/* Life Dashboard — tokens follow the legacy pages (legacy/*.html). Every colour is a token,
   defined for light and dark. Dark is applied by prefers-color-scheme unless the user
   picked light, or by data-theme="dark". */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --surface-2: #f1f0ec;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #6f6d68;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #1f6bc4;
  --on-accent: #ffffff;
  --status-good: #0a7d0a;
  --status-warn: #a86f00;
  --status-warn-bg: #fff4d6;
  --status-serious: #ec835a;
  --status-critical: #c0392b;
  --status-critical-bg: #fde8e6;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);

  /* category colours (schedule dots, tag chips) */
  --c-work: #2a78d6;
  --c-family: #eb6834;
  --c-social: #0e8fa3;
  --c-career: #1baf7a;
  --c-project: #e87ba4;
  --c-rest: #898781;
  --c-leisure: #8b008b;
  --c-health: #ff6347;
  --c-interviewPrep: #4a3aa7;
  --c-prayer: #7a5cff;
  --c-hospital: #c0392b;
  --c-milestone: #ec835a;
  --c-none: #b4b2ab;

  --radius: 12px;
  --tabbar-h: 62px;
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface-1: #1a1a19;
    --surface-2: #232321;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #9a988f;
    --grid: #2c2c2a;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --on-accent: #0d1b2a;
    --status-good: #2fbf4a;
    --status-warn: #f4b63d;
    --status-warn-bg: #2e2510;
    --status-serious: #f0946f;
    --status-critical: #ef6a5c;
    --status-critical-bg: #331614;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    --c-work: #3987e5;
    --c-family: #f07a4a;
    --c-social: #22b0c4;
    --c-career: #22c48a;
    --c-project: #ee8fb3;
    --c-rest: #a3a198;
    --c-leisure: #c65ec6;
    --c-health: #ff7b63;
    --c-interviewPrep: #8a7cf0;
    --c-prayer: #9a84ff;
    --c-hospital: #ef6a5c;
    --c-milestone: #f0946f;
    --c-none: #5e5d59;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface-1: #1a1a19;
  --surface-2: #232321;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #9a988f;
  --grid: #2c2c2a;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5;
  --on-accent: #0d1b2a;
  --status-good: #2fbf4a;
  --status-warn: #f4b63d;
  --status-warn-bg: #2e2510;
  --status-serious: #f0946f;
  --status-critical: #ef6a5c;
  --status-critical-bg: #331614;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  --c-work: #3987e5;
  --c-family: #f07a4a;
  --c-social: #22b0c4;
  --c-career: #22c48a;
  --c-project: #ee8fb3;
  --c-rest: #a3a198;
  --c-leisure: #c65ec6;
  --c-health: #ff7b63;
  --c-interviewPrep: #8a7cf0;
  --c-prayer: #9a84ff;
  --c-hospital: #ef6a5c;
  --c-milestone: #f0946f;
  --c-none: #5e5d59;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  background: var(--page);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.app-head {
  position: sticky; top: 0; z-index: 5;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}
.app-head h1 { font-size: 18px; font-weight: 700; max-width: 760px; margin: 0 auto; }

main { max-width: 760px; margin: 0 auto; padding: 16px; outline: none; }
.loading { color: var(--text-muted); text-align: center; padding: 40px 0; }

/* ---------- bottom tab bar ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface-1);
  border-top: 1px solid var(--border);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; color: var(--text-muted); text-decoration: none;
  font-size: 11px; font-weight: 600; -webkit-tap-highlight-color: transparent;
}
.tabbar a span { max-width: 100%; padding: 0 2px; text-align: center; line-height: 1.15; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--accent); }

/* ---------- banners ---------- */
#banners { max-width: 760px; margin: 0 auto; padding: 0 16px; }
#banners:empty { display: none; }
.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-top: 12px; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-1); font-size: 13.5px;
}
.banner p { flex: 1 1 180px; }
.banner.warn { background: var(--status-warn-bg); border-color: var(--status-warn); }
.banner.error { background: var(--status-critical-bg); border-color: var(--status-critical); }
.banner .actions { display: flex; gap: 8px; }

/* ---------- cards, buttons, forms ---------- */
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.card .desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--page); color: var(--text-primary);
  font-size: 14px; font-weight: 600; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--grid); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--status-critical); border-color: var(--status-critical); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.segmented button {
  min-height: 38px; padding: 6px 14px; border: 0; background: var(--page); cursor: pointer; font-size: 14px;
}
.segmented button + button { border-inline-start: 1px solid var(--border); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv-list dt { color: var(--text-muted); }
.kv-list dd { margin: 0; font-weight: 600; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { font-size: 12.5px; color: var(--text-muted); }
.stat .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .note { font-size: 12px; color: var(--text-secondary); }
.stat .value .value-sm { font-size: 17px; line-height: 1.9; }

/* ---------- schedule rows (same look as legacy) ---------- */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.t-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.t-time { min-width: 76px; color: var(--text-muted); font-size: 12px; padding-top: 2px; flex: none; }
.t-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; }
.t-txt { color: var(--text-secondary); }
.t-row.hi .t-txt { font-weight: 700; color: var(--text-primary); }
.t-row.done .t-txt { text-decoration: line-through; color: var(--text-muted); font-weight: 400; }
.t-row.emergency .t-time { color: var(--c-hospital); font-weight: 700; }

.placeholder {
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px;
  color: var(--text-muted); font-size: 13.5px; text-align: center;
}

/* ---------- dialog ---------- */
dialog {
  border: 1px solid var(--border); border-radius: 14px; padding: 18px;
  background: var(--surface-1); color: var(--text-primary); max-width: min(420px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog h2 { font-size: 17px; margin-bottom: 8px; }
dialog p { font-size: 14px; color: var(--text-secondary); margin-bottom: 14px; }
dialog ul { margin: 0 0 14px; padding-inline-start: 18px; font-size: 13px; color: var(--status-critical); }

@media (prefers-reduced-motion: no-preference) {
  .banner { animation: slide-in .2s ease-out; }
  @keyframes slide-in { from { opacity: 0; transform: translateY(-4px); } }
}

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 12.5px; border: 1px solid var(--border); background: var(--page); color: var(--text-secondary);
}
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--chip, var(--c-none)); }
.link { color: var(--accent); font-weight: 600; text-decoration: none; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.list li .muted { font-variant-numeric: tabular-nums; }

/* ---------- day card (legacy schedule look) ---------- */
.day-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
}
.day-card.milestone { border-color: var(--status-serious); box-shadow: var(--shadow); }
.day-card .d-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin-bottom: 12px; }
.day-card .d-head[role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.day-card .d-head[role="button"] h3::before { content: '▾'; display: inline-block; margin-inline-end: 8px; font-size: 12px; color: var(--text-muted); }
.day-card.collapsed .d-head[role="button"] h3::before { content: '◂'; }
.day-card.collapsed { padding-top: 12px; padding-bottom: 12px; }
.day-card.collapsed .d-head { margin-bottom: 0; }
.day-card h3 { font-size: 16px; font-weight: 700; }
.d-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.d-tag { font-size: 12px; color: var(--text-muted); }
.d-count { font-size: 12px; color: var(--text-muted); }
.lock-badge, .vac-badge {
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 9px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--page); color: var(--text-muted);
}
.vac-badge { margin-inline-start: 8px; border-color: var(--c-social); color: var(--c-social); vertical-align: middle; }

.t-check { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.t-row { align-items: center; min-height: 32px; }
.t-row .t-time, .t-row .t-txt { cursor: pointer; }
.t-row .t-dot { margin-top: 0; }
.day-card.locked .t-check { cursor: not-allowed; opacity: .55; }
.row-del {
  margin-inline-start: auto; flex: none; width: 32px; height: 32px; padding: 0; line-height: 1;
  border: none; border-radius: 8px; background: none; color: var(--text-muted); font-size: 18px; cursor: pointer;
}
.row-del:hover, .row-del:focus-visible { background: var(--grid); color: var(--status-critical); }

.conflict {
  margin-bottom: 12px; padding: 8px 12px; border-radius: 10px; font-size: 13px;
  background: var(--status-warn-bg); border: 1px solid var(--status-warn); color: var(--text-primary);
}
.conflict p + p { margin-top: 4px; }

.day-tools { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 10px; }
.add-task-row { display: flex; gap: 6px; flex-wrap: wrap; }
.add-task-row input[type="text"] {
  flex: 1 1 100%; min-height: 40px; font-size: 15px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--page);
}
.add-task-row select {
  flex: 1 1 auto; min-height: 36px; font-size: 14px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--page);
}
.btn.emergency { color: var(--c-hospital); border-color: var(--c-hospital); }
.tools-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.vac-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; min-height: 32px; }
.vac-toggle input { width: 18px; height: 18px; accent-color: var(--c-social); }
.log-output { display: flex; flex-direction: column; gap: 8px; }
.log-text {
  width: 100%; font-size: 13px; padding: 8px 10px; resize: vertical;
  border: 1px solid var(--border); border-radius: 10px; background: var(--page);
}
.log-status { margin: 0; }
.log-status.ok { color: var(--status-good); }
.log-status.manual { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text-secondary); }
.ok-text { color: var(--status-good); font-weight: 600; }
.link-btn {
  align-self: flex-start; background: none; border: 0; padding: 4px 0; color: var(--accent);
  font-weight: 600; cursor: pointer;
}

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.field input[type="date"], .field input[type="text"], .field input[type="number"], .field select {
  min-height: 42px; padding: 8px 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--page);
}
.chip.toggle { cursor: pointer; min-height: 34px; padding: 4px 12px; font-size: 13.5px; }
.chip.toggle[aria-pressed="true"] { border-color: var(--chip); background: var(--surface-2); color: var(--text-primary); font-weight: 700; }
.chip.toggle[aria-pressed="false"]::before { opacity: .5; }
ul.errors { margin: 6px 0 0; padding-inline-start: 18px; color: var(--status-critical); }

/* ---------- schedule screen ---------- */
.progress-card .p-bar-track { height: 10px; border-radius: 999px; background: var(--grid); overflow: hidden; margin-top: 8px; }
.progress-card .p-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .2s; width: 0; }
.progress-card .p-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

.month-capsule { margin-bottom: 18px; }
.month-capsule > summary {
  cursor: pointer; list-style: none; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  -webkit-tap-highlight-color: transparent;
}
.month-capsule > summary::-webkit-details-marker { display: none; }
.month-capsule > summary::before { content: "◂"; display: inline-block; color: var(--text-muted); font-size: 12px; transition: transform .15s; }
.month-capsule[open] > summary::before { transform: rotate(-90deg); }
.month-capsule[open] > summary { margin-bottom: 14px; }
.month-title { font-size: 15px; font-weight: 700; }
.month-sub { font-size: 12.5px; color: var(--text-muted); flex: 1 1 100%; }
.month-count { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.week-divider { font-size: 15px; font-weight: 700; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border); scroll-margin-top: 70px; }
.week-divider .wd-sub { font-size: 12.5px; font-weight: 400; color: var(--text-muted); display: block; margin-top: 2px; }
.month-continuation { font-size: 12.5px; color: var(--text-muted); text-align: center; padding: 6px 0; margin: 4px 0 14px; border-top: 1px dashed var(--border); }
.day-card { scroll-margin-top: 70px; }
.t-row .t-txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.t-row .t-time { min-width: 64px; max-width: 92px; }

/* Mobile: time on a small line above the task text; wide screens: side by side like the legacy page. */
.day-card { padding: 14px; }
.day-card .t-row { gap: 10px; align-items: center; }
.day-card .t-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0; cursor: pointer; }
.day-card .t-body .t-time { min-width: 0; max-width: none; font-size: 11.5px; line-height: 1.4; padding: 0; }
.day-card .t-body .t-txt { font-size: 14px; line-height: 1.45; }
@media (min-width: 560px) {
  .day-card .t-body { flex-direction: row; align-items: baseline; gap: 10px; }
  .day-card .t-body .t-time { flex: none; width: 92px; font-size: 12px; }
}

/* ---------- dashboard ---------- */
.strong { font-weight: 700; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.card .segmented { margin: 6px 0 12px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 88px 1fr 28px; align-items: center; gap: 8px; font-size: 13px; }
.bar-label { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 14px; border-radius: 999px; background: var(--grid); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-value { text-align: left; color: var(--text-secondary); font-weight: 600; }

.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-nav h3 { font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 11px; color: var(--text-muted); text-align: center; font-weight: 600; }
.cal-cell {
  min-height: 48px; border: 1px solid var(--border); border-radius: 8px; padding: 3px 4px;
  background: var(--page); display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  font: inherit; color: inherit; cursor: pointer; text-align: start;
}
.cal-cell.out { border-color: transparent; background: transparent; cursor: default; }
.cal-cell.has-log { border-color: var(--accent); }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-num { font-weight: 700; font-size: 12px; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; }
.cal-detail { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.cal-detail h3 { font-size: 14px; }

.cmp-scroll { overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmp-table th, .cmp-table td { padding: 5px 3px; text-align: center; border-bottom: 1px solid var(--grid); }
.cmp-table th { color: var(--text-muted); font-weight: 600; font-size: 11.5px; }
.cmp-table td:first-child, .cmp-table th:first-child { text-align: start; white-space: nowrap; color: var(--text-secondary); font-weight: 600; }
.cmp-cell { border-radius: 4px; }
.cmp-cell.zero { color: var(--text-muted); }

.goal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.goal-list li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--text-secondary); }
.goal-list .g-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.card.important-goals-card { border: 2px solid var(--status-serious); box-shadow: var(--shadow); }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.proj { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--page); }
.proj .p-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.proj h3 { font-size: 15px; }
.badge { font-size: 12px; font-weight: 600; border: 1px solid var(--border); border-radius: 999px; padding: 1px 10px; color: var(--text-secondary); }
.proj .p-note { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.proj .p-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.meter { margin-top: 10px; }
.m-track { height: 8px; border-radius: 999px; background: var(--grid); overflow: hidden; }
.m-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.m-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.day-list { display: flex; flex-direction: column; gap: 8px; }
.day-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; color: inherit; text-decoration: none; background: var(--page);
}
.day-date { min-width: 70px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.day-date .d-num { font-size: 14px; font-weight: 700; }
.day-date .d-name { font-size: 11.5px; color: var(--text-muted); }
.day-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.day-body .d-text { font-size: 13.5px; color: var(--text-secondary); }
.num-input { width: 96px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--page); color: var(--text-primary); font: inherit; }
.proj .p-note h4 { font-size: 13px; margin: 8px 0 4px; color: var(--text-primary); }
.proj .p-note ul, .proj .p-note ol { margin: 4px 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- money screen ---------- */
.form-box:not(:empty) { margin-bottom: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.field label { display: flex; flex-direction: column; gap: 6px; }
.field input[type="number"] { width: 100%; }
.form-error { color: var(--status-critical); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }
.money-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.money-list li { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--page); display: flex; flex-direction: column; gap: 4px; }
.m-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.m-title { font-weight: 700; font-size: 14.5px; }
.m-amount { font-weight: 700; white-space: nowrap; }
.m-sub { font-size: 12.5px; color: var(--text-secondary); }
.m-note { font-size: 12px; color: var(--text-muted); }
.m-actions { display: flex; gap: 14px; }
.link-btn.danger { color: var(--status-critical); }
.exp-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.exp-row { display: grid; grid-template-columns: 1fr 90px auto auto; gap: 8px; align-items: center; }
.exp-row input { min-height: 40px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--page); color: var(--text-primary); font: inherit; min-width: 0; }

/* ---------- analysis ---------- */
.month-select, .card .btn-row select { min-height: 42px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--page); color: var(--text-primary); font: inherit; max-width: 100%; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tab-chip { border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; background: var(--page); color: var(--text-secondary); font-size: 13px; cursor: pointer; min-height: 34px; }
.tab-chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.analysis-editor textarea, .analysis-editor input[type="text"] { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--page); color: var(--text-primary); font-size: 14px; line-height: 1.7; resize: vertical; }
.draft-note { color: var(--status-warn); font-weight: 600; margin-bottom: 8px; }

/* ---------- routine ---------- */
.routine-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.routine-row { display: grid; grid-template-columns: 10px 96px minmax(0, 1fr) auto; grid-template-areas: "dot time cat del" "text text text text"; gap: 6px 8px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--page); }
.routine-row .t-dot { grid-area: dot; }
.routine-row .r-time { grid-area: time; }
.routine-row select { grid-area: cat; }
.routine-row .r-text { grid-area: text; }
.routine-row .row-del { grid-area: del; }
.routine-row input, .routine-row select, .routine-editor .field input { min-height: 38px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); color: var(--text-primary); font: inherit; font-size: 14px; min-width: 0; width: 100%; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.card.highlight { border: 2px solid var(--accent); }
.token-input { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--page); color: var(--text-primary); font: inherit; direction: ltr; text-align: left; }
