* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, a { -webkit-tap-highlight-color: transparent; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.page {
  width: min(100%, 480px);
  height: 100dvh;
  margin-inline: auto;
  padding: env(safe-area-inset-top, 0px) 24px max(12px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}
.site-header { position: relative; height: clamp(108px, 15dvh, 140px); flex-shrink: 0; display: flex; justify-content: center; align-items: center; }
.logo { display: flex; align-items: center; justify-content: center; width: 150px; height: 100px; color: var(--gold); text-decoration: none; }
.logo-image { display: block; width: 150px; height: 100px; object-fit: contain; }
.menu-toggle { position: absolute; left: -8px; width: 44px; height: 44px; padding: 11px 8px; display: flex; flex-direction: column; justify-content: space-between; border: 0; background: transparent; }
.ui-icon { width: 28px; height: 28px; display: block; }
.site-menu { position: absolute; top: 75%; left: 0; z-index: 10; min-width: 160px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--background); }
.site-menu a { display: block; padding: 12px 16px; color: var(--text); text-decoration: none; border-radius: 5px; }
.site-menu a[aria-current="page"] { color: var(--gold); background: var(--surface); }
#screen { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; padding: 4px 4px 8px; }
#screen:focus { outline: none; }
.screen-title { flex-shrink: 0; margin: 0 0 16px; color: var(--gold); font-size: 20px; font-weight: 500; text-align: center; }
.spread-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 400px; margin-inline: auto; }
.spread { text-decoration: none; min-height: 96px; height: clamp(96px, 12dvh, 108px); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 18px; }
.spread-icon { flex: 0 0 40px; width: 40px; height: 40px; aspect-ratio: 1; border: 3px solid var(--gold); border-radius: 50%; }
.screen-panel { padding: 20px; border: 1px solid var(--line); border-radius: 9px; }
.auth-panel { margin: auto 0; }
.auth-heading { margin: 0 0 20px; color: var(--gold); font-size: 20px; font-weight: 500; }
.auth-form { display: grid; gap: 10px; }
.auth-form input { width: 100%; min-height: 46px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.auth-toggle { margin-top: 14px; padding: 8px 0; border: 0; background: transparent; color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }
.auth-providers { display: grid; gap: 8px; margin-bottom: 16px; }
.auth-provider { min-height: 44px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); }
.auth-divider { margin: 0 0 10px; color: var(--muted); font-size: 13px; text-align: center; }
.auth-verification { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.auth-verification .screen-link { justify-content: flex-start; margin-top: 0; }
.auth-resend { min-height: 44px; border: 1px solid var(--gold); border-radius: 7px; background: transparent; color: var(--gold); }
.profile-page { display: grid; align-content: start; gap: 20px; flex: 1; min-height: 0; overflow-y: auto; padding: 8px 4px 20px; }
.profile-identity { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 18px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.profile-avatar { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-family: Georgia, serif; font-size: 14px; }
.profile-identity-details { display: grid; min-width: 0; gap: 4px; }
.profile-member-date { color: var(--muted); font-size: 12px; }
.profile-badge { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 28px; padding: 4px 8px; border: 1px solid var(--gold); border-radius: 7px; color: var(--gold); font-size: 12px; white-space: nowrap; }
.profile-identity > .profile-badge { grid-column: 1 / -1; justify-self: start; }
.profile-section { display: grid; gap: 10px; }
.profile-section-title { margin: 0; color: var(--gold); font-size: 15px; font-weight: 500; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-stat { min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-line; }
.profile-navigation { display: grid; gap: 10px; }
.profile-navigation-link { display: flex; align-items: center; min-height: 46px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); text-decoration: none; }
.profile-navigation-link:hover { border-color: var(--gold); }
.profile-page > .action-button { margin: 0; }
.account-panel { padding: 0 0 24px; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.account-section { display: grid; gap: 12px; padding: 20px 0; border-top: 1px solid var(--line); }
.account-section:first-child { padding-top: 0; border-top: 0; }
.account-section .profile-badge { margin-top: 2px; }
.account-help { color: var(--muted); font-size: 14px; line-height: 1.6; }
.account-field { display: grid; gap: 8px; color: var(--text); font-size: 14px; line-height: 1.5; }
.account-section .auth-form { gap: 12px; }
.account-section .auth-form .action-button { margin-top: 0; }
.account-panel > .screen-link { margin-top: 4px; }
.account-panel > .action-button { margin-top: 12px; }
.account-panel .logout-button, .account-session-revoke { border-color: var(--line); background: transparent; color: var(--text); }
.account-panel .logout-button:hover, .account-session-revoke:hover { border-color: var(--gold); color: var(--gold); }
.history-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 4px 20px; }
.history-controls { display: grid; gap: 14px; margin-bottom: 20px; }
.history-list { display: grid; gap: 14px; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); text-decoration: none; }
.history-item:hover { border-color: var(--gold); }
.history-title { color: var(--gold); font-weight: 500; }
.history-date, .history-state { color: var(--muted); font-size: 13px; }
.history-state { grid-column: 2; grid-row: 1; }
.history-question { grid-column: 1 / -1; overflow: hidden; color: var(--text); font-size: 14px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.history-filter-row { display: grid; grid-template-columns: 1.4fr .8fr 1fr; gap: 10px; }
.history-filter, .history-page-button { min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.history-record { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); }
.history-item-link { min-width: 0; display: block; color: inherit; text-decoration: none; }
.history-record-content { min-width: 0; display: grid; gap: 0; }
.history-title { display: block; }
.history-record-meta { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.history-date { display: block; }
.history-delete { min-width: 44px; min-height: 44px; align-self: center; border: 0; background: transparent; color: var(--gold); }
.history-empty { padding: 40px 16px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); text-align: center; line-height: 1.6; }
.history-status { min-height: 24px; margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; grid-column: 1 / -1; margin-top: 10px; padding-top: 4px; }
.history-page-button { min-width: 72px; color: var(--gold); }
.history-page-label { color: var(--muted); font-size: 13px; }
.history-search { width: 100%; min-height: 46px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.profile-card { padding: 18px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); }
.profile-card { display: grid; gap: 6px; }
.profile-name { color: var(--text); font-size: 18px; font-weight: 500; }
.profile-email { color: var(--muted); font-size: 14px; }
.activity-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.activity-stat { min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-line; }
.activity-list { display: grid; gap: 10px; }
.coin-summary { margin-bottom: 24px; padding: 16px; border: 1px solid var(--gold); border-radius: 9px; }
.coin-panel, .coin-content { display: grid; gap: 12px; }
.coin-balance { margin: 0; font-size: 22px; color: var(--text); overflow-wrap: anywhere; }
.coin-detail { display: block; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.coin-entries { list-style: none; margin: 0; padding: 0; }
.coin-packs, .coin-orders { display: grid; gap: 12px; }
.coin-pack { border-color: var(--gold); }
.coin-entry { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.coin-panel .action-button { background: var(--point); color: var(--point-on); }
.coin-panel button:disabled { opacity: .6; cursor: not-allowed; }
.activity-list .history-item { display: block; }
.history-detail { flex: none; overflow: visible; }
.history-detail-date { display: block; margin: -10px 0 20px; color: var(--muted); font-size: 13px; }
.history-detail > .screen-message { margin-bottom: 20px; }
.history-cards { display: grid; gap: 12px; margin: 24px 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.history-cards p { margin: 0; }
.screen-message { margin: 0; line-height: 1.65; font-size: 15px; overflow-wrap: anywhere; }
.screen-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; color: var(--gold); font-size: 14px; text-underline-offset: 4px; }
.reading-process, .reading-result { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 10px; }
.reading-step, .selection-count { margin: 0; color: var(--gold); font-size: 14px; font-weight: 400; }
.field-label { display: block; margin: 10px 0 12px; font-size: 16px; }
.question-input { width: 100%; resize: vertical; min-height: 112px; height: clamp(112px, 24dvh, 220px); padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 16px; line-height: 1.6; }
.question-input::placeholder { color: var(--muted); }
.action-button, .retry { display: block; width: 100%; min-height: 46px; margin-top: 10px; padding: 12px; border: 1px solid var(--point); border-radius: 7px; background: var(--point); color: var(--text); }
.request-status { margin: 0; line-height: 1.6; }
.request-status:empty { display: none; }
.card-deck { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 4px; }
.card-back { aspect-ratio: 2 / 3; min-width: 0; min-height: 44px; border: 1px solid var(--gold); border-radius: 4px; background: var(--surface); color: var(--text); }
.card-back[aria-pressed="true"] { background: var(--gold); color: var(--background); }
.question-summary { margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; }
.question-summary summary { cursor: pointer; }
.question-summary p { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.spread-board { position: relative; width: min(100cqw, calc(100cqh * var(--board-ratio))); margin: auto; }
.result-card { position: absolute; padding: 0; border: 0; background: transparent; color: var(--text); }
.card-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); text-align: center; overflow: hidden; }
.card-name { padding: 4px; font-size: clamp(9px, 2.5vw, 12px); overflow-wrap: anywhere; }
.card-face img { display: block; width: 100%; height: 100%; object-fit: contain; }
.card-number { position: absolute; top: -8px; left: -8px; min-width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; background: var(--background); color: var(--text); font-size: 11px; }
.result-card[aria-pressed="true"] .card-face { border: 2px solid var(--gold); }
.result-card[aria-pressed="true"] .card-number { background: var(--gold); color: var(--background); }
.result-meaning-list { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.result-meaning-title { margin: 0; color: var(--gold); font-size: 16px; font-weight: 500; }
.result-meaning-item { padding-top: 8px; border-top: 1px solid var(--line); }
.result-meaning-card { margin: 0 0 4px; color: var(--text); font-size: 15px; font-weight: 500; }
.result-meaning-current, .result-meaning-secondary { margin: 0; color: var(--text); font-size: 14px; line-height: 1.55; }
.result-meaning-secondary { color: var(--muted); }
@media (hover: hover) { .spread:hover { border-color: var(--gold); } }
@media (max-width: 340px) { .page { padding-inline: 16px; } .spread { font-size: 16px; } .card-deck { gap: 5px; } }
@media (max-height: 680px) { .reading-result { gap: 6px; } .screen-title { margin-bottom: 10px; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }



.spread { min-height: 96px; height: 100%; }
.context-fields { display: flex; gap: 10px; margin: 10px 0; }
.reading-settings { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.reading-settings legend { padding: 0; }
.settings-label, .interpretation-label { margin: 8px 0 5px; color: var(--gold); font-size: 13px; }
.settings-options { display: flex; gap: 8px; }
.setting-option { flex: 1; min-height: 42px; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.setting-option:has(input:checked) { border-color: var(--gold); color: var(--gold); }
.context-label { flex: 1; min-width: 0; font-size: 14px; color: var(--gold); }
.context-input { display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 16px; }
.has-context .question-input { height: clamp(100px, 18dvh, 155px); min-height: 100px; }
.result-context { margin: 0; color: var(--gold); font-size: 14px; }
.answer-summary { padding: 10px 14px; border: 1px solid var(--gold); border-radius: 7px; }
.answer-summary strong { font-weight: 500; color: var(--gold); }
.answer-method { margin-top: 4px; font-size: 12px; line-height: 1.5; }
.answer-method summary { cursor: pointer; }
.answer-method p { margin: 6px 0 0; }
.card-number { white-space: nowrap; padding: 0 2px; }


/* Each screen has one bounded content region; page chrome stays in place. */
.scroll-region, .reading-process[data-stage="question"], #screen[data-view="other"], #screen:has(.reading-process[data-stage="result"]) {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) var(--background);
  scroll-padding-block: 6px;
}
.spread-list { flex: 1; min-height: 0; padding: 4px 12px 20px; }
.spread-grid { grid-auto-rows: clamp(96px, 12dvh, 108px); }
.reading-process[data-stage="question"] > * { flex-shrink: 0; }
.reading-process[data-stage="selection"] > :not(.deck-scroll) { flex-shrink: 0; }
.deck-scroll { flex: 1; min-height: 80px; }
.selection-footer { padding-top: 2px; }
.selection-footer .action-button { margin: 0; }
.selection-footer .request-status:not(:empty) { margin-top: 8px; }
.reading-process[data-stage="result"], .reading-result { flex: none; }
.reading-result { gap: 16px; }
.reading-result > * { flex-shrink: 0; }
.spread-stage { width: 100%; aspect-ratio: var(--board-ratio); flex: none; container-type: size; display: flex; }
.result-insights { flex: none; padding: 3px; }
.spread-presentation { display: flex; flex-direction: column; gap: 12px; }
.spread-controls { display: flex; justify-content: flex-end; }
.spread-enlarge { min-width: 96px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--gold); border-radius: 7px; background: var(--background); color: var(--gold); font-size: 14px; }
.spread-zoom-dialog { width: min(100% - 16px, 980px); max-width: none; height: min(900px, calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); max-height: none; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--background); color: var(--text); overflow: hidden; }
.spread-zoom-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
.spread-zoom-dialog::backdrop { background: var(--background); opacity: .85; }
.spread-zoom-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-shrink: 0; }
.spread-zoom-title { margin: 0; font-size: 18px; font-weight: 500; color: var(--gold); }
.spread-zoom-close { min-width: 60px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--gold); border-radius: 7px; background: var(--surface); color: var(--text); }
.spread-zoom-hint { margin: 0; font-size: 14px; line-height: 1.5; flex-shrink: 0; }
.spread-zoom-viewport { flex: 1; min-height: 0; overflow: auto; padding: 24px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--gold) var(--surface); }
.spread-board-enlarged { width: var(--enlarged-width); margin: 0; }
.spread-board-enlarged .card-name { padding: 8px; font-size: 18px; line-height: 1.4; }
.spread-board-enlarged .card-number { min-width: 32px; height: 28px; padding: 0 5px; font-size: 16px; }
.result-insights > * + * { margin-top: 10px; }
.answer-method { padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; }
.reading-result > .screen-link { margin-top: 0; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-actions .action-button { margin: 0; }
.export-status { grid-column: 1 / -1; font-size: 13px; overflow-wrap: anywhere; }
.reading-copy-dialog { width: min(100% - 32px, 480px); max-width: none; max-height: min(60dvh, calc(100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); margin: auto; padding: 24px; border: 0; border-radius: 9px; background: var(--text-light); color: var(--text-on-light); color-scheme: light; overflow-y: auto; }
.reading-copy-dialog[open] { display: flex; flex-direction: column; gap: 18px; }
.reading-copy-dialog::backdrop { background: var(--background); opacity: .85; }
.reading-copy-prompt { flex: 1 1 auto; min-height: 44px; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 4px; font-size: 16px; line-height: 1.6; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.reading-copy-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; flex-shrink: 0; }
.reading-copy-actions .action-button { margin: 0; color: var(--point-on); }
.reading-copy-status { flex-shrink: 0; font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 380px) { .card-deck { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* A short landscape viewport or keyboard can require extra content scrolling. */
@media (max-height: 420px) {
  #screen { overflow-y: auto; }
  .reading-process[data-stage="selection"] { flex: none; height: 360px; }
}

.stage-back { background: transparent; border: 0; padding: 8px; font: inherit; cursor: pointer; }
.reading-process[data-stage="preparing"], .reading-process[data-stage="generating"] { overflow-y: auto; }

.result-navigation { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.result-navigation .screen-link { margin: 0; font-size: 13px; }
.site-footer { flex-shrink: 0; padding: 12px 4px 4px; border-top: 1px solid var(--line); }
.site-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.site-footer a { color: var(--muted); font-size: 11px; line-height: 1.6; text-underline-offset: 3px; }
.legal-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 16px 24px; }
.legal-eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 12px; text-align: center; }
.legal-intro { margin: 0 0 24px; color: var(--text); font-size: 14px; line-height: 1.65; text-align: center; }
.legal-section { padding-top: 18px; border-top: 1px solid var(--line); }
.legal-section + .legal-section { margin-top: 20px; }
.legal-section-title { margin: 0 0 8px; color: var(--gold); font-size: 15px; font-weight: 500; }
.legal-paragraph { margin: 0; color: var(--text); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.legal-paragraph + .legal-paragraph { margin-top: 8px; }
.business-info-list { display: grid; grid-template-columns: minmax(96px, .8fr) minmax(0, 1.4fr); gap: 0; margin: 0 0 24px; border-top: 1px solid var(--line); }
.business-info-label, .business-info-value { margin: 0; padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.business-info-label { color: var(--muted); }
.business-info-value { color: var(--text); }

/* Personal extensions share the existing shell, tokens and control sizes. */
.feature-page { display: grid; gap: 16px; padding-bottom: 24px; }
.content-offers { padding-top: 20px; border-top: 1px solid var(--line); }
.purchase-page { display: grid; align-content: start; gap: 16px; padding-bottom: 24px; }
.purchase-offer { display: grid; gap: 10px; background: var(--surface); }
.purchase-offer .action-button { margin-top: 0; }
.purchase-payment-area { display: grid; gap: 12px; min-width: 0; }
.purchase-toss-methods, .purchase-toss-agreement { min-width: 0; }
.history-interpretation { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.paid-result-saved { display: grid; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.journal-textarea { display: block; width: 100%; min-height: 96px; resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; line-height: 1.6; }
.journal-form { margin-block: 20px; gap: 12px; }
.library-list, .library-card { display: grid; gap: 12px; }
.library-filters { display: grid; gap: 12px; }
.library-court { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; }
.library-selection { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.library-selection:empty { display: none; }
.library-selection button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.library-detail-body { display: grid; gap: 16px; padding-block: 12px; }
.library-detail-section { display: grid; gap: 8px; }
.library-detail summary, .editorial-info summary { cursor: pointer; }
.editorial-history { margin: 8px 0; padding-left: 20px; }
.editorial-history li + li { margin-top: 8px; }
.library-detail-body, .editorial-info { min-width: 0; overflow-wrap: anywhere; }
.library-card [aria-pressed="true"] { background: var(--gold); color: var(--background); }
.personal-dictionary summary { cursor: pointer; }
.pattern-row { margin: 12px 0 0; font-size: 14px; }
.calendar-controls { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekday { font-size: 12px; color: var(--muted); text-align: center; }
.calendar-day { aspect-ratio: 1; min-width: 0; min-height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; }
.calendar-day.has-readings { background: var(--gold); color: var(--background); font-weight: 700; text-decoration: underline; }
.free-board { position: relative; width: 100%; aspect-ratio: 2 / 3; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.free-card { position: absolute; transform: translate(-50%, -50%); width: 14%; height: 14%; min-height: 44px; padding: 2px; border: 1px solid var(--gold); border-radius: 7px; background: var(--background); color: var(--gold); touch-action: none; font-size: 12px; overflow-wrap: anywhere; display: grid; place-items: center; }
.free-card[aria-pressed="true"] { outline: 2px solid var(--gold); outline-offset: 2px; }
.free-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-free-board { margin-block: 16px; }
.mypage-panel .profile-navigation { margin-bottom: 24px; }
.journal-calendar > .account-field { margin-top: 12px; }
#screen:has(.reading-process[data-stage="reflection"]) { overflow-y: auto; }
.reading-process[data-stage="reflection"] { flex: none; gap: 16px; padding-bottom: 24px; }
.reflection-backs { display: flex; flex-wrap: wrap; gap: 8px; }
.reflection-back { display: grid; place-items: center; width: 40px; height: 60px; border: 1px solid var(--gold); border-radius: 7px; background: var(--surface); color: var(--gold); font-size: 13px; }
.reflection-form { display: grid; gap: 12px; }
.reflection-form .action-button { margin: 0; }
.reflection-form .history-date { margin: 0; line-height: 1.6; }
.impression-comparison { display: grid; gap: 12px; }
.impression-comparison .screen-message { white-space: pre-wrap; }
.impression-comparison .history-date { margin: 0; line-height: 1.6; }
.free-editor .free-controls { align-items: center; }
.free-editor .free-controls > * { flex: 1 1 auto; }
.free-start { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 8px 0 8px var(--background); }
.reading-process.free-selection { flex: none; height: auto; gap: 12px; padding-bottom: 24px; }
.free-deck-tray { position: sticky; top: -4px; z-index: 4; padding-block: 4px 12px; background: var(--background); }
.free-deck-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.free-deck-header .selection-count { line-height: 1.5; }
.free-deck-header button { flex-shrink: 0; }
.free-deck-strip { display: grid; grid-template-rows: repeat(2, 66px); grid-auto-flow: column; grid-auto-columns: 44px; gap: 8px; overflow-x: auto; padding: 4px; scrollbar-width: thin; scrollbar-color: var(--gold) var(--background); overscroll-behavior-x: contain; }
.free-deck-card { padding: 0; border: 1px solid var(--gold); border-radius: 7px; background: var(--surface); color: var(--gold); touch-action: pan-x; user-select: none; cursor: grab; }
.free-deck-card[aria-pressed="true"] { outline: 2px solid var(--gold); outline-offset: -4px; }
.free-deck-card:disabled { opacity: .35; border-style: dashed; }
.free-draw-hint { margin: 0; line-height: 1.6; }
.free-board-empty { position: absolute; inset: 0; display: grid; align-content: start; padding: 24px 16px; margin: 0; pointer-events: none; color: var(--muted); font-size: 14px; text-align: center; }
.free-drop-board.is-drop-target { outline: 2px solid var(--gold); outline-offset: -4px; }
.is-dragging { opacity: .3; }
.free-drag-ghost { position: fixed; width: 44px; height: 66px; transform: translate(-50%, -50%); z-index: 30; border: 2px solid var(--gold); border-radius: 7px; background: var(--surface); pointer-events: none; }
.free-inspector > :not(summary) { margin-block: 12px; }
.free-inspector .history-filter { width: 100%; }
@media (max-height: 680px) { .free-deck-strip { grid-template-rows: 66px; } }
.coin-admin { display: grid; gap: 20px; }
.coin-admin-search { display: grid; gap: 12px; }
.coin-admin label { display: grid; gap: 8px; color: var(--gold); }
.coin-admin label:has(input[type="checkbox"]) { display: flex; align-items: center; min-height: 44px; }
.coin-admin input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--point); }
.coin-admin .auth-input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.coin-admin summary { min-height: 44px; padding-block: 12px; cursor: pointer; }
.coin-admin-order { display: block; width: 100%; min-height: 44px; margin-block: 12px; padding: 14px; border: 1px solid var(--gold); border-radius: 8px; background: var(--surface); color: var(--text); text-align: left; font: inherit; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; cursor: pointer; }
.coin-admin .coin-detail { overflow-wrap: anywhere; white-space: pre-line; }
.coin-admin button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.admin-page { width: min(100%, 1280px); }
.admin-shell { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 24px; align-items: start; }
.admin-nav { display: grid; gap: 10px; position: sticky; top: 0; }
.admin-nav [aria-current="page"] { border-color: var(--gold); color: var(--gold); }
.admin-body { min-width: 0; }
.admin-body .coin-admin { overflow: visible; padding: 0; }
.admin-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; align-items: start; }
.admin-order-detail { padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.admin-order-detail > .coin-detail { margin-bottom: 8px; }
.admin-products { border-top: 1px solid var(--line); padding-top: 16px; }
.admin-auth { max-width: 560px; }
.admin-auth-form { display: grid; gap: 12px; margin-block: 16px; }
.admin-auth label { display: grid; gap: 8px; color: var(--gold); }
.admin-auth .auth-input { width: 100%; min-height: 44px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.admin-secret, .admin-state { display: block; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; }
.admin-security-events { margin-top: 24px; }
.admin-body .admin-auth-form label { display: grid; gap: 6px; }
.admin-body .auth-input { width: 100%; min-height: 44px; box-sizing: border-box; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.admin-facts { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 8px 14px; font-size: 14px; margin-block: 16px; }
.admin-facts dt { color: var(--gold); }
.admin-facts dd { margin: 0; overflow-wrap: anywhere; }
.admin-evidence { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 420px; overflow-y: auto; }
.admin-workspace > section { min-width: 0; }
.admin-security-events .coin-detail { padding-block: 8px; border-bottom: 1px solid var(--line); }
@media (max-width: 900px) {
  .admin-shell, .admin-workspace { grid-template-columns: minmax(0,1fr); }
  .admin-nav { position: static; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .admin-nav .profile-navigation-link { padding: 8px; font-size: 13px; }
}
