/* Shared teaching-deck engine styles. Tokens mirror the Hour of AI design
   system (HourOfAIRegionPage.module.css) so every variant is built from the
   product's real materials; variants layer their own theme on top via
   `.deck[data-theme=…]` overrides in their own files. */
:root {
  --hoa-ink: #1b2440;
  --hoa-ink-2: #5b6785;
  --hoa-ink-3: #98a2bc;
  --hoa-ground: #ffffff;
  --hoa-tint: #f7f8fc;
  --hoa-line: #e8ebf3;
  --hoa-accent: #3b6ff6;
  --hoa-accent-deep: #2a56d0;
  --hoa-accent-soft: #ebf1fe;
  --hoa-shadow: 0 18px 50px rgba(27, 36, 64, 0.12);
  --hoa-shadow-sm: 0 6px 20px rgba(27, 36, 64, 0.07);
  --dom-engage: #2e7cf6; --dom-engage-soft: #e8f1fe; --dom-engage-deep: #1d5ed9;
  --dom-create: #15a86b; --dom-create-soft: #e5f7ee; --dom-create-deep: #0e8654;
  --dom-manage: #f59e0b; --dom-manage-soft: #fef3de; --dom-manage-deep: #c97f06;
  --dom-shape: #8b5cf6;  --dom-shape-soft: #f1eafe;  --dom-shape-deep: #6d3ee0;
  --ok: #15a86b; --ok-soft: #e5f7ee; --bad: #e5484d; --bad-soft: #fdecec;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur: 420ms;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Inter, system-ui, sans-serif;
  color: var(--hoa-ink);
  background: #0f1424;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Stage: a 16:9 board scaled to fit the viewport ---------- */
#stage { position: fixed; inset: 0; }

.deck {
  position: absolute; inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--hoa-ink);
  background: var(--hoa-ground);
}

.deck-top {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--hoa-line);
  background: rgba(255,255,255,.9);
  font-size: 13px; color: var(--hoa-ink-2);
  min-height: 48px;
}
.deck-top .logo { height: 22px; width: auto; }
.deck-top .crumb { font-weight: 700; color: var(--hoa-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-top .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .02em;
  color: var(--dom-manage-deep); background: var(--dom-manage-soft);
}
.deck-top .chip[data-domain="engage"] { color: var(--dom-engage-deep); background: var(--dom-engage-soft); }
.deck-top .chip[data-domain="create"] { color: var(--dom-create-deep); background: var(--dom-create-soft); }
.deck-top .chip[data-domain="shape"]  { color: var(--dom-shape-deep);  background: var(--dom-shape-soft); }
.deck-top .section { margin-left: auto; font-weight: 700; color: var(--hoa-ink-3); letter-spacing: .08em; text-transform: uppercase; font-size: 11px; white-space: nowrap; }
/* English decks: Latin text in Source Sans 3 (the same design as Noto Sans TC's Latin letters), so quotes and
   apostrophes keep their normal width instead of the CJK font's full-width ones. A deck that offers English
   loads the font in its index.html; without it the stack falls back to Noto Sans TC as before. */
.deck[data-lang="en"] { font-family: "Source Sans 3", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Inter, system-ui, sans-serif; }
/* Simplified Chinese: the SC face, so glyphs take the mainland forms (loaded in every index.html with the TC face). */
.deck[data-lang="zh-CN"] { font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans TC", Inter, system-ui, sans-serif; }
/* Language switch (繁中／简中／EN) in the top bar of every deck (see deck.js) */
.deck-top .deck-lang { display: inline-flex; flex: none; gap: 2px; padding: 2px; border-radius: 999px; background: var(--hoa-tint); border: 1px solid var(--hoa-line); }
.deck-top .deck-lang button { border: 0; background: transparent; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 800; line-height: 1.2; color: var(--hoa-ink-2); cursor: pointer; }
.deck-top .deck-lang button:hover { color: var(--hoa-ink); }
.deck-top .deck-lang button[aria-pressed="true"] { background: var(--hoa-ink); color: #fff; cursor: default; }
.deck-top .deck-lang button:focus-visible { outline: 2px solid var(--hoa-accent); outline-offset: 2px; }
.deck-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: transparent; }
.deck-progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3b6ff6, #7c9ef8); transition: width var(--dur) var(--ease-out); }

/* clip, not hidden: a focused control must never scroll the board sideways under the notes drawer. */
.deck-viewport { position: relative; overflow: hidden; overflow: clip; }
.slide {
  position: absolute; inset: 0;
  padding: clamp(20px, 3.5vw, 52px) clamp(24px, 5vw, 84px);
  display: none;
  overflow: hidden;
}
.slide[data-active] { display: block; }
.deck[data-notes-open] .slide[data-active] {
  padding-right: calc(clamp(24px, 5vw, 84px) + min(380px, 40vw));
}
.slide-inner { height: 100%; display: flex; flex-direction: column; }

/* Page arrows at the two edges; they sit in the slide's side padding, under the notes drawer and every pop-up. */
.deck-arrow {
  position: absolute; top: 50%; z-index: 4; transform: translateY(-50%);
  width: clamp(36px, 3.4vw, 56px); height: clamp(56px, 5.6vw, 92px); padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 999px;
  background: rgba(27,36,64,.16); color: #fff; cursor: pointer; opacity: .7;
  transition: opacity 160ms, background-color 160ms; -webkit-tap-highlight-color: transparent;
}
.deck-arrow.prev { left: clamp(4px, .6vw, 12px); }
.deck-arrow.next { right: clamp(4px, .6vw, 12px); }
.deck-arrow svg { width: 60%; height: auto; }
.deck-arrow:hover, .deck-arrow:focus-visible { opacity: 1; background: rgba(27,36,64,.5); }
.deck-arrow:focus-visible { outline: 3px solid var(--hoa-accent); outline-offset: 2px; }
.deck-arrow[hidden] { display: none; }
.deck[data-notes-open] .deck-arrow.next { right: calc(min(380px, 40vw) + clamp(4px, .6vw, 12px)); }

/* Type scale tuned for projection: never below 18px on a slide body. */
.slide h1 { font-size: clamp(34px, 4.4vw, 62px); font-weight: 900; line-height: 1.18; letter-spacing: .01em; margin: 0 0 .35em; text-wrap: balance; }
.slide h2 { font-size: clamp(26px, 3.2vw, 44px); font-weight: 900; line-height: 1.22; margin: 0 0 .45em; text-wrap: balance; }
.slide h3 { font-size: clamp(20px, 2.1vw, 28px); font-weight: 800; margin: 0 0 .4em; }
.slide p, .slide li { font-size: clamp(18px, 1.6vw, 24px); color: var(--hoa-ink-2); margin: 0 0 .5em; }
.slide .lead { font-size: clamp(20px, 2vw, 30px); color: var(--hoa-ink); font-weight: 600; }
.slide .eyebrow { font-size: clamp(13px, 1.1vw, 15px); font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--hoa-accent-deep); margin-bottom: 12px; }
.slide .muted { color: var(--hoa-ink-3); }
.slide .big { font-size: clamp(40px, 6vw, 96px); font-weight: 900; line-height: 1; letter-spacing: -.01em; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 48px); align-items: center; flex: 1; min-height: 0; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: clamp(16px, 2vw, 32px); flex: 1; min-height: 0; align-items: stretch; }
.center { text-align: center; align-items: center; justify-content: center; }
.fill { flex: 1; min-height: 0; }

.card {
  background: #fff; border: 1px solid var(--hoa-line); border-radius: 22px;
  padding: clamp(16px, 1.8vw, 28px);
  box-shadow: var(--hoa-shadow-sm);
}
.card.soft { background: var(--hoa-tint); box-shadow: none; }
.card.ok { border-color: #bfe8d3; background: var(--ok-soft); }
.card.bad { border-color: #f5c2c4; background: var(--bad-soft); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: clamp(13px,1.1vw,15px); font-weight: 800; background: var(--hoa-accent-soft); color: var(--hoa-accent-deep); }
.tag.ok { background: var(--ok-soft); color: #0e8654; }
.tag.bad { background: var(--bad-soft); color: #b3261e; }
.tag.manage { background: var(--dom-manage-soft); color: var(--dom-manage-deep); }
.tag.shape { background: var(--dom-shape-soft); color: var(--dom-shape-deep); }

/* ---------- Step builds ---------- */
.slide [data-step] { opacity: 0; transform: translateY(10px); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); pointer-events: none; }
.slide [data-step].is-on { opacity: 1; transform: none; pointer-events: auto; }
.slide [data-step].is-past { opacity: 1; transform: none; pointer-events: auto; }
.slide [data-step][data-dim].is-past { opacity: .45; }
@media (prefers-reduced-motion: reduce) {
  .slide [data-step] { transition: none; transform: none; }
  .deck-progress > span { transition: none; }
}

/* ---------- Bottom bar: never blocks navigation ---------- */
.deck-bottom {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 18px;
  border-top: 1px solid var(--hoa-line);
  background: rgba(255,255,255,.92);
  font-size: 13px; color: var(--hoa-ink-2);
  min-height: 52px;
}
.deck-bottom .counter { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--hoa-ink); min-width: 64px; }
.deck-bottom .step-dots { display: flex; gap: 4px; }
.deck-bottom .step-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--hoa-line); }
.deck-bottom .step-dots i.on { background: var(--hoa-accent); }
.deck-bottom .spacer { flex: 1; }
.deck-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--hoa-line); background: #fff; color: var(--hoa-ink);
  font-size: 13px; font-weight: 800;
  transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}
.deck-btn:hover { background: var(--hoa-accent-soft); border-color: transparent; color: var(--hoa-accent-deep); }
.deck-btn:active { transform: scale(.97); }
.deck-btn:focus-visible { outline: 2px solid var(--hoa-accent); outline-offset: 2px; }
.deck-btn.primary { background: var(--hoa-ink); color: #fff; border-color: transparent; }
.deck-btn.primary:hover { background: var(--hoa-accent); color: #fff; }
.deck-btn[aria-pressed="true"] { background: var(--hoa-accent); color: #fff; border-color: transparent; }
.deck-btn kbd { font: 700 10.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(27,36,64,.08); padding: 3px 5px; border-radius: 5px; color: inherit; }
.deck-btn.primary kbd, .deck-btn[aria-pressed="true"] kbd { background: rgba(255,255,255,.22); }

/* ---------- Small screens ----------
   The decks are made for a projector. On a narrow screen the bars drop what does not fit. On a phone
   the slides keep their projector layout at 1100 x 619 and are scaled down to fit the screen (deck.js
   sets --deck-fit), so nothing is cut off and the pages can still be turned. */
.deck-tip { display: none; }
@media (max-width: 900px) {
  .deck-top { gap: 10px; padding: 8px 12px; }
  .deck-top .logo, .deck-top .deck-lang { flex: none; }
  .deck-top .crumb { flex: 0 1 auto; min-width: 4em; }
  .deck-top .chip { display: block; flex: 0 2 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .deck-top .chip ~ .chip, .deck-top .section { display: none; }
  .deck-top .deck-lang { margin-left: auto; }
  .deck-bottom { padding: 8px 12px; }
  .deck-bottom .hint-kbd, .deck-btn kbd { display: none; }
  .deck-btn { white-space: nowrap; flex: none; }
}
@media (max-width: 700px) and (orientation: portrait), (max-height: 500px) and (orientation: landscape) {
  .deck { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; }
  .deck-viewport {
    width: 1100px; height: 619px;
    transform: scale(var(--deck-fit, .355)); transform-origin: 0 0;
    margin-left: calc((100% - 1100px * var(--deck-fit, .355)) / 2);
    margin-bottom: calc(619px * (var(--deck-fit, .355) - 1));
  }
  .deck-notes { display: none; }
  .deck[data-notes-open] .slide[data-active] { padding-right: clamp(24px, 5vw, 84px); }
  .deck-bottom [data-act="notes"] { display: none; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .deck-top .crumb, .deck-top .chip { display: none; }
  .deck-bottom { justify-content: center; border-bottom: 1px solid var(--hoa-line); }
  .deck-bottom .spacer, .deck-bottom .step-dots,
  .deck-bottom [data-act="overview"], .deck-bottom [data-act="full"] { display: none; }
  .deck-bottom .deck-btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
  .deck-bottom .counter { min-width: 0; padding: 0 6px; font-size: 15px; }
  .deck-tip { display: block; margin: 0; padding: 14px 16px; text-align: center; font-size: 13px; color: var(--hoa-ink-3); }
}

/* ---------- Teacher notes drawer ---------- */
.deck-notes {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 40vw);
  background: #fffdf5; border-left: 1px solid #f0e6c8;
  box-shadow: -12px 0 40px rgba(27,36,64,.12);
  padding: 22px 22px 80px; overflow: auto;
  transform: translateX(100%); transition: transform 320ms var(--ease-out);
  z-index: 5;
}
.deck-notes[data-open] { transform: none; }
.deck-notes h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #8a6d1d; }
.deck-notes .note-title { font-size: 16px; font-weight: 900; margin-bottom: 12px; color: var(--hoa-ink); }
.deck-notes p, .deck-notes li { font-size: 14.5px; line-height: 1.7; color: #4a4a3f; margin: 0 0 8px; }
.deck-notes ul { padding-left: 18px; margin: 0 0 10px; }
.deck-notes .say { border-left: 3px solid #e7c96a; padding: 6px 12px; background: #fff7dc; border-radius: 0 10px 10px 0; font-style: normal; }
.deck-notes .time { display: inline-block; font-size: 12px; font-weight: 800; color: #8a6d1d; background: #fff1bf; padding: 2px 8px; border-radius: 999px; margin-bottom: 10px; }
@media (prefers-reduced-motion: reduce) { .deck-notes { transition: none; } }

/* ---------- Overview grid ---------- */
.deck-overview {
  position: absolute; inset: 0; z-index: 6;
  background: rgba(15,20,36,.92); backdrop-filter: blur(6px);
  padding: 32px; overflow: auto;
  display: none;
}
.deck-overview[data-open] { display: block; }
.deck-overview .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.deck-overview button.thumb {
  text-align: left; background: #fff; border: 2px solid transparent; border-radius: 16px; padding: 14px 16px; min-height: 96px;
  display: flex; flex-direction: column; gap: 6px; color: var(--hoa-ink);
}
.deck-overview button.thumb:hover, .deck-overview button.thumb:focus-visible { border-color: var(--hoa-accent); outline: none; }
.deck-overview button.thumb[data-current] { border-color: var(--hoa-accent); box-shadow: 0 0 0 4px rgba(59,111,246,.25); }
.deck-overview .n { font-size: 11px; font-weight: 900; color: var(--hoa-ink-3); letter-spacing: .1em; }
.deck-overview .t { font-size: 14px; font-weight: 800; line-height: 1.35; }
.deck-overview .s { font-size: 11px; color: var(--hoa-ink-2); }
.deck-overview .close { position: sticky; top: 0; float: right; margin-bottom: 12px; }

/* Thumbnail overview — opt-in per deck with `overviewThumbs: true` (see deck.js renderThumbs). */
.deck-overview.thumbs .grid { clear: both; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 16px; }
.deck-overview button.thumb.pic { padding: 0; min-height: 0; gap: 6px; background: transparent; border: 0; border-radius: 0; box-shadow: none; color: #fff; }
.deck-overview button.thumb.pic[data-current] { box-shadow: none; }
.deck-overview button.thumb.pic .frame { position: relative; display: block; overflow: hidden; border-radius: 10px; background: #fff; box-shadow: 0 0 0 3px transparent; transition: box-shadow 160ms ease-out;
  /* the copy sits inside a <button>: give it the page's own text defaults back */
  color: var(--hoa-ink); text-align: left; font-size: 16px; font-weight: 400; line-height: 1.5; }
.deck-overview button.thumb.pic:hover .frame, .deck-overview button.thumb.pic:focus-visible .frame { box-shadow: 0 0 0 3px var(--hoa-accent); }
.deck-overview button.thumb.pic[data-current] .frame { box-shadow: 0 0 0 4px #ffc93c; }
.deck-overview button.thumb.pic .frame > .slide { display: block; position: absolute; inset: auto; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.deck-overview button.thumb.pic .frame [data-step] { opacity: 1 !important; transform: none !important; }
.deck-overview button.thumb.pic .frame * { animation: none !important; transition: none !important; }
.deck-overview button.thumb.pic .n { color: rgba(255,255,255,.85); font-size: 13px; }

/* ---------- Shared interactive widgets ---------- */
.w-chat { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; height: 100%; min-height: 0; }
.w-chat .thread { overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 6px; min-height: 0; }
.w-chat .msg { display: flex; gap: 10px; align-items: flex-start; max-width: 92%; }
.w-chat .msg.me { align-self: flex-end; flex-direction: row-reverse; }
.w-chat .msg .av { width: 40px; height: 40px; border-radius: 12px; background: var(--hoa-tint); flex: none; display: grid; place-items: center; overflow: hidden; }
.w-chat .msg .av img { width: 34px; height: 34px; object-fit: contain; }
.w-chat .msg .bub { padding: 12px 16px; border-radius: 18px; font-size: clamp(16px, 1.35vw, 20px); line-height: 1.6; color: var(--hoa-ink); background: var(--hoa-tint); white-space: pre-wrap; }
.w-chat .msg.me .bub { background: var(--hoa-accent); color: #fff; border-bottom-right-radius: 6px; }
.w-chat .msg.ai .bub { border-bottom-left-radius: 6px; }
.w-chat .msg .bub b { font-weight: 800; }
.w-chat .typing i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--hoa-ink-3); animation: blink 1s infinite; }
.w-chat .typing i:nth-child(2) { animation-delay: .2s } .w-chat .typing i:nth-child(3) { animation-delay: .4s }
@keyframes blink { 0%,80%,100% { opacity: .25 } 40% { opacity: 1 } }
.w-chat .compose { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.w-chat textarea { width: 100%; min-height: 76px; resize: vertical; border: 1.5px solid var(--hoa-line); border-radius: 16px; padding: 12px 14px; font: inherit; font-size: clamp(16px, 1.3vw, 19px); color: var(--hoa-ink); background: #fff; }
.w-chat textarea:focus { outline: none; border-color: var(--hoa-accent); box-shadow: 0 0 0 4px rgba(59,111,246,.15); }
.w-chat .presets { display: flex; flex-wrap: wrap; gap: 8px; }
.w-chat .presets button { border: 1px solid var(--hoa-line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 700; color: var(--hoa-ink-2); }
.w-chat .presets button:hover { border-color: var(--hoa-accent); color: var(--hoa-accent-deep); }
.w-chat .presets button.bad { color: #b3261e; } .w-chat .presets button.good { color: #0e8654; }
.w-chat .mode { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--hoa-ink-3); display: inline-flex; align-items: center; gap: 6px; }
.w-chat .mode i { width: 8px; height: 8px; border-radius: 50%; background: var(--hoa-ink-3); }
.w-chat .mode[data-live] i { background: var(--ok); }

.w-rubric { display: grid; gap: 8px; }
.w-rubric .row { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 10px 14px; border-radius: 14px; background: var(--hoa-tint); border: 1px solid var(--hoa-line); opacity: 0; transform: translateX(8px); transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out); }
.w-rubric .row.show { opacity: 1; transform: none; }
.w-rubric .row.pass { background: var(--ok-soft); border-color: #bfe8d3; }
.w-rubric .row.fail { background: var(--bad-soft); border-color: #f5c2c4; }
.w-rubric .mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--hoa-ink-3); font-size: 16px; }
.w-rubric .pass .mark { background: var(--ok); } .w-rubric .fail .mark { background: #e5484d; }
.w-rubric .crit { font-weight: 800; font-size: clamp(15px, 1.25vw, 19px); color: var(--hoa-ink); }
.w-rubric .why { font-size: clamp(13px, 1.1vw, 16px); color: var(--hoa-ink-2); margin: 2px 0 0; }
.w-rubric .overall { font-size: clamp(14px, 1.2vw, 17px); padding: 10px 14px; border-radius: 14px; background: var(--hoa-accent-soft); color: var(--hoa-accent-deep); font-weight: 700; }

.w-poll { display: grid; gap: 10px; }
.w-poll .opt { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 16px; border: 1.5px solid var(--hoa-line); background: #fff; }
.w-poll .opt .label { font-size: clamp(17px, 1.5vw, 22px); font-weight: 800; color: var(--hoa-ink); }
.w-poll .opt .bar { height: 10px; border-radius: 999px; background: var(--hoa-tint); overflow: hidden; margin-top: 8px; }
.w-poll .opt .bar > span { display: block; height: 100%; width: 0; background: var(--hoa-accent); transition: width 300ms var(--ease-out); }
.w-poll .ctr { display: inline-flex; align-items: center; gap: 6px; }
.w-poll .ctr button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hoa-line); background: #fff; font-size: 20px; font-weight: 900; color: var(--hoa-ink); }
.w-poll .ctr button:hover { background: var(--hoa-accent-soft); }
.w-poll .ctr .n { min-width: 40px; text-align: center; font-size: clamp(20px, 1.8vw, 28px); font-weight: 900; font-variant-numeric: tabular-nums; }
.w-poll .opt.reveal-ok { border-color: var(--ok); background: var(--ok-soft); }
.w-poll .opt.reveal-bad { opacity: .6; }
.w-poll .foot { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--hoa-ink-3); }

/* Photo grids used by the dog decks */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--hoa-tint); border: 2px solid transparent; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph .lbl { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(27,36,64,.82); color: #fff; font-size: 11px; font-weight: 800; }
.photos .ph .mk { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 900; background: var(--ok); opacity: 0; transform: scale(.6); transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
.photos .ph .mk.bad { background: #e5484d; }
.photos .ph.judged .mk { opacity: 1; transform: none; }
.photos .ph.judged.wrong { border-color: #e5484d; } .photos .ph.judged.right { border-color: var(--ok); }
.photos .ph .grass { position: absolute; inset: 0; background: rgba(21,168,107,.35); mix-blend-mode: multiply; opacity: 0; transition: opacity 300ms; }
.photos .ph.hl .grass { opacity: 1; }
.photos .ph .wm { position: absolute; right: 4px; bottom: 4px; padding: 1px 6px; font-size: 9px; font-weight: 900; color: #fff; background: rgba(0,0,0,.55); border-radius: 4px; }
.photos .ph.hl { outline: 3px solid var(--dom-manage); outline-offset: 1px; }

.w-train { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; height: 100%; min-height: 0; }
.w-train .box { border: 1.5px dashed var(--hoa-line); border-radius: 18px; padding: 12px; background: #fff; min-height: 120px; }
.w-train .box h4 { margin: 0 0 8px; font-size: clamp(14px,1.2vw,17px); color: var(--hoa-ink-2); display: flex; justify-content: space-between; }
.w-train .model { width: clamp(140px, 14vw, 200px); text-align: center; }
.w-train .model .brain { width: 100%; aspect-ratio: 1; border-radius: 28px; background: var(--hoa-accent-soft); display: grid; place-items: center; position: relative; overflow: hidden; }
.w-train .model .brain img { width: 70%; height: 70%; object-fit: contain; }
.w-train .model .brain .ring { position: absolute; inset: 10px; border-radius: 24px; border: 3px solid transparent; border-top-color: var(--hoa-accent); animation: none; }
.w-train .model.training .brain .ring { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.w-train .model .st { margin-top: 8px; font-weight: 800; font-size: 14px; color: var(--hoa-ink-2); }
.w-train .model .pb { height: 8px; border-radius: 999px; background: var(--hoa-tint); overflow: hidden; margin-top: 8px; }
.w-train .model .pb > span { display: block; height: 100%; width: 0; background: var(--hoa-accent); transition: width 1200ms linear; }
.w-train .flyer { position: absolute; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; pointer-events: none; z-index: 3; transition: transform 700ms var(--ease-out), opacity 700ms; }

.w-conf { display: grid; gap: 10px; }
.w-conf .r { display: grid; grid-template-columns: 90px 1fr 64px; gap: 12px; align-items: center; font-size: clamp(15px,1.3vw,19px); font-weight: 800; }
.w-conf .r .bar { height: 18px; border-radius: 999px; background: var(--hoa-tint); overflow: hidden; }
.w-conf .r .bar > span { display: block; height: 100%; width: 0; background: var(--hoa-accent); transition: width 900ms var(--ease-out); }
.w-conf .r .pct { text-align: right; font-variant-numeric: tabular-nums; }
.w-conf .r.win .bar > span { background: var(--hoa-accent); } .w-conf .r:not(.win) .bar > span { background: #c9d3ea; }

.w-balance { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; height: 100%; min-height: 0; overflow: auto; align-content: start; padding-right: 4px; }
.w-balance .pool, .w-balance .cats { display: grid; gap: 8px; align-content: start; }
.w-balance .folder { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--hoa-line); border-radius: 16px; padding: 8px 12px; background: #fff; cursor: grab; user-select: none; }
.w-balance .folder:hover { border-color: var(--hoa-accent); }
.w-balance .folder .imgs { display: flex; flex: none; }
.w-balance .folder .imgs img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; margin-left: -14px; border: 2px solid #fff; }
.w-balance .folder .imgs img:first-child { margin-left: 0; }
.w-balance .folder .t { font-weight: 800; font-size: clamp(14px,1.2vw,17px); }
.w-balance .folder .s { font-size: 12px; color: var(--hoa-ink-3); }
.w-balance .folder .add { margin-left: auto; border: 1px solid var(--hoa-line); background: var(--hoa-tint); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.w-balance .folder.used { opacity: .45; pointer-events: none; }
.w-balance .cat { border: 2px dashed var(--hoa-line); border-radius: 18px; padding: 12px; background: var(--hoa-tint); transition: border-color 160ms, background-color 160ms; }
.w-balance .cat.over { border-color: var(--hoa-accent); background: var(--hoa-accent-soft); }
.w-balance .cat h4 { margin: 0 0 8px; display: flex; justify-content: space-between; font-size: clamp(15px,1.3vw,19px); }
.w-balance .cat .cnt { font-variant-numeric: tabular-nums; color: var(--hoa-ink-2); font-weight: 800; }
.w-balance .cat .photos { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.w-balance .cat .photos .ph.new { outline: 3px solid var(--dom-create); }
.w-balance .result { grid-column: 1 / -1; }
.w-balance .result .photos { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)) !important; }
.w-balance .result .acc { font-size: clamp(34px, 4.5vw, 64px); font-weight: 900; line-height: 1; }
.w-balance .result .acc.ok { color: #0e8654; } .w-balance .result .acc.mid { color: var(--dom-manage-deep); } .w-balance .result .acc.bad { color: #b3261e; }

.diagram svg { width: 100%; height: auto; display: block; }
.diagram text { font-family: inherit; }

/* Utility */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hint { font-size: clamp(13px,1.1vw,16px); color: var(--hoa-ink-3); }
.kbd { font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--hoa-tint); border: 1px solid var(--hoa-line); padding: 3px 6px; border-radius: 6px; color: var(--hoa-ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
