:root { font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; color: #3e3428; background: #181816; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
#viewport { position: fixed; inset: 0; height: 100vh; height: 100dvh; overflow: hidden; padding-top: env(safe-area-inset-top, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
/* The app follows visible height. Only width is capped; text is never scaled. */
#stage { width: 100%; max-width: 480px; height: 100%; margin-inline: auto; position: relative; overflow: hidden; background: #f7f1e6; display: grid; grid-template-rows: max-content minmax(0, 1fr); }
.presence { overflow: hidden; }
.masthead { height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid #e1d6c4; }
.wordmark { font-size: 18px; font-weight: 700; letter-spacing: -.8px; white-space: nowrap; }
.edition { font-family: Georgia, serif; font-size: 10px; margin-left: 8px; color: #8a785d; letter-spacing: 1px; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, .conversation:focus-visible { outline: 2px solid #9d7848; outline-offset: -3px; }
.sound-button { color: #746650; font-size: 11px; border: 1px solid #d6c9b6; border-radius: 20px; padding: 4px 10px; background: transparent; white-space: nowrap; }
/* Dock height is reserved by the grid, not painted over the final content. */
.consultation-panel { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; align-content: end; }
.conversation { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 0; touch-action: pan-y; scroll-padding-block: 12px; overflow-wrap: anywhere; }
.speaker { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; font-size: 12px; font-weight: 700; color: #81613e; }
.speaker-dot { width: 5px; height: 5px; border-radius: 50%; background: #a98150; }
.preview-label { margin-left: auto; color: #8a8175; font-weight: 400; font-size: 10px; }
h1 { font-size: 21px; line-height: 1.5; letter-spacing: -.7px; font-weight: 600; margin: 0; }
#message { font-size: 14px; line-height: 1.8; margin: 12px 0 0; color: #776754; word-break: keep-all; }
.action-dock { position: relative; z-index: 2; min-width: 0; padding: 6px 18px calc(5px + env(safe-area-inset-bottom, 0px)); background: #f7f1e6; border-top: 1px solid #ded1bd; }
.status { font-size: 11px; line-height: 1.5; color: #83715b; margin: 0 0 4px; word-break: keep-all; }
.actions { display: flex; align-items: stretch; flex-wrap: nowrap; gap: 8px; }
.primary, .secondary { min-height: 42px; border-radius: 7px; padding: 10px 12px; font-size: 13px; }
.primary { background: #5b6247; color: #fffaf0; border: 1px solid #5b6247; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; }
.secondary { color: #766044; border: 1px solid #d9cbb6; background: transparent; }
.action-dock input, .action-dock textarea { min-width: 0; max-width: 100%; font: inherit; font-size: 16px; }
.action-dock textarea { max-height: min(100px, calc(var(--visible-height, 100dvh) * .2)); }
footer { margin-top: 4px; font-size: 10px; line-height: 1.5; text-align: center; color: #8d8070; }

/* Padding belongs inside the scroll viewport so a short window can shrink it to 0. */
.conversation-body { padding: 18px 22px 22px; }
.scroll-test-button { margin-top: 16px; padding: 7px 12px; min-height: 36px; border: 1px solid #cec1ab; border-radius: 6px; color: #655a42; background: transparent; font-size: 12px; }
.scroll-sample { margin-top: 18px; border-top: 1px solid #ded1bd; padding-top: 18px; }
.scroll-sample h2 { margin: 0 0 10px; font-size: 17px; }
.scroll-sample h3 { margin: 24px 0 8px; font-size: 15px; }
.scroll-sample p { font-size: 14px; line-height: 1.9; color: #776754; }
.scroll-sample .sample-end { margin-top: 28px; font-weight: 700; color: #5b6247; }

/* Keep the same scene/video nodes. Only a real input + software keyboard
   temporarily frees the scene and navigation rows for the form. */
#viewport[data-keyboard-open="true"] .room { height: 0; aspect-ratio: auto; visibility: hidden; }
#viewport[data-keyboard-open="true"] .bottom-nav { display: none; }
#viewport[data-keyboard-open="true"] .action-dock { padding-bottom: 5px; }
