/* ---------- Night (29 Nov 2026) ----------
   Loopweek after dark, from her archive's forest green. Every rule here starts with [data-theme="night"], set by
   theme.js before the page is drawn, so the light app is untouched. Not an inversion: near-black green pages, cards a
   step lighter, ivory text, accents softened so they don't vibrate, black buttons become ivory ones. Share posters,
   certificates and envelopes stay paper: they're objects, made to be posted or kept. */

:root[data-theme="night"] {
  color-scheme: dark;
  --paper: #0f1c17; --card: #172921; --paper-2: #1d332a;
  --ink: #eee6d6; --ink-2: #b4bfb1;
  --rule: rgba(238, 230, 214, .12); --rule-2: rgba(238, 230, 214, .26);
  --forest: #eee6d6; --forest-2: #ffffff; --on-forest: #0f1c17;
  --sun-deep: #0a1410; --dusk: #0a1410; --on-dusk: #eee6d6; --on-dusk-2: #9fb0a4;
  --gold: #c9a55a; --gold-2: #c9a55a; --gold-lt: #d9bd7e;
  --live: #7fc08e;
  --accent: #e0806a; --accent-w: #33231e;
}
:root[data-theme="night"][data-palette="ink"] {
  --paper: #121116; --card: #1c1b21; --paper-2: #24232a; --ink: #edebf0; --ink-2: #aaa6b0;
  --rule: rgba(237, 235, 240, .12); --rule-2: rgba(237, 235, 240, .26); --forest: #edebf0; --forest-2: #ffffff; --on-forest: #121116; --dusk: #0c0b0f; --sun-deep: #0c0b0f;
}
:root[data-theme="night"][data-palette="dusk"] {
  --paper: #17120f; --card: #221a15; --paper-2: #2b211b; --ink: #f2e6d6; --ink-2: #c2b3a2;
  --rule: rgba(242, 230, 214, .12); --rule-2: rgba(242, 230, 214, .26); --forest: #f2e6d6; --forest-2: #ffffff; --on-forest: #17120f; --dusk: #100c0a; --sun-deep: #100c0a;
}
html[data-theme="night"], html[data-theme="night"] body { background: var(--paper); }

/* each tab keeps its color, softened for the dark */
html[data-theme="night"][data-tone="home"] { --accent: #e0806a; --accent-w: color-mix(in srgb, #e0806a 18%, var(--card)); }
html[data-theme="night"][data-tone="week"] { --accent: #ad97e3; --accent-w: color-mix(in srgb, #ad97e3 18%, var(--card)); }
html[data-theme="night"][data-tone="vision"] { --accent: #ad97e3; --accent-w: color-mix(in srgb, #ad97e3 18%, var(--card)); }
html[data-theme="night"][data-tone="discover"] { --accent: #5bbcb8; --accent-w: color-mix(in srgb, #5bbcb8 18%, var(--card)); }
html[data-theme="night"][data-tone="todo"] { --accent: #e5839f; --accent-w: color-mix(in srgb, #e5839f 18%, var(--card)); }

/* each kind of thing keeps its color too */
[data-theme="night"] .tone-move { --tc: #e0806a; --tw: color-mix(in srgb, #e0806a 20%, var(--card)); }
[data-theme="night"] .tone-learn { --tc: #86a2ec; --tw: color-mix(in srgb, #86a2ec 20%, var(--card)); }
[data-theme="night"] .tone-night { --tc: #ad97e3; --tw: color-mix(in srgb, #ad97e3 20%, var(--card)); }
[data-theme="night"] .tone-culture { --tc: #8fa9cc; --tw: color-mix(in srgb, #8fa9cc 20%, var(--card)); }
[data-theme="night"] .tone-outside { --tc: #5bbcb8; --tw: color-mix(in srgb, #5bbcb8 20%, var(--card)); }
[data-theme="night"] .tone-people { --tc: #e5839f; --tw: color-mix(in srgb, #e5839f 20%, var(--card)); }
[data-theme="night"] .tone-work { --tc: #e39a6e; --tw: color-mix(in srgb, #e39a6e 20%, var(--card)); }
[data-theme="night"] .tone-ink { --tc: #eee6d6; --tw: var(--paper-2); }

/* real photos stay real; a touch dimmer so they don't glare at night */
[data-theme="night"] img:not(.keep-bright) { filter: brightness(.9); }

/* the welcome is a photo at dusk already: its button stays as it is by day */
[data-theme="night"] .welcome .btn.sun { background: #ffffff; color: #17151f; }
[data-theme="night"] .welcome .btn.sun small { color: rgba(23, 21, 31, .75); }

/* color cards (a tile or a cover with no photo of the actual thing): a deeper version of their color, so the white
   words on them stay clear and the page doesn't glow */
[data-theme="night"] .cover { background: color-mix(in srgb, var(--tc, var(--accent)) 52%, #0f1c17); }

/* what is black by day is the archive's forest green by night */
[data-theme="night"] .edcard, [data-theme="night"] .hm-disc:not(.cover), [data-theme="night"] .evg-ph, [data-theme="night"] .cover.tone-ink { background: #193c30; color: #eee6d6; }
[data-theme="night"] .edcard .dk { color: rgba(238, 230, 214, .75); }

/* paper objects stay paper: polaroids (Vision, the Sunday cover, the little one on Home) keep dark ink */
[data-theme="night"] .pol, [data-theme="night"] .hm-pol { --ink: #17151f; --ink-2: #5f5b66; color: #17151f; }

/* a number in a colored circle: dark on the softened colors (an empty ring keeps light ink) */
[data-theme="night"] .wm-num:not(.ring), [data-theme="night"] .wg-ev .wg-t i { color: #0f1c17; }
[data-theme="night"] .wg-ev .wg-t { color: #cfd6c9; }
[data-theme="night"] .wg-d.past { opacity: .7; }

/* warnings and Delete in a red that reads on dark */
[data-theme="night"] .danger, [data-theme="night"] .dclash { color: #f0a090; }
[data-theme="night"] .btn.danger { background: #b4442c; border-color: #b4442c; color: #fff; }

/* the map's credit line */
[data-theme="night"] .wm-dmap .leaflet-control-attribution, [data-theme="night"] .wm-big .leaflet-control-attribution { background: rgba(15, 28, 23, .72); color: #b4bfb1; }

/* if the dark tiles fail, OpenStreetMap is turned grey and dark */
[data-theme="night"] .wm-osm { filter: grayscale(1) invert(1) brightness(.85) contrast(.9); }
/* map pins and home keep a dark ring instead of a white one */
[data-theme="night"] .leaflet-container { background: #1b1f1d; }
[data-theme="night"] .wm-pin.home { background: #eee6d6; color: #0f1c17; }
[data-theme="night"] .wm-pin.prop { background: var(--card); }

/* ---------- Party night (her ask: "a little hard to see things ... I personally love Partiful's UI") ----------
   What Partiful does that makes a dark app easy to read: near-black (not tinted) pages, bright white text in a heavier
   weight, white pill buttons with black words, cards a clear step lighter, and the color carried by bright pictures plus
   a soft glow of color at the top of the screen. Here the glow is each tab's own color. */
:root[data-theme="night"][data-palette="party"] {
  --paper: #0d0d10; --card: #1b1b21; --paper-2: #26262d;
  --ink: #fafafa; --ink-2: #c4c4cc;
  --rule: rgba(255, 255, 255, .11); --rule-2: rgba(255, 255, 255, .24);
  --forest: #ffffff; --forest-2: #ffffff; --on-forest: #0d0d10;
  --dusk: #0d0d10; --sun-deep: #0d0d10; --on-dusk: #fafafa; --on-dusk-2: #c4c4cc;
}
/* bright tab colors (each tab's glow and accents) */
html[data-theme="night"][data-palette="party"][data-tone="home"] { --accent: #ff7a5c; --accent-w: color-mix(in srgb, #ff7a5c 22%, #1b1b21); }
html[data-theme="night"][data-palette="party"][data-tone="week"] { --accent: #b08cff; --accent-w: color-mix(in srgb, #b08cff 22%, #1b1b21); }
html[data-theme="night"][data-palette="party"][data-tone="vision"] { --accent: #b08cff; --accent-w: color-mix(in srgb, #b08cff 22%, #1b1b21); }
html[data-theme="night"][data-palette="party"][data-tone="discover"] { --accent: #3fd0c9; --accent-w: color-mix(in srgb, #3fd0c9 22%, #1b1b21); }
html[data-theme="night"][data-palette="party"][data-tone="todo"] { --accent: #ff6f9c; --accent-w: color-mix(in srgb, #ff6f9c 22%, #1b1b21); }
[data-palette="party"] .tone-move { --tc: #ff7a5c; --tw: color-mix(in srgb, #ff7a5c 22%, #1b1b21); --day: #c8432a; }
[data-palette="party"] .tone-learn { --tc: #7d9bff; --tw: color-mix(in srgb, #7d9bff 22%, #1b1b21); --day: #2f5bd3; }
[data-palette="party"] .tone-night { --tc: #b08cff; --tw: color-mix(in srgb, #b08cff 22%, #1b1b21); --day: #7353c0; }
[data-palette="party"] .tone-culture { --tc: #8fb0e0; --tw: color-mix(in srgb, #8fb0e0 22%, #1b1b21); --day: #3d5a80; }
[data-palette="party"] .tone-outside { --tc: #3fd0c9; --tw: color-mix(in srgb, #3fd0c9 22%, #1b1b21); --day: #0b7476; }
[data-palette="party"] .tone-people { --tc: #ff6f9c; --tw: color-mix(in srgb, #ff6f9c 22%, #1b1b21); --day: #c93b62; }
[data-palette="party"] .tone-work { --tc: #ffa064; --tw: color-mix(in srgb, #ffa064 22%, #1b1b21); --day: #b94a22; }
[data-palette="party"] .tone-ink { --tc: #fafafa; --tw: #26262d; --day: #26262d; }

/* the glow: the tab's color at the top of the screen, fading to black */
[data-theme="night"][data-palette="party"] #app { background: radial-gradient(130% 340px at 50% -60px, color-mix(in srgb, var(--accent) 42%, transparent), transparent 100%) no-repeat, var(--paper); }

/* easier to read: one step heavier everywhere, small text never too faint */
[data-theme="night"][data-palette="party"] body { font-weight: 450; }
[data-theme="night"][data-palette="party"] h1, [data-theme="night"][data-palette="party"] h2, [data-theme="night"][data-palette="party"] h3 { font-weight: 500; }

/* color cards are as bright as by day (Partiful's colors are bright), with white words */
[data-theme="night"][data-palette="party"] .cover { background: var(--day, var(--accent)); }
[data-theme="night"][data-palette="party"] .cover.tone-ink { background: #26262d; }
/* what was black by day: a deep version of the tab's color */
[data-theme="night"][data-palette="party"] .edcard, [data-theme="night"][data-palette="party"] .hm-disc:not(.cover), [data-theme="night"][data-palette="party"] .evg-ph { background: color-mix(in srgb, var(--accent) 34%, #1b1b21); color: #fafafa; }
[data-theme="night"][data-palette="party"] .edcard .dk { color: rgba(250, 250, 250, .78); }
/* the route's dark outline and the home pin */
[data-theme="night"][data-palette="party"] .wm-pin.home { background: #fafafa; color: #0d0d10; }

/* blocks in the strong color with white words fixed in: at night the strong color is light, so the words go dark */
[data-theme="night"] .why-pop, [data-theme="night"] .lhome.is-arrived, [data-theme="night"] .wm-mode[aria-pressed="true"],
[data-theme="night"] .gv-letters span.on, [data-theme="night"] .gv-check li.on .gv-cl { color: var(--on-forest); }

/* Assist (the side chat, live 29 Nov): its white card, white typing box and light green blocks go dark at night */
[data-theme="night"] .as-card { background: var(--paper-2); border-color: color-mix(in srgb, var(--ink) 38%, transparent); }
[data-theme="night"] .as-form textarea { background: var(--paper); }
[data-theme="night"] .as-btn.ink { color: var(--paper); }
[data-theme="night"] .as-row.no small { color: #f0a090; }
[data-theme="night"] .as-game, [data-theme="night"] .as-listen { background: var(--paper-2); }

/* the Board, tidier (29 Nov 2026): Beat the clock's row, the Get unstuck tiles, and the reds of erase and a deadline.
   The tiles were cream with ivory words at night; they take a dark wash of their own color instead. */
[data-theme="night"] .gm-cp, [data-theme="night"] .gm-cgo, [data-theme="night"] .gm-ckeep[aria-pressed="true"] { background: #8fc79c; color: #0f1c17; }
[data-theme="night"] .gm-c[aria-pressed="true"] { background: var(--card); box-shadow: 0 0 0 1px var(--rule-2); }
[data-theme="night"] .gm-mini, [data-theme="night"] .gm-tile { --tb: color-mix(in srgb, var(--t) 28%, var(--card)); color: var(--ink); }
[data-theme="night"] .bd-due.is-now, [data-theme="night"] .bd-x:hover, [data-theme="night"] .bd-card.is-swiping::after, [data-theme="night"] .bs-act .bd-erase { color: #f0a090; }
[data-theme="night"] .mcal i.k-due { background: #f0a090; }
[data-theme="night"] .bd-x { box-shadow: 0 0 0 1px var(--rule-2); }

/* Discover's cards: the pills and round buttons sit on the dark like the rest */
[data-theme="night"] .dpill.on { background: #ffffff; border-color: #ffffff; color: #17151f; }
[data-theme="night"] .dc-under { box-shadow: none; }
[data-theme="night"] .dc-b { box-shadow: none; }
/* the Board, round two: the deadline flag, the wheel */
[data-theme="night"] .bd-due { background: color-mix(in srgb, #f0a090 16%, var(--card)); color: #f6c3b8; }
[data-theme="night"] .bd-due .ic, [data-theme="night"] .bw-due > span .ic, [data-theme="night"] .wm-due { color: #f0a090; }
[data-theme="night"] .bd-due.is-now { background: #f0a090; color: #0f1c17; }
[data-theme="night"] .bd-due.is-now .ic { color: #0f1c17; }
[data-theme="night"] .wh::before { box-shadow: 0 0 0 1px var(--rule-2); }
/* a goal being dragged keeps the dark card, not the light one (29 Nov 2026) */
[data-theme="night"] .gl.dragging { background: var(--card); }
/* a card's calendar and deadline (29 Nov 2026): the reds soften, the picked day and the placed card turn white, never green */
[data-theme="night"] .bw-due .ic, [data-theme="night"] .bwp-chip.is-flag .ic, [data-theme="night"] .bwp-mk .ic.f { color: #f0a090; }
[data-theme="night"] .bwp-chip.is-flag, [data-theme="night"] .bw-pill.bw-due .bw-set { color: #f6c3b8; }
[data-theme="night"] .bw-pill.bw-due { border-color: color-mix(in srgb, #f0a090 45%, var(--card)); }
[data-theme="night"] .bwp-d.is-sel, [data-theme="night"] .bwp-me { background: #f4efe6; color: #111014; }
[data-theme="night"] .bwp-d.is-sel small { color: rgba(17, 16, 20, .7); }
[data-theme="night"] .bwp-d.is-sel .bwp-mk u { outline-color: #111014; }
[data-theme="night"] .bwp-h.is-over, [data-theme="night"] .bwp-d.is-over { background: color-mix(in srgb, #f4efe6 14%, var(--card)); box-shadow: inset 0 0 0 2px #f4efe6; }
[data-theme="night"] .bwp-h.is-over.is-half { background: linear-gradient(to bottom, transparent 50%, color-mix(in srgb, #f4efe6 14%, var(--card)) 50%); }
[data-theme="night"] .bw-pick.is-due .bwp-d[aria-pressed="true"], [data-theme="night"] .bw-pick.is-due .bwp-d.is-over { background: color-mix(in srgb, #f0a090 18%, var(--card)); box-shadow: inset 0 0 0 1.5px #f0a090; }
[data-theme="night"] .bd-brk .gm-ic { color: #e5839f; }
[data-theme="night"] .bwp-due { background: color-mix(in srgb, #f0a090 18%, var(--card)); color: #f6c3b8; }
[data-theme="night"] .bwp-due .ic { color: #f0a090; }
[data-theme="night"] .bwp-due.is-quiet { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, #f0a090 45%, var(--card)); }
[data-theme="night"] .bw-pick.is-due .bwp-d.is-sel { background: #f0a090; color: #111014; }
[data-theme="night"] .bw-pick.is-due .bwp-h.is-over { background: color-mix(in srgb, #f0a090 18%, var(--card)); box-shadow: inset 0 0 0 2px #f0a090; }
[data-theme="night"] .bwp-d.is-sel .bwp-mk .ic.f { color: #8d1f19; }
[data-theme="night"] .bwp-f input { color-scheme: dark; }
[data-theme="night"] .bw-pick.is-due .bwp-f .ic { color: #f0a090; }


[data-theme="night"] .hm-grid > .hm.hm-disc { background: var(--card); color: var(--ink); }
[data-theme="night"] .hm-grid > .hm.hm-disc .hm-n { color: var(--ink); }
[data-theme="night"] .bd-tally { background: var(--card); }
[data-theme="night"] .tl-step { background: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
[data-theme="night"] .gp-doc { --page: var(--card); box-shadow: 0 0 0 1px var(--rule); }
[data-theme="night"] .gp-dots i.on, [data-theme="night"] .gp-sq i.on, [data-theme="night"] .gp-ms .gp-dia { background: #f4efe6; color: #111014; }
[data-theme="night"] .gp-ms .gp-dia.open { background: none; box-shadow: inset 0 0 0 2px #f4efe6; }
[data-theme="night"] .gp-pk { color: var(--forest); }
[data-theme="night"] .gp-ctx textarea { color-scheme: dark; }
[data-theme="night"] .gp-x:hover, [data-theme="night"] .gp-x:focus-visible { color: #f0a090; }

/* the goal ladder at night: the soft blocks go dark, the words stay light */
[data-theme="night"] .gsmall { background: color-mix(in srgb, #e5839f 18%, var(--card)); }
[data-theme="night"] .lad-bd { color: #e5839f; }
[data-theme="night"] .bd-goal { color: #ad97e3; }
/* the vision board at night (30 Nov 2026): the colors are lighter here, so the words on them are dark; no pale inner frame */
[data-theme="night"] .vposter { box-shadow: none; }
[data-theme="night"] .vp-t.words .vp-a, [data-theme="night"] .vpic-none { color: #141218; }
[data-theme="night"] .vp-t.words.tone-ink .vp-a, [data-theme="night"] .vpic-none.tone-ink { color: #141218; }
[data-theme="night"] .vp-add { background: rgba(20, 18, 24, .55); color: #fff; }
[data-theme="night"] .vp-t.ph .vp-a, [data-theme="night"] .vp-t.ph .vp-w { background: #f4efe6; color: #141218; }
/* the collage's quote cards at night: the item color, dimmed, with light words */
[data-theme="night"] .vc-q { background: color-mix(in srgb, var(--tc, #888) 24%, var(--card)); color: var(--ink); }
[data-theme="night"] .gp-duet .ic, [data-theme="night"] .gp-duemiss .ic { color: #f0a090; }
[data-theme="night"] .apple-btn { background: #fff; color: #000; border-color: #fff; }
