/* =====================================================================
   MyLifeOS design system  ·  tokens → base → layout → components
   Logical properties (inline-start/end) are used so RTL languages work.
   ===================================================================== */

@font-face { font-family: "Noto Sans Devanagari"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/noto-sans-devanagari-devanagari-400-normal.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: "Noto Sans Devanagari"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/noto-sans-devanagari-devanagari-600-normal.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: "Noto Sans Oriya"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/noto-sans-oriya-oriya-400-normal.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0B01-0B77, U+200C-200D, U+20B9, U+25CC; }
@font-face { font-family: "Noto Sans Oriya"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/noto-sans-oriya-oriya-600-normal.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0B01-0B77, U+200C-200D, U+20B9, U+25CC; }

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F6F8FB;
  --surface-2: #EEF2F7;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-2: #475569;
  --text-muted: #536175;
  --primary: #1D4ED8;
  --primary-btn: #1D4ED8;
  --primary-hover: #1E40AF;
  --primary-soft: #E8EEFD;
  --on-primary: #FFFFFF;
  --secondary: #0F766E;
  --secondary-soft: #E2F5F2;
  --success: #15803D;
  --success-soft: #E6F6EC;
  --success-text: #166534;
  --warning: #B45309;
  --warning-soft: #FDF2E2;
  --danger: #B91C1C;
  --danger-soft: #FDECEC;
  --info: #0369A1;
  --info-soft: #E3F2FB;
  --focus: 0 0 0 3px rgba(29, 78, 216, .45);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
  --overlay: rgba(15, 23, 42, .45);

  /* module tints: [soft background, strong icon] */
  --m-blue: #E8EEFD;    --m-blue-i: #1D4ED8;
  --m-indigo: #ECEBFD;  --m-indigo-i: #4338CA;
  --m-green: #E6F6EC;   --m-green-i: #15803D;
  --m-amber: #FDF2E2;   --m-amber-i: #B45309;
  --m-emerald: #E2F5F2; --m-emerald-i: #0F766E;
  --m-rose: #FDECEF;    --m-rose-i: #BE123C;
  --m-sky: #E3F2FB;     --m-sky-i: #0369A1;
  --m-violet: #F1EBFD;  --m-violet-i: #6D28D9;
  --m-orange: #FDEEE3;  --m-orange-i: #C2410C;
  --m-slate: #EEF2F7;   --m-slate-i: #334155;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Oriya", "Helvetica Neue", Arial, sans-serif;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem; --fs-3xl: 1.875rem; --fs-4xl: 2.25rem; --fs-5xl: 3rem;
  --lh: 1.5;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  --sidebar-w: 256px;
  --header-h: 60px;
  --bottom-h: 64px;
  --max-w: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --avatar-ink: #FFFFFF;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220;
  --surface: #111A2E;
  --surface-2: #1A2540;
  --card: #111A2E;
  --border: #26324D;
  --border-strong: #34446A;
  --text: #E6EBF5;
  --text-2: #A9B4CC;
  --text-muted: #8F9BB6;
  --primary: #7EA6FF;
  --primary-btn: #2F5FD0;
  --primary-hover: #3B6FE0;
  --primary-soft: #1B2B52;
  --secondary: #2DD4BF;
  --secondary-soft: #123532;
  --success: #4ADE80;
  --success-soft: #12301F;
  --success-text: #4ADE80;
  --warning: #FBBF24;
  --warning-soft: #35290F;
  --danger: #F87171;
  --danger-soft: #3A1717;
  --info: #38BDF8;
  --info-soft: #0E2C3D;
  --focus: 0 0 0 3px rgba(126, 166, 255, .6);
  --shadow-sm: none;
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
  --overlay: rgba(2, 6, 16, .7);
  --m-blue: #1B2B52;    --m-blue-i: #8DB0FF;
  --m-indigo: #25234D;  --m-indigo-i: #A5A2FF;
  --m-green: #12301F;   --m-green-i: #6EE7A0;
  --m-amber: #35290F;   --m-amber-i: #FCD34D;
  --m-emerald: #123532; --m-emerald-i: #5EEAD4;
  --m-rose: #3A1720;    --m-rose-i: #FDA4AF;
  --m-sky: #0E2C3D;     --m-sky-i: #7DD3FC;
  --m-violet: #2A1D4A;  --m-violet-i: #C4B5FD;
  --m-orange: #3A2112;  --m-orange-i: #FDBA74;
  --m-slate: #1A2540;   --m-slate-i: #CBD5E1;
  --avatar-ink: #0B1220;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: var(--fs-md); line-height: var(--lh); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="hi"] body, html[lang="or"] body { line-height: 1.6; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 var(--s3); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: var(--fs-3xl); } h2 { font-size: var(--fs-2xl); } h3 { font-size: var(--fs-lg); } h4 { font-size: var(--fs-md); }
p { margin: 0 0 var(--s3); }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }
small, .small { font-size: var(--fs-sm); }
.muted { color: var(--text-muted); }
.text-2 { color: var(--text-2); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: var(--s4); top: -60px; z-index: 1000; background: var(--primary-btn); color: #fff; padding: var(--s2) var(--s4); border-radius: var(--r-md); }
.skip-link:focus { top: var(--s4); }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid transparent;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s var(--ease), border-color .15s, color .15s;
  background: var(--surface-2); color: var(--text);
}
.btn:hover { background: var(--border); }
.btn-primary { background: var(--primary-btn); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--card); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn-danger { background: #B91C1C; }
.btn-danger:hover { filter: brightness(.92); }
.btn-lg { min-height: 48px; padding: 0 var(--s6); font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn-sm { min-height: 32px; padding: 0 var(--s3); font-size: var(--fs-xs); }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--on-primary) transparent var(--on-primary) transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s4); min-width: 0; }
.field label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); margin: 0; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: var(--s2) var(--s3); border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text); font: inherit; font-size: var(--fs-md);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { display: flex; gap: var(--s1); align-items: center; color: var(--danger); font-size: var(--fs-sm); margin: 0; }
.check { display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary-btn); flex: none; }
.row { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s4); }
.input-group { position: relative; display: flex; }
.input-group .input { padding-inline-end: 44px; }
.input-group .btn-icon { position: absolute; inset-inline-end: 1px; top: 1px; bottom: 1px; height: auto; min-height: 0; border-radius: var(--r-sm); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--s2); padding: 0; }
.hp-field { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- cards, badges, chips ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: var(--s5); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.card-head h2, .card-head h3 { margin: 0; font-size: var(--fs-md); display: flex; align-items: center; gap: var(--s2); }
.card-foot { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px var(--s2); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-teal { background: var(--secondary-soft); color: var(--secondary); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px var(--s2); border-radius: var(--r-sm); font-size: var(--fs-xs); background: var(--surface-2); color: var(--text-2); text-decoration: none; }
a.chip:hover { background: var(--border); color: var(--text); }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; }
.prio-1 { color: var(--text-muted); } .prio-2 { color: var(--info); } .prio-3 { color: var(--warning); } .prio-4 { color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.c-blue { background: var(--m-blue-i); } .c-teal { background: var(--m-emerald-i); } .c-green { background: var(--m-green-i); }
.c-amber { background: var(--m-amber-i); } .c-rose { background: var(--m-rose-i); } .c-violet { background: var(--m-violet-i); }
.c-sky { background: var(--m-sky-i); } .c-slate { background: var(--m-slate-i); }

.mod-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: inline-grid; place-items: center; flex: none; }
.mod-icon .icon { width: 22px; height: 22px; }
.t-blue { background: var(--m-blue); color: var(--m-blue-i); } .t-indigo { background: var(--m-indigo); color: var(--m-indigo-i); }
.t-green { background: var(--m-green); color: var(--m-green-i); } .t-amber { background: var(--m-amber); color: var(--m-amber-i); }
.t-emerald { background: var(--m-emerald); color: var(--m-emerald-i); } .t-rose { background: var(--m-rose); color: var(--m-rose-i); }
.t-sky { background: var(--m-sky); color: var(--m-sky-i); } .t-violet { background: var(--m-violet); color: var(--m-violet-i); }
.t-orange { background: var(--m-orange); color: var(--m-orange-i); } .t-slate { background: var(--m-slate); color: var(--m-slate-i); }

/* ---------- alerts / flash / toasts ---------- */
.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); border: 1px solid transparent; margin-bottom: var(--s4); font-size: var(--fs-sm); }
.alert .icon { margin-top: 1px; }
.alert p:last-child { margin: 0; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert .alert-body { color: var(--text); flex: 1; }
.alert .alert-body strong { color: inherit; }
.toasts { position: fixed; inset-inline-end: var(--s4); bottom: calc(var(--s4) + env(safe-area-inset-bottom)); z-index: 300; display: flex; flex-direction: column; gap: var(--s2); max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: var(--s3); align-items: center; background: var(--text); color: var(--bg); padding: var(--s3) var(--s4); border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); animation: toast-in .2s var(--ease); }
.toast.toast-error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- dialogs ---------- */
dialog.dialog { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog.dialog::backdrop { background: var(--overlay); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; font-size: var(--fs-lg); }
.dialog-body { padding: var(--s5); overflow: auto; max-height: calc(100vh - 200px); }
.dialog-foot { display: flex; justify-content: flex-end; gap: var(--s3); padding: var(--s4) var(--s5); border-top: 1px solid var(--border); }
@media (max-width: 599px) {
  dialog.dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}

/* ---------- empty / skeleton ---------- */
.empty { text-align: center; padding: var(--s8) var(--s4); color: var(--text-2); }
.empty .mod-icon { margin: 0 auto var(--s3); width: 56px; height: 56px; }
.empty h3 { color: var(--text); }
.empty-sm { padding: var(--s4) 0; text-align: start; color: var(--text-muted); font-size: var(--fs-sm); }

/* =====================================================================
   Public website
   ===================================================================== */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 900px) { .container { padding: 0 var(--s8); } }
.announce { background: var(--primary-soft); color: var(--text); font-size: var(--fs-sm); }
.announce .container { display: flex; gap: var(--s3); align-items: center; justify-content: center; min-height: 40px; text-align: center; }
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; gap: var(--s4); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 800; font-size: var(--fs-lg); color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand img { width: 32px; height: 32px; }
.site-nav { display: none; gap: var(--s1); margin-inline-start: var(--s4); }
.site-nav a { color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; padding: var(--s2) var(--s3); border-radius: var(--r-sm); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-actions { margin-inline-start: auto; display: flex; gap: var(--s2); align-items: center; }
.header-actions .hide-sm { display: none; }
@media (min-width: 900px) { .site-nav { display: flex; } .header-actions .hide-sm { display: inline-flex; } .site-menu-btn { display: none; } }
.mobile-nav { border-top: 1px solid var(--border); padding: var(--s3) 0 var(--s4); }
.mobile-nav a { display: block; padding: var(--s3) var(--s2); color: var(--text); text-decoration: none; border-radius: var(--r-sm); }
.mobile-nav a:hover { background: var(--surface-2); }

.hero { padding: var(--s12) 0 var(--s10); background: radial-gradient(900px 400px at 85% -10%, var(--primary-soft), transparent 70%), radial-gradient(700px 360px at -10% 10%, var(--secondary-soft), transparent 70%); }
.hero-grid { display: grid; gap: var(--s10); align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: 1fr 1.05fr; } .hero { padding: var(--s16) 0; } }
.eyebrow { display: inline-flex; align-items: center; gap: var(--s2); padding: 4px var(--s3); border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--border); font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); margin-bottom: var(--s4); }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -.03em; margin-bottom: var(--s4); }
.hero h1 .accent { background: linear-gradient(90deg, var(--primary), var(--secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: var(--fs-lg); color: var(--text-2); max-width: 36em; margin-bottom: var(--s6); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s5); }
.hero-points { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.hero-points li { display: flex; align-items: center; gap: var(--s2); }
.hero-points .icon { color: var(--success); width: 18px; height: 18px; }

/* app preview mock built from real components (labelled as preview) */
.preview { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.preview-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.preview-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.preview-bar em { margin-inline-start: auto; font-style: normal; font-size: var(--fs-xs); color: var(--text-muted); }
.preview-body { display: grid; grid-template-columns: 150px 1fr; min-height: 320px; }
.preview-side { border-inline-end: 1px solid var(--border); padding: var(--s3); display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
.preview-side div { display: flex; gap: var(--s2); align-items: center; padding: 6px var(--s2); border-radius: var(--r-sm); font-size: var(--fs-xs); color: var(--text-2); }
.preview-side div.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.preview-main { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.preview-stats .card { padding: var(--s3); }
.preview-stats b { display: block; font-size: var(--fs-xl); }
.preview-stats small { color: var(--text-muted); font-size: 11px; }
.preview .task-row { padding: 8px 10px; }
@media (max-width: 599px) { .preview-body { grid-template-columns: 1fr; } .preview-side { display: none; } }

.section { padding: var(--s16) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 44em; margin: 0 auto var(--s10); }
.section-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); letter-spacing: -.02em; }
.section-head p { color: var(--text-2); font-size: var(--fs-lg); }
.grid { display: grid; gap: var(--s5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.feature-card { display: flex; flex-direction: column; gap: var(--s3); }
.feature-card h3 { margin: 0; }
.feature-card p { color: var(--text-2); margin: 0; font-size: var(--fs-sm); }
.module-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s4); text-align: center; }
.module-strip div { display: flex; flex-direction: column; align-items: center; gap: var(--s2); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.split { display: grid; gap: var(--s10); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } .split.reverse > :first-child { order: 2; } }
.ticks { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s3); }
.ticks li { display: flex; gap: var(--s3); align-items: flex-start; color: var(--text-2); }
.ticks .icon { color: var(--secondary); margin-top: 2px; }
.steps { counter-reset: step; display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.step { position: relative; padding-top: var(--s2); }
.step-num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-btn); color: #fff; font-weight: 700; margin-bottom: var(--s3); }
.price-card { display: flex; flex-direction: column; gap: var(--s3); }
.price-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-md); }
.price { font-size: var(--fs-4xl); font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); }
.faq details { border: 1px solid var(--border); border-radius: var(--r-md); padding: 0 var(--s4); margin-bottom: var(--s3); background: var(--card); }
.faq summary { cursor: pointer; padding: var(--s4) 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: var(--s3); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: var(--fs-xl); line-height: 1; color: var(--text-muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--text-2); }
.cta-band { background: linear-gradient(120deg, var(--primary-btn), #0F766E); color: #fff; border-radius: 20px; padding: var(--s12) var(--s6); text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta-band p { color: rgba(255, 255, 255, .88); }
.cta-band .btn-primary { background: #fff; color: #1D4ED8; }
.cta-band .btn-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.prose { max-width: 760px; }
.prose h2 { margin-top: var(--s8); font-size: var(--fs-xl); }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-inline-start: var(--s5); }
.page-hero { padding: var(--s12) 0 var(--s6); }
.page-hero p { color: var(--text-2); font-size: var(--fs-lg); max-width: 44em; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: var(--s12) 0 var(--s6); margin-top: var(--s12); font-size: var(--fs-sm); }
.footer-grid { display: grid; gap: var(--s8); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.site-footer h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between; align-items: center; border-top: 1px solid var(--border); margin-top: var(--s8); padding-top: var(--s5); color: var(--text-muted); }
.pref-form { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.pref-form .select { min-height: 36px; width: auto; font-size: var(--fs-sm); padding: 4px var(--s2); }

/* auth pages */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: start center; padding: var(--s10) var(--s4); background: radial-gradient(700px 360px at 50% -10%, var(--primary-soft), transparent 70%); }
.auth-card { width: min(440px, 100%); padding: var(--s8); }
.auth-card h1 { font-size: var(--fs-2xl); }
.auth-card .sub { color: var(--text-2); margin-bottom: var(--s6); }
.auth-alt { text-align: center; margin-top: var(--s5); font-size: var(--fs-sm); color: var(--text-2); }
@media (max-width: 480px) { .auth-card { padding: var(--s5); } }

/* =====================================================================
   Application shell
   ===================================================================== */
.app { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 900px) { .app { grid-template-columns: var(--sidebar-w) 1fr; } }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); z-index: 120; background: var(--surface);
  border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .2s var(--ease);
}
[dir="rtl"] .sidebar { transform: translateX(100%); }
.sidebar.open { transform: none !important; box-shadow: var(--shadow-lg); }
@media (min-width: 900px) {
  .sidebar { position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); transform: none !important; box-shadow: none !important; }
  .sidebar-close { display: none; }
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s4) var(--s2); }
.sidebar nav { flex: 1; overflow-y: auto; padding: var(--s2) var(--s3) var(--s6); }
.nav-group { margin-bottom: var(--s2); }
.nav-group > button { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: var(--s2) var(--s3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--text-muted); border-radius: var(--r-sm); }
.nav-group > button:focus-visible { box-shadow: var(--focus); }
.nav-group > button .icon { width: 14px; height: 14px; transition: transform .15s; }
.nav-group.collapsed > button .icon { transform: rotate(-90deg); }
[dir="rtl"] .nav-group.collapsed > button .icon { transform: rotate(90deg); }
.nav-group.collapsed ul { display: none; }
.nav-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav-link { display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s3); border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-link .soon { margin-inline-start: auto; font-size: 10px; color: var(--text-muted); font-weight: 600; }
.backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 110; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 60; height: var(--header-h); display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s4); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .topbar { padding: 0 var(--s6); } .topbar .menu-btn, .topbar .brand-sm { display: none; } }
.brand-sm img { width: 28px; height: 28px; }
.search-trigger { flex: 1; max-width: 480px; display: flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-align: start; }
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd { margin-inline-start: auto; font-family: inherit; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; background: var(--card); }
@media (max-width: 599px) { .search-trigger { flex: 0 0 40px; padding: 0; justify-content: center; } .search-trigger span, .search-trigger kbd { display: none; } }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s1); }
.menu { position: relative; }
.menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 230px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: var(--s2); z-index: 80; }
.menu-panel a, .menu-panel button { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text); cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover, .menu-panel a:focus-visible, .menu-panel button:focus-visible { background: var(--surface-2); }
.menu-panel .menu-label { padding: var(--s2) var(--s3) var(--s1); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; }
.menu-panel hr { margin: var(--s2) 0; }
.menu-panel .is-active { color: var(--primary); font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-btn), var(--secondary)); color: #fff; font-weight: 700; font-size: var(--fs-sm); }
.content { padding: var(--s5) var(--s4) calc(var(--bottom-h) + var(--s8)); width: 100%; max-width: var(--max-w); margin: 0 auto; }
@media (min-width: 900px) { .content { padding: var(--s6) var(--s8) var(--s12); } }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s5); }
.page-head h1 { font-size: var(--fs-2xl); margin: 0; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.breadcrumbs { display: flex; gap: var(--s2); align-items: center; font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--s2); }
.breadcrumbs a { color: var(--text-2); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.bottom-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 90; height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5, 1fr); }
@media (min-width: 900px) { .bottom-nav { display: none; } }
.bottom-nav a, .bottom-nav button { all: unset; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.bottom-nav a[aria-current="page"] { color: var(--primary); }
.bottom-nav a:focus-visible, .bottom-nav button:focus-visible { box-shadow: inset var(--focus); }
.bottom-nav .quick { color: var(--on-primary); }
.bottom-nav .quick span.fab { width: 46px; height: 46px; border-radius: 50%; background: var(--primary-btn); display: grid; place-items: center; box-shadow: var(--shadow-md); margin-top: -18px; }
.bottom-nav .quick em { font-style: normal; color: var(--text-muted); }

.banner { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); border-radius: var(--r-md); margin-bottom: var(--s4); font-size: var(--fs-sm); background: var(--info-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.banner.warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.offline-pill { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 400; background: var(--text); color: var(--bg); padding: 6px var(--s4); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; display: flex; gap: var(--s2); align-items: center; box-shadow: var(--shadow-md); }

/* ---------- dashboard ---------- */
.welcome { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); align-items: flex-end; margin-bottom: var(--s5); }
.welcome h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: var(--s1); }
.welcome p { color: var(--text-2); margin: 0; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.qa { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); border: 1px solid var(--border); background: var(--card); color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; font-family: inherit; text-align: start; }
.qa:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.qa .mod-icon { width: 34px; height: 34px; }
.qa small { display: block; font-weight: 500; color: var(--text-muted); font-size: 11px; }
@media (max-width: 599px) { .quick-actions { grid-template-columns: repeat(4, 1fr); gap: var(--s2); } .qa { flex-direction: column; text-align: center; padding: var(--s2); font-size: 11px; } .qa small { display: none; } }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); text-decoration: none; color: var(--text); }
a.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat .num { font-size: var(--fs-3xl); font-weight: 800; line-height: 1; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stat { min-width: 0; }
@media (max-width: 480px) { .stat .num { font-size: var(--fs-2xl); } }
.stat .lbl { font-size: var(--fs-sm); color: var(--text-2); font-weight: 600; }
.stat.is-soon .num { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); line-height: 1.4; }
.stat.alert-danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.dash-grid { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 1000px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } .dash-grid .span-2 { grid-column: span 2; } }
.widget-soon { display: flex; gap: var(--s3); align-items: flex-start; color: var(--text-2); font-size: var(--fs-sm); }
.widget-soon p { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.timeline > li { display: grid; grid-template-columns: 64px 1fr; gap: var(--s3); align-items: start; }
.timeline > li > .time { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; padding-top: 10px; text-align: end; }
.insight { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.insight:last-child { border-bottom: 0; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: var(--s3); padding: var(--s2) 0; font-size: var(--fs-sm); border-bottom: 1px solid var(--border); align-items: baseline; }
.activity li:last-child { border-bottom: 0; }
.activity time { margin-inline-start: auto; color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap; }
.customize-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.customize-list li { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--r-sm); }
.customize-list li .check { flex: 1; }

/* ---------- tasks ---------- */
.tabs { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin-bottom: var(--s4); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); white-space: nowrap; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); }
.filter-bar .input, .filter-bar .select { min-height: 38px; width: auto; font-size: var(--fs-sm); }
.filter-bar .input[type="search"] { flex: 1 1 200px; }
.filter-bar .select { flex: 0 1 auto; max-width: 180px; }
.quick-add { display: flex; gap: var(--s2); margin-bottom: var(--s4); }
.quick-add .input { flex: 1; }
.task-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.task-row { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); position: relative; }
.task-list > li:last-child .task-row, .task-list > .task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface); }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-row .select-box { margin-top: 3px; }
.task-row .select-box input { width: 16px; height: 16px; accent-color: var(--primary-btn); }
.complete-btn { all: unset; box-sizing: border-box; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; flex: none; margin-top: 1px; color: transparent; transition: background .15s, border-color .15s; }
.complete-btn:hover { border-color: var(--success); color: var(--success); }
.complete-btn:focus-visible { box-shadow: var(--focus); }
.complete-btn .icon { width: 14px; height: 14px; }
.complete-btn[aria-pressed="true"] { background: var(--success); border-color: var(--success); color: #fff; }
.prio-4 + .complete-btn, .task-row.p4 .complete-btn { border-color: var(--danger); }
.task-row.p3 .complete-btn { border-color: var(--warning); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.task-title:hover { text-decoration: underline; }
.task-meta { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: 4px; align-items: center; font-size: var(--fs-xs); color: var(--text-muted); }
.due { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.due.overdue { color: var(--danger); }
.due.today { color: var(--secondary); }
.task-actions { display: flex; gap: 2px; opacity: .8; }
.bulk-bar { position: sticky; top: calc(var(--header-h) + 8px); z-index: 40; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; padding: var(--s2) var(--s3); background: var(--text); color: var(--bg); border-radius: var(--r-md); margin-bottom: var(--s3); box-shadow: var(--shadow-lg); }
.bulk-bar .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.bulk-bar .btn:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); }
.bulk-bar .select { width: auto; min-height: 32px; font-size: var(--fs-xs); padding: 2px var(--s2); }
.pagination { display: flex; gap: var(--s2); justify-content: center; align-items: center; margin-top: var(--s5); font-size: var(--fs-sm); }
.detail-grid { display: grid; gap: var(--s5); }
@media (min-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.checklist { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.checklist li { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
.checklist li.done span { text-decoration: line-through; color: var(--text-muted); }
.checklist form { margin: 0; }
.checklist .grow { flex: 1; overflow-wrap: anywhere; }
.progress { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--secondary); border-radius: inherit; }
.history { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.history li { padding: var(--s2) 0; border-bottom: 1px solid var(--border); color: var(--text-2); }
.history time { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); font-size: var(--fs-sm); margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.inline-form { display: inline; margin: 0; }
.stack { display: grid; gap: var(--s4); align-content: start; }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.disabled-note { display: flex; gap: var(--s2); align-items: center; padding: var(--s3); border: 1px dashed var(--border-strong); border-radius: var(--r-md); color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- command palette ---------- */
.palette { width: min(640px, calc(100vw - 24px)); }
.palette .dialog-body { padding: 0; }
.palette-input { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.palette-input input { all: unset; flex: 1; font-size: var(--fs-lg); color: var(--text); }
.palette-results { list-style: none; margin: 0; padding: var(--s2); max-height: 60vh; overflow: auto; }
.palette-results li a { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: var(--fs-sm); }
.palette-results li a[aria-selected="true"], .palette-results li a:hover { background: var(--primary-soft); }
.palette-results .group { padding: var(--s2) var(--s3) var(--s1); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; }
.palette-results .meta { margin-inline-start: auto; color: var(--text-muted); font-size: var(--fs-xs); }

/* ---------- settings ---------- */
.settings-nav { display: flex; gap: var(--s1); overflow-x: auto; margin-bottom: var(--s5); border-bottom: 1px solid var(--border); }
.settings-nav a { padding: var(--s2) var(--s3); text-decoration: none; color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.settings-nav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { text-align: start; padding: var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--surface); }
.table tr:last-child td { border-bottom: 0; }
@media (max-width: 699px) {
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: block; border-bottom: 1px solid var(--border); padding: var(--s2) 0; }
  .table.stack-sm td { display: flex; justify-content: space-between; gap: var(--s3); border: 0; padding: var(--s1) var(--s3); }
  .table.stack-sm td::before { content: attr(data-label); color: var(--text-muted); font-weight: 600; }
}
.more-grid { display: grid; gap: var(--s5); }
.more-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.more-grid a { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); text-decoration: none; color: var(--text); font-size: var(--fs-sm); font-weight: 600; background: var(--card); }
.more-grid a small { display: block; color: var(--text-muted); font-weight: 500; font-size: 11px; }

/* error pages */
.error-page { text-align: center; padding: var(--s16) var(--s4); }
.error-page .code { font-size: var(--fs-5xl); font-weight: 800; color: var(--primary); }

@media print {
  .sidebar, .topbar, .bottom-nav, .site-header, .site-footer, .toasts, .btn, .no-print, .banner { display: none !important; }
  .app { display: block; }
  .emergency-card { border: 2px solid #000; box-shadow: none; }
}

/* ---------- utilities ---------- */
.mt { margin-top: var(--s4); }
.center { text-align: center; justify-content: center; }
.h4 { font-size: var(--fs-md); display: flex; align-items: center; gap: var(--s2); }
.section-sm { padding: var(--s6) 0; }
.js .js-hide { display: none; }
.error-page .cluster { justify-content: center; }
.error-page .mod-icon { width: 56px; height: 56px; margin-bottom: var(--s3); }
@media (max-width: 479px) { .hide-xs { display: none !important; } }
.dash-item { min-width: 0; }
.dash-item.span-2 { grid-column: 1 / -1; }
.dash-item > .stats { margin-bottom: 0; }
details.card > summary { list-style: none; cursor: pointer; margin: 0; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: var(--s4); }
details.card > summary h2 { margin: 0; font-size: var(--fs-md); display: flex; gap: var(--s2); align-items: center; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
progress.progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin-bottom: var(--s2); }
progress.progress::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--r-pill); }
progress.progress::-webkit-progress-value { background: var(--secondary); border-radius: var(--r-pill); }
progress.progress::-moz-progress-bar { background: var(--secondary); border-radius: var(--r-pill); }
.empty .cluster { justify-content: center; }
.empty .badge { margin-bottom: var(--s2); }
.description-title { overflow-wrap: anywhere; }
.module-strip .badge { font-size: 10px; }
.task-row .menu-panel { min-width: 210px; }
.quick-add.mt { margin-bottom: 0; }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Phase 2: repeat, reminders, calendar, notifications, My Day ---------- */
.icon-xs { width: 12px; height: 12px; }
.input-sm { min-height: 32px; padding: 2px var(--s2); width: auto; }
:not(table).stack-sm { display: grid; gap: var(--s2); align-content: start; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); font-size: var(--fs-sm); }
.plain-list li { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.repeat-fields, .reminder-fields { margin-top: var(--s4); }
.check-chip { display: inline-flex; align-items: center; gap: var(--s1); padding: 4px var(--s3); border: 1px solid var(--border); border-radius: var(--r-pill); font-size: var(--fs-sm); cursor: pointer; background: var(--card); }
.check-chip input { accent-color: var(--primary-btn); width: 16px; height: 16px; margin: 0; }
.check-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.check-chip:focus-within { box-shadow: var(--focus); }
.subtle-details { margin-top: var(--s2); }
.subtle-details > summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--primary); padding: var(--s2) 0; }
.weekday-picks { border: 0; padding: 0; margin: var(--s2) 0 0; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.cal-toolbar .cluster { align-items: center; }
.cal-heading { margin: 0 var(--s2); font-size: var(--fs-lg); }
.cal-month { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-row + .cal-row { border-top: 1px solid var(--border); }
.cal-wd { padding: var(--s2); font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-align: center; text-transform: uppercase; background: var(--surface-2); }
.cal-cell { min-height: 108px; padding: var(--s1); border-inline-start: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-cell:first-child { border-inline-start: 0; }
.cal-cell.is-other { background: var(--surface-2); }
.cal-cell.is-other .cal-daynum { color: var(--text-muted); }
.cal-daynum { align-self: flex-start; min-width: 28px; height: 28px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 600; color: var(--text); text-decoration: none; }
.cal-daynum:hover { background: var(--surface-2); }
.cal-cell.is-today .cal-daynum { background: var(--primary-btn); color: #fff; }
.cal-items { display: grid; gap: 2px; min-width: 0; }
.cal-item { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 4px; border-radius: var(--r-sm); font-size: var(--fs-xs); color: var(--text); text-decoration: none; background: var(--surface-2); }
.cal-item:hover { background: var(--primary-soft); }
.cal-item .cal-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.cal-item .cal-time { color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }
.cal-item.cal-task { background: transparent; border: 1px dashed var(--border-strong); }
.cal-item.is-done .cal-title { text-decoration: line-through; color: var(--text-muted); }
.cal-more { font-size: var(--fs-xs); color: var(--primary); padding: 0 4px; }
.cal-dots { display: none; gap: 3px; padding: 0 4px; }
.cal-dots .dot { width: 6px; height: 6px; }
@media (max-width: 719px) {
  .cal-cell { min-height: 56px; align-items: center; }
  .cal-items { display: none; }
  .cal-dots { display: flex; }
  .cal-daynum { align-self: center; }
}
.cal-week { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
@media (min-width: 1100px) { .cal-week { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.cal-wcol { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3); min-height: 120px; min-width: 0; }
.cal-wcol.is-today { border-color: var(--primary); box-shadow: inset 0 3px 0 var(--primary); }
.cal-wcol h3 { font-size: var(--fs-sm); margin: 0 0 var(--s2); }
.cal-wcol h3 a { text-decoration: none; }
.cal-wcol .cal-item { white-space: normal; }
.cal-wcol .cal-item .cal-title { white-space: normal; }
.cal-add { position: absolute; top: var(--s2); inset-inline-end: var(--s2); color: var(--text-muted); display: inline-flex; padding: 4px; border-radius: var(--r-sm); }
.cal-add:hover { background: var(--surface-2); color: var(--primary); }
.cal-agenda { display: grid; gap: var(--s3); }
.cal-aday .card-head h3 { font-size: var(--fs-md); }
.cal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.cal-list li { display: grid; grid-template-columns: 140px 1fr; gap: var(--s1) var(--s3); align-items: center; }
.cal-list li > .muted { grid-column: 2; }
.cal-list .cal-item { font-size: var(--fs-sm); padding: var(--s2); }
.cal-list .cal-item .cal-title { white-space: normal; }
.cal-list .cal-item .cal-time { display: none; }
.cal-when { font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
@media (max-width: 479px) { .cal-list li { grid-template-columns: 1fr; } .cal-list li > .muted { grid-column: 1; } }
.prose { font-size: var(--fs-sm); line-height: 1.6; overflow-wrap: anywhere; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.notif { display: flex; gap: var(--s3); align-items: flex-start; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.notif.is-unread { border-inline-start: 4px solid var(--primary); }
.notif.is-unread .notif-text { font-weight: 600; }
.notif-main { flex: 1; min-width: 0; }
.notif-main p { margin: 0; overflow-wrap: anywhere; }
.notif-actions { flex: none; }
@media (max-width: 599px) { .notif { flex-wrap: wrap; } .notif-actions { width: 100%; } }
.bell-btn { position: relative; }
.bell-count { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.mb { margin-bottom: var(--s3); }
.device-list li { justify-content: space-between; }

/* ---------- Phase 3: family, children, vault, emergency ---------- */
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.seg a { display: inline-flex; flex: none; white-space: nowrap; align-items: center; gap: var(--s2); padding: 6px var(--s3); border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); text-decoration: none; }
.seg a[aria-current="page"] { background: var(--primary-btn); color: #fff; }
.seg button { display: inline-flex; flex: none; white-space: nowrap; align-items: center; gap: var(--s2); padding: 6px var(--s3); border: 0; border-radius: 999px; background: none; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--primary-btn); color: #fff; }
/* Weather Planner */
.wx-now { display: flex; align-items: center; gap: var(--s3); margin: var(--s3) 0; }
.wx-temp { font-size: var(--fs-2xl); font-weight: 800; line-height: 1.1; margin: 0; }
.wx-temp .muted { font-size: var(--fs-base); font-weight: 600; }
.wx-cond { display: inline-flex; align-items: center; gap: 6px; }
.table th.num, .table td.num { text-align: end; white-space: nowrap; }
.mb { margin-bottom: var(--s4); }
.avatar[class*="c-"] { background-image: none; color: var(--avatar-ink); }
.avatar.c-blue { background: var(--m-blue-i); } .avatar.c-teal { background: var(--m-emerald-i); } .avatar.c-green { background: var(--m-green-i); }
.avatar.c-amber { background: var(--m-amber-i); } .avatar.c-rose { background: var(--m-rose-i); } .avatar.c-violet { background: var(--m-violet-i); }
.avatar.c-sky { background: var(--m-sky-i); } .avatar.c-slate { background: var(--m-slate-i); }
.stat > div { display: flex; flex-direction: column; gap: 2px; }
.people-main .badge { align-self: flex-start; }
.avatar-lg { width: 48px; height: 48px; font-size: var(--fs-md); flex: none; }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.people-list li { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
.people-list li:last-child { border-bottom: 0; }
.people-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.people-main a { text-decoration: none; color: var(--text); }
.child-card { display: flex; gap: var(--s3); align-items: flex-start; text-decoration: none; color: var(--text); }
.child-card > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.child-card:hover { border-color: var(--primary); }
.doc-preview { display: block; max-width: 100%; max-height: 480px; height: auto; border-radius: var(--r-md, 10px); border: 1px solid var(--border); }
.cal-when.is-late, .due.is-late { color: var(--danger); }
.contact-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) 0; }
.emergency-card .kv dd { white-space: normal; }
.inline-form { display: inline; }
.table td .badge { margin-inline-start: 4px; }
.text-success { color: var(--success-text); }
.cal-item.cal-due { background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }
.cal-item.cal-dated { background: var(--secondary-soft); border: 1px solid color-mix(in srgb, var(--secondary) 30%, var(--border)); }
.chart { display: block; max-width: 100%; height: auto; }
