/* my-calendar — the approved prototype's visual system (docs/prototype.html):
   tokens, type and spacing shared by every page. Mobile-first; dark mode
   follows the OS unless <html data-theme> says otherwise. */

@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 500 750; font-display: swap;
  src: url("/static/font-bricolage.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/font-figtree.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/font-mono.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #ECEFEC; --surface: #FFFFFF; --surface2: #F5F7F5; --ink: #14201D; --muted: #5C6966; --faint: #8E9A97;
  --line: #D5DCD9; --accent: #0E7A63; --accent-ink: #FFFFFF; --accent-soft: #D7EEE7;
  --work: #4A6FA5; --work-soft: #DFE7F3; --work-ink: #1F3A63;
  --mine: #C97C12; --mine-soft: #FBEBD2; --mine-ink: #6A3E00;
  --warn: #B4472A; --warn-soft: #F8E1DA;
  --shadow: 0 1px 2px rgba(20,32,29,.06), 0 8px 28px rgba(20,32,29,.08);
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --body: "Figtree", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, "Roboto Mono", "Droid Sans Mono", monospace;
  --radius: 16px;
  --gap: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1312; --surface: #172020; --surface2: #1D2827; --ink: #E7EEEC; --muted: #9AA8A4; --faint: #6D7B78;
    --line: #2B3735; --accent: #3BC4A2; --accent-ink: #06201A; --accent-soft: #163A32;
    --work: #7EA2DA; --work-soft: #1C2A40; --work-ink: #C9D9F2;
    --mine: #EDAA45; --mine-soft: #3A2A12; --mine-ink: #F7DDB3;
    --warn: #F08A6C; --warn-soft: #3B211A;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1312; --surface: #172020; --surface2: #1D2827; --ink: #E7EEEC; --muted: #9AA8A4; --faint: #6D7B78;
  --line: #2B3735; --accent: #3BC4A2; --accent-ink: #06201A; --accent-soft: #163A32;
  --work: #7EA2DA; --work-soft: #1C2A40; --work-ink: #C9D9F2;
  --mine: #EDAA45; --mine-soft: #3A2A12; --mine-ink: #F7DDB3;
  --warn: #F08A6C; --warn-soft: #3B211A;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
}
/* Names used by the pages from before R3, mapped onto the tokens. */
:root {
  --text: var(--ink); --border: var(--line); --accent-text: var(--accent-ink);
  --ok: var(--accent); --soon: var(--mine); --due: var(--warn); --overdue: var(--warn);
  --personal: var(--mine); --planned: var(--mine); --planned-soft: var(--mine-soft);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 18%, transparent);
  /* Korean wraps at spaces (not mid-word); very long tokens still break. */
  word-break: keep-all; overflow-wrap: break-word;
}
main {
  max-width: 1100px; margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) 110px max(16px, env(safe-area-inset-left));
}
h1 { font-family: var(--display); font-weight: 650; font-size: 1.9rem; line-height: 1.08; letter-spacing: -0.02em; margin: 8px 0 16px; }
h2 { font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 26px 0 10px; }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: 0.9em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--warn); }
.notice { color: var(--mine-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header: who is signed in, the partner's pages, settings, log out. */
.topbar {
  position: sticky; top: 0; z-index: 25;
  /* No backdrop-filter here: it would make the fixed tab bar inside
     position against the header instead of the viewport. */
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}
@media (max-width: 380px) { .brand span { display: none; } }
.topbar-in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 10px 16px; }
.brand { font-family: var(--display); font-weight: 750; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand i { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-style: normal; font-size: 14px; }
.topbar .who { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.topbar .who a { color: var(--muted); text-decoration: none; }
.topbar .who a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.topbar .who form { margin: 0; }
.topbar .who button.link { font-family: var(--mono); font-size: 12px; padding: 4px 0; min-height: 0; color: var(--muted); }
.settings-link { line-height: 1; padding: 8px; border-radius: 99px; color: var(--muted); display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; }
.settings-link[aria-current="page"] { background: var(--accent-soft); }
.readonly-banner {
  display: inline-block; padding: 6px 12px; border-radius: 16px;
  background: var(--surface2); border: 1px dashed var(--line); color: var(--muted); margin: 0;
}

/* Tabs: a bottom bar on phones (Today / Plan / Us / Routines / More),
   inline in the header on wide screens (plus Tasks). */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left));
  display: flex; justify-content: center; gap: 4px;
}
.tabs a {
  flex: 1; max-width: 140px; min-height: 52px; border-radius: 12px; padding: 4px 2px;
  font-weight: 600; font-size: 12.5px; color: var(--muted); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center;
}
.tabs svg, .settings-link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.wide-only { display: none !important; }
@media (min-width: 900px) {
  .tabs { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; padding: 0; justify-content: flex-start; }
  .tabs a { flex: none; min-height: 40px; padding: 0 14px; flex-direction: row; gap: 6px; font-size: 14.5px; }
  .tabs svg { width: 18px; height: 18px; }
  .tabs a.wide-only { display: flex !important; }
  .topbar .who .wide-only { display: inline !important; }
  .topbar .who form.wide-only { display: block !important; }
  .tabs a.more-tab[data-tasks] { color: var(--muted); background: none; }
  main { padding-bottom: 60px; padding-top: 24px; }
  h1 { font-size: 2.3rem; }
}

/* Controls */
button, .button {
  font: inherit; font-size: 0.95rem; font-weight: 600;
  padding: 8px 14px; min-height: 44px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface2); color: var(--ink);
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .12s, background .15s, border-color .15s;
}
@media (hover: hover) { button:hover, .button:hover { border-color: var(--accent); } }
button:active, .button:active { transform: scale(0.98); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.link { background: none; border: none; color: var(--muted); padding: 6px 8px; min-height: 0; font-weight: 500; }
button.danger { color: var(--warn); }

input, textarea, select {
  font: inherit; font-size: 16px; /* prevents iOS zoom on focus */
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface2); color: var(--ink);
}
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
label { display: block; font-size: 0.9rem; color: var(--muted); }
label > input, label > textarea, label > select { margin-top: 4px; color: var(--ink); }

.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1 1 140px; }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px;
}

.login { max-width: 420px; margin: 8vh auto 0; margin-top: 8svh; }
.login-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 750; font-size: 20px; }
.login-brand i { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-style: normal; }
.login .headline { margin-top: 22px; }
.login-card { margin-top: 22px; padding: 20px 18px; border-radius: 22px; }
.login-card .bigbtn { margin-top: 6px; }
.who { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.who legend { font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 10px; }
.who-pick {
  min-height: 96px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--surface2);
  display: grid; place-items: center; font-family: var(--display); font-size: 40px; font-weight: 750;
  color: var(--ink); cursor: pointer; transition: all .15s;
}
.who-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.who-pick:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.who-pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
main.login-main { padding-bottom: 40px; }

details > summary { cursor: pointer; color: var(--accent); list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* htmx request feedback: the triggering control dims, and a thin bar
   slides along the top when a swap takes more than a moment. */
.htmx-request { opacity: 0.7; transition: opacity 0.15s; }
.loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .2s; }
.loadbar::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 0 3px 3px 0; background: var(--accent); animation: loadbar 1.1s ease-in-out infinite; }
html.is-loading .loadbar { opacity: 1; }
@keyframes loadbar { from { left: -40%; } to { left: 100%; } }
[aria-busy="true"] { cursor: progress; }

/* Routines */
.routine-list { display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 900px) {
  .routine-list { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
.routine { border-left: 4px solid var(--border); }
.routine.status-overdue { border-left-color: var(--overdue); }
.routine.status-due { border-left-color: var(--due); }
.routine.status-soon { border-left-color: var(--soon); }
.routine.status-new { border-left-color: var(--accent); }
.routine.status-ok { border-left-color: var(--ok); }
.routine-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.routine-title { font-weight: 600; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.routine-meta { margin: 4px 0 10px; font-size: 0.92rem; }
.status-overdue .due { color: var(--overdue); }
.status-due .due { color: var(--due); }
.status-soon .due { color: var(--soon); }
.status-ok .due { color: var(--ok); font-weight: 500; }
.routine-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.routine-actions .pick { flex-basis: 100%; }
.routine-actions .pick form { margin-top: 8px; }
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid currentColor;
}
.badge-overdue { color: var(--overdue); }
.badge-due { color: var(--due); }
.badge-soon { color: var(--soon); }
.badge-new { color: var(--accent); }
.badge-ok { color: var(--ok); }
.flash {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: 0.9rem;
}
.flash form { margin: 0; }
.flash .undo { color: var(--accent); font-weight: 600; }
.add-routine, .edit-routine { margin-bottom: 16px; }
.add-routine[open] summary, .edit-routine[open] summary { margin-bottom: 12px; }
.calm { color: var(--ok); }
.notes { white-space: pre-wrap; }
ul.plain { list-style: none; padding: 0; margin: 0; }
.history li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.history form { margin: 0; }
.gap { color: var(--muted); margin-left: 6px; }
.archived { margin-top: 24px; }
.archived li { padding: 6px 0; }
.danger-zone { margin-top: 24px; }

/* Todos */
.capture { padding: 10px 12px; margin-bottom: 8px; }
.capture .row { flex-wrap: nowrap; }
.capture input[type="text"] { min-width: 0; }
.capture-date { width: auto; flex: 0 0 auto; max-width: 150px; }
/* "Due" in front of the date: an empty date field shows the browser's
   format pattern ("mm/dd/yyyy" in English Chrome), which alone reads
   like an error. */
.capture-due { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.capture-due .capture-date { flex: 1 1 auto; min-width: 0; }
@media (max-width: 480px) {
  .capture .row { flex-wrap: wrap; }
  .capture input[type="text"] { flex: 1 1 100%; }
  .capture-date, .capture-due { flex: 1 1 auto; max-width: none; }
}
.task-group { margin-top: 18px; }
.task-group h3, .task-group > summary { font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 8px; }
.task-group > summary { min-height: 40px; display: flex; align-items: center; gap: 6px; }
.task-group > summary::before { content: "▸"; font-family: var(--body); transition: transform .15s; }
.task-group[open] > summary::before { transform: rotate(90deg); }
.group-carried h3 { color: var(--warn); }
.task-list { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px 12px 12px; min-height: 56px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: none; }
.task form { margin: 0; }
.check {
  flex: none; width: 30px; height: 30px; min-height: 30px; padding: 0;
  border-radius: 50%; border: 2px solid var(--line); background: none;
  color: var(--accent-ink); font-size: 0.85rem; line-height: 1;
}
@media (hover: hover) { .check:hover { border-color: var(--accent); } }
.check.checked { background: var(--accent); border-color: var(--accent); }
span.check { display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box; }
.task-body { flex: 1; min-width: 0; padding-top: 4px; }
.task-body > summary { color: var(--ink); padding: 0; }
.task-title { overflow-wrap: anywhere; font-weight: 500; }
.task-due { color: var(--muted); margin-left: 6px; white-space: nowrap; font-size: 13px; }
.group-carried .task-due { color: var(--warn); }
.task.done .task-title { color: var(--faint); text-decoration: line-through; }
.task-edit { margin: 10px 0; }
.tasks-page { max-width: 720px; }
.tasks-body { margin-top: 22px; }
.hint-line { color: var(--muted); margin: 0 4px 4px; }
.hint-line b { color: var(--ink); font-weight: 600; }
.preview-list li { padding: 3px 0; }

/* Calendar agenda: Work and Personal get their own color. */
/* Personal Google events dashed amber, items planned in the app (and
   fixed-day routines) solid amber, work blue — as in the prototype. */
.event-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.event {
  display: flex; gap: 12px; align-items: baseline;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--border);
}
.event:last-child { border-bottom: none; }
.event.src-work { border-left-color: var(--work); }
.event.src-personal {
  border-left: 4px dashed var(--personal);
}
.event.src-app, .event.src-routine {
  border-left-color: var(--planned);
  background: color-mix(in srgb, var(--planned-soft) 70%, transparent);
}
.event-time { flex: 0 0 96px; font-variant-numeric: tabular-nums; font-size: 0.9rem; color: var(--muted); }
.event-main { flex: 1; min-width: 0; }
.event-title { font-weight: 500; overflow-wrap: anywhere; }
.event-meta { display: block; color: var(--muted); }
.src-work .event-meta { color: var(--work); }
.src-personal .event-meta { color: var(--personal); }
.event.marker-past { opacity: 0.55; }
.event.marker-now { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.event.marker-now .event-time, .event.marker-next .event-time { color: var(--text); font-weight: 600; }
.badge-now { color: var(--accent); margin-left: 6px; }
.badge-next { color: var(--muted); margin-left: 6px; }
.event-list.compact .event { padding: 5px 12px; }
.event-list.compact .event-meta { display: inline; margin-left: 6px; }
.sync-status { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-top: 6px; }
.sync-status form { margin: 0; }
.tomorrow .event-list { margin-bottom: 8px; }

/* Plan (M5): lane timeline on wide screens, upcoming list on phones. */
main.wide { max-width: 1600px; }
.plan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.plan-head h1 { margin-bottom: 8px; }
.range-label { font-size: 1rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.plan-nav { display: flex; gap: 6px; }
.plan-nav .button { min-height: 34px; padding: 4px 12px; font-size: 0.9rem; }
.plan-nav .button.current { color: var(--muted); }
.free-text { color: var(--ok); font-size: 0.85rem; }

/* Heat bands of the work lane (busy hours per day). */
.heat-none { background: transparent; }
.heat-light { background: color-mix(in srgb, var(--work) 16%, transparent); }
.heat-moderate { background: color-mix(in srgb, var(--work) 36%, transparent); }
.heat-busy { background: color-mix(in srgb, var(--work) 60%, transparent); }
.heat-heavy { background: color-mix(in srgb, var(--work) 88%, transparent); color: var(--surface); }

.timeline {
  --lane-label-width: 112px;
  display: none;
  grid-auto-rows: minmax(24px, auto);
  row-gap: 3px;
  margin-top: 8px;
  padding: 8px 8px 10px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.72rem;
  line-height: 1.2;
}
.timeline > * { min-width: 0; }
.col-bg { z-index: 0; border-left: 1px solid transparent; }
.col-bg.weekend { background: color-mix(in srgb, var(--muted) 9%, transparent); }
.col-bg.today { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 6px; }
.col-bg.past { opacity: 0.5; }
.col-bg.month-start { border-left-color: var(--border); }
.lane-sep { border-top: 1px solid var(--border); margin-top: -2px; pointer-events: none; }
.week-head { z-index: 1; padding: 0 4px 2px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--border); }
.day-head {
  z-index: 1; display: flex; flex-direction: column; align-items: center;
  padding: 2px 0 4px; color: var(--text); text-decoration: none; border-radius: 6px;
  border-bottom: 3px solid transparent;
}
.day-head .dow { color: var(--muted); font-size: 0.66rem; }
.day-head .num { font-weight: 600; font-variant-numeric: tabular-nums; }
.day-head.past { opacity: 0.45; }
.day-head.today .num { color: var(--accent); }
.day-head.free-evening { border-bottom-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.day-head.free-day { border-bottom-color: var(--ok); }
@media (hover: hover) { .day-head:hover, .gi:hover { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: -1px; } }
.lane-label {
  z-index: 1; align-self: center; padding: 0 8px 0 12px;
  font-weight: 600; color: var(--muted); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lane-label.lane-work { color: var(--work); align-self: start; padding-top: 4px; }
.lane-label.lane-personal { color: var(--personal); align-self: start; padding-top: 4px; }
.lane-label.lane-routine { font-weight: 500; color: var(--text); }
.lane-label.lane-deadline { color: var(--due); }
.gi {
  z-index: 2; display: flex; align-items: center; justify-content: center;
  margin: 0 1px; border-radius: 5px; color: var(--text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gi.heat { font-size: 0.66rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--work); }
.gi.heat-heavy { color: var(--surface); }
/* A bar fills --fill of its item; the rest is room for its label. */
.gi.bar {
  display: block; padding: 4px 5px 0; border-left: 3px solid; font-weight: 500;
  background: linear-gradient(to right, var(--bar-bg) var(--fill, 100%), transparent var(--fill, 100%));
}
.gi.bar-work { --bar-bg: color-mix(in srgb, var(--work) 16%, var(--surface)); border-left-color: var(--work); }
.gi.bar-personal { --bar-bg: var(--surface); border: 1px dashed var(--personal); border-left: 3px dashed var(--personal); }
.gi.bar-app { --bar-bg: var(--planned-soft); border-left-color: var(--planned); }
.gi.rt-mark.rt-fixed::before { background: var(--planned); border-radius: 3px; }
.gi.rt-window { margin: 5px 1px; border-radius: 999px; background: color-mix(in srgb, var(--soon) 24%, transparent); }
.gi.rt-window.rt-projected { background: color-mix(in srgb, var(--soon) 11%, transparent); }
.gi.rt-mark::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--due); flex: none; }
.gi.rt-mark.rt-projected::before { background: transparent; border: 2px solid color-mix(in srgb, var(--due) 55%, transparent); width: 10px; height: 10px; }
.gi.rt-mark.rt-new::before { background: var(--accent); }
.gi.rt-mark.rt-overdue { background: var(--overdue); color: var(--surface); font-weight: 700; font-size: 0.8rem; }
.gi.rt-mark.rt-overdue::before { display: none; }
.gi.deadline { color: var(--due); font-weight: 700; gap: 1px; }
.gi.deadline::before { content: "◆"; font-size: 0.8rem; }
.legend { display: none; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin: 8px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw-window { width: 22px; border-radius: 999px; background: color-mix(in srgb, var(--soon) 24%, transparent); }
.sw-overdue { background: var(--overdue); }
.sw-deadline { background: var(--due); transform: rotate(45deg) scale(0.75); }
.sw-free { height: 3px; width: 16px; background: var(--ok); }

/* Phone list */
.up-week { margin-top: 18px; }
.up-week-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; font-size: 0.95rem; }
.up-week-label { color: var(--text); }
.up-sum { font-weight: 500; font-size: 0.85rem; color: var(--work); }
.up-days { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.up-day { display: flex; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); }
.up-day:last-child { border-bottom: none; }
.up-day.today { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.up-day.empty { padding-top: 4px; padding-bottom: 4px; }
.up-date { flex: 0 0 60px; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); text-decoration: none; font-size: 0.92rem; }
.up-day.today .up-date { color: var(--accent); }
.up-day.empty .up-date { color: var(--muted); font-weight: 500; }
.up-body { flex: 1; min-width: 0; font-size: 0.92rem; }
.up-meta { display: flex; gap: 8px; align-items: center; }
.work-pill { font-size: 0.75rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; color: var(--text); }
.work-pill.heat-heavy { color: var(--surface); }
.up-item { display: flex; gap: 8px; padding: 1px 0; }
.up-time { flex: 0 0 auto; min-width: 16px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.up-text { overflow-wrap: break-word; min-width: 0; }
.li-personal .up-time { color: var(--personal); }
.li-app .up-time { color: var(--planned); font-weight: 600; }
.li-work .up-time { color: var(--work); }
.li-routine .up-time, .li-projected .up-time { color: var(--soon); }
.li-projected { color: var(--muted); }
.li-overdue { color: var(--overdue); }
.li-deadline .up-time { color: var(--due); }

/* Day panel: right-hand drawer on wide screens, bottom sheet on phones. */
.day-panel {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  max-height: 78vh; max-height: 78dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgb(0 0 0 / 0.18);
}
.day-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.day-panel h2 { margin: 4px 0; color: var(--text); font-size: 1.1rem; }
.day-panel h3 { font-size: 0.8rem; margin: 14px 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.day-panel .close { font-size: 1.1rem; color: var(--muted); text-decoration: none; padding: 4px 8px; }
.day-panel .capture { margin-top: 12px; }
.day-panel .flash { margin-top: 6px; }
.panel-list li { padding: 3px 0; }
.panel-list a { color: var(--text); font-weight: 500; }
.pr-overdue .small { color: var(--overdue); }
.pr-due .small { color: var(--due); }
.pr-soon .small { color: var(--soon); }
.pr-new .small { color: var(--accent); }
.pr-projected .small { color: var(--muted); }

@media (min-width: 1000px) {
  .timeline { display: grid; }
  .legend { display: flex; }
  .upcoming { display: none; }
  .day-panel {
    left: auto; top: 64px; right: 16px; bottom: 16px; width: 380px; max-height: none;
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 10px 40px rgb(0 0 0 / 0.2);
  }
}
@media (min-width: 1300px) {
  .timeline { --lane-label-width: 140px; font-size: 0.75rem; }
}

/* Settings (M7/M8) */
.settings-section { margin-bottom: 16px; }
.settings-section h2 { margin-top: 0; color: var(--text); }
.settings-section h3 { font-size: 0.85rem; margin: 18px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
button.big, .button.big { min-height: 52px; padding: 12px 18px; font-size: 1.05rem; width: 100%; }
.help { margin: 10px 0 0; }
.help ol { padding-left: 20px; margin: 8px 0; }
.device-list li, .token-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.device-list form, .token-list form { margin: 0; }
.schedule { padding-left: 18px; margin: 4px 0; }
.notif-log li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.token-once { overflow-wrap: anywhere; user-select: all; display: block; padding: 10px; margin: 8px 0; border-radius: 8px; background: var(--bg); border: 1px dashed var(--accent); font-family: var(--mono); }

/* Check-in and confirm pages: big one-tap buttons for the phone. */
.checkin h2 { margin-top: 18px; }
.all-clear { font-size: 1.05rem; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; border-left: 4px solid var(--border);
}
.check-item.status-overdue { border-left-color: var(--overdue); }
.check-item.status-due { border-left-color: var(--due); }
.check-text { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.check-text .task-title { font-weight: 600; }
.due-text { color: var(--muted); }
.status-overdue .due-text { color: var(--overdue); }
.check-actions { display: flex; gap: 8px; margin: 0; }
.check-actions form { margin: 0; flex: 1; display: flex; }
.check-actions button { flex: 1; min-height: 48px; font-size: 1rem; }
.confirm { max-width: 480px; margin: 0 auto; }
.confirm h1 { margin-bottom: 4px; }
.confirm .stack button, .confirm .stack .button { min-height: 56px; font-size: 1.1rem; width: 100%; }
.confirm .result { font-size: 1.1rem; }
.confirm .pick-row { display: flex; gap: 8px; }
.confirm .pick-row input { flex: 1; min-height: 56px; }
.confirm .pick-row button { width: auto; flex: 0 0 auto; }
.new-token { display: block; }

/* R2: routine kinds. */
.weekday-boxes { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.weekday-boxes legend { padding: 0 4px; }
.day-box { display: inline-flex; gap: 4px; align-items: center; margin-right: 10px; }
.check-label { display: flex; gap: 8px; align-items: center; }
.kind-heading { margin-top: 20px; }
.wdots { letter-spacing: 2px; color: var(--accent); font-size: 0.95rem; }
.routine.status-paused { border-left-color: var(--border); opacity: 0.7; }
.badge-paused { color: var(--muted); }
.habit-list, .quota-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.habit-list li, .quota-list li { padding: 6px 12px; border-bottom: 1px solid var(--border); align-items: center; }
.habit-list li:last-child, .quota-list li:last-child { border-bottom: none; }
.habit.done { color: var(--muted); }
.habit form { margin: 0; }
.habit-check ul { margin-bottom: 8px; }
.habit-check li { padding: 4px 0; }
.event.done .event-title { text-decoration: line-through; text-decoration-color: var(--muted); }
.planned-list li { padding: 6px 12px; border-bottom: 1px solid var(--border); }
.planned-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.planned-list li:last-child { border-bottom: none; }
.planned-status { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- R3: card flows (prototype "flow overlay") ---------- */
main.flow-main { max-width: none; padding: 0; }
.flow {
  /* svh, not dvh: the card stays put while the browser bars (Safari,
     Chrome iOS bottom toolbar, Android Chrome) collapse and expand. */
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom, 0px) + 12px) max(16px, env(safe-area-inset-left));
}
.ftop { display: flex; align-items: center; gap: 8px; max-width: 560px; width: 100%; margin: 0 auto; }
.ftop form { margin: 0; }
.iconbtn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
@media (hover: hover) { .iconbtn:hover { background: var(--surface2); } }
.pdots { flex: 1; display: flex; justify-content: center; gap: 6px; }
.pdots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line); transition: all .3s; }
.pdots i.on { width: 22px; background: var(--accent); }
.pdots i.past { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.skipbtn { min-height: 48px; min-width: 64px; padding: 0 14px; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: 14.5px; background: none; border: 0; }
@media (hover: hover) { .skipbtn:hover { background: var(--surface2); } }
.stage { position: relative; flex: 1; max-width: 560px; width: 100%; margin: 8px auto 0; display: flex; flex-direction: column; }
.qcard {
  position: relative; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow);
  padding: 26px 22px 22px; display: flex; flex-direction: column; gap: 6px;
  touch-action: pan-y; will-change: transform;
}
.qcard.leave { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.qcard.in-fwd { animation: inR .34s cubic-bezier(.2,.8,.2,1); }
.qcard.in-back { animation: inL .34s cubic-bezier(.2,.8,.2,1); }
.qcard.leave.fwd { animation: outL .28s ease forwards; }
.qcard.leave.back { animation: outR .28s ease forwards; }
@keyframes inR { from { transform: translateX(60px) rotate(1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes inL { from { transform: translateX(-60px) rotate(-1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes outL { to { transform: translateX(-90px) rotate(-3deg); opacity: 0; } }
@keyframes outR { to { transform: translateX(90px) rotate(3deg); opacity: 0; } }
.qcard form { margin: 0; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin: 0; }
.q { font-family: var(--display); font-weight: 650; font-size: clamp(27px, 7.4vw, 34px); line-height: 1.08; letter-spacing: -.02em; margin: 4px 0 0; text-wrap: balance; overflow-wrap: anywhere; }
.ctx { color: var(--muted); font-size: 15.5px; margin: 8px 0 0; }
.ctx b { color: var(--ink); font-weight: 600; }
.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.opt {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 62px;
  padding: 10px 16px; border-radius: 18px; background: var(--surface2); border: 1.5px solid var(--line);
  text-align: left; font-weight: 400; color: var(--ink);
}
@media (hover: hover) { .opt:hover { border-color: var(--accent); } }
.opt .ol { flex: 1; min-width: 0; }
.opt .ol b { font-weight: 650; font-size: 17px; display: block; }
.opt .ol span { font-size: 13.5px; color: var(--muted); }
.opt .free { font-family: var(--mono); font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.opt.yes { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.opt.yes .ol span { color: inherit; opacity: .8; }
.opt.quiet { background: transparent; border-style: dashed; }
.opt.quiet .ol b { font-weight: 600; color: var(--muted); }
.opt.picked { transform: scale(.98); border-color: var(--accent); background: var(--accent-soft); }
.opt.yes.picked { background: var(--accent); }
.okmark { display: grid; place-items: center; flex: none; }
.kbd { display: none; font-family: var(--mono); font-size: 11px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); place-items: center; color: var(--muted); flex: none; }
.opt.yes .kbd { border-color: rgba(255,255,255,.4); color: inherit; }
@media (hover: hover) and (pointer: fine) { .kbd { display: grid; } }
.bigbtn {
  margin-top: 22px; min-height: 58px; border-radius: 18px; border: 0; width: 100%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.qpick {
  min-height: 48px; padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--line);
  background: var(--surface2); font-weight: 600; font-size: 15px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; transition: all .15s;
}
.qpick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.qpick small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.qpick .tickmark { display: none; }
.qpick:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.qpick:has(input:checked) small { color: inherit; opacity: .8; }
.qpick:has(input:checked) .tickmark { display: inline-grid; }
.qpick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.qpick:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.counter { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.addrow { display: flex; gap: 8px; margin-top: 14px; }
.addrow input { flex: 1; min-width: 0; min-height: 50px; border-radius: 14px; }
.mini { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; border-top: 1px solid var(--line); }
.mini .r { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.mini .r .mono { font-size: 12px; color: var(--muted); width: 52px; flex: none; }
.mini .r i { width: 9px; height: 9px; border-radius: 3px; flex: none; align-self: center; }
.mini .r.dim { color: var(--muted); }
.sw-work { background: var(--work); }
.sw-mine { background: var(--mine); }
.sw-personal { border: 1.5px dashed var(--mine); }
.sw-todo { background: var(--line); }
.daybar { position: relative; height: 34px; border-radius: 10px; background: var(--surface2); margin-top: 18px; border: 1px solid var(--line); overflow: hidden; }
.daybar i { position: absolute; top: 5px; bottom: 5px; border-radius: 5px; background: var(--work); }
.daybar i.mine { background: var(--mine); }
.dayaxis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 4px; }
.sumgroup { margin-top: 18px; }
.sumgroup h4 { font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.sumgroup .ctx { margin: 0; }
.changes { display: flex; flex-direction: column; gap: 6px; }
.changes div { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.changes svg { color: var(--accent); flex: none; }
.ffoot { max-width: 560px; width: 100%; margin: 10px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
.ffoot form { margin: 0; }
.backbtn { min-height: 48px; padding: 0 14px; border-radius: 99px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; background: none; border: 0; }
.backbtn:disabled { opacity: .3; }
.hint { font-size: 12.5px; color: var(--faint); text-align: right; }
.hint .hint-keys { display: none; }
@media (hover: hover) and (pointer: fine) { .hint .hint-keys { display: inline; } .hint .hint-touch { display: none; } }
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); z-index: 70;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px;
  font-size: 14.5px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: toast 2.6s ease forwards;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 20px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }

/* Week heat strip */
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.hcell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hcol { width: 100%; height: 84px; border-radius: 10px; background: var(--surface2); position: relative; overflow: hidden; border: 1px solid var(--line); }
.hcol .lvl { position: absolute; left: 0; right: 0; bottom: 0; background: var(--work); transition: height .5s ease; }
.hcol .dots { position: absolute; left: 0; right: 0; top: 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hcol .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--mine); }
.hcell b { font-family: var(--display); font-weight: 650; font-size: 14px; }
.hcell span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hcell.tag b { color: var(--accent); }

/* Week dots (quota progress), shared by cards, Today and Routines. */
.wdots { display: inline-flex; gap: 5px; align-items: center; vertical-align: -1px; letter-spacing: normal; }
.wdots i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line); transition: all .25s; }
.wdots i.done { background: var(--accent); border-color: var(--accent); }
.wdots i.plan { border-color: var(--accent); border-style: dashed; }

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

/* ---------- R3: Today (prototype "Your day") ---------- */
.topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dateline { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.ctxtag { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }
.headline { font-family: var(--display); font-weight: 650; font-size: clamp(30px, 8.2vw, 46px); line-height: 1.04; letter-spacing: -.025em; margin: 10px 0 0; text-wrap: balance; max-width: 20ch; }
.headline .hl { color: var(--accent); }
.headline .warn { color: var(--warn); }
/* Today: one short sentence; a little smaller on narrow phones so even
   130 % system text keeps it to three lines. */
.today .headline { font-size: clamp(24px, 7vw, 46px); line-height: 1.08; max-width: 22ch; }
.headline .sep { color: var(--muted); font-weight: 500; }
.headline-sub { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.4; max-width: 46ch; overflow-wrap: anywhere; }
.today .readonly-banner { margin-top: 14px; }
.waiting { margin-top: 16px; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px 0 12px; border-radius: 99px; background: var(--accent-soft); color: var(--ink); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.waiting .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.waiting .go { color: var(--accent); font-weight: 700; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.today-grid { display: grid; gap: 28px; margin-top: 26px; }
@media (min-width: 900px) {
  .today-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: start; }
  .headline, .today .headline { font-size: 52px; }
}
.col { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.col > section > .capture { margin-bottom: 10px; }
.sec-h { font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; display: flex; justify-content: space-between; gap: 8px; font-weight: 500; }
.focus { display: flex; flex-direction: column; gap: 8px; }
.focus form { margin: 0; }
.frow { display: flex; align-items: center; justify-content: flex-start; gap: 14px; min-height: 60px; padding: 10px 16px 10px 12px; background: var(--surface); border: 0; border-radius: 16px; box-shadow: var(--shadow); text-align: left; width: 100%; font-weight: 400; }
.tick { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: all .2s; color: var(--accent-ink); }
.tick svg { opacity: 0; transform: scale(.6); transition: all .2s; }
.frow.is-done .tick { background: var(--accent); border-color: var(--accent); }
.frow.is-done .tick svg { opacity: 1; transform: none; }
.frow.is-done .ftitle { text-decoration: line-through; color: var(--faint); }
.ftitle { font-weight: 600; font-size: 16px; }
.fmeta { font-size: 13px; color: var(--muted); }
.empty { padding: 16px; border: 1.5px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 14.5px; }
.list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.lrow { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 2px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.lrow .t { flex: 1; min-width: 0; }
.lrow .t b { font-weight: 600; display: block; }
.lrow .t span { font-size: 13px; color: var(--muted); }
.pill { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }
.pill.over { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.sched { background: var(--mine-soft); color: var(--mine-ink); border-color: transparent; }
.pill.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Routines strip */
.rstrip { display: flex; flex-direction: column; gap: 10px; }
.hchips { display: flex; flex-wrap: wrap; gap: 8px; }
.hchips form { margin: 0; }
.hchip { min-height: 48px; padding: 0 16px 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; transition: all .15s; color: var(--ink); }
.hchip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.hchip[aria-pressed="true"] b { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.hchip svg { color: var(--accent); }
.hchip b { font-weight: 600; }
.rcard { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); text-align: left; width: 100%; color: var(--ink); text-decoration: none; }
.rcard .t { flex: 1; min-width: 0; }
.rcard .t b { display: block; font-weight: 600; }
.rcard .t span { font-size: 13px; color: var(--muted); }
.rlink { min-height: 48px; display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; color: var(--accent); padding: 0 2px; text-decoration: none; }

/* Day timeline */
.tl-wrap { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 16px 14px 16px 6px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12.5px; color: var(--muted); padding: 0 0 12px 10px; align-items: center; }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tl-legend a { margin-left: auto; font-weight: 600; text-decoration: none; }
.tl { position: relative; margin-top: 8px; }
.tl .hr { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.tl .hr span { position: absolute; left: 4px; top: -8px; font-family: var(--mono); font-size: 12px; color: var(--faint); background: var(--surface); padding-right: 4px; }
.evs { position: absolute; left: 54px; right: 4px; top: 0; bottom: 0; }
.ev { position: absolute; border-radius: 10px; padding: 5px 10px; overflow: hidden; font-size: 13.5px; line-height: 1.25; border-left: 3px solid; text-decoration: none; }
.ev b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev small { font-family: var(--mono); font-size: 12px; opacity: .8; white-space: nowrap; }
.ev.short { display: flex; gap: 8px; align-items: center; padding-block: 2px; }
.ev.short b { display: inline; flex: 0 1 auto; min-width: 2.5em; }
/* Narrow columns (Us on a phone): the title wins, the time gives way. */
.ev.short small { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ev.work { background: var(--work-soft); color: var(--work-ink); border-color: var(--work); }
.ev.personal { background: var(--surface); color: var(--mine-ink); border: 1.5px dashed var(--mine); border-left: 3px solid var(--mine); }
.ev.mine { background: var(--mine-soft); color: var(--mine-ink); border-color: var(--mine); }
.ev.past { opacity: .45; }
.ev.done b { text-decoration: line-through; }
.now { position: absolute; left: 46px; right: 0; height: 0; border-top: 2px solid var(--warn); z-index: 3; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); }
.now span { position: absolute; right: 4px; top: -20px; font-family: var(--mono); font-size: 12px; color: var(--warn); font-weight: 500; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchips.allday { padding: 0 0 6px 10px; }
.chip { font-size: 13px; padding: 5px 10px; border-radius: 99px; font-weight: 500; }
.chip.mine { background: var(--mine-soft); color: var(--mine-ink); }
.chip.personal { border: 1.5px dashed var(--mine); color: var(--mine-ink); }
.chip.work { background: var(--work-soft); color: var(--work-ink); }
.chip .mono { font-size: 12px; opacity: .8; margin-right: 4px; }
.tl-wrap .sync-status { margin: 12px 0 0 10px; }

/* ---- R4: joint plans and invitations ---------------------------------- */
.av { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 12px/1 var(--sans, inherit); font-style: normal; vertical-align: middle; margin-left: 4px; flex: none; }
.lrow > .av, .eyebrow .av { width: 26px; height: 26px; font-size: 12.5px; margin: 0; }
.ev.tentative { background: var(--surface); border-style: dashed; opacity: .85; }
.ev .tent, .tent { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 500; }
.gi.bar-tentative { opacity: .6; border-style: dashed; }
.waitrow { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.waitrow .waiting { margin-top: 16px; }
.waiting.invites { background: var(--mine-soft); }
.waiting.invites .pulse { background: var(--mine); }
.waiting.invites .go { color: var(--mine-ink); }
.check-row { display: flex; gap: 10px; align-items: flex-start; }
.check-row input { margin-top: 3px; }
.invitations { max-width: 720px; }
.invitations section { margin-top: 24px; }
.invite-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px; scroll-margin-top: 80px; }
.invite-card:target { outline: 2px solid var(--accent); }
.invite-card .eyebrow { text-transform: none; letter-spacing: normal; font-family: inherit; display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; color: var(--muted); }
.invite-card h2 { margin: 8px 0 4px; font-size: 21px; font-family: var(--display, inherit); font-weight: 650; text-transform: none; letter-spacing: normal; color: var(--ink); }
.invite-card h2 .when { font-family: var(--mono); font-size: 15px; color: var(--accent); font-weight: 500; white-space: nowrap; }
.invite-actions { display: flex; gap: 8px; margin-top: 12px; }
.invite-actions button { min-height: 44px; padding-inline: 20px; }
.invite-card details, .lrow details { margin-top: 10px; }
.invite-card summary, .lrow summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.lrow details { margin: 0; text-align: right; }
.lrow details[open] form { margin-top: 8px; }
.invite-state { margin: 4px 0 12px; }

/* ---- R4: "Us" ------------------------------------------------------- */
.av-partner { background: var(--mine); color: var(--surface); }
.us { max-width: 1100px; }
.us-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.us-top h1 { margin: 0; }
.seg { display: inline-flex; gap: 2px; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg a { min-height: 38px; min-width: 72px; display: grid; place-items: center; border-radius: 9px; font-family: var(--mono); font-size: 13px; color: var(--muted); text-decoration: none; padding: 0 12px; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.us-range { display: flex; align-items: center; gap: 4px; margin: 10px 0 2px; }
.us-range .iconbtn { width: 40px; height: 40px; font-size: 22px; text-decoration: none; }
.us-range-label { font-family: var(--display, inherit); font-weight: 650; font-size: 17px; min-width: 0; }
.todaybtn { margin-left: auto; font-size: 13.5px; font-weight: 600; padding: 7px 14px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.us-note { margin: 4px 0 12px; }
.us-note .sw-free { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--accent-soft); border: 1px solid var(--accent); vertical-align: middle; }
.us-day { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 12px 16px; }
.us-heads { display: grid; grid-template-columns: 54px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.us-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.us-head .av { width: 28px; height: 28px; font-size: 13px; margin: 0; }
.us-head span { display: flex; flex-direction: column; min-width: 0; }
.us-head b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-head small { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.us-allday { align-items: start; }
.us-allday .chip { background: var(--surface2); }
.us-tl .hr span { background: var(--surface); left: 0; }
a.lrow, .invitations a.lrow { text-decoration: none; color: var(--ink); }
a.lrow .pill { text-decoration: none; }
.us-bands, .us-cols { position: absolute; left: 54px; right: 4px; top: 0; bottom: 0; }
.us-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; pointer-events: none; }
.us-col { position: relative; }
.us-col + .us-col { border-left: 1px dashed var(--line); }
.us-col .ev { pointer-events: auto; }
.us-col.ro .ev.work { opacity: .8; }
.us-free { position: absolute; left: -4px; right: -4px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); text-decoration: none; display: flex; align-items: flex-start; justify-content: center; overflow: hidden; }
@media (hover: hover) { .us-free:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); } }
.us-free span { font-family: var(--mono); font-size: 12px; color: var(--accent); padding: 4px 8px 2px; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.us-free span b { font-family: var(--sans, inherit); background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 2px 9px; font-size: 12px; }
.us-free-h { margin-top: 18px; }
.us-week { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px 16px; }
.uw-grid { display: grid; gap: 6px; }
.uw-row { display: grid; grid-template-columns: 120px repeat(7, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.uw-lbl { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uw-lbl .av { margin: 0; }
.uw-day { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); padding: 4px 0; border-radius: 10px; }
.uw-day b { font-family: var(--display, inherit); font-weight: 650; font-size: 14px; }
.uw-day span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.uw-day.wkend b { color: var(--accent); }
.uw-day.today { background: var(--accent-soft); }
.uw-heat { display: grid; place-items: center; min-height: 40px; border-radius: 9px; font-family: var(--mono); font-size: 12px; background: var(--surface2); color: var(--muted); }
.uw-heat.band-light { background: color-mix(in srgb, var(--work) 16%, var(--surface)); color: var(--work-ink, var(--ink)); }
.uw-heat.band-moderate { background: color-mix(in srgb, var(--work) 36%, var(--surface)); color: var(--work-ink, var(--ink)); }
.uw-heat.band-busy { background: color-mix(in srgb, var(--work) 60%, var(--surface)); color: var(--surface); }
.uw-heat.band-heavy { background: color-mix(in srgb, var(--work) 88%, var(--surface)); color: var(--surface); }
.uw-free { display: flex; flex-direction: column; gap: 4px; min-height: 40px; }
.uw-free a { display: block; font-family: var(--mono); font-size: 12px; text-align: center; padding: 5px 2px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.uw-free a.wk { font-weight: 600; }
.uw-list { display: none; }
@media (max-width: 760px) {
  .uw-grid { display: none; }
  .uw-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
  .uw-item { display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); align-items: center; }
  .uw-item.today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
  .uw-item-day { color: var(--ink); text-decoration: none; font-family: var(--mono); font-size: 13px; }
  .uw-item-day b { font-family: var(--display, inherit); font-size: 15px; }
  .uw-item-heat { display: flex; gap: 6px; flex-wrap: wrap; }
  .uw-item-heat .uw-heat { min-height: 30px; padding: 0 10px; }
  .uw-item-free { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
  .uw-item-free a { font-family: var(--mono); font-size: 12px; padding: 6px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
}
@media (max-width: 480px) {
  .us-day { padding: 10px 6px 14px; }
  .us-heads { grid-template-columns: 40px 1fr 1fr; gap: 6px; }
  .us-bands, .us-cols { left: 40px; }
  .us-tl .hr span { font-size: 12px; left: 0; }
  .us-free span { flex-direction: column; gap: 2px; font-size: 12px; }
}
.us-empty { text-align: center; padding: 28px 20px; max-width: 560px; }
.us-empty-av { display: flex; justify-content: center; gap: 4px; }
.us-empty-av .av { width: 44px; height: 44px; font-size: 18px; }
.us-empty h2 { font-size: 20px; margin: 12px 0 8px; font-family: var(--display, inherit); font-weight: 650; text-transform: none; letter-spacing: normal; color: var(--ink); }
.opts.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.grid2 .opt { min-height: 56px; padding: 10px 12px; gap: 2px; flex-direction: column; align-items: flex-start; justify-content: center; }
.opts.grid2 .opt .ol { width: 100%; }
.opts.grid2 .opt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.opts.grid2 .kbd { display: none; }
a.opt { text-decoration: none; color: inherit; }
.us-custom { margin-top: 12px; display: flex; gap: 8px; }
.us-custom input[type="text"] { flex: 1; min-width: 0; }
a.backbtn { text-decoration: none; }

/* ---- R5: Routines page and setup cards ------------------------------- */
.emo { flex: none; width: 30px; text-align: center; font-size: 21px; line-height: 1; }
.routines-page, .routine-page { max-width: 760px; }
.addbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 58px; margin-top: 20px; border-radius: 18px; border: 1.5px dashed var(--accent); color: var(--accent); font-weight: 700; font-size: 16px; background: var(--accent-soft); text-decoration: none; }
.rgroups { display: flex; flex-direction: column; gap: 26px; margin-top: 24px; }
.rgroups h2.sec-h { margin: 0 0 10px; }
.rrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 64px; padding: 8px 2px; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.rrow:target { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.rrow .t { flex: 1; min-width: 150px; color: var(--ink); text-decoration: none; }
.rrow .t b { display: block; font-weight: 600; }
.rrow .t span { display: block; font-size: 13px; color: var(--muted); }
.rrow .t .rstatus { color: var(--ink); font-size: 13.5px; }
.rrow .t .rstatus .wdots { display: inline-flex; margin-right: 4px; }
.rrow.paused .t, .rrow.paused .emo { opacity: .5; }
.ract { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.ract form { margin: 0; }
.ract button, .ractbtn { min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 0; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
@media (hover: hover) { .ract button:hover, .ractbtn:hover { background: var(--surface2); color: var(--ink); } }
.ract button.armed { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 560px) {
  .rrow { padding-block: 10px 4px; }
  .rrow .ract { width: 100%; margin: -2px 0 0 36px; gap: 0; }
  .ract button, .ractbtn { padding: 0 10px; min-width: 0; }
}
.archived { margin-top: 8px; }
.archived > summary { font-size: 14px; color: var(--muted); min-height: 44px; display: flex; align-items: center; }
.empty .hchips { margin-top: 12px; }
a.hchip { text-decoration: none; }
.routine-tools { margin: 14px 0 4px; }
.routine-tools form { margin: 0; }
.routine-page .routine { margin-top: 12px; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14.5px; font-weight: 500; }
.flash form { margin: 0; }
.flash .undo, .flash button.link { color: var(--accent-soft); font-weight: 700; min-height: 36px; }
/* Setup cards */
.stepper { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 24px; }
.stepbtn { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--surface2); border: 1.5px solid var(--line); font-size: 30px; font-weight: 600; line-height: 1; display: grid; place-items: center; color: var(--ink); text-decoration: none; }
.stepbtn.off { opacity: .3; }
.stepper output { font-family: var(--display); font-size: 68px; font-weight: 750; min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; }
.steplbl { text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0 0; }
a.bigbtn { text-decoration: none; }
.chipset { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.chipset legend { font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 0; }
.chipset .chips { margin-top: 8px; }
.qpick.emo-chip { width: 52px; height: 52px; padding: 0; justify-content: center; font-size: 22px; border-radius: 14px; }
.qpick:has(input[type="radio"]:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.qpick.emo-chip:has(input:checked) { background: var(--accent-soft); color: var(--ink); }
.setup-form.inline { margin-top: 4px; }
.setup-form .addrow input[type="time"], .setup-form .addrow input[type="date"] { max-width: 220px; }
.opt .emo { font-size: 22px; width: auto; }
.opts.grid2 .opt .emo { text-align: left; }
.change-rows a.r { text-decoration: none; color: var(--ink); align-items: center; min-height: 48px; }
.change-rows .grow { flex: 1; min-width: 0; }
.change-rows .chg { font-size: 13px; font-weight: 600; color: var(--accent); }
.change-rows .mono { width: 92px; }
.tip { font-size: 14px; color: var(--muted); background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-top: 14px; }
.tip b { color: var(--ink); }
/* More */
.more-page { max-width: 720px; }
.more-page section { margin-top: 26px; }
a.lrow { color: var(--ink); text-decoration: none; }
.lrow .chev { color: var(--faint); font-size: 22px; line-height: 1; padding: 0 4px; }
.lrow-form { margin: 0; }
button.lrow { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font: inherit; color: var(--warn); justify-content: flex-start; min-height: 52px; padding: 8px 2px; }
button.lrow:active { transform: none; }
/* Planned */
.planned-page { max-width: 720px; }
.planned-page .ctx { max-width: 60ch; }
.plan-add { margin: 18px 0 8px; }
.plan-add > summary.addbtn { margin-top: 0; }
.plan-add[open] > summary.addbtn { margin-bottom: 12px; }
.planned-page section { margin-top: 24px; }
.lrow.past { opacity: .55; }
.lrow .t { color: var(--ink); text-decoration: none; }
.planned-status { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.seg-buttons { margin: 16px 0; }
.danger-zone { margin-top: 18px; }
/* Settings (R5) */
.settings-page { max-width: 760px; }
.settings-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 6px; }
.settings-toc a { font-size: 13.5px; font-weight: 600; padding: 7px 12px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
.settings-section { margin-top: 16px; scroll-margin-top: 80px; }
.settings-section h2 { font-family: var(--display); font-size: 21px; font-weight: 650; letter-spacing: -.01em; text-transform: none; color: var(--ink); margin: 2px 0 10px; }
.settings-section .row > label.grow { flex: 1 1 200px; }
.settings-section details.sub { margin-top: 12px; }
.settings-section details > summary { min-height: 40px; display: flex; align-items: center; font-weight: 600; font-size: 14.5px; }
.grid2f { display: grid; gap: 12px; }
@media (min-width: 600px) { .grid2f { grid-template-columns: 1fr 1fr; } }
.cal-list { margin: 8px 0; }
.cal-row { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-head .t { flex: 1; min-width: 0; }
.cal-head .t b { display: block; }
.cal-head .t span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.cal-head form { margin: 0; }
.cal-row .addrow { margin-top: 8px; }
.cal-row .addrow input { min-height: 44px; }
.account-actions { padding: 0 2px; }
.new-token { display: block; padding: 12px; border-radius: 14px; background: var(--accent-soft); margin: 10px 0; }
/* Welcome cards */
.bigbtn.quietbtn { background: transparent; color: var(--muted); border: 1.5px dashed var(--line); }
.welcome .help { margin-top: 14px; }
.welcome .ftop form { margin: 0; }
.welcome .iconbtn { background: none; border: 0; padding: 0; min-height: 48px; }
.welcome #push-status { margin-top: 16px; }
.routine-page section { margin-top: 26px; }
.routine-page .history .lrow form { margin: 0; }

/* ---- Phones: iOS Safari / Chrome (WebKit) and Android Chrome ---------- */
/* iOS draws date/time inputs and selects natively and ignores min-height
   and padding; reset the appearance so they match the text inputs. */
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; text-align: left; line-height: 1.6;
}
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238E9A97' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
/* Tap targets: at least 44 px (Apple HIG; Material asks 48 dp). */
.brand { min-height: 44px; min-width: 44px; }
code, .mono { font-size: max(12px, 0.9em); }
.day-panel .close { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; }
button.link { min-height: 44px; }
.check {
  /* 30 px ring, 44 px target: the transparent border is the extra hit area. */
  width: 44px; height: 44px; min-height: 44px; margin: -7px; border: 7px solid transparent;
  background-clip: padding-box; box-shadow: inset 0 0 0 2px var(--line);
}
.check.checked { border-color: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
@media (hover: hover) { .check:hover { border-color: transparent; box-shadow: inset 0 0 0 2px var(--accent); } }
span.check { width: 30px; height: 30px; min-height: 30px; margin: 0; border: 0; }
.task-body > summary { padding: 11px 0; margin: -11px 0 -7px; }
.task-group > summary, .settings-section details > summary { min-height: 44px; }
.tl-legend a { min-height: 44px; display: inline-flex; align-items: center; margin-block: -12px; }
.plan-nav .button { min-height: 44px; }
.up-date { min-height: 44px; margin: -7px 0; padding-top: 7px; }
.seg a { min-height: 44px; }
.us-range .iconbtn { width: 44px; height: 44px; }
.todaybtn, .settings-toc a { min-height: 44px; display: inline-flex; align-items: center; }
.uw-item-day { min-height: 44px; display: flex; align-items: center; gap: 4px; }
@media (max-width: 760px) { .uw-item-free a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; } }
label.check-row { min-height: 44px; display: flex; align-items: center; gap: 10px; }
/* While typing on a phone, the fixed tab bar would ride on top of the
   on-screen keyboard (Android Chrome, iOS when the bar does not get
   pushed off): hide it, the input needs the room. */
@media (max-width: 899px) {
  body:has(input:not([type="checkbox"]):not([type="radio"]):focus, textarea:focus, select:focus) .tabs { display: none; }
  /* The day sheet sits above the tab bar, not under it. */
  .day-panel { z-index: 35; }
}
.ios-push-hint ol { margin: 6px 0; padding-left: 20px; }
.ios-push-hint li { margin: 2px 0; }
.ios-push-hint p { margin: 6px 0 0; }
/* Phone in landscape: a one-line tab bar keeps more of the short screen. */
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
  .tabs a { min-height: 44px; flex-direction: row; gap: 6px; }
  .tabs svg { width: 20px; height: 20px; }
  main { padding-bottom: 80px; }
}
/* Very narrow (small phone with large text): the item text drops under
   its time instead of breaking mid-word in a thin column. */
.up-item { flex-wrap: wrap; }
.up-text { flex: 1 1 8em; }
.plan-nav { flex-wrap: wrap; }
.plan-nav .button { white-space: nowrap; }
