/* Design tokens and base rules of all pages.
   Rule: a page style uses a token (var(--...)), not a colour value. Add a new token here. */

:root {
  /* Text and surfaces (from the race card prototype, GHRC-0zwzbq). */
  --ink: #000;
  --dim: #666;
  --line: #cfd4d9;
  --band: #f3f5f7;
  --head: #20303f;
  --head-ink: #fff;
  --bg: #fff;
  --link: #0b4f9e;
  --win: #0a6b2d;
  --trial: #8a5a00;
  --bitch: #a3145f;

  --font: var(--size-text) / 1.25 var(--font-text);
  --font-mono: 11px ui-monospace, monospace;
  --gap: 6px;
  --radius: 3px;

  /* Trap colours, one set for each region. A value is a full CSS background (colour or
     gradient), so use it with "background:", not "background-color:".
     All three regions: the old WPF application (UserInterface/ResourceDictionary1.xaml,
     styles TrapColours and TrapColoursRegion at the lines 4174 to 4793; the brushes at the
     lines 1018 to 1264; the region "BI" and "EU" of the old code is our "uk"). The number
     font is the heading font, bold (--font-heading). */
  --trap-plate: linear-gradient(#fff, #fff) center / 50% 50% no-repeat;
  /* Old Trap3Brush (line 1311): black box with a white inner square (5 % border). */
  --trap-box: linear-gradient(#fff, #fff) center / 90% 90% no-repeat, #000;

  --trap-uk-1-bg: darkred;  --trap-uk-1-fg: #fff;
  --trap-uk-2-bg: blue;     --trap-uk-2-fg: #fff;
  --trap-uk-3-bg: var(--trap-box);  --trap-uk-3-fg: #000;
  --trap-uk-4-bg: #000;     --trap-uk-4-fg: #fff;
  --trap-uk-5-bg: orange;   --trap-uk-5-fg: #fff;
  --trap-uk-6-bg: linear-gradient(#fff, #fff) center / 50% 50% no-repeat,
    linear-gradient(180deg, #000 0 20%, #fff 20% 40%, #000 40% 60%, #fff 60% 80%, #000 80%)
    center / 80% 100% no-repeat, #000;
  --trap-uk-6-fg: red;
  --trap-uk-7-bg: green;    --trap-uk-7-fg: red;
  --trap-uk-8-bg: linear-gradient(90deg, #000 0 50%, goldenrod 50%);
  --trap-uk-8-fg: #fff;

  --trap-au-1-bg: #c02127;  --trap-au-1-fg: #fff;
  --trap-au-2-bg: var(--trap-plate),
    repeating-linear-gradient(180deg, #000 0 14.3%, #fff 14.3% 28.6%);
  --trap-au-2-fg: red;
  --trap-au-3-bg: var(--trap-box); --trap-au-3-fg: #000;
  --trap-au-4-bg: cornflowerblue;  --trap-au-4-fg: #fff;
  --trap-au-5-bg: yellow;          --trap-au-5-fg: #000;
  --trap-au-6-bg: darkseagreen;    --trap-au-6-fg: red;
  --trap-au-7-bg: #000;            --trap-au-7-fg: yellow;
  --trap-au-8-bg: hotpink;         --trap-au-8-fg: #000;
  --trap-au-9-bg: var(--trap-plate),
    repeating-linear-gradient(45deg, green 0 8.3%, #fff 8.3% 16.7%);
  --trap-au-9-fg: #000;
  --trap-au-10-bg: linear-gradient(#fff, #fff) center / 70% 60% no-repeat,
    linear-gradient(90deg, red 0 33%, #fff 33% 67%, blue 67%);
  --trap-au-10-fg: #000;

  --trap-us-1-bg: darkred;  --trap-us-1-fg: #fff;
  --trap-us-2-bg: blue;     --trap-us-2-fg: #fff;
  --trap-us-3-bg: var(--trap-box);  --trap-us-3-fg: #000;
  --trap-us-4-bg: green;    --trap-us-4-fg: #fff;
  --trap-us-5-bg: #000;     --trap-us-5-fg: orange;
  --trap-us-6-bg: linear-gradient(yellow, yellow) center / 90% 90% no-repeat, #000;
  --trap-us-6-fg: red;
  --trap-us-7-bg: linear-gradient(#fff, #fff) center / 40% 50% no-repeat,
    repeating-linear-gradient(180deg, #fff 0 14.3%, green 14.3% 28.6%) center / 90% 90% no-repeat,
    #000;
  --trap-us-7-fg: #000;
  --trap-us-8-bg: linear-gradient(90deg, #000 0 17%, goldenrod 17% 33%, #000 33% 67%,
    goldenrod 67% 83%, #000 83%);
  --trap-us-8-fg: #fff;
  --trap-us-9-bg: mediumvioletred;  --trap-us-9-fg: gold;
}

/* The region of the page selects its trap set. UK is the default. Use: an element with
   data-region="au" (or "us") around the content, and <span class="trap t3">3</span>. */
:root, [data-region="uk"] {
  --trap-1-bg: var(--trap-uk-1-bg); --trap-1-fg: var(--trap-uk-1-fg);
  --trap-2-bg: var(--trap-uk-2-bg); --trap-2-fg: var(--trap-uk-2-fg);
  --trap-3-bg: var(--trap-uk-3-bg); --trap-3-fg: var(--trap-uk-3-fg);
  --trap-4-bg: var(--trap-uk-4-bg); --trap-4-fg: var(--trap-uk-4-fg);
  --trap-5-bg: var(--trap-uk-5-bg); --trap-5-fg: var(--trap-uk-5-fg);
  --trap-6-bg: var(--trap-uk-6-bg); --trap-6-fg: var(--trap-uk-6-fg);
  --trap-7-bg: var(--trap-uk-7-bg); --trap-7-fg: var(--trap-uk-7-fg);
  --trap-8-bg: var(--trap-uk-8-bg); --trap-8-fg: var(--trap-uk-8-fg);
}
[data-region="au"] {
  --trap-1-bg: var(--trap-au-1-bg); --trap-1-fg: var(--trap-au-1-fg);
  --trap-2-bg: var(--trap-au-2-bg); --trap-2-fg: var(--trap-au-2-fg);
  --trap-3-bg: var(--trap-au-3-bg); --trap-3-fg: var(--trap-au-3-fg);
  --trap-4-bg: var(--trap-au-4-bg); --trap-4-fg: var(--trap-au-4-fg);
  --trap-5-bg: var(--trap-au-5-bg); --trap-5-fg: var(--trap-au-5-fg);
  --trap-6-bg: var(--trap-au-6-bg); --trap-6-fg: var(--trap-au-6-fg);
  --trap-7-bg: var(--trap-au-7-bg); --trap-7-fg: var(--trap-au-7-fg);
  --trap-8-bg: var(--trap-au-8-bg); --trap-8-fg: var(--trap-au-8-fg);
  --trap-9-bg: var(--trap-au-9-bg); --trap-9-fg: var(--trap-au-9-fg);
  --trap-10-bg: var(--trap-au-10-bg); --trap-10-fg: var(--trap-au-10-fg);
}
[data-region="us"] {
  --trap-1-bg: var(--trap-us-1-bg); --trap-1-fg: var(--trap-us-1-fg);
  --trap-2-bg: var(--trap-us-2-bg); --trap-2-fg: var(--trap-us-2-fg);
  --trap-3-bg: var(--trap-us-3-bg); --trap-3-fg: var(--trap-us-3-fg);
  --trap-4-bg: var(--trap-us-4-bg); --trap-4-fg: var(--trap-us-4-fg);
  --trap-5-bg: var(--trap-us-5-bg); --trap-5-fg: var(--trap-us-5-fg);
  --trap-6-bg: var(--trap-us-6-bg); --trap-6-fg: var(--trap-us-6-fg);
  --trap-7-bg: var(--trap-us-7-bg); --trap-7-fg: var(--trap-us-7-fg);
  --trap-8-bg: var(--trap-us-8-bg); --trap-8-fg: var(--trap-us-8-fg);
  --trap-9-bg: var(--trap-us-9-bg); --trap-9-fg: var(--trap-us-9-fg);
}

/* GHRC-qnzytd: shared style values of the old application (the WPF source in
   GreyhoundRacingShared/UserInterface). ONE block. A page style uses these properties; it
   does not write a font, a size or one of these colours by hand. A value that comes from
   the source has the file and the line in the comment. A value that is sampled from the
   screenshot docs/research/legacy-ui/02-race-card.png (no source value) says "sampled".
   The old application has no Windows font in our test image: each font is a stack with the
   old font first, then free fonts with near metrics. No font file, no download. */
:root {
  /* Fonts. Heading font: Cambria, bold (trap numbers, ResourceDictionary1.xaml:4182, 4492;
     meeting name of the day list, Single_Meeting_Card.xaml:25; DisplayRaces.cs:4393).
     Text font: the WPF default Segoe UI (all other text of the card; the typing error
     "Sagoe UI" of some files falls back to it). Narrow font: Arial Narrow (the form table of
     the card, Race_LineControl.xaml:751). Caladea has the metrics of Cambria.
     GHRC-dbp2xm: each font of the heading stack must have lining digits (all digits with the
     same height). Georgia has old-style digits, so the trap numbers were at different heights
     in their boxes on a device with no Cambria and no Caladea (macOS, iOS). Do not add
     Georgia or a different font with old-style digits. */
  --font-heading: Cambria, Caladea, "Liberation Serif", "Times New Roman", Times, serif;
  --font-text: "Segoe UI", Selawik, "Liberation Sans", Arial, "Helvetica Neue", sans-serif;
  --font-narrow: "Arial Narrow", "Liberation Sans Narrow", "Nimbus Sans Narrow", "Helvetica Neue",
    Arial, sans-serif;

  /* Sizes (WPF px = CSS px). */
  --size-text: 12px;       /* WPF default text; footers and links (Race_FooterControl.xaml) */
  --size-small: 10px;      /* base of the card (Race_LineControl.xaml:11), win records, trainer */
  --size-tiny: 9px;        /* sire, dam and colour (Race_LineControl.xaml:330) */
  --size-grid: 11px;       /* form table rows (ResourceDictionary1.xaml:3016) */
  --size-name: 14px;       /* dog name (Race_LineControl.xaml:106), default trap (xaml:4182) */
  --size-title: 16px;      /* header bar of a race (Race_HeaderControl.xaml:47, 122, 172, 203) */
  --size-trap-big: 22px;   /* trap box of a runner block (Race_LineControl.xaml:43) */
  --size-trap-grid: 10px;  /* trap box in a form row (Race_LineControl.xaml:1008) */
  --trap-big-w: 25px;      /* Race_LineControl.xaml:46 (width 25, height 29) */
  --trap-big-h: 29px;
  --trap-grid-w: 14px;     /* Race_LineControl.xaml:1007 (width 14, minimum height 18) */
  --row-h: 19px;           /* a row of the form table: the trap box has a height of 18 px plus 2 x 0.5 px */

  /* Greys and pale backgrounds. */
  --old-bar: #6b6969;         /* title bar: ColorbrushBlock, ResourceDictionary1.xaml:11 */
  --old-bar-ink: #f9f7f7;     /* text on the title bar: ColorbrushWhite, xaml:8 */
  --old-border: #b4b1b1;      /* ColorbrushBorder, xaml:9 */
  --old-border-2: #cbcbcb;    /* ColorbrushBorder2, xaml:10 */
  --old-grid-line: #688caf;   /* ColorbrushGridLines, xaml:12 */
  --old-block: #f5f5f5;       /* runner block: WhiteSmoke, Race_LineControl.xaml:25 */
  --old-row-a: #f0f0f0;       /* odd row of a grid: sampled (DataGrid default, system control colour) */
  --old-row-b: #e8e8e8;       /* even row of a grid: AlternatingDataGridRow, xaml:3020 */
  --old-match: #d9f1fa;       /* row of a match: ColorbrushMatchLine, xaml:16 */
  --old-head-cell: linear-gradient(#fff, #f3f4f6);  /* header cell of a grid: sampled (DataGrid default) */
  --old-head-line: #dfe0e2;   /* line between header cells: sampled */
  --old-band: #e5f3fb;        /* band "Next Race": sampled (Windows list item, MainWindow.xaml:196) */
  --old-band-line: #70c0e7;   /* border of the band: sampled */
  --old-footer: #f0f0f0;      /* FooterBackgroundBrush, xaml:552 (GhostWhite to this grey) */
  --old-hover: lightblue;     /* BackgroundHighlightTextBlock hover, xaml:3626 */

  /* Text colours (WPF named colours as the source writes them). */
  --old-red: red;             /* Red: links of the footer, AM / PM, late sex, 1 in 3 wins */
  --old-blue: blue;           /* Blue: dog sex, 1 in 5 wins (TypeConverters.cs:776, 1883) */
  --old-violet: darkviolet;   /* DarkViolet: "F" and "N" flags, Race_LineControl.xaml:69, 484 */
  --old-green-dark: darkgreen; /* DarkGreen: "N" newcomer, Race_LineControl.xaml:51 */
  --old-green: green;         /* Green: first BAGS run, trainer colour 2, void race */
  --old-orange: orange;       /* a dog younger than 2 years (TypeConverters.cs:1681) */
  --old-purple: purple;       /* a dog older than 4.5 years (TypeConverters.cs:1692) */
  --old-slate: darkslategray; /* trainer colour 3 (DisplayRaces.cs:285) */
  --old-aqua: aquamarine;     /* trainer colour 4 (DisplayRaces.cs:288) */
  --old-dog: #3737ed;         /* DogColour, xaml:18 */
  --old-bitch: #eb1616;       /* BitchColour, xaml:19 */
  --old-trap-red: #e30000;    /* ColorbrushTrapRed, xaml:14 */
  --old-mustard: #ffd800;     /* ColorbrushMustard, xaml:15 */
  --old-season-1: #379f37;    /* UserSeasonDateLevel 1, Race_LineControl.xaml:372 */
  --old-season-3: #3aa6c9;    /* level 3, Race_LineControl.xaml:378 */
  --old-season-4: lightblue;  /* level 4, Race_LineControl.xaml:381 */

  /* Dotted separator: a line of 1 px, dash 1 px and gap 4 px
     (Single_Meeting_Card.xaml:38, StrokeDashArray "1,4", black). Use the class .dotted-sep
     or: background: var(--old-dots) 0 50% / 100% 1px no-repeat. */
  --old-dots: repeating-linear-gradient(90deg, #000 0 1px, transparent 1px 5px);

  /* Names of the first version of the card (GHRC-88ekwa), kept for the rules that use them. */
  --card-bar: var(--old-bar);
  --card-bar-ink: var(--old-bar-ink);
  --card-nav: var(--old-band);
  --card-nav-line: var(--old-band-line);
  --card-block: var(--old-block);
  --card-row: var(--old-row-b);
  --card-match: var(--old-match);
  --card-red: var(--old-red);
  --card-blue: var(--old-blue);
  --card-young: var(--old-orange);
  --card-old: var(--old-purple);
  --card-newcomer: var(--old-green-dark);
  --card-tc1: var(--old-red);
  --card-tc2: var(--old-green);
  --card-tc3: var(--old-slate);
  --card-tc4: var(--old-aqua);
}
.dotted-sep { height: 10px; margin: 0 5px; background: var(--old-dots) 0 50% / 100% 1px no-repeat; }

* { box-sizing: border-box; }
body { margin: 0; font: var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 16px; margin: 4px 0 8px; }

header.site {
  display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline;
  background: var(--head); color: var(--head-ink); padding: 4px 8px;
}
header.site a { color: var(--head-ink); }
header.site .brand { font-weight: 700; font-size: 14px; }
.page { padding: var(--gap) 8px; }

/* Account form in the header; login, invitation and reset forms (GHRC-xaq7kc). */
header.site form.account { display: flex; gap: var(--gap); align-items: baseline; margin-left: auto; }
.auth { max-width: 24rem; }
.auth form { display: grid; gap: var(--gap); }
.auth label { display: grid; gap: 2px; }
.auth input { font: inherit; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); }
.auth .error { color: var(--bitch); }
.auth .hint { color: var(--dim); margin: 0; }

/* Administrator pages (GHRC-9mr6tk). */
.admin .error { color: var(--bitch); }
.admin .hint { color: var(--dim); }
.admin-list { border-collapse: collapse; margin-bottom: 12px; }
.admin-list th, .admin-list td { border-bottom: 1px solid var(--line); padding: 2px 6px; text-align: left; }
.admin-list th { background: var(--band); }
.admin-list tr.disabled td { color: var(--dim); }
.admin-list .actions { display: flex; gap: var(--gap); }
.admin-form { display: grid; gap: var(--gap); max-width: 28rem; }
.admin-form label { display: grid; gap: 2px; }
.admin-form fieldset label { display: block; }
.admin input.link { font: var(--font-mono); width: 100%; max-width: 48rem; }

/* Navigation: day view, venue menu, entity pages (GHRC-n2vxda). */
.hint { color: var(--dim); }
.day-nav { display: flex; flex-wrap: wrap; gap: var(--gap) 12px; margin-bottom: 4px; }
.day-nav [aria-current] { font-weight: 700; }
.day h1 .region { color: var(--dim); font-weight: 400; }
.region-select, .track-select { margin: 4px 0; }
.track-select fieldset { display: flex; flex-wrap: wrap; gap: 2px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.track-select label { white-space: nowrap; }
.venue-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: var(--gap); margin-top: 8px; }
.venue-menu .empty, .venue-menu .hint { grid-column: 1 / -1; }
.menu-meeting { border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 6px 4px; }
.menu-meeting h2 { font-size: 13px; margin: 2px 0 4px; }
.race-times { display: flex; flex-wrap: wrap; gap: 2px 8px; list-style: none; margin: 0; padding: 0; font: var(--font-mono); }
.entity h1 a + a, .entity h1 .time { margin-left: 8px; }
.race-facts { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.views { display: flex; gap: 10px; margin: 4px 0; }
.entity-list { border-collapse: collapse; }
.entity-list th, .entity-list td { border-bottom: 1px solid var(--line); padding: 2px 6px; text-align: left; }
.entity-list th { background: var(--band); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; }

.trap {
  display: inline-block; min-width: 16px; padding: 0 2px; line-height: 18px; vertical-align: middle;
  text-align: center; font: 700 var(--size-name) / 18px var(--font-heading);
  /* After "font" (the shorthand sets this property back to normal). GHRC-dbp2xm: lining
     digits also from a font that has the two digit sets. */
  font-variant-numeric: lining-nums;
}
.t1 { background: var(--trap-1-bg); color: var(--trap-1-fg); }
.t2 { background: var(--trap-2-bg); color: var(--trap-2-fg); }
.t3 { background: var(--trap-3-bg); color: var(--trap-3-fg); }
.t4 { background: var(--trap-4-bg); color: var(--trap-4-fg); }
.t5 { background: var(--trap-5-bg); color: var(--trap-5-fg); }
.t6 { background: var(--trap-6-bg); color: var(--trap-6-fg); }
.t7 { background: var(--trap-7-bg); color: var(--trap-7-fg); }
.t8 { background: var(--trap-8-bg); color: var(--trap-8-fg); }
.t9 { background: var(--trap-9-bg); color: var(--trap-9-fg); }
.t10 { background: var(--trap-10-bg); color: var(--trap-10-fg); }

@media (max-width: 640px) { .page { padding: 4px; } }
@media print { header.site { display: none; } }

/* GHRC-bf0c9y: trainer page */
.trainer-totals, .trainer-kennel { border-collapse: collapse; }
.trainer-totals th, .trainer-totals td, .trainer-kennel th, .trainer-kennel td { padding: 1px 8px; text-align: left; }
.trainer-totals th, .trainer-kennel th { color: var(--dim); font-weight: normal; }
.trainer-totals td.num, .trainer-kennel td.num { text-align: right; font-variant-numeric: tabular-nums; }
.trainer .pager a { margin-left: 10px; }

/* GHRC-3mp4sd: result of a race, results of a meeting */
.race-result { margin: 6px 0 12px; }
.result-head { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 13px; margin: 8px 0 2px; padding: 2px 6px; background: var(--band); border-top: 1px solid var(--line); }
.result-head .title { color: var(--dim); font-weight: 400; }
.result-head .card-link { margin-left: auto; font-weight: 400; }
.result-facts, .dividends { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 2px 0; }
.result-state { font-weight: 700; }
.state-void .result-state, .state-abandoned .result-state { color: var(--bitch); }
.state-fast .result-state { color: var(--trial); }
.result-lines { border-collapse: collapse; }
.result-lines th, .result-lines td { border-bottom: 1px solid var(--line); padding: 1px 6px; text-align: left; white-space: nowrap; }
.result-lines th { background: var(--band); font-weight: 600; }
.result-lines .num { font: var(--font-mono); text-align: right; }
.result-lines .pos { font-weight: 700; }
.state-void .result-lines td { color: var(--dim); text-decoration: line-through; }
@media (max-width: 640px) { .result-lines { display: block; overflow-x: auto; } }

/* GHRC-bpgsqf: day views */
.day-views { margin: 2px 0; }
.day-views strong { margin: 0 4px; }
.day-trials h2, .result-meeting h2 { font-size: 14px; margin: 8px 0 2px; }
.day-trials h3, .result-meeting h3 { font-size: 13px; margin: 6px 0 2px; }
.results td.first-three .trap { margin-right: 2px; }
.results td:nth-child(6), .results td:nth-child(7) { text-align: right; font: var(--font-mono); }

/* GHRC-nq0vzv: greyhound page */
.dog-profile { margin-bottom: 4px; }
.trap-wins { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; margin: 4px 0; }
.trap-win { white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 4px 0; }
.form-grid { border-collapse: collapse; font-size: 11px; }
.form-grid th, .form-grid td { padding: 1px 4px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.form-grid thead th { background: var(--band); }
.form-grid tbody tr:nth-child(even) td { background: var(--band); }
.form-grid tr.year th { background: var(--head); color: var(--head-ink); }
.form-grid tr.trial td { color: var(--trial); }
.form-grid tr.void td { color: var(--dim); }
.form-grid td:nth-child(14) { white-space: normal; min-width: 8rem; }
.form-grid .trap { font-size: 11px; min-width: 16px; }

/* GHRC-99xc3x: race card (runner blocks and form lines; layout of the prototype GHRC-0zwzbq) */
.race .title { font-style: italic; }
.race-card { border: 1px solid var(--head); margin: 0 0 10px; break-inside: avoid; }
.race-card > .card-head {
  display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline;
  background: var(--head); color: var(--head-ink); padding: 3px 6px;
}
.race-card > .card-head a { color: var(--head-ink); font-weight: 700; font-size: 14px; }
.runner { border-top: 1px solid var(--line); padding: 2px 4px 3px; }
.race-card > .runner:first-child, .race-card > .card-head + .runner { border-top: 0; }
.runner .who { display: flex; flex-wrap: wrap; gap: 1px 10px; align-items: baseline; }
.runner .dog { font-weight: 700; font-size: 13px; }
.runner.bitch .dog a { color: var(--bitch); }
.runner .dim, .runner.vacant .dog { color: var(--dim); }
.runner .mark { font-weight: 700; color: var(--trial); }
.runner.non-runner .dog a { text-decoration: line-through; }
.runner.non-runner .form { opacity: 0.6; }
.runner .handicap { font-weight: 700; }
.form { border-collapse: collapse; width: 100%; margin-top: 1px; font-variant-numeric: tabular-nums; }
.form th {
  text-align: left; font-weight: 600; color: var(--dim); font-size: 10px;
  border-bottom: 1px solid var(--line); padding: 0 3px; white-space: nowrap;
}
.form td { padding: 0 3px; white-space: nowrap; }
.form td.remarks { white-space: normal; }
.form tbody tr:nth-child(even) td { background: var(--band); }
.form tr.trial td { color: var(--trial); }
.form .n { text-align: right; }
.form .trap { min-width: 16px; font-size: 11px; padding: 0 2px; }
.runner .more { display: none; }
@media (max-width: 640px) {
  .form .x { display: none; }
  .runner .more { display: inline; }
  .runner .more summary {
    cursor: pointer; border: 1px solid var(--line); background: var(--band);
    border-radius: var(--radius); padding: 0 6px;
  }
  .runner:has(.more[open]) .form .x { display: table-cell; }
  .runner:has(.more[open]) .scroll { overflow-x: auto; }
  .runner:has(.more[open]) .form td.remarks { white-space: nowrap; }
}
@media print { .runner .more { display: none; } }

/* GHRC-q0fh8r: track details */
.track-details { margin: 2px 0; font-size: .85em; color: var(--dim); }
.track-configs { border-collapse: collapse; }
.track-configs th, .track-configs td { padding: 1px 8px; text-align: left; }
.track-configs td:nth-child(n+2):nth-child(-n+6) { text-align: right; }
.track-configs tr.former { color: var(--dim); font-style: italic; }

/* GHRC-mm5zfn: meeting cards (all runners, two columns) */
.mc-list { column-count: 2; column-gap: 24px; }
.mc-race { break-inside: avoid; margin: 0 0 8px; }
.mc-race h2 {
  display: flex; flex-wrap: wrap; gap: 0 12px; align-items: baseline; margin: 0;
  font-size: 13px; background: var(--head); color: var(--head-ink); padding: 2px 6px;
}
.mc-race h2 a { color: var(--head-ink); font-weight: 700; }
.mc-runners { border-collapse: collapse; width: 100%; }
.mc-runners td { padding: 0 4px; border-bottom: 1px solid var(--line); }
.mc-runners td.dog { font-weight: 700; width: 50%; }
.mc-runners tr.non-runner td.dog a { text-decoration: line-through; }
.mc-runners .mark { color: var(--trial); }
@media (max-width: 640px) { .mc-list { column-count: 1; } }

/* GHRC-hpgn14: trap statistics */
.trap-filter { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: end; margin-bottom: var(--gap); }
.trap-filter label { display: grid; gap: 1px; color: var(--dim); }
.trap-matrix { border-collapse: collapse; }
.trap-matrix th, .trap-matrix td { padding: 1px 8px; text-align: right; font-weight: normal; }
.trap-matrix th { color: var(--dim); }
.trap-matrix td { font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line); }
.trap-stats .dim { color: var(--dim); }

/* GHRC-t6ey32: Fast Times */
.fast-filter { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: end; margin: 4px 0; }
.fast-filter label { display: flex; flex-direction: column; font-size: 11px; color: var(--dim); }
.fast-filter label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 3px; color: var(--ink); font-size: 12px; }
.fast-filter input[type="number"] { width: 5em; }
.fast-default { margin: 2px 0; }
.fast-range { color: var(--dim); margin: 4px 0; }
.fast-grid { border-collapse: collapse; }
.fast-grid th, .fast-grid td { padding: 1px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.fast-grid th { background: var(--band); font-weight: 600; }
.fast-grid tbody tr:nth-child(even) td { background: var(--band); }
.fast-grid .num { text-align: right; font: var(--font-mono); }
.fast-grid .time { font-weight: 700; }
@media (max-width: 640px) { .fast-grid { display: block; overflow-x: auto; } }

/* GHRC-p6s6pg: name search (top bar field, result list, result page) */
header.site form.site-search { position: relative; }
header.site form.site-search input {
  font: inherit; padding: 2px 4px; width: 14rem; max-width: 60vw;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.search-results {
  position: absolute; top: 100%; left: 0; z-index: 10; min-width: 100%; width: max-content;
  max-width: min(32rem, 94vw); max-height: 70vh; overflow-y: auto;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
}
.search-results:empty { display: none; }
.search-list { padding: 2px 6px 4px; }
.search-list h2 { font-size: 11px; color: var(--dim); margin: 4px 0 1px; }
.search-list ul { list-style: none; margin: 0; padding: 0; }
.search-list li { padding: 1px 0; }
header.site .search-list a { color: var(--link); }
.search-list a.bitch, header.site .search-list a.bitch { color: var(--bitch); }
.search-list .dim, .search-page .dim, .search-list .now { color: var(--dim); }
.search-list p { margin: 4px 0 0; }
.search-list.in-page { padding: 0; }
.search-page .search-form { display: flex; gap: var(--gap); margin: 0 0 4px; }
.search-page .search-form input {
  font: inherit; padding: 4px; width: 20rem; max-width: 70vw;
  border: 1px solid var(--line); border-radius: var(--radius);
}

/* GHRC-jxj9f4: runner statistics and flags on the race card */
.runner .stats { display: flex; flex-wrap: wrap; gap: 0 10px; color: var(--dim); font-size: 11px; }
.runner .stats .trainer-stats span { margin-left: 4px; }
.runner.newcomer .dog { text-decoration: underline; }
.runner .flag { font-weight: 700; font-size: 10px; border: 1px solid currentColor; padding: 0 2px; }
.runner .same-trainer { font-weight: 700; background: var(--line); }

/* GHRC-t11m3b: offspring of a dog */
.dog-grid { border-collapse: collapse; font-size: 12px; }
.dog-grid th, .dog-grid td { padding: 1px 8px; text-align: left; white-space: nowrap; }
.dog-grid th { color: var(--dim); font-weight: normal; }
.dog-grid td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* GHRC-n4y56j: trap draws of open races */
.trap-draw-meeting h2 { margin-bottom: 2px; }

/* GHRC-a7dhx3: Meeting Races view */
.races-grid { border-collapse: collapse; font-size: 12px; width: 100%; }
.races-grid th, .races-grid td { padding: 1px 4px; text-align: left; white-space: nowrap; }
.races-grid tbody tr { border-top: 1px solid var(--line); }
.races-grid td.finisher { min-width: 9rem; }
.races-grid .run-time { margin-left: 4px; color: var(--dim); font-variant-numeric: tabular-nums; }
.races-grid .dead-heat .mark { font-weight: 700; }
.races-grid .video { width: 1.5rem; }
.races-grid tr.state-void, .races-grid tr.state-abandoned { color: var(--dim); }
.meeting-races { overflow-x: auto; }

/* GHRC-1n9hb0: Matches (grid of earlier races, highlight of match form lines on the card) */
.form tbody tr.match td { background: #fff3b0; }
.form tbody tr.match td:first-child { box-shadow: inset 3px 0 0 #d9a400; }
.match-grid { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.match-grid th, .match-grid td { padding: 0 4px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.match-grid th { text-align: left; background: var(--band); font-weight: 600; vertical-align: bottom; }
.match-grid .n { text-align: right; }
.match-grid .trap { min-width: 16px; font-size: 11px; padding: 0 2px; }
.match-grid th.mx-dog { white-space: normal; min-width: 7rem; }
.match-grid th .mark { color: var(--dim); font-weight: 400; }
.match-grid tr.trial td { color: var(--trial); }
.match-grid tbody tr:nth-child(even) td { background: var(--band); }
.match-grid .mx-extra { display: none; color: var(--dim); white-space: normal; font-size: 11px; }
.matches:has(.mx-more:checked) .mx-extra { display: block; max-width: 12rem; }
.matches .mx-toggle { display: inline-block; margin: 2px 0; color: var(--dim); }
.match-grid a.bitch { color: var(--bitch); }
.matches .scroll { overflow-x: auto; }

/* GHRC-q5vw3k: Two Dog Matches */
.two-dog-fields { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 4px 0; }
.two-dog-field { min-width: 16rem; }
.two-dog-field .label { color: var(--dim); margin-right: 4px; }
.two-dog-field .change { margin-left: 6px; font-size: 11px; }
.two-dog-candidates .search-list { padding: 2px 0; }
.two-dog-summary { margin: 4px 0; }
.two-dogs .warn { color: #a00; margin: 2px 0; }

/* GHRC-wxdca3: all races of one dog as a meeting grid */
.races-grid td.me { background: #fff3b0; font-weight: 600; }
.races-grid td.date, .races-grid td.track { white-space: nowrap; }
.dog-results { overflow-x: auto; }

/* GHRC-8ts9ge: Third Dog Matches (list of third dogs above the Matches grid) */
.third-dog-list { border-collapse: collapse; margin: 2px 0 6px; }
.third-dog-list th, .third-dog-list td { padding: 0 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.third-dog-list th { text-align: left; background: var(--band); font-weight: 600; }
.third-dog-list .n { text-align: right; }
.third-dog-list .trap { min-width: 16px; font-size: 11px; padding: 0 2px; }
.third-dog-list tr.selected td { background: #fff3b0; }
.third-dog-list a.bitch, .third-dog-list strong.bitch { color: var(--bitch); }

/* GHRC-e0b71k: phone layout (ADR-0002; the prototype GHRC-0zwzbq): navigation, day views,
   result, greyhound page and race card at 380 px with no horizontal scroll of the page.
   A wide table shows its main columns; "All columns" (details.cols, no server request) shows
   the others in a scroll area of the table. The race card has its rules in GHRC-99xc3x. */
details.cols { display: none; }
@media (max-width: 640px) {
  /* Header: the search field gets a full line, so its result list stays in the screen. */
  header.site { gap: 4px 10px; }
  header.site form.site-search { flex: 1 1 100%; order: 1; }
  header.site form.site-search input { width: 100%; max-width: none; }
  .views, .day-views { flex-wrap: wrap; gap: 2px 10px; }
  .venue-menu { grid-template-columns: 1fr; }
  .track-select fieldset { min-inline-size: 0; }

  details.cols { display: block; margin: 2px 0; }
  details.cols summary {
    display: inline-block; cursor: pointer; border: 1px solid var(--line);
    background: var(--band); border-radius: var(--radius); padding: 0 6px;
  }
  .scroll, .results { overflow-x: auto; }
  .results { display: block; }

  /* Result lines: Pos, Dog, SP, Time, Dist. */
  .result-lines .x { display: none; }
  details.cols[open] + .result-lines .x { display: table-cell; }

  /* Day results: Time, Winner, SP, First three. */
  .results .x { display: none; }
  .day-results:has(> details.cols[open]) .results .x { display: table-cell; }

  /* Form of a greyhound: Date, Track, Dis, the video mark, Trp, Fin, By, Grd, Time (as the
     race card). The cells have no class (tests compare the cell markup), so the rule uses
     the position (GHRC-n8necv: the video column is column 4). */
  .form-grid :is(th, td):is(:nth-child(n+6):nth-child(-n+10), :nth-child(n+13):nth-child(-n+18)) {
    display: none;
  }
  details.cols[open] + .scroll .form-grid :is(th, td):is(:nth-child(n+6):nth-child(-n+10), :nth-child(n+13):nth-child(-n+18)) {
    display: table-cell;
  }
  details.cols[open] + .scroll .form-grid td:nth-child(14) { white-space: nowrap; }
}
@media print { details.cols { display: none; } }

/* GHRC-5y7zmn: video player (mark in a grid row, player, full window) */
.video-mark { text-decoration: none; font-size: 0.85em; }
.video-slot:empty { display: none; }
.video-player { margin: 6px 0; }
.video-player iframe, .video-player video { display: block; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; background: #000; border: 0; }
.video-player .vp-toggle { color: var(--dim); }
.video-player:has(.vp-full:checked) { position: fixed; inset: 0; z-index: 100; margin: 0; padding: 4px; background: #000; }
.video-player:has(.vp-full:checked) .vp-toggle, .video-player:has(.vp-full:checked) figcaption a { color: #ddd; }
.video-player:has(.vp-full:checked) iframe, .video-player:has(.vp-full:checked) video { max-width: none; width: 100%; height: calc(100% - 3em); aspect-ratio: auto; }

/* GHRC-5y7zmn: video player (mark in a grid row, player, full window) */
.video-mark { text-decoration: none; font-size: 0.85em; }
.video-slot:empty { display: none; }
.video-player { margin: 6px 0; }
.video-player iframe, .video-player video { display: block; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; background: #000; border: 0; }
.video-player .vp-toggle { color: var(--dim); }
.video-player:has(.vp-full:checked) { position: fixed; inset: 0; z-index: 100; margin: 0; padding: 4px; background: #000; }
.video-player:has(.vp-full:checked) .vp-toggle, .video-player:has(.vp-full:checked) figcaption a { color: #ddd; }
.video-player:has(.vp-full:checked) iframe, .video-player:has(.vp-full:checked) video { max-width: none; width: 100%; height: calc(100% - 3em); aspect-ratio: auto; }

/* GHRC-ww23kt: split view (templates/split.html, static/js/split.js). The page fills the
   window; two panes side by side, each a frame with a bar (Back, Forward, links to the other
   pane, open alone). A narrow screen shows one pane, the tabs select it. A page in a pane
   (html.in-pane) has no site header: the split page shows it once. */
html.in-pane header.site { display: none; }
body:has(> main > .split-view) { display: flex; flex-direction: column; height: 100vh; }
main:has(> .split-view) { flex: 1; min-height: 0; padding: 4px; }
.split-view { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; gap: 4px; height: 100%; }
.split-tabs { display: none; margin: 0; gap: 4px; }
.split-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.split-bar { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; padding: 2px 4px; background: var(--band); border-bottom: 1px solid var(--line); }
.split-bar button, .split-tabs button { font: inherit; padding: 0 6px; }
.split-bar button[aria-pressed="true"], .split-tabs button[aria-pressed="true"] { background: var(--head); color: var(--head-ink); }
.split-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.split-refused { margin: 4px; color: #a00; }
.split-pane iframe { flex: 1; width: 100%; min-height: 0; border: 0; }
@media (max-width: 899px) {
  .split-view { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .split-tabs { display: flex; }
  .split-pane:not(.active) { display: none; }
}
@media print { .split-bar, .split-tabs { display: none; } }

/* GHRC-w4arv2: print on A4 (the print function of the browser; no PDF from the server).
   Print targets: the race card (/race/{id}), the full meeting (/meeting/{id}/full), the
   meeting cards (/meeting/{id}/cards) and the trap draws of a meeting
   (/meeting/{id}/trap-draws). The page rules:
   - No header bar, navigation, search, forms or "More" / "All columns" controls.
   - All columns of the desktop, also on a narrow paper size (the phone rules do not hide them).
   - A runner block never breaks over two pages. A card that is longer than a page continues
     on the next page between two runner blocks; the head of a card stays with its first runner.
   - Full meeting: each race card starts on a new page (one race on one sheet).
   - Meeting cards and trap draws: two columns; a race block does not break (GHRC-mm5zfn).
   - Trap colours print also with no "background graphics" (print-color-adjust: exact); the
     dark head bars print as dark text with a line, not as a dark area. */
@page { size: A4 portrait; margin: 10mm; }
@media print {
  :root { --font: var(--size-small) / 1.2 var(--font-text); }
  header.site, nav, form, details.more, details.cols, .race-facts > a { display: none !important; }
  .page { padding: 0; }
  a { color: inherit; }
  h1 { font-size: 14px; margin: 0 0 4px; }
  h1, .race-facts, .track-details { break-after: avoid; }
  .trap, .form tbody tr.match td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .trap { font-size: 11px; }
  .race-card { break-inside: auto; border: 0; margin: 0 0 6px; }
  .race-card > .card-head, .mc-race h2 {
    background: none; color: var(--ink); border-bottom: 2px solid var(--head); padding: 0 2px;
    break-after: avoid;
  }
  .race-card > .card-head a, .mc-race h2 a { color: var(--ink); }
  .meeting-full .race-card + .race-card { break-before: page; }
  .runner { break-inside: avoid; }
  .runner .dog { font-size: 11px; }
  .scroll { overflow: visible; }
  .form td, .form th { padding: 0 2px; }
  .form .x, .result-lines .x, .results .x { display: table-cell; }
}

/* GHRC-f0jbmg: day lists like the old lists (title bar, two columns of venue blocks, one race
   on each line with the red time and the label, results columns) */
:root { --time-red: #c00; }
.day h1.title-bar {
  background: var(--head); color: var(--head-ink); text-align: center; font-size: 14px;
  padding: 4px 8px; margin: 6px 0 4px;
}
.day h1.title-bar .region { color: var(--head-ink); opacity: 0.7; font-size: 11px; }
.venue-menu.race-lists { display: block; column-count: 2; column-gap: 24px; margin-top: 4px; }
.venue-menu.race-lists .empty, .venue-menu.race-lists .hint { column-span: all; }
.race-lists .menu-meeting {
  break-inside: avoid; border: 0; border-bottom: 1px dotted var(--dim); border-radius: 0;
  padding: 2px 0 4px; margin: 0 0 8px;
}
.race-lists .menu-meeting h2 {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; text-transform: uppercase; margin: 4px 0;
}
.race-lists .print-link { font-size: 11px; font-weight: 400; text-transform: none; }
.race-lines { list-style: none; margin: 0; padding: 0 0 0 8px; }
.race-lines li { padding: 1px 0; overflow-wrap: anywhere; }
.race-lines .rt { color: var(--time-red); font-variant-numeric: tabular-nums; margin-right: 6px; }
.race-lines .rl { color: var(--ink); text-decoration: none; }
.race-lines .rl:hover { text-decoration: underline; }
.race-lines .state { margin-left: 8px; }
.race-lines li.trial .rl { color: var(--trial); }
.race-lists .more, .result-meeting .more { margin: 4px 0 0; }
.race-lists .more a, .result-meeting .more a { color: var(--time-red); }
.result-meeting { border-bottom: 1px dotted var(--dim); padding-bottom: 4px; margin-bottom: 8px; }
.result-meeting h2 { text-transform: uppercase; }
.results .time { white-space: nowrap; }
.results .rt { color: var(--time-red); }
.results .video-mark { color: var(--ink); margin-right: 3px; }
.results .former { color: var(--dim); }
.results td.num { text-align: right; font-variant-numeric: tabular-nums; }
.day-results .results { width: 100%; }
.race-lists .menu-meeting h2 { font-weight: 700; }
@media (max-width: 640px) {
  .venue-menu.race-lists { column-count: 1; }
}
@media print { .race-lists .print-link { display: none; } }

/* GHRC-j87820: grids like the old grids (band of the selected race, row of the race itself,
   width of one pane). A click on a grid row (tr[hx-get]) puts the band of that race below the
   grid (_race_band.html); the selected row is grey, as in the old grids. Meeting Races and
   Greyhound Results: a fixed layout (colgroup), so that six place columns fit in 960 px (and
   in one pane of the split view at 1920 px); a long name is cut with "..." (the full name and
   the time are in the title of the cell). Matches: a dog name in the column head can break. */
.band-grid tbody tr[hx-get] { cursor: pointer; }
.band-grid tbody tr[hx-get]:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.band-grid tbody tr.selected td { background: var(--line); }
.match-grid tr.own td { font-weight: 600; }
.match-grid th.mx-dog { min-width: 0; }
.match-grid th.mx-dog .mark { margin-left: 0.3em; }
.races-grid { table-layout: fixed; }
.races-grid col.c-date { width: 5.8em; }
.races-grid col.c-track { width: 5.6em; }
.races-grid col.c-time { width: 3.4em; }
.races-grid col.c-dis { width: 3.6em; }
.races-grid col.c-gd { width: 2.8em; }
.races-grid col.c-gg { width: 2.6em; }
.races-grid col.c-video { width: 1.4em; }
.races-grid td.finisher { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.races-grid td.date, .races-grid td.track { overflow: hidden; text-overflow: ellipsis; }

.race-band:empty { display: none; }
.race-band { margin: 4px 0 6px; }
.race-band-grid { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 11px; font-variant-numeric: tabular-nums; }
.race-band-grid th, .race-band-grid td { border: 1px solid var(--line); padding: 1px 3px; text-align: center; vertical-align: middle; overflow: hidden; }
.race-band-grid th { background: var(--band); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.race-band-grid th.rb-race { width: 6.4em; }
.race-band-grid th:nth-child(2) { width: 3.6em; }
.race-band-grid th:nth-child(3) { width: 2.8em; }
.race-band-grid th:nth-child(4) { width: 2.8em; }
.race-band-grid th.video { width: 1.4em; }
.race-band-grid td.rb-race > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race-band-grid td.rb-state { text-align: left; }
.rb-cell { display: grid; grid-template-columns: auto 1fr 1fr; grid-template-areas: "trap fin time" "trap by sec" "rem rem rem"; gap: 0 3px; align-items: center; }
.rb-trap { grid-area: trap; }
.rb-fin { grid-area: fin; }
.rb-time { grid-area: time; }
.rb-by { grid-area: by; }
.rb-sec { grid-area: sec; }
.rb-rem { grid-area: rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid var(--line); }
.rb-links { margin: 2px 0; font-size: 11px; display: flex; gap: 8px; }
@media (max-width: 640px) {
  .races-grid { table-layout: auto; }
  .races-grid td.finisher { min-width: 8rem; }
  .race-band { overflow-x: auto; }
  .race-band-grid { min-width: 36rem; }
}
@media print { .race-band, .rb-links { display: none; } }

/* GHRC-cqjh4j: trainer page by the old trainer tab (totals line, kennel grid with BG) */
.trainer .trainer-totals { margin: 8px 0; font-size: 12px; }
.trainer .trainer-totals span { margin-right: 6px; white-space: nowrap; }
.trainer .trainer-kennel { overflow-x: auto; }

/* GHRC-88ekwa: race card like the old card (UserInterface/Race_HeaderControl.xaml,
   Race_FooterControl.xaml, Race_LineControl.xaml, ResourceDictionary1.xaml): the dark header
   bar with the white centre, the row "Previous Race" / "Next Race", the runner block as a
   grid (trap and name, records and "Bst:", trainer; the profile line; the form lines). The
   div "who" of a block is display: contents, so its parts are cells of the grid. */
.race-card { border: 0; }
.race-card > .card-head {
  display: grid; grid-template-columns: minmax(0, 70fr) minmax(0, 180fr) minmax(0, 70fr);
  gap: 0; padding: 3px; background: var(--card-bar); color: var(--card-bar-ink);
}
.race-card > .card-head a { color: inherit; font-weight: inherit; font-size: inherit; }
.race-card .bar-when {
  display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 0 6px;
  padding: 1px 4px; font-weight: 700; font-size: var(--size-title); line-height: 1.5;
}
.race-card .bar-card, .race-card .bar-dist { text-align: right; }
.race-card .bar-race {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0 8px;
  background: var(--bg); color: var(--ink); padding: 1px 8px;
  font-weight: 700; font-size: var(--size-title); line-height: 1.5;
}
.race-card .bar-venue { font-size: inherit; margin: 0; }
.race-card .bar-grade { text-align: right; }
.race-card .bar-label { grid-column: 1 / -1; text-align: center; }
.race-card .bar-side {
  display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; justify-content: flex-end;
  padding: 1px 6px; font-size: var(--size-text);
}
.race-card .bar-matches { font-weight: 700; }
.race-card .bar-print { display: inline-flex; line-height: 0; color: inherit; }
.race-card .bar-print svg { width: 24px; height: 24px; }
.race-card .bar-print:hover svg { width: 30px; height: 30px; margin: -3px; }
.race-card .race-nav {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin: 3px 0 0; padding: 8px 10px 8px; min-height: 34px; background: var(--old-band);
  border: 1px solid var(--old-band-line); font-size: var(--size-text);
}
.race-card .race-nav a { color: var(--old-red); }
.race-card .race-nav a:hover { text-decoration: none; font-weight: 700; }
.race-card .race-nav a.race-nav-meeting { color: var(--link); }

.race-card .runner {
  display: grid;
  grid-template-columns: auto minmax(0, 310fr) minmax(0, 270fr) minmax(0, 220fr);
  grid-template-areas:
    "trap name stats trainer"
    "trap ex stats trainer"
    "profile profile profile profile"
    "form form form form";
  gap: 0 6px; align-items: start; background: var(--old-block); padding: 2px 2px 3px;
  font-size: var(--size-small);
}
.race-card .runner .who { display: contents; }
.race-card .runner .who > .trap {
  grid-area: trap; width: var(--trap-big-w); height: var(--trap-big-h); min-width: 0; padding: 0;
  margin-left: 2px; font-size: var(--size-trap-big); line-height: var(--trap-big-h);
}
.race-card .runner .name-line {
  grid-area: name; display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline;
}
.race-card .runner .dog { font: 700 var(--size-name) / 1.3 var(--font-text); }
.race-card .runner .dog a, .race-card .runner.bitch .dog a { color: var(--ink); }
.race-card .runner.in-season .dog a, .race-card .runner .season-weeks { color: var(--old-red); }
.race-card .runner.struck .dog a, .race-card .runner.struck .ex { text-decoration: line-through; }
.race-card .runner .mark { font-size: 10px; }
.race-card .runner .flag {
  color: var(--old-green-dark); font-style: italic; border: 0; padding: 0; font-size: 11px;
}
.race-card .runner.newcomer .dog { text-decoration: none; }
.race-card .runner .ex { grid-area: ex; font-weight: 700; font-size: var(--size-small); }
.race-card .runner .profile {
  grid-area: profile; display: flex; flex-wrap: wrap; gap: 0 5px; align-items: baseline;
  font-size: var(--size-tiny);
}
.race-card .runner .profile .sex, .race-card .runner .dob, .race-card .runner .season,
.race-card .runner .season-weeks { font-size: var(--size-small); }
.race-card .runner .profile a { color: inherit; }
.race-card .runner.bitch .sex { color: var(--old-red); }
.race-card .runner.dog .sex { color: var(--old-blue); }
.race-card .runner .dob.young { color: var(--old-orange); font-weight: 700; }
.race-card .runner .dob.old { color: var(--old-purple); font-weight: 700; }
.race-card .runner .season { font-weight: 700; }
.race-card .runner .stats { grid-area: stats; display: block; color: var(--ink); font-size: var(--size-small); }
.race-card .runner .records { display: flex; flex-wrap: wrap; gap: 0 4px; }
.race-card .runner .rec.hi { color: var(--old-red); }
.race-card .runner .rec.mid { color: var(--old-blue); }
.race-card .runner .best { display: block; }
.race-card .runner .trainer-box {
  grid-area: trainer; display: flex; flex-direction: column; align-items: flex-end;
  font-size: var(--size-small); text-align: right;
}
.race-card .runner .trainer { font-weight: 700; }
.race-card .runner .trainer a { color: inherit; }
.race-card .runner .same-trainer { background: none; }
.race-card .runner .tc1 { color: var(--old-red); }
.race-card .runner .tc2 { color: var(--old-green); }
.race-card .runner .tc3 { color: var(--old-slate); }
.race-card .runner .tc4 { color: var(--old-aqua); }
.race-card .runner .pct { margin-left: 4px; }
.race-card .runner .pct.low, .race-card .runner .session { color: var(--old-red); }
.race-card .runner .scroll { grid-area: form; }
.race-card .runner.non-runner .form { opacity: 1; }
.race-card .form { font: var(--size-grid) / 1.2 var(--font-narrow); margin-top: 2px; }
.race-card .form th {
  background: var(--old-head-cell); text-align: center; color: var(--ink); font-weight: 400;
  font-size: var(--size-grid); border-bottom: 0; border-right: 1px solid var(--old-head-line);
  height: 20px; padding: 0 3px;
}
.race-card .form tbody td { background: var(--old-row-a); height: var(--row-h); padding: 0 3px; }
.race-card .form tbody tr:nth-child(even) td { background: var(--old-row-b); }
.race-card .form tbody tr.match td { background: var(--old-match); }
.race-card .form td, .race-card .form .n { text-align: center; }
.race-card .form td:nth-child(1), .race-card .form td:nth-child(12), .race-card .form td:nth-child(13) { text-align: left; }
/* The old links are black and turn red on hover (RedHighlightTextBlock, xaml:3347); no bold here: a wider text moves the grid. */
.race-card .runner a:hover, .race-card .form a:hover { color: var(--old-red); text-decoration: none; background: var(--old-hover); }
.race-card .form .trap {
  width: var(--trap-grid-w); min-width: 0; height: 18px; padding: 0; margin: 0;
  font-size: var(--size-trap-grid); line-height: 18px;
}
/* Same columns in each block, as the grid of the old card (Race_LineControl.xaml:781 to 1470:
   star widths 1.1, 1.4, 1, 1, 1, 0.7, 0.9, 2.5, 2.5, 1, 1.1, 1, 0.8, 1; fixed Dis 34, Video 20,
   Trp 26, Tr 18 px, written as percent of a 900 px table). GHRC-n8necv: the video column is
   column 4; the two widest columns (Win/Sec, Remarks) gave its width. Only for a wide window:
   a phone shows fewer columns. */
@media (min-width: 641px) {
  .race-card .form { table-layout: fixed; }
  .race-card .form td { overflow: hidden; text-overflow: clip; }
  .race-card .form td.remarks { white-space: nowrap; }
  .race-card .form th:nth-child(1) { width: 5.6%; }
  .race-card .form th:nth-child(2) { width: 7.2%; }
  .race-card .form th:nth-child(3) { width: 3.8%; }
  .race-card .form th:nth-child(4) { width: 2.2%; }
  .race-card .form th:nth-child(5) { width: 2.9%; }
  .race-card .form th:nth-child(6) { width: 4.1%; }
  .race-card .form th:nth-child(7) { width: 5.1%; }
  .race-card .form th:nth-child(8) { width: 5.1%; }
  .race-card .form th:nth-child(9) { width: 5.1%; }
  .race-card .form th:nth-child(10) { width: 3.6%; }
  .race-card .form th:nth-child(11) { width: 4.6%; }
  .race-card .form th:nth-child(12) { width: 11.7%; }
  .race-card .form th:nth-child(13) { width: 11.7%; }
  .race-card .form th:nth-child(14) { width: 2%; }
  .race-card .form th:nth-child(15) { width: 5.1%; }
  .race-card .form th:nth-child(16) { width: 5.6%; }
  .race-card .form th:nth-child(17) { width: 5.1%; }
  .race-card .form th:nth-child(18) { width: 4.1%; }
  .race-card .form th:nth-child(19) { width: 5.1%; }
}
.race-card .form tbody tr.match td:first-child { box-shadow: none; }
.race-card .form tr.trial td { color: inherit; }
.race-card .form a { color: inherit; }
.race-card .form a.gap { text-decoration: overline; }
.race-card .form a.am::after {
  content: "am"; margin-left: 1px; font-size: 8px; color: var(--old-red);
}
.race-card .form td.wgt-change { color: var(--old-red); }
@media (max-width: 640px) {
  .race-card > .card-head { grid-template-columns: auto minmax(0, 1fr); }
  .race-card .bar-when, .race-card .bar-race { font-size: 13px; }
  .race-card .bar-side { grid-column: 1 / -1; justify-content: flex-start; }
  .race-card .runner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "trap name more"
      "trap ex ex"
      "profile profile profile"
      "stats stats stats"
      "trainer trainer trainer"
      "form form form";
  }
  .race-card .runner .more { grid-area: more; }
  .race-card .runner .trainer-box { flex-flow: row wrap; gap: 0 8px; align-items: baseline; }
}
@media print {
  .race-card > .card-head { background: none; color: var(--ink); padding: 0 2px; }
  .race-card .bar-race { background: none; }
  .race-card .bar-side a { display: none; }
  .race-card .runner { background: none; }
  .race-card .runner .who > .trap {
    font-size: 14px; line-height: 18px; width: auto; height: auto; min-width: 20px; margin-left: 0;
  }
  .race-card .runner .dog { font-size: 12px; }
  /* The old grid is a screen grid: on paper the rows have no fixed height and the table has
     the automatic layout, so one race card fits on one page. */
  .race-card > .card-head { line-height: 1.25; }
  .race-card .bar-when, .race-card .bar-race { line-height: 1.25; }
  .race-card .form { table-layout: auto; }
  .race-card .form td, .race-card .form th, .race-card .form tbody td { height: auto; overflow: visible; }
  .race-card .form td.remarks { white-space: normal; }
  .race-card .form .trap { width: auto; min-width: 14px; height: auto; line-height: 14px; }
}

/* GHRC-e82aje: void races (one rule). The runners of the card are green, as the old grid
   (finish "not recorded"); a vacant trap is green too. The word Void is bold in the Gg column. */
:root { --card-run: #0a7a0a; }
.card-run, .card-run a, .state-void .result-lines tr.card-run td, .state-void .result-lines tr.card-run a {
  color: var(--card-run); text-decoration: none; }
.races-grid tr.state-void, .races-grid tr.state-abandoned { color: inherit; }
.races-grid td.going-void { font-weight: 700; }
.result-lines tr.vacant td { font-style: italic; }
.races-grid td.vacant { font-style: italic; }

/* GHRC-5th3nw: greyhound page like the Greyhound tab; form marks of the race card */
.dog-profile .sex, .dog-profile dd.ex, .dog-profile dd.season { font-weight: 700; }
.dog-profile .sex.dog { color: var(--old-blue); }
.dog-profile .sex.bitch { color: var(--old-red); }
.form-grid a.gap { text-decoration: overline; }
.form-grid a.am::after { content: "am"; margin-left: 1px; font-size: 8px; color: var(--old-red); }
.form-grid td.wgt-change { color: var(--old-red); }

/* GHRC-naa6sd: settings page, line of the rule of the card statistics */
.settings-form { display: grid; gap: 10px; max-width: 40rem; }
.settings-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); min-inline-size: 0; }
.settings-form fieldset label { display: block; }
.settings-form .setting-tracks { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.settings .notice { color: var(--ok, #0a7a0a); font-weight: 700; margin: 0 0 8px; }
.race-card .stats-rule { margin: 0; padding: 1px 4px; font-size: 11px; color: var(--dim); }
@media print { .race-card .stats-rule a { display: none; } }

/* GHRC-h7a8wm: grids and other pages like the old controls. The values come from the shared
   properties of GHRC-qnzytd; the sources are named at each rule. A grid of the old application
   is a WPF DataGrid: 11 px text (AlternatingDataGridRow, ResourceDictionary1.xaml:3016), header
   cells with the pale gradient and a pale line between them, no line in the body, the rows
   #f0f0f0 and #e8e8e8 (xaml:3020), the selected row #c0c0c0 (HighlightDataGridRow, xaml:3236),
   black text (DataGridCellStyle, xaml:3260) that turns red under the mouse (RedNameStyle,
   xaml:5491). These rules come last, so they win over the first versions of the same grids. */
:root {
  --old-selected: #c0c0c0;    /* selected row: HighlightDataGridRow, ResourceDictionary1.xaml:3249 */
  --old-input-line: #abadb3;  /* border of a text box (WPF default; sampled in 10-greyhound-tab.png) */
  --old-input-bg: #e5e5e5;    /* combo box and button (WPF default; sampled in 11-statistics-tab.png) */
  --grid-row-h: 20px;         /* row of the big grids (screenshot 03: a row pitch of 20 px) */
  --old-light-gray: lightgray; /* alternate row of the Fast Times grid (StatsControl.xaml:88) */
}

/* Header cell, one rule for all grids. */
.races-grid th, .match-grid th, .race-band-grid th, .form-grid thead th, .dog-grid th,
.third-dog-list th, .fast-grid th, .trap-matrix th, .result-lines th {
  background: var(--old-head-cell); color: var(--ink); font-weight: 400; text-align: center;
  border: 0; border-right: 1px solid var(--old-head-line); border-bottom: 1px solid var(--old-head-line);
  height: 20px; padding: 0 3px; vertical-align: middle;
}
.races-grid th:last-child, .match-grid th:last-child, .form-grid thead th:last-child,
.dog-grid th:last-child { border-right: 0; }

/* Cells: one black text, a link is black and red under the mouse (no bold: it moves the grid). */
.races-grid, .match-grid, .third-dog-list { font: var(--size-grid) / 1.2 var(--font-text); }
.races-grid td, .match-grid td, .third-dog-list td { height: var(--grid-row-h); padding: 0 3px; text-align: center; border: 0; }
.races-grid a, .match-grid a, .third-dog-list a, .race-band-grid a, .form-grid a, .dog-grid a,
.fast-grid a, .result-lines a { color: inherit; }
.races-grid a:hover, .match-grid a:hover, .third-dog-list a:hover, .race-band-grid a:hover,
.form-grid a:hover, .dog-grid a:hover, .fast-grid a:hover, .result-lines a:hover {
  color: var(--old-red); text-decoration: none; background: var(--old-hover);
}
.races-grid tbody tr, .match-grid tbody tr { border-top: 0; }
.races-grid tbody td, .match-grid tbody td, .third-dog-list tbody td { background: var(--old-row-a); border-bottom: 0; }
.races-grid tbody tr:nth-child(even) td, .match-grid tbody tr:nth-child(even) td,
.third-dog-list tbody tr:nth-child(even) td { background: var(--old-row-b); }
.band-grid tbody tr.selected td, .third-dog-list tr.selected td { background: var(--old-selected); }
.races-grid, .match-grid { border: 1px solid var(--old-grid-line); }
.match-grid { width: 100%; }

/* Meeting Races and Greyhound Results (MeetingResultControl.xaml:361: DataGrid, FontSize 10, rows 11). */
.races-grid td.finisher { text-align: left; }
.races-grid td.date, .races-grid td.track { text-align: left; }
.races-grid tr.state-void, .races-grid tr.state-abandoned { color: inherit; }
.races-grid td.hint { text-align: left; color: var(--ink); }
.races-grid tbody td.me { background: var(--old-row-a); color: var(--old-red); font-weight: 400; }
.races-grid tbody tr:nth-child(even) td.me { background: var(--old-row-b); }
.band-grid tbody tr.selected td.me { background: var(--old-selected); }
.races-grid td.me a { color: var(--old-red); }
.races-grid td.dead-heat .mark { font-weight: 400; }
.races-grid .trap { width: 14px; min-width: 0; height: 18px; padding: 0; font-size: 12px; line-height: 18px; }
.races-grid td.finisher .trap { margin-right: 2px; }

/* Matches (MatchesPageControl.xaml:44, 364: DataGrid, FontSize 10; a line #688caf left of each dog
   cell; trap label 11 px). */
.match-grid .trap { width: 14px; min-width: 0; height: 18px; padding: 0; font-size: 11px; line-height: 18px; }
.match-grid th.mx-dog { border-left: 1px solid var(--old-grid-line); font-weight: 400; white-space: normal; }
.match-grid th.mx-dog a { color: inherit; }
.match-grid th.mx-dog .trap { margin-right: 2px; }
.match-grid td.mx-cell { text-align: left; border-left: 1px solid var(--old-grid-line); }
.match-grid td.mx-cell b { font-weight: 400; margin: 0 3px; }
.match-grid tr.own td { font-weight: 400; }
.match-grid tr.trial td, .match-grid a.bitch, .third-dog-list a.bitch, .third-dog-list strong.bitch { color: inherit; }
.match-grid th .mark { color: var(--ink); }
.match-grid .mx-extra { color: var(--ink); font-size: var(--size-small); }
.matches .mx-toggle { color: var(--ink); font-size: var(--size-text); }
.third-dog-list { border: 1px solid var(--old-grid-line); }
.third-dog-list td, .third-dog-list th { text-align: left; }
.third-dog-list .n, .third-dog-list th.n { text-align: center; }
.third-dog-list .trap { width: 14px; min-width: 0; height: 18px; padding: 0; font-size: 11px; line-height: 18px; margin-right: 2px; }

/* The band of the selected race (RaceDataGrid of the old Meeting Races view): a line #688caf
   between the cells, the grey #f0f0f0 behind, the header cells pale. */
.race-band-grid { font: var(--size-grid) / 1.2 var(--font-text); background: var(--old-row-a); border: 1px solid var(--old-grid-line); }
.race-band-grid th { border-top: 0; border-left: 0; }
.race-band-grid td { border: 0; border-right: 1px solid var(--old-grid-line); border-bottom: 1px solid var(--old-grid-line); }
.race-band-grid td:last-child, .race-band-grid th:last-child { border-right: 0; }
.race-band-grid .trap { width: 14px; min-width: 0; height: 18px; padding: 0; font-size: 12px; line-height: 18px; }
.rb-rem { border-top: 1px solid var(--old-grid-line); }
.rb-links { font-size: var(--size-text); }

/* Headings: venue and date, 16 px bold, black (MeetingResultControl.xaml:33, 72: the venue in
   capitals, then the date; RedHighlightTextBlock: black, red under the mouse). */
.meeting-races h1, .meeting-results h1, .race-page h1, .result h1 {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 20px; margin: 10px 0;
  font: 700 var(--size-title) / 1.3 var(--font-text); color: var(--ink);
}
.meeting-races h1 a, .meeting-results h1 a, .race-page h1 a, .result h1 a { color: var(--ink); }
.meeting-races h1 a:hover, .meeting-results h1 a:hover, .race-page h1 a:hover, .result h1 a:hover { color: var(--old-red); text-decoration: none; }
.meeting-races h1 a:first-child, .meeting-results h1 a:first-child { text-transform: uppercase; }
.race-page h1 .time, .result h1 .time { margin-left: 0; }
.meeting-races h2, .meeting-results h2.trials-head, .race-page h2 { font: 700 var(--size-text) / 1.3 var(--font-text); margin: 8px 0 2px; }
.race-page .race-facts, .result .race-facts { font-size: var(--size-text); margin: 0; }

/* Race result (Result_Details.xaml:22: DataGrid FontSize 12; position and dog name 16 bold,
   trap 14, headers in capitals, a dotted black line under each row, no other line). */
.result-lines { font: var(--size-text) / 1.25 var(--font-text); width: 100%; }
.result-lines th { text-transform: uppercase; }
.result-lines td {
  border: 0; padding: 2px 6px; white-space: nowrap; background: var(--old-dots) 0 100% / 100% 1px no-repeat;
}
.result-lines .pos { font: 700 var(--size-title) / 1.3 var(--font-text); text-align: center; }
.result-lines td.dog { font: 700 var(--size-title) / 1.3 var(--font-text); }
.result-lines td.dog .trap { font-size: var(--size-name); margin-right: 3px; }
.result-lines .num { font: inherit; text-align: center; }
.result-lines td.x:last-child { text-align: right; }
.state-void .result-lines td { color: var(--old-green); text-decoration: none; }
.state-void .result-lines tr.card-run td { color: var(--card-run); }
.result-facts, .dividends { font-size: var(--size-text); margin: 3px 0; }
.result-state { font-weight: 700; }
.result-head {
  font: 700 var(--size-text) / 1.3 var(--font-text); background: var(--old-bar); color: var(--old-bar-ink);
  border-top: 0; padding: 2px 6px;
}
.result-head a, .result-head .title, .result-head .card-link { color: inherit; font-weight: 400; }
.result-head > a:first-child { font-weight: 700; }
.race-result { margin: 8px 0 14px; }

/* Greyhound page (GreyhoundControl.xaml:211 form grid FontSize 11; the profile boxes of the
   old Greyhound tab: a label and a white text box with a thin grey line). The form grid has the
   look of the form table of the race card (narrow font, 11 px, rows of 19 px). */
.dog h1, .dog-results h1, .trainer h1 { margin: 6px 0 4px; font: 700 var(--size-title) / 1.3 var(--font-text); }
.dog h2 { font: 700 var(--size-text) / 1.3 var(--font-text); margin: 8px 0 2px; }
.dog-profile, .trainer .facts {
  display: grid; grid-template-columns: max-content minmax(0, 22em); gap: 3px 8px; align-items: center;
  margin: 6px 0; font-size: var(--size-text);
}
.dog-profile dt, .trainer .facts dt { color: var(--ink); text-align: right; }
.trainer .facts dt { font-weight: 700; }
.dog-profile dd, .trainer .facts dd {
  background: var(--bg); border: 1px solid var(--old-input-line); padding: 1px 4px; min-height: 20px;
}
.trap-wins { margin: 4px 0; font-size: var(--size-grid); }
.pager { font-size: var(--size-text); margin: 4px 0; }
.form-grid { font: var(--size-grid) / 1.2 var(--font-narrow); width: 100%; border: 1px solid var(--old-grid-line); }
.form-grid tbody td {
  background: var(--old-row-a); height: var(--row-h); padding: 0 3px; text-align: center; border: 0;
}
.form-grid tbody tr:nth-child(even) td { background: var(--old-row-b); }
.form-grid td:nth-child(1), .form-grid td:nth-child(13), .form-grid td:nth-child(14) { text-align: left; }
.form-grid tr.year th { background: var(--old-bar); color: var(--old-bar-ink); font-weight: 700; text-align: left; padding: 0 6px; height: 20px; }
.form-grid tr.trial td, .form-grid tr.void td { color: inherit; }
.form-grid .trap { width: var(--trap-grid-w); min-width: 0; height: 18px; padding: 0; margin: 0; font-size: var(--size-trap-grid); line-height: 18px; }
.form-grid td:nth-child(14) { min-width: 8rem; }

/* Grid of dogs: offspring and kennel of a trainer (GreyhoundControl.xaml:76, TrainerControl.xaml:277:
   DataGrid FontSize 11, a thin vertical line between the columns, rows of 23 px). */
.dog-grid { font: var(--size-grid) / 1.2 var(--font-text); width: 100%; border: 1px solid var(--old-border); }
.dog-grid th, .dog-grid td { height: 23px; padding: 0 5px; text-align: center; border-right: 1px solid var(--old-border-2); white-space: nowrap; }
.dog-grid th { border-bottom: 1px solid var(--old-head-line); }
.dog-grid td { background: var(--old-row-a); }
.dog-grid tbody tr:nth-child(even) td { background: var(--old-row-b); }
.dog-grid td:first-child, .dog-grid td:nth-child(2), .dog-grid td:nth-child(8), .dog-grid td:nth-child(9) { text-align: left; }
.dog-grid td.num { text-align: center; }
.dog-grid th:last-child, .dog-grid td:last-child { border-right: 0; }
.offspring-role { margin: 2px 0; font-size: var(--size-text); }
.trainer .trainer-totals { font-size: var(--size-grid); text-align: center; margin: 12px 0 6px; }
.trainer .trainer-totals span { margin-right: 6px; }
.trainer .trainer-totals th, .trainer .trainer-totals td { font-size: inherit; }

/* Statistics (StatsControl.xaml: labels bold and centred above their control, DataGrid FontSize 12,
   Fast Times with alternate rows LightGray and no line, Trap Statistics with bold cells). */
.trap-filter, .fast-filter { justify-content: center; margin: 8px 0; font-size: var(--size-text); }
.trap-filter label, .fast-filter label {
  display: flex; flex-direction: column; align-items: center; font-size: var(--size-text); font-weight: 700;
  color: var(--ink); text-align: center;
}
.fast-filter label:has(input[type="checkbox"]) { flex-direction: column-reverse; font-size: var(--size-text); color: var(--ink); gap: 2px; }
.trap-filter select, .fast-filter select, .trap-filter input, .fast-filter input, .trap-filter button,
.fast-filter button, .fast-default button, .search-form button, .two-dog-field button {
  font: 400 var(--size-text) / 1.25 var(--font-text); color: var(--ink);
}
.trap-filter select, .fast-filter select, .trap-filter button, .fast-filter button, .fast-default button {
  background: var(--old-input-bg); border: 1px solid #acacac; padding: 1px 4px; min-height: 22px;
}
.trap-filter input, .fast-filter input[type="number"], .fast-filter input[type="date"], .trap-filter input[type="date"] {
  background: var(--bg); border: 1px solid var(--old-input-line); padding: 1px 4px; min-height: 22px;
}
.fast-filter label:has(input[type="checkbox"]) input { margin: 0; }
.fast-range, .trap-stats .dim { color: var(--ink); font-size: var(--size-text); text-align: center; }
.trap-stats h1, .fast-times h1, .two-dogs h1, .search-page h1 { margin: 8px 0 6px; font: 700 var(--size-title) / 1.3 var(--font-text); }
.trap-stats h2 { font: 700 var(--size-text) / 1.3 var(--font-text); text-align: center; margin: 10px 0 6px; }
.trap-matrix { font: var(--size-text) / 1.25 var(--font-text); margin: 8px auto; border: 1px solid var(--old-border-2); }
.trap-matrix th { min-width: 42px; height: 22px; }
.trap-matrix th:first-child { min-width: 60px; }
.trap-matrix th .trap { width: 18px; min-width: 0; font-size: var(--size-text); }
.trap-matrix th.num { background: var(--bg); border-bottom: 1px solid var(--old-border-2); font-weight: 700; text-align: center; }
.trap-matrix td { text-align: center; font-weight: 700; padding: 1px 4px; border: 1px solid var(--old-border-2); }
.fast-grid { font: var(--size-text) / 1.25 var(--font-text); width: 100%; border-collapse: collapse; }
.fast-grid th.num, .fast-grid th { text-align: center; }
.fast-grid th:nth-child(2) { font-weight: 700; }
.fast-grid td { padding: 1px 6px; border: 0; text-align: left; background: var(--bg); }
.fast-grid tbody tr:nth-child(even) td { background: var(--old-light-gray); }
.fast-grid .num { font: inherit; text-align: center; }
.fast-grid .time { font-weight: 700; text-align: center; }
.fast-times .empty, .trap-stats > p:not(.dim) { text-align: center; font-weight: 700; margin: 24px 0; }

/* Two Dog Matches (MatchesPageControl.xaml: text boxes and a bold "Matches" button over the grid). */
.two-dog-fields { justify-content: center; margin: 6px 0; font-size: var(--size-text); }
.two-dog-field .label { color: var(--ink); font-weight: 700; }
.two-dog-field input[type="search"], .search-form input {
  background: var(--bg); border: 1px solid var(--old-input-line); padding: 1px 4px; min-height: 22px;
  font: 400 var(--size-text) / 1.25 var(--font-text);
}
.two-dog-field button, .search-form button {
  background: var(--old-input-bg); border: 1px solid #acacac; font-weight: 700; padding: 1px 8px; min-height: 22px;
}
.two-dog-summary { font-size: var(--size-text); margin: 6px 0; }
.two-dogs .warn { color: var(--old-red); }
.two-dogs a.bitch, .two-dog-field a.bitch { color: var(--old-red); }
.two-dogs a.dog, .two-dog-field a.dog { color: var(--old-blue); }

/* Search (no old control: the text sizes of the old lists). */
.search-page p, .search-list { font-size: var(--size-text); }
.search-list h2 { font-size: var(--size-text); font-weight: 700; color: var(--ink); }
.search-page .search-form { margin: 4px 0; }

/* Phone and print keep their rules; only what the new sizes change is set here. */
@media (max-width: 640px) {
  .dog-profile, .trainer .facts { grid-template-columns: max-content minmax(0, 1fr); }
  .dog-grid { white-space: nowrap; }
  .trainer .trainer-kennel { overflow-x: auto; }
  .match-grid th.mx-dog { min-width: 7rem; }
}
@media print {
  .races-grid td, .match-grid td, .form-grid tbody td, .dog-grid td, .third-dog-list td { background: none; }
  .form-grid .trap { width: auto; min-width: 14px; height: auto; line-height: 14px; }
}

/* GHRC-28p1m8: look of the old day lists. The old source: DualListControl.xaml (box with a
   4 px border, title bar 16 bold white on the grey bar, two lists with a dotted vertical line),
   Single_Meeting_Card.xaml (meeting name 14 bold in the heading font, printer icon 24 px, dotted
   line below each meeting), DisplayRaces.cs lines 3560 to 3800 (race line: a 6 px column for the
   TV mark, a 35 px column for the time, size 10, margin 2 px above and below), Meeting_Results.xaml
   (results grid, size 10). Values: the shared custom properties of GHRC-qnzytd. */
.day-filter { margin: 4px 0 6px; font-size: var(--size-small); color: var(--dim); }
.day-filter p { margin: 0 0 2px; }
.day-filter .region-select, .day-filter .track-select { margin: 2px 0; }
.day-filter select, .day-filter button {
  font: inherit; font-size: var(--size-small); padding: 0 3px; line-height: 1.3;
}
.day-filter .track-select fieldset { border: 0; padding: 0; margin: 0; gap: 0 10px; }
.day-filter .track-select legend { padding: 0; }
.day-filter .track-select input[type="checkbox"] { margin: 0 2px 0 0; vertical-align: -2px; }

.day-box { border: 4px solid var(--old-border); background: var(--bg); margin: 4px 0 8px; }
.day .day-box h1.title-bar {
  margin: 0; padding: 5px; background: var(--old-bar); color: #fff; text-align: center;
  font: 700 var(--size-title) / 1.25 var(--font-heading);
}
.day .day-box h1.title-bar .region {
  color: inherit; opacity: 0.7; font: 400 var(--size-small) var(--font-text);
}
.day-box > .hint { margin: 2px 12px 6px; font-size: var(--size-small); }

/* Two lists with a dotted vertical line between them (one list on a phone: no line). */
.day-box .venue-menu.race-lists { position: relative; column-gap: 0; margin: 0; }
.day-box .venue-menu.race-lists::before {
  content: ""; position: absolute; left: 50%; top: 5px; bottom: 5px; width: 1px;
  background: repeating-linear-gradient(180deg, #000 0 1px, transparent 1px 5px);
}
.day-box .venue-menu.race-lists .hint { margin: 4px 12px; font-size: var(--size-small); }
.day-box .race-lists .menu-meeting, .day-box .result-meeting {
  border: 0; border-radius: 0; margin: 0; padding: 6px 7px 0;
}
.day-box .race-lists .menu-meeting h2, .day-box .result-meeting h2 {
  display: flex; justify-content: space-between; align-items: center; min-height: 26px;
  margin: 0 0 4px; padding-left: 5px;
  font: 700 var(--size-name) / 1.25 var(--font-heading); text-transform: uppercase;
}
.day-box .menu-meeting h2 a:not(.print-link), .day-box .result-meeting h2 a { color: var(--ink); }
.day-box .menu-meeting h2 a:not(.print-link):hover, .day-box .result-meeting h2 a:hover {
  color: var(--old-red); text-decoration: none;
}
.day-box .print-link {
  flex: none; width: 30px; height: 24px; margin-right: 10px; display: flex;
  align-items: center; justify-content: center;
}
.day-box .print-link .print-icon { width: 24px; height: 24px; display: block; }
.day-box .print-link:hover .print-icon { transform: scale(1.25); }

/* A race line: TV mark (6 px), time (35 px, red), label. The old line is 10 px high text with
   2 px margin and 2 px item padding above and below. */
.race-lines, .race-lists .race-lines { padding: 0 0 0 10px; font-size: var(--size-small); }
.meeting-lines { padding-left: 0; }
.race-lines li {
  display: grid; grid-template-columns: 6px 35px minmax(0, 1fr); align-items: center;
  padding: 3px 0; line-height: 15px;
}
.meeting-lines li { grid-template-columns: 6px 35px minmax(0, 1fr) auto; }
.race-lines li.hint { display: block; }
.race-lines .tv { font-size: var(--size-small); text-align: center; line-height: 15px; }
.race-lines .tv-r { color: var(--old-red); }
.race-lines .tv-s { color: skyblue; }
.race-lines .rt { margin-right: 0; text-align: center; color: var(--old-red); }
.race-lines .rt:hover { text-decoration: none; }
.race-lines .rl { min-width: 0; padding-left: 4px; }
.race-lines .rl:hover { color: var(--old-red); text-decoration: none; }
.race-lines .state { margin-left: 8px; }
.day-box .race-lists .more { margin: 2px 0 2px 10px; font-size: var(--size-small); }
.day-box .race-lists .more a, .day-box .result-meeting .more a { color: var(--old-red); }
.day-box .result-meeting .more { margin: 4px 0 2px 10px; font-size: var(--size-small); }
.day-box .dotted-sep { margin: 4px 5px 0; }

/* Results of the day: the grid of Meeting_Results.xaml (size 10, no cell lines). */
.day-box .result-meeting h3 { font: 700 var(--size-text) / 1.25 var(--font-text); margin: 6px 0 2px 5px; }
.day-box .results { width: 100%; font-size: var(--size-small); border-collapse: collapse; }
.day-box .results th, .day-box .results td {
  border: 0; padding: 0 4px; line-height: 15px; white-space: nowrap; text-align: center;
}
.day-box .results th {
  background: var(--old-head-cell); border-bottom: 1px solid var(--old-head-line);
  font-weight: 400; line-height: 20px; color: #333;
}
.day-box .results tbody tr:first-child td { background: var(--old-row-a); }
.day-box .results th:nth-child(2), .day-box .results td:nth-child(2),
.day-box .results th:nth-child(8), .day-box .results td:nth-child(8) { text-align: left; }
.day-box .results td:nth-child(6), .day-box .results td:nth-child(7) { font: inherit; text-align: center; }
.day-box .results td.num { text-align: center; }
.day-box .results a { color: var(--ink); }
.day-box .results a:hover { color: var(--old-red); text-decoration: none; }
.day-box .results .rt { color: var(--ink); }
.day-box .results .video-mark { color: var(--ink); display: inline-block; width: 7px; margin-right: 0; }
.day-box .trap-draw-meeting h2 { margin-bottom: 4px; }
.day-trials { padding: 0 7px 6px; }
.day-trials h2, .day-trials h3 {
  font: 700 var(--size-name) / 1.25 var(--font-heading); text-transform: uppercase;
  margin: 6px 0 2px 5px;
}
.day-trials h3 a { color: var(--ink); }
.day-trials .race-times { font: var(--size-small) / 15px var(--font-text); padding-left: 10px; }

/* The meeting page: the same line form, the meeting name in the heading font. */
.meeting h1 { font: 700 var(--size-name) / 1.25 var(--font-heading); }
.meeting h1 a { color: var(--ink); }
.meeting h1 a:first-child { text-transform: uppercase; }
.meeting h1 a:hover { color: var(--old-red); text-decoration: none; }

@media (max-width: 640px) {
  .day-box { border-width: 2px; }
  .day-box .venue-menu.race-lists { column-count: 1; }
  .day-box .venue-menu.race-lists::before { display: none; }
}
@media print {
  .day-box { border: 0; }
  .day .day-box h1.title-bar { background: none; color: var(--ink); border-bottom: 2px solid var(--ink); }
  .day-box .venue-menu.race-lists::before { display: none; }
}
.day-box .results .trap {
  font-size: var(--size-trap-grid); min-width: var(--trap-grid-w); padding: 0; line-height: 15px;
}
.day-box .results td.first-three .trap { margin-right: 1px; }
/* Column widths of Meeting_Results.xaml (star widths 1, 4.5, 1.2, 1.2, 1.5, 1.5, 1.5, 3, 1.2):
   the same columns in each table. A phone keeps the automatic layout. */
@media (min-width: 641px) {
  .day-box .results { table-layout: fixed; }
  .day-box .results th:nth-child(1) { width: 6%; }
  .day-box .results th:nth-child(2) { width: 27%; }
  .day-box .results th:nth-child(3), .day-box .results th:nth-child(4),
  .day-box .results th:nth-child(9) { width: 7.2%; }
  .day-box .results th:nth-child(5), .day-box .results th:nth-child(6),
  .day-box .results th:nth-child(7) { width: 9%; }
  .day-box .results th:nth-child(8) { width: 18%; }
  .day-box .results td:nth-child(2), .day-box .results td:nth-child(8) {
    overflow: hidden; text-overflow: ellipsis;
  }
}

/* GHRC-27a079: two panes with tab rows as the default view (templates/split.html, base.html,
   static/js/split.js). The light toolbar of the old main window (MainWindow.xaml:1692-1728,
   the system grey of a Windows window) in place of the dark bar; the tab rows of the two panes
   (MainWindow.xaml:51, 175) as Windows tabs: a grey tab with a border, the selected tab white
   and joined to its pane. Two panes from 1400 px (each pane about 700 px); below, one pane
   and both tab rows (a tab of the other row shows the other pane). Print: the selected pane
   only (split.js; the toolbar and the tab rows do not print). */
header.site.toolbar {
  align-items: center; gap: 3px 14px; padding: 2px 8px;
  background: var(--old-footer); color: var(--ink); border-bottom: 1px solid var(--old-border);
  font: var(--size-text) / 1.25 var(--font-text);
}
header.site.toolbar > a, header.site.toolbar form.account > :is(a, span) { color: var(--ink); }
header.site.toolbar .brand { font-size: var(--size-name); }
header.site.toolbar form { display: flex; align-items: center; gap: 4px; margin: 0; }
header.site.toolbar label { display: flex; align-items: center; gap: 4px; }
header.site.toolbar :is(input, select, button) {
  font: inherit; height: 20px; padding: 0 4px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--old-border); border-radius: 0;
}
header.site.toolbar button { background: var(--old-head-cell); cursor: pointer; }
header.site.toolbar button:hover { background: var(--old-band); border-color: var(--old-band-line); }
header.site.toolbar form.site-search input { width: 14rem; padding: 0 4px; }
header.site.toolbar .split-link { padding: 0 6px; border: 1px solid var(--old-border); background: var(--old-head-cell); }

main.page:has(> .split-view) { padding: 2px 4px 4px; }
.split-view { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 0 4px; }
.pane-tabs {
  grid-row: 1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 2px;
  min-width: 0; padding: 2px 2px 0; border-bottom: 1px solid var(--old-border);
}
.pane-tabs[data-pane="left"], .split-pane[data-pane="left"] { grid-column: 1; }
.pane-tabs[data-pane="right"], .split-pane[data-pane="right"] { grid-column: 2; }
.pane-tabs a[data-tab] {
  margin-bottom: -1px; padding: 1px 5px; white-space: nowrap; color: var(--ink);
  background: var(--old-head-cell); border: 1px solid var(--old-border);
}
.pane-tabs a[data-tab]:hover { background: var(--old-band); text-decoration: none; }
.pane-tabs a[data-tab][aria-current="page"] { position: relative; padding-bottom: 3px; background: var(--bg); border-bottom-color: var(--bg); }
.pane-tabs a[data-tab][hidden] { display: none; }
.pane-tabs a.sub { margin-left: 4px; font-size: var(--size-small); }
.pane-tabs a.sub + a.sub { margin-left: 0; }
.pane-tabs .pane-alone { margin-left: auto; align-self: center; padding: 0 2px; font-size: var(--size-small); }
.split-pane { grid-row: 2; border: 1px solid var(--old-border); border-top: 0; border-radius: 0; background: var(--bg); }
@media (max-width: 1399px) {
  .split-view { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .pane-tabs[data-pane] { grid-column: 1; }
  .pane-tabs[data-pane="right"] { grid-row: 2; padding-top: 4px; }
  .split-pane[data-pane] { grid-column: 1; grid-row: 3; }
  .split-view[data-active="left"] .split-pane[data-pane="right"],
  .split-view[data-active="right"] .split-pane[data-pane="left"] { display: none; }
  .split-view[data-active="left"] .pane-tabs[data-pane="right"],
  .split-view[data-active="right"] .pane-tabs[data-pane="left"] { border-bottom-style: dotted; }
  .split-view[data-active="left"] .pane-tabs[data-pane="right"] a[aria-current],
  .split-view[data-active="right"] .pane-tabs[data-pane="left"] a[aria-current] {
    background: var(--old-head-cell); border-bottom-color: var(--old-border);
  }
}
@media (max-width: 640px) {
  header.site.toolbar { gap: 3px 8px; }
  header.site.toolbar form.site-search input { width: 100%; }
  .pane-tabs a[data-tab] { padding: 1px 4px; }
}
.empty-tab h1 { font-size: var(--size-text); color: var(--dim); }
.empty-tab-text { margin: 20vh 0 0; text-align: center; font-size: 20px; font-weight: 700; }
@media print {
  .split-view { display: block; height: auto; }
  .split-view[data-active="left"] .split-pane[data-pane="right"],
  .split-view[data-active="right"] .split-pane[data-pane="left"] { display: none; }
  .split-pane { border: 0; }
  .split-pane iframe { height: 100vh; }
}

/* GHRC-n8necv: the video column of the form lines (race card and greyhound page). The cell
   has no padding, so the mark fits the 20 px of the old column. On paper there is no video
   column: a mark is of no use there, and the other columns get its width. */
.form th.video, .form td.video, .form-grid th.video, .form-grid td.video { padding: 0; text-align: center; }
.form .video-mark, .form-grid .video-mark { color: inherit; }
.form-grid th.video { width: 20px; }
.runner > .video-slot { grid-column: 1 / -1; }
@media print {
  .form th.video, .form td.video, .form-grid th.video, .form-grid td.video, .runner > .video-slot { display: none; }
}
