:root {
  color-scheme: light dark;
  /* Warm paper, deep lake green, and a warm orange as the one accent. The public pages
     (site.css) use the same palette. */
  --bg: #f5f1ea;
  --surface: #fffdf8;
  --surface-2: #ebe5da;
  --border: #ddd5c7;
  --rule: #d3cabb;
  --text: #15211f;
  --muted: #4f5c58;
  --faint: #7d8783;
  --accent: #0d5b54;
  --accent-ink: #ffffff;
  --accent-soft: #dce9e4;
  --sun: #c8692a;
  --user: #0d5b54;
  --user-ink: #f4fbf9;
  --danger: #b4372f;
  --danger-soft: #fbe9e7;
  --warn: #9a6a00;
  --fish-top: #ff9f5a;
  --fish-fin: #e0864a;
  /* Bob the bobber (public/mascot.js): the logo's red and cream, with a dark lake-green line. */
  --bob-red: #e2352b;
  --bob-cream: #f7f1e3;
  --bob-ink: #17332f;
  --radius: 14px;
  --shadow: 0 1px 1px rgb(40 30 10 / 4%), 0 12px 32px -8px rgb(40 30 10 / 12%);
  /* Atkinson Hyperlegible Next (SIL OFL 1.1, public/fonts/ATKINSON-LICENSE.txt), drawn by the
     Braille Institute for low-vision readers, served from our own origin. */
  --font: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1615;
    --surface: #141e1d;
    --surface-2: #1b2826;
    --border: #283734;
    --rule: #2e3e3b;
    --text: #efebe3;
    --muted: #b0b8b4;
    --faint: #85908c;
    --accent: #6fcfbf;
    --accent-ink: #062320;
    --accent-soft: #173431;
    --sun: #f0a066;
    --user: #1f5650;
    --user-ink: #f2fbf9;
    --danger: #ff8a80;
    --danger-soft: #3a1c1a;
    --warn: #f0c060;
    --shadow: 0 1px 1px rgb(0 0 0 / 30%), 0 16px 40px -10px rgb(0 0 0 / 50%);
  }
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; padding: 7px 12px; cursor: pointer;
  font-size: 14px; line-height: 1.2; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); background: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 9px; font-size: 13px; }
/* A link drawn as a button (the share sheet's Save image). */
a.btn { color: var(--text); text-decoration: none; }

/* Mascot (drawn and animated by mascot.js) */
.bob { display: block; width: 100%; height: 100%; overflow: visible; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.bob-hero, .bob-live { cursor: pointer; }
.bob-slot { display: inline-block; flex: none; width: 36px; height: 36px; }
.bob-slot[data-size="lg"] { width: 104px; height: 104px; }
.bob-slot[data-size="xl"] { width: 168px; height: 168px; }
.bob-cream { fill: var(--bob-cream); }
.bob-red { fill: var(--bob-red); }
.bob-stem { fill: var(--bob-cream); stroke: var(--bob-ink); stroke-width: 1.5; }
.bob-line, .bob-seam { fill: none; stroke: var(--bob-ink); stroke-width: 1.6; }
.bob-seam { stroke-width: 1.3; }
.bob-shine { fill: none; stroke: #ffc9c0; stroke-width: 2; stroke-linecap: round; }
.bob-cheek { fill: #ff8f8f; }
.bob-eye, .bob-mouth { fill: var(--bob-ink); }
.bob-glint { fill: #fff; }
.bob-eye-line, .bob-brow { fill: none; stroke: var(--bob-ink); stroke-width: 1.4; stroke-linecap: round; }
.bob-mouth { stroke: var(--bob-ink); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.bob-ripple { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; opacity: 0.8; }
.bob-ripple-far { stroke-width: 1.5; opacity: 0.45; }
.bob-fx { pointer-events: none; }
.bob-fx text { font: 800 8px var(--font); }
.fx-bubble { fill: none; stroke: var(--accent); stroke-width: 0.8; }
.fx-heart { fill: #ff6f7d; }
.fx-sparkle { fill: #ffc94a; }
.fx-check { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.emote-alert { fill: var(--danger); }
.emote-ask { fill: var(--text); }
.emote-note { fill: var(--accent); }
.emote-z { fill: var(--muted); font-weight: 700; }

/* Splash and sign-in */
.splash {
  height: 100%; margin: 0; display: grid; place-content: center; justify-items: center;
  gap: 12px; color: var(--muted);
}
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: min(420px, 100%); text-align: center; display: grid; justify-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 36px 28px 28px; box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.auth-lede { margin: 0; color: var(--muted); }
.auth-form { display: grid; gap: 10px; width: 100%; margin-top: 6px; }
.auth-form input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); font-size: 16px;
}
.auth-form .btn { justify-content: center; padding: 12px; font-size: 15px; }
.auth-note { margin: 0; color: var(--faint); font-size: 13px; }

/* App shell: a slim top bar, the current tab's view, and the tab bar (a rail on wide screens) */
.app {
  height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top" "main" "tabs";
}
.topbar {
  grid-area: top; display: flex; align-items: center; gap: 10px; min-height: 60px;
  padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); position: relative; z-index: 3;
}
.topbar .mascot { width: 50px; height: 50px; margin: -4px -2px -6px -4px; }
.view-title { margin: 0; flex: 1; min-width: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: block; flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.is-live .dot { background: #29b36b; }
.pill.is-offline .dot { background: var(--warn); }
.me-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 16px 4px 5px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font-size: 17px; font-weight: 650; cursor: pointer;
}
.me-btn:hover, .me-btn[aria-expanded="true"] { border-color: var(--accent); }
.me-avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 18px; font-weight: 700;
}
.me-avatar:empty::before { content: "🎣"; font-size: 18px; }
.count { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 8px; font-size: 14px; font-weight: 700; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.tabbar {
  grid-area: tabs; display: grid; grid-template-columns: repeat(4, 1fr); z-index: 3;
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tab-link {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 64px;
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 650; -webkit-tap-highlight-color: transparent;
}
.tab-link svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab-link:hover { color: var(--text); }
.tab-link[aria-current="page"] { color: var(--accent); }
.tab-link[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent);
}
.tab-link:focus-visible { outline-offset: -4px; }
.tab-dot { position: absolute; top: 10px; left: calc(50% + 12px); width: 11px; height: 11px; border-radius: 50%; background: var(--sun); border: 2px solid var(--surface); }
@media (min-width: 1024px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "tabs main"; }
  .tabbar {
    grid-template-columns: none; grid-auto-rows: min-content; align-content: start; gap: 6px;
    padding: 16px 12px; border-top: 0; border-right: 1px solid var(--border); background: transparent;
  }
  .tab-link {
    grid-template-columns: 28px 1fr; justify-items: start; align-items: center; gap: 14px;
    min-height: 56px; padding: 0 16px; border-radius: 14px; font-size: 18px;
  }
  .tab-link[aria-current="page"] { background: var(--accent-soft); }
  .tab-link[aria-current="page"]::before { display: none; }
  .tab-dot { top: 50%; left: auto; right: 14px; transform: translateY(-50%); }
}

.layout { grid-area: main; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); position: relative; }
.app.side-open .layout { grid-template-columns: minmax(0, 1fr) 380px; }
.layout > .view { grid-row: 1; grid-column: 1; min-height: 0; }

/* Conversation */
.chat { min-height: 0; display: grid; grid-template-rows: 1fr auto; grid-template-columns: minmax(0, 1fr); position: relative; }
.timeline { overflow-y: auto; overscroll-behavior: contain; scroll-padding-bottom: 24px; }
.timeline-inner { max-width: 760px; margin: 0 auto; padding: 28px 20px 12px; display: flex; flex-direction: column; gap: 14px; }

.row { display: flex; gap: 10px; align-items: flex-start; animation: rise 0.22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.row.user { justify-content: flex-end; }
.row.agent.cont { margin-top: -6px; }
.bubble-col { display: grid; gap: 4px; min-width: 0; max-width: min(620px, 85%); }
.row.user .bubble-col { justify-items: end; }
.msg {
  padding: 9px 14px; border-radius: 18px; overflow-wrap: anywhere;
}
.row.user .msg { background: var(--user); color: var(--user-ink); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.row.agent .msg { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 6px; }
.row.agent.cont .msg { border-top-left-radius: 18px; }
.msg p { margin: 0; }
.msg p + p, .msg p + ul, .msg ul + p, .msg p + ol, .msg ol + p { margin-top: 8px; }
.msg ul, .msg ol { margin: 0; padding-left: 20px; }
.msg code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.msg a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.row.user .msg a { color: inherit; }
.msg h3, .msg h4, .msg h5, .msg h6 { margin: 10px 0 4px; font-size: 1em; font-weight: 700; }
.msg h3:first-child, .msg h4:first-child, .msg h5:first-child { margin-top: 0; }
.msg .reg-image { display: block; max-width: min(100%, 420px); max-height: 320px; border-radius: 10px; margin: 6px 0; }
.msg blockquote { margin: 8px 0; padding-left: 10px; border-left: 3px solid var(--border); color: var(--muted); }
.msg pre.code { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); overflow-x: auto; }
.msg pre.code code { background: none; padding: 0; font-size: 12.5px; }
.msg > * + * { margin-top: 8px; }
.row.agent .msg.interrupted { opacity: 0.6; border-style: dashed; }
.msg.revealing > :last-child::after {
  content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em;
  background: var(--accent); border-radius: 2px;
}

.msg.revealing p:last-child { display: inline; }
.meta { font-size: 12px; color: var(--faint); display: flex; gap: 8px; align-items: center; padding: 0 4px; }
.meta .tag { font-size: 11px; }
.status-queued { color: var(--muted); }
.status-failed { color: var(--danger); }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 12px; }
.link:hover { text-decoration: underline; }
.tag {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; vertical-align: 2px;
}
.tag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.tag.bad { color: var(--danger); background: var(--danger-soft); }

/* Photos */
.photos { display: grid; gap: 4px; width: min(320px, 100%); border-radius: 18px; overflow: hidden; }
.photos.n2, .photos.n4 { grid-template-columns: 1fr 1fr; }
.photos.n3 { grid-template-columns: 1fr 1fr; }
.photos.n3 .photo:first-child { grid-column: span 2; }
.photo { padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; display: block; aspect-ratio: 4 / 3; }
.photos.n1 .photo { aspect-ratio: auto; max-height: 360px; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgb(0 0 0 / 82%); cursor: zoom-out; animation: picker-in 0.15s ease-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 20px 60px rgb(0 0 0 / 50%); }
.tray { display: flex; gap: 8px; padding: 0 4px; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); animation: tapback-pop 0.3s ease-out; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.uploading img { opacity: 0.5; }
.thumb.failed { border-color: var(--danger); }
.thumb .spinner {
  position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  border: 2px solid rgb(255 255 255 / 40%); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite;
}
.thumb-error { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; background: rgb(180 55 47 / 55%); }
.thumb-x {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0;
  background: rgb(0 0 0 / 60%); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
}
/* Clef */
.clef-slot:not(:empty) { margin-top: 16px; }
.clef-points { display: grid; gap: 6px; }
.clef-point { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; font-size: 13px; }
.clef-agree { text-align: right; font-variant-numeric: tabular-nums; }
.clef-count { grid-column: 1 / -1; font-size: 12px; color: var(--faint); }
.clef-lines { display: grid; gap: 2px; }
.clef-line { margin: 0; font: 12px/1.5 var(--mono); color: var(--muted); }
.clef-line.acted { color: var(--accent); }
.clef-line.bad { color: var(--danger); }

/* Receipts */
.receipts { margin-left: 40px; display: flex; flex-wrap: wrap; gap: 6px; max-width: min(620px, 85%); }
.receipt {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
  max-width: 100%;
}
.receipt-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt.undone .receipt-text { text-decoration: line-through; opacity: 0.6; }
.receipt-state { font-size: 11px; color: var(--faint); }
.profile-text { white-space: pre-wrap; }

/* Map cards (public/map.js) */
.map-card {
  margin: 0 0 0 40px; max-width: min(620px, 85%); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.map-canvas { height: 260px; background: var(--surface-2); z-index: 0; }
.map-card figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 12px; font-size: 13px; color: var(--muted); }
.map-card figcaption strong { color: var(--text); }
.map-card figcaption a { color: var(--accent); margin-left: auto; }
.map-note { color: var(--faint); font-size: 12.5px; margin: 0; padding: 12px; }
.map-pin {
  box-sizing: border-box; width: 19px; height: 19px; border-radius: 50%; cursor: pointer;
  border: 3px solid #ffffff; background: #2f6fd6; box-shadow: 0 1px 3px rgb(0 0 0 / 35%);
}
.map-pin-place { width: 17px; height: 17px; }
.map-pin-start { background: #1f9d55; }
.map-pin-end { background: #d64545; }
.map-pin-catch { background: var(--fish-fin); }
.map-pin-spot { background: #7a4fd0; }
.map-pin-hot_spot { background: #e8590c; }
.map-pin-structure { background: #6b5b45; }
.map-pin-launch { background: #1c7ed6; }
.map-pin-avoid { background: #c92a2a; border-color: #ffe066; }
.map-private, .map-coverage { flex-basis: 100%; font-size: 12px; color: var(--faint); }
/* Opaque enough that labels on a satellite photo don't show through the credits. */
.map-canvas .maplibregl-ctrl.maplibregl-ctrl-attrib { background-color: rgb(255 255 255 / 85%); color: #333333; }
.map-canvas .map-basemaps { display: flex; }
.map-canvas .map-basemaps button.map-basemap {
  display: block; width: auto; height: 29px; padding: 0 10px;
  font: 600 12.5px/29px var(--font); color: #33404a; border-radius: 0;
}
.map-canvas .map-basemaps button.map-basemap + button.map-basemap { border-top: 0; border-left: 1px solid #ddd; }
.map-canvas .map-basemaps button.map-basemap:first-child { border-radius: 4px 0 0 4px; }
.map-canvas .map-basemaps button.map-basemap:last-child { border-radius: 0 4px 4px 0; }
.map-canvas .map-basemaps button.map-basemap[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.map-canvas .map-basemaps button.map-basemap:focus-visible { outline: 2px solid #2f6fd6; outline-offset: 1px; }
.map-canvas .map-layers { position: relative; }
.map-canvas.map-layers-open .maplibregl-ctrl-top-right { z-index: 3; }
.map-canvas .map-layers button.map-layers-button {
  display: block; width: auto; height: 29px; padding: 0 10px; border-radius: 4px;
  font: 600 12.5px/29px var(--font); color: #33404a;
}
.map-canvas .map-layers button.map-layers-button[aria-expanded="true"] { background: #e9eef0; }
.map-canvas .map-layers button.map-layers-button:focus-visible { outline: 2px solid #2f6fd6; outline-offset: 1px; }
.map-layers-panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: 210px; overflow-y: auto;
  padding: 4px 10px 6px; text-align: left; font: 13px/1.3 var(--font); color: #102023;
  background: #ffffff; border-radius: 6px; box-shadow: 0 2px 10px rgb(0 0 0 / 25%);
}
.map-layers-panel fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.map-layers-panel legend {
  padding: 6px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #5d6c70;
}
.map-layer { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; min-height: 30px; cursor: pointer; }
.map-layer input { margin: 0; width: 16px; height: 16px; accent-color: #0f7c74; }
.map-layer input:disabled + span { color: #8a979b; }
.map-layer small { grid-column: 2; margin-top: -4px; padding-bottom: 4px; font-size: 11.5px; color: #5d6c70; }
@media (pointer: coarse) {
  .map-canvas .map-basemaps button.map-basemap { height: 44px; line-height: 44px; padding: 0 14px; font-size: 14px; }
  .map-canvas .map-layers button.map-layers-button { height: 44px; line-height: 44px; padding: 0 14px; font-size: 14px; }
  .map-layers-panel { width: 190px; }
  .map-layers-panel legend { padding-top: 4px; }
  .map-layer { min-height: 44px; }
  .map-layer input { width: 20px; height: 20px; }
}
.map-popup { display: grid; gap: 2px; font: 13px/1.4 var(--font); color: #102023; }
.map-popup-where, .map-popup-kind { color: #5d6c70; font-size: 12px; }
.map-tooltip { pointer-events: none; }
@media (max-width: 480px) {
  .map-canvas .maplibregl-ctrl-attrib { font-size: 10px; line-height: 1.3; padding: 1px 4px; }
}
.map-tooltip .maplibregl-popup-content { padding: 4px 8px; font: 600 12.5px/1.3 var(--font); color: #102023; }

/* Slash commands */
.commands {
  position: absolute; left: 20px; right: 20px; bottom: calc(100% - 4px); z-index: 7;
  max-height: min(50vh, 360px); overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  animation: picker-in 0.12s ease-out;
}
.commands button {
  display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 4px 10px; width: 100%;
  border: 0; background: transparent; border-radius: 9px; padding: 7px 10px; cursor: pointer; text-align: left;
}
.commands button.on, .commands button:hover { background: var(--surface-2); }
.command-name { font: 600 13px var(--mono); color: var(--accent); }
.command-summary { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.cmd-chip {
  display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px;
  font: 12.5px var(--mono); background: rgb(255 255 255 / 16%);
}
@media (max-width: 560px) { .commands { left: 8px; right: 8px; } }

/* Cheat sheet */
.composer-dock { position: relative; }
.sheet {
  position: absolute; left: 20px; right: 20px; bottom: calc(100% - 4px); z-index: 6;
  max-height: min(70vh, 620px); overflow-y: auto; padding: 14px 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  animation: picker-in 0.18s ease-out;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 16px; }
.sheet-section h3 { margin: 14px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.example {
  display: grid; gap: 4px; text-align: left; align-content: start; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); border-radius: 12px; padding: 10px 12px;
  transition: border-color 0.15s, transform 0.15s;
}
.example:hover:not(:disabled), .example:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.example:disabled { cursor: default; opacity: 0.7; }
.example-prompt { font-weight: 600; font-size: 14px; }
.example-expect { font-size: 13px; color: var(--muted); }
.example-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.example-tools code { font: 11px var(--mono); color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 1px 5px; }
@media (max-width: 560px) { .sheet { left: 8px; right: 8px; } }

/* Save this spot */
.spot-sheet { display: grid; gap: 10px; max-width: 460px; }
.spot-sheet .note-text { margin: 0; }
.spot-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: -6px; }
.spot-input {
  width: 100%; font: inherit; font-size: 16px; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.spot-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.spot-rough { color: var(--warn); }
.spot-point a { color: var(--accent); }
.spot-card {
  display: grid; gap: 6px; margin: 0 0 0 40px; max-width: min(460px, 85%); padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.spot-card .note-text, .spot-card .panel-note { margin: 0; }

/* Tapbacks */
.msg-wrap { position: relative; display: flex; align-items: center; gap: 6px; max-width: 100%; }
.row.user .msg-wrap { justify-content: flex-end; }
.msg-wrap .msg { min-width: 0; }
/* Replies */
.reply-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  font-size: 13px; animation: picker-in 0.15s ease-out; min-width: 0; max-width: 100%; overflow: hidden;
}
.reply-bar-label { flex: none; font-weight: 600; color: var(--accent); }
.reply-bar-text { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .close { flex: none; padding: 0 8px; font-size: 18px; }
/* On the water (public/here.js): sharing location while the app is open */
.here-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid #2f6fd6;
  font-size: 13px; min-width: 0; max-width: 100%; overflow: hidden;
}
.here-bar-label { flex: none; font-weight: 600; }
.here-bar-text { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.here-bar .btn { flex: none; }
.here-bar .close { flex: none; padding: 0 8px; font-size: 18px; }
.map-here {
  width: 16px; height: 16px; border-radius: 50%; background: #2f6fd6; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(47, 111, 214, 0.25), 0 1px 3px rgba(0, 0, 0, 0.35);
}
.reply-quote {
  display: grid; gap: 1px; max-width: 100%; text-align: left; cursor: pointer;
  padding: 5px 10px; border: 0; border-left: 3px solid var(--accent); border-radius: 10px;
  background: var(--surface); color: var(--muted); font-size: 12.5px;
}
.reply-quote:hover { background: var(--surface-2); }
.reply-quote-who { font-weight: 600; color: var(--accent); font-size: 11.5px; }
.reply-quote-text { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row.flash .msg { animation: flash 1.2s ease-out; }
.picker-reply {
  width: auto !important; padding: 0 12px !important; border-radius: 999px !important;
  font-size: 13px !important; white-space: nowrap; border-left: 1px solid var(--border) !important;
}
.react-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1;
  opacity: 0; transform: scale(0.8); transition: opacity 0.12s, transform 0.12s;
}
.row.agent:hover .react-btn, .react-btn:focus-visible { opacity: 1; transform: scale(1); }
@media (hover: none) { .react-btn { display: none; } }
.tapback {
  position: absolute; top: -12px; z-index: 1; min-width: 28px; height: 26px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px; font-size: 14px; line-height: 1;
  background: var(--surface); border: 2px solid var(--bg); box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
  animation: tapback-pop 0.42s cubic-bezier(0.3, 1.7, 0.5, 1);
}
.tapback.on-agent { right: 24px; cursor: pointer; background: var(--accent); }
.tapback.on-user { left: -10px; background: var(--surface-2); }
.row.user .msg-wrap, .row.agent .msg-wrap:has(.tapback) { margin-top: 0; }
.row:has(.tapback) { padding-top: 8px; }
@keyframes tapback-pop {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.picker {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5; display: flex; gap: 2px;
  padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); animation: picker-in 0.18s ease-out;
}
.picker button {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  font-size: 20px; line-height: 1; transition: transform 0.12s, background 0.12s;
  animation: picker-item 0.26s cubic-bezier(0.3, 1.6, 0.5, 1) backwards; animation-delay: calc(var(--i) * 25ms);
}
.picker button:hover, .picker button:focus-visible { transform: scale(1.25); background: var(--surface-2); outline: none; }
.picker button.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
@keyframes picker-in { from { opacity: 0; transform: translateY(6px) scale(0.92); } }
@keyframes picker-item { from { opacity: 0; transform: translateY(8px) scale(0.5); } }
@media (prefers-reduced-motion: reduce) { .tapback, .picker, .picker button { animation: none; } }

/* Inline activity */
.trace { max-width: min(620px, 85%); }
.trace > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: var(--muted); padding: 4px 10px 4px 8px; border-radius: 999px;
  border: 1px dashed var(--border); user-select: none;
}
.trace > summary::-webkit-details-marker { display: none; }
.trace > summary:hover { color: var(--text); border-style: solid; }
.trace > summary .chev { transition: transform 0.15s; font-size: 10px; }
.trace[open] > summary .chev { transform: rotate(90deg); }
.trace .spinner { width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.trace ol { margin: 8px 0 0; padding: 0 0 0 4px; list-style: none; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.trace li { display: flex; gap: 8px; align-items: baseline; }
.trace li::before { content: "•"; color: var(--accent); }
.trace li.bad::before { color: var(--danger); }
.trace li span { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thinking { display: flex; align-items: baseline; gap: 0; color: var(--muted); font-size: 14px; padding-left: 2px; }
.thinking .status-text.swap { animation: status-swap 0.35s ease-out; }
@keyframes status-swap { from { opacity: 0; transform: translateY(4px); } }
.dots span { animation: dot 1.2s infinite; opacity: 0; }
.dots span:nth-child(1) { animation-name: dot1; }
.dots span:nth-child(2) { animation-name: dot2; }
.dots span:nth-child(3) { animation-name: dot3; }
@keyframes dot1 { 0%, 100% { opacity: 1; } }
@keyframes dot2 { 0%, 32% { opacity: 0; } 33%, 100% { opacity: 1; } }
@keyframes dot3 { 0%, 65% { opacity: 0; } 66%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots span { animation: none; opacity: 1; } .thinking .status-text.swap { animation: none; } }
.shimmer {
  background: linear-gradient(90deg, var(--muted) 0%, var(--text) 50%, var(--muted) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Empty state */
.hello { margin: auto 0; padding: 8vh 0 4vh; display: grid; justify-items: center; text-align: center; gap: 10px; }
.hello h1 { margin: 6px 0 0; font-size: 30px; letter-spacing: -0.02em; }
.hello p { margin: 0; color: var(--muted); max-width: 460px; }
.suggestions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; width: 100%; margin-top: 18px; text-align: left; }
.suggestion {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; text-align: left; align-content: start; transition: border-color 0.15s, transform 0.15s;
}
.suggestion:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.suggestion:disabled { opacity: 0.5; cursor: default; }
.suggestion strong { font-size: 14px; }
.suggestion span { font-size: 13px; color: var(--muted); }

/* Composer: + for the extras, the message box, a big mic and send */
.composer-dock { padding: 8px 20px 12px; max-width: 800px; width: 100%; margin: 0 auto; display: grid; gap: 8px; }
.composer {
  display: flex; align-items: flex-end; gap: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 26px; padding: 6px; box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.composer textarea {
  flex: 1; border: 0; outline: 0; resize: none; background: transparent; padding: 11px 4px;
  max-height: 200px; line-height: 1.45; font-size: 17px; min-height: 48px;
}
.composer textarea:disabled { cursor: not-allowed; }
.send {
  width: 48px; height: 48px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  transition: opacity 0.15s, transform 0.1s;
}
.send:active:not(:disabled) { transform: scale(0.94); }
.send:disabled { opacity: 0.35; cursor: default; }
.send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.composer-hint { margin: 0; text-align: center; font-size: 15px; color: var(--muted); }
.notice { border-radius: 12px; padding: 9px 12px; font-size: 14px; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.jump {
  position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; color: var(--muted);
}

/* Side panel */
.side {
  display: none; min-height: 0; flex-direction: column; border-left: 1px solid var(--border); background: var(--surface);
}
.app.side-open .side { display: flex; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.tab { border: 0; background: transparent; border-radius: 8px; padding: 5px 12px; cursor: pointer; color: var(--muted); font-size: 14px; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 8%); font-weight: 600; }
.close { font-size: 20px; padding: 2px 10px; }
.panel { overflow-y: auto; padding: 4px 16px 24px; }
.panel-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 20px 0 10px; display: flex; gap: 8px; align-items: center; }
.panel-note { font-size: 13px; color: var(--faint); margin: 12px 0; }
.stack { display: grid; gap: 10px; }
.empty { font-size: 14px; color: var(--faint); margin: 0; }
.card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: var(--bg); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h3 { margin: 0; font-size: 15px; }
.card-sub { font-size: 13px; color: var(--muted); margin: 0; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select, .num {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 8px; font-size: 14px;
}
.check { border-top: 1px dashed var(--border); padding-top: 10px; display: grid; gap: 8px; }
.check p { margin: 0; font-size: 13px; color: var(--muted); }
.card.catch { grid-template-columns: 72px 1fr; align-items: start; }
.card.catch:not(:has(.catch-photo)) { grid-template-columns: 1fr; }
.catch-photo { padding: 0; border: 0; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--surface-2); }
.catch-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.catch h3 { text-transform: capitalize; }
.note-scope { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.card p.note-text { margin: 0; font-size: 14px; }
.learned-meter { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.learned-meter span { display: block; height: 100%; background: var(--accent); }

.run { border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.run.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--accent); } }
.run > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.run > summary::-webkit-details-marker { display: none; }
.run > summary .when { margin-left: auto; color: var(--faint); font-size: 12px; }
.run-body { padding: 0 12px 12px; display: grid; gap: 8px; }
.step { border-left: 2px solid var(--accent); padding-left: 10px; display: grid; gap: 4px; }
.step.bad { border-left-color: var(--danger); }
.step-name { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.step-label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.step pre {
  margin: 0; font: 12px/1.45 var(--mono); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; overflow-x: auto; max-height: 220px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.usage { font-size: 12px; color: var(--faint); }
.scrim { display: none; }

@media (max-width: 900px) {
  .app.side-open .layout { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); z-index: 10;
    box-shadow: -12px 0 32px rgb(0 0 0 / 18%);
  }
  .app.side-open .scrim { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / 30%); z-index: 9; }
}
@media (max-width: 560px) {
  .pill #mode-text { display: none; }
  .timeline-inner { padding: 18px 12px 8px; }
  .composer-dock { padding: 6px 10px 10px; }
  .bubble-col, .trace { max-width: 88%; }
  .hello h1 { font-size: 24px; }
  .bob-slot[data-size="xl"] { width: 132px; height: 132px; }
}

/* Multi-step plan checklist (public/plan.js) */
.plan-card {
  margin-left: 40px; max-width: min(520px, 85%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px 12px;
}
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.plan-title { font-weight: 600; font-size: 14px; }
.plan-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.plan-step { display: flex; align-items: center; gap: 10px; }
.plan-box {
  flex: none; width: 16px; height: 16px; border: 1.5px solid var(--faint); border-radius: 4px;
  display: inline-grid; place-items: center; font-size: 11px; line-height: 1; color: var(--accent-ink);
}
.plan-box.spinner { border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.plan-step.done .plan-box { background: var(--accent); border-color: var(--accent); }
.plan-step.done .plan-goal { color: var(--muted); }
.plan-step.running .plan-goal { color: var(--text); font-weight: 500; }
.plan-step.failed .plan-box { background: var(--danger); border-color: var(--danger); }
.plan-step.dropped { color: var(--faint); }
.plan-step.dropped .plan-box { border-style: dashed; color: var(--faint); }
.plan-step.dropped .plan-goal { text-decoration: line-through; }
.plan-step.added { animation: rise 0.3s ease-out; }
.plan-new { font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 7px; }
.plan-reason { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) { .plan-card { margin-left: 0; max-width: 100%; } }
@media (prefers-reduced-motion: reduce) { .plan-box.spinner { animation-duration: 2.4s; } .plan-step.added { animation: none; } }

/* Suggested next steps (public/suggestions.js) */
.row.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.chip { font: inherit; font-size: 17px; line-height: 1.2; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--text); cursor: pointer; }
.chip:hover { filter: brightness(0.97); }
.chip.quiet { border-color: transparent; background: transparent; opacity: 0.75; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Memory page (public/memory.js) ---------- */
.memory-page { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
.memory-page[hidden] { display: none; }
body.memory-open { overflow: hidden; }
.memory-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px max(16px, env(safe-area-inset-left)) 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.memory-head h1 { font-size: 20px; margin: 0 0 4px; }
.memory-body { flex: 1; overflow-y: auto; padding: 12px 16px 48px; width: 100%; max-width: 760px; margin: 0 auto; box-sizing: border-box; }
.memory-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.memory-tools input[type="search"] { flex: 1 1 220px; min-width: 0; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.mem-toggle { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.mem-privacy { margin: 8px 0 4px; }
.mem-section { margin-top: 8px; }
.mem-group { font-size: 14px; margin: 12px 0 2px; color: var(--muted); }
.mem-item.pending { border-color: var(--warn); }
.mem-item.old { opacity: 0.7; }
.mem-item.is-private { border-left: 3px solid var(--accent); }
.mem-meta { margin: 0; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag.private { color: var(--accent); background: var(--accent-soft); }
.mem-source summary, .mem-old summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.mem-source blockquote { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--border); color: var(--text); font-size: 14px; }
.mem-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mem-actions.confirm span { font-size: 13px; color: var(--danger); margin-right: 4px; }
.mem-editor { display: grid; gap: 8px; }
.mem-edit, .mem-confirm-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.mem-wipe { border-color: var(--danger); margin-bottom: 12px; }
.mem-wipe h3 { margin: 0; }
.mem-long summary { list-style: none; cursor: pointer; }
.mem-old { margin-top: 10px; }
#toggle-memory .count:not([hidden]) { background: var(--warn); color: #fff; }

/* Incognito chats */
#incognito-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.incognito-banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 13px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--text); margin-bottom: 6px; }
.incognito-banner[hidden] { display: none; }
body.is-incognito .composer { outline: 2px dashed var(--accent); outline-offset: 2px; }
.row.incognito .msg { border: 1px dashed var(--accent); }

/* Sources: under a reply while its picker is open (public/citations.js) */
.sources {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 5; width: min(340px, 85vw);
  padding: 10px 6px 6px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); animation: picker-in 0.18s ease-out;
}
.sources-head {
  padding: 0 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--faint);
}
.sources ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sources a {
  display: grid; gap: 1px; padding: 7px 8px; border-radius: 10px; color: var(--text);
  text-decoration: none; min-width: 0;
}
.sources a:hover, .sources a:focus-visible { background: var(--surface-2); outline: none; }
.sources .source-site { font-size: 14px; font-weight: 600; }
.sources .source-title, .sources .source-meta {
  font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sources .source-meta { color: var(--faint); }
@media (prefers-reduced-motion: reduce) { .sources { animation: none; } }

/* Tool cards in the chat (public/cards.js): bite, lures */
.tool-card {
  display: grid; gap: 10px; margin: 0 0 0 40px; max-width: min(560px, 85%); padding: 12px 14px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: rise 0.3s ease-out;
}
@media (max-width: 640px) { .tool-card { margin-left: 0; max-width: 100%; } }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-kicker { font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.card-title { font-weight: 600; font-size: 15px; }
.tool-card .card-sub { margin: 0; font-size: 13px; color: var(--muted); }
.card-foot { margin: 0; font-size: 12px; color: var(--faint); }
.card-alert { margin: 0; padding: 6px 10px; border-radius: 10px; font-size: 13px; background: var(--danger-soft); color: var(--danger); }
.card-care { margin: 0; padding: 7px 10px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, var(--bite-fair) 18%, transparent); color: var(--text); }
.card-error { margin: 0; font-size: 12.5px; color: var(--danger); }
.tool-card .muted { color: var(--muted); }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 999px; }
:root { --bite-slow: #9aa7ab; --bite-fair: #e0b341; --bite-good: #3fa66b; --bite-great: #0d5b54; }
@media (prefers-color-scheme: dark) { :root { --bite-slow: #5d6c70; --bite-fair: #d6a93a; --bite-good: #4cc17f; --bite-great: #6fcfbf; } }
.bite-score { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 2px; text-align: right; }
.bite-score strong { font-size: 30px; line-height: 1; }
.bite-score span { font-size: 13px; color: var(--muted); }
.bite-score em { grid-column: 1 / -1; font-style: normal; font-size: 12px; text-transform: capitalize; }
.bite-score.slow strong, .bite-score.slow em { color: var(--bite-slow); }
.bite-score.fair strong, .bite-score.fair em { color: var(--bite-fair); }
.bite-score.good strong, .bite-score.good em { color: var(--bite-good); }
.bite-score.great strong, .bite-score.great em { color: var(--bite-great); }
.day-picker { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.day-picker .day {
  flex: none; display: grid; justify-items: center; gap: 1px; min-width: 46px; padding: 5px 6px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 12px;
}
.day-picker .day b { font-size: 14px; }
.day-picker .day b.slow { color: var(--bite-slow); } .day-picker .day b.fair { color: var(--bite-fair); }
.day-picker .day b.good { color: var(--bite-good); } .day-picker .day b.great { color: var(--bite-great); }
.day-picker .day.on { border-color: var(--accent); background: var(--accent-soft); }
.day-picker .day.loading { opacity: 0.5; }
.bite-strip { display: grid; gap: 3px; }
.bite-bars { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 2px; height: 64px; }
.bite-bar { height: var(--h); border-radius: 3px 3px 1px 1px; background: var(--bite-slow); opacity: 0.85; }
.bite-bar.fair { background: var(--bite-fair); } .bite-bar.good { background: var(--bite-good); } .bite-bar.great { background: var(--bite-great); }
.bite-bar.dark { opacity: 0.45; }
.bite-bar.peak { opacity: 1; box-shadow: 0 -3px 0 var(--text) inset; }
.bite-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bite-windows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13.5px; }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.reason { display: flex; gap: 8px; align-items: baseline; }
.reason-sign { flex: none; font-size: 10px; width: 12px; }
.reason.up .reason-sign { color: var(--bite-good); }
.reason.down .reason-sign { color: var(--danger); }
.reason.flat .reason-sign { color: var(--faint); }
.lures { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lure { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; }
.swatch { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); }
.lure-body { display: grid; gap: 1px; min-width: 0; }
.lure-name { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.lure-line { font-size: 13px; }
.lure-line b { font-weight: 600; color: var(--muted); font-size: 12px; }
@media (max-width: 480px) { .lure { grid-template-columns: 30px 1fr; } .lure .btn { grid-column: 2; justify-self: start; } }
@media (prefers-reduced-motion: reduce) { .tool-card { animation: none; } }
.tool-card .btn.small { border: 1px solid var(--border); }

/* Lake finder card (public/cards.js) */
.finder-lakes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.finder-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.finder-drive { font-size: 13px; color: var(--muted); }
.finder-sure { font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; }
.finder-sure.high { color: var(--bite-good); }
.finder-sure.low { color: var(--faint); }
.finder-why { margin: 2px 0 0; font-size: 14px; }

/* Forecast, rules and catch cards (public/cards.js) */
.fc-now { display: grid; justify-items: end; }
.fc-now strong { font-size: 24px; line-height: 1.1; }
.fc-now span { font-size: 12px; color: var(--muted); }
.day-picker .day small { font-size: 10.5px; color: var(--muted); }
.fc-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.fc-tabs::-webkit-scrollbar { display: none; }
.fc-tab { flex: none; border: 1px solid var(--border); background: transparent; border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; }
.fc-tab.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.fc-chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; }
.fc-col { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.fc-val { font-size: 11.5px; font-weight: 600; }
.fc-track { position: relative; width: 100%; max-width: 30px; height: 70px; display: flex; align-items: end; }
.fc-bar { position: relative; z-index: 1; width: 100%; border-radius: 4px 4px 1px 1px; background: var(--accent); }
.fc-bar.rain { background: #3d7fd6; } .fc-bar.pressure { background: #8a6fd1; } .fc-bar.temp { background: #e0864a; }
.fc-gust { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 1px 1px; background: var(--accent-soft); border: 1px dashed var(--accent); }
.fc-key { margin-top: 4px; }
.fc-time { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.fc-tides { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; font-size: 13.5px; }
.fc-moon p { margin: 0; }
.verdict { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.verdict.good { background: color-mix(in srgb, var(--bite-good) 18%, transparent); color: var(--bite-good); }
.verdict.bad { background: var(--danger-soft); color: var(--danger); }
.verdict.warn { background: color-mix(in srgb, var(--bite-fair) 20%, transparent); color: var(--warn); }
.rules { margin: 0; display: grid; gap: 6px; }
.rule-row { display: grid; grid-template-columns: 80px 1fr; gap: 10px; font-size: 14px; }
.rule-row dt { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.rule-row dd { margin: 0; }
.rule-row ul { margin: 0; padding-left: 18px; }
.recap-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.recap-stat { display: grid; justify-items: center; padding: 8px 4px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.recap-stat strong { font-size: 24px; line-height: 1.1; color: var(--accent); }
.recap-stat span { font-size: 11.5px; color: var(--muted); }
.verdict.big { font-size: 15px; padding: 5px 14px; letter-spacing: 0.01em; }
.keep-card .reason-sign { font-size: 12px; font-weight: 700; }
.card-tip { margin: 0; padding: 7px 10px; border-radius: 10px; font-size: 13px; background: var(--surface-2); }
.ruler { display: grid; gap: 4px; padding: 6px 0 2px; }
.ruler-track { position: relative; height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.ruler-legal { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--bite-good) 35%, transparent); }
.ruler-slot {
  position: absolute; top: 0; bottom: 0;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--danger) 45%, transparent) 0 4px, transparent 4px 8px);
}
.ruler-fish { position: absolute; top: 50%; transform: translate(-50%, -55%); font-size: 20px; line-height: 1; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.25)); }
.ruler-ticks { position: relative; height: 16px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ruler-tick { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ruler-tick::before { content: ""; position: absolute; left: 50%; top: -8px; width: 1px; height: 6px; background: var(--muted); }
.card-foot a { color: var(--accent); }
.catch-conditions { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.catch-card-photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); }
.badge.pb { background: color-mix(in srgb, var(--fish-top) 25%, transparent); }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tide-marks { position: relative; height: 14px; }
.tide-mark { position: absolute; transform: translateX(-50%); font-size: 10px; line-height: 14px; color: #3d7fd6; }
.tide-mark.low { opacity: 0.7; }
.bite-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); }
.bite-legend .key { display: inline-flex; align-items: center; gap: 5px; }
.bite-legend .key.peak::before, .bite-legend .key.dark::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--bite-good); }
.bite-legend .key.peak::before { box-shadow: 0 -3px 0 var(--text) inset; }
.bite-legend .key.dark::before { background: var(--bite-slow); opacity: 0.45; }
.bite-legend .key.tide { color: #3d7fd6; }

/* Big tiles by goal on Today (public/today.js), and the Log tab's screen (public/logbook.js) */
.features { min-height: 0; overflow: auto; background: var(--bg); }
.features-inner { max-width: 880px; margin: 0 auto; padding: 22px 16px 32px; display: grid; gap: 16px; }
.tile-picks { display: grid; gap: 10px; }
.tile-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tile-pick-label { font-weight: 650; font-size: 17px; min-width: 56px; color: var(--muted); }
.tile-chip {
  font: inherit; font-size: 17px; padding: 9px 18px; border-radius: 999px; cursor: pointer; min-height: 48px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.tile-chip[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile {
  font: inherit; text-align: left; color: var(--text); cursor: pointer;
  display: grid; grid-template-rows: auto auto 1fr; align-content: start; gap: 6px;
  min-height: 136px; padding: 16px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.tile:hover { border-color: var(--accent); }
.tile:active { transform: scale(0.98); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile-icon { font-size: 30px; line-height: 1; }
.tile-label { font-size: 20px; font-weight: 700; line-height: 1.2; }
.tile-hint { font-size: 17px; color: var(--muted); line-height: 1.35; }
.tile-live { font-size: 17px; font-weight: 650; color: var(--accent); line-height: 1.35; }
.tile-live.busy { color: var(--faint); font-weight: 400; }
.tile-live.slow { color: var(--bite-slow); }
.tile-live.fair { color: var(--bite-fair); }
.tile-live.good { color: var(--bite-good); }
.tile-live.excellent { color: var(--bite-great); }
.tile-note { margin: 0; color: var(--muted); font-size: 17px; }
.tile-ghost { position: fixed; z-index: 50; margin: 0; pointer-events: none; overflow: hidden; background: var(--surface); border-color: var(--accent); box-shadow: 0 12px 40px rgb(16 32 35 / 18%); }
@media (max-width: 560px) {
  .features-inner { padding: 16px 12px 28px; gap: 14px; }
  .tile-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 128px; padding: 14px 12px; }
  .tile-label { font-size: 19px; }
  .tile-hint, .tile-live { font-size: 17px; }
}
/* Keep the chat column inside a phone screen: no child may widen it past the viewport. */
.composer-dock { grid-template-columns: minmax(0, 1fr); }
.composer textarea { min-width: 0; }
@media (max-width: 480px) {
  .composer-dock { padding: 6px 8px 8px; }
  .composer .talk-mic span { display: none; }
  .composer .talk-mic { padding: 0; width: 48px; }
}

/* Developer views (public/app.js devMode): hidden unless the page has the dev class. */
html:not(.dev) .dev-only { display: none !important; }

/* The account sheet (public/app.js openAccount). */
.modal-scrim {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgb(8 16 18 / 45%);
}
.modal {
  width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px 20px 20px; display: grid; gap: 12px;
}
.modal .sheet-head h2 { font-size: 18px; }
.account-email { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.account-links { display: grid; gap: 2px; }
.account-links a { color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.account-links a:hover { text-decoration: underline; }
.account-danger { border-top: 1px solid var(--border); padding-top: 12px; }
.account-danger summary { cursor: pointer; color: var(--danger); font-weight: 600; }
.account-danger p { color: var(--muted); font-size: 14px; }
.account-danger .btn { width: 100%; justify-content: center; margin-top: 10px; }
.account-label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.account-confirm { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 16px; }
.account-danger .btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.account-danger .btn.danger:disabled { opacity: 0.5; }

/* Catch log screen (public/logbook.js): big type and big targets, for reading at a glance. */
.logbook .lb-inner { max-width: 760px; }
.lb-h2 { margin: 8px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.lb-best-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lb-best {
  display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.lb-best:hover { border-color: var(--accent); }
.lb-best-species { font-weight: 700; font-size: 16px; }
.lb-best-size { color: var(--accent); font-weight: 650; font-size: 16px; }
.lb-filters { display: grid; gap: 10px; }
.lb-search { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 17px; }
.lb-tile:focus-visible, .lb-best:focus-visible, .lb-camera:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lb-badge { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.lb-empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 16px; }
.lb-empty-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.lb-back { font-size: 17px; min-height: 44px; justify-self: start; }
.lb-detail { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; }
.lb-photo { width: 100%; max-height: 420px; object-fit: contain; border-radius: 12px; background: var(--surface-2); }
.lb-detail-title { margin: 0; font-size: 26px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lb-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 17px; }
.lb-facts dt { color: var(--muted); }
.lb-facts dd { margin: 0; overflow-wrap: anywhere; }
.lb-conditions { margin: 0; color: var(--muted); font-size: 15px; }
.lb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lb-actions .btn { min-height: 48px; padding: 10px 18px; font-size: 16px; }
.lb-delete { border-top: 1px solid var(--border); padding-top: 12px; display: grid; gap: 8px; }
.lb-delete p { margin: 0; }
.btn.danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.lb-form-title { margin: 0; font-size: 22px; }
.lb-form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; }
.lb-field { display: grid; gap: 6px; }
.lb-label { font-weight: 650; font-size: 16px; }
.lb-hint { color: var(--faint); font-size: 14px; }
.lb-field input, .lb-field select, .lb-field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 17px; min-height: 50px;
}
.lb-field input[type="file"] { padding: 10px; }
.lb-where { display: grid; gap: 8px; }
.lb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .lb-two { grid-template-columns: 1fr; } }
.lb-save { flex: 1; justify-content: center; }
.catch-log-open { margin: 0 0 8px; font-size: 14px; justify-self: start; }

/* The share sheet (public/share.js): the catch picture, Share or Save, and email to a friend. */
.share-sheet { width: min(480px, 100%); }
.share-preview { display: grid; place-items: center; }
.share-canvas {
  width: 100%; max-width: 360px; height: auto; aspect-ratio: 1080 / 1350;
  border-radius: 14px; background: var(--surface-2); box-shadow: var(--shadow);
}
.share-check { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--text); cursor: pointer; }
.share-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.share-actions { display: flex; gap: 8px; }
.share-actions .btn { flex: 1; justify-content: center; padding: 11px; font-size: 15px; text-decoration: none; }
.share-actions .btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.share-email { border-top: 1px solid var(--border); padding-top: 12px; }
.share-email summary { cursor: pointer; font-weight: 600; color: var(--text); }
.share-form { display: grid; gap: 10px; margin-top: 10px; }
.share-intro { margin: 0; color: var(--muted); font-size: 14px; }
.share-label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.share-label-row { display: flex; justify-content: space-between; }
.share-count { color: var(--faint); font-size: 12px; }
.share-input {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px; resize: vertical;
}
.share-form .btn { justify-content: center; padding: 11px; font-size: 15px; }
.share-status { margin: 0; min-height: 1.2em; font-size: 14px; color: var(--accent); }
.share-status.error { color: var(--danger); }

/* Today (public/today.js): the main water's bite and weather, the next trip, the tiles */
.today { overflow-y: auto; overscroll-behavior: contain; }
.today-inner { max-width: 880px; margin: 0 auto; padding: 16px 16px 32px; display: grid; gap: 16px; }
.today-h2 { margin: 8px 0 -4px; font-size: 20px; font-weight: 700; }
.prompt-slot > * { margin: 0; }
.hero-card, .trip-card {
  display: grid; gap: 16px; padding: 18px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.hero-kicker { margin: 0; font-size: 17px; font-weight: 650; color: var(--muted); }
.hero-top { display: flex; align-items: center; gap: 18px; }
.hero-score { flex: none; display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 2px; }
.hero-score strong { font-size: 64px; line-height: 0.95; letter-spacing: -0.03em; }
.hero-of { font-size: 20px; color: var(--muted); }
.hero-word { grid-column: 1 / -1; font-size: 20px; font-weight: 700; }
.hero-score.slow strong, .hero-score.slow .hero-word { color: var(--bite-slow); }
.hero-score.fair strong, .hero-score.fair .hero-word { color: var(--warn); }
.hero-score.good strong, .hero-score.good .hero-word { color: var(--bite-good); }
.hero-score.great strong, .hero-score.great .hero-word { color: var(--bite-great); }
.hero-verdict { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.3; }
.hero-sub { margin: 0; color: var(--muted); }
.hero-alert { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); font-weight: 650; }
.hero-care { margin: 0; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--bite-fair) 18%, transparent); }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hero-when { color: var(--muted); font-size: 15px; }
.hero-empty { justify-items: start; }
.btn.big { min-height: 48px; padding: 10px 20px; font-size: 17px; border-radius: 14px; }

.day-bar { position: relative; padding-top: 30px; }
.day-best-label {
  position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.day-hours { position: relative; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 34px; }
.day-hour { border-radius: 4px; background: var(--bite-slow); opacity: 0.75; }
.day-hour.fair { background: var(--bite-fair); }
.day-hour.good { background: var(--bite-good); }
.day-hour.great { background: var(--bite-great); }
.day-best { position: absolute; top: -4px; bottom: -4px; border: 3px solid var(--text); border-radius: 8px; pointer-events: none; }
.day-now { position: absolute; top: -8px; bottom: -8px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--sun); }
.day-axis { position: relative; height: 24px; margin-top: 6px; font-size: 15px; color: var(--muted); }
.day-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

.today-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.today-fact { display: grid; gap: 0; align-content: start; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.fact-label { font-size: 15px; color: var(--muted); }
.fact-value { font-size: 22px; line-height: 1.25; }
.fact-sub { font-size: 15px; color: var(--muted); }

.skeleton .bone { display: block; border-radius: 10px; background: var(--surface-2); animation: bone 1.4s ease-in-out infinite; }
.bone-score { width: 96px; height: 72px; flex: none; }
.bone-line { height: 28px; flex: 1; }
.bone-bar { height: 34px; margin-top: 30px; }
.bone-fact { height: 70px; }
@keyframes bone { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .skeleton .bone { animation: none; } }

.trip-card { gap: 8px; }
.trip-card.quiet { box-shadow: none; background: transparent; border-style: dashed; }
.trip-title { margin: 0; font-size: 20px; font-weight: 700; }
.trip-sub { margin: 0; color: var(--muted); }
.trip-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.trip-card > .btn, .hero-empty > .btn { justify-self: start; }
@media (max-width: 480px) {
  .today-inner { padding: 12px 12px 28px; gap: 14px; }
  .hero-card, .trip-card { padding: 16px 14px; border-radius: 20px; }
  .hero-top { gap: 14px; }
  .hero-score strong { font-size: 56px; }
  .hero-verdict { font-size: 20px; }
  .today-facts { grid-template-columns: 1fr 1fr; }
  .hero-foot .btn { width: 100%; justify-content: center; }
}

/* The composer's + button and its sheet */
.plus-btn {
  width: 48px; height: 48px; flex: none; border-radius: 50%; border: 1px solid var(--border); cursor: pointer;
  background: var(--surface-2); color: var(--text); display: grid; place-items: center;
}
.plus-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; transition: transform 0.15s; }
.plus-btn[aria-expanded="true"] svg { transform: rotate(45deg); }
.plus-sheet { padding: 8px; max-width: 420px; right: auto; }
.plus-list { display: grid; gap: 2px; }
.me-item, .plus-item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; column-gap: 14px;
  width: 100%; min-height: 56px; padding: 8px 14px; border: 0; border-radius: 14px; background: transparent;
  color: var(--text); font: inherit; font-size: 18px; text-align: left; cursor: pointer;
}
.me-item:hover:not(:disabled), .plus-item:hover:not(:disabled), .me-item:focus-visible, .plus-item:focus-visible { background: var(--surface-2); }
.me-item:disabled, .plus-item:disabled { opacity: 0.5; cursor: default; }
.me-item svg, .plus-item svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); }
.plus-item[aria-pressed="true"] { background: var(--accent-soft); }
@media (max-width: 560px) { .plus-sheet { right: 8px; max-width: none; } }

/* The Me sheet (public/app.js setMeOpen): a bottom sheet on a phone, a panel under Me on a computer */
.me-scrim { z-index: 55; place-items: end center; padding: 0; }
.me-sheet {
  width: min(520px, 100%); max-height: 92dvh; border-radius: 24px 24px 0 0; gap: 8px;
  padding: 16px 12px max(16px, env(safe-area-inset-bottom));
}
.me-sheet .sheet-head { padding: 0 6px 0 14px; }
.me-sheet .sheet-head h2 { font-size: 20px; }
.me-sheet .close { min-width: 48px; min-height: 48px; font-size: 26px; }
.me-list { display: grid; gap: 2px; }
.me-sub { grid-column: 2; grid-row: 2; font-size: 15px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-units { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px 8px 56px; }
.me-units-label { flex-basis: 100%; font-size: 18px; }
.me-note { margin: 4px 14px 0; font-size: 15px; color: var(--muted); }
#me-alerts-slot:empty { display: none; }
#me-alerts-slot { padding: 0 6px; }
@media (min-width: 720px) {
  .me-scrim { place-items: start end; padding: 68px 16px 16px; background: rgb(8 16 18 / 25%); }
  .me-sheet { width: 420px; border-radius: 20px; max-height: calc(100dvh - 84px); }
}

/* The Map tab (public/maptab.js): one map that fills the view, What's under me?, and a sheet */
.map-view { display: grid; min-height: 0; position: relative; }
.map-view .map-full { margin: 0; max-width: none; display: grid; grid-template-rows: minmax(0, 1fr) auto; border: 0; border-radius: 0; box-shadow: none; }
.map-view .map-full .map-canvas { height: auto; min-height: 0; }
.map-view .map-full figcaption { display: none; }
.map-view .map-empty { margin: 16px; align-self: start; }
.map-view .map-full .maplibregl-ctrl-group button { width: 44px; height: 44px; }
.map-view .map-full .map-basemaps button.map-basemap, .map-view .map-full .map-layers button.map-layers-button { height: 44px; line-height: 44px; padding: 0 14px; font-size: 15px; }
.prompt-slot .btn, #me-alerts-slot .btn { min-height: 48px; padding: 10px 18px; font-size: 17px; border-radius: 14px; }

/* Chat cards, card first (public/cards.js): the answer at a glance, the rest behind Why? */
.tool-card { font-size: 17px; gap: 12px; padding: 14px 16px; }
.card-kicker { font-size: 14px; }
.card-title { font-size: 18px; }
.tool-card .card-sub { font-size: 16px; }
.card-foot { font-size: 15px; }
.card-alert, .card-care, .card-tip { font-size: 16px; }
.bite-score strong { font-size: 40px; }
.bite-score span { font-size: 16px; }
.bite-score em { font-size: 16px; font-weight: 700; }
.card-lead { margin: 0; font-size: 18px; font-weight: 700; }
.card-where { margin: 4px 0 0; font-weight: 600; }
.reasons { font-size: 17px; gap: 8px; }
.reason-sign { font-size: 13px; width: 16px; }
.bite-windows { font-size: 17px; }
.day-picker .day { min-width: 52px; min-height: 52px; font-size: 15px; }
.day-picker .day b { font-size: 17px; }
.day-picker .day small { font-size: 14px; }
.fc-summary { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fc-tab { min-height: 44px; padding: 6px 16px; font-size: 16px; }
.fc-val, .fc-time { font-size: 14px; }
.fc-tides { font-size: 16px; }
.rule-row { font-size: 17px; grid-template-columns: 96px 1fr; }
.rule-row dt { font-size: 16px; }
.lure-line { font-size: 16px; }
.lure-line b { font-size: 15px; }
.badge { font-size: 15px; }
.recap-stat span { font-size: 15px; }
.tool-card .btn.small { min-height: 44px; padding: 8px 16px; font-size: 16px; }
.card-more { border-top: 1px solid var(--border); padding-top: 4px; }
.card-more > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none;
  font-weight: 650; color: var(--accent);
}
.card-more > summary::-webkit-details-marker { display: none; }
.card-more > summary::after { content: "▾"; font-size: 14px; transition: transform 0.15s; }
.card-more[open] > summary::after { transform: rotate(180deg); }
.card-more-body { display: grid; gap: 10px; padding-bottom: 4px; }
.jump { width: 48px; height: 48px; font-size: 20px; }
.fc-now span { font-size: 15px; }
.map-under {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 4;
  min-height: 56px; padding: 0 24px; border-radius: 999px; font-size: 18px; gap: 10px; box-shadow: 0 6px 20px rgb(0 0 0 / 25%);
}
.map-view .map-empty + .map-under { position: static; transform: none; margin: 0 16px; justify-self: start; }
.map-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; max-height: 70%; overflow-y: auto;
  display: grid; gap: 12px; padding: 18px 16px 16px; border-radius: 22px 22px 0 0;
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -10px 30px rgb(0 0 0 / 20%);
}
.map-sheet-close { position: absolute; top: 8px; right: 8px; min-width: 48px; min-height: 48px; font-size: 26px; }
.map-sheet-body { display: grid; gap: 8px; padding-right: 48px; }
.map-sheet-body .map-popup { font-size: 17px; color: var(--text); gap: 4px; }
.map-sheet-body .map-popup-kind, .map-sheet-body .map-popup-where { font-size: 15px; color: var(--muted); }
.map-sheet-title { margin: 0; font-size: 20px; font-weight: 700; }
.map-sheet-lead { margin: 0; font-size: 18px; }
.map-sheet-sub, .map-sheet-note { margin: 0; color: var(--muted); font-size: 15px; }
.map-sheet-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.map-sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 768px) { .map-sheet { left: 16px; right: auto; bottom: 16px; width: 420px; border-radius: 20px; border: 1px solid var(--border); } }

/* The Log tab (public/logbook.js): bests, the season recap, filters, a photo grid, the camera */
.logbook .lb-inner { padding-bottom: 120px; }
.lb-recap:empty { display: none; }
.lb-recap .tool-card { margin: 0; max-width: none; }
.lb-list { display: grid; gap: 8px; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.lb-tile {
  position: relative; display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; text-align: left;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.lb-tile:hover { border-color: var(--accent); }
.lb-tile-photo { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); }
.lb-tile-art { display: grid; place-items: center; font-size: 52px; background: linear-gradient(160deg, hsl(var(--hue) 45% 78%), hsl(calc(var(--hue) + 40) 40% 62%)); }
@media (prefers-color-scheme: dark) { .lb-tile-art { background: linear-gradient(160deg, hsl(var(--hue) 30% 30%), hsl(calc(var(--hue) + 40) 30% 20%)); } }
.lb-tile-badge { position: absolute; top: 8px; left: 8px; }
.lb-tile-text { display: grid; gap: 2px; padding: 10px 12px 12px; }
.lb-tile-title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.lb-tile-sub { font-size: 15px; color: var(--muted); }
.lb-plain-add { justify-self: start; min-height: 44px; font-size: 17px; }
.lb-camera-wrap { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; pointer-events: none; }
.lb-camera {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 24px 0 18px;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 18px; font-weight: 700;
  cursor: pointer; box-shadow: 0 6px 20px rgb(0 0 0 / 25%);
}
.lb-camera-icon { font-size: 26px; }
.lb-quick { display: grid; gap: 10px; }
.lb-quick .lb-photo { max-height: 280px; }
.lb-id { display: grid; gap: 8px; }
.lb-id-line { margin: 0; font-size: 18px; font-weight: 650; }
@media (max-width: 420px) { .lb-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .lb-tile-title { font-size: 17px; } }
.map-view:has(.map-sheet:not([hidden])) .map-under { display: none; }

/* The on-screen keyboard is up (public/keyboard.js): no bottom tabs, and the app fits the part of
   the screen above the keys, so the message box sits right on top of them. Touch screens below
   the rail's width only; a computer never gets the class. */
@media (max-width: 1023px) {
  html.keyboard-open .tabbar { display: none; }
  html.keyboard-open .app {
    position: fixed; top: var(--vv-top, 0px); left: 0; right: 0;
    height: var(--vv-height, 100dvh); grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "top" "main";
  }
  html.keyboard-open .composer-dock { padding-bottom: 6px; }
}
