/* Corner Content Engine — Track Titan styling (mirrors the nextjs-app design system). */
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap");

:root {
  --bg: #131618;
  --panel: #1f2224;
  --panel-2: #15181a;
  --surface-3: #2d3031;
  --line: #2c3033;
  --line-2: #36393b;
  --text: #ffffff;
  --muted: #cacaca;
  --muted-2: #5d6162;
  --orange: #f1860d;
  --orange-600: #bc680a;
  --orange-700: #874b07;
  --green: #98df33;
  --red: #f44336;
  --blue: #2c6bb3;
  --tips: #f9d62b;
  --radius: 12px;
  --radius-sm: 8px;
  --font:
    "Cairo", "Ubuntu", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,
h2 {
  font-family: var(--font);
}

/* top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(19, 22, 24, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  color: var(--orange);
  font-size: 20px;
  line-height: 1;
}
.brand {
  color: var(--orange);
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 18px;
}
.brand-sep {
  color: var(--muted-2);
}
.brand-tool {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 16px;
}
.topbar-sub {
  color: var(--muted);
  font-size: 13px;
  margin-left: auto;
}

/* two-panel layout */
.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 28px 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: start;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.col-right {
  position: sticky;
  top: 84px;
}
@media (max-width: 1040px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .col-right {
    position: static;
  }
}

/* cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.02),
    0 12px 32px rgba(0, 0, 0, 0.22);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.card-head h2 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
  font-weight: 700;
}
.card-head .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--orange);
  color: #1a1205;
  font-weight: 800;
  font-size: 13px;
}
.head-hint {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

/* form controls */
.field {
  margin-bottom: 16px;
}
.field:last-child {
  margin-bottom: 0;
}
label {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
select,
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 11px 12px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  appearance: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
select:focus,
input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(241, 134, 13, 0.18);
}
select:disabled {
  opacity: 0.5;
}
.row2 {
  display: flex;
  gap: 12px;
}
.row2 > * {
  flex: 1;
  min-width: 0;
}

/* Manual IDs picker: space the inputs, and set the +Add driver button apart. */
.manual {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.manual .manual-add {
  margin-top: 6px;
}
.seg-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.grow {
  flex: 1;
  margin-bottom: 0;
}
.hint {
  color: var(--muted-2);
  font-size: 12px;
  margin: 10px 0 0;
}

/* buttons */
.btn {
  cursor: pointer;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary {
  background: var(--orange);
  color: #1a1205;
  margin-top: 4px;
}
.btn-primary:not(:disabled):hover {
  background: var(--orange-600);
}
.btn-primary:not(:disabled):active {
  background: var(--orange-700);
}
.btn-sec {
  background: var(--panel-2);
  border-color: var(--orange);
  color: var(--orange);
}
.btn-sec:hover {
  background: var(--orange);
  color: #1a1205;
}
.btn-sec:active {
  background: var(--orange-600);
  color: #1a1205;
}

/* tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.tab {
  flex: 1;
  cursor: pointer;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.tab:hover {
  color: var(--text);
  border-color: var(--muted-2);
  background: var(--surface-3);
}
.tab.active {
  background: var(--orange);
  color: #1a1205;
  border-color: var(--orange);
}
.tab.active:hover {
  background: var(--orange-600);
  border-color: var(--orange-600);
  color: #1a1205;
}

/* Load-sessions button: centre its label + spinner. */
.btn-load {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* By-laps: header row with back button + session label */
.laps-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.back-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.back-btn:active {
  background: var(--surface-3);
}
.back-btn .back-arrow {
  font-size: 15px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.back-btn:hover .back-arrow {
  transform: translateX(-2px);
}
.laps-who {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* lists */
.list {
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.list-sm {
  max-height: 200px;
  margin-top: 8px;
}
.list-head {
  padding: 7px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  background: #181b1d;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.row:last-child {
  border-bottom: 0;
}
.rk {
  width: 46px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.nm {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nm.muted,
.muted {
  color: var(--muted-2);
}
.tm {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pick {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-3);
  color: var(--muted);
  font-family: var(--font);
  transition: all 0.2s;
}
.pick:hover {
  border-color: var(--muted);
}
.pick.on {
  background: var(--orange);
  color: #1a1205;
  border-color: var(--orange);
}
.pick:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.badge.idle {
  background: var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.work {
  background: #3a2f12;
  color: var(--tips);
  border: 1px solid #7a641c;
}
.badge.live {
  background: #173a22;
  color: #57d98a;
  border: 1px solid #2a6b45;
}
.badge.sample {
  background: #4a1717;
  color: #ff9a9a;
  border: 1px solid #8f2c2c;
}
.badge.invalid {
  background: #4a1717;
  color: #ff9a9a;
  border: 1px solid #8f2c2c;
}
.card-head .badge {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0.3px;
}

/* selected drivers */
.selwrap {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.selwrap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.selwrap-head .ttl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 600;
}
.selwrap-head .clr {
  cursor: pointer;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  font-family: var(--font);
}
.selempty {
  color: var(--muted-2);
  font-size: 13px;
  margin: 0;
}
.chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--panel-2);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    opacity 0.15s;
}
.chip.dragging {
  opacity: 0.55;
  border-color: var(--orange);
}
.chip .handle {
  color: var(--muted-2);
  font-size: 16px;
  line-height: 1;
  user-select: none;
  cursor: grab;
  padding: 2px 3px;
  border-radius: 5px;
  transition:
    color 0.15s,
    background 0.15s;
}
.chip .handle:hover {
  color: var(--orange);
  background: var(--surface-3);
}
.chip .handle:active {
  cursor: grabbing;
}
.chip .dot {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  flex: 0 0 auto;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  color: transparent;
}
/* The swatch hides its own text via color:transparent; options must stay legible in the dropdown. */
.chip .dot option {
  color: var(--text);
  background: var(--panel-2);
}
.chip .meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.chip .who {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tier-input {
  width: 190px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
}
.chip .rm {
  cursor: pointer;
  border: 0;
  background: none;
  color: var(--muted-2);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}
.chip .rm:hover {
  color: #ff6b6b;
}

/* overlays */
.ovl-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 720px) {
  .ovl-groups {
    grid-template-columns: 1fr;
  }
}
.ovl-group {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.ovl-group .gt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--orange);
  margin-bottom: 10px;
  font-weight: 800;
}
.chk {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  font-weight: 400;
}
.chk:last-child {
  margin-bottom: 0;
}

.chk input[type="checkbox"],
.scene-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--line-2);
  border-radius: 5px;
  background: var(--panel-2);
  cursor: pointer;
  position: relative;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.chk input[type="checkbox"]:hover,
.scene-toggle input[type="checkbox"]:hover {
  border-color: var(--orange);
}
.chk input[type="checkbox"]:checked,
.scene-toggle input[type="checkbox"]:checked {
  background: var(--orange);
  border-color: var(--orange);
}
/* White checkmark drawn with a rotated box border. */
.chk input[type="checkbox"]:checked::after,
.scene-toggle input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #1a1205;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.chk input[type="checkbox"]:focus-visible,
.scene-toggle input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(241, 134, 13, 0.28);
}
.chk input[type="checkbox"]:disabled,
.scene-toggle input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.chk .note {
  color: var(--muted-2);
  font-size: 12px;
}

/* orientation radios */
.orient {
  display: flex;
  gap: 10px;
}
.radio {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}
.radio input {
  accent-color: var(--orange);
  cursor: pointer;
}

/* segmented toggle (orientation) — two buttons, one active */
.toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--panel-2);
}
.toggle-opt {
  flex: 1;
  cursor: pointer;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.toggle-opt + .toggle-opt {
  border-left: 1px solid var(--line-2);
}
.toggle-opt:hover:not(.active) {
  color: var(--text);
  background: var(--surface-3);
}
.toggle-opt.active {
  background: var(--orange);
  color: #1a1205;
}

/* inline hint inside a field label (e.g. "of 14") */
.lbl-hint {
  color: var(--muted-2);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

/* scene timing grid */
.timing-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.timing-grid .field {
  margin-bottom: 0;
}
.timing-grid input {
  padding: 9px 10px;
}

/* −/+ stepper around each scene-timing number field */
.stepper {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.stepper input[type="number"] {
  text-align: center;
  padding: 9px 6px;
  -moz-appearance: textfield;
}

.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.step-btn {
  flex: 0 0 auto;
  width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--panel-2);
  color: var(--orange);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.step-btn:hover:not(:disabled) {
  background: var(--orange);
  border-color: var(--orange);
  color: #1a1205;
}
.step-btn:active:not(:disabled) {
  background: var(--orange-600);
  border-color: var(--orange-600);
}
.step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.scene-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
input:disabled {
  opacity: 0.5;
}
@media (max-width: 720px) {
  .timing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* text-size controls (Text card) */
.size-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.size-title { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.size-reset { cursor: pointer; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; font-family: var(--font); }
.size-reset:hover { color: var(--orange); }
.size-grid { display: flex; flex-direction: column; gap: 12px; }
.size-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 46px; align-items: center; gap: 12px; }
.size-label { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.size-label .note { color: var(--muted-2); font-size: 12px; }
.size-val { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.size-slider { width: 100%; height: 4px; padding: 0; background: var(--surface-3); border: 0; border-radius: 999px; appearance: none; -webkit-appearance: none; cursor: pointer; }
.size-slider:focus { outline: none; box-shadow: none; }
.size-slider::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--orange); border: 2px solid #1a1205; cursor: pointer; transition: background .2s; }
.size-slider:hover::-webkit-slider-thumb { background: var(--orange-600); }
.size-slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--orange); border: 2px solid #1a1205; cursor: pointer; }
.size-slider::-moz-range-track { height: 4px; background: var(--surface-3); border-radius: 999px; }
@media (max-width: 560px) { .size-row { grid-template-columns: minmax(0, 1fr) 90px 40px; } }

/* result / video */
.video-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.video {
  width: min(300px, 70%);
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.video.landscape {
  width: 100%;
  aspect-ratio: 16/9;
}
.video.vertical {
  aspect-ratio: 9/16;
}
.placeholder {
  width: min(300px, 70%);
  aspect-ratio: 9/16;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: var(--muted-2);
  font-size: 13px;
  white-space: pre-line;
}
.placeholder.landscape {
  width: 100%;
  aspect-ratio: 16/9;
}
.dl {
  color: var(--orange);
  font-size: 13px;
  text-decoration: none;
}
.dl:hover {
  text-decoration: underline;
}

/* pipeline log */
.log {
  background: #0d0f10;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  height: 260px;
  overflow: auto;
  font:
    12px/1.55 "Ubuntu Mono",
    ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  color: #b9c2c7;
  white-space: pre-wrap;
  word-break: break-word;
}
.log .cmd {
  color: var(--orange);
}
.log .err {
  color: #ff6b6b;
}

/* auth gates */
.gate-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: var(--muted);
  font: 14px var(--font);
}
.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.login-card__brand {
  color: var(--orange);
  font: 700 12px var(--font);
  letter-spacing: 0.18em;
  margin-bottom: 12px;
}
.login-card__title {
  margin: 8px 0 16px;
  color: var(--text);
  font: 600 22px var(--font);
}
.login-card__sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 24px;
}
.login-card__sub code {
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.login-card__btn {
  display: inline-block;
  width: 100%;
  padding: 12px 16px;
  background: var(--orange);
  color: #15181a;
  border: 0;
  border-radius: var(--radius-sm);
  font: 600 14px var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.login-card__btn:hover {
  background: var(--orange-600);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 13px var(--font);
}
.topbar-user-email {
  color: var(--muted);
}
.topbar-user-out {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--orange);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.topbar-user-out:hover {
  text-decoration: underline;
}
.topbar-user-out:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 2px;
}

/* spinner */
.spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.list::-webkit-scrollbar,
.log::-webkit-scrollbar {
  width: 8px;
}
.list::-webkit-scrollbar-thumb,
.log::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 8px;
}

/* Amplify Authenticator: theme it to match the Corner Content Engine palette. */
.login-card--amplify .login-card__form {
  margin: 8px 0 16px;
}
.amplify-tabs {
  background: transparent !important;
  border: 0 !important;
}
[data-amplify-authenticator] {
  --amplify-components-primary-color: var(--orange);
  --amplify-components-primary-on-color: var(--text);
  --amplify-colors-font-primary: var(--text);
  --amplify-colors-font-secondary: var(--muted);
  --amplify-colors-background-secondary: var(--panel);
  --amplify-components-fieldcontrol-background-color: var(--panel-2);
  --amplify-components-fieldcontrol-border-color: var(--line-2);
  --amplify-components-fieldcontrol-color: var(--text);
  --amplify-components-fieldcontrol-focus-border-color: var(--orange);
  --amplify-components-button-primary-background-color: var(--orange);
  --amplify-components-button-primary-color: #15181a;
  --amplify-components-button-primary-hover-background-color: var(--orange-600);
  --amplify-components-button-primary-disabled-background-color: var(
    --orange-700
  );
  --amplify-components-button-link-color: var(--orange);
  --amplify-components-button-link-hover-color: var(--orange-600);
}
[data-amplify-authenticator] [data-amplify-form] {
  padding: 0 !important;
}

/* ----- Amplify concrete class overrides -----
   The CSS variables above cover the tokens Amplify v6 uses internally, but
   @aws-amplify/ui-react/styles.css also ships concrete selectors (e.g.
   .amplify-input, .amplify-button, .amplify-label) with hard-coded colours.
   We hit those directly so the form visually matches the Corner Content
   Engine palette. */
.amplify-flex {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.amplify-field {
  gap: 6px;
}

/* Fieldset + form spacing — Amplify adds generous padding/margin by default. */
[data-amplify-form] fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}
[data-amplify-form] > .amplify-flex {
  gap: 14px;
}
[data-amplify-form] > .amplify-flex > .amplify-flex {
  gap: 8px;
}

/* Input backgrounds, borders, focus state. */
.amplify-input,
.amplify-field-group__control {
  background: var(--panel-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--line-2) !important;
  border-radius: var(--radius-sm) !important;
  padding: 11px 14px !important;
  font: 14px var(--font) !important;
  width: 100% !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.amplify-input::placeholder {
  color: var(--muted-2) !important;
  opacity: 1 !important;
}
.amplify-input:hover,
.amplify-field-group__control:hover {
  border-color: var(--muted-2) !important;
}
.amplify-input:focus,
.amplify-field-group__control:focus,
.amplify-input:focus-within,
.amplify-field-group__control:focus-within {
  outline: none !important;
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 1px var(--orange) inset !important;
}

/* Labels. */
.amplify-label,
label.amplify-label {
  color: var(--muted) !important;
  font: 500 12px var(--font) !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Field group wrapper (input + show-password button). */
.amplify-field-group {
  background: var(--panel-2) !important;
  border-radius: var(--radius-sm) !important;
}
.amplify-field-group__control
  + .amplify-field-group__outer-end
  .amplify-field-group__control,
.amplify-field-group--horizontal .amplify-field-group__field-wrapper {
  background: transparent !important;
}
.amplify-field-group__outer-end {
  background: transparent !important;
  border-left: 1px solid var(--line-2) !important;
  color: var(--muted) !important;
}

/* Show-password toggle button. */
.amplify-field__show-password {
  background: transparent !important;
  color: var(--muted) !important;
  padding: 0 12px !important;
}
.amplify-field__show-password:hover {
  color: var(--orange) !important;
}
.amplify-icon {
  color: inherit !important;
}

/* Primary button (Sign in). */
.amplify-button--primary,
button.amplify-button--primary[type="submit"] {
  background: var(--orange) !important;
  color: #15181a !important;
  border: 0 !important;
  border-radius: var(--radius-sm) !important;
  padding: 12px 16px !important;
  font: 600 14px var(--font) !important;
  cursor: pointer !important;
  width: 100% !important;
  margin-top: 4px !important;
  transition:
    background-color 0.15s ease,
    transform 0.05s ease !important;
}
.amplify-button--primary:hover {
  background: var(--orange-600) !important;
}
.amplify-button--primary:active {
  transform: translateY(1px);
  background: var(--orange-600) !important;
}
.amplify-button--primary:focus-visible {
  outline: 2px solid var(--orange) !important;
  outline-offset: 2px !important;
}
.amplify-button--primary[disabled] {
  background: var(--orange-700) !important;
  color: var(--muted) !important;
  cursor: not-allowed !important;
}

/* Link buttons (Forgot your password?). */
.amplify-button--link,
button.amplify-button--link {
  background: transparent !important;
  color: var(--orange) !important;
  padding: 8px 0 !important;
  font: 500 13px var(--font) !important;
  cursor: pointer !important;
  border: 0 !important;
}
.amplify-button--link:hover {
  color: var(--orange-600) !important;
  text-decoration: underline !important;
}

/* Footer wrapping the link. */
[data-amplify-footer] {
  margin-top: 4px;
}

/* Generic .amplify-button reset (for buttons outside primary/link variants). */
.amplify-button {
  background: transparent !important;
  color: inherit !important;
  border: 0 !important;
  font: inherit !important;
}
.login-card__error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
}
.login-card__alt {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.login-card__alt a {
  color: var(--orange);
  text-decoration: none;
}
.login-card__alt a:hover {
  text-decoration: underline;
}

/* Sign-out affordance shown inside <Authenticator> after login. */
.login-card__signedin {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}
.login-card__signout {
  background: transparent;
  color: var(--orange);
  border: 1px solid var(--orange);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font: 500 13px var(--font);
  cursor: pointer;
}
.login-card__signout:hover {
  background: rgba(241, 134, 13, 0.1);
}

[data-amplify-router] {
  background: transparent !important;
  border: none !important;
}
