:root {
  --bg: #0a101c;
  --panel: #101828;
  --panel-2: #141e31;
  --line: #1f2b40;
  --line-2: #2a3850;
  --text: #e9eef6;
  --muted: #8d9ab0;
  --dim: #5f6c82;
  --gold: #d9b45e;
  --gold-ink: #1b1608;
  --green: #2fcf8a;
  --green-bg: rgba(47, 207, 138, .14);
  --red: #f0606f;
  --red-bg: rgba(240, 96, 111, .14);
  --blue: #5b8cf0;
  --amber: #f0a64a;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --r: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.35 var(--sans); }
body { min-height: 100vh; overscroll-behavior-y: none; overflow-x: hidden; }
main, .cards, .card { min-width: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
.boot { padding: 40px; color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.serif { font-family: var(--serif); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 14px 20px 10px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; border-bottom: 1px solid transparent; }
.brand .kicker { font-size: 10px; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
.brand h1 { margin: 2px 0 0; font: 400 23px/1.1 var(--serif); }
.brand .ev { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tabs { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tabs button { min-height: 40px; padding: 0 20px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs button.on { background: var(--gold); color: var(--gold-ink); }
.top-right { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.chip-btn { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip-btn.gold { border-color: var(--gold); color: var(--gold); }
.chip-btn.solid { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.live { font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--dim); flex: none; }
.dot.on { background: var(--green); }
.dot.off { background: var(--red); }
.dot.drop { background: transparent; border: 1.5px solid var(--red); }
.dot.amber { background: var(--amber); }
.bottom-nav { display: none; }

main { padding: 6px 20px 120px; max-width: 1400px; margin: 0 auto; }

/* ---------- slot strip ---------- */
.slots { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.slots .arrow { width: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; color: var(--muted); flex: none; }
.slots, .slot-list { min-width: 0; }
.slot-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.slot-list::-webkit-scrollbar { display: none; }
.slot { flex: none; min-width: 86px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); text-align: center; }
.slot b { display: block; font-size: 16px; }
.slot span { font-size: 11px; color: var(--muted); }
.slot.done b { color: var(--muted); }
.slot.done span { color: var(--green); }
.slot.cur { border-color: var(--gold); background: #1d1a10; }
.slot.cur b, .slot.cur span { color: var(--gold); }
.slot.sel { outline: 2px solid var(--blue); outline-offset: -2px; }

/* ---------- progress bar ---------- */
.bar { display: flex; align-items: center; gap: 18px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; }
.bar .count { white-space: nowrap; }
.bar .count big { font: 400 26px var(--serif); }
.bar .count .sub { font-size: 12px; color: var(--gold); }
.progress { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; min-width: 60px; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 3px; transition: width .3s; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; min-height: 44px; }
.toggle .sw { width: 42px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #c9d2e0; transition: left .2s; }
.toggle.on .sw { background: var(--green); }
.toggle.on .sw::after { left: 21px; background: #0b1a13; }
.big-btn { min-height: 48px; padding: 0 20px; border-radius: 10px; background: var(--gold); color: var(--gold-ink); font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.big-btn:disabled { opacity: .35; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 12px 10px; display: flex; flex-direction: column; }
.card.done { opacity: .55; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 15px; }
.card-h .loc { font-size: 12px; color: var(--muted); margin-top: 1px; }
.card-h .here { font-size: 11px; color: var(--muted); white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); display: inline-grid; place-items: center; color: var(--gold); font-size: 18px; line-height: 1; }
.line { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.line:last-of-type { border-bottom: 0; }
.line .who { flex: 1; min-width: 0; cursor: pointer; }
.line .nm { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.line .nm .tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--line-2); color: var(--muted); }
.line .nm .tag.os { background: rgba(91, 140, 240, .18); color: var(--blue); }
.line .nm .tag.ns { background: var(--red-bg); color: var(--red); }
.line .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line .last { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.line .last b { color: var(--muted); font-weight: 600; }
.line .last.gap b { color: var(--amber); }
.line.held .nm { color: var(--muted); }
.line.cxl .nm { text-decoration: line-through; color: var(--dim); }
.tick { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.tick i { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--gold); display: grid; place-items: center; transition: all .12s; }
.tick.on i { background: var(--green); border-color: var(--green); }
.tick.on i::after { content: ''; width: 7px; height: 13px; border: solid #062014; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
.tick.dis i { border-color: var(--line-2); }
.card-f { margin-top: 8px; }
.card-f button { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--r); }
.open-strip { margin-top: 14px; padding: 12px 14px; background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--r); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.open-strip .lbl { font-size: 12px; color: var(--muted); margin-right: 4px; }
.pill { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px dashed var(--gold); color: var(--gold); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---------- find ---------- */
.find-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.search { flex: 1 1 280px; position: relative; }
.search input { padding-left: 38px; border-color: var(--gold); }
.search::before { content: ''; position: absolute; left: 13px; top: 14px; width: 11px; height: 11px; border: 2px solid var(--muted); border-radius: 50%; }
.search::after { content: ''; position: absolute; left: 25px; top: 27px; width: 6px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.find-bar select { width: auto; min-width: 120px; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; overflow-x: auto; }
.seg button { min-height: 38px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
table.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr.row { cursor: pointer; }
table.grid tr.now { background: rgba(217, 180, 94, .05); }
table.grid tr.cxl td { color: var(--dim); }
table.grid tr.cxl .nm, table.grid tr.cxl .sp { text-decoration: line-through; }
table.grid td.t { font-weight: 700; white-space: nowrap; }
table.grid .nm { font-weight: 600; }
.st { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.st.held { background: var(--green-bg); color: var(--green); }
.st.now { background: var(--gold); color: var(--gold-ink); }
.st.upcoming { background: var(--line); color: var(--muted); }
.st.noshow { background: var(--red-bg); color: var(--red); }
.st.absent { background: var(--line); color: var(--red); }
.st.cancelled { border: 1px solid var(--line-2); color: var(--muted); }
.find-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 10px 2px; }
.people-hits { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.people-hits button { padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; }
.mobile-rows { display: none; }

/* ---------- sponsors ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.kpi big { font: 400 28px var(--serif); display: block; }
.kpi span { font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); padding: 10px 2px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.seg-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); min-width: 120px; }
.seg-bar i { display: block; height: 100%; }
.hatch { background: repeating-linear-gradient(-45deg, var(--gold) 0 4px, #3a301a 4px 8px); }
.num { font: 400 17px var(--serif); text-align: center; }
.num.g { color: var(--green); } .num.b { color: var(--blue); } .num.o { color: var(--gold); } .num.z { color: var(--dim); }
.nc { font-size: 13px; font-weight: 700; white-space: nowrap; text-align: center; }
.nc .r { color: var(--red); }
.open-slots { display: flex; gap: 6px; flex-wrap: wrap; }
.open-slots .pill { min-height: 30px; font-size: 12px; padding: 0 10px; }

/* ---------- sheets / modals ---------- */
.scrim { position: fixed; inset: 0; background: rgba(3, 6, 12, .62); z-index: 50; display: flex; justify-content: center; align-items: flex-end; }
.sheet { background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px 16px 0 0; width: min(760px, 100%); max-height: 92vh; display: flex; flex-direction: column; padding-bottom: var(--safe-b); }
@media (min-width: 768px) { .scrim { align-items: center; } .sheet { border-radius: 16px; max-height: 88vh; } }
.sheet-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { margin: 0; font: 400 21px var(--serif); }
.sheet-h .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sheet-b { padding: 14px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.x { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 20px; color: var(--muted); flex: none; }
.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; font-size: 14px; }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.danger { color: var(--red); border-color: rgba(240, 96, 111, .4); }
.btn:disabled { opacity: .4; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.timeline .tm { width: 92px; flex: none; font-weight: 700; font-size: 13px; }
.timeline .what { flex: 1; font-size: 14px; }
.timeline .what small { display: block; color: var(--muted); font-size: 12px; }
.timeline li.gap .what { color: var(--amber); }
.timeline li.mtg .what b { color: var(--gold); }
.timeline li.here { background: rgba(217, 180, 94, .06); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cand { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 6px; cursor: pointer; min-height: 52px; }
.cand.sel { border-color: var(--gold); background: #1d1a10; }
.cand .who { flex: 1; min-width: 0; }
.cand .nm { font-weight: 600; font-size: 14px; }
.cand .meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.rank.r1 { background: var(--gold); color: var(--gold-ink); }
.rank.r2 { background: rgba(217, 180, 94, .2); color: var(--gold); }
.rank.r3 { background: rgba(91, 140, 240, .2); color: var(--blue); }
.rank.r4 { background: var(--green-bg); color: var(--green); }
.rank.r5 { background: var(--line); color: var(--muted); }
.rank.r9 { background: var(--red-bg); color: var(--red); }
.section-t { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.ms-list label { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); min-height: 48px; font-size: 14px; }
.ms-list input { width: 22px; height: 22px; min-height: 0; accent-color: var(--gold); flex: none; }

/* ---------- settings ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px; }
.panel h2 { margin: 0 0 4px; font: 400 19px var(--serif); }
.panel p.help { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.set-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.diff { font-size: 13px; }
.diff .grp { margin: 10px 0 4px; font-weight: 700; }
.diff ul { margin: 0; padding-left: 18px; color: var(--muted); }
.diff-badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.diff-badges span { padding: 6px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini th, table.mini td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.mini th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
table.mini input { min-height: 36px; padding: 6px 8px; width: 70px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.warn { color: var(--amber); font-size: 13px; }
.bad { color: var(--red); font-size: 13px; }

/* ---------- login ---------- */
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 20px; }
.login h1 { font: 400 32px var(--serif); margin: 6px 0 24px; }
.login .kicker { font-size: 11px; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
.login .btn { width: 100%; margin-top: 6px; }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: #eef2f8; color: #0b1220; border-radius: 22px; padding: 6px 6px 6px 16px; display: flex; align-items: center; gap: 12px; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); min-height: 44px; }
.toast.plain { padding: 10px 16px; }
.toast button { background: #0b1220; color: var(--gold); font-weight: 700; border-radius: 16px; padding: 0 16px; min-height: 34px; }
.banner { margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13px; background: rgba(240, 166, 74, .12); color: var(--amber); border: 1px solid rgba(240, 166, 74, .3); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr auto; padding: 12px 14px 8px; }
  .top .tabs { display: none; }
  .brand h1 { font-size: 21px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #0d1422; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
  .bottom-nav button { flex: 1; min-height: 58px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
  .bottom-nav button.on { color: var(--gold); }
  .bottom-nav svg { width: 20px; height: 20px; }
  main { padding: 4px 14px calc(150px + var(--safe-b)); }
  #toast-root { bottom: calc(140px + var(--safe-b)); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .set-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .cards { grid-template-columns: 1fr; }
  .slots .arrow { display: none; }
  .bar { flex-wrap: wrap; gap: 8px 14px; padding: 10px 12px; }
  .bar .progress { order: 3; flex-basis: 100%; }
  .bar .mark-all-top { display: none; }
  .mark-all-fixed { position: fixed; left: 14px; right: 14px; bottom: calc(68px + var(--safe-b)); z-index: 25; width: auto; justify-content: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
  .table-wrap.desktop { display: none; }
  .mobile-rows { display: block; }
  .mrow { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
  .mrow .who { flex: 1; min-width: 0; }
  .mrow .l1 { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
  .mrow .l2 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mrow.cxl .l1 { text-decoration: line-through; color: var(--dim); }
  .sp-table { display: none; }
  .sp-cards { display: block; }
  .chip-btn .lbl-long { display: none; }
  .set-grid, .row2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 90px 1fr; }
}
@media (min-width: 701px) { .mark-all-fixed { display: none; } .sp-cards { display: none; } }
.sp-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; }
.sp-card .h { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sp-card .nums { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; font-size: 11px; color: var(--muted); margin-top: 8px; }
.sp-card .nums b { display: block; font: 400 18px var(--serif); }
.lbl-short { display: none; }
@media (max-width: 700px) { .lbl-short { display: inline; } }
