/* Team portal (web/app). Phone first; every value comes from tokens.css
 * (design/tokens.css, the Diamond Board system). Board green chrome, paper
 * surfaces, foul-pole yellow as the single accent. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; scroll-padding-bottom: 96px; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--text-md)/var(--leading-body) var(--font-ui); }
a { color: var(--link); }
h1, h2, h3 { line-height: var(--leading-tight); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.display, .appbar h1, h2.section, .card-title, .auth-title { font-family: var(--font-display); font-weight: 800; letter-spacing: .01em; }
.muted { color: var(--text-3); }
.small { font-size: var(--text-xs); }
.center { text-align: center; }
.loading { text-align: center; padding: var(--space-7) var(--space-4); color: var(--text-3); }
.empty { text-align: center; padding: var(--space-5) var(--space-4); color: var(--text-3); border: 2px dashed var(--border); border-radius: var(--radius-card); }
.empty p { margin: 0 0 var(--space-3); }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); }
.grid-2 > *, .field { min-width: 0; }
.plain { list-style: none; margin: 0; padding: 0; }

/* ---- shell */
.shell { min-height: 100dvh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; background: var(--bg); }
.appbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--space-3);
  padding: calc(env(safe-area-inset-top) + var(--space-2)) var(--space-4) var(--space-2);
  background: var(--board-900); color: var(--chalk); border-bottom: 6px solid var(--team, var(--foul)); }
.appbar-mark, .appbar-back { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: var(--radius-tile); text-decoration: none; }
.appbar-mark { background: var(--foul); color: var(--foul-ink); font-size: 22px; }
.appbar-back { color: var(--chalk); font-size: 40px; line-height: 1; margin-left: -8px; }
.appbar-title { flex: 1; min-width: 0; }
.appbar-title small { display: block; color: var(--chalk-dim); font-size: var(--text-xs); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar h1 { margin: 0; font-size: var(--text-xl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-btn { min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-control); border: 2px solid var(--board-600); background: transparent; color: var(--chalk); font: 700 var(--text-sm) var(--font-ui); cursor: pointer; }
.page { flex: 1; padding: var(--space-4) var(--space-4) var(--space-7); }
.has-tabs .page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 720px); z-index: 10; display: flex;
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px;
  color: var(--text-3); text-decoration: none; font-size: var(--text-xs); font-weight: 700; }
.tabbar-icon { font-size: 20px; line-height: 1; }
.tabbar-item.on { color: var(--text); box-shadow: inset 0 4px 0 var(--foul); }

/* ---- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 52px; padding: 0 var(--space-4);
  border-radius: var(--radius-control); border: 2px solid var(--border); background: var(--surface); color: var(--text);
  font: 700 var(--text-md) var(--font-ui); text-decoration: none; cursor: pointer; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-danger { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-sm { min-height: 44px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-block { display: flex; width: 100%; }
.icon-btn { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; font-size: 22px; cursor: pointer; border-radius: var(--radius-control); }
.icon-btn:disabled { opacity: .3; }
.row-btns { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.row-btns > * { flex: 1; }
.row-btns.compact > * { flex: none; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.field { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; }
.field > label, .field > span, .label { font-weight: 700; font-size: var(--text-sm); color: var(--text-2); margin: 0; }
.hint { color: var(--text-3); font-size: var(--text-xs); }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
  width: 100%; min-width: 0; max-width: 100%; min-height: 52px; padding: var(--space-3); border-radius: var(--radius-control); border: 2px solid var(--border);
  background: var(--surface); color: var(--text); font: var(--text-md) var(--font-ui); }
textarea { min-height: 52px; resize: vertical; }
input[type=color] { width: 100%; height: 52px; border: 2px solid var(--border); border-radius: var(--radius-control); background: var(--surface); padding: 4px; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; }
.code-input { text-transform: uppercase; letter-spacing: .2em; font-family: var(--font-display) !important; font-size: var(--text-xl) !important; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.rules { border: 2px solid var(--border); border-radius: var(--radius-card); padding: var(--space-3) var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); background: var(--surface); }
fieldset.rules legend { font-weight: 800; padding: 0 var(--space-2); }
.seg-field legend { font-weight: 700; font-size: var(--text-sm); color: var(--text-2); margin-bottom: var(--space-1); }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: var(--radius-control); }
.seg-opt { flex: 1; position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; }
.seg-opt span { display: grid; place-items: center; min-height: 44px; border-radius: 10px; font-weight: 700; font-size: var(--text-sm); cursor: pointer; text-align: center; padding: 0 var(--space-2); }
.seg-opt input:checked + span { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); }
.toggle { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { flex: none; width: 52px; height: 32px; border-radius: var(--radius-pill); background: var(--surface-3); border: 2px solid var(--border); position: relative; transition: background .15s; }
.toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.toggle input:checked + .toggle-track { background: var(--ok); border-color: var(--ok); }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.toggle input:disabled + .toggle-track { opacity: .5; }
.toggle-label { font-weight: 700; }
.form-error { color: var(--danger); font-weight: 700; margin: 0; min-height: 0; }
.form-error:empty { display: none; }
.inline-form { display: flex; gap: var(--space-2); align-items: stretch; flex-wrap: wrap; }
.inline-form > input, .inline-form > select { flex: 1 1 160px; width: auto; }
.inline-form .form-error { flex-basis: 100%; }
details.more > summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; list-style: none; color: var(--link); }
details.more > summary::before { content: "＋"; margin-right: var(--space-2); }
details.more[open] > summary::before { content: "－"; }
/* Spacing by margin: WebKit does not reliably lay out / repaint a <details> made a flex container. */
details.more[open] > * + * { margin-top: var(--space-3); }
.rest-rows { display: flex; flex-direction: column; gap: var(--space-2); }
.rest-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-2); align-items: center; }
.unit-blocks { display: flex; flex-direction: column; gap: var(--space-3); }
.unit-block, .unit-limits { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.unit-block.is-also { border-top: 1px solid var(--border); padding-top: var(--space-2); }
.unit-block.is-also > .unit-limits { border-left: 3px solid var(--border); padding-left: var(--space-3); }
.b2b > .grid-2 { align-items: end; }

/* ---- cards, chips, lists */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.card-title { margin: 0; font-size: var(--text-xl); }
.card > p { margin: 0; }
h2.section { margin: var(--space-3) 0 0; font-size: var(--text-xl); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.section-head select { width: auto; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--text-2); font-size: var(--text-xs); font-weight: 800; white-space: nowrap; text-decoration: none; }
.chip-live { background: var(--strike); color: var(--strike-ink); }
.chip-live::before { content: "● "; }
.chip-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-hl { background: var(--foul); color: var(--foul-ink); }
.chip-mine { background: var(--foul); color: var(--foul-ink); margin-left: var(--space-1); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.list-row, .team-row, .channel-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 60px; padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); color: var(--text); text-decoration: none; margin-bottom: var(--space-2); }
.list-row small { text-align: right; }
.menu .list-row::after, .team-row::after, .channel-row::after { content: "›"; font-size: 26px; color: var(--text-3); margin-left: var(--space-2); }
.team-list { list-style: none; padding: 0; margin: 0; }
.team-row-name { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); flex: 1; }
.hello { font-size: var(--text-lg); font-weight: 700; margin: 0 0 var(--space-2); }
.home { display: flex; flex-direction: column; gap: var(--space-3); }

/* ---- auth */
.auth { max-width: 440px; margin: 0 auto; padding-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.auth form { display: flex; flex-direction: column; gap: var(--space-3); }
.auth-brand { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; }
.auth-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--foul); color: var(--foul-ink); border-radius: var(--radius-tile); }
.auth-title { font-size: var(--text-3xl); margin: var(--space-3) 0 0; }
.auth-sub { margin: 0; color: var(--text-2); }
.auth-alt { text-align: center; }
form.stack > .btn-block { margin-top: var(--space-2); }

/* ---- schedule */
.games { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.game-card { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); text-decoration: none; color: var(--text); min-height: 72px; }
.game-card[data-status=live] { border: 3px solid var(--foul); }
.game-card[data-status=cancelled] .game-vs { text-decoration: line-through; color: var(--text-3); }
.game-when { display: flex; flex-direction: column; font-size: var(--text-xs); color: var(--text-3); line-height: 1.25; }
.game-when strong { color: var(--text); font-size: var(--text-sm); }
.game-main { display: flex; flex-direction: column; min-width: 0; }
.game-vs { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linked { color: var(--ok); }
.game-sub { font-size: var(--text-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.game-score { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); white-space: nowrap; }
.res { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: var(--radius-tile); font-size: var(--text-md); background: var(--surface-3); }
.res[data-res=W] { background: var(--go); color: var(--go-ink); }
.rsvp-mini { font-size: var(--text-xs); color: var(--text-3); font-weight: 700; white-space: nowrap; }
.invite { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2) 0; }

/* ---- game */
.game-hero, .tour-hero { background: var(--board-900); color: var(--chalk); border-radius: var(--radius-card); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
.game-hero .muted, .tour-hero .muted { color: var(--chalk-dim); }
.tour-hero a { color: var(--foul); font-weight: 700; }
.game-hero h2 { margin: 0; font-size: var(--text-2xl); }
.game-hero-when { margin: 0; font-weight: 800; color: var(--foul); }
.game-hero-score { margin: 0; font-family: var(--font-display); font-size: var(--text-4xl); font-weight: 900; line-height: 1; }
.game-hero p { margin: 0; }
.game-hero .chip { background: var(--board-700); color: var(--chalk); }
.game-hero .chip-ok { background: var(--go); color: var(--go-ink); }
.game-hero .chip-live { background: var(--strike); }
.rsvp-summary { font-weight: 700; }
.rsvp-list { display: flex; flex-direction: column; }
.rsvp-row { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-1); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.rsvp-row:has(> .rsvp-status) { flex-direction: row; justify-content: space-between; align-items: center; }
.rsvp-row:last-child { border-bottom: 0; }
.rsvp-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.rsvp-btn { min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-control); border: 2px solid var(--border); background: var(--surface); font: 700 var(--text-sm) var(--font-ui); color: var(--text-2); cursor: pointer; }
.rsvp-btn.on[data-rsvp=yes] { background: var(--go); border-color: var(--go); color: var(--go-ink); }
.rsvp-btn.on[data-rsvp=maybe] { background: var(--foul); border-color: var(--foul); color: var(--foul-ink); }
.rsvp-btn.on[data-rsvp=no] { background: var(--strike); border-color: var(--strike); color: var(--strike-ink); }
.rsvp-status { font-size: var(--text-sm); font-weight: 700; color: var(--text-3); }
.rsvp-status.st-yes { color: var(--ok); } .rsvp-status.st-no { color: var(--danger); }
.lineup-view { margin: 0; padding-left: var(--space-5); }
.lineup-view li { padding: var(--space-1) 0; display: flex; justify-content: space-between; gap: var(--space-2); }

/* ---- lineup editor */
.order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.order-row { display: grid; grid-template-columns: 32px 1fr 92px; grid-template-areas: "n name pos" "n btns btns"; gap: 4px var(--space-2); align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); }
.order-n { grid-area: n; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 900; text-align: center; }
.order-name { grid-area: name; font-weight: 700; min-width: 0; }
.order-row select { grid-area: pos; min-height: 44px; padding: var(--space-2); }
.order-btns { grid-area: btns; display: flex; justify-content: flex-end; gap: 4px; }
.order-btns .icon-btn { background: var(--surface-2); }
.bench { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.bench-btn { min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 2px dashed var(--border); background: var(--surface); font: 700 var(--text-sm) var(--font-ui); color: var(--text); cursor: pointer; }
.inning-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.inning-tab { flex: none; min-width: 48px; min-height: 48px; border-radius: var(--radius-tile); border: 2px solid var(--border); background: var(--surface); font: 900 var(--text-lg) var(--font-display); cursor: pointer; color: var(--text); }
.inning-tab.on { background: var(--board-900); color: var(--foul); border-color: var(--board-900); }
.defense { display: flex; flex-direction: column; }
.defense-row { display: grid; grid-template-columns: 1fr 120px; gap: var(--space-2); align-items: center; padding: 4px 0; }
.defense-row select { min-height: 44px; padding: var(--space-2); }
.warn-text { color: var(--warn); background: var(--warn-bg); padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); font-weight: 700; margin: 0; }
.sticky-save { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-sheet); }

/* ---- scorer links (v2.0: no PINs) */
.link-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
.link-card h3 { margin: 0; font-size: var(--text-lg); }
.scorer-link { display: flex; flex-direction: column; gap: var(--space-2); }
.ways { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }
.join-code { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 900; letter-spacing: .15em; margin: 0; }

/* ---- roster + player */
.player-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.player-tile { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); }
.player-photo, .player-num { width: 100%; aspect-ratio: 3 / 4; border-radius: var(--radius-control); object-fit: cover; }
.player-num { display: grid; place-items: center; background: var(--surface-3); font-family: var(--font-display); font-size: var(--text-4xl); font-weight: 900; color: var(--text-2); }
.player-name { font-weight: 800; }
.player-meta { font-size: var(--text-xs); color: var(--text-3); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.profile-sub { margin: 0; color: var(--text-2); font-weight: 700; }
.photo-row { display: flex; gap: var(--space-4); align-items: flex-start; }
.profile-photo, .profile-num { width: 120px; flex: none; aspect-ratio: 3 / 4; border-radius: var(--radius-control); object-fit: cover; }
.profile-num { display: grid; place-items: center; background: var(--surface-3); font-family: var(--font-display); font-size: var(--text-4xl); font-weight: 900; }
.consent { display: flex; flex-direction: column; gap: var(--space-2); }
.consent-row { display: flex; flex-direction: column; border-bottom: 1px solid var(--border); padding-bottom: var(--space-2); }
.consent-row small { padding-left: 64px; margin-top: -6px; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.facts li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); background: var(--surface-2); border-radius: var(--radius-control); padding: 0 0 0 var(--space-3); min-height: 48px; }
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-2); }
.stat { display: flex; flex-direction: column; align-items: center; background: var(--surface-2); border-radius: var(--radius-tile); padding: var(--space-2); }
.stat strong { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 900; line-height: 1; }
.stat small { font-size: var(--text-xs); color: var(--text-3); font-weight: 800; }

/* ---- team more */
.team-hero { display: flex; gap: var(--space-3); align-items: center; }
.team-hero h2 { margin: 0; font-size: var(--text-2xl); }
.team-hero p { margin: 0 0 var(--space-1); }
.team-badge { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: var(--radius-tile); background: var(--team, var(--board-800)); color: #fff; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 900; }
.invite-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.invite-code { flex: 1; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 900; letter-spacing: .15em; background: var(--surface-2); border-radius: var(--radius-tile); padding: var(--space-2) var(--space-3); }
.members { display: flex; flex-direction: column; gap: var(--space-2); }
.member { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2); align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-3); }
.member-main { display: flex; flex-direction: column; min-width: 0; }
.member-main small { overflow: hidden; text-overflow: ellipsis; }
.member select { width: auto; min-height: 44px; padding: var(--space-2); }
.member-actions { grid-column: 1 / -1; display: flex; gap: var(--space-2); justify-content: flex-end; }
.privacy-row { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }

/* ---- tournaments */
.suggestions { display: flex; flex-direction: column; gap: var(--space-3); }
.suggestion { border: 2px solid var(--border); border-radius: var(--radius-control); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.suggestion.st-accepted { border-color: var(--ok); }
.suggestion.st-rejected { opacity: .6; }
.suggest-head { display: flex; justify-content: space-between; gap: var(--space-2); align-items: flex-start; }
.passage { margin: 0; padding: var(--space-2) var(--space-3); border-left: 4px solid var(--foul); background: var(--surface-2); font-size: var(--text-sm); color: var(--text-2); }
.notes { white-space: pre-line; }

/* ---- stats + pitching */
.record { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.record-big { font-family: var(--font-display); font-size: var(--text-4xl); font-weight: 900; line-height: 1; }
.table-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--space-4)); padding: 0 var(--space-4); }
.stats { border-collapse: collapse; width: 100%; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.stats th, .stats td { padding: var(--space-2); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.stats .num { text-align: right; }
.stats tbody th { position: sticky; left: 0; background: var(--surface); }
.avail { display: flex; flex-direction: column; gap: var(--space-2); }
.avail-row { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--space-2); align-items: center; padding: var(--space-3); background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--border); border-radius: var(--radius-control); }
.avail-row.can { border-left-color: var(--go); }
.avail-row.cannot { border-left-color: var(--strike); }
.avail-chip { font-weight: 800; font-size: var(--text-sm); padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-3); white-space: nowrap; }
.avail-chip.ok { background: var(--go); color: var(--go-ink); }
.avail-chip.no { background: var(--danger-bg); color: var(--danger); }
.avail-reason { grid-column: 1 / -1; color: var(--text-3); }
.banner-warn { background: var(--warn-bg); color: var(--warn); padding: var(--space-3); border-radius: var(--radius-control); font-weight: 700; margin: 0; }

/* ---- chat */
.channels .channel-row { justify-content: flex-start; }
.channel-icon { font-size: 26px; }
.channel-text { display: flex; flex-direction: column; flex: 1; }
.chat { display: flex; flex-direction: column; gap: var(--space-2); }
.messages { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.page:has(.composer) { padding-bottom: calc(var(--composer-h, 120px) + 96px + env(safe-area-inset-bottom)); }
.msg { position: relative; max-width: 86%; align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card) var(--radius-card) var(--radius-card) var(--radius-tile); padding: var(--space-2) 44px var(--space-2) var(--space-3); }
.msg.mine { align-self: flex-end; background: var(--board-800); color: var(--chalk); border-color: var(--board-800); border-radius: var(--radius-card) var(--radius-card) var(--radius-tile) var(--radius-card); }
.msg.mine .msg-meta, .msg.mine time { color: var(--chalk-dim); }
.msg-announcement { border: 2px solid var(--foul); max-width: 100%; align-self: stretch; }
.msg-auto { align-self: center; background: transparent; border: 0; color: var(--text-3); font-size: var(--text-sm); text-align: center; padding: 0 var(--space-3); max-width: 100%; }
.msg.removed .msg-body { font-style: italic; color: var(--text-3); }
.msg-meta { display: flex; gap: var(--space-2); align-items: baseline; font-size: var(--text-xs); color: var(--text-3); flex-wrap: wrap; }
.msg-meta strong { color: inherit; }
.msg.mine .msg-meta strong { color: var(--chalk); }
.msg-body { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-more { position: absolute; top: 2px; right: 2px; min-width: 40px; min-height: 40px; border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; opacity: .6; }
.composer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(64px + env(safe-area-inset-bottom)); width: min(100%, 720px); display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) var(--space-3); background: var(--surface-2); border-top: 1px solid var(--border); z-index: 9; }
.composer-row { display: flex; gap: var(--space-2); align-items: flex-end; min-width: 0; }
.composer textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 160px; resize: none; }
.composer-btn { flex: none; min-height: 48px; }
.composer-hint { margin: 0; font-size: var(--text-xs); color: var(--text-3); text-align: center; }
.composer-error { margin: 0; color: var(--danger); font-size: var(--text-sm); font-weight: 700; }
.composer-reply { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border-left: 4px solid var(--foul); background: var(--surface); border-radius: var(--radius-tile); }
.composer-reply-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.composer-reply-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending { display: flex; gap: var(--space-2); overflow-x: auto; margin: 0; padding: 0; }
.pending-item { flex: none; display: flex; align-items: center; gap: var(--space-2); width: 220px; max-width: 80%; padding: var(--space-1) var(--space-1) var(--space-1) var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); }
.pending-thumb { flex: none; width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-tile); display: grid; place-items: center; font-size: 24px; background: var(--surface-3); }
.pending-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pending-name { font-size: var(--text-xs); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-main progress { width: 100%; height: 6px; accent-color: var(--foul); }
.mention-list { list-style: none; margin: 0; padding: var(--space-1); max-height: 220px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: var(--shadow-sheet); }
.mention-opt { display: flex; justify-content: space-between; gap: var(--space-2); align-items: baseline; min-height: 44px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-tile); cursor: pointer; }
.mention-opt.on, .mention-opt:hover { background: var(--surface-3); }
.mention { font-weight: 800; color: var(--accent, inherit); }
.mention-me { background: var(--foul); color: var(--foul-ink); border-radius: 4px; padding: 0 3px; }
.msg.mine .mention:not(.mention-me) { color: var(--chalk); text-decoration: underline; }
.msg { scroll-margin-bottom: calc(var(--composer-h, 120px) + 80px); }
.msg-reply { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin: 4px 0 2px; padding: 4px var(--space-2); border: 0; border-left: 3px solid var(--foul); border-radius: 4px; background: color-mix(in srgb, currentColor 8%, transparent); color: inherit; font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer; }
.msg-reply span, .msg-reply em { opacity: .85; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.msg-media { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-1); }
.att-img { display: block; }
.att-img img, .att-video { display: block; max-width: 100%; width: 100%; height: auto; max-height: 360px; object-fit: contain; border-radius: var(--radius-tile); background: var(--surface-3); }
.att-img img[width] { width: auto; min-width: 120px; }
.att-expired { margin: 0; padding: var(--space-2) var(--space-3); border: 1px dashed var(--border); border-radius: var(--radius-tile); font-size: var(--text-sm); font-style: italic; opacity: .8; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--space-1); }
.react-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; min-width: 40px; padding: 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.react-chip.mine { border-color: var(--foul); background: color-mix(in srgb, var(--foul) 30%, var(--surface)); font-weight: 800; }
.react-add { color: var(--text-3); font-weight: 800; }
.react-count { font-size: var(--text-xs); font-weight: 800; }
.emoji-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-1); margin: var(--space-2) 0; }
.emoji-btn { min-height: 48px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-2); font-size: 24px; cursor: pointer; }
.emoji-btn.mine { border-color: var(--foul); border-width: 2px; }
.emoji-other { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
.emoji-other input { flex: 1; min-width: 0; }
.emoji-other .form-error { flex-basis: 100%; }
.gif-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-3) 0; }
.gif-pick { padding: 0; border: 0; background: var(--surface-3); border-radius: var(--radius-tile); overflow: hidden; cursor: pointer; min-height: 80px; }
.gif-pick img { display: block; width: 100%; height: 120px; object-fit: cover; }
.chat-switch { margin-bottom: var(--space-2); }
.chat-links { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-start; margin-bottom: var(--space-2); }
.gameday-list { flex: 1 1 100%; }
.gameday-list summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.chip-link { min-height: 32px; }
.composer-note { text-align: center; color: var(--text-3); }
.quote { margin: 0; padding: var(--space-2) var(--space-3); background: var(--surface-2); border-radius: var(--radius-control); white-space: pre-wrap; overflow-wrap: anywhere; }
.report-box { display: flex; flex-direction: column; gap: var(--space-2); }
.reports { display: flex; flex-direction: column; gap: var(--space-3); }

/* ---- v2.1 footer (links to the server's /privacy, /terms, /support) */
.app-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-3); }
.app-footer a { color: var(--text-2); }

/* ---- v2.1 small confirm anchored to its button */
.pop-confirm { position: absolute; z-index: 30; width: min(300px, calc(100vw - 24px)); padding: var(--space-3); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: var(--shadow-sheet); }
.pop-confirm p { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.pop-confirm .row-btns { justify-content: flex-end; }
.pop-error { color: var(--danger); font-weight: 700; }

/* ---- sheet + toast */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: min(100%, 560px); max-height: 90dvh; border-radius: var(--radius-card) var(--radius-card) 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sheet); }
dialog.sheet::backdrop { background: rgba(6, 24, 15, .55); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4) 0; }
.sheet-head h2 { margin: 0; font-size: var(--text-lg); }
.sheet-body { padding: var(--space-3) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: var(--space-3); }
.sheet-body p { margin: 0; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 72px); z-index: 100; display: flex; flex-direction: column; gap: var(--space-2); width: min(92vw, 480px); pointer-events: none; }
.toast { padding: var(--space-3) var(--space-4); border-radius: var(--radius-control); background: var(--board-900); color: var(--chalk); font-weight: 700; box-shadow: var(--shadow-sheet); }
.toast-ok { border-left: 6px solid var(--go); }
.toast-warn { border-left: 6px solid var(--foul); }
.toast-danger { border-left: 6px solid var(--strike); }

@media (min-width: 640px) {
  .link-grid { grid-template-columns: 1fr 1fr; }
  .action-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- roster model v1.3: seasons, kids, guests, overlay style ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chip-guest { background: var(--warn-bg); color: var(--warn); margin-left: var(--space-1); }
.season-switch select { width: auto; min-width: 11em; font-weight: 700; }
.section-head:empty { display: none; }
.season-note { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.season-note a { color: inherit; }
.season-list { display: grid; gap: var(--space-2); }
.season-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.season-row .chip { margin-left: var(--space-2); }
.row-btns.compact { flex: 0 0 auto; }
.record-season { font-weight: 800; color: var(--text-2); }
.player-tile.is-left { opacity: .6; }

/* Overlay style picker (team settings) */
.overlay-pick { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.overlay-pick legend { font-weight: 800; font-size: var(--text-md); padding: 0; margin-bottom: var(--space-1); }
.overlay-pick > p { margin: 0; }
.overlay-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.overlay-opt { position: relative; display: grid; gap: 4px; align-content: start; padding: var(--space-2); border: 2px solid var(--border); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; }
.overlay-opt img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--board-900); }
.overlay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.overlay-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.overlay-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.overlay-name { font-weight: 800; font-size: var(--text-sm); line-height: 1.2; }
.overlay-opt small { font-size: var(--text-xs); line-height: 1.25; }
@media (max-width: 420px) { .overlay-opts { grid-template-columns: 1fr; } .overlay-opt { grid-template-columns: 120px 1fr; column-gap: var(--space-3); } .overlay-opt img { grid-row: span 2; } }

/* Children */
.kid-list { display: grid; gap: var(--space-3); }
.kid-head { display: flex; align-items: center; gap: var(--space-3); }
.kid-head .card-title { flex: 1; margin: 0; }
.kid-photo { width: 48px; height: 64px; object-fit: cover; border-radius: 4px; }
.kid-teams { display: grid; gap: 6px; }
.kid-team { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.child-chooser { display: grid; gap: var(--space-3); }
.chooser-q { margin: 0; font-weight: 800; font-size: var(--text-lg); }
.choice-list { display: grid; gap: var(--space-2); }
.choice { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) var(--space-3); border: 2px solid var(--border); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); }
.choice input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--accent); }
.choice span { display: grid; }
.claim-who { font-size: var(--text-lg); }
.claim-code { margin: 0; font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 900; letter-spacing: .15em; }
.claim-block, .claim-out { display: grid; gap: var(--space-1); justify-items: start; }

/* Guests */
.guest-list { display: grid; gap: var(--space-3); }
.guest-row { display: grid; gap: var(--space-2); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.guest-main { display: flex; align-items: center; gap: var(--space-2); }
.guest-main strong { flex: 0 1 auto; }
.guest-main .num-input { margin-left: auto; }
.num-input { width: 4.2em !important; min-height: 44px; text-align: center; font-weight: 800; }
.prev-guests { display: grid; gap: var(--space-2); }
.prev-guest { display: flex; align-items: center; gap: var(--space-2); }
.prev-guest > span { flex: 1; min-width: 0; }
.guest-new { display: flex; gap: var(--space-2); }
.guest-new input[name=guest_first] { flex: 1; min-width: 0; }
.guest-new input[name=guest_number] { width: 4.2em; }
.order-row .num-input { grid-area: btns; justify-self: start; }
.outings { margin-top: 2px; font-size: var(--text-xs); color: var(--text-3); }
.outing.other-team strong { color: var(--warn); }
.order-row:has(.num-input) .order-btns { justify-self: end; }
.pc-body { display: grid; gap: var(--space-2); }
.pc-teams { display: grid; gap: var(--space-2); }
.pc-team { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px var(--space-2); }
.pc-team small { flex-basis: 100%; }
.pitch-counts .outings { font-size: var(--text-sm); }
.kid-head .player-num { width: 48px; height: 64px; flex: none; font-size: var(--text-xl); aspect-ratio: auto; }

/* ---- v1.4: sign-in providers, account, admin, next season */
.appbar-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.sso { display: flex; flex-direction: column; gap: var(--space-2); align-items: stretch; }
.sso-google { display: flex; justify-content: center; min-height: 44px; }
.sso-btn { min-height: 48px; font-weight: 700; }
.sso-apple { background: #000; border-color: #000; color: #fff; }
.sso-facebook { background: #1877F2; border-color: #1877F2; color: #fff; }
.sso-or { display: flex; align-items: center; gap: var(--space-2); color: var(--text-3); font-size: var(--text-sm); margin: var(--space-1) 0 0; }
.sso-or::before, .sso-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.notice { padding: var(--space-3); border-radius: var(--radius-card); background: var(--surface); border: 2px solid var(--border); }
.notice p { margin: 0 0 var(--space-2); }
code.break, .break { overflow-wrap: anywhere; word-break: break-all; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 420px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.admin-row { flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.kv li { display: flex; align-items: center; gap: var(--space-2); justify-content: space-between; padding: var(--space-1) 0; }
.kv li > span:first-child { flex: 1; }
.audit li { padding: var(--space-1) 0; border-bottom: 1px solid var(--border); }
.checklist { border: 2px solid var(--border); border-radius: var(--radius-card); padding: var(--space-2) var(--space-3); display: flex; flex-direction: column; }
.check-row { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; }
.check-row input { width: 22px; height: 22px; }

/* v1.5: notifications, share link, clips, video plan */
.notif-opts { display: grid; gap: var(--space-2); }
.notif-opt { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) var(--space-3); border: 2px solid var(--border); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; }
.notif-opt input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.notif-opt span { display: grid; gap: 2px; }
.notif-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.notif-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.clip-list .list-row { padding-left: 0; padding-right: 0; }
.clip-list .list-row > span:first-child { min-width: 0; }
.clip-play video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-control); margin-bottom: var(--space-3); }
.plan p { margin: 0 0 var(--space-1); }
.plan[data-state=over] strong { color: var(--warn); }
.admin-row .btn-sm { flex: none; }

/* v1.7: practices on the schedule, opponent search, player hub. */
.event-card { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3);
  background: var(--surface-2); border: 1px dashed var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-control); color: var(--text); min-height: 64px; }
.event-card.is-cancelled .game-vs { text-decoration: line-through; color: var(--text-3); }
.event-kind { display: inline-block; padding: 0 8px; border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-ink); font-size: var(--text-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.event-notes { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weekday-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.weekday-opt { position: relative; }
.weekday-opt input { position: absolute; opacity: 0; inset: 0; }
.weekday-opt span { display: inline-grid; place-items: center; min-width: 48px; min-height: 44px; border-radius: var(--radius-control); border: 2px solid var(--border); background: var(--surface); font-weight: 700; }
.weekday-opt input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.weekday-opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.opp-results { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.opp-opt { display: block; width: 100%; text-align: left; min-height: 48px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-control);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: var(--text-sm) var(--font-ui); cursor: pointer; }
.opp-opt:hover, .opp-opt:focus-visible { border-color: var(--accent); }
.opp-name { border-style: dashed; }
.opp-chip { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3);
  border: 2px solid var(--accent); border-radius: var(--radius-control); background: var(--surface); min-height: 52px; }
.link-btn { background: none; border: 0; padding: 8px; color: var(--accent); font: 700 var(--text-sm) var(--font-ui); text-decoration: underline; cursor: pointer; }
.kid-hub { display: flex; flex-direction: column; gap: var(--space-2); }
.hub-list { display: flex; flex-direction: column; gap: 4px; }
.hub-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.hub-row:last-child { border-bottom: 0; }
.hub-when { color: var(--text-3); font-size: var(--text-xs); min-width: 9em; }
.hub-event .event-kind { margin-right: 4px; }
.plan[data-state=unavailable] strong { color: var(--text-2); }

/* ---- v1.8 kids, invites, roles */
.appbar-invites { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; color: var(--chalk); text-decoration: none; font-size: 22px; }
.appbar-invites[hidden] { display: none; }
.appbar-invites .badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--foul); color: var(--foul-ink); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.invite-banner { display: flex; justify-content: space-between; gap: var(--space-2); text-decoration: none; }
.invite-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-invite.st-pending { background: var(--warn-bg); color: var(--warn); }
.chip-invite.st-accepted { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.chip-invite.st-declined, .chip-invite.st-expired { background: var(--surface-3); color: var(--text-3); }
.notice-warn { color: var(--warn); background: var(--warn-bg); }
.chip-checks { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: grid; place-items: center; min-width: 52px; min-height: 44px; padding: 0 var(--space-2); border: 2px solid var(--border); border-radius: var(--radius-pill); font-weight: 700; cursor: pointer; }
.chip-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-check input:focus-visible + span { outline: 3px solid var(--focus); }
fieldset.positions { border: 0; padding: 0; margin: 0; }
fieldset.positions legend { font-weight: 700; font-size: var(--text-sm); color: var(--text-2); margin-bottom: var(--space-1); }
.facts-mini { margin: 0; }
.role-caps { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }

/* v1.9: lineup range copy */
.range-copy .row-btns { align-items: center; margin: var(--space-2) 0; }

/* ---------- v2.0: share game, stream links, schedule row share ---------- */
.card-sub { margin: 0; font-size: var(--text-md); }
.stream-list { display: flex; flex-direction: column; gap: var(--space-2); }
.stream-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-control); }
.stream-row > a { min-width: 0; overflow-wrap: anywhere; color: var(--text); text-decoration: none; }
.game-item { display: flex; gap: var(--space-2); align-items: stretch; }
.game-item > .game-card { flex: 1; min-width: 0; }
.game-row-btns { display: flex; flex-direction: column; gap: var(--space-1); }
.game-row-btns > .btn { flex: 1; }
.game-delete { color: var(--danger); }
.game-share { flex: none; min-height: auto; padding: 0 var(--space-3); }

/* ---------- v2.0: desktop layout ----------
 * Phones keep the single column with the bottom tab bar. From 900px the
 * shell fills the window: header across the top, the team sections as a
 * left sidebar, wide content; pages that opt in (.desk-cols) flow their
 * cards into two columns, and lists/grids use the width. */
@media (min-width: 900px) {
  .shell { max-width: none; display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .appbar { grid-column: 1 / -1; padding-left: var(--space-5); padding-right: var(--space-5); }
  .page { grid-column: 1 / -1; width: 100%; max-width: 1180px; margin: 0 auto; padding: var(--space-5) var(--space-6) var(--space-7); }
  .shell.has-tabs .page { grid-column: 2; grid-row: 2; padding-bottom: var(--space-7); }
  .tabbar { position: sticky; top: 0; grid-column: 1; grid-row: 2; align-self: start; transform: none; left: auto; width: auto;
    flex-direction: column; gap: 2px; padding: var(--space-4) var(--space-3); border-top: 0; border-right: 1px solid var(--border);
    min-height: calc(100dvh - 72px); background: var(--surface); }
  .tabbar-item { flex: none; flex-direction: row; justify-content: flex-start; gap: var(--space-3); min-height: 48px; padding: 0 var(--space-3);
    border-radius: var(--radius-control); font-size: var(--text-md); }
  .tabbar-item:hover { background: var(--surface-3); color: var(--text); }
  .tabbar-item.on { box-shadow: inset 4px 0 0 var(--foul); background: var(--surface-3); }
  .tabbar-icon { width: 24px; text-align: center; }
  .sticky-save { bottom: var(--space-4); }
  #toasts { top: 88px; }
  /* Two columns of cards (game page, scorer links). */
  .desk-cols { display: block; column-count: 2; column-gap: var(--space-5); }
  .desk-cols > * { break-inside: avoid; margin: 0 0 var(--space-4); }
  .desk-cols > .span-all { column-span: all; }
  .games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .player-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .action-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .table-wrap { margin: 0; padding: 0; }
  .auth { padding-top: var(--space-7); }
}
@media (min-width: 1280px) {
  .games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* v2.2 team logos */
.team-logo { width: 20px; height: 20px; object-fit: contain; vertical-align: -4px; margin-right: 6px; flex: none; }
.appbar-logo { width: 32px; height: 32px; object-fit: contain; flex: none; border-radius: 6px; }
.opp-logo { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.chip-age { margin-left: 6px; font-size: var(--text-xs); padding: 1px 6px; }
.hero-logos { display: flex; align-items: center; gap: var(--space-3); }
.hero-side { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; }
.hero-side img { width: 56px; height: 56px; object-fit: contain; }
.hero-side small { color: var(--chalk-dim); font-size: var(--text-xs); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-nologo { width: 56px; height: 56px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); }
.logo-row { display: flex; align-items: center; gap: var(--space-3); }
.logo-preview { width: 96px; height: 96px; flex: none; display: grid; place-items: center; border-radius: 12px; background: repeating-conic-gradient(#e6e6e6 0 25%, #fff 0 50%) 0 0 / 16px 16px; overflow: hidden; }
.logo-preview img { width: 96px; height: 96px; object-fit: contain; }
.logo-empty { width: 96px; height: 96px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 28px; }

/* ---- v2.5 chat: game-day state, schedule cards, files, media panel */
.gd-banner { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); border: 1px solid var(--border); background: var(--surface); }
.gd-banner[data-state=open] { border-left: 4px solid var(--ok); }
.gd-banner[data-state=closed] { border-left: 4px solid var(--text-3); background: var(--surface-2); }
.gd-banner[data-state=blocked] { border-left: 4px solid var(--danger); background: var(--danger-bg); }
.gd-icon { flex: none; font-size: 20px; }
.gd-text { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; }
.gd-text small { color: var(--text-2); }
.gd-actions { flex: none; display: flex; gap: var(--space-2); margin-left: auto; }
.chat-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); flex-wrap: wrap; }
.chat-toolbar .load-older { margin-right: auto; }
.chat-media-btn { min-height: 40px; }
.composer-reason { margin: 0; padding: var(--space-1) var(--space-2); font-size: var(--text-sm); font-weight: 700; color: var(--text-2); text-align: center; }
.composer-off textarea { background: var(--surface-3); cursor: not-allowed; }
.composer-off .composer-hint { display: none; }
.msg.flash { outline: 3px solid var(--foul); outline-offset: 2px; transition: outline-color .3s; }

.msg-schedule { align-self: stretch; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sched-time { font-size: var(--text-xs); color: var(--text-3); text-align: center; }
.sched-card { text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); }
.sched-changed { border-left-color: var(--warn); }
.sched-cancelled { border-left-color: var(--danger); }
.sched-head { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.sched-items { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; }
.sched-item { display: flex; gap: var(--space-2); align-items: flex-start; padding-top: var(--space-1); border-top: 1px solid var(--border); }
.sched-item:first-child { border-top: 0; }
.sched-icon { flex: none; font-size: 20px; line-height: 1.4; }
.sched-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--text-sm); }
.sched-name { font-weight: 800; font-size: var(--text-md); overflow-wrap: anywhere; }
a.sched-name { color: var(--link); }
s.sched-name { color: var(--text-3); }
.sched-when, .sched-where { color: var(--text-2); overflow-wrap: anywhere; }
.sched-main .changed { color: var(--warn); background: var(--warn-bg); font-weight: 800; border-radius: 4px; padding: 0 4px; align-self: flex-start; }
.sched-tour { align-self: flex-start; }
.sched-changes { color: var(--text-3); }

.file-icon { flex: none; display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 4px; border-radius: var(--radius-tile); font: 800 11px/1 var(--font-ui); letter-spacing: .03em; color: #fff; background: #5b6470; }
.file-icon[data-group=pdf] { background: #c0392b; }
.file-icon[data-group=doc] { background: #2b5797; }
.file-icon[data-group=sheet] { background: #1e7145; }
.file-icon[data-group=slides] { background: #c35a1d; }
.file-icon[data-group=text] { background: #5b6470; }
.pending-thumb .file-icon { min-width: 44px; }
.att-file { display: flex; align-items: center; gap: var(--space-2); min-height: 56px; padding: var(--space-1) var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-2); color: var(--text); text-decoration: none; min-width: 0; max-width: 100%; }
.msg.mine .att-file { background: var(--board-700, var(--surface-2)); color: var(--chalk); border-color: var(--board-600, var(--border)); }
.att-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-file-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file-size { opacity: .75; }
.att-file-dl { flex: none; font-size: 18px; opacity: .8; }

dialog.sheet[data-testid=media-sheet] { height: 90dvh; }
dialog.sheet[data-testid=media-sheet] .sheet-body { overflow-y: auto; max-height: calc(90dvh - 60px); }
.media-body { flex: none; min-height: 120px; display: flex; flex-direction: column; gap: var(--space-3); }
.media-grid { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; }
@media (min-width: 520px) { .media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.media-tile { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--radius-tile); overflow: hidden; background: var(--surface-3); cursor: pointer; color: var(--text); }
.media-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 28px; }
.media-tile.expired .media-ph { opacity: .45; }
.media-badge { position: absolute; top: 4px; left: 4px; padding: 0 6px; border-radius: 4px; background: rgba(0,0,0,.65); color: #fff; font: 800 11px/18px var(--font-ui); }
.media-exp { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 11px; font-weight: 700; text-align: left; }
.media-exp:empty { display: none; }
.media-exp.is-expired { background: rgba(0,0,0,.6); text-align: center; }
.media-files { flex: none; display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; }
.media-file { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); min-width: 0; }
.media-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.media-file-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-exp-line { color: var(--text-3); }
.media-exp-line.is-expired, .media-file[data-expired] .media-file-name { color: var(--danger); }
.media-file[data-expired] .file-icon { opacity: .5; }
.viewer-media { display: block; width: 100%; max-height: 65dvh; object-fit: contain; border-radius: var(--radius-tile); background: #000; }

/* ---------- v2.6: the app's layout on the web ----------
 * Main tabs (Team · Players · Messages · Settings) in .tabbar; a team hub's
 * Schedule · Roster · Stats · More pill; the team record chip; the schedule
 * (create buttons, this-week block, List | Calendar, chip rows, month grid,
 * multi-select bar) and small anchored menus. */
.tabbar-item { position: relative; }
.tab-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-pill);
  background: var(--strike); color: var(--strike-ink); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.appbar-title { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.appbar-title small { flex-basis: 100%; }
.appbar-title h1 { min-width: 0; flex: 0 1 auto; }
.appbar-plus { font-size: 26px; width: 44px; padding: 0; line-height: 1; }
.record-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--text);
  font: 800 15px var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.appbar .record-chip { background: var(--board-700); color: var(--chalk); }
.team-row .record-chip { margin-left: var(--space-2); }
.team-row-gap { flex: 1; }
.team-row .team-row-name { flex: 0 1 auto; }

.team-pill { display: flex; gap: 2px; padding: 3px; margin: 0 0 var(--space-3); background: var(--surface-3); border-radius: var(--radius-pill); }
.team-pill-item { flex: 1; display: grid; place-items: center; min-height: 44px; border-radius: var(--radius-pill); color: var(--text-2);
  font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.team-pill-item.on { background: var(--surface); color: var(--text); font-weight: 800; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.team-pill-item:focus-visible { outline: 3px solid var(--focus); }

.sched-create { display: flex; gap: var(--space-2); }
.create-btn { flex: 1; display: grid; place-items: center; min-height: 50px; padding: 0 6px; border-radius: var(--radius-control); background: var(--surface-3);
  color: var(--text); font-weight: 800; font-size: 15px; text-align: center; text-decoration: none; line-height: 1.15; }
.create-btn.prominent { background: var(--accent); color: var(--accent-ink); }
.sched-title { font-family: var(--font-ui); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: var(--space-2) 0 var(--space-2); }
.week-block, .sched-list { display: flex; flex-direction: column; gap: var(--space-2); }
.empty-note { margin: 0; padding: var(--space-3) var(--space-4); background: var(--surface); border-radius: var(--radius-control); }
.sched-controls { display: flex; flex-direction: column; gap: var(--space-2); }
.chip-row { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chip-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--text); font: 800 14px var(--font-ui); cursor: pointer; }
.filter-chip.on { background: var(--accent); color: var(--accent-ink); }
.filter-chip:focus-visible { outline: 3px solid var(--focus); }
.chip-check-mark { font-size: 11px; }
.chip-danger { background: var(--danger-bg); color: var(--danger); }

.game-item { position: relative; }
.game-item.indented { padding-left: 22px; }
.game-item.indented::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--highlight); }
.row-menu { flex: none; width: 40px; border: 0; border-radius: var(--radius-control); background: var(--surface); color: var(--text-2); font-size: 22px; cursor: pointer; }
.row-menu:hover { background: var(--surface-3); }
.tour-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); background: var(--surface); border-radius: var(--radius-control); color: var(--text); text-decoration: none; }
.tour-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 8px; background: var(--highlight); color: var(--highlight-ink); font-size: 18px; }
.tour-head .game-main { display: flex; flex-direction: column; }
.tour-head strong { font-size: var(--text-md); font-weight: 800; }
.select-row { flex: 1; display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: var(--space-3); border: 0; border-radius: var(--radius-control);
  background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.select-row:disabled { opacity: .5; cursor: not-allowed; }
.select-row .game-main { display: flex; flex-direction: column; }
.select-dot { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--text-3); color: #fff; font-size: 14px; font-weight: 900; }
.select-row.on .select-dot { background: var(--danger); border-color: var(--danger); }
.select-bar { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 9; display: flex; gap: var(--space-3); padding: var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-sheet); }
.select-bar > * { flex: 1; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 800; }

.sched-cal { display: flex; flex-direction: column; gap: var(--space-2); touch-action: pan-y; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-month { font-size: var(--text-md); font-weight: 800; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px 2px; text-align: center; }
.cal-wd { font-size: 12px; font-weight: 800; color: var(--text-3); }
.cal-day { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; padding: 2px 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.cal-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 15px; }
.cal-day.today .cal-num { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 800; }
.cal-day:focus-visible .cal-num { outline: 3px solid var(--focus); }
.cal-dots { display: flex; gap: 3px; height: 5px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-dot[data-kind=games] { background: var(--ok); }
.cal-dot[data-kind=tournaments] { background: var(--highlight); }
.cal-dot[data-kind=other] { background: var(--link); }

.pop-menu { position: absolute; z-index: 30; min-width: 180px; padding: 4px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-control); box-shadow: var(--shadow-sheet); display: flex; flex-direction: column; }
.pop-menu-item { min-height: 44px; padding: 0 var(--space-3); border: 0; border-radius: 10px; background: none; color: var(--text); font: 700 var(--text-sm) var(--font-ui); text-align: left; cursor: pointer; }
.pop-menu-item:hover, .pop-menu-item:focus-visible { background: var(--surface-3); outline: none; }
.pop-menu-item.danger { color: var(--danger); }

.msg-team .menu { margin-top: var(--space-2); }
.channel-row { justify-content: flex-start; }
.channel-icon { width: 28px; text-align: center; font-size: 20px; }
.channel-main { flex: 1; display: flex; flex-direction: column; }
@media (min-width: 900px) {
  .select-bar { bottom: var(--space-4); }
  .tab-badge { left: 30px; top: 4px; }
}
.tour-head-item { grid-column: 1 / -1; }
.channel-main { align-items: flex-start; } .channel-main small { margin: 0; text-align: left; }
/* v2.6 Players tab and kid hub */
.menu .list-row.static::after { content: none; }
.list-row.static { background: none; border: 0; padding-left: 0; padding-right: 0; min-height: 0; }
.block { display: block; text-align: left; }
.kid-row { justify-content: flex-start; }
.kid-row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.kid-row-main small { text-align: left; }
.kid-row .kid-photo, .kid-row .player-num { width: 48px; height: 48px; flex: none; border-radius: 50%; object-fit: cover; }
.kid-head { display: flex; align-items: center; gap: var(--space-3); }
.kid-photo.big, .player-num.big { width: 64px; height: 64px; flex: none; border-radius: 50%; object-fit: cover; font-size: 26px; }
.team-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: 0; }
.chip-btn { border: 0; cursor: pointer; font: inherit; font-size: var(--text-xs); font-weight: 800; min-height: 32px; }
.hub-list .hub-row { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.live-card { padding: var(--space-3); }
.kid-row .player-num, .player-num.big { aspect-ratio: auto; font-size: 24px; } .kid-row .kid-photo, .kid-photo.big { aspect-ratio: 1; }
.player-head { display: flex; gap: var(--space-4); align-items: center; } .player-head .profile-photo, .player-head .profile-num { width: 84px; flex: none; } .player-head h2 { margin: 0; }
.bench-rsvp.no { color: var(--danger); }
.add-row { width: 100%; background: var(--surface); font: inherit; text-align: left; cursor: pointer; color: var(--text); } .add-row:disabled { opacity: .5; cursor: not-allowed; }
.choice.is-off { opacity: .6; } .danger-text { color: var(--danger); }
a.event-card { text-decoration: none; color: inherit; }
[data-testid=stat-line] .stat-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
[data-testid=stat-line] .stat { min-width: 0; padding: 6px 2px; }
[data-testid=stat-line] .stat strong { font-size: 20px; }
[data-testid=by-game] strong { white-space: nowrap; }
.choice small.warn-text { background: none; padding: 0; }

/* ---- v2.7 phase 2: address picker */
.addr-picker { position: relative; }
.addr-box { position: relative; display: flex; align-items: center; }
.addr-box input { flex: 1; padding-right: 40px; }
.addr-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); font-size: 22px; line-height: 1; cursor: pointer; }
.addr-clear:hover, .addr-clear:focus-visible { background: var(--surface-2); color: var(--text); }
.addr-list { list-style: none; margin: 4px 0 0; padding: 4px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: var(--shadow-sheet); max-height: 300px; overflow-y: auto; }
.addr-opt { display: flex; gap: var(--space-2); align-items: flex-start; min-height: 44px; padding: var(--space-2) var(--space-3); border-radius: calc(var(--radius-control) - 2px); cursor: pointer; }
.addr-opt:hover, .addr-opt.active { background: var(--surface-2); }
.addr-opt.active { outline: 2px solid var(--focus); outline-offset: -2px; }
.addr-opt-icon { flex: none; width: 1.4em; text-align: center; }
.addr-opt-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.addr-opt-text small { color: var(--text-3); font-size: var(--text-sm); }
.addr-typed { border-top: 1px solid var(--border); color: var(--text-2); }
.addr-typed:first-child { border-top: 0; }
.addr-picked { display: flex; flex-wrap: wrap; gap: 4px var(--space-2); align-items: center; margin: 4px 0 0; font-size: var(--text-sm); color: var(--text-2); }
.addr-line { overflow-wrap: anywhere; }
.addr-hint { font-size: var(--text-xs); font-weight: 700; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-3); }
.addr-hint[data-source=google] { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.sub-toggle { margin-left: var(--space-5); }

/* ---- v2.7 phase 2: weather */
.wx-card { display: flex; flex-direction: column; gap: var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-3) var(--space-4); }
.wx-main { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.wx-icon { font-size: 40px; line-height: 1; }
.wx-temps { display: flex; flex-direction: column; }
.wx-temp { font-size: var(--text-2xl); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wx-feels { font-size: var(--text-sm); color: var(--text-2); }
.wx-cond { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-left: auto; text-align: right; font-weight: 700; }
.wx-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--text-sm); color: var(--text-2); }
.wx-updated { margin: 0; font-size: var(--text-xs); color: var(--text-3); }
.wx-later { flex-direction: row; align-items: center; }
.wx-later .wx-icon { font-size: 24px; }
.wx-later-text { margin: 0; color: var(--text-2); }
.wx-badge { display: inline-block; font-size: var(--text-xs); font-weight: 800; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--warn-bg); color: var(--warn); align-self: flex-start; }
.wx-badge[data-level=wet] { background: color-mix(in srgb, var(--link) 15%, transparent); color: var(--link); }
.wx-badge[data-level=danger] { background: var(--danger-bg); color: var(--danger); }
.wx-mini { display: inline-flex; align-items: center; gap: 2px; font-size: var(--text-xs); font-weight: 700; color: var(--text-2); padding: 1px 6px; border-radius: var(--radius-pill); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wx-mini[data-level] { background: var(--warn-bg); color: var(--warn); }
.wx-mini[data-level=wet] { background: color-mix(in srgb, var(--link) 15%, transparent); color: var(--link); }
.wx-mini[data-level=danger] { background: var(--danger-bg); color: var(--danger); }
.wx-days { list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x mandatory; }
.wx-day { flex: 0 0 92px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-tile); background: var(--surface); text-align: center; }
.wx-day[data-level] { border-color: var(--warn); }
.wx-day[data-level=wet] { border-color: var(--link); }
.wx-day[data-level=danger] { border-color: var(--danger); }
.wx-day-name { font-size: var(--text-xs); font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.wx-day-icon { font-size: 28px; line-height: 1.2; }
.wx-day-temps { font-variant-numeric: tabular-nums; }
.wx-day-rain { font-size: var(--text-xs); color: var(--text-2); }
.wx-day .wx-badge { align-self: center; font-size: 10px; padding: 1px 6px; }
.wx-chat { border-left-color: var(--link); }
.wx-chat-line { color: var(--text); font-weight: 700; }
.wx-chat .wx-badge { margin-top: 2px; }

/* ---- v2.7 admin Keys */
.admin-keys-link { justify-content: space-between; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-3) var(--space-4); }
.key-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.key-head .card-title { margin: 0; }
.key-test li { flex-wrap: wrap; }
.key-error { flex-basis: 100%; color: var(--danger); overflow-wrap: anywhere; }

/* v2.8 kid profile: round photos everywhere (the photo is a circle crop), the fun-facts checklist, the crop sheet */
.player-photo, .player-tile .player-num { aspect-ratio: 1; border-radius: 50%; }
.profile-photo, .profile-num { aspect-ratio: 1; border-radius: 50%; }
.kid-photo { width: 48px; height: 48px; border-radius: 50%; }
.facts li { padding-right: var(--space-3); }
.fact-count { margin: 0; font-weight: 800; font-size: var(--text-sm); color: var(--text-2); }
.fact-groups { display: flex; flex-direction: column; gap: var(--space-2); }
.fact-cat, .fact-free { border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); padding: 0 var(--space-3); margin: 0; }
.fact-free { padding-bottom: var(--space-2); }
.fact-free legend { font-weight: 800; font-size: var(--text-sm); padding: 0 var(--space-1); }
.fact-cat summary { display: flex; align-items: center; gap: var(--space-2); min-height: 48px; font-weight: 800; cursor: pointer; }
.fact-cat summary::after { content: '▸'; margin-left: auto; color: var(--text-3); }
.fact-cat[open] summary::after { content: '▾'; }
.fact-cat-count { font-weight: 600; font-size: var(--text-xs); }
.fact-q { border-top: 1px solid var(--border); padding: var(--space-1) 0; }
.fact-check { display: flex; align-items: flex-start; gap: var(--space-2); min-height: 44px; padding-top: 10px; cursor: pointer; }
.fact-check input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.fact-check input:disabled + span { color: var(--text-3); }
.fact-answer { display: flex; flex-direction: column; gap: 4px; padding: 0 0 var(--space-2) 28px; }
.fact-answer[hidden] { display: none; }
.fact-answer input { width: 100%; }
.fact-hint { display: flex; justify-content: space-between; gap: var(--space-2); }
.fact-len { font-variant-numeric: tabular-nums; }
.fact-problem { margin: 0; color: var(--warn); min-height: 1em; }
.fact-problem:empty { display: none; }
dialog.sheet[data-testid=crop-sheet] .sheet-body { overflow-y: auto; max-height: calc(90dvh - 60px); }
.crop-stage { position: relative; flex: none; width: 100%; height: 300px; border-radius: var(--radius-control); overflow: hidden; background: #000; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-canvas { display: block; }
.crop-zoom-row { display: flex; align-items: center; gap: var(--space-2); }
.crop-zoom { flex: 1; accent-color: var(--accent); }
.crop-filters { flex: none; display: flex; gap: var(--space-3); overflow-x: auto; padding: 2px 2px var(--space-2); }
.crop-filter span { line-height: 1.4; }
.crop-filter { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--text-xs); cursor: pointer; padding: 0; flex: none; }
.crop-thumb { width: 56px; height: 56px; border-radius: 50%; border: 3px solid transparent; }
.crop-filter[aria-pressed=true] .crop-thumb { border-color: var(--accent); }
.crop-filter[aria-pressed=true] span { font-weight: 800; }
