/* Shared interface refinement. Existing sport identities, chart data and exports remain native. */
:root {
  --bg:#f6f7f9; --surface:#fff; --surface-2:#f0f2f5; --surface-3:#e5e9ee;
  --border:#d8dee6; --border-strong:#94a0ae; --grid:#e8ecf1;
  --text:#17212f; --text-2:#354254; --muted:#586779;
  --row-alt:#fafbfd; --row-hover:#fff5cf;
  --ui-radius:10px; --ui-shadow:0 8px 28px #1422340d;
  --ui-menu-shadow:0 14px 36px #10182824;
}
:root[data-theme="dark"] {
  --bg:#15171b; --surface:#1d2026; --surface-2:#252a32; --surface-3:#303743;
  --border:#3b4350; --border-strong:#748194; --grid:#303641;
  --text:#f0f3f7; --text-2:#d1d9e4; --muted:#acb8c8;
  --row-alt:#21252c; --row-hover:#3b3624;
  --ui-shadow:0 8px 28px #0002; --ui-menu-shadow:0 14px 36px #0006;
}
body { line-height:1.55; }
html { scroll-padding-top:calc(var(--header-h,80px) + 16px); }
:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
button,a.btn,[role="button"],summary { touch-action:manipulation; }
button,.btn,.icon-btn { -webkit-tap-highlight-color:transparent; }
button { font:inherit; }
.btn { min-height:36px; height:auto; border-radius:7px; padding:8px 12px; font-size:.84rem; line-height:1.25; justify-content:center; }
.btn.small { min-height:30px; height:auto; padding:5px 9px; }
.btn.primary { box-shadow:0 1px 2px #0001; }
.btn:disabled { opacity:.48; }
.btn:active:not(:disabled) { background:var(--surface-3); }
.btn.primary:active:not(:disabled) { background:var(--ink-btn); opacity:.84; }
input[type="text"],input[type="search"],input[type="number"],input[type="email"],input[type="password"],input[type="date"],textarea {
  border-radius:7px; min-height:36px; padding:7px 10px; line-height:1.3;
}
/* Native WebKit menu labels clip when vertical padding consumes the control line box. */
select { border-radius:7px; min-height:36px; padding:0 10px; line-height:normal; }
textarea { color:var(--text); background:var(--surface); border:1px solid var(--border-strong); font:inherit; }
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
label.field { gap:5px; }
.seg { height:auto; min-height:36px; border-radius:7px; overflow:hidden; }
.seg button { min-height:34px; padding:7px 11px; }
.box,.tbl-wrap,.kpis { border-radius:var(--ui-radius); }
.tbl-wrap { scrollbar-color:var(--border-strong) var(--surface-2); }
.tbl-tools { gap:8px; padding-top:8px; padding-bottom:8px; }
.menu,.clip-menu,.pop,.popover,.search-results { border-radius:10px; box-shadow:var(--ui-menu-shadow); }
dialog { border-radius:12px; border:1px solid var(--border-strong); box-shadow:0 24px 72px #0005; }
dialog::backdrop { background:#080d1680; }
summary { cursor:pointer; text-underline-offset:3px; }
.notice { border-radius:0 8px 8px 0; line-height:1.6; }
.site-header { border-bottom-width:3px; }
.site-header>.wrap { min-height:64px; height:64px; gap:14px; padding-left:20px; padding-right:20px; }
.site-header .brand { font-size:1.27rem; letter-spacing:.045em; gap:8px; min-height:38px; }
.site-header .brand-logo { flex:none; }
.site-header .beta-pill { flex:none; margin-left:0; }
.site-header .nav { align-items:stretch; gap:1px; }
.site-header .nav>a,.site-header .graphics-nav>a { display:flex; align-items:center; font-size:.73rem; line-height:1.2; padding:0 8px; letter-spacing:.025em; }
.site-header .nav a { transition:background-color 120ms ease,color 120ms ease; }
.site-header .nav a[aria-current="page"] { background:#ffffff0b; }
.site-header .header-tools { gap:7px; }
.site-header .icon-btn { min-height:36px; height:36px; border-radius:7px; padding:0 10px; font-size:.72rem; }
.site-header .search input { width:190px; height:36px; min-height:36px; padding:7px 10px; border-radius:7px; }
.site-header .search-results { max-height:min(440px,65dvh); overflow:auto; padding:5px; border-color:var(--border-strong); }
.site-header .search-results a { min-height:42px; align-items:center; padding:9px 10px; border-radius:6px; gap:12px; }
.site-header .search-results a small { flex:none; }
.site-header .graphics-options { padding:6px; border-radius:10px; box-shadow:var(--ui-menu-shadow); min-width:220px; }
.site-header .nav .graphics-options a { display:flex; align-items:center; min-height:42px; line-height:1.25; padding:10px 12px; border:0; border-radius:6px; color:var(--text); font-size:.78rem; letter-spacing:.02em; }
.site-header .nav .graphics-options a:hover,.site-header .nav .graphics-options a:focus-visible,.site-header .nav .graphics-options a[aria-current="page"] { color:var(--text); background:var(--surface-2); }
/* This is a drawn icon, not the coarse-pointer hit-area pseudo-element from site.css. */
.site-header .menu-btn { flex:none; white-space:nowrap; }
.menu-btn::before { content:""; position:static; transform:none; display:block; flex:0 0 14px; width:14px; height:11px; border-top:2px solid currentColor; border-bottom:2px solid currentColor; background:linear-gradient(currentColor,currentColor) center/14px 2px no-repeat; }
.site-footer { margin-top:24px; background:var(--surface); border-top:1px solid var(--border); }
.site-family { gap:10px; padding-top:22px; padding-bottom:20px; }
.site-family a { border-radius:8px; padding:12px 14px; }
.site-foot-main { line-height:1.75; padding-top:16px; padding-bottom:18px; }
.shared-signin-foot { padding-top:14px; padding-bottom:18px; }
@media (max-width:1599px), (pointer:coarse) {
  .site-header>.wrap { height:auto; min-height:64px; padding-top:10px; padding-bottom:10px; flex-wrap:wrap; gap:10px; }
  .site-header .header-tools { margin-left:auto; }
  .site-header .menu-btn { display:inline-flex; }
  .site-header:not(.menu-open) .nav { display:none; }
  .site-header.menu-open .nav { order:3; display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); flex-basis:100%; gap:8px; padding:12px 0; border-top:1px solid #ffffff24; height:auto; max-height:60dvh; overflow-y:auto; overscroll-behavior:contain; }
  .site-header.menu-open .nav>a,.site-header.menu-open .graphics-nav>a { justify-content:flex-start; text-align:left; min-height:48px; padding:12px 14px; line-height:1.3; border:1px solid #ffffff2e; border-radius:8px; background:#ffffff0d; color:var(--header-ink); font-size:.82rem; font-weight:650; text-decoration:none; }
  .site-header.menu-open .nav a[aria-current="page"] { background:#ffffff20; border-color:#ffffff60; box-shadow:inset 3px 0 var(--brand); }
  .site-header.menu-open .nav :is(a:active,a:focus-visible) { background:#ffffff26; border-color:#ffffff70; color:var(--header-ink); text-decoration:none; }
  .site-header .graphics-nav>a { width:100%; }
  .site-header .graphics-options { display:none !important; }
}
@media (max-width:1000px) {
  .site-header>.wrap { padding-left:16px; padding-right:16px; }
  .site-header .search input { width:150px; }
  .site-header .icon-btn { padding:0 9px; }
}
@media (max-width:680px) {
  .site-header>.wrap { gap:8px 10px; }
  .site-header .brand { font-size:1.2rem; }
  .site-header .header-tools { flex-basis:100%; display:flex; width:100%; gap:6px; position:relative; }
  .site-header .search { flex:1; min-width:90px; position:static; }
  .site-header .search input { width:100%; font-size:16px; }
  .site-header .search-results { top:calc(100% + 6px); left:0; right:0; width:auto; }
  .site-header .icon-btn { min-height:40px; height:40px; padding:0 9px; }
  .site-header .search input { min-height:40px; height:40px; }
  .site-header #theme-label { display:none; }
  .site-header #theme-toggle { width:40px; justify-content:center; }
  .site-header.menu-open .nav { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .site-foot-main { gap:12px; }
}
@media (pointer:coarse) {
  :is(input[type="text"],input[type="search"],input[type="number"],input[type="email"],input[type="password"],input[type="date"],select,textarea) { font-size:16px; }
  .btn,.seg button { min-height:44px; }
  select { min-height:44px; }
  .site-header .icon-btn,.site-header .search input { min-height:44px; height:44px; }
  .site-header #theme-toggle { width:auto; min-width:44px; flex:none; }
}
@media (hover:hover) and (pointer:fine) {
  .btn:hover:not(:disabled) { border-color:var(--text-2); }
  .site-header .nav>a:hover,.site-header .graphics-nav>a:hover { background:#ffffff0b; }
  .site-header.menu-open .nav>a:hover,.site-header.menu-open .graphics-nav>a:hover { background:#ffffff26; border-color:#ffffff70; color:var(--header-ink); text-decoration:none; }
  .site-family a:hover { background:var(--surface-2); }
}
@media (prefers-reduced-motion:reduce) {
  .site-header .nav a { transition:none; }
}
/* Keep presentation and compact widget controls in their own established geometry. */
.wtools .btn,.w-tools .btn { min-height:26px; padding:3px 6px; }
html[data-brand] .site-header>.wrap { min-height:50px; }
@media print { body { background:#fff; } }

/* Trend cards must grow with text zoom and wrap long numeric comparisons. */
.tgroups { grid-template-columns:repeat(auto-fill,minmax(min(100%,18.125rem),1fr)); }
.tgroup { min-width:0; }
.tgroup li a { flex-wrap:wrap; }
.tgroup li a .what { min-width:0; flex:1 1 6em; overflow-wrap:anywhere; }
.tgroup li a .nums { white-space:normal; overflow-wrap:anywhere; margin-left:auto; text-align:right; }

@media (max-width:680px) { .site-header .header-tools { flex-wrap:wrap; } }

.vcard .top,.tgroup-head { flex-wrap:wrap; }

.site-header .brand { min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; }

/* A popup dismissal is a touch target; compact chart toolbar buttons stay unchanged. */
@media (pointer:coarse) {
  .inspector > h3 > .btn.small, .settings-modal .settings-ways > .btn.small { min-width:44px; min-height:44px; padding:8px 10px; }
}

/* Team result links show the opponent, not an unexplained game number. */
.team-result-strip { margin:12px 0; max-width:100%; }
.team-result-strip>p { margin:0 0 6px; }
.team-result-links { display:flex; flex-wrap:wrap; gap:4px; max-height:146px; overflow:auto; padding:2px 2px 4px; overscroll-behavior:contain; }
.team-result-links a,.results.team-result-strip a { display:inline-flex; align-items:center; justify-content:center; flex:none; min-width:72px; min-height:44px; height:auto; padding:8px 10px; border-radius:4px; font-size:13px; line-height:1.2; white-space:nowrap; color:#fff; text-decoration:none; }
.team-result-links a.w { background:#087b37; }
.team-result-links a.l { background:#b3261e; }
.team-result-links a.t { background:#596273; }
.team-result-links a:hover,.team-result-links a:focus-visible,.results.team-result-strip a:hover,.results.team-result-strip a:focus-visible { color:#fff; text-decoration:none; outline:2px solid var(--text); outline-offset:2px; }

/* Removable filters align their label and close control on the same centre line. */
.ask-filters .filter-chips, .ask-chips { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.chip.filter-chip, .dash-page .ask-bar .chip.filter-chip { display:inline-flex; align-items:center; gap:6px; line-height:1.25; vertical-align:middle; }
.chip.filter-chip .chip-x { flex:none; margin:0; align-self:center; }
/* The tight right padding only makes room for the x. A chip without one (who, which seasons) keeps even padding, so its label is centred. */
.chip.filter-chip, .dash-page .ask-bar .chip.filter-chip { justify-content:center; padding:2px 10px; }
.chip.filter-chip:has(> .chip-x), .dash-page .ask-bar .chip.filter-chip:has(> .chip-x) { padding:1px 2px 1px 10px; }

/* Stat cards need enough reading room; responsive board geometry is handled per viewport. */
.widget:has(.wtitle[data-chart="ptile"]) .wbody, .widget:has(.wtitle[data-chart="kpi"]) .wbody { padding:10px 14px 14px; text-align:left; }
.widget:has(.wtitle[data-chart="ptile"]) .wtitle b, .widget:has(.wtitle[data-chart="kpi"]) .wtitle b { font-size:15px; }
.widget:has(.wtitle[data-chart="ptile"]) .wtitle span, .widget:has(.wtitle[data-chart="kpi"]) .wtitle span { font-size:13px; line-height:1.4; }

/* A scoped dashboard must never disguise an unsupported unfiltered measurement. */
/* A chart that cannot use the board's filter: one calm line under the board, and a plain card when asked for. Red is for real failures. */
.filter-held-line { position:absolute; display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; padding:10px 14px; box-sizing:border-box; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--muted); font-size:.95rem; line-height:1.35; }
.filter-held-line .linkish { min-height:32px; }
.filter-held { padding:12px 14px; color:var(--text); font-size:.95rem; line-height:1.45; overflow-wrap:anywhere; }
.filter-held p { margin:0 0 6px; }
.filter-held p:not(:first-child) { color:var(--muted); }
.widget[hidden] { display:none !important; }
.filter-scope-error { padding:16px; border:3px solid #b91c1c; border-radius:8px; background:#fff1f2; color:#7f1d1d; font:400 16px/1.5 Arial,sans-serif; overflow-wrap:anywhere; }
.filter-scope-error strong { display:block; font-size:17px; line-height:1.4; letter-spacing:.02em; }
.filter-scope-error p { margin:10px 0 0; }
.widget:has(.filter-scope-error) { outline:2px solid #b91c1c; outline-offset:-2px; }

/* Keep a verified reference chart visible, with its scope exception in the header. */
.widget.filter-scope-exception .wtitle>b { white-space:normal; }
.filter-scope-banner { display:block; padding:6px 8px; margin-top:5px; border-left:3px solid var(--border-strong); background:var(--surface-2); color:var(--text); font-size:.82rem; font-weight:500; line-height:1.4; white-space:normal; overflow-wrap:anywhere; }

/* UI audit fixes, 2026-10-30. */
/* Ask: what it did and the filters stay; everything else one tap away. */
.ask-details { flex: 1 1 100%; order: 9; font-size: .85rem; margin-top: 2px; }
.ask-details .ask-thread { max-height: none; }
.ask-details > summary { cursor: pointer; color: var(--muted); min-height: 28px; display: list-item; padding: 4px 0; }
.ask-details .ask-kept, .ask-details .ask-links { margin: 4px 0; }
.ask-unread { display: inline-block; font-weight: 600; color: var(--text); }
/* Editor tools wait for Edit dashboard, on every size. */
.dash-page:not(.editing):not(.locked) .dash-top > :not(.title-input):not(.edit-toggle):not(.share-btn):not(.sql-bar-btn):not(.export-pop):not(.keep-tool) { display: none; }
.dash-page.board-blank:not(.locked) .dash-top > .add-widget { display: inline-flex; }
.dash-page.signed-out .dash-top > .keep-tool.needs-account { display: none; }
.wtools.needs-account { display: none !important; }
/* A control that needs an account says so before it is pressed. */
/* position: static: on a touch screen the 44px tap-target rule (site.css) makes a control's ::before absolute and centred, which laid this lock on top of the label ("Edit dashboard", "Share", "Export"). */
button.needs-account::before, a.needs-account::before, .pop.needs-account > button::before { content: ""; position: static; inset: auto; transform: none; min-width: 0; min-height: 0; flex: none; display: inline-block; width: .85em; height: .85em; margin-right: .35em; vertical-align: -.08em; background: currentColor; -webkit-mask: var(--lock-icon) center / contain no-repeat; mask: var(--lock-icon) center / contain no-repeat; }
:root { --lock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a4 4 0 0 0-4 4v2H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1h-1V5a4 4 0 0 0-4-4Zm-2 6V5a2 2 0 1 1 4 0v2H6Z'/%3E%3C/svg%3E"); }
.tip-strip .wrap > span a { color: inherit; text-decoration: underline; }
/* Stats page on a phone: a bottom sheet that never widens the page, tabs that scroll, Weeks on its own row. */
.min-rule { margin: 0 0 8px; font-size: .92rem; }
.min-rule .linkish { min-height: 28px; }
@media (max-width: 600px) {
  .pop .menu, .pop .menu.right { position: fixed; left: 8px !important; right: 8px !important; top: auto; bottom: 8px; width: auto; min-width: 0; max-width: none; max-height: 70vh; z-index: 60; box-shadow: 0 -4px 24px rgba(0,0,0,.25); box-sizing: border-box; }
  .pop .filter-row select, .pop .filter-row input { min-width: 0; width: auto; flex: 1 1 0; }
  .pop .filter-row > button { flex: 0 0 auto; }
  .stat-tabs { flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .stat-tabs > button { flex: 0 0 auto; }
  .controls-row .weeks-field { flex: 1 1 100% !important; grid-column: 1 / -1 !important; width: 100%; max-width: none; }
  .controls-row .weeks-field > span { flex-wrap: nowrap; align-items: center; }
  .controls-row .weeks-field input { flex: 1 1 0; min-width: 0; width: auto; }
}
/* Player page: the season's line. */
.player-line h2 { margin: 0 0 8px; }
.player-line-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.player-line-stats > div { border: 1px solid var(--border); background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.player-line-stats b { font-size: 1.4rem; line-height: 1.15; }
.player-line-stats span { color: var(--muted); font-size: .78rem; line-height: 1.25; }
/* Before / After */
.ba-error { padding: 10px 12px; margin: 10px 0; border-left: 4px solid #b91c1c; background: #fff1f2; color: #7f1d1d; font-weight: 600; overflow-wrap: anywhere; }
.ba-example { margin: 4px 0 10px; }

/* The tip bar's statement: its first sentence and the link on a phone, its first three sentences from there up (the owner's wording; the full text on About). */
@media (max-width: 600px) { .tip-more { display: none; } }
.tip-strip .wrap > span a { color: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
/* A finger gets 44 px on "How it works", as on the bar's other controls (site.css; the accessibility statement promises it). */
@media (pointer: coarse) {
  .tip-strip .wrap > span a { position: relative; z-index: 1; }
  .tip-strip .wrap > span a::before { content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
}
