/* Oche Manager – dashboard, captain portal and login screens.
   Designed for non-technical users on phones: big text, big buttons, clear contrast. */
:root {
	--brand: #0f766e;
	--brand-dark: #115e59;
	--brand-soft: #e6f4f1;
	--ink: #17201e;
	--muted: #5b6765;
	--line: #dfe5e3;
	--bg: #f5f7f6;
	--card: #fff;
	--ok: #15803d;
	--ok-soft: #e7f6ec;
	--warn: #b45309;
	--warn-soft: #fff4e0;
	--bad: #b91c1c;
	--bad-soft: #fdecec;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(16, 24, 22, .06), 0 4px 16px rgba(16, 24, 22, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.ochm-app {
	margin: 0; background: var(--bg); color: var(--ink);
	font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand-dark); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .2em 0 .3em; letter-spacing: -.01em; }
h1 small, h2 small { font-weight: 500; color: var(--muted); font-size: .65em; margin-left: .4em; }
h2 { font-size: 1.2rem; margin: 0 0 .6em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
p { margin: 0 0 .8em; }
.lead { color: var(--muted); font-size: 1.05rem; margin-top: -.2em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.hp { position: absolute; left: -9999px; }

/* Top bar */
.topbar {
	position: sticky; top: 0; z-index: 30; display: flex; gap: 12px; align-items: center;
	padding: 10px 16px; background: var(--brand); color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 800; font-size: 1.1rem; margin-right: auto; letter-spacing: -.01em; }
.brand.big { display: block; font-size: 1.5rem; color: var(--brand); margin-bottom: 1rem; text-decoration: none; }
.top-link { font-size: .95rem; opacity: .92; }
.top-link:hover { opacity: 1; text-decoration: underline; }
.league-switch select { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 10px; padding: 6px 10px; font: inherit; font-size: .95rem; max-width: 240px; }
.league-switch option { color: var(--ink); }
.plan { font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.18); text-transform: uppercase; letter-spacing: .04em; }
.plan.pro { background: #fde68a; color: #713f12; }
.menu-btn { display: none; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 600; }

/* Layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); }
.sidenav { background: #fff; border-right: 1px solid var(--line); padding: 16px 10px; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav li a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.sidenav li a:hover { background: var(--bg); }
.sidenav li a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.sidenav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidenav .count, h2 .count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 8px; }
.pro-tag { margin-left: auto; font-style: normal; font-size: .68rem; font-weight: 700; background: #fde68a; color: #713f12; border-radius: 6px; padding: 1px 6px; }
.nav-extra { margin-top: 16px; border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; font-size: .92rem; }
.nav-extra a { color: var(--muted); text-decoration: none; }
.nav-extra a:hover { color: var(--brand-dark); text-decoration: underline; }
.main { padding: 24px clamp(16px, 3vw, 40px) 120px; max-width: 1100px; width: 100%; }
.main.narrow { max-width: 640px; margin: 0 auto; }

/* Cards & blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 18px; box-shadow: var(--shadow); }
.card.danger { border-color: #f3c7c7; }
.card.locked { opacity: .85; }
.card.highlight { border: 2px solid var(--brand); }
.card.upsell { background: linear-gradient(135deg, #fffbeb, #fff); border-color: #fcd9a0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.stack { display: grid; gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.actions form { margin: 0; }

/* Forms */
label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=file], select, textarea {
	width: 100%; font: inherit; font-weight: 400; color: var(--ink); background: #fff;
	border: 1.5px solid #c9d3d0; border-radius: 10px; padding: 11px 12px; min-height: 48px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(15, 118, 110, .25); border-color: var(--brand); }
input[type=color] { width: 72px; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--brand); }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.choice .radio-card { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 400; cursor: pointer; }
.choice .radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice .radio-card input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--brand); }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 12px; }
.inline-form label { flex: 1 1 200px; }
.inline-form label.small { flex: 0 0 110px; }
.inline-form label.wide { flex: 2 1 260px; }
.addon { display: flex; align-items: stretch; border: 1.5px solid #c9d3d0; border-radius: 10px; overflow: hidden; }
.addon span { background: var(--bg); color: var(--muted); padding: 11px 10px; font-weight: 400; white-space: nowrap; font-size: .9rem; display: flex; align-items: center; }
.addon span:empty { display: none; }
.addon input { border: 0; border-radius: 0; min-width: 0; }
.row-label { grid-template-columns: 1fr 1fr; align-items: center; }
.captain-row { border-top: 1px solid var(--line); padding-top: 12px; }

/* Buttons */
.btn, button.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 10px 20px; border-radius: 12px; border: 0; cursor: pointer;
	background: var(--brand); color: #fff; font: inherit; font-weight: 700; text-decoration: none;
	box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.btn:hover { background: var(--brand-dark); }
.btn.big { min-height: 56px; font-size: 1.08rem; padding: 12px 26px; width: 100%; max-width: 420px; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.ghost { background: #fff; color: var(--brand-dark); border: 1.5px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: var(--bad); }
.btn[disabled], .btn.busy { opacity: .6; pointer-events: none; }
button.link { background: none; border: 0; padding: 4px 0; color: var(--brand-dark); text-decoration: underline; font: inherit; cursor: pointer; }
.link.danger, button.link.danger { color: var(--bad); }

/* Messages */
.flash { border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; font-weight: 500; border-left: 5px solid; }
.flash.success { background: var(--ok-soft); border-color: var(--ok); }
.flash.error { background: var(--bad-soft); border-color: var(--bad); }
.flash.info { background: #eef4ff; border-color: #3b6fd8; }
.alert-card { display: grid; gap: 4px; background: var(--warn-soft); border: 2px solid #f4b25b; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; color: var(--ink); text-decoration: none; }
.alert-card span { color: var(--warn); font-weight: 600; }
.alert-card.static .actions { margin: 8px 0 0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; background: #eef1f0; color: var(--muted); vertical-align: middle; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.ok { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); }
.promo { background: #fff4e0; border: 2px dashed #f4b25b; border-radius: 12px; padding: 12px 14px; font-weight: 700; }

/* Progress & checklist */
.progress { height: 10px; background: #e8eeec; border-radius: 999px; overflow: hidden; margin: 0 0 16px; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.next-step { display: flex; gap: 16px; align-items: center; justify-content: space-between; background: var(--brand-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.next-step p { margin: 0; color: var(--muted); }
.checklist { margin: 0 0 12px; padding-left: 1.4em; display: grid; gap: 4px; }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.checklist li.done::marker { content: "✓  "; color: var(--ok); }

/* Wizard */
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 18px; }
.wizard-steps a { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 600; }
.wizard-steps span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); font-size: .8rem; }
.wizard-steps .current a { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.wizard-steps .current span, .wizard-steps .done span { background: var(--brand); color: #fff; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 12px; }
.or { text-align: center; color: var(--muted); font-weight: 700; margin: 16px 0; }
.big-link { font-size: 1.15rem; font-weight: 700; word-break: break-all; }
.wizard.done h2 { font-size: 1.5rem; }

/* Lists & tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
table.list th, table.list td, .league-table th, .league-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.league-table th, .league-table td { text-align: center; }
.league-table .t-name { text-align: left; }
.league-table thead th, table.list thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.league-table .pts { font-weight: 800; }
.form span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; font-size: .7rem; font-weight: 700; color: #fff; margin: 0 1px; }
.f-w { background: var(--ok); } .f-d { background: #94a3b8; } .f-l { background: var(--bad); }
.fixture-list { list-style: none; margin: 0; padding: 0; }
.fixture-list li { border-bottom: 1px solid var(--line); }
.fixture-list li:last-child { border-bottom: 0; }
.fixture-list a, .fixture-list .row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px 4px; text-decoration: none; color: var(--ink); }
.fixture-list a:hover { background: var(--bg); }
.fixture-list .row a { padding: 0; flex: 1; }
.fixture-list .row form { margin: 0 0 0 auto; }
.fixture-list .date { color: var(--muted); font-size: .9rem; min-width: 84px; }
.fixture-list .teams { font-weight: 600; }
.fixture-list .score { margin-left: auto; font-weight: 800; }
.fixture-list .score.win { color: var(--ok); } .fixture-list .score.loss { color: var(--bad); }
.fixture-list .tag, .fixture-list .btn { margin-left: auto; }
.fixture-list .score + .tag { margin-left: 0; }
.fixture-list li.clash { background: var(--bad-soft); }
.fixture-list li.void { opacity: .55; text-decoration: line-through; }
.fixture-list.big a { padding: 16px 6px; font-size: 1.05rem; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
ul.ticks { padding-left: 1.2em; }
ul.ticks li::marker { content: "✓  "; color: var(--ok); font-weight: 700; }
.venue-row, .player-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 0; }
.venue-row .inline-form, .player-row .inline-form { flex: 1 1 100%; margin: 0; }
.player-row .inline-form { flex: 1 1 auto; }
.player-row.inactive input { color: var(--muted); text-decoration: line-through; }
.player-row form { margin: 0; }
.import-team { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.logo-prev { border-radius: 10px; vertical-align: middle; }

/* Scorecard */
.scorecard { display: grid; gap: 12px; }
.sc-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 14px 16px; position: sticky; top: 60px; z-index: 5; }
.sc-team { font-weight: 700; display: grid; } .sc-team:last-child { text-align: right; }
.sc-team small { font-weight: 400; opacity: .7; font-size: .8rem; }
.sc-total { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.game { padding: 14px; }
.game legend { font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; float: left; width: 100%; margin-bottom: 8px; }
.game-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; clear: both; }
.game-row .side { display: grid; gap: 6px; }
.side-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.legs-box { display: flex; align-items: center; gap: 6px; font-weight: 700; }
select.legs { width: 64px; text-align: center; font-size: 1.15rem; font-weight: 700; padding: 8px 4px; }
.game.won-home .legs-box select:first-child, .game.won-away .legs-box select:last-child { border-color: var(--ok); background: var(--ok-soft); }
.quick-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; }
.quick-score input { font-size: 1.6rem; font-weight: 800; text-align: center; }
.stats-entry summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.stats-grid { display: grid; grid-template-columns: minmax(110px, 1.4fr) repeat(var(--cols), minmax(60px, 1fr)); gap: 6px 8px; align-items: center; margin-bottom: 12px; }
.stats-grid .th { font-size: .75rem; font-weight: 700; color: var(--muted); text-align: center; }
.stats-grid .pn { font-size: .95rem; }
.stats-grid input { min-height: 42px; padding: 6px; text-align: center; }
.sticky-submit { position: sticky; bottom: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.18); margin: 6px auto 0; }

/* Leaderboards */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.board ol { margin: 0; padding-left: 1.4em; }
.board li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.board li::marker { font-weight: 700; color: var(--muted); }
.board .pn small { color: var(--muted); display: block; font-size: .8rem; }
.roundup { font-family: inherit; font-size: 1rem; line-height: 1.55; background: #fbfdfc; }

/* Billing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 12px 0; }
.plan-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; justify-items: start; }
.plan-card.best { border-color: var(--brand); }
.plan-card h3 { margin: 0; }
.plan-card .price { font-size: 2rem; font-weight: 800; margin: 0; }
.plan-card .price small { font-size: .9rem; font-weight: 500; color: var(--muted); }

/* Share poster */
.poster { border: 3px solid var(--ink); border-radius: 18px; padding: 28px; text-align: center; max-width: 420px; margin: 0 auto 16px; background: #fff; }
.poster-top { font-weight: 800; letter-spacing: .12em; font-size: .8rem; color: var(--brand); }
.poster h3 { font-size: 1.7rem; margin: .2em 0 .6em; }
.qr { width: 240px; height: 240px; margin: 0 auto 10px; display: grid; place-items: center; }
.qr svg, .qr img { width: 100%; height: 100%; }
.poster-scan { font-weight: 700; font-size: 1.1rem; margin: 0; }
.poster-url { font-weight: 600; word-break: break-all; color: var(--muted); }
.poster-foot { font-size: .75rem; color: var(--muted); margin: 14px 0 0; }

/* Help assistant */
.help-fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 14px 20px; font: inherit; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; }
.help-fab::before { content: "?"; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--ink); margin-right: 8px; font-weight: 800; }
.help-panel { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: min(420px, calc(100vw - 24px)); height: min(640px, calc(100vh - 100px)); background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
.help-panel[hidden] { display: none; }
.help-panel header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--brand); color: #fff; }
.help-panel header button { background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.help-log { flex: 1; overflow-y: auto; padding: 14px; display: grid; gap: 10px; align-content: start; background: var(--bg); }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: .97rem; }
.msg p { margin: 0 0 .5em; } .msg p:last-child { margin: 0; }
.msg ol, .msg ul { margin: .3em 0 .5em; padding-left: 1.3em; }
.msg.bot { background: #fff; border: 1px solid var(--line); justify-self: start; }
.msg.me { background: var(--brand); color: #fff; justify-self: end; }
.msg.typing { color: var(--muted); font-style: italic; }
.help-suggest { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; }
.help-suggest button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.help-form { display: flex; gap: 8px; padding: 10px 12px; align-items: flex-end; }
.help-form textarea { min-height: 48px; height: 48px; }
.help-escalate { padding: 0 12px 12px; font-size: .9rem; }
.help-escalate form { display: grid; gap: 8px; margin-top: 6px; }

/* Auth */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: linear-gradient(160deg, var(--brand-soft), var(--bg)); }
.auth-card { background: #fff; border-radius: 18px; padding: 28px; width: 100%; max-width: 460px; box-shadow: var(--shadow); }

/* Captain */
.captain .topbar { flex-wrap: wrap; }
.team-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; }
.team-tabs a { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; white-space: nowrap; }
.team-tabs a[aria-current] { background: var(--brand); color: #fff; border-color: var(--brand); }

@media (max-width: 860px) {
	.shell { grid-template-columns: 1fr; }
	.menu-btn { display: inline-block; }
	.sidenav { display: none; position: fixed; inset: 56px 0 0 0; z-index: 25; overflow-y: auto; }
	.sidenav.open { display: block; }
	.top-link { display: none; }
	.captain .top-link { display: inline; }
	.league-switch select { max-width: 150px; }
	.grid-2, .grid-3 { grid-template-columns: 1fr; }
	.next-step { flex-direction: column; align-items: stretch; }
	.row-label { grid-template-columns: 1fr; }
	.game-row { grid-template-columns: 1fr; }
	.legs-box { justify-content: center; order: 2; }
	.game-row .side:last-child { order: 3; }
	.legs-box select.legs { width: 80px; min-height: 52px; font-size: 1.35rem; }
	.help-fab { padding: 12px 16px; }
	.help-panel { right: 6px; bottom: 6px; width: calc(100vw - 12px); height: calc(100vh - 70px); }
	.hide-sm { display: none; }
}
@media print {
	body * { visibility: hidden; }
	.poster, .poster * { visibility: visible; }
	.poster { position: absolute; left: 0; top: 0; width: 100%; max-width: none; border-width: 6px; }
	.qr { width: 60vw; height: 60vw; max-width: 420px; max-height: 420px; }
}

/* Install-the-app bar */
.install-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; align-items: center; gap: 12px; background: #17201e; color: #fff; padding: 12px 14px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: .95rem; max-width: 520px; margin: 0 auto; }
.install-bar span { flex: 1; }
.install-bar .btn { padding: 8px 14px; white-space: nowrap; }
.install-x { background: transparent; border: 0; color: #cdd8d5; font-size: 1.5rem; line-height: 1; padding: 4px 8px; cursor: pointer; }

.game legend small{font-weight:400;color:var(--muted,#51615d)}

.lineup-row{display:grid;grid-template-columns:5.5em 1fr 1fr;gap:8px;align-items:center;margin:0 0 8px}
.lineup-row .pos{font-weight:600}
.lineup select{width:100%}
.game.locked select:not(.legs){pointer-events:none;background:#f1f5f4;opacity:.9}

/* Sidebar stays put while the page scrolls (desktop) */
@media (min-width: 861px) {
	.sidenav { position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto; }
}
/* Space between the Save button and whatever follows it */
form > .btn.big:last-child { margin-bottom: 28px; }
.card.danger { margin-top: 28px; }

.open-scroll{overflow-x:auto;margin:10px 0}
.open-table{border-collapse:collapse;min-width:560px;width:100%}
.open-table th,.open-table td{padding:4px 6px;text-align:left;font-size:.92rem}
.open-table th[scope=row]{white-space:nowrap}
.open-table input{width:4.6em;padding:6px}

.fmt-block{display:grid;grid-template-columns:repeat(3,1fr);gap:10px 12px;border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:0 0 10px;background:#fff}
.fmt-block label{display:grid;gap:4px;font-size:.88rem;font-weight:600;margin:0}
.fmt-block label small{font-weight:400;color:var(--muted)}
.fmt-block select,.fmt-block input{width:100%;min-width:0}
.fmt-title{grid-column:1/-1;font-weight:800;font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.fmt-wide{grid-column:1/-1}
.fmt-pair{display:grid;grid-template-columns:1fr 4.2em;gap:8px}
.fmt-more,.fmt-help{margin:0 0 12px}
.fmt-more>summary,.fmt-help>summary{cursor:pointer;color:var(--brand-dark);font-weight:600;padding:6px 0}
.fmt-help p{color:var(--muted);font-size:.92rem;margin:.4em 0}
.fmt-lock{display:block;font-weight:600;margin:6px 0 12px}
.fmt-lock input{width:4.6em;display:inline-block;margin:0 4px}
.fmt-lock small{display:block;font-weight:400;color:var(--muted);margin-top:2px}
@media (max-width:520px){.fmt-block{grid-template-columns:1fr 1fr}.fmt-block label:nth-of-type(3){grid-column:1/-1}}

.brand{display:inline-flex;align-items:center;gap:9px}
.brand .board-mark{flex:none}
.brand.big{display:flex}

/* ===== 3.8 ===== */
.highlight-soft { border-color: var(--brand); background: linear-gradient(180deg, var(--brand-soft), #fff 70%); }
.highlight-soft > summary { cursor: pointer; font-size: 1.05rem; padding: 2px 0 8px; }
.main { min-width: 0; }
.only-sm { display: none; }
.brand { white-space: nowrap; }
.sc-head, .card { min-width: 0; }
select, input { max-width: 100%; }

/* Show / hide password */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--brand-dark); font: inherit; font-weight: 700; font-size: .85rem; padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.pw-toggle:hover { background: var(--brand-soft); }

/* Front-door page */
.start-choices { display: grid; gap: 12px; margin: 18px 0; }
.start-choices .btn { max-width: none; flex-direction: column; gap: 2px; }
.start-choices small { font-weight: 400; opacity: .85; font-size: .85rem; }

/* Captain menu */
.cap-tabs { position: sticky; top: 52px; z-index: 20; display: flex; gap: 4px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 6px 10px; }
.cap-tabs a { flex: 1 1 0; text-align: center; padding: 10px 6px; font-size: .92rem; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; }
.cap-tabs a[aria-current] { background: var(--brand-soft); color: var(--brand-dark); }

/* Highlights (stats) entry */
.stats-entry h3 { margin: 1em 0 .4em; font-size: 1rem; color: var(--muted); }
.stat-player { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 8px; background: #fff; }
.stat-player > summary { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; }
.stat-player > summary::-webkit-details-marker { display: none; }
.stat-player > summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; color: var(--brand-dark); }
.stat-player[open] > summary::after { content: "–"; }
.stat-player > summary small { flex: 1 0 100%; font-weight: 400; color: var(--ok); }
.stat-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 0 14px 14px; }
.stat-fields label { font-size: .85rem; }

/* Compact format blocks */
.fmt-block { grid-template-columns: 1.1fr .7fr 1.4fr; gap: 6px 10px; padding: 10px 12px; }
.fmt-block[hidden] { display: none; }
.fmt-title { margin-bottom: -2px; }
[data-fmt-add] { margin: 2px 0 12px; }
@media (max-width: 520px) { .fmt-block { grid-template-columns: 1fr 1fr; } .fmt-block label:nth-of-type(3) { grid-column: 1 / -1; } }

/* New venue inline */
.new-venue { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; background: var(--brand-soft); border-radius: 12px; padding: 12px; }
.new-venue[hidden] { display: none; }

/* Date picker */
.dp-wrap { position: relative; }
.dp-input { cursor: pointer; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 2v4M16 2v4M3 9h18M5 5h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") no-repeat right 12px center / 22px; padding-right: 44px; }
.dp-pop { position: absolute; z-index: 60; left: 0; top: calc(100% + 6px); width: 320px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 48px rgba(0,0,0,.22); padding: 14px; }
.dp-pop[hidden] { display: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 800; }
.dp-head button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.3rem; cursor: pointer; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.dp-grid .dow { font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.dp-grid button { aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 50%; background: transparent; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.dp-grid button:hover { background: var(--brand-soft); }
.dp-grid button.today { box-shadow: inset 0 0 0 2px var(--brand); }
.dp-grid button.sel { background: var(--brand); color: #fff; }
.dp-grid button.out { color: #b5c0bd; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }

/* Address look-up */
.addr-wrap { position: relative; }
.addr-row { display: flex; gap: 8px; }
.addr-row input { flex: 1; min-width: 0; }
.addr-list { list-style: none; margin: 6px 0 0; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.addr-list[hidden] { display: none; }
.addr-list button { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.addr-list button:hover { background: var(--brand-soft); }
.addr-note { font-size: .8rem; color: var(--muted); margin: 4px 0 0; }

.nav-league { padding: 4px 6px 12px; display: grid; gap: 4px; }

@media (max-width: 860px) {
	.shell { grid-template-columns: minmax(0, 1fr); }
	.only-sm { display: grid; }
	.hide-sm { display: none !important; }
	.topbar { padding: 8px 12px; gap: 8px; }
	.brand { font-size: 1rem; gap: 7px; }
	.brand .board-mark { width: 24px; height: 24px; }
	.main { padding: 18px 14px 120px; }
	.addon { flex-wrap: wrap; }
	.addon span { width: 100%; padding: 8px 12px; }
	.addon input { flex: 1 1 100%; width: 100%; }
	table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
	table.stack-sm thead { display: none; }
	table.stack-sm tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; background: #fff; }
	table.stack-sm td { border: 0 !important; padding: 4px 0 !important; display: flex; justify-content: space-between; gap: 12px; text-align: right !important; }
	table.stack-sm td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; flex: none; }
	table.stack-sm td[data-label=""]::before { display: none; }
	.lineup-row { grid-template-columns: 1fr; gap: 6px; }
	.lineup-row .pos { font-size: .85rem; color: var(--muted); }
	.sc-head { top: 52px; padding: 10px 12px; }
	.sc-team { font-size: .9rem; }
	.stat-fields { grid-template-columns: 1fr 1fr; }
	.new-venue { grid-template-columns: 1fr; }
	.captain .topbar { flex-wrap: nowrap; }
	.captain .brand { overflow: hidden; text-overflow: ellipsis; }
}

.fmt-title { display:flex; justify-content:space-between; align-items:center; grid-column:1/-1; }
.fmt-remove { background:none; border:0; color:#b42318; font-size:.85rem; font-weight:600; text-decoration:underline; padding:2px 0; cursor:pointer; }

.cancel-sure summary { list-style:none; display:inline-block; cursor:pointer; }
.cancel-sure summary::-webkit-details-marker { display:none; }
.cancel-sure[open] summary { display:none; }
.cancel-box { border:1px solid #f3c7c7; background:#fff7f7; border-radius:12px; padding:14px 16px; margin:4px 0 8px; }
.cancel-box p { margin:0 0 10px; }

.week .bye { margin:.6rem 0 0; font-size:.92rem; }

/* Owner dashboard */
.owner-tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; margin:0 0 16px; }
.otile { background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px 14px; display:grid; gap:2px; }
.otile b { font-size:1.55rem; line-height:1.1; color:var(--teal, #0f766e); }
.otile span { font-size:.82rem; color:var(--muted); }
.owner-list { margin:0; padding-left:1.1rem; display:grid; gap:6px; }
.owner-msg { border-top:1px solid var(--line); padding:12px 0; }
.owner-msg:first-of-type { border-top:0; }
.owner-msg .meta { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.owner-msg p { margin:.4rem 0 .6rem; }
.owner-pre { white-space:pre-wrap; font-size:.85rem; background:#f6f8f7; padding:10px; border-radius:10px; }
#cust-filter { width:100%; margin:0 0 10px; }
#cust-table form.inline { display:inline-block; margin:0 8px 6px 0; }
#cust-table .del { display:inline-block; }
#cust-table tr[hidden] { display:none; }
#cust-filter { padding:10px 14px; border:1px solid var(--line); border-radius:12px; font-size:1rem; background:#fff; }
@media (max-width: 720px) {
	#cust-table td { flex-direction:column; align-items:flex-start; gap:2px; text-align:left !important; word-break:break-word; }
	#cust-table td::before { font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; }
	#cust-table td[data-label=""] { flex-direction:row; flex-wrap:wrap; align-items:center; gap:8px 12px; padding-top:8px !important; }
}

.owner-reply { display:grid; gap:8px; margin:.4rem 0 .4rem; }
.owner-reply textarea { width:100%; border:1px solid var(--line); border-radius:12px; padding:10px 12px; font:inherit; }
.owner-reply .btn { justify-self:start; }
.owner-done { margin:0 0 4px; }
