/*
 * f1-theme.css — FEA Class Racing (formerly FEA-StudioPRO-F1), the STEM Racing edition theme.
 *
 * Loaded LAST (after tokens.css, app.css, features.css). It re-points the DesignClass tokens at the
 * StudioPro-F1 livery (dark race purple, magenta, teal, the hot magenta → orange gradient, kerb
 * stripes, blueprint grid) and then fixes the few places where the main edition's CSS hard-codes a
 * light-page colour. The engine CSS files are unchanged, so engine fixes port across cleanly
 * (see FORK.md). No STEM Racing / F1 logos are used anywhere: the DesignClass mark stays.
 *
 * Fonts (all SIL Open Font Licence 1.1, self-hosted in fonts/, licences alongside):
 *   Poppins (body text, unchanged) · Barlow Condensed (display headings) · Chakra Petch (labels, numbers).
 */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: italic; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-style: italic; font-display: swap; src: url("../fonts/barlow-condensed-latin-800-italic.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/chakra-petch-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); }
/* Chakra Petch has no 700: bold labels use 600 (the browser would otherwise fake-bold it). */
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); }

/* ------------------------------------------------------------------ tokens */
:root {
  /* StudioPro-F1 palette */
  --f1-ink: #0A0318;  --f1-paper: #12052A;  --f1-card: #2A0C4C;  --f1-card-2: #2F1052;  --f1-field: #4B3373;
  --f1-magenta: #E6007E;  --f1-teal: #2FD6C9;  --f1-orange: #ED6D05;  --f1-yellow: #FFCC00;  --f1-lime: #95C11F;
  --f1-lilac: #BDB4D8;
  --hot: linear-gradient(100deg, #961B81 0%, #E6007E 52%, #ED6D05 100%);
  /* white words on a gradient: the orange end is darkened so white text keeps 4.5 : 1 there too */
  --hot-btn: linear-gradient(100deg, #961B81 0%, #E6007E 52%, #C04F00 100%);
  --hot-text: linear-gradient(100deg, #FF4FA8 0%, #E6007E 45%, #ED6D05 100%);
  --kerb: repeating-linear-gradient(-60deg, #E6007E 0 14px, #FFFFFF 14px 28px);
  --blueprint-lines: rgba(117, 111, 144, .09);

  /* DesignClass token names, re-pointed (every component in app.css / features.css follows) */
  --ink: #0A0318;
  --ink2: #160832;
  --paper: #12052A;
  --white: #2A0C4C;          /* "white" = a card / field surface in the main edition */
  --blue: #E6007E;           /* action = STEM Racing magenta */
  --blue-d: #B8006A;
  --cyan: #2FD6C9;           /* highlight = teal */
  --text: #FFFFFF;
  --pencil: #BDB4D8;
  --faint: #A99FC4;
  --field-line: #4B3373;
  --track: rgba(205, 198, 224, .14);
  --level-pill: #3A1A60;
  --placeholder: #2F1052;
  --fact-text: #E9E4F5;
  --tb-text: #E9E4F5;
  --body-dark: #CDC6E0;
  --dim-text: #BDB4D8;
  --lens-label: #A99FC4;
  --tb-label: #A99FC4;
  --line-light: rgba(205, 198, 224, .16);
  --line-dark: rgba(170, 140, 230, .26);
  --grid-dark: var(--blueprint-lines);
  --grid-paper: rgba(117, 111, 144, .07);
  --scribble: #ED6D05;

  /* Traffic lights on dark purple: same hues, tints become dark washes, text colours go light. */
  --ok: #22B566;
  --warn: #F2A516;
  --bad: #FF4D5E;
  --ok-tint: rgba(34, 181, 102, .16);
  --warn-tint: rgba(242, 165, 22, .16);
  --bad-tint: rgba(255, 77, 94, .17);
  --ok-text: #7EE2A8;
  --warn-text: #FFD666;
  --bad-text: #FF9AA5;

  --mono: "Chakra Petch", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  --shadow-card-hover: 0 28px 50px -24px rgba(0, 0, 0, .8);
  --shadow-window: 0 30px 60px -30px rgba(0, 0, 0, .85);
  --shadow-primary: 0 10px 24px -12px rgba(230, 0, 126, .75);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
body { background: var(--paper); }
::selection { background: rgba(230, 0, 126, .35); }
:focus-visible, .on-dark :focus-visible, .ink :focus-visible, .app-header :focus-visible { outline-color: var(--f1-yellow); }
.vp-btn:focus-visible, .process-select:focus-visible { outline-color: var(--f1-yellow); }
a { color: #FF6FB5; }                    /* magenta text on purple needs a lighter tint (4.5 : 1) */
a:hover { color: #FF9CCB; }
h1, h2, .level-card h3, .fx-verdict-title, .modal-head h2 {
  font-family: var(--display); font-style: italic; font-weight: 800; letter-spacing: .005em; text-transform: uppercase;
}
h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
.panel-head h2 { font-size: 1.75rem; }
.paper {
  background-image: linear-gradient(var(--grid-paper) 1px, transparent 1px), linear-gradient(90deg, var(--grid-paper) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ------------------------------------------------------------------ header + kerb */
.app-header {
  background: radial-gradient(55% 220% at 82% 0%, rgba(150, 27, 129, .45), transparent 70%),
              radial-gradient(40% 160% at 20% 100%, rgba(58, 13, 85, .9), transparent 70%), var(--ink);
  border-bottom: 0;
}
.app-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--kerb); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line-dark); }
.brand-eyebrow { font: 600 .66rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); white-space: nowrap; }
.brand-name { font: italic 800 1.5rem/1 var(--display); letter-spacing: .005em; text-transform: uppercase; }
.brand-name b, .brand-name .brand-f1 {
  background: var(--hot-text); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em;
}
.brand-by { font-family: var(--mono); }
@media (max-width: 640px) { .brand-eyebrow, .brand-by { display: none; } .brand-name { font-size: 1.2rem; } }

/* ------------------------------------------------------------------ buttons (slanted, like the livery) */
.btn { border-radius: 4px; font: italic 700 1.08rem/1.1 var(--display); letter-spacing: .01em; }
.btn-sm { font-size: 1rem; }
.btn-primary {
  background: var(--hot-btn); border-color: transparent; padding-inline: 1.6em;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%); box-shadow: none;
}
.btn-primary:hover:not(:disabled) { background: var(--hot-btn); filter: brightness(.9); }
.btn-primary:focus-visible { outline-offset: -5px; }      /* the slant would cut an outside outline */
.btn-outline { border-color: rgba(255, 255, 255, .75); }
.btn-outline:hover:not(:disabled), .icon-btn:hover, .face-chip button:hover { background: rgba(255, 255, 255, .14); color: #fff; border-color: #fff; }
.btn-text { color: #FF6FB5; }
.btn-text:hover:not(:disabled) { background: rgba(230, 0, 126, .14); }
.btn-danger { color: var(--bad-text); border-color: var(--bad); }
.icon-btn { background: rgba(255, 255, 255, .05); border-color: var(--line-dark); }
.tag { border-color: rgba(255, 255, 255, .55); border-radius: 3px; }
.tag > b { background: var(--hot); border-right-color: transparent; }

/* ------------------------------------------------------------------ pills, notices, forms */
.pill { color: var(--fact-text); }
.pill-ok { color: var(--ok-text); } .pill-warn { color: var(--warn-text); } .pill-bad { color: var(--bad-text); }
.pill-blue { background: rgba(230, 0, 126, .2); color: #FF9CCB; }
.notice { background: rgba(230, 0, 126, .1); }
.field-error, .fx-breakit-err { color: var(--bad-text); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(230, 0, 126, .25); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23FFFFFF' stroke-width='2'/%3E%3C/svg%3E");
}
select option { background: var(--f1-card); color: #fff; }
input, select, textarea { background-color: var(--ink2); }
.seg > button[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* ------------------------------------------------------------------ cards and choices */
.card { box-shadow: 0 30px 50px -30px rgba(0, 0, 0, .75); border: 1px solid #33204F; border-radius: 8px; }
.card-dark { background: var(--ink2); }
.choice { border-radius: 8px; }
.choice[aria-pressed="true"] { box-shadow: 0 0 0 3px rgba(230, 0, 126, .3); }
.choice:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--cyan); box-shadow: 0 14px 28px -20px rgba(0, 0, 0, .8); }
.choice:disabled, .choice[aria-disabled="true"], .level-card[aria-disabled="true"] { background: rgba(42, 12, 76, .45); }
.level-card li::before { background: var(--cyan); }
.preset-card .sketch .face-top { fill: #4B2A78; }
.preset-card .sketch .face-x { fill: #3A1A60; }
.preset-card .sketch .face-z { fill: #2B1048; }
.preset-card .sketch polygon { stroke: #E9E4F5; }
.preset-card[aria-pressed="true"] .sketch polygon { stroke: var(--cyan); }
.pf-sketch path { fill: #3A1A60; }
.pf-preview-wrap { background: var(--ink2); }
.dropzone { background: rgba(42, 12, 76, .55); }
.dropzone.over { background: rgba(47, 214, 201, .08); border-color: var(--cyan); }
.face-swatch.support { background: repeating-linear-gradient(45deg, #A99FC4 0 2px, #2A0C4C 2px 5px); border-color: #A99FC4; }
.face-swatch.load { background: var(--blue); }
.face-chip { background: rgba(230, 0, 126, .16); }
.load-card.active { box-shadow: 0 0 0 3px rgba(230, 0, 126, .3); }

/* text that the main edition draws in ink on a light tint */
.fx-verdict-line-title, .tool-check-item, .fx-making-chip, .tool-check-badge, .is-todo .fx-check-icon { color: var(--text); }
.tool-check-item:hover { border-color: var(--cyan); }
.tool-check-item.tool-check-info, .tool-status { background: var(--ink2); }
.fx-radio-item:has(input:checked) { background: rgba(230, 0, 126, .12); }
.fx-breakit-tile[aria-checked="true"] { background: rgba(230, 0, 126, .2); }
.fx-race-badge { background: rgba(230, 0, 126, .14); border-color: rgba(230, 0, 126, .4); }
.fx-race-fos.fx-tone-bad { color: var(--bad-text); } .fx-race-fos.fx-tone-warn { color: var(--warn-text); } .fx-race-fos.fx-tone-ok { color: var(--ok-text); }
.fx-race-making.is-warn, .fx-race-large, .fx-race-status .is-changed .fx-race-sicon, .fx-race-table tr.is-changed .c-status { color: var(--warn-text); }
.fx-race-saved, .fx-cmp-bestmark, .fx-wwu-badge { color: var(--ok-text); }
.fx-print-verdict.fx-print-layer-split b, .fx-wwu-split b, .fx-wwu-split { color: #FF8FDB; }
.fx-fix-group, .fx-lc-table th, .fx-lc-table td { border-color: var(--line-light); }

/* ------------------------------------------------------------------ verdicts (race words in Explorer) */
.fx-verdict { border-radius: 8px; }
.fx-verdict::before { height: 6px; }
.fx-tone-ok .fx-verdict-title { color: var(--ok-text); }
.fx-tone-warn .fx-verdict-title { color: var(--warn-text); }
.fx-tone-bad .fx-verdict-title { color: var(--bad-text); }
.fx-verdict .fx-verdict-title { font-size: 2.1rem; line-height: 1; margin: 4px 0 8px; }
.fx-tone-bad.fx-verdict::before { background: repeating-linear-gradient(-60deg, var(--bad) 0 12px, #fff 12px 24px); }   /* a kerb for a DNF */

/* ------------------------------------------------------------------ sidebar, overlays, toasts */
.sheet-bar button[aria-current="step"] { color: #FF6FB5; }
.sheet-bar button[aria-current="step"]::after { background: var(--hot); }
.sidebar { scrollbar-color: var(--field-line) transparent; }
.panel-scroll { scrollbar-color: var(--field-line) transparent; }
.modal { border: 1px solid #33204F; border-radius: 8px; }
.modal-backdrop { background: rgba(10, 3, 24, .8); }
.toast { border-radius: 6px; background: #1B0838; }
.vp-group, .vp-hint, .vp-status { background: rgba(10, 3, 24, .86); }
.vp-btn[aria-pressed="true"] { background: var(--cyan); color: var(--ink); }
.vp-level .vp-btn { color: var(--cyan); }
.vp-drop { background: rgba(10, 3, 24, .82); }
.viewport.ink {
  background: radial-gradient(70% 90% at 72% 35%, rgba(58, 13, 85, .9) 0%, transparent 70%),
              linear-gradient(var(--blueprint-lines) 1px, transparent 1px) 0 0 / 40px 40px,
              linear-gradient(90deg, var(--blueprint-lines) 1px, transparent 1px) 0 0 / 40px 40px, var(--ink);
}
.title-block { background: var(--ink); }
.title-block .tb-label { color: var(--tb-label); }

/* Work title block: Part / Material / Process / Class / Level / Units / Sheet. */
#work-title-block { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .9fr) minmax(0, 1fr) max-content max-content; }
@media (max-width: 1299px) {
  #work-title-block { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .9fr) minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ start screen */
.hero {
  background-color: var(--ink);
  background-image:
    radial-gradient(ellipse 55% 75% at 76% 40%, rgba(150, 27, 129, .55), transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 100%, rgba(58, 13, 85, .9), transparent 70%),
    linear-gradient(var(--blueprint-lines) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint-lines) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--kerb); opacity: .9; }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 5rem); line-height: .98; }
.hero .eyebrow { color: var(--cyan); font-weight: 600; }
.cad-outline { -webkit-text-stroke: 2px var(--cyan); }
.solid-block::before { background: var(--hot); transform: skewX(-12deg); border-radius: 2px; }
.dial svg circle[fill="#4FE3FF"] { fill: var(--cyan); }
.process-pointer a { color: #FF6FB5; }
.start-foot .tb-logo img { height: 36px; }

/* start lights in the hero: they come on one by one, then go out ("lights out and away we go") */
.f1-start-lights { display: flex; width: max-content; gap: 10px; padding: 9px 14px; margin: 14px 0 2px; border-radius: 999px; background: #07020F; border: 1px solid #33204F; }
.f1-start-lights i { width: 16px; height: 16px; border-radius: 50%; background: #2B1B3B; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .6); animation: f1-start-light 5s infinite; }
.f1-start-lights i:nth-child(2) { animation-delay: .5s; } .f1-start-lights i:nth-child(3) { animation-delay: 1s; }
.f1-start-lights i:nth-child(4) { animation-delay: 1.5s; } .f1-start-lights i:nth-child(5) { animation-delay: 2s; }
@keyframes f1-start-light {
  0%, 2% { background: #2B1B3B; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .6); }
  4%, 60% { background: #FF2A3A; box-shadow: 0 0 12px 2px rgba(255, 42, 58, .65); }
  62%, 100% { background: #2B1B3B; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .6); }
}
@media (prefers-reduced-motion: reduce) { .f1-start-lights i { animation: none; background: #FF2A3A; } }

/* class cards (Entry / Development / Professional) */
.f1-class-card { border: 1.5px solid #33204F; }
.f1-class-card::before { height: 8px; background: repeating-linear-gradient(-60deg, var(--k) 0 14px, rgba(255, 255, 255, .9) 14px 28px); }
.f1-class-card[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(230, 0, 126, .3), 0 30px 50px -30px rgba(0, 0, 0, .75); }
.f1-class-card h3 { font-size: 2rem; }
.f1-class-card .eyebrow { color: var(--cyan); }

/* ------------------------------------------------------------------ start-gate progress lights (solve) */
.progress.f1-gated { height: auto; overflow: visible; background: transparent; border-radius: 0; display: flex; flex-direction: column; gap: 8px; }
.progress.f1-gated .progress-bar { order: 2; height: 4px; background: var(--hot); border-radius: 2px; }
.f1-gate { order: 1; display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: 999px; background: #07020F; border: 1px solid #33204F; }
.f1-light { width: 30px; height: 30px; border-radius: 50%; background: #2B1B3B; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7); transition: background-color .2s var(--ease), box-shadow .2s var(--ease); }
.f1-light.is-on { background: #FF2A3A; box-shadow: 0 0 14px 3px rgba(255, 42, 58, .6), inset 0 -3px 5px rgba(120, 0, 10, .5); }
.f1-light.is-next { animation: f1-gate-pulse 1.2s ease-in-out infinite; }
@keyframes f1-gate-pulse { 50% { background: #5A1B2B; } }
@media (prefers-reduced-motion: reduce) { .f1-light.is-next { animation: none; } }

/* ------------------------------------------------------------------ Engineer report / test panel stay readable */
.modal pre { background: var(--ink); }

/* ------------------------------------------------------------------ Multi-material components (Part B) */
.f1-components { border-left: 3px solid var(--f1-teal); }
.f1-comp-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; align-items: center;
  padding: .35rem .45rem; border: 1px solid transparent; border-radius: 6px; }
.f1-comp-row.is-selected { border-color: var(--f1-magenta); background: rgba(230, 0, 126, .10); }
.f1-comp-pick { display: flex; gap: .5rem; align-items: center; min-width: 0; padding: .2rem 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.f1-comp-pick:focus-visible { outline: 2px solid var(--f1-teal); outline-offset: 2px; }
.f1-comp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.f1-comp-select { width: 100%; min-width: 0; }
.f1-comp-made { overflow-wrap: anywhere; color: var(--f1-lilac); }   /* F1: fixes ported (B3): full material name under the box */
.f1-comp-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.f1-comp-table th, .f1-comp-table td { padding: .3rem .35rem; text-align: left; border-bottom: 1px solid rgba(189, 180, 216, .18); vertical-align: top; }
.f1-comp-table thead th { font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--f1-lilac); }
.f1-comp-table tr.f1-comp-fails th, .f1-comp-table tr.f1-comp-fails td { background: rgba(230, 0, 126, .10); }
.f1-first-pill { margin-left: .4rem; font-size: .66rem; }
.f1-comp-fos { font-weight: 700; font-variant-numeric: tabular-nums; }
.f1-tone-ok { color: var(--ok-text); } .f1-tone-warn { color: var(--warn-text); } .f1-tone-bad { color: var(--bad-text); } .f1-tone-muted { color: var(--f1-lilac); font-weight: 400; }

/* ---- Part C: STEM Racing presets (js/f1/presets.js, js/f1/preset-ui.js) ---------------- */
.f1-edition .preset-card.f1-preset .eyebrow { color: var(--f1-teal); }
.f1-edition .f1-class-tag { color: var(--f1-yellow); }
.f1-edition .f1-preset-explain { border-left: 3px solid var(--f1-teal); font-size: .86rem; line-height: 1.45; }
.f1-edition .f1-process-hint { gap: 8px; align-items: flex-start; }
.f1-edition .f1-variants .seg button, .f1-edition .f1-cases .seg button { font-family: var(--mono); font-size: .8rem; }

/* ---- Part D: race loads calculator (js/f1/race-loads-ui.js, Loads step) ---------------- */
.f1-race { border-left: 3px solid var(--f1-orange); padding: 12px 14px; }
.f1-race > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.f1-race > summary::-webkit-details-marker { display: none; }
.f1-race > summary::before { content: '▸'; color: var(--f1-orange); transition: transform .15s var(--ease); }
.f1-race[open] > summary::before { transform: rotate(90deg); }
.f1-race > summary:focus-visible { outline: 2px solid var(--f1-teal); outline-offset: 3px; }
.f1-race-title { font-family: var(--display); font-size: 1.2rem; text-transform: uppercase; letter-spacing: .02em; }
.f1-race-pill { margin-left: auto; font-family: var(--mono); font-size: .66rem; color: var(--f1-yellow); border: 1px solid var(--f1-yellow); background: transparent; }
.f1-race[open] > .stack-sm { margin-top: 10px; }
.f1-race-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; align-items: start; }
.f1-race-inputs .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f1-race-inputs .input-unit > input { min-width: 0; width: 100%; padding-left: 10px; padding-right: 38px; }
.f1-race-inputs .input-unit > .unit { right: 10px; }
.f1-race-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 10px; border-radius: 8px; background: rgba(237, 109, 5, .12); }
.f1-race-big { font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--f1-yellow); font-variant-numeric: tabular-nums; }
.f1-race-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 4px; line-height: 1.4; }
.f1-race-maths { display: block; margin-top: 2px; font-family: var(--mono); font-size: .78rem; color: var(--f1-teal); white-space: normal; overflow-wrap: anywhere; background: none; padding: 0; }
.f1-race-estimate { color: var(--f1-lilac); }
.f1-race-apply { padding-top: 8px; border-top: 1px solid rgba(189, 180, 216, .18); }
.f1-race-apply .seg button { font-size: .8rem; }
.f1-race-chamber { border-left: 3px solid var(--f1-teal); }
.f1-race-weight { padding-top: 8px; border-top: 1px solid rgba(189, 180, 216, .18); }

/* ---- Part E: car body check (js/f1/body-check-ui.js, Part step) ------------------------ */
.f1-body { border-left: 3px solid var(--f1-magenta); padding: 12px 14px; }
.f1-body > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.f1-body > summary::-webkit-details-marker { display: none; }
.f1-body > summary::before { content: '▸'; color: var(--f1-magenta); transition: transform .15s var(--ease); }
.f1-body[open] > summary::before { transform: rotate(90deg); }
.f1-body > summary:focus-visible { outline: 2px solid var(--f1-teal); outline-offset: 3px; }
.f1-body[open] > .stack-sm { margin-top: 10px; }
.f1-body-sub { margin: 0; font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--f1-teal); }
.f1-thin-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.f1-thin-row .field { flex: 0 1 150px; min-width: 0; }
.f1-thin-row .input-unit > input { min-width: 0; width: 100%; padding-left: 10px; padding-right: 38px; }
.f1-thin-row .input-unit > .unit { right: 10px; }
.f1-thin-key { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--f1-lilac); }
.f1-thin-key > span { display: inline-flex; align-items: center; gap: 5px; }
.f1-thin-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.f1-thin-list { margin: 0; padding-left: 1.4rem; display: grid; gap: 2px; }
.f1-thin-spot { text-align: left; white-space: normal; padding-left: 4px; }
.f1-thin-spot b { color: var(--bad-text); font-variant-numeric: tabular-nums; }

/* ---- Part F: team + car name (start screen and next to the export buttons) ---------------------- */
.f1-team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.f1-team-field { display: grid; gap: 4px; min-width: 0; }
.f1-team-label { font: 600 .72rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--f1-lilac); }
.f1-team-field input { width: 100%; min-width: 0; }
.f1-team-start { margin-top: 18px; max-width: 640px; padding: 14px 16px 12px; border-radius: 12px; background: var(--f1-card);
  border: 1px solid rgba(189, 180, 216, .2); border-left: 4px solid var(--f1-magenta); }
.f1-team-start .f1-team-hint { margin: 10px 0 0; }
.f1-team-export { display: grid; gap: 6px; margin: 4px 0 2px; }
.f1-team--compact { gap: 6px 10px; }
.f1-team--compact input { padding-block: 6px; font-size: .9rem; }
@media (max-width: 420px) { .f1-team { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ F1: fixes ported (B3), F1 livery only */
/* In this livery two Professional-class boxes cut their words off at 1366 px (the main edition's do not):
   the pinned-fix "Longest direction of the face" and the self-weight direction "−Y (down)" / "+Z (to you)". */
#fx-fix-axis, #fx-fix-dir { padding-left: 12px; padding-right: 34px; background-position: right 12px center; }
select[data-gravity-dir] { min-width: 10rem; max-width: 100%; }
