/* Locked In — styling follows the Orange Unified Design System (OUDS).
 *
 * Token values are taken from Orange-OpenSource/ouds-ios:
 *   colour ramps  OUDS/Core/Themes/Orange/.../OrangeBrandColorRawTokens+Values.swift
 *   greys         OUDS/Core/Tokens/RawTokens/.../ColorRawTokens+Values.swift
 *   spacing       DimensionRawTokens (4pt base scale)
 *   radii         BorderRawTokens (4pt base scale)
 *
 * OUDS is light-first; the dark set mirrors it by inverting the grey ramp and
 * lifting the brand colour for contrast on dark surfaces.
 */

/* ---------- raw tokens ---------- */
:root {
  /* Orange brand ramp */
  --orange-50:  #fff2e6;
  --orange-100: #ffd5b0;
  --orange-200: #ffc18a;
  --orange-300: #ffa554;
  --orange-400: #ff9433;
  --orange-500: #ff7900;  /* brand */
  --orange-550: #f15e00;
  --orange-600: #e86e00;
  --orange-700: #b55600;
  --orange-800: #8c4300;
  --orange-900: #6b3300;

  /* Functional greys */
  --grey-l80:  #f4f4f4;
  --grey-l160: #eeeeee;
  --grey-l240: #e0e0e0;
  --grey-l320: #d6d6d6;
  --grey-l400: #cccccc;
  --grey-l640: #adadad;
  --grey-l800: #999999;
  --grey-d80:  #7a7a7a;
  --grey-d240: #666666;
  --grey-d400: #555555;
  --grey-d560: #3b3b3b;
  --grey-d640: #333333;
  --grey-d720: #272727;
  --grey-d800: #1f1f1f;
  --grey-d880: #141414;
  --grey-d960: #0a0a0a;

  /* Semantic status colours */
  --positive: #1ecd3c;
  --positive-strong: #17a02f;
  --negative: #db0002;
  --negative-strong: #b20002;
  --warning: #ffd000;
  --warning-strong: #a38200;
  --info: #26b2ff;
  --info-strong: #0073b2;

  /* Spacing — OUDS 4pt scale */
  --sp-25: 2px;
  --sp-50: 4px;
  --sp-100: 8px;
  --sp-150: 12px;
  --sp-200: 16px;
  --sp-250: 20px;
  --sp-300: 24px;
  --sp-400: 32px;
  --sp-500: 40px;
  --sp-600: 48px;

  /* Radii — OUDS 4pt scale */
  --r-100: 4px;
  --r-200: 8px;
  --r-300: 12px;
  --r-400: 16px;
  --r-500: 20px;
  --r-pill: 2000px;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --ease: cubic-bezier(.2, 0, 0, 1);
}

/* ---------- light theme (OUDS default) ---------- */
:root,
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-secondary: var(--grey-l80);
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: var(--grey-l80);
  --border: var(--grey-l240);
  --border-strong: var(--grey-l400);

  --content: #000000;
  --content-muted: var(--grey-d240);
  --content-subtle: var(--grey-d80);
  --content-on-brand: #ffffff;

  --brand: var(--orange-500);
  --brand-hover: var(--orange-550);
  --brand-soft: var(--orange-50);
  --brand-border: var(--orange-200);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .04);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .07), 0 4px 12px rgba(0, 0, 0, .05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .10), 0 2px 8px rgba(0, 0, 0, .06);

  --positive-soft: #edfcf0;
  --negative-soft: #ffe5e6;
  --warning-soft: #fff7d6;
  --info-soft: #f0faff;

  color-scheme: light;
}

/* ---------- dark theme ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--grey-d960);
    --bg-secondary: var(--grey-d880);
    --surface: var(--grey-d880);
    --surface-raised: var(--grey-d800);
    --surface-sunken: #000000;
    --border: var(--grey-d640);
    --border-strong: var(--grey-d400);

    --content: #ffffff;
    --content-muted: var(--grey-l640);
    --content-subtle: var(--grey-l800);
    --content-on-brand: #000000;

    --brand: var(--orange-400);
    --brand-hover: var(--orange-300);
    --brand-soft: rgba(255, 121, 0, .14);
    --brand-border: rgba(255, 121, 0, .34);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, .55);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, .6);

    --positive-soft: rgba(30, 205, 60, .14);
    --negative-soft: rgba(219, 0, 2, .18);
    --warning-soft: rgba(255, 208, 0, .14);
    --info-soft: rgba(38, 178, 255, .14);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: var(--grey-d960);
  --bg-secondary: var(--grey-d880);
  --surface: var(--grey-d880);
  --surface-raised: var(--grey-d800);
  --surface-sunken: #000000;
  --border: var(--grey-d640);
  --border-strong: var(--grey-d400);

  --content: #ffffff;
  --content-muted: var(--grey-l640);
  --content-subtle: var(--grey-l800);
  --content-on-brand: #000000;

  --brand: var(--orange-400);
  --brand-hover: var(--orange-300);
  --brand-soft: rgba(255, 121, 0, .14);
  --brand-border: rgba(255, 121, 0, .34);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .55);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .6);

  --positive-soft: rgba(30, 205, 60, .14);
  --negative-soft: rgba(219, 0, 2, .18);
  --warning-soft: rgba(255, 208, 0, .14);
  --info-soft: rgba(38, 178, 255, .14);

  color-scheme: dark;
}

/* ---------- base ---------- */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap;
  src: url("/fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap;
  src: url("/fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap;
  src: url("/fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap;
  src: url("/fonts/Inter-Bold.woff2") format("woff2"); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior-y: contain;
}

body {
  background: var(--bg-secondary);
  color: var(--content);
  font: 400 15px/1.45 "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-100);
}

/* Window Controls Overlay: when the installed desktop app hides the title bar,
 * this strip stays draggable so the window can still be moved. */
.titlebar-drag {
  height: env(titlebar-area-height, 0px);
  -webkit-app-region: drag;
  app-region: drag;
}
.titlebar-drag button, .titlebar-drag a { -webkit-app-region: no-drag; app-region: no-drag; }

/* ---------- responsive shell ----------
 * Narrow is the phone view, then a sidebar, then a detail pane.
 *
 * These are viewport queries, not container queries: the shell IS the window,
 * and an element cannot respond to a container it declares itself. In a PWA the
 * viewport tracks the window, so dragging the window still reflows.
 */
.shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "header" "main";
  height: 100dvh;
  overflow: hidden;
}

.sidebar { display: none; }
.detail  { display: none; }

@media (min-width: 720px) {
  .shell {
    grid-template-columns: 232px minmax(0, 1fr);
    grid-template-areas: "sidebar header" "sidebar main";
  }
  .sidebar { display: flex; }
}

@media (min-width: 1100px) {
  .shell {
    grid-template-columns: 232px minmax(0, 1fr) 360px;
    grid-template-areas: "sidebar header header" "sidebar main detail";
  }
  .detail { display: flex; }
}

.app-header { grid-area: header; }
.main       { grid-area: main; overflow-y: auto; scrollbar-gutter: stable; }
.sidebar    { grid-area: sidebar; }
.detail     { grid-area: detail; }

/* Wide enough to use a large window, capped so lines stay readable. Without a
 * detail pane there is more room, so the cap lifts. */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: var(--sp-250) var(--sp-250) calc(var(--sp-600) + var(--safe-b));
}
@media (min-width: 1100px) { .container { max-width: 760px; margin-left: var(--sp-400); } }
@media (min-width: 1600px) { .container { max-width: 860px; } }

/* ---------- header ----------
 * The grid gives the header its own row, so it does not need sticky -- and
 * sticky inside a grid area with an overflow-hidden parent is what clipped it
 * on wide windows. The bar spans the full column; only the list below is
 * width-limited, so the title and actions stay at the window edges.
 */
.app-header {
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-t);
  min-width: 0;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-150);
  padding: var(--sp-150) var(--sp-250);
  width: 100%;
  min-width: 0;
}
.header-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0; flex: 1; }
.header-title .accent { color: var(--brand); }
.header-actions { display: flex; gap: var(--sp-100); align-items: center; }

/* ---------- sidebar (>=720px) ---------- */
.sidebar {
  flex-direction: column;
  gap: var(--sp-50);
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: calc(var(--sp-200) + var(--safe-t)) var(--sp-150) var(--sp-200);
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: var(--sp-100);
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  padding: var(--sp-100) var(--sp-150) var(--sp-300);
}
.sidebar-brand .dot {
  width: 10px; height: 10px; border-radius: var(--r-pill);
  background: var(--brand); flex: none;
}
.nav-item {
  display: flex; align-items: center; gap: var(--sp-150);
  padding: var(--sp-100) var(--sp-150);
  border: 0; background: none; width: 100%;
  border-radius: var(--r-200);
  font-size: 14px; font-weight: 500; color: var(--content-muted);
  cursor: pointer; text-align: left;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.nav-item:hover { background: var(--surface-sunken); color: var(--content); }
.nav-item[aria-current="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item .count {
  margin-left: auto; font-size: 12px; font-weight: 600;
  color: var(--content-subtle); font-variant-numeric: tabular-nums;
}
.nav-item[aria-current="true"] .count { color: var(--brand); }
.nav-sep { height: 1px; background: var(--border); margin: var(--sp-150) var(--sp-150); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-100);
  min-height: 44px; padding: 0 var(--sp-250);
  border-radius: var(--r-200); border: 1px solid transparent;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .12s var(--ease), border-color .12s var(--ease), transform .06s var(--ease);
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--brand); color: var(--content-on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-soft); }
.btn-ghost { background: transparent; color: var(--content-muted); }
.btn-ghost:hover { background: var(--surface-sunken); color: var(--content); }
.btn-danger { background: transparent; color: var(--negative); border-color: var(--border); }
.btn-danger:hover { background: var(--negative-soft); border-color: var(--negative); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border: 0; background: transparent; color: var(--content-muted);
  border-radius: var(--r-200); cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--content); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- fields ---------- */
.field { margin-bottom: var(--sp-200); }
.field label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--content-muted); margin-bottom: var(--sp-100);
}
.input, .field input, .field textarea, .field select {
  width: 100%; min-height: 44px;
  padding: var(--sp-100) var(--sp-150);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-200);
  color: var(--content);
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.hint { font-size: 13px; color: var(--content-subtle); line-height: 1.5; }
.err { font-size: 13px; color: var(--negative); min-height: 18px; }

/* ---------- quick add ---------- */
.quickadd { position: relative; margin-bottom: var(--sp-200); }
.quickadd-row {
  display: flex; gap: var(--sp-100); align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-300);
  padding: var(--sp-50);
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.quickadd-row:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.quickadd input {
  flex: 1; min-height: 44px; padding: 0 var(--sp-150);
  background: none; border: 0; outline: none; font-size: 15px;
}
.quickadd .btn { min-height: 44px; padding: 0 var(--sp-200); }

/* Chips showing what the parser understood, so the syntax teaches itself. */
.parse-preview {
  display: flex; flex-wrap: wrap; gap: var(--sp-50);
  padding: var(--sp-100) var(--sp-50) 0;
  min-height: 0;
}
.parse-preview:empty { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: var(--sp-50);
  padding: var(--sp-25) var(--sp-100);
  border-radius: var(--r-100);
  font-size: 12px; font-weight: 500;
  background: var(--surface-sunken); color: var(--content-muted);
  border: 1px solid var(--border);
}
.chip-brand   { background: var(--brand-soft);   color: var(--brand);          border-color: var(--brand-border); }
.chip-warning { background: var(--warning-soft); color: var(--warning-strong); border-color: transparent; }
.chip-danger  { background: var(--negative-soft);color: var(--negative);       border-color: transparent; }
.chip-positive{ background: var(--positive-soft);color: var(--positive-strong);border-color: transparent; }
.chip-info    { background: var(--info-soft);    color: var(--info-strong);    border-color: transparent; }

/* ---------- toolbar (search + filters) ---------- */
.toolbar { display: flex; gap: var(--sp-100); margin-bottom: var(--sp-200); flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap svg {
  position: absolute; left: var(--sp-150); top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--content-subtle); pointer-events: none;
}
.search-wrap input { padding-left: var(--sp-500); }
.segmented {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--surface-sunken); border-radius: var(--r-200);
  border: 1px solid var(--border);
}
.segmented button {
  border: 0; background: none; cursor: pointer;
  padding: var(--sp-50) var(--sp-150); min-height: 38px;
  border-radius: var(--r-100);
  font-size: 13px; font-weight: 500; color: var(--content-muted);
  transition: background .12s var(--ease), color .12s var(--ease);
}
.segmented button:hover { color: var(--content); }
.segmented button[aria-selected="true"] {
  background: var(--surface); color: var(--content);
  font-weight: 600; box-shadow: var(--shadow-sm);
}

/* ---------- task list ---------- */
.section-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--content-subtle);
  margin: var(--sp-300) 0 var(--sp-100);
}
.section-label:first-child { margin-top: 0; }

.task-list { display: flex; flex-direction: column; gap: var(--sp-100); list-style: none; margin: 0; padding: 0; }

.task {
  display: flex; align-items: flex-start; gap: var(--sp-150);
  padding: var(--sp-150);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-300);
  cursor: pointer;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease), background .12s var(--ease);
}
.task:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.task[data-focused="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.task[data-done="true"] { opacity: .55; }
.task[data-done="true"] .task-title { text-decoration: line-through; }

/* Priority is a left edge rather than a badge: readable at a glance, no width. */
.task[data-priority="1"] { border-left: 3px solid var(--negative); }
.task[data-priority="3"] { border-left: 3px solid var(--border-strong); }

.check {
  flex: none; width: 24px; height: 24px; margin-top: 1px;
  border-radius: var(--r-pill);
  border: 2px solid var(--border-strong);
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s var(--ease), border-color .12s var(--ease);
}
.check:hover { border-color: var(--brand); }
.check svg { width: 14px; height: 14px; color: var(--content-on-brand); opacity: 0; }
.check[aria-checked="true"] { background: var(--brand); border-color: var(--brand); }
.check[aria-checked="true"] svg { opacity: 1; }

.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: 500; line-height: 1.4; word-break: break-word; }
.task-notes {
  font-size: 13px; color: var(--content-muted); margin-top: var(--sp-50);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task-meta { display: flex; flex-wrap: wrap; gap: var(--sp-50); margin-top: var(--sp-100); }
.task-meta:empty { display: none; }

.empty {
  text-align: center; padding: var(--sp-600) var(--sp-200);
  color: var(--content-subtle); font-size: 14px;
}
.empty-icon { font-size: 32px; margin-bottom: var(--sp-150); opacity: .5; }

/* ---------- sheet / dialog ----------
 * Bottom sheet on narrow screens, centred dialog once there is room. Both use
 * the same markup so there is one dismissal path to reason about.
 */
.backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease);
}
.backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; z-index: 41;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: var(--r-500) var(--r-500) 0 0;
  padding: var(--sp-100) var(--sp-200) calc(var(--sp-300) + var(--safe-b));
  max-height: min(90dvh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform .28s var(--ease);
  box-shadow: var(--shadow-lg);
}
.sheet.open { transform: translateY(0); }

@media (min-width: 640px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(560px, calc(100vw - var(--sp-500)));
    border-radius: var(--r-400);
    padding-bottom: var(--sp-300);
    transform: translate(-50%, -46%) scale(.98);
    opacity: 0;
    transition: transform .2s var(--ease), opacity .2s var(--ease);
  }
  .sheet.open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.sheet-head {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  display: flex; align-items: center; gap: var(--sp-100);
  padding: var(--sp-150) 0 var(--sp-200);
  /* Clears the iOS status bar when installed to the home screen. */
  padding-top: calc(var(--sp-150) + var(--safe-t));
}
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; letter-spacing: -.01em; }
.grabber {
  width: 36px; height: 4px; border-radius: var(--r-pill);
  background: var(--border-strong); margin: var(--sp-100) auto 0;
}
@media (min-width: 640px) { .grabber { display: none; } }

/* ---------- detail pane (>=1100px) ---------- */
.detail {
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  min-width: 0;
  padding: var(--sp-300) var(--sp-250) var(--sp-600);
}
.detail-empty {
  color: var(--content-subtle); font-size: 14px; text-align: center;
  margin: auto 0; padding: var(--sp-400) var(--sp-200);
}

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 60;
  left: 50%; bottom: calc(var(--sp-300) + var(--safe-b));
  transform: translate(-50%, 12px);
  display: flex; align-items: center; gap: var(--sp-150);
  padding: var(--sp-150) var(--sp-250);
  background: var(--content); color: var(--bg);
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  max-width: calc(100vw - var(--sp-400));
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button {
  border: 0; background: none; color: var(--brand);
  font-weight: 600; cursor: pointer; padding: 0;
}

/* ---------- keyboard help ---------- */
.kbd-grid { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-100) var(--sp-200); align-items: center; }
kbd {
  display: inline-block; min-width: 24px; text-align: center;
  padding: var(--sp-25) var(--sp-100);
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-100);
  font: 500 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--content);
}
.kbd-desc { font-size: 14px; color: var(--content-muted); }

/* ---------- weather + misc ---------- */
.wx { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--sp-100); }
.wx-card {
  background: var(--surface-sunken); border: 1px solid var(--border);
  border-radius: var(--r-300); padding: var(--sp-150);
}
.wx-city { font-size: 12px; font-weight: 600; color: var(--content-muted); text-transform: uppercase; letter-spacing: .05em; }
.wx-temp { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: var(--sp-50); }
.wx-cond { font-size: 13px; color: var(--content-muted); }
.wx-range { font-size: 12px; color: var(--content-subtle); margin-top: var(--sp-50); }

.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: var(--sp-150);
  padding: var(--sp-150); background: var(--surface-sunken);
  border: 1px solid var(--border); border-radius: var(--r-200);
  margin-bottom: var(--sp-100);
}
.row-title { font-size: 14px; font-weight: 500; }
.row-meta { font-size: 12px; color: var(--content-subtle); }

.actions { display: flex; gap: var(--sp-100); justify-content: flex-end; margin-top: var(--sp-300); }

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

/* ---------- overview strip ----------
 * A wall of identical rows gives no sense of where you stand. These counts sit
 * above the list and double as filters.
 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: var(--sp-100); margin-bottom: var(--sp-250); }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-300); padding: var(--sp-150);
  cursor: pointer; text-align: left;
  transition: border-color .12s var(--ease), background .12s var(--ease);
}
.stat:hover { border-color: var(--border-strong); }
.stat[data-active="true"] { border-color: var(--brand); background: var(--brand-soft); }
.stat-num { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--content-muted); margin-top: 2px; }
.stat[data-tone="danger"] .stat-num { color: var(--negative); }
.stat[data-tone="brand"]  .stat-num { color: var(--brand); }
.stat[data-tone="positive"] .stat-num { color: var(--positive-strong); }

/* Progress bar for the day. */
.progress-wrap { margin-bottom: var(--sp-250); }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-100); }
.progress-head b { font-size: 14px; font-weight: 600; }
.progress-head span { font-size: 13px; color: var(--content-muted); }
.progress {
  height: 6px; border-radius: var(--r-pill);
  background: var(--surface-sunken); overflow: hidden;
}
.progress > i {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: var(--brand); transition: width .3s var(--ease);
}

/* Hover affordances so rows feel interactive rather than static. */
.task .task-actions { display: flex; gap: var(--sp-50); opacity: 0; transition: opacity .12s var(--ease); }
.task:hover .task-actions, .task[data-focused="true"] .task-actions { opacity: 1; }
@media (hover: none) { .task .task-actions { opacity: 1; } }
.task-actions .icon-btn { width: 32px; height: 32px; }
.task-actions .icon-btn svg { width: 16px; height: 16px; }

.hint-inline { font-size: 12px; color: var(--content-subtle); margin-top: var(--sp-100); }
.hint-inline kbd { font-size: 11px; }
