/* ============================================================
   ATLANTIS — city.css
============================================================ */
:root {
  --abyss:   #03121f;
  --deep:    #062338;
  --sea:     #0b3b57;
  --glow:    #8fe3ff;
  --pearl:   #e8f3f8;
  --muted:   #8fb3c6;
  --gold:    #ffd36a;
  --live:    #5be3a0;
  --work:    #ffb35c;
  --warn:    #c0564a;      /* an edge or line that needs attention */
  --warn-soft: #f0a597;    /* its text */
  --urgent:  #ff8f8f;      /* overdue, down, a slip */
  --urgent-soft: #ffb3b3;
  --on-accent: #1a1305;    /* text on a gold button */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--abyss);
  color: var(--pearl);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* ── HUD ── */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 1.5rem; padding: 1.25rem 1.75rem;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 18, 31, 0.75), rgba(3, 18, 31, 0));
}
.hud > * { pointer-events: auto; }
.hud h1 {
  font-family: 'Cinzel', Georgia, serif; font-weight: 800; font-size: 2rem; letter-spacing: 0.22em;
  color: var(--pearl);
}
.hud .sub { color: #dce9f0; font-size: 0.9rem; margin-top: 0.1rem; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85); }
.hud h1 { text-shadow: 0 0 18px color-mix(in srgb, var(--glow) 55%, transparent), 0 2px 8px rgba(0, 0, 0, 0.6); }
.stats { display: flex; gap: 0.6rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.stat {
  font-size: 0.85rem; padding: 0.4rem 0.8rem; border-radius: 999px;
  background: color-mix(in srgb, var(--glow) 8%, transparent); border: 1px solid color-mix(in srgb, var(--glow) 20%, transparent); color: var(--pearl);
}
.stat b { font-weight: 700; margin-right: 0.3rem; }
.stat.live b { color: var(--live); }
.stat.work b { color: var(--work); }
.stat.dirty b { color: var(--gold); }
.refresh {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--glow) 25%, transparent);
  background: color-mix(in srgb, var(--glow) 8%, transparent); color: var(--pearl); cursor: pointer; display: grid; place-items: center;
}
.refresh svg { width: 18px; height: 18px; }
.refresh:hover { background: color-mix(in srgb, var(--glow) 18%, transparent); }

/* ── SCENE ── */
#scene { position: fixed; inset: 0; background: #1a1626; }
#scene canvas { display: block; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.tag {
  position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform;
  font-family: 'Cinzel', Georgia, serif; font-weight: 600; letter-spacing: 0.1em;
}
.tag.project {
  font-size: 13px; color: #fff4dc; padding: 0.25rem 0.7rem; border-radius: 999px;
  background: rgba(20, 14, 8, 0.62); border: 1px solid rgba(255, 210, 130, 0.45);
  box-shadow: 0 0 14px rgba(255, 190, 100, 0.25);
}
.tag.project.active { background: rgba(40, 26, 10, 0.9); border-color: #ffd27a; color: #fff; }
.tag.citizen {
  font-size: 12px; color: #fff4dc; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: rgba(14, 30, 48, 0.72); border: 1px solid color-mix(in srgb, var(--glow) 45%, transparent);
  display: flex; align-items: center; gap: 0.35rem;
}
.tag.citizen.active { border-color: var(--glow); background: rgba(14, 40, 64, 0.92); }
.tag .badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: #ffb35c; color: #1a0f04; font: 800 11px Inter, sans-serif; letter-spacing: 0;
  box-shadow: 0 0 12px rgba(255, 179, 92, 0.9); animation: pulse 1.6s ease-in-out infinite;
}
.tag .badge[hidden] { display: none; }
@keyframes pulse { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
.tag.capital { font-size: 16px; font-weight: 800; letter-spacing: 0.35em; color: #ffe2a8; text-shadow: 0 0 12px rgba(255, 170, 70, 0.8), 0 2px 4px rgba(0, 0, 0, 0.8); }
.tag.district { font-size: 15px; font-weight: 800; letter-spacing: 0.4em; text-transform: uppercase; color: rgba(255, 236, 200, 0.75); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9); }

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

/* ── ZOOM CONTROLS ── */
.controls { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 5; display: flex; align-items: center; gap: 0.4rem; }
.controls button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--glow) 30%, transparent);
  background: rgba(4, 22, 34, 0.75); color: var(--pearl); font-size: 1.3rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.controls button:hover { background: rgba(14, 50, 72, 0.9); }
.controls button svg { width: 18px; height: 18px; }
#labels[hidden] { display: none; }
.controls button[aria-pressed="false"] { opacity: 0.55; }

/* ── CARD ── */
.card {
  position: fixed; z-index: 10; width: 340px; max-width: calc(100vw - 24px);
  padding: 1.1rem 1.2rem 1.2rem;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 0.88rem; line-height: 1.5;
}
.card.pinned { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.15rem; }
.card h2 { font-family: 'Cinzel', Georgia, serif; font-size: 1.25rem; }
.pill { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; margin-left: auto; white-space: nowrap; }
.pill.live { background: rgba(91, 227, 160, 0.15); color: var(--live); }
.pill.work { background: rgba(255, 179, 92, 0.15); color: var(--work); }
:is(.card, .page) .district-name { font-size: 0.78rem; text-transform: uppercase; margin-bottom: 0.6rem; }
:is(.card, .page) .desc { margin-bottom: 0.8rem; }
:is(.card, .page) dl { display: grid; grid-template-columns: 92px 1fr; gap: 0.3rem 0.6rem; margin-bottom: 0.8rem; }
:is(.card, .page) dt { color: var(--muted); }
:is(.card, .page) dd { color: var(--pearl); overflow-wrap: anywhere; }
:is(.card, .page) dd code { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }
:is(.card, .page) .dirty { color: var(--gold); }
.pill.urgent { background: rgba(255, 110, 110, 0.18); color: var(--urgent); }
.notices { list-style: none; display: grid; gap: 0.5rem; margin-bottom: 0.8rem; max-height: 46vh; overflow: auto; }
.notices li { display: grid; gap: 0.1rem; padding: 0.55rem 0.7rem; border-radius: 10px; background: color-mix(in srgb, var(--glow) 6%, transparent); border: 1px solid color-mix(in srgb, var(--glow) 12%, transparent); }
.notices li.new { border-color: rgba(91, 227, 160, 0.45); }
.notices .li-head { display: flex; align-items: center; gap: 0.5rem; }
.notices a { color: var(--glow); }
:is(.card, .page) .steps { padding-left: 1.1rem; display: grid; gap: 0.5rem; margin-bottom: 0.8rem; color: #cfe2ec; }
:is(.card, .page) code.block { display: block; margin-top: 0.35rem; padding: 0.5rem 0.6rem; border-radius: 8px; background: rgba(0, 0, 0, 0.35); font: 0.72rem/1.45 ui-monospace, Menlo, monospace; color: var(--gold); white-space: pre-wrap; word-break: break-all; user-select: all; }
:is(.card, .page) dd a { color: var(--brass-hi); }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.9rem; }
.chip { font-size: 0.75rem; padding: 0.15rem 0.55rem; border-radius: 6px; background: color-mix(in srgb, var(--glow) 10%, transparent); color: #cfe2ec; }
.actions { display: flex; gap: 0.5rem; }
.actions a, .actions button {
  font: inherit; font-weight: 600; font-size: 0.82rem; text-decoration: none; cursor: pointer;
  padding: 0.45rem 0.8rem; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--glow) 35%, transparent);
  background: color-mix(in srgb, var(--glow) 10%, transparent); color: var(--pearl);
}
.actions a:hover, .actions button:hover { background: color-mix(in srgb, var(--glow) 22%, transparent); }
.hint { margin-top: 0.7rem; font-size: 0.75rem; color: var(--muted); }

@media (max-width: 720px) {
  .hud { flex-wrap: wrap; padding: 1rem; }
  .hud h1 { font-size: 1.5rem; }
  .stats { margin-left: 0; justify-content: flex-start; width: 100%; order: 3; }
}

/* ── The books (the Purser's and the Merchant's ledger) ── */
.ledger { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-bottom: 0.9rem; font-variant-numeric: tabular-nums; }
.ledger th, .ledger td { padding: 0.3rem 0.35rem; text-align: right; border-bottom: 1px solid color-mix(in srgb, var(--glow) 12%, transparent); white-space: nowrap; }
.ledger th:first-child { text-align: left; white-space: normal; }
.ledger thead th { color: var(--muted); font-weight: 600; }
.ledger tfoot th, .ledger tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.gain { color: var(--live); } .loss { color: var(--urgent); }
.entry { display: grid; grid-template-columns: 1fr 1fr; }
.entry select, .entry input { font: inherit; font-size: 0.8rem; color: var(--pearl); background: rgba(0, 0, 0, 0.3); border: 1px solid color-mix(in srgb, var(--glow) 25%, transparent); border-radius: 7px; padding: 0.4rem 0.5rem; min-width: 0; }
.entry input[name=category], .entry input[name=note] { grid-column: 1 / -1; }
.entry button { grid-column: 1 / -1; font: inherit; font-weight: 700; cursor: pointer; padding: 0.45rem; border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); color: var(--gold); }
.entry button.fit { grid-column: auto; }   /* a button that sits beside its field instead of under it */
.pre-line { white-space: pre-line; }   /* text that keeps its own line breaks (a warning's description) */
.push { margin-left: auto; }   /* pushed to the end of its row */
.sub-h { font-family: 'Cinzel', Georgia, serif; font-size: 0.85rem; letter-spacing: 0.08em; margin-bottom: 0.4rem; }
:is(.card, .page) .small { font-size: 0.72rem; margin-top: 0.3rem; }
.card.wide { width: 430px; }
.warn { color: var(--gold); }
.entry .inline { display: flex; gap: 0.4rem; min-width: 0; }
.entry .inline input { flex: 1; } .entry .inline select { flex: 1; }
.entry label { display: flex; align-items: center; gap: 0.4rem; }
.entry label input { flex: 1; }
.ledger th .small { font-weight: 400; margin-top: 0.1rem; }
.tag.project.down { background: rgba(60, 10, 10, 0.85); border-color: var(--urgent); color: #ffd0d0; }
.tag.project.down::after { content: " · site down"; color: var(--urgent); font-family: Inter, sans-serif; letter-spacing: 0; font-size: 11px; }
.notices .actions { margin-top: 0.35rem; }
:is(.card, .page) details summary { cursor: pointer; margin: 0.6rem 0 0.4rem; }

/* The Lamplighter's checklist */
.checklist { list-style: none; margin: 0 0 0.9rem; padding: 0; display: grid; gap: 0.25rem; }
.checklist .task { display: flex; align-items: center; gap: 0.4rem; background: color-mix(in srgb, var(--glow) 6%, transparent); }
.checklist label { flex: 1; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.85rem; }
.checklist input { accent-color: var(--gold); width: 16px; height: 16px; }
.checklist .done span { text-decoration: line-through; }
.task-x { font: inherit; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0 0.3rem; font-size: 1rem; opacity: 1; }   /* always shown (style.md); subtasks and the managing list show it fainter */
.checklist .task:hover .task-x, .task-x:focus-visible { opacity: 1; }
.entry input[name=name] { grid-column: 1 / -1; }

/* The Oracle */
.two-col { margin-top: 0.4rem; }
.two-col h4 { margin: 0 0 0.2rem; font-size: 0.72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.steps { margin: 0.3rem 0 0.8rem; padding-left: 1.1rem; display: grid; gap: 0.35rem; color: #cfe2ec; }

/* ============================================================
   ATLANTIS PRO additions
============================================================ */
/* ── Sign-in screens ── */
.gate {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 1.4rem; padding: 16px; overflow: auto;
}
.gate::before { content: ""; position: fixed; inset: 0; z-index: -1; transition: opacity 0.8s ease;
  background: radial-gradient(ellipse at 50% 45%, rgba(3, 18, 31, 0.05) 0%, rgba(3, 18, 31, 0.4) 85%); }   /* a light veil over the open sea */
/* unlocking (auth.js): the card fades, the veil lifts, the mark and name glide to the middle and grow; then all fade */
.gate-hero { transition: transform 0.95s cubic-bezier(.4, 0, .2, 1); }   /* GLIDE in auth.js */
.gate-box { transition: opacity 0.35s ease, transform 0.35s ease; }
.gate.unlocking { pointer-events: none; overflow: hidden; }
.gate.unlocking::before { opacity: 0; }
.gate.unlocking .gate-box { opacity: 0; transform: translateY(14px) scale(0.98); }
.gate.unlocking .gate-hero { transform: translate(var(--dx, 0), var(--dy, 0)) scale(1.5); }
.gate.gone { opacity: 0; transition: opacity 0.7s ease; }
.gate-box {
  width: min(420px, 100%); background: var(--card-bg); border: 1px solid color-mix(in srgb, var(--glow) 28%, transparent); border-radius: 18px;
  position: relative; padding: 1.8rem 1.6rem 1.4rem; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.gate h1 { font-family: 'Cinzel', Georgia, serif; font-weight: 800; letter-spacing: 0.22em; font-size: 1.9rem; text-align: center; text-shadow: 0 0 18px color-mix(in srgb, var(--glow) 45%, transparent); }
/* The mark: gold, pulsing like slow footsteps while it waits; on sign-in the whole dial turns counterclockwise until the
   bridge sits at 3 o'clock, then it brightens to white and snaps to blue (auth.js plays the chime at the snap). */
@property --atl-a { syntax: '<color>'; inherits: true; initial-value: #e2bd62; }
@property --atl-g { syntax: '<length>'; inherits: true; initial-value: 6px; }
@property --atl-r { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
.atl-af { fill: var(--atl-a); }
.atl-as { stroke: var(--atl-a); }
.atl-dial { transform: rotate(var(--atl-r)); transform-origin: 100px 100px; transform-box: view-box; }
/* above the card: the mark, the name, the tagline, standing on the sea */
.gate-hero { display: grid; justify-items: center; text-align: center; }
.gate-hero h1 { margin-top: 0.7rem; padding-left: 0.22em; text-shadow: 0 2px 14px rgba(3, 18, 31, 0.85), 0 0 18px color-mix(in srgb, var(--glow) 35%, transparent); }
.gate .gate-hero .tagline { margin: 0.3rem 0 0; font-size: 0.95rem; color: var(--pearl); text-shadow: 0 1px 3px rgba(3, 18, 31, 0.9), 0 0 14px rgba(3, 18, 31, 0.7); }
.gate-foot { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 1.2rem; }
.gate-foot:has(.gate-tag) { justify-content: space-between; }
.gate .gate-foot .credit { margin: 0; text-align: left; }
.gate-foot .gate-tag { margin: 0; flex: none; font-size: 0.6rem; }
.gate-box .card-title { font: 600 1rem Inter, system-ui, sans-serif; text-align: center; margin: 0.2rem 0 1rem; color: var(--pearl); }
@media (max-width: 420px) { .gate-hero .gate-logo { width: 104px; height: 104px; } }
.gate-logo { display: block; width: 140px; height: 140px; animation: atl-pulse 3.8s infinite;
  filter: drop-shadow(0 0 calc(var(--atl-g) * 0.3) color-mix(in srgb, var(--atl-a) 50%, transparent)); }
.gate-logo.unlocking { animation: atl-unlock 3.4s ease-in-out forwards; }
@keyframes atl-pulse {
  0% { --atl-a: #c9a14a; --atl-g: 4px; animation-timing-function: cubic-bezier(.3, 0, .3, 1); }
  11% { --atl-a: #e2bd62; --atl-g: 20px; animation-timing-function: cubic-bezier(.4, 0, .5, 1); }
  30% { --atl-a: #d0a851; --atl-g: 9px; }
  50%, 100% { --atl-a: #c9a14a; --atl-g: 4px; }   /* one pulse, then a rest as long as the pulse */
}
@keyframes atl-unlock {
  0% { --atl-a: #e2bd62; --atl-g: 10px; --atl-r: 0deg; animation-timing-function: ease-in-out; }
  40% { --atl-a: #e2bd62; --atl-g: 10px; --atl-r: -120deg; }
  60% { --atl-a: #ece4d4; --atl-g: 34px; animation-timing-function: cubic-bezier(.2, 0, 0, 1); }
  64% { --atl-a: #8fe3ff; --atl-g: 44px; animation-timing-function: ease-out; }
  76% { --atl-a: #8fe3ff; --atl-g: 14px; }
  100% { --atl-a: #8fe3ff; --atl-g: 14px; --atl-r: -120deg; }
}
@media (prefers-reduced-motion: reduce) { .gate-logo { animation: none; } .gate-logo.unlocking { animation: atl-unlock 0.01s forwards; } }
.gate .tagline { text-align: center; color: var(--muted); font-size: 0.88rem; margin: 0.3rem 0 1.3rem; }
.gate form { display: grid; gap: 0.7rem; }
.gate label { display: grid; gap: 0.25rem; font-size: 0.82rem; color: var(--muted); }
.gate input, .gate textarea {
  font: inherit; font-size: 0.95rem; color: var(--pearl); background: rgba(0, 0, 0, 0.3);
  border: 1px solid color-mix(in srgb, var(--glow) 25%, transparent); border-radius: 9px; padding: 0.6rem 0.7rem;
}
.gate input:focus-visible, .gate textarea:focus-visible, .gate button:focus-visible { outline: 2px solid var(--glow); outline-offset: 1px; }
.gate .primary {
  font: inherit; font-weight: 700; cursor: pointer; padding: 0.7rem; border-radius: 10px; margin-top: 0.3rem;
  border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent); background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold);
}
.gate .primary:disabled { opacity: 0.6; cursor: progress; }
.gate .links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; font-size: 0.82rem; }
.gate .links button { background: none; border: 0; color: var(--glow); cursor: pointer; font: inherit; padding: 0; }
.gate .error { color: var(--urgent); font-size: 0.85rem; min-height: 1.2em; }
.gate .note { color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.gate .recovery {
  font: 700 1rem/1.6 ui-monospace, Menlo, monospace; letter-spacing: 0.04em; color: var(--gold); text-align: center;
  background: rgba(0, 0, 0, 0.35); border: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent); border-radius: 10px; padding: 0.8rem; word-break: break-all; user-select: all;
}
.gate .check { display: flex; gap: 0.5rem; align-items: flex-start; color: var(--pearl); font-size: 0.85rem; }
.gate .check input { margin-top: 0.2rem; accent-color: var(--gold); }
.gate .row { display: flex; gap: 0.5rem; }
.gate .row > * { flex: 1; }
.gate .ghost { font: inherit; cursor: pointer; padding: 0.55rem; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--glow) 30%, transparent); background: color-mix(in srgb, var(--glow) 8%, transparent); color: var(--pearl); }
.credit { position: fixed; left: 1.25rem; bottom: 1.1rem; z-index: 5; font-size: 0.75rem; color: rgba(232, 243, 248, 0.7); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.credit a { color: inherit; }
.gate .credit { position: static; text-align: center; margin-top: 1.2rem; display: block; }
.donate { display: grid; justify-items: center; gap: 0.6rem; }
.donate img { width: 220px; max-width: 100%; border-radius: 12px; background: #fff; padding: 8px; }
.hud .lock { width: 40px; height: 40px; color: var(--pearl); cursor: pointer; display: grid; place-items: center; }
.hud .lock svg { width: 18px; height: 18px; }
:is(.card, .page) .share { padding: 0.6rem 0.7rem; margin-bottom: 0.8rem; font-size: 0.82rem; }
:is(.card, .page) .share b { color: var(--gold); }
.entry textarea { font: inherit; font-size: 0.8rem; color: var(--pearl); background: rgba(0, 0, 0, 0.3); border: 1px solid color-mix(in srgb, var(--glow) 25%, transparent); border-radius: 7px; padding: 0.4rem 0.5rem; grid-column: 1 / -1; min-height: 4.5rem; }
.entry .full { grid-column: 1 / -1; }
.saving { color: var(--muted); font-size: 0.75rem; }

.card { max-height: calc(100vh - 100px); overflow: auto; overscroll-behavior: contain; }

/* adding and removing things */
.hud .add { height: 40px; padding: 0 1rem; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--gold); font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.hud .add:hover, .hire:hover { background: color-mix(in srgb, var(--gold) 25%, transparent); }
.hud .add + .lock { margin-left: -1rem; }
.hire { margin-left: auto; font: inherit; font-weight: 700; font-size: 0.75rem; padding: 0.25rem 0.65rem; border-radius: 7px; border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--gold); cursor: pointer; text-decoration: none; white-space: nowrap; }
.card-head .hire { align-self: center; }
.card-foot { justify-content: flex-end; margin-top: 0.4rem; }
.quiet { font: inherit; font-size: 0.75rem; padding: 0.25rem 0.6rem; cursor: pointer; }
details.edit { margin: 0.2rem 0 0.4rem; }
details.edit summary { cursor: pointer; font-size: 0.8rem; color: var(--glow); margin-bottom: 0.5rem; }
:is(.card, .page) .notices a { color: inherit; text-decoration: none; }
:is(.card, .page) .notices a:hover b { text-decoration: underline; }
.entry label input[type=checkbox] { flex: none; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 0.9rem; max-width: calc(100vw - 32px); padding: 0.6rem 0.7rem 0.6rem 1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 0.85rem; color: var(--pearl); }
.toast[hidden], .toast button[hidden] { display: none; }
.toast button { font: inherit; font-weight: 700; font-size: 0.8rem; padding: 0.3rem 0.8rem; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); cursor: pointer; }

/* Today and the captain carousel */
.hud .today { border-color: color-mix(in srgb, var(--glow) 35%, transparent); background: color-mix(in srgb, var(--glow) 8%, transparent); color: var(--pearl); }
.hud .today:hover { background: color-mix(in srgb, var(--glow) 18%, transparent); }
.hud .today + .add { margin-left: -1rem; }
.portrait { margin: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 420 / 260; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--sail) 35%, transparent), transparent 70%), linear-gradient(180deg, color-mix(in srgb, var(--glow) 12%, transparent), rgba(10, 60, 90, 0.35)); border: 1px solid color-mix(in srgb, var(--glow) 18%, transparent); }
.portrait img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sail-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sail); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); flex: none; }
.agenda .when { color: var(--muted); font-size: 0.78rem; min-width: 4.2rem; }
.agenda a, .notices .li-head a { color: inherit; text-decoration: none; }
.agenda a:hover { text-decoration: underline; }

/* captains' lists */
button.chip { font: inherit; font-size: 0.75rem; border: 1px solid transparent; cursor: pointer; }
button.chip:hover { border-color: color-mix(in srgb, var(--glow) 35%, transparent); }
.chip.on { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.sub-h.late { color: var(--urgent-soft); }
.checklist .task .aisle { font: inherit; font-size: 0.7rem; color: var(--muted); background: transparent; border: 1px solid color-mix(in srgb, var(--glow) 15%, transparent); border-radius: 6px; padding: 0.1rem 0.2rem; max-width: 7.5rem; opacity: 0; }
.checklist .task:hover .aisle, .checklist .task .aisle:focus { opacity: 1; }
.checklist.big .task label { padding: 0.15rem 0; }
.ledger.week td { text-align: left; font-size: 0.78rem; }
.ledger.week td .task-x { padding: 0 0.15rem; font-size: 0.85rem; }
.ledger.week .meal { color: var(--pearl); }
.recipes summary { cursor: pointer; }
.steps { white-space: pre-wrap; font-size: 0.82rem; }
@media (hover: none) { .task-x, .checklist .task .aisle { opacity: 1; } }
.card-head > .dim.small { margin-left: auto; white-space: nowrap; }

/* the Merchant's books */
.entry label select { font: inherit; font-size: 0.8rem; color: var(--pearl); background: rgba(0, 0, 0, 0.3); border: 1px solid color-mix(in srgb, var(--glow) 25%, transparent); border-radius: 7px; padding: 0.3rem 0.4rem; min-width: 0; }
.entry label.small:has(input[type=checkbox]) { flex-direction: row; align-items: center; }
.entry input[type=file] { font-size: 0.78rem; color: var(--muted); }
.bars { list-style: none; display: grid; gap: 0.35rem; margin-bottom: 0.9rem; font-size: 0.8rem; }
.bars li { display: grid; grid-template-columns: 6.5rem 1fr auto auto; align-items: center; gap: 0.5rem; }
.bars .bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--glow) 10%, transparent); overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.bars.budget .bar i { background: var(--live); }
.bars li.over .bar i { background: var(--urgent); }
.bars li.over b { color: var(--urgent); }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.month-nav .nav { width: 2rem; height: 2rem; font: inherit; font-size: 1.2rem; cursor: pointer; }
.month-nav .nav:disabled { opacity: 0.3; cursor: default; }
.ledger.preview td, .ledger.preview th { font-size: 0.72rem; text-align: left; }
.ledger.preview td:last-child { text-align: right; white-space: nowrap; }
.notices .actions { display: flex; gap: 0.4rem; justify-content: flex-end; align-items: center; }
.entry button:disabled { opacity: 0.45; cursor: default; }

/* ── the skeleton: managers in the top bar, captain pages, the bell, phones ── */
.hud .managers { display: flex; gap: 0.35rem; }
.hud .managers button { height: 38px; padding: 0 0.9rem; font: inherit; cursor: pointer; }
.hud .lock + .lock, .hud .managers + .lock { margin-left: -0.9rem; }
button.stat { font: inherit; cursor: pointer; }
.tag.project.home { border-color: rgba(255, 220, 140, 0.8); background: rgba(70, 46, 16, 0.9); }
.card-head .sail-dot { flex: none; }
.crew .li-head a { color: inherit; text-decoration: none; }
.crew .li-head a:hover b { text-decoration: underline; }
details.danger summary { color: var(--urgent-soft); }
code.recovery { font-size: 0.9rem; letter-spacing: 0.04em; }
.bell-icon { font-size: 1.4rem; display: inline-block; transform-origin: 50% 10%; }
.bell-icon.ring { animation: ring 1.2s ease-out; }
@keyframes ring { 0% { transform: rotate(0); } 10% { transform: rotate(18deg); } 25% { transform: rotate(-16deg); } 40% { transform: rotate(12deg); } 55% { transform: rotate(-8deg); } 70% { transform: rotate(4deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .bell-icon.ring { animation: none; } }

/* a captain's full page */
.page { position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; color: var(--pearl); }
.page[hidden] { display: none; }
body.on-page .hud, body.on-page .controls, body.on-page #labels, body.on-page .credit { visibility: hidden; }
.page-bar { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.5rem; }
.page-bar h1 { font-family: 'Cinzel', Georgia, serif; }
.page-bar .back { text-decoration: none; padding: 0.4rem 0.8rem; white-space: nowrap; }
.page-bar .pill { margin-left: auto; }
.page-body { flex: 1; overflow: auto; }
.page-inner { max-width: 860px; margin: 0 auto; padding: 1.4rem 1.5rem 3rem; }
.page .notices { max-height: none; }
.page .sail-dot { width: 14px; height: 14px; }

/* phones: the top bar wraps, cards slide up from the bottom */
@media (max-width: 700px) {
  .hud { gap: 0.5rem; padding: 0.7rem 0.8rem; }
  .hud > div:first-child { flex: 1 1 100%; }
  .hud .stats { order: 5; flex: 1 1 100%; justify-content: flex-start; margin-left: 0; }
  .hud .managers button { height: 34px; padding: 0 0.7rem; font-size: 0.8rem; }
  .hud .lock { width: 34px; height: 34px; }
  .card, .card.wide { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-width: none; max-height: 72vh; border-radius: 16px 16px 0 0; }
  .page-bar { padding: 0.7rem 0.9rem; gap: 0.5rem; flex-wrap: wrap; }
  .page-bar h1 { font-size: 1.15rem; }
  .page-inner { padding: 1rem 0.9rem 2.5rem; }
  .bars li { grid-template-columns: 5rem 1fr auto auto; }
}
button.linkish, a.linkish { font: inherit; color: var(--brass-hi); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
button.linkish:hover, a.linkish:hover { text-decoration: underline; }
a.linkish { text-decoration: none; }
.timer { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.55rem 0.7rem; border-radius: 10px; background: rgba(91, 227, 160, 0.08); border: 1px solid rgba(91, 227, 160, 0.35); margin-bottom: 0.8rem; font-size: 0.85rem; }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.bars.hours li { grid-template-columns: minmax(6.5rem, auto) 1fr auto; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.stat-row > div { padding: 0.6rem 0.7rem; border-radius: 10px; background: color-mix(in srgb, var(--glow) 6%, transparent); border: 1px solid color-mix(in srgb, var(--glow) 12%, transparent); display: grid; gap: 0.1rem; } .stat-row span { color: var(--muted); font-size: 0.75rem; }
/* the Cartographer's calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 1rem; }
.cal-dow { text-align: center; padding: 0.2rem 0; }
.cal-day { min-height: 4.8rem; border-radius: 8px; background: color-mix(in srgb, var(--glow) 5%, transparent); border: 1px solid color-mix(in srgb, var(--glow) 10%, transparent); padding: 0.25rem; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-day.other { opacity: 0.45; }
.cal-day.today { border-color: var(--gold); }
.cal-n { font-size: 0.72rem; color: var(--muted); }
.ev { display: block; font-size: 0.68rem; line-height: 1.25; padding: 1px 4px; border-radius: 4px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .cal-day { min-height: 3.2rem; } .ev { font-size: 0.6rem; } }
/* the Chaplain */
.vow .reason { font-style: italic; color: #e8dcc0; font-size: 0.85rem; margin: 0.2rem 0; }
.vow .actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 0.3rem; }
.vow .slip { color: var(--urgent-soft); border-color: rgba(255, 143, 143, 0.4); }
a.quiet { text-decoration: none; display: inline-block; }   /* a link that does what a button does looks like one */
.entry .days { display: flex; flex-wrap: wrap; }
.entry .days label { flex-direction: row; }
label.discreet { display: flex; align-items: center; gap: 0.4rem; margin: 0.6rem 0; }
.journal textarea { min-height: 12rem; font-size: 0.9rem; line-height: 1.5; }
.moods { display: flex; gap: 0.6rem; }
.moods label { display: flex; align-items: center; cursor: pointer; font-size: 1.3rem; }
.moods input { position: absolute; opacity: 0; pointer-events: none; }
.moods span { padding: 0.15rem 0.3rem; border-radius: 8px; opacity: 0.45; }
.moods input:checked + span { opacity: 1; background: color-mix(in srgb, var(--gold) 20%, transparent); }
/* the Shantyman */
.player { margin-bottom: 0.9rem; display: grid; gap: 0.4rem; }
.player iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.songs { list-style: none; display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.song { display: grid; gap: 0.6rem; align-items: center; padding: 0.35rem; border-radius: 10px; background: color-mix(in srgb, var(--glow) 5%, transparent); border: 1px solid color-mix(in srgb, var(--glow) 10%, transparent); }
.song.on { border-color: var(--gold); }
.song > div { display: grid; gap: 0.1rem; min-width: 0; }
.song b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { position: relative; padding: 0; border: 0; border-radius: 7px; overflow: hidden; cursor: pointer; background: #000; width: 96px; height: 54px; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.1rem; background: rgba(0, 0, 0, 0.25); opacity: 0; }
.thumb:hover span { opacity: 1; }
/* the Vault */
.usage { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: center; margin-bottom: 0.8rem; }
.usage .bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--glow) 10%, transparent); overflow: hidden; }
.usage .bar i { display: block; height: 100%; background: var(--gold); }
.files { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; margin: 0.25rem 0; }
.file { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.82rem; }
.steps-list { margin: 0 0 0.8rem 1.2rem; font-size: 0.85rem; display: grid; gap: 0.25rem; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 70px; margin: 0.4rem 0 1rem; padding: 0.3rem; border-radius: 8px; background: color-mix(in srgb, var(--glow) 5%, transparent); }
.spark i { flex: 1; background: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 35%, transparent)); border-radius: 2px 2px 0 0; min-height: 2px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }
.status-preview { margin-bottom: 0.9rem; }   /* the Herald's report: its own look, from herald.js (REPORT_CSS) */
/* the Captains manager: an accordion in two groups */
.crew-list { list-style: none; display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.crew-row { border-radius: 10px; background: color-mix(in srgb, var(--glow) 5%, transparent); border: 1px solid color-mix(in srgb, var(--glow) 12%, transparent); }
.crew-row.aboard { border-color: rgba(91, 227, 160, 0.3); }
.crew-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.6rem 0.35rem 0.35rem; }
.crew-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.6rem; font: inherit; color: inherit; background: none; border: 0; padding: 0.25rem; cursor: pointer; text-align: left; }
.crew-name { display: grid; min-width: 0; } .crew-name .dim { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { margin-left: auto; color: var(--muted); }
.crew-detail { padding: 0 0.8rem 0.8rem; display: grid; gap: 0.5rem; }
.crew-detail .portrait { max-width: 320px; }
.crew-detail .actions { display: flex; gap: 0.5rem; align-items: center; }

/* scroll bars: thin, in the city's colours */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--glow) 35%, transparent) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--glow) 28%, transparent); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--glow) 50%, transparent); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* the Lamplighter */
.checklist.lamplighter .task { gap: 0.6rem; }
.checklist .ticks { display: inline-flex; gap: 0.3rem; }
.checklist.lamplighter .task > span:last-child { flex: 1; font-size: 0.88rem; }
.day-bar { overflow: hidden; margin: -0.3rem 0 0.7rem; }
.day-bar i { display: block; height: 100%; transition: width 0.3s; }
.hist-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 0.4rem; }
.hist-day { display: grid; place-items: center; font-size: 0.72rem; }
.hist-day.other { opacity: 0.35; }
.hist-day.future { opacity: 0.25; }
.checklist.manage .task { gap: 0.5rem; }
.checklist .grow { flex: 1; font-size: 0.85rem; }
.handle { cursor: grab; color: var(--muted); font-size: 1.1rem; touch-action: none; user-select: none; padding: 0 0.15rem; }
.task.dragging { opacity: 0.85; outline: 1px dashed var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.checklist.manage .task { flex-wrap: wrap; }
.checklist.manage .task-x { opacity: 0.6; }

/* ── form controls: one look everywhere (popups and captain pages) ── */
:is(.card, .page) { color-scheme: dark; }
:is(.card, .page) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), select, textarea) {
  font: inherit; font-size: 0.9rem; min-width: 0;
  padding: 0.6rem 0.75rem; min-height: 2.6rem; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
:is(.card, .page) textarea { min-height: 5.5rem; line-height: 1.5; resize: vertical; }
:is(.card, .page) :is(input, select, textarea):focus { outline: none; }
:is(.card, .page) select { appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-repeat: no-repeat; background-position: right 0.85rem center; }
:is(.card, .page) select option { color: var(--pearl); }
:is(.card, .page) input[type=number] { -moz-appearance: textfield; }
:is(.card, .page) input[type=number]::-webkit-inner-spin-button, :is(.card, .page) input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
:is(.card, .page) input[type=date]::-webkit-calendar-picker-indicator, :is(.card, .page) input[type=time]::-webkit-calendar-picker-indicator { filter: invert(0.8) sepia(1) hue-rotate(160deg); cursor: pointer; opacity: 0.8; }
:is(.card, .page) input[type=color] { width: 2.6rem; height: 2.6rem; padding: 0.2rem; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--glow) 18%, transparent); background: transparent; cursor: pointer; }
:is(.card, .page) input[type=file] { font: inherit; font-size: 0.82rem; color: var(--muted); padding: 0.5rem; border: 1px dashed color-mix(in srgb, var(--glow) 30%, transparent); border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
:is(.card, .page) input[type=file]::file-selector-button { font: inherit; margin-right: 0.7rem; }

/* checkboxes and radios */
:is(.card, .page) :is(input[type=checkbox], input[type=radio]) {
  appearance: none; flex: none; width: 1.15rem; height: 1.15rem; margin: 0; cursor: pointer; display: inline-grid; place-content: center; transition: background 0.15s, border-color 0.15s;
}
:is(.card, .page) :is(input[type=checkbox], input[type=radio]):hover { border-color: var(--gold); }
:is(.card, .page) input[type=checkbox]:checked { background: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1' fill='none' stroke='%2303121f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; }
:is(.card, .page) :is(input[type=checkbox], input[type=radio]):focus-visible { outline: 2px solid color-mix(in srgb, var(--gold) 60%, transparent); outline-offset: 2px; }

/* the form grid: labels above their fields, roomier */
.entry { gap: 0.6rem; margin-bottom: 1.1rem; }
.entry label.small { flex-direction: column; align-items: stretch; gap: 0.3rem; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.02em; }
.entry label.small > :is(input, select) { flex: none; }
.entry button { min-height: 2.6rem; border-radius: 10px; font-size: 0.88rem; letter-spacing: 0.01em; transition: background 0.15s, transform 0.05s;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 24%, transparent), color-mix(in srgb, var(--gold) 12%, transparent)); }
.entry button:hover:not(:disabled) { background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 34%, transparent), color-mix(in srgb, var(--gold) 18%, transparent)); }
.entry button:active:not(:disabled) { transform: translateY(1px); }
.entry button.quiet { background: none; color: var(--pearl); border-color: color-mix(in srgb, var(--glow) 30%, transparent); font-weight: 600; }
.page .entry { max-width: none; }

/* choosing days: pills that light up */
.entry .days { gap: 0.35rem; }
.entry .days label { position: relative; padding: 0.4rem 0.75rem; cursor: pointer; user-select: none; transition: all 0.15s; }
.entry .days label:hover { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.entry .days label input { position: absolute; opacity: 0; pointer-events: none; }
.entry .days label:has(input:checked) { font-weight: 600; }

/* captain pages: sections as panels, text in proportion */
.page .sub-h { margin-top: 1.4rem; font-size: 0.95rem; }
.page .desc { font-size: 0.95rem; }
.hist-day { aspect-ratio: auto; height: 2.3rem; }
/* list rows: one comfortable height for ticking and managing */
.checklist .task { padding: 0.55rem 0.8rem; min-height: 2.9rem; border-radius: 10px; }
.checklist.lamplighter input[type=checkbox] { width: 1.3rem; height: 1.3rem; }

/* ── Atlantis gold: a warmer, lighter theme for popups and captain pages ── */
:root {
  --card-bg: rgba(18, 52, 72, 0.94);
  --gold-deep: #e0a94a;
  --gold-soft: color-mix(in srgb, var(--gold) 16%, transparent);
  --gold-line: color-mix(in srgb, var(--gold) 32%, transparent);
  --panel: rgba(255, 236, 190, 0.055);
}
.card { border-color: var(--gold-line); }
.card h2, .page-bar h1 { color: var(--gold); text-shadow: 0 0 18px rgba(255, 190, 90, 0.35); }

/* captain pages: sunlight on the water */
.page-bar { border-bottom-color: var(--gold-line); }

/* rows and panels: warm, with gold edges */
:is(.card, .page) :is(.notices li, .checklist .task, .crew-row, .stat-row > div, .cal-day, .song) { border-color: color-mix(in srgb, var(--gold) 16%, transparent); }
:is(.card, .page) .notices li, .checklist .task { border-width: 1px; border-style: solid; }
.hist-day { border-color: color-mix(in srgb, var(--gold) 12%, transparent); }

/* inputs: warmer fields with gold edges */
:is(.card, .page) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), select, textarea) { border-color: color-mix(in srgb, var(--gold) 28%, transparent); }
:is(.card, .page) :is(input[type=checkbox], input[type=radio]) { border-color: color-mix(in srgb, var(--gold) 55%, transparent); }

/* buttons: solid Atlantis gold for the main action */
.entry button:not(.quiet), .hire { color: #2a1a05; font-weight: 700; border: 1px solid #f5c560;
  background: linear-gradient(180deg, #ffe08f, #e8b04e); box-shadow: 0 2px 10px rgba(224, 169, 74, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.entry button:not(.quiet):hover:not(:disabled), .hire:hover { background: linear-gradient(180deg, #ffe7a6, #f0bb5a); }
.quiet { border-color: var(--gold-line); }
.entry .days label { border-color: var(--gold-line); }
.month-nav .nav { border-color: var(--gold-line); }
:is(.card, .page) .share { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.toast { border-color: var(--gold-line); }
.toast button { color: #2a1a05; background: linear-gradient(180deg, #ffe08f, #e8b04e); border-color: #f5c560; }
.hud .managers button { border-color: var(--gold-line); }
/* captain page header: clean white, gold title */
.page-bar .back { border-color: #d9c18a; }

/* ══ Chart room: navy, slate and brass. Squarer, bolder, no pastel. (overrides the softer styles above) ══ */
:root {
  --navy: #0e2230; --slate: #16303f; --slate-2: #1d3b4c; --steel: #3a5666; --steel-2: #5d7b8a;
  --brass: #c9a14a; --brass-hi: #e2bd62; --brass-dk: #8f6c25; --ivory: #ece4d4; --iron: #9fb2bb;
}
.card { background: var(--slate); border: 1px solid var(--steel); border-top: 3px solid var(--brass); border-radius: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); }
.card h2 { color: var(--ivory); text-shadow: none; letter-spacing: 0.08em; }
:is(.card, .page) .district-name { color: var(--brass); font-weight: 600; letter-spacing: 0.14em; }
:is(.card, .page) .desc { color: var(--ivory); }
:is(.card, .page) .dim { color: var(--iron); }
:is(.card, .page) .sub-h { display: flex; align-items: center; gap: 0.6rem; color: var(--brass); font-family: Inter, sans-serif; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; margin-top: 1.2rem; }
:is(.card, .page) .sub-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--brass-dk), transparent); }

/* captain pages: a solid navy deck, a brass-ruled header */
.page { background: linear-gradient(180deg, var(--slate) 0%, var(--navy) 100%); }
.page-bar { background: var(--navy); border-bottom: 2px solid var(--brass); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45); }
.page-bar h1 { color: var(--ivory); text-shadow: none; text-transform: uppercase; letter-spacing: 0.14em; font-size: 1.35rem; }
.page-bar .sub { color: var(--brass); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.72rem; }
.page-bar .back { color: var(--ivory); background: transparent; border: 1px solid var(--steel-2); border-radius: 4px; font-weight: 700; letter-spacing: 0.04em; }
.page-bar .back:hover { border-color: var(--brass); color: var(--brass-hi); background: rgba(201, 161, 74, 0.08); }
.page-bar .sail-dot { box-shadow: 0 0 0 2px var(--navy), 0 0 0 3px var(--brass); }
.page-bar .pill { border-radius: 3px; }

/* rows: flat slate plates; done ones get a brass edge */
:is(.card, .page) :is(.notices li, .checklist .task, .crew-row, .stat-row > div, .cal-day, .song) { background: var(--slate-2); border: 1px solid var(--steel); border-radius: 4px; }
.checklist .task { border-left: 3px solid var(--steel); }
.checklist .task.done { background: var(--slate-2); border-color: var(--steel); border-left-color: var(--brass); }
.checklist .done span { color: var(--iron); }
.crew-row.aboard { border-left: 3px solid var(--brass); }
.crew-row.open { border-color: var(--brass); }
.hist-day { border-radius: 3px; border: 1px solid var(--steel); background: color-mix(in srgb, var(--brass) calc(var(--p) * 85%), var(--slate-2)); color: var(--ivory); }
.hist-day.today { border-color: var(--brass-hi); box-shadow: inset 0 0 0 1px var(--brass-hi); }
.day-bar { height: 5px; border-radius: 0; background: var(--steel); }
.day-bar i { background: var(--brass); }
.cal-dow { color: var(--brass); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.65rem; }

/* fields: dark wells with steel rims; brass when in use */
:is(.card, .page) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), select, textarea) { background: var(--navy); border: 1px solid var(--steel); border-radius: 4px; color: var(--ivory); }
:is(.card, .page) :is(input, select, textarea):hover { border-color: var(--steel-2); }
:is(.card, .page) :is(input, select, textarea):focus { border-color: var(--brass); background: var(--navy); box-shadow: 0 0 0 2px rgba(201, 161, 74, 0.25); }
:is(.card, .page) ::placeholder { color: #6f8794; }
:is(.card, .page) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c9a14a' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E"); }
:is(.card, .page) select option { background: var(--navy); }
:is(.card, .page) .entry label.small { color: var(--brass); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.65rem; }
:is(.card, .page) :is(input[type=checkbox], input[type=radio]) { border: 2px solid var(--steel-2); border-radius: 3px; background: var(--navy); }
:is(.card, .page) input[type=radio] { border-radius: 50%; }
:is(.card, .page) input[type=checkbox]:checked { background-color: var(--brass); border-color: var(--brass); }
:is(.card, .page) input[type=radio]:checked { background: var(--brass); border-color: var(--brass); box-shadow: inset 0 0 0 3px var(--navy); }

/* buttons: solid brass, square, lettered */
.entry button:not(.quiet), .hire, .toast button { color: var(--on-accent); background: var(--brass); border: 1px solid var(--brass-hi); border-radius: 4px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 800; }
.entry button:not(.quiet):hover:not(:disabled), .hire:hover, .toast button:hover { background: var(--brass-hi); }
.quiet { border-radius: 4px; border: 1px solid var(--steel-2); color: var(--ivory); background: transparent; }
.quiet:hover { border-color: var(--brass); color: var(--brass-hi); }
:is(.card, .page) .chip { border-radius: 3px; background: var(--slate-2); border: 1px solid var(--steel); color: var(--ivory); }
:is(.card, .page) .chip.on { background: var(--brass); border-color: var(--brass-hi); color: var(--on-accent); font-weight: 700; }
.entry .days label { border-radius: 3px; border: 1px solid var(--steel); background: var(--navy); color: var(--iron); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; }
.entry .days label:has(input:checked) { background: var(--brass); color: var(--on-accent); border-color: var(--brass-hi); }
.month-nav .nav { border-radius: 4px; border: 1px solid var(--steel-2); background: transparent; color: var(--brass); }
.month-nav b { letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; }
:is(.card, .page) details.edit summary, :is(.card, .page) .notices a { color: var(--brass-hi); }
:is(.card, .page) .share { background: rgba(201, 161, 74, 0.08); border: 1px solid var(--brass-dk); border-left: 3px solid var(--brass); border-radius: 4px; color: var(--ivory); }
:is(.card, .page) .ledger th { color: var(--brass); }
.pill { border-radius: 3px; }
.toast { background: var(--navy); border: 1px solid var(--steel); border-top: 2px solid var(--brass); border-radius: 4px; }
.hud .lock { border-color: var(--steel-2); }
/* page forms: the action is a compact button at the right, not a slab */
.page .entry > button:not(.quiet) { justify-self: end; width: auto; min-width: 9rem; padding: 0 1.4rem; }
/* the page's footer: what the captain is, and a quiet way to dismiss it */
.page-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 0.9rem; border-top: 1px solid var(--steel); color: var(--iron); font-size: 0.75rem; }
.page-foot .dismiss, .crew-actions .dismiss { font: inherit; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--iron); background: none; border: 0; padding: 0.3rem 0; cursor: pointer; }
.page-foot .dismiss:hover, .crew-actions .dismiss:hover { color: #e07a6a; background: none; }   /* (not the menu buttons' blue hover) */
.crew-actions .dismiss { margin-left: auto; }   /* the Captains menu: Open on the left, Dismiss captain on the right, as on the captain's page */
/* the top bar keeps its pale, see-through, round buttons */
.hud .managers button { border-radius: 19px; border: 1px solid color-mix(in srgb, var(--glow) 30%, transparent); background: color-mix(in srgb, var(--glow) 8%, transparent); color: var(--pearl);
  text-transform: none; letter-spacing: normal; font-size: 0.85rem; font-weight: 600; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hud .managers button:hover { background: color-mix(in srgb, var(--glow) 18%, transparent); border-color: color-mix(in srgb, var(--glow) 45%, transparent); color: var(--pearl); }
.hud .lock { border-radius: 50%; border: 1px solid color-mix(in srgb, var(--glow) 25%, transparent); background: color-mix(in srgb, var(--glow) 8%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hud .lock:hover { background: color-mix(in srgb, var(--glow) 18%, transparent); }
.entry button:not(.quiet), .hire, .toast button { box-shadow: inset 0 -1px 0 var(--brass-dk); }
.hire { box-shadow: none; }
/* the Settings menu: one setting per row */
.settings { border: 1px solid var(--steel); border-radius: 4px; background: var(--slate-2); margin-bottom: 0.4rem; }
.set-row { display: grid; align-items: center; gap: 0.4rem 0.8rem; padding: 0.7rem 0.8rem; }
.set-row + .set-row { border-top: 1px solid var(--steel); }
.set-label { display: grid; gap: 0.1rem; min-width: 0; }
.set-label b { color: var(--ivory); font-size: 0.88rem; font-weight: 600; }
.set-label span { color: var(--iron); font-size: 0.72rem; }
.set-control { display: flex; align-items: center; justify-content: flex-end; }
.set-control select { min-height: 2.2rem !important; padding-top: 0.35rem !important; padding-bottom: 0.35rem !important; font-size: 0.82rem !important; }
.set-body { grid-column: 1 / -1; }
.set-body .entry { margin: 0.3rem 0 0.1rem; }
.set-value { color: var(--iron); font-size: 0.78rem; }
.inline-form { display: flex; gap: 0.4rem; align-items: center; }
.inline-form input { width: 11rem; min-height: 2.2rem !important; padding-top: 0.35rem !important; padding-bottom: 0.35rem !important; }
.quiet.small { padding: 0.35rem 0.8rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.danger-zone { margin-top: 1.2rem; border-color: rgba(224, 122, 106, 0.45); border-left: 3px solid var(--warn); }
.danger-zone .set-label b { color: var(--warn-soft); }
.entry button.danger { background: #a8473c; border-color: var(--warn); color: #fff; box-shadow: none; }
.entry button.danger:hover:not(:disabled) { background: #bf5145; }
.check-row { flex-direction: row !important; align-items: center !important; gap: 0.5rem !important; text-transform: none !important; letter-spacing: normal !important; font-size: 0.78rem !important; color: var(--ivory) !important; }
.crew-search { width: 100%; margin: 0.2rem 0 0.4rem; padding-left: 2.3rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c9a14a' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: 0.8rem center !important; }
.crew-search::-webkit-search-cancel-button { filter: sepia(1) saturate(3) hue-rotate(5deg); cursor: pointer; }
.crew-group[hidden], .crew-row[hidden] { display: none !important; }
/* forms inside a settings row fit the row */
.set-row { grid-template-columns: minmax(0, 1fr) auto; }
.set-body { min-width: 0; }
.set-body .entry { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.entry label.small > :is(input, select) { width: 100%; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; }
.form-actions button { grid-column: auto; width: auto; min-width: 7rem; padding: 0 1.2rem; }
.form-actions .quiet.small { min-width: 0; min-height: 2.6rem; }
.set-body .entry > button:not(.quiet) { justify-self: end; width: auto; min-width: 9rem; padding: 0 1.2rem; }
#toggle-sound .mute { display: none; }
#toggle-sound.muted .wave { display: none; }
#toggle-sound.muted .mute { display: inline; }
/* labels: small until pointed at (or their building or ship is), then full size */
@property --s { syntax: "<number>"; inherits: false; initial-value: 1; }
.tag { --s: 0.6; transform-origin: 50% 100%; transition: --s 0.15s ease-out; }
.tag.district, .tag.capital { --s: 0.75; }
.tag.project, .tag.citizen { pointer-events: auto; cursor: pointer; }
.tag.project:hover, .tag.citizen:hover, .tag.active { --s: 1; z-index: 3; }

/* the First Mate: TODO rows that open in place */
.todos { list-style: none; display: grid; gap: 0.4rem; margin-bottom: 0.9rem; }
.todo { background: var(--slate-2); border: 1px solid var(--steel); border-left: 3px solid var(--steel); border-radius: 4px; }
.todo.starred { border-left-color: var(--brass); }
.todo.open { border-color: var(--brass); }
.todo-head { display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.7rem; min-height: 2.9rem; }
.todo-title { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.6rem; font: inherit; font-size: 0.9rem; color: var(--ivory); background: none; border: 0; padding: 0.15rem 0; text-align: left; cursor: pointer; }
.todo-title.static { cursor: default; }
.todo-title > span:first-child { overflow-wrap: anywhere; }
.tchips { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.tchip { font-size: 0.68rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: 3px; background: var(--navy); border: 1px solid var(--steel); color: var(--iron); white-space: nowrap; }
.tchip.late { color: var(--warn-soft); border-color: rgba(224, 122, 106, 0.6); }
.tchip.link { color: var(--brass-hi); border-color: var(--brass-dk); }
.star { font-size: 1.05rem; line-height: 1; color: var(--steel-2); background: none; border: 0; cursor: pointer; padding: 0.2rem; }
.star:hover { color: var(--brass-hi); }
.star.on { color: var(--brass); }
.todo-detail { padding: 0.2rem 0.9rem 0.8rem; border-top: 1px solid var(--steel); display: grid; gap: 0.8rem; }
.todo-detail .entry { margin: 0.6rem 0 0; }
.part-h { display: block; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); margin-bottom: 0.4rem; }
.subtasks { list-style: none; display: grid; gap: 0.25rem; margin-bottom: 0.45rem; }
.subtasks li { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.5rem; border-radius: 3px; background: var(--navy); }
.subtasks label { flex: 1; display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; cursor: pointer; }
.subtasks li.done span { text-decoration: line-through; color: var(--iron); }
.subtasks .task-x { opacity: 0.6; }
.chip-x { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 0.25rem; opacity: 0.7; }
.chip-x:hover { opacity: 1; color: var(--warn-soft); }
.todo-part select { min-height: 2.2rem !important; font-size: 0.82rem !important; padding-top: 0.3rem !important; padding-bottom: 0.3rem !important; }
.todo-foot { display: flex; justify-content: flex-end; }
.dismiss-link { font: inherit; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--iron); background: none; border: 0; cursor: pointer; padding: 0.2rem 0; }
.dismiss-link:hover { color: #e07a6a; }
.inline-form.wide { margin-top: 0.4rem; }
.inline-form.wide input { flex: 1; width: auto; }
.todos.compact .todo-head { min-height: 2.4rem; padding: 0.35rem 0.6rem; }

/* ── shared rows for every captain: a row that opens in place (the First Mate's look, under general names) ── */
.rows { list-style: none; display: grid; gap: 0.4rem; margin-bottom: 0.9rem; }
.row { background: var(--slate-2); border: 1px solid var(--steel); border-left: 3px solid var(--steel); border-radius: 4px; }
.row.accent { border-left-color: var(--brass); }
.row.warn { border-left-color: var(--warn); }
.row.good { border-left-color: #5ba37c; }
.row.open { border-color: var(--brass); }
.row-head { display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.7rem; min-height: 2.9rem; }
.row-title { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.6rem; font: inherit; font-size: 0.9rem; color: var(--ivory); background: none; border: 0; padding: 0.15rem 0; text-align: left; cursor: pointer; }
.row-title.static { cursor: default; }
.row-title > span:first-child { overflow-wrap: anywhere; }
.row-side { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; color: var(--ivory); font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.row-side.in { color: #8fd6a8; } .row-side.out { color: var(--warn-soft); }
.row-detail { padding: 0.2rem 0.9rem 0.8rem; border-top: 1px solid var(--steel); display: grid; gap: 0.8rem; }
.row-detail .entry { margin: 0.6rem 0 0; }
.row-foot { display: flex; justify-content: flex-end; gap: 1rem; }
.panel { background: var(--slate-2); border: 1px solid var(--steel); border-radius: 4px; padding: 0.8rem 0.9rem; margin-bottom: 0.9rem; }
.panel.brass { border-left: 3px solid var(--brass); }
.inline-form { flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1 1 8rem; width: auto; }
.inline-form .narrow { flex: 0 1 7rem; }
.add-bar { display: flex; gap: 0.45rem; margin-bottom: 1rem; flex-wrap: wrap; }
.add-bar > :is(input, select) { flex: 1 1 9rem; min-width: 0; }
.add-bar > .narrow { flex: 0 1 7.5rem; }
.add-bar > button { flex: none; min-height: 2.6rem; padding: 0 1.2rem; border-radius: 4px; font: inherit; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-accent); background: var(--brass); border: 1px solid var(--brass-hi); box-shadow: inset 0 -1px 0 var(--brass-dk); cursor: pointer; }
.add-bar > button:hover { background: var(--brass-hi); }
/* the Chef */
.week-row { flex-wrap: wrap; gap: 0.5rem 1rem; }
.day-name { color: var(--ivory); font-size: 0.85rem; }
.meal-slots { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; min-width: 16rem; }
.meal-slot { display: grid; gap: 0.15rem; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); }
.meal-slot select { min-height: 2.1rem !important; padding: 0.25rem 1.8rem 0.25rem 0.5rem !important; font-size: 0.8rem !important; text-transform: none; letter-spacing: normal; font-weight: 400; }
.panel.shop { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel.shop > div { display: grid; gap: 0.15rem; }
.panel.shop b { color: var(--ivory); }
.ingredients { list-style: none; margin: 0; display: grid; gap: 0.2rem; font-size: 0.85rem; }
/* ledgers */
.budget-bar { flex: 1 1 6rem; max-width: 12rem; height: 7px; border-radius: 0; background: var(--navy); overflow: hidden; display: block; }
.budget-bar i { display: block; height: 100%; background: #5ba37c; }
.budget-bar.over i { background: var(--warn); }
.row-head .hire { padding: 0.3rem 0.8rem; }
:is(.card, .page) .gain { color: #8fd6a8; } :is(.card, .page) .loss { color: var(--warn-soft); }
.stat-row b { font-size: 1.25rem; }
.inline-form label.small { display: grid; gap: 0.25rem; flex: 1 1 10rem; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); }
.inline-form label.small > :is(input, select) { width: 100%; text-transform: none; letter-spacing: normal; font-weight: 400; }
.inline-form:has(label.small) { align-items: flex-end; }
.row-snippet { padding: 0 0.9rem 0.6rem 0.7rem; margin-top: -0.25rem; color: var(--iron); font-size: 0.8rem; }
.journal-text { white-space: pre-wrap; line-height: 1.6; color: var(--ivory); font-size: 0.9rem; }
/* the Cartographer */
button.cal-day { font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.cal-day:hover { border-color: var(--steel-2); }
.cal-day.picked { border-color: var(--brass) !important; box-shadow: inset 0 0 0 1px var(--brass); }
.row-head .when { flex: none; width: 5.2rem; color: var(--brass); font-size: 0.78rem; font-weight: 700; }
a.row-title { text-decoration: none; }
.sub-h.today-h { color: var(--brass-hi); }
.row-side.quiet-side { font-weight: 400; font-size: 0.75rem; color: var(--iron); }
.panel.checkout { display: grid; gap: 0.5rem; }
.panel.checkout > b { color: var(--ivory); letter-spacing: 0.04em; }
.panel.checkout .form-actions { justify-content: flex-start; }
.row.past { opacity: 0.55; }
.day-name { display: grid; gap: 0.05rem; width: 7.5rem; }
/* the Chandler's staples: a main feature, one tap each */
.staples { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.4rem; }
.staple { display: inline-flex; align-items: stretch; border: 1px solid var(--steel); border-radius: 4px; background: var(--slate-2); overflow: hidden; }
.staple > button { font: inherit; font-size: 0.82rem; color: var(--ivory); background: none; border: 0; cursor: pointer; padding: 0.4rem 0.65rem; }
.staple > button:first-child:hover { background: rgba(201, 161, 74, 0.12); }
.staple.on { border-color: var(--brass-hi); background: var(--brass); }
.staple.on > button { color: var(--on-accent); font-weight: 700; }
.staple .staple-x { padding: 0.4rem 0.5rem; color: var(--iron); border-left: 1px solid var(--steel); opacity: 0.7; }
.staple.on .staple-x { color: var(--on-accent); border-left-color: var(--brass-dk); }
.staple .staple-x:hover { opacity: 1; color: var(--warn-soft); }
.staple-new { display: inline-flex; border: 1px dashed var(--steel-2); border-radius: 4px; overflow: hidden; }
.staple-new input { border: 0 !important; background: transparent !important; min-height: 2.1rem !important; padding: 0.35rem 0.6rem !important; width: 9rem; font-size: 0.82rem !important; box-shadow: none !important; }
.staple-new button { font: inherit; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass-hi); background: none; border: 0; border-left: 1px dashed var(--steel-2); padding: 0 0.65rem; cursor: pointer; }
.staples-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.4rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.2rem; }
.section-head .sub-h { flex: 1; margin: 0 !important; }
.section-head .hire { flex: none; }
/* checkout: the total is the main field; "charge to" stays modest */
.checkout .inline-form label.grow2 { flex: 2 1 9rem; }
.checkout .inline-form label.grow1 { flex: 1 1 7rem; max-width: 11rem; }
.checkout .inline-form :is(input, select) { min-height: 2.5rem !important; height: 2.5rem; padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; font-size: 0.85rem !important; }
.checkout .inline-form .hire { height: 2.5rem; align-self: flex-end; }
.hire:disabled { opacity: 0.45; cursor: default; filter: grayscale(0.4); }
/* sending the grocery list */
.panel.send-list { display: grid; gap: 0.7rem; }
.panel.send-list > div:first-child { display: grid; gap: 0.15rem; }
.panel.send-list b { color: var(--ivory); }
.send-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quiet.send { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.95rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; text-decoration: none; color: var(--ivory); }
.quiet.send svg { color: var(--brass); flex: none; }
.quiet.send:hover svg { color: var(--brass-hi); }
.inline-form.grow { flex: 1; }
.inline-form.grow input { min-height: 2.2rem !important; padding-top: 0.3rem !important; padding-bottom: 0.3rem !important; }
.chip-count { opacity: 0.6; font-size: 0.75em; margin-left: 0.15rem; }
.staple.on .chip-count { opacity: 0.8; }
/* panels that stack a heading, a line and a form (the vault, imports, keys) */
.panel > b:first-child { display: block; color: var(--ivory); letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.panel.shop > div > b, .panel.send-list > div > b { margin-bottom: 0; }
.panel.vault, .panel.import { display: grid; gap: 0.7rem; }
.panel.vault > div:first-child, .panel.import > div:first-child { display: grid; gap: 0.15rem; }
.panel.vault .usage { margin-bottom: 0; }
.panel.import .inline-form { align-items: flex-end; }
.panel .inline-form + .dim, .panel > p.dim { margin-top: 0.45rem; }
.panel.shop .send-buttons { flex: none; }
/* a chip with two fields (the ledger's category rules), and a calendar's colour */
.staple-new.wide input { width: 10rem; }
.staple-new.wide input + input { width: 7rem; border-left: 1px dashed var(--steel-2) !important; }
.staple-new .swatch { width: 2.4rem !important; padding: 0.2rem !important; border-left: 1px dashed var(--steel-2) !important; cursor: pointer; }
.staple .sail-dot { display: inline-block; width: 9px; height: 9px; vertical-align: 0.05em; margin-right: 0.2rem; box-shadow: none; }   /* a calendar's colour, as a small round dot */
/* the month switcher beside a section heading */
.month-nav.inline { margin: 0; gap: 0.5rem; }
.month-nav.inline b { font-size: 0.82rem; min-width: 8.5rem; text-align: center; }
/* the daily bell: the captains' rows, a little tighter */
.bell-rows { gap: 0.3rem; max-height: 34vh; overflow: auto; }
.bell-rows .row-head { min-height: 2.5rem; padding: 0.35rem 0.65rem; }
.bell-rows .when { flex: none; width: 5.6rem; color: var(--iron); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }
.bell-rows a.row-title { color: var(--ivory); font-size: 0.88rem; }
.bell-rows a.row-title:hover span:first-child { text-decoration: underline; }
/* the open list of a dropdown, where the browser lets us draw it (Chrome and Edge; others keep their own) */
@supports (appearance: base-select) {
  :is(.card, .page) select, :is(.card, .page) select::picker(select) { appearance: base-select; }
  :is(.card, .page) select { background-image: none !important; font-weight: 400 !important; letter-spacing: normal !important; text-transform: none; }
  :is(.card, .page) select::picker-icon { color: var(--brass); font-size: 0.75rem; transition: rotate 0.15s; }   /* the browser's arrow, in brass */
  :is(.card, .page) select:open::picker-icon { rotate: 180deg; }
  :is(.card, .page) select::picker-icon { flex-shrink: 0; }
  :is(.card, .page) select::picker(select) { background: var(--slate-2); border: 1px solid var(--brass-dk); border-radius: 4px; padding: 0.25rem;
    margin-top: 3px; max-height: 18rem; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); }
  :is(.card, .page) select option { background: transparent; color: var(--ivory); padding: 0.45rem 0.7rem; border-radius: 3px; font-size: 0.85rem; font-weight: 400; letter-spacing: normal; text-transform: none; cursor: pointer; }
  :is(.card, .page) select option:is(:hover, :focus-visible) { background: rgba(201, 161, 74, 0.16); color: var(--brass-hi); outline: none; }
  :is(.card, .page) select option:checked { color: var(--brass-hi); font-weight: 600; }
  :is(.card, .page) select option::checkmark { color: var(--brass); }
  :is(.card, .page) select option[value=""]:not(:checked) { color: var(--iron); }
}
/* the popups' one-line add: the field, a dropdown and Add all the same height */
.inline-form.wide > :is(input, select, button) { height: 2.2rem; min-height: 2.2rem !important; box-sizing: border-box; }
.inline-form.wide > :is(input, select) { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; font-size: 0.85rem !important; }
.inline-form.wide > select.narrow { flex: 0 1 7.5rem; }
.inline-form.wide > select { align-items: center; }
/* a one-line form's button stands as tall as its field (ingredients, subtasks) */
.inline-form:not(:has(label)) > :is(input, button) { height: 2.2rem; min-height: 2.2rem !important; box-sizing: border-box; }
:is(.card, .page) .inline-form:not(:has(label)) > button { padding: 0 1.1rem; margin: 0; }
/* asking before something is deleted for good (the Vault's files) */
.confirm-inline { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.confirm-inline .dim.small { margin: 0; }
:is(.card, .page) .confirm-inline > button { margin: 0; }
.hire.danger { background: #a8473c; border-color: var(--warn); color: #fff; box-shadow: none; }
.hire.danger:hover { background: #bf5145; }
/* the Lamplighter's today: rows with a tick box per time */
.lamplighter-today .ticks { display: inline-flex; gap: 0.3rem; flex: none; }
.lamplighter-today input[type=checkbox] { width: 1.3rem; height: 1.3rem; }
/* what's typed in a labelled field is plain text, not the label's bold capitals */
:is(.card, .page) label.small > :is(input, textarea, select) { font-weight: 400 !important; letter-spacing: normal !important; text-transform: none !important; }
:is(.card, .page) label.small > :is(input, textarea)::placeholder { font-weight: 400; }
/* the Lamplighter: names line up whether a task has one tick box or several */
.lamplighter-today .ticks { min-width: calc(var(--ticks, 1) * 1.3rem + (var(--ticks, 1) - 1) * 0.3rem); }
/* the popups' quick add: the list dropdown stays modest so the field keeps its room */
.card .inline-form.wide > select.narrow { flex: 0 1 6.2rem; min-width: 5.5rem; }
.card .inline-form.wide > input { min-width: 7rem; }
/* choosing a file: an outlined, squared button like the rest */
:is(.card, .page) input[type=file]::file-selector-button { border-radius: 4px; border: 1px solid var(--steel-2); background: transparent; color: var(--ivory); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em; padding: 0.45rem 0.9rem; cursor: pointer; }
:is(.card, .page) input[type=file]::file-selector-button:hover { border-color: var(--brass); color: var(--brass-hi); }
/* while a reload checks whether you're still signed in, the sign-in box is empty: don't draw it */
.gate-box:empty { display: none; }
/* arriving: the city's labels, menus and cards wait for the camera, then fade in */
:is(#hud, #controls, #credit, #labels, #card) { transition: opacity 0.8s ease; }
body.arriving :is(#hud, #controls, #credit, #labels, #card) { opacity: 0; pointer-events: none; }
/* a dropdown's chosen value sits in the middle of its box (e.g. the Chandler's "Charge to") */
:is(.card, .page) select { align-items: center; }
/* facts about a row as quiet grey text, not boxes ("due the 5th · 24% APR"); late ones stay red */
.tchips.facts { gap: 0; }
.tchips.facts .tchip { border: 0; background: none; padding: 0; border-radius: 0; font-size: 0.78rem; font-weight: 400; color: var(--iron); }
.tchips.facts .tchip + .tchip::before { content: "·"; margin: 0 0.4rem; color: var(--steel-2); }
.tchips.facts .tchip.late { color: var(--warn-soft); }
.tchips.facts .tchip.link { color: var(--brass-hi); }
/* opening straight onto a captain's page: no sea or sign-in veil showing before the page is up */
html.opening-page body { background: var(--navy); }
html.opening-page canvas, html.opening-page #gate { visibility: hidden; }
/* quiet facts sit at the right of the row, like the Lamplighter's and the Chef's */
.row-title .tchips.facts { margin-left: auto; justify-content: flex-end; text-align: right; }
/* a captain's popup: "Open … →" runs the full width of the card */
.card-foot { display: block; }
.card-foot > .hire { display: block; width: 100%; text-align: center; box-sizing: border-box; }
/* a message's reply and mark-read buttons, the same height side by side */
.reply-actions > :is(.hire, .quiet.small) { display: inline-flex; align-items: center; height: 2.3rem; min-height: 2.3rem !important; padding: 0 1rem; margin: 0; box-sizing: border-box; }
/* a message's preview line is part of what you click to open it */
button.row-snippet { display: block; width: 100%; font: inherit; font-size: 0.8rem; text-align: left; background: none; border: 0; cursor: pointer; }
.row.clickable { cursor: pointer; }
/* the Shantyman's docked player: plays on through every page and the city */
.music-dock { position: fixed; left: 16px; bottom: 16px; z-index: 55; width: 300px; background: var(--slate-2); border: 1px solid var(--brass-dk); border-radius: 4px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); overflow: hidden; }
.music-dock[hidden] { display: none; }
.music-dock iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.music-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.45rem 0.6rem; font-size: 0.8rem; color: var(--ivory); }
.music-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* phones: a compact player above the round controls, the video square (at YouTube's smallest, 200 × 200) beside the song */
@media (max-width: 700px), (max-height: 500px) {
  .music-dock { left: 12px; right: auto; width: min(320px, calc(100vw - 24px)); bottom: calc(0.9rem + 48px); display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: stretch; }   /* a fixed size: dragging moves it, never stretches it */
  .music-dock iframe { width: 200px; height: 200px; aspect-ratio: auto; }   /* square: YouTube's smallest player, 200 × 200 */
  .music-bar { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.35rem; padding: 0.4rem 0.55rem; }
  .music-bar > span:not(.music-grip):not(.music-buttons) { max-width: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
}
/* a live search box (filters as you type, like the Captains menu) */
:is(.card, .page) .filter-input { width: 100%; margin-bottom: 0.5rem; }
/* a captain in the Captains menu: Open and Dismiss the same height side by side */
.crew-actions > :is(.hire, .quiet.small) { display: inline-flex; align-items: center; justify-content: center; height: 2.3rem; min-height: 2.3rem !important; padding: 0 1rem; margin: 0; box-sizing: border-box; }
/* Shantyman: songs whose genre is out of the shuffle are dimmed; the docked player's Next and Stop */
.songs .song.off { opacity: 0.5; }
.songs .song > .quiet.small, .songs .song > .dim.small { flex: none; white-space: nowrap; }
.music-buttons { display: flex; gap: 0.35rem; flex: none; }
.music-buttons .quiet.small { margin: 0; min-height: 0; padding: 0.25rem 0.6rem; }
.song { grid-template-columns: 96px minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: auto; }   /* picture, name, then its buttons (+ Queue or its place, Send, ×) on the same row, however many */
/* a captain's page: the world's name, as it reads over the city, takes you back to the city */
.page-bar .back.logo-back { padding: 0.2rem 0.1rem; border: 0; border-radius: 0; background: none; flex: none;
  font-family: 'Cinzel', Georgia, serif; font-weight: 800; letter-spacing: 0.22em; font-size: 1.25rem; color: var(--ivory); text-shadow: 0 0 14px color-mix(in srgb, var(--glow) 35%, transparent); }
.page-bar .back.logo-back:hover { background: none; color: var(--brass-hi); }
/* the trident, pointing back, before the world's name */
.page-bar .back.logo-back { display: inline-flex; align-items: center; gap: 0.6rem; }
.page-bar .back.logo-back .trident-back { flex: none; color: var(--brass); transition: transform 0.15s; }
.page-bar .back.logo-back:hover .trident-back { transform: translateX(-3px); color: var(--brass-hi); }
/* a tick-box setting in a form: the box, then the sentence, in plain text across the form */
:is(.card, .page) .entry label.check-row { grid-column: 1 / -1; display: flex; flex-direction: row; align-items: center; gap: 0.55rem; margin: 0.2rem 0 0;
  font-size: 0.85rem; font-weight: 400; letter-spacing: normal; text-transform: none; color: var(--ivory); cursor: pointer; }
:is(.card, .page) .entry label.check-row > input[type=checkbox] { flex: none; width: 1.1rem; height: 1.1rem; margin: 0; }
/* the guide (? at the top) */
.guide-part { margin-bottom: 0.4rem; }
.guide-part p { font-size: 0.86rem; line-height: 1.5; color: var(--ivory); margin: 0.1rem 0 0.25rem; }
.guide-part > a.quiet { margin-top: 0.15rem; }
.thumb .no-pic { display: grid; place-items: center; width: 96px; height: 54px; background: var(--navy); color: var(--brass); font-size: 1.2rem; }
/* a song's station: a quiet picker at the start of its details line, read like text with a small arrow */
:is(.card, .page) :is(.song, .recipe-book) select.song-genre { display: inline; width: auto; min-height: 0 !important; padding: 0 0.95rem 0 0 !important; margin: 0;
  font-size: inherit !important; color: var(--brass); background-color: transparent !important; border: 0 !important; border-radius: 0; box-shadow: none !important;
  background-position: right 0 center; background-size: 0.55rem auto; vertical-align: baseline; }
:is(.card, .page) :is(.song, .recipe-book) select.song-genre:hover { color: var(--brass-hi, var(--gold)); }
:is(.card, .page) :is(.song, .recipe-book) select.song-genre:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }
/* where the browser draws the arrow itself: name then arrow on one line, the arrow just after the name, and it stays put */
@supports (appearance: base-select) {
  :is(.card, .page) :is(.song, .recipe-book) select.song-genre { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0 !important; vertical-align: baseline; }
  :is(.card, .page) :is(.song, .recipe-book) select.song-genre::picker-icon { order: 2; font-size: 0.65rem; }
  :is(.card, .page) :is(.song, .recipe-book) select.song-genre:open::picker-icon { rotate: none; }
}
:is(.card, .page) .sub-h .small { margin-top: 0; }            /* a heading's count sits level with its words */
.staple > button .chip-count { margin-left: 0.3rem; vertical-align: 0.09em; }   /* the smaller number, centred on the name's capitals */
.month-pick { display: flex; gap: 0.4rem; }
:is(.card, .page) .month-pick select { width: auto; min-height: 2rem !important; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; font-size: 0.85rem !important; }
.month-nav.picker { justify-content: flex-end; gap: 0.4rem; }   /* ‹ on the left; the dropdowns and › together on the right */
.month-nav.picker > .nav:first-child { margin-right: auto; }
.row-now { color: var(--iron); font-size: 0.8rem; font-weight: 400; margin-left: 0.5rem; }   /* Stormwatch: what it's like now, in Today's row */
.month-nav.picker .quiet.small { height: 2rem; padding: 0 0.9rem; font-size: 0.8rem; margin: 0; }   /* the Cartographer's Today, as tall as the dropdowns beside it */
.task-x.x-slot { visibility: hidden; pointer-events: none; }   /* holds the ×'s place on a row that has none, so facts line up */
.quiet-side .late { color: var(--warn-soft); }   /* a fact that's overdue, in a row's quiet facts */
/* the Pilot's payoff planner: like Check out, a title, then fields and the button the same height, lined up along the bottom */
.panel.planner { display: grid; gap: 0.5rem; }
.panel.planner > b { color: var(--ivory); letter-spacing: 0.04em; }
.planner .inline-form { align-items: flex-end; }
.planner .inline-form label.grow1 { flex: 1 1 7rem; max-width: 11rem; }
.planner .inline-form label.grow2 { flex: 2 1 12rem; }
.planner .inline-form :is(input, select) { min-height: 2.5rem !important; height: 2.5rem; padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; font-size: 0.85rem !important; }
.planner .inline-form .hire { height: 2.5rem; align-self: flex-end; flex: none; }
.planner .desc { margin: 0.2rem 0 0; }
/* a list shown a page at a time: ‹ Page 1 of 3 ›, under the list */
.pager { display: flex; align-items: center; justify-content: center; gap: 0.8rem; margin: 0.2rem 0 1rem; }
.pager .nav { width: 2rem; height: 2rem; border-radius: 4px; border: 1px solid var(--steel-2); background: transparent; color: var(--brass); font: inherit; font-size: 1.2rem; cursor: pointer; }
.pager .nav:disabled { opacity: 0.3; cursor: default; }
/* buttons and small text on a row's line sit level: no stray margin from .small, and the buttons one height (the Chaplain's Kept and Slip) */
:is(.card, .page) .row-head .small { margin-top: 0; }
.row-head > :is(.hire, .quiet.small) { height: 2rem; display: inline-flex; align-items: center; margin: 0; box-sizing: border-box; }
/* the Purser's quick add in its popup: in or out, amount, category on one line; what for and Record on the next */
.quick-money { display: grid; grid-template-columns: 5rem 1fr 1.4fr; gap: 0.4rem; margin-top: 0.5rem; }
.quick-money .cat-pick { display: flex; gap: 0.4rem; min-width: 0; }
.quick-money .cat-pick > * { flex: 1; min-width: 0; }
.quick-money input[name=note] { grid-column: 1 / 3; }
.quick-money > :is(input, select), .quick-money .cat-pick > * { height: 2.2rem; min-height: 2.2rem !important; box-sizing: border-box; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; font-size: 0.85rem !important; width: 100%; }
:is(.card, .page) .quick-money > button { margin: 0; height: 2.2rem; min-height: 2.2rem; width: 100%; padding: 0 1rem; box-sizing: border-box; align-self: stretch; }   /* the same size as the category box above it and level with "What for" (outranks the .small margin) */

/* ── Phones (narrower than 700px): one set of rules, so every captain behaves the same on a small screen ──
   Desktop is untouched. Pickers wrap onto two lines; a row keeps its title, value and buttons on the first line and
   moves its quiet facts to a second line; forms and chips wrap rather than squeeze. */
@media (max-width: 700px) {
  /* month and day pickers: ‹ (Today) › on the first line, the dropdowns sharing the second */
  .month-nav.picker { flex-wrap: wrap; row-gap: 0.45rem; }
  .month-nav.picker > .nav:last-child { order: 2; }
  .month-nav.picker > .quiet.small { order: 1; }
  .month-nav.picker .month-pick { order: 3; flex: 1 1 100%; }
  .month-nav.picker .month-pick select { flex: 1 1 0; min-width: 0; }
  /* a heading with its picker beside it (the Purser's Entries): the picker goes under the heading */
  .section-head { flex-wrap: wrap; row-gap: 0.4rem; }
  .section-head > .month-nav.picker { flex: 1 1 100%; }

  /* rows: title, value and buttons on the first line; the quiet facts on a line of their own under the title */
  .row-head { flex-wrap: wrap; row-gap: 0.15rem; }
  .row-head > .row-title { flex: 1 1 0; min-width: 6rem; }
  .row-head > .quiet-side { order: 10; flex: 1 1 100%; text-align: left; margin: 0; white-space: normal; }
  .row-head:has(> input[type=checkbox]) > .quiet-side { padding-left: 1.8rem; }      /* past a tick box */
  .row-head > .x-slot { display: none; }                                             /* the facts no longer need lining up */
  .row-head .when { width: 4.4rem; }
  .row-head:has(> .when) > .quiet-side { padding-left: calc(4.4rem + 0.55rem); }   /* under the title, past the time or date */
  .row-head > .budget-bar { flex: 0 1 3.5rem; }                                      /* the Timekeeper's bar: shorter */
  .row-now { display: block; margin: 0.1rem 0 0; }                                   /* Stormwatch: "Now: …" under Today */

  /* the Shantyman's songs: a smaller picture */
  .song { grid-template-columns: 64px minmax(0, 1fr); }
  .thumb, .thumb .no-pic { width: 64px; height: 36px; }

  /* chips and their "+ New …" forms wrap; a new-chip form takes the full width */
  .staple-new, .staple-new.wide { display: flex; flex: 1 1 100%; }
  .staple-new input, .staple-new.wide input { flex: 1 1 0; width: auto; min-width: 0; }

  /* the Purser's popup quick add: in or out and amount; then category; then what for; then Record, as wide as category */
  .quick-money { grid-template-columns: 5rem 1fr; }
  .quick-money .cat-pick, .quick-money input[name=note], :is(.card, .page) .quick-money > button { grid-column: 1 / -1; }

  /* panels with a sentence and a button (Shuffle, a timer, a calendar's delete): the button(s) under the sentence */
  .panel.shop { flex-wrap: wrap; }
  .panel.shop > .send-buttons, .panel.shop > .hire { flex: 1 1 100%; justify-content: flex-end; }

  /* the figures (in, out, left over; owed, paid off…): two to a line */
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ── Pieces added during the captain reviews ──
   Kept after the Phones rules on purpose: they refine the shared rules above for one captain or piece, and moving
   them up beside their family would change which rule wins. */
/* the Timekeeper's allocation (Hours, Every, Starting, then Give hours): like the Pilot's planner, the fields and the
   button the same height, lined up along the bottom */
.inline-form.allocation { align-items: flex-end; }
.inline-form.allocation :is(input, select) { min-height: 2.5rem !important; height: 2.5rem; padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; font-size: 0.85rem !important; }
:is(.card, .page) .inline-form.allocation > button { height: 2.5rem; margin: 0; flex: none; padding: 0 1.1rem; }
/* the Timekeeper's timer: Start, Cancel and Stop and log, the same size, side by side on the right of their panel */
.panel.timer .timer-buttons { display: flex; gap: 0.5rem; flex: none; }
:is(.card, .page) .panel.timer .timer-buttons > button { height: 2.4rem; min-width: 6.5rem; margin: 0; padding: 0 1.1rem; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 4px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
:is(.card, .page) .panel.timer .timer-buttons > .quiet { background: transparent; border: 1px solid var(--steel-2); color: var(--ivory); }
:is(.card, .page) .panel.timer .timer-buttons > .quiet:hover { border-color: var(--brass); color: var(--brass-hi); }
@media (max-width: 700px) { .panel.timer .timer-buttons { flex: 1 1 100%; justify-content: flex-end; } }
.card .panel.timer { flex-wrap: wrap; }   /* in the narrower popup, the buttons go under the sentence */
.card .panel.timer .timer-buttons { flex: 1 1 100%; justify-content: flex-end; }
/* the Timekeeper's open area: room above the log bar, and the timer's Start centred in its panel */
.row-detail > .add-bar[data-act=log] { margin-top: 0.8rem; }
.panel.timer { align-items: center; }
.panel.timer .timer-buttons { align-self: center; align-items: center; }
/* the Timekeeper's Billable tick, beside the button in a log bar or with ▶ Start */
form.timer-buttons { align-items: center; }
/* the Timekeeper's hourly rates: one compact line each, the rate box and Save on the right */
.row-head > .inline-form.rate { flex: none; gap: 0.35rem; }
.row-head > .inline-form.rate input { width: 6.5rem; flex: none; min-height: 2rem !important; height: 2rem; padding-top: 0.2rem !important; padding-bottom: 0.2rem !important; }
:is(.card, .page) .row-head > .inline-form.rate > button { height: 2rem; margin: 0; }
/* the Timekeeper's log bars: everything on one line (the Client box appearing shrinks the others rather than pushing
   the button to a new line); phones still wrap */
.add-bar.time-bar { flex-wrap: nowrap; }
.add-bar.time-bar > :is(input, select) { flex: 1 1 6rem; min-width: 0; }
.add-bar.time-bar > input[name=note] { flex: 2 1 8rem; }
.add-bar.time-bar > input[type=date] { flex: 0 1 8.5rem; }
.add-bar.time-bar > button { flex: none; }
@media (max-width: 700px) { .add-bar.time-bar { flex-wrap: wrap; } }
/* the Timekeeper's popup quick log: what for and hours; then For and Client (once there's a business); then Log */
.quick-log { display: grid; grid-template-columns: 1fr 6rem; gap: 0.4rem; margin-top: 0.5rem; }
.quick-log .for-pick { grid-column: 1 / -1; display: flex; gap: 0.4rem; min-width: 0; }
.quick-log .for-pick > * { flex: 1 1 0; min-width: 0; }
.quick-log > :is(input, select), .quick-log .for-pick select { height: 2.2rem; min-height: 2.2rem !important; box-sizing: border-box; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; font-size: 0.85rem !important; width: 100%; }
:is(.card, .page) .quick-log > button { grid-column: 1 / -1; height: 2.2rem; margin: 0; width: 100%; }
.form-actions.start { justify-content: flex-start; }   /* buttons that belong at the start of a line (the Sentinel's proof, the Courier's reply) */
.chip-count.late { color: var(--warn-soft); opacity: 1; font-weight: 800; }   /* a Tune in place with warnings or events there */
/* the Buildings menu: a building's live/status marker sits on the right, just left of its × */
.li-end { margin-left: auto; display: inline-flex; align-items: center; gap: 0.5rem; }
.li-end .pill { margin-left: 0; }
/* the books' add bar (the Merchant's has business and client too): one line, the fields sharing it, the button at the end */
.add-bar.money-bar { flex-wrap: nowrap; }
.add-bar.money-bar:has(> .bar-break) { flex-wrap: wrap; row-gap: 0.5rem; }   /* business and client: a second line, never squeezed */
.add-bar.money-bar > .bar-break { flex-basis: 100%; height: 0; }
.add-bar.money-bar > :is(input, select) { flex: 1 1 5rem; min-width: 0; }
.add-bar.money-bar > select { min-width: max-content; }                 /* a dropdown keeps room for its words and its arrow */
.add-bar.money-bar > input[name=note] { flex: 2 1 7rem; }
.add-bar.money-bar > input[type=date] { flex: 0 1 8.5rem; }
.add-bar.money-bar > .narrow { flex: 1 1 5rem; }
.add-bar.money-bar > button { flex: none; }
@media (max-width: 700px) { .add-bar.money-bar { flex-wrap: wrap; } }
/* the popup's quick add: business and client on a line of their own */
.quick-money .pick-row { grid-column: 1 / -1; display: flex; gap: 0.4rem; min-width: 0; }
.quick-money .pick-row > * { flex: 1 1 0; min-width: 0; height: 2.2rem; min-height: 2.2rem !important; box-sizing: border-box; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; font-size: 0.85rem !important; }

/* the hint on a button (its title), drawn in the app's own style instead of the browser's */
.tip { position: fixed; z-index: 100; max-width: 16rem; padding: 0.4rem 0.6rem; border-radius: 4px; pointer-events: none;
  background: var(--slate-2); border: 1px solid var(--brass-dk); color: var(--ivory); font-size: 0.78rem; line-height: 1.4;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); }
.tip[hidden] { display: none; }
/* the Collector: a find's photo, shown when it's opened */
.find-photo { display: block; max-width: 100%; max-height: 22rem; border-radius: 6px; border: 1px solid var(--brass-dk); margin: 0.2rem 0 0.6rem; }
.panel.storage { margin-top: 1.4rem; }   /* room above the storage box, after the lists */
/* the shared storage box (Vault and Collector): one bar split by captain, and a key under it */
.panel.storage .bar { display: flex; }
.panel.storage .bar i { border-radius: 0; }
.storage-key { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; align-items: center; }
.storage-key .sail-dot { display: inline-block; width: 9px; height: 9px; vertical-align: 0.05em; margin-right: 0.2rem; box-shadow: none; }   /* a small round dot, as in the chips */
.panel.new-invoice form { display: grid; gap: 0.6rem; }   /* the Merchant's New invoice: its line, the lines so far, then who and when */
.panel.new-invoice .rows { margin: 0; }

/* ── Navigate your waters (the compass in the top bar): the crew as ships on a sea chart, the routes between them ── */
.hud .managers .compass { width: 38px; padding: 0; display: inline-grid; place-items: center; }
.hud .managers .compass svg { width: 20px; height: 20px; }
.card.waters { width: min(1080px, calc(100vw - 32px)); }
.waters-controls .swatch { display: inline-block; width: 20px; height: 0; border-top: 2px solid; margin-right: 0.45rem; vertical-align: 0.25em; }
.swatch.sends { border-color: var(--brass-hi); } .swatch.reads { border-color: #7cc3d8; border-top-style: dashed; } .swatch.calendar { border-color: #7fcf98; border-top-style: dotted; border-top-width: 3px; }
.waters-chart { border: 1px solid var(--steel); border-radius: 6px; overflow-x: auto; margin-bottom: 0.4rem; }
.waters-svg { display: block; width: 100%; min-width: 760px; height: auto;
  --sea-top: #0d2a3c; --sea-bottom: #071823; --wave: color-mix(in srgb, var(--glow) 16%, transparent); --sends: var(--brass-hi); --reads: #7cc3d8; --cal: #7fcf98; --hull: #4a2f1b; --deck: #a77d47; }
.waters-svg .sea-top { stop-color: var(--sea-top); } .waters-svg .sea-bottom { stop-color: var(--sea-bottom); }
.waters-svg .wave, .waters-svg .wake { fill: none; stroke: var(--wave); stroke-width: 1.4; stroke-linecap: round; }
.waters-svg .water-name { font: 600 15px 'Cinzel', Georgia, serif; letter-spacing: 0.32em; fill: var(--ivory); opacity: 0.3; }
.waters-svg .water-sub { font-size: 11px; letter-spacing: 0.12em; fill: var(--ivory); opacity: 0.38; }
.waters-svg .rose path { fill: var(--ivory); opacity: 0.16; } .waters-svg .rose circle { fill: none; stroke: var(--ivory); opacity: 0.16; }
.waters-svg .route { fill: none; stroke-width: 2; transition: opacity 0.25s; }
.waters-svg .route.sends { stroke: var(--sends); stroke-width: 2.4; stroke-dasharray: 10 6; }
.waters-svg .route.reads { stroke: var(--reads); stroke-dasharray: 4 7; }
.waters-svg .route.calendar { stroke: var(--cal); stroke-dasharray: 1.5 7; stroke-linecap: round; stroke-width: 2.6; }
.waters-svg .route.away { opacity: 0.35; }
.waters-svg .arrow.sends { fill: var(--sends); } .waters-svg .arrow.reads { fill: var(--reads); } .waters-svg .arrow.calendar { fill: var(--cal); }
@media (prefers-reduced-motion: no-preference) {
  .waters-svg .route { animation: waters-flow 2.6s linear infinite; }
  .waters-svg .boat .bob { animation: waters-bob 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
}
@keyframes waters-flow { to { stroke-dashoffset: -64; } }
@keyframes waters-bob { 0%, 100% { transform: translateY(0) rotate(-1.6deg); } 50% { transform: translateY(2.5px) rotate(1.6deg); } }
.waters-svg .boat { cursor: pointer; transition: opacity 0.25s; } .waters-svg .boat.away { opacity: 0.45; }
.waters-svg .boat:focus { outline: none; }   /* no browser box round a ship: the brass ring shows which is chosen */
.waters-svg .boat:focus-visible .ring { opacity: 1; }   /* and, from the keyboard, which has focus */
.waters-svg .hull { fill: var(--hull); } .waters-svg .deck { fill: var(--deck); } .waters-svg .mast { stroke: var(--hull); stroke-width: 2; }
.waters-svg .sail { stroke: rgba(0, 0, 0, 0.25); stroke-width: 0.8; }
.waters-svg .ring { fill: none; stroke: var(--brass); stroke-width: 2; opacity: 0; }
.waters-svg .boat.on .ring { opacity: 1; } .waters-svg .boat.hub .ring { opacity: 0.55; stroke: var(--cal); stroke-dasharray: 3 4; }
.waters-svg .tag { fill: rgba(10, 28, 40, 0.9); stroke: var(--steel); stroke-width: 1; }
.waters-svg .name { font: 600 12.5px Inter, system-ui, sans-serif; fill: var(--ivory); } .waters-svg .role { font-size: 10px; fill: var(--iron); }
.waters-svg .route-label { opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.waters-svg .route-label rect { fill: var(--slate); stroke-width: 1.5; } .waters-svg .route-label text { font: 500 12px Inter, system-ui, sans-serif; fill: var(--ivory); }
.waters-svg .route-label.sends rect { stroke: var(--sends); } .waters-svg .route-label.reads rect { stroke: var(--reads); } .waters-svg .route-label.calendar rect { stroke: var(--cal); }
.waters-svg .route-label .lead { stroke: none; } .waters-svg .route-label.sends .lead { fill: var(--sends); } .waters-svg .route-label.reads .lead { fill: var(--reads); } .waters-svg .route-label.calendar .lead { fill: var(--cal); }
.waters-svg.focused .route, .waters-svg.focused .boat { opacity: 0.1; } .waters-svg.focused .route.lit, .waters-svg.focused .boat.lit { opacity: 1; } .waters-svg.focused .route-label.lit { opacity: 1; }
.waters-svg .hidden { display: none; }
.waters-ledger td .sail-dot { display: inline-block; width: 9px; height: 9px; box-shadow: none; vertical-align: 0.05em; margin-right: 0.15rem; }
.route-kind { display: inline-block; width: 16px; height: 0; border-top: 2px solid; margin-right: 0.5rem; vertical-align: 0.25em; }
.route-kind.sends { border-color: var(--brass-hi); } .route-kind.reads { border-color: #7cc3d8; border-top-style: dashed; } .route-kind.calendar { border-color: #7fcf98; border-top-style: dotted; border-top-width: 3px; }
@media (max-width: 700px) { .card.waters { width: auto; } }

/* ── Phones: the main screen ──
   The top bar as a small grid: the city's name with Help, Settings and Lock beside it; the summary under the name; the
   managers as one even row (Buildings, Districts, Captains, the compass); then what needs a look. The credit moves into
   the help card, so the bottom corner keeps only the round controls. */
@media (max-width: 700px) {
  .hud { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "name guide gear lock" "managers managers managers managers" "stats stats stats stats";
    align-items: center; gap: 0.45rem 0.4rem; padding: 0.65rem 0.75rem 0.9rem; }
  .hud > div:first-child { grid-area: name; min-width: 0; flex: none; }
  .hud h1 { font-size: 1.15rem; letter-spacing: 0.14em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud .sub { font-size: 0.74rem; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud #guide { grid-area: guide; } .hud #gear { grid-area: gear; } .hud #lock { grid-area: lock; }
  .hud .lock, .hud .lock + .lock, .hud .managers + .lock { margin: 0; width: 36px; height: 36px; }
  .hud .managers { grid-area: managers; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 38px; gap: 0.35rem; }
  .hud .managers button { height: 36px; padding: 0 0.3rem; font-size: 0.78rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud .managers .compass { width: 38px; }
  .hud .stats { grid-area: stats; width: auto; margin: 0; justify-content: flex-start; order: 0; flex: none; }
  .hud .stats:empty { display: none; }
  .credit { display: none; }
  .controls { right: 0.75rem; bottom: 0.9rem; }
  .controls button { width: 40px; height: 40px; }
}
/* the credit inside the help card: only on phones, where the corner line is hidden */
.guide-credit { display: none; margin-top: 0.6rem; }
.guide-credit a { color: var(--brass-hi); }
@media (max-width: 700px) { .guide-credit { display: block; } }
/* while music plays on a phone, a captain's page leaves room at the bottom so the player doesn't cover its last rows */
@media (max-width: 700px), (max-height: 500px) { body:has(#music-dock:not([hidden])) .page-inner { padding-bottom: 16rem; } }
/* the player's grip: only on phones, where it can be dragged (shantyman.js, movable) */
.music-grip { display: none; }
@media (max-width: 700px), (max-height: 500px) {
  .music-dock .music-bar { position: relative; padding-right: 1.7rem; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
  .music-dock.moving { opacity: 0.92; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); }
  .music-dock.moving .music-bar { cursor: grabbing; }
  .music-grip { display: block; position: absolute; top: 5px; right: 8px; width: 18px; height: 10px;
    background: radial-gradient(circle, var(--iron) 1.2px, transparent 1.6px) 0 0 / 6px 5px; opacity: 0.8; }
}

/* ── Phones on their side (short and wide): the desktop layout, made compact ──
   One row: the city's name, what needs a look, the managers, then Help, Settings and Lock, all smaller; the credit
   moves into the help card, as on phones held upright. */
@media (max-height: 500px) and (min-width: 701px) {
  .hud { padding: 0.45rem 0.9rem; gap: 0.5rem; flex-wrap: nowrap; }
  .hud > div:first-child { flex: 0 1 auto; min-width: 0; }
  .hud h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud .sub { display: none; }
  .hud .stats { flex: none; margin-left: auto; flex-wrap: nowrap; }
  .hud .stat { font-size: 0.75rem; padding: 0.3rem 0.6rem; white-space: nowrap; }
  .stat-more { display: none; }
  .hud .managers { flex: none; }
  .hud h1 { font-size: 1.1rem; letter-spacing: 0.14em; }
  .hud .managers { gap: 0.3rem; }
  .hud .managers button { height: 32px; padding: 0 0.7rem; font-size: 0.78rem; }
  .hud .managers .compass { width: 32px; }
  .hud .managers .compass svg { width: 17px; height: 17px; }
  .hud .lock { width: 32px; height: 32px; }
  .hud .lock + .lock, .hud .managers + .lock { margin-left: 0; }
  .hud .stats { gap: 0.4rem; }
  .credit { display: none; }
  .guide-credit { display: block; }
  .controls { right: 0.6rem; bottom: 0.6rem; }
  .controls button { width: 36px; height: 36px; }
  .card { max-height: calc(100vh - 64px); }
  .music-dock { bottom: calc(0.6rem + 44px); }
}
/* friends: "Send to a friend" under an item, and a friend's safety code in Home */
.friend-send { margin-top: 0.6rem; max-width: 28rem; }
.friend-send select { flex: 1 1 10rem; }
.safety-code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.12em; color: var(--brass-hi); }
/* something from a friend, or a friend request, in Home: who and what on top, then when and Decline / Accept */
.friend-item { display: grid; gap: 0.45rem; padding: 0.6rem 0.75rem; }
.friend-what { display: grid; gap: 0.15rem; min-width: 0; }
.friend-what b { color: var(--ivory); font-weight: 600; word-break: break-all; }
.friend-name { color: var(--ivory); font-weight: 600; overflow-wrap: anywhere; }
.friend-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.friend-foot .send-buttons { display: flex; gap: 0.4rem; margin-left: auto; }
.friend-foot .hire { margin-left: 0; }

/* ══ Status: your class in the city (app/standing.js) ══ */
:root { --rank-0: var(--iron); --rank-1: #e8e2d0; --rank-2: #6aa5f0; --rank-3: #e0675a; --rank-4: var(--brass-hi); }
.standing-flag { font-size: 1.3rem; line-height: 1; }
.rank-0 .standing-flag { color: var(--rank-0); } .rank-1 .standing-flag { color: var(--rank-1); } .rank-2 .standing-flag { color: var(--rank-2); }
.rank-3 .standing-flag { color: var(--rank-3); } .rank-4 .standing-flag { color: var(--rank-4); text-shadow: 0 0 12px rgba(226, 189, 98, 0.6); }
a.standing-line { display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.7rem; background: var(--slate-2); border: 1px solid var(--steel); border-radius: 4px; color: var(--ivory); text-decoration: none; flex-wrap: wrap; }
a.standing-line:hover { border-color: var(--brass); }
a.standing-line .dim { margin-left: auto; }
.standing-hero { display: flex; align-items: center; gap: 0.9rem; margin: 0.6rem 0 0.8rem; padding: 0.8rem 1rem; background: var(--slate-2); border: 1px solid var(--steel); border-left: 4px solid var(--rank-0); border-radius: 4px; }
.standing-hero.rank-1 { border-left-color: var(--rank-1); } .standing-hero.rank-2 { border-left-color: var(--rank-2); }
.standing-hero.rank-3 { border-left-color: var(--rank-3); } .standing-hero.rank-4 { border-left-color: var(--rank-4); }
.standing-hero .standing-flag { font-size: 2.2rem; }
.standing-hero b { display: block; font-family: 'Cinzel', Georgia, serif; font-size: 1.35rem; letter-spacing: 0.06em; color: var(--ivory); }
.standing-hero span:not(.standing-flag) { color: var(--iron); font-size: 0.82rem; }
.standing-strip { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; margin-bottom: 0.35rem; }
.standing-strip .sd { height: 22px; border-radius: 2px; border: 1px solid var(--steel); background: color-mix(in srgb, var(--brass) calc(var(--p) * 90%), var(--slate-2)); }
.standing-strip .sd.none { background: transparent; border-style: dashed; opacity: 0.55; }
.standing-strip .sd.today { box-shadow: inset 0 0 0 1px var(--brass-hi); }
.ladder { list-style: none; display: grid; gap: 0.25rem; margin: 0.4rem 0 0.6rem; }
.ladder li { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.35rem 0.6rem; border-left: 3px solid var(--steel); background: var(--slate-2); border-radius: 3px; color: var(--iron); }
.ladder li b { min-width: 7.5rem; color: var(--iron); font-weight: 700; }
.ladder li.past b { color: var(--ivory); }
.ladder li.on { border-left-color: var(--brass); }
.ladder li.on b { color: var(--brass-hi); }
.standing-counts { display: grid; margin: 0.4rem 0 0.6rem; background: var(--slate-2); border: 1px solid var(--steel); border-radius: 4px; }
.check-row.standing-count { align-items: flex-start !important; padding: 0.55rem 0.8rem; line-height: 1.4; }
.standing-count input { flex: none; margin-top: 0.1rem; }
.standing-count + .standing-count { border-top: 1px solid var(--steel); }
.tchip.standing-chip { color: var(--brass-hi); }

/* ══ The Letterbox ══ */
.letters { list-style: none; display: grid; gap: 0.5rem; margin: 0.5rem 0 0.8rem; max-height: 42vh; overflow-y: auto; padding-right: 0.2rem; }
.letter { max-width: 88%; padding: 0.6rem 0.8rem; border-radius: 4px; background: #efe6d2; color: #2c2416; border: 1px solid #d8c9a6; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.letter.mine { justify-self: end; background: #f6efdf; }
.letter.aq { background: linear-gradient(180deg, #e3f7ff, #bfe9fb); border-color: #7fd0f2; color: #0b3550; border-radius: 14px; padding: 0.45rem 0.8rem; }
.letter.aq.mine { background: linear-gradient(180deg, #d4ffef, #a8efd5); border-color: #62d3a8; }
.letter-meta { font-size: 0.7rem; opacity: 0.7; margin-bottom: 0.2rem; }
.letter-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: Georgia, 'Times New Roman', serif; font-size: 0.92rem; line-height: 1.45; }
.letter.aq .letter-text { font-family: 'Comic Sans MS', 'Chalkboard SE', 'Trebuchet MS', sans-serif; font-size: 0.88rem; }
.letter-form textarea { font-family: Georgia, serif; resize: vertical; }
.letter-friends { margin: 0.4rem 0 0.6rem; }

/* AquaNet: glossy, bubbly, very 2001 */
.aq-mark { font-family: 'Trebuchet MS', 'Arial Rounded MT Bold', sans-serif; font-weight: 800; font-style: italic; letter-spacing: -0.02em;
  background: linear-gradient(180deg, #b9f3ff 0%, #36c2f0 45%, #0a7fc0 55%, #29b6e8 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35)); }
.aq-mark span { background: linear-gradient(180deg, #d6fff0 0%, #45e0a6 45%, #0b9a6a 55%, #3ad49c 100%); -webkit-background-clip: text; background-clip: text; }
.post-ways { display: grid; gap: 0.4rem; margin: 0.4rem 0 0.2rem; }
.post-way { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.45rem 0.75rem; padding: 0.65rem 0.8rem;
  background: var(--slate-2); border: 1px solid var(--steel); border-radius: 6px; }
.post-way.on { border-color: var(--brass); }
.post-way.aq.on { border-color: #36c2f0; background: linear-gradient(180deg, rgba(54, 194, 240, 0.14), rgba(54, 194, 240, 0.04)); }
.sub-h .sub-h-with { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: normal; font-weight: 500; font-size: 0.8rem; color: var(--iron); }
.post-way-icon { font-size: 1.35rem; line-height: 1; }
.post-way-text { display: grid; gap: 0.15rem; }
.post-way-text b, .post-way-text .aq-mark { font-size: 0.95rem; }
.post-way-tag { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass-hi); white-space: nowrap; }
@media (max-width: 480px) { .post-way > button { grid-column: 2 / -1; justify-self: start; } }
button.aq-button, .entry button.aq-button { font: inherit; font-weight: 800; font-size: 0.85rem; cursor: pointer; padding: 0.45rem 1rem; border-radius: 999px; color: #04314d;
  border: 1px solid #8fe3ff; background: linear-gradient(180deg, #ecfbff 0%, #9fe4fb 48%, #4cc3ef 52%, #8ee0fa 100%);
  box-shadow: 0 2px 10px rgba(54, 194, 240, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
button.aq-button:hover, .entry button.aq-button:hover:not(:disabled) { filter: brightness(1.07); background: linear-gradient(180deg, #ecfbff 0%, #9fe4fb 48%, #4cc3ef 52%, #8ee0fa 100%); }
button.aq-button .aq-mark { filter: none; }

/* ── the post's shows (app/post.js) ── */
.post-fx { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.fx-caption { position: absolute; left: 50%; bottom: 7.5rem; transform: translateX(-50%); padding: 0.5rem 1rem; border-radius: 4px; background: var(--navy); border: 1px solid var(--steel); border-top: 2px solid var(--brass); color: var(--ivory); font-size: 0.9rem; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; animation: fx-fade 4.6s ease both; }
.fx-sea { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; }
.fx-waves { position: absolute; left: 0; bottom: 0; width: 200%; height: 46px; fill: rgba(11, 59, 87, 0.85); animation: fx-waves 4.6s linear both, fx-fade 4.6s ease both; }
.paper-boat { position: absolute; bottom: 22px; left: -130px; animation: fx-sail 4.4s cubic-bezier(.45, .05, .55, .95) both; }
.paper-boat .hull { fill: #f4ecd8; stroke: #b9a77c; stroke-width: 1.5; }
.paper-boat .sail-l { fill: #fffaf0; stroke: #c8b78c; stroke-width: 1.2; }
.paper-boat .sail-r { fill: #ece2c8; stroke: #c8b78c; stroke-width: 1.2; }
.paper-boat .letter { fill: #fff; stroke: var(--brass); stroke-width: 1.5; animation: fx-drop 0.8s ease-out both; }
.paper-boat .letter-flap { fill: none; stroke: var(--brass); stroke-width: 1.5; animation: fx-drop 0.8s ease-out both; }
@keyframes fx-sail { 0% { transform: translate(calc(50vw + 70px), 0) rotate(0); } 18% { transform: translate(calc(50vw + 70px), -4px) rotate(-3deg); }
  40% { transform: translate(calc(62vw + 70px), 2px) rotate(3deg); } 60% { transform: translate(calc(76vw + 70px), -3px) rotate(-3deg); } 80% { transform: translate(calc(90vw + 70px), 2px) rotate(3deg); } 100% { transform: translate(calc(100vw + 260px), -2px) rotate(-2deg); } }
@keyframes fx-drop { from { transform: translateY(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fx-waves { to { transform: translateX(-50%); } }
@keyframes fx-fade { 0% { opacity: 0; } 10%, 82% { opacity: 1; } 100% { opacity: 0; } }

.aquanet-fx { display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(4, 49, 77, 0.55), rgba(3, 18, 31, 0.15)); animation: fx-fade 4.2s ease both; }
.aq-window { position: relative; width: min(330px, calc(100vw - 32px)); padding: 0 0 1rem; border-radius: 10px; overflow: hidden; text-align: center; color: #04314d;
  background: linear-gradient(180deg, #f2fbff, #c8eefc); border: 2px solid #36c2f0; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 #fff; animation: aq-pop 0.5s cubic-bezier(.2, 1.6, .5, 1) both; }
.aq-bar { display: flex; justify-content: space-between; padding: 0.3rem 0.6rem; font: 700 0.75rem 'Trebuchet MS', sans-serif; color: #fff; background: linear-gradient(180deg, #5fd3f7, #0a7fc0); }
.aq-logo { margin: 0.8rem 0 0.4rem; font: italic 800 2.4rem 'Trebuchet MS', 'Arial Rounded MT Bold', sans-serif; letter-spacing: -0.03em; color: #0a7fc0; text-shadow: 0 2px 0 #fff, 0 4px 14px rgba(10, 127, 192, 0.45); }
.aq-logo span { color: #0b9a6a; }
.aq-steps { list-style: none; font: 700 0.85rem 'Trebuchet MS', sans-serif; height: 1.3rem; position: relative; }
.aq-steps li { position: absolute; inset: 0; opacity: 0; }
.aq-steps li:nth-child(1) { animation: aq-step 0.9s 0.3s both; } .aq-steps li:nth-child(2) { animation: aq-step 0.9s 1.2s both; }
.aq-steps li:nth-child(3) { animation: aq-last 2s 2.1s both; color: #0b9a6a; }
.aq-meter { height: 10px; margin: 0.6rem 1.4rem 0; border-radius: 999px; background: #fff; border: 1px solid #7fd0f2; overflow: hidden; }
.aq-meter i { display: block; height: 100%; background: repeating-linear-gradient(45deg, #36c2f0 0 10px, #7fe0ff 10px 20px); animation: aq-fill 2.2s 0.2s ease-in-out both; }
.aq-welcome { margin-top: 0.7rem; font: 700 0.85rem 'Trebuchet MS', sans-serif; opacity: 0; animation: aq-step 1.6s 2.4s both; animation-fill-mode: forwards; }
@keyframes aq-pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes aq-step { 0% { opacity: 0; transform: translateY(6px); } 20%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes aq-last { 0% { opacity: 0; transform: scale(0.8); } 20%, 100% { opacity: 1; transform: none; } }
@keyframes aq-fill { from { width: 0; } to { width: 100%; } }
.aq-bubbles { position: absolute; inset: 0; }
.bubble { position: absolute; left: var(--x); bottom: -30px; width: var(--bs); height: var(--bs); border-radius: 50%;   /* (not --s: the labels own that one, as a number) */
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), color-mix(in srgb, var(--glow) 35%, transparent) 40%, rgba(54, 194, 240, 0.15) 70%); border: 1px solid rgba(190, 240, 255, 0.7);
  animation: aq-rise var(--t) var(--d) ease-in both; }
@keyframes aq-rise { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 50% { transform: translate(12px, -55vh); } 100% { transform: translate(-8px, -110vh); opacity: 0.2; } }
.aq-send-fx .aq-burst { position: absolute; left: var(--ox); top: var(--oy); }
.aq-send-fx .bubble { left: 0; bottom: auto; top: 0; border: 1.5px solid rgba(255, 255, 255, 0.95);
  background: radial-gradient(circle at 30% 30%, #fff, color-mix(in srgb, var(--glow) 75%, transparent) 45%, rgba(54, 194, 240, 0.45) 75%);
  box-shadow: 0 0 10px rgba(127, 232, 255, 0.9); animation: aq-shoot var(--t) var(--d) cubic-bezier(.2, .7, .3, 1) both; }
.aq-zap { position: absolute; left: -1rem; top: -1.4rem; font-size: 2.6rem; filter: drop-shadow(0 0 10px rgba(255, 220, 80, 0.95)); animation: aq-zap 1.1s ease-out both; }
@keyframes aq-shoot { 0% { transform: translate(0, 0) scale(0.6); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--dx), -280px) scale(1.25); opacity: 0; } }
@keyframes aq-zap { 0% { transform: scale(0.4); opacity: 0; } 25% { transform: scale(1.4) translateY(-30px); opacity: 1; } 100% { transform: scale(1.1) translateY(-200px); opacity: 0; } }
.aq-got-fx .aq-got { position: absolute; top: 5.5rem; left: 50%; transform: translateX(-50%); display: grid; gap: 0.1rem; text-align: center; padding: 0.6rem 1.2rem; border-radius: 999px;
  color: #04314d; background: linear-gradient(180deg, #ecfbff, #9fe4fb 48%, #4cc3ef 52%, #8ee0fa); border: 1px solid #fff; box-shadow: 0 8px 26px rgba(54, 194, 240, 0.5); font: 700 0.95rem 'Trebuchet MS', sans-serif; animation: aq-bob 2.6s ease both; }
.aq-got span { font-size: 0.75rem; font-weight: 600; }
@keyframes aq-bob { 0% { transform: translate(-50%, -40px) scale(0.7); opacity: 0; } 15% { transform: translate(-50%, 0) scale(1.05); opacity: 1; } 25%, 80% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { transform: translate(-50%, -20px); opacity: 0; } }
.risen-fx { display: grid; place-items: center; }
.risen { display: grid; justify-items: center; gap: 0.2rem; padding: 1.2rem 2rem; background: var(--navy); border: 1px solid var(--steel); border-top: 3px solid var(--brass); border-radius: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); animation: risen 4.2s ease both; }
.risen b { font-family: 'Cinzel', Georgia, serif; font-size: 1.5rem; color: var(--brass-hi); letter-spacing: 0.06em; text-align: center; }
.risen span:last-child { color: var(--iron); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.16em; }
.risen-flag { font-size: 2.6rem; color: var(--brass-hi); animation: risen-flag 1.2s 0.2s ease-out both; }
@keyframes risen { 0% { opacity: 0; transform: translateY(30px) scale(0.9); } 12%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-20px); } }
@keyframes risen-flag { 0% { transform: translateY(40px); opacity: 0; } 60% { transform: translateY(-6px); opacity: 1; } 100% { transform: none; } }
/* reduced motion: only the captions */
.post-fx.calm *, .post-fx.calm { animation: none !important; }
.post-fx.calm .paper-boat, .post-fx.calm .fx-waves, .post-fx.calm .bubble, .post-fx.calm .aq-zap, .post-fx.calm .aq-meter, .post-fx.calm .aq-steps li:not(:last-child) { display: none; }
.post-fx.calm .aq-steps li:last-child, .post-fx.calm .aq-welcome { opacity: 1; }
@media (max-width: 700px) { .letter { max-width: 94%; } .ladder li b { min-width: 6.5rem; } .standing-strip .sd { height: 18px; } }

/* ── the Beta badge (app/release.js) ── */
.beta-badge { display: inline-block; vertical-align: middle; margin-left: 0.55rem; padding: 0.18rem 0.55rem; border-radius: 4px;
  border: 1.5px solid #fff; background: linear-gradient(135deg, var(--gold) 0%, #ffb347 45%, #ff7a2f 100%); color: #fff;
  font: 900 0.68rem/1.3 Inter, system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase;
  text-shadow: 0 1px 1px rgba(122, 44, 0, 0.75), 0 0 6px rgba(122, 44, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 122, 47, 0.45), 0 2px 10px rgba(255, 140, 50, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
button.beta-badge { cursor: pointer; pointer-events: auto; }
button.beta-badge:hover { filter: brightness(1.08) saturate(1.1); box-shadow: 0 0 0 1px rgba(255, 122, 47, 0.6), 0 2px 16px rgba(255, 140, 50, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.hud > div:first-child { display: flex; flex-wrap: wrap; align-items: center; }
.hud > div:first-child .sub { flex-basis: 100%; }
.gate h1 .beta-badge { font-size: 0.6rem; transform: translateY(-0.35em); }
.card-head .beta-badge { margin-left: auto; }
.beta-badge { display: inline-flex; align-items: center; gap: 0.3rem; }
.beta-badge .betta { flex: none; width: 27px; height: 17px; margin: -3px 0 -3px -2px; filter: drop-shadow(0 1px 1px rgba(122, 44, 0, 0.45)); }
.betta-big .betta { width: 64px; height: 41px; filter: drop-shadow(0 0 8px rgba(90, 168, 240, 0.5)); }
.stat { white-space: nowrap; }
/* the betta swims: a sway of the tail and fins, and a little bob, more of it on hover */
@media (prefers-reduced-motion: no-preference) {
  .betta { overflow: visible; animation: betta-bob 3.2s ease-in-out infinite; }
  .betta-tail { transform-origin: 18px 11px; animation: betta-tail 1.6s ease-in-out infinite; }
  .betta-fin { transform-origin: 14px 11px; animation: betta-fin 2.4s ease-in-out infinite; }
  .beta-badge:hover .betta-tail { animation-duration: 0.5s; }
}
@keyframes betta-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes betta-tail { 0%, 100% { transform: skewY(-6deg) scaleX(0.94); } 50% { transform: skewY(6deg) scaleX(1.04); } }
@keyframes betta-fin { 0%, 100% { transform: scaleY(0.92); } 50% { transform: scaleY(1.06); } }
/* on the glossy button the light logo would vanish: there it's deep ocean blue and sea green, edged in white */
button.aq-button .aq-mark { font-size: 1.08em; background: linear-gradient(180deg, #0b6fb0 0%, #04406a 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.6)); }
button.aq-button .aq-mark span { background: linear-gradient(180deg, #0e9a68 0%, #065a3c 100%); -webkit-background-clip: text; background-clip: text; }
/* Home's way into the Letterbox: a big, plain button, easy to spot */
a.letter-cta { display: flex; align-items: center; justify-content: center; gap: 0.55rem; width: 100%; margin: 0.35rem 0 0.2rem; padding: 0.75rem 1rem; border-radius: 6px; font-size: 1rem; text-decoration: none; }
a.letter-cta span { font-size: 1.25rem; line-height: 1; }
.letter-notes { margin-top: 0.3rem; text-align: center; }

/* phone-style counters: what friends have waiting (red, like an app icon's badge) */
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; margin-left: 0.4rem;
  background: #ff3b30; color: #fff; font: 800 11px/1 Inter, system-ui, sans-serif; letter-spacing: 0; text-transform: none;
  box-shadow: 0 0 0 2px var(--slate), 0 2px 6px rgba(255, 59, 48, 0.45); }
a.letter-cta { position: relative; }
.count-badge.on-corner { position: absolute; top: -8px; right: -8px; margin: 0; min-width: 24px; height: 24px; font-size: 12px; }
.tag .badge.mail { background: #ff3b30; color: #fff; box-shadow: 0 0 10px rgba(255, 59, 48, 0.8); animation: none; }
.tag.project.home { display: flex; align-items: center; gap: 0.35rem; }
/* the Letterbox's search: one friend, or tick All friends */
.letter-search { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.2rem; }
.letter-search .filter-input { flex: 1; margin-bottom: 0; }
.letter-search .check-row { white-space: nowrap; }
.older-letters { display: block; margin: 0.2rem auto 0.4rem; }
.letter-meta .linkish { font-size: inherit; font-weight: 700; color: inherit; text-decoration: underline; }

/* AquaNet's mark (post.js AQUA_MARK): square; sits in a line of text, bigger in the AquaNet row and the dial-up window */
.aq-icon { display: inline-block; vertical-align: -0.22em; width: 1.15em; height: 1.15em; overflow: visible; }
.post-way-icon .aq-icon { width: 1.5rem; height: 1.5rem; vertical-align: middle; }
.aq-bar .aq-icon { width: 1rem; height: 1rem; }
.aq-logo-mark { margin-top: 0.8rem; }
.aq-logo-mark .aq-icon { width: 58px; height: 58px; filter: drop-shadow(0 4px 10px rgba(10, 127, 192, 0.3)); }
.aq-logo-mark + .aq-logo { margin-top: 0.1rem; }
.aq-got .aq-icon { width: 1.3em; height: 1.3em; }
/* while it dials up, the arcs light up one after another, like a signal coming in */
@media (prefers-reduced-motion: no-preference) {
  .aquanet-fx .aq-arc { animation: aq-signal 1.2s ease-in-out infinite both; }
  .aquanet-fx .aq-arc-2 { animation-delay: 0.25s; }
}
@keyframes aq-signal { 0%, 100% { opacity: 0.25; } 40%, 60% { opacity: 1; } }

/* ── Backbone's admin page (admin.html) ── */
body.admin-page { overflow: auto; padding: 24px 16px; background: var(--navy); }
.card.admin-card { position: static; width: min(560px, 100%); margin: 0 auto; }
.admin-code { font: 700 0.95rem ui-monospace, Menlo, monospace; letter-spacing: 0.08em; color: var(--brass-hi); }
/* CyberStream's unlock card */
.cyber-steps { margin: 0.5rem 0 0.6rem 1.2rem; display: grid; gap: 0.45rem; font-size: 0.88rem; color: var(--ivory); }
.cyber-code { display: inline-block; margin-top: 0.3rem; padding: 0.25rem 0.6rem; border: 1px dashed var(--brass); border-radius: 4px;
  font: 800 1.05rem ui-monospace, Menlo, monospace; letter-spacing: 0.14em; color: var(--brass-hi); user-select: all; }
.cyber-plans { display: grid; gap: 0.45rem; }
/* Backbone's Venmo QR: a link too (on a phone, tap it to open Venmo); the caption says whichever fits the device */
a.venmo-link { display: inline-block; border-radius: 12px; }
a.venmo-link:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; }
.on-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .on-touch { display: inline; } .on-desktop { display: none; } }
/* CyberStream's prices: each pass, and the third of it that goes to the cause */
.cyber-price { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.4rem 0 0.5rem; }
.cyber-price > div { display: grid; gap: 0.1rem; padding: 0.6rem 0.75rem; background: var(--slate-2); border: 1px solid var(--steel); border-radius: 4px; }
.cyber-price b { font-family: 'Cinzel', Georgia, serif; font-size: 1.4rem; color: var(--brass-hi); }
.cyber-price span { font-size: 0.8rem; color: var(--ivory); }
.cyber-price .cyber-gives { color: var(--live); font-size: 0.74rem; }
/* CyberStream's mark (release.js CYBER_MARK): a Tesla coil; its lightning flickers, one bolt after another */
.cyber-icon { flex: none; width: 1.6rem; height: 1.6rem; overflow: visible; }
.cyber-icon .cy-bolts { filter: drop-shadow(0 0 1.5px rgba(127, 232, 255, 0.9)); }
.cyber-big .cyber-icon { width: 52px; height: 52px; }
@media (prefers-reduced-motion: no-preference) {
  .cyber-icon .cy-bolt { animation: cy-flicker 2.4s steps(1) infinite; }
  .cyber-icon .cy-bolt-2 { animation-delay: 0.5s; } .cyber-icon .cy-bolt-3 { animation-delay: 1s; }
  .cyber-icon .cy-bolt-4 { animation-delay: 1.4s; } .cyber-icon .cy-bolt-5 { animation-delay: 1.9s; }
}
@keyframes cy-flicker { 0%, 100% { opacity: 1; } 8% { opacity: 0.2; } 12% { opacity: 1; } 55% { opacity: 0.35; } 60% { opacity: 1; } }
/* Home's CyberStream line stays one row: a small coil, and the note shortened with … if it must be */
a.cyber-line { flex-wrap: nowrap; padding-top: 0.45rem; padding-bottom: 0.45rem; }
a.cyber-line .cyber-icon { width: 1.25rem; height: 1.25rem; }
a.cyber-line b { white-space: nowrap; }
a.cyber-line .dim { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* sending a whole station or cookbook: "Send a station [which] [to whom] Send" */
.inline-form.send-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 0.4rem; margin: 0.2rem 0 0.7rem; }
.send-group > span { grid-column: 1 / -1; }
.inline-form.send-group select { width: 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send-group button { white-space: nowrap; }
@media (max-width: 480px) { .inline-form.send-group { grid-template-columns: minmax(0, 1fr); } }

/* a recipe's cookbook: under its name, the same quiet picker as a song's station, so every row's starts at the same place */
.recipe-book { padding: 0 0.7rem 0.5rem; margin-top: -0.45rem; font-size: 0.78rem; }

/* ── a message in a bottle (post.js bottleAway / bottleAshore) ── */
.bottle .glass { fill: rgba(150, 220, 200, 0.55); stroke: #3d8c7a; stroke-width: 1.2; }
.bottle .cork { fill: #b07a45; stroke: #6b4420; stroke-width: 0.8; }
.bottle .scroll { fill: #f4e9cf; stroke: #b59a62; stroke-width: 0.7; }
.bottle .ribbon { stroke: #c0392b; stroke-width: 1.2; }
.bottle .shine { stroke: rgba(255, 255, 255, 0.75); stroke-width: 1.2; stroke-linecap: round; }
.bottle-arc { position: absolute; left: 0; bottom: 30px; animation: bottle-toss 5.2s cubic-bezier(.3, .6, .4, 1) both; }
@keyframes bottle-toss {
  0% { transform: translate(calc(30vw), -40px) rotate(-30deg); opacity: 0; }
  6% { opacity: 1; }
  22% { transform: translate(calc(40vw), -170px) rotate(160deg); }
  36% { transform: translate(calc(48vw), 0) rotate(350deg); }
  44% { transform: translate(calc(50vw), -6px) rotate(354deg); }
  52% { transform: translate(calc(52vw), 2px) rotate(346deg); }
  100% { transform: translate(calc(88vw), -2px) rotate(352deg) scale(0.7); opacity: 0; }
}
.bottle-fx .splash { position: absolute; left: calc(48vw + 30px); bottom: 34px; width: 16px; height: 6px; border: 2px solid rgba(220, 245, 255, 0.85); border-radius: 50%; opacity: 0;
  animation: bottle-splash 1.4s 1.75s ease-out both; }
@keyframes bottle-splash { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(6, 3); opacity: 0; } }
.fx-star { position: absolute; left: 62vw; bottom: 210px; font-size: 1.6rem; color: #fff6d0; text-shadow: 0 0 12px #ffe9a0, 0 0 24px var(--gold); opacity: 0; animation: fx-star 3s 2.1s ease-in-out both; }
@keyframes fx-star { 0% { opacity: 0; transform: scale(0.4) rotate(0); } 30% { opacity: 1; transform: scale(1.2) rotate(20deg); } 60% { opacity: 0.7; transform: scale(0.9) rotate(35deg); } 100% { opacity: 0; transform: scale(0.5) rotate(60deg); } }
.bottle-in { position: absolute; left: 0; bottom: 26px; animation: bottle-in 4.4s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes bottle-in { 0% { transform: translate(100vw, -4px) rotate(10deg); } 60% { transform: translate(calc(50vw - 36px), 2px) rotate(-8deg); } 75% { transform: translate(calc(50vw - 40px), 0) rotate(-2deg); } 100% { transform: translate(calc(50vw - 40px), 0) rotate(0); } }
.ashore-sparkle { position: absolute; left: calc(50vw + 30px); bottom: 70px; font-size: 1.3rem; color: #fff6d0; text-shadow: 0 0 10px #ffe9a0; opacity: 0; animation: fx-star 2s 2.6s ease-in-out both; }
.post-fx.calm .bottle-arc, .post-fx.calm .bottle-in, .post-fx.calm .splash, .post-fx.calm .fx-star, .post-fx.calm .ashore-sparkle { display: none; }

/* a bottle letter in the conversation: aged paper, a little askew */
.letter.bottle { background: linear-gradient(180deg, #f3e6c4, #e8d6a8); border-color: #c9ad72; transform: rotate(-0.6deg); }
.letter.bottle.mine { transform: rotate(0.6deg); }
.bottle-opt { margin-top: 0.4rem; }
.bottle-opt summary { cursor: pointer; color: var(--brass-hi); font-size: 0.85rem; }
.bottle-opt .bottle-when { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.bottle-opt .bottle-when label { flex: 1 1 14rem; }
.bottle-mark { display: inline-block; width: 1.9em; height: 0.95em; vertical-align: -0.1em; }
.post-way-icon .bottle-mark { width: 1.6rem; height: 0.8rem; vertical-align: middle; }

/* ── Voyager Rock: the voyages menu ── */
.tag.rock { font-size: 11px; color: #ffe2b0; padding: 0.15rem 0.55rem; border-radius: 999px; background: rgba(14, 30, 48, 0.72); border: 1px solid rgba(255, 190, 110, 0.5); pointer-events: auto; cursor: pointer; }
.voyage-row .row-title { display: grid; }
.v-lantern { flex: none; width: 12px; height: 16px; border-radius: 4px 4px 5px 5px; background: #3a3128; box-shadow: inset 0 0 0 1px #6b5a48; }
.v-lantern.s05 { background: #9a6a38; box-shadow: 0 0 6px rgba(255, 160, 70, 0.5); }
.v-lantern.s1 { background: #ffc46a; box-shadow: 0 0 10px rgba(255, 170, 80, 0.95); }
.v-kept { color: var(--live); font-weight: 800; } .v-not { color: var(--iron); } .v-off { color: var(--steel-2); }
.voyage-invite { display: grid; gap: 0.45rem; }
button.aq-button:disabled, .entry button.aq-button:disabled { opacity: 0.45; filter: grayscale(0.6); cursor: not-allowed; box-shadow: none; }
.v-today { display: block; margin-top: 0.15rem; color: var(--ivory); }
form[data-act=voyage-start] select { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.voyage-line { flex-wrap: nowrap; }
a.voyage-line .dim { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the Letterbox's send buttons: equal halves across the full width, the same height, labels centred */
.letter-form .form-actions { display: flex; gap: 0.5rem; width: 100%; justify-content: stretch; }
.letter-form .form-actions > button { flex: 1 1 0; min-width: 0; min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; margin: 0; white-space: nowrap; }
.letter-form .form-actions > button.aq-button { border-radius: 6px; }

/* ── the world preview (preview.html) ── */
body.preview-page { overflow: hidden; }
.card.preview-panel { position: fixed; top: 16px; right: 16px; width: 320px; max-height: calc(100vh - 32px); z-index: 10; }
.preview-controls { display: grid; gap: 0.7rem; margin-top: 0.4rem; }
.preview-controls label.small { display: grid; gap: 0.25rem; }
.preview-controls input[type=range] { width: 100%; }
.preview-about { margin-top: -0.4rem; }
@media (max-width: 700px) { .card.preview-panel { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-height: 45vh; border-radius: 10px 10px 0 0; } }
.preview-controls label.check-row { display: flex; align-items: center; gap: 0.5rem; }

/* the Reality Lab panel (preview.html, app/lab.js) */
.lab { display: grid; gap: 0.6rem; margin: 0.4rem 0 0.8rem; }
.lab-ask { display: grid; gap: 0.35rem; }
.lab-ask textarea { width: 100%; resize: vertical; min-height: 4.2rem; font: inherit; }
.lab-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.lab-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; max-height: 16rem; overflow: auto; }
.lab-req { border-left: 2px solid color-mix(in srgb, var(--glow) 40%, transparent); padding: 0.2rem 0 0.2rem 0.6rem; font-size: 0.86rem; }
.lab-you { color: var(--pearl); }
.lab-claude { color: var(--muted); margin-top: 0.2rem; }
.lab-status { font-weight: 600; color: var(--gold); }
.lab-waiting .lab-status { color: var(--glow); }
.lab-needs-piece .lab-status { color: var(--warn); }
.lab-section summary { cursor: pointer; font-size: 0.86rem; color: var(--muted); }
.lab-versions, .lab-pieces { margin: 0.4rem 0 0; padding-left: 1rem; font-size: 0.84rem; display: grid; gap: 0.25rem; }
.lab-spec { max-height: 18rem; overflow: auto; font-size: 0.72rem; background: rgba(0, 0, 0, 0.25); padding: 0.5rem; border-radius: 6px; }
