/* Styles for the custom elements in elements.js. Kept beside them, not scattered. */

/* Pieces that are buttons but not signs: they drop the sign's border and glint. */
:is(.opt, .paper, .scene, .stop-row, .toc-sec, .sign-tile, .shape-card, .type-chip,
    .num-card, .mark-card, .date-trigger, .date-day, .icon-btn, .acct-btn, .x,
    .pass-undo, .pass-oops) {
  box-shadow: none; background-image: none; letter-spacing: normal;
}

/* ---- an answer ------------------------------------------------------------ */
orr-option { display: block; }
#options { counter-reset: opt; }
.opt {
  position: relative; display: flex; align-items: flex-start; justify-content: flex-start; gap: 14px;
  width: 100%; min-height: var(--tap); margin: var(--space-2) 0 0;
  padding: 14px 16px; text-align: left; cursor: pointer;
  font: 500 17px/1.4 var(--read-face); color: var(--ink);
  background: var(--card); border: 0; border-radius: 14px;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  transition: box-shadow var(--motion), color var(--motion), background-color var(--motion);
}
/* the letter, as a small lane number: drawn, so it is never read as part of the answer */
#options .opt::before {
  counter-increment: opt; content: counter(opt, upper-alpha);
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; margin-top: -2px;
  border-radius: 8px; background: var(--zone); color: var(--muted);
  font: 800 14px/1 var(--sign-face);
}
.opt.right { background: var(--guide); color: #fff; box-shadow: var(--glow) var(--guide); font-weight: 600; }
#options .opt.right::before { background: rgb(255 255 255 / .2); color: #fff; }
.opt.wrong { color: var(--wrong); box-shadow: inset 0 0 0 2px var(--wrong); }
#options .opt.wrong::before { background: var(--wrong); color: #fff; }
.opt.chosen { box-shadow: inset 0 0 0 2.5px var(--ink); font-weight: 600; }
#options .opt.chosen::before { background: var(--ink); color: var(--bg); }
.opt:disabled { cursor: default; opacity: 1; }
#options .opt:disabled:not(.right):not(.wrong) { color: var(--faint); box-shadow: inset 0 0 0 1.5px var(--line); }
@media (hover: hover) {
  .opt:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--ink); }
}

/* ---- the answer panel: a traffic signal says which way it went ------------- */
orr-verdict {
  display: block; position: relative; margin: var(--space-4) 0 0;
  padding: 18px 18px 18px 58px; border-radius: var(--radius-lg);
  background: var(--zone);
  animation: rise .5s var(--spring) both;
}
orr-verdict b { display: block; margin-bottom: var(--space-2); font: 700 20px/1.2 var(--sign-face); }
orr-verdict p { margin: 0 0 var(--space-2); }
orr-verdict .mark {
  --top: var(--lamp-off); --mid: var(--lamp-off); --low: var(--lamp-off);
  position: absolute; left: 18px; top: 18px; width: 24px; height: 58px; border-radius: 9px;
  background:
    radial-gradient(circle at 50% 11px, var(--top) 0 5.5px, transparent 6px),
    radial-gradient(circle at 50% 29px, var(--mid) 0 5.5px, transparent 6px),
    radial-gradient(circle at 50% 47px, var(--low) 0 5.5px, transparent 6px),
    var(--housing);
}
orr-verdict .mark svg { display: none; }
orr-verdict.wrong .mark { --top: var(--lamp-red);
  box-shadow: 0 -4px 14px -4px rgb(255 68 88 / .55); }
orr-verdict.right .mark { --low: var(--lamp-green);
  box-shadow: 0 6px 14px -4px rgb(25 201 123 / .55); }
html.exam orr-verdict { animation: none; }
.drill { color: var(--muted); margin: var(--space-2) 0 0; }
/* The citation is the product's signature — "we show our work". A blue sign: blue
   always means the handbook says so. Body-adjacent size, never whispered. */
.cite {
  display: inline-flex; align-items: flex-start; gap: 8px; max-width: 100%;
  margin: var(--space-2) 0 0; padding: 7px 11px 7px 9px; border-radius: 8px;
  background: var(--info); color: #fff; font: 600 14.5px/1.35 var(--sign-face);
}
.cite::before {
  content: ""; width: 16px; height: 16px; flex: none; margin-top: 1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 5.2c2.9-1.2 5.8-1 8.5.8 2.7-1.8 5.6-2 8.5-.8v14c-2.9-1.1-5.8-.9-8.5.9-2.7-1.8-5.6-2-8.5-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 5.2c2.9-1.2 5.8-1 8.5.8 2.7-1.8 5.6-2 8.5-.8v14c-2.9-1.1-5.8-.9-8.5.9-2.7-1.8-5.6-2-8.5-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- the date picker ------------------------------------------------------ */
.date-field { position: relative; }
button.date-trigger {
  --date-pad-y: 15px; --date-pad-x: 16px;
  width: 100%; margin-top: 0; min-height: var(--tap); text-align: left; justify-content: flex-start;
  padding: var(--date-pad-y) var(--date-pad-x);
  font: 400 17px/1.3 var(--read-face); color: var(--ink);
  background: var(--card); border-radius: var(--radius); box-shadow: inset 0 0 0 1.5px var(--line-2);
}
.date-trigger.is-empty { color: var(--faint); }
.date-trigger.date-count {
  position: relative; overflow: hidden;
  display: flex; align-items: center;
}
.date-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--pct, 0%);
  background: var(--state-accent); pointer-events: none;
}
.date-under, .date-over {
  display: flex; width: 100%; justify-content: space-between; align-items: center;
  gap: 10px; box-sizing: border-box;
}
.date-under { position: relative; z-index: 1; color: var(--ink); }
.date-over {
  position: absolute; inset: 0; z-index: 2;
  padding: var(--date-pad-y) var(--date-pad-x);
  color: var(--state-accent-ink);
  clip-path: inset(0 calc(100% - var(--pct, 0%)) 0 0);
  pointer-events: none;
}
.date-left { flex: 0 0 auto; white-space: nowrap; font-family: var(--sign-face); font-weight: 700; }
.date-trigger.date-count.is-past { box-shadow: inset 0 0 0 2px var(--nogo); }
.date-trigger.date-count.is-past .date-fill { background: var(--nogo); }
.date-trigger.date-count.is-past .date-over { color: var(--bg); }
.date-trigger.date-count.is-today {
  background: var(--state-accent);
  color: var(--state-accent-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--state-accent) 35%, transparent);
}
.date-trigger.date-count.is-today .date-fill { width: 100%; background: var(--state-accent); }
.date-trigger.date-count.is-today .date-over { color: var(--state-accent-ink); clip-path: none; }
.date-trigger.date-count.is-today .date-under { color: transparent; }
.date-pop {
  position: absolute; z-index: 30; left: 0; right: 0;
  margin-top: 6px; padding: 12px;
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 18px 40px -20px rgb(20 25 30 / .35);
}
@media (max-width: 679px) {
  .date-pop {
    position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto;
    margin: 0; max-height: min(72vh, 560px); overflow: auto;
  }
}
.date-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.date-nav {
  flex: 0 0 40px; width: 40px; min-height: 40px; margin: 0; padding: 0;
  font-size: 22px; line-height: 1;
}
.date-pickers { display: flex; gap: 6px; flex: 1; min-width: 0; }
.date-pickers select {
  flex: 1; min-width: 0; min-height: 40px; margin: 0; padding: 0 8px;
  background: var(--zone); color: var(--ink); box-shadow: none; border-radius: 10px;
  font: 700 15px/1 var(--sign-face);
}
.date-dow, .date-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center;
}
.date-dow { color: var(--faint); font: 700 12px/1 var(--sign-face); margin-bottom: 6px; }
.date-day {
  min-height: var(--tap); margin: 0; padding: 0; width: 100%;
  background: transparent; color: var(--ink);
  font: 600 16px/1 var(--sign-face); border-radius: 10px;
}
.date-day.today { box-shadow: inset 0 0 0 2px var(--state-accent); color: var(--ink); }
.date-day.on { background: var(--guide); color: #fff; }
.date-day.off { opacity: .35; }
.date-empty { min-height: var(--tap); }
.date-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-2); margin: 8px 0 0;
}
.date-foot button:last-child { margin-left: auto; }

/* ---- the one earned real-world moment ------------------------------------- */
.pass-modal {
  max-width: 440px; width: calc(100% - 32px); padding: 0; border: 0;
  background: transparent;
}
.pass-modal.pass-party {
  max-width: min(720px, calc(100% - 16px));
  width: calc(100% - 16px);
  max-height: 90dvh;
}
.pass-modal::backdrop { background: rgb(10 16 22 / .6); }
.pass-card {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: 22px;
}
.pass-party .pass-card { max-height: 90dvh; display: flex; flex-direction: column; }
.pass-card img { display: block; width: 100%; height: 180px; object-fit: cover; }
.pass-party #pass-art {
  width: 100%; height: auto; aspect-ratio: 16 / 9;
  object-fit: cover; max-height: none;
  background: var(--zone); flex: 0 0 auto;
}
.pass-card .pass-body { padding: var(--space-4); }
.pass-party .pass-body { overflow: auto; flex: 1 1 auto; }
.pass-card .x {
  position: absolute; top: 10px; right: 10px; width: 44px; min-height: 44px;
  margin: 0; padding: 0; background: color-mix(in srgb, var(--card) 85%, transparent);
  color: var(--ink); font: 400 24px/1 var(--read-face); border-radius: 99px;
  z-index: 1;
}
.pass-party .pass-body h3 {
  margin: var(--space-4) 0 var(--space-2);
  font: 700 12px/1 var(--sign-face); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.pass-quote {
  margin: var(--space-3) 0 0;
  padding: 2px 0 2px var(--space-3);
  border-left: 3px solid var(--state-accent);
}
.pass-quote blockquote { margin: 0; font-size: 1.05em; line-height: 1.45; font-weight: 500; }
.pass-quote figcaption { margin-top: var(--space-2); color: var(--muted); font-size: 14px; }
#pass-party-work { margin: var(--space-3) 0 0; }
.pass-meters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin: var(--space-3) 0 0;
}
.pass-meters > div { background: var(--zone); border-radius: var(--radius); padding: 12px 14px; }
.pass-meters .head {
  display: block; color: var(--muted);
  font: 700 11.5px/1.2 var(--sign-face); letter-spacing: .1em; text-transform: uppercase;
}
.pass-meters b { display: block; margin-top: 4px; font: 800 20px/1 var(--sign-face); }
#pass-party-undo.pass-oops {
  width: auto; min-height: 44px; margin-top: var(--space-4);
  padding: 8px 0; background: none;
  color: var(--muted); font: 400 14px/1.3 var(--read-face);
}
#pass-party-undo.pass-oops:hover,
#pass-party-undo.pass-oops:focus-visible { color: var(--ink); background: none; }
.pass-burst { pointer-events: none; position: fixed; inset: 0; z-index: 40; overflow: hidden; }
.pass-burst i {
  position: absolute; width: 10px; height: 10px; border-radius: 2px;
  animation: burst 900ms ease-out forwards;
}
@keyframes burst {
  to { transform: translate(var(--dx), var(--dy)) rotate(220deg); opacity: 0; }
}

/* ---- a number tile -------------------------------------------------------- */
orr-stat { display: block; background: var(--zone); border-radius: var(--radius-lg); padding: 16px 16px 15px; }
.stat-head { color: var(--muted); font: 700 11.5px/1.25 var(--sign-face); letter-spacing: .1em;
             text-transform: uppercase; margin-bottom: 8px; }
.stat-value { font: 800 32px/1 var(--sign-face); letter-spacing: -0.025em; }
.stat-label { color: var(--muted); font-size: 14.5px; margin-top: 7px; line-height: 1.35; }

orr-status {
  display: inline-block; font: 700 12px/1 var(--sign-face); letter-spacing: .06em;
  padding: 6px 10px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px currentColor;
}
.pill-go { color: var(--go); }
.pill-nogo { color: var(--nogo); }
.pill-pending { color: var(--pending); }
.pill-na { color: var(--muted); }

/* Official sign device — never a teaching figure. Shown plainly; on the question it
   stands on its post at the roadside (app.css). */
figure.device { margin: var(--space-3) 0; text-align: center; }
figure.device img { width: 172px; max-width: 60%; height: auto; }
@media (min-width: 680px) { figure.device img { width: 200px; } }
figure.art { margin: var(--space-3) 0; text-align: center; }
figure.art img { width: 172px; max-width: 60%; height: auto; }
@media (min-width: 680px) { figure.art img { width: 220px; } }

/* Teaching figure: 16:9, contain, no crop that invents a new aspect. */
.figure {
  margin: 0 0 var(--space-3); padding: 0;
  aspect-ratio: 16 / 9;
  background: var(--zone);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.figure img { display: block; width: 100%; height: 100%; object-fit: contain; }
.figure-thumb { max-width: 160px; cursor: zoom-in; margin: 0; }
.figure-after { max-width: 280px; }
html.exam .figure { display: none; }

dialog.figure-zoom {
  border: 0; border-radius: var(--radius-lg);
  padding: var(--space-3); max-width: min(96vw, 1100px);
  background: var(--card); color: var(--ink);
}
dialog.figure-zoom img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  object-fit: contain; background: var(--zone); border-radius: var(--radius);
}
dialog.figure-zoom::backdrop { background: rgb(10 16 22 / .55); }

.why { margin-top: var(--space-2); }
.why summary { cursor: pointer; color: var(--muted); font: 700 14px/1.4 var(--sign-face); }
.why-more { margin-top: var(--space-2); }

/* Product pictures: a window onto your state. */
figure.frame {
  margin: 0 0 var(--space-3); padding: 0;
  max-width: 140px; border-radius: var(--radius); overflow: hidden; background: var(--zone);
}
figure.frame img {
  display: block; width: 100%; height: 72px; max-height: 72px;
  object-fit: cover; object-position: center 50%;
}
figure.frame figcaption { display: none; }
.mast {
  display: grid; grid-template-columns: minmax(0, 1fr) 112px;
  gap: var(--space-3); align-items: center;
  margin: 0 0 var(--space-4);
}
.mast figure.frame { margin: 0; max-width: 112px; }
html.exam figure.frame { display: none; }

/* The state's route shield: which state this page is about, on every page that is
   about one. Its letters on its own accent, then its name, beside the brand. */
.brand-row { display: flex; align-items: center; gap: var(--space-2) var(--space-3); flex-wrap: wrap; }
.brand-row .mark { white-space: nowrap; }
.state-plate { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font: 700 15px/1 var(--sign-face); color: var(--ink); }
.state-plate b {
  position: relative; isolation: isolate; display: inline-grid; place-items: center;
  width: 31px; height: 34px; padding-bottom: 7px;
  font: 800 12.5px/1 var(--sign-face); letter-spacing: .02em; color: var(--state-accent-ink);
  background: var(--state-accent);
  clip-path: path("M0 0H31V18.5C31 27.2 23.8 31.8 15.5 34 7.2 31.8 0 27.2 0 18.5Z");
}
.state-plate b::before, .state-plate b::after {
  content: ""; position: absolute; z-index: -1;
  clip-path: path("M0 0H25V15C25 21.6 19.6 25.6 12.5 27.6 5.4 25.6 0 21.6 0 15Z");
  width: 25px; height: 28px; left: 3px; top: 3px; background: var(--state-accent-ink);
}
.state-plate b::after {
  clip-path: path("M0 0H22V13.4C22 19.2 17.2 22.8 11 24.6 4.8 22.8 0 19.2 0 13.4Z");
  width: 22px; height: 25px; left: 4.5px; top: 4.5px; background: var(--state-accent);
}
