/* Conference Schedule Builder - PlayOn colours.
   Black rail, grey workspace, light blue as the one accent. Light blue is a
   fill colour: anything on it is black, and blue TEXT uses --accent-ink.
   Teal means "met", amber "compromised", red "broken".
   To match exact brand values, change the four --accent tokens only. */
:root {
    --night: #0c0d0f;
    --night-2: #1a1c20;
    --night-3: #2b2e34;
    --rail-ink: #c9cdd3;
    --rail-dim: #8b9099;
    --canvas: #eceef1;
    --card: #ffffff;
    --ink: #111214;
    --muted: #5d6169;
    --faint: #8d929b;
    --line: #dcdfe4;
    --line-2: #eef0f2;
    --accent: #5bc2ef;
    --accent-ink: #0a6c99;
    --accent-soft: #e5f5fd;
    --accent-glow: rgba(91, 194, 239, .35);
    --on-accent: #0c0d0f;
    --teal: #0f9f8f;
    --teal-ink: #0b7a6e;
    --teal-soft: #e2f6f2;
    --amber: #d97706;
    --amber-soft: #fff5e3;
    --red: #e11d48;
    --red-soft: #ffe9ee;
    --home: #e5f5fd;
    --meet: #eceef1;
    --meet-ink: #2b2e34;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(12, 13, 15, .05), 0 8px 24px rgba(12, 13, 15, .06);
    --shadow-lg: 0 2px 6px rgba(12, 13, 15, .06), 0 24px 48px rgba(12, 13, 15, .12);
    --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--canvas);
    color: var(--ink);
    font: 15px/1.55 var(--body);
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 2px; border-radius: 8px; }

.app { display: grid; grid-template-columns: 264px minmax(0, 1fr) 340px; min-height: 100vh; }

/* ---------------------------------------------------------------- rail */
.rail {
    background: radial-gradient(120% 60% at 0% 0%, #1f2a33 0%, var(--night) 62%);
    color: var(--rail-ink);
    padding: 26px 18px 18px;
    display: flex; flex-direction: column; gap: 28px;
    position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; color: #fff; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-name { font: 800 22px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.brand-sub { font-size: 12px; color: var(--rail-dim); margin-top: 3px; }

.steps { display: flex; flex-direction: column; gap: 4px; }
.step {
    display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center;
    background: none; border: 0; text-align: left; padding: 10px; border-radius: 12px;
    color: var(--rail-ink); transition: background .15s;
}
.step:hover { background: var(--night-2); }
.step .num {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    font: 700 15px var(--mono); background: var(--night-3); color: var(--rail-dim);
    transition: all .2s;
}
.step .t { font-weight: 700; font-size: 14px; color: #eceef1; line-height: 1.2; }
.step .s { font-size: 12px; color: var(--rail-dim); }
.step.active { background: var(--night-2); box-shadow: inset 3px 0 0 var(--accent); }
.step.active .num { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px var(--accent-glow); }
.step.done .num { background: rgba(15, 159, 143, .18); color: #5fe0cf; }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.rail-link { background: none; border: 1px solid var(--night-3); color: var(--rail-ink); padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.rail-link:hover { border-color: var(--rail-dim); }
.saved { font-size: 12px; color: var(--rail-dim); }

/* ---------------------------------------------------------------- main */
.main { min-width: 0; }
.view { padding: 36px 40px 80px; max-width: 1180px; }
.eyebrow { font: 700 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
h1 {
    font: 800 46px/1 var(--display); text-transform: uppercase; letter-spacing: .01em;
    margin: 8px 0 10px; text-wrap: balance;
}
h2 { font: 700 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 0; }
.lede { color: var(--muted); max-width: 64ch; margin: 0 0 28px; font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card, .stack > * + * { margin-top: 18px; }
.card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }

.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
input[type=text], input[type=number], input[type=date], select, textarea {
    border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px;
    transition: border-color .15s, box-shadow .15s; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { width: 100%; resize: vertical; font-family: var(--mono); font-size: 13px; }
input[type=number] { width: 90px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 11px;
    padding: 11px 18px; font-weight: 700; font-size: 14px; background: var(--line-2); color: var(--ink);
    transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 22px var(--accent-glow); }
.btn.primary:hover { background: #46b6e8; }
.btn.dark { background: var(--night); color: #fff; }
.btn.ghost { background: none; border: 1.5px solid var(--line); }
.btn.big { padding: 15px 26px; font-size: 16px; border-radius: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn svg { width: 18px; height: 18px; }

.nav-foot { display: flex; justify-content: space-between; margin-top: 30px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px;
    font-size: 13px; font-weight: 600; color: var(--ink); transition: all .15s;
}
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.pill.met { background: var(--teal-soft); color: var(--teal-ink); }
.pill.comp { background: var(--amber-soft); color: #9a5200; }
.pill.broken { background: var(--red-soft); color: #b0123a; }
.pill.dim { background: var(--line-2); color: var(--muted); }

/* segmented */
.seg { display: inline-flex; background: var(--line-2); padding: 4px; border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 9px 16px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent-ink); }
.switch input:checked::after { transform: translateX(17px); }

/* ---------------------------------------------------------------- teams */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.teams { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 980px; }
table.teams th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 0 6px 10px; white-space: nowrap; }
table.teams td { padding: 4px; border-top: 1px solid var(--line-2); vertical-align: middle; }
table.teams td input { width: 100%; padding: 7px 9px; font-size: 13px; border-color: transparent; background: transparent; }
table.teams td input:hover { border-color: var(--line); }
table.teams td input:focus { background: #fff; }
table.teams td.idx { font: 600 12px var(--mono); color: var(--faint); width: 28px; text-align: right; padding-right: 8px; }
table.teams td.name input { font-weight: 700; font-size: 14px; }
table.teams td.rank input { width: 56px; }
.icon-btn { border: 0; background: none; color: var(--faint); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--red-soft); color: var(--red); }
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.example {
    text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 13px; padding: 14px 16px;
    transition: all .15s;
}
.example:hover { border-color: var(--accent); box-shadow: 0 6px 18px var(--accent-soft); }
.example b { display: block; font-size: 14px; }
.example span { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- format */
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.format {
    position: relative; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 16px;
    padding: 18px; transition: all .18s; display: flex; flex-direction: column; gap: 8px;
}
.format:hover { border-color: #c6cedb; transform: translateY(-2px); }
.format.on { border-color: var(--accent); box-shadow: 0 10px 30px var(--accent-soft); }
.format .glyph { height: 46px; display: flex; align-items: center; color: var(--ink); }
.format .glyph svg { height: 44px; }
.format b { font: 700 19px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.format span { font-size: 13px; color: var(--muted); }
.format .tick {
    position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent); color: var(--on-accent); display: none; place-items: center;
}
.format.on .tick { display: grid; }
.format-opts { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line); }

/* ---------------------------------------------------------------- calendar */
.daypills { display: flex; gap: 6px; flex-wrap: wrap; }
.daypill {
    width: 46px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff;
    font: 700 12px var(--mono); color: var(--muted);
}
.daypill.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.counter {
    display: flex; align-items: center; gap: 22px; background: var(--night); color: #fff; border-radius: 16px;
    padding: 16px 22px; flex-wrap: wrap;
}
.counter .big { font: 800 42px/1 var(--display); }
.counter .lbl { font-size: 12px; color: var(--rail-dim); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.counter .bar { flex: 1; min-width: 160px; height: 8px; border-radius: 99px; background: var(--night-3); overflow: hidden; }
.counter .bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f9fd6, var(--accent)); border-radius: 99px; transition: width .3s; }
.counter.complete .bar i { background: linear-gradient(90deg, var(--teal), #5fe0cf); }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.month { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px; }
.month h4 { margin: 0 0 10px; font: 700 18px var(--display); text-transform: uppercase; letter-spacing: .03em; }
.month .dow, .month .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month .dow span { font: 700 10px var(--mono); color: var(--faint); text-align: center; }
.day {
    aspect-ratio: 1; border-radius: 9px; border: 0; background: none; font: 600 13px var(--mono);
    color: var(--ink); position: relative; padding: 0;
}
.day.out { color: #c9cfda; cursor: default; }
.day.off { color: #b3bccb; }
.day.play { background: var(--line-2); }
.day.play:hover { background: #e2e7ef; }
.day.pick { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 12px var(--accent-glow); font-weight: 700; }
.day.black { background: repeating-linear-gradient(135deg, #ffe0e7 0 4px, #fff 4px 8px); color: var(--red); text-decoration: line-through; }
.day.hc::after {
    content: ''; position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px;
    border-radius: 50%; background: var(--teal);
}
.day.pick.hc::after { background: var(--on-accent); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }

/* ---------------------------------------------------------------- priorities */
.prio-list { display: flex; flex-direction: column; gap: 10px; }
.prio {
    display: grid; grid-template-columns: 28px 44px 1fr auto; gap: 14px; align-items: center;
    background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; transition: all .15s;
}
.prio.dragging { opacity: .5; }
.prio.over { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.prio.off { background: var(--line-2); border-style: dashed; }
.prio.off .rank { background: none; color: var(--faint); box-shadow: none; }
.prio .grip { color: var(--faint); cursor: grab; display: grid; place-items: center; }
.prio .rank {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    font: 800 24px var(--display); background: var(--night); color: #fff;
}
.prio.hard .rank { background: var(--accent); color: var(--on-accent); }
.prio .what b { font-size: 15px; }
.prio .what p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.prio .params { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.prio .params input { width: 70px; padding: 5px 8px; font-size: 13px; }
.prio .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.prio .moves { display: flex; gap: 4px; }
.prio .moves button { border: 1px solid var(--line); background: #fff; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.prio .moves button:hover { border-color: var(--ink); color: var(--ink); }
.divider-label { font: 700 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 14px 0 0; }

/* ---------------------------------------------------------------- build */
.hero-build {
    background:
        radial-gradient(80% 140% at 100% 0%, rgba(91, 194, 239, .34) 0%, transparent 55%),
        radial-gradient(60% 120% at 0% 100%, rgba(141, 146, 155, .22) 0%, transparent 60%),
        var(--night);
    color: #fff; border-radius: 20px; padding: 28px 30px; display: flex; gap: 28px; align-items: center;
    flex-wrap: wrap; box-shadow: var(--shadow-lg);
}
.hero-build h2 { color: #fff; font-size: 30px; }
.hero-build p { margin: 4px 0 0; color: var(--rail-ink); max-width: 52ch; }
.hero-build .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-build .btn.ghost { color: #fff; border-color: var(--night-3); }
.hero-build .btn.ghost:hover { background: var(--night-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; }
.stat .v { font: 800 34px/1 var(--display); }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.stat.good .v { color: var(--teal-ink); }
.stat.bad .v { color: var(--red); }

.report { display: flex; flex-direction: column; }
.report details { border-top: 1px solid var(--line-2); }
.report details:first-child { border-top: 0; }
.report summary {
    list-style: none; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center;
    padding: 12px 4px; cursor: pointer;
}
.report summary::-webkit-details-marker { display: none; }
.report .r { font: 800 18px var(--display); color: var(--faint); text-align: center; }
.report ul.old { margin: 0 0 12px 46px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.report li { padding: 3px 0; }
.report li::before { content: '—'; margin-right: 8px; color: var(--faint); }

.tabs { display: flex; gap: 6px; }
.grid-wrap { overflow: auto; max-height: 68vh; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.grid th, table.grid td { padding: 0; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
table.grid thead th {
    position: sticky; top: 0; z-index: 2; background: var(--night); color: #fff; font: 700 13px var(--display);
    text-transform: uppercase; letter-spacing: .03em; padding: 10px 8px; min-width: 116px; white-space: nowrap;
}
table.grid thead th:first-child { left: 0; z-index: 3; min-width: 112px; }
table.grid tbody th {
    position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; padding: 8px 12px;
    font: 600 12px var(--mono); white-space: nowrap; box-shadow: 1px 0 0 var(--line);
}
table.grid tbody th small { display: block; color: var(--faint); font-weight: 500; }
.cell {
    display: block; width: 100%; min-height: 46px; border: 0; background: none; text-align: left;
    padding: 7px 9px; font-size: 12px; line-height: 1.3; position: relative;
}
.cell.home { background: var(--home); }
.cell.home .o { color: var(--accent-ink); }
.cell.away .o { color: var(--ink); }
.cell.meet { background: var(--meet); }
.cell.meet .o { color: var(--meet-ink); }
.cell .k { display: block; font: 700 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.cell .o { font-weight: 700; }
.cell.game:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.cell.locked { box-shadow: inset 0 0 0 2px var(--ink); }
.cell .lock { position: absolute; top: 5px; right: 6px; width: 13px; height: 13px; color: var(--ink); }
tr.crossover-row th { color: var(--accent-ink); }

.list-day { margin-top: 16px; }
.list-day h4 { margin: 0 0 8px; font: 700 16px var(--display); text-transform: uppercase; letter-spacing: .03em; }
.list-day h4 small { font: 600 12px var(--mono); color: var(--faint); margin-left: 8px; text-transform: none; }
.matchups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.matchup { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.matchup .tag { font: 700 10px var(--mono); text-transform: uppercase; color: var(--faint); }
.matchup.cross .tag { color: var(--accent-ink); }
.matchup.meet .tag { color: var(--meet-ink); }

.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.team-card h4 { margin: 0 0 4px; font: 700 18px var(--display); text-transform: uppercase; }
.team-card ol { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.team-card li { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line-2); }
.team-card li .d { font: 600 11px var(--mono); color: var(--muted); }
.team-card li .h { color: var(--accent-ink); font-weight: 700; }

/* ---------------------------------------------------------------- export */
.exports { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.export {
    text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 20px;
    display: flex; flex-direction: column; gap: 6px; transition: all .15s;
}
.export:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 28px var(--accent-soft); }
.export b { font: 700 19px var(--display); text-transform: uppercase; letter-spacing: .02em; }
.export span { font-size: 13px; color: var(--muted); }
.export .ext { font: 700 11px var(--mono); color: var(--accent-ink); }
.export[disabled] { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------------- plan */
.plan {
    background: #fff; border-left: 1px solid var(--line); padding: 30px 24px; position: sticky; top: 0;
    height: 100vh; overflow-y: auto;
}
.plan h2 { font-size: 24px; }
.plan .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.plan .tile { background: var(--canvas); border-radius: 13px; padding: 14px; }
.plan .tile.wide { grid-column: span 2; background: var(--night); color: #fff; }
.plan .tile .v { font: 800 36px/1 var(--display); }
.plan .tile .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
.plan .tile.wide .k { color: var(--rail-dim); }
.plan .summary { font-size: 14px; line-height: 1.55; }
.plan .blocks { margin: 14px 0; padding: 0; list-style: none; counter-reset: b; }
.plan .blocks li { counter-increment: b; display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 0; border-top: 1px solid var(--line-2); }
.plan .blocks li::before { content: counter(b); font: 700 12px var(--mono); color: var(--accent-ink); }
.alert { border-radius: 11px; padding: 10px 12px; font-size: 13px; margin-top: 8px; }
.alert.bad { background: var(--red-soft); color: #9b1032; }
.alert.warn { background: var(--amber-soft); color: #8a4a00; }
.alert.good { background: var(--teal-soft); color: var(--teal-ink); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--night); color: #fff;
    padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; z-index: 50; max-width: min(640px, 90vw);
}
.toast.bad { background: #8f0f2e; }

.fade-in { animation: fade .28s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- narrow */
@media (max-width: 1280px) {
    .app { grid-template-columns: 240px minmax(0, 1fr); }
    .plan { grid-column: 2; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; }
    .rail { position: static; height: auto; gap: 16px; }
    .steps { flex-direction: row; overflow-x: auto; }
    .step { grid-template-columns: 30px; }
    .step .t, .step .s { display: none; }
    .rail-foot { display: none; }
    .plan { grid-column: 1; }
    .view { padding: 24px 16px 60px; }
    h1 { font-size: 36px; }
}

/* report card: who / why / cost */
.report details.has-issues > summary { cursor: pointer; }
.report .chev { display: inline-block; margin-left: 6px; transition: transform .2s; font-size: 15px; line-height: 1; }
.report details[open] .chev { transform: rotate(90deg); }
.report summary:hover b { color: var(--accent-ink); }
.explain { margin: 0 0 16px 46px; background: var(--canvas); border-radius: 13px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.ex-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: start; }
.ex-k { font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
.ex-row p { margin: 0; font-size: 14px; }
.ex-row ul { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink); }
.ex-row li { padding: 3px 0; }
.ex-row li::before { content: '\2014'; margin-right: 8px; color: var(--faint); }
.whatif { background: #fff; border-radius: 12px; padding: 14px 16px; border: 1.5px solid var(--line); font-size: 13px; }
.whatif b { font: 700 16px var(--display); text-transform: uppercase; letter-spacing: .03em; }
.whatif p { margin: 4px 0 10px; font-size: 14px; }
.whatif table { width: 100%; border-collapse: collapse; }
.whatif th { text-align: left; font: 700 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 4px 6px; }
.whatif td { padding: 5px 6px; border-top: 1px solid var(--line-2); }
.whatif tr.me td { font-weight: 800; }
.whatif td.up { color: var(--teal-ink); font-weight: 700; }
.whatif td.down { color: var(--red); font-weight: 700; }
@media (max-width: 860px) { .explain { margin-left: 0; } .ex-row { grid-template-columns: 1fr; gap: 4px; } }

/* final details on the export step */
.card.final { border-top: 4px solid var(--accent); }
.final-title { font-size: 34px; margin-top: 4px; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 14px; }
.name-row { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; }
.name-row .mono { font-size: 12px; color: var(--faint); text-align: right; }
.name-row input { width: 100%; }
.name-row input.todo { border-color: var(--accent); background: var(--accent-soft); }

/* levels */
.levels { display: flex; flex-direction: column; gap: 10px; }
.lv { display: grid; grid-template-columns: minmax(150px, 1fr) 140px minmax(220px, 1.4fr) 34px; gap: 12px; align-items: end;
      border: 1.5px solid var(--line); border-radius: 13px; padding: 14px 16px; background: #fff; }
.lv-top { background: var(--canvas); border-style: dashed; grid-template-columns: minmax(150px, 1fr) 140px 1fr; }
.lv-name { display: flex; flex-direction: column; gap: 4px; align-self: center; }
.lv-name b { font: 700 20px var(--display); text-transform: uppercase; letter-spacing: .02em; }
.lv-name input { font-weight: 700; }
.lv select { width: 100%; }
.lv-byes { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.chip.small { padding: 4px 10px; font-size: 12px; }
.lv-preview { margin-top: 14px; background: var(--canvas); border-radius: 12px; padding: 12px 16px; }
.lv-preview ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 14px; }
.lv-preview li { padding: 3px 0; }
.lv-preview .mono { display: inline-block; width: 74px; color: var(--accent-ink); font-weight: 600; }
@media (max-width: 860px) { .lv, .lv-top { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- workspace navigation */
.navlink {
    display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--rail-ink);
    padding: 11px 12px; border-radius: 12px; font-weight: 700; font-size: 14px; text-align: left;
}
.navlink:hover { background: var(--night-2); }
.navlink.active { background: var(--night-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.navlink svg { color: var(--accent); flex: none; }
.navlink .count { margin-left: auto; font: 600 12px var(--mono); background: var(--night-3); color: var(--rail-ink); border-radius: 99px; padding: 2px 8px; }
.rail-sched { margin: 14px 4px 4px; padding-top: 14px; border-top: 1px solid var(--night-3); display: flex; flex-direction: column; gap: 2px; }
.rail-sched b { color: #fff; font: 700 17px/1.15 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.rail-k { font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--rail-dim); }
.rail-resume { margin-top: 12px; background: none; border: 1px dashed var(--night-3); color: var(--rail-ink); border-radius: 11px; padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 600; }
.rail-resume:hover { border-color: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- schedules dashboard */
.new-sched { border-top: 4px solid var(--accent); }
.sched-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.sched-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 2px solid transparent; }
.sched-card.is-current { border-color: var(--accent); }
.sched-card h3 { font: 800 22px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 8px 0 4px; }
.sc-top { display: flex; gap: 6px; }
.sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 8px; }
.sc-stats span { background: var(--canvas); border-radius: 10px; padding: 8px 10px; font: 800 22px/1 var(--display); }
.sc-stats small { display: block; font: 600 11px var(--body); color: var(--muted); margin-top: 3px; }

/* ---------------------------------------------------------------- conference setup */
table.schools { min-width: 640px; }
td.addr { min-width: 300px; }
td.addr input { width: 100%; }
.loc { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--faint); font-weight: 800; }
.loc.ok { color: var(--teal-ink); background: var(--teal-soft); }
.loc.bad { color: #9a5200; background: var(--amber-soft); }
.loc .spinner { width: 14px; height: 14px; }
.sports { display: flex; flex-direction: column; gap: 10px; }
.sport { display: grid; grid-template-columns: 170px 110px minmax(230px, 1fr) 130px 120px 34px; gap: 12px; align-items: end;
    border: 1.5px solid var(--line); border-radius: 13px; padding: 12px 14px; }
.sport select, .sport input { width: 100%; }
.from-conf { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 8px; }

/* ---------------------------------------------------------------- versions */
.versions { margin-top: 18px; }
.ver-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ver { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
    border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ver.final { border-color: var(--teal); background: var(--teal-soft); }
.ver-main b { font-size: 15px; }

/* ---------------------------------------------------------------- game times */
.lv { grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.4fr) 34px; }
.lv-top { grid-template-columns: minmax(150px, 1fr) 2fr; }
.times-wrap { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
table.times { border-collapse: separate; border-spacing: 0; min-width: 560px; }
table.times th { text-align: left; font: 700 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 6px 6px; }
table.times td { padding: 4px 6px; border-top: 1px solid var(--line-2); }
table.times input { width: 118px; padding: 6px 8px; font-size: 13px; }
table.times input[type=number] { width: 80px; }
table.times input.set { border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 860px) {
    .sport { grid-template-columns: 1fr 1fr; }
    .navlink span:not(.count) { display: none; }
    .rail-sched, .rail-resume { display: none; }
}

/* rank dropdown */
table.teams td.rank select { width: 68px; padding: 7px 8px; font: 600 13px var(--mono); }

/* school names must never be squeezed: the table scrolls sideways instead */
table.teams td.name { min-width: 220px; }
table.teams td.name input { min-width: 210px; max-width: none; }
table.teams td input[data-field="division"] { min-width: 90px; }
table.teams td input[data-field="homecoming"] { min-width: 110px; }
table.teams td input[data-field="excludedDates"],
table.teams td input[data-field="noHomeDates"],
table.teams td input[data-field="noAwayDates"] { min-width: 120px; }
table.teams { min-width: 1380px; }
table.schools { min-width: 760px; }

/* conference setup: time and length per level */
.sport { grid-template-columns: 170px 110px minmax(200px, 1fr) minmax(300px, 1.3fr) 34px; align-items: start; }
.sport > .field > span, .sport > label > span { min-height: 18px; }
.lt-grid { display: flex; flex-direction: column; gap: 6px; }
.lt-row { display: grid; grid-template-columns: 74px 1fr 84px; gap: 8px; align-items: center; }
.lt-row b { font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.lt-row input { width: 100%; padding: 7px 9px; font-size: 13px; }
@media (max-width: 860px) { .sport { grid-template-columns: 1fr; } }

/* priorities: the grip is for finger dragging too */
.prio .grip { touch-action: none; padding: 8px 4px; }
.prio .what { min-width: 0; }
.prio .params { min-width: 0; }

/* phones: the controls get their own row under each priority, with tap-sized
   buttons, instead of hanging off the right edge of the screen */
@media (max-width: 860px) {
    .prio { grid-template-columns: 34px 40px minmax(0, 1fr); gap: 10px; padding: 12px; }
    .prio .rank { width: 40px; height: 40px; font-size: 21px; }
    .prio .grip { padding: 12px 8px; margin: -8px 0; }
    .prio .side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
        gap: 10px; border-top: 1px solid var(--line-2); padding-top: 10px; }
    .prio .moves { gap: 8px; }
    .prio .moves button { width: 46px; height: 40px; font-size: 18px; border-radius: 10px; }
    .prio .switch { padding: 6px 0; }
    .prio.off { grid-template-columns: 0 40px minmax(0, 1fr); }
    .prio.off .grip { display: none; }
    .prio .params input { width: 64px; }
}

/* phones: the strip of navigation buttons scrolls sideways on its own. Before
   this, a grid column sized itself to the strip (483px), which widened every
   schedule screen and pushed controls past the edge of the phone. */
@media (max-width: 860px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .rail, .main, .plan { min-width: 0; }
    .steps { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 6px; padding-bottom: 2px; }
    .steps::-webkit-scrollbar { display: none; }
    .steps .navlink, .steps .step { flex: none; }
}

/* team date boxes open a calendar */
.date-cell {
    display: inline-flex; align-items: center; gap: 7px; width: 100%; min-width: 150px; border: 1.5px dashed var(--line);
    background: #fff; border-radius: 10px; padding: 7px 10px; font-size: 13px; color: var(--faint); text-align: left; white-space: nowrap;
}
.date-cell:hover { border-color: var(--accent); color: var(--ink); }
.date-cell.set { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.date-cell svg { flex: none; color: var(--accent-ink); }

body.modal-open { overflow: hidden; }
.dp-backdrop { position: fixed; inset: 0; background: rgba(12, 13, 15, .5); z-index: 60; animation: fade .18s ease-out; }
.dp {
    position: fixed; z-index: 61; left: 50%; top: 4vh; transform: translateX(-50%);
    width: min(900px, 94vw); max-height: 92vh; overflow: auto; background: var(--card); border-radius: 18px;
    box-shadow: var(--shadow-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 16px;
}
.dp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dp-head h2 { font-size: 28px; margin-top: 2px; }
.dp-days { display: flex; flex-direction: column; gap: 8px; }
.dp-months { grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
.dp-months .month { box-shadow: none; border: 1px solid var(--line); }
.day.wk { opacity: .7; }
.day[disabled] { cursor: default; }
.dp-foot { position: sticky; bottom: -22px; background: var(--card); padding: 14px 0 4px; border-top: 1px solid var(--line-2);
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dp-chosen { display: flex; flex-wrap: wrap; gap: 6px; max-height: 76px; overflow: auto; flex: 1; min-width: 0; }
@media (max-width: 860px) {
    .dp { top: 0; left: 0; transform: none; width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; padding: 18px 16px; }
}

/* logo */
.brand { flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 6px; }
.brand-logo { display: block; width: 100%; max-width: 218px; height: auto; }
.brand-sub { font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--rail-dim); padding-left: 2px; }
@media (max-width: 860px) {
    .brand { flex-direction: row; align-items: center; justify-content: space-between; }
    .brand-logo { max-width: 190px; }
}
