/* TECH ACADEMY - dot-matrix field terminal.
   Mobile first. Square chrome, no rounded corners, no gradients on type.
   Everything is self-contained: no webfonts, no network. */

:root {
  --bg:        #0B0F14;
  --panel:     #121A22;
  --panel-2:   #18222C;
  --line:      #24313E;
  --line-hot:  #35485A;
  --ink:       #E7EEF4;
  --dim:       #8397A9;
  --dimmer:    #5B6C7C;
  --blue:      #009FDB;
  --blue-lo:   #00567F;
  --blue-hi:   #63D2FF;
  --good:      #4ED17A;
  --warn:      #F2A33C;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
  --gut: 14px;
}

* { box-sizing: border-box; }

/* Any element given an explicit `display` outruns the UA rule for [hidden],
   which is how the reset dialog ended up visible on every page. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--mono);
  letter-spacing: .01em;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

button { font: inherit; color: inherit; }

.skip {
  position: absolute; left: -9999px;
  background: var(--blue); color: #001824; padding: 8px 12px; z-index: 99;
}
.skip:focus { left: 8px; top: 8px; }

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

/* ------------------------------------------------------------------ header */

/* Header and stage pin together: the van has to stay on screen while you work
   down the route, so the whole block sticks and the route scrolls under it. */
.chrome {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  box-shadow: 0 6px 12px rgba(0,0,0,.45);
}

/* The chrome is a fixed-size element. It must not resize, crop, or reflow on
   scroll: any movement up here reads as the stage jumping around. */
.top {
  background: var(--bg);
  border-bottom: 2px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) var(--gut) 10px;
}

/* The menu button is taken out of the flow so the wordmark sits in the true
   centre of the header rather than the centre of what is left over. */
.top-row { position: relative; display: flex; align-items: center;
           min-height: 40px; }

.top-row .iconbtn { position: absolute; left: 0; top: 0; }

.brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex: 1; min-width: 0; padding: 0 52px;
  text-decoration: none; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.brand:hover .brand-title { color: var(--blue-hi); }

.brand-text { align-items: center; text-align: center; }

/* CSS stand-in for the globe. The sprite version lives on the van. */
.globe {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  background:
    repeating-linear-gradient(
      180deg,
      var(--blue) 0 3px,
      #FFFFFF   3px 6px
    );
  box-shadow: inset 0 0 0 2px var(--blue);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-title {
  font-size: 17px; font-weight: 700; letter-spacing: .16em; line-height: 1.1;
}

.brand-sub {
  font-size: 9.5px; letter-spacing: .14em; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 3px;
}

.progress { margin-top: 12px; }

.progress-line {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; letter-spacing: .12em;
}

.rank { color: var(--blue-hi); font-weight: 700; }
.tally { color: var(--dim); }

.bar {
  height: 10px; margin-top: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1px;
}

.bar-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg, var(--blue) 0 4px, var(--blue-lo) 4px 6px);
  transition: width .35s steps(12, end);
}

.next-rank {
  margin: 6px 0 0; font-size: 10px; letter-spacing: .12em; color: var(--dimmer);
}

/* ------------------------------------------------------------------- stage */

.stage {
  display: flex; justify-content: center; align-items: flex-end;
  background: #12202E;
  border-bottom: 2px solid var(--line);
  overflow: hidden; line-height: 0;
}

.stage-canvas { display: block; image-rendering: pixelated; }

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

.shell { padding: 18px var(--gut) 60px; }

/* -------------------------------------------------------------------- legs */

.leg { margin: 0 0 26px; }

.leg-head { margin-bottom: 10px; }

.leg-title {
  margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .2em;
  color: var(--blue-hi);
  border-left: 4px solid var(--blue);
  padding-left: 9px;
}

.leg-caption {
  margin: 5px 0 0 13px; font-size: 11px; color: var(--dim); letter-spacing: .04em;
}

/* ------------------------------------------------------------------- stops */

.stops {
  list-style: none; margin: 0; padding: 0 0 0 0;
  position: relative;
}

/* the road */
.stops::before {
  content: ""; position: absolute; left: 16px; top: 8px; bottom: 8px;
  width: 2px;
  background: repeating-linear-gradient(
    180deg, var(--line-hot) 0 6px, transparent 6px 12px);
}

.stop { position: relative; margin-bottom: 8px; }

.stop-btn {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  text-align: left; background: var(--panel);
  border: 1px solid var(--line);
  border-left-width: 3px;
  padding: 11px 12px; min-height: 52px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.stop-btn:hover { background: var(--panel-2); border-color: var(--line-hot); }

.stop-mark {
  flex: none; width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--bg);
  border: 1px solid var(--line-hot);
  font-size: 12px; font-weight: 700; color: var(--dim);
}

.stop-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.stop-label {
  font-size: 12.5px; font-weight: 700; letter-spacing: .09em; line-height: 1.3;
}

.stop-brief {
  font-size: 11px; color: var(--dim); letter-spacing: .01em; line-height: 1.4;
}

.stop.is-done .stop-mark { color: var(--good); border-color: var(--good); }
.stop.is-done .stop-label { color: var(--dim); }
.stop.is-done .stop-btn { border-left-color: var(--good); }

.stop.is-skipped .stop-btn { border-left-color: var(--dimmer); }
.stop.is-skipped .stop-mark { color: var(--dimmer); border-color: var(--dimmer); }
.stop.is-skipped .stop-label {
  color: var(--dimmer); text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.stop.is-skipped .stop-brief { color: var(--dimmer); }

.stop.is-current .stop-btn {
  background: var(--panel-2);
  border-color: var(--blue);
  border-left-color: var(--blue-hi);
}
.stop.is-current .stop-mark {
  color: var(--bg); background: var(--blue-hi); border-color: var(--blue-hi);
}
.stop.is-current .stop-label { color: #fff; }


.sprite { display: block; image-rendering: pixelated; }

/* --------------------------------------------------------- folded sections */

.leg--folded { margin-bottom: 10px; }

.leg-fold {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: 1px solid var(--line);
  border-left: 3px solid var(--good);
  padding: 9px 12px; min-height: 44px; cursor: pointer; text-align: left;
}
.leg-fold:hover { background: var(--panel); border-color: var(--line-hot); }

.fold-tick {
  flex: none; width: 20px; height: 20px; display: grid; place-items: center;
  border: 1px solid var(--good); color: var(--good); font-size: 11px;
}

.fold-title {
  flex: 1; font-size: 11px; font-weight: 700; letter-spacing: .16em;
  color: var(--dim); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.fold-count { font-size: 9.5px; letter-spacing: .1em; color: var(--dimmer); }

/* ------------------------------------------------------------------- forks */

.leg--fork { border-top: 1px dashed var(--line-hot); padding-top: 16px; }

.fork-prompt { color: var(--warn); border-left-color: var(--warn); }

.leg--fork.flash { animation: flash .4s steps(2, end) 3; }
@keyframes flash { 50% { background: rgba(242,163,60,.10); } }

.lanes { display: flex; gap: 10px; align-items: flex-start; }

.lane { flex: 1 1 0; min-width: 0; }

.lane-head {
  display: flex; flex-direction: column; gap: 3px; width: 100%;
  background: var(--panel); border: 1px solid var(--line-hot);
  border-bottom: 3px solid var(--line-hot);
  padding: 10px 8px; margin-bottom: 10px; min-height: 52px;
  cursor: pointer; text-align: left;
}

.lane-title { font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.lane-count { font-size: 9.5px; letter-spacing: .1em; color: var(--dimmer); }

.lane.is-taken .lane-head {
  border-color: var(--blue); border-bottom-color: var(--blue-hi);
  background: var(--panel-2);
}
.lane.is-taken .lane-title { color: var(--blue-hi); }

.lane.is-untaken { opacity: .45; }
.lane.is-untaken:hover, .lane.is-untaken:focus-within { opacity: .85; }

/* lane cards are half width, so drop the second line of copy */
.stops--lane .stop-brief { display: none; }
.stops--lane .stop-btn { padding: 9px 8px; gap: 8px; }
.stops--lane .stop-mark { width: 22px; height: 22px; font-size: 11px; }
.stops--lane .stop-label { font-size: 11px; letter-spacing: .06em; }
.stops--lane::before { left: 14px; }

/* ------------------------------------------------------------------ detail */

/* The step sheet slides up UNDER the chrome, never over it. Covering the stage
   would hide the van driving to the very place the step is about. */
.detail {
  position: fixed; left: 0; right: 0; bottom: 0;
  top: var(--chrome-h, 330px);
  z-index: 40;
  background: var(--bg);
  border-top: 2px solid var(--line-hot);
  padding: 14px var(--gut) calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform .22s ease-out;
  visibility: hidden;
}

body.is-detail-open .detail { transform: translateY(0); visibility: visible; }

.detail-close {
  background: none; border: 1px solid var(--line-hot);
  padding: 8px 12px; font-size: 11px; letter-spacing: .14em;
  cursor: pointer; margin-bottom: 14px;
}

.detail-art {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px; margin-bottom: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}

.art-todo {
  font-size: 9.5px; letter-spacing: .14em; color: var(--dimmer);
}

.detail-kicker {
  margin: 0 0 6px; font-size: 10px; letter-spacing: .16em; color: var(--warn);
}

.detail-title {
  margin: 0 0 8px; font-size: 18px; font-weight: 700; letter-spacing: .08em;
  line-height: 1.25;
}

.detail-brief {
  margin: 0 0 16px; font-size: 13px; color: var(--blue-hi); line-height: 1.5;
}

.checks { list-style: none; margin: 0 0 18px; padding: 0; }

.check { margin-bottom: 6px; }

.check-btn {
  display: flex; gap: 11px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line);
  padding: 11px 12px; min-height: 46px; cursor: pointer; align-items: flex-start;
}
.check-btn:hover { border-color: var(--line-hot); }

.check-box {
  flex: none; width: 20px; height: 20px; margin-top: 1px;
  border: 1px solid var(--line-hot); display: grid; place-items: center;
  font-size: 12px; color: var(--good);
}

.check-text { font-size: 12.5px; line-height: 1.45; }

.check.is-checked .check-box { border-color: var(--good); }
.check.is-checked .check-text { color: var(--dim); }

.watch {
  border: 1px solid var(--warn); border-left-width: 4px;
  background: rgba(242,163,60,.06);
  padding: 12px; margin-bottom: 20px;
}

.watch-title {
  margin: 0 0 6px; font-size: 10px; letter-spacing: .18em; color: var(--warn);
}

.watch-body { margin: 0; font-size: 12.5px; line-height: 1.5; }

.detail-nav { display: flex; gap: 8px; }

.btn {
  border: 1px solid var(--line-hot); background: var(--panel);
  padding: 13px 14px; font-size: 12px; font-weight: 700; letter-spacing: .12em;
  cursor: pointer; min-height: 48px;
}
.btn:disabled { opacity: .35; cursor: default; }
.btn--ghost { flex: 0 0 auto; padding: 13px 11px; letter-spacing: .08em; }
.btn--go {
  flex: 1; background: var(--blue); border-color: var(--blue-hi); color: #00202F;
}
.btn--go:hover { background: var(--blue-hi); }
.btn--tiny { padding: 7px 10px; font-size: 10px; min-height: 0; }

.detail-foot {
  margin: 18px 0 0; font-size: 10px; letter-spacing: .08em; color: var(--dimmer);
  border-top: 1px solid var(--line); padding-top: 10px;
}

.detail-empty { color: var(--dim); font-size: 12px; }

/* -------------------------------------------------------------- CRT overlay */

.scanlines {
  position: fixed; inset: 0; z-index: 25; pointer-events: none;
  background: repeating-linear-gradient(
    180deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  opacity: .5;
}

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

/* ----------------------------------------------------------------- desktop */

@media (min-width: 980px) {
  body { font-size: 15px; }

  .top { padding-left: 28px; padding-right: 28px; }
  .top-row, .progress { max-width: 1180px; margin-inline: auto; }
  .progress { margin-top: 12px; }

  .shell {
    display: grid;
    grid-template-columns: minmax(360px, 460px) 1fr;
    gap: 32px; align-items: start;
    max-width: 1180px; margin-inline: auto;
    padding: 26px 28px 80px;
  }

  .detail {
    /* inset first: it resets the mobile top/left/right/bottom, and would wipe
       out `top` if it came after. */
    inset: auto;
    position: sticky;
    top: calc(var(--chrome-h, 330px) + 18px);
    transform: none; visibility: visible; z-index: 1;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 22px;
    max-height: calc(100vh - var(--chrome-h, 330px) - 44px);
  }

  .detail-close { display: none; }

  .stops--lane .stop-brief { display: block; }
  .stop-btn { padding: 13px 14px; }
}

@media (min-width: 1240px) {
  .detail-art { padding: 22px; }
}

/* ========================================================== shell additions */

.iconbtn {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line-hot);
  cursor: pointer; font-size: 14px; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.iconbtn:hover { border-color: var(--blue); background: var(--panel-2); }

.bars { display: block; width: 16px; }
.bars i {
  display: block; height: 2px; background: var(--ink); margin: 3px 0;
}

/* Controls pinned to the animation window itself, so they never scroll away
   and never sit on top of the picture's subject. */
.stage { position: relative; }

.stagebtn {
  position: absolute; top: 8px; z-index: 3;
  background: rgba(11,15,20,.82);
  border: 1px solid var(--line-hot);
  color: var(--ink);
  padding: 8px 11px; min-height: 36px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  cursor: pointer; backdrop-filter: blur(2px);
}
.stagebtn:hover { border-color: var(--blue); background: rgba(11,15,20,.95); }
.stagebtn--l { left: 8px; }
.stagebtn--r { right: 8px; border-color: #6E4A1E; color: #F2A33C; }
.stagebtn--r:hover { border-color: var(--warn); }

@media (min-width: 980px) { .stagebtn--l { display: none; } }

/* ------------------------------------------------------------------ drawer */

.scrim {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(0,0,0,.6);
  opacity: 0; transition: opacity .2s ease-out;
}
body.is-drawer-open .scrim { opacity: 1; }

.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 46;
  width: min(84vw, 340px);
  background: var(--bg);
  border-right: 2px solid var(--blue-lo);
  padding: calc(14px + env(safe-area-inset-top)) 0 24px;
  transform: translateX(-102%);
  transition: transform .2s ease-out;
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
body.is-drawer-open .drawer { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 12px; border-bottom: 1px solid var(--line);
}
.drawer-title {
  font-size: 11px; font-weight: 700; letter-spacing: .22em; color: var(--blue-hi);
}

.drawer-list { list-style: none; margin: 0; padding: 10px 10px 0; flex: 1; }
.drawer-item { margin-bottom: 6px; }

.drawer-link {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px; min-height: 56px; justify-content: center;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--line-hot);
  text-decoration: none; color: inherit;
}
.drawer-link:hover { border-left-color: var(--blue); background: var(--panel-2); }
.drawer-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.drawer-hint { font-size: 10.5px; color: var(--dim); }

.drawer-foot {
  margin: 14px 14px 0; padding-top: 12px; font-size: 10px;
  color: var(--dimmer); border-top: 1px solid var(--line); letter-spacing: .06em;
}

/* ------------------------------------------------------------------- pages */

.page { max-width: 760px; margin-inline: auto; }

.page-kicker {
  margin: 0 0 4px; font-size: 10px; letter-spacing: .2em; color: var(--warn);
}
.page-title {
  margin: 0 0 14px; font-size: 22px; font-weight: 700; letter-spacing: .1em;
}
.page-intro {
  margin: 0 0 20px; font-size: 13px; line-height: 1.6; color: var(--blue-hi);
}
.page-foot {
  margin: 26px 0 0; padding-top: 12px; font-size: 10px; color: var(--dimmer);
  border-top: 1px solid var(--line); letter-spacing: .08em;
}

.section-head {
  margin: 26px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .2em;
  color: var(--blue-hi); border-left: 4px solid var(--blue); padding-left: 9px;
}

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--line-hot);
  padding: 14px; margin-bottom: 10px;
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.card-headtext { min-width: 0; }
.card-art { flex: none; line-height: 0; }
.card-art canvas { image-rendering: pixelated; }
.card-kicker {
  margin: 0 0 4px; font-size: 9.5px; letter-spacing: .18em; color: var(--dim);
}
.card-title {
  margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .08em;
  line-height: 1.3;
}
.card-body { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink); }
.card-by { margin: 10px 0 0; font-size: 10px; letter-spacing: .12em; color: var(--dimmer); }

.card--safety { border-left-color: var(--warn); }
.card--safety .card-kicker { color: var(--warn); }

.card--quote { border-left-color: var(--blue); text-align: center; padding: 20px 16px; }
.quote-mark { margin: 0; font-size: 26px; line-height: .6; color: var(--blue-lo); }
.quote-text { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--blue-hi); }
.quote-by { margin: 10px 0 0; font-size: 9.5px; letter-spacing: .18em; color: var(--dimmer); }

.card--week { border-left-color: var(--good); }
.card--week .card-kicker { color: var(--good); }

.news-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.news-tag {
  font-size: 9px; letter-spacing: .16em; color: var(--bg);
  background: var(--blue); padding: 2px 6px;
}
.news-date { font-size: 9.5px; letter-spacing: .14em; color: var(--dimmer); }

.tilegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  min-height: 68px; padding: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-bottom: 3px solid var(--line-hot);
  text-decoration: none; color: inherit;
}
.tile:hover { border-bottom-color: var(--blue); background: var(--panel-2); }
.tile-label { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; }
.tile-hint { font-size: 10px; color: var(--dim); line-height: 1.35; }

.keynum {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--blue);
  color: var(--blue-hi); font-size: 12px; font-weight: 700;
}
.card--key, .card--phase, .card--test { border-left-color: var(--blue); }

.card-do, .card-pass {
  display: flex; gap: 8px; align-items: baseline; margin: 10px 0 0;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.do-tag {
  flex: none; font-size: 9px; letter-spacing: .16em; color: var(--warn);
}
.do-text { font-size: 12px; line-height: 1.5; color: var(--dim); }

.marks { list-style: none; margin: 10px 0 0; padding: 0; }
.mark { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 5px; }
.mark-box {
  flex: none; width: 16px; height: 16px; display: grid; place-items: center;
  border: 1px solid var(--good); color: var(--good); font-size: 9px;
}
.mark-text { font-size: 12px; line-height: 1.45; color: var(--dim); }

.howto { margin: 10px 0 0; padding-left: 20px; }
.howto-step { font-size: 12px; line-height: 1.55; margin-bottom: 4px; }

.warnbox {
  border: 2px solid var(--warn); background: rgba(242,163,60,.08);
  padding: 13px; margin-bottom: 18px;
}
.warn-tag {
  display: block; font-size: 9.5px; letter-spacing: .2em; color: var(--warn);
  margin-bottom: 6px; font-weight: 700;
}
.warn-text { margin: 0; font-size: 12.5px; line-height: 1.6; }

.card--rule { border-left-color: var(--warn); }
.card--urgent { border-left-color: #E03A3E; }
.card--urgent .card-title { color: #FF6B63; }

.lines { margin-top: 10px; border-top: 1px solid var(--line); }
.line {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.line-k { color: var(--dim); letter-spacing: .1em; font-size: 10.5px; }
.line-v { color: var(--blue-hi); }

.card--person { border-left-color: var(--good); }

/* ------------------------------------------------------------------- modal */

.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(0,0,0,.72);
  padding: 20px;
}

.modal-box {
  width: min(100%, 420px);
  background: var(--bg);
  border: 2px solid #1A1F27;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}

/* black and yellow hazard tape, drawn with a repeating gradient */
.tape {
  height: 16px;
  background: repeating-linear-gradient(
    -45deg, #F5C518 0 12px, #14181F 12px 24px);
}

.modal-body { padding: 18px 16px; }
.modal-title {
  margin: 0 0 8px; font-size: 16px; font-weight: 700; letter-spacing: .16em;
  color: #F5C518;
}
.modal-text { margin: 0 0 18px; font-size: 13px; line-height: 1.6; }
.modal-nav { display: flex; gap: 10px; }
.modal-nav .btn { flex: 1; }

.btn--danger {
  background: #C9302C; border-color: #F5C518; color: #fff;
}
.btn--danger:hover { background: #E03A3E; }

body.is-modal-open { overflow: hidden; }

/* ----------------------------------------------------- desktop adjustments */

@media (min-width: 980px) {
  .page { max-width: none; }
  body:not(.is-flow) .shell { display: block; }
  .tilegrid { grid-template-columns: repeat(3, 1fr); }
}

/* -------------------------------------------------------- job complete */

.done-panel {
  border: 2px solid var(--good);
  background: linear-gradient(180deg, rgba(78,209,122,.10), transparent 70%),
              var(--panel);
  padding: 18px 16px; margin-bottom: 22px; text-align: center;
}

.done-kicker {
  margin: 0 0 6px; font-size: 10px; letter-spacing: .24em; color: var(--good);
}
.done-title {
  margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: .14em;
}
.done-body {
  margin: 0 0 16px; font-size: 12.5px; line-height: 1.6; color: var(--dim);
}

.done-stats { display: flex; gap: 8px; margin-bottom: 16px; }
.done-stat {
  flex: 1; display: flex; flex-direction: column; gap: 3px;
  padding: 10px 6px; background: var(--bg); border: 1px solid var(--line);
}
.done-stat-v {
  font-size: 15px; font-weight: 700; color: var(--blue-hi); letter-spacing: .06em;
}
.done-stat-k { font-size: 9px; letter-spacing: .14em; color: var(--dimmer); }

.done-panel .btn--go { width: 100%; }


/* --------------------------------------------------- short viewports */
/* A landscape phone has roughly 350px of height. There is no arrangement that
   pins the artwork AND leaves room to read, so here the chrome un-pins and
   scrolls away rather than eating the screen. */

@media (max-height: 520px) and (max-width: 1100px) {
  .chrome { position: static; box-shadow: none; }
  .detail { top: 0; }
  .top { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; }
  .brand-sub { display: none; }
  .next-rank { display: none; }
  .progress { margin-top: 8px; }
}
