:root {
  --bg: #2A2A2A;
  --bg-2: #333333;
  --bg-3: #3d3d3d;
  --line: #4a4a4a;
  --text: #C0C0C0;
  --text-hi: #ececec;
  --muted: #8d8d8d;
  --red: #E10600;
  --red-dim: rgba(225, 6, 0, .14);
  --ok: #7fc28a;
  --warn: #e0b24a;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 "Inter", system-ui, -apple-system, Segoe UI, sans-serif; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { color: var(--text-hi); margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text-hi); text-transform: uppercase; letter-spacing: .06em; }
.brand i { width: 10px; height: 22px; background: var(--red); display: inline-block; transform: skewX(-14deg); }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 12px 0 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; background: none; border: 0; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; font-weight: 600; }
.tab.on { color: var(--text-hi); border-color: var(--red); }

.days { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 6px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; width: 58px; padding: 8px 0; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); text-align: center; cursor: pointer; }
.day small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.day b { display: block; font-size: 19px; color: var(--text-hi); }
.day .dot { display: block; width: 5px; height: 5px; border-radius: 50%; margin: 3px auto 0; background: transparent; }
.day.has .dot { background: var(--red); }
.day.on { background: var(--red); border-color: var(--red); }
.day.on small, .day.on b { color: #fff; }
.day.on .dot { background: #fff; }

.section { padding: 18px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { padding: 12px 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); color: var(--text-hi); cursor: pointer; font-weight: 600; }
.slot:hover { border-color: var(--red); }

.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 14px; align-items: center; }
.card + .card { margin-top: 8px; }
.card .time { min-width: 64px; font-weight: 700; color: var(--text-hi); font-size: 16px; }
.card .body { flex: 1; min-width: 0; }
.card .body b { color: var(--text-hi); }

.btn { border: 1px solid var(--line); background: var(--bg-3); color: var(--text-hi); padding: 10px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--text); }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.red:hover { filter: brightness(1.1); }
.btn.ghost { background: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; }

.empty { padding: 28px 16px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.request-bar { margin-top: 20px; padding: 16px; border-radius: var(--radius); background: var(--red-dim); border: 1px solid rgba(225, 6, 0, .4); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.request-bar b { color: var(--text-hi); }

.chip { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 99px; border: 1px solid currentColor; }
.chip.accepted { color: var(--ok); }
.chip.pending { color: var(--warn); }
.chip.declined, .chip.cancelled { color: var(--muted); }
.chip.type { color: var(--text); }

.bar { height: 4px; border-radius: 4px; background: var(--bg-3); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--red); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: none; align-items: flex-end; justify-content: center; z-index: 20; }
.modal.open { display: flex; }
.sheet { background: var(--bg-2); border: 1px solid var(--line); width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
@media (min-width: 600px) { .modal { align-items: center; } .sheet { border-radius: 16px; } }
.sheet h2 { margin-bottom: 4px; }
.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text-hi); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.actions .btn { flex: 1; }
.err { color: #ff6b66; font-size: 13px; margin-top: 10px; min-height: 1em; }
input[type="date"], input[type="time"] { color-scheme: dark; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--text-hi); color: #1a1a1a; padding: 10px 16px; border-radius: 8px; font-weight: 600; opacity: 0; transition: .2s; z-index: 30; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.notice { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 8px; padding: 12px 14px; margin-top: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.wk { display: flex; gap: 6px; flex-wrap: wrap; }
.wk label { cursor: pointer; }
.wk input { display: none; }
.wk span { display: inline-block; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.wk input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; background: none; border: 0; padding: 10px 6px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--red); color: #fff; }
.roster { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hidden { display: none !important; }
