/* Shared score typography and navigation dimensions for participant and admin views. */
:root { --ah-sidebar-width: 184px; --ah-font-body: Arial, 'Pretendard', sans-serif; }
:is(body.ah-app, body.ah-admin-app) { font-family: var(--ah-font-body); }
:is(.ah-app, .ah-admin-app) :is(h1, h2, h3, h4, h5, h6, p, a, li, td, th, label, button, input, select, textarea, small, .nav-link) {
  font-family: var(--ah-font-body) !important;
}
:is(.ah-app, .ah-admin-app) :is(.ah-overline, .ah-3d-callout span, .ah-3d-callout b, .ah-session-stats strong) { font-family: var(--ah-font-body) !important; }
:is(.ah-app, .ah-admin-app) :is(.jumbotron h1, .ah-list-title h1, .ah-console-copy h1) {
  font-size: clamp(28px, 3.6vh, 42px) !important;
  font-weight: 700 !important;
  letter-spacing: .015em;
  color: #f4f5f7;
}
:is(.ah-app, .ah-admin-app) :is(.jumbotron h1, .ah-list-title h1) { line-height: 1.2; }
body.ah-app .ah-workspace .ah-console-copy h1 { margin: 0; background: none; }

@media (min-width: 768px) {
  body.ah-app:not(.ah-preauth) .ah-sidebar,
  body.ah-admin-app .ah-admin-sidebar {
    width: var(--ah-sidebar-width);
    height: 100dvh;
    padding: clamp(10px, 2vh, 22px) 14px;
    overflow-y: auto;
  }
  body.ah-app:not(.ah-preauth) main,
  body.ah-admin-app main { margin-left: var(--ah-sidebar-width); }
  body.ah-app:not(.ah-preauth) .footer,
  body.ah-admin-app .footer { margin-left: var(--ah-sidebar-width); width: calc(100% - var(--ah-sidebar-width)); }
  :is(.ah-sidebar, .ah-admin-sidebar) > .container { height: 100%; min-height: 0; }
  :is(.ah-sidebar, .ah-admin-sidebar) .navbar-brand {
    flex: 0 0 auto;
    padding: 0 8px 12px;
    margin: 0 0 10px;
  }
  :is(.ah-sidebar, .ah-admin-sidebar) :is(.ah-logo, .ah-admin-logo) {
    width: 122px;
    height: clamp(46px, 8vh, 70px);
    object-fit: contain;
  }
  :is(.ah-sidebar, .ah-admin-sidebar) .navbar-collapse { flex: 1 1 auto; min-height: 0; justify-content: flex-start; }
  :is(.ah-sidebar, .ah-admin-sidebar) .navbar-nav { gap: 2px; flex: 0 0 auto; }
  :is(.ah-sidebar, .ah-admin-sidebar) .navbar-nav + .navbar-nav { margin-top: 8px !important; padding-top: 6px; }
  :is(body.ah-app, body.ah-admin-app) :is(.ah-sidebar, .ah-admin-sidebar) .nav-link {
    display: block;
    width: 100%;
    padding: clamp(4px, calc((100dvh - 520px) / 26), 10px) 12px !important;
    margin: 0;
    font-size: 13px;
    line-height: 20px;
    text-align: left;
    white-space: nowrap;
  }
  :is(.ah-sidebar, .ah-admin-sidebar) .dropdown-item { text-align: left; }
  body.ah-admin-app .ah-admin-sidebar .navbar-brand span { border: 0; color: #7fc0ea; }
  html.ah-sidebar-collapsed body.ah-app .ah-sidebar { width: var(--ah-sidebar-collapsed-width); }
  html.ah-sidebar-collapsed body.ah-app:not(.ah-preauth) :is(main, .footer) { margin-left: var(--ah-sidebar-collapsed-width); }
  html.ah-sidebar-collapsed body.ah-app:not(.ah-preauth) .footer { width: calc(100% - var(--ah-sidebar-collapsed-width)); }
}
@media (min-width: 1500px) {
  :root { --ah-sidebar-width: 214px; }
  :is(body.ah-app, body.ah-admin-app) :is(.ah-sidebar, .ah-admin-sidebar) .nav-link { font-size: 14px; }
}

/* Track headings keep their complete names on a single line at every viewport. */
body.ah-app #ah-pit.ah-pit--board #ah-lanes {
  --ah-cols: minmax(320px, 1.9fr) repeat(var(--tracks), minmax(178px, 1fr));
  min-width: calc(320px + var(--tracks) * 178px);
}
body.ah-app #ah-pit.ah-pit--board .ah-track-head > .ah-head-track { gap: 8px; padding-inline: 10px; }
body.ah-app #ah-pit.ah-pit--board .ah-head-track > div > span {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  font-size: clamp(12px, .85vw, 17px);
}
body.ah-app #ah-pit.ah-pit--board .ah-track-icon { flex-basis: 26px; width: 26px; height: 29px; }

/* Vehicle cards retain the proposal's icon / title / solve-count presentation. */
body.ah-app .ah-workspace .ah-3d-callout {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  width: clamp(156px, 22%, 210px);
  min-height: 74px;
  padding: 14px;
  border: 1px solid #404859;
  border-radius: 10px;
  background: linear-gradient(135deg, #19222de8, #0a0e17ed);
  box-shadow: inset 0 1px #ffffff0a, 0 8px 24px #0003;
  text-align: left;
}
body.ah-app .ah-workspace .ah-3d-callout::after { display: none; }
body.ah-app .ah-workspace .ah-callout-icon { display: block; width: 26px; height: 26px; color: #8abfff; }
.ah-callout-icon svg, .ah-track-brief-icon svg { width: 100%; height: 100%; display: block; }
body.ah-app .ah-workspace .ah-callout-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
body.ah-app .ah-workspace .ah-callout-title { font: 600 clamp(12px, .9vw, 16px)/1.2 Arial, 'Pretendard', sans-serif; letter-spacing: -.02em; white-space: nowrap; }
body.ah-app .ah-workspace .ah-3d-callout b { display: flex; align-items: center; gap: 7px; margin: 0; color: #b3c3d6; font: 400 11px/1.2 Arial, 'Pretendard', sans-serif; white-space: nowrap; }
body.ah-app .ah-workspace .ah-3d-callout b::before { content: ''; flex: 0 0 10px; width: 10px; height: 10px; border: 1px solid #657086; border-radius: 50%; }
body.ah-app .ah-workspace .ah-3d-callout[data-progress=complete] b::before { background: #4aa8ff; border-color: #b0d4ff; }
body.ah-app .ah-workspace .ah-3d-callout[data-progress=partial] b::before { background: #526f93; border-color: #8aa6c8; }
body.ah-app .ah-workspace .ah-3d-callout[aria-pressed=true] { border-color: #8fbcf4; background: linear-gradient(135deg, #20334be8, #10182aed); box-shadow: inset 0 1px #ffffff15, 0 0 0 1px #4aa8ff22; }

/* A wider vehicle stage and a compact, useful brief for the selected track. */
body.ah-app .ah-workspace .ah-track-brief {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  padding: 26px;
  background: linear-gradient(150deg, #131b2a, #0d1320);
  border-left: 1px solid #253b55;
}
.ah-track-eyebrow { display: flex; justify-content: space-between; color: #8e9dbb; font-size: 10px; letter-spacing: .1em; }
.ah-track-identity { display: flex; align-items: center; gap: 14px; }
.ah-track-brief-icon { flex: 0 0 32px; height: 32px; color: #8abfff; }
body.ah-app .ah-track-identity h2 { font-size: clamp(20px, 1.5vw, 26px); font-weight: 650; line-height: 1.2; margin: 0; color: #ecf2f9; letter-spacing: -.025em; }
.ah-track-description { margin: -4px 0 0; color: #98a8c3; font-size: 12px; line-height: 1.75; }
.ah-track-facts { display: flex; gap: 22px; padding-bottom: 20px; border-bottom: 1px solid #ffffff12; color: #8493ae; font-size: 9px; letter-spacing: .04em; }
.ah-track-facts strong { font-size: 18px; color: #cbdbee; margin-right: 5px; font-weight: 550; }
.ah-track-problem-heading { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: #9eb0c5; letter-spacing: .05em; }
.ah-track-problem-heading > span:last-child { color: #788bab; letter-spacing: 0; }
.ah-track-problems { display: grid; align-content: start; gap: 9px; margin-top: -8px; max-height: 290px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #465d7a #111827; }
.ah-track-problems > p { color: #95a9c2; font-size: 12px; line-height: 1.7; }
body.ah-app .ah-track-problem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 16px 14px;
  border: 1px solid #2d3d51;
  border-radius: 7px;
  background: #111c2e;
  color: #d8e5f4;
  text-align: left;
  cursor: pointer;
}
.ah-track-problem > span { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ah-track-problem strong { font-size: 13px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.ah-track-problem small { color: #7f91b1; font-size: 9px; letter-spacing: .07em; }
.ah-track-problem > b { color: #aed1fc; font-size: 11px; font-weight: 500; white-space: nowrap; }
body.ah-app .ah-track-problem:hover { background: #1b2d44; border-color: #749ed1; }
.ah-track-problem[data-solved=true] small { color: #a9d0ff; }
.ah-track-session { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; border-top: 1px solid #ffffff12; }
.ah-track-session > div { display: flex; flex-direction: column; gap: 5px; }
.ah-track-session [data-ah-clock-label] { font-size: 10px; color: #a3b8d2; }
.ah-track-session small { font-size: 9px; color: #728dad; }
.ah-track-session strong { font-size: 21px; line-height: 1.2; font-variant-numeric: tabular-nums; color: #dceafa; font-weight: 550; }
@media (min-width: 1101px) {
  body.ah-app .ah-workspace { grid-template-columns: minmax(0, 1fr) clamp(290px, 25vw, 360px); grid-template-rows: auto minmax(440px, auto) auto; }
  body.ah-app .ah-workspace .ah-region-map { grid-column: 1; grid-row: 2; padding: 0; min-height: 440px; }
  body.ah-app .ah-workspace .ah-car-model { height: 100%; min-height: 440px; max-height: 540px; }
  body.ah-app .ah-workspace .ah-track-brief { grid-column: 2; grid-row: 2; }
  body.ah-app .ah-workspace .ah-map-legend { grid-row: 3; }
  body.ah-app .ah-workspace .ah-3d-callout.is-left { left: 18px; }
  body.ah-app .ah-workspace .ah-3d-callout.is-right { right: 18px; }
  body.ah-app .ah-workspace .ah-3d-callout:is(.is-ev6, .is-jeep) { top: 7%; }
  body.ah-app .ah-workspace .ah-3d-callout:is(.is-vector, .is-ids) { top: 40%; }
  body.ah-app .ah-workspace .ah-3d-callout:is(.is-can, .is-evse) { top: 73%; }
  body.ah-app .ah-workspace .ah-orbit-hint { bottom: 14px; }
}
/* Reuse design-proposal's photos and overlays; navigation retains its plain navy surface. */
:is(body.ah-app:not(.ah-preauth), body.ah-admin-app) main {
  background: linear-gradient(180deg, rgba(5,9,16,.72), #070b12 38%), linear-gradient(#1f63c766, #1f63c766), url('challenge-garage.png') center top / cover fixed;
  background-blend-mode: normal, color, normal;
}
body.ah-app .ah-workspace .ah-region-map {
  background: linear-gradient(180deg, #03071066, #03071044), linear-gradient(#1f63c766, #1f63c766), url('challenge-garage.png') center / cover;
  background-blend-mode: normal, color, normal;
}
body.ah-app .ah-workspace .ah-region-map .ah-car-model { background: transparent; }
@media (min-width: 768px) and (max-width: 1100px) {
  body.ah-app .ah-workspace { grid-template-columns: 1fr; grid-template-rows: auto 420px auto auto; }
  body.ah-app .ah-workspace .ah-region-map { grid-column: 1; grid-row: 2; }
  body.ah-app .ah-workspace .ah-track-brief { grid-column: 1; grid-row: 3; display: grid; grid-template-columns: 1fr 1.15fr; grid-template-rows: auto auto auto 1fr auto; gap: 14px 24px; border-left: 0; border-top: 1px solid #253b55; padding: 22px; }
  .ah-track-eyebrow { grid-column: 1 / -1; }
  .ah-track-identity, .ah-track-description, .ah-track-facts { grid-column: 1; }
  .ah-track-facts { border: 0; padding: 0; }
  .ah-track-problem-heading { grid-column: 2; grid-row: 2; align-items: center; }
  .ah-track-problems { grid-column: 2; grid-row: 3 / 5; margin: 0; max-height: 210px; }
  .ah-track-session { grid-column: 1 / -1; margin-top: 0; padding-top: 14px; }
  body.ah-app .ah-workspace .ah-map-legend { grid-row: 4; }
  body.ah-app .ah-workspace .ah-3d-callout { grid-template-columns: 22px minmax(0, 1fr); column-gap: 9px; width: 155px; min-height: 66px; padding: 11px; }
  body.ah-app .ah-workspace .ah-callout-icon { width: 22px; height: 22px; }
  body.ah-app .ah-workspace .ah-callout-title { font-size: 12px; }
}
@media (max-width: 767px) {
  body.ah-app .ah-workspace .ah-region-map { min-height: 545px; }
  body.ah-app .ah-workspace .ah-car-model { height: 300px; }
  body.ah-app .ah-workspace .ah-3d-callouts { grid-template-rows: repeat(3, 66px); }
  body.ah-app .ah-workspace .ah-3d-callout { width: auto; min-height: 66px; padding: 11px 9px; grid-template-columns: 22px minmax(0, 1fr); column-gap: 9px; }
  body.ah-app .ah-workspace .ah-callout-icon { width: 22px; height: 22px; }
  body.ah-app .ah-workspace .ah-callout-title { font-size: 12px; }
  body.ah-app .ah-workspace .ah-orbit-hint { bottom: 228px; }
  body.ah-app .ah-workspace .ah-track-brief { padding: 22px 18px; border-left: 0; border-top: 1px solid #253b55; }
}

/* Operational views share the same palette while preserving state colors. */
body.ah-admin-app { color-scheme: dark; }
body.ah-admin-app .ah-admin-logo { mix-blend-mode: normal; }
body.ah-admin-app .table { background: #0b101b; color: #d9e2ee; }
body.ah-admin-app .table-striped tbody tr:nth-of-type(odd) { background: #141c2c; }
body.ah-admin-app :is(.card-footer, .modal-footer) { background: #111827; border-color: #253b55; }
body.ah-admin-app :is(.nav-tabs, .nav-pills) .nav-link { color: #adc7e6; }
body.ah-admin-app :is(.nav-tabs, .nav-pills) .nav-link.active { background: #294464; border-color: #4aa8ff; color: #edf5ff; }
body.ah-admin-app :is(.dropdown-item, .page-link) { color: #c1d6f0; background: #131d30; border-color: #2a4664; }
body.ah-admin-app .page-item.active .page-link { background: #2a8ae8; border-color: #8fc1ff; }
body.ah-admin-app :is(.CodeMirror, .editor-preview) { background: #0d1422; color: #d6f0ff; border-color: #2a4664; }
body.ah-admin-app .CodeMirror-gutters { background: #172138; border-color: #2a4664; }
body.ah-admin-app main > .bg-warning { background: #302919 !important; }
body.ah-admin-app .btn-warning { background: #6e552d; border-color: #9d7b45; color: #f1dfba; }
body.ah-admin-app .ah-admin-sidebar .dropdown-toggle:not([aria-current=page]) { background: transparent !important; color: #bbcfe7 !important; }
