/* Additions to site.css for accounts and the admin area. Uses the same tokens. */

/* Lets wide tables scroll inside their column on phones instead of widening the page. */
.split > *, .cols-2 > *, .cols-3 > * { min-width: 0; }

/* ---------- Messages ---------- */
.flash-wrap { padding-top: 16px; }
.flash { border-left: 6px solid var(--z2); background: var(--white); padding: 12px 16px; border-radius: 0 var(--r) var(--r) 0; margin-bottom: 12px; }
.flash.success { border-left-color: #1e9e3c; }
.flash.warn { border-left-color: var(--ga); }
.flash.error { border-left-color: var(--curb); }

/* ---------- Forms ---------- */
.form { max-width: 480px; }
.form.wide { max-width: 720px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=tel], .form input[type=number], .form input[type=search], .form input[type=datetime-local], .form textarea {
  width: 100%; font: 400 1.05rem var(--body); padding: 10px 12px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; color: var(--ink);
}
.form .hint { font-size: .92rem; color: var(--muted); margin: 4px 0 0; }
.form .btn-row { margin-top: 8px; }
.narrow { max-width: 560px; }
.codes { columns: 2; list-style: none; padding: 16px; background: var(--white); border-radius: var(--r); font: 600 1.05rem ui-monospace, Menlo, monospace; max-width: 420px; }
.secret { font: 600 1.05rem ui-monospace, Menlo, monospace; word-break: break-all; background: var(--white); padding: 10px 12px; border-radius: var(--r); }
.linkish { background: none; border: 0; color: #e8eaee; font: 600 .98rem var(--body); padding: 8px 10px; cursor: pointer; }
.linkish:hover { color: #fff; text-decoration: underline; }
.btn.danger { background: var(--curb); }
.btn.danger:hover { background: #a81a20; }

/* ---------- Schedule: list or calendar ---------- */
.view-toggle { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; margin-bottom: 20px; }
.view-toggle a { padding: 8px 18px; font-weight: 600; color: var(--ink); text-decoration: none; }
.view-toggle a[aria-current] { background: var(--ink); color: #fff; }
.cal { table-layout: fixed; margin-bottom: 8px; }
.cal th { text-align: center; padding: 8px 4px; }
.cal td { height: 92px; padding: 6px; border: 1px solid var(--line); }
.cal td.blank { background: #e7e9e5; }
.cal-d { display: block; font-weight: 600; font-size: .9rem; color: var(--muted); }
.cal-w { display: none; }
.cal-ev { display: block; margin-top: 4px; padding: 4px 6px; background: var(--z2); color: #fff; border-radius: 4px; text-decoration: none; font-weight: 600; font-size: .86rem; line-height: 1.2; overflow-wrap: anywhere; }
.cal-ev:hover { background: var(--z2-dark); color: #fff; }
.cal-ev.special { background: var(--curb); }
.cal-ev.off { background: #7b808a; text-decoration: line-through; }
.cal-ev small { display: block; font-weight: 400; font-size: .78rem; }
@media (max-width: 760px) {
  .cal, .cal tbody, .cal tr, .cal td { display: block; width: 100%; }
  .cal thead, .cal td.blank, .cal td:not(.has) { display: none; }
  .cal td { height: auto; border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .cal-w { display: inline; }
  .cal-ev { font-size: 1rem; padding: 8px 10px; }
  .cal-ev small { font-size: .9rem; }
}

/* ---------- Booking ---------- */
.table-scroll + p { margin-top: 14px; }
@media (max-width: 640px) {
  .book-table, .book-table tbody { display: block; }
  .book-table thead { display: none; }
  .book-table tr { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; padding: 14px 12px; border-bottom: 1px solid var(--line); }
  .book-table td { display: block; padding: 0; border: 0; text-align: left; }
  .book-table td:nth-child(1) { grid-area: 1 / 1; align-self: start; }
  .book-table td:nth-child(2) { grid-area: 1 / 2 / 1 / 4; }
  .book-table td:nth-child(3) { grid-area: 2 / 1; font-weight: 600; }
  .book-table td:nth-child(4) { grid-area: 2 / 2; }
  .book-table td:nth-child(5) { grid-area: 2 / 3; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table thead { display: none; }
  .stack-table tr { padding: 14px 12px; border-bottom: 1px solid var(--line); }
  .stack-table td { padding: 0 0 8px; border: 0; text-align: left; }
  .stack-table td:last-child { padding-bottom: 0; }
  .stack-table td:empty { display: none; }
  .stack-table select { max-width: 100%; }
  .stack-table td[data-label]:not(:empty)::before { content: attr(data-label) ": "; font-weight: 600; }
}
.setting-head { display: flex; align-items: center; gap: 10px; }
.setting-head label { margin-bottom: 0; }
.tip-btn { flex: none; width: 32px; height: 32px; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: #fff; color: var(--ink); font: 700 1rem/1 var(--body); cursor: pointer; }
.tip-btn:hover { background: var(--ink); color: #fff; }
.tip-btn:focus-visible { outline: 3px solid var(--z2); outline-offset: 2px; }
.tip-body { padding: 22px 24px; }
.tip-dialog .tip-body h2 { font-size: 1.7rem; margin: 0 0 .4em; }
.tip-body h3 { font-size: 1.1rem; margin: 1em 0 .2em; }
.tip-body p { margin: 0; }
.roster-table .btn { white-space: nowrap; }
.customer-note { padding: 14px 16px; margin-top: 12px; }
.rich-editor { border: 2px solid var(--ink); border-radius: var(--r); background: #fff; overflow: hidden; }
.rich-modes { display: flex; justify-content: flex-end; gap: 4px; padding: 6px 8px 0; background: #e7e9e5; }
.rich-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; background: #e7e9e5; border-bottom: 1px solid var(--line); }
.rich-btn { min-height: 34px; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: var(--ink); font: 600 .92rem var(--body); cursor: pointer; }
.rich-btn:hover { border-color: var(--ink); }
.rich-btn:focus-visible { outline: 3px solid var(--z2); outline-offset: 1px; }
.rich-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.rich-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: #f2f3f0; border-bottom: 1px solid var(--line); }
.rich-link input { flex: 1 1 200px; min-width: 0; width: auto; padding: 6px 8px; }
.rich-area { min-height: 150px; padding: 12px 14px; overflow-wrap: anywhere; }
.rich-area:focus { outline: 3px solid var(--z2); outline-offset: -3px; }
.rich-area > :first-child { margin-top: 0; }
.rich-area > :last-child { margin-bottom: 0; }
.rich-editor textarea { display: block; width: 100%; min-height: 150px; border: 0; border-radius: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; }
.rich-editor textarea[hidden] { display: none; }
.campaign-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.block-card { background: var(--white); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.block-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.block-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.block-card label { display: grid; gap: 4px; margin-bottom: 8px; font-weight: 600; font-size: .92rem; }
.block-card input, .block-card textarea { width: 100%; font: 400 1rem var(--body); padding: 8px 10px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; }
.email-preview { background: var(--white); border-top: 6px solid var(--z2); border-radius: var(--r); padding: 20px; overflow-wrap: anywhere; }
.email-preview h3 { margin: 0 0 10px; }
.preview-image { padding: 24px 12px; background: #e7e9e5; border-radius: var(--r); text-align: center; color: var(--muted); }
@media (max-width: 1100px) {
  .campaign-grid { grid-template-columns: minmax(0, 1fr); }
}
.customer-note p { margin: 0 0 8px; overflow-wrap: anywhere; }
.support-msg.from-staff { border-left: 6px solid var(--z2); }
.support-msg.is-note { border-left: 6px solid var(--ga); background: #fff8dc; }
@media print {
  body.admin .top, .admin-nav, .admin-main > .flash, .no-print { display: none !important; }
  .admin-shell { display: block; padding: 0; }
  .table-scroll { overflow: visible; }
  .roster-table { font-size: .8rem; }
  .roster-table th, .roster-table td { padding: 4px 6px; }
  .roster-table tr { break-inside: avoid; }
  .roster-group { break-after: avoid; }
}

/* ---------- Rentals and garages in the cart ---------- */
.variant-rows input[type="text"]:not([inputmode]) { min-width: 110px; }
.addon-day { margin-top: 32px; padding-top: 8px; border-top: 2px solid var(--line); }
.addon-rental { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 12px; align-items: end; }
.addon-rental .field { margin: 0; }
.addon-rental select, .addon-rental input { width: 100%; font: 400 1rem var(--body); padding: 10px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; }
.garage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.garage-grid button { display: grid; gap: 2px; padding: 10px 4px; background: #fff; border: 2px solid var(--ink); border-radius: var(--r); font: 400 .88rem var(--body); color: var(--ink); cursor: pointer; }
.garage-grid button b { font: 700 1.3rem/1 var(--display); }
.garage-grid button:hover:not(:disabled) { background: #e7e9e5; }
.garage-grid button[aria-pressed="true"] { background: var(--z2); border-color: var(--z2); color: #fff; }
.garage-grid button:disabled { background: #e7e9e5; border-color: #c9ccc7; color: #6b7079; cursor: not-allowed; }
@media (max-width: 560px) {
  .addon-rental { grid-template-columns: minmax(0, 1fr) 90px; }
  .addon-rental button { grid-column: 1 / -1; }
}

/* ---------- Admin ---------- */
.form.xwide { max-width: 860px; }
.form textarea { resize: vertical; }
.code-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.code-row input { flex: 1 1 200px; width: auto; min-width: 0; }
.form input[type=date] { font: 400 1.05rem var(--body); padding: 9px 12px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; }
.day-box { background: var(--white); border: 0; border-radius: var(--r); padding: 16px 18px; margin: 0 0 16px; min-width: 0; }
.day-box legend { font: 700 1.3rem var(--display); float: left; width: 100%; margin-bottom: 8px; }
.day-box > .field { clear: both; }
table.inputs th, table.inputs td { padding: 7px 8px; vertical-align: middle; }
table.inputs input[type=number], table.inputs td.num input[type=text] { width: 84px; padding: 6px 8px; text-align: right; }
table.inputs input[type=text] { padding: 6px 8px; font-size: .95rem; }
table.inputs input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--z2); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filter-bar label { display: grid; gap: 4px; font-weight: 600; font-size: .92rem; }
.filter-bar input, .filter-bar select { font: 400 1rem var(--body); padding: 8px 10px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; width: auto; }
form.inline { display: inline-block; margin-left: 6px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #e7e9e5; color: var(--ink); }
.pill.ok { background: #d5f0dc; }
.pill.bad { background: #f9d6d7; }
.pill.env { background: var(--ga); }
body.admin .top .nav form { margin: 0; }
.admin-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; padding-top: 28px; padding-bottom: 64px; align-items: start; }
.admin-nav { display: grid; gap: 2px; position: sticky; top: 84px; }
.admin-nav a { padding: 8px 12px; border-radius: var(--r); text-decoration: none; color: var(--ink); font-weight: 600; }
.admin-nav a:hover { background: #e7e9e5; }
.admin-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.admin-nav-group { background: none; margin: 0; }
.admin-nav-group summary { padding: 8px 12px; border-radius: var(--r); font: 700 1rem var(--body); list-style-position: inside; }
.admin-nav-group summary:hover { background: #e7e9e5; }
.admin-nav-group summary:focus-visible { outline: 3px solid var(--z2); outline-offset: 1px; }
.admin-nav-group a { display: block; padding-left: 26px; }
.admin-main h1 { font-size: 2.4rem; }
.admin-main h2 { font-size: 1.6rem; margin-top: 1.4em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stats .card { padding: 16px 18px; }
.stats b { display: block; font: 700 2.2rem/1 var(--display); }
.perm-grid { display: grid; gap: 10px; margin-bottom: 16px; }
.perm-grid fieldset { background: var(--white); border-radius: var(--r); padding: 12px 16px; }
.perm-grid legend { font-weight: 600; padding: 0; float: left; width: 100%; margin-bottom: 6px; }
.perm-grid label { display: inline-flex; gap: 6px; align-items: center; margin: 0 16px 4px 0; }
pre.log { background: var(--asphalt); color: #e8eaee; padding: 16px; border-radius: var(--r); overflow: auto; max-height: 560px; font-size: .85rem; white-space: pre-wrap; word-break: break-word; }
.pager { display: flex; gap: 12px; margin-top: 14px; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .admin-nav { position: static; }
}

/* Extras on the event page */
.extra-list { border-top: 1px solid var(--line); margin: 12px 0 18px; }
.extra-item { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.extra-item > div:first-child { flex: 1 1 220px; min-width: 0; }
.extra-buy, .extra-buy form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.extra-buy input[type=number] { width: 68px; font: 400 1rem var(--body); padding: 7px 8px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; }

/* Keeps the heading clear of the sticky site header when jumping to course dates */
#dates { scroll-margin-top: 72px; }

/* Site settings page */
.settings-tools { margin-bottom: 12px; }
.settings-tools .field { margin-bottom: 4px; }
.settings-tools p { min-height: 1.5em; margin: 0; }
.settings-jump { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 20px; }
.settings-jump[hidden], .settings-group[hidden], [data-search][hidden], .settings-tools[hidden] { display: none; }
.settings-group { scroll-margin-top: 76px; background: var(--white); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; }
.settings-group h2 { font-size: 1.5rem; margin: 0 0 12px; }
.settings-group .field:last-child { margin-bottom: 0; }

/* AFM discount at checkout */
.afm-form { margin: 0 0 18px; padding: 14px 16px; background: var(--white); border-radius: var(--r); }
.afm-form > p { margin: 0 0 10px; }
.afm-form .opt { margin-bottom: 12px; }

/* Closed until a rider says they race with the AFM */
.afm-toggle, .afm-toggle[open] { background: none; border: 0; box-shadow: none; padding: 0; margin: 0 0 14px; }
.afm-toggle summary { cursor: pointer; font-weight: 600; padding: 4px 0; color: var(--z2); list-style-position: inside; }
.afm-toggle summary:focus-visible { outline: 3px solid var(--z2); outline-offset: 2px; }
.afm-toggle .afm-form { margin-top: 10px; }

/* ---------- Pages, blog and image library ---------- */
.prose { max-width: 780px; }
.prose h2, .prose h3 { margin-top: 1.2em; }
.prose blockquote { border-left: 4px solid var(--z2); margin: 1.2em 0; padding: 4px 0 4px 18px; }
.block-figure { margin: 0 0 1.2em; }
.block-figure figcaption { margin-top: 8px; }
.block-gallery-img { aspect-ratio: 3 / 2; height: auto; }
.blog-item { padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid #d9dcd6; }
.blog-item:last-of-type { border-bottom: 0; }
.blog-item h2 { margin-top: .6em; }
.blog-item h2 a { color: inherit; }
.block-card { margin-bottom: 18px; scroll-margin-top: 16px; }
.block-tools { margin-top: 10px; }
.block-qa { border: 1px solid #d9dcd6; border-radius: var(--r); margin: 0 0 14px; padding: 12px 14px; }
.card .field input[type=text], .card .field textarea { width: 100%; font: 400 1rem var(--body); padding: 8px 10px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; }
.field-label { font-weight: 600; display: block; margin-bottom: 6px; }
.media-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; max-height: 300px; overflow-y: auto; }
.media-choice { display: grid; gap: 4px; justify-items: start; align-content: start; cursor: pointer; }
.media-choice img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.media-card { padding: 12px; display: grid; gap: 8px; align-content: start; }
.media-card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r); }
.media-card form { display: grid; gap: 6px; justify-items: start; }
.media-alt { width: 100%; font: 400 .95rem var(--body); padding: 6px 8px; border: 2px solid var(--ink); border-radius: var(--r); }
.nav-tools { white-space: nowrap; }
.nav-add { margin-top: 12px; }

/* ---------- Backups ---------- */
.backup-get { margin: 0; flex-wrap: nowrap; }
.backup-get input[type=password] { max-width: 170px; }
.guide-toc { background: #fff; border: 1px solid #d9dcd6; border-radius: var(--r); padding: 16px 20px; margin: 20px 0 8px; }
.guide-toc h2 { margin: 0 0 8px; font-size: 1.2rem; }
.guide-toc ul { columns: 2; column-gap: 28px; margin: 0; padding-left: 18px; }
.guide-toc li { break-inside: avoid; margin-bottom: 4px; }
.guide-section, .guide-toc { scroll-margin-top: 90px; }
.guide-flow { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px 20px; margin: 16px 0; }
.guide-flow dt { font-weight: 700; }
.guide-flow dd { margin: 0; }
.guide-flow ul { margin: 0; padding-left: 18px; }
.guide-flow li + li { margin-top: 4px; }
.guide-top { font-size: .9rem; }
@media (max-width: 720px) { .guide-toc ul { columns: 1; } .guide-flow { grid-template-columns: minmax(0, 1fr); gap: 4px; } .guide-flow dd { margin-bottom: 10px; } }
.backup-line { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; font-size: .85rem; }
