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

orr-option { display: block; }
.opt {
  display: block; width: 100%; min-height: var(--tap); margin: var(--space-2) 0 0;
  padding: 14px var(--space-3); text-align: left; font-weight: 400; cursor: pointer;
  background: var(--tap-bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.opt { transition: border-color var(--motion), color var(--motion), background-color var(--motion); }
.opt.right { border-color: var(--right); color: var(--right); font-weight: 600; background: color-mix(in srgb, var(--right) 8%, var(--card)); }
.opt.wrong { border-color: var(--wrong); color: var(--wrong); }
.opt.chosen { border-color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.opt:disabled { cursor: default; opacity: 1; }

orr-verdict {
  display: block; margin: var(--space-4) 0 0; padding: var(--space-3) 18px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: var(--radius);
  animation: rise var(--motion) both;
}
orr-verdict.right { border-left-color: var(--right); background: color-mix(in srgb, var(--right) 7%, var(--card)); }
orr-verdict.wrong { border-left-color: var(--wrong); }
orr-verdict b { display: block; margin-bottom: var(--space-1); }
orr-verdict .mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-right: 8px; vertical-align: -3px;
  border-radius: 99px; border: 2px solid currentColor;
}
orr-verdict.right .mark { color: var(--right); }
orr-verdict.wrong .mark { color: var(--wrong); }
orr-verdict.right .mark path {
  stroke-dasharray: 22; stroke-dashoffset: 22;
  animation: draw 320ms ease forwards 60ms;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
html.exam orr-verdict { animation: none; }
html.exam orr-verdict.right .mark path { animation: none; stroke-dashoffset: 0; }
.drill { color: var(--muted); margin: var(--space-2) 0 0; }
/* The citation is the product's signature — "we show our work". It was set at 13px
   muted, i.e. whispered; a reader with bifocals called it out. Body-adjacent size
   and full ink, still quiet enough to sit under the explanation. */
.cite {
  font-size: 15px; color: var(--ink); margin: var(--space-2) 0 0;
  padding-top: var(--space-2); border-top: 1px solid var(--line);
}

.date-field { position: relative; }
.date-trigger {
  --date-pad-y: 15px; --date-pad-x: 18px;
  width: 100%; margin-top: 0; text-align: left; font-weight: 400;
  padding: var(--date-pad-y) var(--date-pad-x);
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
}
.date-trigger.is-empty { color: var(--muted); }
.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; }
.date-trigger.date-count.is-past { border-color: 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 {
  border-color: var(--state-accent);
  background: var(--state-accent);
  color: var(--state-accent-ink);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--state-accent) 40%, 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: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
@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(--tap-bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-weight: 650; font-size: 15px;
}
.date-dow, .date-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center;
}
.date-dow { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.date-day {
  min-height: var(--tap); margin: 0; padding: 0; width: 100%;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  font-weight: 500; border-radius: var(--radius);
}
.date-day.today { border-color: var(--state-accent); color: var(--state-accent); }
.date-day.on {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.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; }

.pass-modal {
  max-width: 420px; 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: color-mix(in srgb, var(--ink) 55%, transparent); }
.pass-card {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.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(--bg); 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: 8px; right: 8px; width: 44px; min-height: 44px;
  margin: 0; padding: 0; border: 0; background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--ink); font-size: 22px; border-radius: 99px;
  z-index: 1;
}
.pass-party .pass-body h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: 13px; font-weight: 650; letter-spacing: .02em;
  color: var(--state-accent);
}
.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: 450;
}
.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(--tap-bg); border-radius: var(--radius);
  padding: 10px 12px;
}
.pass-meters .head {
  display: block; color: var(--state-accent);
  font-size: 12px; font-weight: 650; letter-spacing: .02em;
}
.pass-meters b { display: block; font-size: 18px; font-weight: 650; margin-top: 2px; }
#pass-party-undo.pass-oops {
  width: auto; min-height: 44px; margin-top: var(--space-4);
  padding: 8px 0; border: 0; background: none;
  color: var(--muted); font-weight: 400; font-size: 13px;
}


#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; }
}

orr-stat { display: block; background: var(--card); border: 1px solid var(--line);
           border-radius: var(--radius-lg); padding: var(--space-3); box-shadow: var(--shadow); }
.stat-head { color: var(--state-accent); font-size: 13px; font-weight: 650;
             letter-spacing: .02em; margin-bottom: 6px; }
.stat-value { font-size: 34px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 14px; margin-top: 4px; line-height: 1.35; }

orr-status {
  display: inline-block; font-size: 12px; font-weight: 650; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 99px; border: 1px solid 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. */
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: 220px; } }
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(--tap-bg);
  border: 1px solid var(--line);
  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: 1px solid var(--line); 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(--tap-bg);
}
dialog.figure-zoom::backdrop { background: color-mix(in srgb, #000 45%, transparent); }

.why { margin-top: var(--space-2); }
.why summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.why-more { margin-top: var(--space-2); }

/* Product pictures are a thumb, never a banner. */
figure.frame {
  margin: 0 0 var(--space-3);
  padding: 0;
  max-width: 140px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), 0 0 0 2px color-mix(in srgb, var(--state-accent) 35%, transparent);
  overflow: hidden;
}
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 plate: which state this page is about, on every page that is about
   one. A small licence plate — the state's two letters on its own accent — then
   its name. Sits beside the brand so it is in the same place on every screen. */
.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: 7px; white-space: nowrap;
  font-size: 14px; font-weight: 600; color: var(--ink); }
.state-plate b { font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .1em; padding: 5px 5px 5px 7px; border-radius: 5px;
  background: var(--state-accent); color: var(--state-accent-ink);
  box-shadow: inset 0 0 0 1.5px var(--state-accent), inset 0 0 0 2.5px var(--state-accent-ink); }
