/* MyObjectives, Harbor look: calm, spacious, rounded. Color means status; cobalt marks progress and actions. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/figtree-latin.woff2") format("woff2"); }
:root {
  --paper: #f2f6fa;
  --surface: #ffffff;
  --surface-2: #e8eef5;
  --ink: #0f2a3d;
  --ink-2: #4a6073;
  --ink-3: #7a8ea0;
  --line: #dde6ee;
  --accent: #1d62d8;        /* cobalt: progress, primary actions, selection */
  --accent-ink: #ffffff;
  --accent-soft: #dfeafb;
  --soon: #b85208;          /* amber: due soon */
  --soon-soft: #fdebdc;
  --over: #b8352e;          /* brick: overdue */
  --over-soft: #fbe0dd;
  --ok: #1f8a5b;           /* done, achieved */
  --ok-soft: #dcf3e7;
  --ai: #1d62d8;
  --ai-soft: #dfeafb;
  --m-opus: #1d4fa8; --m-opus-ink: #ffffff; --m-sonnet: #4f86e0; --m-sonnet-ink: #ffffff;
  --m-haiku: #93b4ea; --m-haiku-ink: #0f2a3d; --m-gpt: #0f2a3d; --m-gpt-ink: #ffffff; --m-pplx: #1f8a5b; --m-pplx-ink: #ffffff;
  --shadow: 0 1px 2px rgba(15, 42, 61, .05), 0 10px 28px rgba(15, 42, 61, .06);
  --r: 22px;
  --r-s: 14px;
  --tap: 44px;
  --pad: 16px;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1622;
    --surface: #12202f;
    --surface-2: #1a2c40;
    --ink: #e8f0f7;
    --ink-2: #a9bccd;
    --ink-3: #7a8ea2;
    --line: #1f3144;
    --accent: #6aa6ff;
    --accent-ink: #07203f;
    --accent-soft: #16304f;
    --soon: #f2a15b;
    --soon-soft: #3a2615;
    --over: #f08a82;
    --over-soft: #40201e;
    --ok: #5fd09a;
    --ok-soft: #15372a;
    --ai: #6aa6ff;
    --ai-soft: #16304f;
    --m-opus: #6aa6ff; --m-opus-ink: #07203f; --m-sonnet: #4f86e0; --m-sonnet-ink: #ffffff;
    --m-haiku: #3f5f94; --m-haiku-ink: #e8f0f7; --m-gpt: #e8f0f7; --m-gpt-ink: #0b1622; --m-pplx: #5fd09a; --m-pplx-ink: #0b1622;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.45 var(--font); font-variant-numeric: tabular-nums;
  min-height: 100dvh; padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
body.login { padding-bottom: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 25px; letter-spacing: -0.025em; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-2); }
.hidden, [hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-top: env(safe-area-inset-top); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 4px var(--pad); max-width: 720px; margin: 0 auto; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; text-decoration: none; }
.topbar .back { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; color: var(--ink-2); min-height: var(--tap); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: transparent; color: var(--ink); text-decoration: none; }
.iconbtn:active { background: var(--surface-2); }

.page { max-width: 720px; margin: 0 auto; padding: 8px var(--pad) 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 18px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--over); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.big { width: 100%; font-size: 17px; min-height: 52px; }
.btn:disabled { opacity: .55; }
.btn.block { width: 100%; }
.fab { position: fixed; right: 20px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(29, 98, 216, .35); z-index: 4; }
.fab svg { width: 26px; height: 26px; stroke-width: 2.2; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px var(--pad) 14px; margin: 0 calc(-1 * var(--pad)); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip b { font-weight: 600; opacity: .7; }

/* Cards */
.cards { display: grid; gap: 12px; padding-bottom: 72px; }  /* room under the floating button */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); text-decoration: none; display: block; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card.quiet { box-shadow: none; border: 1px solid var(--line); background: transparent; }
.card.objective { display: grid; gap: 12px; }
.objective-main { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.objective-main h2 { font-size: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: 4px; color: var(--ink-3); font-size: 13px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.card .meta .count { font-weight: 600; color: var(--ink-2); }
.card-foot { display: flex; align-items: center; gap: 10px; min-height: 32px; color: var(--ink-2); font-size: 13px; }
.card-foot .done-count { font-weight: 600; }
.card-foot .reorder { margin-left: auto; }
.objective.soon .meta { color: var(--soon); }
.objective.over .meta { color: var(--over); }
.objective.achieved .meta { color: var(--ok); }
.objective.hold .meta, .objective.archived .meta { color: var(--ink-3); }

/* Avatars and pills */
.avatars { display: flex; }
.avatar, .avatars img { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -6px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.avatars > :first-child { margin-left: 0; }
.avatar.more { background: var(--surface-2); color: var(--ink-2); }
.avatar.big { width: 56px; height: 56px; font-size: 20px; margin: 0; border: 0; }
.pill { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ai { background: var(--ai-soft); color: var(--ai); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.over { background: var(--over-soft); color: var(--over); }
.pill.soon { background: var(--soon-soft); color: var(--soon); }

/* Today: the one bold card on Home */
.today-card { background: var(--accent); color: var(--accent-ink); border-radius: var(--r); padding: 18px 18px 6px; margin-bottom: 4px; }
.today-card h2 { font-size: 18px; margin-bottom: 4px; }
.today-card ul { list-style: none; margin: 0; padding: 0; }
.today-card li a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--accent-ink) 22%, transparent); text-decoration: none; font-weight: 500; }
.today-card li a:first-child { border-top: 0; }
.today-card li em { font-style: normal; font-size: 13px; opacity: .8; white-space: nowrap; }
.today-card li em.over { opacity: 1; font-weight: 700; }
.today-card .today-note { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--accent-ink) 22%, transparent); font-size: 14px; opacity: .9; }
.today-card.calm { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); padding-bottom: 14px; }
.today-card.calm p { color: var(--ink-2); font-size: 14px; }

/* Page heads on the main tabs */
.no-topbar .topbar { display: none; }
.no-topbar .page { padding-top: calc(env(safe-area-inset-top) + 14px); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 16px; }
.page-head p { color: var(--ink-3); font-size: 13px; font-weight: 500; }
.page-head h1 { margin-top: 2px; }
.page-head .avatar { margin: 0; width: 42px; height: 42px; border: 0; font-size: 14px; text-decoration: none; }
.page-head img.avatar { object-fit: cover; }

/* Empty states and notices */
.empty { padding: 40px 12px; text-align: left; }
.empty h2 { font-size: 20px; }
.empty p { margin: 8px 0 16px; color: var(--ink-2); max-width: 36ch; }
.notice { padding: 10px 12px; border-radius: var(--r-s); background: var(--surface-2); color: var(--ink-2); margin: 10px 0; }
.notice.warn { background: var(--over-soft); color: var(--over); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

/* Forms */
.form { display: grid; gap: 14px; }
.form label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.form input:not([type=checkbox]), .form select, .form textarea, .row input {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 16px; }
.form textarea { min-height: 88px; resize: vertical; }
/* Fields that grow to show everything typed in them (app.js sizes them); the title is one line of text that wraps. */
.form textarea[data-autogrow] { resize: none; overflow-y: hidden; max-height: 50dvh; line-height: 1.4; }
.form textarea[data-single-line] { min-height: var(--tap); }
/* A date field is as wide as its column on every phone, with the date aligned like the other fields. */
.form input[type=date] { display: block; min-width: 0; -webkit-appearance: none; appearance: none; text-align: left; }
.form input[type=date]::-webkit-date-and-time-value { text-align: left; }
.form .check { grid-template-columns: auto 1fr; align-items: center; font-size: 15px; color: var(--ink); font-weight: 500; }
.form .check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.form .hint { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.form .toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; color: var(--ink); font-weight: 500; }
.form .toggle input { width: 22px; height: 22px; accent-color: var(--accent); }
.row { display: flex; align-items: flex-start; gap: 8px; }
.row > * { flex: 1 1 0; min-width: 0; }
.row > .btn { flex: none; }

/* Login hero */
.hero { padding: 24px 0 40px; max-width: 520px; }
.hero h1 { font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; margin: 20px 0 12px; }
.lede { color: var(--ink-2); font-size: 16px; line-height: 1.5; margin-bottom: 24px; max-width: 42ch; }
.hero-mark { display: flex; gap: 6px; align-items: flex-end; height: 44px; }
.hero-mark span { width: 14px; border-radius: 4px; background: var(--accent); }
.hero-mark span:nth-child(1) { height: 40%; opacity: .45; }
.hero-mark span:nth-child(2) { height: 70%; opacity: .7; }
.hero-mark span:nth-child(3) { height: 100%; }
.devlogin { margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.devlogin label { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.standalone-note { margin-top: 16px; font-size: 13px; color: var(--ink-3); }

/* Profile */
.signout { margin-top: 24px; }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 600; }
.tabbar a[aria-current] { color: var(--accent); }

/* Bottom sheet */
.sheet { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; max-height: 92dvh; position: fixed; inset: auto 0 0 0; background: var(--surface); color: var(--ink); border-radius: 28px 28px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.25); }
.sheet::backdrop { background: rgba(10, 16, 15, .45); }
.sheet-body { padding: 8px var(--pad) calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 92dvh; }
#sheet-body:focus { outline: none; }
.sheet-body::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 19px; }
@media (min-width: 720px) { .sheet { max-width: 520px; margin: 0 auto; border-radius: 28px; inset: auto 0 24px 0; } }

/* htmx states */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
.htmx-request .hide-while-loading { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: .01ms !important; } }

/* Objective detail */
.page-title { font-size: 26px; margin: 8px 0 6px; }
.lede-s { margin-bottom: 16px; max-width: 44ch; }
.obj-head { display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center; padding: 18px; margin-bottom: 14px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.obj-head h1 { font-size: 22px; }
.obj-head .meta { margin-top: 4px; color: var(--ink-2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.obj-head .meta .count { color: var(--ink); font-weight: 600; }
.obj-head.soon .meta { color: var(--soon); }
.obj-head.over .meta { color: var(--over); }
.obj-head.achieved .meta { color: var(--ok); }
.ring { position: relative; width: 74px; height: 74px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-2); stroke-width: 5; }
.ring .arc { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.achieved .ring .arc { stroke: var(--ok); }
.hold .ring .arc, .archived .ring .arc { stroke: var(--ink-3); }
.ring .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.ring .pct small { font-size: 10px; font-weight: 600; margin-left: 1px; }
.ring.sm { width: 58px; height: 58px; } .ring.sm .pct { font-size: 14px; }
.banner { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface-2); color: var(--ink-2); font-weight: 500; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }

.tasks { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 0; overflow: hidden; }
.tasklist { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 2px 8px 2px 10px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .tick { flex: none; display: flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); margin: 0; }
.task .tick input { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; border-radius: 50%; border: 2px solid var(--ink-3); background: transparent; display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.task .tick input:checked { background: var(--ok); border-color: var(--ok); }
.task .tick input:checked::after { content: ""; width: 6px; height: 11px; margin-top: -2px; border: solid var(--surface); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.task .tick.static { color: var(--ok); font-weight: 700; }
.task-main { flex: 1; text-align: left; background: none; border: 0; padding: 8px 6px; min-height: var(--tap); display: grid; gap: 2px; }
.task .title { font-size: 15px; line-height: 1.3; }
.task.done .title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.task .sub { display: flex; gap: 6px; align-items: center; min-height: 0; }
.task .sub:empty { display: none; }
.task .sub .avatar { margin: 0; width: 20px; height: 20px; font-size: 9px; border: 0; }
.task.over .title { color: var(--over); }
.addtask { display: flex; gap: 8px; padding: 8px 10px 8px; border-top: 1px solid var(--line); }
.addtask input { flex: 1; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--paper); font-size: 16px; }
.empty-s { padding: 14px 16px; }

.research { margin: 14px 0; }
.jobstatus { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 10px 14px; border-radius: 12px; background: var(--ai-soft); color: var(--ai); font-weight: 600; }
.jobstatus.failed { background: var(--over-soft); color: var(--over); }
.jobstatus.done { background: var(--ok-soft); color: var(--ok); }
.jobstatus form { margin-left: auto; }

.members, .why, .reminders, .suggestions { margin-top: 20px; }
.members h3, .why h3, .reminders h3, .suggestions h3 { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.people { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.people li { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.people .avatar, .people img.avatar { margin: 0; width: 28px; height: 28px; font-size: 11px; border: 0; }
.people .role { margin-left: auto; font-size: 13px; }
.why p { color: var(--ink-2); white-space: pre-line; }
.menu { display: grid; gap: 10px; }
.sheet-actions { display: grid; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.sheet-actions .hint { margin: 6px 4px 2px; font-size: 13px; line-height: 1.4; color: var(--ink-3); font-weight: 400; }
.sources { margin: 0; padding-left: 18px; font-size: 14px; }
.sources a { color: var(--accent); }

/* Suggestions */
.tray-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tray-head h3 { margin: 0; }
.suglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sug { background: var(--accent-soft); border-radius: var(--r); padding: 14px 16px; }
.sug-title { font-weight: 600; }
.sug-kind { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.sug-details { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.sug-why { margin-top: 4px; color: var(--ink-3); font-size: 13px; }
.sug-sources { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; }
.sug-sources a { color: var(--accent); }
.sug-actions { display: flex; gap: 8px; margin-top: 10px; }
.findings { margin-top: 12px; background: var(--surface); border-radius: var(--r); padding: 10px 14px; box-shadow: var(--shadow); }
.findings summary { cursor: pointer; font-weight: 600; color: var(--ink-2); min-height: 28px; display: flex; align-items: center; }
.findings-text { margin-top: 8px; display: grid; gap: 8px; color: var(--ink-2); font-size: 14px; }

/* Sharing and the dev outbox */
.sheet-sub { font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 18px 0 8px; }
.people li form { margin-left: auto; }
.people li .role + form { margin-left: 8px; }
.row-actions { display: flex; gap: 8px; }
.outbox { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.outbox-row a { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 12px; background: var(--surface); border-radius: var(--r-s); text-decoration: none; font-size: 14px; }
.outbox-row .kind { font-weight: 600; }
.email-preview { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.email-text { white-space: pre-wrap; font-size: 13px; color: var(--ink-2); }

/* Reminders and the calendar */
.remlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rem { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 8px 10px 14px; }
.rem-when { grid-column: 1; font-size: 12px; font-weight: 700; color: var(--accent); }
.rem-body { grid-column: 1; }
.rem-title { font-weight: 600; }
.rem-obj { display: block; font-size: 13px; color: var(--ink-2); text-decoration: none; margin-top: 2px; }
.rem-people { display: flex; margin-top: 6px; }
.rem-people .avatar { margin: 0 0 0 -4px; width: 20px; height: 20px; font-size: 9px; }
.rem-people .avatar:first-child { margin-left: 0; }
.rem-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; }
.cal-day { margin-bottom: 18px; }
.cal-day h2 { font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 10px 0 8px; }
.people-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.people-pick legend { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; padding: 0; }

/* Drafts */
.handoff { flex-wrap: wrap; }
.handoff > * { flex: 1 1 auto; }
.drafts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.drafts li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Suggest me: findings inside the task sheet */
.btn.accent { background: var(--ai-soft); color: var(--ai); border-color: transparent; }
.findings-panel { margin-top: 4px; display: grid; gap: 10px; }
.findings-head { display: flex; align-items: center; justify-content: space-between; }
.findings-head h3 { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.findings-summary { color: var(--ink-2); font-size: 14px; }
.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.option { padding: 10px 12px; border-radius: var(--r-s); background: var(--surface-2); }
.option-title { font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.option-title a { color: var(--accent); }
.option-details { margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.suggested { border-left: 3px solid var(--ai); padding: 4px 0 4px 12px; display: grid; gap: 8px; }
.suggested-text { font-size: 14px; white-space: pre-line; }

/* Task facts */
.facts { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.facts legend { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; padding: 0; }
.fact-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; gap: 8px; }
.facts-inline { font-size: 12px; color: var(--ink-2); }
.recalc { margin-top: 8px; }

/* Settings (Me) */
.settings-form { gap: 12px; }
.card.settings { display: grid; gap: 12px; padding: 16px; }
.card-title { font-size: 13px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.01em; }
.card-sub { color: var(--ink-2); font-size: 14px; margin-top: -6px; }
.spend { display: grid; gap: 8px; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.spend-text { font-size: 14px; color: var(--ink-2); }
.spend-text b { color: var(--ink); }
.signout { margin-top: 20px; }

/* Notes: grouped bullets from the model */
.notes { display: grid; gap: 4px; font-size: 14px; }
.notes p { margin: 0; }
.notes .notes-head { font-weight: 650; margin-top: 6px; color: var(--ink); }
.notes .notes-head:first-child { margin-top: 0; }
.notes-list { margin: 0; padding-left: 18px; display: grid; gap: 2px; color: var(--ink-2); }

/* Specific options: facts, fit, and the details we ask for */
.option-facts { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 2px; }
.option-why { margin-top: 6px; font-size: 13px; color: var(--accent); }
.ask { border-left: 3px solid var(--soon); padding: 4px 0 4px 12px; display: grid; gap: 6px; }
.ask-title { font-weight: 600; font-size: 14px; }
.ask-list { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 2px; }
.fact-row.asked [name=fact_value] { border-color: var(--soon); }

/* Admin: families and members */
.admin-link { margin-top: 12px; text-decoration: none; }
.admin-link p { color: var(--ink-2); font-size: 14px; }
.card.family h2 { font-size: 17px; }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.member { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member .avatar { margin: 0; width: 32px; height: 32px; font-size: 12px; border: 0; }
.member-text { display: grid; gap: 2px; min-width: 0; }
.member-name { font-weight: 600; }
.member-sub { font-size: 13px; color: var(--ink-2); word-break: break-all; }
.member-status { display: flex; gap: 8px; align-items: center; font-size: 12px; margin-top: 2px; }
.member-spend { display: grid; justify-items: end; text-align: right; font-size: 14px; }
.member-spend small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.member-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.member.disabled .member-name { color: var(--ink-3); }

/* Family page */
.lede { color: var(--ink-2); font-size: 14px; margin: -6px 0 14px; }
.fam-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.fam-head .avatar { margin: 0; width: 36px; height: 36px; font-size: 13px; border: 0; }
.fam-head .avatar.house { background: var(--accent-soft, var(--line)); color: var(--accent); display: grid; place-items: center; }
.fam-head .avatar.house svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.member-name-input { font: inherit; font-weight: 600; padding: 2px 0; border: 0; border-bottom: 1px dashed var(--line); background: none; color: var(--ink); border-radius: 0; min-height: 0; width: 100%; }
.member-name-input:focus { outline: none; border-bottom-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty-family p { margin: 0; }

/* Tasks page: open tasks grouped by objective */
.task-groups { display: grid; gap: 18px; }
.task-group h2 { font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.task-group h2 a { color: inherit; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-group h2 small { color: var(--ink-3); font-weight: 500; font-size: 12px; flex: none; }
.task-group .tasks { margin: 0; }
.tasks-note { font-size: 13px; color: var(--ink-2); margin: -4px 0 12px; }

/* On hold objectives and the up/down order controls */
.objective.hold .meta { color: var(--ink-3); }
.reorder { display: flex; gap: 2px; margin-left: auto; }
.reorder .iconbtn { width: 36px; height: 36px; }
.reorder .iconbtn:disabled { opacity: .25; }

/* Share sheet: family first, someone else behind a disclosure */
.role-pick { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; margin: 4px 0 6px; }
.people .who { display: grid; min-width: 0; flex: 1 1 auto; }
.people .role { flex: none; white-space: nowrap; }
.people .who small { font-weight: 400; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.someone-else { margin-top: 14px; }
.someone-else summary { cursor: pointer; font-size: 13px; color: var(--ink-3); font-weight: 600; min-height: 32px; display: flex; align-items: center; list-style: none; }
.someone-else summary::-webkit-details-marker { display: none; }
.someone-else summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-right: 10px; transition: transform .15s; }
.someone-else[open] summary::before { transform: rotate(45deg); }
.someone-else .form { margin-top: 8px; }
.form .two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }

/* Harbor: spacing between stacked setting cards on Family and Admin */
.card.fam, .page > .card.settings, .page > .form.card { margin-bottom: 12px; }
.role-pick select { width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 16px; font-weight: 500; }

/* Me: grouped settings that save as you go */
.me { display: grid; }
.me-id { background: var(--surface); border-radius: var(--r); padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; align-items: center; box-shadow: var(--shadow); }
.me-id .avatar.big { width: 64px; height: 64px; font-size: 22px; grid-row: span 2; object-fit: cover; }
.me-id h2 { font-size: 21px; letter-spacing: -0.02em; align-self: end; }
.me-id p { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; align-self: start; }
.me-id .tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill.ok.big, .me-id .pill { min-height: 24px; padding: 0 10px; }
.me-st { margin: 22px 6px 8px; font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: 0; }
.me-group { background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.me-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); text-align: left; text-decoration: none; font-size: 15px; }
.me-group > :first-child { border-top: 0; }
.me-row .tile { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.me-row .tile.g { background: var(--ok-soft); color: var(--ok); }
.me-row .tile.w { background: var(--soon-soft); color: var(--soon); }
.me-row .tile svg { width: 18px; height: 18px; }
.me-row .k { flex: 1; min-width: 0; font-weight: 600; }
.me-row .k small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.me-row .v { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-weight: 500; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-row .v svg { width: 16px; height: 16px; flex: none; }
button.me-row, a.me-row, .me-row.sel { cursor: pointer; }
.me-row.sel select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.me-row.sel:has(select:focus-visible), button.me-row:focus-visible, a.me-row:focus-visible, .me-row:has(#me-nudge:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.me-row.off { opacity: .45; }
.me-row.off select { cursor: default; }
.sw { position: relative; width: 48px; height: 29px; flex: none; }
.sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); transition: background .15s; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.sw input:checked + i { background: var(--accent); border-color: var(--accent); }
.sw input:checked + i::after { transform: translateX(19px); }
.me-tiers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; margin: 12px 14px 4px; padding: 3px; background: var(--surface-2); border-radius: 14px; }
.me-tiers label { position: relative; text-align: center; padding: 10px 4px; border-radius: 11px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.me-tiers input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.me-tiers label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 42, 61, .18); }
.me-tiers label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.me-tdesc { padding: 8px 16px 14px; color: var(--ink-2); font-size: 14px; }
.me-tdesc b { color: var(--ink); }
.me-spend { display: grid; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.me-spend > div:first-child { display: flex; justify-content: space-between; font-weight: 600; }
.me-spend small { color: var(--ink-3); font-size: 12px; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter .fill { height: 100%; background: var(--accent); border-radius: 99px; }
.me-out { margin-top: 22px; display: block; width: 100%; min-height: 52px; background: var(--surface); border: 0; border-radius: 20px; color: var(--over); font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; opacity: 0; pointer-events: none; z-index: 8; }
.toast svg { width: 18px; height: 18px; stroke-width: 2.6; }
.toast.show { animation: toast 1.8s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }
@keyframes toast-fade { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .toast.show { animation-name: toast-fade; animation-duration: 1.8s !important; transform: translate(-50%, 0); } }

/* Me: AI provider and delete account */
.me-note { padding: 14px 16px; color: var(--ink-2); font-size: 14px; border-top: 1px solid var(--line); }
.me-note b { color: var(--ink); }
.me-group.danger .k { color: var(--over); }
.me-row .tile.r { background: var(--over-soft); color: var(--over); }
.ai-form .opt { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 18px; margin-top: 10px; cursor: pointer; }
.ai-form .opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ai-form .opt .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; margin-top: 2px; }
.ai-form .opt b { display: block; font-size: 15px; }
.ai-form .opt small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; line-height: 1.35; }
.ai-form .opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ai-form .opt:has(input:checked) .dot { border-color: var(--accent); }
.ai-form .opt:has(input:checked) .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ai-form .opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-form .keybox { display: none; margin: 8px 0 0 32px; gap: 10px; }
.ai-form:has(#ai-own:checked) .keybox { display: grid; }
.ai-form .saved { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.me-field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 6px; }
.me-input { width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 16px; font-weight: 500; }
.ai-form .hint { color: var(--ink-3); font-size: 12.5px; }
.ai-form > .btn { margin-top: 16px; }
.lbl-check { display: none; }
.ai-form.nokey:has(#ai-own:checked) .lbl-save { display: none; }
.ai-form.nokey:has(#ai-own:checked) .lbl-check { display: inline; }
.btn.danger-fill { background: var(--over); color: #fff; border-color: transparent; margin-top: 16px; }
.btn.danger-fill:disabled { opacity: .4; cursor: default; }
.sheet-p { color: var(--ink-2); margin-bottom: 4px; }
.sheet-list { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 6px; }
.ai-off-note { color: var(--ink-2); font-size: 14px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-s); }
.ai-off-note a { color: var(--accent); font-weight: 700; }

/* Admin: recent AI runs, one row per objective and one column per step */
.runs-filters { display: grid; gap: 7px; margin: 0 2px 10px; }
.runs-f { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 6px; align-items: center; margin: 0; }
.runs-f > b { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.runs-f > b label { font: inherit; }
.runs-seg { display: flex; min-width: 0; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.runs-seg a { flex: 1 1 0; min-width: 0; padding: 6px 2px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; border-radius: 8px; }
.runs-seg .sf { display: none; }
@media (max-width: 350px) { .runs-seg .lf { display: none; } .runs-seg .sf { display: inline; } }
.runs-seg a.on { background: var(--accent); color: var(--accent-ink); }
.runs-f select { min-width: 0; width: 100%; min-height: 36px; padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.runs-summary { display: grid; gap: 2px; margin: 0 2px 12px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); font-size: 12.5px; }
.runs-summary b { font-size: 15px; }
.runs-summary span { color: var(--ink-2); font-size: 11.5px; }
.runs-legend { display: grid; gap: 8px; font-size: 12px; color: var(--ink-2); margin: 0 4px 12px; }
.runs-grp { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: center; }
.runs-grp > b { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.runs-grp > div { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.runs-legend span { display: inline-flex; align-items: center; gap: 5px; }
.runs-card { padding: 12px 10px; }
table.runs { width: 100%; table-layout: fixed; border-collapse: collapse; }
col.runs-obj { width: 31%; }
table.runs th { white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: center; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
table.runs th:first-child { text-align: left; }
table.runs td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: center; }
table.runs tr:last-child td { border-bottom: 0; }
table.runs td.runs-o { text-align: left; padding-right: 6px; }
.runs-t { font-size: 12.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.runs-tot { font-size: 12px; font-weight: 700; margin-top: 3px; }
.runs-s { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.runs-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.runs-tag.high { background: var(--ok-soft); color: var(--ok); }
.runs-c { display: grid; justify-items: center; gap: 3px; }
.runs-p { font-size: 12px; font-weight: 600; }
.runs-none { color: var(--ink-3); font-size: 12px; }
.mdl { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 9px; font-weight: 800; font-style: normal; line-height: 1; }
.mdl-O { background: var(--m-opus); color: var(--m-opus-ink); }
.mdl-S { background: var(--m-sonnet); color: var(--m-sonnet-ink); }
.mdl-H { background: var(--m-haiku); color: var(--m-haiku-ink); }
.mdl-T, .mdl-X, .mdl-L { background: var(--m-gpt); color: var(--m-gpt-ink); border-radius: 4px; }
.mdl-P { background: var(--m-pplx); color: var(--m-pplx-ink); border-radius: 4px; }
.mdl-\? { background: var(--surface-2); color: var(--ink-2); }
