/* Mobile-first, simple, gentle. Light (default) or Dark (data-mode="dark", spec F-21).
   Three palettes (data-theme): blossom, sage, sky — each in Light and Dark. Colors only through variables.
   Colors mean: --me = your time, --other = the other parent's time. Only TWO parent colors per palette
   (spec F-04b): "together" is drawn with both of them — split in two, MY color always on top
   (across the time line: top/bottom in the month bar, left/right in the 3-day grid).
   Each palette has two parent colors --c1 (blue-ish) and --c2 (peach-ish); --me/--other take them
   as they are, or swapped when "Swap colors" is on (data-swap="on", spec F-19) — everywhere at once. */
:root, [data-theme="blossom"] {
  /* v35 (Q6, the owner: "raise the contrast"): --muted darker (≥ 4.5:1 on page and cards), text on the pastel
     accent buttons dark instead of white (≥ 4.5:1) — the palette colors themselves stay */
  --bg: #FBF7F4; --card: #FFFFFF; --ink: #3E3A4A; --muted: #6E6979; --line: #F0E8E3;
  --accent: #E58FA5; --accent-ink: #3A1E28; --accent-soft: #FCE9EE;
  --c1: #4589D2; --c1-soft: #E3F0FF; --c2: #F9A870; --c2-soft: #FEEADD;
  --none: #F1ECE8; --ok: #6CBF9C; --ok-soft: #E4F5EC; --warn: #E3AE4A; --warn-soft: #FBF1DC; --no: #D98282;
  --flag: #C93A48; --flag-ink: #FFFFFF; --alert: #C85C5C; --alert-soft: #FBE3E3; --alert-mid: #F7D0D0; --alert-ink: #9A3340;
}
[data-theme="sage"] {
  --bg: #F6F7F2; --card: #FFFFFF; --ink: #36423B; --muted: #5F6B63; --line: #E6EAE1;
  --accent: #6FA287; --accent-ink: #10251A; --accent-soft: #E5F0E9;
  --c1: #2D9570; --c1-soft: #D7F8E8; --c2: #F79E75; --c2-soft: #FEEAE0;
  --none: #ECEEE7; --ok: #5FAF88; --ok-soft: #E2F2E9; --warn: #D9A548; --warn-soft: #F8EED8; --no: #D08080;
  --flag: #C93A48; --flag-ink: #FFFFFF; --alert: #C85C5C; --alert-soft: #F9E4E2; --alert-mid: #F5D1CD; --alert-ink: #93353D;
}
[data-theme="sky"] {
  --bg: #F4F7FB; --card: #FFFFFF; --ink: #343F57; --muted: #5F6982; --line: #E4E9F2;
  --accent: #7B97EE; --accent-ink: #141C3A; --accent-soft: #E8EEFD;
  --c1: #2892CF; --c1-soft: #E0F1FF; --c2: #F493AA; --c2-soft: #FFE8EC;
  --none: #ECEFF5; --ok: #63BA98; --ok-soft: #E2F4EC; --warn: #DDAA4C; --warn-soft: #F9EFD9; --no: #D7838F;
  --flag: #C93A48; --flag-ink: #FFFFFF; --alert: #C85C5C; --alert-soft: #F8E3E6; --alert-mid: #F4CFD5; --alert-ink: #963848;
}
:root { --me: var(--c1); --me-soft: var(--c1-soft); --other: var(--c2); --other-soft: var(--c2-soft);
  /* v36 holiday colors — the SAME in all palettes (not a parent color, not the red "!"): violet = public holiday,
     ochre = school holidays (tools/contrast.js checks them) */
  --hol: #6E45C8; --sch: #9C7A00; }
:root[data-swap="on"] { --me: var(--c2); --me-soft: var(--c2-soft); --other: var(--c1); --other-soft: var(--c1-soft); }
:root { --radius: 18px; --shadow: 0 1px 2px rgba(60, 40, 60, .04), 0 6px 18px rgba(60, 40, 60, .05);
  --font: ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color-scheme: light;
  /* light values of everything that is not a palette color (Dark overrides them below) */
  --field-focus: #fff; --picker-bg: #fff; --hatch-gap: #fff; --off: #B9B3BF; --queued: #C9C3CF;
  --tick: rgba(255, 255, 255, .85); --strike: rgba(0, 0, 0, .25); --scrim: rgba(60, 50, 70, .22);
  --tabs-bg: rgba(255, 255, 255, .92); --toast-bg: var(--ink); --toast-ink: #fff; --ok-ink: #fff; --badge-ink: #fff;
  --fab-shadow: 0 8px 20px rgba(0, 0, 0, .14); }

/* ---- Dark (spec F-21): the same three palettes, by analogy with Light. Background — deep and slightly
   tinted with the palette (not black), text — soft light (not pure white), parent colors — the same hues,
   a bit calmer; "soft" fills — dark tints. Text contrast >= 7:1, secondary text >= 4.5:1 (tests S-22). */
:root[data-mode="dark"] { color-scheme: dark; --hol: #BCA2FF; --sch: #DCDC50;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 18px rgba(0, 0, 0, .22);
  --off: #6E6876; --queued: #5E5866; --strike: rgba(255, 255, 255, .35); --scrim: rgba(8, 6, 12, .55);
  --toast-bg: #F1ECF3; --toast-ink: #24202A; --fab-shadow: 0 8px 20px rgba(0, 0, 0, .4);
  --field-focus: var(--card); --picker-bg: var(--card); --hatch-gap: var(--card); --tick: var(--card);
  --ok-ink: var(--card); --badge-ink: var(--accent-ink);
}
:root[data-mode="dark"], :root[data-mode="dark"][data-theme="blossom"] {
  --bg: #1D1A21; --card: #28242D; --ink: #EEE8EE; --muted: #A9A1B0; --line: #3A343F;
  --accent: #E99BB0; --accent-ink: #2B1820; --accent-soft: #46303A;
  --c1: #5296DF; --c1-soft: #243951; --c2: #FCBA89; --c2-soft: #4B311D;
  --none: #332E38; --ok: #7CC9A8; --ok-soft: #233B32; --warn: #E6B862; --warn-soft: #403524; --no: #E89393;
  --flag: #FF7B86; --flag-ink: #3A0A12; --alert: #FF8E8E; --alert-soft: #4A2A30; --alert-mid: #5E3039; --alert-ink: #FFD8DC;
  --tabs-bg: rgba(40, 36, 45, .92);
}
:root[data-mode="dark"][data-theme="sage"] {
  --bg: #1A1E1B; --card: #232925; --ink: #E7EDE8; --muted: #9DA9A0; --line: #333B35;
  --accent: #84BC9D; --accent-ink: #13231A; --accent-soft: #2B3E33;
  --c1: #36A980; --c1-soft: #1C4031; --c2: #FDB48C; --c2-soft: #4D3020;
  --none: #2D332F; --ok: #72C29A; --ok-soft: #213930; --warn: #DDB05A; --warn-soft: #3C3422; --no: #E19393;
  --flag: #FF7B86; --flag-ink: #3A0A12; --alert: #FF8E8E; --alert-soft: #46292B; --alert-mid: #5A2F33; --alert-ink: #FFD9D9;
  --tabs-bg: rgba(35, 41, 37, .92);
}
:root[data-mode="dark"][data-theme="sky"] {
  --bg: #181C25; --card: #212733; --ink: #E7EBF4; --muted: #9CA5B8; --line: #323B4C;
  --accent: #93ACF4; --accent-ink: #141B33; --accent-soft: #2C3653;
  --c1: #449ED7; --c1-soft: #1E3B4F; --c2: #FEADBF; --c2-soft: #4E2D34;
  --none: #2B313D; --ok: #74C6A4; --ok-soft: #213B34; --warn: #E0B55E; --warn-soft: #3D3525; --no: #E6969F;
  --flag: #FF7B86; --flag-ink: #3A0A12; --alert: #FF8E8E; --alert-soft: #452A33; --alert-mid: #59303E; --alert-ink: #FFD8DE;
  --tabs-bg: rgba(33, 39, 51, .92);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app { max-width: 520px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 8px) 16px 120px; }
body:not(.inapp) .app { padding-bottom: 32px; }
h1 { font-size: 26px; margin: 8px 0 6px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0; font-weight: 700; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 4px 8px; font-weight: 700; }
p { line-height: 1.45; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.i { vertical-align: -3px; flex: none; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.center { text-align: center; padding-top: 6vh; }
.center .card { text-align: left; margin: 16px 0; }
.page { padding-top: 4px; }
.logo { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); overflow: hidden; }
.logo img { width: 64px; height: 64px; display: block; }
.back { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-size: 14px; margin: 6px 0; }

/* forms */
label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 14px; }
input, select { display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 14px; background-color: var(--bg); outline: none; font-size: 16px; }
input:focus, select:focus { border-color: var(--accent); background-color: var(--field-focus); }
/* v37 App feedback: the text box and the feed (text kept as typed: new lines by CSS, never as HTML) */
textarea { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background-color: var(--bg); outline: none; font: inherit; font-size: 16px; color: inherit; resize: vertical; min-height: 96px; }
textarea:focus { border-color: var(--accent); background-color: var(--field-focus); }
.fbrow { align-items: center; color: var(--ink); }
.fbrow svg { flex: none; color: var(--accent-ink, var(--ink)); }
.fbfeed { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.fbmsg { align-self: flex-end; max-width: 88%; background: var(--accent-soft); border-radius: 16px 16px 4px 16px; padding: 10px 12px; }
.fbmsg.dev { align-self: flex-start; background: var(--card); border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow); }
.fbmsg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fbmsg small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
/* Drop-downs: OUR arrow, the same in Safari / iPhone / Chrome / Android (v25; the owner: the browser's arrow
   "sticks to the right edge as if it slid off"). The browser's own is switched off; a small chevron drawn
   with two gradients in the palette's muted color sits at an even distance from the edge, the text keeps
   clear of it. */
select { -webkit-appearance: none; appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select::-ms-expand { display: none; }
/* the small hour / minute columns: the number centered, the chevron close and even */
.tpick select { padding: 13px 26px 13px 12px; background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; }
/* date: OUR calendar icon (v26; the owner: the browser's icon became invisible / ugly after v25), drawn in the
   palette's muted tone at the same even distance as the chevrons — the same on every browser, also on iPhone
   (where Safari shows no icon at all). The browser's own picker button stays as an invisible tap area on top. */
:root { --cal-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23948FA0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
:root[data-mode="dark"] { --cal-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23A9A1B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
input[type=date] { -webkit-appearance: none; appearance: none; position: relative; min-height: 50px; text-align: left; padding-right: 40px;
  background-image: var(--cal-icon); background-repeat: no-repeat; background-position: calc(100% - 13px) 50%; background-size: 18px 18px; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
input[type=date]::-webkit-calendar-picker-indicator { position: absolute; right: 0; top: 0; width: 44px; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
#kids input { margin-bottom: 8px; }
input.code { font-size: 24px; letter-spacing: .2em; text-align: center; font-weight: 700; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; } legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 8px; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
/* time: date + hours column + minutes column (00/15/30/45); the readable line below says the full date */
.trow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.trow label { margin-bottom: 0; }
/* v48 Repeat + Until side by side (Until only when repeating) */
.trow.rep { grid-template-columns: 1fr 1fr; margin: 12px 0 14px; }
.trow.rep .until[hidden] { display: none; }
.scopeacts { flex-direction: column; align-items: stretch; }
.repnext { display: block; margin-top: 4px; color: var(--muted); }
.tpick { display: inline-flex; align-items: center; gap: 4px; }
.tpick select { width: auto; min-width: 70px; min-height: 50px; margin-top: 0; text-align: center; text-align-last: center; }
.trow input[type=date] { margin-top: 6px; }
.tpick b { color: var(--muted); }
.when { display: block; margin: 4px 2px 14px; font-size: 13px; color: var(--ink); font-weight: 600; }
.when.bad { color: var(--no); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { margin: 0; } .opt input { display: none; }
.opt span { display: inline-block; padding: 10px 16px; border-radius: 999px; background: var(--bg); border: 1.5px solid var(--line); color: var(--ink); font-weight: 600; font-size: 15px; }
.opt.me input:checked + span { background: var(--me-soft); border-color: var(--me); }
.opt.other input:checked + span { background: var(--other-soft); border-color: var(--other); }
.opt.both input:checked + span { background: linear-gradient(var(--me-soft) 50%, var(--other-soft) 50%); border-color: var(--muted); }
.opt.kid input:checked + span { background: var(--accent-soft); border-color: var(--accent); }
.formerr { color: var(--no); font-size: 14px; min-height: 0; margin: 4px 0; }
.formerr:empty { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border-radius: 14px; border: 0; background: var(--bg); font-weight: 650; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.ok { background: var(--ok); color: var(--ok-ink); box-shadow: none; }
.btn.soft { background: var(--bg); }
.btn.danger { color: var(--no); }
/* v50 (the owner): stacked buttons (Account: log out here / everywhere) with a normal gap, not glued together */
.btnstack { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
/* a switch list that opens its card (Holidays) has no empty top and no line above it */
.card > .ngroups:first-child { margin-top: 0; border-top: 0; }
.card > .ngroups:first-child > .nrow:first-child { padding-top: 0; }
.btn.wide { width: 100%; margin-top: 8px; padding: 15px; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 10px 4px; display: inline-flex; gap: 4px; align-items: center; }
.iconbtn { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--muted); flex: none; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.bigchoice { display: block; margin: 12px 0; } .bigchoice b { display: block; font-size: 17px; } .bigchoice small { color: var(--muted); }
.bigcode { font-size: 30px; font-weight: 800; letter-spacing: .12em; text-align: center; padding: 10px 0 4px; color: var(--accent); }

/* status line */
header { min-height: 8px; }
.statusline { display: flex; align-items: center; gap: 8px; margin: 2px auto 6px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.on { background: var(--ok); } .dot.off { background: var(--off); } .dot.sync { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.tznote { font-size: 12px; color: var(--muted); text-align: center; margin-top: -2px; }
/* not updated (no connection / server did not answer, F-13): the line gently blinks red in the palette's
   tones — the text stays readable at every moment of the blink (checked: --alert-ink on --alert-soft and --alert-mid) */
.statusline.alert { background: var(--alert-soft); color: var(--alert-ink); box-shadow: inset 0 0 0 1.5px var(--alert); animation: alertblink 1.6s ease-in-out infinite; font-weight: 600; }
.statusline.alert .dot { background: var(--alert); }
@keyframes alertblink { 50% { background: var(--alert-mid); box-shadow: inset 0 0 0 1.5px transparent; } }
@media (prefers-reduced-motion: reduce) { .statusline.alert { animation: none; } }
.notice { display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--warn-soft); border-radius: 14px; padding: 10px 12px; font-size: 14px; margin: 6px 0; }
/* F-16: deleted calendar (read only) banner and "the other parent deleted a calendar" messages */
.notice.frozen, .notice.msg { justify-content: flex-start; align-items: flex-start; background: var(--alert-soft); color: var(--alert-ink); }
.notice.frozen .i, .notice.msg .i { margin-top: 2px; }
.notice.msg a { text-decoration: underline; font-weight: 650; }
/* "Deleted calendars" unfold below on the same screen: the same cards, another look — indented, on the page
   color with a dashed outline, a muted text and the "Deleted … — read only" line */
.delbtn { width: 100%; text-align: left; border: 0; }
.delbtn b { display: flex; align-items: center; gap: 6px; } .delbtn .chev { margin-left: auto; color: var(--muted); }
.deletedlist { margin: -4px 0 12px 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.calcard.deleted { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); border: 0; }
.calcard.deleted .kids, .calcard.deleted .with { color: var(--muted); }
.calcard.deleted .delnote { color: var(--alert-ink); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.calcard .link.danger { padding: 4px 0; }

/* calendar toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.seg { display: inline-flex; background: var(--card); border-radius: 14px; padding: 4px; box-shadow: var(--shadow); }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font-weight: 650; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--accent-soft); color: var(--ink); }
.chip { border: 0; border-radius: 999px; padding: 9px 14px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; color: var(--muted); }
.chip.on { background: var(--me-soft); color: var(--ink); }
.navrow { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; }
.navrow h2 { flex: 1; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: 4px 2px 10px; }
.legend .sw { display: inline-block; width: 16px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }

/* colors of time */
.me { --c: var(--me); --cs: var(--me-soft); } .other { --c: var(--other); --cs: var(--other-soft); } .both { --c: var(--me); --cs: var(--me-soft); }
.sw, .strip b, .bar { background: var(--c); }
.hatched.sw, .strip b.hatched, .bar.hatched { background: repeating-linear-gradient(135deg, var(--c) 0 3px, transparent 3px 6px); }
/* together: split in two, my color on top */
.sw.both, .strip b.both, .bar.both { background: linear-gradient(var(--me) 50%, var(--other) 50%); }
.sw.both.hatched, .strip b.both.hatched, .bar.both.hatched {
  background: repeating-linear-gradient(135deg, var(--me) 0 3px, transparent 3px 4.5px, var(--other) 4.5px 7.5px, transparent 7.5px 9px); }
.legend .sw.both, .keylist .sw.both:not(.wide) { border-radius: 50%; }
.legend .sw.both { width: 11px; height: 11px; vertical-align: -1px; }
.legend .sw.faded, .keystates .sw.faded { opacity: .38; }
/* v42: the three states of each color in "What the colors and signs mean" — a small table */
.keystates { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 8px 10px; align-items: center; justify-items: center;
  font-size: 12px; color: var(--muted); padding: 4px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.keystates > span { justify-self: start; color: var(--ink); font-size: 13px; }
.keystates > b { font-weight: 600; text-align: center; align-self: end; }
.keystates .sw { display: block; width: 34px; height: 12px; border-radius: 4px; }
.keylist .sw.both:not(.wide) { width: 18px; height: 18px; }
.strip b.faded, .bar.faded { opacity: .38; }
.bar.queued { background: repeating-linear-gradient(135deg, var(--queued) 0 3px, transparent 3px 6px); }

/* month */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 8px 6px 10px; gap: 4px; }
.dow { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; padding: 2px 0 6px; }
/* every day is its own soft tile (the owner: days must not melt into the month card): the page color as the tile
   on the card + a light outline in the palette's line color; Light and Dark, every palette (checked in 1b) */
.day { --tile: var(--bg); border: 1px solid var(--line); background: var(--tile); padding: 4px 3px 5px; border-radius: 12px;
  display: flex; flex-direction: column; gap: 3px; min-height: 60px; position: relative; text-align: left; }
/* the head of a day: the number and RIGHT next to it the dot (F-04c) — they read as one; the "!" flashes on
   the dot's place, on top of it */
.dhead { display: flex; align-items: center; gap: 2px; min-height: 24px; }
/* v36 holidays: public = number in violet + tiny ✦; school = thin ochre band along the bottom edge of the day,
   consecutive days join into one band (the band runs under the gap between tiles, rounded at its ends) */
.day.hol .num, .wrow.hol .num { color: var(--hol); }
.day.today.hol .num, .wrow.today.hol .num { color: var(--accent-ink); }
.hmark { color: var(--hol); line-height: 0; margin: -12px 0 0 -3px; flex: none; }
.star { width: 9px; height: 9px; display: inline-block; vertical-align: 0; }
.lg-hol .star, .holline .star { width: 11px; height: 11px; vertical-align: -1px; }
.keyhol .star { width: 10px; height: 10px; vertical-align: 4px; margin-left: 1px; }
/* v37 (the owner: the band in the GAP between tile rows "belongs to nothing"): the band sits INSIDE the tile — its
   bottom on the tile's own bottom edge (over the 1px border), 3px high; between consecutive days it runs straight
   across the 4px gap at the same level; at the ENDS of a range it bends up along the tile's rounded corner
   (3px bottom + side border on a 14px box with the tile's 12px corner) — a range reads like an underline that
   hugs its days. Mondays / Sundays: no overhang outside the card. */
.day.sch::after { content: ''; position: absolute; box-sizing: border-box; left: -5px; right: -5px; bottom: -1px; height: 3px;
  background: var(--sch); pointer-events: none; z-index: 3; }   /* v42: always above the today / selected frame */
/* v38 (the owner: the ends must TAPER, "like it once looked in Week"): along the corner curve the line goes from 3px
   (bottom) to 1px (side) — the browser blends the two border widths along the radius — and the tip fades out */
.day.sch.schs::after, .day.sch.sche::after { height: 14px; background: transparent; border-bottom: 3px solid var(--sch);
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent); mask-image: linear-gradient(to top, #000 55%, transparent); }
.day.sch.schs::after { left: -1px; border-left: 1px solid var(--sch); border-bottom-left-radius: 12px; }
.day.sch.sche::after { right: -1px; border-right: 1px solid var(--sch); border-bottom-right-radius: 12px; }
.month .day:nth-child(7n + 1).sch::after { left: -1px; }   /* Mondays: the band does not run off the card */
.month .day:nth-child(7n).sch::after { right: -1px; }      /* Sundays */
/* Week: each day is its own row — the band hugs the row's bottom with both rounded corners */
.wrow { position: relative; }
.wrow.sch::after, .wrow.hol::before { z-index: 3; }   /* v42: above the selected row's frame */
.wrow.sch::after { content: ''; position: absolute; box-sizing: border-box; left: -1px; right: -1px; bottom: -1px; height: 14px;
  border: 1px solid var(--sch); border-bottom-width: 3px; border-top: 0; border-radius: 0 0 12px 12px; pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent); mask-image: linear-gradient(to top, #000 55%, transparent); }
/* v42 (the owner): PUBLIC holidays = the mirror of the school band, along the TOP of the day in violet (--hol): its top on
   the tile's top edge, consecutive days join across the gap, the ends bend DOWN along the rounded top corners and
   taper 3px -> 1px with a fading tip. Uses ::before (the school band is ::after) — a day can have both. */
.day.hol { position: relative; }
.day.hol::before { content: ''; position: absolute; box-sizing: border-box; left: -5px; right: -5px; top: -1px; height: 3px;
  background: var(--hol); pointer-events: none; z-index: 3; }   /* always above the today / selected frame */
.day.hol.hols::before, .day.hol.hole::before { height: 14px; background: transparent; border-top: 3px solid var(--hol);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.day.hol.hols::before { left: -1px; border-left: 1px solid var(--hol); border-top-left-radius: 12px; }
.day.hol.hole::before { right: -1px; border-right: 1px solid var(--hol); border-top-right-radius: 12px; }
.month .day:nth-child(7n + 1).hol::before { left: -1px; }
.month .day:nth-child(7n).hol::before { right: -1px; }
.wrow.hol::before { content: ''; position: absolute; box-sizing: border-box; left: -1px; right: -1px; top: -1px; height: 14px;
  border: 1px solid var(--hol); border-top-width: 3px; border-bottom: 0; border-radius: 12px 12px 0 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.holtop, .keyhtop { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--hol); margin-right: 5px; vertical-align: 6px; }
.keyhtop { width: 22px; margin: 0 0 0 4px; vertical-align: 8px; }
.keyhol { color: var(--hol); font-size: 13px; }
.keysch { display: inline-block; width: 22px; height: 3px; border-radius: 2px; background: var(--sch); }
.lg-hol b { color: var(--hol); font-size: 11px; margin-right: 4px; }
.lg-sch i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--sch); margin-right: 5px; vertical-align: 2px; }
.holline { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -2px 0 8px; font-size: 13px; font-weight: 600; }
.holline .hp { color: var(--hol); }
.holline .hs { color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.holline .hs i { width: 16px; height: 3px; border-radius: 2px; background: var(--sch); }
.dslot { position: relative; width: 14px; height: 14px; flex: none; }
.ddot { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--tile); }
.day .num { font-size: 13px; font-weight: 650; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; margin-left: -1px; }
.day.out { opacity: .4; }
:root[data-mode="dark"] .day.out { opacity: .55; }  /* on dark, .4 turns the colors muddy */
.day.today .num { background: var(--accent); color: var(--accent-ink); }
.day.sel { --tile: var(--accent-soft); border-color: var(--accent); }
/* mark "!" — this day has an open request (new event, change or cancel): ONE kind of mark, a filled red
   round badge with a ring of the card color (spec F-04; contrast checked by tools/contrast.js) */
.mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--flag); color: var(--flag-ink);
  font-size: 13px; font-weight: 900; line-height: 1; box-shadow: 0 0 0 2px var(--card); }
.mark .i { vertical-align: 0; }
.day .mark, .wrow .mark { position: absolute; top: -2px; left: -2px; z-index: 1; box-shadow: 0 0 0 2px var(--tile); }   /* v39: Week like Month — the "!" centred on the day's dot */
/* "!" flashes over the day's dot (the owner): 3 s cycle — 1 s not there at all (the day as it is), then 2 s
   of a LINEAR rise and fall (1 s up, 1 s down) */
.mark.pulse { animation: markpulse 3s linear infinite; }
@keyframes markpulse {
  0%, 33.333% { opacity: 0; }
  66.667% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .mark.pulse { animation: none; } }
.strip { position: relative; height: 12px; border-radius: 6px; background: var(--none); overflow: hidden; display: block; }
.strip.thin { height: 5px; background: none; border-radius: 3px; }
.strip b { position: absolute; top: 0; bottom: 0; }
.strip i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--tick); }
.strip .t6 { left: 25%; } .strip .t12 { left: 50%; } .strip .t18 { left: 75%; }
.striphint { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); padding: 4px 10px 0; }

/* lists */
.daylist { margin-top: 14px; padding: 14px 14px 6px; } .daylist h3 { margin: 0 0 6px; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); }
/* a day was tapped: its event card blinks softly TWICE (accent tint + accent ring), then it is as before */
.daylist.flash { animation: dayflash .6s ease-in-out 2; }
@keyframes dayflash { 50% { background: var(--accent-soft); box-shadow: var(--shadow), 0 0 0 3px var(--accent); } }
@media (prefers-reduced-motion: reduce) { .daylist.flash { animation: none; } }
.list { padding: 4px 0; }
.row { display: flex; gap: 12px; align-items: stretch; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.bar { width: 6px; border-radius: 3px; flex: none; }
.rowtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rowtext b { font-weight: 650; }
.rowtext small { color: var(--muted); font-size: 13px; }
.tag { font-size: 11px; font-weight: 700; color: var(--warn); margin-left: 4px; }
.st-ok { color: var(--ok) !important; } .st-ask { color: var(--accent) !important; font-weight: 650; } .st-wait { color: var(--warn) !important; } .st-no { color: var(--no) !important; }

/* WEEK (v27): 7 rows Mon…Sun, each a horizontal 0–24 h line. Main line = agreed only (soft color + colored
   edge, the title when there is room; pale = a change is asked); thin line below = suggestions (striped) */
.month:not(.demo), .week { touch-action: pan-y; will-change: transform; }   /* v29: sideways = our swipe, up/down = page scroll */
.week { padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.whours, .wrow { display: grid; grid-template-columns: 58px 1fr; gap: 6px; align-items: center; }
.whours > div { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); padding: 0 1px; }
.wrow { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 5px 6px 5px 4px; --tile: var(--bg); }
.wrow *, .month .day * { pointer-events: none; }   /* (v28) the whole row is the tap target — nothing inside catches the tap */
.wtrack, .wthin { display: block; } .wlines { display: flex; }
.wrow.sel { border-color: var(--accent); background: var(--accent-soft); --tile: var(--accent-soft); }
.wday { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; }
.wdow { font-size: 11px; color: var(--muted); font-weight: 700; padding-left: 2px; }
.wrow .num { font-size: 14px; font-weight: 650; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.wrow.today .num { background: var(--accent); color: var(--accent-ink); }
.wlines { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wtrack { position: relative; height: 34px; border-radius: 9px; background: var(--none); overflow: hidden; }
.wtrack > i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--tick); }
.wtrack .t6 { left: 25%; } .wtrack .t12 { left: 50%; } .wtrack .t18 { left: 75%; }
.wthin { position: relative; height: 7px; }
/* v38 (the owner: "Week looks strange — a vertical stripe and then a horizontal one; it must look EXACTLY like the Month
   strip, just bigger"): the same fills as .strip b — my color solid, the other's solid, together split in the
   middle (mine on top), faded / hatched the same; no colored edges, no soft fill, no text on the color (the titles
   are in the day list below; text on the parents' colors could not keep the readability norm in every palette) */
.wblk { position: absolute; top: 0; bottom: 0; border: 0; padding: 0; overflow: hidden; z-index: 1; background: var(--c); }
.wblk.both { background: linear-gradient(var(--me) 50%, var(--other) 50%); }
.wblk.faded { opacity: .38; }
.wthin .wblk { border-radius: 3px; box-shadow: none; padding: 0; background: repeating-linear-gradient(135deg, var(--c) 0 3px, transparent 3px 6px); }
.wthin .wblk.both { background: repeating-linear-gradient(135deg, var(--me) 0 3px, transparent 3px 4.5px, var(--other) 4.5px 7.5px, transparent 7.5px 9px); }

/* 3-day grid (until v27) */
.grid3 { overflow: hidden; }
.ghead { display: grid; grid-template-columns: 36px repeat(3, 1fr); border-bottom: 1px solid var(--line); padding: 8px 0; text-align: center; font-size: 12px; color: var(--muted); }
.ghead b { display: block; font-size: 18px; color: var(--ink); }
.ghead .today b { color: var(--accent); }
.gbody { display: grid; grid-template-columns: 36px 1fr; height: 58dvh; overflow-y: auto; }
.ghours { position: relative; }
.ghours div { position: absolute; right: 6px; font-size: 10px; color: var(--muted); transform: translateY(-6px); }
.gcols { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); }
.gcols > i { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.col { position: relative; border-left: 1px solid var(--line); }
.col.today { background: linear-gradient(var(--accent-soft), transparent 40%); }
.blk { position: absolute; left: 3px; right: 3px; border: 0; border-radius: 10px; padding: 4px 6px; text-align: left; overflow: hidden; background: var(--cs); box-shadow: inset 3px 0 0 var(--c); font-size: 12px; line-height: 1.25; }
.blk { overflow: clip; }
.blk b, .blk small { display: block; position: sticky; top: 0; background: inherit; }
.blk b { font-weight: 700; }
.blk small { color: var(--muted); font-size: 11px; top: 16px; }
.blk.hatched { background: repeating-linear-gradient(135deg, var(--cs) 0 6px, var(--hatch-gap) 6px 12px); box-shadow: inset 0 0 0 1.5px var(--c); }
.blk.faded { opacity: .5; }
/* together in the 3-day grid: time runs top->bottom here, so the split is left/right (mine left) —
   it must not read as "first me, then the other" */
.blk.both { background: linear-gradient(90deg, var(--me-soft) 50%, var(--other-soft) 50%); box-shadow: inset 3px 0 0 var(--me), inset 6px 0 0 var(--other); padding-left: 9px; }
.blk.both.hatched { background: repeating-linear-gradient(135deg, var(--me-soft) 0 6px, var(--hatch-gap) 6px 9px, var(--other-soft) 9px 15px, var(--hatch-gap) 15px 18px);
  box-shadow: inset 3px 0 0 var(--me), inset 6px 0 0 var(--other); }
.blk.half { left: 45%; z-index: 2; }
.blk .q { position: absolute; top: 3px; right: 4px; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
.sheet-wrap.open { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; max-height: 90dvh; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .25s ease; }
.sheet-wrap.open .sheet { transform: none; }
.sheethead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.sheethead h2 { margin-top: 6px; font-size: 21px; }
.chipst { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--bg); }
.chipst.st-ok { background: var(--ok-soft); } .chipst.st-ask { background: var(--accent-soft); } .chipst.st-wait { background: var(--warn-soft); }
.box { border-radius: 16px; padding: 12px 14px; background: var(--bg); display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
.box small { color: var(--muted); font-size: 12px; font-weight: 600; } .box span { font-size: 14px; color: var(--muted); }
.box.hatched { background: repeating-linear-gradient(135deg, var(--accent-soft) 0 8px, var(--hatch-gap) 8px 16px); box-shadow: inset 0 0 0 1.5px var(--accent); }
.box.faded { opacity: .7; } .box.faded b { text-decoration: line-through; text-decoration-color: var(--strike); }
.box.solid { background: var(--ok-soft); }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .cmp .box { margin: 0; }
.note { background: var(--bg); border-radius: 14px; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.note.small { font-size: 12px; }
.hist { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 14px; }
.card.hist { border-left: 0; margin-left: 0; padding: 6px 14px; }
.hrow { position: relative; padding: 4px 0 12px; font-size: 14px; display: flex; flex-direction: column; gap: 1px; }
.hist > .hrow::before { content: ""; position: absolute; left: -21px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--muted); }
/* timeline dots (event card): accepted = filled green, declined = filled red, waiting now = amber ring,
   other actions (suggested, …) = grey ring; "Start" (the oldest record) = filled dark dot */
.hrow.accepted::before { border-color: var(--ok); background: var(--ok); } .hrow.declined::before { border-color: var(--no); background: var(--no); }
.hrow.wait::before { border-color: var(--warn); }
.hist > .hrow.start::before { background: var(--ink); border-color: var(--ink); }
/* the timeline inside the event card scrolls by itself when it is long (the line scrolls with it) */
.sheethist { max-height: 42dvh; overflow-y: auto; border-left: 0; margin-left: 0; padding-left: 22px;
  background: linear-gradient(var(--line), var(--line)) 8px 0 / 2px 100% no-repeat local; overscroll-behavior: contain; }
.sheethist > .hrow::before { left: -20px; }
.hnote { font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.hrow .when { color: var(--muted); font-size: 12px; } .hrow small { color: var(--muted); }
.hitem { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 0 0; border-bottom: 1px solid var(--line); }
.hitem:last-child { border-bottom: 0; }
.htitle { font-weight: 650; font-size: 15px; }

/* tabs + fab */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: none; justify-content: space-around; background: var(--tabs-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
body.inapp .tabs { display: flex; }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); position: relative; min-width: 64px; font-weight: 600; }
.tabs a.on { color: var(--accent); }
.badge { position: absolute; top: -4px; left: 50%; margin-left: 6px; background: var(--accent); color: var(--badge-ink); font-size: 10px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.fab { position: fixed; right: max(18px, calc(50% - 242px)); bottom: calc(84px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: var(--fab-shadow); z-index: 11; display: grid; place-items: center; }
.fab[hidden] { display: none; }
.toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--toast-bg); color: var(--toast-ink); padding: 10px 16px; border-radius: 14px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 30; max-width: 90vw; }
.toast.show { opacity: .94; transform: translate(-50%, 0); }

/* calendar title + chooser (F-15/F-16) */
.caltitle { display: block; width: 100%; margin: 0 0 8px; border: 0; background: none; color: var(--muted); font-size: 14px; padding: 2px 4px; text-align: center; line-height: 1.4; }
.caltitle b { color: var(--ink); font-size: 15px; }
.caltitle .you { color: var(--ink); font-weight: 600; }
.caltitle .i { vertical-align: -2px; }
.calcard { padding: 16px 18px 10px; margin: 12px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.calcard.current { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.calopen { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 3px; width: 100%; }
.calopen .kids { font-size: 19px; font-weight: 700; }
.calopen .with { font-size: 15px; }
.calopen small { color: var(--muted); font-size: 13px; }
.link.danger { color: var(--no); font-size: 14px; padding: 6px 0; }

/* legend on the More screen */
.keylist { display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.35; }
/* (v51: not the states table — `.keylist > div` overrode its 4 columns and pushed the headers out of line) */
.keylist > div:not(.keystates) { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; }
.keylist .kv { display: flex; justify-content: center; align-items: center; }
.keylist .sw { width: 44px; height: 12px; border-radius: 6px; }
.keylist .sw.none { background: var(--none); }
.keylist .sw.faded { opacity: .38; }
.keylist .strip.demo { width: 84px; }
.keylist .sw.dotdemo { width: 14px; height: 14px; border-radius: 50%; }
.keylist .chipst { font-size: 11px; white-space: nowrap; }
.badge.static { position: static; margin: 0; }

/* pull to refresh */
html { overscroll-behavior-y: contain; }
/* v38 (the owner, Pixel: "the bottom bar sometimes slides down or disappears"): reproduced — while the month / week is
   dragged to the right it sticks out past the screen edge, the page becomes wider than the phone, Chrome zooms the
   whole page out and the fixed bar moves. Nothing may ever make the page wider than the screen: clip it. */
html, body { overflow-x: hidden; overflow-x: clip; }
/* the bar on its own layer (Chrome Android repaints blurred fixed bars badly while scrolling); while the keyboard is
   open the bar and + step aside instead of riding on top of it */
.tabs { transform: translateZ(0); }
body.kbd .tabs, body.kbd .fab { display: none !important; }
.ptr { position: fixed; top: calc(env(safe-area-inset-top) + 6px); left: 50%; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); color: var(--accent); display: grid; place-items: center; transform: translateY(-70px); z-index: 15; transition: transform .2s; }
.ptr { opacity: 0; pointer-events: none; }
.ptr.pulling, .ptr.spin { opacity: 1; }
.ptr.pulling { transition: none; }
.ptr.ready svg { transform: rotate(180deg); transition: transform .15s; }
.ptr.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* theme picker */
.themes { display: flex; gap: 10px; }
.theme { flex: 1; border: 1.5px solid var(--line); background: var(--picker-bg); border-radius: 14px; padding: 10px 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: 12px; font-weight: 650; text-transform: capitalize; }
.theme.on { border-color: var(--accent); }
.theme i { width: 18px; height: 18px; border-radius: 50%; }
.theme span { width: 100%; text-align: center; order: 4; }
/* swapped colors: the first two dots of each palette change places too */
/* each palette button: my color, the other parent's color, and "together" (split: mine on top);
   --p1/--p2 = the palette's two parent colors (below), Swap colors exchanges them */
.theme { --pa: var(--p1); --pb: var(--p2); }
:root[data-swap="on"] .theme { --pa: var(--p2); --pb: var(--p1); }
.theme i:nth-child(1) { background: var(--pa); } .theme i:nth-child(2) { background: var(--pb); }
.theme i:nth-child(3) { background: linear-gradient(var(--pa) 50%, var(--pb) 50%); }
.swapbtn { width: 100%; margin-top: 10px; justify-content: space-between; }
/* demo week in Look: the real month tiles, not clickable, as a preview of the chosen look */
.demoweek { margin-top: 14px; }
.demoweek .legend { margin: 0 0 6px; }
.month.demo { padding: 0; } .month.demo .day { min-height: 54px; cursor: default; }
.swapbtn.on { box-shadow: inset 0 0 0 1.5px var(--accent); }
.swapbtn .sample { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-size: 13px; color: var(--muted); }
.swapbtn .sample .sw { width: 12px; height: 12px; border-radius: 50%; margin: 0 6px 0 0; }
/* the two parent colors of each palette (the same values as --c1/--c2 of that palette, Light and Dark) */
.t-blossom { --p1: #4589D2; --p2: #F9A870; } .t-sage { --p1: #2D9570; --p2: #F79E75; } .t-sky { --p1: #2892CF; --p2: #F493AA; }
:root[data-mode="dark"] .t-blossom { --p1: #5296DF; --p2: #FCBA89; }
:root[data-mode="dark"] .t-sage { --p1: #36A980; --p2: #FDB48C; }
:root[data-mode="dark"] .t-sky { --p1: #449ED7; --p2: #FEADBF; }
/* Light / Dark switch (F-21) */
.modeseg { display: flex; margin-bottom: 12px; box-shadow: none; background: var(--bg); }
/* v33: Swap colors as a two-half switch like Light/Dark; each half shows the result (your dot first) */
.swapseg { display: flex; margin: 4px 0 12px; box-shadow: none; background: var(--bg); }
.swapseg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; }
.swapseg .sw { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.swapseg .sw + .sw, .swapseg button > .sw:nth-of-type(2) { margin-left: 6px; }
.swaplabel { margin: 10px 0 0; font-weight: 650; }
/* v34: notification groups — a row per group with an on/off switch (all on by default) */
.ngroups { margin: 12px 0 6px; border-top: 1px solid var(--line); }
.nrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.nrow .rowtext { flex: 1; }
.switch { flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(18px); }
/* v43 check this device: three live rows ✅/❌ with the steps for THIS device under what is ❌ */
.devicecheck .dcrow { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.devicecheck .dcmark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--card); margin-top: 1px; }
.devicecheck .dcrow.ok .dcmark { background: var(--ok); }
.devicecheck .dcrow.no .dcmark { background: var(--no); }
.devicecheck [hidden] { display: none !important; }   /* .btn's own display must not show a hidden button */
.devicecheck .dchelp:empty { display: none; }
.devicecheck .dchelp { line-height: 1.4; }
/* v49: rows open on a tap — closed by default (light screen), hint under the title, a chevron that turns */
.devicecheck .dcrow { cursor: default; text-align: left; }
.devicecheck .dcrow.has { cursor: pointer; }
.devicecheck .dcrow .rowtext { flex: 1; min-width: 0; }
.devicecheck .dchint { display: block; color: var(--muted); font-size: 13px; }
.devicecheck .dcrow.has .dchint { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.devicecheck .dcrow:not(.open) .dchelp { display: none; }
.devicecheck .dcchev { flex: none; color: var(--muted); margin-top: 3px; transition: transform .2s; visibility: hidden; }
.devicecheck .dcrow.has .dcchev { visibility: visible; }
.devicecheck .dcrow.open .dcchev { transform: rotate(180deg); }
.devicecheck .dcsteps { margin: 8px 0 2px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.devicecheck .dcsteps b { font-weight: 700; }
.devicecheck .dcicon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--line); vertical-align: -5px; }
.devicecheck .dcbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* v44 overlaps: the explanation box, the small day line, the choices */
.ovlbox { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 10px 0; background: var(--bg); }
.ovlbox .note { margin-top: 0; }
.ovllist { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }   /* v47: links to the open requests */
.ovlopen { text-align: left; font-weight: 600; }
.miniline { display: flex; flex-direction: column; gap: 3px; margin: 8px 0 6px; }
.mlrow { position: relative; display: block; height: 10px; border-radius: 5px; background: var(--none); overflow: hidden; }
.mlrow b { position: absolute; top: 0; bottom: 0; background: var(--c); }
.mlrow b.both { background: linear-gradient(var(--me) 50%, var(--other) 50%); }
.mlrow b.hatched { background: repeating-linear-gradient(135deg, var(--c) 0 3px, transparent 3px 6px); }
.mlrow b.ovl { background: none; box-shadow: inset 0 0 0 2px var(--flag); border-radius: 4px; }
.mlticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); font-style: normal; }
.mlticks i { font-style: normal; }
.ovlopt { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 15px; }
.ovlopt input { width: auto; margin: 0; }
.ovlacts { flex-direction: column; align-items: stretch; }
.ovlacts .btn { text-align: left; white-space: normal; }
.acctname { margin: 0 0 2px; font-size: 17px; }
.lookdiv { height: 1px; background: var(--line); margin: 14px 0 4px; }
.modeseg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
/* v30: English / Deutsch — like Light / Dark; on the login screen a small centered switch under the form */
/* v33: version number, bottom-right of the login forms — small and grey (the muted text tone, readable) */
#mailform, #codeform { position: relative; padding-bottom: 26px; }
.cardver { position: absolute; right: 14px; bottom: 8px; font-size: 11px; color: var(--muted); letter-spacing: .02em; pointer-events: none; }
.card .langseg { display: flex; box-shadow: none; background: var(--bg); margin-bottom: 8px; }
.card .langseg button { flex: 1; }
/* v32: flags in the language switch — small, rounded, with a thin edge so white parts show on light cards */
.langseg button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.langseg .flag { width: 22px; height: 15px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.center > .langseg { margin: 16px auto 0; }
