/* Bingo Hub: dark OSRS-ish theme (colours from Handover/reference/board-style.css) */
:root {
  --bg: #0d0f14;
  --bg-2: #141821;
  --panel: #181c26;
  --panel-2: #1f2430;
  --border: #2a3140;
  --text: #e7e9ee;
  --muted: #8e97a8;
  --gold: #e8b64c;
  --gold-2: #ffd77a;
  --brown: #a8741c;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --c1: #3ecf8e;
  --c2: #9bd35a;
  --c3: #e8c44c;
  --c4: #f08a3e;
  --c5: #ef5d5d;
  --done: #b8a06a;
  --want: #e8b64c;
  --help: #5aa9ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(232, 182, 76, .10), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(90, 169, 255, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--gold-2); }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.err { color: var(--c5); min-height: 1em; }
.warn { color: var(--gold-2) !important; }
.pixel { image-rendering: pixelated; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--gold-2); text-decoration: underline; text-underline-offset: 2px; }
.link.hint { color: var(--muted); font-size: 12px; }

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #3a4357; background: #262c3a; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.active { border-color: var(--gold); color: var(--gold-2); background: rgba(232, 182, 76, .1); }
.btn.active.help { border-color: var(--help); color: #a9d0ff; background: rgba(90, 169, 255, .1); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-big { padding: 14px 22px; font-size: 17px; width: 100%; }
.btn-primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1b1405; border-color: transparent; }
.btn-primary:hover { background: linear-gradient(180deg, #ffe39a, var(--gold-2)); border-color: transparent; }
.btn.danger:hover { color: var(--c5); border-color: var(--c5); }

.input {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); outline: none; min-width: 0;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 182, 76, .15); }
.input.num { width: 64px; }
textarea.input { width: 100%; resize: vertical; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel);
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
}
.chip:hover { color: var(--text); }
.chip.on { color: #1b1405; background: var(--gold); border-color: var(--gold); }
.chip.pick.on { background: var(--help); border-color: var(--help); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap;
  padding: 10px 20px; background: rgba(13, 15, 20, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--brown));
  color: #1b1405; font-family: "Cinzel", Georgia, serif; font-weight: 900; font-size: 19px;
  box-shadow: 0 0 20px rgba(232, 182, 76, .35);
}
.brand-mark.big { width: 56px; height: 56px; font-size: 30px; margin: 0 auto 8px; }
.brand h1 {
  margin: 0; font-family: "Cinzel", Georgia, serif; font-size: 20px; font-weight: 800; letter-spacing: .5px; white-space: nowrap;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.on { background: var(--c1); box-shadow: 0 0 8px var(--c1); }
.live.off { background: var(--c5); }
.summary-line { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); flex: 1; }
.summary-line b { color: var(--gold-2); font-size: 16px; }
.countdown { color: var(--text); }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-left: auto; }
.playing { white-space: nowrap; }
.playing b { color: var(--gold-2); }
.zone-btn { color: var(--muted); }

.tabs {
  display: flex; gap: 4px; padding: 6px 20px 0; border-bottom: 1px solid var(--border);
  background: rgba(13, 15, 20, .6); overflow-x: auto;
}
.tab {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px 10px 0 0;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; border: 1px solid transparent; border-bottom: 0;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold-2); background: var(--panel); border-color: var(--border); }
.tab-icon { font-size: 13px; }

.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 30; display: none;
  padding: 14px 20px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 800; font-size: 16px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1b1405; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}

main { padding: 0; }
.page { max-width: 1300px; margin: 0 auto; padding: 16px 20px 90px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title { font-family: "Cinzel", Georgia, serif; color: var(--gold-2); margin: 4px 0 10px; font-size: 22px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }

/* ---------- board layout ---------- */
.layout {
  display: grid; grid-template-columns: 170px minmax(0, 1fr) 340px; gap: 18px; align-items: start;
  max-width: 1700px; margin: 0 auto; padding: 14px 20px 90px;
}
.board-col { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.board-controls { width: 100%; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center; }
.legend-item {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 4px 9px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); font-size: 12px;
}
.legend-item i { width: 10px; height: 10px; border-radius: 3px; background: var(--tone); }
.c1 { --tone: var(--c1); } .c2 { --tone: var(--c2); } .c3 { --tone: var(--c3); }
.c4 { --tone: var(--c4); } .c5 { --tone: var(--c5); } .done { --tone: var(--done); }
.neutral { --tone: #6b7385; }
.tile.neutral .tile-hours { color: var(--text); }
.footnote { text-align: center; max-width: 760px; margin: 0; }

.board {
  --gap: 10px; --lab: 56px;
  width: min(100%, calc(100vh - 190px));
  min-width: 300px;
  display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)) var(--lab); gap: var(--gap);
  container-type: inline-size;
}
.board.no-lines { grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); }

.tile {
  position: relative; display: flex; flex-direction: column; aspect-ratio: 1; overflow: hidden; text-align: left;
  padding: clamp(4px, 1.1cqw, 10px); padding-bottom: clamp(9px, 1.6cqw, 14px); border-radius: var(--radius); cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--tone) 70%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tone) 26%, transparent), color-mix(in srgb, var(--tone) 6%, transparent)),
    var(--panel);
  transition: transform .15s, box-shadow .15s, opacity .15s, filter .15s;
  -webkit-touch-callout: none; user-select: none;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 0 22px color-mix(in srgb, var(--tone) 30%, transparent); }
.tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tile.is-done { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(232, 182, 76, .25); background: linear-gradient(180deg, rgba(232, 182, 76, .18), rgba(232, 182, 76, .04)), var(--panel); }
.tile.is-done .tile-hours { color: var(--gold-2); }
.tile.is-done .tile-img { filter: grayscale(.5) drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); opacity: .8; }
.tile.overlap::after {
  content: "2+"; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  font-size: clamp(8px, 1.2cqw, 11px); font-weight: 800; padding: 1px 7px; border-radius: 0 0 6px 6px; background: var(--want); color: #1b1405;
}
.board.filtered .tile.dimmed { opacity: .22; filter: saturate(.3); }
.board.picking .tile { cursor: cell; }
.board.picking .tile.mine-want { outline: 3px solid var(--want); outline-offset: 1px; }
.board.picking .tile.mine-help { outline: 3px dashed var(--help); outline-offset: 1px; }

.tile-top { display: flex; justify-content: space-between; gap: 4px; align-items: flex-start; }
.tile-title {
  font-size: clamp(9px, 1.7cqw, 15px); font-weight: 700; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-pts { flex: none; font-size: clamp(8px, 1.4cqw, 12px); font-weight: 800; color: var(--gold-2); background: rgba(0, 0, 0, .35); border-radius: 6px; padding: 1px 5px; }
.tile-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; padding: 2px 16%; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); }
.tile-chips { position: absolute; top: clamp(22px, 4.6cqw, 40px); right: clamp(3px, .8cqw, 8px); display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.tile-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; }
.tile-hours { font-size: clamp(11px, 3cqw, 26px); font-weight: 800; line-height: 1; color: var(--tone); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); white-space: nowrap; }
.tile-count { font-size: clamp(8px, 1.4cqw, 12px); color: var(--text); font-weight: 700; opacity: .85; }
.tile-prog { position: absolute; left: 6px; right: 6px; bottom: 4px; height: 5px; display: flex; gap: 2px; }
.tile-prog .seg { display: block; height: 100%; border-radius: 999px; background: rgba(0, 0, 0, .5); overflow: hidden; }
.tile-prog .seg i { display: block; height: 100%; background: var(--c1); box-shadow: 0 0 6px rgba(62, 207, 142, .7); }
.tile.is-done .tile-prog .seg i { background: var(--gold); box-shadow: none; }

.pchip {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 999px;
  font-size: 10px; font-weight: 800; background: var(--want); color: #1b1405; line-height: 1;
}
.pchip.help { background: transparent; border: 1.5px solid var(--help); color: #a9d0ff; }
.pchip.me { box-shadow: 0 0 0 2px var(--text); }
.pchip.more { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.pchip.big { height: auto; padding: 4px 10px; font-size: 13px; }

.line-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 10px; border: 1px dashed var(--border); color: var(--muted);
  font-size: 11px; line-height: 1.15; text-align: center; min-width: 0;
}
.line-label b { color: var(--text); font-size: 13px; }
.line-label small { font-size: 10px; }
.line-label.done { border-color: var(--gold); border-style: solid; }
.line-label.done b { color: var(--gold-2); }
.col-label { padding: 5px 2px; min-height: 46px; }
.corner-cell { display: flex; flex-direction: column; gap: 3px; }
.corner-cell .line-label { flex: 1; flex-direction: row; flex-wrap: wrap; gap: 0 3px; padding: 1px; }
.corner-cell .line-label b { font-size: 10px; }
.corner-cell .line-label small:last-child { display: none; }
.glyph { color: var(--gold); }

/* ---------- names column: hover a name to highlight their tiles ---------- */
.people { position: sticky; top: 112px; }
.people h3 { margin: 4px 0 8px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.people-list { display: grid; gap: 4px; }
.person-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%;
  padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); cursor: pointer;
  font-size: 13px; font-weight: 600; text-align: left;
}
.person-btn:hover, .person-btn:focus-visible { border-color: var(--gold); background: var(--panel-2); outline: none; }
.person-btn.pinned { border-color: var(--gold); background: rgba(232, 182, 76, .14); color: var(--gold-2); }
.person-btn.me .person-name::after { content: " (you)"; color: var(--muted); font-weight: 400; }
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-count { flex: none; font-size: 11px; }
.cw { color: var(--want); }
.ch { color: var(--help); }
.people .hint { font-size: 11px; margin: 8px 0 0; }
.board.person-hl .tile { opacity: .2; filter: saturate(.25); }
.board.person-hl .tile.hl-want, .board.person-hl .tile.hl-help { opacity: 1; filter: none; transform: translateY(-2px); }
.board.person-hl .tile.hl-want { outline: 3px solid var(--want); outline-offset: 2px; }
.board.person-hl .tile.hl-help { outline: 3px dashed var(--help); outline-offset: 2px; }

/* ---------- sidebar ---------- */
.info-intro { margin: -4px 0 10px; }
.info-names { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.info-name {
  position: relative; padding: 6px 10px; border-radius: 8px; border: 1.5px solid var(--gold); background: transparent;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text);
}
.info-name:hover { background: rgba(232, 182, 76, .1); }
.info-name.sel { background: var(--gold); color: #1b1405; }
.info-name.has-note::after {
  content: ""; position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--c1); box-shadow: 0 0 0 2px var(--panel);
}
.info-box .note-card { margin: 0; min-height: 110px; border: 1px solid var(--border); border-left: 3px solid var(--want); }
.info-box .note-card.me { border-left-color: var(--help); }
.note-away { font-size: 13px; margin: 6px 0; display: grid; gap: 2px; }
.side { position: sticky; top: 112px; max-height: calc(100vh - 124px); overflow: auto; }
.note-card { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); margin-bottom: 8px; border-left: 3px solid var(--want); }
.note-card.me { border-left-color: var(--help); background: color-mix(in srgb, var(--help) 7%, var(--bg-2)); }
.note-card.stale { opacity: .6; border-left-color: var(--border); }
.note-card.empty p { margin: 4px 0 8px; }
.note-head { display: flex; gap: 8px; align-items: baseline; }
.note-head .hint { font-size: 12px; }
.note-edit { margin-left: auto; padding: 2px 8px; }
.note-text { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; }
.note-avail, .note-usual { font-size: 13px; color: #c9ceda; margin: 2px 0; }
.note-usual { color: var(--muted); }
.note-tiles { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; }
.tag.on { background: var(--gold); color: #1b1405; border-color: var(--gold); }
.note-tiles.pick .tag { font-size: 13px; padding: 5px 9px; }
.online { display: flex; flex-wrap: wrap; gap: 6px; }
.shout-form { display: flex; gap: 6px; margin-bottom: 8px; }
.shout-form .input { flex: 1; }
.shout-list { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 5px; overflow-wrap: anywhere; }
.history { list-style: none; padding: 0; display: grid; gap: 10px; }
.history li { padding: 8px; background: var(--bg-2); border-radius: 8px; white-space: pre-wrap; }

/* ---------- dialogs ---------- */
.modal {
  width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  padding: 0; border: 1px solid var(--border); border-radius: 18px;
  background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal::backdrop { background: rgba(5, 6, 9, .7); backdrop-filter: blur(3px); }
.modal-body { padding: 20px; }
.small-modal { width: min(520px, calc(100vw - 24px)); }
.modal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.modal-head img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.modal-head h2 { margin: 0 0 3px; font-size: 20px; }
.modal-close { margin-left: auto; align-self: flex-start; }
.modal-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 8px; }

/* side drawer for tile details */
.drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 100vw); border-radius: 18px 0 0 18px;
  border-right: 0; overflow: auto;
}
.drawer[open] { animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }

.desc { white-space: pre-line; color: #c9ceda; background: var(--bg-2); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.stat-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.stat { padding: 7px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); }
.stat b { display: block; font-size: 16px; color: var(--gold-2); }
.stat span { font-size: 12px; color: var(--muted); }
.big-stat b { font-size: 22px; }
.section-title { margin: 18px 0 8px; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }

.groups { display: grid; gap: 6px; margin-bottom: 8px; }
.req { padding: 8px 10px; border-radius: 10px; background: var(--bg-2); }
.req.complete { box-shadow: inset 3px 0 0 var(--gold); }
.req-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-bottom: 6px; }
.have small { color: var(--muted); font-weight: 400; }
.bar { height: 6px; border-radius: 999px; background: rgba(0, 0, 0, .45); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--c1); }
.req.complete .bar span { background: var(--gold); }

.interest-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.who-list { display: grid; gap: 3px; font-size: 14px; }
.drop-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14px; }
.drop-list li { display: flex; gap: 10px; padding: 5px 8px; background: var(--bg-2); border-radius: 8px; }
.drop-when { color: var(--muted); white-space: nowrap; font-size: 13px; }
.exp-list { display: flex; flex-wrap: wrap; gap: 5px; }
.exp-chip { font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 7px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
th.num, td.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.sources tr.off td { opacity: .45; }
.sources tr.used td:first-child { box-shadow: inset 3px 0 0 var(--gold); }

/* ---------- logging ---------- */
.sheet { width: min(640px, calc(100vw - 24px)); }
.sheet-head { display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; gap: 8px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 18px; text-align: center; }
.sheet-head > :last-child { justify-self: end; }
.item-picker { display: grid; gap: 10px; }
.item-group-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.item-group.complete .item-btn { opacity: .5; }
.item-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.item-btn {
  min-height: 48px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2);
  cursor: pointer; font-weight: 600; font-size: 14px; text-align: left; line-height: 1.2;
}
.item-btn:hover { border-color: var(--gold); background: #262c3a; }
.item-btn.other { border-style: dashed; color: var(--muted); }

.mini-grid { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 6px; }
.mini-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; min-height: 92px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; font-size: 12px; font-weight: 700;
}
.mini-tile:hover { border-color: var(--gold); }
.mini-tile img { width: 44px; height: 44px; object-fit: contain; }
.mini-name { text-align: center; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.mini-prog { color: var(--muted); font-weight: 600; font-size: 11px; }
.mini-tile.is-done { border-color: var(--gold); }
.mini-tile.is-done .mini-prog { color: var(--gold-2); }
.log-page { max-width: 820px; }

.confirm-form { display: grid; gap: 12px; }
.confirm-what { display: flex; gap: 12px; align-items: center; background: var(--bg-2); padding: 10px; border-radius: 12px; font-size: 17px; }
.confirm-what img { width: 52px; height: 52px; object-fit: contain; }
.field { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }
.field > span { color: var(--muted); font-size: 14px; }
.field.col { grid-template-columns: 1fr; gap: 4px; margin-top: 10px; }
.field .input { width: 100%; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .btn { width: 48px; height: 44px; font-size: 22px; padding: 0; }
.count-out { min-width: 36px; text-align: center; font-size: 20px; font-weight: 800; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(520px, calc(100vw - 24px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px;
  background: #232937; border: 1px solid var(--border); box-shadow: var(--shadow); animation: pop .18s ease-out; font-size: 14px;
}
.toast > span { flex: 1; }
.toast.err { border-color: var(--c5); }
.toast.info { border-color: var(--help); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .25s; }
.toast-action { background: var(--gold); color: #1b1405; border-color: var(--gold); }
.toast-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
/* keep toasts above open dialogs */
dialog[open] ~ .toasts { z-index: 2147483647; }

/* ---------- landing ---------- */
.landing { position: fixed; inset: 0; z-index: 50; overflow: auto; display: grid; place-items: start center; padding: 6vh 14px 40px; background: var(--bg); }
.landing-card { width: min(640px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 24px; text-align: center; display: grid; gap: 12px; box-shadow: var(--shadow); }
.landing-card h1 { margin: 0; font-family: "Cinzel", Georgia, serif; color: var(--gold-2); }
.landing-card p { margin: 0; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.name-btn {
  padding: 16px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer;
  font-weight: 700; font-size: 16px;
}
.name-btn:hover, .name-btn.sel { border-color: var(--gold); color: var(--gold-2); }
.other-row { display: flex; gap: 8px; }
.big-input { flex: 1; padding: 12px; font-size: 16px; }
.tz-details { text-align: left; }
.tz-details summary { cursor: pointer; color: var(--gold-2); margin-bottom: 8px; }
.tz-picker { display: grid; gap: 8px; text-align: left; }
.tz-search { width: 100%; }
.tz-list { max-height: 300px; overflow: auto; display: grid; gap: 2px; border: 1px solid var(--border); border-radius: 10px; padding: 4px; background: var(--bg-2); }
.tz-item { text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 14px; }
.tz-item:hover { background: var(--panel-2); }
.tz-item.sel { background: rgba(232, 182, 76, .18); color: var(--gold-2); font-weight: 700; }
.tz-more { padding: 6px 10px; margin: 0; }

/* ---------- drops page ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.drops-table tr.deleted td { opacity: .5; text-decoration: line-through; }
.drops-table tr.deleted td:last-child { text-decoration: none; opacity: 1; }

/* ---------- schedules ---------- */
.zone-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.zone-box b { color: var(--gold-2); }
.sched-grid { border-collapse: separate; border-spacing: 2px; table-layout: fixed; min-width: 640px; }
.sched-grid th, .sched-grid td { border: 0; padding: 0; text-align: center; }
.sched-grid thead th { font-size: 10px; letter-spacing: 0; font-weight: 600; text-align: left; text-transform: none; }
.sched-grid tbody th { width: 38px; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--muted); text-align: left; }
.sched-grid th.today { color: var(--gold-2); }
.editor td.ec { height: 26px; background: var(--bg-2); border-radius: 3px; cursor: pointer; touch-action: none; }
.editor td.ec:nth-child(odd) { box-shadow: inset 1px 0 0 rgba(0, 0, 0, .35); }
.editor td.ec.on { background: var(--gold); }
.editor td.ec.maybe { background: repeating-linear-gradient(45deg, rgba(232, 182, 76, .55) 0 4px, rgba(232, 182, 76, .15) 4px 8px); }
.legend-item.on i { background: var(--gold); }
.legend-item.maybe i { background: repeating-linear-gradient(45deg, rgba(232, 182, 76, .7) 0 3px, rgba(232, 182, 76, .2) 3px 6px); }
.grid-editor { user-select: none; margin: 8px 0; }
.grid-editor .legend { justify-content: flex-start; margin-top: 6px; }
.range-editor { display: none; gap: 8px; margin: 8px 0; }
.range-day { background: var(--bg-2); border-radius: 10px; padding: 8px 10px; display: grid; gap: 6px; }
.range-day-head { display: flex; justify-content: space-between; align-items: center; }
.range-row { display: flex; gap: 6px; align-items: center; }
.range-row .input[type="time"] { width: 110px; }
.save-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; }

/* foldable panels */
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--gold); font-size: 14px; transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary h3 { margin: 0; }
details.fold > summary:hover h3 { color: var(--text); }
details.fold[open] > .fold-body { margin-top: 10px; }

/* absences */
.absence-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.absence-form .field.col { margin: 0; }
.absence-form .grow { flex: 1; min-width: 220px; }
.absence-list { display: grid; gap: 6px; margin: 14px 0 8px; }
.absence-day { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 10px; background: var(--bg-2); border-radius: 10px; }
.absence-date { font-weight: 700; color: var(--gold-2); }
.absence-people { display: grid; gap: 4px; }
.absence-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.absence-item .btn { padding: 1px 7px; }
.absence-kind { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: rgba(239, 93, 93, .15); color: #ff9a9a; }
.absence-item.limited .absence-kind { background: rgba(232, 182, 76, .15); color: var(--gold-2); }

.heat td.hc {
  height: 30px; border-radius: 4px; font-size: 11px; font-weight: 700; cursor: pointer;
  background: color-mix(in srgb, var(--gold) calc(var(--a) * 85%), var(--bg-2));
  color: color-mix(in srgb, #1b1405 calc(var(--a) * 100%), var(--muted));
}
.heat td.hc.nomatch { opacity: .35; }
.heat td.hc.match { outline: 2px solid var(--c1); outline-offset: -2px; opacity: 1; }
.heat td.hc.now { box-shadow: inset 0 0 0 2px var(--help); }
.heat td.hc.sel { outline: 2px solid var(--text); outline-offset: -2px; }
.heat th.now-col { color: var(--help); }
.heat-detail { min-height: 1.4em; }
.find { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.person-rows { display: grid; gap: 8px; margin-top: 12px; }
.person-row { display: grid; gap: 4px; padding: 8px 10px; background: var(--bg-2); border-radius: 10px; }
.person-row.me { box-shadow: inset 3px 0 0 var(--help); }
.person-meta { font-size: 14px; }
.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; overflow-x: auto; }
.strip-day { display: grid; grid-template-columns: 12px repeat(24, minmax(2px, 1fr)); gap: 1px; align-items: center; }
.strip-label { font-size: 10px; color: var(--muted); }
.strip i { display: block; height: 12px; background: var(--panel-2); border-radius: 1px; }
.strip i.on { background: var(--gold); }
.strip i.maybe { background: rgba(232, 182, 76, .4); }
.strip i.now { box-shadow: 0 0 0 1px var(--help); }

/* ---------- interest matrix ---------- */
.matrix { width: auto; border-collapse: collapse; }
.matrix th, .matrix td { border-bottom: 1px solid var(--border); text-align: center; padding: 4px; }
.mx-name { text-align: left !important; white-space: nowrap; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); }
.matrix tr.me .mx-name { color: var(--help); }
.mx-tile { vertical-align: bottom; height: 120px; }
.mx-tile .vert { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; text-transform: none; letter-spacing: 0; }
.mx-tile.overlap, .mx-cell.overlap { background: rgba(232, 182, 76, .09); }
.mx-tile.done .vert { color: var(--muted); text-decoration: line-through; }
.mx-cell { width: 30px; font-size: 15px; }
.mx-cell.want { color: var(--want); }
.mx-cell.help { color: var(--help); }
.mx-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px dashed var(--border); background: transparent; cursor: pointer; color: inherit; padding: 0; }
.mx-total td { font-size: 11px; color: var(--muted); }
.mx-total td.overlap { color: var(--gold-2); font-weight: 700; }

/* ---------- progress ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--gold); stroke: var(--panel); stroke-width: 2; }
.chart .label { fill: var(--text); font-size: 12px; font-weight: 700; }
.chart .cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; background: #232937; border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; font-size: 12px; box-shadow: var(--shadow); width: 190px; }
.chart-table { margin-top: 6px; }
.chart-table summary { cursor: pointer; }
.best { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; }
.best-val { margin-left: 8px; font-weight: 700; color: var(--gold-2); }
.hbars { display: grid; gap: 4px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 60px 76px; gap: 8px; align-items: center; background: none; border: 0; padding: 3px 4px; border-radius: 6px; cursor: pointer; text-align: left; font-size: 13px; }
.hbar:hover { background: var(--panel-2); }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; }
.hbar-fill { display: block; height: 100%; background: var(--gold); border-radius: 0 4px 4px 0; }
.hbar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.hbar-pph { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; padding: 10px 10px 90px; }
  .people { position: static; }
  .people-list { display: flex; flex-wrap: wrap; gap: 5px; }
  .person-btn { width: auto; padding: 5px 9px; }
  .people .hint { display: none; }
  .board { width: 100%; --gap: 6px; --lab: 44px; }
  .side { position: static; max-height: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { font-size: 14px; }
  .topbar { padding: 8px 10px; gap: 6px 10px; }
  .brand h1 { font-size: 17px; }
  .summary-line { order: 3; flex-basis: 100%; font-size: 12px; gap: 4px 10px; }
  .summary-line b { font-size: 14px; }
  .who { font-size: 13px; }
  .zone-btn { padding: 4px 6px; }
  /* bottom tab bar on phones */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border); border-bottom: 0; background: rgba(13, 15, 20, .96); justify-content: space-around; gap: 0;
  }
  .tab { flex-direction: column; gap: 1px; padding: 5px 4px; font-size: 10px; border-radius: 8px; border: 0; flex: 1; text-align: center; }
  .tab.active { background: var(--panel-2); }
  .tab-icon { font-size: 17px; }
  .page { padding: 12px 10px 90px; }
  .board { --gap: 4px; --lab: 34px; min-width: 0; }
  .tile { border-radius: 8px; padding: 3px; padding-bottom: 8px; border-width: 1.5px; }
  .tile-img { padding: 1px 12%; }
  .tile-pts { display: none; }
  .tile-count { display: none; }
  .tile-chips { top: auto; bottom: 22px; right: 2px; flex-direction: row; }
  .pchip { min-width: 14px; height: 13px; font-size: 7px; padding: 0 2px; }
  .tile-chips .pchip:nth-child(n+3) { display: none; }
  .tile.overlap::after { font-size: 7px; padding: 0 4px; }
  .line-label { font-size: 8px; border-radius: 6px; }
  .line-label b { font-size: 9px; }
  .line-label small { font-size: 8px; }
  .corner-cell .line-label b { font-size: 8px; }
  .board-controls .chips.right { display: none; }
  .chip { padding: 5px 10px; font-size: 12px; }
  .footnote { font-size: 11px; }
  .modal { max-height: 100dvh; width: 100vw; max-width: 100vw; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .small-modal, .sheet { height: auto; max-height: 92dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .drawer { width: 100vw; border-radius: 0; }
  .modal-body { padding: 14px 14px calc(20px + env(safe-area-inset-bottom)); }
  .item-buttons { grid-template-columns: 1fr 1fr; }
  .mini-grid { gap: 4px; }
  .mini-tile { min-height: 78px; padding: 4px 2px; font-size: 10px; }
  .mini-tile img { width: 34px; height: 34px; }
  .field { grid-template-columns: 90px 1fr; }
  .fab { display: block; bottom: calc(68px + env(safe-area-inset-bottom)); right: 12px; padding: 12px 16px; font-size: 15px; }
  body:not(:has(#view[data-view="board"])) .fab { display: none; }
  .toasts { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .grid-editor { display: none; }
  .range-editor { display: grid; }
  .hbar { grid-template-columns: 80px 1fr 50px; }
  .hbar-pph { display: none; }
  .absence-day { grid-template-columns: 1fr; gap: 4px; }
}
