@charset "UTF-8";

:root {
  --page-bg: #ffe7bd;
  --page-bg-deep: #e96a00;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-glass-strong: rgba(255, 255, 255, 0.9);
  --surface-strong: rgba(255, 253, 248, 0.98);
  --surface-soft: rgba(246, 238, 223, 0.84);
  --tm-orange: #ff8a00;
  --tm-orange-strong: #f06400;
  --tm-orange-deep: #b94800;
  --tm-yellow: #ffd642;
  --tm-pink: #d9368a;
  --tm-violet: #5548e8;
  --tm-teal: #00a98f;
  --foundation-blue: #b94800;
  --gold-primary: var(--tm-orange);
  --gold-strong: var(--tm-orange-strong);
  --gold-deep: var(--tm-orange-deep);
  --gold-soft: #ffe18a;
  --gold-pale: #fff2c6;
  --ink: #30241d;
  --ink-soft: #5c493d;
  --ink-muted: #7b6a5f;
  --success: #168466;
  --success-bg: #e4f6ef;
  --error: #b23b26;
  --error-bg: #fff0eb;
  --focus-ring: #ff8a00;
  --line: rgba(240, 100, 0, 0.16);
  --shadow: 0 22px 60px rgba(126, 59, 10, 0.14);
  --shadow-float: 0 30px 86px rgba(126, 59, 10, 0.2);
  --shadow-soft: 0 10px 28px rgba(126, 59, 10, 0.11);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-display: "Iowan Old Style", "Noto Serif TC", "Songti TC", serif;
  --font-body: "Avenir Next", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-body);
  scroll-behavior: auto;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 86% 4%, rgba(255, 138, 0, .48), transparent 28rem),
    radial-gradient(circle at 5% 88%, rgba(255, 214, 66, .34), transparent 30rem),
    linear-gradient(145deg, #fff8e8 0%, var(--page-bg) 52%, #f3a34d 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  opacity: 0.34;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  pointer-events: none;
}

button, input, textarea, select { font: inherit; }
button, label, summary, .choice-chip span { touch-action: manipulation; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: var(--foundation-blue);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

.ambient {
  position: fixed;
  z-index: -2;
  width: 30rem;
  height: 24rem;
  filter: blur(46px);
  pointer-events: none;
}
.ambient-one {
  top: -11rem;
  left: -12rem;
  background: linear-gradient(135deg, rgba(255, 214, 66, .72), rgba(255, 255, 255, .9));
  clip-path: polygon(0 12%, 72% 0, 100% 62%, 24% 100%);
}
.ambient-two {
  right: -10rem;
  bottom: -10rem;
  background: linear-gradient(135deg, rgba(255, 106, 0, .28), rgba(217, 54, 138, .22), rgba(0, 169, 143, .16));
  clip-path: polygon(16% 0, 100% 22%, 80% 100%, 0 74%);
}
.particle-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.particle-field::before,
.particle-field::after {
  position: absolute;
  width: 18rem;
  height: 18rem;
  content: "";
  background: radial-gradient(circle, rgba(255,138,0,.42) 0 2px, transparent 3px);
  background-size: 34px 34px;
  opacity: .12;
  animation: particle-drift 42s linear infinite;
}
.particle-field::before { top: 6%; left: 8%; }
.particle-field::after { right: 4%; bottom: 8%; animation-duration: 32s; }
@keyframes particle-drift { to { transform: translate3d(30px, -36px, 0); } }

.handbook-app {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 0 max(34px, env(safe-area-inset-bottom));
}

#app-view:focus { outline: none; }
/* The view container receives programmatic focus after navigation; only interactive controls draw a focus ring. */
#app-view:focus-visible { outline: none; }

.view-shell { opacity: 1; transform: none; animation: none; }
.view-shell.is-stable-update { animation: none; }
.surface-enter { opacity: 1; transform: none; animation: none; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes surface-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

.topbar {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 100;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(166,76,0,.12);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  overflow: visible;
}

.brand-lockup { display: flex; flex: 1 1 auto; gap: 10px; align-items: center; min-width: 0; font-weight: 900; color: var(--foundation-blue); }
.brand-logo-frame {
  display: inline-flex;
  min-width: 0;
  max-width: min(360px, 46vw);
  height: 54px;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.foundation-logo {
  width: auto;
  max-width: min(320px, 40vw);
  height: 42px;
  object-fit: contain;
}
.app-title {
  overflow: hidden;
  max-width: 14rem;
  color: var(--foundation-blue);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-pill, .status-pill, .eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  color: var(--gold-deep);
  background: var(--gold-pale);
  border: 1px solid rgba(255,138,0,.18);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .04em;
}
.top-actions { display: flex; gap: 8px; }

.global-role-entry { position: relative; z-index: 101; flex: 0 0 auto; }
.global-role-entry summary,
.role-current-pill {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--foundation-blue);
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,214,66,.55));
  border: 1px solid rgba(255,138,0,.2);
  border-radius: 999px;
  box-shadow: inset 0 1px rgba(255,255,255,.9), 0 10px 24px rgba(166,76,0,.14);
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}
.role-current-pill { cursor: default; }
.global-role-entry summary::-webkit-details-marker { display: none; }
.role-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 200;
  display: grid;
  min-width: 190px;
  gap: 6px;
  padding: 10px;
  border-radius: 20px;
  box-shadow: var(--shadow-float);
}
.role-menu button {
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,138,0,.14);
  border-radius: 13px;
  cursor: pointer;
}
.role-menu button:hover { background: var(--gold-pale); }

.glass-card {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,246,216,.72));
  border: 1px solid rgba(255,255,255,.84);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(24px) saturate(1.16);
  -webkit-backdrop-filter: blur(24px) saturate(1.16);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  padding: 20px;
  place-items: center;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.7), transparent 18rem),
    rgba(99, 46, 0, .24);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}
.modal-card {
  position: relative;
  width: min(560px, 100%);
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 36px 110px rgba(61,43,10,.25), inset 0 1px rgba(255,255,255,.92);
}
.modal-card h2 { margin-bottom: 8px; font-family: var(--font-display); font-size: clamp(1.9rem, 6vw, 3rem); }
.dialog-modal {
  display: grid;
  gap: 14px;
}
.dialog-modal h2 {
  margin-bottom: 0;
}
.dialog-modal p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}
.dialog-danger {
  border-color: rgba(155,63,54,.2);
}
.dialog-actions {
  justify-content: flex-end;
  margin-top: 4px;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--gold-deep);
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(255,138,0,.18);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 800;
}
.activity-code-result p { margin: 8px 0 0; color: var(--ink-soft); line-height: 1.55; }
.voice-transcript-modal .modal-card { width: min(520px, 100%); }
.voice-transcript-modal textarea { min-height: 132px; resize: vertical; }
.voice-status-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  margin: 18px 0;
  padding: 16px;
  color: var(--ink-soft);
  background: rgba(255,255,255,.68);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.voice-status-card p { margin: 0; line-height: 1.55; }
.voice-recording-indicator {
  width: 18px;
  height: 18px;
  margin: auto;
  background: var(--gold-primary);
  border: 8px solid rgba(183,126,11,.14);
  border-radius: 50%;
  box-sizing: content-box;
}
.voice-status-card.recording .voice-recording-indicator {
  background: #b7432d;
  border-color: rgba(183,67,45,.14);
  animation: voice-pulse 1.1s ease-in-out infinite;
}
.voice-status-card.transcribing .voice-recording-indicator {
  border-color: rgba(183,126,11,.2);
  animation: voice-pulse .8s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { transform: scale(.85); opacity: .6; }
  50% { transform: scale(1.08); opacity: 1; }
}

.panel { padding: clamp(20px, 4vw, 42px); }
.section-card {
  padding: clamp(18px, 3vw, 28px);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: clamp(26px, 5vw, 64px);
  min-height: min(720px, calc(100vh - 110px));
  align-items: center;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(116deg, rgba(255,214,66,.95) 0%, rgba(255,138,0,.95) 45%, rgba(240,94,0,.96) 100%),
    var(--tm-orange);
  border-color: rgba(255,255,255,.42);
  box-shadow: 0 32px 90px rgba(188,75,0,.28), inset 0 1px rgba(255,255,255,.38);
}
.hero::before {
  position: absolute;
  right: clamp(1rem, 6vw, 6rem);
  top: clamp(1rem, 3vw, 2.5rem);
  width: min(40vw, 25rem);
  aspect-ratio: 1;
  content: "";
  background:
    conic-gradient(from -26deg, var(--tm-yellow), var(--tm-orange) 26%, var(--tm-pink) 43%, var(--tm-violet) 61%, var(--tm-teal) 78%, var(--tm-yellow));
  clip-path: polygon(50% 0, 72% 8%, 96% 38%, 88% 72%, 60% 98%, 24% 90%, 0 55%, 12% 18%);
  opacity: .28;
  mix-blend-mode: screen;
  filter: blur(.2px) drop-shadow(0 22px 38px rgba(108,38,0,.18));
  transform: rotate(-9deg);
}
.hero::after {
  position: absolute;
  right: -9rem;
  bottom: -13rem;
  width: 34rem;
  height: 34rem;
  content: "";
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 40% 60% 48% 52%;
  box-shadow: 0 0 0 34px rgba(255,255,255,.08), 0 0 0 68px rgba(255,255,255,.05);
}
.hero-copy, .hero-art { position: relative; z-index: 1; }
.hero h1, .page-heading h1, .summary-title, .certificate-title {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
}
.hero h1 { max-width: 9em; font-size: clamp(2.65rem, 7vw, 5.8rem); }
.hero .eyebrow {
  color: #fff7d4;
  background: rgba(185,72,0,.26);
  border-color: rgba(255,255,255,.32);
}
.hero-brand-row {
  position: absolute;
  left: 0;
  top: clamp(-68px, -5vw, -46px);
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 0;
  color: var(--foundation-blue);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-weight: 900;
}
.hero-foundation-logo {
  width: min(230px, 44vw);
  height: 34px;
  object-fit: contain;
}
.hero-lead { max-width: 35rem; color: var(--ink-soft); font-size: clamp(1.04rem, 2vw, 1.28rem); line-height: 1.85; }
.hero .hero-lead { color: rgba(255,255,255,.92); text-shadow: 0 1px 18px rgba(111,42,0,.18); }
.hero-art {
  min-height: 430px;
  padding: 14px;
  transform: rotate(2deg);
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 24px;
  box-shadow: 0 34px 74px rgba(102,39,0,.28);
}
.hero-art img { width: 100%; height: 100%; min-height: 400px; object-fit: cover; filter: saturate(1.05) contrast(1.05); border-radius: 16px; }
.hero-art figcaption { padding: 12px 4px 2px; color: var(--ink-muted); font-size: .85rem; }
.role-gateway {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.role-gateway-card {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: hidden;
  padding: 18px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.role-gateway-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  content: "";
  background: linear-gradient(180deg, var(--tm-yellow), var(--tm-orange));
}
.role-gateway-card h2 { margin-bottom: 0; font-family: var(--font-display); font-size: 1.45rem; }
.role-gateway-card p { margin-bottom: 4px; color: var(--ink-soft); line-height: 1.55; }
.role-gateway-card .btn { width: fit-content; }
.role-gateway-card.student-role {
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(255,239,189,.9));
  border-color: rgba(255,138,0,.28);
}
.role-gateway-card.teacher-role::before { background: linear-gradient(180deg, var(--tm-orange), var(--tm-pink)); }
.role-gateway-card.admin-role::before { background: linear-gradient(180deg, var(--tm-violet), var(--tm-teal)); }

.main-gateway {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(280px, .78fr);
  gap: clamp(24px, 5vw, 62px);
  min-height: min(660px, calc(100vh - 96px));
  align-items: center;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  color: white;
  background:
    radial-gradient(circle at 12% 14%, rgba(255,255,255,.26), transparent 18rem),
    linear-gradient(120deg, rgba(255,214,66,.98) 0%, rgba(255,138,0,.96) 46%, rgba(240,94,0,.98) 100%);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 90px rgba(188,75,0,.28), inset 0 1px rgba(255,255,255,.38);
}
.main-gateway-simple {
  grid-template-columns: minmax(0, 760px);
  min-height: min(560px, calc(100vh - 96px));
  justify-content: center;
  text-align: center;
}
.main-gateway::after {
  position: absolute;
  right: -8rem;
  bottom: -12rem;
  width: 34rem;
  height: 34rem;
  content: "";
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 42% 58% 48% 52%;
  box-shadow: 0 0 0 34px rgba(255,255,255,.08), 0 0 0 68px rgba(255,255,255,.05);
}
.main-gateway-copy,
.main-gateway-art {
  position: relative;
  z-index: 1;
}
.main-gateway-simple .main-gateway-copy {
  display: grid;
  justify-items: center;
}
.gateway-foundation-logo,
.role-entry-logo {
  display: block;
  width: min(420px, 74vw);
  height: auto;
  margin-bottom: clamp(20px, 4vw, 34px);
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(117,45,0,.18));
}
.main-gateway h1,
.role-entry-brand h1 {
  max-width: 9em;
  margin: 14px 0 16px;
  color: white;
  font-family: var(--font-display);
  font-size: clamp(2.65rem, 7vw, 5.75rem);
  line-height: 1.05;
}
.main-gateway p,
.role-entry-brand p {
  max-width: 40rem;
  margin: 0;
  color: rgba(255,255,255,.92);
  font-size: clamp(1.04rem, 2vw, 1.24rem);
  line-height: 1.8;
  text-shadow: 0 1px 18px rgba(111,42,0,.18);
}
.main-gateway-simple p {
  margin-inline: auto;
}
.gateway-role-actions {
  display: grid;
  width: min(100%, 620px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(24px, 4vw, 36px);
}
.gateway-role-button {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 62px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255,255,255,.34), rgba(255,255,255,.12) 38%, rgba(255,138,0,.5)),
    linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 18px;
  box-shadow:
    0 18px 40px rgba(151,59,0,.24),
    inset 0 1px 0 rgba(255,255,255,.72),
    inset 0 -18px 34px rgba(255,107,0,.18);
  font-size: 1.02rem;
  letter-spacing: .03em;
  text-shadow: 0 1px 14px rgba(122,42,0,.34);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
}
.gateway-role-button::before {
  position: absolute;
  inset: 1px;
  content: "";
  background:
    radial-gradient(circle at 22% 0%, rgba(255,255,255,.64), transparent 28%),
    linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  border-radius: 17px;
  opacity: .9;
  pointer-events: none;
}
.gateway-role-button::after {
  position: absolute;
  top: -40%;
  left: -30%;
  width: 70%;
  height: 180%;
  content: "";
  background: linear-gradient(110deg, transparent 15%, rgba(255,255,255,.36), transparent 70%);
  transform: translateX(-80%) rotate(12deg);
  transition: transform 520ms ease;
  pointer-events: none;
}
.gateway-role-button:hover {
  background:
    linear-gradient(145deg, rgba(255,255,255,.42), rgba(255,255,255,.16) 36%, rgba(255,138,0,.58)),
    linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.68);
  box-shadow:
    0 22px 48px rgba(151,59,0,.3),
    inset 0 1px 0 rgba(255,255,255,.82),
    inset 0 -18px 34px rgba(255,107,0,.22);
}
.gateway-role-button:hover::after {
  transform: translateX(210%) rotate(12deg);
}
.gateway-role-button:active {
  transform: translateY(1px) scale(.99);
}
.main-gateway .eyebrow,
.role-entry-brand .eyebrow {
  color: #fff7d4;
  background: rgba(185,72,0,.26);
  border-color: rgba(255,255,255,.32);
}
.main-gateway-art {
  min-height: 390px;
  padding: 14px;
  transform: rotate(1.8deg);
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 24px;
  box-shadow: 0 34px 74px rgba(102,39,0,.28);
}
.main-gateway-art img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  border-radius: 16px;
  filter: saturate(1.05) contrast(1.05);
}
.main-gateway-art figcaption {
  padding: 12px 4px 2px;
  color: var(--ink-muted);
  font-size: .85rem;
}
.role-gateway-main {
  margin-top: 20px;
}
.role-gateway-main .role-gateway-card {
  min-height: 230px;
  padding: clamp(20px, 3vw, 30px);
}
.role-gateway-main .role-gateway-card h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
}

.role-entry-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .74fr);
  gap: clamp(24px, 5vw, 56px);
  min-height: min(680px, calc(100vh - 88px));
  align-items: center;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  color: white;
  background:
    radial-gradient(circle at 12% 12%, rgba(255,255,255,.24), transparent 18rem),
    linear-gradient(125deg, rgba(255,214,66,.98), rgba(255,138,0,.96) 48%, rgba(240,94,0,.98));
  border: 1px solid rgba(255,255,255,.5);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 90px rgba(188,75,0,.28), inset 0 1px rgba(255,255,255,.38);
}
.role-entry-page::after {
  position: absolute;
  right: -7rem;
  top: -9rem;
  width: 30rem;
  height: 30rem;
  content: "";
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 44% 56% 52% 48%;
  box-shadow: 0 0 0 32px rgba(255,255,255,.08), 0 0 0 64px rgba(255,255,255,.05);
}
.role-entry-brand,
.role-entry-card {
  position: relative;
  z-index: 1;
}
.role-entry-form-card {
  display: grid;
  gap: 12px;
  padding: clamp(22px, 4vw, 34px);
  color: var(--ink);
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}
.role-entry-form-card h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
}

.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field label, .field-label { color: var(--ink); font-weight: 800; }
.field small, .help-text { color: var(--ink-muted); line-height: 1.55; }
.field input, .field textarea, .field select, .search-field {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  color: var(--ink);
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(105,73,14,.22);
  border-radius: 13px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.field textarea { min-height: 118px; resize: vertical; line-height: 1.65; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible, .search-field:focus-visible {
  background: #fff;
  border-color: var(--gold-strong);
  box-shadow: 0 0 0 4px rgba(255,138,0,.18);
  outline: 0;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.spread { justify-content: space-between; }
.btn {
  display: inline-flex;
  min-height: 48px;
  padding: 11px 18px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(107,74,13,.2);
  border-radius: 13px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(88,59,8,.12); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--tm-orange), var(--tm-orange-strong) 58%, #d74700); border-color: transparent; box-shadow: 0 14px 30px rgba(240,100,0,.28); }
.btn-soft { color: var(--gold-deep); background: linear-gradient(135deg, #fff7d4, #ffe18a); border-color: rgba(255,138,0,.2); }
.btn-quiet { min-height: 44px; padding: 8px 12px; background: transparent; }
.btn-danger { color: var(--error); background: var(--error-bg); }
.btn-disabled-action {
  color: rgba(80,68,48,.72);
  background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(233,225,204,.82));
  border-color: rgba(107,74,13,.12);
  box-shadow: none;
}
.btn-disabled-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(88,59,8,.08);
}
.btn-disabled-action[aria-disabled="true"] {
  cursor: pointer;
}
.btn-block { width: 100%; }
.btn:disabled, .send-icon:disabled, .mic-icon:disabled { opacity: .56; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-busy, .send-icon.is-busy, .chat-composer.is-busy, .admin-activity-row.is-busy { pointer-events: none; }
.btn:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #173f7a;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(23,63,122,.42);
}

@media (forced-colors: active) {
  .btn:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 4px;
    box-shadow: none;
  }
}
.task-map-ai-cta { min-width: min(100%, 280px); min-height: 56px; padding-inline: 24px; }

.loading-spinner {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .72s linear infinite;
}
.send-icon .loading-spinner { width: 20px; height: 20px; }

.field-error {
  color: var(--error);
  font-size: .86rem;
  font-weight: 800;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.chat-composer input[aria-invalid="true"] {
  border-color: rgba(155,63,54,.7);
  box-shadow: 0 0 0 4px rgba(155,63,54,.12);
}
.invalid-shake { animation: invalid-shake 360ms ease both; }
@keyframes invalid-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.notice, .error-banner, .success-banner {
  padding: 13px 15px;
  border-radius: 13px;
  line-height: 1.55;
}
.notice { color: var(--ink-soft); background: rgba(255,244,204,.92); border: 1px solid rgba(255,138,0,.18); }
.error-banner { color: var(--error); background: var(--error-bg); border: 1px solid rgba(155,63,54,.24); }
.success-banner { color: var(--success); background: var(--success-bg); border: 1px solid rgba(57,116,90,.2); }

.page-heading { display: grid; gap: 6px; margin-bottom: 24px; }
.page-heading h1 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3.55rem); }
.page-heading p { max-width: 50rem; margin: 0; color: var(--ink-soft); line-height: 1.7; }

.progress-shell { display: grid; gap: 8px; margin: 18px 0 28px; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-soft); font-weight: 750; }
.progress-track { height: 10px; overflow: hidden; background: rgba(255,138,0,.14); border-radius: 999px; }
.progress-track > i { display: block; width: var(--progress, 0%); height: 100%; background: linear-gradient(90deg, var(--tm-yellow), var(--tm-orange), var(--tm-pink)); border-radius: inherit; transition: width 300ms ease; }

.admin-workspace { display: grid; grid-template-columns: minmax(280px, .46fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-create-card, .admin-list-card { min-width: 0; }
.admin-list-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-list-head h2, .admin-activity-main h2 { margin-bottom: 6px; font-family: var(--font-display); }
.admin-activity-list { display: grid; gap: 10px; }
.admin-activity-row {
  overflow: hidden;
  padding: 15px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 8px 22px rgba(166,76,0,.08);
}
.admin-activity-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.admin-activity-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.admin-activity-edit-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, .6fr) minmax(130px, .45fr) auto;
  gap: 10px;
  align-items: end;
}
.skeleton-row {
  position: relative;
  min-height: 88px;
  overflow: hidden;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,138,0,.12);
  border-radius: 15px;
}
.skeleton-row::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.15s ease-in-out infinite;
}
@keyframes skeleton-shimmer { to { transform: translateX(100%); } }

.artwork-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.artwork-card { display: flex; min-width: 0; overflow: hidden; flex-direction: column; background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.artwork-card figure { position: relative; margin: 0; overflow: hidden; aspect-ratio: 4/3; background: #d8ceb9; }
.artwork-card figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.artwork-card:hover figure img { transform: scale(1.035); }
.artwork-card-body { display: flex; padding: 20px; flex: 1; flex-direction: column; }
.artwork-card h2 { margin-bottom: 8px; font-family: var(--font-display); font-size: 1.45rem; }
.artwork-meta { color: var(--ink-muted); font-size: .9rem; line-height: 1.5; }
.artwork-card .actions { margin-top: auto; padding-top: 16px; }
.placeholder-ribbon { position: absolute; top: 12px; left: 12px; padding: 6px 9px; color: #fff; background: rgba(185,72,0,.88); border-radius: 8px; font-size: .74rem; font-weight: 800; }

.artwork-workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .9fr); gap: 18px; align-items: start; }
.artwork-stage { position: relative; display: grid; min-height: 0; align-self: start; overflow: hidden; padding: 12px; background: #191813; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.artwork-image-map { position: relative; width: 100%; margin: auto; overflow: hidden; line-height: 0; }
.artwork-image-map > img { display: block; width: 100%; height: auto; object-fit: contain; }
.artwork-image-map::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  background: transparent;
  border-radius: calc(var(--radius-lg) - 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.artwork-stage.has-active-hotspot .artwork-image-map::after {
  background: transparent;
  opacity: 0;
  animation: none;
}
.artwork-stage.is-spotlight-mode .artwork-image-map::before {
  display: none;
}
.artwork-stage.is-spotlight-mode .artwork-image-map::after {
  background: transparent;
}
@keyframes artwork-spotlight {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spotlight-glow {
  0%, 100% { opacity: .72; transform: translate(-50%, -50%) scale(.97); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); }
}
.hotspot {
  --hotspot-dot-size: 20px;
  --hotspot-focus-size: 38px;
  --hotspot-dot-bg: rgba(255,249,226,.46);
  --hotspot-dot-border: rgba(246,219,122,.95);
  --hotspot-text: rgba(185,72,0,.95);
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  color: var(--hotspot-text);
  background: transparent;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
  font-size: .68rem;
  transform: translate(calc(-50% + 11px), calc(-50% - 11px));
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(255,255,255,.45);
  z-index: 6;
}
.hotspot::before {
  position: absolute;
  width: var(--hotspot-dot-size);
  height: var(--hotspot-dot-size);
  content: "";
  background: var(--hotspot-dot-bg);
  border: 2px solid var(--hotspot-dot-border);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255,244,198,.15), 0 6px 18px rgba(0,0,0,.2);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  transition: width 180ms ease, height 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  /* 只在作品初次出現時輕柔提示兩次，避免未選光點持續閃爍。 */
  animation: hotspot-breathe 1.75s ease-in-out 2;
}
.hotspot::after {
  position: absolute;
  left: 8px;
  top: 32px;
  width: 8px;
  height: 8px;
  content: "";
  background: #fff7cf;
  border: 2px solid var(--tm-orange-strong);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,247,207,.42), 0 2px 5px rgba(58,29,8,.36);
  opacity: 0;
  pointer-events: none;
  transform: none;
  transition: opacity 180ms ease;
}
.hotspot:hover::before,
.hotspot:focus-visible::before {
  --hotspot-dot-size: 25px;
  --hotspot-dot-bg: rgba(255,249,226,.7);
  --hotspot-dot-border: rgba(255,232,142,1);
}
.hotspot:focus-visible {
  outline: 2px solid rgba(246,219,122,.9);
  outline-offset: 2px;
}
.hotspot > * { position: relative; z-index: 1; }
.hotspot.unviewed {
  --hotspot-dot-size: 24px;
  --hotspot-dot-bg: #f06400;
  --hotspot-dot-border: rgba(255,240,185,1);
  --hotspot-text: #fff;
  text-shadow: 0 1px 4px rgba(99,38,0,.45);
}
.hotspot.viewed {
  --hotspot-dot-size: 24px;
  --hotspot-dot-bg: #fffdf6;
  --hotspot-dot-border: #f06400;
  --hotspot-text: var(--tm-orange-deep);
  text-shadow: none;
}
.hotspot.viewed:not(.completed) {
  --hotspot-dot-bg: #fffdf6;
  --hotspot-dot-border: #f06400;
  --hotspot-text: var(--tm-orange-deep);
}
.hotspot.completed {
  --hotspot-dot-size: 20px;
  --hotspot-dot-bg: rgba(47,125,98,.94);
  --hotspot-dot-border: rgba(230,246,238,.96);
  --hotspot-text: #fff;
  opacity: .72;
  text-shadow: none;
}
.hotspot.viewed::before,
.hotspot.completed::before {
  animation: none;
}
.hotspot.viewed::before {
  border-width: 3px;
  box-shadow: 0 0 0 6px rgba(255,255,255,.42), 0 6px 18px rgba(0,0,0,.18);
}
.hotspot.completed::before {
  box-shadow: 0 0 0 4px rgba(47,125,98,.13), 0 5px 14px rgba(0,0,0,.15);
}
.hotspot.completed:hover,
.hotspot.completed:focus-visible {
  opacity: 1;
}
.hotspot.active {
  --hotspot-dot-size: 25px;
  --hotspot-focus-size: 46px;
  opacity: 1;
}
.hotspot.active::before {
  animation: hotspot-breathe 1.25s ease-in-out 2;
  box-shadow: 0 0 0 4px rgba(255,233,142,.18), 0 5px 14px rgba(0,0,0,.16);
}
.hotspot.viewed.active::before { animation: none; }
.hotspot.active::after {
  opacity: 1;
  transform: none;
  animation: none;
}
.hotspot.completed.active {
  --hotspot-dot-size: 22px;
  --hotspot-focus-size: 40px;
  --hotspot-dot-bg: rgba(47,125,98,.98);
  --hotspot-dot-border: rgba(230,246,238,1);
  --hotspot-text: #fff;
}
.hotspot.completed.active::before,
.hotspot.completed.active::after {
  animation: none;
}
.hotspot.completed.active::after {
  opacity: .72;
}
.hotspot-guide-target {
  position: absolute;
  left: var(--x);
  top: var(--y);
  /* 選定主亮點後，A–E 是目前要操作的細節層；避免與主數字重疊時點不到。 */
  z-index: 8;
  width: clamp(44px, 10%, 72px);
  padding: 0;
  background: rgba(255,252,242,.055);
  aspect-ratio: 1;
  border: 2px dashed rgba(246,235,207,.62);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255,252,242,.045), inset 0 0 22px rgba(255,252,242,.09);
  cursor: zoom-in;
  transform: translate(-50%, -50%);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.hotspot-guide-target:hover,
.hotspot-guide-target:focus-visible,
.hotspot-guide-target.is-selected {
  border-style: solid;
  border-color: #ff9d45;
  background: rgba(240,100,0,.16);
  box-shadow: 0 0 0 7px rgba(240,100,0,.11), 0 0 22px rgba(240,100,0,.24), inset 0 0 22px rgba(255,244,220,.13);
}
.hotspot-guide-target.is-viewed:not(.is-selected) {
  border-style: solid;
  border-color: rgba(115,205,178,.92);
  background: rgba(47,125,98,.17);
  box-shadow: 0 0 0 6px rgba(47,125,98,.09), inset 0 0 22px rgba(215,248,235,.1);
}
.hotspot-guide-target.is-attention-needed:not(.is-viewed) {
  border-style: solid;
  border-color: rgba(255,198,79,.96);
  background: rgba(255,177,45,.12);
  animation: observation-target-shimmer 1.65s ease-in-out 3;
}
.hotspot-guide-target.is-attention-needed:not(.is-viewed) b {
  color: #2e2115;
  background: #ffd76b;
  border-color: #fff7ce;
}
.hotspot-guide-target:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hotspot-guide-target b {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fffaf0;
  background: #574936;
  border: 2px solid #eadbb8;
  border-radius: 50%;
  box-shadow: 0 5px 12px rgba(48,30,8,.24);
  font-size: .7rem;
  line-height: 1;
}
.hotspot-guide-target b > span { display: block; }
.hotspot-guide-target b > i {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: none;
  width: 14px;
  height: 14px;
  place-items: center;
  color: #fff;
  background: #21664f;
  border: 1px solid #e5f7ef;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(20,68,51,.35);
  font-size: .56rem;
  font-style: normal;
}
.hotspot-guide-target.is-viewed b {
  background: #2f7d62;
  border-color: #dff5eb;
}
.hotspot-guide-target.is-viewed b > i { display: grid; }
.hotspot-guide-target.is-selected b {
  background: var(--tm-orange-strong);
  border-color: #fff0bb;
}
.hotspot-guide-target.is-edge-right b {
  right: auto;
  left: -8px;
}
.hotspot-guide-target.is-edge-right {
  width: clamp(44px, 9%, 62px);
}
.hotspot-guide-target.is-near-hotspot {
  /* A–E 與主數字接近時移到細節旁，兩種操作都保有獨立點擊區。 */
  transform: translate(calc(-50% - 18px), calc(-50% + 18px));
}
.hotspot-guide-target.is-near-hotspot.is-edge-bottom {
  transform: translate(calc(-50% - 18px), calc(-50% - 18px));
}
.hotspot-evidence-list {
  display: grid;
  gap: 9px;
  margin: 2px 0 14px;
  padding: 12px 13px;
  color: var(--ink-soft);
  background: linear-gradient(135deg, rgba(255,247,220,.9), rgba(255,255,255,.84));
  border: 1px solid rgba(240,100,0,.18);
  border-radius: 14px;
}
.hotspot-evidence-list.is-observation-required {
  background: linear-gradient(135deg, rgba(255,238,181,.96), rgba(255,252,241,.9));
  border-color: rgba(240,100,0,.34);
  box-shadow: 0 8px 22px rgba(148,75,0,.08);
}
.hotspot-evidence-list > strong {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--tm-orange-deep);
  font-size: .84rem;
  letter-spacing: .04em;
}
.hotspot-evidence-list > strong em {
  color: #2f705b;
  font-size: .76rem;
  font-style: normal;
  letter-spacing: 0;
}
.hotspot-evidence-list > div { display: flex; flex-wrap: wrap; gap: 7px; }
.hotspot-evidence-list button {
  display: inline-flex;
  min-height: 44px;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px 6px 6px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(184,119,44,.2);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.3;
  cursor: zoom-in;
  text-align: left;
}
.hotspot-evidence-list button > span { display: inline-flex; align-items: center; gap: 7px; }
.hotspot-evidence-list button > small {
  color: #786c5d;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}
.hotspot-evidence-list button:hover,
.hotspot-evidence-list button:focus-visible,
.hotspot-evidence-list button.is-selected {
  background: #fff8df;
  border-color: rgba(240,100,0,.52);
  box-shadow: 0 0 0 2px rgba(240,100,0,.1);
}
.hotspot-evidence-list button.is-viewed:not(.is-selected) {
  color: #245f4d;
  background: #edf8f3;
  border-color: rgba(47,125,98,.34);
  box-shadow: inset 0 0 0 1px rgba(47,125,98,.05);
}
.hotspot-evidence-list button.is-viewed:not(.is-selected) > small { color: #2f705b; }
.hotspot-evidence-list button.is-attention-needed:not(.is-viewed) {
  color: #8a3d08;
  background: #fffaf0;
  border-color: rgba(240,100,0,.42);
}
.hotspot-evidence-list button.is-attention-needed:not(.is-viewed) > small { color: #a4490a; }
.hotspot-evidence-list button:focus-visible { outline: 2px solid var(--tm-orange-strong); outline-offset: 2px; }
.hotspot-evidence-list i {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--tm-orange-strong);
  border-radius: 50%;
  font-size: .7rem;
  font-style: normal;
}
.hotspot-evidence-list .is-guide i {
  color: #fff8df;
  background: #574936;
}
.hotspot-evidence-list .is-guide.is-viewed:not(.is-selected) i {
  color: #fff;
  background: #2f7d62;
}
.artwork-stage.is-active-hotspot-marker-hidden .hotspot.active {
  z-index: 4;
  opacity: 0;
  pointer-events: none;
}
.artwork-stage.is-active-hotspot-marker-hidden .hotspot.active::before {
  --hotspot-dot-size: 20px;
  background: rgba(255, 255, 255, .72);
  border-color: rgba(255, 226, 123, .95);
  animation: none;
}
.artwork-stage.is-active-hotspot-marker-hidden .hotspot.active::after {
  opacity: 0;
  animation: none;
}
@keyframes hotspot-breathe {
  0%, 100% { box-shadow: 0 0 0 5px rgba(255,244,198,.12), 0 6px 18px rgba(0,0,0,.2); transform: scale(.94); }
  50% { box-shadow: 0 0 0 13px rgba(255,233,142,.28), 0 7px 20px rgba(0,0,0,.2); transform: scale(1.1); }
}
@keyframes hotspot-focus-ring {
  0%, 100% { border-color: rgba(255,232,142,.28); transform: scale(.92); }
  50% { border-color: rgba(255,232,142,.6); transform: scale(1.08); }
}
.hotspot-panel { display: flex; min-height: 100%; flex-direction: column; }
.hotspot-panel h2 { font-family: var(--font-display); font-size: 1.8rem; }
.hotspot-student-text {
  line-height: 1.75;
  white-space: pre-line;
}
.mobile-hotspot-panel-toggle { display: none; }
.hotspot-sheet-content { display: contents; }
.hotspot-index { color: var(--gold-strong); font-size: .8rem; font-weight: 900; letter-spacing: .12em; }
.hotspot-zoom-preview {
  position: relative;
  display: grid;
  min-height: 210px;
  margin: 4px 0 12px;
  align-items: end;
  overflow: hidden;
  background-color: #1c1913;
  border: 1px solid rgba(246,219,122,.38);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), var(--shadow-soft);
}
.hotspot-focus-image {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--zoom-size, 230%);
  max-width: none;
  height: auto;
  transform: translate(calc(-1 * var(--zoom-x)), calc(-1 * var(--zoom-y)));
  pointer-events: none;
}
.hotspot-zoom-preview[data-focus-mode="whole"] .hotspot-focus-image {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
}
.hotspot-zoom-preview figcaption {
  position: relative;
  margin: 0;
  padding: 10px 12px;
  color: #fff8e3;
  background: linear-gradient(180deg, transparent, rgba(28,25,19,.78));
  font-size: .9rem;
  font-weight: 850;
}
.artwork-stage.is-focus-preview { display: grid; gap: 12px; width: 100%; padding: 12px; }
.artwork-chat-focus {
  width: 100%;
  min-height: clamp(320px, 52vh, 560px);
  margin: 0;
  background-color: #100e0b;
}
.artwork-chat-focus figcaption { display: grid; gap: 2px; }
.artwork-chat-focus figcaption span { color: #ffd98a; font-size: .74rem; letter-spacing: .08em; }
.artwork-chat-focus figcaption strong { font-size: 1rem; }
.focus-hotspot-switcher { display: grid; grid-template-columns: 1fr; gap: 8px; }
.focus-hotspot-switch {
  display: grid;
  min-width: 0;
  min-height: 62px;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 8px;
  color: #fff8e8;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
}
.focus-hotspot-switch > span { display: grid; width: 27px; height: 27px; place-items: center; color: #fff; background: var(--tm-orange-strong); border: 2px solid #ffe8a2; border-radius: 50%; font-size: .72rem; font-weight: 900; }
.focus-hotspot-switch small { overflow: hidden; font-size: .72rem; font-weight: 800; line-height: 1.35; text-overflow: ellipsis; }
.focus-hotspot-switch.is-viewed > span { color: var(--tm-orange-deep); background: #fffdf6; border-color: var(--tm-orange-strong); }
.focus-hotspot-switch.is-completed > span { background: #2f7d62; border-color: #e6f6ee; }
.focus-hotspot-switch.is-active { background: rgba(240,100,0,.2); border-color: rgba(255,216,138,.72); box-shadow: 0 0 0 2px rgba(240,100,0,.15); }
#hotspot-observation-panel { scroll-margin-top: 96px; }
#artwork-learning-view .topbar { position: relative; top: auto; }
.prompt-box { margin-top: 14px; padding: 14px; color: var(--ink-soft); background: var(--gold-pale); border-radius: 12px; line-height: 1.6; }
.spotlight-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  color: var(--gold-deep);
  background: linear-gradient(135deg, rgba(255,242,198,.9), rgba(255,255,255,.76));
  border: 1px solid rgba(255,138,0,.18);
  border-radius: 13px;
  font-size: .94rem;
  font-weight: 850;
  line-height: 1.5;
}
.spotlight-note.is-observation-lock {
  color: #783408;
  background: linear-gradient(135deg, #fff0b7, #fffaf0);
  border-color: rgba(240,100,0,.38);
  box-shadow: inset 4px 0 0 var(--tm-orange-strong);
}
.hotspot-bottom-sheet {
  overflow: auto;
  max-height: min(74vh, 760px);
  overscroll-behavior: contain;
  transition: max-height 240ms ease, transform 240ms ease, box-shadow 240ms ease, background 240ms ease;
}
.hotspot-action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.hotspot-action-row .btn.is-locked {
  color: #665b4f;
  background: #eee9df;
  border-color: #d8cfc1;
  box-shadow: none;
}
.hotspot-action-row .btn.is-locked:hover,
.hotspot-action-row .btn.is-locked:focus-visible {
  color: #7c3609;
  background: #fff2c9;
  border-color: var(--tm-orange);
}
.ai-discussion { display: grid; gap: 12px; margin-top: 16px; }
.ai-discussion.chat-mode {
  display: flex;
  min-height: min(66vh, 620px);
  flex: 1;
  flex-direction: column;
  margin-top: 0;
}
.chat-compact-head {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}
.chat-compact-head h2 { margin-bottom: 0; }
.chat-compact-head h2 {
  font-size: clamp(1.45rem, 2.3vw, 1.8rem);
  line-height: 1.15;
  text-wrap: balance;
}
.chat-hint-drawer {
  position: relative;
  flex: 0 0 auto;
  max-width: min(260px, 100%);
}
.starter-question-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.starter-question-drawer,
.observation-prompt-drawer {
  border: 1px solid rgba(255,138,0,.18);
  border-radius: 15px;
  background: rgba(255,248,224,.48);
}
.starter-question-drawer > .prompt-drawer-summary,
.observation-prompt-drawer > .prompt-drawer-summary {
  width: 100%;
}
.starter-question-drawer > .starter-question-list {
  padding: 0 10px 10px;
}
.observation-prompt-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}
.observation-prompt-body .prompt-box { margin-top: 0; }
.observation-prompt-body .prompt-box p { margin: 5px 0 0; }
.starter-question {
  min-height: 30px;
  padding: 5px 8px;
  color: var(--gold-deep);
  background: rgba(255,248,224,.82);
  border: 1px solid rgba(181,125,5,.2);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
}
.starter-question:hover,
.starter-question:focus-visible {
  background: var(--gold-pale);
  border-color: rgba(181,125,5,.42);
  outline: 3px solid rgba(181,125,5,.16);
}
.chat-hint-drawer summary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  color: var(--gold-deep);
  list-style: none;
  background: rgba(255,242,198,.82);
  border: 1px solid rgba(255,138,0,.22);
  border-radius: 999px;
  box-shadow: inset 0 1px rgba(255,255,255,.9);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 900;
}
.prompt-drawer-summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  color: var(--gold-deep);
  background: rgba(255,242,198,.82);
  border: 1px solid rgba(255,138,0,.22);
  border-radius: 14px;
  box-shadow: inset 0 1px rgba(255,255,255,.9);
  list-style: none;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 900;
}
.prompt-drawer-summary::-webkit-details-marker { display: none; }
.prompt-drawer-arrow {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  color: var(--tm-orange-deep);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,138,0,.2);
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 180ms ease, background 180ms ease;
}
details[open] > .prompt-drawer-summary .prompt-drawer-arrow {
  background: rgba(255,242,198,.96);
  transform: rotate(180deg);
}
.chat-hint-drawer summary::-webkit-details-marker { display: none; }
.chat-hint-drawer[open] summary { border-radius: 16px 16px 0 0; }
.chat-hint-body {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  z-index: 5;
  width: min(300px, 72vw);
  padding: 12px;
  color: var(--ink-soft);
  background: rgba(255,253,247,.96);
  border: 1px solid rgba(255,138,0,.22);
  border-radius: 16px 0 16px 16px;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.chat-hint-body p { margin: 0; line-height: 1.5; }
.chat-hint-body p + p { margin-top: 8px; }
.chat-hint-body strong { display: block; color: var(--gold-deep); font-size: .78rem; }
.chat-gate-note {
  margin: 0;
  padding: 8px 10px;
  color: var(--gold-deep);
  background: rgba(255,242,198,.78);
  border: 1px dashed rgba(255,138,0,.28);
  border-radius: 12px;
  font-size: .92rem;
  font-weight: 800;
}
.chat-gate-note-top {
  margin-bottom: 0;
  font-size: .8rem;
  line-height: 1.45;
}
.hotspot-status-grid {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}
.hotspot-status-grid.has-completion {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}
.hotspot-status-grid .hotspot-completion-signal,
.hotspot-status-grid .chat-gate-note {
  height: 100%;
  box-sizing: border-box;
  font-size: .8rem;
  line-height: 1.45;
}
.hotspot-completion-signal {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 9px 11px;
  color: #2f6d4d;
  background:
    linear-gradient(135deg, rgba(235,247,240,.94), rgba(255,242,198,.88));
  border: 2px solid rgba(74,135,98,.34);
  border-radius: 13px;
  box-shadow: 0 12px 32px rgba(47,109,77,.18), 0 0 0 4px rgba(255,214,66,.12);
  font-size: .93rem;
  font-weight: 900;
}
.hotspot-completion-signal span {
  min-width: 0;
  white-space: normal;
}
.hotspot-completion-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  gap: 10px;
  align-items: stretch;
  margin-top: 2px;
}
.hotspot-completion-action-row .hotspot-completion-signal {
  height: 100%;
  box-sizing: border-box;
  font-size: .8rem;
  line-height: 1.45;
}
.hotspot-completion-action-row .btn {
  min-width: 170px;
  margin: 0;
}
.status-light-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: #fff;
  filter: drop-shadow(0 5px 10px rgba(47,109,77,.26));
}
.status-light-glow {
  fill: rgba(59,151,100,.18);
  animation: status-light-breathe 1.7s ease-in-out infinite;
  transform-origin: center;
}
.status-light-core {
  fill: #3b9764;
}
@keyframes status-light-breathe {
  0%, 100% { opacity: .72; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.08); }
}
.conversation-thread {
  display: flex;
  max-height: 280px;
  flex-direction: column;
  gap: 10px;
  align-content: start;
  overflow: auto;
  overflow-anchor: auto;
  scroll-behavior: smooth;
  scroll-padding-block: 14px;
  padding: 12px;
  background: rgba(255,255,255,.56);
  border: 1px solid rgba(255,138,0,.14);
  border-radius: 18px;
}
.conversation-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(166,76,0,.08);
}
.conversation-message > span { display: block; margin-bottom: 4px; color: var(--gold-deep); font-size: .78rem; font-weight: 850; }
.conversation-message p {
  margin: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.conversation-message.from-student { align-self: flex-end; justify-self: end; background: #fff2c6; }
.conversation-message.from-ai { align-self: flex-start; justify-self: start; background: rgba(255,255,255,.9); }
.chat-mode .conversation-message {
  max-width: 94%;
  padding: 15px 17px;
  border-radius: 19px;
}
.chat-mode .conversation-message > span { margin-bottom: 6px; font-size: .84rem; }
.chat-mode .conversation-message p { font-size: 1.06rem; line-height: 1.72; }
.conversation-message.is-optimistic { flex: 0 0 auto; overflow: visible; border: 1px solid rgba(240,100,0,.2); animation: none !important; opacity: 1 !important; transform: none !important; }
.message-delivery-state { margin-left: 7px; color: #28725a; font-size: .72rem; font-weight: 900; }
.conversation-message.is-ai-pending {
  min-width: min(290px, 88%);
  flex: 0 0 auto;
  border: 1px dashed rgba(240,100,0,.26);
  box-shadow: 0 8px 20px rgba(166,76,0,.05);
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.ai-pending-copy { display: flex; min-height: 28px; gap: 9px; align-items: center; color: var(--ink-soft); }
.ai-pending-copy > span { margin: 0; }
.conversation-message:not(.conversation-empty) { animation: surface-in 240ms cubic-bezier(.2,.8,.2,1) both; }
.view-shell.is-stable-update .conversation-message:not(.conversation-empty) { animation: none; }
.view-shell.is-stable-update .conversation-message.is-optimistic,
.view-shell.is-stable-update .conversation-message.is-ai-pending { animation: none; }
.ai-loading-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0 12px;
  padding: 9px 12px;
  color: var(--gold-deep);
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,138,0,.16);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(166,76,0,.1), inset 0 1px rgba(255,255,255,.9);
  font-size: .82rem;
  font-weight: 900;
}
.ai-loading-inline {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-weight: 850;
}
.ai-loading-inline > span {
  display: inline-flex;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.ai-loading-orb {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: radial-gradient(circle, #fff8d8 0 22%, var(--tm-yellow) 42%, var(--tm-orange) 100%);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255,138,0,.12), 0 0 18px rgba(255,138,0,.32);
  animation: ai-loading-pulse 1s ease-in-out infinite;
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 22px;
}
.typing-dots i {
  width: 7px;
  height: 7px;
  background: var(--gold-strong);
  border-radius: 50%;
  animation: typing-dots 900ms ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 120ms; }
.typing-dots i:nth-child(3) { animation-delay: 240ms; }
@keyframes typing-dots {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-4px); opacity: 1; }
}
@keyframes ai-loading-pulse {
  0%, 100% { transform: scale(.86); opacity: .72; }
  50% { transform: scale(1.1); opacity: 1; }
}
@keyframes ai-loading-sweep {
  0% { transform: translateX(-100%); opacity: .25; }
  45%, 70% { opacity: 1; }
  100% { transform: translateX(100%); opacity: .25; }
}
.conversation-empty {
  width: 100%;
  max-width: 100%;
  padding: 16px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,.95), transparent 16rem),
    rgba(255,255,255,.82);
}
.chat-mode .conversation-thread {
  min-height: 0;
  max-height: none;
  flex: 1;
}
.hotspot-chat-form textarea { min-height: 76px; resize: vertical; }
.chat-composer {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(255,138,0,.16);
  border-radius: 18px;
}
.chat-composer:focus-within {
  border-color: rgba(255,138,0,.36);
  box-shadow: 0 0 0 4px rgba(255,138,0,.16);
}
.chat-composer input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
}
.mic-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--gold-deep);
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.9), rgba(255,225,138,.78));
  border: 1px solid rgba(255,138,0,.18);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(166,76,0,.13), inset 0 1px rgba(255,255,255,.85);
  cursor: pointer;
  font-size: 1.1rem;
}
.mic-icon:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(166,76,0,.18), inset 0 1px rgba(255,255,255,.9); }
.send-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-strong));
  border: 0;
  border-radius: 50%;
  box-shadow: 0 10px 20px rgba(166,76,0,.22), inset 0 1px rgba(255,255,255,.5);
  cursor: pointer;
}
.voice-composer {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,138,0,.14);
  border-radius: 16px;
}
.voice-status { color: var(--ink-muted); line-height: 1.45; }

.robot-chat-layout, .guide-chat-layout { display: grid; grid-template-columns: minmax(190px, .35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.robot-avatar {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: 0;
  padding: 18px;
  text-align: center;
  background: radial-gradient(circle at 35% 20%, rgba(255,255,255,.95), rgba(255,214,66,.25));
  border: 1px solid rgba(255,138,0,.18);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
}
.robot-avatar img {
  width: min(220px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(166,76,0,.18));
}
.robot-avatar figcaption { color: var(--gold-deep); font-weight: 900; }
.stand-guide { position: sticky; top: 110px; }
.robot-speech {
  position: relative;
  padding: 13px 14px;
  color: var(--ink-soft);
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,138,0,.16);
  border-radius: 18px;
  line-height: 1.55;
  text-align: left;
}
.robot-speech::before {
  position: absolute;
  top: -9px;
  left: 42%;
  width: 16px;
  height: 16px;
  content: "";
  background: inherit;
  border-top: 1px solid rgba(255,138,0,.16);
  border-left: 1px solid rgba(255,138,0,.16);
  transform: rotate(45deg);
}
.full-chat-panel {
  display: grid;
  min-height: min(70vh, 720px);
  gap: 14px;
  align-content: start;
  background:
    linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,245,214,.86));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.95);
}
.full-chat-panel .conversation-thread {
  min-height: 340px;
  max-height: 48vh;
  background:
    radial-gradient(circle at 16% 0%, rgba(255,255,255,.9), transparent 18rem),
    rgba(255,255,255,.62);
}
.guide-system-note {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  color: var(--ink-soft);
  background: rgba(255,242,198,.82);
  border: 1px solid rgba(255,138,0,.22);
  border-radius: 16px;
  line-height: 1.5;
}
.guide-system-note strong { color: var(--gold-deep); }
.open-chat-composer { position: sticky; bottom: 0; z-index: 2; }

.reflection-grid, .summary-grid, .teacher-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.reflection-card { display: grid; gap: 14px; }
.reflection-card img { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: 13px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip { position: relative; }
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip span {
  display: inline-flex;
  min-height: 46px;
  padding: 10px 14px;
  align-items: center;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 750;
}
.choice-chip input:checked + span { color: #fff; background: var(--gold-strong); border-color: var(--gold-strong); }
.choice-chip input:focus-visible + span { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.light-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.light-choice-card { position: relative; min-width: 0; }
.light-choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.light-choice-card span {
  display: grid;
  min-height: 78px;
  gap: 5px;
  padding: 12px;
  align-content: center;
  color: var(--ink-soft);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 15px;
  cursor: pointer;
}
.light-choice-card strong { font-size: .98rem; }
.light-choice-card small { color: var(--ink-muted); line-height: 1.4; }
.light-choice-card input:checked + span { color: #fff; background: var(--gold-strong); border-color: var(--gold-strong); box-shadow: 0 8px 18px rgba(166,76,0,.16); }
.light-choice-card input:checked + span small { color: rgba(255,255,255,.86); }
.light-choice-card input:focus-visible + span { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.creation-mode-grid, .filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.creation-mode-card, .filter-card, .quote-card, .mini-choice, .sticker-element-choice { position: relative; min-width: 0; }
.creation-mode-card input, .filter-card input, .quote-card input, .mini-choice input, .sticker-element-choice input { position: absolute; opacity: 0; pointer-events: none; }
.creation-mode-card span, .filter-card span, .quote-card span, .mini-choice span, .sticker-element-choice span {
  display: grid;
  min-height: 78px;
  gap: 5px;
  padding: 13px;
  align-content: center;
  color: var(--ink-soft);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 15px;
  cursor: pointer;
}
.creation-mode-card span { min-height: 142px; align-content: start; }
.creation-mode-card strong, .filter-card strong, .sticker-element-choice strong { font-size: 1rem; }
.creation-mode-card small, .filter-card small, .sticker-element-choice small { color: var(--ink-muted); line-height: 1.45; }
.creation-mode-card em { color: var(--gold-deep); font-size: .78rem; font-style: normal; font-weight: 850; }
.mode-badge { display: inline-grid; width: 28px; height: 28px; place-items: center; color: #fff !important; background: var(--gold-strong); border-radius: 50%; font-weight: 900; }
.creation-mode-card input:checked + span, .filter-card input:checked + span, .quote-card input:checked + span, .mini-choice input:checked + span, .sticker-element-choice input:checked + span { color: #fff; background: var(--gold-strong); border-color: var(--gold-strong); box-shadow: 0 8px 18px rgba(166,76,0,.16); }
.creation-mode-card input:checked + span small, .filter-card input:checked + span small, .sticker-element-choice input:checked + span small { color: rgba(255,255,255,.86); }
.creation-mode-card input:checked + span em { color: rgba(255,255,255,.88); }
.creation-mode-card input:focus-visible + span, .filter-card input:focus-visible + span, .quote-card input:focus-visible + span, .mini-choice input:focus-visible + span, .sticker-element-choice input:focus-visible + span { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.style-filter-card span {
  min-height: 154px;
  padding: 10px;
  align-content: start;
  overflow: hidden;
}
.style-filter-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 68px;
  margin-bottom: 4px;
  overflow: hidden;
  background: #2d241f;
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.style-filter-preview::before,
.style-filter-preview::after {
  position: absolute;
  content: "";
  pointer-events: none;
}
.style-filter-preview::before {
  inset: 12px 30%;
  border-radius: 50%;
  background: #d6a26d;
}
.style-filter-triangle_light .style-filter-preview {
  background: linear-gradient(90deg, #f7b15c 0 38%, #2a1510 52% 100%);
}
.style-filter-triangle_light .style-filter-preview::before {
  background: linear-gradient(90deg, #ffcf84 0 47%, #2a1510 48% 100%);
  box-shadow: -18px 0 34px rgba(255,170,67,.7);
}
.style-filter-triangle_light .style-filter-preview::after {
  top: 35px;
  left: 51%;
  width: 16px;
  height: 13px;
  background: #f7c578;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 0 6px rgba(255,201,118,.7));
}
.style-filter-claude_glass .style-filter-preview {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255,213,127,.95) 0 12%, rgba(122,143,111,.84) 30%, rgba(19,35,37,.94) 66%, #050a0b 100%);
  box-shadow: inset 0 0 24px 11px rgba(0,0,0,.82), inset 0 0 0 1px rgba(255,224,158,.28);
}
.style-filter-claude_glass .style-filter-preview::before {
  inset: 18px 25%;
  background: linear-gradient(165deg, rgba(255,255,255,.5), transparent 42%);
  border: 1px solid rgba(255,226,173,.35);
  box-shadow: 0 0 26px rgba(255,211,121,.36);
}
.style-filter-gilded_edge_light .style-filter-preview {
  background: radial-gradient(circle, #3a2516 12%, #100906 74%);
}
.style-filter-gilded_edge_light .style-filter-preview::before {
  inset: 10px 27%;
  background: #2f211a;
  border: 4px solid #ffd56a;
  box-shadow: 0 0 9px #ffae1a, 0 0 22px rgba(255,153,0,.8), inset 0 0 14px rgba(255,190,62,.42);
}
.style-filter-card em {
  justify-self: start;
  padding: 3px 7px;
  color: #9b3d00;
  background: #fff0b4;
  border-radius: 999px;
  font-size: .7rem;
  font-style: normal;
  font-weight: 950;
}
.style-filter-card input:checked + span .style-filter-preview {
  box-shadow: 0 0 0 2px rgba(255,255,255,.92), 0 8px 20px rgba(65,24,0,.28);
}
.style-filter-card input:checked + span em {
  color: #7d2f00;
  background: #fff1a9;
}
.social-play-page { position: relative; overflow: hidden; }
.social-play-page::before { position: absolute; top: -6rem; right: -4rem; width: 16rem; height: 16rem; content: ""; border: 1px solid rgba(255,138,0,.18); border-radius: 50%; box-shadow: 0 0 0 24px rgba(255,214,66,.08), 0 0 0 48px rgba(255,138,0,.06); pointer-events: none; }
#social-upload-view .topbar,
#social-config-view .topbar,
#social-confirm-view .topbar,
#social-generation-loading-view .topbar,
#social-generation-result-view .topbar { position: relative; top: auto; }
.certificate-extension-panel { display: grid; gap: 10px; margin: 28px auto 0; padding: 22px; max-width: 820px; text-align: left; background: linear-gradient(135deg, rgba(255,246,218,.9), rgba(255,255,255,.8)); border: 1px solid rgba(255,138,0,.2); border-radius: 20px; }
.certificate-extension-panel h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.2rem); }
.certificate-extension-panel p { margin: 0; color: var(--ink-muted); line-height: 1.6; }
.certificate-play-card { display: grid; min-height: 142px; gap: 7px; padding: 16px; align-content: start; color: var(--ink); text-align: left; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.certificate-play-card:hover { transform: translateY(-3px); border-color: rgba(255,138,0,.5); box-shadow: var(--shadow-soft); }
.certificate-play-card strong { font-size: 1.05rem; }
.certificate-play-card small { color: var(--ink-muted); line-height: 1.45; }
.certificate-play-card:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.mode-panel { display: grid; gap: 16px; padding: 18px; background: rgba(255,246,218,.72); border: 1px solid rgba(255,138,0,.2); border-radius: 18px; }
.mode-panel-heading { display: grid; gap: 4px; }
.mode-panel-heading strong { font-size: 1.15rem; }
.mode-panel-heading small { color: var(--ink-muted); line-height: 1.5; }
.quote-grid { display: grid; gap: 8px; }
.quote-card span { min-height: 54px; padding: 11px 13px; font-weight: 750; }
.quote-input { width: 100%; min-height: 50px; padding: 12px 14px; color: var(--ink); background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 13px; }
.subject-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-choice span { min-height: 48px; place-items: center; padding: 9px; font-weight: 800; }
.sticker-element-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sticker-element-choice span { min-height: 66px; }
.sticker-element-choice[hidden] { display: none; }
.sticker-element-choice input:disabled + span { color: rgba(45,36,28,.48); background: rgba(255,255,255,.58); cursor: not-allowed; box-shadow: none; }
.sticker-pack-hint, .sticker-selection-status { margin: 9px 2px 0; color: var(--ink-muted); font-size: .9rem; font-weight: 750; line-height: 1.5; }
.sticker-pack-hint { padding: 10px 12px; color: var(--gold-deep); background: rgba(255,255,255,.72); border-left: 3px solid var(--tm-orange); border-radius: 0 12px 12px 0; }
.sticker-selection-status { min-height: 1.5em; }

.loading-stage { display: grid; min-height: 600px; place-items: center; text-align: center; }
.loading-stage > div { width: min(100%, 760px); margin: 0 auto; text-align: center; }
.loading-stage .hero-lead { margin-right: auto; margin-left: auto; text-align: center; }
.loading-status-row { display: inline-flex; max-width: 100%; align-items: center; gap: 9px; margin: 14px auto 18px; padding: 10px 14px; color: var(--gold-deep); background: rgba(255,255,255,.76); border: 1px solid rgba(255,138,0,.18); border-radius: 999px; box-shadow: 0 10px 24px rgba(166,76,0,.08); font-size: .9rem; font-weight: 850; }
.loading-orbit { position: relative; width: 120px; height: 120px; margin: 0 auto 28px; border: 1px solid rgba(255,138,0,.24); border-radius: 50%; }
.loading-orbit::before, .loading-orbit::after { position: absolute; content: ""; border-radius: 50%; }
.loading-orbit::before { inset: 16px; border: 2px solid transparent; border-top-color: var(--gold-strong); animation: spin 1.5s linear infinite; }
.loading-orbit::after { top: -6px; left: 50%; width: 12px; height: 12px; background: var(--gold-primary); box-shadow: 0 0 20px var(--gold-primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-steps { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; color: var(--ink-muted); }
.loading-steps span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; background: rgba(255,255,255,.7); border-radius: 999px; animation: loading-step-breathe 1.8s ease-in-out infinite; animation-delay: calc(var(--step-index, 0) * 180ms); }
.loading-step i { display: grid; width: 20px; height: 20px; place-items: center; color: #fff; background: var(--tm-orange); border-radius: 50%; font-size: .72rem; font-style: normal; font-variant-numeric: tabular-nums; }
@keyframes loading-step-breathe { 0%, 100% { opacity: .64; transform: translateY(0); } 45% { opacity: 1; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(166,76,0,.12); } }

.summary-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .42fr); gap: 18px; margin-bottom: 18px; }
.summary-title { font-size: clamp(2.25rem, 6vw, 4.7rem); }
.summary-hero-refined .panel {
  display: grid;
  align-content: center;
  min-height: 250px;
}
.summary-hero-refined .summary-title {
  font-size: clamp(2.05rem, 5.2vw, 4rem);
}
.title-medallion { position: relative; display: grid; min-height: 230px; padding: 42px 28px; place-content: center; text-align: center; background: radial-gradient(circle, rgba(255,250,240,.78) 0 45%, rgba(255,138,0,.13) 70%); border-radius: 30px; box-shadow: inset 0 0 28px rgba(166,76,0,.08), var(--shadow-soft); overflow: hidden; }
.title-medallion > div { position: relative; z-index: 1; }
.badge-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 18px 30px rgba(166,76,0,.18));
}
.title-medallion strong { display: block; font-family: var(--font-display); font-size: clamp(1.55rem, 3vw, 2.25rem); }
.title-medallion small { display: block; margin-top: 8px; color: var(--ink-soft); line-height: 1.55; }
.metric-card, .stat-card { padding: 18px; background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: var(--radius-md); }
.metric-card strong, .stat-card strong { display: block; margin-bottom: 4px; color: var(--gold-deep); font-family: var(--font-display); font-size: 2rem; }
.metric-card span, .stat-card span { color: var(--ink-muted); font-size: .88rem; }
.summary-insight-stack {
  display: grid;
  gap: 16px;
}
.summary-support-grid,
.summary-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 16px;
  align-items: stretch;
}
.summary-evaluation-card {
  display: grid;
  align-content: center;
  min-height: 270px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255,255,255,.96), transparent 18rem),
    linear-gradient(135deg, rgba(255,253,247,.96), rgba(250,239,207,.66));
}
.summary-evaluation-text {
  max-width: 42rem;
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 2.25rem);
  line-height: 1.45;
}
.summary-focus-card,
.summary-next-card {
  min-height: 0;
}
.summary-focus-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: clamp(18px, 4vw, 38px);
  align-items: center;
  background:
    radial-gradient(circle at 0% 0%, rgba(255,214,66,.18), transparent 18rem),
    linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,244,213,.76));
}
.summary-focus-overview h2 {
  max-width: 42rem;
  margin-bottom: 8px;
}
.focus-donut {
  position: relative;
  display: grid;
  width: min(240px, 58vw);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  background: var(--focus-pie);
  border-radius: 50%;
  box-shadow: 0 20px 40px rgba(166,76,0,.16);
}
.focus-donut::after {
  position: absolute;
  inset: 28px;
  content: "";
  background: rgba(255,253,247,.96);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,138,0,.12);
}
.focus-donut-center {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--gold-deep);
}
.focus-donut-center strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}
.focus-donut-center span {
  color: var(--ink-muted);
  font-size: .84rem;
  font-weight: 900;
}
.focus-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.focus-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,138,0,.13);
  border-radius: 14px;
}
.focus-legend-item span {
  width: 12px;
  height: 12px;
  background: var(--tm-orange);
  border-radius: 50%;
}
.focus-legend-item[data-focus="light"] span { background: var(--tm-yellow); }
.focus-legend-item[data-focus="material"] span { background: var(--tm-orange); }
.focus-legend-item[data-focus="composition"] span { background: var(--tm-pink); }
.focus-legend-item[data-focus="symbol"] span { background: #18b99b; }
.focus-legend-item strong { min-width: 0; }
.focus-legend-item em {
  color: var(--gold-deep);
  font-style: normal;
  font-weight: 900;
}
.focus-bars { display: grid; gap: 12px; }
.focus-row { display: grid; grid-template-columns: 4.5rem 1fr 3rem; gap: 10px; align-items: center; }
.focus-row i { display: block; width: var(--value); height: 9px; background: linear-gradient(90deg, var(--tm-yellow), var(--tm-orange), var(--tm-pink)); border-radius: 999px; }
.focus-row .bar { overflow: hidden; background: rgba(120,83,18,.1); border-radius: 999px; }
.clean-list { display: grid; gap: 10px; margin: 0; padding-left: 1.2rem; color: var(--ink-soft); line-height: 1.55; }
.element-card { display: grid; gap: 6px; min-width: 190px; padding: 14px; background: #fff5d8; border: 1px solid var(--line); border-radius: 13px; }
.element-card small { color: var(--ink-muted); line-height: 1.45; }

.upload-zone { position: relative; display: grid; min-height: 260px; padding: 28px; place-items: center; text-align: center; background: rgba(255,246,218,.82); border: 2px dashed rgba(255,138,0,.36); border-radius: var(--radius-lg); cursor: pointer; overflow: hidden; transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease; }
.upload-zone::before { position: absolute; inset: -40% 38% auto -20%; height: 180%; content: ""; background: linear-gradient(100deg, transparent, rgba(255,255,255,.54), transparent); transform: rotate(18deg) translateX(-130%); pointer-events: none; }
.upload-zone:hover { border-color: rgba(255,138,0,.62); box-shadow: 0 16px 34px rgba(166,76,0,.12); transform: translateY(-1px); }
.upload-zone:focus-within { border-color: var(--gold-strong); box-shadow: 0 0 0 4px rgba(255,138,0,.18), 0 16px 34px rgba(166,76,0,.12); outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.upload-zone.is-processing { cursor: wait; background: linear-gradient(135deg, rgba(255,242,198,.96), rgba(255,255,255,.88)); border-style: solid; }
.upload-zone.is-processing::before { animation: upload-zone-glint 1.8s ease-in-out infinite; }
.upload-zone-icon, .upload-preview-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 10px; place-items: center; color: var(--tm-orange); background: rgba(255,255,255,.72); border: 1px solid rgba(255,138,0,.24); border-radius: 16px; font-size: 1.5rem; box-shadow: 0 8px 20px rgba(166,76,0,.1); }
.upload-zone.is-processing .upload-zone-icon { animation: upload-icon-breathe 1.1s ease-in-out infinite; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-preview, .result-image, .certificate-preview { width: 100%; max-height: 680px; object-fit: contain; background: #1c1913; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.upload-preview-placeholder { display: grid; min-height: 260px; padding: 24px; place-items: center; align-content: center; gap: 8px; color: var(--ink-muted); text-align: center; background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,246,218,.86)); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.upload-preview-placeholder .upload-preview-icon { color: var(--gold-deep); }
.upload-preview-placeholder.is-processing { color: var(--gold-deep); }
.upload-preview-placeholder.is-processing strong { font-size: 1.05rem; }
.upload-preview-placeholder small { color: var(--ink-muted); }
.upload-status-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; width: min(100%, 360px); margin: 16px auto 0; padding: 12px 14px; text-align: left; background: rgba(255,255,255,.78); border: 1px solid rgba(255,138,0,.2); border-radius: 16px; box-shadow: 0 10px 24px rgba(166,76,0,.1); }
.upload-status-orb, .loading-status-orb { display: inline-block; width: 14px; height: 14px; flex: 0 0 auto; background: radial-gradient(circle, #fff8d8 0 22%, var(--tm-yellow) 42%, var(--tm-orange) 100%); border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,138,0,.12), 0 0 18px rgba(255,138,0,.32); animation: ai-loading-pulse 1s ease-in-out infinite; }
.upload-status-copy { display: grid; min-width: 0; gap: 3px; }
.upload-status-copy strong, .upload-status-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-status-copy strong { color: var(--gold-deep); font-size: .9rem; }
.upload-status-copy span { color: var(--ink-muted); font-size: .76rem; }
.upload-progress-bar { grid-column: 1 / -1; width: 100%; height: 6px; border: 0; border-radius: 999px; accent-color: var(--tm-orange); }
.upload-progress-bar::-webkit-progress-bar { background: rgba(255,138,0,.14); border-radius: inherit; }
.upload-progress-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--tm-yellow), var(--tm-orange), var(--tm-pink)); border-radius: inherit; }
@keyframes upload-zone-glint { 0% { transform: rotate(18deg) translateX(-130%); } 55%, 100% { transform: rotate(18deg) translateX(260%); } }
@keyframes upload-icon-breathe { 0%, 100% { transform: scale(.94); } 50% { transform: scale(1.06); } }
.two-column { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); gap: 18px; }
.choice-group { display: grid; gap: 10px; }
.choice-group fieldset,
fieldset.choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }

.creation-flow {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(340px, 1fr);
  gap: 18px;
  align-items: start;
}
.creation-preview-card {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
  text-align: center;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.creation-preview-card .upload-preview { max-height: min(48vh, 520px); background: #fff5d8; }
.creation-preview-card figcaption { color: var(--ink-muted); font-weight: 750; line-height: 1.45; }
.creation-main-card {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
  background:
    linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,245,214,.84));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.creation-step-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px 16px 16px 54px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,138,0,.14);
  border-radius: 18px;
}
.creation-step-card.primary-step { background: rgba(255,242,198,.84); }
.creation-step-card textarea { min-height: 108px; resize: vertical; }
.creation-step-card legend { position: relative; min-height: 28px; padding: 0 0 0 38px; color: var(--ink); font-weight: 800; }
.creation-step-card legend .step-dot { top: -2px; left: 0; }
.choice-guidance {
  margin: 0;
  padding: 10px 12px;
  color: var(--gold-deep);
  background: rgba(255,242,198,.56);
  border-left: 3px solid var(--tm-orange-strong);
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.55;
}
.step-dot {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-strong));
  border-radius: 50%;
  font-weight: 900;
  box-shadow: 0 9px 18px rgba(166,76,0,.18);
}
.advanced-creation-options {
  overflow: hidden;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,138,0,.14);
  border-radius: 18px;
}
.advanced-creation-options summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: var(--gold-deep);
  cursor: pointer;
  font-weight: 900;
}
.advanced-creation-options summary::after {
  content: "＋";
  font-size: 1.2rem;
}
.advanced-creation-options[open] summary::after { content: "–"; }
.advanced-creation-body {
  display: grid;
  gap: 16px;
  padding: 0 16px 16px;
}
.ai-element-strip {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,138,0,.14);
  border-radius: 18px;
}
.compact-sentence {
  padding: 0;
  background: transparent;
}
.compact-sentence textarea {
  min-height: 86px;
  resize: vertical;
}
.creation-actions { margin-top: 2px; }
.generation-confirm-summary {
  font-size: 1.12rem;
  line-height: 1.65;
}
.generation-confirm-summary strong { font-size: 1.05em; }

.generation-grid, .library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.generation-card { overflow: hidden; background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.generation-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.generation-card-body { padding: 18px; }
.selected-generation { border: 3px solid var(--gold-primary); }
.social-library-saved {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  color: #176744;
  background: linear-gradient(135deg, rgba(218,249,229,.96), rgba(255,250,207,.92));
  border-color: rgba(42,143,91,.28);
}
.social-library-saved strong { font-size: 1.02rem; }
.library-social-section {
  padding: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,181,59,.2), transparent 34%),
    rgba(255,249,233,.74);
  border: 1px solid rgba(255,138,0,.2);
  border-radius: 20px;
}
.library-social-card img { aspect-ratio: 1 / 1; object-fit: cover; }

.certificate-wrap { padding: clamp(12px, 3vw, 26px); text-align: center; }
.certificate-preview { aspect-ratio: 4 / 3; margin: 0 auto 20px; background: #f8f0df; }

.teacher-view-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,138,0,.14);
  border-radius: 16px;
}
.teacher-view-tab {
  min-height: 42px;
  padding: 0 14px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}
.teacher-view-tab:hover { transform: translateY(-1px); background: rgba(255,242,198,.82); }
.teacher-view-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--tm-orange), var(--tm-orange-strong));
  box-shadow: 0 10px 22px rgba(255,100,0,.2);
}
.teacher-view-tab span {
  display: inline-grid;
  min-width: 1.7em;
  height: 1.7em;
  margin-left: 6px;
  place-items: center;
  color: inherit;
  background: rgba(255,255,255,.2);
  border-radius: 999px;
  font-size: .78rem;
}
.teacher-overview-note { margin-top: 18px; }
.teacher-toolbar { display: grid; grid-template-columns: 1fr 220px auto; gap: 10px; margin-bottom: 16px; }
.teacher-export-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.teacher-list { display: grid; gap: 10px; }
.teacher-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(5, minmax(90px, .6fr)) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.teacher-row > * { min-width: 0; }
.teacher-row > :first-child { overflow-wrap: anywhere; word-break: break-word; }
.teacher-row:hover {
  transform: translateY(-1px);
  border-color: rgba(255,138,0,.24);
  box-shadow: 0 12px 28px rgba(166,76,0,.1);
}
.teacher-row small { color: var(--ink-muted); }
.teacher-row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.teacher-row-actions .btn { min-height: 38px; padding-inline: 12px; }
.teacher-detail { margin-top: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.teacher-media-section { display: grid; gap: 14px; }
.teacher-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.teacher-media-card {
  min-width: 0;
  overflow: hidden;
  background: rgba(255,255,255,.84);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(98,48,10,.08);
}
.teacher-media-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f6eedf; }
.teacher-media-card > div { display: grid; gap: 7px; padding: 13px; }
.teacher-media-card p { margin: 0; line-height: 1.5; }
.teacher-media-card small { color: var(--ink-muted); }
.teacher-artwork-summaries, .teacher-conversation-records { display: grid; gap: 12px; }
.teacher-artwork-summary, .teacher-open-summary { padding: 16px; background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 14px; }
.teacher-artwork-summary h3, .teacher-conversation-records h2 { margin: 0; }
.teacher-summary-text { margin: 8px 0 0; white-space: pre-wrap; line-height: 1.7; color: var(--ink); }
.teacher-transcript-details { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.68); overflow: hidden; }
.teacher-transcript-details summary { cursor: pointer; padding: 14px 16px; font-weight: 800; color: var(--accent-deep); }
.teacher-transcript { margin: 0; padding: 16px; max-height: 520px; overflow: auto; white-space: pre-wrap; font: inherit; line-height: 1.65; color: var(--ink); border-top: 1px solid var(--line); }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.hidden { display: none !important; }
.muted { color: var(--ink-muted); }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.stack { display: grid; gap: 16px; }

/* Student experience: a calm museum field notebook with one clear action at a time. */
.student-entry-page {
  background:
    radial-gradient(circle at 12% 10%, rgba(255,255,255,.18), transparent 21rem),
    linear-gradient(118deg, #a83d00 0 58%, var(--tm-orange-strong) 58% 78%, var(--tm-orange) 100%);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 32px 82px rgba(166,76,0,.28);
}
.student-entry-page::before {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 100%;
  content: "";
  background: var(--tm-orange);
}
.student-entry-page::after { opacity: .45; }
.student-entry-page .role-entry-logo { padding: 10px 14px; background: rgba(255,255,255,.94); border-radius: 6px 18px 6px 18px; filter: none; }
.student-entry-page .role-entry-brand h1 { max-width: 8.5em; }
.student-entry-page .role-entry-form-card { background: #fffdf8; border-radius: 6px 24px 6px 24px; box-shadow: 0 26px 64px rgba(14,15,38,.25); }
.student-entry-page .role-entry-form-card .btn-primary { background: linear-gradient(135deg, var(--tm-orange-deep), var(--tm-orange-strong)); border-color: var(--tm-orange-deep); box-shadow: 0 12px 25px rgba(166,76,0,.24); }
.student-entry-steps { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 24px; color: rgba(255,255,255,.82); font-size: .88rem; font-weight: 900; }
.student-entry-steps span { padding: 8px 12px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; }
.student-entry-steps i { color: var(--tm-yellow); font-style: normal; }
.entry-form-help { margin: -4px 0 0; color: var(--ink-muted); font-size: .88rem; line-height: 1.5; }
.student-profile-page { background: #fffdf8; border-color: rgba(240,100,0,.14); backdrop-filter: none; -webkit-backdrop-filter: none; }
.student-profile-page .page-heading h1 { color: var(--foundation-blue); }
.optional-profile-fields { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #f7f2e9; }
.optional-profile-fields > summary { min-height: 48px; padding: 13px 15px; color: var(--foundation-blue); cursor: pointer; font-weight: 850; }
.optional-profile-fields-body { display: grid; gap: 14px; padding: 0 15px 15px; }

.student-task-map,
.student-artwork-page {
  background:
    linear-gradient(rgba(255,255,255,.95), rgba(255,253,248,.97)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(240,100,0,.045) 31px 32px);
  border-color: rgba(240,100,0,.13);
  box-shadow: 0 28px 72px rgba(126,59,10,.15);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.student-flow-strip {
  display: flex;
  gap: 0;
  margin: 0 0 32px;
  padding: 0;
  overflow-x: auto;
  color: var(--ink-muted);
  list-style: none;
  scrollbar-width: none;
}
.student-flow-strip::-webkit-scrollbar { display: none; }
.student-flow-strip li {
  position: relative;
  display: flex;
  min-width: 150px;
  flex: 1 0 150px;
  gap: 9px;
  align-items: center;
  padding-right: 28px;
  font-size: .88rem;
}
.student-flow-strip li::after {
  position: absolute;
  top: 17px;
  right: 12px;
  left: 48px;
  height: 2px;
  content: "";
  background: #ded9d0;
}
.student-flow-strip li:last-child::after { display: none; }
.student-flow-strip li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: #747a89;
  background: #f3efe7;
  border: 1px solid #d8d3ca;
  border-radius: 50%;
  font-weight: 900;
}
.student-flow-strip li > strong {
  position: relative;
  z-index: 2;
  padding: 2px 5px;
  white-space: nowrap;
  background: var(--surface, #fffaf4);
  border-radius: 6px;
}
.student-flow-strip li.is-complete { color: #28725a; }
.student-flow-strip li.is-complete > span { color: #fff; background: #28725a; border-color: #28725a; }
.student-flow-strip li.is-complete::after { background: linear-gradient(90deg, #28725a, #c9d9d2); }
.student-flow-strip li.is-current { color: var(--foundation-blue); }
.student-flow-strip li.is-current > span {
  color: #fff;
  background: var(--foundation-blue);
  border-color: var(--foundation-blue);
  box-shadow: 0 0 0 5px rgba(240,100,0,.12);
}

.task-map-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .55fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: end;
  margin-bottom: 22px;
}
.task-map-hero .page-heading { margin: 0; }
.task-map-hero .page-heading h1 {
  max-width: 12em;
  color: var(--foundation-blue);
  font-size: clamp(2.25rem, 5vw, 4.45rem);
  text-wrap: balance;
}
.task-map-score {
  position: relative;
  display: grid;
  min-height: 210px;
  gap: 8px;
  padding: 24px;
  align-content: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, var(--tm-orange-deep), #d65b00 62%, var(--tm-orange-strong));
  border-radius: 8px 28px 8px 28px;
  box-shadow: 0 20px 44px rgba(166,76,0,.24);
}
.task-map-score::after {
  position: absolute;
  right: -42px;
  bottom: -54px;
  width: 150px;
  aspect-ratio: 1;
  content: "";
  border: 18px solid rgba(255,255,255,.08);
  border-radius: 50%;
}
.task-map-score-label { color: rgba(255,255,255,.72); font-size: .82rem; font-weight: 800; letter-spacing: .08em; }
.task-map-score > strong { font-family: var(--font-display); font-size: 4rem; line-height: 1; }
.task-map-score > strong small { font-family: var(--font-body); font-size: 1rem; }
.task-map-score .progress-track { margin-top: 4px; background: rgba(255,255,255,.18); }
.task-map-score .progress-track > i { background: linear-gradient(90deg, var(--tm-yellow), var(--tm-orange)); }
.task-map-score p { position: relative; z-index: 1; margin: 4px 0 0; color: rgba(255,255,255,.82); font-size: .88rem; line-height: 1.55; }

.task-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8f4ec;
}
.task-rule-grid > div { display: flex; gap: 10px; align-items: center; padding: 15px 18px; }
.task-rule-grid > div + div { border-left: 1px solid var(--line); }
.task-rule-grid strong { color: var(--tm-orange-deep); font-family: var(--font-display); font-size: 1.5rem; }
.task-rule-grid span { color: var(--ink-soft); font-size: .88rem; font-weight: 800; }

.student-task-map .artwork-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.student-task-map .artwork-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, .84fr) minmax(0, 1.16fr);
  min-height: 310px;
  background: #fffdf8;
  border-color: rgba(240,100,0,.14);
  border-radius: 20px 5px 20px 5px;
  box-shadow: 0 12px 30px rgba(126,59,10,.1);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.student-task-map .artwork-card:hover { transform: translateY(-3px); border-color: rgba(255,138,0,.3); box-shadow: 0 18px 38px rgba(126,59,10,.15); }
.student-task-map .artwork-card.is-started { border-color: rgba(255,138,0,.38); }
.student-task-map .artwork-card.is-complete { border-color: rgba(40,114,90,.34); }
.student-task-map .artwork-card figure { height: 100%; min-height: 310px; aspect-ratio: auto; }
.student-task-map .artwork-card figure::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 48%, rgba(17,20,31,.62));
  pointer-events: none;
}
.student-task-map .artwork-card figure img { filter: saturate(.92) contrast(1.02); }
.artwork-card-number {
  position: absolute;
  left: 14px;
  bottom: 10px;
  z-index: 1;
  color: #fff;
  font-family: var(--font-display);
  font-size: 2.15rem;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.student-task-map .artwork-card-body { padding: 22px; }
.student-task-map .artwork-card h2 { color: var(--foundation-blue); font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.28; text-wrap: balance; }
.artwork-progress-summary { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; color: var(--ink-soft); font-size: .82rem; font-weight: 800; }
.artwork-progress-summary span { display: inline-flex; gap: 6px; align-items: center; }
.progress-dot { width: 9px; height: 9px; border-radius: 50%; }
.progress-dot.is-read { background: var(--tm-orange); }
.progress-dot.is-done { background: #28725a; }
.artwork-card-progress { margin: 14px 0 12px; }
.artwork-card-progress .progress-meta { font-size: .78rem; }
.student-task-map .artwork-card .btn-primary,
.student-artwork-page .btn-primary {
  background: linear-gradient(135deg, var(--tm-orange-deep), var(--tm-orange-strong));
  border-color: var(--tm-orange-deep);
  box-shadow: 0 10px 22px rgba(166,76,0,.2);
}
.student-task-map .artwork-card .btn-primary:hover,
.student-artwork-page .btn-primary:hover { background: var(--tm-orange-strong); }
.task-map-next {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: #f3eee4;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.task-map-next p { margin: 0; color: var(--ink-soft); line-height: 1.55; }

.artwork-page-topline { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; color: var(--ink-muted); font-size: .86rem; font-weight: 800; }
.back-link-button { min-height: 44px; padding: 0; color: var(--foundation-blue); background: transparent; border: 0; cursor: pointer; font-weight: 900; }
.back-link-button:hover { color: var(--tm-orange-deep); }
.artwork-page-heading { margin-bottom: 14px; }
.artwork-page-heading h1 { max-width: 17em; color: var(--foundation-blue); text-wrap: balance; }
.artwork-progress-banner {
  display: grid;
  grid-template-columns: auto auto minmax(150px, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: #f3eee4;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.artwork-progress-banner > div { display: grid; gap: 2px; }
.artwork-progress-banner span { color: var(--ink-muted); font-size: .74rem; font-weight: 800; }
.artwork-progress-banner strong { color: var(--foundation-blue); font-size: 1.35rem; }
.artwork-progress-banner strong small { font-size: .78rem; }
.artwork-progress-banner p { margin: 0; color: var(--ink-soft); font-size: .84rem; font-weight: 800; }
.student-artwork-page > .hero-lead { max-width: 52rem; margin-bottom: 0; font-size: 1.05rem; }
.hotspot-state-legend {
  display: flex;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 9px 16px;
  align-items: center;
  margin-top: 18px;
  padding: 10px 14px;
  color: var(--ink-soft);
  background: rgba(255,249,234,.86);
  border: 1px solid rgba(240,100,0,.16);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(126,59,10,.07);
  font-size: .8rem;
  font-weight: 800;
}
.hotspot-state-legend > strong { color: var(--tm-orange-deep); }
.hotspot-state-legend > span { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.hotspot-state-legend b { color: var(--ink); font-size: .9rem; }
.legend-marker {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  font-size: .68rem;
  font-style: normal;
  font-weight: 900;
}
.legend-marker.is-unviewed { color: #fff; background: var(--tm-orange-strong); border: 2px solid #ffe8a2; box-shadow: 0 0 0 4px rgba(255,138,0,.11); animation: legend-unviewed-pulse 1.75s ease-in-out infinite; }
.legend-marker.is-viewed { color: var(--tm-orange-deep); background: #fffdf6; border: 2px solid var(--tm-orange-strong); }
.legend-marker.is-completed { width: 21px; height: 21px; color: #fff; background: #2f7d62; border: 2px solid #e6f6ee; opacity: .78; }
@keyframes legend-unviewed-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,138,0,.08); transform: scale(.96); }
  50% { box-shadow: 0 0 0 7px rgba(255,138,0,.17); transform: scale(1.04); }
}
.student-artwork-page .artwork-workspace { grid-template-columns: minmax(0, 1.14fr) minmax(360px, .86fr); gap: 20px; }
.student-artwork-page .artwork-stage { background: #1d1712; border: 1px solid rgba(240,100,0,.24); border-radius: 5px 20px 5px 20px; box-shadow: 0 20px 44px rgba(71,36,13,.25); }
.student-artwork-page .hotspot-panel { background: #fffdf8; border-color: rgba(240,100,0,.16); border-radius: 20px 5px 20px 5px; box-shadow: 0 16px 36px rgba(126,59,10,.11); }
.student-artwork-page .artwork-workspace.is-chat-stage {
  grid-template-columns: minmax(280px, .68fr) minmax(540px, 1.32fr);
  gap: 24px;
}
.student-artwork-page .is-chat-stage .artwork-stage {
  min-height: 0;
}
.student-artwork-page .is-chat-stage-panel {
  min-height: min(74vh, 760px);
  max-height: none;
  overflow: visible;
}
.student-artwork-page .is-chat-stage-panel .ai-discussion.chat-mode {
  min-height: min(70vh, 720px);
}
.student-artwork-page .is-chat-stage-panel .conversation-thread {
  min-height: clamp(340px, 44vh, 500px);
  max-height: 52vh;
}
.artwork-stage.has-active-hotspot .hotspot.unviewed:not(.active) { opacity: 1; }
.artwork-stage.has-active-hotspot .hotspot.unviewed:not(.active)::before { animation: none; }
.artwork-stage.has-active-hotspot .hotspot.viewed:not(.active) { opacity: .88; }
.artwork-stage.has-active-hotspot .hotspot.completed:not(.active) { opacity: .58; }
.artwork-stage.has-active-hotspot .hotspot:not(.active):hover,
.artwork-stage.has-active-hotspot .hotspot:not(.active):focus-visible { opacity: 1; }
.artwork-stage.is-active-hotspot-marker-hidden .hotspot.active { opacity: 1; pointer-events: auto; }

.hotspot-learning-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.hotspot-learning-steps button {
  min-height: 44px;
  padding: 8px 6px;
  color: var(--ink-muted);
  background: #efebe3;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 850;
  text-align: center;
}
.hotspot-learning-steps button > span,
.hotspot-learning-steps button > small { display: block; }
.hotspot-learning-steps button > small {
  margin-top: 2px;
  color: #826f5a;
  font-size: .61rem;
  line-height: 1.2;
}
.hotspot-learning-steps button:hover,
.hotspot-learning-steps button:focus-visible { border-color: var(--tm-orange); background: #fff8df; }
.hotspot-learning-steps button.is-done { color: #28725a; background: #e6f2ed; }
.hotspot-learning-steps button.is-current { color: #fff; background: var(--tm-orange-deep); box-shadow: 0 6px 14px rgba(185,72,0,.18); }
.hotspot-learning-steps button.is-locked {
  color: #6f665b;
  background: #e8e4dc;
  border-color: #d8d0c5;
}
.hotspot-learning-steps button.is-locked:hover,
.hotspot-learning-steps button.is-locked:focus-visible {
  color: #7c3609;
  background: #fff2c9;
  border-color: var(--tm-orange);
}

@keyframes observation-target-shimmer {
  0%, 100% {
    box-shadow: 0 0 0 5px rgba(255,215,107,.08), inset 0 0 22px rgba(255,252,242,.09);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255,215,107,.22), 0 0 28px rgba(255,177,45,.5), inset 0 0 24px rgba(255,241,185,.24);
  }
}
.panel-kicker,
.source-reading-label { color: var(--tm-orange-deep); font-size: .72rem; font-weight: 900; letter-spacing: .11em; }
.source-reading-card { margin: 12px 0; padding: 16px 18px; background: #fff; border-left: 4px solid var(--tm-orange); box-shadow: inset 0 0 0 1px rgba(240,100,0,.09); }
.source-reading-card .hotspot-student-text { max-width: 38em; margin: 7px 0 0; color: #3d3028; font-size: 1.02rem; line-height: 1.82; white-space: pre-line; overflow-wrap: anywhere; }
.empty-observation-copy { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.75; }
.question-suggestion-block { display: grid; gap: 9px; padding: 12px; background: #f5f1e8; border: 1px solid var(--line); border-radius: 13px; }
.question-suggestion-block > strong { color: var(--ink-soft); font-size: .8rem; }
.optional-question-heading { display: grid; gap: 3px; }
.optional-question-heading > span {
  width: max-content;
  padding: 4px 8px;
  color: var(--tm-orange-deep);
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(240,100,0,.18);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.optional-question-heading > strong { color: var(--ink); font-size: .96rem; }
.optional-question-heading > small { color: var(--ink-soft); font-size: .78rem; line-height: 1.45; }
.question-suggestion-list { display: grid; gap: 7px; }
.chat-question-suggestions {
  border-left: 4px solid var(--tm-orange);
}
.question-suggestion {
  min-height: 44px;
  padding: 9px 11px;
  color: var(--foundation-blue);
  text-align: left;
  background: #fff;
  border: 1px solid rgba(240,100,0,.18);
  border-radius: 10px;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.45;
}
.question-suggestion:hover,
.question-suggestion:focus-visible { color: #fff; background: var(--foundation-blue); border-color: var(--foundation-blue); }
.question-suggestion.is-selected {
  color: #fff;
  background: var(--tm-orange-strong);
  border-color: var(--tm-orange-strong);
  box-shadow: 0 0 0 3px rgba(240,100,0,.13);
}
.open-extension-suggestions {
  gap: 14px;
  padding: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,190,105,.22), transparent 38%),
    linear-gradient(145deg, #fffaf1, #f8f1e4);
  border-color: rgba(213,104,22,.24);
}
.extension-artwork-question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.extension-artwork-question-card {
  min-width: 0;
  overflow: hidden;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(203,112,42,.2);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(96,51,18,.055);
}
.extension-artwork-question-card[open] {
  border-color: rgba(213,104,22,.42);
  box-shadow: 0 10px 24px rgba(145,68,10,.1);
}
.extension-artwork-question-card > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  padding: 9px 11px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.extension-artwork-question-card > summary::-webkit-details-marker { display: none; }
.extension-artwork-question-card > summary::after {
  content: "＋";
  color: var(--tm-orange-deep);
  font-size: 1rem;
  font-weight: 900;
}
.extension-artwork-question-card[open] > summary::after { content: "－"; }
.extension-artwork-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: linear-gradient(135deg, var(--tm-orange), var(--tm-orange-deep));
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .04em;
  box-shadow: 0 5px 11px rgba(190,79,0,.22);
}
.extension-artwork-question-card > summary strong {
  min-width: 0;
  overflow: hidden;
  font-size: .86rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.extension-artwork-question-card > summary small {
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}
.extension-artwork-question-card .question-suggestion-list {
  padding: 0 10px 10px;
  border-top: 1px solid rgba(203,112,42,.13);
}
.open-extension-suggestions .question-suggestion {
  margin-top: 8px;
  color: #8f3f0b;
  border-color: rgba(213,104,22,.22);
}
.open-extension-suggestions .question-suggestion:hover,
.open-extension-suggestions .question-suggestion:focus-visible,
.open-extension-suggestions .question-suggestion.is-selected {
  color: #fff;
  background: linear-gradient(135deg, var(--tm-orange-deep), var(--tm-orange-strong));
  border-color: var(--tm-orange-deep);
}
.open-conversation-next {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}
.open-conversation-next p { margin: 0; color: var(--ink-soft); font-size: .82rem; font-weight: 750; }
.observation-questions { margin-top: 12px; }
.chat-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: start; justify-content: flex-end; }
.chat-head-actions .btn-quiet { color: var(--foundation-blue); border-color: rgba(240,100,0,.18); }
.student-artwork-page .chat-composer { background: #fff; border-color: rgba(240,100,0,.2); }
.student-artwork-page .send-icon { background: linear-gradient(135deg, var(--tm-orange-deep), var(--tm-orange-strong)); box-shadow: 0 8px 18px rgba(166,76,0,.24); }
.student-artwork-page .hotspot-index { color: var(--tm-orange-deep); }

@media (max-width: 900px) {
  .social-play-page::before { display: none; }
  .social-play-page .page-heading h1 { overflow-wrap: anywhere; }
  .social-play-page .creation-flow { grid-template-columns: 1fr; }
  .extension-artwork-question-grid { grid-template-columns: 1fr; }
  .extension-artwork-question-card > summary { min-height: 48px; }
}

@media (max-width: 960px) {
  .hero, .summary-hero, .summary-insight-grid, .summary-support-grid, .summary-focus-overview, .two-column, .role-gateway { grid-template-columns: 1fr; }
  .admin-workspace { grid-template-columns: 1fr; }
  .admin-activity-edit-form { grid-template-columns: 1fr 1fr; }
  .admin-activity-edit-form .actions { grid-column: 1 / -1; }
  .artwork-workspace { grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr); }
  .hero { min-height: auto; }
  .hero::before { width: min(66vw, 22rem); right: 1rem; opacity: .22; }
  .hero-art { min-height: 330px; transform: none; }
  .hero-art img { min-height: 300px; }
  .main-gateway,
  .role-entry-page {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .main-gateway-art {
    min-height: 320px;
    transform: none;
  }
  .main-gateway-art img { min-height: 290px; }
  .artwork-grid, .reflection-grid, .summary-grid, .teacher-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artwork-stage { min-height: 0; }
  .teacher-row { grid-template-columns: 1fr 1fr 1fr auto; }
  .teacher-row > :nth-child(4), .teacher-row > :nth-child(5) { display: none; }
  .teacher-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creation-flow { grid-template-columns: minmax(220px, .72fr) minmax(360px, 1fr); }
}

@media (max-width: 640px) {
  .handbook-app { width: min(100% - 20px, 1180px); padding-top: max(10px, env(safe-area-inset-top)); }
  .teacher-media-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; border-radius: 18px; }
  .brand-lockup { flex: 1 1 100%; order: -1; }
  .brand-logo-frame { max-width: 100%; height: 46px; }
  .foundation-logo { max-width: min(300px, 78vw); height: 36px; }
  .app-title { display: none; }
  .top-actions { margin-left: auto; }
  .global-role-entry summary, .role-current-pill { padding-inline: 12px; font-size: .9rem; }
  .role-menu { min-width: min(220px, calc(100vw - 28px)); }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: clamp(2.5rem, 15vw, 4rem); }
  .hero-brand-row { left: 0; top: -44px; width: 100%; justify-content: center; }
  .hero-brand-row span { display: none; }
  .hero-foundation-logo { width: min(250px, 76vw); }
  .main-gateway,
  .role-entry-page {
    padding: 26px 18px;
    border-radius: 24px;
  }
  .gateway-foundation-logo,
  .role-entry-logo {
    width: min(330px, 86vw);
    margin-inline: auto;
  }
  .main-gateway-copy,
  .role-entry-brand {
    text-align: center;
  }
  .main-gateway h1,
  .role-entry-brand h1 {
    max-width: none;
    font-size: clamp(2.45rem, 14vw, 4rem);
  }
  .gateway-role-actions {
    grid-template-columns: 1fr;
  }
  .main-gateway-art {
    min-height: 250px;
  }
  .main-gateway-art img { min-height: 220px; }
  .hero-art { min-height: 250px; }
  .hero-art img { min-height: 220px; }
  .panel { padding: 20px 16px; border-radius: 24px; }
  .artwork-workspace { grid-template-columns: 1fr; }
  .artwork-grid, .reflection-grid, .summary-grid, .summary-insight-grid, .summary-support-grid, .teacher-stats, .generation-grid, .library-grid, .detail-grid { grid-template-columns: 1fr; }
  .focus-legend-grid { grid-template-columns: 1fr; }
  .artwork-stage { min-height: 0; padding: 6px; }
  .artwork-image-map > img { height: auto; min-height: 0; }
  .artwork-stage.is-spotlight-mode .artwork-image-map::before {
    width: clamp(130px, 42%, 220px);
  }
  .artwork-stage.is-spotlight-mode .artwork-image-map::after {
    background:
      radial-gradient(circle clamp(130px, 42vw, 220px) at var(--focus-x) var(--focus-y),
        rgba(255,255,255,.1) 0 17%,
        rgba(0,0,0,.08) 30%,
        rgba(0,0,0,.7) 100%);
  }
  .hotspot { width: 44px; height: 44px; }
  .admin-list-head, .admin-activity-main { grid-template-columns: 1fr; }
  .admin-list-head { display: grid; }
  .admin-activity-actions { justify-content: stretch; }
  .admin-activity-actions .btn { flex: 1 1 auto; }
  .admin-activity-edit-form { grid-template-columns: 1fr; }
	  .mobile-artwork-observation-card {
	    position: static;
	    z-index: auto;
	    max-height: none;
	    min-height: 0;
	    margin-top: 12px;
	    border-radius: 20px;
	    box-shadow: var(--shadow-soft);
	  }
  .mobile-hotspot-panel-toggle {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    color: var(--gold-deep);
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(255,138,0,.16);
    border-radius: 14px;
	    cursor: pointer;
	    font-weight: 900;
	  }
	  .hotspot-panel-peek span {
	    overflow: hidden;
	    max-width: 100%;
	    text-overflow: ellipsis;
	    white-space: nowrap;
	  }
	  .hotspot-sheet-content { display: block; min-height: 0; overflow: auto; }
	  .hotspot-bottom-sheet.is-collapsed {
	    min-height: 0;
	    max-height: 68px;
	    overflow: hidden;
	    padding: 8px;
	    background: rgba(255,252,242,.84);
	    transform: translateY(0);
	  }
	  .hotspot-bottom-sheet.is-open {
	    max-height: none;
	  }
	  .hotspot-bottom-sheet.is-collapsed .hotspot-sheet-content { display: none; }
	  .hotspot-bottom-sheet.is-open .mobile-hotspot-panel-toggle { margin-bottom: 12px; }
	  .ai-discussion.chat-mode { min-height: auto; }
	  .chat-mode .conversation-thread { max-height: 38vh; }
	  .chat-mode .conversation-message { max-width: 100%; padding: 13px 14px; }
	  .chat-mode .conversation-message p { font-size: 1rem; line-height: 1.65; }
	  .hotspot-status-grid.has-completion { grid-template-columns: 1fr; }
	  .hotspot-completion-action-row { grid-template-columns: 1fr; }
	  .hotspot-completion-action-row .btn { min-width: 0; }
  .robot-chat-layout, .guide-chat-layout { grid-template-columns: 1fr; }
  .robot-avatar { grid-template-columns: 92px 1fr; justify-items: start; text-align: left; }
  .robot-avatar img { width: 92px; }
  .stand-guide { position: static; }
  .robot-speech { grid-column: 1 / -1; }
  .chat-compact-head { flex-direction: column; gap: 8px; }
  .chat-hint-drawer { max-width: 100%; }
  .chat-hint-body { right: auto; left: 0; width: min(320px, calc(100vw - 54px)); border-radius: 0 16px 16px 16px; }
  .chat-mode .conversation-thread { min-height: 0; max-height: none; }
  .full-chat-panel .conversation-thread { min-height: 260px; max-height: 42vh; }
  .creation-flow { grid-template-columns: 1fr; }
  .creation-preview-card { padding: 12px; }
  .creation-preview-card .upload-preview { max-height: 320px; }
  .creation-main-card { padding: 16px; }
  .creation-step-card { padding: 14px 14px 14px 50px; }
  .light-choice-grid, .creation-mode-grid, .filter-grid, .sticker-element-grid { grid-template-columns: 1fr; }
  .subject-type-grid { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 100%; }
  .actions .btn-quiet { flex: 0 1 auto; }
  .title-medallion { min-height: 210px; }
  .teacher-toolbar { grid-template-columns: 1fr; }
  .teacher-export-actions { justify-content: stretch; }
  .teacher-export-actions .btn { flex: 1 1 auto; }
  .teacher-row { grid-template-columns: 1fr auto; }
  .teacher-row > :not(:first-child):not(:last-child) { display: none; }
  .teacher-row-actions { justify-content: stretch; }
  .teacher-row-actions .btn { flex: 1 1 auto; }
  .focus-row { grid-template-columns: 3.6rem 1fr 2.6rem; font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .particle-field::before, .particle-field::after { animation: none !important; }
  .artwork-stage.is-spotlight-mode .artwork-image-map::before { animation: none !important; }
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .glass-card, .topbar { background: #fff5d8; }
}

@media (max-width: 640px) {
  .student-flow-strip { margin-bottom: 24px; padding-bottom: 4px; }
  .student-flow-strip li { min-width: 128px; flex-basis: 128px; padding-right: 18px; font-size: .78rem; }
  .student-flow-strip li::after { right: 5px; left: 43px; }
  .student-flow-strip li > span { width: 34px; height: 34px; flex-basis: 34px; }
  .task-map-hero { grid-template-columns: 1fr; gap: 20px; }
  .task-map-hero .page-heading h1 { font-size: clamp(2.2rem, 12vw, 3.35rem); }
  .task-map-score { min-height: 176px; padding: 20px; }
  .task-map-score > strong { font-size: 3.4rem; }
  .task-rule-grid { grid-template-columns: 1fr; }
  .task-rule-grid > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .student-task-map .artwork-grid { grid-template-columns: 1fr; }
  .student-task-map .artwork-card { grid-template-columns: 118px minmax(0, 1fr); min-height: 285px; }
  .student-task-map .artwork-card figure { min-height: 285px; }
  .student-task-map .artwork-card-body { padding: 17px 15px; }
  .student-task-map .artwork-card h2 { font-size: 1.28rem; }
  .student-task-map .artwork-card .status-pill { font-size: .7rem; }
  .artwork-progress-summary { display: grid; gap: 5px; }
  .task-map-next { align-items: stretch; flex-direction: column; }
  .artwork-page-topline { align-items: center; }
  .artwork-progress-banner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 13px 14px; }
  .artwork-progress-banner .progress-track,
  .artwork-progress-banner p { grid-column: 1 / -1; }
  .student-artwork-page .artwork-workspace,
  .student-artwork-page .artwork-workspace.is-chat-stage { grid-template-columns: 1fr; }
  .student-artwork-page .artwork-stage { border-radius: 4px 16px 4px 16px; }
  .student-artwork-page .hotspot-panel { scroll-margin-top: 12px; border-radius: 16px 4px 16px 4px; }
  .source-reading-card { padding: 15px; }
  .source-reading-card .hotspot-student-text { font-size: 1rem; line-height: 1.78; }
  .question-suggestion-block { padding: 10px; }
  .question-suggestion { font-size: .82rem; }
  .chat-head-actions { width: 100%; justify-content: stretch; }
  .chat-head-actions .btn,
  .chat-head-actions details { flex: 1 1 auto; }
  .chat-head-actions .btn { width: 100%; }
  .student-artwork-page .chat-composer { position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 4; box-shadow: 0 -8px 28px rgba(126,59,10,.13); }
  .student-artwork-page .focus-hotspot-switcher { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); }
  .student-artwork-page .focus-hotspot-switch { min-height: 48px; grid-template-columns: 1fr; justify-items: center; padding: 5px; text-align: center; }
  .student-artwork-page .focus-hotspot-switch small { display: none; }
  .student-artwork-page .is-chat-stage .artwork-stage { min-height: 0; }
  .student-artwork-page .artwork-chat-focus { min-height: min(58vh, 430px); }
  .student-artwork-page .is-chat-stage-panel { min-height: 620px; }
  .student-artwork-page .is-chat-stage-panel .ai-discussion.chat-mode { min-height: 560px; }
  .student-artwork-page .is-chat-stage-panel .conversation-thread { min-height: 320px; max-height: none; }
}

/* iPad and tablet portrait: keep the artwork generous, then place the reading surface below it. */
@media (min-width: 641px) and (max-width: 900px) {
  .handbook-app { width: min(100% - 28px, 1180px); }
  .task-map-hero { grid-template-columns: minmax(0, 1fr) minmax(230px, .55fr); gap: 24px; }
  .task-map-hero .page-heading h1 { font-size: clamp(2.7rem, 7vw, 4rem); }
  .task-map-score { min-height: 190px; padding: 20px; }
  .student-task-map .artwork-card { grid-template-columns: 112px minmax(0, 1fr); min-height: 300px; }
  .student-task-map .artwork-card figure { min-height: 300px; }
  .student-task-map .artwork-card-body { padding: 17px 15px; }
  .student-task-map .artwork-card h2 { font-size: 1.28rem; }
  .artwork-progress-summary { display: grid; gap: 5px; }
  .student-artwork-page .artwork-workspace,
  .student-artwork-page .artwork-workspace.is-chat-stage { grid-template-columns: 1fr; }
  .student-artwork-page .artwork-stage { min-height: 0; }
  .student-artwork-page .artwork-image-map > img { height: auto; min-height: 0; }
  .student-artwork-page .hotspot-panel { max-height: none; overflow: visible; }
  .student-artwork-page .is-chat-stage .artwork-stage { min-height: 0; }
  .student-artwork-page .artwork-chat-focus { min-height: min(50vh, 470px); }
  .student-artwork-page .focus-hotspot-switcher { grid-template-columns: 1fr; }
  .student-artwork-page .is-chat-stage-panel { min-height: 680px; }
  .student-artwork-page .ai-discussion.chat-mode { min-height: 620px; }
  .student-artwork-page .chat-mode .conversation-thread { min-height: 360px; max-height: 52vh; }
}

@media (pointer: coarse) {
  .btn { min-height: 50px; }
  .hotspot { width: 52px; height: 52px; }
  .question-suggestion,
  .prompt-drawer-summary,
  .mobile-hotspot-panel-toggle,
  .back-link-button { min-height: 48px; }
}
