@font-face { font-family: "Josefin Sans"; src: url("fonts/josefin-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #fbfaf7; --surface: #ffffff; --ink: #1f1a1d; --muted: #5d5459; --line: #dcd4d8;
  --accent: #7d1d3f; --accent-ink: #ffffff; --soft: #f6eaee; --gold: #a87618; --gold-soft: #f6ecd6;
  --good: #2b6a3b; --warn: #94430a; --warn-soft: #fbeee2;
  --head: "Josefin Sans", "Avenir Next", "Century Gothic", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 4px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151214; --surface: #1f1a1d; --ink: #f1eaed; --muted: #b9adb3; --line: #3d3338;
    --accent: #e48aa8; --accent-ink: #1a0a10; --soft: #33212a; --gold: #e2b95f; --gold-soft: #3a2f1c;
    --good: #82c995; --warn: #f2ab6b; --warn-soft: #3a2719;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--body); }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-in { display: flex; align-items: center; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 21px/1 var(--head); padding-top: 3px; }
.brand svg { margin-top: -3px; }

h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.15; }
.hero { padding-top: 22px; }
h1 { font-size: clamp(30px, 6vw, 44px); margin: 0 0 10px; letter-spacing: -.01em; }
.lede { margin: 0 0 14px; max-width: 70ch; color: var(--ink); }
.note { border-left: 4px solid var(--accent); background: var(--soft); padding: 10px 14px; margin: 0 0 14px; border-radius: 0 var(--r) var(--r) 0; }
.note p { margin: 4px 0; }
.note.warn { border-color: var(--warn); background: var(--warn-soft); }

/* dogs as ring numbers */
.dogs { display: flex; gap: 10px; align-items: stretch; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px; }
.dog-cards { display: flex; gap: 10px; }
.dog-card {
  position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; text-align: left;
  min-width: 150px; max-width: 220px; padding: 12px 12px 10px; border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
}
.dog-card[aria-pressed="true"] { box-shadow: inset 0 6px 0 var(--accent); padding-top: 16px; }
.dog-card .dc-num { font: 700 34px/1 var(--head); padding-top: 4px; }
.dog-card .dc-of { font-size: 14px; color: var(--muted); }
.dog-card .dc-name { grid-column: 1 / -1; margin-top: 4px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.dog-card .dc-award { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.dog-card.done .dc-award { color: var(--good); font-weight: 600; }
.add-dog { flex: 0 0 auto; align-self: stretch; }
.example-note { margin: 0 0 12px; color: var(--muted); }

/* layout */
.layout { display: grid; gap: 18px; }
@media (min-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; gap: 28px; } }
.col-a, .col-b { min-width: 0; }
.col-a { display: grid; gap: 14px; align-content: start; }
.d-sum { overflow-wrap: anywhere; }

/* details */
.details { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.details summary { cursor: pointer; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; min-height: 48px; }
.d-title { font-weight: 700; }
.d-sum { color: var(--muted); font-size: 15px; }
.details-body { padding: 0 14px 14px; }
.more { margin-top: 8px; }
.more summary { cursor: pointer; color: var(--accent); font-size: 15px; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.more[open] summary { margin-bottom: 6px; }

/* form fields */
.row { display: grid; gap: 10px; }
@media (min-width: 520px) { .row.two { grid-template-columns: 1fr 1fr; } }
.f { display: block; margin: 0 0 10px; font-weight: 600; font-size: 15px; }
fieldset.f { border: 0; padding: 0; min-width: 0; }
legend, .legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 4px; display: block; }
.hint { display: block; font-weight: 400; font-size: 15px; color: var(--muted); margin: 4px 0 0; }
input[type=text], input[type=date], select {
  display: block; width: 100%; margin-top: 4px; font: 16px var(--body); color: var(--ink); background: var(--bg);
  border: 1px solid var(--muted); border-radius: var(--r); padding: 10px 10px; min-height: 46px;
}
input[type=date] { -webkit-appearance: none; appearance: none; }
input:disabled { opacity: .7; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--muted); border-radius: var(--r); overflow: hidden; margin-top: 4px; }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; min-height: 46px; padding: 6px 6px; font-weight: 600; font-size: 15px; line-height: 1.2; border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg small { font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 2px; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:checked + span small { color: inherit; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (max-width: 420px) { .seg3 { grid-auto-flow: row; } .seg3 span { border-left: 0; border-top: 1px solid var(--line); flex-direction: row; gap: 8px; justify-content: flex-start; padding: 8px 12px; text-align: left; align-items: baseline; } .seg3 label:first-child span { border-top: 0; } }
.seg.mini span { min-height: 44px; font-size: 15px; }

/* status (the result) */
.status { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--r); padding: 16px; }
.status.good { border-color: var(--good); }
.status.warn { border-color: var(--warn); }
.st-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big .num { font: 700 56px/1 var(--head); }
.big .of { font-size: 18px; margin-left: 8px; color: var(--muted); }
.st-award { font-weight: 600; color: var(--accent); }
.pips { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 10px; }
.pips i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--muted); }
.pips i.pa { background: var(--accent); border-color: var(--accent); }
.pips i.pb { background: var(--gold); border-color: var(--gold); }
.pips i.extra { opacity: .55; }
.mins { list-style: none; padding: 0; margin: 0 0 8px; font-size: 16px; }
.mins li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding: 2px 0; }
.mins .k { width: 10px; height: 10px; border-radius: 50%; display: inline-block; align-self: center; }
.mins .k.pa { background: var(--accent); } .mins .k.pb { background: var(--gold); }
.mins .of { color: var(--muted); }
.ok { color: var(--good); font-weight: 700; }
.st-head { font-weight: 700; margin: 8px 0 2px; font-size: 18px; }
.status.good .st-head { color: var(--good); }
.st-line { margin: 0; }

/* add form */
.add { border-top: 6px solid var(--accent); background: var(--surface); padding: 14px; border-radius: var(--r); border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.h-small { font-size: 22px; margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { font: 600 15px var(--body); min-height: 44px; padding: 8px 12px; border: 1px solid var(--accent); color: var(--accent); background: var(--surface); border-radius: var(--r); cursor: pointer; }
.chip:hover { background: var(--soft); }
.win-rows { display: grid; gap: 10px; margin-top: 10px; }
.win-row { border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 10px 12px; border-radius: 0 var(--r) var(--r) 0; }
.wr-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.x { font-size: 24px; line-height: 1; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; margin: -8px -8px -8px 0; }
.wr-cls { margin: 6px 0 8px; }
.wr-q { font-size: 15px; font-weight: 600; display: block; }
.wr-out { margin-top: 6px; font-size: 15px; }
.pts { font-weight: 700; color: var(--good); }
.why { color: var(--warn); }
.muted { color: var(--muted); }
.preview { margin: 12px 0 4px; min-height: 1.5em; }
.err { color: var(--warn); font-weight: 600; margin: 4px 0; min-height: 0; }
.err:empty { display: none; }
.add-actions { display: flex; gap: 10px; margin-top: 8px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 16px; font: 600 16px var(--body); border-radius: var(--r); border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { border-color: var(--line); }
.btn.danger { color: var(--warn); }
.btn.small { min-height: 44px; padding: 6px 12px; font-size: 15px; }
.btn.small.danger:not(.ghost) { border-color: var(--warn); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: 0; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* shows */
.shows { margin-top: 26px; }
.show-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.show { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.show.qual { box-shadow: inset 4px 0 0 var(--good); padding-left: 12px; }
.sh-when { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.sh-when span { color: var(--muted); font-size: 15px; }
.sh-name { font-weight: 600; overflow-wrap: anywhere; }
.sh-wins { list-style: none; padding: 0; margin: 4px 0 0; font-size: 15px; }
.sh-wins li { display: flex; gap: 8px; flex-wrap: wrap; }
.sh-wins li b { color: var(--good); }
.sh-wins li em { font-style: normal; color: var(--warn); }
.sh-wins li.no span { color: var(--muted); }
.sh-none { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.sh-flag { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--warn); }
.show.qual .sh-flag:first-of-type { color: var(--good); }
.sh-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.sh-pts { font: 700 28px/1 var(--head); color: var(--accent); }
.show:not(.scored) .sh-pts { color: var(--muted); }
.sh-run { font-size: 14px; color: var(--muted); }
.sh-btns { display: flex; gap: 6px; margin-top: 6px; }
.empty { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.share-out p { margin: 10px 0 4px; }
.share-out input { font-size: 15px; }
.saved { color: var(--muted); font-size: 15px; margin: 12px 0; }

.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40; width: min(560px, calc(100% - 24px));
  display: flex; gap: 14px; align-items: center; justify-content: space-between; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--r); }
.toast .linkish { color: var(--bg); font-weight: 700; min-height: 44px; }

/* content */
.content { padding-top: 34px; padding-bottom: 20px; max-width: 760px; margin-left: max(16px, calc((100% - 1120px) / 2 + 16px)); }
@media (max-width: 1152px) { .content { margin-left: auto; } }
.content h2 { font-size: 27px; margin: 28px 0 10px; }
.content h3 { font-size: 19px; margin: 20px 0 4px; }
.content p { margin: 0 0 12px; }
.faq p { margin-top: 0; }
.table-wrap { overflow-x: auto; }
.ref { border-collapse: collapse; width: 100%; font-size: 16px; margin: 6px 0 12px; }
.ref caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
.ref th, .ref td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ref thead th { border-bottom: 2px solid var(--ink); }
.ref tbody th { font-weight: 600; }
.sources { font-size: 15px; color: var(--muted); margin-top: 24px; }

.foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 18px 0 30px; font-size: 15px; color: var(--muted); }
.sb-footer p { margin: 6px 0; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- print ---------- */
.print-sheet { display: none; }
@page { margin: 14mm 13mm; }
@media print {
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .top, .hero, .tool, .content, .foot, .skip, .toast { display: none !important; }
  .print-sheet { display: block; color: #000; }
  .p-head h2 { font: 700 18pt/1.1 var(--head); margin: 0 0 2pt; }
  .p-head p { margin: 0 0 8pt; font-size: 10pt; }
  .p-dog { display: grid; grid-template-columns: 1fr 1fr; gap: 3pt 18pt; margin-bottom: 8pt; }
  .pf { display: flex; gap: 6pt; border-bottom: 0.75pt solid #777; padding: 3pt 0 2pt; min-height: 17pt; }
  .pf span { font-size: 9pt; color: #333; white-space: nowrap; }
  .pf b { font-weight: 600; overflow-wrap: anywhere; }
  .p-rule { font-size: 9.5pt; margin: 6pt 0 8pt; }
  .p-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .p-table th, .p-table td { border: 0.75pt solid #555; padding: 3pt 4pt; text-align: left; vertical-align: top; font-size: 9.5pt; overflow-wrap: break-word; }
  .p-table thead { display: table-header-group; }
  .p-table th { font-size: 9pt; background: none; }
  .p-table tr { break-inside: avoid; }
  .p-table td { height: 18pt; }
  .p-table .p-run th { border: 0; padding: 0 0 3pt; font-weight: 400; font-size: 8.5pt; color: #333; }
  .p-table .n { text-align: right; }
  .p-table .nw { white-space: nowrap; }
  .p-table small { display: block; font-size: 7.5pt; color: #333; }
  .c-no { width: 5%; } .c-date { width: 13%; } .c-show { width: 26%; } .c-type { width: 12%; } .c-award { width: 26%; } .c-pts { width: 10%; } .c-run { width: 8%; }
  .p-keep { break-inside: avoid; }
  .p-table .p-sum td { border: 0; padding: 6pt 0 0; height: auto; font-size: 10.5pt; }
  .p-total { margin: 8pt 0 2pt; font-size: 10.5pt; break-inside: avoid; }
  .p-small { font-size: 9pt; margin: 3pt 0; }
  .p-skip ul { margin: 2pt 0 0; padding-left: 14pt; font-size: 8.5pt; }
  .p-skip { break-inside: avoid-page; }
  .p-foot { font-size: 8.5pt; color: #333; margin-top: 10pt; border-top: 0.75pt solid #777; padding-top: 4pt; }
}
