/*
 * paddlefreestyle.com, in the app's kit.
 *
 * The values are copied from docs/design/website.mjs and docs/design/kit.mjs
 * rather than approximated, so a page here and a board on the canvas are the
 * same thing. Palette D, Archivo through the weights the kit uses, no
 * gradients, no photographs, every icon drawn inline.
 *
 * The boards are 1440 wide with a 64 gutter; this file keeps those numbers to
 * the top and lets everything reflow down to 360, which is the phone board.
 */

:root {
  --paper: #FBFBF9;
  --ink: #141414;
  --muted: #6E6E6A;
  --line: #D9D9D4;
  --tile: #FFFFFF;
  --panel: #F1F1EE;
  --accent: #FFD60A;
  --accent-soft: #FFF6C7;
  --amber: #FFE7B3;
  --amber-ink: #7A4B00;
  --danger: #B8321F;
  --ok: #2E8B57;
  --pad: 64px;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
h1, h2, h3, p, ul { margin: 0; }
svg { display: block; }

/* The page is the boards' 1440 with the 64 gutter, centred on a wider screen. */
.wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.grow { flex: 1 1 auto; }

/* --------------------------------------------------------------------------
 * The mark: B1 from docs/design/icons.mjs, masked at 22 percent the way iOS
 * masks it, so the site and the app icon are the same playboat.
 * ------------------------------------------------------------------------ */
.mark {
  display: block;
  border-radius: 22%;
  overflow: hidden;
  flex: 0 0 auto;
}
.mark svg { width: 100%; height: 100%; }
.mark-34 { width: 34px; height: 34px; }
.mark-28 { width: 28px; height: 28px; }
.mark-38 { width: 38px; height: 38px; }
.mark-132 { width: 132px; height: 132px; }

/* --------------------------------------------------------------------------
 * Top bar and foot
 * ------------------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 74px;
  border-bottom: 2px solid var(--ink);
}
.topbar.bare { border-bottom: 0; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
  padding-bottom: 3px;
  border-bottom: 3px solid transparent;
}
.nav a[aria-current='page'] { font-weight: 700; color: var(--ink); border-bottom-color: var(--ink); }

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 0 26px;
  border-top: 2px solid var(--ink);
  margin-top: 40px;
}
.foot-who { font-weight: 700; font-size: 14px; }
.foot-note { font-weight: 600; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; align-items: center; flex-wrap: wrap; gap: 26px; font-weight: 600; font-size: 13px; color: var(--muted); }
.foot-links .mail { font-weight: 700; color: var(--ink); }

/* --------------------------------------------------------------------------
 * Buttons. Outlined, filled or yellow, never under 44 high.
 * ------------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  min-height: 44px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
/* A button laid out with flex has to be told what `hidden` means, or the
   display rule above wins and the admin page shows one it has put away. */
.btn[hidden] { display: none; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-ghost { border-color: var(--line); color: var(--muted); }
.btn-tall { height: 52px; font-size: 16px; }

/* --------------------------------------------------------------------------
 * Search. One field, one job: type a name, a venue or a year.
 * ------------------------------------------------------------------------ */
.search {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 460px;
  max-width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--tile);
}
.search:focus-within { border-color: var(--ink); }
.search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  text-overflow: ellipsis;
}
.search input::placeholder { color: var(--muted); }

/* --------------------------------------------------------------------------
 * Home (W2, Poster): ink on yellow, the competitions as cards under it.
 * ------------------------------------------------------------------------ */
.hero { background: var(--accent); border-bottom: 3px solid var(--ink); }
.hero-body { display: flex; align-items: center; gap: 46px; padding: 30px 0 52px; }
.hero-text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
/* The line breaks where the board breaks it, so the size has to come down with
 * the window rather than the break moving. 66 is the board's. */
.hero h1 { font-weight: 800; font-size: clamp(26px, 6.4vw, 66px); line-height: 1; letter-spacing: -0.035em; }
.hero-sub { font-weight: 600; font-size: 19px; }
.hero-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  padding-top: 32px;
}
.section-head h2 { font-weight: 800; font-size: 30px; letter-spacing: -0.02em; }
.section-head .sub { font-weight: 600; font-size: 15px; color: var(--muted); margin-top: 6px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
  margin-top: 26px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 214px;
  padding: 20px 22px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--tile);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h3 { font-weight: 800; font-size: 24px; line-height: 1.1; letter-spacing: -0.02em; }
.card-venue { font-weight: 600; font-size: 15px; color: var(--muted); }
.card-classes { font-weight: 700; font-size: 13px; color: var(--muted); }
.card .btn { width: 130px; height: 46px; }
.card-empty {
  justify-content: center;
  gap: 10px;
  border: 2px dashed var(--line);
  background: transparent;
}
.card-empty p { font-weight: 600; font-size: 14px; line-height: 1.4; color: var(--muted); }
.card-empty h3 { font-weight: 700; font-size: 17px; color: var(--muted); letter-spacing: 0; }

.cap { font-weight: 600; font-size: 10px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.bibs-only { font-weight: 700; font-size: 11px; color: var(--amber-ink); white-space: nowrap; }

/* The amber note an organiser's choice leaves on a competition. */
.withheld {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 2px solid var(--amber-ink);
  border-radius: 6px;
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 700;
  font-size: 12px;
}

.state { padding: 40px 0; font-weight: 600; font-size: 16px; color: var(--muted); }
.state.error { color: var(--danger); }

/* --------------------------------------------------------------------------
 * A competition: class tabs, phase pills, the leaderboard.
 * ------------------------------------------------------------------------ */
.crumbs { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; color: var(--muted); padding-top: 26px; }
.crumbs .here { font-weight: 700; color: var(--ink); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; flex-wrap: wrap; margin-top: 16px; }
.page-head h1 { font-weight: 800; font-size: 42px; line-height: 1.05; letter-spacing: -0.03em; }
.page-head .meta { font-weight: 600; font-size: 16px; color: var(--muted); margin-top: 10px; }
.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.tabrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 26px; }
.tabrow .tabs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* The classes and the phases are two different questions, so the board puts a
 * rule between them rather than a wider gap. */
.tabrow .gap { width: 2px; height: 30px; background: var(--line); margin: 0 24px; }

/* A tab is black when chosen. A filter pill is yellow when chosen: on this site
 * yellow still means the thing you picked, as it does on the scoring grid. */
.tab, .fpill {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.tab[aria-selected='true'] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.fpill[aria-selected='true'] { border-color: var(--ink); background: var(--accent); color: var(--ink); }

.phase-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 20px 0 12px; }
.phase-head h2 { font-weight: 800; font-size: 24px; }
.phase-head .sub { font-weight: 600; font-size: 14px; color: var(--muted); }

.lb { width: 100%; }
.lb-head, .lb-row { display: flex; align-items: center; gap: 16px; }
.lb-head { height: 34px; border-bottom: 2px solid var(--ink); }
.lb-row { min-height: 46px; border-bottom: 1px solid var(--line); }
.lb-rank { width: 54px; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--muted); }
.lb-row.top .lb-rank { color: var(--ink); }
.lb-bib { width: 60px; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.lb-name { flex: 1 1 0; min-width: 0; font-weight: 700; font-size: 17px; }
.lb-name.withheld-name { font-weight: 600; color: var(--muted); }
.lb-nation { width: 80px; font-weight: 600; font-size: 14px; color: var(--muted); letter-spacing: 0.06em; }
.lb-run { width: 92px; text-align: right; font-weight: 600; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-score { width: 100px; text-align: right; font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.lb-runs-small { display: none; font-weight: 600; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: 18px 22px;
  background: var(--panel);
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
 * Get the app
 * ------------------------------------------------------------------------ */
.app-top { display: flex; gap: 60px; flex-wrap: wrap; padding-top: 46px; }
.app-text { display: flex; flex-direction: column; gap: 18px; width: 720px; max-width: 100%; }
.app-text h1 { font-weight: 800; font-size: 44px; line-height: 1.05; letter-spacing: -0.03em; }
.app-text .lede { font-weight: 600; font-size: 18px; line-height: 1.55; color: var(--muted); }
.stores { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.store {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 268px;
  max-width: 100%;
  height: 74px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--tile);
}
.store .small { font-weight: 600; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.store .big { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.facts { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.facts .version { font-weight: 700; color: var(--ink); }

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--tile);
  align-self: flex-start;
}
.qr-card .qr { width: 150px; height: 150px; }
.qr-card .qr svg { width: 100%; height: 100%; }
.qr-card .label { font-weight: 700; font-size: 14px; }
.qr-card .hint { font-weight: 600; font-size: 12px; color: var(--muted); text-align: center; width: 190px; max-width: 100%; }

.three { display: flex; gap: 36px; flex-wrap: wrap; padding-top: 44px; }
.three > div { width: 392px; max-width: 100%; display: flex; flex-direction: column; gap: 8px; }
.three h3 { font-weight: 800; font-size: 19px; }
.three p { font-weight: 600; font-size: 15px; line-height: 1.5; color: var(--muted); }

.strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding: 24px 30px;
  background: var(--panel);
  border-radius: 14px;
}
.strip h3 { font-weight: 800; font-size: 21px; }
.strip p { font-weight: 600; font-size: 15px; color: var(--muted); margin-top: 5px; }

/* --------------------------------------------------------------------------
 * Terms and privacy
 * ------------------------------------------------------------------------ */
.doc-head { padding-top: 44px; }
.doc-head h1 { font-weight: 800; font-size: 44px; line-height: 1.05; letter-spacing: -0.03em; }
.doc-head .sub { font-weight: 600; font-size: 16px; color: var(--muted); margin-top: 12px; }
.doc-head .lede { font-weight: 600; font-size: 18px; line-height: 1.55; color: var(--muted); margin-top: 14px; max-width: 900px; }

.terms { display: flex; flex-direction: column; gap: 26px; padding-top: 34px; }
.term { display: flex; gap: 20px; }
.term .n { width: 30px; flex: 0 0 30px; font-weight: 800; font-size: 17px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 3px; }
.term p { width: 780px; max-width: 100%; font-weight: 600; font-size: 18px; line-height: 1.6; }

.contact { display: flex; gap: 60px; flex-wrap: wrap; margin-top: 44px; padding: 30px 34px; background: var(--panel); border-radius: 14px; }
.contact .lead { display: flex; flex-direction: column; gap: 10px; width: 470px; max-width: 100%; }
.contact h2 { font-weight: 800; font-size: 24px; }
.contact p { font-weight: 600; font-size: 16px; line-height: 1.6; color: var(--muted); }
.contact .details { display: flex; flex-direction: column; gap: 16px; }
.contact .detail { display: flex; flex-direction: column; gap: 4px; }
.contact .email { font-weight: 800; font-size: 22px; letter-spacing: -0.01em; word-break: break-word; }
.contact .site { font-weight: 700; font-size: 18px; }

.signoff { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 30px; }
.signoff .big { font-weight: 800; font-size: 22px; }
.signoff .by { font-weight: 600; font-size: 15px; color: var(--muted); }

/* Nine questions in two columns: they are scanned for, not read in order. */
.privacy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; padding-top: 24px; }
.privacy section { padding: 20px 0 22px; border-top: 1px solid var(--line); }
.privacy h2 { font-weight: 800; font-size: 21px; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 9px; }
.privacy p { font-weight: 600; font-size: 17px; line-height: 1.6; }

/* --------------------------------------------------------------------------
 * Narrower than the boards. The phone board is 390 wide with a 20 gutter; this
 * holds together down to 360.
 * ------------------------------------------------------------------------ */
@media (max-width: 1100px) {
  :root { --pad: 32px; }
  .hero h1 { font-size: 52px; }
  .hero-body { gap: 30px; }
  .app-top { gap: 30px; }
  .privacy { gap: 0 32px; }
}

@media (max-width: 820px) {
  :root { --pad: 20px; }
  .topbar { height: auto; flex-direction: column; align-items: stretch; gap: 0; padding: 14px 0 0; }
  .nav { gap: 20px; overflow-x: auto; padding: 8px 0 0; }
  .nav a { display: flex; align-items: center; height: 44px; padding-bottom: 0; border-bottom-width: 3px; }
  .hero-body { flex-direction: column; align-items: flex-start; gap: 20px; padding: 24px 0 34px; }
  .hero h1 { font-size: 38px; letter-spacing: -0.03em; }
  .hero-sub { font-size: 17px; }
  .mark-132 { width: 84px; height: 84px; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .section-head h2 { font-size: 26px; }
  .page-head h1, .app-text h1, .doc-head h1 { font-size: 32px; }
  .privacy { grid-template-columns: 1fr; gap: 0; }
  .term p, .app-text .lede { font-size: 17px; }
  .contact { padding: 22px; gap: 24px; }
  .strip { padding: 20px; }
  .three { gap: 24px; }
  .note { padding: 16px; }
  /* The rule between the classes and the phases becomes the line break. */
  .tabrow .gap { flex: 0 0 100%; width: auto; height: 0; margin: 4px 0; background: none; }

  /* The runs move under the name, so a row still fits a 360 wide screen. */
  .lb-head .lb-nation, .lb-row .lb-nation,
  .lb-head .lb-run, .lb-row .lb-run { display: none; }
  .lb-runs-small { display: block; }
  .lb-head, .lb-row { gap: 10px; }
  /* "RANK" in the heading needs its tracking back to fit its own column. */
  .lb-head .cap { font-size: 9px; letter-spacing: 0.06em; }
  .lb-rank { width: 40px; font-size: 15px; }
  .lb-bib { width: 36px; font-size: 14px; }
  .lb-name { font-size: 15px; }
  .lb-score { width: 62px; font-size: 17px; }
  .lb-row { padding: 8px 0; }
}

/* --------------------------------------------------------------------------
 * Admin
 *
 * One page nobody but the owner opens: the sign-in card, the paddler search,
 * the competitions as rows, the dialog that asks before anything changes and
 * the editor that holds one competition's JSON. It is the site's own
 * kit throughout, so this block adds a shape rather than a second look: the
 * card is the competition card, the fields are the home page's search field,
 * and the only new button is the red one, which the site has nowhere else.
 *
 * A pane that is laid out with flex has to be told what `hidden` means, or the
 * display rule wins and the page shows all three states at once.
 * ------------------------------------------------------------------------ */
.admin-signin[hidden], .admin-form[hidden], .modal[hidden],
.admin-results[hidden], .admin-field[hidden] { display: none; }

.admin-signin { display: flex; justify-content: center; padding: 58px 0; }
.admin-card {
  display: flex;
  flex-direction: column;
  width: 420px;
  max-width: 100%;
  padding: 28px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--tile);
}
.admin-card h1 { font-weight: 800; font-size: 30px; letter-spacing: -0.02em; }
.admin-lede { font-weight: 600; font-size: 15px; color: var(--muted); margin-top: 8px; }

.admin-form { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.admin-field { display: flex; flex-direction: column; gap: 7px; }
.admin-label { font-weight: 700; font-size: 13px; }
.admin-form .search { width: 100%; height: 52px; }
.admin-wide { width: 100%; margin-top: 4px; }

.admin-refusal { font-weight: 600; font-size: 14px; line-height: 1.45; color: var(--danger); margin-top: 14px; }
.admin-none { font-weight: 600; font-size: 15px; line-height: 1.5; color: var(--muted); margin-top: 20px; }

/* --------------------------------------------------------------------------
 * The paddler search, above the list. A name lives inside the competition
 * files, so this is the one thing on the page the index cannot answer.
 * ------------------------------------------------------------------------ */
.admin-search { padding: 20px 0 4px; }
/* The field keeps the home page's 460, so the search on this page and the
   search on the public one are the same field. */
.admin-search-form { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }

.admin-results { margin-top: 20px; }
.admin-results-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.admin-results-count { font-weight: 700; font-size: 15px; }
.admin-results-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.admin-result-rows { margin-top: 12px; border-top: 1px solid var(--line); }
.admin-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.admin-result-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.admin-result-name { font-weight: 800; font-size: 16px; }
.admin-result-where { font-weight: 600; font-size: 13px; color: var(--muted); }
.admin-result-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }

/* Shorter across, never shorter than the 44 every target on the site has. */
.btn-small { height: 44px; padding: 0 14px; font-size: 14px; }

/* Amber, the colour a withheld name already wears on a competition page:
   nothing is deleted by it, the bib stays and the organiser's own choice looks
   the same. */
.admin-withhold { color: var(--amber-ink); }
.admin-withhold:hover { border-color: var(--amber-ink); }

.admin-rows { margin-top: 12px; border-top: 2px solid var(--ink); }
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.admin-row-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.admin-row-name { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.admin-row-where { font-weight: 600; font-size: 14px; color: var(--muted); }
.admin-row-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.admin-code {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  color: var(--muted);
}
.admin-tag { font-weight: 700; font-size: 11px; color: var(--amber-ink); }
.admin-row-sub { font-weight: 600; font-size: 13px; color: var(--muted); word-break: break-word; }
.admin-row-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
/* The one ghost button on the site that means something is about to go. */
.admin-remove { color: var(--danger); }
.admin-remove:hover { border-color: var(--danger); }

.btn-danger { border-color: var(--danger); background: var(--danger); color: var(--paper); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-back { position: absolute; inset: 0; background: rgba(20, 20, 20, 0.45); }
.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 460px;
  max-width: 100%;
  padding: 26px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--tile);
}
.modal-card p { font-weight: 600; font-size: 16px; line-height: 1.5; }
.modal-card .admin-refusal { margin-top: 0; font-size: 14px; }
.modal-buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }

/* The JSON editor: the widest thing on the site, and taller than the screen
   would allow if the card were not held to it. */
.modal-wide { width: 900px; gap: 16px; max-height: calc(100vh - 40px); overflow: auto; }
.admin-editor-title { font-weight: 800; font-size: 20px; letter-spacing: -0.01em; }
.admin-editor {
  flex: 1 1 auto;
  width: 100%;
  height: 60vh;
  min-height: 200px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--tile);
  color: var(--ink);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.admin-editor:focus { outline: 0; border-color: var(--ink); }
.admin-editor:disabled { color: var(--muted); }

@media (max-width: 820px) {
  .admin-signin { padding: 30px 0; }
  .admin-card { padding: 22px; }
  .admin-card h1 { font-size: 26px; }
  /* On a phone the pieces stack and the buttons share the lines under them:
     four of them at 360 need two rows, which is why they wrap. */
  .admin-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .admin-row-actions { flex-wrap: wrap; }
  .admin-row-actions .btn { flex: 1 1 130px; }
  .admin-search-form .btn { flex: 1 1 auto; }
  .admin-result { flex-direction: column; align-items: stretch; gap: 10px; }
  .admin-result-actions .btn { flex: 1 1 0; }
  .modal-card { padding: 20px; gap: 18px; }
  .modal-buttons .btn { flex: 1 1 auto; }
  .modal-wide { gap: 14px; }
}
