/* Tend · design system. Warm paper & ink by day, charcoal & ember by night. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --serif: 'Fraunces', 'Amiri', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, monospace;
  --r: 14px; --r-lg: 22px; --r-xl: 30px; --r-pill: 999px;
  --gutter: clamp(16px, 2.4vw, 56px);
  --maxw: none; --maxw-read: 1040px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 180ms;

  --bg: #f5f1ea; --surface: #fffcf7; --surface-2: #f1ece3; --surface-3: #e9e3d8;
  --ink: #211d18; --ink-2: #5f574d; --ink-3: #6f665b; /* ≥ 4.5:1 on --bg and --surface-2 */
  --line: rgba(33, 29, 24, .10); --line-2: rgba(33, 29, 24, .18);
  --accent: #c8623c; --accent-ink: #fff; --accent-soft: rgba(200, 98, 60, .13); --accent-2: #5a8a65;
  --good: #4f8a5e; --good-soft: rgba(79, 138, 94, .14); --warn: #c28a2a; --warn-soft: rgba(194, 138, 42, .14); --bad: #b8484f; --bad-soft: rgba(184, 72, 79, .13);
  --shadow: 0 1px 2px rgba(33, 29, 24, .05), 0 14px 44px -22px rgba(33, 29, 24, .28);
  --shadow-lg: 0 2px 6px rgba(33, 29, 24, .06), 0 30px 70px -30px rgba(33, 29, 24, .4);

  --c-ember: #c8623c; --c-sage: #5a8a65; --c-teal: #2f8a8c; --c-plum: #7f5a9a; --c-rose: #c05a72; --c-honey: #c2922b;
  --c-sky: #3f7fb5; --c-moss: #6d7f3a; --c-clay: #a8623f; --c-slate: #5b6b7a; --c-lilac: #8d7bc4; --c-mint: #3e9a82;
}
[data-mode="dark"] {
  color-scheme: dark;
  --bg: #16140f; --surface: #1e1b16; --surface-2: #27231d; --surface-3: #312c25;
  --ink: #f3ede3; --ink-2: #b7ad9e; --ink-3: #7f7669;
  --line: rgba(243, 237, 227, .10); --line-2: rgba(243, 237, 227, .2);
  --accent: #e3845c; --accent-ink: #1a120d; --accent-soft: rgba(227, 132, 92, .17); --accent-2: #7fb58a;
  --good: #7fb58a; --good-soft: rgba(127, 181, 138, .16); --warn: #dcae52; --warn-soft: rgba(220, 174, 82, .16); --bad: #de7b82; --bad-soft: rgba(222, 123, 130, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 20px 50px -28px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 36px 80px -30px rgba(0, 0, 0, .8);
  --c-ember: #e3845c; --c-sage: #7fb58a; --c-teal: #58b3b5; --c-plum: #ad8ccb; --c-rose: #e283a0; --c-honey: #e0b457;
  --c-sky: #74aee0; --c-moss: #a3b765; --c-clay: #d08b66; --c-slate: #93a4b4; --c-lilac: #b6a7e6; --c-mint: #6fc7ad;
}
[data-accent="sage"] { --accent: var(--c-sage); --accent-soft: rgba(90, 138, 101, .14); --accent-2: #c8623c; --bg: #f1f4ee; --surface: #fcfdf9; --surface-2: #e9eee4; --surface-3: #dfe6d9; }
[data-accent="teal"] { --accent: var(--c-teal); --accent-soft: rgba(47, 138, 140, .14); --accent-2: #c2922b; --bg: #edf3f2; --surface: #fafdfc; --surface-2: #e4edec; --surface-3: #d9e5e4; }
[data-accent="plum"] { --accent: var(--c-plum); --accent-soft: rgba(127, 90, 154, .14); --accent-2: #c2922b; --bg: #f2eff5; --surface: #fcfbfe; --surface-2: #eae6ef; --surface-3: #dfdae6; }
[data-accent="rose"] { --accent: var(--c-rose); --accent-soft: rgba(192, 90, 114, .14); --accent-2: #5a8a65; --bg: #f7f0f1; --surface: #fffbfb; --surface-2: #f0e6e8; --surface-3: #e8dadd; }
[data-accent="honey"] { --accent: var(--c-honey); --accent-soft: rgba(194, 146, 43, .16); --accent-2: #2f8a8c; --bg: #f7f3e7; --surface: #fffdf6; --surface-2: #f1ead9; --surface-3: #e9e0cb; }
[data-mode="dark"][data-accent="sage"] { --accent-soft: rgba(127, 181, 138, .18); --bg: #131611; --surface: #1a1e18; --surface-2: #23281f; --surface-3: #2c3227; }
[data-mode="dark"][data-accent="teal"] { --accent-soft: rgba(88, 179, 181, .18); --bg: #101616; --surface: #171e1e; --surface-2: #1f2828; --surface-3: #283232; }
[data-mode="dark"][data-accent="plum"] { --accent-soft: rgba(173, 140, 203, .18); --bg: #151218; --surface: #1c1820; --surface-2: #26212a; --surface-3: #302a35; }
[data-mode="dark"][data-accent="rose"] { --accent-soft: rgba(226, 131, 160, .18); --bg: #181214; --surface: #20181b; --surface-2: #2a2124; --surface-3: #342a2e; }
[data-mode="dark"][data-accent="honey"] { --accent-soft: rgba(224, 180, 87, .18); --bg: #17140e; --surface: #1f1b13; --surface-2: #29241a; --surface-3: #332d21; }
[data-accent="sage"] .accent-ink, [data-accent="teal"] .accent-ink { color: #fff; }
[data-accent="sage"], [data-accent="teal"], [data-accent="plum"], [data-accent="rose"] { --accent-ink: #fff; }
[data-mode="dark"][data-accent="sage"], [data-mode="dark"][data-accent="teal"], [data-mode="dark"][data-accent="plum"], [data-mode="dark"][data-accent="rose"], [data-mode="dark"][data-accent="honey"] { --accent-ink: #15110c; }
[data-accent="honey"] { --accent-ink: #1f1706; }

html[lang="ar"] { --sans: 'IBM Plex Sans Arabic', 'Manrope', system-ui, sans-serif; --serif: 'Amiri', 'Fraunces', Georgia, serif; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 15.5px; line-height: 1.55; color: var(--ink); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; transition: background var(--t), color var(--t); }
html[lang="ar"] body { font-size: 16px; letter-spacing: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -.012em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { letter-spacing: 0; font-weight: 700; line-height: 1.35; }
h1 { font-size: clamp(30px, 2.2vw + 14px, 44px); font-variation-settings: 'opsz' 144; }
h2 { font-size: clamp(22px, 2.6vw, 28px); }
h3 { font-size: 19px; }
h4 { font-size: 16px; }
p { margin: 0 0 .9em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img, svg { display: inline-block; vertical-align: middle; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
html[lang="ar"] .eyebrow { letter-spacing: 0; font-size: 12.5px; }
.serif { font-family: var(--serif); }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; } .mt-4 { margin-top: 44px; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 28px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- boot ---------- */
.boot-screen { min-height: 100vh; display: grid; place-items: center; color: var(--accent); }
.boot-mark { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.94); opacity: .6 } 50% { transform: scale(1.04); opacity: 1 } }

/* ---------- layout ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); height: 68px; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: -.02em; text-decoration: none !important; }
.brand .mark { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 2px; margin-inline-start: 10px; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; position: relative; }
.nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--ink); }
.nav a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -14px; height: 2px; background: var(--accent); border-radius: 2px; }
.topbar .spacer { flex: 1; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--ink-2); transition: background var(--t), color var(--t); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; border: 1px solid var(--line-2); background: var(--surface); }
.page { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 30px var(--gutter) 80px; animation: enter 260ms var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .lede { color: var(--ink-2); max-width: 60ch; margin-top: 6px; font-size: 16px; }
.footer { border-top: 1px solid var(--line); padding: 22px var(--gutter); color: var(--ink-3); font-size: 13px; }
.footer-in { max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--ink-2); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.board { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.rail { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1000px) { .board { grid-template-columns: 1fr; } .rail { position: static; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .page { padding-top: 18px; padding-bottom: 110px; } }

/* ---------- mobile tabs ---------- */
.tabbar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 700; color: var(--ink-3); border-radius: 10px; }
.tabbar a.active { color: var(--accent); }
@media (max-width: 760px) { .tabbar { display: flex; } .nav { display: none; } .topbar-in { height: 58px; } }

/* ---------- cards & surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-sm { padding: 16px 18px; border-radius: var(--r); }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card.accent { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h3 { font-size: 18px; }
.hero { background: radial-gradient(1200px 400px at 10% -20%, var(--accent-soft), transparent 60%), var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 30px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.panel-list > * + * { border-top: 1px solid var(--line); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; line-height: 1.2; border: 1px solid transparent; background: var(--surface-2); color: var(--ink); transition: transform 120ms var(--ease), background var(--t), color var(--t), border-color var(--t), box-shadow var(--t); white-space: nowrap; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-good { background: var(--good-soft); color: var(--good); }
.btn-link { background: none; color: var(--accent); padding: 4px 6px; font-weight: 600; }
.btn-link:hover { background: var(--accent-soft); }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn-pill { border-radius: var(--r-pill); }
.btn-block { width: 100%; }
.btn-hc { background: var(--hc, var(--accent)); color: #fff; box-shadow: 0 8px 20px -10px var(--hc, var(--accent)); }
.btn-hc:hover { filter: brightness(.94); background: var(--hc, var(--accent)); }
.btn-hc-soft { background: color-mix(in srgb, var(--hc, var(--accent)) 14%, transparent); color: var(--hc, var(--accent)); }

/* ---------- chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; }
.chip.type-retain { background: rgba(47, 138, 140, .14); color: var(--c-teal); }
.chip.type-quit { background: rgba(192, 90, 114, .14); color: var(--c-rose); }
.chip.type-embrace { background: rgba(90, 138, 101, .14); color: var(--c-sage); }
.chip.good { background: var(--good-soft); color: var(--good); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip-btn { cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); padding: 8px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: all var(--t); }
.chip-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.chip-btn.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.code { font-family: var(--mono); font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 7px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .error-text { font-size: 12.5px; color: var(--bad); font-weight: 600; }
.input, .select, .textarea { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: border-color var(--t), box-shadow var(--t); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input.invalid { border-color: var(--bad); }
.textarea { min-height: 86px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 34px; }
html[dir="rtl"] .select { background-position: 18px 50%, 13px 50%; }
.input-row { display: flex; gap: 10px; align-items: center; }
.input-row .input { flex: 1; }
.inline-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; line-height: 1.7; }
.inline-sentence .input { width: auto; flex: 1 1 160px; padding: 7px 11px; border-radius: 10px; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background var(--t); flex: none; }
.switch::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--t); }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
html[dir="rtl"] .switch[aria-checked="true"]::after { transform: translateX(-18px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.switch-row .t { font-weight: 700; font-size: 14.5px; } .switch-row .d { font-size: 13px; color: var(--ink-2); }
.seg { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 12px; gap: 2px; }
.seg button { padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.opt-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.opt { display: flex; flex-direction: column; gap: 6px; text-align: start; padding: 16px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); transition: all var(--t); cursor: pointer; }
.opt:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.opt .ot { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; } .opt .od { font-size: 13px; color: var(--ink-2); }
.opt .oi { font-size: 24px; }
.range { width: 100%; accent-color: var(--accent); }
.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-picker button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); font-weight: 700; font-size: 12.5px; color: var(--ink-2); background: var(--surface); }
.weekday-picker button.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- avatar, type, stage ---------- */
.av { display: inline-grid; place-items: center; border-radius: 16px; background: color-mix(in srgb, var(--hc, var(--accent)) 16%, transparent); color: var(--hc, var(--accent)); flex: none; line-height: 1; }
.av-sm { width: 36px; height: 36px; font-size: 18px; border-radius: 11px; } .av-md { width: 48px; height: 48px; font-size: 24px; } .av-lg { width: 72px; height: 72px; font-size: 38px; border-radius: 22px; } .av-xl { width: 96px; height: 96px; font-size: 50px; border-radius: 28px; }
.av.round { border-radius: 50%; }
.stage { color: var(--hc, var(--accent)); }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--hc, var(--accent)); transition: width 500ms var(--ease); }
.bar.thin { height: 5px; }
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1; }
.ring .ring-label b { font-family: var(--serif); font-size: 30px; font-weight: 500; } .ring .ring-label small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 4px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dots { display: inline-flex; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); border: 1px solid transparent; }
.dot.on { background: var(--hc, var(--accent)); } .dot.off { background: var(--bad); opacity: .55; } .dot.rest { background: var(--warn); opacity: .6; } .dot.today { border-color: var(--ink-3); } .dot.future { opacity: .45; } .dot.unscheduled { background: transparent; border: 1px dashed var(--line-2); }
.dot.pending { background: var(--surface-3); box-shadow: inset 0 0 0 2px var(--hc, var(--accent)); }
.week-dots { display: flex; gap: 6px; }
.week-dots .wd { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--ink-3); font-weight: 700; }

/* ---------- habit card (today) ---------- */
.group-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; }
.group-head h2 { font-size: 20px; } .group-head .count { color: var(--ink-3); font-size: 13px; font-weight: 700; }
.hcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); transition: transform 200ms var(--ease), box-shadow var(--t), border-color var(--t); position: relative; overflow: hidden; }
.hcard + .hcard { margin-top: 10px; }
.hcard:hover { transform: translateY(-1px); border-color: var(--line-2); }
.hcard.done { background: linear-gradient(90deg, color-mix(in srgb, var(--hc) 9%, var(--surface)), var(--surface) 60%); }
.hcard.done::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--hc); }
.hcard.missed::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--bad); opacity: .6; }
.hcard.rest::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--warn); opacity: .6; }
.hcard .hname { font-weight: 800; font-size: 16.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hcard .hname a { color: inherit; }
.hcard .hmeta { color: var(--ink-2); font-size: 13px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hcard .hactions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.hcard .streak { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--hc); }
.hcard .hstate { font-weight: 700; color: var(--hc); display: inline-flex; align-items: center; gap: 6px; }
.hcard .hstate.neg { color: var(--bad); } .hcard .hstate.rest { color: var(--warn); }
@media (max-width: 640px) { .hcard { grid-template-columns: auto minmax(0, 1fr); } .hcard .hactions { grid-column: 1 / -1; justify-content: flex-start; } .hcard .hactions .btn { flex: 1 1 auto; } }

/* ---------- lists ---------- */
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .lt { font-weight: 700; } .list-row .ld { font-size: 13px; color: var(--ink-2); }
.kpi { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kpi .kv { font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1; margin: 4px 0 6px; } .kpi .kl { font-size: 12px; color: var(--ink-3); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; } .kpi .kd { font-size: 13px; color: var(--ink-2); }
html[lang="ar"] .kpi .kl { letter-spacing: 0; text-transform: none; }
.kpi.accent { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
.insight { display: flex; gap: 12px; padding: 12px 0; }
.insight + .insight { border-top: 1px solid var(--line); }
.insight .ii { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.insight.warn .ii { background: var(--warn-soft); color: var(--warn); } .insight.good .ii { background: var(--good-soft); color: var(--good); } .insight.info .ii { background: var(--accent-soft); color: var(--accent); }
.insight .it { font-weight: 800; font-size: 14px; } .insight .ib { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.insight .why { font-size: 12px; margin-top: 4px; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty .ei { font-size: 44px; margin-bottom: 8px; }
.empty h3 { margin-bottom: 6px; }
.notice { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; background: var(--accent-soft); color: var(--ink); display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); } .notice.bad { background: var(--bad-soft); } .notice.good { background: var(--good-soft); }
.science-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-inline-start: 3px solid var(--accent); }
.science-note b { color: var(--ink); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
html[lang="ar"] .table th { letter-spacing: 0; text-transform: none; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* ---------- modal & toast ---------- */
.layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.modal-back { position: fixed; inset: 0; background: rgba(20, 16, 10, .45); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; pointer-events: auto; animation: fade 160ms var(--ease) both; z-index: 101; overflow: auto; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 26px; animation: pop 220ms var(--ease) both; max-height: calc(100vh - 40px); overflow: auto; }
.modal.wide { width: min(760px, 100%); } .modal.narrow { width: min(440px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: none } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-size: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
@media (max-width: 640px) { .modal-back { align-items: end; padding: 0; } .modal { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; } }
.toasts { position: fixed; bottom: 24px; inset-inline-end: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 120; pointer-events: none; }
@media (max-width: 760px) { .toasts { bottom: 84px; inset-inline: 16px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; max-width: 420px; animation: toastin 260ms var(--ease) both; }
.toast.out { animation: toastout 220ms var(--ease) both; }
.toast .xp { font-family: var(--serif); font-size: 18px; color: var(--accent); background: color-mix(in srgb, var(--bg) 14%, transparent); padding: 2px 10px; border-radius: 10px; white-space: nowrap; }
.toast.bad .xp { color: var(--bad); }
@keyframes toastin { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px) } }

/* ---------- celebrations ---------- */
.particle { position: fixed; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; z-index: 130; animation: fly 900ms cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0 } }
.confetti { position: fixed; top: -10px; width: 9px; height: 14px; border-radius: 2px; z-index: 130; pointer-events: none; animation: drop var(--dur) linear forwards; }
@keyframes drop { to { transform: translateY(110vh) rotate(720deg); opacity: .9 } }
.milestone-card { text-align: center; padding: 10px 6px; }
.milestone-card .big { font-family: var(--serif); font-size: 80px; line-height: 1; color: var(--hc, var(--accent)); }
.breath { width: 160px; height: 160px; border-radius: 50%; margin: 10px auto; background: radial-gradient(circle, var(--accent-soft), transparent 70%); display: grid; place-items: center; position: relative; }
.breath::before { content: ''; position: absolute; inset: 20px; border-radius: 50%; background: var(--accent); opacity: .22; animation: inhale 8s ease-in-out infinite; }
.breath b { font-family: var(--serif); font-size: 30px; font-weight: 500; position: relative; }
@keyframes inhale { 0%, 100% { transform: scale(.6) } 50% { transform: scale(1.1) } }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .5 } }

/* ---------- emoji & color pickers ---------- */
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; max-height: 220px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.emoji-grid button { font-size: 22px; height: 42px; border-radius: 10px; }
.emoji-grid button:hover { background: var(--surface-3); } .emoji-grid button.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; background: var(--sw); transition: transform 120ms; }
.swatch:hover { transform: scale(1.08); } .swatch.selected { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.accent-pick { width: 56px; height: 56px; border-radius: 16px; background: var(--sw); position: relative; border: 3px solid transparent; }
.accent-pick.selected { border-color: var(--ink); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-story { padding: clamp(28px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; gap: 28px; background: radial-gradient(900px 500px at 20% 10%, var(--accent-soft), transparent 60%); }
.auth-story h1 { font-size: clamp(38px, 5.4vw, 66px); max-width: 14ch; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pillar { padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pillar .pi { font-size: 26px; margin-bottom: 8px; } .pillar b { display: block; font-size: 15px; margin-bottom: 3px; } .pillar span { font-size: 13px; color: var(--ink-2); }
.auth-panel { display: grid; place-items: center; padding: clamp(20px, 5vw, 60px); border-inline-start: 1px solid var(--line); background: var(--surface); }
.auth-card { width: min(420px, 100%); }
.auth-card .tabs { margin-bottom: 20px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 10px 14px; font-weight: 700; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.codes code { font-family: var(--mono); font-size: 13.5px; padding: 9px 12px; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 10px; text-align: center; letter-spacing: .04em; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-story { padding-bottom: 10px; } .pillars { grid-template-columns: 1fr; } .auth-panel { border-inline-start: 0; border-top: 1px solid var(--line); } }

/* ---------- onboarding ---------- */
.onb { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.onb-top { display: flex; align-items: center; justify-content: space-between; padding: 20px var(--gutter); }
.onb-progress { height: 4px; background: var(--surface-3); border-radius: 2px; width: min(360px, 40vw); overflow: hidden; } .onb-progress i { display: block; height: 100%; background: var(--accent); transition: width 400ms var(--ease); }
.onb-body { width: min(760px, 100%); margin: 0 auto; padding: 10px var(--gutter) 60px; animation: enter 280ms var(--ease) both; }
.onb-body h1 { font-size: clamp(30px, 4.6vw, 44px); margin-bottom: 8px; }
.onb-body .lede { color: var(--ink-2); font-size: 17px; margin-bottom: 26px; max-width: 56ch; }
.onb-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }
.plan-tip { display: flex; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.plan-tip .pt { font-size: 22px; }

/* ---------- habit form ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); } .steps i.on { background: var(--accent); }
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .type-cards { grid-template-columns: 1fr; } }
.type-card { text-align: start; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface); transition: all var(--t); cursor: pointer; }
.type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.type-card.selected { border-color: var(--tc); box-shadow: 0 0 0 1px var(--tc), var(--shadow); background: color-mix(in srgb, var(--tc) 8%, var(--surface)); }
.type-card .ti { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 14%, transparent); color: var(--tc); margin-bottom: 10px; }
.type-card b { display: block; font-size: 17px; font-family: var(--serif); font-weight: 500; margin-bottom: 4px; } .type-card span { font-size: 13px; color: var(--ink-2); }
.preview-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface-2); }

/* ---------- habit detail ---------- */
.detail-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
@media (max-width: 760px) { .detail-hero { grid-template-columns: auto 1fr; } .detail-hero .dh-actions { grid-column: 1 / -1; } }
.detail-hero h1 { font-size: clamp(28px, 4vw, 40px); }
.plan-line { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
.cal-strip { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.cal-strip i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-3); display: block; }
.cal-strip i.on { background: var(--hc, var(--accent)); } .cal-strip i.off { background: var(--bad); opacity: .55; } .cal-strip i.rest { background: var(--warn); opacity: .55; } .cal-strip i.na { background: transparent; border: 1px dashed var(--line); } .cal-strip i.today { box-shadow: inset 0 0 0 2px var(--ink-3); } .cal-strip i.future { opacity: .25; }
.urge-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 14px; }
.urge-row + .urge-row { border-top: 1px solid var(--line); }
.intensity { display: inline-flex; gap: 3px; } .intensity i { width: 6px; height: 14px; border-radius: 2px; background: var(--surface-3); } .intensity i.on { background: var(--c-rose); }

/* ---------- stats ---------- */
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding-bottom: 6px; }
.heatmap i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-3); display: block; }
.heatmap i[data-l="1"] { background: color-mix(in srgb, var(--accent) 30%, var(--surface-3)); } .heatmap i[data-l="2"] { background: color-mix(in srgb, var(--accent) 55%, var(--surface-3)); } .heatmap i[data-l="3"] { background: color-mix(in srgb, var(--accent) 80%, var(--surface-3)); } .heatmap i[data-l="4"] { background: var(--accent); }
.heatmap i[data-l="x"] { background: color-mix(in srgb, var(--bad) 45%, var(--surface-3)); }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); margin-top: 6px; } .heat-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--surface-3); }
/* charts: fixed plot height at any width; shapes stretch, labels are HTML at their real size */
.cchart { display: flex; width: 100%; }
.cc-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.cc-plot { position: relative; width: 100%; height: var(--ch, 128px); border-bottom: 1px solid var(--line-2); }
.cc-plot::before, .cc-ghost, .cc-bar { content: ''; position: absolute; bottom: 0; left: 50%; width: min(26px, 62%); transform: translateX(-50%); border-radius: 5px 5px 2px 2px; }
.cc-plot::before { top: 0; background: color-mix(in srgb, var(--surface-3) 40%, transparent); }
.cc-bar { min-height: 3px; }
.cc-val { position: absolute; left: 50%; transform: translate(-50%, -4px); font-size: 11px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.cc-x { height: 22px; padding-top: 5px; font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.cchart.dense .cc-plot::before, .cchart.dense .cc-ghost, .cchart.dense .cc-bar { width: 64%; border-radius: 3px 3px 1px 1px; }
.lchart { width: 100%; }
.lc-plot { position: relative; height: var(--ch, 138px); }
.lc-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lc-plot svg * { vector-effect: non-scaling-stroke; }
.lchart .axis { stroke: var(--line-2); } .lchart .grid { stroke: var(--line); }
.lc-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface); }
.lc-tag { position: absolute; transform: translate(-50%, calc(-100% - 9px)); font-size: 11px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.ch-x { position: relative; height: 22px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.ch-x span { position: absolute; top: 5px; transform: translateX(-50%); white-space: nowrap; }
.ch-x span.lo { transform: none; } .ch-x span.hi { transform: translateX(-100%); }
.bars-h .bh { display: grid; grid-template-columns: 120px 1fr 40px; gap: 10px; align-items: center; font-size: 13.5px; padding: 5px 0; }
.bars-h .bh .bar { height: 10px; } .bars-h .bh .v { text-align: end; color: var(--ink-2); font-weight: 700; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach { padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-align: center; }
.ach.locked { opacity: .45; filter: grayscale(1); }
.ach .ai { font-size: 28px; } .ach b { display: block; font-size: 13.5px; margin-top: 6px; } .ach span { font-size: 12px; color: var(--ink-2); }

/* ---------- circle ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; margin-bottom: 20px; }
.podium .pod { text-align: center; padding: 18px 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.podium .pod.first { padding-top: 28px; background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.podium .rank { font-family: var(--serif); font-size: 28px; color: var(--accent); }
.lb-row { display: grid; grid-template-columns: 36px auto 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; }
.lb-row + .lb-row { border-top: 1px solid var(--line); }
.lb-row .r { font-family: var(--serif); font-size: 20px; color: var(--ink-3); text-align: center; }
.lb-row.me { background: var(--accent-soft); margin: 0 -18px; padding: 12px 18px; border-radius: 12px; border-top: 0; }
.lb-row .score { font-family: var(--serif); font-size: 20px; }
@media (max-width: 640px) { .podium { grid-template-columns: 1fr; } }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 30px; align-items: start; }
.settings-nav { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 10px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.settings-nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); } .settings-nav a:hover { text-decoration: none; color: var(--ink); }
@media (max-width: 860px) { .settings { grid-template-columns: 1fr; } .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; } .settings-nav a { white-space: nowrap; } }
.section { margin-bottom: 30px; }
.section h2 { margin-bottom: 4px; } .section .sd { color: var(--ink-2); margin-bottom: 18px; }

/* ---------- science ---------- */
.study { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 20px 0; }
.study + .study { border-top: 1px solid var(--line); }
.study .si { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); font-size: 26px; }
.study h3 { margin-bottom: 4px; } .study .cite { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; font-style: italic; }
.study .how { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.study .how b { color: var(--accent); }

/* ---------- misc ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0 } }
.menu { position: absolute; top: 46px; inset-inline-end: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; animation: pop 160ms var(--ease) both; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; color: var(--ink); font-weight: 600; font-size: 14px; text-align: start; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu .mh { padding: 8px 12px 4px; font-size: 12px; color: var(--ink-3); font-weight: 700; }
.pos-rel { position: relative; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.quiet-words { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.quiet-words span { position: absolute; font-family: var(--serif); font-style: italic; color: var(--ink-3); opacity: .22; font-size: 14px; }
.lvl { display: flex; align-items: center; gap: 14px; }
.lvl .ln { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--serif); font-size: 24px; }
.consequence { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); flex-wrap: wrap; }
.consequence .ct { font-weight: 700; } .consequence .cd { font-size: 13px; color: var(--ink-2); }
.timer { font-family: var(--serif); font-size: 56px; text-align: center; line-height: 1; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.fs-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--accent-soft), transparent); font-size: 13px; font-weight: 700; color: var(--accent); }

/* ---------- motion ---------- */
/* Motion follows Settings → Appearance: full by default (as in Lext, even when the device asks for less), reduced
   (short fades, nothing drifting), none, or the device's own setting ("system" resolves to full or reduced). */
[data-motion="none"] *, [data-motion="none"] *::before, [data-motion="none"] *::after { animation: none !important; transition: none !important; }
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after { animation-duration: 160ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 120ms !important; }
html[data-motion="none"], html[data-motion="reduced"] { scroll-behavior: auto; }

/* ---------- RTL ---------- */
html[dir="rtl"] .flip { transform: scaleX(-1); }
html[dir="rtl"] .nav a.active::after { left: 12px; right: 12px; }
html[dir="rtl"] .ltr { direction: ltr; display: inline-block; }
.ltr { direction: ltr; unicode-bidi: isolate; }
