/* How Long Really: calm task timing in the Favabeans look (see ../APP_DESIGN.md). Accent: indigo.
   Light by default, dark when the system asks. No dark green or teal, no red alarms, no scores. */
:root {
  /* Favabeans base */
  --canvas: #F7F7F5;
  --surface: #FFFFFF;
  --surface-2: #F1F1EE;
  --surface-3: #E7E7E3;
  --ink: #1D1D1F;
  --ink-2: #57575F;
  --line: rgb(29 29 31 / .09);
  --line-2: rgb(29 29 31 / .17);
  --danger: #b3261e;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px -14px rgb(0 0 0 / .12);
  --shadow-2: 0 2px 4px rgb(0 0 0 / .04), 0 24px 48px -22px rgb(0 0 0 / .22);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r-card: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* This app's accent: indigo, two-tone #B3BDFF → #4F5BD5 */
  --accent: #4F5BD5;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECEEFF;
  --accent-text: #3F4AB8;
  --focus: #4F5BD5;
  --a1: #B3BDFF;
  --a2: #4F5BD5;

  --track: rgb(29 29 31 / .07);
  --face-1: #FFFFFF;
  --face-2: #F4F4F7;
  --badge-mix: 34%;
  --scrim: rgb(20 22 40 / .32);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --canvas: #0C0C0E;
    --surface: #161619;
    --surface-2: #202024;
    --surface-3: #2A2A2F;
    --ink: #F2F2F4;
    --ink-2: #ABABB5;
    --line: rgb(255 255 255 / .09);
    --line-2: rgb(255 255 255 / .17);
    --danger: #ffb4ab;
    --shadow-1: 0 1px 0 rgb(255 255 255 / .04) inset, 0 8px 24px -12px rgb(0 0 0 / .6);
    --shadow-2: 0 1px 0 rgb(255 255 255 / .05) inset, 0 28px 56px -22px rgb(0 0 0 / .8);

    --accent: #A9B4FF;
    --accent-ink: #12163A;
    --accent-soft: #1E2033;
    --accent-text: #C3CAFF;
    --focus: #C3CAFF;

    --track: rgb(255 255 255 / .08);
    --face-1: #222227;
    --face-2: #1A1A1E;
    --badge-mix: 22%;
    --scrim: rgb(0 0 0 / .55);
    color-scheme: dark;
  }
}
:root:where([data-theme="dark"]) {
  --canvas: #0C0C0E;
  --surface: #161619;
  --surface-2: #202024;
  --surface-3: #2A2A2F;
  --ink: #F2F2F4;
  --ink-2: #ABABB5;
  --line: rgb(255 255 255 / .09);
  --line-2: rgb(255 255 255 / .17);
  --danger: #ffb4ab;
  --shadow-1: 0 1px 0 rgb(255 255 255 / .04) inset, 0 8px 24px -12px rgb(0 0 0 / .6);
  --shadow-2: 0 1px 0 rgb(255 255 255 / .05) inset, 0 28px 56px -22px rgb(0 0 0 / .8);

  --accent: #A9B4FF;
  --accent-ink: #12163A;
  --accent-soft: #1E2033;
  --accent-text: #C3CAFF;
  --focus: #C3CAFF;

  --track: rgb(255 255 255 / .08);
  --face-1: #222227;
  --face-2: #1A1A1E;
  --badge-mix: 22%;
  --scrim: rgb(0 0 0 / .55);
  color-scheme: dark;
}

/* Task colours: two-tone pairs, light → deep (the saved key is the name). */
[data-color="peach"] { --c1: #FFCB8F; --c2: #F28A2E; }
[data-color="sky"]   { --c1: #9CD8FF; --c2: #3398E6; }
[data-color="rose"]  { --c1: #FFB3CF; --c2: #E5508C; }
[data-color="sun"]   { --c1: #FFE68A; --c2: #E3B21C; }
[data-color="lilac"] { --c1: #C3AEFF; --c2: #8467F2; }
[data-color="coral"] { --c1: #FFC2B0; --c2: #EC6A4E; }
[data-color] {
  --c-text: color-mix(in srgb, var(--c2) 52%, var(--ink));
  --c-icon: color-mix(in srgb, var(--c2) 42%, var(--ink));
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) [data-color] { --c-text: color-mix(in srgb, var(--c1) 82%, var(--ink)); --c-icon: color-mix(in srgb, var(--c1) 70%, var(--ink)); }
}
:where(:root[data-theme="dark"]) [data-color] { --c-text: color-mix(in srgb, var(--c1) 82%, var(--ink)); --c-icon: color-mix(in srgb, var(--c1) 70%, var(--ink)); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header: a thin frosted bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--canvas) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; margin-inline-end: auto; min-width: 0; }
.brand img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 1px 2px rgb(0 0 0 / .1); flex: none; }
.brand h1 { margin: 0; display: flex; align-items: center; font: 600 1.0625rem/1.2 var(--font); letter-spacing: -0.015em; white-space: nowrap; }
body .top .fbk-beta {
  margin-inline-start: 8px; padding: .32em .62em; border: 0; border-radius: 999px; box-shadow: none;
  font: 600 max(.66rem, 11px)/1.1 var(--font); letter-spacing: .05em;
  color: var(--accent-text); background: var(--accent-soft);
}
.fb-lang { display: flex; align-items: center; gap: 0; font-size: .875rem; color: var(--line-2); }
.fb-lang button { min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: none; box-shadow: none; color: var(--ink-2); font: 500 .875rem/1 var(--font); cursor: pointer; }
.fb-lang button:hover { color: var(--ink); }
.fb-lang button[lang="ar"] { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; font-size: .95rem; }
.fb-lang button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.fb-lang button:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; }
.home-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font: 500 .875rem/1 var(--font); text-decoration: none; white-space: nowrap;
  transition: box-shadow .2s;
}
.home-link:hover { box-shadow: inset 0 0 0 1px var(--line-2); }

main { max-width: 1180px; margin: 0 auto; padding: 30px var(--gutter) 40px; display: grid; gap: 20px; }

/* ---------- Intro ---------- */
.intro { display: grid; gap: 10px; max-width: 60ch; }
.lead { margin: 0; font-size: clamp(1.5rem, 3vw, 2.125rem); line-height: 1.15; font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
.intro-sub { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.55; text-wrap: pretty; }

/* ---------- Two columns: tasks, and the side (usual times + add) ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.col-main { display: grid; gap: 14px; min-width: 0; }
.col-side { display: grid; gap: 16px; position: sticky; top: 80px; min-width: 0; }
.eyebrow-h { margin: 6px 0 -2px; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
:root[lang="ar"] .eyebrow-h { text-transform: none; letter-spacing: 0; font-size: .875rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--btn, var(--surface-2)); color: var(--ink);
  font: 500 .9375rem/1.2 var(--font); letter-spacing: -0.005em; cursor: pointer; text-align: center;
  transition: background-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 6%, var(--btn, var(--surface-2))); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.sm { padding: 0 16px; font-size: .875rem; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 12%, var(--accent)); }
.btn.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); }
.btn.quiet { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn.quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn.wide { width: 100%; }
.add-soft, .clock-btn { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.add-soft:hover:not(:disabled), .clock-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.clock-btn::before {
  content: ''; width: 17px; height: 17px; flex: none; background: currentColor;
  -webkit-mask: var(--i-clock) center / contain no-repeat; mask: var(--i-clock) center / contain no-repeat;
}
.link-btn {
  min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--accent-text); cursor: pointer;
  font: 500 .9375rem/1.2 var(--font); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--accent-text) 40%, transparent);
}
.link-btn:hover { text-decoration-color: currentColor; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

input[type=text], input[type=number], select {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-sm);
  background: var(--field, var(--surface)); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font: 400 1rem/1.2 var(--font); transition: box-shadow .2s; min-width: 0;
}
input::placeholder { color: color-mix(in srgb, var(--ink-2) 85%, transparent); }
select { padding-inline-end: 10px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):focus-visible, select:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus), 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
label > span, .lbl { display: block; margin-bottom: 6px; font-weight: 500; font-size: .8125rem; color: var(--ink-2); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

/* Switches (the shared display settings) */
body .fava-prefs input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 44px; height: 26px; margin: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .25s var(--ease);
}
body .fava-prefs input[type=checkbox]::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 2px 6px -1px rgb(0 0 0 / .14);
  transition: transform .25s var(--ease);
}
body .fava-prefs input[type=checkbox]:checked { background: var(--accent); box-shadow: none; }
body .fava-prefs input[type=checkbox]:checked::after { transform: translateX(18px); }
:root[dir="rtl"] body .fava-prefs input[type=checkbox]:checked::after { transform: translateX(-18px); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) body .fava-prefs input[type=checkbox]::after { background: #F2F2F4; }
}
:where(:root[data-theme="dark"]) body .fava-prefs input[type=checkbox]::after { background: #F2F2F4; }

/* ---------- Drawn icons (js/icons.js) ---------- */
svg.di { flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.di .f { fill: color-mix(in srgb, var(--c2, var(--accent)) 50%, transparent); }
svg.di .k { fill: currentColor; stroke: none; }
svg.di .w { fill: var(--surface); }
.badge {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  color: var(--c-icon);
  background:
    radial-gradient(120% 120% at 30% 18%, rgb(255 255 255 / .55), transparent 55%),
    linear-gradient(150deg, color-mix(in srgb, var(--c1) var(--badge-mix), var(--surface)), color-mix(in srgb, var(--c2) calc(var(--badge-mix) * .9), var(--surface)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c2) 18%, transparent);
}
.badge svg { width: 22px; height: 22px; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .badge { background: linear-gradient(150deg, color-mix(in srgb, var(--c1) var(--badge-mix), var(--surface)), color-mix(in srgb, var(--c2) calc(var(--badge-mix) * 1.2), var(--surface))); }
}
:where(:root[data-theme="dark"]) .badge { background: linear-gradient(150deg, color-mix(in srgb, var(--c1) var(--badge-mix), var(--surface)), color-mix(in srgb, var(--c2) calc(var(--badge-mix) * 1.2), var(--surface))); }

/* ---------- Example note ---------- */
.note {
  --btn: var(--surface);
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border-radius: 22px;
  background: var(--accent-soft); color: var(--ink);
}
.note p { flex: 1; margin: 0; font-size: .9375rem; line-height: 1.35; }
.note-i {
  flex: none; position: relative; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .06);
}
.note-i::after {
  content: ''; position: absolute; inset: 9px; background: var(--accent-text);
  -webkit-mask: var(--i-spark) center / contain no-repeat; mask: var(--i-spark) center / contain no-repeat;
}

/* ---------- The task cards (the signature) ---------- */
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.task {
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "dial head" "dial info" "dial spread" "dial acts";
  grid-template-rows: auto auto auto 1fr;
  gap: 4px 26px; padding: 22px 22px 20px 20px; border-radius: var(--r-card);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 11%, var(--surface)), var(--surface) 58%);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  transition: box-shadow .35s var(--ease);
}
:root[dir="rtl"] .task { padding: 22px 20px 20px 22px; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .task { background: linear-gradient(180deg, color-mix(in srgb, var(--c2) 9%, var(--surface)), var(--surface) 58%); }
}
:where(:root[data-theme="dark"]) .task { background: linear-gradient(180deg, color-mix(in srgb, var(--c2) 9%, var(--surface)), var(--surface) 58%); }
.task.is-running {
  box-shadow: var(--shadow-2), inset 0 0 0 1.5px color-mix(in srgb, var(--c2) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 22%, var(--surface)), var(--surface) 70%);
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .task.is-running { background: linear-gradient(180deg, color-mix(in srgb, var(--c2) 16%, var(--surface)), var(--surface) 70%); }
}
:where(:root[data-theme="dark"]) .task.is-running { background: linear-gradient(180deg, color-mix(in srgb, var(--c2) 16%, var(--surface)), var(--surface) 70%); }
.task.flash { animation: hl-flash 1.1s var(--ease); }
@keyframes hl-flash { 0% { box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line), 0 0 0 0 color-mix(in srgb, var(--c2) 35%, transparent); } 100% { box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line), 0 0 0 16px transparent; } }

.t-head { grid-area: head; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 44px; }
.t-name { margin: 0; flex: 1; min-width: 0; font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ex-pill {
  flex: none; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.hist {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 11px; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line); position: relative;
  font: 500 .8125rem/1 var(--font); cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s var(--ease);
}
:root[dir="rtl"] .hist { padding: 0 11px 0 14px; }
.hist::before { content: ''; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: var(--i-hist) center / contain no-repeat; mask: var(--i-hist) center / contain no-repeat; }
:root[dir="rtl"] .hist::before { transform: scaleX(-1); }
.hist:hover { background: var(--surface); color: var(--ink); }
.hist:active { transform: scale(.96); }
.hist::after { content: ''; position: absolute; inset: -2px; }

/* The dial: one ring, a round-capped two-tone band that fills while it runs (Clock Plan's Ring) */
.dial {
  grid-area: dial; align-self: center; position: relative; display: grid; place-items: center;
  width: 172px; height: 172px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s var(--ease);
}
.dial:active { transform: scale(.97); }
.dial:focus-visible { outline: none; }
.dial:focus-visible .dial-svg { filter: drop-shadow(0 0 0 var(--focus)) drop-shadow(0 0 5px color-mix(in srgb, var(--focus) 70%, transparent)); }
.dial:focus-visible::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 3px var(--focus); }
.dial-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial-svg .face { fill: var(--face-1); filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / .07)) drop-shadow(0 6px 10px rgb(0 0 0 / .06)); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .dial-svg .face { filter: drop-shadow(0 6px 12px rgb(0 0 0 / .5)); } }
:where(:root[data-theme="dark"]) .dial-svg .face { filter: drop-shadow(0 6px 12px rgb(0 0 0 / .5)); }
.dial-svg .trk { fill: none; stroke: var(--track); stroke-width: 13; }
.dial-svg .band { fill: none; stroke-width: 13; stroke-linecap: round; }
.dial-svg .rg { fill: none; stroke-width: 3.4; stroke-linecap: round; opacity: .95; }
.dial-svg .typ { stroke: var(--face-1); stroke-width: 1.4; }
.dial-svg .gm { stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; }
.dial-c { position: relative; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.dial-i {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--accent) 90%, transparent);
  transition: transform .25s var(--ease), background-color .25s;
}
.dial-i::before {
  content: ''; width: 20px; height: 20px; background: var(--accent-ink);
  -webkit-mask: var(--i-play) center / contain no-repeat; mask: var(--i-play) center / contain no-repeat;
}
.dial-l { font-weight: 600; font-size: .9375rem; color: var(--ink); letter-spacing: -0.01em; }
@media (hover: hover) { .dial:hover .dial-i { transform: scale(1.05); } }
.is-running .dial-i { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.is-running .dial-i::before { background: var(--ink); -webkit-mask-image: var(--i-stop); mask-image: var(--i-stop); width: 16px; height: 16px; }

.t-info { grid-area: info; min-width: 0; display: grid; align-content: start; gap: 2px; }
.usual { margin: 0; font-size: 1.0625rem; line-height: 1.4; color: var(--ink); text-wrap: pretty; }
.usual b { font-weight: 600; color: var(--c-text); }
.usual .rg { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.usual.none { color: var(--ink-2); font-weight: 500; }
.sub { margin: 0; color: var(--ink-2); font-size: .875rem; line-height: 1.45; }
.t-note {
  margin: 8px 0 2px; padding: 8px 12px; border-radius: 14px; width: fit-content; max-width: 100%;
  background: color-mix(in srgb, var(--c1) 26%, var(--surface)); color: var(--ink); font-size: .9063rem; line-height: 1.4;
}
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .t-note { background: color-mix(in srgb, var(--c2) 16%, var(--surface)); } }
:where(:root[data-theme="dark"]) .t-note { background: color-mix(in srgb, var(--c2) 16%, var(--surface)); }
.guess-add { justify-self: start; margin-top: 2px; font-size: .875rem; }

/* My guess: a small stepper, saved straight away */
.guess { display: flex; align-items: center; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.guess-l { font-size: .875rem; font-weight: 500; color: var(--ink-2); margin-inline-end: 6px; }
.step, .guess-x {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink); font: 500 1.25rem/1 var(--font); cursor: pointer;
  transition: background-color .2s, transform .15s var(--ease);
}
.step:hover { background: color-mix(in srgb, var(--ink) 8%, var(--surface-2)); }
.step:active { transform: scale(.94); }
.guess-v { min-width: 4.2em; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.guess-x { background: transparent; margin-inline-start: 2px; }
.guess-x::before { content: ''; width: 14px; height: 14px; background: var(--ink-2); -webkit-mask: var(--i-x) center / contain no-repeat; mask: var(--i-x) center / contain no-repeat; }
.guess-x:hover { background: var(--surface-2); }

/* Running: words first, small digits after; no big ticking seconds */
.eyebrow { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-text); }
:root[lang="ar"] .eyebrow { text-transform: none; letter-spacing: 0; font-size: .875rem; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(150deg, var(--c1), var(--c2)); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduce"]) .pulse { animation: hl-breathe 3.2s ease-in-out infinite; }
}
@keyframes hl-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.elapsed { margin: 0; font-size: clamp(1.45rem, 2.4vw, 1.875rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.digits { margin: 2px 0 4px; color: var(--ink-2); font-size: .875rem; font-variant-numeric: tabular-nums; }
:root[data-digits="hide"] .digits [data-dg] { display: none; }
.scale { font-size: .8125rem; }

/* The spread: a soft band from short to long, the typical time marked */
.spread { grid-area: spread; position: relative; margin: 8px 0 2px; padding-top: 22px; min-width: 0; max-width: 460px; }
.sp-track { position: relative; height: 12px; border-radius: 999px; background: var(--track); }
.sp-band {
  position: absolute; top: 0; bottom: 0; min-width: 12px; border-radius: 999px;
  background: linear-gradient(90deg, var(--c1), var(--c2)); opacity: .9;
}
:root[dir="rtl"] .sp-band { background: linear-gradient(270deg, var(--c1), var(--c2)); }
.sp-dot { position: absolute; top: 50%; width: 4px; height: 4px; margin-inline-start: -2px; margin-top: -2px; border-radius: 50%; background: rgb(255 255 255 / .85); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .sp-dot { background: rgb(12 12 14 / .55); } }
:where(:root[data-theme="dark"]) .sp-dot { background: rgb(12 12 14 / .55); }
.sp-typ {
  position: absolute; top: 50%; width: 18px; height: 18px; margin-inline-start: -9px; margin-top: -9px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 3.5px var(--c2), 0 2px 6px rgb(0 0 0 / .18);
}
.sp-typl, .sp-end { position: absolute; transform: translateX(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }

:root[dir="rtl"] .sp-typl, :root[dir="rtl"] .sp-end { transform: translateX(50%); }
.sp-typl { top: 0; font-size: .8125rem; font-weight: 600; color: var(--c-text); line-height: 1; }
.sp-ends { position: relative; height: 22px; }
.sp-end { top: 6px; font-size: .75rem; color: var(--ink-2); line-height: 1; }
.spread.big { max-width: none; margin: 12px 0 4px; }
.spread.big .sp-track { height: 14px; }

.t-acts { grid-area: acts; display: flex; flex-wrap: wrap; gap: 8px; align-self: end; margin-top: 10px; }

/* ---------- Empty state ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 34px 22px 30px; border-radius: var(--r-card); background: var(--surface-2); }
.empty-art { width: 108px; height: 108px; margin-bottom: 6px; }
.empty-art .face { fill: var(--face-1); }
.empty-art .trk { fill: none; stroke: var(--track); stroke-width: 13; }
.empty-art .play { fill: var(--accent); stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; }
.empty h3 { margin: 0; font-size: 1.25rem; }
.empty p { margin: 0; max-width: 44ch; color: var(--ink-2); font-size: .9375rem; }

/* ---------- Side: usual times, add a task ---------- */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.glance, .add-card { padding: 20px 20px 18px; }
.glance h2, .add-card h2 { margin: 0; font-size: 1.0625rem; letter-spacing: -0.01em; }
.help { margin: 2px 0 12px; max-width: 64ch; color: var(--ink-2); font-size: .875rem; }
.glance-list { list-style: none; margin: 0; padding: 0; display: grid; }
.glance-list li + li { border-top: 1px solid var(--line); }
.g-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%;
  min-height: 48px; padding: 6px 4px; border: 0; background: none; color: inherit; text-align: start; font: inherit; cursor: pointer; border-radius: 10px;
}
.g-row:hover .g-name { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.g-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(150deg, var(--c1), var(--c2)); }
.g-name { font-size: .9375rem; font-weight: 500; overflow-wrap: anywhere; line-height: 1.3; }
.g-val { font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.g-val.none { color: var(--ink-2); font-weight: 400; }
.add-form { margin: 12px 0 14px; }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; width: 100%; }
.add-row .btn { flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 11px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font: 500 .875rem/1.2 var(--font); cursor: pointer; text-align: start;
  transition: background-color .2s, transform .15s var(--ease);
}
:root[dir="rtl"] .chip { padding: 0 11px 0 14px; }
.chip:hover { background: var(--accent-soft); color: var(--accent-text); }
.chip:active { transform: scale(.97); }
.chip .plus { width: 13px; height: 13px; flex: none; background: currentColor; opacity: .75; -webkit-mask: var(--i-plus) center / contain no-repeat; mask: var(--i-plus) center / contain no-repeat; }
.chip { position: relative; }
.chip::after { content: ''; position: absolute; inset: -2px 0; }

/* ---------- Panels: settings, backup ---------- */
.panel { padding: 4px 22px; }
.panel summary { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; cursor: pointer; list-style: none; }
.panel summary::-webkit-details-marker { display: none; }
.panel summary::before { content: ''; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); }
.panel summary > span:not(.pi) { flex: 1; }
.panel summary::after { content: ''; flex: none; width: 9px; height: 9px; margin-inline-end: 6px; border-right: 1.8px solid var(--ink-2); border-bottom: 1.8px solid var(--ink-2); transform: rotate(45deg) translate(-2px, -2px); transition: transform .25s var(--ease); }
.panel[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.panel[open] { padding-bottom: 22px; }
.panel summary .pi {
  position: absolute; inset-inline-start: 7px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  background: var(--accent-text); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
.panel .fava-prefs { margin-top: 4px; }
.fava-prefs legend { font-weight: 600 !important; font-size: 1rem; }
.fava-prefs label { gap: 12px !important; }
.fava-prefs label > span { display: inline; margin: 0; font-weight: 400; font-size: .9375rem; color: var(--ink); }
.panel [data-fava-install] { margin-top: 10px; }
#settingsPanel { --m: var(--i-gear); }
#backupPanel { --m: var(--i-save); }
.msg { min-height: 1.4em; margin: 6px 0 0; font-weight: 500; font-size: .9375rem; color: var(--accent-text); }
.msg:empty { min-height: 0; margin: 0; }

/* ---------- Sheets: history, add a time ---------- */
.sheet {
  --btn: var(--surface-2); --field: var(--surface);
  border: 0; border-radius: var(--r-card); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2), 0 40px 90px -30px rgb(0 0 0 / .35);
  overscroll-behavior: contain;
}
.sheet-in { padding: 22px clamp(18px, 4vw, 28px) 24px; }
.sheet::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduce"]) .sheet[open] { animation: hl-in .28s var(--ease); }
}
@keyframes hl-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes hl-up { from { transform: translateY(32px); opacity: .5; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet h2 { margin: 0; font-size: 1.3125rem; line-height: 1.25; display: flex; gap: 12px; align-items: center; overflow-wrap: anywhere; min-width: 0; }
.sheet h2 .badge { width: 44px; height: 44px; }
.sheet h2 .badge svg { width: 23px; height: 23px; }
.sheet h3 { margin: 0; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
:root[lang="ar"] .sheet h3 { text-transform: none; letter-spacing: 0; font-size: .875rem; }
#historyClose, #addClose { flex: none; }
#addTitle { display: grid; gap: 2px; }
#addTitle small { font-size: .9375rem; font-weight: 500; color: var(--ink-2); letter-spacing: -0.005em; }
.h-sum { padding: 14px 16px 8px; border-radius: var(--r-md); background: var(--surface-2); }
.h-sum .sp-typ { background: var(--surface-2); }
.h-sum .spread { margin-bottom: 0; }
.h-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 4px; }
.hlist { list-style: none; margin: 0; padding: 0; }
.hlist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--line); }
.hlist li:last-child { border-bottom: 0; }
.hlist li.none { color: var(--ink-2); font-size: .9375rem; padding: 10px 0; }
.h-main { display: grid; gap: 0; min-width: 0; padding-block: 6px; line-height: 1.35; }
.h-dur { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 4.5em; }
.h-when { color: var(--ink-2); font-size: .875rem; font-variant-numeric: tabular-nums; }
.h-acts { display: flex; gap: 2px; flex: none; }
.ibtn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color .2s, color .2s;
}
.ibtn::before { content: ''; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ibtn.edit { --m: var(--i-pen); }
.ibtn.del { --m: var(--i-bin); }
.ibtn:hover { background: var(--surface-2); color: var(--ink); }
.ibtn.del:hover { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--danger); }
.h-edit { padding: 8px 0; }
.h-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; width: 100%; }
.h-form .h-when { flex-basis: 100%; }
.mins { display: inline-flex; align-items: center; gap: 8px; }
.mins > span[aria-hidden] { margin: 0; font-size: .9375rem; color: var(--ink-2); font-weight: 500; }
.mins input { width: 92px; }
.older { margin: 6px 0 0; color: var(--ink-2); font-size: .875rem; }
.older:empty { display: none; }
.change { margin-top: 22px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: 14px; --btn: var(--surface); }
.change h3 { margin: 0; }
.name-field input { width: 100%; }
.icon-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px;
  padding: 8px; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.icon-opt {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; min-height: 44px; border-radius: 50%;
  cursor: pointer; color: var(--ink-2); transition: background-color .2s, color .2s;
}
.icon-opt:hover { background: var(--surface-2); color: var(--ink); }
.icon-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.icon-opt svg { width: 24px; height: 24px; }
.icon-opt svg .f { fill: color-mix(in srgb, var(--ink) 9%, transparent); }
.icon-opt:has(input:checked) { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.icon-opt:has(input:checked) svg .f { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.icon-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches legend { margin-bottom: 6px; font-weight: 500; font-size: .8125rem; color: var(--ink-2); }
.swatch { position: relative; display: grid; place-items: center; width: 44px; height: 44px; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch span {
  display: block; width: 30px; height: 30px; border-radius: 50%; pointer-events: none;
  background: linear-gradient(150deg, var(--c1) 22%, var(--c2) 85%);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06), 0 1px 2px rgb(0 0 0 / .1);
  transition: box-shadow .2s, transform .2s var(--ease);
}
.swatch input:checked + span { box-shadow: 0 0 0 2.5px var(--surface-2), 0 0 0 4.5px var(--c2); transform: scale(1.04); }
.swatch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 5px; }
#removeTask { justify-self: start; }

/* Add a time */
.add-time { display: grid; gap: 16px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.qchip { position: relative; }
.qchip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.qchip span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 44px; margin: 0; padding: 0 14px;
  border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 500; font-size: .9375rem; font-variant-numeric: tabular-nums;
  transition: background-color .2s, box-shadow .2s;
}
.qchip:hover span { background: color-mix(in srgb, var(--ink) 6%, var(--surface-2)); }
.qchip input:checked + span { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--accent); }
.qchip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.exact { display: flex; gap: 10px; flex-wrap: wrap; }
.exact label { flex: 1 1 120px; }
.exact input { width: 100%; }
.day-f select { width: 100%; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px); min-height: 52px; padding: 6px 6px 6px 20px;
  border-radius: 28px; background: var(--ink); color: var(--canvas); font-weight: 500; box-shadow: var(--shadow-2); line-height: 1.35;
}
:root[dir="rtl"] .toast { padding: 6px 20px 6px 6px; }
.toast:not(:has(.toast-btn:not([hidden]))) { padding-inline-end: 20px; }
.toast #toastText { padding-block: 8px; }
.toast-btn { flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--canvas); color: var(--ink); font: 600 .9375rem/1 var(--font); cursor: pointer; }
.toast-btn:hover { background: color-mix(in srgb, var(--accent) 14%, var(--canvas)); }
.toast-btn:focus-visible { outline-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduce"]) .toast:not([hidden]) { animation: hl-toast .3s var(--ease); }
}
@keyframes hl-toast { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Footer, about, FAQ ---------- */
.foot { max-width: 1180px; margin: 0 auto; padding: 18px var(--gutter) 28px; color: var(--ink-2); font-size: .875rem; }
.foot p { margin: 0 0 6px; }
.fb-about { max-width: 1180px; margin: 12px auto 0; padding: 26px var(--gutter) 6px; color: var(--ink-2); font-size: .9375rem; }
.fb-about h2 { margin: 0 0 8px; font-size: 1.0625rem; color: var(--ink); }
.fb-about > p { margin: 0 0 14px; max-width: 70ch; line-height: 1.6; }
.fb-faq { display: grid; gap: 8px; }
.fb-faq h3 { margin: 8px 0 4px; font-size: .9375rem; color: var(--ink); }
.fb-faq details { border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.fb-faq summary { cursor: pointer; padding: 12px 16px; font-weight: 500; color: var(--ink); list-style-position: inside; }
.fb-faq summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 16px; }
.fb-faq details p { margin: 0; padding: 0 16px 14px; max-width: 70ch; line-height: 1.6; }

/* Feedback box from /assets/feedback.js, fitted to this page */
body .fbk {
  width: min(760px, calc(100% - 2 * var(--gutter)));
  margin: 24px auto 72px; padding: 24px 26px;
  background: var(--surface); border: 0; border-radius: var(--r-card);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
body .fbk-q { font-weight: 600; letter-spacing: -0.01em; }
body .fbk-q svg { stroke: var(--accent); }
body .fbk-hint { color: var(--accent-text); }
body .fbk-send { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
body .fbk textarea, body .fbk input[type=email] { background: var(--surface); border-color: var(--line-2); border-radius: var(--r-sm); }
body .fbk .fbk-beta { color: var(--accent-text); background: var(--accent-soft); border: 0; box-shadow: none; font-family: var(--font); font-weight: 600; letter-spacing: .05em; }
body .fbk-star:focus-visible, body .fbk button:focus-visible, body .fbk textarea:focus-visible, body .fbk input:focus-visible { outline-color: var(--focus); }
body .fbk .fbk-star { background: none; padding: 8px; border-radius: 8px; }
body .fbk .fbk-link { background: none; min-height: 44px; padding: 4px 0; border-radius: 0; }
body .fbk .fbk-send { min-height: 44px; padding: 0 22px; border-radius: 999px; }

/* ---------- Language (English / العربية) ---------- */
:root[lang="ar"] { --font: "Geist", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif; }
:root[lang="ar"] body { line-height: 1.7; }
:root[lang="ar"] body *:not(svg):not(svg *) { letter-spacing: normal !important; }
:root[lang="ar"] h1, :root[lang="ar"] h2, :root[lang="ar"] h3, :root[lang="ar"] .lead, :root[lang="ar"] .elapsed { line-height: 1.4; }
.fb-suggest { --btn: var(--surface); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0; padding: 12px 16px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.fb-suggest p { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.fb-suggest [lang="ar"] { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; font-weight: 600; }
.fb-suggest [lang="en"] { font-family: 'Geist', system-ui, sans-serif; color: var(--ink-2); }
.fb-suggest-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-suggest button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer; font: 500 .9375rem var(--font); }
.fb-suggest .fb-ar { background: var(--accent); color: var(--accent-ink); font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; }
.fb-suggest .fb-en { background: var(--surface-2); color: var(--ink); }

/* ---------- Small UI pictures (masks, so they follow the text colour) ---------- */
:root {
  --i-hist: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 12a8.4 8.4 0 1 0 2.5-6'/%3E%3Cpath d='M3.5 3.8v4.1h4.1'/%3E%3Cpath d='M12 7.6V12l3 1.8'/%3E%3C/svg%3E");
  --i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  --i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
  --i-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4.6v14.8a1 1 0 0 0 1.5.86l12.3-7.4a1 1 0 0 0 0-1.72L8.5 3.74A1 1 0 0 0 7 4.6z' fill='%23000'/%3E%3C/svg%3E");
  --i-stop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='4' width='16' height='16' rx='4' fill='%23000'/%3E%3C/svg%3E");
  --i-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.6'/%3E%3Cpath d='M12 7.4V12l3 2'/%3E%3C/svg%3E");
  --i-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5v3M12 17.5v3M3.5 12h3M17.5 12h3M6 6l2 2M16 16l2 2M18 6l-2 2M8 16l-2 2'/%3E%3C/svg%3E");
  --i-pen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 4.5l4 4L9 19H5v-4z'/%3E%3Cpath d='M13 7l4 4'/%3E%3C/svg%3E");
  --i-bin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 7h15M9.5 7V4.8h5V7M6.5 7l.9 12.2a1.5 1.5 0 0 0 1.5 1.3h6.2a1.5 1.5 0 0 0 1.5-1.3L17.5 7'/%3E%3C/svg%3E");
  --i-gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h9M17 7h3M4 17h3M11 17h9'/%3E%3Ccircle cx='15' cy='7' r='2.2'/%3E%3Ccircle cx='9' cy='17' r='2.2'/%3E%3C/svg%3E");
  --i-save: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v10.5M7.8 10.6 12 14.8l4.2-4.2'/%3E%3Cpath d='M4.5 15.5v2.5a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-2.5'/%3E%3C/svg%3E");
}

/* ---------- Shared “easier to see” settings (Favabeans prefs.js) ---------- */
:root[data-text="large"] { font-size: 120%; }
:root[data-contrast="high"] { --ink-2: var(--ink); --line: rgb(29 29 31 / .45); --line-2: rgb(29 29 31 / .6); --track: rgb(29 29 31 / .2); }
@media (prefers-color-scheme: dark) { :root[data-contrast="high"]:where(:not([data-theme="light"])) { --line: rgb(255 255 255 / .45); --line-2: rgb(255 255 255 / .6); --track: rgb(255 255 255 / .22); } }
:root[data-contrast="high"]:where([data-theme="dark"]) { --line: rgb(255 255 255 / .45); --line-2: rgb(255 255 255 / .6); --track: rgb(255 255 255 / .22); }
:root[data-contrast="high"] .btn, :root[data-contrast="high"] .hist, :root[data-contrast="high"] .chip, :root[data-contrast="high"] .step { box-shadow: inset 0 0 0 1.5px var(--line-2); }
:root[data-contrast="high"] .task, :root[data-contrast="high"] .card { box-shadow: inset 0 0 0 1.5px var(--line-2); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- Tablets and phones ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
}
@media (max-width: 600px) {
  .top-in { min-height: 56px; gap: 0 8px; flex-wrap: nowrap; }
  .brand { gap: 8px; }
  .brand h1 { font-size: .9375rem; white-space: normal; line-height: 1.15; }
  .fb-lang button { padding: 0 6px; font-size: .8125rem; }
  .fb-lang button[lang="ar"] { font-size: .875rem; }
  .home-link { font-size: 0; width: 40px; min-width: 40px; padding: 0; justify-content: center; }
  .home-link::before { content: '←'; font-size: 1.05rem; line-height: 1; }
  :root[dir="rtl"] .home-link::before { content: '→'; }
  main { padding-top: 20px; gap: 16px; }
  .lead { font-size: 1.5rem; }
  .intro-sub { font-size: .9375rem; }

  .task {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "head head" "dial info" "spread spread" "acts acts";
    grid-template-rows: auto;
    gap: 10px 16px; padding: 14px 14px 16px; border-radius: 24px;
  }
  :root[dir="rtl"] .task { padding: 14px 14px 16px; }
  .t-name { font-size: 1.0625rem; }
  .badge { width: 36px; height: 36px; }
  .badge svg { width: 20px; height: 20px; }
  .hist { width: 40px; padding: 0; justify-content: center; gap: 0; }
  :root[dir="rtl"] .hist { padding: 0; }
  .hist span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hist::before { width: 18px; height: 18px; }
  .dial { width: 128px; height: 128px; align-self: start; }
  .dial-i { width: 42px; height: 42px; }
  .dial-i::before { width: 17px; height: 17px; }
  .dial-l { font-size: .875rem; }
  .usual { font-size: 1rem; }
  .elapsed { font-size: 1.375rem; }
  .spread { max-width: none; margin-top: 0; }
  .t-acts { margin-top: 2px; }
  .t-acts .btn { flex: 1 1 auto; }
  .guess-l { flex-basis: 100%; margin-bottom: -2px; }

  .glance, .add-card { padding: 16px; border-radius: 24px; }
  .panel { padding: 2px 16px; border-radius: 24px; }
  .panel[open] { padding-bottom: 16px; }

  .sheet { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 90dvh; border-radius: 26px 26px 0 0; }
  .sheet-in { padding: 26px 16px max(20px, env(safe-area-inset-bottom)); }
  .sheet::before { content: ''; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line-2); }
  :root:not([data-motion="reduce"]) .sheet[open] { animation-name: hl-up; }
  .note { align-items: flex-start; flex-wrap: wrap; padding: 10px; }
  .note p { flex: 1 1 calc(100% - 60px); padding-top: 6px; }
  .note .btn { margin-inline-start: 48px; }
}
@media (max-width: 430px) { body .top .fbk-beta { display: none; } }
@media (max-width: 360px) {
  .task { grid-template-areas: "head head" "dial dial" "info info" "spread spread" "acts acts"; }
  .dial { justify-self: center; }
  .brand img { width: 24px; height: 24px; }
  .fb-lang button { padding: 0 4px; }
}
:root[data-text="large"] .task { grid-template-areas: "head head" "dial info" "spread spread" "acts acts"; }
@media (max-width: 600px) { :root[data-text="large"] .task { grid-template-areas: "head head" "dial dial" "info info" "spread spread" "acts acts"; } :root[data-text="large"] .dial { justify-self: center; } }
