@charset "UTF-8";

:root {
  --page-bg: #f6efdf;
  --page-bg-deep: #ead9b4;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-glass: rgba(255, 255, 255, 0.68);
  --surface-glass-strong: rgba(255, 255, 255, 0.86);
  --surface-strong: rgba(255, 253, 247, 0.95);
  --surface-soft: rgba(255, 248, 229, 0.7);
  --gold-primary: #d2a62c;
  --gold-strong: #8d6111;
  --gold-deep: #624006;
  --gold-soft: #f3df9b;
  --gold-pale: #fbf2d5;
  --ink: #2d261b;
  --ink-soft: #665b48;
  --ink-muted: #847762;
  --success: #39745a;
  --success-bg: #e8f3eb;
  --error: #9b3f36;
  --error-bg: #fff0ed;
  --focus-ring: #71500d;
  --line: rgba(115, 80, 15, 0.16);
  --shadow: 0 22px 68px rgba(87, 60, 8, 0.13);
  --shadow-float: 0 30px 90px rgba(87, 60, 8, 0.2);
  --shadow-soft: 0 10px 32px rgba(87, 60, 8, 0.1);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --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: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 8%, rgba(255,255,255,.92), transparent 29rem),
    radial-gradient(circle at 90% 18%, rgba(224,177,58,.17), transparent 27rem),
    linear-gradient(145deg, #fbf7ee 0%, var(--page-bg) 48%, #efe1c4 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; }

.ambient {
  position: fixed;
  z-index: -2;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(54px);
  pointer-events: none;
}
.ambient-one { top: -13rem; left: -10rem; background: rgba(255,255,255,.9); }
.ambient-two { right: -12rem; bottom: -12rem; background: rgba(211,160,35,.2); }
.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(244,215,138,.5) 0 2px, transparent 3px);
  background-size: 34px 34px;
  opacity: .48;
  animation: particle-drift 24s 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; }
#app-view:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 4px; }

.view-shell { animation: view-in 380ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.topbar {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 100;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 10px 12px 10px 18px;
  color: var(--ink-soft);
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(90,61,8,.07);
  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: 9px; align-items: center; min-width: 0; font-weight: 800; }
.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: white;
  background: var(--gold-strong);
  border-radius: 50% 50% 46% 54%;
  box-shadow: inset 0 1px rgba(255,255,255,.45);
}
.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(141,97,17,.16);
  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 {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--gold-deep);
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(244,215,138,.52));
  border: 1px solid rgba(255,230,164,.72);
  border-radius: 999px;
  box-shadow: inset 0 1px rgba(255,255,255,.9), 0 10px 24px rgba(98,64,6,.12);
  cursor: pointer;
  list-style: none;
}
.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(141,97,17,.12);
  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,.88), rgba(255,247,226,.67));
  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(61, 43, 10, .18);
  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); }
.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(141,97,17,.16);
  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;
}
.hero::after {
  position: absolute;
  right: -8rem;
  bottom: -11rem;
  width: 30rem;
  height: 30rem;
  content: "";
  border: 1px solid rgba(180,128,22,.18);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(218,174,66,.05), 0 0 0 68px rgba(218,174,66,.035);
}
.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: -.035em;
  line-height: 1.08;
}
.hero h1 { max-width: 9em; font-size: clamp(2.65rem, 7vw, 5.8rem); }
.hero-lead { max-width: 35rem; color: var(--ink-soft); font-size: clamp(1.04rem, 2vw, 1.28rem); line-height: 1.85; }
.hero-art {
  min-height: 430px;
  padding: 14px;
  transform: rotate(2deg);
  background: #fffaf0;
  border: 1px solid rgba(117,76,5,.16);
  box-shadow: 0 34px 74px rgba(74,48,3,.2);
}
.hero-art img { width: 100%; height: 100%; min-height: 400px; object-fit: cover; filter: saturate(.85) contrast(1.04); }
.hero-art figcaption { padding: 12px 4px 2px; color: var(--ink-muted); font-size: .85rem; }

.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(210,166,44,.2);
  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, #a87813, var(--gold-strong)); border-color: transparent; box-shadow: 0 12px 28px rgba(141,97,17,.23); }
.btn-soft { color: var(--gold-deep); background: var(--gold-pale); }
.btn-quiet { min-height: 40px; padding: 8px 12px; background: transparent; }
.btn-danger { color: var(--error); background: var(--error-bg); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }

.notice, .error-banner, .success-banner {
  padding: 13px 15px;
  border-radius: 13px;
  line-height: 1.55;
}
.notice { color: var(--ink-soft); background: rgba(255,248,226,.9); border: 1px solid rgba(141,97,17,.15); }
.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(116,83,21,.12); border-radius: 999px; }
.progress-track > i { display: block; width: var(--progress, 0%); height: 100%; background: linear-gradient(90deg, var(--gold-primary), var(--gold-strong)); border-radius: inherit; transition: width 300ms ease; }

.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(65,47,18,.82); 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: stretch; }
.artwork-stage { position: relative; min-height: 520px; overflow: hidden; padding: 12px; background: #191813; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.artwork-stage img { width: 100%; height: min(66vh, 650px); object-fit: contain; }
.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  color: var(--gold-deep);
  background: rgba(255,249,226,.93);
  border: 3px solid rgba(210,166,44,.95);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(255,244,198,.2), 0 9px 24px rgba(0,0,0,.24);
  cursor: pointer;
  transform: translate(-50%, -50%);
  font-weight: 900;
}
.hotspot.viewed { color: #fff; background: var(--success); border-color: #d7f0df; }
.hotspot.active { box-shadow: 0 0 0 9px rgba(255,233,142,.36), 0 12px 26px rgba(0,0,0,.28); }
.hotspot-panel { display: flex; min-height: 100%; flex-direction: column; }
.hotspot-panel h2 { font-family: var(--font-display); font-size: 1.8rem; }
.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; }
.prompt-box { margin-top: 14px; padding: 14px; color: var(--ink-soft); background: var(--gold-pale); border-radius: 12px; line-height: 1.6; }
.hotspot-bottom-sheet { overflow: auto; max-height: min(74vh, 760px); overscroll-behavior: contain; }
.hotspot-action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.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: 8px;
}
.starter-question {
  min-height: 38px;
  padding: 8px 12px;
  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: .88rem;
  font-weight: 800;
  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(251,242,213,.78);
  border: 1px solid rgba(210,166,44,.22);
  border-radius: 999px;
  box-shadow: inset 0 1px rgba(255,255,255,.9);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 900;
}
.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(210,166,44,.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,248,229,.78);
  border: 1px dashed rgba(141,97,17,.24);
  border-radius: 12px;
  font-size: .92rem;
  font-weight: 800;
}
.conversation-thread {
  display: flex;
  max-height: 280px;
  flex-direction: column;
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding: 12px;
  background: rgba(255,255,255,.56);
  border: 1px solid rgba(141,97,17,.12);
  border-radius: 18px;
}
.conversation-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(87,60,8,.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; }
.conversation-message.from-student { align-self: flex-end; justify-self: end; background: #fff8df; }
.conversation-message.from-ai { align-self: flex-start; justify-self: start; background: rgba(255,255,255,.9); }
.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(141,97,17,.14);
  border-radius: 18px;
}
.chat-composer:focus-within {
  border-color: rgba(141,97,17,.32);
  box-shadow: 0 0 0 4px rgba(210,166,44,.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(251,242,213,.72));
  border: 1px solid rgba(141,97,17,.16);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(98,64,6,.12), 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(98,64,6,.16), 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(98,64,6,.18), 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(141,97,17,.12);
  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(244,215,138,.22));
  border: 1px solid rgba(255,230,164,.72);
  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(98,64,6,.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(141,97,17,.14);
  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(141,97,17,.14);
  border-left: 1px solid rgba(141,97,17,.14);
  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,.92), rgba(255,249,234,.84));
  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(251,242,213,.78);
  border: 1px solid rgba(210,166,44,.2);
  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; }

.loading-stage { display: grid; min-height: 600px; place-items: center; text-align: center; }
.loading-orbit { position: relative; width: 120px; height: 120px; margin: 0 auto 28px; border: 1px solid rgba(141,97,17,.2); 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 { padding: 7px 10px; background: rgba(255,255,255,.7); border-radius: 999px; }

.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); }
.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,.7) 0 45%, rgba(236,209,127,.16) 70%); border-radius: 30px; box-shadow: inset 0 0 28px rgba(105,68,4,.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(98,64,6,.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; }
.focus-bars { display: grid; gap: 12px; }
.focus-row { display: grid; grid-template-columns: 4rem 1fr 3rem; gap: 10px; align-items: center; }
.focus-row i { display: block; width: var(--value); height: 9px; background: linear-gradient(90deg, var(--gold-primary), var(--gold-strong)); 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: #fffaf0; border: 1px solid var(--line); border-radius: 13px; }
.element-card small { color: var(--ink-muted); line-height: 1.45; }

.upload-zone { display: grid; min-height: 260px; padding: 28px; place-items: center; text-align: center; background: rgba(255,250,236,.75); border: 2px dashed rgba(141,97,17,.32); border-radius: var(--radius-lg); cursor: pointer; }
.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); }
.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: #fffaf0; }
.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,.92), rgba(255,249,234,.8));
  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(141,97,17,.12);
  border-radius: 18px;
}
.creation-step-card.primary-step { background: rgba(255,248,229,.82); }
.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(98,64,6,.16);
}
.advanced-creation-options {
  overflow: hidden;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(141,97,17,.12);
  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;
}
.compact-sentence {
  padding: 0;
  background: transparent;
}
.compact-sentence textarea {
  min-height: 86px;
  resize: vertical;
}
.creation-actions { margin-top: 2px; }

.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); }

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

.teacher-toolbar { display: grid; grid-template-columns: 1fr 220px auto; gap: 10px; margin-bottom: 16px; }
.teacher-list { display: grid; gap: 10px; }
.teacher-row { display: grid; grid-template-columns: minmax(140px, 1fr) repeat(4, 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; }
.teacher-row small { color: var(--ink-muted); }
.teacher-detail { margin-top: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

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

@media (max-width: 960px) {
  .hero, .summary-hero, .two-column { grid-template-columns: 1fr; }
  .artwork-workspace { grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr); }
  .hero { min-height: auto; }
  .hero-art { min-height: 330px; transform: none; }
  .hero-art img { min-height: 300px; }
  .artwork-grid, .reflection-grid, .summary-grid, .teacher-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artwork-stage { min-height: 430px; }
  .teacher-row { grid-template-columns: 1fr 1fr 1fr auto; }
  .teacher-row > :nth-child(4), .teacher-row > :nth-child(5) { display: none; }
  .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)); }
  .topbar { border-radius: 18px; }
  .global-role-entry summary { padding-inline: 12px; font-size: .9rem; }
  .role-menu { min-width: min(220px, calc(100vw - 28px)); }
  .brand-lockup span:last-child { overflow: hidden; max-width: 10rem; text-overflow: ellipsis; white-space: nowrap; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: clamp(2.5rem, 15vw, 4rem); }
  .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, .teacher-stats, .generation-grid, .library-grid, .detail-grid { grid-template-columns: 1fr; }
  .artwork-stage { min-height: 340px; padding: 6px; }
  .artwork-stage img { height: 54vh; min-height: 320px; }
  .hotspot { width: 44px; height: 44px; }
  .hotspot-bottom-sheet {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 30;
    max-height: 68vh;
    min-height: 280px;
    border-radius: 26px;
    box-shadow: var(--shadow-float);
  }
  .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(141,97,17,.14);
    border-radius: 14px;
    cursor: pointer;
    font-weight: 900;
  }
  .hotspot-sheet-content { display: block; min-height: 0; overflow: auto; }
  .hotspot-bottom-sheet.is-collapsed {
    min-height: 0;
    max-height: 72px;
    padding: 10px;
  }
  .hotspot-bottom-sheet.is-collapsed .hotspot-sheet-content { display: none; }
  .hotspot-bottom-sheet.is-open .mobile-hotspot-panel-toggle { margin-bottom: 12px; }
  .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; }
  .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-row { grid-template-columns: 1fr auto; }
  .teacher-row > :not(:first-child):not(:last-child) { display: none; }
  .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; }
}

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