/* ---- Synthwave theme: Tomas's Ghostty palette (synthwave-sunset, ~/.config/ghostty/themes, copy in docs/ghostty/).
   Every colour in the app comes from these tokens. Two Ghostty colours fail WCAG AA as text on the dark purple
   (bright black #6d5686 2.99:1, blue #7d5cff 4.05:1), so they're only used for lines and fills; text uses the
   lighter --muted and the bright blue. test/theme.test.mjs checks every text pair. */
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url(/fonts/orbitron-latin-600-normal.woff2) format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url(/fonts/orbitron-latin-800-normal.woff2) format("woff2"); font-weight: 700 900; font-display: swap; }
:root {
  /* Ghostty: background, foreground, palette 0-15, cursor, selection */
  --sw-bg: #150e1e; --sw-fg: #f6e9f6;
  --sw-black: #2b1d3a; --sw-red: #ff3560; --sw-green: #4ee6b0; --sw-yellow: #ffc247; --sw-blue: #7d5cff; --sw-magenta: #ff4fd8; --sw-cyan: #2ef0f0; --sw-white: #e7d6ea;
  --sw-bblack: #6d5686; --sw-bred: #ff6f8b; --sw-bgreen: #72f1b8; --sw-byellow: #ffe066; --sw-bblue: #a892ff; --sw-bmagenta: #ff8ff0; --sw-bcyan: #7dfffd; --sw-bwhite: #fff4fb;
  --sw-cursor: #ff2d95; --sw-select: #4a2559; --sw-select-fg: #ffe6fa;

  /* what the app uses */
  --bg: var(--sw-bg); --card: #1e1430; --text: var(--sw-fg); --muted: #b8a2cc; --line: #3a2850; --edge: var(--sw-bblack);
  --accent: var(--sw-cursor); --accent-text: var(--sw-bg); --link: var(--sw-cyan); --danger: var(--sw-red); --warn: var(--sw-yellow); --ok: var(--sw-green);
  --chip: var(--sw-black); --code: #0f0a17; --code-text: var(--sw-bcyan);
  --me: linear-gradient(135deg, #5b1a63, #3b1f7a); --me-text: var(--sw-bwhite); --session: var(--sw-yellow);
  --glow-pink: 0 0 6px rgba(255, 45, 149, .65), 0 0 18px rgba(255, 45, 149, .35);
  --glow-cyan: 0 0 6px rgba(46, 240, 240, .55), 0 0 16px rgba(46, 240, 240, .25);
  --box-glow: 0 0 0 1px rgba(255, 79, 216, .35), 0 0 18px rgba(255, 45, 149, .22);
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --display: "Orbitron", "JetBrains Mono", ui-monospace, sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); }
body { min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); -webkit-tap-highlight-color: transparent; }
body.signed-out { padding-bottom: 0; }
body.signed-out #top, body.signed-out #nav { display: none; }

#top { position: sticky; top: 0; z-index: 2; padding-top: env(safe-area-inset-top); background: var(--bg); border-bottom: 1px solid var(--line); }
#top .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 6px; }
#top h1 { margin: 0; font-size: 20px; letter-spacing: .5px; }
#mac { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
#mac::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
#mac.ok::before { background: var(--ok); }
#mac.stale::before { background: var(--warn); }
/* The offline bar (public/offline.js): quiet, one line, no red. */
#netbar { padding: 4px 16px 6px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
#netbar[hidden] { display: none; }
#movedbar { padding: 4px 16px 6px; font-size: 13px; color: var(--muted); }
#movedbar[hidden] { display: none; }
#movedbar a { color: var(--link); font-weight: 600; }
#netbar::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
#netbar.mac::before { background: var(--warn); }
.bubble.waiting { opacity: .75; }
.bubble .waiting-mark { font-size: 12px; margin-top: 4px; opacity: .85; }

main { padding: 12px 16px 24px; max-width: 680px; margin: 0 auto; }
h2 { font-size: 15px; margin: 18px 4px 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.title { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.chip.working { color: var(--accent); }
.chip.blocked, .chip.urgent { color: var(--danger); }
.chip.idle, .chip.done { color: var(--ok); }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; margin: 10px 0 0; }
.msg.clamped { max-height: 14.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
pre.screen { background: var(--code); border-radius: 8px; padding: 10px; font-size: 12px; overflow-x: auto; white-space: pre; margin: 10px 0 0; }
.more { background: none; border: 0; color: var(--accent); padding: 6px 0 0; font-size: 14px; }
.reply { margin-top: 12px; display: flex; gap: 8px; align-items: flex-end; }
textarea { flex: 1; min-width: 0; resize: none; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); max-height: 40vh; }
button { font: inherit; cursor: pointer; }
.btn { border: 0; border-radius: 12px; padding: 10px 16px; background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 15px; }
.btn.secondary { background: var(--chip); color: var(--text); }
.btn.danger { background: none; color: var(--danger); padding: 8px 10px; }
.btn.danger.armed { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; }
.status { font-size: 13px; margin-top: 8px; }
.status.failed { color: var(--danger); }
.status.done { color: var(--ok); }
.reminder .when { font-size: 14px; font-weight: 600; color: var(--accent); }
.reminder .text { margin-top: 4px; font-size: 15px; overflow-wrap: anywhere; white-space: pre-wrap; }

#nav { display: flex; max-width: 680px; margin: 0 auto; padding: 0 8px; }
#nav .tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 0 8px; font-size: 13px; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; }
#nav .tab span { font-size: 16px; line-height: 1.2; }
#nav .tab.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }

.splash, .signin { min-height: 80dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.splash img, .signin > img { border-radius: 22%; }
.signin h1 { margin: 6px 0 0; font-size: 28px; }
.signin p { color: var(--muted); max-width: 320px; margin: 0; line-height: 1.45; }
.signin .btn { max-width: 320px; }
.error { color: var(--danger); font-size: 14px; max-width: 320px; white-space: pre-line; }
.error.pre { max-width: none; margin-top: 8px; }

#toast { position: fixed; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 3; margin: 0 auto; max-width: 420px;
  background: var(--text); color: var(--bg); padding: 12px 14px; border-radius: 12px; font-size: 14px; text-align: center; }

/* ---- chat */
body.has-composer { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
body.has-composer main { padding-bottom: 8px; }
.feed { display: flex; flex-direction: column; gap: 8px; }
.earlier { align-self: center; margin-bottom: 4px; }
.bubble { max-width: 86%; padding: 9px 12px 6px; border-radius: 16px; overflow-wrap: anywhere; font-size: 15px; line-height: 1.42; }
.bubble.me { align-self: flex-end; background: var(--me); color: var(--me-text); border-bottom-right-radius: 5px; }
.bubble.aeter { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble.session { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--session); border-bottom-left-radius: 5px; }
.bubble-head { font-weight: 600; font-size: 13px; color: var(--session); margin-bottom: 2px; }
.bubble .meta { font-size: 11px; opacity: .7; margin-top: 4px; text-align: right; }
.bubble.me .status { color: var(--me-text); }
.bubble.me .status.failed { color: #ffe1e1; font-weight: 600; }
.failed-box { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--danger); border-left-width: 4px; border-radius: 10px; background: var(--card); color: var(--text); font-size: 14px; }
.failed-box b { color: var(--danger); }
.failed-box .failed-why { margin: 2px 0 8px; }
.failed-box .resend { min-height: 44px; width: 100%; }
.failed-box.resent { border-color: var(--line); border-left-width: 1px; padding: 6px 10px; color: var(--muted); font-size: 13px; }
.bubble .more { font-size: 13px; padding-top: 4px; }
.chat-note { align-self: center; font-size: 12px; color: var(--muted); background: var(--chip); padding: 3px 10px; border-radius: 999px; }
.typing .dots { letter-spacing: 2px; color: var(--accent); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.quote { font-size: 13px; opacity: .85; border-left: 3px solid currentColor; padding: 2px 0 2px 8px; margin-bottom: 6px; white-space: pre-wrap;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.quote.open { display: block; -webkit-line-clamp: unset; max-height: 20em; overflow: auto; }

/* Markdown inside bubbles */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md .code-wrap, .md .table-wrap { margin: 0 0 8px; }
.md ul, .md ol { padding-left: 20px; }
.md h3, .md h4, .md h5, .md h6 { margin: 10px 0 6px; font-size: 16px; }
.md code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--code); color: var(--text); padding: 1px 4px; border-radius: 4px; }
.md .code-wrap { position: relative; }
.md pre { background: var(--code); color: var(--text); margin: 0; padding: 38px 10px 10px; border-radius: 8px; overflow-x: auto; }
.code-copy { -webkit-user-select: none; user-select: none; position: absolute; top: 5px; right: 5px; font: inherit; font-size: 13px; line-height: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.code-copy:active { background: var(--chip); }
.md code { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.md code.copy-tap { cursor: copy; transition: background .15s, color .15s; }
.md code.copied { background: var(--accent); color: var(--accent-text); }
.md code.copy-failed { background: var(--danger); color: #fff; }
.md pre code { padding: 0; background: none; white-space: pre; }
.md blockquote { border-left: 3px solid var(--line); padding-left: 10px; color: var(--muted); margin-left: 0; }
.md .table-wrap { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.md a { color: inherit; text-decoration: underline; }
.bubble.aeter .md a, .bubble.session .md a { color: var(--accent); }

/* Files in bubbles */
.file { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.file img, .file video { max-width: 100%; max-height: 60vh; border-radius: 10px; display: block; }
.file audio { width: 240px; max-width: 100%; }
.file .dl { font-size: 12px; color: inherit; opacity: .8; }
.file .doc { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--chip); color: var(--text); text-decoration: none; font-size: 14px; }
.file .doc span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Composer, fixed at the bottom */
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; background: var(--bg); border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.compose-row { display: flex; gap: 8px; align-items: flex-end; max-width: 680px; margin: 0 auto; }
.compose-row textarea { border-radius: 20px; padding: 9px 14px; }
.round { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; font-size: 18px; display: grid; place-items: center; }
.round.send { background: var(--accent); color: var(--accent-text); }
.round.plain { background: none; }
.round:disabled { opacity: .5; }
.attach-row, .reply-row { display: flex; flex-wrap: wrap; gap: 6px; max-width: 680px; margin: 0 auto; font-size: 13px; color: var(--muted); align-items: center; }
.attach-row:not(:empty), .reply-row:not(:empty) { margin-bottom: 6px; }
.chip-x { border: 0; background: none; color: var(--muted); padding: 0 4px; font-size: 13px; }
/* Upload progress (composer.js): the chip fills from the left as the file goes to the i7. */
.attach-row .chip.uploading, .attach-row .chip.failed { display: inline-flex; align-items: center; gap: 2px; }
.attach-row .chip.uploading { position: relative; color: var(--text); white-space: normal; }
.attach-row .chip.failed { color: var(--danger); white-space: normal; }
.chip-retry { border: 0; background: none; color: inherit; font: inherit; padding: 0; text-align: left; }
.attach-note { max-width: 680px; margin: 0 auto 6px; font-size: 12px; color: var(--warn); }
.att-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .45); }

/* ---- Upload laser (composer.js laser()): a neon beam pink -> purple -> cyan that fills the chip up to --p, a white-hot
   head at its leading edge, a grid shimmer running along the lit part and a glow under the chip. The gradient spans the
   whole chip and the fill is a clip, so the colour under the head shifts from pink to cyan as the file goes.
   composer.js keeps the node while it uploads, so the width glides and the animations never restart. */
@property --p { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
.laser { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; transition: --p .3s linear; }
.laser-fill { position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background: linear-gradient(90deg, rgba(255, 45, 149, .62), rgba(125, 92, 255, .58) 55%, rgba(46, 240, 240, .55));
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0 round 999px); }
/* the beam's core: a hot line through the middle of the lit part, and the grid shimmer streaming toward the head */
.laser-fill::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px;
  background: linear-gradient(90deg, var(--sw-magenta), var(--sw-bmagenta) 40%, var(--sw-bcyan)); box-shadow: 0 0 6px #fff, 0 0 10px var(--sw-cursor); opacity: .55; }
.laser-fill::after { content: ""; position: absolute; top: 0; bottom: 0; left: -24px; right: 0;
  background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 244, 251, .22) 10px 11px, transparent 11px 12px),
    repeating-linear-gradient(0deg, rgba(21, 14, 30, .28) 0 1px, transparent 1px 3px);
  animation: laser-grid .5s linear infinite; }
@keyframes laser-grid { to { transform: translateX(12px); } }
.laser-head { position: absolute; top: 50%; left: var(--p, 0%); width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 3px 1px #fff, 0 0 9px 3px var(--sw-bcyan), 0 0 18px 6px rgba(255, 45, 149, .7); opacity: 0;
  transition: opacity .2s; animation: laser-flare .9s ease-in-out infinite alternate; }
/* the flare: a thin horizontal streak through the head */
.laser-head::before { content: ""; position: absolute; top: 50%; left: 50%; width: 46px; height: 2px; margin: -1px 0 0 -23px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95), transparent); }
.started .laser-head { opacity: 1; }
@keyframes laser-flare { from { transform: scale(.85); filter: brightness(1); } to { transform: scale(1.15); filter: brightness(1.35); } }
.attach-row .chip.uploading { border-color: rgba(255, 79, 216, .6); box-shadow: 0 4px 14px -4px rgba(255, 45, 149, .55), 0 6px 18px -8px rgba(46, 240, 240, .45); }
.attach-row .chip.uploading .up-label, .attach-row .chip.uploading .chip-x { position: relative; text-shadow: 0 0 3px rgba(21, 14, 30, .95), 0 1px 2px rgba(21, 14, 30, .9); }
/* on a picture: the laser runs along the bottom edge and the % is neon */
.att-thumb .laser { inset: auto 0 0 0; height: 6px; border-radius: 0; }
.att-thumb .laser-fill { clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); }
.att-thumb .laser-fill::after { animation-duration: .4s; }
.att-thumb .laser-head { margin-left: -5px; }
.att-thumb.uploading .att-pct { background: linear-gradient(180deg, rgba(21, 14, 30, .15), rgba(21, 14, 30, .55)), repeating-linear-gradient(0deg, rgba(21, 14, 30, .3) 0 1px, transparent 1px 3px);
  font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .5px; color: var(--sw-bwhite);
  text-shadow: 0 0 4px var(--sw-cursor), 0 0 10px var(--sw-cursor), 0 0 2px #000; padding-bottom: 4px; }
.att-wrap:has(.att-thumb.uploading) { filter: drop-shadow(0 4px 8px rgba(255, 45, 149, .45)); }
/* 100%: one quick flash as it becomes a normal chip or thumbnail */
.chip.landed, .att-thumb.landed { animation: laser-landed .55s ease-out; }
@keyframes laser-landed { 0% { box-shadow: 0 0 0 1px #fff, 0 0 16px 4px var(--sw-bcyan), 0 0 30px 8px rgba(255, 45, 149, .6); filter: brightness(1.6); }
  100% { box-shadow: none; filter: none; } }
@media (prefers-reduced-motion: reduce) {
  .laser, .laser-fill::after, .laser-head, .chip.landed, .att-thumb.landed { animation: none !important; transition: none !important; }
}
.rec { color: var(--danger); font-weight: 600; }
.composer.recording .round.send { background: var(--danger); color: #fff; }
/* A voice note (composer.js drawVoice): the recording timer with a big 🗑, then the stopped take with ▶, its length and 🗑 Delete. */
.voice-row { display: flex; align-items: center; gap: 8px; max-width: 680px; margin: 0 auto 6px; font-size: 14px; }
.voice-row[hidden] { display: none; }
.voice-row .rec { flex: 1; }
.voice-play, .voice-del { flex: none; min-width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--chip); color: var(--text); font-size: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; }
.voice-del { color: var(--danger); border-color: var(--danger); font-size: 17px; }
.voice-del span { font-size: 14px; font-weight: 600; margin-left: 5px; }
.voice-del:disabled { opacity: .5; }
.voice-bar { flex: 1; min-width: 40px; height: 4px; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; }
.voice-fill { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--accent); }
.voice-len { flex: none; font-family: var(--mono); font-size: 13px; color: var(--muted); }
body.has-composer #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

.code-box { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 320px; }
.code-box:empty { display: none; }
input.code { width: 100%; font: inherit; font-size: 28px; letter-spacing: 8px; text-align: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); }

/* Reply: quote preview in the composer, the long-press menu, swipe */
.bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; transition: transform .15s; }
.bubble.selecting { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
@media (hover: hover) and (pointer: fine) { .bubble { -webkit-user-select: text; user-select: text; } }
.quote-preview { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 8px; display: flex; flex-direction: column; }
.quote-preview b { color: var(--accent); font-size: 12px; }
.quote-preview span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.bubble-menu { position: fixed; z-index: 5; display: flex; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.bubble-menu button { border: 0; background: none; color: var(--text); font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.bubble-menu button:active { background: var(--chip); }
/* display: flex above would beat the hidden attribute, and the menu never went away. */
.bubble-menu[hidden], .menu-shield[hidden] { display: none; }
.menu-shield { position: fixed; inset: 0; z-index: 4; -webkit-tap-highlight-color: transparent; }
.new-session select, .new-session textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin-top: 8px; }
.new-session textarea { min-height: 110px; resize: vertical; }
.meter { margin-bottom: 12px; }
.meter > .row { font-size: 15px; }
.track { height: 10px; border-radius: 5px; background: var(--chip); overflow: hidden; margin: 6px 0 4px; }
.track.thin { height: 6px; border-radius: 3px; margin: 4px 0 2px; }
.fill { height: 100%; border-radius: 5px; background: var(--accent); }
.fill.warn { background: var(--warn); }
.fill.hit { background: var(--danger); }
.consumer { margin-top: 10px; }
.consumer .name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Sessions: facts, status help, one session's chat */
.status-help { margin-top: 6px; font-size: 13px; }
.step { margin-top: 6px; font-size: 13px; color: var(--accent); overflow-wrap: anywhere; }
.step .dots, .typing .dots { animation: blink 1.2s infinite; }
a.title.link { color: inherit; text-decoration: none; }
.open-chat { display: block; text-align: center; text-decoration: none; margin-top: 10px; }
.back { display: inline-block; color: var(--accent); text-decoration: none; font-size: 15px; margin-bottom: 8px; }
.session-feed { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.bubble.progress { font-size: 13px; opacity: .75; border-left-width: 2px; }
.session-head .chips { margin-top: 6px; }
.session-feed .bubble { -webkit-user-select: text; user-select: text; }
.session-feed .typing { font-size: 13px; } .session-feed .typing .dots { font-size: 8px; letter-spacing: 2px; vertical-align: middle; }
.actions { margin-top: 10px; flex-wrap: wrap; } .actions .spacer { flex: 1; } .actions .open-chat { margin-top: 0; }
.load-earlier { align-self: center; font-size: 14px; padding: 8px 14px; }
.chip.ended { color: var(--muted); }
.card.past .title { display: block; margin-bottom: 2px; }
.sent { margin: -4px 4px 8px; text-align: right; }

/* Picture viewer (viewer.js) */
.file img.viewable { cursor: zoom-in; }
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, calc(.94 * var(--fade, 1))); opacity: 0; transition: opacity .18s;
  touch-action: none; -webkit-user-select: none; user-select: none; color: #fff; }
.viewer.shown { opacity: 1; }
.viewer-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; will-change: transform; -webkit-user-drag: none; }
.viewer-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 18px; background: linear-gradient(rgba(0,0,0,.6), transparent); transition: opacity .2s; }
.viewer-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 20px;
  display: grid; place-items: center; text-decoration: none; }
.viewer-count { font-size: 14px; opacity: .85; }
.viewer-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 16px calc(12px + env(safe-area-inset-bottom)); font-size: 13px; text-align: center;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity .2s; pointer-events: none; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12);
  color: #fff; font-size: 34px; line-height: 1; transition: opacity .2s; }
.viewer-nav.prev { left: 8px; } .viewer-nav.next { right: 8px; }
.viewer-nav[hidden] { display: none; }
@media (hover: none) { .viewer-nav { display: none; } }
.viewer.bare .viewer-bar, .viewer.bare .viewer-name, .viewer.bare .viewer-nav, .viewer.zoomed .viewer-nav { opacity: 0; pointer-events: none; }

/* ---- Status tab: the otter (art in /status, frames swapped by status.js) and one row per thing */
.mascot { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 14px 14px; }
.stage { position: relative; width: 240px; height: 240px; border-radius: 28px; overflow: hidden; background: #050a2a; }
.stage img { display: block; width: 100%; height: 100%; transform-origin: 50% 90%; animation: bob 3.2s ease-in-out infinite; }
.stage.idle img { animation: float 5s ease-in-out infinite; }
.stage.controller img { animation: bob 1.6s ease-in-out infinite, wiggle 0.9s steps(2) infinite; }
.stage.camera img { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.012); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }
@keyframes wiggle { 0% { rotate: -0.6deg; } 100% { rotate: 0.6deg; } }
.fx { position: absolute; inset: 0; pointer-events: none; }
.fx::before, .fx::after { position: absolute; content: none; }
/* idle: little z's drifting up */
.idle .fx::before, .idle .fx::after { content: "z"; top: 22%; right: 16%; color: #bfe3ff; font: 700 22px/1 system-ui, sans-serif; opacity: 0; animation: zz 4s ease-out infinite; }
.idle .fx::after { font-size: 15px; right: 24%; animation-delay: 2s; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 10px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translate(14px, -40px); } }
/* recording: a blinking REC light */
.camera .fx::before { content: ""; top: 14px; left: 14px; width: 12px; height: 12px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b; animation: rec 1.2s steps(1) infinite; }
.camera .fx::after { content: "REC"; top: 12px; left: 32px; color: #ffd6d6; font: 700 13px/16px system-ui, sans-serif; letter-spacing: 1px; }
@keyframes rec { 50% { opacity: 0; } }
/* the arm: radio waves going out from the controller */
.controller .fx::before, .controller .fx::after { content: ""; top: 18px; right: 18px; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #7fd0ff; border-left-color: transparent; border-bottom-color: transparent; animation: wave 1.4s ease-out infinite; }
.controller .fx::after { animation-delay: .7s; }
@keyframes wave { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.6); } }
/* a render: a spinner (the laptop in the picture already shows a progress bar) */
.busy .fx::before { content: ""; top: 18px; right: 18px; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: #6fd3ff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* out of touch with the Mac: greyed and still */
.stage.old img { animation: none; }
.stage.old .fx { display: none; }
@media (prefers-reduced-motion: reduce) { .stage img, .fx::before, .fx::after { animation: none !important; } .idle .fx::before, .idle .fx::after { opacity: .7; } }
.caption { margin-top: 12px; font-size: 18px; font-weight: 600; }
.status-note { margin-top: 4px; font-size: 13px; color: var(--muted); }
.status-note.warn { color: var(--warn); font-weight: 600; }
.status-list { display: flex; flex-direction: column; gap: 8px; }
.status-row { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.status-row .icon { font-size: 22px; line-height: 1.2; }
.status-row .body { flex: 1; min-width: 0; }
.status-row .name { font-weight: 600; }
.status-row .when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.status-row .text { margin-top: 2px; color: var(--muted); overflow-wrap: anywhere; }
.status-row.active { border-color: var(--accent); }
.status-row.active .text { color: var(--text); }
.status-row.crashed, .status-row.stale, .status-row.holding { border-color: var(--warn); }
.status-row.busy { border-color: var(--warn); }
/* "Aeter may use this machine" (machine rows): a switch, not a button. */
.aeter-switch-wrap { margin-top: 8px; }
.aeter-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; user-select: none; }
.aeter-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aeter-switch .track { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line); transition: background .15s; }
.aeter-switch .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.aeter-switch input:checked + .track { background: var(--accent); }
.aeter-switch input:checked + .track .knob { transform: translateX(18px); }
.aeter-switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.aeter-switch.disabled { cursor: default; opacity: .55; }
.aeter-switch .label { font-size: 14px; }
.status-sessions { margin: 12px 4px 0; font-size: 13px; }
/* Five tabs: on a phone the icon sits above the label so they don't run into each other. */
@media (max-width: 520px) {
  #nav { padding: 0 2px; }
  #nav .tab { flex-direction: column; gap: 1px; padding: 4px 0 6px; font-size: 11px; min-width: 0; }
  #nav .tab span { font-size: 18px; }
}
/* Status buttons: starts are a tap, stops a press-and-hold that fills the button */
.status-row .controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.status-row .controls .btn { position: relative; overflow: hidden; min-height: 44px; padding: 10px 16px; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.status-row .controls .btn .label { position: relative; }
.status-row .controls .btn .fill { position: absolute; inset: 0; width: 0; background: rgba(255,255,255,.28); }
.status-row .controls .btn.holding .fill { width: 100%; transition: width .8s linear; }
.status-row .hint { margin-top: 6px; }
/* 💬 ask Aeter about a row: top right, away from the stop buttons; a plain tap only opens the chat */
.status-row .row.between { align-items: center; }
.status-row .row.between .when { margin-left: auto; }
.status-row .ask { flex: none; width: 36px; height: 36px; margin: -8px -8px -8px 6px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 16px; line-height: 1; padding: 0; cursor: pointer; touch-action: manipulation; }
.status-row .ask:active { transform: scale(.92); }
@media (hover: hover) { .status-row .ask:hover { border-color: var(--accent); } }
.control-note { margin-top: 6px; font-size: 13px; }
.control-note.ok { color: var(--ok); }
.control-note.error { color: var(--danger); }
.control-note.muted { color: var(--muted); }
.status-row .controls .btn.danger.hold { border: 1.5px solid var(--danger); border-radius: 10px; }
.status-row .controls .btn.danger.hold .fill { background: var(--danger); opacity: .3; }
.release-slot { display: contents; }
.status-row.release { margin-top: 8px; }
.status-row.keys .warn-text { color: var(--warn); }
.key-shown { margin-top: 10px; padding: 10px; border: 1px solid var(--accent); border-radius: 10px; }
.key-link { display: block; margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; color: var(--text); }
.key-msg { margin-top: 8px; font-size: 13px; }
.key-msg summary { cursor: pointer; color: var(--muted); }
.key-msg pre { margin: 6px 0 0; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.key-take { margin-top: 10px; }
.key-for { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.key-given { margin-top: 10px; }
.credit-role { margin-top: 8px; }
.credit-list { list-style: none; margin: 6px 0 0; padding: 0; }
.credit-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.credit-who { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.credit-state { margin-left: auto; font-size: 13px; color: var(--muted); }
.credit-answered .credit-state { color: var(--accent); font-weight: 600; }
.credit-revoked { opacity: .55; }
.status-row .credit-list .controls { margin-top: 4px; justify-content: flex-end; }
.status-row .credit-list .controls .btn { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.release-pending { margin-top: 8px; }
.release-commits { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.release-commits li { margin: 2px 0; overflow-wrap: anywhere; }
.release-commits code { font-size: 12px; color: var(--muted); }
.release-log { margin: 6px 0 0; padding: 8px 10px; max-height: 160px; overflow: auto; font-size: 11.5px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }

.list-kinds { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px 6px; scrollbar-width: none; }
.list-kinds::-webkit-scrollbar { display: none; }
.list-chip { flex: none; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; }
.list-chip b { font-weight: 600; font-size: 12px; color: var(--muted); }
.list-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.list-chip.on b { color: var(--accent-text); }
.list-tools { display: flex; gap: 8px; margin-bottom: 10px; justify-content: space-between; }
.pick-btn { margin-bottom: 10px; }
.pick { border-color: var(--accent); }
.pick-title { font-size: 21px; font-weight: 700; margin: 4px 0; overflow-wrap: anywhere; }
.pick-actions { flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.list-filters { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 2px 10px; }
.list-filter { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; padding: 6px 2px; border-bottom: 2px solid transparent; }
.list-filter.on { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.list-item { padding: 12px; margin-bottom: 8px; }
.list-item.watched .title { color: var(--muted); text-decoration: line-through; }
.list-line { display: flex; gap: 10px; align-items: flex-start; }
.tick { flex: none; width: 28px; height: 28px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--muted); background: none; color: var(--accent-text); font-size: 16px; font-weight: 700; line-height: 1; padding: 0; }
.tick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.list-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 0; }
.list-why { line-height: 1.35; overflow-wrap: anywhere; }
.list-link { flex: none; color: var(--accent); text-decoration: none; font-size: 19px; padding: 0 4px; line-height: 1.3; }
.pick .list-link { font-size: 15px; font-weight: 600; }
.list-item .chips { margin-left: 38px; }
.chip.st-want { color: var(--accent); }
.chip.st-watching { color: var(--warn); }
.chip.st-watched { color: var(--ok); }
.lists-form { display: flex; flex-direction: column; gap: 8px; }
.lists-form.inline { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.lists-form input, .lists-form select { width: 100%; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.lists-form input[hidden] { display: none; }
.lists-pair { display: flex; gap: 8px; }
.lists-form .row { gap: 8px; }

/* ---- Synthwave look (on every tab and both layouts). The backdrop is public/fx.js's WebGL canvas (behind
   everything); without WebGL, or with effects off, the CSS sunset below stands in. Glows are text-shadow and
   box-shadow on accents, never a blur over the words. html[data-fx] is full | lite | off (Settings → Look). */
body { background: transparent; }
html { background-color: var(--bg); background: radial-gradient(120% 60% at 50% 100%, #3a1240 0%, transparent 60%), linear-gradient(#120b1c, var(--bg) 45%, #1d0f2a); background-attachment: fixed; }
body { position: relative; isolation: isolate; }
::selection { background: var(--sw-select); color: var(--sw-select-fg); }
textarea, input, select { caret-color: var(--sw-cursor); }
a { color: var(--link); }

/* the CSS sunset grid, for no WebGL / effects off: a static, cheap layer */
#fx-fallback { position: fixed; left: 0; right: 0; bottom: 0; height: 38lvh; z-index: -2; pointer-events: none; overflow: hidden; }
#fx-fallback::before { content: ""; position: absolute; left: -50%; right: -50%; top: 0; bottom: -40%;
  background: linear-gradient(transparent 0 calc(100% - 1.5px), rgba(255, 79, 216, .35) 0) 0 0 / 100% 42px,
    linear-gradient(90deg, transparent 0 calc(100% - 1.5px), rgba(255, 79, 216, .3) 0) 0 0 / 56px 100%;
  transform: perspective(240px) rotateX(58deg); transform-origin: 50% 0; -webkit-mask-image: linear-gradient(transparent, #000 35%); mask-image: linear-gradient(transparent, #000 35%); }
#fx-fallback::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(255, 45, 149, .55); box-shadow: 0 0 18px 4px rgba(255, 45, 149, .35); }
html.fx-gl #fx-fallback { display: none; }
#fx-canvas { position: fixed; left: 0; top: 0; width: 100vw; height: 100lvh; z-index: -1; pointer-events: none; display: none; }
html.fx-gl #fx-canvas { display: block; }

/* CRT over the page: scanlines and a slow VHS band. Very low strength, plain alpha (no blend modes, no blur),
   so text stays sharp; the band only moves with transform (compositor). Vignette, grain and chromatic edges
   are in the backdrop shader, behind the text. */
#crt { position: fixed; inset: 0; z-index: 4; pointer-events: none; display: none; overflow: hidden;
  background: repeating-linear-gradient(rgba(0, 0, 0, 0) 0 2px, rgba(10, 0, 20, .07) 2px 3px); }
#crt .vhs { position: absolute; left: 0; right: 0; top: 0; height: 18vh; background: linear-gradient(transparent, rgba(255, 128, 216, .035), transparent);
  transform: translateY(110vh); will-change: transform; }
/* fx.js moves the band with its 30 fps loop (a transform on its own layer: no restyle of the page, no repaint);
   an endless CSS animation kept the compositor drawing every frame. Without WebGL the CSS animation does it. */
html[data-fx="full"]:not(.fx-gl) #crt .vhs { animation: vhs 12s linear infinite; }
@keyframes vhs { from { transform: translateY(110vh); } to { transform: translateY(-20vh); } }
html[data-fx="full"] #crt, html[data-fx="lite"] #crt { display: block; }
html[data-fx="lite"] #crt .vhs { display: none; }

/* header and tabs */
#top { background: var(--bg); border-bottom-color: var(--line); box-shadow: 0 1px 0 rgba(255, 45, 149, .18), 0 8px 24px -12px rgba(255, 45, 149, .35); }
#top h1 { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: 4px; text-transform: uppercase; color: var(--sw-bmagenta);
  text-shadow: -.6px 0 rgba(255, 53, 96, .7), .6px 0 rgba(46, 240, 240, .55), var(--glow-pink); position: relative; }
/* a gentle neon flicker: only the glow copy's opacity animates (compositor only) */
#top h1::after { content: "Aeter"; position: absolute; left: 0; top: 0; color: transparent; text-shadow: 0 0 14px rgba(255, 79, 216, .9), 0 0 28px rgba(255, 45, 149, .5); pointer-events: none; opacity: var(--flick, .6); }
html[data-fx="full"]:not(.fx-gl) #top h1::after { animation: flicker 7s steps(1) infinite; }
@keyframes flicker { 0%, 61%, 64%, 66%, 100% { opacity: .6; } 62% { opacity: .15; } 65% { opacity: .35; } }
#mac { font-family: var(--mono); font-size: 12px; }
#mac.ok::before { box-shadow: 0 0 8px var(--ok); }
#mac.stale::before { box-shadow: 0 0 8px var(--warn); }
#nav .tab { font-family: var(--mono); letter-spacing: .2px; }
#nav .tab.active { color: var(--sw-bmagenta); border-bottom-color: var(--accent); text-shadow: var(--glow-pink); box-shadow: 0 6px 12px -8px rgba(255, 45, 149, .9); }

/* headings, cards, chips */
h2 { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 2.4px; color: var(--sw-cyan); text-shadow: var(--glow-cyan); }
.card { background: rgba(30, 20, 48, .94); border-color: var(--line); box-shadow: inset 0 1px 0 rgba(255, 143, 240, .06), 0 10px 30px -18px rgba(0, 0, 0, .9); }
.title { letter-spacing: .1px; }
.chip { font-family: var(--mono); font-size: 11.5px; border: 1px solid rgba(109, 86, 134, .45); }
.chip.working { color: var(--sw-bmagenta); }
.chip.blocked, .chip.urgent { color: var(--sw-bred); }
.reminder .when { font-family: var(--mono); color: var(--sw-bmagenta); }
.step { color: var(--sw-bmagenta); }
.more, .back { color: var(--link); }
pre.screen { background: var(--code); border: 1px solid var(--line); font-family: var(--mono); color: var(--sw-white); }
textarea, .new-session select, .new-session textarea, .lists-form input, .lists-form select, input.code { background: rgba(15, 10, 23, .72); border-color: var(--edge); }
textarea:focus, input:focus, select:focus { border-color: var(--sw-magenta); box-shadow: 0 0 0 1px rgba(255, 79, 216, .4), 0 0 16px rgba(255, 45, 149, .25); }
input.code { font-family: var(--mono); color: var(--sw-bcyan); text-shadow: var(--glow-cyan); }

/* buttons: neon fills with dark text (white on these pinks fails contrast) */
.btn { background: var(--accent); color: var(--accent-text); box-shadow: 0 0 14px rgba(255, 45, 149, .45); }
.btn.secondary { background: var(--chip); color: var(--text); box-shadow: inset 0 0 0 1px var(--edge); }
.btn.danger { background: none; color: var(--sw-bred); box-shadow: none; }
.btn.danger.armed, .md code.copy-failed, .composer.recording .round.send { background: var(--danger); color: var(--accent-text); box-shadow: 0 0 14px rgba(255, 53, 96, .55); }
.round.send { box-shadow: 0 0 12px rgba(255, 45, 149, .55); }
.round.plain { box-shadow: none; }
.signin h1 { font-family: var(--display); letter-spacing: 3px; color: var(--sw-bmagenta); text-shadow: var(--glow-pink); }
.splash img, .signin > img { box-shadow: 0 0 0 2px rgba(255, 79, 216, .7), 0 0 26px rgba(255, 45, 149, .55); }
#toast { background: var(--sw-black); color: var(--text); border: 1px solid var(--sw-magenta); box-shadow: var(--glow-pink); }

/* chat */
.bubble.me { border: 1px solid rgba(255, 79, 216, .55); box-shadow: 0 0 16px -4px rgba(255, 45, 149, .55); }
.bubble.aeter, .bubble.session { background: rgba(30, 20, 48, .95); border-color: var(--line); }
.bubble.aeter { box-shadow: inset 2px 0 0 rgba(46, 240, 240, .5); }
.bubble.session { border-left-color: var(--session); }
.bubble-head { font-family: var(--mono); }
.bubble .meta { font-family: var(--mono); font-size: 10.5px; opacity: .78; }
.bubble.me .status.failed { color: var(--sw-byellow); }
.chat-note { font-family: var(--mono); border: 1px solid var(--line); }
.typing .dots { color: var(--sw-bmagenta); text-shadow: var(--glow-pink); }
.quote-preview { border-left-color: var(--accent); }
.quote-preview b { color: var(--sw-bmagenta); }
.bubble-menu { background: var(--sw-black); border-color: var(--sw-magenta); box-shadow: var(--box-glow), 0 8px 26px rgba(0, 0, 0, .5); }
/* a new message lights up once (cursor-blaze's halo; the WebGL layer adds the trail behind it) */
html:not([data-fx="off"]) .bubble.arrived { animation: arrive 1.3s ease-out; }
@keyframes arrive { 0% { box-shadow: 0 0 0 1px rgba(255, 143, 240, .9), 0 0 30px rgba(255, 45, 149, .75); } 100% { box-shadow: 0 0 0 1px transparent, 0 0 0 transparent; } }

/* Markdown answers: code, tables, links, quotes */
.md code { font-family: var(--mono); background: var(--code); color: var(--code-text); border: 1px solid rgba(109, 86, 134, .35); }
.md pre { background: var(--code); color: var(--sw-white); border: 1px solid var(--line); box-shadow: inset 0 0 24px rgba(125, 92, 255, .08); }
.md pre code { color: inherit; border: 0; }
.md code.copied { background: var(--ok); color: var(--accent-text); }
.code-copy { background: var(--sw-black); border-color: var(--edge); font-family: var(--mono); font-size: 12px; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { color: var(--sw-bmagenta); text-shadow: 0 0 10px rgba(255, 45, 149, .35); }
.md blockquote { border-left-color: var(--sw-blue); }
.md th { background: rgba(125, 92, 255, .14); color: var(--sw-bcyan); font-family: var(--mono); font-size: 12.5px; }
.md th, .md td { border-color: var(--line); }
.md tr:nth-child(even) td { background: rgba(43, 29, 58, .5); }
.md a, .bubble.aeter .md a, .bubble.session .md a { color: var(--link); text-decoration-color: rgba(46, 240, 240, .45); text-underline-offset: 2px; }
.bubble.me .md a { color: var(--sw-bcyan); }
.md strong { color: var(--sw-bwhite); }
.file .doc { background: var(--sw-black); border: 1px solid var(--line); }
.file .doc:active { border-color: var(--sw-magenta); }
.file img, .file video { box-shadow: 0 0 0 1px var(--line); }

/* composer: translucent, so the caret's blaze glows through behind the words */
.composer { background: var(--bg); border-top-color: var(--line); box-shadow: 0 -1px 0 rgba(255, 45, 149, .22), 0 -10px 26px -14px rgba(255, 45, 149, .5); }

/* cursor blaze (fx.js): a halo under the words at the caret, and a smear that catches up in 0.17 s.
   They sit behind the text box (its background is translucent), so the typed text is never covered. */
.blaze-host { position: relative; }
.blaze-host > textarea { position: relative; z-index: 1; background: rgba(15, 10, 23, .5); }
.blaze-halo, .blaze-smear { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; will-change: transform, opacity; }
.blaze-halo { width: 46px; height: 46px; margin: -23px 0 0 -20px; border-radius: 50%; opacity: .45;
  background: radial-gradient(closest-side, rgba(255, 45, 149, .75), rgba(255, 79, 216, .25) 55%, transparent); transition: transform .17s cubic-bezier(.2, .8, .3, 1), opacity .6s; }
.blaze-halo.hot { animation: hot .9s ease-out; }
@keyframes hot { from { opacity: 1; } to { opacity: .45; } }
.blaze-smear { transform-origin: 0 50%; border-radius: 999px; opacity: 0; margin-left: -4px;
  background: linear-gradient(90deg, transparent, rgba(255, 45, 149, .55)); transition: transform .17s cubic-bezier(.2, .8, .3, 1), opacity .17s ease-out; }
@media (prefers-reduced-motion: reduce) { html:not([data-fx="full"]) .blaze-halo { transition: none; animation: none; } }

/* meters (Settings) */
.track { background: var(--sw-black); }
.fill { background: linear-gradient(90deg, var(--sw-blue), var(--sw-magenta)); box-shadow: 0 0 10px rgba(255, 79, 216, .5); }
.fill.warn { background: var(--warn); box-shadow: 0 0 10px rgba(255, 194, 71, .45); }
.fill.hit { background: var(--danger); box-shadow: 0 0 10px rgba(255, 53, 96, .5); }

/* Status: the otter stays as drawn, in a neon frame */
.stage { background: #0b0614; box-shadow: 0 0 0 2px var(--sw-magenta), 0 0 0 5px rgba(46, 240, 240, .25), 0 0 26px rgba(255, 45, 149, .55), 0 0 60px rgba(125, 92, 255, .3); }
.stage::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(transparent 0 3px, rgba(10, 0, 20, .12) 3px 4px), radial-gradient(transparent 60%, rgba(21, 14, 30, .45)); }
.stage.old { box-shadow: 0 0 0 2px var(--edge); }
.caption { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: 1.5px; color: var(--sw-bwhite); text-shadow: var(--glow-pink); }
.status-row { background: rgba(30, 20, 48, .94); border-color: var(--line); }
.status-row .name { font-family: var(--mono); font-size: 14px; letter-spacing: .3px; }
.status-row .when { font-family: var(--mono); font-size: 12px; }
.status-row.active { border-color: var(--sw-magenta); box-shadow: var(--box-glow); }
.status-row.active .name { color: var(--sw-bmagenta); text-shadow: 0 0 8px rgba(255, 45, 149, .45); }
.status-row.crashed, .status-row.stale, .status-row.holding, .status-row.busy { border-color: var(--warn); box-shadow: 0 0 14px -4px rgba(255, 194, 71, .5); }
.status-row .controls .btn .fill { background: rgba(21, 14, 30, .35); box-shadow: none; }
.status-row .controls .btn.danger.hold { border-color: var(--danger); }
.status-row .ask { border-color: rgba(255, 45, 149, .45); background: rgba(21, 14, 30, .6); }
.status-row .ask:hover, .status-row .ask:focus-visible { box-shadow: var(--box-glow); }

/* Lists */
.list-chip { background: rgba(30, 20, 48, .9); border-color: var(--line); font-family: var(--mono); font-size: 13px; text-align: left; }
.list-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 14px rgba(255, 45, 149, .5); }
.list-filter { font-family: var(--mono); font-size: 13px; }
.list-filter.on { color: var(--sw-bmagenta); border-bottom-color: var(--accent); text-shadow: 0 0 8px rgba(255, 45, 149, .5); }
.pick { border-color: var(--sw-magenta); box-shadow: var(--box-glow); }
.pick-title { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .6px; color: var(--sw-bwhite); text-shadow: var(--glow-pink); }
.tick { border-color: var(--edge); }
.tick[aria-pressed="true"] { box-shadow: 0 0 10px rgba(255, 45, 149, .6); }
.list-link { color: var(--link); }
.chip.st-want { color: var(--sw-bmagenta); }

/* Settings → Look */
.fx-modes { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.fx-modes .btn { flex: 1; min-width: 84px; }
.fx-modes .btn[aria-pressed="false"] { background: var(--chip); color: var(--text); box-shadow: inset 0 0 0 1px var(--edge); }
.fx-stats { margin-top: 8px; font-family: var(--mono); font-size: 12px; }

/* With reduced motion: nothing moves unless Tomas picks "On" himself (fx.js then sets data-fx="full"). */
@media (prefers-reduced-motion: reduce) { html:not([data-fx="full"]) .bubble.arrived { animation: none; } }

/* Approvals tab */
/* Seven tabs on a phone: smaller monospace labels so the longest (Reminders) fits its column. */
@media (max-width: 520px) { #nav .tab { font-size: 9.5px; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; } }
#nav .tab { position: relative; }
#nav .tab .badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 11px/17px var(--mono, system-ui); text-align: center; box-shadow: 0 0 8px rgba(255, 45, 149, .7); }
.waiting-link { display: block; margin: 0 0 8px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--warn); color: var(--text); text-decoration: none; font-weight: 600; background: rgba(30, 20, 48, .94); box-shadow: 0 0 14px -4px rgba(255, 194, 71, .5); }
.waiting-link[hidden] { display: none; }
.approvals-view { display: flex; flex-direction: column; gap: 10px; }
.approvals-note:empty { display: none; }
.approvals-view .empty.calm { padding: 28px 16px; }
.tankbro { display: flex; flex-direction: column; gap: 10px; }
.tankbro[hidden] { display: none; }
.tankbro h2 { margin-bottom: 0; }
.tankbro .status-row.release { margin-top: 0; }
/* Studio access (public/studio.js): one row per email, the remove hold under it. */
.studio .sa-person { padding: 6px 0; }
.studio .sa-person + .sa-person { border-top: 1px solid rgba(255, 255, 255, .08); }
.studio .sa-email { overflow-wrap: anywhere; }
/* Upload links (public/uplinks.js): the form fields stack; a just-made link stands out. */
.uplinks .key-take > * + * { margin-top: 8px; }
.uplinks select.key-for { appearance: auto; }
.uplinks .ul-link.fresh { border-color: var(--accent); }
.uplinks .ul-files { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.approvals-list { display: flex; flex-direction: column; gap: 10px; }
.approval { background: rgba(30, 20, 48, .94); border: 1px solid var(--warn); border-radius: 14px; padding: 12px 14px; box-shadow: 0 0 14px -4px rgba(255, 194, 71, .5); }
.approval.destructive { border-color: var(--danger); box-shadow: 0 0 14px -4px rgba(255, 45, 149, .7); }
.approval .row.between { align-items: center; }
.approval .row.between .when { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.approval .name { font-family: var(--mono); font-weight: 700; color: var(--sw-bmagenta, var(--accent)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.approval .ask { flex: none; width: 36px; height: 36px; margin: -8px -8px -8px 6px; border-radius: 50%; border: 1px solid rgba(255, 45, 149, .45); background: rgba(21, 14, 30, .6); font-size: 16px; padding: 0; cursor: pointer; }
.approval .where { font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.approval .question { margin-top: 8px; font-weight: 600; }
.approval pre { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(10, 6, 18, .7); border: 1px solid var(--line); font: 13px/1.4 var(--mono, ui-monospace, monospace); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh; overflow: auto; }
.approval pre.command { color: var(--sw-bcyan, #7ff); }
.approval .more { margin-top: 6px; }
.approval .controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.approval .controls .btn { position: relative; overflow: hidden; min-height: 44px; padding: 10px 16px; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.approval .controls .btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; opacity: .85; }
.approval .controls .btn .label { position: relative; }
.approval .controls .btn .fill { position: absolute; inset: 0; width: 0; background: var(--danger); opacity: .3; }
.approval .controls .btn.holding .fill { width: 100%; transition: width 1.2s linear; }
.approval .controls .btn.danger.hold { border: 1.5px solid var(--danger); border-radius: 10px; }
.approval .control-note { margin-top: 8px; }
.approval.aeter { border-color: var(--sw-bcyan, #7ff); box-shadow: 0 0 14px -4px rgba(127, 255, 255, .45); }
.approval.aeter.destructive { border-color: var(--danger); box-shadow: 0 0 14px -4px rgba(255, 45, 149, .7); }
.approval.request.money { border-color: #ffd23f; box-shadow: 0 0 14px -4px rgba(255, 210, 63, .6); }
.approval.request.cleanup { border-color: var(--sw-bcyan, #7ff); }
.approval.request.crash { border-color: #ff5a4f; box-shadow: 0 0 14px -4px rgba(255, 90, 79, .6); }
.approval .amount { font-size: 1.4em; font-weight: 700; margin: 4px 0; }
.approval .request-detail { white-space: pre-wrap; margin: 6px 0; font-size: .92em; }
.approval .request { margin-top: 8px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30vh; overflow: auto; }
.approval .blocked-action { margin-top: 8px; }
.approval .blocked-action .reason { font-size: 12px; font-family: var(--mono); }
.approvals-list > .control-note { padding: 8px 12px; border-radius: 10px; background: rgba(30, 20, 48, .94); }
.empty.calm { text-align: center; padding: 48px 16px; color: var(--muted); font-size: 16px; }
.empty.calm .big { font-size: 44px; margin-bottom: 10px; }

/* Settings → Notifications (public/notify.js) */
h3.sub { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 6px; font-weight: 600; }
.notify-row + .notify-row { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--edge); }
.notify-row .fx-modes .btn { min-width: 0; flex: 1 1 40%; font-size: 14px; padding-left: 8px; padding-right: 8px; }
.card .note { margin-top: 14px; }
.people .person { align-items: center; gap: 8px; margin-top: 8px; }
.people .person .who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.people .person .btn[aria-pressed="false"], .add-person .btn.secondary[aria-pressed="false"] { opacity: .75; }
.people .person .btn[aria-pressed="true"], .add-person .btn.secondary[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); }
.add-person { gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.add-person input { flex: 1 1 160px; min-width: 0; font: inherit; font-size: 16px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.decisions .decision { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--chip); }
.decisions .decision.pushed { box-shadow: inset 3px 0 0 var(--accent); }
.decisions .gist { margin: 2px 0; }
.decisions .when { flex: none; margin-left: 8px; }

/* Settings → Browsing guard: a rule's messages, folded */
.guard-messages { margin-top: 8px; }
.guard-messages summary { cursor: pointer; }
.guard-messages .gist { margin-top: 6px; font-style: italic; }

/* Outfits tab (public/outfits.js): reuses the lists' chips, tools, filters and forms. */
.outfit-event { margin: 4px 4px 10px; }
/* An event's carousel of him in the outfits: full width on a phone, one picture per swipe. */
.looks { margin-bottom: 22px; }
.look-frame { position: relative; margin: 0 -16px; }
.look-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; outline: none; }
.look-track::-webkit-scrollbar { display: none; }
.look-slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.look-slide img, .look-none { display: block; width: 100%; aspect-ratio: 2 / 3; max-height: 72dvh; object-fit: cover; object-position: center top; background: var(--bg); }
.look-slide img { cursor: zoom-in; -webkit-user-drag: none; }
.look-none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.look-none span { font-size: 64px; }
.look-caption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 40px 16px 12px; font-size: 18px;
  color: #fff; background: linear-gradient(transparent, rgba(8, 4, 14, .85)); pointer-events: none; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.look-count { position: absolute; top: 10px; right: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(8, 4, 14, .7); color: #fff; font: 600 12px var(--mono, system-ui); }
.look-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(8, 4, 14, .6); color: #fff; font-size: 24px; line-height: 1; }
.look-nav.prev { left: 8px; } .look-nav.next { right: 8px; }
.look-nav:disabled { opacity: 0; pointer-events: none; }
.look-acts { position: absolute; top: 8px; left: 10px; z-index: 1; display: flex; gap: 8px; }
.look-acts[hidden] { display: none; }
.look-acts button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(8, 4, 14, .7); font-size: 17px; line-height: 1; }
.look-wrap { position: relative; display: flex; min-width: 0; }
.look-wrap .look-tile { flex: 1; min-width: 0; }
.look-wrap .look-acts { top: 6px; left: 6px; gap: 6px; }
.look-wrap .look-acts button { width: 34px; height: 34px; font-size: 14px; }
.undo-bar { position: sticky; top: calc(var(--top-h, 100px) + 8px); z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--warn); background: rgba(30, 20, 48, .97); }
.look-dots { display: flex; justify-content: center; gap: 2px; margin: 6px 0 2px; }
.look-dots button { width: 22px; height: 22px; padding: 0; border: 0; background: none; }
.look-dots button::before { content: ""; display: block; width: 7px; height: 7px; margin: auto; border-radius: 50%; background: var(--line); }
.look-dots button.on::before { background: var(--accent); box-shadow: 0 0 8px rgba(255, 45, 149, .7); }
.look-detail .outfit { margin-top: 8px; }
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.look-tile { display: flex; flex-direction: column; gap: 2px; padding: 0 0 8px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(30, 20, 48, .94); color: var(--text); font: inherit; text-align: left; }
.look-tile img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: center top; margin-bottom: 4px; }
.look-tile span { padding: 0 10px; overflow-wrap: anywhere; }
.look-tile .muted { font-size: 12.5px; }
.photo-count { margin-top: 6px; font-size: 13px; }
.photo-edit { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-edit div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.photo-edit img { width: 64px; height: 96px; object-fit: cover; border-radius: 8px; }
.outfit-event h2 { margin: 6px 0 2px; }
.outfit { padding: 0; overflow: hidden; }
.outfit > :not(.outfit-photo) { margin-left: 14px; margin-right: 14px; }
.outfit-photo { display: block; width: 100%; aspect-ratio: 2 / 3; max-height: 560px; object-fit: cover; object-position: center top; background: var(--bg); cursor: zoom-in; }
.outfit-head { margin-top: 12px; gap: 10px; align-items: flex-start; }
.outfit-head .title { font-size: 17px; font-weight: 700; }
.outfit-notes { margin-top: 6px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.outfit-pieces { margin-top: 10px; border-top: 1px solid var(--line); }
.outfit-piece { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.outfit-piece .piece-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.outfit-piece .muted { font-size: 13px; }
.piece-icon, .piece-thumb { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--chip); display: flex; align-items: center; justify-content: center; font-size: 22px; object-fit: cover; }
.piece-buy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 2px; }
.piece-buy b { color: var(--accent); }
.piece-buy .list-link { font-size: 14px; font-weight: 600; padding: 0; }
.piece-how { line-height: 1.35; }
.btn.small { padding: 6px 10px; font-size: 13px; flex: none; }
.outfit-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 10px; font-weight: 600; }
.outfit-total b { font-size: 18px; color: var(--accent); }
.outfit-actions { flex-wrap: wrap; margin-top: 12px; margin-bottom: 14px; }
.outfit .lists-form.inline { margin-bottom: 14px; }
.chip.os-chosen, .chip.os-bought { color: var(--accent); }
.chip.os-worn { color: var(--ok); }
.piece-kind { margin: 16px 4px 8px; }
.piece-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.piece-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0; padding: 10px; text-align: left; font: inherit; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.piece-tile .muted { font-size: 13px; }
.piece-wrap { position: relative; display: flex; min-width: 0; }
.piece-wrap .piece-tile { flex: 1; }
.piece-chat { position: absolute; top: 6px; right: 6px; z-index: 1; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: rgba(21, 14, 30, .85); font-size: 15px; line-height: 1; }
.outfit-event.row { align-items: flex-end; }
.piece-tile .chip { white-space: normal; margin-top: 3px; }
.piece-tile.editing { grid-column: 1 / -1; }
.piece-tile.editing .lists-form.inline { margin-top: 0; padding-top: 0; border-top: 0; width: 100%; }
.piece-photo { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; background: var(--chip); margin-bottom: 4px; }
.piece-photo.none { display: flex; align-items: center; justify-content: center; font-size: 40px; aspect-ratio: 5 / 3; }
.piece-notes { line-height: 1.3; }
.piece-checks { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; padding: 4px 2px; }
.piece-checks input { width: auto; margin-right: 6px; }
.file-label input { font-size: 14px; padding: 6px; }
.sizes h2 { margin: 0 0 4px; }
.size-row { display: flex; gap: 12px; align-items: baseline; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; }
.size-key { flex: none; width: 92px; color: var(--muted); }
.size-value { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.size-value .muted { font-size: 13px; line-height: 1.35; }
.size-form { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sizes > .btn { margin-top: 12px; }

/* Mind (public/mind.js): the locked gate, then a chat like the other one with a quiet header and a lock button. */
.mind [hidden] { display: none !important; }
.mind-gate { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 48px 20px 24px; max-width: 420px; margin: 0 auto; }
.mind-gate h2 { margin: 0; font-family: Orbitron, sans-serif; letter-spacing: .08em; text-shadow: var(--glow-cyan, none); }
.mind-gate p { margin: 0 0 8px; line-height: 1.45; }
.mind-gate .btn.big { min-width: 240px; }
.mind-lock-icon { font-size: 56px; line-height: 1; filter: drop-shadow(0 0 14px rgba(255, 45, 149, .55)); }
.mind-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 2px 2px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.mind-head .muted { flex: 1; min-width: 0; font-size: 12px; }
.mind-title { font-weight: 700; }
.history-body > .card { margin-bottom: 4px; }
.muted.note.out { margin: 8px 2px 0; font-size: 13px; }
.mind-lockbtn { padding: 6px 12px; font-size: 13px; }
.mind-tools { display: flex; gap: 6px; margin-left: auto; }
.chat.mind .mind-bar { position: sticky; top: var(--mind-top, 0px); z-index: 1; margin: -12px -16px 0; padding: 10px 16px 8px; background: var(--bg); }
.chat.mind .mind-bar[hidden] { display: none; }
.mind-sub { flex: 1 0 100%; }
.mind-sub:empty { display: none; }
.mind-sub .mind-past { padding: 2px 2px 0; }
.mind-note { font-size: 12px; margin: 8px 2px 6px; }
.chat.mind .feed > * { scroll-margin-top: calc(var(--mind-top, 0px) + 64px); }
.mind-lockbtn.on { border-color: var(--accent); color: var(--accent); }
.mind-newbtn.confirm { border-color: var(--sw-bmagenta, var(--accent)); color: var(--sw-bmagenta, var(--accent)); }
.mind-past, .mind-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); padding: 6px 2px 8px; }
.mind-list-head b { color: var(--text, inherit); font-size: 15px; }
.mind-thread { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--card, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.mind-thread[aria-current] { border-color: var(--accent); }
.mind-thread-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 14px; }
.mind-thread-top .muted { font-weight: 400; font-size: 12px; }
.mind-thread-title { font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mind-now { font-size: 11px; font-family: var(--mono, inherit); color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; }
.mind-gap { margin: 6px 0; }
.mind-starting { display: flex; gap: 10px; align-items: flex-start; align-self: stretch; border: 1px dashed var(--line); border-radius: 12px; padding: 12px; font-size: 14px; }
.mind-starting .muted { font-size: 13px; margin-top: 2px; }
.mind-suggest { align-self: stretch; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.mind-suggest .muted { font-size: 13px; }
.mind-suggest-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.mind-suggest-row .btn { padding: 7px 12px; font-size: 13px; }
.mind .file button.doc { border: 1px solid var(--line); font: inherit; font-size: 14px; text-align: left; cursor: pointer; width: 100%; }
/* Replies (public/replies.js): Mind's gate, bar and rows, plus the list of people. */
.replies-body { padding-top: 10px; }
.replies-search, .replies-form input { width: 100%; font: inherit; font-size: 16px; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.replies-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; align-items: center; }
.replies-row.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 8px; padding: 0 16px; }
.replies-row.scroll::-webkit-scrollbar { display: none; }
.replies-chip { font: inherit; font-size: 13px; color: var(--muted); background: var(--chip); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; white-space: nowrap; cursor: pointer; }
.replies-chip.on { color: var(--accent-text); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.replies-name { overflow-wrap: anywhere; }
.replies-sub { display: flex; gap: 8px; align-items: center; margin-top: 5px; min-width: 0; }
.replies-note { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.replies-sort { border: 1px dashed var(--sw-byellow, var(--line)); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.replies-sort > .muted { font-size: 13px; margin: 2px 0 6px; }
.replies-sortrow, .replies-chatrow { border-top: 1px solid var(--line); padding: 8px 0; font-size: 14px; overflow-wrap: anywhere; }
.replies-sortrow .muted, .replies-chatrow .muted { font-size: 12px; }
.replies-sortrow .replies-row { margin: 6px 0 0; }
.replies-chatrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.replies-open { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 2px 0; cursor: pointer; overflow-wrap: anywhere; }
.replies-foot { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin: 14px 0; }
.replies-form { display: flex; flex-direction: column; gap: 10px; align-items: stretch; align-self: stretch; }
.replies-form .replies-row { margin: 0; }
.replies-same:empty { display: none; }
.replies-back { font: inherit; font-size: 26px; line-height: 1; color: var(--link); background: none; border: 0; min-width: 40px; min-height: 40px; margin-left: -10px; cursor: pointer; }
.replies-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat.replies .mind-bar { flex-wrap: nowrap; }
.mind-head .replies-title .muted { font-size: 12px; font-weight: 400; }
.replies-divider { margin: 10px 0 4px; }
.replies-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.replies-thumb { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: none; overflow: hidden; cursor: pointer; line-height: 0; }
.replies-thumb img { width: 96px; height: 140px; object-fit: cover; object-position: top; }
.md blockquote.replies-copy { cursor: pointer; background: rgba(46, 240, 240, .06); border-radius: 0 10px 10px 0; padding: 8px 10px; color: var(--text); }
.replies-copy > :last-child { margin-bottom: 0; }
.replies-copy::after { content: '⧉ tap to copy'; display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---- The tab bar's More button and its drawer (public/nav.js, Tomas #2340, like Studio's). On a phone the drawer
   drops down under the header over a dimmed page; on a laptop it is the sidebar's list (no bar, no More). */
#nav .tab i { font-style: normal; }
#nav .more { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin: 0; cursor: pointer; }
#nav .tab .badge[hidden], #drawer .badge[hidden] { display: none; }
#drawer[hidden] { display: none; }
#drawer { position: fixed; left: 0; right: 0; top: var(--top-h, 96px); bottom: 0; z-index: 5; background: rgba(8, 4, 14, .62); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  overflow-y: auto; overscroll-behavior: contain; animation: drawer-fade .16s ease-out; }
.drawer-in { max-width: 680px; margin: 0 auto; padding: 6px 14px 16px; background: var(--bg); border-bottom: 1px solid var(--line); border-radius: 0 0 18px 18px;
  box-shadow: 0 1px 0 rgba(255, 45, 149, .25), 0 22px 40px -16px rgba(255, 45, 149, .45); animation: drawer-drop .2s cubic-bezier(.2, .8, .2, 1); }
.drawer-group h3 { margin: 12px 4px 6px; font: 600 11px var(--mono); letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.drawer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dlink { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 66px; padding: 8px 2px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; font-family: var(--mono); font-size: 11.5px; }
.dlink span { font-size: 22px; line-height: 1; }
.dlink i { font-style: normal; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlink.active { border-color: var(--accent); color: var(--sw-bmagenta); background: rgba(255, 45, 149, .12); box-shadow: 0 0 14px -4px rgba(255, 45, 149, .7); font-weight: 600; }
.dlink .badge { position: absolute; top: 5px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff;
  font: 700 11px/17px var(--mono, system-ui); text-align: center; box-shadow: 0 0 8px rgba(255, 45, 149, .7); }
@media (hover: hover) and (pointer: fine) { .dlink:not(.active):hover { border-color: var(--sw-magenta); } }
@keyframes drawer-fade { from { opacity: 0; } }
@keyframes drawer-drop { from { transform: translateY(-12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #drawer, .drawer-in { animation: none; } }
body.drawer-open { overflow: hidden; }
body.signed-out #drawer { display: none; }

/* The Hinge button's sheet (public/hinge.js, Android app): a capture from Hinge on its way into Replies. */
.hinge-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
.hinge-card { max-width: 520px; margin: 0 auto; background: var(--card); border: 1px solid #ff3ea5; border-radius: 18px; padding: 14px 16px; box-shadow: 0 -6px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 10px; }
.hinge-top { display: flex; align-items: center; justify-content: space-between; }
.hinge-card p { margin: 0; }
.hinge-x { background: none; border: 0; color: var(--muted); font-size: 18px; padding: 4px 8px; }
.hinge-name { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.hinge-pick { text-align: left; }

/* ---- Laptop and desktop (browser or the installed app's window). Nothing above this line changes on a phone:
   everything here is behind a width of 900 px, or a mouse (hover). */
@media (hover: hover) and (pointer: fine) {
  html { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .btn:not(:disabled):hover { filter: brightness(1.08); }
  .btn.secondary:not(:disabled):hover { background: var(--line); filter: none; }
  .btn.danger:not(:disabled):hover { background: color-mix(in srgb, var(--danger) 12%, transparent); filter: none; }
  .btn.danger.armed:hover { background: var(--danger); }
  .round:not(:disabled):hover { filter: brightness(1.1); }
  .round.plain:hover { background: var(--chip); }
  .chip-x:hover { color: var(--danger); }
  .more:hover, .back:hover { text-decoration: underline; }
  a.title.link:hover { color: var(--accent); }
  .file .doc:hover { background: var(--line); }
  .code-copy:hover, .bubble-menu button:hover { background: var(--chip); }
  .viewer-btn:hover, .viewer-nav:hover { background: rgba(255,255,255,.26); }
  .quote:hover { opacity: 1; }
  .list-chip:not(.on):hover { background: var(--chip); }
  .list-filter:hover { color: var(--text); }
  .list-title:hover .title { color: var(--accent); }
  .tick:hover { border-color: var(--accent); }
  textarea:focus, select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
  .btn:focus-visible, .round:focus-visible, #nav .tab:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}

@media (min-width: 900px) {
  :root { --side: 220px; --wide: 1040px; }
  /* The tabs move to a sidebar on the left. */
  body:not(.signed-out) { padding-left: var(--side); }
  #top { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side); display: flex; flex-direction: column;
    border-bottom: 0; border-right: 1px solid var(--line); overflow-y: auto; }
  #top .bar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px 20px 18px; }
  #netbar { padding: 0 20px 12px; align-items: flex-start; }
  #top h1 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
  #top h1::before { content: ""; width: 32px; height: 32px; border-radius: 9px; background: url(/otter-192.png) center / cover; }
  #nav { flex-direction: column; max-width: none; margin: 0; padding: 0 10px; gap: 2px; }
  #nav .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; font-size: 15px;
    border-bottom: 0; border-radius: 10px; }
  #nav .tab span { font-size: 18px; width: 24px; text-align: center; }
  #nav .tab.active { background: color-mix(in srgb, var(--accent) 15%, transparent); }
  #nav .tab:not(.active):hover { background: var(--chip); color: var(--text); }

  main { max-width: var(--wide); padding: 28px 36px 40px; }
  h2 { margin-top: 22px; }
  #toast { left: calc(var(--side) + 16px); }

  /* Chat and a session's chat: a wider column, bubbles at a readable width. */
  .bubble { max-width: min(72%, 720px); font-size: 15.5px; }
  .file img, .file video { max-width: min(100%, 520px); max-height: 440px; }
  .composer { left: var(--side); padding-left: 36px; padding-right: 36px; }
  .compose-row, .attach-row, .reply-row { max-width: calc(var(--wide) - 72px); }

  /* Sessions: cards side by side; headings, buttons and notes across. */
  body[data-view="sessions"] main { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 0 16px; align-items: start; }
  body[data-view="sessions"] main > :not(.card), body[data-view="sessions"] main > .new-session { grid-column: 1 / -1; }
  body[data-view="sessions"] main > .btn.big { justify-self: start; width: auto; padding: 12px 22px; }

  /* Status: the otter beside the rows. */
  .status-view { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 0 20px; align-items: start; }
  .status-view .mascot { grid-row: 1 / span 2; position: sticky; top: 28px; margin: 0; padding: 24px 16px 18px; }
  .status-view .status-sessions { grid-column: 2; }

  body[data-view="settings"] main, body[data-view="history"] main, body[data-view="reminders"] main { max-width: 760px; }

  /* Lists: the lists down the left, their items beside them. */
  .lists-view { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 0 24px; align-items: start; }
  .list-kinds { flex-direction: column; overflow: visible; margin: 0; padding: 0; position: sticky; top: 28px; }
  .list-chip { justify-content: space-between; border-radius: 10px; }
  .list-main { max-width: 720px; }
  /* Outfits: the carousel beside the outfit in view; the gallery gets wider tiles. */
  .outfits-view .list-main[data-section="events"], .outfits-view .list-main[data-section="looks"] { max-width: 1000px; }
  .looks { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 0 24px; align-items: start; }
  .looks > .outfit-event, .looks > .look-dots { grid-column: 1; }
  .looks > .look-frame { grid-column: 1; margin: 0; border-radius: 14px; overflow: hidden; }
  .looks > .look-detail { grid-column: 2; grid-row: 1 / span 3; }
  .look-detail .outfit { margin-top: 0; }
  .look-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

  /* The picture viewer: room around the picture, bigger arrows. */
  .viewer-img { max-width: calc(100% - 160px); max-height: calc(100% - 140px); }
  .viewer-nav { width: 56px; height: 88px; font-size: 40px; }
  .viewer-nav.prev { left: 20px; } .viewer-nav.next { right: 20px; }
  .viewer-bar { padding: 14px 20px 24px; }
}
@media (min-width: 1100px) { .status-view { grid-template-columns: 320px minmax(0, 1fr); } }
@media (min-width: 1400px) { :root { --side: 248px; --wide: 1180px; } }

/* Synthwave on the laptop: the sidebar glows on its edge, the otter icon gets the neon frame too. */
@media (min-width: 900px) {
  #top { background: rgba(21, 14, 30, .84); box-shadow: 1px 0 0 rgba(255, 45, 149, .2), 12px 0 32px -20px rgba(255, 45, 149, .5); }
  #top h1::before { box-shadow: 0 0 0 1.5px var(--sw-magenta), 0 0 12px rgba(255, 45, 149, .6); }
  #top h1::after { left: 42px; }
  #nav .tab.active { background: rgba(255, 45, 149, .12); box-shadow: inset 2px 0 0 var(--accent), 0 0 18px -8px rgba(255, 45, 149, .8); }
  #nav .tab:not(.active):hover { text-shadow: 0 0 8px rgba(255, 79, 216, .5); }
  .stage { box-shadow: 0 0 0 2px var(--sw-magenta), 0 0 0 6px rgba(46, 240, 240, .22), 0 0 34px rgba(255, 45, 149, .55), 0 0 80px rgba(125, 92, 255, .32); }
}
@media (hover: hover) and (pointer: fine) {
  html { scrollbar-color: var(--edge) transparent; }
  .btn:not(:disabled):hover { box-shadow: 0 0 20px rgba(255, 45, 149, .7); }
  .list-chip:not(.on):hover, .file .doc:hover { border-color: var(--sw-magenta); }
  .md a:hover { text-shadow: var(--glow-cyan); }
  .chip-x:hover { color: var(--sw-bred); }
}

@media (min-width: 900px) { .chat.mind { max-width: 720px; margin: 0 auto; } }
@media (min-width: 900px) { .mind.history { max-width: 720px; margin: 0 auto; } }

/* The More drawer on a laptop: the sidebar's list of every section. */
@media (min-width: 900px) {
  #nav { display: none; }
  body:not(.signed-out) #drawer, #drawer[hidden] { display: block; }
  body.signed-out #drawer { display: none; }
  #drawer { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; animation: none; padding: 0 10px 18px; }
  .drawer-in { max-width: none; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; animation: none; }
  .drawer-group h3 { margin: 14px 12px 4px; font-size: 10.5px; }
  .drawer-grid { display: flex; flex-direction: column; gap: 1px; }
  .dlink { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 0; padding: 7px 12px; border: 0; background: none; color: var(--muted); font-size: 14px; border-radius: 10px; }
  .dlink span { font-size: 17px; width: 24px; text-align: center; }
  .dlink .badge { position: static; margin-left: auto; }
  .dlink.active { background: rgba(255, 45, 149, .12); box-shadow: inset 2px 0 0 var(--accent), 0 0 18px -8px rgba(255, 45, 149, .8); }
  .dlink:not(.active):hover { background: var(--chip); color: var(--text); }
  .undo-bar { top: 16px; }
}
