@font-face {
  font-family: "岭南题字";
  src: url("assets/lingshi-brush.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #324052;
  --deep: #f5f0e5;
  --paper: #faf1de;
  --paper-light: #fff7e7;
  --paper-ink: #364152;
  --muted: #605c62;
  --linen: #e9dbc0;
  --line: #9a856d57;
  --dark-line: #a9966b4d;
  --ochre: #906b39;
  --seal: #9f4638;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --brush: "岭南题字", KaiTi, "Kaiti SC", var(--serif);
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --ease: cubic-bezier(.19, .69, .24, 1);
  --paper-grain: url("assets/archive-paper.webp");
  --coast: url("assets/lingnan-morning.webp");
  --chapter-art: url("assets/chapter-scenes.webp");
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 74% -20%, #ddedf2, transparent 60%), var(--deep);
  font: 400 16px/1.62 var(--sans);
}
body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
}
body::before {
  background: linear-gradient(180deg, #f9f6edd9, #f8f2e5eb 80%), var(--coast) 55% 52% / cover no-repeat;
  opacity: .87;
}
body::after {
  z-index: -1;
  background: repeating-linear-gradient(90deg, transparent 0 159px, #a59e7a2c 160px, transparent 161px 320px);
  mask-image: linear-gradient(#000, transparent 93%);
  opacity: .37;
}
button, input { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #bc8843; outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.33; }
.shell { width: min(1310px, calc(100% - 96px)); margin-inline: auto; }
.main { position: relative; padding-top: 23px; view-transition-name: folio-content; }
.main:focus:not(:focus-visible) { outline: none; }
.sr-only,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  z-index: 15;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  background: var(--paper);
  color: var(--ink);
}

.header {
  position: relative;
  z-index: 8;
  border-bottom: 1px solid #b6a88a65;
  background: linear-gradient(105deg, #fffaf0eb, #edf3f4d9);
  backdrop-filter: blur(14px);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(186px, 1fr) auto minmax(186px, 1fr);
  align-items: center;
  gap: 22px;
  min-height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; justify-self: start; white-space: nowrap; }
.seal,
.avatar {
  display: grid;
  place-items: center;
  font-family: var(--brush);
  font-weight: 400;
  color: #ffedd3;
  background: linear-gradient(135deg, #b05a42, #8f3c34 76%);
  box-shadow: inset 0 0 9px #60292163;
}
.seal {
  width: 42px;
  height: 42px;
  border: 1px solid #ddac83;
  border-radius: 5px 5px 7px 5px;
  outline: 1px solid #f7d4a9c2;
  outline-offset: -5px;
  font-size: 1.55rem;
}
.brand-copy { display: grid; gap: 3px; line-height: 1.12; }
.brand-copy strong { font: 400 1.33rem/1.05 var(--brush); letter-spacing: .09em; color: #495266; }
.brand-copy > span { color: #5b6270; font-size: .72rem; }
.navigation { display: flex; align-items: center; gap: 20px; justify-self: center; }
.navigation a {
  position: relative;
  padding: 11px 8px 10px;
  color: #5b6170;
  font: 700 .97rem/1.4 var(--serif);
  white-space: nowrap;
  transition: color .23s ease;
}
.navigation a::after {
  position: absolute;
  inset: auto 6px 2px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent 2%, #a1825a 15%, #b18049 50%, #a17a455d 88%, transparent);
  transform: scaleX(0);
  transition: transform .34s var(--ease);
}
.navigation a:hover,
.navigation a[aria-current="page"] { color: #795439; }
.navigation a:hover::after,
.navigation a[aria-current="page"]::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: 15px; justify-self: end; }
.model-status { display: flex; align-items: center; gap: 7px; color: #5b6068; font-size: .76rem; white-space: nowrap; }
.model-status i { width: 6px; height: 6px; border-radius: 50%; background: #cba172; }
.model-status[data-ready="true"] i { background: #5d956f; box-shadow: 0 0 9px #7cbf9255; }
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 11px;
  border: 1px solid #a497785e;
  border-radius: 20px;
  background: linear-gradient(135deg, #f9edda, #edf1f0);
  color: #64523e;
  font: 700 .77rem/1.2 var(--sans);
  white-space: nowrap;
  transition: background .21s ease, transform .21s var(--ease);
}
.sound-toggle:not(:disabled):hover { background: #f5e7ce; transform: translateY(-1px); }
.sound-toggle:not(:disabled):active { transform: scale(.95); }
.sound-toggle[aria-pressed="false"] { border-color: #b9b08a56; color: #646676; }
.sound-symbol { display: inline-flex; position: relative; align-items: center; gap: 2px; height: 13px; }
.sound-symbol i { width: 2px; height: 6px; border-radius: 2px; background: currentColor; }
.sound-symbol i:nth-child(2) { height: 12px; }
.sound-symbol i:nth-child(3) { height: 8px; }
.sound-toggle[aria-pressed="false"] .sound-symbol::after {
  position: absolute;
  width: 14px;
  height: 1px;
  content: "";
  background: currentColor;
  box-shadow: 0 0 0 1px #f7ead8;
  transform: rotate(-43deg);
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 419px;
  overflow: hidden;
  border: 1px solid #ac9a755f;
  border-radius: 23px 23px 11px 11px;
  background: #ede9db;
  box-shadow: 0 16px 38px #65553625;
  --light-x: 70%;
  --light-y: 45%;
  --art-x: 0px;
  --art-y: 0px;
  --frame-x: 0px;
  --frame-y: 0px;
}
.hero-art,
.hero-mist,
.hero-grain,
.hero-line,
.hero::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-art {
  inset: -14px;
  z-index: -4;
  background: var(--coast) center 57% / cover no-repeat;
  filter: saturate(.88);
  transform: translate(var(--art-x), var(--art-y)) scale(1.041);
  transition: transform .63s var(--ease);
  animation: bay-resolve 1.38s var(--ease) both;
}
.hero-mist {
  z-index: -3;
  width: 100%;
  background: radial-gradient(ellipse at var(--light-x) var(--light-y), #fff5d386 0%, transparent 43%);
  mix-blend-mode: screen;
}
.hero::after {
  z-index: -2;
  content: "";
  background: linear-gradient(90deg, #fff8e9dc 0%, #fff8e9ad 31%, #fff7e646 57%, transparent 77%),
    linear-gradient(0deg, #f9ead53d 0%, transparent 38%, transparent 78%, #fff7eb31 100%);
}
.hero-grain {
  z-index: -1;
  background: radial-gradient(circle at 49% 34%, #f8dba8b8 0 1px, transparent 2px),
    radial-gradient(circle at 60% 46%, #f8dba894 0 1px, transparent 2px),
    radial-gradient(circle at 55% 41%, #d0e1bc98 0 1px, transparent 2px),
    radial-gradient(circle at 71% 18%, #f8dba894 0 1px, transparent 2px),
    radial-gradient(circle at 83% 82%, #f1d49e8d 0 1px, transparent 2px);
  animation: mist-motes 4.4s var(--ease) both;
}
.hero-line {
  inset: 14px;
  border: 1px solid #ae8e5c7a;
  border-radius: 14px 14px 3px 3px;
  mask-image: linear-gradient(135deg, #000, #0004 36%, #0004 69%, #000);
}
.hero-content { width: min(63%, 740px); padding: 43px 0 63px clamp(34px, 5.6vw, 83px); }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  color: #78563b;
  font: 700 .89rem/1.3 var(--serif);
  letter-spacing: .2em;
}
.hero-kicker::before {
  width: 31px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, #a85f50 0 5px, #c58e5b 6px, #edd9a56e);
}
.hero h1 {
  margin-left: -.055em;
  padding: 3px 0 8px;
  font: 400 clamp(4.45rem, 8.8vw, 7.75rem)/.96 var(--brush);
  letter-spacing: .061em;
  color: #3a4c61;
  text-shadow: 0 1px 1px #fff9ec, 0 3px 15px #fff8e484;
  white-space: nowrap;
}
.hero-subtitle {
  margin-top: 12px;
  color: #465367;
  font: 750 clamp(1.17rem, 2.3vw, 1.86rem)/1.4 var(--serif);
  letter-spacing: .045em;
}
.hero-description { max-width: 450px; margin-top: 12px; color: #526272; font-size: .95rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 22px; }
.hero-content > * { animation: slide-lit .63s var(--ease) both; }
.hero-content h1 { animation-delay: .08s; }
.hero-subtitle { animation-delay: .13s; }
.hero-description { animation-delay: .18s; }
.hero-actions { animation-delay: .23s; }
.hero-portrait {
  position: absolute;
  top: 12%;
  right: 10%;
  width: clamp(154px, 16.8vw, 226px);
  margin: 0;
  padding: 9px 9px 7px;
  background: linear-gradient(145deg, #efd2a5ef, #9b7546ed 43%, #dfc092f6 85%);
  box-shadow: 0 13px 26px #62584363, 0 0 0 1px #ffdeb395;
  border: 1px solid #eee0af60;
  border-radius: 48% 48% 6px 6px / 34% 34% 6px 6px;
  transform: translate(var(--frame-x), var(--frame-y)) rotate(3.5deg);
  transition: transform .66s var(--ease);
  animation: portrait-lift .94s var(--ease) both;
}
.hero-portrait::before {
  position: absolute;
  inset: -11px;
  z-index: -1;
  border: 1px solid #e7cb929e;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}
.portrait-window { overflow: hidden; border: 1px solid #594e3e; border-radius: 48% 48% 3px 3px / 33% 33% 3px 3px; }
.hero-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: .83;
  object-fit: cover;
  object-position: 50% 38%;
  filter: sepia(.22) contrast(.96) saturate(.9);
}
.hero-portrait figcaption {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 1px 0;
  color: #302630;
  font: 800 .84rem/1.35 var(--serif);
}
.hero-portrait figcaption span:last-child { font: 700 .74rem/1.6 var(--sans); }
.hero-credit {
  position: absolute;
  right: 22px;
  bottom: 22px;
  padding: 3px 8px;
  border: 1px solid #aa98736e;
  border-radius: 6px;
  background: #fff5e2de;
  color: #634f3e;
  font-size: .74rem;
}
.hero-credit:hover { text-decoration: underline; }

.button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 45px;
  overflow: hidden;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
  font-size: .9rem;
  white-space: nowrap;
  transition: border-color .22s ease, background .24s ease, box-shadow .24s ease, transform .23s var(--ease);
}
.button::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(116deg, transparent 20%, #fff5cd66 52%, transparent 78%);
  transform: translateX(-115%);
  pointer-events: none;
}
.button:not(:disabled):hover { transform: translateY(-2px); }
.button:not(:disabled):hover::after,
.button:not(:disabled):focus-visible::after { transform: translateX(115%); transition: transform .65s var(--ease); }
.button:not(:disabled):active { transform: translateY(1px) scale(.97); }
.button-paper,
.button-soft-red {
  color: #372c25;
  border-color: #e5c891;
  background: linear-gradient(118deg, #f5dfac, #cfab6f);
  box-shadow: 0 5px 15px #78593038;
}
.button-paper:hover,
.button-soft-red:hover { box-shadow: 0 8px 17px #896b3b46; }
.button-outline-light {
  border-color: #8394a2a9;
  background: linear-gradient(110deg, #f9f8efdf, #edf3f5c9);
  color: #485e6b;
}
.button-outline-light:hover { background: #f2f5f3; }
.button-red {
  color: #fff0c9;
  border-color: #424766;
  background: linear-gradient(125deg, #535f7b, #313a56 73%);
  box-shadow: inset 0 1px #d1c7ac34, 0 4px 10px #4e414e29;
}
.button-red:not(:disabled):hover { background: linear-gradient(125deg, #626f8b, #393f60); }
.button-red:disabled { color: #6f6a56; border-color: #bbb39275; background: #dbd0b6; box-shadow: none; }
.button-quiet { color: #535165; border-color: #a595757e; background: #fff4dfc4; }
.button-quiet:hover { background: #f1e4c9; }
.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 35px;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  color: #764930;
  background: none;
  font-size: .85rem;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}
.text-button:hover { color: #3a4568; background: #a39a8a26; }
.send-arrow { font: 700 1.03rem/1 Georgia, serif; }

.workspace { display: grid; align-items: start; gap: 21px; }
.overview {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.overview-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #ad9b755c;
  border-radius: 15px 21px 15px 15px;
  background: linear-gradient(140deg, #fff8e7a3, #f3ece4a3), var(--paper-grain) center / cover;
  box-shadow: 0 8px 21px #64573f1a;
  transition: transform .27s var(--ease), box-shadow .28s ease;
  animation: slide-lit .51s .1s var(--ease) both;
}
.overview-card:nth-child(2) { animation-delay: .17s; }
.overview-card:nth-child(3) { animation-delay: .24s; }
.overview-card:hover,
.overview-card:focus-within { transform: translateY(-4px); box-shadow: 0 12px 23px #64573f2c; }
.overview-image {
  display: block;
  height: 113px;
  border-bottom: 1px solid #8d806541;
  background-color: #ece4d2;
}
.overview-image-chat { background: linear-gradient(100deg, #f3ead230, #fcf4e800), var(--chapter-art) right bottom / 200% auto; }
.overview-image-quiz { background: linear-gradient(100deg, #f3ead21c, #fcf4e800), var(--chapter-art) left 25% / 200% auto; }
.overview-image-archive {
  position: relative;
  overflow: hidden;
  background: linear-gradient(95deg, #f4ead737, #f8f2e381), var(--coast) 62% 53% / cover;
}
.overview-image-archive img {
  position: absolute;
  top: 12px;
  right: 15%;
  display: block;
  width: 78px;
  height: auto;
  padding: 3px;
  background: #e9d7b0;
  border: 1px solid #ad9670;
  filter: sepia(.13);
  transform: rotate(6deg);
}
.overview-body { padding: 12px 17px 14px; }
.overview-meta { color: #8a674b; font-size: .78rem; font-weight: 700; }
.overview-body h2 { margin: 4px 0; color: #425269; font: 400 1.84rem/1.15 var(--brush); }
.overview-body p:not(.overview-meta) { color: #586271; font-size: .89rem; }
.overview-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin-top: 5px;
  color: #674d3a;
  font-size: .87rem;
  font-weight: 700;
}
.overview-link::after { content: "→"; transition: transform .24s var(--ease); }
.overview-link:hover::after { transform: translateX(4px); }
.overview-link:hover { text-decoration: underline; }
.chat-layout {
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  align-items: start;
  gap: 19px;
}
.panel { min-width: 0; }
.conversation,
.quiz-card,
.entry-sheet {
  color: var(--paper-ink);
  border: 1px solid #cfc19d;
  background: linear-gradient(145deg, #fff6e36b, #f5ead356), var(--paper-grain) center / cover;
  box-shadow: 0 12px 25px #68634b26, inset 0 1px #fffaf0;
}
.conversation {
  overflow: hidden;
  isolation: isolate;
  position: relative;
  border-radius: 14px 23px 14px 14px;
}
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 16px 18px 13px; }
.conversation .panel-header {
  border-bottom: 1px solid #a58b5d3f;
  background: linear-gradient(110deg, #fff5df95, #ded3be47);
}
.chat-sidebar {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #ab9a785e;
  border-radius: 16px 20px 16px 16px;
  background: linear-gradient(154deg, #eee9dcef, #f5f3ecc8, #edf3f4c9), var(--paper-grain) center / cover;
  box-shadow: 0 9px 23px #786d5222;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 13px 12px 10px;
  border-bottom: 1px solid #b7a98a59;
}
.history-header h2 {
  flex-shrink: 0;
  color: #465568;
  font: 800 1.02rem/1.35 var(--serif);
}
.history-header .button {
  min-height: 36px;
  gap: 5px;
  padding: 3px 8px;
  color: #674e3b;
  font-size: .8rem;
}
.chat-history {
  display: grid;
  gap: 6px;
  max-height: min(58vh, 490px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 9px;
  scrollbar-color: #b7a47e transparent;
}
.history-entry {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 49px;
  gap: 2px;
  padding: 7px 9px 7px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fffaf1a3;
  color: #425469;
  text-align: left;
  transition: background .23s ease, border-color .23s ease;
}
.history-entry:hover { background: #eaf1f2; border-color: #92a5b04f; }
.history-entry[aria-current="true"] { border-color: #98adba84; background: linear-gradient(125deg, #e4edf1, #f2ead8); }
.history-entry[aria-current="true"]::before {
  position: absolute;
  inset: 8px auto 8px 3px;
  width: 3px;
  border-radius: 2px;
  background: #9f7952;
  content: "";
}
.history-entry strong { overflow: hidden; font: 750 .86rem/1.36 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.history-entry span { color: #5e6873; font-size: .74rem; }
.history-status {
  padding: 8px 11px 10px;
  border-top: 1px solid #afa68c52;
  color: #6d675a;
  font-size: .75rem;
}
.panel-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.panel-title h2 { margin-top: 1px; font: 400 1.83rem/1.05 var(--brush); letter-spacing: .025em; }
.panel-title p { margin-top: 4px; color: var(--muted); font-size: .77rem; }
.conversation .panel-title > div { min-width: 0; }
.conversation .panel-title h2 {
  overflow: hidden;
  color: #41536a;
  font: 800 clamp(1.12rem, 2.4vw, 1.43rem)/1.33 var(--serif);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-mark {
  position: relative;
  flex: 0 0 37px;
  height: 37px;
  border: 1px solid #8f8d9f55;
  border-radius: 8px;
  color: #4e5972;
  background: linear-gradient(145deg, #dedce5, #f4e7ce);
}
.book-mark::before { position: absolute; inset: 8px 10px; border: 1.5px solid; border-radius: 2px; content: ""; }
.book-mark::after { position: absolute; inset: 15px 14px auto; height: 1.4px; background: currentColor; box-shadow: 0 4.5px currentColor; content: ""; }
.route-mark::before {
  position: absolute;
  top: 10px;
  left: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 9px 12px currentColor;
  content: "";
}
.route-mark::after {
  position: absolute;
  top: 12px;
  left: 15px;
  width: 11px;
  height: 15px;
  border: solid currentColor;
  border-width: 0 0 1px 1px;
  border-radius: 0 0 0 8px;
  transform: rotate(-15deg);
  content: "";
}
.chat-scroll {
  min-height: clamp(236px, 37vh, 410px);
  max-height: clamp(320px, 53vh, 565px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #a99972 transparent;
}
.messages { display: grid; gap: 13px; padding: 15px 18px 8px; }
.message { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.avatar { flex: 0 0 30px; height: 30px; border-radius: 6px; font-size: 1.12rem; }
.bubble {
  min-width: 0;
  max-width: min(100%, 640px);
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border: 1px solid #b1926955;
  border-left: 2px solid #898eac;
  border-radius: 2px 12px 12px 12px;
  background: linear-gradient(147deg, #f8eed8b0, #e6dece97);
  font-size: .94rem;
}
.message.user { justify-content: flex-end; }
.message.user .bubble {
  max-width: 87%;
  white-space: pre-wrap;
  background: #d8e0ecb0;
  border: 1px solid #7a89ab52;
  border-right: 2px solid #8892ae;
  border-radius: 12px 2px 12px 12px;
}
.message.user.fresh { animation: chat-from-right .34s var(--ease) both; }
.message.assistant.fresh .avatar { animation: chat-from-left .31s var(--ease) both; }
.message.assistant.fresh .bubble { animation: chat-sheet .37s var(--ease) both; }
.message.assistant.fresh .answer-evidence { animation: chat-line .35s .09s var(--ease) both; }
.message.assistant.fresh .reflection { animation: chat-line .39s .18s var(--ease) both; }
.message.assistant.fresh .source-links { animation: chat-line .37s .27s var(--ease) both; }
.bubble h3 { margin-bottom: 2px; color: #424e68; font: 800 .94rem/1.56 var(--serif); }
.bubble p + p { margin-top: 6px; }
.bubble .reflection { margin-top: 10px; padding-top: 8px; border-top: 1px solid #9c8b5d5c; }
.bubble .reflection p { white-space: pre-wrap; }
.reflection-updated p { animation: chat-line .43s var(--ease) both; }
.answer-thinking { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; color: #6b6674; font-size: .76rem; }
.answer-thinking i { width: 4px; height: 4px; border-radius: 50%; background: #947756; animation: answer-beat .88s ease-in-out 5; }
.answer-thinking i:nth-child(2) { animation-delay: .13s; }
.answer-thinking i:nth-child(3) { animation-delay: .26s; }
.answer-thinking span { margin-left: 4px; }
.source-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; color: #655c55; font-size: .76rem; }
.source-link {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #ab947160;
  border-radius: 6px;
  background: #fffaeaba;
  color: #465376;
  overflow-wrap: anywhere;
}
.source-link:hover,
.source-link:focus-visible { text-decoration: underline; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 18px 15px 57px; }
.chip {
  min-height: 36px;
  padding: 5px 9px;
  border: 1px solid #9a8c6b5f;
  border-radius: 8px;
  color: #4f5066;
  background: #fffae988;
  text-align: left;
  font-size: .81rem;
  transition: background .22s ease, transform .22s var(--ease);
}
.chip:hover { transform: translateY(-2px); background: #ece7ec; }
.chip:active { transform: translateY(1px); }
.composer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 17px;
  border-top: 1px solid #ab956b56;
  background: linear-gradient(98deg, #e8dfc6a8, #f5edd269);
}
.composer input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #aa9d7c87;
  border-radius: 8px;
  color: #323545;
  background: #fffaeade;
  font-size: 1rem;
}
.composer input::placeholder { color: #6f6a57; font-size: .86rem; }
.composer input:focus { outline-offset: 2px; }

.journey {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-bottom: 14px;
  border: 1px solid #a49c865e;
  border-radius: 21px 14px 14px 14px;
  color: #4a5365;
  background: #f4eee3;
  box-shadow: 0 12px 25px #69644c2b, inset 0 1px #fcf7e8bf;
}
.journey::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(135deg, #fffaeeec, #e8eff1d6 54%, #f4e9d7ed), var(--coast) 80% 63% / cover no-repeat;
}
.journey .panel-header { border-bottom: 1px solid var(--dark-line); }
.journey .panel-title p { color: #68717b; }
.journey .section-mark { border-color: #b2aa8d78; color: #566478; background: #e4e8e2; }
.count-label {
  padding: 2px 8px;
  border: 1px solid #ab9d7d75;
  border-radius: 20px;
  background: #f1e6cfab;
  color: #70563c;
  font: 700 .8rem/1.68 Georgia, serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stage-list { display: grid; gap: 2px; margin: 0; padding: 9px 16px 9px; list-style: none; }
.stage {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
}
.stage.active { border-color: #b3a17988; background: linear-gradient(90deg, #f4e5cdbf, #e6ebed); }
.stage:not(:last-child)::after {
  position: absolute;
  top: 36px;
  left: 22px;
  width: 1px;
  height: 16px;
  background: #af9d6270;
  content: "";
}
.stage-number {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #c6b99f85;
  border-radius: 50%;
  color: #58657b;
  background: #f1eee6;
  font: 700 .79rem/1 Georgia, serif;
}
.stage.active .stage-number {
  border-color: #ae9166;
  color: #4d3f3b;
  background: #ebd4a2;
  box-shadow: 0 0 0 3px #dbc58e6b;
}
.stage.done .stage-number { border-color: #b7d2a1; color: #204739; background: #c8dac0; }
.stage-title { color: #46576d; font: 800 .98rem/1.32 var(--serif); }
.stage-period,
.stage-theme { color: #616b79; font-size: .72rem; line-height: 1.2; }
.stage-theme { text-align: right; }
.quiz-note { margin: 4px 18px 0; color: #64707b; font-size: .78rem; }

.page-heading {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
  overflow: hidden;
  min-height: 122px;
  margin-bottom: 24px;
  padding: 9px 11px 21px;
  border-bottom: 1px solid #b1a18084;
  color: #44566b;
}
.page-heading::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 11% 97%, #d0dce778, transparent 57%);
  content: "";
  pointer-events: none;
}
.page-heading h1 { font: 400 clamp(2.55rem, 5vw, 4.3rem)/1.05 var(--brush); letter-spacing: .03em; }
.page-heading p { margin-top: 8px; color: #586979; font-size: .94rem; }
.page-heading .text-button {
  padding-inline: 11px;
  border: 1px solid #8c9ca375;
  border-radius: 20px;
  background: #fcf7e8ec;
  color: #586574;
}
.page-heading .text-button:hover { background: #f3ead5; }
.chat-heading {
  min-height: 124px;
  padding-inline: 23px;
  border: 1px solid #aab2ad70;
  border-radius: 15px;
  background: linear-gradient(90deg, #f8f5eafb, #f1f4f3c9 56%, #fcf2de78), var(--coast) center 49% / cover;
}
.archive-heading {
  min-height: 144px;
  padding-inline: 25px;
  border: 1px solid var(--dark-line);
  border-radius: 17px;
  background: linear-gradient(90deg,#fbf6e9f6 0%,#f1f2ecc4 52%,#fcf2d968 79%), var(--coast) center 71% / cover;
}
.quiz-workspace {
  grid-template-columns: minmax(295px, .87fr) minmax(0, 1.78fr);
  grid-template-areas: "itinerary sheet";
  gap: 24px;
}
.quiz-journey {
  grid-area: itinerary;
  display: flex;
  flex-direction: column;
  border-radius: 15px 15px 19px 15px;
  --chapter-position: left top;
}
#quiz-page[data-chapter="1"] .quiz-journey { --chapter-position: right top; }
#quiz-page[data-chapter="2"] .quiz-journey { --chapter-position: left bottom; }
#quiz-page[data-chapter="3"] .quiz-journey { --chapter-position: right bottom; }
.quiz-journey .panel-header { padding-top: 14px; }
.chapter-story {
  position: relative;
  order: -1;
  overflow: hidden;
  border-bottom: 1px solid #cabe8873;
  background: #373d52;
}
.chapter-story summary { display: block; position: relative; list-style: none; cursor: pointer; }
.chapter-story summary::-webkit-details-marker { display: none; }
.chapter-painting {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--chapter-art) var(--chapter-position) / 200% auto no-repeat;
  transition: filter .3s ease;
}
.chapter-painting::before,
.chapter-painting::after { position: absolute; inset: 0; content: ""; pointer-events: none; }
.chapter-painting::before { background: linear-gradient(0deg, #24283ca3, transparent 47%); }
.chapter-painting::after { opacity: 0; background: radial-gradient(ellipse at 23% 65%, #fff3c2aa, transparent 69%); }
.chapter-story summary:hover .chapter-painting { filter: saturate(1.19) brightness(1.07); }
.chapter-story.story-reveal .chapter-painting::after { animation: chapter-light 1.3s var(--ease) both; }
.chapter-story.story-reveal[data-chapter="1"] .chapter-painting::after { background: linear-gradient(111deg, transparent 20%, #f7d581a3 51%, transparent 78%); }
.chapter-story.story-reveal[data-chapter="2"] .chapter-painting::after {
  inset: -20%;
  background: repeating-linear-gradient(113deg, transparent 0 27px, #dfedee89 28px, transparent 29px 43px);
  animation: chapter-rain 1.27s var(--ease) both;
}
.chapter-story.story-reveal[data-chapter="3"] .chapter-painting::after { background: radial-gradient(ellipse at 67% 46%, #fff0ab9e, transparent 66%); }
.story-tab {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  padding: 22px 15px 11px;
  background: linear-gradient(0deg, #2b3047f1, #30374da6 68%, transparent);
}
.story-tab strong { display: block; color: #fff1cb; font: 800 1.06rem/1.4 var(--serif); }
.story-tab small { display: block; margin-top: 3px; color: #f2e5bd; font-size: .76rem; }
.story-toggle {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 1px solid #e8d29b99;
  border-radius: 50%;
  color: #edd9a7;
  background: #535971a3;
}
.story-toggle::after { content: "+"; font: 400 1rem/1 var(--sans); transition: transform .27s var(--ease); }
.chapter-story[open] .story-toggle::after { transform: rotate(45deg); }
.story-body {
  padding: 11px 15px;
  border-top: 1px solid #d4c4987c;
  background: linear-gradient(150deg, #f4e7c9c9, #f8eed7ab), var(--paper-grain) center / cover;
  color: #444758;
  font-size: .86rem;
}
.chapter-story[open] .story-body { animation: ink-read .42s var(--ease) both; }
.story-body .text-button { margin-top: 5px; padding-inline: 3px; }
progress {
  display: block;
  width: calc(100% - 36px);
  height: 7px;
  margin: 13px 18px 3px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #bebba776;
}
progress::-webkit-progress-bar { background: #bebba776; }
progress::-webkit-progress-value { border-radius: 8px; background: linear-gradient(90deg, #829ba8, #cca97a); }
progress::-moz-progress-bar { border-radius: 8px; background: linear-gradient(90deg, #829ba8, #cca97a); }

.quiz-card {
  position: relative;
  isolation: isolate;
  grid-area: sheet;
  min-height: 502px;
  overflow: hidden;
  padding: clamp(19px, 3.05vw, 42px);
  border-radius: 16px 36px 16px 16px;
  scroll-margin-top: 13px;
}
.quiz-card::after {
  position: absolute;
  inset: 0 0 auto auto;
  z-index: -1;
  width: 58px;
  height: 58px;
  border-bottom-left-radius: 15px;
  background: linear-gradient(135deg, #fffaec73 0%, #c7af7b82 56%, #dfd0a3a2 100%);
  content: "";
}
.quiz-intro { position: relative; isolation: isolate; padding-top: 16px; }
.quiz-intro::after {
  position: absolute;
  inset: auto 0 -158px auto;
  z-index: -1;
  width: min(380px, 51%);
  height: 180px;
  background: var(--coast) 75% 73% / cover;
  mask-image: radial-gradient(ellipse at 81% 66%, #0009, #0005 44%, transparent 73%);
  filter: sepia(.28) saturate(.72);
  content: "";
  pointer-events: none;
}
.quiz-intro h2,
.summary h2 {
  margin: 12px 0;
  color: #39455d;
  font: 400 clamp(2rem, 4vw, 3.28rem)/1.13 var(--brush);
}
.quiz-intro p,
.summary > p { max-width: 35em; color: #535464; }
.quiz-intro .button { margin-top: 23px; }
.chapter-tag {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid #a493a880;
  border-radius: 20px;
  color: #4b4966;
  background: #e6dce2b5;
  font: 750 .8rem/1.45 var(--serif);
}
.question-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.question-count { color: #6d6248; font-size: .84rem; font-variant-numeric: tabular-nums; }
.quiz-reading-link { display: none; }
.question-title { margin-top: 15px; color: #333b52; font-size: clamp(1.2rem, 2.15vw, 1.75rem); font-weight: 800; }
.question-instructions { margin: 6px 0 15px; color: #605b66; font-size: .86rem; }
.options { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.option {
  position: relative;
  display: grid;
  grid-template-columns: 17px 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 49px;
  padding: 7px 11px;
  border: 1px solid #aa97716b;
  border-radius: 9px;
  background: linear-gradient(112deg, #fff6e7c7, #eee5cb99);
  color: #383a4b;
  cursor: pointer;
  line-height: 1.47;
  transition: transform .19s var(--ease), background .24s ease, border-color .24s ease;
}
.option::before {
  position: absolute;
  inset: 7px auto 7px 0;
  width: 3px;
  border-radius: 3px;
  background: #898eac;
  content: "";
  transform: scaleY(0);
  transition: transform .24s var(--ease);
}
.option:hover,
.option:has(input:checked) { border-color: #8794b49c; background: linear-gradient(108deg, #e1e4edfa, #ece3d3); }
.option:has(input:checked)::before { transform: scaleY(1); }
.option:active { transform: scale(.993) translateX(2px); }
.option input { width: 15px; height: 15px; margin: 0; accent-color: #61698d; }
.option-letter {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #b6ab8a8c;
  border-radius: 6px;
  background: #f5eddbb5;
  color: #4d5574;
  font: 800 .89rem/1 Georgia, serif;
}
.options:disabled .option { cursor: default; }
.options:disabled .option:not(.correct):not(.incorrect) { border-color: #b19d7b68; background: #f8f0dcaa; }
.options:disabled .option.correct { border-color: #8bb495a8; background: #dbead3d1; }
.options:disabled .option.incorrect { border-color: #c8957eae; background: #f2ddcdbd; }
.quiz-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; }
.feedback {
  position: relative;
  margin-top: 13px;
  padding: 11px 55px 10px 13px;
  border: 1px solid #c1987b9c;
  border-radius: 9px;
  background: linear-gradient(110deg,#f8e5cd,#f3dfc897);
}
.feedback.is-correct { border-color: #83aa869c; background: linear-gradient(110deg, #dce9cf, #edf0d7c7); }
.feedback.fresh { animation: ink-read .43s var(--ease) both; }
.feedback-mark {
  position: absolute;
  top: 11px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #9e5040;
  border: 2px solid currentColor;
  outline: 1px solid currentColor;
  outline-offset: -5px;
  font: 800 1rem/1 var(--serif);
  transform: rotate(8deg);
}
.feedback.is-correct .feedback-mark { color: #46765a; }
.feedback.fresh .feedback-mark { animation: seal-drop .48s .06s var(--ease) both; }
.feedback strong { color: #81422f; font-size: .94rem; }
.feedback.is-correct strong { color: #32644e; }
.feedback p { margin: 3px 0; font-size: .91rem; }
.feedback .text-button { min-height: 32px; padding-left: 0; }
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 18px 0; }
.score-tile {
  padding: 9px 11px;
  border: 1px solid #a9a47887;
  border-radius: 8px;
  background: linear-gradient(142deg, #ffffe9c0, #e8e3d9);
}
.score-tile span { display: block; color: #646073; font-size: .76rem; }
.score-tile strong { color: #495374; font: 750 1.46rem/1.3 Georgia, serif; font-variant-numeric: tabular-nums; }
.summary > .review { padding-top: 9px; border-top: 1px solid var(--line); }
.review summary { padding: 5px 0; color: #495476; font-weight: 700; cursor: pointer; }
.review ol { padding-left: 1.4em; }
.review li { margin: 8px 0; }
.review li p { margin-top: 3px; color: var(--muted); font-size: .9rem; }

.archive-content {
  display: grid;
  grid-template-columns: minmax(206px, 267px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 3vw, 46px);
}
.archive-profile {
  position: sticky;
  top: 17px;
  padding: 15px;
  border: 1px solid #b3a78684;
  border-radius: 12px 24px 14px 14px;
  color: #4b5c70;
  background: linear-gradient(135deg, #f9f5eaf0, #e8edf0ea), var(--coast) center / cover;
  box-shadow: 0 11px 25px #6b65532a;
}
.archive-portrait { margin: 0; }
.archive-portrait img {
  display: block;
  width: 100%;
  max-height: 258px;
  object-fit: cover;
  object-position: 51% 39%;
  padding: 5px;
  border: 1px solid #e1c68c;
  border-radius: 10px 18px 3px 3px;
  background: #c5a47a;
  filter: sepia(.15);
}
.archive-portrait figcaption { padding: 9px 3px 4px; color: #65707b; font-size: .78rem; }
.archive-person { padding: 4px 3px 9px; }
.archive-person strong { display: block; color: #42556c; font: 400 2.17rem/1.17 var(--brush); }
.archive-person span { color: #80674d; font: 700 .92rem/1.3 Georgia, serif; letter-spacing: .075em; }
.archive-route {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid #a99a7a6b;
}
.archive-route a {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 7px;
  border-radius: 6px;
  color: #4e6378;
  font: 700 .86rem/1.48 var(--serif);
  transition: background .2s ease, color .2s ease;
}
.archive-route a:hover,
.archive-route a[aria-current="location"] { color: #76563c; background: #dbe7ecb3; }
.archive-route a > span { font: 700 1rem/1.25 Georgia, serif; }
.archive-entries { position: relative; display: grid; gap: 15px; --rail-left: 99px; --archive-progress: 0; }
.archive-entries::before,
.archive-entries::after {
  position: absolute;
  left: var(--rail-left);
  top: 16px;
  bottom: 5px;
  width: 1px;
  background: linear-gradient(#c1b394, #b7b9b6 80%, transparent);
  content: "";
}
.archive-entries::after {
  width: 2px;
  background: linear-gradient(#ad8a58, #849cab);
  transform: scaleY(var(--archive-progress));
  transform-origin: top;
  transition: transform .28s var(--ease);
}
.archive-entry {
  position: relative;
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  min-width: 0;
  scroll-margin-top: 19px;
}
.archive-entry::before {
  position: absolute;
  top: 25px;
  left: 95px;
  width: 9px;
  height: 9px;
  z-index: 1;
  border: 1px solid #b39263;
  border-radius: 50%;
  background: #e9c58b;
  box-shadow: 0 0 0 4px #d9bc8c5c;
  content: "";
}
.archive-entry .entry-period {
  padding-top: 18px;
  color: #8d6949;
  text-align: right;
  font: 750 .83rem/1.4 var(--serif);
  font-variant-numeric: tabular-nums;
}
.entry-sheet {
  min-width: 0;
  padding: 15px 20px 13px;
  border-radius: 8px 23px 12px 12px;
  box-shadow: 0 6px 21px #76664921;
}
.archive-entry.timeline-arrive .entry-sheet { animation: archive-from-below .55s var(--ease) both; }
.archive-entry.timeline-arrive[data-archive-motion="up"] .entry-sheet { animation-name: archive-from-above; }
.archive-entry.timeline-arrive::before { animation: archive-marker .65s var(--ease) both; }
.archive-entry.highlighted .entry-sheet { border-color: #ba9360; box-shadow: 0 0 0 3px #e8cd8880, 0 10px 24px #70634630; }
.archive-entry h2 { margin: 0 0 8px; color: #39455d; font-size: clamp(1.14rem, 2vw, 1.43rem); }
.archive-entry p { color: #444452; font-size: .95rem; line-height: 1.7; overflow-wrap: anywhere; }
.archive-entry .archive-action { margin-top: 6px; }
.archive-reflection {
  margin-top: 9px;
  padding: 7px 9px;
  border-left: 2px solid #8988a5;
  border-radius: 0 7px 7px 0;
  background: linear-gradient(90deg, #dedce5ad, #ede4d483);
}
.archive-reflection strong { margin-right: 5px; color: #4b5676; font: 800 .88rem/1.5 var(--serif); }

.footer { display: flex; justify-content: space-between; gap: 8px; padding-block: 15px 20px; color: #676d75; font-size: .77rem; }
.footer a:hover { color: #805d3e; text-decoration: underline; }
dialog {
  width: min(650px, calc(100% - 30px));
  max-height: calc(100% - 40px);
  padding: 22px;
  border: 1px solid #c0a679;
  border-radius: 18px;
  color: #3c3f54;
  background: linear-gradient(110deg, #fff5dabe, #f4ebd2b8), var(--paper-grain) center / cover;
  box-shadow: 0 21px 85px #030e0e9c;
}
dialog[open] { animation: slide-lit .31s var(--ease) both; }
dialog::backdrop { background: #5b5c694f; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog-head h2 { font-size: 1.35rem; }
#source-list ul { margin: 9px 0 14px; padding-left: 1.25em; }
#source-list li { padding-block: 4px; }
#source-list a { color: #49587d; text-decoration: underline; text-underline-offset: 3px; }
.image-explanation { color: var(--muted); font-size: .9rem; }

::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-group(folio-content) { animation-duration: .54s; }
::view-transition-image-pair(folio-content) { isolation: isolate; }
::view-transition-old(folio-content) { animation: scene-leave .24s ease-in both; }
::view-transition-new(folio-content) { animation: scene-unroll .54s var(--ease) both; }
.scene-arrive { animation: scene-unroll .53s var(--ease) both; }
.question-arrive .question-title { animation: slide-lit .33s .015s var(--ease) both; }
.question-arrive .option { animation: slide-lit .33s .05s var(--ease) both; }
.question-arrive .option:nth-of-type(2) { animation-delay: .09s; }
.question-arrive .option:nth-of-type(3) { animation-delay: .13s; }
.question-arrive .option:nth-of-type(4) { animation-delay: .17s; }
.quiz-complete .score-tile { animation: slide-lit .44s .11s var(--ease) both; }
.quiz-complete .score-tile:nth-of-type(2) { animation-delay: .16s; }
.quiz-complete .score-tile:nth-of-type(3) { animation-delay: .21s; }
.quiz-complete .score-tile:nth-of-type(4) { animation-delay: .26s; }
.ink-effect {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.page-turn {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: linear-gradient(112deg, transparent 13%, #e9d6a458 39%, #fff3d2ba 55%, #9c845d55 71%, transparent 82%);
  animation: paper-pass .59s var(--ease) both;
  pointer-events: none;
}
@keyframes bay-resolve {
  from { opacity: .68; filter: saturate(.73) blur(2px); }
  to { opacity: 1; filter: saturate(.88) blur(0); }
}
@keyframes mist-motes {
  0% { opacity: .2; transform: translate(-9px, 7px); }
  45% { opacity: .78; }
  100% { opacity: .35; transform: translate(9px, -10px); }
}
@keyframes portrait-lift {
  from { transform: translateY(13px) rotate(.8deg); opacity: .22; }
  to { opacity: 1; }
}
@keyframes slide-lit {
  from { transform: translateY(9px); opacity: .21; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes ink-read {
  from { transform: translateY(5px); opacity: .06; clip-path: inset(0 27% 0 0 round 6px); }
  to { transform: translateY(0); opacity: 1; clip-path: inset(0 0 0 0 round 6px); }
}
@keyframes scene-leave {
  to { transform: translateY(-9px) scale(.995); opacity: 0; }
}
@keyframes scene-unroll {
  from { transform: translateY(12px); opacity: .24; clip-path: inset(0 0 6% 0 round 12px); }
  to { transform: translateY(0); opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes paper-pass {
  from { transform: translateX(-105%) skewX(-7deg); opacity: .7; }
  to { transform: translateX(110%) skewX(-7deg); opacity: 0; }
}
@keyframes seal-drop {
  from { transform: translateY(-10px) rotate(20deg) scale(1.31); opacity: .42; }
  56% { transform: translateY(1px) rotate(5deg) scale(.97); opacity: 1; }
  to { transform: translateY(0) rotate(8deg) scale(1); opacity: 1; }
}
@keyframes chapter-light {
  from { opacity: .85; transform: translateX(-20%) scale(1.13); }
  to { opacity: 0; transform: translateX(39%) scale(1.03); }
}
@keyframes chapter-rain {
  from { opacity: .75; transform: translate(11%, -15%); }
  to { opacity: 0; transform: translate(-8%, 20%); }
}
@keyframes chat-from-right {
  from { transform: translateX(14px); opacity: .24; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes chat-from-left {
  from { transform: translateX(-10px); opacity: .3; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes chat-sheet {
  from { opacity: .18; transform: translateX(-9px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes chat-line {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes answer-beat {
  0%, 100% { opacity: .47; transform: translateY(0); }
  45% { opacity: 1; transform: translateY(-2px); }
}
@keyframes archive-from-below {
  from { transform: translateY(12px) translateX(4px); opacity: .48; }
  to { transform: translateY(0) translateX(0); opacity: 1; }
}
@keyframes archive-from-above {
  from { transform: translateY(-12px) translateX(4px); opacity: .48; }
  to { transform: translateX(0) translateY(0); opacity: 1; }
}
@keyframes archive-marker {
  from { box-shadow: 0 0 0 0 #d6b479b3; }
  to { box-shadow: 0 0 0 4px #d9bc8c5c; }
}

@media (max-width: 1060px) {
  .shell { width: calc(100% - 64px); }
  .overview,
  .quiz-workspace { gap: 16px; }
  .hero { min-height: 398px; }
  .hero-portrait { right: 8%; }
  .navigation { gap: 9px; }
}
@media (max-width: 780px) {
  .shell { width: calc(100% - 38px); }
  .header-inner { gap: 11px; grid-template-columns: 1fr auto 1fr; }
  .header-tools { gap: 8px; }
  .panel-header { padding-inline: 13px; }
  .chat-layout { grid-template-columns: minmax(185px, 205px) minmax(0, 1fr); gap: 13px; }
  .quiz-workspace { grid-template-columns: minmax(213px, .8fr) minmax(0, 1.4fr); }
  .quiz-card { min-height: 420px; }
  .archive-content { grid-template-columns: 180px minmax(0, 1fr); gap: 15px; }
  .archive-entries { --rail-left: 80px; }
  .archive-entry { grid-template-columns: 68px minmax(0, 1fr); gap: 23px; }
  .archive-entry::before { left: 76px; }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 27px); }
  .header-inner { grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px; min-height: 0; padding: 10px 0 7px; }
  .header-tools { grid-column: 2; grid-row: 1; gap: 6px; }
  .brand { gap: 7px; }
  .seal { width: 35px; height: 35px; font-size: 1.28rem; outline-offset: -4px; }
  .brand-copy strong { font-size: 1.17rem; }
  .brand-copy > span { font-size: .67rem; }
  .navigation { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: space-around; gap: 4px; }
  .navigation a { padding: 7px 7px; font-size: .82rem; }
  .navigation a::after { inset-inline: 4px; bottom: 1px; }
  .model-status { gap: 5px; font-size: .69rem; }
  .sound-toggle { min-height: 32px; padding-inline: 7px; }
  .main { padding-top: 13px; }
  .hero { min-height: 338px; border-radius: 18px 18px 8px 8px; }
  .hero-line { inset: 8px; border-radius: 12px 12px 3px 3px; }
  .hero-art { background-position: 62% 57%; }
  .hero::after { background: linear-gradient(90deg, #fff8e9ea, #fff8e9a2 63%, #fff6e53c), linear-gradient(0deg,#fcf3e591,transparent 48%); }
  .hero-content { width: 77%; padding: 27px 0 41px 18px; }
  .hero-kicker { margin-bottom: 12px; font-size: .72rem; gap: 7px; letter-spacing: .13em; }
  .hero-kicker::before { width: 18px; }
  .hero h1 { font-size: clamp(2.73rem, 12vw, 4.6rem); letter-spacing: .032em; }
  .hero-subtitle { margin-top: 8px; font-size: 1.07rem; letter-spacing: 0; }
  .hero-description { max-width: 22em; margin-top: 8px; font-size: .85rem; }
  .hero-actions { gap: 7px; margin-top: 14px; }
  .hero-actions .button { min-height: 41px; padding-inline: 10px; font-size: .83rem; }
  .hero-portrait { top: 15%; right: 6%; width: 22%; padding: 4px 4px 3px; }
  .hero-portrait::before { inset: -5px; }
  .hero-portrait figcaption { padding-top: 3px; font-size: .64rem; }
  .hero-portrait figcaption span:last-child { display: none; }
  .hero-credit { right: 13px; bottom: 12px; padding: 2px 5px; font-size: .67rem; }
  .overview,
  .chat-layout,
  .quiz-workspace { grid-template-columns: minmax(0,1fr); gap: 13px; }
  .overview { margin-top: 14px; }
  .overview-card { display: grid; grid-template-columns: minmax(92px, 30%) minmax(0, 1fr); }
  .overview-image { min-height: 132px; height: 100%; border-right: 1px solid #8d806541; border-bottom: 0; }
  .overview-image-chat { background-size: auto 200%; }
  .overview-image-quiz { background-position: left top; background-size: auto 200%; }
  .overview-image-archive img { top: 18px; right: 22%; width: 61%; }
  .overview-body { padding: 9px 11px 8px; }
  .overview-body h2 { font-size: 1.55rem; }
  .overview-body p:not(.overview-meta) { font-size: .82rem; }
  .overview-link { min-height: 30px; margin-top: 3px; }
  .quiz-workspace { grid-template-areas: "sheet" "itinerary"; }
  .chat-scroll { min-height: 233px; max-height: 420px; }
  .history-header { padding: 10px 11px 7px; }
  .chat-history { display: flex; max-height: none; overflow-x: auto; padding-block: 7px; }
  .history-entry { flex: 0 0 min(155px, 47%); min-height: 44px; padding-block: 4px; }
  .history-status { padding-block: 4px 6px; }
  .messages { padding: 12px 11px 6px; }
  .bubble { padding: 8px 9px; font-size: .9rem; }
  .suggestions { padding-inline: 11px; }
  .chip { min-height: 39px; }
  .composer { padding: 10px 11px; }
  .composer .button { padding-inline: 11px; }
  .page-heading { min-height: 109px; padding: 9px 5px 13px; margin-bottom: 14px; }
  .page-heading h1 { font-size: clamp(2.5rem, 9.4vw, 3.4rem); }
  .page-heading p { font-size: .86rem; }
  .page-heading .text-button { padding-inline: 8px; font-size: .78rem; }
  .archive-heading, .chat-heading { padding: 14px; }
  .quiz-card { min-height: 0; padding: 17px; border-radius: 12px 24px 12px 12px; }
  .quiz-card::after { width: 38px; height: 38px; }
  .quiz-intro { padding-top: 4px; }
  .quiz-intro::after { display: none; }
  .quiz-reading-link { display: inline-flex; padding-inline: 4px; font-size: .77rem; }
  .question-title { margin-top: 10px; }
  .question-count { font-size: .75rem; }
  .question-meta { gap: 5px; }
  .option { grid-template-columns: 16px 24px minmax(0,1fr); gap: 7px; min-height: 48px; padding: 5px 9px; }
  .option-letter { width: 23px; height: 23px; }
  .score-grid { grid-template-columns: repeat(2,1fr); }
  .archive-content { grid-template-columns: 1fr; }
  .archive-profile { position: relative; top: 0; display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 3px 14px; padding: 12px; }
  .archive-portrait { grid-row: span 2; }
  .archive-portrait img { max-height: 124px; }
  .archive-portrait figcaption { font-size: .71rem; }
  .archive-person { padding-block: 0 6px; }
  .archive-person strong { font-size: 1.83rem; }
  .archive-route { grid-template-columns: 1fr 1fr; }
  .archive-route a { padding: 4px 5px; font-size: .77rem; }
  .archive-entries { --rail-left: 9px; }
  .archive-entry { grid-template-columns: minmax(0,1fr); gap: 6px; padding-left: 23px; }
  .archive-entry::before { left: 5px; top: 7px; }
  .archive-entry .entry-period { padding-top: 1px; text-align: left; }
  .entry-sheet { padding: 12px 13px; }
  .footer { flex-wrap: wrap; padding-block: 13px 18px; }
}
@media (max-width: 360px) {
  .hero { min-height: 324px; }
  .hero-content { width: 78%; padding-left: 14px; }
  .hero h1 { font-size: clamp(2.27rem, 11.35vw, 2.65rem); }
  .hero-subtitle { font-size: .96rem; }
  .hero-portrait { right: 5%; width: 21%; }
  .model-status > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .page-heading .text-button { display: none; }
  .panel-title h2 { font-size: 1.62rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body { background: #fff; color: #141a17; }
  body::before, body::after, .header, .footer, .page-heading, .quiz-journey, .quiz-actions, dialog { display: none !important; }
  .shell { width: 100%; }
  .main { padding: 0; }
  .quiz-workspace { display: block; }
  .quiz-card { min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .quiz-card::after { display: none; }
  .score-tile { break-inside: avoid; }
}
