/* 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 { 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; }
}
