/* A quiet daily entry and shared mobile lesson chrome. */
.today-shell { width: min(100%, 640px); margin: 16px auto; display: grid; gap: 16px; }
.today-card { padding: clamp(20px, 4vw, 32px); border: 1px solid var(--border, #d7e6da); border-radius: 24px; background: var(--surface, #fff); color: var(--ink, #173b32); }
.today-greeting { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.today-greeting p { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.today-avatar { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; font-size: 30px; }
.today-avatar img { width: 100%; height: 100%; object-fit: contain; }
.today-eyebrow { color: var(--muted, #52695f); margin: 0 0 6px; }
.today-main h1 { margin: 0 0 24px; font-size: clamp(1.7rem, 6vw, 2.3rem); line-height: 1.2; text-shadow: none; color: inherit; }
.today-main > .button, .hamyon-next-action > .button { display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; text-align: center; }
.today-progress { display: grid; gap: 8px; margin-top: 28px; }
.today-progress progress { width: 100%; height: 10px; accent-color: #168b4d; }
.today-progress small, .today-next { color: var(--muted, #52695f); line-height: 1.5; }
.today-next { margin: 20px 0 0; }
.today-discovery summary, .study-more > summary, .study-settings > summary { min-height: 48px; padding: 12px 0; cursor: pointer; font-weight: 800; }
.today-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }
.today-links a { display: inline-flex; min-height: 48px; align-items: center; padding: 8px 16px; border-radius: 12px; background: var(--surface-sunken, #edf6ef); color: var(--ink, #173b32); }
.hamyon-next-action { margin-bottom: 16px; }
.hamyon-next-action h2 { margin: 0; color: inherit; text-shadow: none; }
.focus-toolbar { display: none; }
.study-more { margin-top: 16px; }
.study-settings { margin-top: 12px; }
@media (max-width: 859px) {
  body.learning-focus { --app-bottom-height: 0px; padding-bottom: 0; }
  .learning-focus .site-header, .learning-focus .mobile-tabbar { display: none !important; }
  .learning-focus .focus-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--surface, #fff); color: var(--ink, #173b32); }
  .focus-exit { display: inline-flex; min-height: 48px; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
  .focus-toolbar > span { font-size: .85rem; color: var(--muted, #52695f); }
  .learning-focus .page-shell { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); min-height: 0; }
  .learning-focus .word-study-hero { display: none; }
  .learning-focus .study-layout { display: flex; flex-direction: column; gap: 12px; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .learning-focus .study-layout > .study-card { width: 100%; margin: 0; }
  .learning-focus .study-media { width: min(100%, 220px); margin-inline: auto; height: auto; aspect-ratio: 1; }
  .learning-focus .study-media img { width: 100%; height: 100%; object-fit: contain; }
  .learning-focus .study-audio-launcher { flex-wrap: wrap; }
  .learning-focus .study-card .button, .learning-focus .speaker-button { min-height: 48px; }
  .learning-focus .speaker-button { min-width: 48px; }
  .learning-focus .study-understood-form .button { min-height: 56px; }
  .learning-focus .game-toast { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); min-width: 0; }
  .learning-focus .success-screen { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .learning-focus .global-support-fab { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .today-page .page-shell { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .learning-focus *, .today-page * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.focus-word-step { margin: 0 0 8px; color: var(--muted); font-size: .9rem; text-align: center; }
.study-settings select { min-height: 48px; }

.learning-focus .study-layout { display: block; max-width: 900px; margin-inline: auto; }
.learning-focus .study-understood-form { grid-column: 1 / -1; }
@media (max-width: 859px) {
  .learning-focus .focus-toolbar { padding-right: 76px; }
  .learning-focus .focus-toolbar > span { display: none; }
  .learning-focus #learning-guide-root .help-hub { top: calc(8px + env(safe-area-inset-top)); bottom: auto; right: 12px; }
  .learning-focus #learning-guide-root .help-hub-panel { top: calc(100% + 8px); bottom: auto; }
  .learning-focus #learning-guide-root .help-hub .global-support-fab-icon { width: 48px; height: 48px; border: 0; box-shadow: none; }
  .learning-focus .study-understood-form { bottom: calc(8px + env(safe-area-inset-bottom)); }
  .learning-focus .study-floating-audio { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .today-page .site-header > .learning-language-switcher, .today-page .site-header > .app-fullscreen-toggle { display: none; }
}

.learning-focus .study-audio-launcher { grid-template-columns: 1fr; margin: 8px 0; }

/* The mobile day entry uses the same schedule data, with the full editor one link away. */
.day-agenda, .room-agenda-back { display: none; }
@media (max-width: 859px) {
  .learning-room[data-room-view="agenda"] > .room-detail-content { display: none; }
  .learning-room[data-room-view="agenda"] > .day-agenda { display: grid; gap: 20px; }
  .room-agenda-back { display: inline-flex; align-items: center; min-height: 48px; margin-bottom: 12px; color: var(--ink); }
  .agenda-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .agenda-heading p { margin: 0; color: var(--muted); font-size: .85rem; }
  .agenda-heading h1 { margin: 4px 0 0; font-size: 1.8rem; color: var(--ink); text-shadow: none; }
  .agenda-heading > a, .agenda-links a { display: inline-flex; min-height: 48px; align-items: center; padding: 8px; color: var(--ink); }
  .agenda-group { padding: 18px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
  .agenda-group h2 { margin: 0 0 12px; font-size: 1.15rem; color: var(--ink); text-shadow: none; }
  .agenda-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; min-width: 0; }
  .agenda-item + .agenda-item { border-top: 1px solid var(--border); }
  .agenda-item h3 { margin: 0; color: var(--ink); font-size: 1rem; overflow-wrap: anywhere; }
  .agenda-item p { margin: 5px 0 0; color: var(--muted); font-size: .85rem; }
  .agenda-item .button { flex-shrink: 0; min-height: 48px; padding: 10px 12px; }
  .agenda-primary { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
  .agenda-primary .button { min-height: 56px; justify-content: center; margin-top: 8px; }
  .agenda-later time { color: var(--muted); white-space: nowrap; }
  .agenda-empty { color: var(--muted); line-height: 1.5; margin: 0; }
  .agenda-done summary { min-height: 48px; padding: 12px 0; cursor: pointer; color: var(--ink); }
  .agenda-done .agenda-item { justify-content: flex-start; }
  .agenda-links { display: flex; gap: 8px; flex-wrap: wrap; }
  .learning-focus .focus-toolbar > .focus-step { display: block; font-size: .8rem; text-align: right; }
  .learning-focus .review-stage-layout { margin-top: 0; }
  .learning-focus .review-stage-layout :is(.focused-review-heading,.stage-five-header,.stage-six-header,.stage-seven-header,.stage-eight-header,.audio-connector-header) { background: var(--surface); color: var(--ink); box-shadow: none; border: 0; border-radius: 16px; padding: 12px; }
  .learning-focus .review-stage-layout :is(.focused-review-heading,.stage-five-header,.stage-six-header,.stage-seven-header,.stage-eight-header,.audio-connector-header) :is(h1,p,span) { color: var(--ink); }
  .learning-focus :is(.image-review-mascot,.audio-connector-mascot,.stage-five-mascot,.stage-six-mascot,.stage-seven-mascot,.stage-eight-mascot,.review-mascot-banner,.selected-profile-chip,.review-exercise-illustration) { display: none; }
  .learning-focus .review-stage-layout > .page-heading { padding: 12px; }
  .learning-focus .review-stage-layout > .page-heading > a { display: none; }
  .learning-focus :is(.focused-review,.audio-connector-shell,.stage-six-shell,.stage-seven-shell,.stage-eight-shell) { padding-inline: 0; }
  .learning-focus .chunk-practice-feedback[data-state="correct"] { color: var(--ink); }
  .learning-focus .chunk-practice-feedback[data-state="wrong"] { color: var(--ink); }
  .learning-focus [data-chunk-practice] > .study-card[hidden] { display: none; }
  .learning-focus .story-container { width: 100%; margin: 0 auto 20px; }
  .learning-focus .scene-card { padding: 16px; border-radius: 20px; background: var(--surface); box-shadow: none; }
  .learning-focus .decoration-circle { display: none; }
  .learning-focus .scene-progress-bar { height: 8px; margin-bottom: 12px; }
  .learning-focus .scene-card > .eyebrow { margin-bottom: 12px; }
  .learning-focus .scene-text { color: var(--ink); }
  .learning-focus .story-player { gap: 8px; }
  .learning-focus .scene-nav { gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; }
  .learning-focus .btn-nav { min-height: 48px; justify-content: center; padding: 12px 16px; }
  .learning-focus :is(.btn-toggle,.btn-select-answer,.btn-play-audio,.mode-toggle) { min-height: 48px; }
  .learning-focus .answer-card { min-width: 0 !important; flex-basis: 100% !important; }
  .learning-focus .result-card { margin: 12px auto; padding: 24px 16px; box-shadow: none; }
  .learning-focus .stars { font-size: 2rem; }
}
.focus-training-note { max-width: 900px; margin: 0 auto 12px; padding: 12px; border-radius: 12px; background: var(--surface-sunken); color: var(--ink); }
@media (max-width: 859px) {
  .learning-focus [data-chunk-practice].chunk-task-active .primary-study-card .study-word-body { display: none; }
}

@media (max-width: 859px) {
  .agenda-more > summary { min-height: 48px; padding: 14px 0; color: var(--ink); cursor: pointer; }
  .agenda-later time { font-size: .85rem; }
  .learning-room-page .site-header > .learning-language-switcher,
  .learning-room-page .site-header > .app-fullscreen-toggle { display: none; }
}

@media (max-width: 859px) {
  body.learning-focus .review-stage-layout[data-review-stage] :is(.focused-review-heading,.stage-five-header,.stage-six-header,.stage-seven-header,.stage-eight-header,.audio-connector-header) { background: var(--surface) !important; color: var(--ink) !important; box-shadow: none !important; }
  body.learning-focus .review-stage-layout[data-review-stage] :is(.focused-review-heading,.stage-five-header,.stage-six-header,.stage-seven-header,.stage-eight-header,.audio-connector-header) :is(h1,p,span) { color: var(--ink) !important; text-shadow: none !important; }
}
/* A task's hidden reference/hint must never be revealed by legacy display rules. */
.learning-focus [hidden] { display: none !important; }

@media (max-width: 859px) { .agenda-primary > .button { width: 100%; justify-self: stretch; } }

/* Wallet: one recommended action, with editing and the full stage map on request. */
.hamyon-today-page .hamyon-today-toolbar { display: grid; gap: 12px; }
.hamyon-today-page .hamyon-today-heading h1 { font-size: clamp(1.5rem, 5vw, 2rem); text-shadow: none; }
.hamyon-today-page .hamyon-today-summary { width: 100%; max-width: none; min-height: 0; padding: 14px 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: none; }
.hamyon-today-page .hamyon-today-progress-copy { display: flex; gap: 8px 20px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.hamyon-today-page .hamyon-next-action h2 { font-size: 1.35rem; }
.hamyon-today-page .hamyon-today-ready-callout { display: block; padding: 0; margin-top: 12px; background: none; border: 0; box-shadow: none; }
.hamyon-today-page .hamyon-ready-note { color: var(--muted); margin: 0 0 16px; }
.hamyon-today-page .hamyon-today-check-button { min-height: 56px; width: 100%; }
.hamyon-settings { margin-bottom: 16px; }
.hamyon-settings > summary, .hamyon-review-section > summary { min-height: 48px; padding: 12px 0; cursor: pointer; font-weight: 800; color: var(--ink); }
.hamyon-word-options { position: relative; }
.hamyon-word-options > summary { display: grid; place-items: center; min-height: 48px; min-width: 48px; list-style: none; cursor: pointer; font-size: 1.4rem; color: var(--ink); }
.hamyon-word-options > summary::-webkit-details-marker { display: none; }
.hamyon-word-options[open] > form { position: absolute; right: 0; top: 100%; z-index: 5; padding: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.hamyon-word-options .hamyon-remove-word { min-height: 48px; white-space: nowrap; }
.hamyon-rest h2 { font-size: 1.3rem; color: var(--ink); text-shadow: none; }
.hamyon-rest p { color: var(--muted); line-height: 1.5; }
.hamyon-rest-check { display: inline-grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--surface-sunken); color: var(--primary); font-size: 1.4rem; }
.hamyon-all-reviews { display: inline-flex; min-height: 48px; align-items: center; margin-top: 12px; }
/* Quiz: only the current question is visible, with explicit next/previous controls. */
.story-quiz-page [hidden] { display: none !important; }
.quiz-position { color: var(--muted); font-weight: 800; scroll-margin-top: 20px; }
.quiz-step-actions { display: flex; gap: 12px; margin-top: 20px; justify-content: space-between; }
.quiz-step-actions .button { min-height: 52px; }
.story-quiz-page #next-btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.story-quiz-page .answer-card[data-restored="correct"] { border-color: var(--primary) !important; background: var(--surface-sunken) !important; }
.story-quiz-page .answer-card[data-restored="wrong"] { border-color: #d54949 !important; }
@media (max-width: 859px) {
  .hamyon-today-page .site-header > .learning-language-switcher, .hamyon-today-page .site-header > .app-fullscreen-toggle { display: none; }
  .hamyon-today-page .hamyon-words-heading .treasure-kicker { display: none; }
  .hamyon-today-page .hamyon-today-words-card { padding: 16px; }
  .hamyon-today-page .hamyon-review-section { padding: 8px 16px; }
  .story-quiz-page .story-quiz-heading { margin-bottom: 12px !important; gap: 8px !important; }
  .story-quiz-page .story-quiz-heading h1 { font-size: 1.45rem !important; }
  .story-quiz-page .story-quiz-heading > div > p:not(.eyebrow) { display: none; }
  .story-quiz-page .question-card { padding: 16px !important; }
  .story-quiz-page .scene-nav { margin-top: 12px; }
}
/* Keep the words readable in either theme; colour lives in the illustrations. */
:root[data-theme] .hamyon-today-page .hamyon-today-words-card {
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
:root[data-theme] .hamyon-today-page .hamyon-today-words-card h2,
:root[data-theme] .hamyon-today-page .hamyon-today-word-copy strong { color: var(--ink); }
:root[data-theme] .hamyon-today-page .hamyon-today-word-copy span { color: var(--muted); }
:root[data-theme] .hamyon-today-page .hamyon-today-word:nth-child(n) {
  background: var(--surface-sunken); border-color: var(--border); box-shadow: none; color: var(--ink);
}
:root[data-theme] .hamyon-today-page .hamyon-today-round-action { color: var(--ink); border-color: var(--border); background: var(--surface); }
.hamyon-word-options .hamyon-remove-word { font-size: .9rem; color: var(--ink); }
:root[data-theme] .hamyon-today-page .hamyon-word-count { color: var(--ink); background: var(--surface-sunken); border-color: var(--border); }

/* Quiet progress between activities. Marks reflect confirmed server state. */
.wallet-journey { margin-top: 20px; color: var(--ink); }
.wallet-journey-heading { display: flex; gap: 12px; align-items: center; }
.wallet-journey-heading img { flex: 0 0 48px; object-fit: contain; }
.wallet-journey-heading p { margin: 0; line-height: 1.45; }
.wallet-journey-date { color: var(--muted); font-size: .85rem; }
.wallet-journey-count { font-weight: 800; }
.wallet-journey-steps { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); width: 100%; max-width: 352px; list-style: none; gap: 6px; padding: 0; margin: 14px 0 10px; }
.wallet-journey-steps li { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-sunken); color: var(--muted); font-size: .85rem; font-weight: 800; }
.wallet-journey-steps .is-completed { background: var(--primary); color: #fff; border-color: var(--primary); }
.wallet-journey-steps .is-current { border: 2px solid var(--ink); color: var(--ink); }
.wallet-journey-note { margin: 0; font-size: .85rem; line-height: 1.5; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .hamyon-today-page .hamyon-today-word { transition: none; transform: none; }
}
:root[data-theme="dark"] .wallet-journey-steps .is-completed { color: #06362b; }

/* A confirmed result with room to stop or return to the lesson. */
.story-result { max-width: 560px; margin: 24px auto; padding: 24px; text-align: center; }
.story-result-check { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--surface-sunken); color: var(--ink); font-size: 1.8rem; }
.story-result-name { color: var(--muted); font-size: .9rem; }
.story-result h1 { font-size: 1.7rem; }
.story-result-score { margin-bottom: 8px; font-weight: 800; font-size: 1.25rem; }
.story-result-percent, .story-result-saved { color: var(--muted); }
.story-result-actions { display: grid; gap: 12px; margin-top: 24px; }
.story-result-actions .button, .story-result-more { min-height: 52px; display: flex; align-items: center; justify-content: center; }
.story-result-more { color: var(--ink); }

.review-result-mascot { object-fit: contain; }
.review-result .wallet-journey { text-align: left; }
.review-result-counts { display: grid; gap: 12px; margin: 20px 0; }
.review-result-counts > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; border-radius: 14px; background: var(--surface-sunken); }
.review-result-counts dt { text-align: left; font-weight: 700; }
.review-result-counts dd { margin: 0; font-size: 1.6rem; font-weight: 800; }
.review-result-more { margin-top: 16px; text-align: left; }
.review-result-more summary, .review-result-more a { min-height: 48px; display: flex; align-items: center; }
.review-result-more summary { cursor: pointer; font-weight: 700; }
.review-result-more p { color: var(--muted); font-size: .9rem; }
.review-result-more nav { display: grid; }
.review-result-mascot { display: block; width: 48px; height: 48px; margin: 0 auto 8px; }
.review-result .wallet-journey-heading img { display: none; }

/* Bank: search and words first; optional controls stay available on demand. */
.bank-page .bank-dashboard-header { margin-bottom: 12px; }
.bank-page .bank-dashboard-header .treasure-kicker { display: none; }
:root[data-theme] .bank-page .bank-card { background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: none; padding: 20px; }
.bank-page .bank-filter-form { display: block; }
.bank-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.bank-search-row .button { min-height: 48px; }
:root[data-theme] .bank-page .bank-filter-input { width: 100%; min-width: 0; min-height: 48px; background: var(--surface-sunken); color: var(--ink); border: 1px solid var(--border); }
:root[data-theme] .bank-page .bank-filter-label span { color: var(--muted); text-transform: none; letter-spacing: normal; }
.bank-options > summary { min-height: 48px; padding: 14px 0 0; cursor: pointer; font-weight: 800; }
.bank-filter-active { font-weight: 400; color: var(--muted); }
.bank-extra-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.bank-extra-filters .button { min-height: 48px; grid-column: 1 / -1; }
.bank-page .bank-legend { margin: 12px 0; padding: 12px 0; }
.bank-size-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; }
.bank-page .bank-word-size-button { min-height: 48px; min-width: 48px; }
.bank-page .bank-toolbar-nav { margin: 12px 0 0; }
:root[data-theme] .bank-page .bank-nav-btn { min-height: 48px; padding: 10px 12px; background: var(--surface-sunken); color: var(--ink); border: 1px solid var(--border); }
.bank-page .bank-total { font-size: .95rem; color: var(--muted); margin: 0 0 12px; white-space: normal; }
:root[data-theme] .bank-page .bank-word-cloud { padding: 0; gap: 8px; background: transparent; border: 0; box-shadow: none; }
:root[data-theme] .bank-page .bank-word-chip { min-height: 48px; max-width: 100%; padding: 10px 14px; font-size: 1.1rem; border-width: 2px; border-style: solid; border-radius: 12px; overflow-wrap: anywhere; }
:root[data-theme] .bank-page .bank-word-chip.is-locked { opacity: .8; border-style: dashed; }
.bank-lock { font-size: .7em; margin-left: 6px; }
.bank-locked-note { color: var(--muted); font-size: .85rem; margin: 16px 0 0; }
.bank-clear { display: inline-flex; min-height: 48px; align-items: center; }
.bank-page [hidden] { display: none !important; }
.bank-page .bank-load-retry { margin: 12px auto 0; min-height: 48px; }
@media (max-width: 859px) {
  .bank-page .bank-dashboard-header .treasure-profile { display: none; }
  .bank-page .bank-card { padding: 16px; }
  .bank-page .bank-extra-filters { grid-template-columns: minmax(0, 1fr); }
  .bank-page .bank-scroll-top { width: 48px; height: 48px; box-shadow: none; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .bank-page .bank-word-chip, .bank-page .bank-load-spinner { animation: none; transition: none; transform: none; }
}
:root[data-theme] .bank-page .bank-word-cloud[data-word-scale="1.5"] .bank-word-chip { font-size: clamp(1.38rem, 5.4vw, 1.62rem); }
:root[data-theme] .bank-page .bank-word-cloud[data-word-scale="2"] .bank-word-chip { font-size: clamp(1.84rem, 7.2vw, 2.16rem); min-height: 56px; }
.bank-page .bank-word-chip { gap: 8px; flex-wrap: wrap; }

/* Safe: words and recall checks first, with details available on demand. */
.safe-page .bank-dashboard-header { margin-bottom: 12px; }
.safe-page .bank-dashboard-header .treasure-kicker, .safe-page .chunk-kicker { display: none; }
.safe-page .seyf-super-switch { margin: 12px 0; padding: 4px; width: min(100%, 560px); border-radius: 16px; }
.safe-page .seyf-super-switch a { min-height: 48px; padding: 12px; font-size: 1rem; border-radius: 12px; }
.safe-total { color: var(--muted); margin: 8px 0 12px; }
.safe-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-bottom: 12px; }
.safe-search label { min-width: 0; }
.safe-search input, .safe-page .chunk-search input { width: 100%; min-width: 0; min-height: 48px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; }
.safe-search button, .safe-page .chunk-search button { min-height: 48px; }
.safe-clear { display: inline-flex; align-items: center; min-height: 48px; }
.safe-page .seyf-main-grid { display: block; }
.safe-page .seyf-sidebar { display: block; position: static; height: auto; margin-bottom: 16px; }
.safe-options > summary, .safe-word-details > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.safe-options > summary::before, .safe-word-details > summary::before { content: '+ '; margin-right: 8px; }
.safe-options[open] > summary::before, .safe-word-details[open] > summary::before { content: '− '; }
.safe-page .seyf-summary-card { aspect-ratio: auto; min-height: 0; padding: 16px !important; margin: 12px 0; }
.safe-page .seyf-summary-card__value { font-size: 1.4rem; }
.safe-page .seyf-summary-card__progress { margin-top: 12px; height: 8px; }
.safe-page .seyf-topic-panel { margin-top: 12px; }
.safe-page .seyf-topic-panel > div > img { display: none; }
.safe-page .seyf-filter-scroller { flex-wrap: wrap; }
:root[data-theme] .safe-page .seyf-hero-stat, :root[data-theme] .safe-page .ranking-filter-panel { background: var(--surface) !important; color: var(--ink); box-shadow: none !important; border: 1px solid var(--border) !important; }
:root[data-theme] .safe-page .seyf-hero-stat strong, :root[data-theme] .safe-page .seyf-hero-stat span, :root[data-theme] .safe-page .seyf-hero-stat small { color: var(--ink) !important; }
:root[data-theme] .safe-page .seyf-board-panel { background: var(--surface); padding: 16px !important; box-shadow: none; }
.safe-page #safe-maintenance-banner { margin: 0 0 16px !important; padding: 14px !important; gap: 12px !important; }
.safe-page #safe-maintenance-start { min-height: 48px; }
.safe-page #safe-maintenance-dialog button { min-height: 48px; }
.safe-page #safe-maintenance-task input { max-width: 100%; }
.safe-page [hidden] { display: none !important; }
:root[data-theme] .safe-page .word-grid .word-card-custom:nth-child(n) { background: var(--surface-sunken) !important; color: var(--ink) !important; border: 1px solid var(--border) !important; box-shadow: none; }
:root[data-theme] .safe-page .word-grid .word-card-custom.is-new:nth-child(n) { border: 2px solid var(--primary) !important; }
.safe-page .word-card-custom.is-new .safe-word-image { filter: none; }
.safe-page .safe-word-visual { height: 88px; }
.safe-word-open { display: block; min-height: 48px; color: inherit; text-decoration: none; }
.safe-word-open:hover, .safe-word-open:focus-visible { text-decoration: underline; }
.safe-retention-note { font-size: .85rem; color: var(--muted); }
.safe-word-details { text-align: left; }
.safe-word-details > summary { font-size: .8rem; }
.safe-page .safe-word-open strong { font-size: 1.1rem !important; overflow-wrap: anywhere; }
.safe-page .word-card-custom > button { min-height: 48px; }
.safe-page .seyf-pagination .hamyon-filter-btn { min-height: 48px; }
:root[data-theme] .safe-page .celebration-banner { padding: 16px; margin-bottom: 16px !important; background: var(--surface) !important; border-color: var(--primary) !important; text-align: left !important; }
.safe-page .celebration-banner > span { display: none !important; }
.safe-page .celebration-banner h2 { font-size: 1.25rem; }
.safe-page .chunk-library { padding: 0; }
.safe-page .chunk-hero { padding: 16px; }
.safe-page .chunk-hero h1 { font-size: 1.8rem; }
.safe-page .chunk-audio { min-height: 48px; }
@media (max-width: 859px) {
  .safe-page .bank-dashboard-header .treasure-profile, .safe-page .bank-dashboard-header h1 img { display: none; }
  .safe-page .chunk-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .safe-page .chunk-search button { width: auto; }
  .safe-page .chunk-card { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
  .safe-page .chunk-card img, .safe-page .chunk-card-icon { width: 56px; height: 56px; }
  .safe-page .chunk-audio-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}
.safe-page .celebration-banner h2, .safe-page .celebration-banner p { color: var(--ink) !important; }
.safe-page .chunk-filter { display: inline-flex; min-height: 48px; align-items: center; }
.safe-page .chunk-card h2, .safe-page .chunk-card p { overflow-wrap: anywhere; }
.safe-options > summary, .safe-word-details > summary { color: var(--ink); }

/* The same project surfaces and button variants on small and wide layouts. */
.bank-page .treasure-dashboard, .hamyon-today-page .treasure-dashboard,
.safe-page .treasure-dashboard, .safe-page .chunk-library {
  width: 100%; max-width: var(--content); margin-inline: auto;
}
.safe-page .safe-word-audio { width: 100%; }
.safe-page #safe-maintenance-banner { background: var(--surface-sunken) !important; border-color: var(--border) !important; color: var(--ink); }
.safe-page #safe-maintenance-dialog { color: var(--ink) !important; border-color: var(--border) !important; }
:root[data-theme] .hamyon-today-page .hamyon-today-empty { background: var(--surface); color: var(--ink); border-color: var(--border); }
:root[data-theme] .hamyon-today-page .hamyon-today-empty h2 { color: var(--ink); text-shadow: none; }
.bank-forecast-cta { display:flex; justify-content:flex-end; margin:10px 0; }
@media(max-width:560px){.bank-forecast-cta .button{width:100%;justify-content:center;}}
:root[data-theme] .hamyon-today-page .hamyon-today-empty p { color: var(--muted); }
