/* RMS Race Day theme — red, black, white. */
:root {
  --rms-red: #e10600;
  --rms-red-600: #c00500;
  --rms-red-050: #fdeceb;
  --rms-black: #0d0d0f;
  --rms-ink: #17171b;
  --rms-ink-2: #23232a;
  --rms-text: #1b1b1f;
  --rms-muted: #6b6b76;
  --rms-line: #e7e7ec;
  --rms-bg: #f4f4f6;
  --rms-card: #ffffff;
  --rms-sidebar-w: 252px;
  --rms-radius: 14px;
  --bs-primary: var(--rms-red);
  --bs-primary-rgb: 225, 6, 0;
  --bs-link-color: var(--rms-red);
  --bs-link-color-rgb: 225, 6, 0;
  --bs-link-hover-color: var(--rms-red-600);
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--rms-text);
  --bs-body-bg: var(--rms-bg);
  --bs-border-color: var(--rms-line);
}

body { background: var(--rms-bg); font-size: .925rem; }
.display-font, .rms-title, .rms-stat-value, .rms-brand-text, .rms-date-block .day, .rms-hero .countdown {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
}
a { text-decoration: none; }
.min-w-0 { min-width: 0; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- shell ---------- */
.rms-shell { display: flex; min-height: 100vh; }
.rms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rms-content { padding: 1.5rem 2rem 3rem; }

.rms-sidebar {
  /* Bootstrap's .offcanvas-lg forces a transparent background on desktop */
  background: var(--rms-black) !important;
  color: #c9c9d1;
  display: flex;
  flex-direction: column;
}
@media (min-width: 992px) {
  .rms-sidebar {
    position: sticky; top: 0; height: 100vh;
    width: var(--rms-sidebar-w); flex: 0 0 var(--rms-sidebar-w);
    overflow-y: auto;
    scrollbar-width: none; /* still scrolls; a visible scrollbar pushes the logo off-centre */
  }
  .rms-sidebar::-webkit-scrollbar { display: none; }
}
@media (max-width: 991.98px) {
  .rms-sidebar { --bs-offcanvas-width: 272px; --bs-offcanvas-bg: var(--rms-black); }
  .rms-content { padding: 1rem 1rem 2.5rem; }
}

.rms-brand { position: relative; padding: 1.1rem 1.25rem .75rem; }
.rms-brand .btn-close { position: absolute; top: .75rem; right: .75rem; }
.rms-brand-link { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.rms-logo { width: 100%; max-width: 200px; height: auto; display: block; }
/* letter-spacing adds trailing space after the last letter; pad the left to match so the text centres */
.rms-brand-text { color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; padding-left: .32em; }
.rms-checker {
  height: 8px; margin: 0 1.25rem .75rem; opacity: .9; border-radius: 2px;
  background:
    conic-gradient(#fff 25%, transparent 0 50%, #fff 0 75%, transparent 0) 0 0 / 8px 8px,
    var(--rms-ink-2);
}

.rms-nav, .rms-nav-actions { padding: .25rem .75rem; display: flex; flex-direction: column; gap: 2px; }
.rms-nav-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #6f6f7c;
  padding: .9rem .75rem .35rem; font-weight: 600;
}
.rms-nav-link {
  position: relative; display: flex; align-items: center; gap: .75rem;
  padding: .62rem .8rem; border-radius: 10px; color: #c9c9d1; font-weight: 500;
  transition: background .15s, color .15s;
}
.rms-nav-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; }
.rms-nav-link:hover { background: var(--rms-ink-2); color: #fff; }
.rms-nav-link.active { background: linear-gradient(90deg, rgba(225, 6, 0, .28), rgba(225, 6, 0, .06)); color: #fff; }
.rms-nav-link.active::before {
  content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--rms-red);
}
.rms-nav-link.active i { color: var(--rms-red); }

.rms-quick {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  background: transparent; border: 1px dashed #34343d; color: #c9c9d1;
  padding: .5rem .8rem; border-radius: 10px; font-size: .85rem; text-align: left;
  transition: border-color .15s, color .15s, background .15s;
}
.rms-quick:hover { border-color: var(--rms-red); color: #fff; background: rgba(225, 6, 0, .08); }
.rms-sidebar-foot {
  margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid #1f1f25;
  display: flex; align-items: center; justify-content: space-between; color: #6f6f7c;
}

.rms-topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 2rem; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rms-line);
}
@media (max-width: 991.98px) { .rms-topbar { padding: .75rem 1rem; } }
.rms-eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--rms-red); font-weight: 700; }
.rms-title { font-size: 1.9rem; font-weight: 700; margin: 0; line-height: 1.05; text-transform: uppercase; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; }
.btn-rms { background: var(--rms-red); border-color: var(--rms-red); color: #fff; }
.btn-rms:hover, .btn-rms:focus { background: var(--rms-red-600); border-color: var(--rms-red-600); color: #fff; }
.btn-dark-rms { background: var(--rms-ink); color: #fff; border-color: var(--rms-ink); }
.btn-dark-rms:hover { background: #000; color: #fff; }
.btn-outline-rms { border: 1px solid var(--rms-line); background: #fff; color: var(--rms-text); }
.btn-outline-rms:hover { border-color: var(--rms-red); color: var(--rms-red); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; color: var(--rms-muted); background: transparent; }
.btn-icon:hover { background: var(--rms-bg); color: var(--rms-text); border-color: var(--rms-line); }
.btn-icon.text-danger:hover { color: var(--rms-red) !important; background: var(--rms-red-050); }
.rms-topbar .btn-icon { font-size: 1.4rem; color: var(--rms-text); }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: rgba(225, 6, 0, .5); box-shadow: 0 0 0 .2rem rgba(225, 6, 0, .15);
}
.form-check-input:checked { background-color: var(--rms-red); border-color: var(--rms-red); }
.form-label { font-size: .8rem; font-weight: 600; color: var(--rms-muted); margin-bottom: .3rem; }

/* ---------- cards ---------- */
.rms-card { background: var(--rms-card); border: 1px solid var(--rms-line); border-radius: var(--rms-radius); box-shadow: 0 1px 2px rgba(16, 16, 20, .04); }
.rms-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--rms-line); }
.rms-card-head h2, .rms-card-head h3 { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .5rem; }
.rms-card-head h2 i, .rms-card-head h3 i { color: var(--rms-red); }
.rms-card-body { padding: 1.25rem; }
.rms-card.hoverable { transition: transform .15s, box-shadow .15s, border-color .15s; }
.rms-card.hoverable:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 16, 20, .08); border-color: #d9d9e0; }

.rms-stat { padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.rms-stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--rms-red-050); color: var(--rms-red); font-size: 1.3rem; flex: 0 0 auto; }
.rms-stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.rms-stat-label { font-size: .78rem; color: var(--rms-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

.rms-hero {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--rms-radius);
  background: radial-gradient(120% 140% at 100% 0%, rgba(225, 6, 0, .55), transparent 55%), var(--rms-black);
  padding: 1.5rem 1.75rem;
}
.rms-hero::after {
  content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 180px; transform: skewX(-18deg); opacity: .12;
  background: conic-gradient(#fff 25%, transparent 0 50%, #fff 0 75%, transparent 0) 0 0 / 22px 22px;
}
.rms-hero .label { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; color: #ff8a85; font-weight: 700; }
.rms-hero h2 { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 2.1rem; margin: .2rem 0; text-transform: uppercase; }
.rms-hero .countdown { font-size: 3.4rem; font-weight: 800; font-style: italic; line-height: 1; }
.rms-hero .countdown small { font-size: 1rem; font-style: normal; font-weight: 600; letter-spacing: .1em; color: #bdbdc6; }

/* ---------- tables ---------- */
.table-rms { margin: 0; --bs-table-bg: transparent; --bs-table-hover-bg: #fafafb; }
.table-rms thead th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rms-muted);
  font-weight: 700; background: #fafafb; border-bottom: 1px solid var(--rms-line); padding: .7rem 1rem; white-space: nowrap;
}
.table-rms td { padding: .7rem 1rem; vertical-align: middle; border-color: var(--rms-line); }
.table-rms tbody tr:last-child td { border-bottom: 0; }
.table-rms tr[data-href] { cursor: pointer; }
.table-rms .actions { white-space: nowrap; text-align: right; width: 1%; }

/* ---------- bits ---------- */
.avatar { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; flex: 0 0 auto;
  background: var(--rms-ink); color: #fff; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.05rem; font-style: italic; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 14px; }
.avatar.red { background: var(--rms-red); }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600;
  padding: .2rem .55rem; border-radius: 999px; background: var(--rms-bg); color: var(--rms-text); border: 1px solid var(--rms-line); white-space: nowrap; }
.chip.red { background: var(--rms-red-050); color: var(--rms-red-600); border-color: #f8cfcd; }
.chip.dark { background: var(--rms-ink); color: #fff; border-color: var(--rms-ink); }
.chip.green { background: #e8f6ee; color: #18794e; border-color: #c6ead6; }
.chip.amber { background: #fff4e0; color: #9a5b00; border-color: #fde2b0; }
.lap { font-variant-numeric: tabular-nums; font-weight: 700; }
.lap.best { color: var(--rms-red); }
.pos { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 8px; font-weight: 800;
  font-family: "Barlow Condensed", sans-serif; font-size: 1.05rem; background: var(--rms-bg); }
.pos.p1 { background: #f5c518; color: #2b2100; }
.pos.p2 { background: #d5d7dc; }
.pos.p3 { background: #e0a46b; color: #3a1d00; }
.muted { color: var(--rms-muted); }
.small-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rms-muted); font-weight: 700; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--rms-muted); }
.empty i { font-size: 2rem; color: #c8c8d0; display: block; margin-bottom: .5rem; }

.rms-alert { border-radius: 12px; border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.rms-modal .modal-content { border-radius: 16px; border: 0; }
.rms-modal .modal-header { border-bottom: 1px solid var(--rms-line); }
.rms-modal .modal-header .modal-title { font-weight: 700; text-transform: capitalize; }
.rms-modal .modal-header { border-top: 4px solid var(--rms-red); border-radius: 16px 16px 0 0; }
.rms-form-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--rms-red);
  padding-top: .5rem; border-top: 1px solid var(--rms-line); }
.row > .col-12:first-child .rms-form-section { border-top: 0; padding-top: 0; }

/* Setup cards / spec grids */
.setup-card .gear { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.6rem; line-height: 1; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.spec { background: #fafafb; border: 1px solid var(--rms-line); border-radius: 10px; padding: .6rem .8rem; }
.spec .v { font-weight: 600; margin-top: .15rem; word-break: break-word; }
.spec.highlight { background: var(--rms-black); color: #fff; border-color: var(--rms-black); }
a.spec.highlight.text-reset { color: #fff !important; }  /* clickable tiles: keep the numbers white */
a.spec.highlight:hover { border-color: var(--rms-red); }
.spec.highlight .small-label { color: #9a9aa6; }
.spec.highlight .v { font-family: "Barlow Condensed", sans-serif; font-size: 1.5rem; line-height: 1.1; }
.spec.highlight.red .v { color: #ff6b66; }


/* Schedule */
.rms-month { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; font-weight: 700; font-size: 1.25rem;
  letter-spacing: .04em; margin: 1.5rem 0 .75rem; display: flex; align-items: center; gap: .75rem; }
.rms-month::after { content: ""; flex: 1; height: 1px; background: var(--rms-line); }
.rms-event { display: flex; gap: 1rem; align-items: stretch; padding: 1rem; }
.rms-date-block { flex: 0 0 64px; border-radius: 12px; background: var(--rms-black); color: #fff; text-align: center; padding: .45rem 0; }
.rms-date-block .dow { font-size: .65rem; letter-spacing: .14em; color: #ff6b66; font-weight: 700; text-transform: uppercase; }
.rms-date-block .day { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.rms-date-block .mon { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #b0b0ba; }
.rms-event.is-race .rms-date-block { background: var(--rms-red); }
.rms-event.is-race .rms-date-block .dow, .rms-event.is-race .rms-date-block .mon { color: #ffe1df; }
.rms-event.is-cancelled { opacity: .55; }
.rms-event.is-cancelled h3 { text-decoration: line-through; }
.rms-event h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-bar .form-select, .filter-bar .form-control { width: auto; min-width: 150px; border-radius: 10px; }
@media (max-width: 575.98px) {
  .filter-bar > * { flex: 1 1 100%; width: 100% !important; }
  .rms-title { font-size: 1.5rem; }
}
.nav-pills-rms .nav-link { color: var(--rms-muted); border-radius: 999px; font-weight: 600; padding: .35rem .9rem; }
.nav-pills-rms .nav-link.active { background: var(--rms-ink); color: #fff; }

.compare-table td.diff { background: var(--rms-red-050); font-weight: 600; }
.compare-table th:first-child, .compare-table td:first-child { color: var(--rms-muted); font-weight: 600; width: 180px; }

/* ---------- race-day command bar ---------- */
.rms-topbar { flex-wrap: wrap; }
.rms-cmd { position: relative; flex: 0 1 440px; min-width: 260px; display: flex; align-items: center; }
.rms-cmd .form-control {
  padding-left: 2.4rem; padding-right: 4rem; height: 42px; border-radius: 12px;
  background: var(--rms-black); color: #fff; border-color: var(--rms-black);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92rem; letter-spacing: .02em;
}
.rms-cmd .form-control::placeholder { color: #7a7a86; }
.rms-cmd .form-control:focus { background: var(--rms-black); color: #fff; border-color: var(--rms-red); }
.rms-cmd-icon { position: absolute; left: .85rem; color: var(--rms-red); font-size: 1.05rem; pointer-events: none; }
.rms-cmd-kbd { position: absolute; right: 2.5rem; background: #2a2a31; color: #aaa; font-size: .72rem; border-radius: 5px; padding: .1rem .4rem; }
.rms-cmd-help { position: absolute; right: .6rem; background: none; border: 0; color: #8b8b96; padding: 0; font-size: 1.05rem; }
.rms-cmd-help:hover { color: #fff; }
.rms-cmd-preview {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1060; min-width: 320px;
  background: #fff; border: 1px solid var(--rms-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .16); overflow: hidden;
}
.cmd-item { display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .85rem; border-bottom: 1px solid var(--rms-line); }
.cmd-item .chip { flex: 0 0 auto; }
.cmd-change { display: inline-block; margin-right: .5rem; font-size: .85rem; }
.cmd-change strong { color: var(--rms-red); }
.cmd-warn { color: #9a5b00; }
.cmd-foot { font-size: .72rem; color: var(--rms-muted); padding: .45rem .85rem; background: #fafafb; }
@media (max-width: 1199.98px) {
  .rms-cmd { order: 3; flex: 1 1 100%; }
}
.popover code { color: var(--rms-red); }

/* lineup */
.lineup td[data-cmd] { cursor: text; font-variant-numeric: tabular-nums; font-weight: 600; }
.lineup td[data-cmd]:hover { background: var(--rms-red-050); color: var(--rms-red-600); box-shadow: inset 0 -2px 0 var(--rms-red); }
.lineup .num { font-family: "Barlow Condensed", sans-serif; font-style: italic; font-weight: 800; font-size: 1.5rem; color: var(--rms-red); }
.delta { font-size: .75rem; font-weight: 600; margin-left: .35rem; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--rms-muted); }
.delta.down { color: #18794e; }
.change-row { display: flex; gap: .75rem; align-items: center; padding: .55rem 0; border-top: 1px dashed var(--rms-line); }
.change-row:first-child { border-top: 0; }
.change-row code { color: var(--rms-text); background: var(--rms-bg); padding: .1rem .4rem; border-radius: 6px; white-space: nowrap; }
.lineup td:nth-child(4) { min-width: 150px; }
.results-grid td { padding: .4rem .5rem; }
.results-grid td:first-child { padding-left: 1rem; }
.results-grid input[type=number] { width: 72px; }
.results-grid input[name^=lap_] { width: 96px; }
.results-grid input[name^=points_] { width: 72px; }
.results-grid select { min-width: 220px; }
.num-sm { font-family: "Barlow Condensed", sans-serif; font-style: italic; font-weight: 800; color: var(--rms-red); font-size: 1.1rem; }

/* ---------- auth ---------- */
.rms-signout { background: none; border: 0; padding: 0; color: #9a9aa6; font-size: .82rem; display: inline-flex; align-items: center; gap: .35rem; }
.rms-signout:hover { color: #fff; }
.rms-login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem;
  background: radial-gradient(120% 90% at 100% 0%, rgba(225, 6, 0, .35), transparent 55%), var(--rms-black); }
.rms-login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 2rem 1.75rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45); border-top: 5px solid var(--rms-red); }
.rms-login-logo { display: block; width: 220px; max-width: 80%; margin: 0 auto 1.25rem; }
.rms-login-card h1 { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; font-weight: 700; font-size: 1.6rem; text-align: center; margin: 0 0 1.25rem; }
.rms-login-card .form-control { height: 46px; border-radius: 12px; }
.rms-login-public { text-align: center; margin-top: 1.25rem; font-size: .85rem; }
.rms-login-public a { color: #cfcfd6; }
.rms-login-public a:hover { color: #fff; }

/* ---------- results & standings ---------- */
.results-grid .grid-group { border-bottom: 2px solid var(--rms-red) !important; color: var(--rms-text); }
.results-grid .grid-split { border-left: 1px solid var(--rms-line); }
.standings td, .standings th { white-space: nowrap; }
.standings .round { text-align: right; min-width: 52px; font-variant-numeric: tabular-nums; }
.standings .round.dropped { color: #b8b8c2; text-decoration: line-through; }
.standings .round.missed { color: #c8c8d0; }
.standings .counted { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.25rem; }
.standings th.round a { color: inherit; }
.drop-chip { font-size: .62rem; font-weight: 700; color: var(--rms-red-600); background: var(--rms-red-050); border-radius: 4px; padding: 0 .25rem; margin-left: .2rem; text-decoration: none; display: inline-block; }
.session-cell small { display: block; font-size: .7rem; color: var(--rms-muted); line-height: 1.1; }
.results-grid .grid-kart { width: 64px; }
.results-grid .grid-class { min-width: 104px; }
.standings .session-chip { color: var(--rms-muted); background: var(--rms-bg); }
/* finishing positions: 1 gold, 2 silver, 3 bronze */
.place { font-variant-numeric: tabular-nums; }
.place.gold, .place.silver, .place.bronze { font-weight: 800; }
.place.gold { color: #c99700; }
.place.silver { color: #7d8794; }
.place.bronze { color: #b06a2c; }
.standings .round-start { border-left: 1px solid var(--rms-line); }
.standings.split .round { min-width: 38px; padding-left: .45rem; padding-right: .45rem; }
.standings thead .round-group { text-align: center; border-left: 1px solid var(--rms-line); }
.standings thead .heat { font-size: .62rem; color: var(--rms-muted); }
/* races hierarchy */
.season-card { overflow: hidden; }
.season-year { font-family: "Barlow Condensed", sans-serif; font-style: italic; font-weight: 800; font-size: 3rem; line-height: 1;
  color: #fff; padding: 1rem 1.25rem; background: radial-gradient(120% 140% at 100% 0%, rgba(225, 6, 0, .6), transparent 60%), var(--rms-black); }
.rms-back { border: 1px solid var(--rms-line); background: #fff; color: var(--rms-text); height: 38px; display: inline-flex;
  align-items: center; gap: .15rem; padding: 0 .75rem; flex: 0 0 auto; }
.rms-back:hover { border-color: var(--rms-red); color: var(--rms-red); }
.nav-pills-sm .nav-link { font-size: .8rem; padding: .2rem .7rem; }
.class-tag strong { color: var(--rms-red); font-weight: 800; }
.tire-pos { display: inline-block; min-width: 1.1rem; text-align: center; font-size: .65rem; font-weight: 800; color: #fff;
  background: var(--rms-ink); border-radius: 4px; margin-right: .15rem; }
.session-cell small.lap { font-weight: 600; color: var(--rms-text); }
.rms-cmd { flex-wrap: wrap; }
.rms-raceday { position: absolute; top: calc(100% + 2px); left: .6rem; font-size: .7rem; color: var(--rms-red); font-weight: 600; white-space: nowrap; }
.rms-raceday a { color: inherit; text-decoration: underline; }
.rms-raceday-x { background: none; border: 0; padding: 0 .2rem; color: var(--rms-muted); font-size: .9rem; line-height: 1; }
.rms-raceday-x:hover { color: var(--rms-red); }
/* times page */
.times-filters > summary { list-style: none; }
.times-filters > summary::-webkit-details-marker { display: none; }
.times-filters[open] { flex-basis: 100%; }
.times-race > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; }
.times-race > summary::-webkit-details-marker { display: none; }
.times-race > summary:hover { background: #fafafb; border-radius: var(--rms-radius); }
.times-chevron { color: var(--rms-muted); transition: transform .15s; }
.times-race[open] .times-chevron { transform: rotate(90deg); color: var(--rms-red); }
.times-race[open] > summary { border-bottom: 1px solid var(--rms-line); }
.times-grid td, .times-grid th, .bests-grid td, .bests-grid th { padding: .45rem .7rem; }
.bests-grid thead th { white-space: normal; min-width: 96px; }
/* race day */
/* Race day's event switcher: a red pill with its own chevron, sized to the chosen event. */
.raceday-picker { appearance: none; -webkit-appearance: none; field-sizing: content; max-width: 100%; cursor: pointer;
  color: var(--rms-red); font-weight: 700; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid rgba(225, 6, 0, .35); border-radius: 999px; padding: .3rem 1.9rem .3rem .75rem; margin-bottom: .2rem;
  background: var(--rms-red-050) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23e10600' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right .65rem center / 11px;
  transition: border-color .12s, box-shadow .12s; }
.raceday-picker:hover, .raceday-picker:focus { border-color: var(--rms-red); box-shadow: 0 0 0 3px rgba(225, 6, 0, .12); outline: 0; }
.raceday-num { font-family: "Barlow Condensed", sans-serif; font-style: italic; font-weight: 800; font-size: 1.9rem; line-height: 1;
  color: #fff; background: var(--rms-red); border-radius: 10px; padding: .15rem .55rem; min-width: 52px; text-align: center; }
.raceday-tray { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
.tray-setup { display: flex; gap: .5rem; align-items: center; padding: .45rem .5rem; border: 1px solid var(--rms-line); border-radius: 10px;
  margin-bottom: .35rem; background: #fff; cursor: grab; }
.tray-setup:hover { border-color: var(--rms-red); }
.tray-setup:active { cursor: grabbing; }
.dragging-setup .raceday-card { outline: 2px dashed #f2b4b1; outline-offset: -2px; }
.raceday-card.drop-target { outline: 3px solid var(--rms-red) !important; background: var(--rms-red-050); }

/* Weekend format */
.weekend { display: flex; flex-wrap: wrap; gap: 1rem 1.75rem; }
.weekend-day .small-label { margin-bottom: .3rem; }
.session-chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; font-weight: 600; padding: .25rem .6rem;
  border-radius: 999px; border: 1px solid var(--rms-line); background: #fff; color: var(--rms-text); white-space: nowrap; }
.session-chip small { color: var(--rms-muted); font-weight: 500; }
.session-chip.kind-practice { background: var(--rms-bg); }
.session-chip.kind-qualifying, .session-chip.kind-heat, .session-chip.kind-race, .session-chip.kind-prefinal { border-color: #bdbdc6; }
.session-chip.kind-feature { background: var(--rms-ink); border-color: var(--rms-ink); color: #fff; }
.session-chip.kind-feature small { color: #c9c9d1; }
.session-chip.done { opacity: .55; }
.session-chip.done i { color: #198754; }
.session-chip.next { border-color: var(--rms-red); box-shadow: 0 0 0 2px rgba(225, 6, 0, .18); }
.session-chip.next i { color: var(--rms-red); }
.format-table select[name=day] { min-width: 125px; }
.format-table select[name=kind] { min-width: 120px; }
.format-table input[name=time] { min-width: 110px; }
.format-table input[name=name] { min-width: 140px; }
.format-dates input[type=date] { width: auto; }

/* Log run stepper */
.log-shared { background: var(--rms-bg); border-radius: 10px; padding: .6rem .5rem; margin-left: 0; margin-right: 0; }
.step-dots { display: flex; flex-wrap: wrap; gap: .35rem; }
.step-dot { min-width: 2.2rem; height: 2.2rem; padding: 0 .45rem; border-radius: 999px; border: 1px solid var(--rms-line); background: #fff;
  font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1rem; color: var(--rms-muted); }
.step-dot.filled { background: var(--rms-red-050); border-color: var(--rms-red); color: var(--rms-red); }
.step-dot.active { background: var(--rms-red); border-color: var(--rms-red); color: #fff; }
.log-step .form-control, .log-step .form-select { font-size: 1rem; }
button.session-chip { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
button.session-chip:hover { border-color: var(--rms-red); box-shadow: 0 0 0 2px rgba(225, 6, 0, .12); }
.day-report { white-space: pre-wrap; word-break: break-word; font-size: .82rem; line-height: 1.5; padding: 1rem 1.25rem;
  max-height: 70vh; overflow: auto; background: transparent; }
.pen-chip { display: inline-block; margin-left: .3rem; padding: 0 .35rem; border-radius: 6px; font-size: .68rem; font-weight: 800;
  line-height: 1.5; background: #fff3cd; color: #7a5300; border: 1px solid #f0d68a; vertical-align: middle; cursor: help; }
.pos.out { min-width: 38px; font-size: .75rem; background: var(--rms-bg); color: var(--rms-muted); }
.results-grid .grid-cls { min-width: 82px; }
.pen-edit { display: block; width: 100%; max-width: 150px; margin-top: .25rem; padding: .05rem .4rem; border-radius: 6px;
  font-size: .7rem; font-weight: 700; text-align: left; background: #fff3cd; color: #7a5300; border: 1px solid #f0d68a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pen-edit[hidden] { display: none; }
.pen-popup { position: fixed; z-index: 1080; width: 250px; padding: .75rem; background: #fff; border: 1px solid var(--rms-line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
button.pen-chip { font-family: inherit; }
.results-grid .grid-lap { min-width: 92px; }
.pen-chip { white-space: nowrap; }
@media (min-width: 1200px) { .results-grid-dialog { max-width: min(1500px, 96vw); } }

/* Public home page */
.home-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; position: relative; z-index: 1; }
.home-total { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: .8rem 1rem; }
.home-total .v { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-style: italic; font-size: 3rem; line-height: 1; }
.home-total .l { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: #bdbdc6; }
.home-total.gold .v { color: #f5c518; }
@media (max-width: 575.98px) { .home-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-total .v { font-size: 2.3rem; } }
.honour { display: flex; align-items: center; gap: 1rem; border-left: 4px solid var(--rms-line); }
.honour-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; flex: 0 0 auto;
  background: var(--rms-bg); color: var(--rms-muted); }
.honour-title { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 800; color: var(--rms-red); }
.honour.p1 { border-left-color: #f5c518; } .honour.p1 .honour-icon { background: #fff6d6; color: #c99a00; }
.honour.p2 { border-left-color: #b9bcc4; } .honour.p2 .honour-icon { background: #eef0f3; color: #7d828c; }
.honour.p3 { border-left-color: #e0a46b; } .honour.p3 .honour-icon { background: #fbeee2; color: #b5672a; }
.home-next { display: block; padding: .6rem 0; border-bottom: 1px solid var(--rms-line); }
.home-next:last-child { border-bottom: 0; }
.home-next:hover .fw-semibold { color: var(--rms-red); }
