/* ============================================================
   ATLANTIS — city.css
============================================================ */
:root {
  --abyss:   #03121f;
  --deep:    #062338;
  --sea:     #0b3b57;
  --glow:    #8fe3ff;
  --pearl:   #e8f3f8;
  --muted:   #8fb3c6;
  --gold:    #ffd36a;
  --live:    #5be3a0;
  --work:    #ffb35c;
}

* { 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 rgba(143, 227, 255, 0.55), 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: rgba(143, 227, 255, 0.08); border: 1px solid rgba(143, 227, 255, 0.2); 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 rgba(143, 227, 255, 0.25);
  background: rgba(143, 227, 255, 0.08); color: var(--pearl); cursor: pointer; display: grid; place-items: center;
}
.refresh svg { width: 18px; height: 18px; }
.refresh:hover { background: rgba(143, 227, 255, 0.18); }

/* ── 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 rgba(143, 227, 255, 0.45);
  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 rgba(143, 227, 255, 0.3);
  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: rgba(255, 211, 106, 0.6); }
.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: #ff8f8f; }
.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: rgba(143, 227, 255, 0.06); border: 1px solid rgba(143, 227, 255, 0.12); }
.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(--glow); }
.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: rgba(143, 227, 255, 0.1); 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 rgba(143, 227, 255, 0.35);
  background: rgba(143, 227, 255, 0.1); color: var(--pearl);
}
.actions a:hover, .actions button:hover { background: rgba(143, 227, 255, 0.22); }
.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 rgba(143, 227, 255, 0.12); 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 rgba(255, 211, 106, 0.4); }
.gain { color: var(--live); } .loss { color: #ff8f8f; }
.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 rgba(143, 227, 255, 0.25); 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 rgba(255, 211, 106, 0.6); 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: #ff8f8f; color: #ffd0d0; }
.tag.project.down::after { content: " · site down"; color: #ff8f8f; 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 Steward'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: rgba(143, 227, 255, 0.06); }
.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: grid; place-items: center; padding: 16px; overflow: auto;
  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 */
}
.gate-box {
  width: min(420px, 100%); background: var(--card-bg); border: 1px solid rgba(143, 227, 255, 0.28); border-radius: 18px;
  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 rgba(143, 227, 255, 0.45); }
.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 rgba(143, 227, 255, 0.25); 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 rgba(255, 211, 106, 0.7); background: rgba(255, 211, 106, 0.18); 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: #ff8f8f; 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 rgba(255, 211, 106, 0.6); 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 rgba(143, 227, 255, 0.3); background: rgba(143, 227, 255, 0.08); 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 rgba(143, 227, 255, 0.25); 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 rgba(255, 211, 106, 0.6); background: rgba(255, 211, 106, 0.15); color: var(--gold); font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.hud .add:hover, .hire:hover { background: rgba(255, 211, 106, 0.25); }
.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 rgba(255, 211, 106, 0.6); background: rgba(255, 211, 106, 0.15); 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 rgba(255, 211, 106, 0.6); cursor: pointer; }

/* Today and the captain carousel */
.hud .today { border-color: rgba(143, 227, 255, 0.35); background: rgba(143, 227, 255, 0.08); color: var(--pearl); }
.hud .today:hover { background: rgba(143, 227, 255, 0.18); }
.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, rgba(143, 227, 255, 0.12), rgba(10, 60, 90, 0.35)); border: 1px solid rgba(143, 227, 255, 0.18); }
.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: rgba(143, 227, 255, 0.35); }
.chip.on { background: rgba(255, 211, 106, 0.18); color: var(--gold); border-color: rgba(255, 211, 106, 0.45); }
.sub-h.late { color: #ffb3b3; }
.checklist .task .aisle { font: inherit; font-size: 0.7rem; color: var(--muted); background: transparent; border: 1px solid rgba(143, 227, 255, 0.15); 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 rgba(143, 227, 255, 0.25); 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: rgba(143, 227, 255, 0.1); overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.bars.budget .bar i { background: #5be3a0; }
.bars li.over .bar i { background: #ff8f8f; }
.bars li.over b { color: #ff8f8f; }
.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: #ffb3b3; }
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(--glow); 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: #5be3a0; box-shadow: 0 0 8px #5be3a0; 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: rgba(143, 227, 255, 0.06); border: 1px solid rgba(143, 227, 255, 0.12); display: grid; gap: 0.1rem; } .stat-row span { color: var(--muted); font-size: 0.75rem; }
/* the Navigator'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: rgba(143, 227, 255, 0.05); border: 1px solid rgba(143, 227, 255, 0.1); 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: #ffb3b3; 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: rgba(255, 211, 106, 0.2); }
/* 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: rgba(143, 227, 255, 0.05); border: 1px solid rgba(143, 227, 255, 0.1); }
.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 Keeper */
.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: rgba(143, 227, 255, 0.1); 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: rgba(143, 227, 255, 0.05); }
.spark i { flex: 1; background: linear-gradient(180deg, var(--gold), rgba(255, 211, 106, 0.35)); 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: rgba(143, 227, 255, 0.05); border: 1px solid rgba(143, 227, 255, 0.12); }
.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: rgba(143, 227, 255, 0.35) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(143, 227, 255, 0.28); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(143, 227, 255, 0.5); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* the Steward */
.checklist.steward .task { gap: 0.6rem; }
.checklist .ticks { display: inline-flex; gap: 0.3rem; }
.checklist.steward .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: rgba(255, 211, 106, 0.1); }
.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 rgba(143, 227, 255, 0.18); 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 rgba(143, 227, 255, 0.3); 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 rgba(255, 211, 106, 0.6); 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, rgba(255, 211, 106, 0.24), rgba(255, 211, 106, 0.12)); }
.entry button:hover:not(:disabled) { background: linear-gradient(180deg, rgba(255, 211, 106, 0.34), rgba(255, 211, 106, 0.18)); }
.entry button:active:not(:disabled) { transform: translateY(1px); }
.entry button.quiet { background: none; color: var(--pearl); border-color: rgba(143, 227, 255, 0.3); 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: rgba(255, 211, 106, 0.6); }
.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.steward 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: rgba(255, 211, 106, 0.16);
  --gold-line: rgba(255, 211, 106, 0.32);
  --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: rgba(255, 211, 106, 0.16); }
:is(.card, .page) .notices li, .checklist .task { border-width: 1px; border-style: solid; }
.hist-day { border-color: rgba(255, 211, 106, 0.12); }

/* 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: rgba(255, 211, 106, 0.28); }
:is(.card, .page) :is(input[type=checkbox], input[type=radio]) { border-color: rgba(255, 211, 106, 0.55); }

/* 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: rgba(255, 211, 106, 0.45); }
.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: #1a1305; 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: #1a1305; 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: #1a1305; 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, .linkish, :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 rgba(143, 227, 255, 0.3); background: rgba(143, 227, 255, 0.08); 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: rgba(143, 227, 255, 0.18); border-color: rgba(143, 227, 255, 0.45); color: var(--pearl); }
.hud .lock { border-radius: 50%; border: 1px solid rgba(143, 227, 255, 0.25); background: rgba(143, 227, 255, 0.08); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hud .lock:hover { background: rgba(143, 227, 255, 0.18); }
.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 #c0564a; }
.danger-zone .set-label b { color: #f0a597; }
.entry button.danger { background: #a8473c; border-color: #c0564a; 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: #f0a597; 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: #f0a597; }
.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: #c0564a; }
.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: #f0a597; }
.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: #1a1305; 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 Cook */
.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: #c0564a; }
.row-head .hire { padding: 0.3rem 0.8rem; }
:is(.card, .page) .gain { color: #8fd6a8; } :is(.card, .page) .loss { color: #f0a597; }
.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 Navigator */
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 Provisioner'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: #1a1305; 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: #1a1305; border-left-color: var(--brass-dk); }
.staple .staple-x:hover { opacity: 1; color: #f0a597; }
.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 Keeper'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: #c0564a; color: #fff; box-shadow: none; }
.hire.danger:hover { background: #bf5145; }
/* the Steward's today: rows with a tick box per time */
.steward-today .ticks { display: inline-flex; gap: 0.3rem; flex: none; }
.steward-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 Steward: names line up whether a task has one tick box or several */
.steward-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 Provisioner'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: #f0a597; }
.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 Steward's and the Cook'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 1fr auto auto; }        /* picture, name, + Queue (or its place in the queue), × */
/* 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 rgba(143, 227, 255, 0.35); }
.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) .song 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) .song select.song-genre:hover { color: var(--brass-hi, var(--gold)); }
:is(.card, .page) .song 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) .song select.song-genre { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0 !important; vertical-align: baseline; }
  :is(.card, .page) .song select.song-genre::picker-icon { order: 2; font-size: 0.65rem; }
  :is(.card, .page) .song 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: #f0a597; }   /* 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 1fr auto; }
  .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: #f0a597; 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: rgba(143, 227, 255, 0.16); --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-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.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); }
