:root {
  /* Reuben College palette: Oxford Blue + crest green & gold */
  --oxford: #002147;
  --crest-green: #13652f;
  --crest-gold: #c99718;
  --bg: #f3f5f9;
  --bg-grad: radial-gradient(1200px 520px at 100% -10%, #dde5f1 0%, transparent 60%), radial-gradient(900px 480px at -10% 0%, #e3eee7 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #edf1f6;
  --border: #e1e6ee;
  --border-strong: #cbd3df;
  --text: #0c1a2e;
  --text-2: #46546a;
  --text-3: #7f8ba0;
  --accent: #002147;
  --accent-2: #0b3566;
  --accent-soft: #e5ebf4;
  --accent-text: #ffffff;
  --water: #1f5a96;
  --water-soft: #e3edf8;
  --land: #9a6f08;
  --land-soft: #fbf1d6;
  --ok: #13652f;
  --ok-soft: #dcefe2;
  --warn: #a8670a;
  --warn-soft: #fdf0d5;
  --bad: #c62828;
  --bad-soft: #fde4e4;
  --violet: #6b3fa0;
  --violet-soft: #efe8f8;
  --topbar: #002147;
  --topbar-text: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 33, 71, .06);
  --shadow: 0 1px 2px rgba(0, 33, 71, .04), 0 4px 16px rgba(0, 33, 71, .07);
  --shadow-lg: 0 10px 40px rgba(0, 33, 71, .2);
  --radius: 14px;
  --radius-sm: 10px;
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050d1a;
    --bg-grad: radial-gradient(1200px 520px at 100% -10%, rgba(30, 70, 130, .28) 0%, transparent 60%), radial-gradient(900px 480px at -10% 0%, rgba(19, 101, 47, .14) 0%, transparent 55%);
    --surface: #0c1729;
    --surface-2: #0a1424;
    --surface-3: #142238;
    --border: #1a2a43;
    --border-strong: #263a5a;
    --text: #e7ecf4;
    --text-2: #a6b3c8;
    --text-3: #6c7b93;
    --accent: #8fb0e0;
    --accent-2: #a9c3ea;
    --accent-soft: rgba(143, 176, 224, .14);
    --accent-text: #001630;
    --water: #7fb0e8;
    --water-soft: rgba(127, 176, 232, .13);
    --land: #e3b648;
    --land-soft: rgba(227, 182, 72, .13);
    --ok: #5cc483;
    --ok-soft: rgba(92, 196, 131, .13);
    --warn: #f0b545;
    --warn-soft: rgba(240, 181, 69, .13);
    --bad: #f37b7b;
    --bad-soft: rgba(243, 123, 123, .14);
    --violet: #b79be6;
    --violet-soft: rgba(183, 155, 230, .15);
    --topbar: #001530;
    --topbar-text: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #050d1a;
    --bg-grad: radial-gradient(1200px 520px at 100% -10%, rgba(30, 70, 130, .28) 0%, transparent 60%), radial-gradient(900px 480px at -10% 0%, rgba(19, 101, 47, .14) 0%, transparent 55%);
    --surface: #0c1729;
    --surface-2: #0a1424;
    --surface-3: #142238;
    --border: #1a2a43;
    --border-strong: #263a5a;
    --text: #e7ecf4;
    --text-2: #a6b3c8;
    --text-3: #6c7b93;
    --accent: #8fb0e0;
    --accent-2: #a9c3ea;
    --accent-soft: rgba(143, 176, 224, .14);
    --accent-text: #001630;
    --water: #7fb0e8;
    --water-soft: rgba(127, 176, 232, .13);
    --land: #e3b648;
    --land-soft: rgba(227, 182, 72, .13);
    --ok: #5cc483;
    --ok-soft: rgba(92, 196, 131, .13);
    --warn: #f0b545;
    --warn-soft: rgba(240, 181, 69, .13);
    --bad: #f37b7b;
    --bad-soft: rgba(243, 123, 123, .14);
    --violet: #b79be6;
    --violet-soft: rgba(183, 155, 230, .15);
    --topbar: #001530;
    --topbar-text: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px; line-height: 1.45; color: var(--text);
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  min-height: 100vh; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; color: var(--topbar-text);
  background: var(--topbar);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 24px rgba(0, 20, 50, .18);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, var(--crest-green) 0 33.3%, #fff 33.3% 66.6%, var(--crest-green) 66.6%); opacity: .9; }
.topbar-inner { max-width: 1440px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; }
.brand { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: 0; line-height: 1.1; }
.brand-mark { height: 38px; width: auto; display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); }
.brand small { display: block; font-family: Inter, sans-serif; font-weight: 500; color: rgba(255, 255, 255, .62); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 12px; border-radius: 9px; color: rgba(255, 255, 255, .72); font-weight: 550; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 -2px 0 var(--crest-gold); }
.nav .count { background: var(--crest-gold); color: #1d1500; color: #fff; font-size: 11px; border-radius: 99px; padding: 0 6px; line-height: 17px; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.main { max-width: 1440px; margin: 0 auto; padding: 22px 20px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-family: var(--serif); font-size: 32px; letter-spacing: 0; font-weight: 700; line-height: 1.1; color: var(--accent); }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 13px; border-radius: 10px; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 7px; }
.btn svg { width: 16px; height: 16px; flex: none; }

.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 10px;
  padding: 8px 11px; outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { resize: vertical; min-height: 64px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip.water { background: var(--water-soft); color: var(--water); }
.chip.land { background: var(--land-soft); color: var(--land); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip svg { width: 13px; height: 13px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; margin: 26px 0 10px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 400px; padding: 34px 30px 28px; text-align: center; margin-top: 60px; }
.login-wrap { background: radial-gradient(900px 600px at 50% -10%, #0b3566 0%, var(--oxford) 55%, #00142c 100%); }
.login { border: 0; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.login .crest { height: 104px; width: auto; display: block; margin: -84px auto 14px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35)); }
.login h1 { margin: 0 0 2px; font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--accent); }
.login .sub { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin: 0 0 22px; }
.login-foot { margin-top: 18px; color: rgba(255, 255, 255, .55); font-size: 12px; text-align: center; }
.login p { margin: 0 0 22px; color: var(--text-2); }
.login form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login .btn { padding: 10px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---------- week ---------- */
.weekbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.weekbar .label { font-weight: 700; font-size: 16px; min-width: 210px; text-align: center; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; padding: 4px 10px; border-radius: 99px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; align-items: start; }
.day { min-width: 0; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 4px 8px; }
.day-head b { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.day-head span { font-size: 12.5px; color: var(--text-3); }
.day.today .day-head b { color: var(--accent); }
.day.today .day-head span { color: var(--accent); font-weight: 600; }
.day-body { display: flex; flex-direction: column; gap: 10px; min-height: 60px; border-radius: var(--radius); }
.day-empty { border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 14px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.day-empty button { margin-top: 6px; }

.outing { position: relative; overflow: hidden; padding: 12px 12px 10px; cursor: default; transition: box-shadow .15s, transform .15s; }
.outing::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--water); }
.outing.land::before { background: var(--land); }
.outing.draft { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 10px, var(--surface-2) 10px, var(--surface-2) 20px); }
.outing.past { opacity: .72; }
.outing.clickable { cursor: pointer; }
.outing.clickable:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.o-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.o-time { font-weight: 750; font-size: 15px; letter-spacing: -.01em; }
.o-title { font-weight: 600; color: var(--text); }
.o-meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 8px; }
.o-sub { color: var(--text-2); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.o-sub svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; opacity: .7; }
.seats { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.seat { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 7px; font-size: 13px; min-height: 26px; }
.seat:nth-child(odd) { background: var(--surface-2); }
.seat .sl { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.seat .sn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.open .sn { color: var(--text-3); font-style: italic; }
.seat.bad .sn { color: var(--bad); font-weight: 600; }
.seat.me { background: var(--accent-soft) !important; }
.seat.me .sn { font-weight: 700; color: var(--accent); }
.seat.subreq { background: var(--warn-soft) !important; }
.seat.subreq .sn { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--warn) 70%, transparent); }
.seat .tag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.seat .tag.warn { background: var(--warn); color: #fff; }
.seat .tag.ok { background: var(--ok-soft); color: var(--ok); }
.seat .tag.violet { background: var(--violet-soft); color: var(--violet); }
.seat button.tag { border: 0; cursor: pointer; }
.seat .tags { display: flex; gap: 4px; align-items: center; }
.o-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.warnings { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.warnings div { font-size: 12px; color: var(--bad); display: flex; gap: 5px; align-items: flex-start; }
.warnings svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 20px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; cursor: default; }
.t th.sort { cursor: pointer; }
.t th.sort:hover { color: var(--text); }
.t th:first-child { border-top-left-radius: var(--radius); }
.t th:last-child { border-top-right-radius: var(--radius); }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t tr.clickable { cursor: pointer; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--crest-green)); border-radius: 99px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { padding: 16px; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; }
.stat .v { color: var(--accent); font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--text-2); }

/* ---------- boats ---------- */
.boats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.boat { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.boat.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.boat.clickable:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.boat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.boat-name { font-weight: 750; font-size: 16px; letter-spacing: -.01em; }
.boat-svg { width: 100%; height: 34px; color: var(--water); }
.boat.repair .boat-svg { color: var(--warn); }
.boat.retired { opacity: .6; }
.boat.retired .boat-svg { color: var(--text-3); }

/* ---------- subs ---------- */
.sub-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.sub { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sub-when { display: flex; gap: 12px; align-items: center; }
.datebox { width: 52px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent); text-align: center; padding: 6px 0; line-height: 1.1; }
.datebox b { display: block; font-size: 20px; font-weight: 800; }
.datebox span { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.sub .reason { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; color: var(--text-2); font-style: italic; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty svg { width: 42px; height: 42px; color: var(--text-3); margin-bottom: 8px; }
.empty h3 { margin: 0 0 4px; color: var(--text); }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 22, .45); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade .15s ease; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 700; color: var(--accent); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: space-between; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; flex-wrap: wrap; }
.modal-foot .r { display: flex; gap: 8px; margin-left: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* seat editor */
.seat-editor { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(var(--rows, 5), auto); grid-auto-flow: column; gap: 8px 14px; align-items: start; }
.se-row { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; }
.se-row .sl { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }
.se-status { font-size: 11.5px; margin: 2px 0 0 62px; min-height: 0; }
.se-status:empty { display: none; }

/* combobox */
.combo { position: relative; }
.combo .input { padding-right: 28px; }
.combo .input.bad { border-color: color-mix(in srgb, var(--bad) 60%, transparent); color: var(--bad); }
.combo .input.warn { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.combo .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 2px 4px; font-size: 16px; line-height: 1; }
.combo-list { position: absolute; z-index: 70; top: calc(100% + 4px); left: 0; right: 0; min-width: 260px; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; }
.combo-item { padding: 7px 9px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; }
.combo-item.hl, .combo-item:hover { background: var(--accent-soft); }
.combo-item .why { font-size: 11.5px; white-space: nowrap; }
.combo-item.dim .nm { color: var(--text-3); }
.combo-empty { padding: 10px; color: var(--text-3); font-size: 13px; }

/* identity */
.me-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; max-width: 220px; }
.me-chip:hover { background: var(--surface-3); }
.me-chip span.n { overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; background: linear-gradient(135deg, var(--oxford), var(--crest-green)); }
.role-badge { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; background: var(--crest-gold); color: #1d1500; }
.topbar .me-chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; }
.topbar .me-chip:hover { background: rgba(255, 255, 255, .16); }
.topbar .me-chip .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.topbar .btn.ghost { color: rgba(255, 255, 255, .8); }
.topbar .btn.ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.pick-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pick-list button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.pick-list button:hover { background: var(--surface-3); }

/* toast */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13.5px; animation: pop .2s ease; max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; }

.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 13.5px; align-items: flex-start; }
.callout.warn { background: var(--warn-soft); }
.callout.bad { background: var(--bad-soft); }
.callout svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--accent); }
.callout.warn svg { color: var(--warn); }
.callout.bad svg { color: var(--bad); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 600; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--accent); animation: spin .7s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .nav { order: 3; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
}
@media (max-width: 640px) {
  .main { padding: 16px 16px 80px; }
  .days { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .seat-editor { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
  .weekbar .label { min-width: 0; flex: 1; font-size: 15px; }
  .brand small { display: none; }
  .brand { font-size: 16px; }
  .brand-mark { height: 32px; }
  .page-head h1 { font-size: 26px; }
  .me-chip { max-width: 150px; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; overflow-y: auto; }
  .modal-foot { border-radius: 0; }
  .sub-list { grid-template-columns: 1fr; }
}

/* ---------- weekly sign-up ---------- */
.su-form { display: flex; flex-direction: column; gap: 14px; max-width: 860px; }
.su-sec { display: flex; gap: 16px; }
.su-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: var(--accent); color: var(--accent-text); margin-top: 2px; }
.su-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.su-body h3 { margin: 4px 0 0; font-family: var(--serif); font-size: 23px; font-weight: 700; color: var(--accent); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--border); background: var(--surface); padding: 7px 13px; border-radius: 99px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--text-2); transition: all .12s; }
.pill:hover { border-color: var(--border-strong); color: var(--text); }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.role-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.role-card { text-align: left; border: 1.5px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: all .12s; }
.role-card b { font-size: 14px; }
.role-card span { font-size: 12px; color: var(--text-3); }
.role-card:hover { border-color: var(--border-strong); }
.role-card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.role-card.on b { color: var(--accent); }
.stepper { display: flex; align-items: stretch; max-width: 170px; }
.stepper input { text-align: center; border-radius: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper button { width: 40px; flex: none; border: 1px solid var(--border); background: var(--surface-2); font-size: 18px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.stepper button:first-child { border-radius: 10px 0 0 10px; border-right: 0; }
.stepper button:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.stepper button:hover { background: var(--surface-3); color: var(--text); }
.su-day { display: flex; flex-direction: column; gap: 8px; }
.su-day-h { font-size: 13.5px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.slot { position: relative; text-align: left; border: 1.5px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 12px 10px 38px; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; transition: all .12s; }
.slot:hover { border-color: var(--border-strong); }
.slot-check { position: absolute; left: 11px; top: 12px; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; }
.slot-check svg { width: 12px; height: 12px; }
.slot.on { border-color: var(--accent); background: var(--accent-soft); }
.slot.on .slot-check { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.slot-time { font-weight: 750; font-size: 15px; }
.slot-meta { font-size: 12px; color: var(--text-3); }
.su-submit { display: flex; justify-content: flex-end; align-items: center; gap: 14px; position: sticky; bottom: 0; padding: 12px 0;
  background: linear-gradient(transparent, var(--bg) 30%); }
.su-submit .btn { padding: 11px 20px; font-size: 15px; }
.su-done { max-width: 560px; margin: 30px auto; padding: 34px 28px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.su-done h2 { margin: 0; font-family: var(--serif); font-size: 30px; color: var(--accent); }
.su-done p { margin: 0; }
.su-done-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto; }
.su-done-icon svg { width: 28px; height: 28px; }
.su-done-list { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.su-done-list > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.slot-admin { display: flex; flex-direction: column; gap: 8px; }
.slot-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
.slot-row .slot-time { min-width: 52px; }
.slot-counts { display: flex; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.slot-counts b { color: var(--accent); font-size: 14px; }
.grid-t .gc { text-align: center; padding: 8px 6px; min-width: 70px; }
.grid-t th.gc { font-size: 11px; line-height: 1.5; }
.grid-t th.gc .chip { font-size: 10.5px; padding: 0 6px; }
.grid-t td:first-child { white-space: nowrap; position: sticky; left: 0; background: var(--surface); }
.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--water-soft); color: var(--water); }
.tick.erg { background: var(--land-soft); color: var(--land); }
.tick.tank { background: var(--ok-soft); color: var(--ok); }
.tick svg { width: 13px; height: 13px; }
.grid-t tr.tot td { background: var(--surface-2); font-weight: 700; }
@media (max-width: 760px) {
  .role-cards { grid-template-columns: 1fr 1fr; }
  .su-sec { flex-direction: column; gap: 8px; }
  .slot-grid { grid-template-columns: 1fr 1fr; }
}

/* seat picker: room for sign-up chips */
.seat-editor .combo-list { min-width: 400px; }
.combo-item .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-item .why { display: flex; gap: 4px; flex: none; }
@media (max-width: 640px) { .seat-editor .combo-list { min-width: 0; } .combo-item .why .chip:nth-child(n+3) { display: none; } }

/* ---------- outing editor: sign-up pool ---------- */
.modal.xl { max-width: 1120px; }
.oe-crew-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.oe-crew .seat-editor { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; gap: 6px; }
.oe-hint { margin: -4px 0 10px; font-size: 12.5px; color: var(--text-3); }
.se-wrap { border-radius: 10px; padding: 2px 4px; margin: 0 -4px; transition: background .12s; }
.se-wrap.armed { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.se-row .sl-btn { border: 1px dashed transparent; background: transparent; cursor: pointer; padding: 6px 4px; border-radius: 8px; text-align: left; display: flex; align-items: center; gap: 4px; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }
.se-row .sl-btn:hover { border-color: var(--border-strong); color: var(--text); }
.se-row .sl-btn i { font-style: normal; font-size: 9.5px; font-weight: 800; padding: 0 4px; border-radius: 4px; background: var(--surface-3); color: var(--text-3); }
.se-wrap.armed .sl-btn { color: var(--accent); border-color: var(--accent); border-style: solid; }
.oe-pool { position: sticky; top: 0; max-height: 64vh; overflow-y: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.pool-head { display: flex; justify-content: space-between; align-items: baseline; }
.pool-head b { font-family: var(--serif); font-size: 20px; color: var(--accent); }
.pool-group { display: flex; flex-direction: column; gap: 4px; }
.pool-h { font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); display: flex; gap: 6px; align-items: baseline; padding: 0 2px 2px; cursor: default; }
.pool-hint { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-3); }
.pool-more summary { cursor: pointer; list-style: none; }
.pool-more summary::before { content: "▸"; font-size: 10px; }
.pool-more[open] summary::before { content: "▾"; }
.pool-more .pool-item { opacity: .75; }
.pool-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 7px 8px 7px 10px; cursor: pointer; transition: all .12s; font: inherit; color: inherit; }
.pool-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.pool-item.in { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pool-item.in .pi-name { color: var(--accent); font-weight: 700; }
.pool-item.bad .pi-name { color: var(--bad); }
.pi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pi-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-meta { display: flex; flex-wrap: wrap; gap: 3px; }
.pi-meta .chip { font-size: 11px; padding: 0 6px; }
.pi-state { flex: none; min-width: 34px; display: grid; place-items: center; color: var(--text-3); }
.pi-state svg { width: 16px; height: 16px; }
.pool-item:hover .pi-state { color: var(--accent); }
.pi-seat { font-size: 10.5px; font-weight: 800; text-transform: uppercase; background: var(--accent); color: var(--accent-text); border-radius: 6px; padding: 2px 5px; }
@media (max-width: 900px) {
  .oe-crew-wrap { grid-template-columns: 1fr; }
  .oe-pool { position: static; max-height: none; order: -1; }
}
.oe-crew .se-row { grid-template-columns: 78px 1fr; }
.oe-crew .se-status { margin-left: 86px; }
.callout a { font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- calendar subscription ---------- */
.cal-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cal-opt { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; transition: all .12s; }
.cal-opt b { font-size: 14.5px; color: var(--accent); }
.cal-opt span { font-size: 12px; color: var(--text-3); }
.cal-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 640px) { .cal-opts { grid-template-columns: 1fr; } }
.land-open .btn.sm { padding: 4px 12px; }

/* ---------- subs reminders ---------- */
.count-pill { background: var(--crest-gold); color: #1d1500; font-size: 11px; font-weight: 750; border-radius: 99px; padding: 0 6px; margin-left: 2px; }
.rem-h.bad { color: var(--bad); }
.rem-h.warn { color: var(--warn); }
.rem-h.accent { color: var(--accent); }
.rem-list { display: flex; flex-direction: column; gap: 8px; }
.rem { display: flex; gap: 14px; padding: 12px 14px; align-items: center; flex-wrap: wrap; }
.rem-main { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 4px; }
.rem-name { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rem-why { font-size: 13.5px; color: var(--text); }
.rem-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); align-items: center; }
.rem-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rem-reminded { border: 0; cursor: pointer; }

/* ---------- times & places ---------- */
.time-range { display: flex; align-items: center; gap: 6px; }
.time-range .input { min-width: 0; }
.o-sub a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
.o-sub a:hover { color: var(--accent); }
.places-list { display: flex; flex-direction: column; gap: 6px; }
.place-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 12px; cursor: pointer; font: inherit; color: inherit; }
.place-row:hover { border-color: var(--accent); }
.place-row > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* ---- leaderboard ---- */
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lb-board { padding: 16px; }
.lb-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.lb-ico { font-size: 22px; line-height: 1; width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-size: 14px; }
.lb-list li + li { border-top: 1px solid var(--border); }
.lb-list li.you { background: var(--accent-soft); border-top-color: transparent; }
.lb-list li.lb-gap { margin-top: 6px; border-top: 1px dashed var(--border-strong); }
.lb-rank { width: 24px; text-align: center; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-val { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.lb-empty { margin: 4px 0 0; }
.lb-me { margin-bottom: 4px; }
.lb-me-head { display: flex; gap: 12px; align-items: center; }
.lb-me-head .avatar { width: 40px; height: 40px; font-size: 15px; }
.lb-progress { margin: 14px 0; display: grid; gap: 6px; }
.lb-me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.lb-me-grid .k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; }
.lb-me-grid .v { font-size: 22px; font-weight: 800; color: var(--accent); }
.lb-me-grid .v.lb-small { font-size: 16px; padding-top: 4px; }
.lb-me-grid .s { font-size: 12.5px; color: var(--text-2); }
.lb-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.lb-teaser { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: inherit; text-decoration: none; }
.lb-teaser > div { flex: 1; }
.lb-teaser > svg { width: 18px; height: 18px; color: var(--text-3); }
