/** すべての接客・分析画面を一つのビューポートに収め、長い文章はページ送りで読む。 */
:root {
  --cafe-header: 78px;
  --cafe-footer: 44px;
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--cafe-header) minmax(0, 1fr) var(--cafe-footer);
}
body > main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.site-header {
  position: relative;
  top: auto;
  height: 100%;
  min-height: 0;
  padding-block: 7px;
  gap: 12px;
}
.site-header nav {
  gap: 10px;
  min-width: 0;
}
.wordmark img {
  width: 210px;
  min-width: 0;
  max-width: 26vw;
  max-height: 59px;
  object-fit: contain;
}
.site-header nav > button,
.site-header .back-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
  line-height: 1.35;
}
.site-footer {
  height: 100%;
  min-height: 0;
  padding: 0 22px;
  flex-wrap: nowrap;
  gap: 12px;
  overflow: hidden;
}
.site-footer > span {
  white-space: nowrap;
}
.footer-links {
  flex-wrap: nowrap;
  min-width: 0;
  gap: 6px;
}
.site-footer .text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 17px;
  font-size: 9px;
  white-space: nowrap;
}

/* 写真の行は残りの高さ。会話の紙は必要な高さだけ使い、顔を下敷きにしない。 */
.cafe,
body[data-scene='welcome'] .cafe,
body[data-scene='collect'] .cafe,
body[data-scene='select'] .cafe {
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  scroll-margin: 0;
}
.stage {
  position: relative;
  grid-row: 1;
  grid-column: 1;
  inset: auto;
  height: 100%;
  width: 100%;
  min-height: 0;
  z-index: 0;
  overflow: hidden;
}
.cafe-backdrop {
  background-position: center 44%;
}
.master-rig {
  width: auto;
  height: 126%;
  aspect-ratio: 1;
  left: 58%;
  bottom: -26%;
  transform: translateX(-35%);
}
body[data-scene='collect'] .master-rig,
body[data-scene='select'] .master-rig {
  width: auto;
  height: 126%;
  left: 58%;
  bottom: -26%;
  transform: translateX(-35%);
}
.conversation {
  position: relative;
  grid-row: 2;
  grid-column: 1;
  inset: auto;
  width: calc(100% - 56px);
  max-width: 1250px;
  min-height: 0;
  margin: 0 auto 12px;
  padding: 20px 36px 16px;
  z-index: 2;
}
.speaker {
  min-height: 25px;
  padding-block: 2px;
}
.speaker .availability {
  right: 36px;
}
.dialogue-heading {
  margin-top: 0;
}
.dialogue-heading h2 {
  font-size: clamp(20px, 1.8vw, 27px);
  line-height: 1.55;
  margin: 6px 0 9px;
}
.dialogue-copy {
  font-size: 13px;
  line-height: 1.75;
  margin: 0 0 11px;
}
.copy-line {
  display: inline-block;
}
#handle-form,
.preview-actions {
  gap: 9px;
}
.primary-button,
.secondary-button {
  min-height: 46px;
  padding-block: 9px;
  font-size: 12px;
  line-height: 1.6;
}
.handle-field {
  min-height: 46px;
}
.handle-field input {
  font-size: 16px;
  padding-block: 9px;
  line-height: 1.6;
}
.field-help {
  margin: 5px 0 0;
  font-size: 10px;
  line-height: 1.65;
}
.conversation-foot {
  margin-top: 7px;
  padding-top: 5px;
}
.preview .profile-line {
  margin: 0 0 7px;
  gap: 6px 12px;
}
.preview .profile-line strong {
  font-size: 15px;
}
.preview-export {
  margin-top: 7px;
  gap: 10px;
}
.preview-export .text-link,
#preview-change {
  min-height: 44px;
  padding-block: 7px;
  font-size: 10px;
}
.preview-export > span {
  font-size: 9px;
  line-height: 1.6;
}
.notice {
  margin-top: 7px;
  padding: 9px 18px;
  font-size: 11px;
  line-height: 1.7;
}
#status-retry {
  margin-top: 4px;
  min-height: 44px;
}
.scene-caption,
.scene-controls {
  top: 14px;
}
.scene-controls .motion-toggle,
.scene-controls .voice-play {
  min-height: 44px;
  padding-block: 7px;
}
.welcome-heading {
  z-index: 1;
  top: 16%;
  left: 6%;
  max-width: 39%;
}
.welcome-heading h1 {
  font-size: clamp(26px, 3.15vw, 45px);
  line-height: 1.55;
  margin-block: 10px 15px;
}
.welcome-heading > p:last-child {
  font-size: 12px;
  line-height: 1.8;
}

/* 抽出中は会話を退け、写真レイヤー全体をカメラとして使う。 */
body[data-scene='set'] .cafe,
body[data-scene='extract'] .cafe,
body[data-scene='finish'] .cafe {
  height: 100%;
  min-height: 0;
  padding: 0;
  display: block;
}
body[data-scene='set'] .stage,
body[data-scene='extract'] .stage,
body[data-scene='finish'] .stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.brewing-caption {
  z-index: 1;
}
body[data-scene='extract'] .brewing-caption,
body[data-scene='finish'] .brewing-caption {
  top: 14%;
  bottom: auto;
  max-width: 34%;
}
.brewing-caption h2 {
  font-size: clamp(22px, 2.5vw, 36px);
  line-height: 1.6;
}
.brewing-caption p {
  font-size: 12px;
  line-height: 1.85;
}

/* 結果はツールバー・項目タブ・一枚の説明・保存入口の四段。 */
.tasting-sheet {
  width: calc(100% - 32px);
  max-width: 1440px;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 18px 30px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-image-width: 30px;
  scroll-margin: 0;
}
.menu-top,
.menu-bottom,
.blend-label,
.master-note,
.tasting-sheet .export-help,
.tasting-sheet .result-caveat {
  display: none;
}
.menu-toolbar {
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0 0 10px;
  align-items: center;
  gap: 8px 18px;
}
.menu-toolbar > div {
  gap: 7px;
}
.menu-toolbar .text-link {
  min-height: 44px;
  padding: 8px 23px;
  line-height: 1.4;
}
#dashboard-account {
  min-width: 0;
  font-size: 11px;
  line-height: 1.5;
}
.tasting-layout {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 4%;
  overflow: hidden;
}
.blend-visual {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
}
.tasting-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 100%;
  flex: 0 1 auto;
}
.menu-copy {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.menu-copy > .eyebrow {
  flex: 0 0 auto;
  margin: 0 0 5px;
  font-size: 9px;
  line-height: 1.5;
}
.menu-copy > h2 {
  flex: 0 0 auto;
  font-size: clamp(25px, 2.65vw, 39px);
  line-height: 1.5;
  margin: 0 0 11px;
}
.result-tabs {
  order: -1;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
}
.result-tabs button {
  min-width: 0;
  min-height: 44px;
  height: 44px;
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  text-wrap: balance;
  word-break: normal;
}
#overview,
#palette,
#reflection-panel,
#result {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
#overview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
#result-summary {
  min-height: 0;
  margin: 0;
  font-size: 15px;
  line-height: 2;
}
.flavor-strip {
  flex: 0 0 auto;
  gap: 6px;
  margin: 4px 0;
}
.flavor-strip > span {
  font-size: 11px;
  line-height: 1.5;
  padding: 7px 17px;
}
#palette {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.palette-legend {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
body .palette-choice {
  min-width: 0;
  min-height: 102px;
  padding: 13px 16px;
}
body .palette-choice span {
  min-height: 0;
  font-size: 12px;
  line-height: 1.45;
}
body .palette-choice strong {
  font-size: 26px;
  line-height: 1.4;
  margin: 2px 0;
}
body .palette-choice small {
  font-size: 10px;
  line-height: 1.4;
}
body .palette-choice[aria-pressed='true']:after {
  right: 13px;
  top: 10px;
}
.palette-detail {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.palette-detail h4 {
  flex: 0 0 auto;
  font-size: 21px;
  line-height: 1.5;
  margin: 0;
}
.palette-detail > .paged-copy {
  flex: 1 1 auto;
}
.palette-detail .evidence-trigger,
#palette-method {
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0;
  align-self: flex-start;
  padding: 7px 23px;
  font-size: 11px;
  line-height: 1.5;
}
#result {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.detail-pager {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0;
  margin: 0;
}
.detail-pager button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 5px;
}
#detail-content {
  flex: 1 1 auto;
  min-height: 0;
}
.insight {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  gap: 8px;
}
.insight h3 {
  flex: 0 0 auto;
  font-size: 23px;
  line-height: 1.55;
  margin: 0;
}
.insight-part {
  flex: 1 1 auto;
  min-height: 0;
  font-size: 14px;
  line-height: 1.9;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.insight-part > strong {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1.5;
  margin: 0;
}
.insight-part > .paged-copy {
  flex: 1 1 auto;
}
.reading-tabs {
  flex: 0 0 auto;
  margin: 0;
  gap: 7px;
  flex-wrap: nowrap;
}
.reading-tabs button {
  min-height: 44px;
  padding: 6px 17px;
  font-size: 12px;
  line-height: 1.5;
}
.insight > .evidence-trigger {
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0;
  padding: 7px 24px;
  align-self: flex-start;
  font-size: 11px;
  line-height: 1.5;
}
#reflection-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
#reflection-panel > span {
  font-size: 12px;
  line-height: 1.5;
}
#reflection {
  font: 500 19px/1.9 var(--serif);
  min-height: 0;
  margin: 0;
}
.menu-actions {
  flex: 0 0 auto;
  margin: 10px 0 0;
  min-height: 44px;
}
.menu-actions button,
#save-open {
  min-height: 44px;
  height: 44px;
  padding: 6px 24px;
  font-size: 12px;
  line-height: 1.5;
}

/* 長文は文章本体とページ送りを分け、操作が画面外へ押し出されるのを防ぐ。 */
.paged-copy {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.text-page-body {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.95;
  letter-spacing: .015em;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.text-page-controls {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.text-page-button {
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 6px 18px;
  border: 0;
  background: var(--ui-secondary) center / 100% 100% no-repeat;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}
.text-page-position {
  flex: 0 1 auto;
  min-width: 0;
  font: 10px/1.5 var(--latin);
  text-align: center;
  white-space: nowrap;
}

/* 紹介以外の項目には写真・見出しを再掲せず、読んでいる文章だけを大きく使う。 */
body[data-result-tab]:not([data-result-tab='overview']) .tasting-layout {
  grid-template-columns: minmax(0, 1fr);
}
body[data-result-tab]:not([data-result-tab='overview']) .blend-visual,
body[data-result-tab]:not([data-result-tab='overview']) .menu-copy > .eyebrow {
  display: none;
}
body[data-result-tab]:not([data-result-tab='overview']) #result-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
body[data-result-tab]:not([data-result-tab='overview']) .menu-copy {
  width: min(100%, 880px);
  margin-inline: auto;
}

/* ダイアログもスクロールしない。本文ページと全保存操作が常に同時に見える。 */
.evidence-dialog,
.save-dialog,
#save-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: min(640px, calc(100vw - 28px));
  height: min(550px, calc(100dvh - 32px));
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 32px);
  min-height: 0;
  margin: 0;
  padding: 25px 32px;
  overflow: hidden;
}
.save-dialog,
#save-dialog {
  border: 1px solid transparent;
  border-image: var(--ui-dialogue) 17% 10% fill / 26px / 0 stretch;
  background: none;
  color: var(--ink);
}
.evidence-dialog[open],
.save-dialog[open],
#save-dialog[open] {
  display: flex;
  flex-direction: column;
}
.dialog-heading {
  flex: 0 0 auto;
  min-height: 44px;
  gap: 8px;
}
.dialog-heading > button {
  min-height: 44px;
  padding: 7px 19px;
}
.evidence-dialog h2,
.save-dialog h2,
#save-dialog h2 {
  flex: 0 0 auto;
  font: 600 24px/1.5 var(--serif);
  margin: 13px 0 17px;
  text-wrap: balance;
}
#evidence-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
  overflow: hidden;
}
#evidence-content > .paged-copy,
#evidence-content > blockquote {
  flex: 1 1 auto;
  min-height: 0;
}
.evidence-dialog blockquote {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding-left: 16px;
}
.evidence-dialog p {
  font-size: 14px;
  line-height: 1.95;
  margin-block: 0 12px;
}
.evidence-dialog .text-page-body {
  margin: 0;
}
.evidence-dialog a {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1.6;
}
.evidence-pager {
  flex: 0 0 auto;
  padding: 0;
  min-height: 44px;
  gap: 7px;
}
.evidence-pager button {
  min-height: 44px;
  padding: 7px 16px;
  font-size: 11px;
  line-height: 1.5;
}
.save-actions,
#save-dialog .export-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0;
}
#save-dialog .primary-button,
#save-dialog .secondary-button {
  min-height: 48px;
  height: auto;
  padding: 11px 18%;
  font-size: 13px;
  white-space: normal;
}

@media (max-width: 900px) {
  .site-header {
    padding-inline: 18px;
  }
  .site-header nav > #about-open {
    display: none;
  }
  .menu-copy > h2 {
    font-size: 28px;
  }
  .tasting-sheet {
    width: calc(100% - 20px);
    padding: 16px 22px;
  }
  .menu-toolbar {
    margin-bottom: 8px;
  }
  .menu-toolbar .text-link {
    padding-inline: 18px;
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  :root {
    --cafe-header: 58px;
    --cafe-footer: 44px;
  }
  .site-header {
    height: 100%;
    padding: 5px 12px;
    gap: 8px;
  }
  .wordmark img {
    width: 140px;
    min-width: 0;
    max-width: 42vw;
    max-height: 45px;
  }
  .site-header nav {
    gap: 4px;
  }
  .site-header nav > .audio-toggle {
    min-width: 56px;
    min-height: 44px;
    height: 44px;
    padding: 5px 13px;
    flex: 0 0 56px;
    font-size: 9px;
  }
  .site-header .back-link {
    min-height: 44px;
    padding: 6px 12px;
    font-size: 9px;
    line-height: 1.4;
    white-space: nowrap;
  }
  .site-header .back-link span {
    margin-left: 3px;
  }
  .site-footer {
    padding: 0 12px;
    gap: 8px;
  }
  .site-footer > span:first-child {
    font-size: 6px;
    letter-spacing: 0;
  }
  .site-footer > span:nth-child(2) {
    display: none;
  }
  .site-footer .text-link {
    min-height: 44px;
    padding: 6px 13px;
    font-size: 8px;
  }
  .footer-links {
    margin-left: auto;
    gap: 3px;
  }
  .conversation {
    width: calc(100% - 24px);
    margin: 0 auto 9px;
    padding: 15px 20px 14px;
    border-image-width: 21px;
  }
  .speaker {
    font-size: 10px;
    min-height: 23px;
    padding: 2px 20px;
  }
  .speaker .availability {
    font-size: 8px;
    right: 20px;
  }
  .dialogue-heading h2 {
    font-size: clamp(17px, 4.4vw, 20px);
    line-height: 1.5;
    margin: 6px 0 9px;
    letter-spacing: .01em;
  }
  .dialogue-phrase {
    display: inline-block;
    white-space: nowrap;
  }
  .dialogue-number {
    display: none;
  }
  .dialogue-copy,
  .preview .dialogue-copy {
    font-size: 11px;
    line-height: 1.7;
    margin: 0 0 10px;
  }
  .copy-line + .copy-line,
  .conversation-foot,
  .preview .profile-line strong,
  .preview #post-count,
  .preview > .dialogue-copy,
  .preview-export > span {
    display: none;
  }
  #handle-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }
  .handle-field {
    min-height: 44px;
    padding-inline: 26px;
  }
  .handle-field input {
    padding-block: 9px;
    font-size: 16px;
    line-height: 1.5;
  }
  .handle-field input::placeholder {
    font-size: 13px;
  }
  .primary-button,
  .secondary-button {
    min-height: 44px;
    padding: 8px 17%;
    font-size: 12px;
    line-height: 1.55;
  }
  .field-help {
    margin-top: 5px;
    font-size: 9px;
    line-height: 1.55;
  }
  .preview .profile-line {
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
  }
  .preview .profile-line > div {
    flex: 1 1 auto;
    flex-basis: auto;
    max-width: none;
  }
  .preview .profile-line a {
    font-size: 11px;
  }
  #preview-change {
    min-height: 44px;
    padding: 7px 18px;
    font-size: 10px;
  }
  .preview-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }
  .preview .field-help {
    font-size: 9px;
    line-height: 1.6;
  }
  .preview-export {
    margin-top: 6px;
  }
  .preview-export .text-link {
    display: block;
    min-height: 44px;
    width: 100%;
    padding: 7px 24px;
    font-size: 10px;
    line-height: 1.6;
  }
  .notice {
    font-size: 10px;
    line-height: 1.65;
    padding: 8px 15px;
    margin-top: 6px;
  }
  .master-rig,
  body[data-scene='collect'] .master-rig,
  body[data-scene='select'] .master-rig {
    width: auto;
    height: 132%;
    left: 50%;
    bottom: -32%;
    transform: translateX(-43%);
  }
  .scene-caption {
    display: none;
  }
  .scene-controls {
    top: 8px;
    right: 10px;
    gap: 3px;
  }
  .scene-controls .motion-toggle,
  .scene-controls .voice-play {
    min-height: 44px;
    padding: 6px 17px;
    font-size: 8px;
  }
  .welcome-heading {
    top: 52px;
    left: 20px;
    max-width: 55%;
  }
  .welcome-heading .eyebrow,
  .welcome-heading > p:last-child {
    display: none;
  }
  .welcome-heading h1 {
    font-size: clamp(18px, 5vw, 23px);
    line-height: 1.55;
    margin: 0;
    letter-spacing: .015em;
  }
  body[data-scene='extract'] .brewing-caption,
  body[data-scene='finish'] .brewing-caption {
    top: auto;
    bottom: 24px;
    left: 22px;
    right: 22px;
    max-width: 100%;
  }
  .brewing-caption h2 {
    font-size: 25px;
    line-height: 1.55;
  }
  .brewing-caption p {
    font-size: 12px;
    line-height: 1.8;
  }
  .brewing-dots {
    margin-top: 10px;
  }
  .tasting-sheet {
    width: calc(100% - 12px);
    padding: 13px 16px 15px;
    margin: 0 auto;
    border-image-width: 22px;
  }
  .menu-toolbar {
    min-height: 44px;
    margin: 0 0 8px;
    gap: 0 4px;
    flex-wrap: nowrap;
  }
  #dashboard-account {
    font-size: 9px;
    line-height: 1.4;
    max-width: 40%;
  }
  .menu-toolbar > div {
    gap: 3px;
    flex-wrap: nowrap;
    margin-left: auto;
  }
  .menu-toolbar .text-link {
    min-height: 44px;
    padding: 6px 12px;
    font-size: 9px;
    line-height: 1.4;
  }
  .tasting-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .blend-visual {
    flex: 0 0 auto;
    height: 104px;
    margin-bottom: 10px;
    align-items: center;
  }
  .tasting-photo {
    height: 104px;
    width: 139px;
    max-height: 104px;
    flex: 0 0 auto;
  }
  .bag-label {
    font-size: 8px;
  }
  .menu-copy {
    flex: 1 1 auto;
    width: 100%;
    margin: 0;
    min-height: 0;
  }
  .menu-copy > .eyebrow {
    font-size: 8px;
    margin-bottom: 3px;
    line-height: 1.4;
  }
  .menu-copy > h2 {
    font-size: 25px;
    line-height: 1.45;
    margin: 0 0 8px;
  }
  .result-tabs {
    margin-bottom: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
  }
  .result-tabs button {
    min-height: 44px;
    height: 44px;
    padding: 4px 4px;
    font-size: 11px;
    line-height: 1.35;
  }
  #overview {
    justify-content: center;
    gap: 8px;
  }
  #result-summary {
    font-size: 14px;
    line-height: 1.9;
  }
  .flavor-strip {
    display: none;
  }
  .palette-legend {
    gap: 5px;
  }
  body .palette-choice {
    min-height: 93px;
    padding: 11px 10px;
  }
  body .palette-choice span {
    font-size: 10px;
    line-height: 1.45;
  }
  body .palette-choice strong {
    font-size: 24px;
    line-height: 1.35;
  }
  body .palette-choice small {
    font-size: 9px;
    line-height: 1.45;
  }
  body .palette-choice[aria-pressed='true']:after {
    top: 9px;
    right: 9px;
    font-size: 9px;
  }
  #palette {
    gap: 6px;
  }
  .palette-detail {
    gap: 5px;
  }
  .palette-detail h4 {
    font-size: 19px;
    line-height: 1.5;
  }
  .palette-detail .evidence-trigger,
  #palette-method {
    min-height: 44px;
    font-size: 10px;
    padding: 7px 19px;
  }
  .detail-pager {
    min-height: 44px;
    font-size: 10px;
  }
  .insight {
    gap: 6px;
  }
  .insight h3 {
    font-size: 20px;
    line-height: 1.5;
  }
  .insight-part {
    gap: 4px;
  }
  .insight-part > strong {
    font-size: 10px;
    line-height: 1.45;
  }
  .reading-tabs {
    gap: 5px;
  }
  .reading-tabs button {
    min-height: 44px;
    padding: 6px 17px;
    font-size: 11px;
  }
  .insight > .evidence-trigger {
    min-height: 44px;
    padding: 7px 20px;
    font-size: 10px;
  }
  .paged-copy {
    gap: 5px;
  }
  .text-page-body {
    font-size: 13px;
    line-height: 1.9;
    letter-spacing: .01em;
  }
  .text-page-controls {
    min-height: 44px;
    gap: 5px;
  }
  .text-page-button {
    min-height: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 11px;
    padding: 6px 16px;
  }
  .text-page-position {
    font-size: 9px;
  }
  #reflection-panel > span {
    font-size: 11px;
  }
  #reflection {
    font-size: 18px;
    line-height: 1.8;
  }
  .menu-actions {
    margin-top: 7px;
  }
  .menu-actions button,
  #save-open {
    min-height: 44px;
    height: 44px;
    padding: 7px 24px;
    font-size: 12px;
  }
  .evidence-dialog,
  .save-dialog,
  #save-dialog {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: min(540px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
    padding: 20px 23px;
    border-image-width: 22px;
  }
  .dialog-heading {
    min-height: 44px;
  }
  .dialog-heading > .eyebrow {
    font-size: 7px;
    letter-spacing: .08em;
  }
  .dialog-heading > button {
    min-height: 44px;
    font-size: 10px;
    padding: 7px 17px;
  }
  .evidence-dialog h2,
  .save-dialog h2,
  #save-dialog h2 {
    font-size: 21px;
    line-height: 1.5;
    margin-block: 12px 15px;
  }
  .evidence-dialog p {
    font-size: 13px;
    line-height: 1.9;
  }
  .evidence-pager button {
    min-height: 44px;
    padding: 7px 13px;
    font-size: 10px;
  }
  #save-dialog .primary-button,
  #save-dialog .secondary-button {
    min-height: 48px;
    padding: 10px 18%;
    font-size: 12px;
  }
  .download-status {
    bottom: calc(var(--cafe-footer) + 12px);
    padding: 13px 38px;
    font-size: 11px;
    line-height: 1.7;
  }
}

/* 小さい高さでも、本文領域を残して入力・確認操作を縮めない。 */
@media (max-height: 700px) {
  :root {
    --cafe-header: 58px;
  }
  .site-header {
    padding-block: 4px;
  }
  .wordmark img {
    max-height: 46px;
  }
  .welcome-heading > .eyebrow,
  .welcome-heading > p:last-child {
    display: none;
  }
  .welcome-heading {
    top: 18%;
  }
  .welcome-heading h1 {
    font-size: clamp(22px, 3vw, 30px);
  }
  .conversation {
    padding-top: 15px;
    padding-bottom: 12px;
  }
  .conversation-foot {
    display: none;
  }
  .dialogue-copy {
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 8px;
  }
  .dialogue-heading h2 {
    font-size: 21px;
    line-height: 1.5;
    margin-block: 4px 7px;
  }
  .field-help {
    font-size: 9px;
    line-height: 1.5;
  }
  .preview > .dialogue-copy,
  .preview-export > span,
  .preview .profile-line strong {
    display: none;
  }
  .tasting-sheet {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .menu-toolbar {
    margin-bottom: 7px;
  }
  .menu-copy > .eyebrow {
    display: none;
  }
  .menu-copy > h2 {
    font-size: 26px;
    line-height: 1.45;
    margin-bottom: 7px;
  }
  .menu-copy > #result-title {
    max-height: 2.9em;
  }
  #overview {
    gap: 6px;
  }
  .flavor-strip,
  #palette-method {
    display: none;
  }
  body .palette-choice {
    min-height: 87px;
    padding-top: 9px;
    padding-bottom: 9px;
  }
  body .palette-choice span {
    font-size: 11px;
    line-height: 1.4;
  }
  body .palette-choice strong {
    font-size: 23px;
    line-height: 1.35;
  }
  .palette-detail h4 {
    font-size: 18px;
    line-height: 1.45;
  }
  .text-page-body {
    font-size: 13px;
    line-height: 1.85;
  }
  .insight h3 {
    font-size: 20px;
    line-height: 1.45;
  }
  .insight {
    gap: 5px;
  }
}
@media (max-width: 600px) and (max-height: 700px) {
  .welcome-heading {
    display: none;
  }
  .dialogue-heading h2 {
    font-size: 17px;
    line-height: 1.5;
    letter-spacing: 0;
  }
  .dialogue-copy,
  .preview .dialogue-copy {
    font-size: 11px;
  }
  .conversation {
    width: calc(100% - 20px);
    padding: 13px 19px 12px;
    margin-bottom: 6px;
    border-image-width: 19px;
  }
  .speaker {
    min-height: 22px;
  }
  .speaker .availability {
    right: 20px;
  }
  .preview .profile-line {
    margin-bottom: 3px;
  }
  .preview-export {
    margin-top: 3px;
  }
  .blend-visual {
    display: none;
  }
  .menu-toolbar .text-link {
    font-size: 8px;
    padding-inline: 12px;
  }
  .tasting-sheet {
    padding-inline: 14px;
  }
  .menu-copy > h2 {
    font-size: 24px;
  }
  body .palette-choice {
    min-height: 87px;
    padding-inline: 8px;
  }
  body .palette-choice span {
    font-size: 10px;
  }
  body .palette-choice strong {
    font-size: 22px;
  }
  .result-tabs {
    gap: 2px;
  }
  .result-tabs button {
    font-size: 10px;
    padding-inline: 3px;
  }
  .palette-detail h4 {
    font-size: 18px;
  }
  .insight h3 {
    font-size: 18px;
    line-height: 1.45;
  }
  .insight-part > strong {
    display: none;
  }
  .reading-tabs button {
    font-size: 10px;
    padding-inline: 14px;
  }
}
@media (max-width: 360px) {
  .site-footer > span:first-child {
    display: none;
  }
  .footer-links {
    width: 100%;
    margin: 0;
    justify-content: center;
  }
  .wordmark img {
    width: 128px;
    max-width: 40vw;
  }
  .site-header .back-link {
    padding-inline: 10px;
  }
  .scene-controls .motion-toggle,
  .scene-controls .voice-play {
    font-size: 8px;
    padding-inline: 14px;
  }
}
/* 長い銘柄名は続きを送り、他の項目では見出し用の操作も退ける。 */
#title-pages{flex:0 0 auto;margin:0 0 6px}body[data-result-tab]:not([data-result-tab='overview']) #title-pages{display:none}.text-page-body{white-space:pre-wrap}.dialog-page{min-height:0;flex:1}.save-dialog .export-help{font-size:11px;line-height:1.7}.site-header nav>.audio-toggle{white-space:nowrap}
/* 旧hoverのbackground短縮指定で画像サイズがautoへ戻るのを防ぐ。 */
button.primary-button:hover:not(:disabled),button.primary-button:active,button.primary-button:focus-visible{background:var(--ui-primary) center/100% 100% no-repeat;filter:brightness(1.05)}button.secondary-button:hover:not(:disabled),button.secondary-button:active,button.secondary-button:focus-visible{background:var(--ui-secondary) center/100% 100% no-repeat;filter:brightness(1.05)}
/* 詳細を読む間は保存を上部へ移し、本文の行とページ操作を重ねない。 */
#save-toolbar{display:none}body[data-result-tab]:not([data-result-tab='overview']) #save-toolbar{display:inline-flex}body[data-result-tab]:not([data-result-tab='overview']) #portrait-replay,body[data-result-tab]:not([data-result-tab='overview']) .tasting-sheet .menu-actions{display:none}

/* 紙の外側には店内写真が続く。人物は紙の後ろへ重ね、顔のための上段高さを保つ。 */
.cafe { background: transparent; }
.cafe > .cafe-backdrop { position: absolute; inset: 0; z-index: 0; }
body[data-scene='welcome'] .stage,body[data-scene='collect'] .stage,body[data-scene='select'] .stage { overflow: visible; }

.cafe > .stage { background: transparent; }
