[hidden]{display:none!important}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scrollbar-gutter:stable}
/* (the scrollbar's space is kept, so the page doesn't shift sideways when a pop-up or the full-screen road locks scrolling) */
/* Keep the page locked to the screen width: nothing can push it sideways, but normal up/down scrolling still works */
html,body{max-width:100%;overflow-x:hidden;overscroll-behavior-x:none}
@supports (overflow-x:clip){html,body{overflow-x:clip}}
img,video,iframe,embed,object,svg{max-width:100%;height:auto}
iframe,embed,object{display:block;border:0}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
p,li,td,h1,h2,h3{overflow-wrap:break-word}
body{margin:0;background:#f2f2f3;color:#24242c;font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;overflow-wrap:break-word}
header{background:white;color:#24242c;border-bottom:4px solid #c91f2c;text-align:center;padding:24px}
header .logo{display:block;width:220px;max-width:100%;margin:0 auto}
header h1{font-size:clamp(23px,5vw,34px);margin:8px 0 4px}
header nav{justify-content:center}
main{max-width:780px;margin:auto;padding:16px}
h1,h2,h3,p{margin:8px 0 14px}
h2{font-size:22px}
small{color:#5b5b66}
section{background:white;padding:18px;border-radius:16px;margin-bottom:14px;box-shadow:0 2px 8px #00000009}
canvas{display:block;width:100%;max-width:560px;height:auto;margin:0 auto;background:#839978;border-radius:12px;touch-action:manipulation}
a{color:#a51d29}
button,select,input{font:inherit;padding:11px 14px;border:1px solid #c7c7cb;border-radius:9px;background:white;color:#24242c}
button{cursor:pointer}
select{max-width:100%}
button:disabled{opacity:.45;cursor:not-allowed}
button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #d51f30;outline-offset:3px}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0}
.row input:not([type=checkbox]){flex:1;min-width:160px}
.primary{background:#25252d;color:white;border-color:#25252d;font-weight:600}
.ghost{background:transparent}
label{display:inline-flex;gap:6px;align-items:center;margin:4px 12px 4px 0}
.muted{color:#5b5b66}
.error{color:#b3141c;font-weight:600}
code{font:600 15px ui-monospace,Menlo,Consolas,monospace;background:#f2f2f3;padding:2px 8px;border-radius:6px;letter-spacing:.06em}

#go{width:100%;margin-top:12px;padding:20px;font-size:26px;font-weight:800;letter-spacing:.08em;color:white;background:#176b47;border:0;border-radius:14px;box-shadow:0 4px 0 #0f4c32}
#go:active:not(:disabled){transform:translateY(2px);box-shadow:0 2px 0 #0f4c32}
#skip{width:100%;margin-top:12px;padding:20px;font-size:24px;font-weight:800;letter-spacing:.04em;color:white;background:#1f5fae;border:0;border-radius:14px;box-shadow:0 4px 0 #15437c}
#skip:active{transform:translateY(2px);box-shadow:0 2px 0 #15437c}
#ready{width:100%;margin-top:12px;padding:20px;font-size:24px;font-weight:800;letter-spacing:.04em;color:#25252d;background:#ffd23f;border:0;border-radius:14px;box-shadow:0 4px 0 #c9a21c}
#ready:active{transform:translateY(2px);box-shadow:0 2px 0 #c9a21c}
#stop{width:100%;margin-top:12px;padding:20px;font-size:26px;font-weight:800;letter-spacing:.08em;color:white;background:#b3141c;border:0;border-radius:14px;box-shadow:0 4px 0 #7a0d13}
#stop:active:not(:disabled){transform:translateY(2px);box-shadow:0 2px 0 #7a0d13}
#go[hidden],#skip[hidden],#ready[hidden],#stop[hidden]{display:none}
/* Judge it on the approach: GO and STOP side by side */
.two-choice #go,.two-choice #stop{display:inline-block;width:calc(50% - 8px);vertical-align:top}
.two-choice #stop{margin-left:10px}
.hint{text-align:center;font-size:14px;color:#5b5b66;margin:8px 0 0}
#status{font-weight:600;min-height:1.4em}

.feedback{border-radius:12px;padding:14px 16px;margin-top:12px;border-left:6px solid}
.feedback h3{margin:0 0 6px;font-size:18px}
.feedback p{margin:0 0 10px}
.feedback .row{margin-bottom:0}
.feedback.safe{background:#e8f5ee;border-color:#176b47}
.feedback.unsafe{background:#fdecec;border-color:#b3141c}
.feedback.missed{background:#fdf5e3;border-color:#a87a12}

.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin:8px 0 14px}
.tile{background:#f6f6f7;border-radius:12px;padding:12px}
.tile b{display:block;font-size:26px;line-height:1.1}
.tile span{font-size:13px;color:#5b5b66}
table{width:100%;border-collapse:collapse;font-size:15px}
th,td{text-align:left;padding:8px 6px;border-bottom:1px solid #ececef}
th{font-size:13px;color:#5b5b66;font-weight:600}
td.num,th.num{text-align:right}

.list{list-style:none;padding:0;margin:0}
.list li{border:1px solid #ececef;border-radius:12px;padding:12px 14px;margin-bottom:10px}
.list li p{margin:6px 0 8px}
.list .row{margin:0}
.bulk{align-items:center;margin:4px 0 10px;padding:8px 12px;border:1px solid #ececef;border-radius:12px;background:#fafafb}
.bulk label.check{margin:0}
.mistake-head{display:flex;align-items:flex-start;gap:10px}
.mistake-head .pick{width:22px;height:22px;margin:2px 0 0;flex:none;accent-color:#b3141c;cursor:pointer}
.list li.picked{border-color:#b3141c;background:#fff6f6}
.badge{display:inline-block;font-size:12px;font-weight:700;padding:2px 8px;border-radius:99px;margin-right:6px;text-transform:uppercase;letter-spacing:.03em}
.badge.unsafe{background:#fdecec;color:#9b1118}
.badge.missed{background:#fdf5e3;color:#7a5808}
.badge.safe{background:#e8f5ee;color:#0f5536}
.badge.fixed{background:#e8f0fb;color:#1d4c8f}
.meta{font-size:13px;color:#5b5b66}

dialog{border:0;border-radius:16px;padding:0;width:min(640px,96vw);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);box-shadow:0 20px 60px #0005}
/* While a pop-up is open the page behind it stays still, so the pop-up can't drift as the page scrolls underneath */
html:has(dialog[open]),html:has(dialog[open]) body{overflow:hidden}
/* Relook pop-up: fills the screen and stays put while the replay's messages and buttons change.
   The road gets priority: it is shown as large as the screen allows, and the explanation underneath scrolls
   into view if it doesn't fit, instead of the road shrinking to make room for it. */
dialog#relook{position:fixed;inset:0;margin:auto;max-width:none;max-height:none;
  width:min(calc(100vw - 16px),max(560px,min(1000px,calc((100vh - 250px) * 1.09 + 36px))));
  width:min(calc(100vw - 16px),max(560px,min(1000px,calc((100dvh - 250px) * 1.09 + 36px))));
  height:calc(100vh - 16px);height:calc(100dvh - 16px);overflow:auto;overscroll-behavior:contain}
#relook .dialog-body{min-height:100%;display:flex;flex-direction:column}
#relook .dialog-body>*{flex:none}
#relook .rl-head{display:flex;align-items:flex-start;gap:10px;margin-bottom:4px}
#relook h2{margin:0;flex:1;min-width:0}
#relook .rl-x{flex:none;width:44px;height:44px;min-width:44px;padding:0;border-radius:99px;font-size:18px;line-height:1}
#relook #rl-meta{margin:0 0 8px}
#relook #rl-canvas{flex:1 0 auto;width:100%;height:auto;aspect-ratio:480/440;max-height:calc(100vh - 250px);max-height:calc(100dvh - 250px);
  max-width:none;object-fit:contain;background:transparent;border-radius:0}
#relook #rl-step{margin:8px 0 0;min-height:2.9em;line-height:1.45}
#relook #rl-why{margin:4px 0 0}
/* Phone on its side: the road takes the full height on the left, with the messages and buttons beside it */
@media (orientation:landscape) and (max-height:560px){
  dialog#relook{width:calc(100vw - 16px)}
  #relook .dialog-body{display:grid;grid-template-columns:minmax(0,1fr) clamp(220px,36vw,340px);grid-template-rows:repeat(5,auto) minmax(0,1fr);
    column-gap:14px;align-content:start;padding:10px 12px}
  #relook .dialog-body>*{grid-column:2}
  #relook #rl-canvas{grid-column:1;grid-row:1 / -1;height:calc(100vh - 40px);height:calc(100dvh - 40px);max-height:none;aspect-ratio:auto;min-height:0}
  #relook h2{font-size:17px}
  #relook #rl-meta,#relook #rl-step,#relook #rl-why{font-size:14px}
  #relook .row{margin-top:6px}
}
dialog::backdrop{background:#10121a99}
.dialog-body{padding:18px}
.dialog-body h2{margin-top:0}
.clickable{cursor:pointer}
.clickable:hover td{background:#fafafb}
.selected td{background:#f3f6fb}

.packs{display:flex;gap:6px;flex-wrap:wrap;margin:4px 0 12px}
.packs button{flex:1;min-width:130px;font-weight:600;background:#f6f6f7;border-color:#e2e2e6}
.packs button[aria-selected="true"]{background:#25252d;color:white;border-color:#25252d}
.packs button small{display:block;font-weight:500;font-size:11px;color:inherit;opacity:.75;text-transform:uppercase;letter-spacing:.05em}
tr.group td{background:#f6f6f7;font-weight:700;font-size:13px;color:#5b5b66;text-transform:uppercase;letter-spacing:.04em}

/* Instructor sign-up, pricing and account */
.stack{display:flex;flex-direction:column;gap:10px;margin:10px 0}
.stack label{display:flex;flex-direction:column;align-items:stretch;gap:4px;margin:0;font-weight:600}
.stack label small{font-weight:400}
.stack button{align-self:flex-start}
.prices{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin:12px 0}
.price{background:#f6f6f7;border-radius:12px;padding:14px;border-top:4px solid #c91f2c}
.price b{display:block;font-size:32px;line-height:1.1}
.price span{color:#5b5b66}
#checkout-msg:empty{display:none}
.pin{max-width:12em;letter-spacing:.3em;font-variant-numeric:tabular-nums}
.badge.unpaid{background:#f0f0f2;color:#5b5b66}
.badge.suspended{background:#3a3a44;color:#fff}
button.danger{color:#b3141c;border-color:#b3141c}
tr.is-suspended td:not(:last-child){opacity:.65}
#added input{flex:1;min-width:0;font-size:14px}
.copy-row input{flex:1;min-width:0;font-size:14px;background:#fafafb}
.copy-btn{padding:4px 10px;font-size:13px;font-weight:600;border-radius:7px;vertical-align:middle}
button.copied{background:#e8f5ee;border-color:#176b47;color:#0f5536}
.primary-link{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border-radius:8px;background:#25252d;color:#fff;font-weight:600;text-decoration:none}

/* Results folders: month → week → day */
.folders details.folder{border:1px solid #e2e2e6;border-radius:12px;margin:0 0 8px;background:#fff}
.folders details.week{background:#fafafb}
.folders details.day{background:#fff}
.folders summary{cursor:pointer;padding:11px 14px;display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;list-style:none}
.folders summary::-webkit-details-marker{display:none}
.folders summary::before{content:"▸";color:#5b5b66;width:1em}
.folders details[open]>summary::before{content:"▾"}
.folders summary .meta{flex-basis:100%;padding-left:1.4em}
.folders .folder-body{padding:0 10px 10px 14px}
.folders .folder-body>.feedback{margin:0 0 10px}
.badge.missed{white-space:nowrap}
.month-end-box{padding:4px 18px}
.month-end-box .feedback{margin:14px 0}

/* Junction approach guide (MSPSGL) */
.mspsgl{list-style:none;padding:0;margin:8px 0 14px}
.mspsgl li{border:1px solid #ececef;border-left:6px solid #c7c7cb;border-radius:10px;padding:10px 12px;margin-bottom:8px;transition:background .2s,border-color .2s}
.mspsgl li b:first-child{display:block}
.mspsgl li.active{background:#e8f0fb;border-left-color:#1f5fae}
.mspsgl li.done{border-left-color:#176b47}
#guide-caption{font-weight:600;min-height:2.8em;margin-top:10px}
#guide-caption.bad{color:#b3141c}

/* EZ Pass staff permissions */
fieldset.perms{border:1px solid #e2e2e6;border-radius:12px;padding:8px 12px 10px;margin:0}
fieldset.perms legend{font-weight:600;padding:0 4px}
.perms label.check{display:flex;align-items:flex-start;gap:10px;margin:8px 0;font-weight:400}
.perms label.check input{margin-top:4px}
.perms label.check span small{display:block}
.perm-chips{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0}
#access-list{margin:0 0 12px;padding-left:20px}

/* Road signs quiz */
.sq-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 6px}
.sq-clock{font-size:20px;font-variant-numeric:tabular-nums}
.sq-tally .badge{font-size:14px;padding:4px 10px}
.sq-bar{height:10px;background:#ececef;border-radius:99px;overflow:hidden;margin:4px 0}
.sq-bar>div{height:100%;width:100%;background:#1f5fae;border-radius:99px}
.sq-bar-sign{height:6px}
.sq-bar-sign>div{background:#a87a12}
.sq-sign{display:flex;justify-content:center;margin:14px 0}
.sq-sign svg{width:min(220px,55vw);height:auto;filter:drop-shadow(0 2px 4px #0002)}
.sq-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px}
.sq-options .sq-timeout{grid-column:1/-1;margin:0;font-weight:700;color:#b3141c}
.sq-option{text-align:left;font-weight:600;background:#f6f6f7;border-color:#e2e2e6;padding:12px 14px;min-height:52px}
.sq-option:hover:not(:disabled){background:#ececef}
.sq-option:disabled{opacity:1}
.sq-option.right{background:#e8f5ee;border-color:#176b47;color:#0f5536}
.sq-option.wrong{background:#fdecec;border-color:#b3141c;color:#9b1118}
.sq-option kbd{display:inline-block;min-width:1.6em;text-align:center;font:600 12px ui-monospace,Menlo,Consolas,monospace;background:white;border:1px solid #d5d5da;border-radius:5px;padding:1px 4px;margin-right:4px;color:#5b5b66}
#sq-stop{margin-top:6px}
.sq-thumb{display:inline-block;width:54px;flex:none}
.sq-thumb svg{width:100%;height:auto;display:block}
.sq-thumb.lg{width:72px}
.sq-table td{vertical-align:top}
.sq-table td:first-child{width:66px}
.sq-table tr.sq-missed td{background:#fff8f8}
.sq-per-list{max-height:460px;overflow-y:auto;border:1px solid #ececef;border-radius:12px}
.sq-per-item{border-bottom:1px solid #ececef}
.sq-per-item:last-child{border-bottom:0}
.sq-per-item summary{display:flex;align-items:center;gap:10px;padding:8px 12px;cursor:pointer;list-style:none;min-height:48px}
.sq-per-item summary::-webkit-details-marker{display:none}
.sq-per-item summary:hover{background:#f6f6f7}
.sq-thumb.sm{width:32px}
.sq-per-name{flex:1;font-weight:600}
.sq-per-chev{width:8px;height:8px;border-right:2px solid #8a8a94;border-bottom:2px solid #8a8a94;transform:rotate(45deg);margin:0 4px 4px;transition:transform .15s}
.sq-per-item[open] .sq-per-chev{transform:rotate(-135deg);margin-bottom:0;margin-top:4px}
.sq-per-body{padding:0 12px 12px 54px}
.sq-per-body p{margin:0 0 8px}
.sq-per-stats{display:flex;flex-wrap:wrap;gap:6px}
.sq-per-stats span{background:#f6f6f7;border-radius:99px;padding:4px 10px;font-size:14px}
.sq-per-stats span.bad{background:#fdecec;color:#9b1118}
.sq-details{margin:12px 0 0}
.sq-details summary{cursor:pointer;font-weight:600;padding:8px 0}
.sq-guide{list-style:none;padding:0;margin:0 0 10px;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:8px}
.sq-guide li{display:flex;gap:10px;align-items:flex-start;border:1px solid #ececef;border-radius:12px;padding:10px}
.sq-guide li p{margin:4px 0 0}
@media (max-width:600px){
  .sq-options{grid-template-columns:1fr}
  .sq-option kbd,.sq-keyhint{display:none}
  .sq-table td:first-child{width:56px}
  .sq-thumb{width:46px}
}

/* Phones and small tablets: larger text, 44px tap targets, no sideways scrolling. Desktop is unaffected. */
@media (max-width:600px){
  header{padding:16px 12px}
  main{padding:10px}
  section{padding:14px;border-radius:14px}
  .dialog-body{padding:14px}
  dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}

  /* Readable text: nothing a learner reads drops below 16px */
  .hint,.meta,small,table,.tile span,.feedback p,code{font-size:16px}
  th{font-size:14px}
  .badge{font-size:13px}
  .packs button small{font-size:12px}

  /* Tap targets at least 44 x 44px */
  button,select,input:not([type=checkbox]):not([type=radio]){min-height:44px;min-width:44px}
  input[type=checkbox],input[type=radio]{width:22px;height:22px;margin:0;flex:none}
  summary{display:list-item;min-height:44px;padding:11px 0;cursor:pointer}
  .tap-link{display:inline-flex;align-items:center;min-height:44px}
  label.check{min-height:44px;gap:10px}
  th,td{padding:12px 6px}

  /* Stack the practice controls so long scenario names never push the page sideways */
  .row > label:not(.check){flex:1 1 100%;margin:0;justify-content:space-between}
  .row > label:not(.check) select{flex:1;min-width:0}
  .row input:not([type=checkbox]){min-width:0;flex:1 1 100%}
  .row > button{flex:1 1 auto}
  .packs button{min-width:0;flex:1 1 calc(50% - 6px)}
  .stack button{align-self:stretch}
  .tiles{grid-template-columns:repeat(auto-fit,minmax(100px,1fr))}

  #go,#stop{padding:18px;font-size:24px}
  #ready,#skip{padding:18px;font-size:22px}
}

/* Road sign library */
.sl-main{max-width:980px}
.sl-back{margin:0 0 8px}
.sl-tools .row input[type=search]{flex:1;min-width:200px}
.sl-chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.sl-chip{padding:8px 12px;border-radius:99px;font-weight:600;font-size:14px;background:#f6f6f7;border-color:#e2e2e6}
.sl-chip[aria-pressed=true]{background:#24242c;border-color:#24242c;color:white}
.sl-chip[aria-pressed=true] .sl-count{background:#ffffff2b;color:white}
.sl-count{display:inline-block;min-width:1.7em;padding:0 6px;margin-left:4px;border-radius:99px;background:#e6e6ea;color:#5b5b66;font-size:12px;font-weight:700;text-align:center;vertical-align:middle}
.sl-selects label{margin-right:16px}
.sl-group-title{display:flex;align-items:center;gap:6px;margin:18px 0 2px;font-size:20px}
.sl-group-title:first-child{margin-top:0}
.sl-group-note{margin:0 0 10px}
.sl-grid{list-style:none;padding:0;margin:0 0 8px;display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:10px}
.sl-card{display:flex;gap:12px;align-items:flex-start;width:100%;height:100%;text-align:left;padding:12px;border:1px solid #e2e2e6;border-radius:14px;background:white;transition:border-color .15s,box-shadow .15s,transform .15s}
.sl-card:hover{border-color:#b9b9c2;box-shadow:0 4px 14px #0000000f;transform:translateY(-1px)}
.sl-pic{flex:none;width:84px}
.sl-pic svg{width:100%;height:auto;display:block;filter:drop-shadow(0 1px 2px #0002)}
.sl-card-text{display:flex;flex-direction:column;gap:4px;min-width:0}
.sl-name{font-size:16px;line-height:1.25}
.sl-explain{font-size:13px;color:#5b5b66;line-height:1.4;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.sl-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:2px}
.sl-tags .badge{white-space:nowrap;margin:0;text-transform:none;letter-spacing:0;font-weight:600}
.sl-tag{display:inline-block;font-size:12px;font-weight:600;padding:2px 8px;border-radius:99px;background:#f0f0f2;color:#5b5b66}
.sl-tag-warning{background:#fdecec;color:#9b1118}
.sl-tag-prohibit{background:#fdecec;color:#9b1118}
.sl-tag-mandatory{background:#e8f0fb;color:#1d4c8f}
.sl-tag-info{background:#e8f0fb;color:#1d4c8f}
.badge.sl-untried{background:#f0f0f2;color:#5b5b66}
.sl-dialog{padding:16px 20px 20px}
.sl-d-top{display:flex;justify-content:space-between;align-items:center}
.sl-d-top button{padding:6px 12px;border:0;font-size:18px}
.sl-d-pic{display:flex;justify-content:center;margin:4px 0 10px}
.sl-big{width:min(240px,60vw)}
.sl-big svg{width:100%;height:auto;display:block;filter:drop-shadow(0 3px 6px #0003)}
#sl-d-name{text-align:center;margin:0 0 6px}
#sl-d-name+p{text-align:center;margin:0 0 10px}
.sl-d-explain{font-size:17px;line-height:1.5}
.sl-d-facts{margin:12px 0;display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:14px}
.sl-d-facts div{display:contents}
.sl-d-facts dt{font-weight:700}
.sl-d-facts dd{margin:0;color:#3d3d47}
.sl-d-nav{justify-content:space-between}
.sl-d-nav button{flex:1}
@media (max-width:600px){
  .sl-grid{grid-template-columns:1fr}
  .sl-chips{flex-wrap:nowrap;overflow-x:auto;margin:6px -14px;padding:2px 14px 6px;scrollbar-width:none}
  .sl-chip{flex:none}
  .sl-pic{width:70px}
  .sl-d-facts{grid-template-columns:1fr;gap:2px}
  .sl-d-facts dd{margin-bottom:8px}
}

/* Planning and awareness */
.pl-how{padding-left:22px;margin:6px 0 4px}
.pl-how li{margin:0 0 6px}
.pl-scenes{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;margin:6px 0 14px}
.pl-chip{display:flex;align-items:center;gap:8px;text-align:left;font-weight:600;background:#f6f6f7;border-color:#e2e2e6;padding:10px 12px;min-height:48px;min-width:0}
.pl-chip[aria-pressed="true"]{background:#25252d;color:#fff;border-color:#25252d}
.pl-chip-n{flex:none;display:inline-grid;place-items:center;width:24px;height:24px;border-radius:99px;background:#fff;color:#25252d;font-size:13px;border:1px solid #d5d5da}
.pl-chip-name{flex:1;min-width:0;font-size:15px;line-height:1.2}
.pl-chip-best{flex:none;font-size:11px;font-weight:700;padding:2px 7px;border-radius:99px;background:#e8f5ee;color:#0f5536}
#pl-title{margin:4px 0 0;font-size:20px}
#pl-place{margin:0 0 6px}
#pl-scene-intro{margin:0 0 4px}
#pl-ask{margin:0 0 6px}
#pl-status{font-weight:600;min-height:1.4em}
/* The road scene is a tall, zoomed-in view: as big as the width allows, but short enough to see whole with the buttons. */
/* The scene and everything that pops up while you play (messages, buttons, captions, questions, results) share one
   centred column the same width as the road, so nothing stretches out wider than the scene. */
.pl-stage{width:min(100%,460px,max(260px,calc((100vh - 140px) * 288 / 580)));margin:0 auto}
@supports (height:100svh){.pl-stage{width:min(100%,460px,max(260px,calc((100svh - 140px) * 288 / 580)))}}
#pl-scene{width:100%;max-width:none;height:auto;aspect-ratio:288/580;scroll-margin-top:8px}
.pl-stage .sq-options{grid-template-columns:1fr}
@media (max-width:520px){#pl-player{padding-left:10px;padding-right:10px}}
.pl-big{width:100%;margin-top:12px;padding:20px;font-size:24px;font-weight:800;letter-spacing:.04em;border:0;border-radius:14px}
.pl-ready{color:#25252d;background:#ffd23f;box-shadow:0 4px 0 #c9a21c}
.pl-act{color:#fff;background:#176b47;box-shadow:0 4px 0 #0f4c32}
.pl-big:active{transform:translateY(2px);box-shadow:0 2px 0 #0003}
.pl-big[hidden]{display:none}
.pl-caption{margin:12px 0 0;padding:12px 14px;border-radius:12px;background:#25252d;color:#fff;font-weight:600;min-height:3.2em}
#pl-question h3{margin:16px 0 8px;font-size:18px}
.pl-timeline{margin:12px 0 4px}
.pl-track{position:relative;height:18px;border-radius:99px;overflow:hidden;background:#ececef}
.pl-seg{position:absolute;top:0;bottom:0}
.pl-seg.soon{background:#d9d9de}
.pl-seg.best{background:linear-gradient(90deg,#1f9d63,#b9d97a)}
.pl-seg.late{background:#e9a3a3}
.pl-mark{position:absolute;top:-2px;bottom:-2px;width:4px;margin-left:-2px;border-radius:2px}
.pl-mark.tap{background:#1f5fae;box-shadow:0 0 0 2px #fff}
.pl-mark.early{background:#b3141c;box-shadow:0 0 0 2px #fff}
.pl-legend{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:13px;color:#5b5b66;margin-top:6px}
.pl-legend i{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:5px;vertical-align:-1px}
.pl-legend i.soon{background:#d9d9de}
.pl-legend i.best{background:#1f9d63}
.pl-legend i.late{background:#e9a3a3}
.pl-legend i.tap{background:#1f5fae}
.pl-legend i.early{background:#b3141c}
.pl-feature{display:flex;gap:12px;align-items:center;flex-wrap:wrap}

/* Full-screen stage: while a scenario is being watched, the road and its Ready / GO / Continue button
   fill the screen. The page (and the debrief) comes back once there's something to read. */
.stage-title,.stage-sub,.stage-close{display:none}
html.stage-open,html.stage-open body{overflow:hidden}
/* The title, message, road and button are kept together as one block in the middle of the screen, as wide as
   the road can be while everything still fits on screen (--stage-w), rather than the road floating between a
   title pinned to the top and a button pinned to the bottom. --stage-chrome is the height of everything but the road. */
.stage.stage-full{--stage-chrome:calc(232px + env(safe-area-inset-top) + env(safe-area-inset-bottom));
  --stage-w:min(760px,calc(100vw - 24px),max(260px,calc((100vh - var(--stage-chrome)) * 480 / 440)));
  position:fixed;inset:0;z-index:50;display:grid;grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto auto auto auto;align-content:center;column-gap:12px;row-gap:8px;margin:0;
  padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right),calc((100vw - var(--stage-w)) / 2))
    max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left),calc((100vw - var(--stage-w)) / 2));
  overflow-y:auto;background:#1b1d24;color:#fff;overscroll-behavior:contain}
/* dvh is the screen height actually visible, below the phone browser's address bar */
@supports (height:100dvh){
  .stage.stage-full{--stage-w:min(760px,calc(100vw - 24px),max(260px,calc((100dvh - var(--stage-chrome)) * 480 / 440)));
    bottom:auto;height:100dvh}
}
/* Title and exit button share the top row, so a long scenario name wraps instead of running under the button */
.stage-full > *{grid-column:1 / -1;margin:0;min-width:0}
.stage-full .stage-title{grid-column:1;grid-row:1;font-weight:800;font-size:17px;line-height:1.25;min-height:40px;display:flex;align-items:center}
.stage-full .stage-sub{display:block;font-size:15px;color:#d6d7de}
.stage-full .stage-sub[hidden]{display:none}
.stage-full .stage-close{grid-column:2;grid-row:1;align-self:start;display:inline-flex;align-items:center;white-space:nowrap;
  min-height:40px;padding:6px 12px;font-size:14px;font-weight:700;background:#ffffff1a;color:#fff;border:1px solid #ffffff40}
/* The status line is always the same height whatever its message, so the road doesn't jump up and down
   (a message that wouldn't fit scrolls inside the line rather than pushing the road down). */
.stage-full #status{grid-row:2;color:#fff;font-size:15px;line-height:1.45;height:2.9em;overflow-y:auto;overscroll-behavior:contain}
.stage-full #scene{grid-row:3;width:100%;height:auto;aspect-ratio:480 / 440;min-height:0;max-width:none;object-fit:contain;background:transparent;border-radius:0;margin:0}
/* GO, Ready and Continue are exactly the same size, so swapping one for another doesn't resize the road */
.stage-full #go,.stage-full #stop,.stage-full #ready,.stage-full #skip{grid-row:4;margin-top:0;height:72px;padding:0 16px;font-size:24px;line-height:1}
/* GO and STOP share the button row, one each side */
.stage-full.two-choice #go,.stage-full.two-choice #stop{width:calc(50% - 6px);margin-left:0}
.stage-full.two-choice #go{justify-self:start}
.stage-full.two-choice #stop{justify-self:end}
@media (max-width:600px){
  .stage-full .stage-title{font-size:16px}
  .stage-full .stage-close{font-size:13px;padding:6px 10px}
  .stage-full #status{height:4.35em;font-size:14px}
  .stage-full #go,.stage-full #stop,.stage-full #ready,.stage-full #skip{height:64px;font-size:22px}
}
/* Phone on its side: the road takes the full height on the left, with the title, message and button beside it */
@media (orientation:landscape) and (max-height:560px){
  .stage.stage-full{grid-template-columns:minmax(0,1fr) clamp(210px,34vw,320px);grid-template-rows:auto auto minmax(0,1fr) auto;
    align-content:stretch;row-gap:6px;overflow:hidden;
    padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
  .stage-full #scene{grid-column:1;grid-row:1 / -1;height:100%;aspect-ratio:auto}
  .stage-full .stage-close{grid-column:2;grid-row:1;justify-self:end}
  .stage-full .stage-title{grid-column:2;grid-row:2;font-size:15px;min-height:0}
  .stage-full #status{grid-column:2;grid-row:3;font-size:14px;height:auto;min-height:0}
  .stage-full #go,.stage-full #stop,.stage-full #ready,.stage-full #skip{grid-column:2;grid-row:4;height:60px;font-size:22px}
}

/* Planning scene: while a go is being watched, the road and its buttons fill the whole screen. */
.pl-view-head{display:none}
.pl-view.pl-full{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;align-items:center;gap:8px;margin:0;background:#16161b;color:#fff;overscroll-behavior:contain;padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
.pl-view.pl-full>*{width:min(100%,520px);flex:none}
.pl-view.pl-full .pl-view-head{display:flex;align-items:flex-start;gap:10px}
.pl-view-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;line-height:1.3}
.pl-view-text b{font-size:18px}
.pl-view-text span{font-size:14px;color:#d5d5dc}
.pl-v-close{flex:none;width:44px;height:44px;padding:0;font-size:20px;font-weight:700;line-height:1;border-radius:99px;background:#2e2e37;color:#fff;border-color:#4a4a55}
.pl-view.pl-full #pl-status{margin:0;color:#ffd23f;font-size:15px;min-height:0}
.pl-view.pl-full #pl-status:empty{display:none}
.pl-view.pl-full .pl-view-road{flex:1 1 0;min-height:0;width:100%;max-width:none}
.pl-view.pl-full #pl-scene{width:100%;height:100%;max-width:none;aspect-ratio:auto;object-fit:contain;background:transparent;border-radius:0}
.pl-view.pl-full .pl-big{margin-top:0;padding:16px;font-size:22px}
html.pl-noscroll,html.pl-noscroll body{overflow:hidden}

.passcode{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:1.2em;letter-spacing:.08em}
.staff-message{width:100%;margin-top:10px;font:inherit;font-size:14px;padding:10px 12px;border:1px solid #c7c7cb;border-radius:9px;background:#fafafb;resize:vertical}
.staff-phone{display:flex;gap:8px;align-items:center;font-weight:600;margin:4px 0 10px}
.staff-phone input{flex:1;max-width:240px}
/* Public demo for driving schools (/demo) */
.demo-hero{border-top:5px solid #c91f2c}
.demo-cta{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:12px}
.demo-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 20px;border-radius:10px;background:#25252d;color:#fff;font-weight:700;text-decoration:none}
.demo-btn.alt{background:#c91f2c}
.demo-btn:focus-visible{outline:3px solid #2b6cb0;outline-offset:2px}
.demo-badge{background:#c91f2c;color:#fff;vertical-align:middle;margin-left:6px}
.demo-note{font-size:14px;color:#5b5b66;background:#f6f6f7;border-left:4px solid #c91f2c;border-radius:6px;padding:8px 12px}
.demo-nudge{border:2px solid #c91f2c}
.demo-list{padding-left:20px}
.demo-list li{margin-bottom:8px}
.demo-fb-note{margin-top:10px}
.demo-sample td:first-child{font-style:italic;color:#5b5b66}
@media (max-width:600px){.demo-cta .demo-btn{flex:1 1 100%}}
/* Every button (and every link styled as a button) has a thin red edge, so the choices on a screen stand out at a glance.
   Answer and "copied" buttons keep their green or red edge, since that colour tells you the result. */
button:not(.right):not(.wrong):not(.copied),.primary-link,.demo-btn{border:1.5px solid #d51f30 !important}
/* The simulator's dropdowns (Scenario, Difficulty, Playback and, at roundabouts, Your exit) have a thin blue edge so people notice they can change them. */
#practice .row select{border:1.5px solid #1f6fd5}

/* Separate pages: each heading of the practice app has a page of its own (see views.js) */
.off-view{display:none!important}
.crumbs{margin:0 0 10px}
.crumbs-back{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border:1.5px solid #d51f30;border-radius:99px;background:white;color:#24242c;font-weight:700;text-decoration:none;box-shadow:0 2px 8px #00000012}
.crumbs-back:hover{color:#a51d29}
.page-kicker{margin:0;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#a51d29}
#practice .page-kicker+h2{margin-top:2px}
/* Inner pages: a slim header, so the page itself starts near the top of the screen */
body[data-view]:not([data-view=landing]):not([data-view=home]) header{display:flex;align-items:center;justify-content:center;gap:12px;padding:10px 16px}
body[data-view]:not([data-view=landing]):not([data-view=home]) header .logo{width:96px;margin:0}
body[data-view]:not([data-view=landing]):not([data-view=home]) header h1{font-size:18px;margin:0}
body[data-view]:not([data-view=landing]):not([data-view=home]) header .tagline{display:none}
.logo-link{display:block}
body[data-view=home] #account{padding:12px 18px}
body[data-view=home] #account h2{font-size:18px;margin-bottom:6px}

/* The menu, and the Driving judgement page */
.hub h2{margin-bottom:4px}
.hub-group{margin:16px 0 8px;font-size:14px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#5b5b66}
.hub-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:10px}
.hub-tile{display:flex;align-items:center;gap:14px;min-height:76px;padding:14px 16px;border:1.5px solid #d51f30;border-radius:14px;background:white;color:inherit;text-decoration:none;transition:border-color .15s,box-shadow .15s,transform .15s}
.hub-tile:hover{background:#fffafa;box-shadow:0 4px 14px #0000000f;transform:translateY(-1px)}
.hub-tile:focus-visible{outline:3px solid #d51f30;outline-offset:3px}
.hub-icon{flex:none;display:grid;place-items:center;width:48px;height:48px;border-radius:99px;background:#fdecec;font-size:24px;line-height:1;color:#a51d29;font-weight:800}
.hub-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.hub-text b{font-size:17px;line-height:1.25}
.hub-text span{font-size:14px;color:#5b5b66;line-height:1.4}
.hub-go{flex:none;width:10px;height:10px;border-right:2.5px solid #a51d29;border-top:2.5px solid #a51d29;transform:rotate(45deg);margin-right:4px}
@media (max-width:600px){
  .hub-grid{grid-template-columns:1fr}
  .hub-text span{font-size:15px}
  body[data-view]:not([data-view=landing]):not([data-view=home]) header .logo{width:80px}
  body[data-view]:not([data-view=landing]):not([data-view=home]) header h1{font-size:16px}
}
.more-settings{margin:4px 0 10px}
.more-settings summary{cursor:pointer;font-weight:600;color:#5b5b66;padding:6px 0}
.more-settings .hint{text-align:left}
#feedback+.more-settings{margin-top:14px}

/* Dual carriageways */
.dc-routine{padding-left:22px;margin:6px 0 8px}
.dc-routine li{margin:0 0 6px}
.dc-stage{width:min(100%,460px,max(260px,calc((100vh - 140px) * 300 / 540)));margin:0 auto}
@supports (height:100svh){.dc-stage{width:min(100%,460px,max(260px,calc((100svh - 140px) * 300 / 540)))}}
#dc-title{margin:4px 0 0;font-size:20px}
#dc-place{margin:0 0 6px}
#dc-intro{margin:0 0 6px}
#dc-status{font-weight:600;min-height:1.4em}
#dc-scene{width:100%;max-width:none;height:auto;aspect-ratio:300/540;scroll-margin-top:8px}
.dc-how{margin:0 0 10px;background:#f6f6f7;border:1px solid #e2e2e6;border-radius:10px;padding:8px 12px}
.dc-how summary{cursor:pointer;font-weight:700;min-height:32px;display:flex;align-items:center}
.dc-how ol{padding-left:20px;margin:6px 0 4px}
.dc-how li{margin:0 0 6px}
@media (max-width:520px){#dc-player{padding-left:10px;padding-right:10px}}
/* The controls only show while you're driving. */
.dc-controls{display:none}
.dc-view.dc-live .dc-controls{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px}
.dc-btn{min-height:46px;padding:6px 4px;font-size:15px;font-weight:800;line-height:1.15;border-radius:11px;border:2px solid #4a4a55;background:#2e2e37;color:#fff;touch-action:manipulation;-webkit-user-select:none;user-select:none}
.dc-btn:active{transform:translateY(1px)}
.dc-sig{background:#3a3320;border-color:#8a7322}
.dc-sig[aria-pressed="true"]{background:#2bd66b;border-color:#2bd66b;color:#10301c;animation:dc-blink .66s steps(2,start) infinite}
@keyframes dc-blink{50%{background:#1a7a40;border-color:#1a7a40;color:#fff}}
.dc-mir{background:#243548;border-color:#44698f}
.dc-look{background:#2a2a40;border-color:#5a5a88}
.dc-btn.on{background:#ffd23f;border-color:#ffd23f;color:#16161b}
.dc-move{background:#174a33;border-color:#2a7a55}
.dc-gap{display:block}
.dc-work{padding-left:20px}
.dc-work li{margin:0 0 6px}
.dc-group{margin:0 0 10px}
.dc-group h4{margin:8px 0 4px;font-size:15px}
.dc-checks{list-style:none;padding:0;margin:0}
.dc-checks li{margin:0 0 6px;padding:6px 10px;border-radius:8px;background:#ffffffa0}
.dc-checks li.ok b{color:#0f5536}
.dc-checks li.bad b{color:#b3141c}
.dc-view.pl-full #dc-status{margin:0;color:#ffd23f;font-size:15px;min-height:1.3em;line-height:1.3}
.dc-view.pl-full .dc-road{flex:1 1 0;min-height:0;width:100%;max-width:none}
.dc-view.pl-full #dc-scene{width:100%;height:100%;max-width:none;aspect-ratio:auto;object-fit:contain;background:transparent;border-radius:0}
.dc-view.pl-full.dc-live .pl-view-text span{display:none}
/* A phone held sideways: the road on the left, everything else beside it. */
@media (orientation:landscape) and (max-height:560px){
  .dc-view.pl-full{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,46%);grid-template-rows:auto auto 1fr auto;align-items:start;column-gap:12px}
  .dc-view.pl-full>*{width:auto}
  .dc-view.pl-full .dc-road{grid-column:1;grid-row:1/5;height:100%;align-self:stretch}
  .dc-view.pl-full .pl-view-head{grid-column:2;grid-row:1}
  .dc-view.pl-full #dc-status{grid-column:2;grid-row:2}
  .dc-view.pl-full .dc-controls,.dc-view.pl-full .pl-big{grid-column:2;grid-row:4}
}

/* Sport mode (roundabouts, for learners their instructor has allowed) */
.sport-box{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin:4px 0 10px;padding:10px 14px;border-radius:12px;background:linear-gradient(90deg,#fff1e0,#fff8ef);border:2px solid #ff8a00}
.sport-box .sport-toggle{font-weight:700;color:#8a3d00}
.sport-box #sport-note{color:#6b4a2a}
.sport-box #sport-stats{flex-basis:100%;margin:0;color:#6b4a2a}
.sport-box #sport-stats:empty{display:none}
.feedback .sport-line{font-weight:600;color:#8a3d00}
.sport-on{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;background:#ff8a00;color:#1b1b1b;font-size:13px;font-weight:700}
.sport-admin{padding:8px 12px;border-radius:10px;background:#fff6ea;border:1px solid #ffc37a}
.sport-admin p{color:#6b4a2a}

/* Cockpit view (roundabouts): holding the sides of the road picture turns your head, so no text selection or callout */
#scene.cockpit{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;cursor:pointer}
.view-note{font-size:14px}
