/* Off the Record: a private notebook that happens to live on your phone. */

:root {
  --paper: #eef7f4;
  --card: #fbfefd;
  --soft: #d9eee8;
  --ink: #10343a;
  --muted: #587679;
  --line: #cbe3dc;
  --accent: #0e8a8c;
  --accent-soft: #d2efec;
  --on-accent: #f3fbfa;
  --hi: #a8e6cf;
  --good: #22a386;
  --star: #f2b84b;
  --deep-1: #0b5e66;
  --deep-2: #1a9c8f;
  --chart: #0a9396; /* validated: L-band, chroma and 3:1 contrast on --card */
  --shadow: 0 1px 0 rgba(16, 52, 58, 0.04), 0 8px 20px -12px rgba(16, 52, 58, 0.28);
  --serif: "New York", ui-serif, "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --tabs-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1b1e; --card: #12282c; --soft: #1a353a; --ink: #e2f4f0; --muted: #8cadab;
    --line: #21403f; --accent: #4fd1c5; --accent-soft: #143e40; --on-accent: #052225; --hi: #5fcfae; --good: #5fcfae;
    --star: #f2c46b; --deep-1: #0f4d55; --deep-2: #157a73; --chart: #26a89c;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 20px -12px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b1b1e; --card: #12282c; --soft: #1a353a; --ink: #e2f4f0; --muted: #8cadab;
  --line: #21403f; --accent: #4fd1c5; --accent-soft: #143e40; --on-accent: #052225; --hi: #5fcfae; --good: #5fcfae;
  --star: #f2c46b; --deep-1: #0f4d55; --deep-2: #157a73; --chart: #26a89c;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 20px -12px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font: 16px/1.45 var(--sans);
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 0 calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image: radial-gradient(120% 340px at 50% -80px, color-mix(in srgb, var(--hi) 45%, transparent), transparent 70%);
  background-repeat: no-repeat;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
#app { max-width: 640px; margin: 0 auto; padding: 12px 16px 0; }

/* ---------- type ---------- */
.eyebrow { font: 600 11px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
h1 { font: 600 32px/1.1 var(--serif); margin: 6px 0 4px; letter-spacing: -0.01em; }
h2 { font: 600 20px/1.2 var(--serif); margin: 0; }
.sub { color: var(--muted); margin: 0; font-size: 15px; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 10px; }
.section-title .eyebrow { font-size: 12px; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

/* ---------- buttons & chips ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; min-height: 44px;
  background: var(--accent); color: var(--on-accent); font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.quiet { background: var(--soft); color: var(--ink); }
.btn.danger { background: transparent; color: var(--accent); border: 1px solid var(--accent-soft); }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.45; }
.icon-btn { border: 0; background: transparent; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:active { background: var(--soft); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 12px; font-size: 14px; min-height: 34px;
}
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.kbd { font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft); padding: 4px 6px; border-radius: 6px; }

/* ---------- inputs ---------- */
.field, textarea.field {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px;
  font-size: 16px; outline: none; min-height: 46px;
}
.field:focus { border-color: var(--ink); }
textarea.field { resize: none; font-family: var(--serif); font-size: 18px; line-height: 1.5; min-height: 120px; }
label.lbl { display: block; font-size: 13px; color: var(--muted); margin: 14px 2px 6px; font-weight: 600; }
.add-row { display: flex; gap: 8px; }
.add-row .field { flex: 1; }

/* ---------- segmented control ---------- */
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 3px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; min-height: 36px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* ---------- home ---------- */
.hello { padding: 8px 2px 4px; }
.capture { margin-top: 16px; padding: 14px; }
.capture textarea.field { border: 0; padding: 4px 2px; min-height: 96px; background: transparent; }
.capture .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.dest { font-size: 13px; color: var(--muted); }
.dest b { color: var(--ink); }
.prompt-card { background: linear-gradient(135deg, var(--deep-1), var(--deep-2)); color: #effaf7; border: 0; position: relative; overflow: hidden; }
.prompt-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(168, 230, 207, 0.35), transparent 70%); pointer-events: none; }
.prompt-card .eyebrow { color: rgba(239, 250, 247, 0.7); }
.prompt-card .q { font: 500 21px/1.35 var(--serif); margin: 10px 0 14px; position: relative; }
.prompt-card .btn.quiet { background: rgba(239, 250, 247, 0.16); color: #effaf7; }
.prompt-card .btn { background: #effaf7; color: #0b5e66; position: relative; z-index: 1; }

/* ---------- entries ---------- */
.day-label { margin: 22px 2px 8px; }
.entry { cursor: pointer; }
.entry .body { font: 17px/1.5 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.entry .q { font: italic 14px/1.4 var(--serif); color: var(--muted); margin-bottom: 6px; }
.entry .meta { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.flames { letter-spacing: 1px; }
.intensity { display: flex; gap: 6px; }
.intensity button { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 10px; min-height: 44px; font-size: 18px; filter: grayscale(1); opacity: 0.5; }
.intensity button.on { filter: none; opacity: 1; border-color: var(--accent); background: var(--accent-soft); }

/* ---------- lists ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 14px; min-height: 108px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tile .emo { font-size: 26px; line-height: 1; }
.tile .name { font: 600 15px/1.25 var(--serif); margin-top: 10px; overflow-wrap: anywhere; }
.tile .count { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--muted); }
.tile.new { border-style: dashed; box-shadow: none; background: transparent; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.list-head { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 6px; }
.list-head .emo { font-size: 34px; line-height: 1.1; }
.items { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.item { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 4px; min-height: 52px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .txt { flex: 1; padding: 10px 6px; font: 16px/1.35 var(--serif); overflow-wrap: anywhere; cursor: pointer; }
.item .txt .note { display: block; font: 13px/1.3 var(--sans); color: var(--muted); margin-top: 2px; }
.item.done .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.item.media-done .txt { text-decoration: none; }
.check { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; flex: none; }
.check span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: all 0.15s ease; }
.check.on span { background: var(--good); border-color: var(--good); color: #fff; }
.check.on span::after { content: "✓"; font-size: 14px; font-weight: 700; }
.stars { display: flex; }
.stars button { border: 0; background: transparent; padding: 4px 2px; font-size: 16px; color: var(--line); min-width: 22px; }
.stars button.on { color: var(--star); }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; font-family: var(--serif); font-style: italic; }
.person { margin: 18px 2px 8px; display: flex; align-items: center; gap: 8px; }
.toggle-done { border: 0; background: transparent; color: var(--muted); font-size: 14px; padding: 12px 2px; font-weight: 600; }

/* ---------- to-do ---------- */
.bucket-title { display: flex; align-items: baseline; gap: 8px; margin: 24px 2px 8px; }
.bucket-title h2 { font-size: 22px; }
.fade-out { animation: fadeOut 0.5s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateX(16px); } }

/* ---------- tabs ---------- */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabs .inner { max-width: 640px; margin: 0 auto; display: flex; height: var(--tabs-h); }
#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; }
#tabs a.on { color: var(--accent); }
#tabs svg { width: 24px; height: 24px; }
.fab {
  position: fixed; right: max(16px, calc(50% - 304px)); bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent);
  font-size: 30px; line-height: 1; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* ---------- sheet (bottom drawer) ---------- */
dialog#sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92dvh;
  background: var(--paper); color: var(--ink); border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
}
dialog#sheet[open] { animation: up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1); }
dialog#sheet::backdrop { background: rgba(10, 12, 18, 0.45); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-inner { padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 92dvh; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sheet-head h2 { flex: 1; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
.prompt-list button { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 14px 4px; font: 16px/1.4 var(--serif); }
.prompt-list button:first-child { border-top: 0; }

/* ---------- toast & stamp ---------- */
#toast {
  position: fixed; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); z-index: 40;
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: all 0.2s ease;
  background: var(--ink); color: var(--paper); border-radius: 14px; padding: 10px 10px 10px 16px;
  display: flex; align-items: center; gap: 12px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}
#toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#toast button { border: 0; background: color-mix(in srgb, var(--paper) 16%, transparent); color: var(--paper); border-radius: 9px; padding: 6px 12px; font-weight: 700; min-height: 34px; }
.stamp {
  position: fixed; left: 50%; top: 38%; z-index: 50; pointer-events: none;
  font: 800 22px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  border: 3px solid var(--accent); border-radius: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--paper) 80%, transparent);
  animation: stamp 1.1s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; white-space: nowrap;
}
.stamp small { display: block; font-size: 12px; letter-spacing: 0.08em; margin-top: 6px; text-align: center; font-weight: 700; }
@keyframes stamp {
  0% { transform: translate(-50%, -50%) rotate(-14deg) scale(2.2); opacity: 0; }
  25% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); opacity: 1; }
  75% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(-8deg) scale(0.96); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .stamp, dialog#sheet[open], .fade-out { animation-duration: 0.01s; } }

/* ---------- misc ---------- */
.banner { font-size: 13px; background: var(--hi); color: #08312f; border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.sync { font-size: 12px; color: var(--muted); text-align: center; margin-top: 28px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--good); margin-right: 6px; vertical-align: 1px; }
.dot.warn { background: var(--hi); }
.dot.bad { background: var(--accent); }
.rules ol { padding-left: 20px; margin: 0; }
.rules li { margin: 10px 0; font-family: var(--serif); }
.rules li b { font-family: var(--sans); }
table.keys { width: 100%; border-collapse: collapse; font-size: 14px; }
table.keys td { padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: top; }
table.keys tr:first-child td { border-top: 0; }
.back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--accent); font-weight: 600; padding: 8px 0; min-height: 44px; }
.auth { max-width: 380px; margin: 12vh auto 0; text-align: center; }
.auth .logo { display: inline-block; transform: rotate(-8deg); border: 3px solid var(--accent); color: var(--accent); border-radius: 10px; padding: 8px 14px; font: 800 18px/1 var(--sans); letter-spacing: 0.14em; }
.search { margin: 12px 0 0; }

/* ---------- phase 2: home extras ---------- */
.hello { position: relative; }
.gear { position: absolute; right: -6px; top: 0; }
.gear svg { width: 22px; height: 22px; }
.otd .item-otd { border-top: 1px solid var(--line); padding: 12px 0 2px; cursor: pointer; }
.otd .item-otd:first-of-type { border-top: 0; padding-top: 6px; }
.otd .when { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; }
.otd .what { font: 16px/1.45 var(--serif); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini a { text-decoration: none; }
.mini .card { padding: 14px; }
.mini .num { font: 600 24px/1.1 var(--serif); margin-top: 6px; }

/* ---------- body ---------- */
.stat-row { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.big { font: 600 40px/1 var(--serif); letter-spacing: -0.02em; }
.big small { font: 600 15px var(--sans); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font: 600 18px/1.2 var(--serif); margin-top: 2px; }
.chart-wrap { position: relative; margin-top: 14px; touch-action: pan-y; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap .grid { stroke: var(--line); stroke-width: 1; }
.chart-wrap .axis { fill: var(--muted); font: 11px var(--sans); }
.chart-wrap .raw { fill: var(--chart); fill-opacity: 0.32; }
.chart-wrap .avg { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-wrap .end { fill: var(--chart); stroke: var(--card); stroke-width: 2; }
.chart-wrap .bar { fill: var(--chart); }
.chart-wrap .bar.dim { fill-opacity: 0.45; }
.chart-wrap .target { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-wrap .xhair { stroke: var(--muted); stroke-width: 1; }
.chart-wrap .hit { fill: transparent; cursor: crosshair; }
.tip {
  position: absolute; top: 0; transform: translate(-50%, -110%); pointer-events: none; white-space: nowrap;
  background: var(--ink); color: var(--paper); border-radius: 10px; padding: 6px 10px; font-size: 12px; line-height: 1.35; box-shadow: var(--shadow);
}
.tip b { font-size: 14px; }
.ring-row { display: flex; align-items: center; gap: 18px; }
.ring { width: 112px; height: 112px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--soft); }
.ring .prog { stroke: var(--chart); stroke-linecap: round; transition: stroke-dashoffset 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring .mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .mid b { display: block; font: 600 24px/1 var(--serif); }
.ring .mid span { font-size: 11px; color: var(--muted); }
.cal-list .item .txt { font-family: var(--sans); font-size: 15px; }

/* ---------- fish collection ---------- */
.progress { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; margin: 10px 0 4px; }
.progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--deep-1), var(--deep-2)); }
.dex { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fish {
  position: relative; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 1 / 1.08; display: flex; flex-direction: column; justify-content: flex-end; text-align: left; padding: 0; box-shadow: var(--shadow);
}
.fish .art { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; }
.fish .art img { width: 100%; height: 100%; object-fit: cover; }
.fish.caught .art { background: linear-gradient(160deg, var(--accent-soft), var(--soft)); }
.fish.wanted { border-style: dashed; box-shadow: none; background: transparent; }
.fish.wanted .art { filter: grayscale(1) brightness(0.6); opacity: 0.28; }
.fish .label { position: relative; padding: 28px 12px 10px; background: linear-gradient(transparent, color-mix(in srgb, var(--card) 92%, transparent) 45%); }
.fish.has-photo .label { background: linear-gradient(transparent, rgba(5, 25, 28, 0.82) 50%); color: #f1fbf8; }
.fish.has-photo .label .sm { color: rgba(241, 251, 248, 0.8); }
.fish .nm { font: 600 15px/1.2 var(--serif); overflow-wrap: anywhere; }
.fish .sm { font-size: 11px; color: var(--muted); margin-top: 3px; font-weight: 600; }
.fish .badge { position: absolute; top: 8px; right: 8px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; border-radius: 99px; padding: 3px 8px; }
.catch-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.catch-row:first-child { border-top: 0; }
.thumb { width: 54px; height: 54px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; font-size: 24px; overflow: hidden; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick { display: flex; align-items: center; gap: 12px; }
.photo-pick .thumb { width: 72px; height: 72px; }
.hero-photo { width: 100%; border-radius: 14px; display: block; margin-bottom: 12px; max-height: 50dvh; object-fit: cover; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two label.lbl { margin-top: 10px; }
.hidden { display: none !important; }

/* ---------- Gale the sailfish ---------- */
.gale { display: flex; align-items: flex-end; gap: 8px; border: 0; background: transparent; padding: 6px 0 0; text-align: left; width: 100%; color: inherit; cursor: pointer; }
.gale-av { flex: none; width: 128px; display: block; margin-left: -6px; }
.gale-av svg { width: 100%; height: auto; display: block; overflow: visible; }
.gale-av .gale-sail { transform-origin: 120px 46px; animation: sail 5s ease-in-out infinite; }
@keyframes sail { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-3deg) scaleY(1.03); } }
.gale .bubble {
  position: relative; flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px;
  padding: 10px 12px; font: 15px/1.4 var(--serif); box-shadow: var(--shadow); margin-bottom: 14px;
}
.gale.wiggle .gale-av { animation: wiggle 0.5s ease; }
.gale.wiggle .bubble { animation: pop 0.25s ease; }
@keyframes wiggle { 0% { transform: rotate(0); } 25% { transform: rotate(-8deg) translateY(-3px); } 60% { transform: rotate(5deg); } 100% { transform: rotate(0); } }
@keyframes pop { from { transform: scale(0.96); opacity: 0.4; } }
.gale-mini { display: inline-block; width: 44px; vertical-align: middle; flex: none; }
.gale-mini svg { width: 100%; height: auto; display: block; }
.empty .gale-mini { width: 56px; margin-right: 4px; }
#toast.from-gale { max-width: min(420px, calc(100vw - 32px)); }
#toast.from-gale span:not(.gale-mini) { font-family: var(--serif); font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .gale-av .gale-sail, .gale.wiggle .gale-av, .gale.wiggle .bubble { animation: none; } }

/* ---------- Phase 3: moods / Year in Pixels ---------- */
/* Diverging mood scale (validated: adjacent steps separate for protan/deutan/tritan and normal vision). */
:root { --m1: #a63a25; --m2: #e08a70; --m3: #e6e9e8; --m4: #4fb3a0; --m5: #0a6f70; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --m1: #f29a80; --m2: #b8604c; --m3: #3a4544; --m4: #2f9c8c; --m5: #6fe0d2; } }
:root[data-theme="dark"] { --m1: #f29a80; --m2: #b8604c; --m3: #3a4544; --m4: #2f9c8c; --m5: #6fe0d2; }
.m1 { --mc: var(--m1); } .m2 { --mc: var(--m2); } .m3 { --mc: var(--m3); } .m4 { --mc: var(--m4); } .m5 { --mc: var(--m5); }
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mood { border: 1px solid var(--line); background: var(--card); border-radius: 12px; min-height: 58px; padding: 8px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink); }
.mood .sw { width: 22px; height: 22px; }
.mood.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--mc, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent); flex: none; }
.sw.open { background: transparent; box-shadow: none; border: 1px dashed var(--muted); }
.pixels { display: grid; grid-template-columns: 18px repeat(12, minmax(0, 1fr)); gap: 2px; font-size: 10px; color: var(--muted); }
.pixels .ph { text-align: center; font-weight: 700; padding-bottom: 2px; }
.pixels .pr { text-align: right; padding-right: 3px; line-height: 13px; }
.px { border: 0; padding: 0; height: 13px; border-radius: 3px; background: var(--mc, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent); }
.px.open { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 45%, transparent); }
.px.future { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent); opacity: 0.6; }
.px.none { visibility: hidden; }
.px.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.legend b { color: var(--ink); }
.lookback-link .lb-pix { display: grid; grid-template-columns: repeat(3, 12px); gap: 2px; }

/* ---------- Phase 3: recaps ---------- */
.recap .masthead { text-align: center; padding: 6px 0 4px; border-bottom: 2px solid var(--ink); margin-bottom: 12px; }
.recap .masthead h1 { font-size: 34px; }
.rstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.rstat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.rstat b { display: block; font: 600 22px/1.1 var(--serif); }
.rstat span { font-size: 11px; color: var(--muted); font-weight: 600; }
.rh { font-size: 19px; margin: 26px 2px 10px; }
.rlist { margin: 6px 0 0; padding-left: 20px; font-family: var(--serif); }
.rlist li { margin: 3px 0; }
.stars-s { color: var(--star); font-size: 12px; }
.mstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 10px; color: var(--muted); text-align: center; }
.mstrip .px { height: 22px; border-radius: 5px; }
.pub-pick { cursor: pointer; }
.pub-pick input { width: 22px; height: 22px; margin: 0 6px 0 10px; accent-color: var(--accent); flex: none; }
.newsletter { background: #fbfefd; color: #10343a; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; box-shadow: var(--shadow); }
