/* コーヒー版で試す共通メニュー。会話の幅・文字・選択肢は変更しない。 */
body { padding-top: env(safe-area-inset-top, 0px); }

.coffee-page-actions {
  position: fixed;
  z-index: 50;
  top: 50%;
  right: max(8px, calc((100vw - var(--content-max, 680px)) / 2 - 72px));
  display: grid;
  width: 60px;
  transform: translateY(-50%);
  filter: drop-shadow(0 7px 15px rgba(62, 48, 42, .16));
}

.coffee-page-icon {
  display: grid;
  height: 58px;
  place-items: center;
  border-radius: 12px 0 0 0;
  background: #fff;
}

.coffee-page-icon img {
  display: block;
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
}

.coffee-page-link {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 118px;
  margin: 0;
  border: 0;
  padding: 9px 6px;
  color: #fff;
  text-decoration: none;
  writing-mode: vertical-rl;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.5;
  cursor: pointer;
  appearance: none;
}

.coffee-page-home { background: #b56a7b; }
.coffee-page-install { border-radius: 0 0 0 5px; background: #5e3fa3; }
.coffee-page-link:hover { filter: brightness(.96); }
.coffee-page-link:disabled { cursor: wait; }
.coffee-page-actions > :focus-visible { outline: 3px solid #342a23; outline-offset: 3px; }

/* 680pxの本文＋左右の余白が不足するときは、本文幅を保って下部に置く。 */
@media (max-width: 839px), (max-height: 380px) {
  html { scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  body {
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    padding-left: env(safe-area-inset-left, 0px);
  }

  .coffee-page-actions {
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr);
    width: min(100%, var(--content-max, 680px));
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    border-top: 1px solid #e6dbd3;
    border-radius: 16px 16px 0 0;
    background: #fff;
    transform: translateX(-50%);
    filter: none;
    box-shadow: 0 -5px 20px rgba(62, 48, 42, .10);
  }

  .coffee-page-icon { height: 56px; border-radius: 16px 0 0 0; }
  .coffee-page-icon img { width: 40px; height: 40px; }
  .coffee-page-link {
    min-height: 56px;
    padding: 10px 8px;
    writing-mode: horizontal-tb;
    font-size: 13px;
    letter-spacing: .04em;
    white-space: nowrap;
  }
  .coffee-page-install { border-radius: 0 16px 0 0; }
  .coffee-page-actions > :focus-visible { outline-offset: -4px; }
}

.coffee-install-dialog {
  width: min(360px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow-y: auto;
  border: 1px solid #decfbe;
  border-radius: 22px;
  color: #342a23;
  background: #fffdf9;
  box-shadow: 0 18px 48px rgba(62, 43, 30, .18);
}
.coffee-install-dialog::backdrop { background: rgba(52, 42, 35, .34); }
.coffee-install-dialog h2 { margin: 0 0 12px; font-size: 18px; line-height: 1.6; }
.coffee-install-dialog p { margin: 0 0 20px; font-size: 14px; line-height: 1.9; white-space: pre-line; }
.coffee-install-dialog form { margin: 0; }
.coffee-install-dialog button {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #70523f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.coffee-install-dialog button:focus-visible { outline: 3px solid #342a23; outline-offset: 3px; }
