:root { --pico-font-size: 100%; }
header.container nav { padding-top: .5rem; }
form.inline { margin: 0; }
button.small, .small { padding: .3rem .7rem; font-size: .85rem; width: auto; margin-bottom: 0; }
.login { max-width: 24rem; margin: 4rem auto; }
.status-head { display: flex; justify-content: space-between; align-items: center; }
.status-grid > div { margin-bottom: .5rem; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 1rem; font-size: .85rem; font-weight: 600; }
.badge.ok { background: #d1f2d9; color: #12602b; }
.badge.err { background: #fbd5d5; color: #8a1c1c; }
.badge.muted { background: #e6e8eb; color: #4a5361; }
.error { color: #c0392b; }
.ok-text { color: #1e8449; }
.muted { color: #7a8494; }
tr.match td { background: #fff3c4 !important; font-weight: 600; }
.marks { border-left: 4px solid #f1c40f; }
.marks ul { margin-bottom: .5rem; }
.marks h4 { margin: .75rem 0 .25rem; }
.marks h5 { margin: .5rem 0 .25rem; font-size: 1rem; }
.marks .meeting:first-of-type h4 { margin-top: 0; }
.line { margin-bottom: .4rem; }
.channel { border: 1px solid var(--pico-muted-border-color); border-radius: .5rem; padding: 1rem; margin-bottom: 1rem; }
.channel legend { padding: 0 .4rem; }
.test-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.inline-check { display: inline; font-size: .85rem; }
.inline-check input { margin: 0 .3rem 0 0; }
.nowrap { white-space: nowrap; }
table.log td { font-size: .9rem; vertical-align: top; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
@media (prefers-color-scheme: dark) {
  tr.match td { background: #4d4210 !important; }
  .badge.ok { background: #134d27; color: #c9f1d6; }
  .badge.err { background: #5c1a1a; color: #fbd5d5; }
  .badge.muted { background: #39404b; color: #cfd5dd; }
}
.share-row { margin-bottom: .5rem; }
.share-row input[type=text] { flex: 1 1 18rem; margin: 0; font-size: .85rem; padding: .3rem .6rem; height: auto; }
.share-page { max-width: 36rem; margin: 0 auto; }
.share-head { margin-bottom: 1rem; }
/* shared heat summary: one block per race, columns fixed so every block lines up */
.race { margin: 0 0 1rem; border: 1px solid var(--pico-muted-border-color); border-radius: .5rem; overflow: hidden;
  background: var(--pico-card-background-color); }
.race-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .7rem 1rem; background: var(--pico-card-sectioning-background-color);
  border-bottom: 1px solid var(--pico-muted-border-color); }
.race-title strong { font-size: 1.05rem; }
.race-when { color: var(--pico-muted-color); font-size: .9rem; white-space: nowrap; }
.race table { width: 100%; table-layout: fixed; margin: 0; border-collapse: collapse; }
.race col.c-athlete, .race col.c-mark { width: 50%; }
.race th, .race td { padding: .5rem 1rem; text-align: left; background: transparent; }
.race th { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--pico-muted-color); padding-top: .6rem; padding-bottom: .3rem; }
.race thead th { border-bottom: 0; }
.race td { border-top: 1px solid var(--pico-muted-border-color); font-variant-numeric: tabular-nums; }
.race td, .race th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* athlete performances */
.athlete-pick { display: flex; gap: .5rem; max-width: 32rem; }
.athlete-pick input { margin: 0; }
.athlete-pick button { width: auto; margin: 0; }
.athlete-favs { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .75rem; }
.athlete-favs a[aria-current] { font-weight: 700; text-decoration: none; }
table.runs td, table.runs th { font-size: .9rem; white-space: nowrap; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.lift { color: #1e8449; font-weight: 600; }
td.pull { color: #c0392b; font-weight: 600; }
@media (prefers-color-scheme: dark) { td.lift { color: #58d68d; } td.pull { color: #f1948a; } }

/* posts: design template */
.design { margin-top: 2rem; }
.design-grid { display: grid; grid-template-columns: 270px 1fr; gap: 1.5rem; align-items: start; }
.design-grid figure { margin: 0; }
.design-grid img { width: 100%; height: auto; border-radius: .25rem; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
@media (max-width: 640px) { .design-grid { grid-template-columns: 1fr; } .design-grid figure { max-width: 270px; } }

/* share page: post images */
.share-images { margin-top: 2rem; }
.share-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-top: 1rem; }
.share-thumbs figure { margin: 0; text-align: center; }
.share-thumbs img { width: 100%; height: auto; border-radius: .25rem; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.share-thumbs figcaption { font-size: .85rem; margin-top: .35rem; }
.share-thumbs figure:only-child { grid-column: 1 / -1; max-width: 22rem; }

/* results */
.results-summary { margin-bottom: 1rem; }
.results-event table { table-layout: fixed; }
.results-event col.c-name { width: 32%; }
.results-event col.c-round { width: 14%; }
.results-event col.c-place { width: 12%; }
.results-event col.c-mark, .results-event col.c-time, .results-event col.c-mps { width: 14%; }
.results-event .short { display: none; }
.results-event th.num, .results-event td.num { text-align: right; white-space: nowrap; }
.results-event th, .results-event td { padding: .45rem .75rem; }
.results-event tr.final td { font-weight: 600; }
.results-event tr.winner td:nth-child(3) { color: #12602b; }
@media (max-width: 600px) {
  .results-event .long { display: none; }
  .results-event .short { display: inline; }
  .results-event th, .results-event td { padding: .4rem .3rem; font-size: .8rem; }
  .results-event th:first-child, .results-event td:first-child { padding-left: .6rem; }
  .results-event th:last-child, .results-event td:last-child { padding-right: .6rem; }
  .results-event th { font-size: .62rem; letter-spacing: .02em; }
  /* size columns to their contents on phones, so numbers are never cut off; names wrap between words */
  .results-event table { table-layout: auto; }
  .results-event col { width: auto !important; }
  .results-event td, .results-event th { overflow: visible; text-overflow: clip; }
  .results-event td:first-child { white-space: normal; line-height: 1.25; width: 100%; }
}

/* top menu bar: pill items and dropdown panels on wide screens, a tappable list on phones */
:root { --nav-ink: #374151; --nav-hover: rgba(1, 114, 173, .08); --nav-active: rgba(1, 114, 173, .14); --nav-active-ink: #01629a;
  --nav-panel: #ffffff; --nav-rule: #e5e7eb; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --nav-ink: #d6dde6; --nav-hover: rgba(96, 165, 250, .12); --nav-active: rgba(96, 165, 250, .2);
    --nav-active-ink: #93c5fd; --nav-panel: #1c2330; --nav-rule: #2e3746; }
}
:root[data-theme="dark"] { --nav-ink: #d6dde6; --nav-hover: rgba(96, 165, 250, .12); --nav-active: rgba(96, 165, 250, .2);
  --nav-active-ink: #93c5fd; --nav-panel: #1c2330; --nav-rule: #2e3746; }
header.container { position: sticky; top: 0; z-index: 10; background: var(--pico-background-color);
  border-bottom: 1px solid var(--pico-muted-border-color); margin-bottom: 1rem; }
nav.menubar { flex-wrap: wrap; }
nav.menubar a, nav.menubar a:hover, nav.menubar a:focus { text-decoration: none; }
nav.menubar .brand { color: inherit; }
nav.menubar .nav-links { gap: .15rem; }
nav.menubar .nav-links > li { padding: .25rem 0; }
nav.menubar .nav-links > li > a, nav.menubar details.dropdown > summary {
  display: inline-flex; align-items: center; gap: .35rem; margin: 0; padding: .45rem .8rem; border: 0; border-radius: 999px;
  background: transparent; box-shadow: none; color: var(--nav-ink); font-weight: 500; height: auto; line-height: 1.4;
  transition: background-color .15s, color .15s; }
nav.menubar .nav-links > li > a:hover, nav.menubar details.dropdown > summary:hover,
nav.menubar details.dropdown[open] > summary { background: var(--nav-hover); color: var(--nav-active-ink); }
nav.menubar .nav-links > li > a[aria-current], nav.menubar li.menu.active > details > summary {
  background: var(--nav-active); color: var(--nav-active-ink); font-weight: 600; }
nav.menubar details.dropdown { margin: 0; }
nav.menubar details.dropdown > summary::after { background-image: var(--pico-icon-chevron); filter: none; float: none; margin: 0;
  width: .9rem; height: .9rem; background-size: .9rem; }
nav.menubar details.dropdown > ul { min-width: 13rem; padding: .35rem; border: 1px solid var(--nav-rule); border-radius: .75rem;
  background: var(--nav-panel); box-shadow: 0 10px 30px rgba(15, 23, 42, .12); }
nav.menubar details.dropdown > ul li { padding: 0; margin: 0; list-style: none; }
nav.menubar details.dropdown > ul li a { display: block; margin: 0; padding: .55rem .75rem; border-radius: .5rem;
  color: var(--nav-ink); font-weight: 500; }
nav.menubar details.dropdown > ul li a:hover { background: var(--nav-hover); color: var(--nav-active-ink); }
nav.menubar details.dropdown > ul a[aria-current] { background: var(--nav-active); color: var(--nav-active-ink); font-weight: 600; }
nav.menubar .nav-links form button { border-radius: 999px; }
.nav-toggle, .nav-burger { display: none; }
@media (max-width: 1279px) {
  nav.menubar { align-items: center; }
  nav.menubar > ul:first-of-type { flex: 1 1 auto; order: 0; }
  nav.menubar .nav-burger { order: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 2.75rem; height: 2.75rem; margin: 0; padding: 0; cursor: pointer; border-radius: .6rem; }
  nav.menubar .nav-burger:hover { background: var(--nav-hover); }
  nav.menubar .nav-burger span { display: block; flex: none; width: 1.5rem; height: 2px; margin: 0; background: currentColor; border-radius: 1px; }
  nav.menubar .nav-links { order: 2; display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .2rem;
    margin: .25rem 0 .75rem; padding: .4rem; border: 1px solid var(--nav-rule); border-radius: .9rem; background: var(--nav-panel); }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  nav.menubar .nav-links > li { padding: 0; margin: 0; }
  nav.menubar .nav-links > li > a, nav.menubar details.dropdown > summary {
    display: flex; justify-content: space-between; width: 100%; padding: .75rem 1rem; border-radius: .6rem; font-size: 1.05rem; }
  nav.menubar details.dropdown[open] > summary { background: transparent; color: var(--nav-ink); }
  nav.menubar li.menu.active > details > summary { background: transparent; color: var(--nav-active-ink); }
  nav.menubar details.dropdown[open] > summary::after { transform: rotate(180deg); }
  /* Pico closes an open dropdown with a full-screen layer over the page; in this list it sat over the links and ate the tap */
  nav.menubar details.dropdown[open] > summary::before { display: none; }
  nav.menubar details.dropdown > ul { position: static; transform: none; opacity: 1; box-shadow: none; border: 0; border-radius: 0;
    background: transparent; width: auto; min-width: 0; margin: 0 0 .25rem 1rem; padding: 0 0 0 .5rem; border-left: 2px solid var(--nav-rule); }
  nav.menubar details.dropdown > ul li a { padding: .65rem .9rem; font-size: 1rem; }
  nav.menubar .nav-links form { padding: .5rem; }
  nav.menubar .nav-links form button { width: 100%; padding: .6rem; font-size: .95rem; }
}

/* season results */
table.season td { vertical-align: top; }
td.placings { white-space: normal; line-height: 1.9; min-width: 12rem; }

.placing { display: inline-block; min-width: 2.4rem; padding: 0 .35rem; margin: 0 .2rem .2rem 0; text-align: center;
  border-radius: .3rem; font-size: .8rem; font-variant-numeric: tabular-nums; background: #e6e8eb; color: #4a5361; }
.placing.podium { background: #d1f2d9; color: #12602b; font-weight: 600; }
.placing.p1 { background: #f9e08b; color: #6b4e00; }
@media (prefers-color-scheme: dark) {
  .placing { background: #39404b; color: #cfd5dd; }
  .placing.podium { background: #134d27; color: #c9f1d6; }
  .placing.p1 { background: #6b5300; color: #fbe9a8; }
}

/* dashboard squad filter */
.squad-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1.5rem 0 1rem; }
.squad-filter label { margin: 0; font-weight: 600; }
form.squad-filter input[type=text] { flex: none; width: 7rem; margin: 0; padding: .3rem .6rem; height: auto; text-transform: uppercase; }
form.squad-filter button, form.squad-filter a[role=button] { flex: none; width: auto; margin: 0; }
.handicap-search { margin-top: 1rem; }
.handicap-search a[role=button] { width: auto; margin: 0; }
.athlete-handicaps h4 { margin: 1.25rem 0 .5rem; font-size: 1rem; }
.athlete-handicaps header { margin-bottom: .5rem; }
.public-tabs ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.public-tabs li { list-style: none; padding: 0; }
.public-tabs a[aria-current] { font-weight: 700; text-decoration: underline; text-underline-offset: .35em; }
.share-link table { margin-bottom: .75rem; }
.share-link th { white-space: nowrap; font-weight: 600; }
.share-link code { word-break: break-all; font-size: .85rem; }

/* charts and tiles (race planner) */
.stawell { --viz-surface: #fcfcfb; --viz-ink: #0b0b0b; --viz-ink-2: #52514e; --viz-muted: #898781; --viz-grid: #e6e5e0; --viz-series: #2a78d6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stawell { --viz-surface: #1a1a19; --viz-ink: #f0efec; --viz-ink-2: #c3c2b7; --viz-grid: #33332f; --viz-series: #3987e5; }
}
:root[data-theme="dark"] .stawell { --viz-surface: #1a1a19; --viz-ink: #f0efec; --viz-ink-2: #c3c2b7; --viz-grid: #33332f; --viz-series: #3987e5; }
.stawell-controls { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin: 1rem 0 .25rem; }
.stawell-controls label { flex: 1 1 14rem; margin: 0; }
.stawell-controls input, .stawell-controls select { margin: .25rem 0 0; }
.stawell-controls button { width: auto; margin: 0; }
.stawell-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.stawell-tiles article { margin: 0; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.stawell-tiles strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stawell-tiles article.final strong { color: var(--pico-primary); }
.stawell-chart { margin: 1rem 0 1.5rem; padding: .75rem; background: var(--viz-surface); border-radius: .5rem; }
.stawell-chart figcaption { margin-bottom: .5rem; color: var(--viz-ink); }
.stawell-chart svg { width: 100%; height: auto; display: block; font-size: 12px; }
.stawell-chart .grid { stroke: var(--viz-grid); stroke-width: 1; }
.stawell-chart .axis { stroke: var(--viz-muted); stroke-width: 1; }
.stawell-chart .tick { fill: var(--viz-muted); }
.stawell-chart .marker { stroke: var(--viz-muted); stroke-width: 1; stroke-dasharray: 2 3; }
.stawell-chart .ref { stroke: var(--viz-ink-2); stroke-width: 1.5; stroke-dasharray: 6 4; }
.stawell-chart .ref-label { fill: var(--viz-ink-2); font-weight: 600; paint-order: stroke; stroke: var(--viz-surface); stroke-width: 3px; }
.stawell-chart .trend { fill: none; stroke: var(--viz-series); stroke-width: 2; stroke-linecap: round; }
.stawell-chart .projection { stroke-dasharray: 5 4; }
.stawell-chart .band { stroke: var(--viz-series); stroke-width: 8; stroke-linecap: round; opacity: .25; }
.stawell-chart .proj { fill: var(--viz-surface); stroke: var(--viz-series); stroke-width: 2; }
.stawell-chart .dot circle { fill: var(--viz-series); stroke: var(--viz-surface); stroke-width: 2; }
.stawell-chart .dot circle.hit { fill: transparent; stroke: none; }
.stawell-chart .dot:hover circle:not(.hit) { r: 6.5; }
.stawell-chart .chart-scroll { overflow-x: auto; }
.stawell-chart .chart-scroll svg { min-width: 540px; }

/* table headers as solid blocks */
:root { --head-bg: #e3e8ef; --head-ink: #1f2a37; --head-rule: #c5cfdc; --head-strong: #1f3a5f; --head-strong-ink: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --head-bg: #263241; --head-ink: #e8edf3; --head-rule: #3a4a5e; --head-strong: #35557d; --head-strong-ink: #ffffff; }
}
:root[data-theme="dark"] { --head-bg: #263241; --head-ink: #e8edf3; --head-rule: #3a4a5e; --head-strong: #35557d; --head-strong-ink: #ffffff; }
table thead th {
  background: var(--head-bg); color: var(--head-ink); font-weight: 700;
  border-bottom: 2px solid var(--head-rule); vertical-align: bottom;
}
table thead th:first-child { border-top-left-radius: .4rem; }
table thead th:last-child { border-top-right-radius: .4rem; }
.race .race-title { background: var(--head-strong); color: var(--head-strong-ink); border-bottom: 0; }
.race .race-title .race-when { color: var(--head-strong-ink); opacity: .85; }
.race thead th { background: var(--head-bg); color: var(--head-ink); border-radius: 0; padding-top: .45rem; }

/* race planner tables */
.outlook-table td { vertical-align: top; }
.outlook-table td.last { min-width: 11rem; }
.outlook-table td.last div { line-height: 1.3; }
.outlook-table tr.new-meeting td { border-top: 2px solid var(--head-rule); }
.outlook-table tr.goal td { background: color-mix(in srgb, var(--viz-series) 7%, transparent); }
.outlook-table tr.home td { background: color-mix(in srgb, var(--viz-series) 4%, transparent); }
.outlook-table td.chance { min-width: 3.5rem;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--viz-series) 22%, transparent) var(--p, 0%), transparent var(--p, 0%));
  background-repeat: no-repeat; background-size: 100% 6px; background-position: left bottom; }
.outlook-table td.chance.strong { font-weight: 700; }
.outlook mark.tag { font-size: .7rem; padding: .05rem .35rem; border-radius: .3rem; white-space: nowrap;
  background: var(--head-strong); color: var(--head-strong-ink); }
.outlook-tiles strong small { font-size: .9rem; font-weight: 400; }
.outlook-tiles article small { display: block; }
.outlook-table td:nth-child(2) { min-width: 9.5rem; }
.outlook-table td:first-child { min-width: 7rem; }
.outlook-controls { margin: 1rem 0 .5rem; }
.outlook-controls > label { max-width: 24rem; }
.whatif { border: 1px solid var(--nav-rule); border-radius: .75rem; padding: .75rem 1rem .6rem; margin: .5rem 0; }
.whatif legend { padding: 0 .4rem; font-weight: 600; }
.whatif legend small { font-weight: 400; }
.whatif-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem .75rem; }
.whatif-grid label { margin: 0; font-size: .9rem; }
.whatif-grid input { margin: .2rem 0 0; }
.whatif-actions { display: flex; gap: 1rem; align-items: center; margin: .6rem 0 .3rem; }
.whatif-actions button { width: auto; margin: 0; }
.whatif-banner { padding: .5rem .8rem; border-radius: .6rem; background: var(--nav-active); }
.outlook-table small.was { white-space: nowrap; font-weight: 400; }
.outlook-table input.race-mark { width: 5.2rem; margin: 0; padding: .3rem .45rem; height: auto; font-size: .95rem; text-align: right; }
.outlook-table input.race-mark.set { border-color: var(--pico-primary); font-weight: 700; }

/* Current heats: squad / all toggle, every heat as a card, squad rows highlighted */
.view-toggle { display: inline-flex; gap: 0; margin: 0 1rem 1rem 0; border: 1px solid var(--nav-rule, #ccd); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.view-toggle label { margin: 0; padding: .35rem 1rem; cursor: pointer; font-size: .9rem; }
.view-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.view-toggle label:has(input:checked) { background: var(--nav-active, #1f4e79); color: var(--nav-active-ink, #fff); font-weight: 600; }
.view-toggle label:has(input:focus-visible) { outline: 2px solid var(--pico-primary); outline-offset: -2px; }
.all-heats h3.heat-event { margin: 1.5rem 0 .5rem; font-size: 1.05rem; }
details.heat-card { border: 1px solid var(--nav-rule, #dde); border-radius: .6rem; padding: .4rem .8rem; margin-bottom: .5rem; }
details.heat-card > summary { font-size: .95rem; }
details.heat-card table { margin: .4rem 0 .2rem; }
mark.squad-tag { background: #fff1b8; color: #5c4300; border-radius: .3rem; padding: 0 .35rem; font-size: .8rem; font-weight: 600; }
table.heat-table tr.ours td { background: #fff7d1; font-weight: 600; }
table.series th.num, table.series td.num { text-align: right; }
table.heat-table tr.ours td:first-child { box-shadow: inset 4px 0 0 #e0a800; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) mark.squad-tag { background: #5c4a0a; color: #ffe9a3; }
  :root:not([data-theme="light"]) table.heat-table tr.ours td { background: #3d3410; }
}

/* next race */
.your-heat-card header { display: flex; flex-direction: column; gap: .1rem; }
table.your-heat-table tr.me td { background: #e6f0fa; font-weight: 600; }
table.your-heat-table tr.me td:first-child { box-shadow: inset 4px 0 0 #1f6fb2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) table.your-heat-table tr.me td { background: #1d3247; }
}

/* Handicap rules matrix */
table.rules-matrix { font-size: .85rem; }
.rules-scroll { overflow: auto; max-height: calc(100vh - 7rem); margin-bottom: 1rem; border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius); }
.rules-scroll table.rules-matrix { width: max-content; min-width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
table.rules-matrix thead { position: sticky; top: 0; z-index: 3; }
table.rules-matrix thead th { background: var(--pico-card-sectioning-background-color, var(--pico-background-color)); }
table.rules-matrix thead tr:last-child th { border-bottom: 2px solid var(--pico-muted-border-color); }
table.rules-matrix tbody th, table.rules-matrix thead tr:first-child th:first-child { position: sticky; left: 0; z-index: 2; background: var(--pico-background-color); }
table.rules-matrix thead tr:first-child th:first-child { z-index: 4; background: var(--pico-card-sectioning-background-color, var(--pico-background-color)); }
table.rules-matrix th, table.rules-matrix td { padding: .25rem .2rem; text-align: center; white-space: nowrap; }
table.rules-matrix tbody th { text-align: left; white-space: normal; width: 7.5rem; min-width: 7.5rem; max-width: 7.5rem; }
table.rules-matrix input[type="text"] { width: 3.6rem; margin: 0; padding: .2rem .35rem; height: auto; font-size: .85rem; text-align: right; }
table.rules-matrix input.wide { width: 4.6rem; }
table.rules-matrix input[type="checkbox"] { margin: 0; }
table.rules-matrix td.changed { background: #fff1b8; }
table.rules-matrix td.changed input { font-weight: 700; }
.rules-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.rules-actions button { width: auto; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) table.rules-matrix td.changed { background: #5c4a0a; } }

/* race planner plan */
.goal-tiles { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.goal-verdict { margin: 1rem 0; padding: .75rem 1rem; border-left: 4px solid var(--pico-primary); background: var(--pico-card-background-color); border-radius: .4rem; }
table.goal-table tr.goal td { background: #fff7d1; }
table.goal-table tr.stop td { background: #e6f4ea; }
table.goal-table tr.skipped td { opacity: .5; }
table.goal-table input[type="checkbox"] { margin: 0; }
ul.goal-numbers li { margin-bottom: .3rem; }
a.plan-link { font-size: .75rem; margin-left: .35rem; padding: 0 .4rem; border: 1px solid var(--nav-rule, #ccd); border-radius: 999px; text-decoration: none; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) table.goal-table tr.goal td { background: #3d3410; }
  :root:not([data-theme="light"]) table.goal-table tr.stop td { background: #173a24; }
}
table.goal-table label.skip { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-size: .85rem; white-space: nowrap; }

/* race planner chart */
.goal-chart .chart-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; font-size: .8rem; color: var(--viz-ink-2); margin-bottom: .4rem; }
.goal-chart .chart-legend span { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin-right: -.5rem; }
.goal-chart .key-form { border-top: 2px solid var(--viz-series); }
.goal-chart .key-need { border-top: 2px dashed var(--viz-ink-2); }
.goal-chart .key-trial { width: 10px !important; height: 10px !important; border-radius: 2px; background: var(--viz-surface); border: 2px solid var(--viz-series); }
.goal-chart .trial rect { fill: var(--viz-surface); stroke: var(--viz-series); stroke-width: 2; }
.goal-chart .form-label { fill: var(--viz-series); }
.goal-table .trial-in { width: 5.5rem; margin: .3rem 0 0; padding: .2rem .4rem; height: auto; font-size: .85rem; }

/* photographer */
.photo-pick { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.photo-pick select { flex: 1 1 12rem; width: auto; min-width: 0; margin: 0; }
.photo-pick input { flex: 0 0 5.5rem; width: 5.5rem; margin: 0; }
.photo-pick button { margin: 0; }
.photo-status { margin: .75rem 0 .5rem; }
.photo-list { list-style: none; padding: 0; margin: 0; }
.photo-list li { list-style: none; display: grid; grid-template-columns: 6.6rem 1fr 6.5rem; gap: .75rem; align-items: center;
  padding: 0 0 0 .8rem; margin: 0 0 .4rem; border: 1px solid var(--pico-muted-border-color); border-radius: .5rem;
  background: var(--pico-card-background-color); overflow: hidden; min-height: 4.6rem; }
.photo-list li.same { margin-top: -.4rem; border-top-left-radius: 0; border-top-right-radius: 0; border-top-style: dashed; }
.photo-list li.same .photo-time { visibility: hidden; }
.photo-time { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.photo-colour { align-self: stretch; display: flex; align-items: flex-end; justify-content: center; padding: .3rem;
  border: 1px solid rgba(0,0,0,.45); border-radius: 0 .45rem .45rem 0; background: repeating-linear-gradient(45deg, #ccc 0 4px, #eee 4px 8px); }
.photo-colour b { font-size: .8rem; font-weight: 700; line-height: 1.2; padding: .1rem .4rem; border-radius: .25rem; background: rgba(0,0,0,.6); color: #fff; text-align: center; }
.photo-colour.number { align-items: center; background: #fff; }
.photo-colour.number b { background: none; color: #000; font-size: 2rem; font-weight: 800; padding: 0; }
.photo-name { min-width: 0; padding: .7rem 0; }
.photo-name strong { display: block; font-size: 1.45rem; line-height: 1.2; }
.photo-name small { color: var(--pico-muted-color); font-size: 1rem; }
.photo-list li.next { border: 2px solid var(--pico-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pico-primary) 20%, transparent); }
.photo-list li.done { background: #e3f5e6; border-color: #7cc48a; }
.photo-list li.done .photo-time, .photo-list li.done .photo-name strong { color: #1d6b2e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .photo-list li.done { background: #173a20; border-color: #2f7a43; }
  :root:not([data-theme="light"]) .photo-list li.done .photo-time, :root:not([data-theme="light"]) .photo-list li.done .photo-name strong { color: #9fe0ad; }
}
:root[data-theme="dark"] .photo-list li.done { background: #173a20; border-color: #2f7a43; }
:root[data-theme="dark"] .photo-list li.done .photo-time, :root[data-theme="dark"] .photo-list li.done .photo-name strong { color: #9fe0ad; }
@media (max-width: 520px) {
  .photo-list li { grid-template-columns: 5.7rem 1fr 4.6rem; gap: .5rem; padding-left: .6rem; }
  .photo-time { font-size: 1.15rem; }
  .photo-name strong { font-size: 1.25rem; }
}
.photo-event { font-size: 1.3rem; margin: 1.1rem 0 .45rem; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.photo-event small { font-weight: 400; font-size: .8rem; }
.goal-warning { margin: 1rem 0 0; padding: .6rem 1rem; border-left: 4px solid #d08a00; background: color-mix(in srgb, #d08a00 12%, var(--pico-card-background-color)); border-radius: .4rem; font-size: .9rem; }
/* athlete status */
table.status-table td.num { text-align: center; white-space: nowrap; }
table.status-table th[scope="row"] { white-space: nowrap; }
table.status-table tr.status-classes td { border-top: 0; padding-top: 0; }
table.status-table td.status-events { font-size: .9rem; }
details.status-meetings table { font-size: .85rem; }
details.status-meetings tr.muted td { color: var(--pico-muted-color); }
.athlete-status h3.status-name { margin-top: 1.5rem; }
table.status-table td.status-cell { min-width: 11rem; }

/* race planner */
.goal-chart .key-win { border-top: 2px dotted #c2410c; }
.plan-chart .need-win { stroke: #c2410c; stroke-dasharray: 2 3; }
.plan-chart .win-label { fill: #c2410c; }
.outlook mark.tag.ok { background: color-mix(in srgb, #1f9d55 18%, transparent); color: inherit; }
table.plan-table tr.crossing td { box-shadow: inset 0 2px 0 #1f9d55; }
table.plan-table td { vertical-align: top; }
.next-race-card { margin: 1rem 0; }
.next-race-card > summary { margin-bottom: .5rem; }
.race-heats { display: grid; grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr)); gap: 0 1rem; }
@media (max-width: 480px) { .race-heats { grid-template-columns: 1fr; } }
table.race-table caption { text-align: left; padding: .25rem 0; }
table.race-table td, table.race-table th { padding: .3rem .45rem; font-size: .88rem; }
table.race-table tr.me td { background: #e6f0fa; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) table.race-table tr.me td { background: #1d3247; } }
.goal-pick { max-width: 30rem; display: block; }
table.plan-table td.race-as { min-width: 6.5rem; }
table.plan-table td.race-as select { margin: 0 0 .3rem; padding: .2rem 1.6rem .2rem .45rem; height: auto; font-size: .85rem; }
table.plan-table .trial-in.set { border-color: var(--pico-primary); font-weight: 700; }
table.plan-table tr.nap td { background: color-mix(in srgb, #d08a00 8%, transparent); }
table.plan-table td.last { min-width: 10rem; }
table.plan-table tr.past td { background: color-mix(in srgb, var(--pico-muted-color) 7%, transparent); }
table.plan-table tr.today-line td { border-top: 2px solid var(--pico-primary); padding-top: .3rem; padding-bottom: .3rem; }
.chg.lift { color: #1f9d55; }
.chg.pull { color: #c0392b; }
.chg.same { color: #d08a00; }

/* recap post preview */
.recap-preview { display: flex; flex-wrap: wrap; gap: 1rem; }
.recap-preview img { width: min(100%, 540px); height: auto; border-radius: .4rem; }

table.predicted-final tr.via-loser td { border-top: 2px solid var(--pico-muted-border-color, #8884); }

.novice-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .5rem; }
.novice-events fieldset { margin: 0; }
.novice-events .ev-pick { font-size: .9em; margin: .1rem 0; }

.model-form label.changed > input, .model-form label.changed .model-input input { outline: 2px solid var(--pico-primary, #1f5fbf); }
.model-form label.changed { font-weight: 600; }
.model-form .model-input { display: flex; align-items: center; gap: .5rem; max-width: 14rem; }
.model-form .model-input input { margin: 0; }
