.word-forms-content :is(.card-extra-parts, .word-tense-more),
.card-extra-relations details {
  padding: 8px 12px;
  border: 1px solid #d9dccd;
  border-radius: 10px;
  background: #fbf9f0;
}
.word-forms-content :is(.card-extra-parts, .word-tense-more) summary,
.card-extra-relations summary {
  padding-block: 4px;
  color: #465c48;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.word-forms-content > section > h3,
.word-memory-content h3,
.card-extra-relations h3 { margin-block: 0 8px; }
.word-forms-content .word-pos-groups,
.card-extra-relations ul { gap: 8px; }
.word-forms-content .word-pos-group { min-width: 0; }
.card-extra-parts dl > div {
  display: grid;
  grid-template-columns: minmax(3em, auto) minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.card-extra-parts dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.card-extra-relations { display: grid; gap: 16px; }
.card-extra-relations details + details { margin-top: 8px; }
.card-extra-relations ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  padding: 0;
  list-style: none;
}
.card-extra-relations li {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: #f0f2e8;
  overflow-wrap: anywhere;
}
.card-extra-relations li .word-voice-control { margin: 0; }
.card-data-source { color: #4d6552; font-size: 12px; }
.handwriting-card-overlay .personal-handwriting-board {
  background: repeating-linear-gradient(#fffaf0 0 31px, #eeeadf 31px 32px);
}
.personal-handwriting-canvas { image-rendering: auto; }
.agnes-entry { margin-block: 8px 16px; }
.word-memory-content .agnes-entry { margin-block: 0; }
.agnes-launcher,
.agnes-dialog button,
.ink-tools button,
.ink-tools select {
  min-height: 44px;
  border: 1px solid #c9d4c6;
  border-radius: 10px;
  background: #ecf2e9;
  color: #253c2f;
  font: inherit;
  font-weight: 650;
  padding: 6px 12px;
  cursor: pointer;
}
.agnes-launcher:focus-visible, .agnes-dialog :is(button, textarea, select):focus-visible,
.ink-tools :is(button, select, input):focus-visible { outline: 2px solid #4e7156; outline-offset: 3px; }
.agnes-dialog {
  box-sizing: border-box;
  width: min(680px, calc(100% - 24px));
  height: min(700px, 88dvh);
  max-height: 88dvh;
  margin: auto;
  padding: 0;
  border: 1px solid #cbd4c6;
  border-radius: 16px;
  overflow: hidden;
  background: #faf9f3;
  color: #28362b;
}
.agnes-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.agnes-dialog::backdrop { background: rgb(27 40 32 / .36); }
.agnes-header, .agnes-history, .agnes-log, .agnes-footer { padding-inline: clamp(12px, 4vw, 24px); }
.agnes-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-block: 12px 8px; }
.agnes-header h2 { margin: 0; font-size: clamp(18px, 5vw, 23px); color: inherit; }
.agnes-context { display: block; color: #475a4b; overflow-wrap: anywhere; }
.agnes-actions, .agnes-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.agnes-history:empty { display: none; }
.agnes-history { grid-row: 2; }
.agnes-history label { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; font-size: 14px; }
.agnes-history select { min-width: 0; max-width: min(66%, 240px); min-height: 36px; border: 1px solid #c9d4c6; border-radius: 6px; background: #fffefa; color: inherit; }
.agnes-log { grid-row: 3; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding-block: 12px; }
.agnes-empty { color: #475a4b; margin: 0; }
.agnes-message { max-width: 88%; align-self: flex-start; padding: 8px 12px; border-radius: 10px; background: #eeeee7; overflow-wrap: anywhere; }
.agnes-message--user { align-self: flex-end; background: #e7efe4; }
.agnes-message strong { display: block; font-size: 13px; color: #475a4b; }
.agnes-message p { margin: 4px 0 0; line-height: 1.55; white-space: pre-wrap; }
.agnes-footer { grid-row: 4; display: grid; gap: 8px; padding-block: 8px 12px; background: #f6f7ef; }
.agnes-footer form { display: flex; align-items: end; gap: 8px; margin: 0; }
.agnes-footer textarea { flex: 1; min-width: 0; min-height: 48px; padding: 8px; resize: none; font-size: 16px; color: inherit; background: #fffefa; border: 1px solid #c9d4c6; border-radius: 10px; }
.agnes-footer button[type=submit]:not(:disabled) { background: #cadaC8; }
.agnes-footer button:disabled { opacity: .55; cursor: default; }
.agnes-footer small, .agnes-status { color: #475a4b; font-size: 12px; margin: 0; }
.agnes-status:empty { display: none; }
.ink-tools, .ink-tool-switch, .ink-tools label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ink-tools { margin: 4px 0; font-size: 14px; }
.ink-tools label[hidden] { display: none; }
.ink-tools button[aria-pressed="true"] { background: #dbe9d7; border-color: #7f9880; }
.ink-tools input[type=range] { width: clamp(70px, 21vw, 124px); min-height: 28px; accent-color: #597c5d; }
.ink-size-control output { min-width: 2ch; font-variant-numeric: tabular-nums; }
.personal-handwriting-board--eraser .personal-handwriting-canvas { cursor: crosshair; }
.ink-tools { display: grid; grid-template-columns: max-content minmax(0, 1fr); }
.ink-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; }
@media (max-width: 580px) {
  .ink-tools { grid-template-columns: minmax(0, 1fr); }
}
.agnes-settings { grid-row: 3 / 5; overflow: auto; display: grid; align-content: start; gap: 12px; padding: 12px clamp(12px, 4vw, 24px) 24px; }
.agnes-settings label { display: grid; gap: 4px; font-weight: 600; }
.agnes-settings input {
  width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 12px;
  border: 1px solid #c9d4c6; border-radius: 10px; background: #fffefa; color: inherit; font-size: 16px;
}
.agnes-settings input:focus-visible { outline: 2px solid #4e7156; outline-offset: 2px; }
.agnes-config-info { margin: 0; font-size: 14px; color: #475a4b; }
.agnes-settings small { color: #475a4b; }
.ink-color input[type=color] {
  width: 44px; height: 44px; padding: 4px; border: 1px solid #c9d4c6; border-radius: 10px;
  background: #fffefa; cursor: pointer;
}
.ink-lasso-tip { margin: 0; color: #475a4b; }
.personal-handwriting-board--lasso .personal-handwriting-canvas { cursor: crosshair; }
.ink-selection-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.agnes-page { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; width: 100%; height: min(730px, calc(100dvh - 160px)); min-height: 315px; }
.agnes-page h1 { margin: 0; font-size: clamp(20px, 5vw, 28px); }
.bottom-nav:has(.nav-item:nth-child(7)) { grid-template-columns: repeat(7,minmax(0,1fr)); }
.bottom-nav .nav-item { padding-inline: 3px; }
.notebook-favorite { display: inline-grid; align-items: center; gap: 4px; }
.notebook-favorite-status:empty { display: none; }
.notebook-favorite-status { font-size: 12px; color: #475a4b; }
.notebook-favorite button[aria-pressed=true] { background: #dbe9d7; }
.favorite-notebook {
  margin-block: 8px 16px; border: 1px solid #d9dccd; border-radius: 16px; background: #fbf9f0;
}
.favorite-notebook summary {
  min-height: 44px; padding: 8px 12px; cursor: pointer; color: #283e31; line-height: 1.6;
}
.favorite-notebook > summary { font-weight: 650; }
.favorite-notebook > summary span { margin-left: 8px; color: #475a4b; font-weight: 500; font-size: 14px; }
.notebook-content { display: grid; gap: 12px; padding: 0 12px 12px; }
.notebook-content input {
  width: 100%; min-height: 44px; padding: 8px 12px; font-size: 16px;
  color: inherit; border: 1px solid #c9d4c6; border-radius: 10px; background: #fffefa;
}
.notebook-page { background: #f0f2e8; border-radius: 10px; }
.notebook-page summary strong { margin-right: 8px; }
.notebook-page summary span { color: #475a4b; overflow-wrap: anywhere; }
.notebook-note { padding: 0 12px 12px; overflow-wrap: anywhere; }
.notebook-note .personal-note-save { margin-top: 8px; }
.notebook-text { white-space: pre-wrap; }
.notebook-ink-view { max-height: 440px; overflow: auto; background: #fffcf3; }
.notebook-ink-view canvas { display: block; width: 100%; height: auto; }
@media (max-width: 580px) {
  .ink-tools { grid-template-rows: auto minmax(96px, auto); align-content: start; row-gap: 4px; }
  .ink-controls { align-self: start; }
  .ink-lasso-tip { align-self: start; min-height: 44px; display: flex; align-items: center; }
}
.notebook-favorite { position: relative; }
.notebook-favorite-status:not(:empty) {
  position: absolute; z-index: 2; inset: calc(100% + 4px) 0 auto auto; width: max-content;
  max-width: min(220px, 70vw); padding: 4px 8px; border-radius: 6px; background: #f1f5e9;
}
.study-context-hint {
  margin-top: 8px; padding: 0 12px;
  background: #f5f5ec; border: 1px solid #d1d9cb; border-radius: 10px;
}
.study-context-hint summary { display: list-item; cursor: pointer; padding-block: 10px; color: #36513f; }
.study-context-hint p { margin: 0; padding-bottom: 12px; line-height: 1.55; color: #354337; overflow-wrap: anywhere; }
.study-context-blank { color: #4e7156; font-weight: 720; white-space: nowrap; }
.recall-controls { margin: 12px 0 16px; }
.recall-choice-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
:is(.recall-reveal, .recall-again, .recall-remembered) {
  display: grid; place-items: center; width: 100%; min-height: 48px; padding: 8px 12px;
  border: 1px solid #a9bdab; border-radius: 10px; color: #263f31; background: #dfeade;
  font: inherit; font-weight: 700; text-align: center; line-height: 1.25; cursor: pointer;
  transition: background-color 120ms ease-out, transform 100ms ease-out;
}
.recall-again { background: #f6f5ec; border-color: #c1c7b9; color: #39483d; }
:is(.recall-reveal, .recall-again, .recall-remembered):focus-visible,
.study-context-hint summary:focus-visible { outline: 2px solid #4e7156; outline-offset: 3px; }
:is(.recall-reveal, .recall-again, .recall-remembered):active:not(:disabled) { transform: translateY(1px); }
:is(.recall-reveal, .recall-again, .recall-remembered):disabled { opacity: .55; cursor: default; }
.recall-status { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; color: #4c5e51; font-size: 13px; }
.recall-status:not(:empty) { margin-top: 8px; }
.recall-status strong, .focused-practice-heading strong { font-weight: 750; font-variant-numeric: tabular-nums; }
.recall-shortcuts { margin-inline-start: auto; }
.focused-practice {
  margin-block: 16px; padding: 12px; text-align: start;
  background: #f4f6ee; border: 1px solid #d1d9cb; border-radius: 16px;
}
.focused-practice-heading { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.focused-practice-heading h2 { margin: 0; font-size: clamp(17px, 4vw, 22px); }
.focused-practice-heading span { color: #4c5e51; white-space: nowrap; }
.focused-practice-heading strong { font-size: 1.2em; color: #273f31; }
.focused-practice ul {
  display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px),1fr));
  padding: 0; margin: 12px 0; list-style: none;
  max-height: 14rem; overflow: auto; overscroll-behavior: contain;
}
.focused-practice li { display: grid; gap: 4px; padding: 8px; border-radius: 6px; background: #fcfbf6; overflow-wrap: anywhere; }
.focused-practice li small { color: #4c5e51; }
@media (prefers-reduced-motion: reduce) {
  :is(.recall-reveal, .recall-again, .recall-remembered) { transition: none; }
}
.ink-lasso-controls { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.ink-lasso-actions { display: flex; align-items: center; gap: 8px; }
.ink-lasso-actions button:not(:disabled):first-child { color: #742d37; background: #f4e5e5; border-color: #d7b9bb; }
.ink-tools button:disabled { opacity: .55; cursor: default; }
@media (max-width: 580px) {
  .ink-lasso-controls { align-self: start; }
  .ink-lasso-controls .ink-lasso-tip { min-height: 36px; }
}
.notebook-date {
  display: block; padding-inline-start: 1em; font-size: 12px; color: #475a4b;
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.agnes-log { background-position: center; background-size: cover; }
.agnes-message strong.agnes-sender { display: flex; align-items: center; gap: 8px; }
.agnes-avatar, .ai-theme-preview { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.ai-theme-settings, .ai-profiles { display: grid; gap: 12px; }
.ai-theme-settings label { display: grid; gap: 4px; min-width: 0; }
.ai-theme-settings input, .ai-theme-settings select { max-width: 100%; min-height: 38px; }
.ai-image-setting { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ai-theme-preview { width: 44px; height: 44px; }
.ai-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-profile-list { list-style: none; display: grid; gap: 8px; padding: 0; margin: 0; }
.ai-profile-list li { display: grid; gap: 4px; padding: 8px; border-radius: 6px; background: #f0f2e8; min-width: 0; overflow-wrap: anywhere; }
.ai-profile-list small { color: #475a4b; }
.ai-profiles form.agnes-settings { padding: 12px 0 0; border-top: 1px solid #d9dccd; }
.agnes-settings label.ai-remember-key { display: flex; align-items: center; gap: 8px; }
.agnes-settings label.ai-remember-key input { width: 18px; height: 18px; min-height: 0; accent-color: #597c5d; }
.review-practice-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.review-practice-actions label { display: flex; align-items: center; gap: 8px; }
.review-practice-actions select { min-height: 40px; border: 1px solid #c1cdbd; border-radius: 6px; color: #283e31; background: #fffefa; }
.review-panel .review-practice-start:not(:disabled) { background: #dfeade; border-color: #9bae9c; color: #263f31; font-weight: 700; }
.review-practice-status { margin: 8px 0 0; color: #475a4b; font-size: 13px; }
.review-practice-status:empty { display: none; }
.review-panel li small { display: block; color: #475a4b; max-width: 19ch; text-align: start; }
.review-tray-slot:not(:empty) { margin-block: 8px 12px; }
.review-tray-slot .review-tray { position: static; transform: none; width: 100%; }
.review-tray-slot .review-tray summary { min-height: 44px; display: list-item; padding: 10px 12px; }
.review-tray-slot .review-panel {
  position: static; margin-top: 8px; max-height: min(52dvh, 420px);
  box-shadow: none; border-radius: 10px; padding: 12px;
}
body:has(.review-tray-slot .review-tray:not([hidden])) .app-frame { padding-bottom: calc(105px + env(safe-area-inset-bottom)); }
.pet-touch {
  display: grid; place-items: center; background: transparent; border: 0; padding: 0;
  color: inherit; cursor: pointer; touch-action: manipulation;
}
.pet-figure { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.pet-figure .pet-touch { max-width: 100%; }
.pet-figure img:not(.mascot-photo) { width: min(100%, 150px); }
.pet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pet-actions button, .agnes-read-aloud {
  background: #e9f0e4; color: #324f3d; border: 1px solid #c5d4c5; border-radius: 6px;
  min-height: 40px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 13px;
}
.pet-figure .pet-actions { justify-content: center; }
.pet-reaction { padding-inline: 4px; min-height: 1.35em; font-size: 12px; color: #385343; text-align: center; }
.pet-touch:focus-visible, .pet-actions button:focus-visible { outline: 2px solid #4e7156; outline-offset: 2px; }
.pet-touch img[data-pet-action] { animation: pet-nudge 320ms ease-out both; }
.pet-touch img[data-pet-action="feed"] { animation-name: pet-snack; }
@keyframes pet-nudge { 45% { transform: translateY(-4px) rotate(-4deg) scale(1.035); } }
@keyframes pet-snack { 35% { transform: scale(.96); } 66% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .pet-touch img[data-pet-action] { animation: none; } }
.agnes-message .agnes-read-aloud { margin-top: 8px; min-height: 40px; }
.agnes-read-aloud[aria-pressed=true] { background: #dbe9d7; }
.notebook-history-row { position: relative; }
.notebook-history-row > .notebook-page > summary { padding-inline-end: 60px; min-height: 60px; }
.history-note-favorite {
  position: absolute; inset: 8px 8px auto auto; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; background: #fffefa; color: #625b49;
  border: 1px solid #c8c7b9; border-radius: 10px; cursor: pointer;
}
.note-favorite-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.note-favorite-star { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; flex: none; }
:is(.history-note-favorite, .note-favorite-action)[aria-pressed=true] .note-favorite-star {
  fill: #e8b940; stroke: #78551a;
}
.history-note-favorite[aria-pressed=true] { border-color: #cfaa5f; background: #fff4d2; }
.history-note-favorite:focus-visible { outline: 2px solid #4e7156; outline-offset: 2px; }
.agnes-dialog .agnes-message, .ai-theme-swatch .agnes-message { background-color: var(--agnes-assistant-bubble, #eeeee7); }
.agnes-dialog .agnes-message--user, .ai-theme-swatch .agnes-message--user { background-color: var(--agnes-user-bubble, #e7efe4); }
.ai-theme-swatch {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 54px;
  padding: 8px 12px; background-position: center; background-size: cover; border: 1px solid #d9dccd; border-radius: 10px;
}
.ai-theme-swatch .agnes-message { align-self: auto; padding: 4px 12px; border: 1px solid #6c6c561e; }
.site-theme-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.site-theme-options legend { padding: 0; margin-bottom: 12px; font-weight: 650; }
.site-theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr)); gap: 8px; }
.site-theme-option {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px;
  min-height: 48px; padding: 8px; color: var(--preview-ink); border: 1px solid var(--preview-line);
  background: var(--preview-paper); border-radius: 10px; cursor: pointer;
}
.site-theme-option:has(input:checked) { border-color: var(--preview-accent); background: var(--preview-accent-surface); }
.site-theme-option input { margin: 0; accent-color: var(--preview-accent); }
.site-theme-colors {
  display: flex; align-items: center; justify-content: center; padding: 4px; grid-column: 1 / -1;
  min-height: 24px; border: 1px solid #5b51481f; border-radius: 6px;
}
.site-theme-colors span { width: 18px; height: 16px; }
.site-theme-status { color: var(--preview-ink); font-size: 13px; margin: 8px 0 0; }
.site-theme-status:empty { display: none; }

:root[data-site-theme]:not([data-site-theme="original"]) {
  --preview-ink: #343b38;
  --preview-paper: var(--site-surface);
  --preview-accent: var(--site-accent);
  --preview-accent-surface: var(--site-accent-soft);
  --preview-accent-hover: var(--site-accent-hover);
  --preview-accent-border: var(--site-accent-border);
  --preview-line: var(--site-line);
  --paper: var(--site-surface);
  --paper-deep: var(--site-canvas);
  --line: var(--site-line);
  --ink: #343b38;
  --muted: #535b55;
  background-color: var(--site-surround);
  color: var(--ink);
}
[data-site-theme]:not([data-site-theme="original"]) body { background-color: var(--site-surround); }
[data-site-theme]:not([data-site-theme="original"]) :is(.app-frame, .bottom-nav) { background: var(--site-canvas); }
[data-site-theme]:not([data-site-theme="original"]) .bottom-nav { border-color: var(--site-line); }
[data-site-theme]:not([data-site-theme="original"]) :is(.today-page .buddy-card, .today-page .daily-review-card, .companion-dock) {
  background: var(--site-accent-soft); border-color: var(--site-accent-border);
}
[data-site-theme]:not([data-site-theme="original"]) :is(
  .study-card, .quiz-card, .favorite-notebook, .arcade-card, .compact-section,
  .agnes-dialog, .ink-color input, .handwriting-card-overlay.personal-handwriting-region, .personal-text-editor
) { background-color: var(--site-surface); border-color: var(--site-line); }
[data-site-theme]:not([data-site-theme="original"]) :is(.handwriting-overlay-toolbar, .meaning-panel, .notebook-page, .agnes-footer) {
  background: var(--site-canvas); border-color: var(--site-line);
}
[data-site-theme]:not([data-site-theme="original"]) .handwriting-card-overlay .personal-handwriting-board {
  background: repeating-linear-gradient(var(--site-surface) 0 31px, var(--site-line) 31px 32px);
}
[data-site-theme]:not([data-site-theme="original"]) :is(
  .wordbook-tabs button, .app-frame .button--secondary, .study-card .word-note-launcher,
  .study-card .word-forms-panel > summary, .study-card .word-voice-button, .recall-again,
  .pet-actions button, .personal-note-save, .agnes-launcher
) { background: var(--site-surface); color: var(--site-accent); border-color: var(--site-accent-border); }
[data-site-theme]:not([data-site-theme="original"]) :is(
  .wordbook-tabs button.active, .recall-reveal, .recall-remembered, .review-panel .review-practice-start:not(:disabled)
) { background: var(--site-accent-soft); color: var(--site-accent); border-color: var(--site-accent-border); }
[data-site-theme]:not([data-site-theme="original"]) :is(.today-page .progress-track span, .session-progress span) {
  background: var(--site-accent);
}
.pet-feeding {
  width: min(360px, calc(100% - 24px)); padding: 16px; color: var(--preview-ink);
  background: var(--preview-paper); border: 1px solid var(--preview-line); border-radius: 16px;
}
.pet-feeding::backdrop { background: #202b2590; }
.pet-feeding h3 { margin: 0 0 12px; font-size: 18px; }
.pet-feeding .pet-snacks { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.pet-feeding .pet-snacks button { background: var(--preview-accent-surface); color: var(--preview-accent); min-height: 44px; }
.pet-touch img[data-pet-action="pat"] { animation-name: pet-pat; }
.pet-touch img[data-pet-action="watermelon"] { animation-name: pet-snack; }
.pet-touch img[data-pet-action="apple"] { animation-name: pet-nod; }
.pet-touch img[data-pet-action="strawberry"] { animation-name: pet-berry; }
@keyframes pet-pat { 60% { transform: translateY(3px) rotate(5deg) scale(.98); } }
@keyframes pet-nod { 40% { transform: translateY(3px) rotate(-6deg); } 72% { transform: rotate(3deg); } }
@keyframes pet-berry { 35% { transform: translateY(-7px) scale(1.06); } 75% { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) {
  .pet-touch img[data-pet-action] { animation: none; }
}
.ai-voice-settings { display: grid; gap: 12px; min-width: 0; }
.ai-voice-settings p { margin: 0; }
.ai-voice-settings audio { width: 100%; max-width: 360px; }
.ai-voice-settings label { display: grid; grid-template-columns: minmax(5em,auto) minmax(0,1fr) auto; align-items: center; gap: 8px; }
.ai-voice-settings :is(input,select) { max-width: 100%; min-width: 0; accent-color: var(--preview-accent); }
.ai-voice-settings select { min-height: 44px; color: var(--preview-ink); background: var(--preview-paper); border: 1px solid var(--preview-line); border-radius: 6px; }
.ai-voice-settings output { min-width: 4ch; font-variant-numeric: tabular-nums; text-align: end; }
.pet-touch { position: relative; }
.pet-feeding .pet-snacks button { display: grid; place-items: center; gap: 4px; }
.pet-feeding .pet-snacks button span { font-size: 22px; }
.pet-food-bite {
  position: absolute; z-index: 2; left: calc(50% - 13px); top: 54%; width: 26px; height: 26px;
  font-size: 22px; line-height: 26px; pointer-events: none;
  animation: pet-apple-bite .9s ease-in-out both;
}
.pet-food-bite[data-food="watermelon"] { animation: pet-watermelon-bite 1.2s ease-in-out both; }
.pet-touch img[data-pet-action="apple"] { animation: pet-nod .9s ease-out both; }
.pet-touch img[data-pet-action="watermelon"] { animation: pet-watermelon-chew 1.2s ease-in-out both; }
@keyframes pet-apple-bite {
  0% { transform: translate(28px, 15px) rotate(18deg); }
  58% { transform: translate(3px, 2px) rotate(-9deg); opacity: 1; }
  76% { transform: translate(0) scale(.62) rotate(7deg); opacity: .9; }
  100% { transform: translate(0) scale(.12); opacity: 0; }
}
@keyframes pet-watermelon-bite {
  0% { transform: translate(-28px, 22px) rotate(-20deg); }
  45% { transform: translate(-3px, 4px) rotate(5deg); }
  58% { transform: translate(0) scale(.72); }
  72% { transform: translate(-7px, 6px) scale(.72); opacity: 1; }
  90% { transform: translate(0) scale(.32); opacity: .9; }
  100% { transform: translate(0) scale(.12); opacity: 0; }
}
@keyframes pet-watermelon-chew {
  44%, 75% { transform: translateY(2px) scale(.97); }
  57%, 88% { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .pet-food-bite, .pet-touch img:is([data-pet-action="apple"],[data-pet-action="watermelon"]) { animation: none; }
  .pet-food-bite { transform: translate(16px,15px); }
}
.ai-profile-editor {
  width: min(500px, calc(100% - 24px)); max-height: 88vh; max-height: 88dvh;
  margin: auto; padding: 16px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--preview-line); border-radius: 16px;
  background: var(--preview-paper); color: var(--preview-ink);
}
.ai-profile-editor::backdrop { background: rgb(29 38 32 / .45); }
.ai-profile-editor h2 { margin: 0; font-size: 20px; }
.ai-profile-editor .agnes-settings { overflow: visible; }
.ai-profile-editor .ai-profile-actions button[type="submit"] {
  background: var(--preview-accent-surface); color: var(--preview-accent); border-color: var(--preview-accent-border);
}
.study-upgrade-row,.pet-outfits {display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.pet-care-body {display:grid;gap:16px}
.pet-care-body h3,.pet-postcard p {margin:0}
.pet-care-body button,.mock-exam-dialog button {background:#eff3e9;color:#37463c;border:1px solid #bbc6b9;border-radius:8px;padding:8px 12px;font:inherit;min-height:42px}
.pet-outfits button[aria-pressed="true"] {background:#dce9da;border-color:#728a70}
.pet-outfits small {display:block;font-size:.78em}
.pet-postcard {margin:12px 0;padding:12px 16px;border-inline-start:3px solid #a8bd9a;background:#faf6eb}
.pet-touch {touch-action:pan-y}
.pet-portrait {display:inline-grid;position:relative;place-items:center;max-width:100%;pointer-events:none}
.pet-portrait img {display:block}
.pet-outfit {position:absolute;inset:auto;width:64%;height:auto;left:18%;top:47%;pointer-events:none}
.pet-outfit--hat {top:0}
.pet-outfit--satchel {top:45%}
.pet-touch:has([data-pet-action="watermelon"])::after {content:"";position:absolute;left:50%;top:57%;width:14%;height:8%;border-radius:50%;background:#f4e9d7;pointer-events:none;animation:pet-wipe 1.6s both}
@keyframes pet-wipe {0%,64%,100%{opacity:0}70%{opacity:1;transform:translateX(-65%) rotate(-12deg)}86%{opacity:1;transform:translateX(25%) rotate(12deg)}}
.pet-touch:has([data-pet-action="strawberry"])::after {content:"⌒ ⌒";position:absolute;top:40%;left:0;width:100%;color:#514435;font-size:clamp(12px,1.6vw,18px);font-weight:700;pointer-events:none;animation:pet-smile 1.1s both}
@keyframes pet-smile {0%,100%{opacity:0}42%,76%{opacity:1}}
@media(prefers-reduced-motion:reduce){.pet-touch::after{display:none}}
.word-exam-mode {padding:12px 0}
.mock-exam-dialog {box-sizing:border-box;inset:0;width:100%;max-width:none;height:100dvh;max-height:none;margin:0;border:0;background:var(--preview-paper,#faf8ef);padding:0 0 max(18px,env(safe-area-inset-bottom));overscroll-behavior:contain;color:inherit}
.mock-exam-dialog::backdrop {background:#30352655}
.mock-exam-dialog .exam-passage {white-space:pre-line}
.mock-exam-dialog .cloze-fullscreen-header {position:sticky;top:0;z-index:1;background:var(--preview-paper,#faf8ef)}
.mock-exam-dialog > button {display:block;margin:8px auto}
.study-backup-preview {padding:12px;background:#f3f1e8;border-radius:10px}
.study-backup input {display:block;max-width:100%}
