/* ClubOps member shell (D-62): mobile-first, self-contained, no third-party CSS or fonts.
   Text/background pairs listed in tests/test_clubops_shell.py meet WCAG AA (4.5:1). */
:root {
  --ink: #111827;          /* text on --surface and --bg */
  --muted: #4b5563;        /* secondary text on --surface and --bg */
  --placeholder: #6b7280;  /* example text in empty fields, on --surface */
  --bg: #f3f4f6;
  --surface: #ffffff;
  --line: #e5e7eb;
  --brand: #c8102e;        /* NGCC red: buttons, active tab, links */
  --on-brand: #ffffff;
  --header: #000000;       /* the crest's own black field, as in the app icons */
  --on-header-muted: #d1d5db;
  --on-header: #ffffff;
  --ok-bg: #dcfce7;
  --ok-ink: #14532d;
  --warn-bg: #fef3c7;
  --warn-ink: #78350f;
  --alert-bg: #fee2e2;
  --alert-ink: #7f1d1d;
  /* One colour per XI (D-66), each with white text (--on-xi). */
  --on-xi: #ffffff;
  --xi-red: #c8102e;
  --xi-black: #111827;
  --xi-blue: #1d4ed8;
  --xi-green: #15803d;
  --xi-amber: #b45309;
  --xi-purple: #6d28d9;
  --meter-track: #dbeafe;  /* lighter step of --xi-blue for meter tracks */
  --axis: #9ca3af;         /* chart baselines */
  --radius: 14px;
  --tab-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--co-navigation-height, 12rem) + .75rem); }
body.co {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom));
}
.co-updates-dialog { width: min(34rem, calc(100% - 2rem)); max-height: calc(100dvh - 3rem); overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; background: var(--surface); color: var(--ink); }
.co-updates-dialog::backdrop { background: rgb(0 0 0 / .5); }
.co-updates-dialog h3 { margin-bottom: .5rem; }
.co-updates-dialog li { margin-bottom: .65rem; }
.co-footer-nav { flex-wrap: wrap; }
.co-scorer-item { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }
.co-scorer-item textarea, .co-scorer-item input { width: 100%; font-size: 1rem; }
body.co.co-no-tabs { padding-bottom: 0; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.co-skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 20; }
.co-skip:focus { left: .5rem; }

/* Header */
.co-chrome { flex: none; position: sticky; top: 0; z-index: 10; background: var(--surface); }
.co-header {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: calc(.6rem + env(safe-area-inset-top, 0px)) 1rem .6rem;
  background: var(--header); color: var(--on-header);
}
.nav-brand { display: flex; align-items: center; gap: .6rem; min-width: 0; color: inherit; text-decoration: none; }
.nav-brand img { width: 36px; height: 36px; object-fit: contain; flex: none; }
.nav-brand strong { display: block; font-size: 1.05rem; letter-spacing: .02em; }
.nav-brand small { display: block; font-size: .8rem; color: var(--on-header-muted); }
.co-header-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.co-header-actions a, .co-header-actions button {
  min-height: 44px; padding: .4rem .8rem; border-radius: 999px; border: 1px solid #4b5563;
  background: transparent; color: var(--on-header); font: inherit; font-size: .875rem; text-decoration: none; cursor: pointer;
}
.co-header-actions form { margin: 0; }
.co-narrow { display: none; }
@media (max-width: 400px) { .co-wide { display: none; } .co-narrow { display: inline; } .co-header-actions { gap: .35rem; } }

/* Bottom tabs on phones, a top row on wider screens */
.co-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-height) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.co-tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600;
  border-top: 3px solid transparent;
}
.co-tabs a[aria-current="page"] { color: var(--brand); border-top-color: var(--brand); }
.co-tabs svg { width: 24px; height: 24px; }

.co-subnav { display: flex; gap: .5rem; justify-content: center; padding: .5rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.co-subnav a {
  display: flex; flex: 1; align-items: center; justify-content: center; gap: .4rem; min-width: 0; max-width: 20rem;
  min-height: 48px; padding: .6rem .5rem; border: 2px solid var(--brand); border-radius: var(--radius);
  background: var(--surface); color: var(--brand); font-size: .875rem; font-weight: 700; line-height: 1.25; text-decoration: none;
}
.co-subnav .co-personal-link { background: var(--brand); color: var(--on-brand); }
.co-subnav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; }
.co-subnav svg { width: 20px; height: 20px; flex: none; }
.co-main { flex: 1 0 auto; width: 100%; max-width: 44rem; margin: 0 auto; padding: 1rem; min-width: 0; }
.co-main > * { min-width: 0; }

@media (min-width: 800px) {
  body.co { padding-bottom: 0; }
  .co-tabs {
    position: static; height: auto; padding: 0 1rem; display: flex; justify-content: center; gap: .5rem;
    border-top: 0; border-bottom: 1px solid var(--line);
  }
  .co-tabs a { flex-direction: row; gap: .4rem; padding: .8rem 1rem; font-size: .9rem; border-top: 0; border-bottom: 3px solid transparent; }
  .co-tabs a[aria-current="page"] { border-bottom-color: var(--brand); }
  .co-tabs svg { width: 18px; height: 18px; }
  .co-main { padding: 1.5rem 1rem; }
}

/* Content */
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; margin-top: 1.25rem; }
h3 { font-size: 1.05rem; margin-top: 1.25rem; }
p { margin: .4rem 0; }
.co-muted, .co-small { color: var(--muted); }
.co-small { font-size: .875rem; }

.co-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin: .9rem 0; box-shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 4px 12px rgba(17, 24, 39, .04);
}
.co-card > :first-child { margin-top: 0; }
.co-summary { border-left: 4px solid var(--brand); }
.co-headline { font-size: 1.2rem; font-weight: 700; margin: 0 0 .25rem; }
.co-amounts { font-variant-numeric: tabular-nums; }
/* Fee deadline as plain rows (D-66): "Pay by 30 Nov 2026 · R1 300" / "From 1 Dec 2026 · R1 500". */
.co-fees { margin: .6rem 0 .2rem; border-top: 1px solid var(--line); }
.co-fee { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.co-fee dt, .co-fee dd { margin: 0; }
.co-fee dd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-fee-now { color: var(--ink); font-weight: 700; }
.co-unlock { margin-top: .6rem; font-weight: 600; }

.co-dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; margin: .5rem 0; }
.co-dl dt { color: var(--muted); }
.co-dl dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* Label above value: long account numbers and names stay readable on phones. */
.co-kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: .25rem 0 .75rem; }
.co-kv dt { color: var(--muted); font-size: .875rem; margin-top: .5rem; }
.co-kv dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 480px) { .co-kv { grid-template-columns: max-content minmax(0, 1fr); column-gap: 1.5rem; } .co-kv dt { margin-top: .35rem; } .co-kv dd { margin-top: .35rem; } }
.co-install { border-left: 4px solid var(--ink); }
[hidden] { display: none !important; }
.co-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.co-plain { list-style: none; padding: 0; margin: .5rem 0; }
.co-list { list-style: none; padding: 0; margin: .5rem 0; }
.co-list > li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin: .5rem 0; }

.co-alert { background: var(--alert-bg); color: var(--alert-ink); border-radius: 12px; padding: .8rem 1rem; }
.co-notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px; padding: .8rem 1rem; }
.co-source-note { font-size: .875rem; padding: .6rem .8rem; }
.co-fixture-filters { margin-block: 1rem; }
.co-fixture-filters > div { display: grid; gap: .3rem; }
.co-pagination { display: flex; flex-wrap: wrap; gap: 1rem; margin-block: 1rem; }
.co-pagination a { min-height: 44px; display: inline-flex; align-items: center; }
@media (min-width: 640px) { .co-fixture-filters { max-width: 42rem; grid-template-columns: 1fr 1fr auto; align-items: end; } }
.co-ok { background: var(--ok-bg); color: var(--ok-ink); border-radius: 12px; padding: .8rem 1rem; }

/* Forms and buttons */
form { margin: .75rem 0; }
.co-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; max-width: 28rem; }
.co-auth { width: 100%; max-width: 28rem; margin-inline: auto; }
.co-notice-copy { white-space: pre-wrap; }
.co-form label { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; font-weight: 600; min-width: 0; }
.co-form .co-check, .co-check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.co-check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; }
input:not([type=checkbox]):not([type=hidden]), select {
  width: 100%; max-width: 100%; min-height: 44px; padding: .6rem .75rem;
  border: 1px solid #9ca3af; border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
.co-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7rem 1.2rem;
  border: 0; border-radius: 12px; background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; width: 100%;
}
.co-link-btn {
  min-height: 44px; padding: .4rem 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600;
  text-decoration: underline; cursor: pointer; justify-self: start;
}
.co-btn-quiet { background: var(--surface); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
@media (min-width: 480px) { .co-btn { width: auto; } }
.co-row { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.co-row > input { flex: 1 1 8rem; min-width: 0; }
.co-row > .co-btn { width: auto; }
.co-grid { display: grid; gap: .9rem; }
/* Profile sections (D-66): nickname and role, then batting, bowling and fielding. */
.co-prefs .co-form { max-width: none; }
.co-prefs fieldset { border: 0; border-top: 1px solid var(--line); margin: 1.1rem 0 0; padding: .9rem 0 0; min-width: 0; }
.co-prefs legend { float: left; width: 100%; padding: 0; margin-bottom: .6rem; font-size: 1.05rem; font-weight: 700; }
.co-prefs legend + * { clear: left; }
.co-prefs > p:last-child { margin-top: 1.4rem; }
input::placeholder { color: var(--placeholder); opacity: 1; font-weight: 400; }
/* Stat tiles: a number with its label (owner review counts; D-66). */
.co-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.5rem), 1fr)); gap: .5rem; margin: .9rem 0; }
.co-tile { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: .1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .75rem; min-width: 0; }
.co-tile dt { color: var(--muted); font-size: .8rem; }
.co-tile dd { margin: 0; font-size: 1.4rem; font-weight: 700; overflow-wrap: anywhere; }
.co-tile dd.co-stat-unavailable { font-size: .8rem; line-height: 1.75rem; white-space: nowrap; overflow-wrap: normal; }
.co-team .co-tile, .co-stats .co-tile { text-align: center; }
@media (min-width: 640px) { .co-grid { grid-template-columns: 1fr 1fr; } }

/* XI badges, coloured fixture rows and jump links (D-66) */
.co-xi {
  display: inline-flex; align-items: center; min-height: 28px; padding: .15rem .65rem; border-radius: 999px;
  background: var(--xi-black); color: var(--on-xi); font-size: .875rem; font-weight: 700; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
}
.co-xi--red { background: var(--xi-red); }
.co-xi--black { background: var(--xi-black); }
.co-xi--blue { background: var(--xi-blue); }
.co-xi--green { background: var(--xi-green); }
.co-xi--amber { background: var(--xi-amber); }
.co-xi--purple { background: var(--xi-purple); }
.co-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.co-chips .co-xi { min-height: 44px; padding: .35rem .9rem; }
.co-fixture-teams .co-all-teams { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.co-fixture-teams a[aria-current="page"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
/* The measured navigation height also covers wrapping labels and desktop tabs. */
.co-xi-group, .co-team, .co-main { scroll-margin-top: .5rem; }
.co-xi-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.co-xi-head .co-small { font-weight: 400; }
.co-list > li.co-fixture { border-left: 5px solid var(--xi-black); }
.co-fixture--red { border-left-color: var(--xi-red) !important; }
.co-fixture--black { border-left-color: var(--xi-black) !important; }
.co-fixture--blue { border-left-color: var(--xi-blue) !important; }
.co-fixture--green { border-left-color: var(--xi-green) !important; }
.co-fixture--amber { border-left-color: var(--xi-amber) !important; }
.co-fixture--purple { border-left-color: var(--xi-purple) !important; }
.co-fixture p { margin: .2rem 0; }
.co-fixture-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .35rem .6rem; }
.co-cal { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.co-next { border-left: 4px solid var(--brand); }
.co-next-date { font-size: 1.1rem; font-weight: 700; margin: 0; }
.co-next .co-list > li { box-shadow: none; }

.co-wa { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.co-hidden, .hidden { display: none !important; }

/* Team breakdown and My stats (D-66): tiles, form chips, ranked lists, meters and bars. */
.co-team .co-xi-head, .co-stats h2 { margin-top: 0; }
.co-stats h3 { margin: 1.1rem 0 .35rem; font-size: 1rem; }
.co-formline { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin: .5rem 0; }
.co-results, .co-spells, .co-rank, .co-bars { list-style: none; padding: 0; margin: 0; }
.co-results { display: flex; gap: .3rem; }
.co-result {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; padding: 0 .35rem;
  border-radius: 8px; font-weight: 700; font-size: .875rem; background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
.co-result--won { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.co-result--lost { background: var(--alert-bg); color: var(--alert-ink); border-color: transparent; }
/* Columns follow the card's own width, not the viewport (two cards share a row on desktop). */
.co-top { display: grid; gap: .25rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.co-top h3 { margin: .9rem 0 .3rem; font-size: 1rem; }
.co-rank li { display: flex; align-items: baseline; gap: .3rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.co-rank strong, .co-rank li > span:last-child { flex: none; white-space: nowrap; }
.co-meters { display: grid; gap: .45rem; margin: .4rem 0; }
.co-meter { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); gap: .75rem; align-items: center; }
@media (max-width: 359px) { .co-meter { grid-template-columns: minmax(0, 1fr); gap: .15rem; } }
.co-meter dt { color: var(--muted); font-size: .875rem; }
.co-meter dd { margin: 0; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.co-meter-track { flex: 1 1 auto; height: 10px; border-radius: 999px; background: var(--meter-track); overflow: hidden; min-width: 2rem; }
.co-meter-fill { display: block; height: 100%; border-radius: 999px; background: var(--xi-blue); }
.co-meter-value { min-width: 3.2rem; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin: .4rem 0 .2rem; }
.co-bars li { display: grid; grid-template-rows: 72px auto; justify-items: center; min-width: 0; }
.co-bar-area { display: flex; align-items: flex-end; justify-content: center; width: 100%; border-bottom: 1px solid var(--axis); }
.co-bar { display: block; width: min(100%, 28px); border-radius: 4px 4px 0 0; background: var(--xi-blue); }
.co-bar-label { margin-top: .2rem; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.co-spells { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .2rem; }
.co-spells li {
  min-width: 3rem; padding: .3rem .5rem; border: 1px solid var(--xi-blue); border-radius: 8px; text-align: center;
  font-weight: 700; font-variant-numeric: tabular-nums; color: var(--xi-blue); background: var(--surface);
}
.co-spells li.co-spell-haul { background: var(--xi-blue); color: var(--on-xi); }
/* OPS-26 richer My stats */
.co-last5, .co-log ol { list-style: none; padding: 0; margin: 0; }
.co-last5 { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .35rem; margin: .4rem 0 .2rem; }
.co-last5 li {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-width: 0; min-height: 3.5rem; padding: .35rem .15rem; text-align: center;
  border: 1px solid var(--axis); border-radius: 8px; background: var(--surface); font-variant-numeric: tabular-nums;
}
.co-last5-bat { font-weight: 700; }
.co-last5-bowl { font-size: .8rem; color: var(--xi-blue); }
.co-milestone, .co-place { margin: .5rem 0 .2rem; }
.co-place { font-weight: 700; }
.co-log { margin: .9rem 0 .4rem; }
.co-log summary { cursor: pointer; font-weight: 700; padding: .4rem 0; }
.co-log li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .15rem .75rem; padding: .45rem 0; border-top: 1px solid var(--axis); }
.co-log-when { min-width: 0; overflow-wrap: anywhere; }
.co-log-figs { font-weight: 700; font-variant-numeric: tabular-nums; }
.co-log-part { white-space: nowrap; }

/* Retained analytics views (flag-gated off in the pilot) */
.team-comparison-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
article { min-width: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem; }

/* Original scorecard sources */
.co-source-image { display: block; max-width: 100%; height: auto; }
.co-source-pdf { display: block; width: 100%; height: 70vh; border: 0; }
.co-card { overflow-wrap: anywhere; }

/* Owner scorecard-name inbox (OPS-23) */
.co-names h4, details.co-card h4 { margin: .2rem 0 .1rem; font-size: 1rem; }
.co-check input[type=radio] { width: 1.15rem; min-height: 1.15rem; height: 1.15rem; margin: .2rem 0 0; padding: 0; flex: none; accent-color: var(--brand); }
details.co-card > summary { cursor: pointer; font-weight: 600; }
details.co-card .co-formline { justify-content: space-between; }
.co-tile dt a { color: inherit; }

/* One shared footer, below the content and above the phone's fixed tabs. */
.co-footer { flex: none; width: 100%; border-top: 1px solid var(--line); background: var(--surface); }
.co-footer-inner { width: 100%; max-width: 44rem; margin: 0 auto; padding: 1rem; display: flex; flex-direction: column; gap: .85rem; }
.co-footer-brand { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem .75rem; }
.co-footer-brand strong { font-size: .875rem; letter-spacing: .04em; }
.co-footer-brand > span { color: var(--muted); font-size: .75rem; }
.co-footer-nav { display: flex; align-items: stretch; gap: .5rem; min-width: 0; }
.co-footer-nav > a, .co-footer-current { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: .8125rem; font-weight: 600; line-height: 1.4; text-decoration: none; }
.co-footer-nav > :first-child { flex: none; white-space: nowrap; }
.co-footer-nav > a { transition: border-color .15s, color .15s; }
.co-footer-nav > a:hover { border-color: var(--brand); color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
.co-footer-nav svg { width: 18px; height: 18px; flex: none; color: var(--brand); }
.co-footer-current { border-color: transparent; background: transparent; color: var(--muted); }
.co-footer-current svg { color: inherit; }
.co-return { margin: 0 0 .75rem; }
.co-return a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: var(--muted); font-size: .875rem; font-weight: 600; text-decoration: none; }
.co-return a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
@media (min-width: 800px) {
  .co-footer-inner { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.5rem; }
  .co-footer-brand { flex-direction: column; gap: .1rem; flex: none; }
}

/* Feedback (OPS-21) */
.co-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.co-fieldset legend { font-weight: 600; padding: 0; margin-bottom: .3rem; }
textarea { width: 100%; max-width: 100%; padding: .6rem .75rem; border: 1px solid #9ca3af; border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }

/* Owner workspace: isolated from member forms. */
.co-owner-main { max-width: 72rem; }
.co-owner-sidebar { display: none; }
.co-owner-switch, .co-owner-filters { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.co-owner-switch label, .co-owner-filters label { display: grid; gap: .3rem; flex: 1; }
.co-owner-switch select, .co-owner-filters select { padding: .65rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: var(--surface); width: 100%; }
.co-gap-filters label { flex: 1 1 16rem; min-width: min(100%, 16rem); }
@media (max-width: 799px) { .co-gap-filters .co-btn { width: 100%; } }
.co-gap-counts .co-tile dt { white-space: normal; overflow: visible; }
.co-gap-help > summary { text-decoration: underline; text-underline-offset: .2em; }
.co-owner-content { min-width: 0; }
.co-owner-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: .65rem 0; }
.co-owner-row > summary { cursor: pointer; font-weight: 600; min-height: 44px; }
.co-owner-row > summary .co-small { display: block; font-weight: 400; }
.co-owner-pages { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
@media (min-width: 800px) {
 .co-owner-main { display: grid; grid-template-columns: 13rem minmax(0,1fr); align-items: start; gap: 2rem; }
 .co-owner-sidebar { display: grid; position: sticky; top: calc(var(--co-navigation-height, 8rem) + 1rem); gap: .25rem; }
 .co-owner-sidebar a { display: block; padding: .75rem; border-radius: var(--radius); text-decoration: none; color: var(--ink); min-height: 44px; }
 .co-owner-sidebar a[aria-current] { background: var(--brand); color: var(--on-brand); font-weight: 600; }
 .co-owner-switch { display: none; }
}

.co-feedback-title { font-weight: 600; }
.co-feedback-status { display: inline-block; padding: .2rem .55rem; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.co-feedback-private { border: 2px dashed var(--muted); border-radius: var(--radius); padding: 1rem; margin-top: 1.5rem; background: var(--bg); }
.co-owner-filters input { min-height: 44px; padding: .65rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; width: 100%; }

.co-feedback-queues { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.co-feedback-queues a { padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); min-height: 44px; text-decoration: none; background: var(--surface); color: var(--ink); }
.co-feedback-queues a[aria-current] { background: var(--brand); color: var(--on-brand); font-weight: 600; }

/* Compact stats components (staging polish, D-162): badges, keys and source links replace paragraphs. */
.co-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.co-card-head h2 { margin: 0; }
.co-card-actions { display: inline-flex; align-items: center; gap: .35rem; flex: none; }
.co-icon-link, .co-mini-link { display: inline-flex; align-items: center; justify-content: center; min-height: 2rem; border-radius: 999px; color: var(--muted); text-decoration: none; }
.co-icon-link { width: 2rem; }
.co-mini-link { padding: 0 .6rem; border: 1px solid var(--line); font-size: .8rem; font-weight: 600; }
.co-icon-link:hover, .co-mini-link:hover { color: var(--ink, inherit); background: var(--surface); }
.co-data, .co-flag { margin: .5rem 0; }
.co-data > summary, .co-flag > summary, .co-key > summary { cursor: pointer; list-style: none; }
.co-data > summary::-webkit-details-marker, .co-flag > summary::-webkit-details-marker, .co-key > summary::-webkit-details-marker { display: none; }
.co-badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.co-badge--complete { background: var(--ok-bg); color: var(--ok-ink); }
.co-badge--partial { background: var(--warn-bg); color: var(--warn-ink); }
.co-gaps { list-style: none; padding: 0; margin: .5rem 0 .25rem; display: grid; gap: .3rem; }
.co-gaps li { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(2rem, 1fr) auto; align-items: center; gap: .5rem; font-size: .8rem; }
.co-gap-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.co-flag > summary { display: inline-block; padding: .2rem .6rem; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); font-size: .8rem; font-weight: 600; }
.co-flag-mark { font-size: .9rem; color: var(--warn-ink); vertical-align: super; }
.co-tile--flag { border-color: var(--warn-ink); }
.co-h3-row { display: flex; align-items: center; gap: .4rem; }
.co-key { display: inline-block; }
.co-key > summary { color: var(--muted); font-size: 1rem; line-height: 1; padding: .25rem; }
.co-key[open] { display: block; flex-basis: 100%; }
.co-h3-row { flex-wrap: wrap; }
.co-log li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.co-src { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 2rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .7rem; font-weight: 700; text-decoration: none; }
.co-src:hover { background: var(--surface); }
/* Polish 2: Results cards with source chips, and one-line tile labels. */
.co-res { border-left: 5px solid var(--xi-black); padding-top: .75rem; padding-bottom: .75rem; }
.co-res-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .35rem .6rem; }
.co-res-when { font-weight: 700; font-size: .9rem; }
.co-res-format { font-weight: 400; color: var(--muted); }
.co-res-main { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .35rem 0; }
.co-res-main > div { min-width: 0; }
.co-res h2 { font-size: 1.05rem; margin: 0; }
.co-res-result { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.co-res-open { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); font-size: 1.5rem; line-height: 1; text-decoration: none; color: var(--ink); }
.co-res-open:hover { background: var(--surface); }
.co-res-chips { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.co-chip { display: inline-flex; align-items: center; min-height: 1.5rem; padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--line); font-size: .75rem; font-weight: 600; white-space: nowrap; color: var(--ink); background: var(--surface); }
.co-chip--quiet { color: var(--muted); }
.co-chip--src { font-weight: 700; letter-spacing: .02em; }
.co-chip--add { border-style: dashed; }
.co-chip--warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.co-res-key { margin: 0 0 .5rem; }
.co-tile dt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-tile-mark { margin-left: .2rem; font-size: .75rem; color: var(--warn-ink); }
/* Polish 3: mini grid, rank badges, coverage chips, partnership rows, icon headings, innings tiles. */
.co-mini { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin: .6rem 0; }
.co-mini-item { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.co-mini-item dt { color: var(--muted); font-size: .75rem; min-width: 0; }
.co-mini-item dd { margin: 0; flex: none; font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-mini-item dd.co-muted { font-weight: 400; font-size: .75rem; }
/* Team comparisons keep each pair on one row, including narrow cards. */
.co-team .co-outcomes, .co-team .co-team-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.co-outcomes > :last-child { grid-column: 1 / -1; }
.co-team .co-tile dt { white-space: normal; overflow: visible; text-overflow: clip; }
.co-team .co-tile dd { font-variant-numeric: tabular-nums; }
.co-fixture-total { margin: 1rem 0 .6rem; text-align: center; }
.co-fixture-total > div { display: flex; flex-direction: column-reverse; }
.co-fixture-total dt { color: var(--muted); font-size: .85rem; }
.co-fixture-total dd { margin: 0; font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.co-count-key > summary { padding: .5rem .2rem; text-decoration: underline; text-underline-offset: .2em; }
.co-rank li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.co-rank li:last-child { border-bottom: 0; }
.co-rank-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .75rem; font-weight: 700; color: var(--muted); }
.co-rank li:first-child .co-rank-n { background: var(--brand); border-color: var(--brand); color: #fff; }
.co-rank-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.co-rank-val { flex: none; font-variant-numeric: tabular-nums; }
.co-fielding-leaders > li { display: flex; flex-direction: column; gap: .25rem; }
.co-note-chip { margin: .4rem 0 .2rem; }
/* Team breakdown: coverage is one plain, colourless section at the foot of the page. */
.co-coverage { margin-top: 2rem; padding-top: .75rem; border-top: 1px solid var(--line); color: var(--muted); }
.co-coverage .co-coverage-title { margin: 0 0 .25rem; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.co-coverage-teams { list-style: none; padding: 0; margin: .5rem 0 0; }
.co-coverage-team { display: grid; gap: .15rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.co-coverage-name { font-size: .875rem; font-weight: 600; }
.co-coverage-items { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem 1rem; }
.co-coverage .co-data, .co-coverage .co-note-chip { margin: 0; }
.co-coverage .co-data[open] { flex-basis: 100%; }
.co-coverage .co-badge { padding: .1rem 0; background: none; color: inherit; font-weight: 400; text-decoration: underline dotted; text-underline-offset: .2em; }
.co-coverage summary:hover .co-badge, .co-coverage [open] > summary .co-badge { color: var(--ink); }
.co-coverage-link { justify-self: start; font-size: .8rem; color: inherit; }
.co-coverage-link:hover { color: var(--ink); }
@media (min-width: 48rem) { .co-coverage-team { grid-template-columns: 11rem minmax(0, 1fr) auto; align-items: baseline; column-gap: 1rem; } }
.co-stand-list > li { display: flex; flex-direction: column; gap: .15rem; }
.co-stand-top { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.co-stand-runs { font-size: 1.15rem; font-variant-numeric: tabular-nums; min-width: 2.2rem; }
.co-stand-names { min-width: 0; }
.co-stand-when { font-size: .8rem; }
.co-stand-one { display: flex; flex-direction: column; gap: .15rem; margin: .35rem 0; }
.co-h3i { display: flex; align-items: center; gap: .4rem; }
.co-ico { flex: none; color: var(--brand); }
.co-h3-row .co-h3i { margin: 0; }
.co-innings dd { font-size: 1.5rem; }
.co-innings-ov { font-size: .8rem; font-weight: 400; color: var(--muted); }
