/* ==========================================================================
   League Control - visual language borrowed from a pit wall timing monitor:
   dense monospaced timing data, hairline rules, signal colours used only
   where they carry meaning (amber = steward action, red = ban, green = clear).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg:        #0C1017;
  --panel:     #151C26;
  --panel-2:   #1B2430;
  --line:      #26313F;
  --text:      #E6EDF6;
  --dim:       #7C8CA0;
  --amber:     #FFC145;   /* steward action pending */
  --green:     #3DDC97;   /* clear / classified */
  --red:       #FF5A5F;   /* ban / disqualified */
  --blue:      #5AA9FF;   /* informational */

  --display: 'Barlow Condensed', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --r: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin: 0;
}
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; color: var(--dim); letter-spacing: 0.12em; }

a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- shell ---------------------------------------------------------------- */

.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }

.rail {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 0;
  display: flex; flex-direction: column;
}

.brand {
  font-family: var(--display);
  font-size: 19px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
/* The amber bar reads as the marshal's signal, not decoration. */
.brand::before {
  content: ''; display: block;
  width: 26px; height: 3px; background: var(--amber); margin-bottom: 10px;
}

.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail nav button {
  background: none; border: 0; color: var(--dim);
  text-align: left; padding: 9px 20px; cursor: pointer;
  font-family: var(--display); font-size: 15px;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-left: 2px solid transparent;
}
.rail nav button:hover { color: var(--text); background: var(--panel-2); }
.rail nav button[aria-current='true'] {
  color: var(--text); border-left-color: var(--amber); background: var(--panel-2);
}
.rail nav button .badge {
  float: right; background: var(--amber); color: #000;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 8px;
}

.rail .foot { margin-top: auto; padding: 14px 20px 0; border-top: 1px solid var(--line); }
.rail .foot .who { font-size: 12px; color: var(--dim); }
.rail .foot .who strong { display: block; color: var(--text); font-size: 13px; }

main { padding: 24px 28px 60px; overflow-x: auto; }

.head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.head .sub { color: var(--dim); font-size: 13px; }
.head .spacer { flex: 1; }

/* --- controls ------------------------------------------------------------- */

.btn {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 7px 13px; cursor: pointer;
  font-family: var(--display); font-size: 14px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.btn:hover { border-color: var(--dim); }
.btn.primary { background: var(--amber); color: #10141A; border-color: var(--amber); font-weight: 600; }
.btn.danger  { background: transparent; color: var(--red); border-color: var(--red); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.sm { padding: 4px 9px; font-size: 12px; }

input, select, textarea {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 7px 9px; width: 100%;
}
input:focus, select:focus, textarea:focus,
button:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
textarea { min-height: 78px; resize: vertical; }

label { display: block; margin-bottom: 12px; }
label span { display: block; font-size: 11px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 130px; }

/* --- panels and tables ---------------------------------------------------- */

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 18px;
}
.panel > header {
  padding: 11px 15px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.panel > .body { padding: 15px; }

table { width: 100%; border-collapse: collapse; }
th {
  font-family: var(--display); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim);
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 8px 12px; border-bottom: 1px solid rgba(38,49,63,0.5); }
tbody tr:hover { background: var(--panel-2); }
.num, td.time, td.pts { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.time { color: var(--dim); font-size: 13px; }
td.pts  { font-weight: 700; text-align: right; }

/* Position column reads like a timing tower. */
.pos {
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  width: 34px; text-align: right; color: var(--dim);
}
tr.p1 .pos { color: var(--amber); }
tr.p2 .pos, tr.p3 .pos { color: var(--text); }
tr.dsq td { opacity: 0.45; text-decoration: line-through; }

.delta { color: var(--red); font-family: var(--mono); font-size: 12px; }
.gain  { color: var(--green); }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 2px; border: 1px solid;
}
.tag.captured  { color: var(--dim);   border-color: var(--line); }
.tag.review    { color: var(--amber); border-color: var(--amber); }
.tag.final     { color: var(--green); border-color: var(--green); }
.tag.dsq, .tag.ban { color: var(--red); border-color: var(--red); }

.empty { padding: 34px 15px; text-align: center; color: var(--dim); }
.empty strong { display: block; color: var(--text);
  font-family: var(--display); font-size: 17px;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 5px; }

/* --- signature: the superlicence card ------------------------------------- */

.licences { display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.licence {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 5px;
  padding: 14px; position: relative; overflow: hidden;
}
/* Left edge is the status stripe: it turns amber then red as points build. */
.licence::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--green);
}
.licence.warn::before { background: var(--amber); }
.licence.banned::before { background: var(--red); }

.licence .name {
  font-family: var(--display); font-size: 18px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.licence .team { color: var(--dim); font-size: 12px; margin-bottom: 10px; }

/* Points shown as pips, the way a licence is actually punched. */
.pips { display: flex; gap: 3px; margin: 10px 0 6px; flex-wrap: wrap; }
.pip {
  width: 13px; height: 17px; border-radius: 2px;
  border: 1px solid var(--line); background: transparent;
}
.pip.used { background: var(--amber); border-color: var(--amber); }
.pip.over { background: var(--red); border-color: var(--red); }
.pip.quali-line { border-right: 2px solid var(--dim); margin-right: 4px; }

.licence .scale {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; color: var(--dim);
}
.licence .status {
  margin-top: 9px; font-family: var(--mono); font-size: 11px;
  display: flex; align-items: center; gap: 6px;
}

/* --- stewards ------------------------------------------------------------- */

.incident { border-bottom: 1px solid var(--line); padding: 13px 15px; }
.incident:last-child { border-bottom: 0; }
.incident .top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.incident .who { font-family: var(--display); font-size: 16px;
  text-transform: uppercase; letter-spacing: 0.04em; }
.incident .meta { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.incident .desc { margin: 7px 0; color: var(--text); font-size: 13px; }
.incident .evidence { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.incident .evidence a {
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--line); border-radius: 2px; padding: 3px 7px;
}

.verdict-form { background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; margin-top: 11px; }

/* Only the fields the chosen outcome actually needs are shown. */
.verdict-form [data-when] { display: none; }
.verdict-form [data-when].on { display: block; }

/* --- login ---------------------------------------------------------------- */

.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login { width: 100%; max-width: 330px; }
.login .brand { border: 0; padding: 0 0 18px; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  padding: 11px 17px; border-radius: var(--r);
  font-size: 13px; z-index: 50; max-width: 480px;
}
.toast.bad { border-left-color: var(--red); }
.toast.good { border-left-color: var(--green); }

.hint { color: var(--dim); font-size: 12px; margin-top: 5px; }
.mono { font-family: var(--mono); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail { flex-direction: row; align-items: center; overflow-x: auto;
    padding: 10px; gap: 10px; }
  .rail .brand { border: 0; padding: 0 12px 0 4px; margin: 0; font-size: 15px; }
  .rail .brand::before { display: none; }
  .rail nav { flex-direction: row; }
  .rail nav button { white-space: nowrap; border-left: 0;
    border-bottom: 2px solid transparent; padding: 7px 11px; }
  .rail nav button[aria-current='true'] { border-bottom-color: var(--amber); }
  .rail .foot { display: none; }
  main { padding: 16px 13px 50px; }
}

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

/* ==========================================================================
   Championship tabs, constructor seats and the records boards
   ========================================================================== */

.tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
}

.tabs button:hover { color: var(--text); }

.tabs button[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--amber);
}

.tabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.panel-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 10px;
}

/* Both seats on one row, so a team reads as a pair rather than two entries. */
.seats { display: flex; flex-wrap: wrap; gap: 6px 14px; }

.seat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.seat em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 4px;
}

.seat b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  font-weight: 500;
}

/* Records */
.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
}

.board ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}

.board li {
  counter-increment: rank;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-top: 1px solid var(--panel-2);
}

.board li:first-child { border-top: 0; }

.board li::before {
  content: counter(rank);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--dim);
  min-width: 16px;
}

.board .who { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }

.board .who em {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
}

.board li b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

/* The leader of each board is the only thing coloured, so it reads at a glance. */
.board li:first-child b { color: var(--amber); }

@media (max-width: 720px) {
  .tabs { overflow-x: auto; }
  .seats { flex-direction: column; gap: 3px; }
}

/* ==========================================================================
   Across divisions: one leader card per division, and the standout above them
   ========================================================================== */

.standout {
  display: grid;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 24px;
  margin-bottom: 14px;
}

.standout-label {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.standout-name {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.standout-meta { font-size: 13px; color: var(--dim); }

.standout-stat {
  margin-top: 8px;
  font-size: 13px;
  color: var(--dim);
}

.standout-stat b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  color: var(--text);
  margin-right: 4px;
}

.leaders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.leader {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
}

.leader-name {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
}

.leader-team { font-size: 12px; color: var(--dim); margin-bottom: 10px; }

.leader-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--panel-2);
}

.leader-stats div { display: flex; flex-direction: column; gap: 1px; }

.leader-stats dt {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.leader-stats dd {
  margin: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

@media (max-width: 520px) {
  .standout-name { font-size: 26px; }
}

/* ==========================================================================
   Mobile
   A driver checks the standings on a phone on Sunday night. That is the
   primary case, not an afterthought, so below 760px the sidebar becomes a
   bottom bar and tables stop trying to be tables.
   ========================================================================== */

@media (max-width: 760px) {
  body { padding-bottom: env(safe-area-inset-bottom); }

  .layout { display: block; }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    width: 100%;
    height: auto;
    display: flex;
    overflow-x: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--panel);
    z-index: 50;
  }

  .sidebar .brand { display: none; }

  .sidebar nav { display: flex; gap: 4px; }

  .sidebar a {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
  }

  main { padding: 14px 14px 76px; }

  .head { flex-wrap: wrap; gap: 8px; }
  h1 { font-size: 22px; }

  /* Tables become stacked cards: a ten-column grid on a 390px screen is
     unreadable however small the type gets. */
  table.stack thead { display: none; }

  table.stack tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2px 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--panel-2);
  }

  table.stack td { border: 0; padding: 0; }
  table.stack td[data-label]::before {
    content: attr(data-label) " ";
    color: var(--dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  /* Keep the wide grids scrollable rather than stacked. */
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .scroll-x table { min-width: 640px; }

  .boards, .leaders { grid-template-columns: 1fr; }
  .standout-name { font-size: 24px; }

  /* Touch targets. 44px is the smallest thing most people hit reliably. */
  button, .tabs button, select, input { min-height: 44px; }
}

@media (max-width: 400px) {
  main { padding: 12px 10px 76px; }
  .panel { padding: 14px 12px; }
}

/* --- live timing tower --------------------------------------------------- */

.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red, #ff5c5c);
  box-shadow: 0 0 8px rgba(255, 92, 92, 0.7);
  animation: live-pulse 2s ease-in-out infinite;
}

.live-dot.stale { background: var(--dim); box-shadow: none; animation: none; }

@keyframes live-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

table.tower td { padding: 8px 12px; font-size: 14px; }
table.tower .num { font-variant-numeric: tabular-nums; text-align: right; }
table.tower tr.in-pit { opacity: 0.75; }
table.tower tr.out { opacity: 0.4; text-decoration: line-through; }

.pit, .pen {
  font-size: 10px; letter-spacing: 0.08em; padding: 1px 5px;
  border-radius: 2px; margin-left: 6px; vertical-align: middle;
}
.pit { background: rgba(79, 195, 232, 0.18); color: #4fc3e8; }
.pen { background: rgba(255, 176, 32, 0.18); color: #ffb020; }

/* --- download page ------------------------------------------------------- */

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.download {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  background: var(--panel-2);
  transition: border-color 0.12s ease;
}

.download:hover { border-color: var(--amber); }

.download-label {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.download-note { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }

.steps { margin: 0; padding-left: 20px; line-height: 1.7; }
.steps li { margin-bottom: 8px; }

.checksums td { padding: 6px 10px 6px 0; font-size: 12px; vertical-align: top; }
.checksums .mono {
  font-family: var(--mono);
  color: var(--dim);
  word-break: break-all;
}

/* --- setup screens -------------------------------------------------------- */

.seat-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--panel-2);
}

.seat-row:first-child { border-top: 0; }
.seat-row strong { min-width: 110px; padding-bottom: 8px; }
.seat-row label { flex: 1 1 180px; margin: 0; }
.seat-row.empty-row { color: var(--dim); }

.team-panel { border-left: 3px solid var(--line); }

.tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 6px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--dim);
  vertical-align: middle;
}

.tag.warn { color: var(--amber); border-color: var(--amber); }

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-left: 4px; }

td.mono { font-family: var(--mono); font-size: 12px; }
td.mono.missing { color: var(--red); }

tr.out { opacity: 0.45; }

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

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

@media (max-width: 760px) {
  .seat-row { flex-direction: column; align-items: stretch; }
  .seat-row strong { min-width: 0; }
}

/* The hidden attribute must beat any display rule. Without this a class like
   .login-wrap { display: grid } silently overrides it, and the login screen
   stays painted over a dashboard that is working perfectly behind it. */
[hidden] { display: none !important; }

/* --- edit panels, notices and keys ---------------------------------------- */

.edit-panel { border-left: 3px solid var(--amber); margin-bottom: 14px; }

.notice {
  padding: 12px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  font-size: 14px;
}

.notice.warn { border-color: var(--amber); color: var(--amber); }

.tag.good { color: var(--green, #22c98a); border-color: var(--green, #22c98a); }

.spacer { flex: 1; }

.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

p.key {
  font-size: 18px;
  letter-spacing: 0.14em;
  word-break: break-all;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 6px 0 14px;
}

#invite-screen { position: fixed; inset: 0; background: var(--bg, #0b0f0e); z-index: 100; }

/* --- points editor -------------------------------------------------------- */

.points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.points-editor {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--panel-2);
}

.points-head {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}

.points-table { width: 100%; border-collapse: collapse; }
.points-table th {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dim); text-align: left; padding: 0 6px 6px 0; font-weight: 600;
}
.points-table td { padding: 2px 6px 2px 0; }
.points-table input {
  width: 100%; min-height: 34px; padding: 4px 8px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.points-table td:last-child { width: 1%; white-space: nowrap; }
.points-editor .add-row { margin-top: 8px; }

.inline-in {
  background: transparent; border: 1px solid transparent;
  color: var(--text); padding: 5px 7px; border-radius: 3px; width: 100%;
}
.inline-in:hover { border-color: var(--line); }
.inline-in:focus { border-color: var(--amber); background: var(--panel-2); outline: none; }

.inline-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 180px; }

/* --- the desktop app guide ------------------------------------------------ */

.settings-table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
.settings-table th, .settings-table td {
  text-align: left; padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--panel-2);
  font-weight: 400; font-size: 14px;
}
.settings-table th { color: var(--dim); width: 45%; font-weight: 500; }
.settings-table tr.critical td { color: var(--amber); }

.faq { margin: 0; }
.faq dt {
  font-weight: 600; font-size: 14px; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--panel-2);
}
.faq dt:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.faq dd { margin: 4px 0 0; color: var(--dim); font-size: 14px; line-height: 1.6; }

pre.code {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px;
  font-family: var(--mono); font-size: 12px;
  overflow-x: auto; margin: 8px 0;
}

/* --- a driver's own submission page --------------------------------------- */

#submit-screen { position: fixed; inset: 0; overflow-y: auto; background: var(--bg, #0b0f0e); z-index: 90; }

.submit-wrap { max-width: 720px; margin: 0 auto; padding: 24px 18px 60px; }

.submit-head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.submit-head h1 { margin: 0; font-size: 26px; }

.panel.urgent { border-left: 3px solid var(--amber); }

.case { padding: 14px 0; border-top: 1px solid var(--panel-2); }
.case:first-child { border-top: 0; padding-top: 0; }
.case-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.case-desc { margin: 8px 0; line-height: 1.6; }

.answered {
  border-left: 2px solid var(--green, #22c98a);
  padding: 8px 0 8px 12px; margin: 10px 0;
}
.answered strong { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.answered p { margin: 4px 0 0; }

.defence-form { margin-top: 10px; }
.submit-foot { text-align: center; margin-top: 24px; }

textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 3px; color: var(--text); padding: 9px 11px;
  font-family: inherit; font-size: 14px; line-height: 1.5; resize: vertical;
}
textarea:focus { border-color: var(--amber); outline: none; }

.late-ack {
  border: 1px solid var(--amber);
  border-radius: var(--r);
  padding: 10px 12px;
  margin: 12px 0;
  background: rgba(255, 176, 32, 0.07);
}

em.unit {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
  margin-left: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- two-factor enrolment ------------------------------------------------- */

.qr-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 14px 0;
}

/* White backing: a QR code needs light quiet zones to scan reliably, and the
   page behind it is nearly black. */
.qr {
  width: 220px;
  height: 220px;
  background: #fff;
  padding: 10px;
  border-radius: var(--r);
  flex: none;
}

.qr-alt { flex: 1 1 240px; min-width: 220px; }
.qr-alt .key { font-size: 15px; letter-spacing: 0.12em; }

@media (max-width: 560px) {
  .qr-row { flex-direction: column; }
  .qr { width: 180px; height: 180px; align-self: center; }
}

/* --- driver movements ----------------------------------------------------- */

.move-current {
  padding: 12px 14px;
  background: var(--panel-2);
  border-radius: var(--r);
  margin: 12px 0;
  font-size: 14px;
}

.swap-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--blue, #4fc3e8); border-radius: var(--r);
  background: rgba(79, 195, 232, 0.07);
  font-size: 14px;
}

.preview-box {
  border: 1px solid var(--line); border-left: 3px solid var(--green, #22c98a);
  border-radius: var(--r); padding: 14px 16px; margin: 14px 0;
}
.preview-box.warn { border-left-color: var(--amber); }

.preview-kind {
  font-family: var(--display); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
  margin-bottom: 6px;
}

.preview-table { width: 100%; max-width: 340px; margin: 10px 0; }
.preview-table td { padding: 5px 0; font-size: 14px; }
.preview-table td.num {
  text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.preview-table td.num.drop { color: var(--amber); }

.where-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; margin: 12px 0;
  background: var(--panel-2); border-radius: var(--r); font-size: 14px;
}
