:root {
  --chat-accent-soft: #ffd3ee;
  --chat-accent: #ff9fd8;
  --chat-accent-deep: #b28cff;
  --chat-accent-ink: #251129;
  --bg: #03040a;
  --panel: rgba(8, 12, 31, 0.86);
  --panel-strong: rgba(13, 18, 43, 0.94);
  --gold: #f0d49a;
  --blue: #9edcff;
  --text: #f8fbff;
  --muted: #d4def1;
  --border: rgba(255,255,255,.16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(137, 108, 255, .26), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(139, 211, 255, .20), transparent 30%),
    linear-gradient(180deg, #050713, var(--bg));
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  line-height: 1.75;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.premium-app { width: min(1120px, calc(100% - 24px)); margin: 0 auto; padding: 18px 0 34px; }
.premium-hero, .premium-screen, .premium-notice, .premium-progress, .premium-footer {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0,0,0,.34);
  backdrop-filter: blur(12px);
}
.premium-hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 22px; border-radius: 28px; }
.premium-kicker { margin: 0 0 7px; color: var(--gold); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; line-height: 1.18; letter-spacing: .03em; }
h1 { font-size: clamp(32px, 8vw, 64px); }
h2 { font-size: clamp(25px, 6vw, 42px); }
.premium-lead, .premium-section-head p { color: var(--muted); margin: 14px 0 0; }
.premium-badge { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; color: #15182a; font-weight: 900; background: linear-gradient(135deg, #fff1b7, #8bd3ff 55%, #ffb7dc); }
.premium-notice { margin-top: 14px; padding: 13px 16px; border-radius: 18px; color: #fff8d6; background: rgba(240, 212, 154, .12); }
.premium-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; padding: 10px; border-radius: 18px; }
.premium-progress .premium-tab { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 10px; border-radius: 999px; text-align: center; color: var(--muted); background: rgba(255,255,255,.07); font-size: 12px; font-weight: 800; border: 0; cursor: pointer; transition: background .16s, border-color .16s, box-shadow .16s, color .16s, filter .16s, transform .16s; }
.premium-progress .premium-tab:hover { background: rgba(255,255,255,.10); color: #fff; }
.premium-progress .premium-tab:focus-visible { outline: 2px solid rgba(158, 220, 255, .82); outline-offset: 3px; }
.premium-progress .premium-tab.is-current { color: #15182a; background: linear-gradient(135deg, #fff0b5, #8bd3ff); }
.premium-progress .chat-tab { color: var(--chat-accent-soft); background: linear-gradient(135deg, rgba(255, 159, 216, .20), rgba(178, 140, 255, .14)); border: 1px solid rgba(255, 211, 238, .30); box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 0 18px rgba(255, 159, 216, .12); }
.premium-progress .chat-tab-icon { width: 15px; height: 15px; flex: 0 0 auto; fill: currentColor; filter: drop-shadow(0 1px 6px rgba(255, 159, 216, .28)); }
.premium-progress .chat-tab:hover { color: #fff7fc; background: linear-gradient(135deg, rgba(255, 159, 216, .30), rgba(178, 140, 255, .22)); border-color: rgba(255, 211, 238, .48); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 22px rgba(255, 159, 216, .18); filter: brightness(1.04); }
.premium-progress .chat-tab:focus-visible { outline-color: rgba(255, 211, 238, .95); box-shadow: 0 0 0 4px rgba(255, 159, 216, .16), 0 0 22px rgba(178, 140, 255, .18); }
.premium-progress .chat-tab.is-current { color: var(--chat-accent-ink); background: linear-gradient(135deg, #ffe0f1 0%, var(--chat-accent) 48%, var(--chat-accent-deep) 100%); border-color: rgba(255, 235, 248, .72); box-shadow: inset 0 1px 0 rgba(255,255,255,.42), 0 0 24px rgba(255, 159, 216, .24); }
.premium-screen { margin-top: 14px; padding: 20px; border-radius: 24px; }
.mentor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.mentor-card { width: 100%; min-height: 180px; padding: 16px; border-radius: 20px; text-align: left; color: var(--text); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); cursor: pointer; transition: transform .16s, filter .16s, border-color .16s; }
.mentor-card:active, .option-btn:active, .primary-btn:active, .ghost-btn:active, .choice-btn:active { transform: scale(.98); }
.mentor-card:not(:disabled):hover { transform: translateY(-2px); border-color: rgba(240,212,154,.7); filter: brightness(1.08); }
.mentor-card:disabled { cursor: not-allowed; opacity: .65; }
.mentor-card strong { display: block; font-size: 22px; color: #fff; }
.mentor-role, .mentor-desc { display: block; color: var(--muted); margin-top: 6px; }
.mentor-status { display: inline-flex; margin-top: 12px; padding: 4px 9px; border-radius: 999px; color: #15182a; background: linear-gradient(135deg, #fff0b5, #8bd3ff); font-size: 12px; font-weight: 900; }
.mentor-status.is-coming { color: var(--muted); background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); }
.settings-form { display: grid; gap: 14px; margin-top: 16px; }
fieldset { margin: 0; padding: 14px; border-radius: 20px; border: 1px solid var(--border); background: rgba(255,255,255,.05); }
legend { padding: 0 6px; color: var(--gold); font-weight: 900; }
.option-grid, .choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-grid { margin-top: 12px; }
.answer-start-btn { margin: 6px 0 0; }
.option-btn, .choice-btn { width: 100%; min-height: 48px; padding: 12px 13px; border-radius: 16px; border: 1px solid rgba(255,255,255,.14); color: var(--text); background: rgba(255,255,255,.07); cursor: pointer; text-align: left; transition: .16s; }
.option-btn.is-selected, .choice-btn.is-selected, .choice-btn.choice-selected { color: #15182a; background: linear-gradient(135deg, #fff0b5, #8bd3ff); font-weight: 900; }
.choice-btn.choice-correct { color: #102018; border-color: rgba(127, 229, 171, .95); background: linear-gradient(135deg, #d8ffe7, #8fe8b3); font-weight: 900; }
.choice-btn.choice-wrong { color: #2b1315; border-color: rgba(255, 156, 156, .95); background: linear-gradient(135deg, #ffd6d6, #ffaaa5); font-weight: 900; }
.choice-btn:disabled { cursor: default; opacity: .95; }
.premium-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.primary-btn, .ghost-btn { min-height: 48px; padding: 12px 18px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 900; transition: transform .16s, filter .16s; }
.primary-btn { color: #15182a; background: linear-gradient(135deg, #fff0b5, #8bd3ff); }
.ghost-btn { color: var(--text); background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); }
.alice-message-card { display: grid; grid-template-columns: 82px 1fr; gap: 14px; padding: 16px; border-radius: 22px; background: var(--panel-strong); border: 1px solid var(--border); }
.alice-portrait { width: 82px; height: 82px; border-radius: 24px; display: grid; place-items: center; color: #15182a; font-weight: 900; background: linear-gradient(135deg, #fff3b8, #ffb7dc 48%, #8bd3ff); }
.alice-message { margin: 0 0 10px; font-size: 18px; color: #fff; }
.daily-task { margin-top: 6px; color: var(--muted); }
.daily-task strong { color: var(--gold); }
.question-card, .answer-box { margin-top: 14px; padding: 16px; border-radius: 22px; background: rgba(255,255,255,.06); border: 1px solid var(--border); }
.english-line { color: #fff; font-size: 18px; font-weight: 800; word-break: normal; overflow-wrap: anywhere; }
.answer-box { color: #fff8d6; white-space: pre-wrap; }
.record-list { display: grid; gap: 10px; margin: 16px 0 0; }
.record-list div { display: grid; grid-template-columns: 180px 1fr; gap: 10px; padding: 13px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.record-list dt { color: var(--gold); font-weight: 900; }
.record-list dd { margin: 0; color: var(--text); }
.record-sections { display: grid; gap: 14px; margin-top: 16px; }
.record-block { padding: 16px; border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid var(--border); }
.record-block h3 { margin: 0; color: var(--gold); font-size: 18px; }
.history-list { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.history-list li, .empty-history { margin: 0; padding: 13px; border-radius: 16px; color: var(--text); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.streak-summary span { color: #fff8d6; }
.premium-footer { margin-top: 14px; padding: 16px; border-radius: 20px; text-align: center; }
.return-link { display: inline-flex; padding: 12px 18px; border-radius: 999px; color: #15182a; background: linear-gradient(135deg, #fff0b5, #8bd3ff); font-weight: 900; text-decoration: none; }
[hidden] { display: none !important; }
@media (max-width: 720px) {
  .premium-app { width: min(100% - 18px, 520px); padding-top: 9px; }
  .premium-hero { grid-template-columns: 1fr; padding: 17px; border-radius: 22px; }
  .premium-badge { width: auto; height: auto; padding: 10px 14px; border-radius: 999px; justify-self: start; }
  .premium-progress { grid-template-columns: repeat(2, 1fr); }
  .premium-screen { padding: 15px; border-radius: 20px; }
  .mentor-grid, .option-grid, .choice-grid { grid-template-columns: 1fr; }
  .alice-message-card { grid-template-columns: 1fr; }
  .alice-portrait { width: 72px; height: 72px; border-radius: 20px; }
  .record-list div { grid-template-columns: 1fr; gap: 2px; }
  .primary-btn, .ghost-btn { width: 100%; }
}
.mission-after-comment {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid rgba(240, 212, 154, .35);
  background: linear-gradient(135deg, rgba(240, 212, 154, .14), rgba(158, 220, 255, .10));
}
.mission-after-comment h3 {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 15px;
}
.mission-after-comment p {
  margin: 0;
  color: #fff8d6;
}
.dev-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,.045);
  border: 1px dashed rgba(255,255,255,.18);
}
.dev-note summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 900;
}
.dev-note p { margin: 8px 0 0; overflow-wrap: anywhere; }
.record-dev-note { margin-top: 14px; }
.danger-btn {
  opacity: .76;
  font-size: 13px;
  min-height: 40px;
  padding: 9px 14px;
}
.danger-btn:hover,
.danger-btn:focus-visible { opacity: 1; }
.history-list li { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .premium-progress {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
  }
  .premium-progress .premium-tab {
    flex: 0 0 auto;
    min-width: 86px;
    scroll-snap-align: start;
  }
  h1 { font-size: clamp(30px, 11vw, 44px); overflow-wrap: anywhere; }
  h2 { font-size: clamp(23px, 8vw, 34px); overflow-wrap: anywhere; }
  .premium-lead, .premium-section-head p, .daily-task, .question-card p { overflow-wrap: anywhere; }
  .english-line { font-size: 16px; line-height: 1.65; }
  .premium-actions { gap: 12px; }
  .daily-task { margin-top: 8px; }
  .record-block { padding: 14px; }
}
.learning-status-card,
.mission-clear-card {
  margin: 12px 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(158, 220, 255, .28);
  background: linear-gradient(135deg, rgba(158, 220, 255, .12), rgba(240, 212, 154, .08));
}
.learning-status-card h3,
.mission-clear-card h3 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 18px;
}
.learning-status-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}
.learning-status-card div {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 10px;
  align-items: center;
}
.learning-status-card dt {
  color: var(--gold);
  font-weight: 900;
}
.learning-status-card dd {
  margin: 0;
  color: var(--text);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-right: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  color: #121827;
  background: linear-gradient(135deg, #fff0b5, #8bd3ff);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.status-success { background: linear-gradient(135deg, #d8ffe7, #8fe8b3); color: #102018; }
.status-pending { background: rgba(255,255,255,.12); color: #fff8d6; border: 1px solid rgba(255,255,255,.18); }
.status-warning { background: linear-gradient(135deg, #ffe0a8, #ffb7dc); color: #2a1820; }
.mission-clear-card {
  border-color: rgba(240, 212, 154, .42);
}
.mission-clear-card.is-complete {
  background: linear-gradient(135deg, rgba(216, 255, 231, .18), rgba(240, 212, 154, .16));
  box-shadow: 0 0 28px rgba(240, 212, 154, .12);
}
.mission-clear-card.is-ready {
  background: linear-gradient(135deg, rgba(255, 240, 181, .18), rgba(158, 220, 255, .14));
  box-shadow: 0 0 28px rgba(158, 220, 255, .12);
}
.mission-clear-card.is-pending,
.mission-clear-card.is-waiting {
  background: rgba(255,255,255,.055);
}
.mission-clear-card p { margin: 0; color: #fff8d6; }
@media (max-width: 720px) {
  .learning-status-card div { grid-template-columns: 1fr; gap: 2px; }
}
.setting-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.alice-question-card {
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(158, 220, 255, .07));
}
.question-guide {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.question-alice-image {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(240, 212, 154, .42);
  background: rgba(255,255,255,.08);
  box-shadow: 0 10px 30px rgba(0,0,0,.24);
}
.alice-question-intro {
  margin: 0;
  color: #fff8d6;
  font-size: 18px;
  font-weight: 800;
}
.question-expression-label,
.question-subhead {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}
.question-expression-label span {
  color: var(--gold);
}
.question-subhead {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: .04em;
}
@media (max-width: 720px) {
  .question-guide {
    grid-template-columns: 68px 1fr;
    gap: 10px;
  }
  .question-alice-image {
    width: 68px;
    height: 68px;
    border-radius: 18px;
  }
  .alice-question-intro {
    font-size: 16px;
  }
}
.question-help {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}
.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}
.compact-btn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
  opacity: .9;
}
.compact-btn:hover,
.compact-btn:focus-visible { opacity: 1; }
@media (max-width: 720px) {
  .question-actions { display: grid; grid-template-columns: 1fr; }
  .compact-btn { width: 100%; }
}

.answer-box.is-correct,
.answer-box.is-incorrect {
  white-space: normal;
  color: var(--text);
}
.answer-box.is-correct {
  border-color: rgba(127, 229, 171, .42);
  background: linear-gradient(135deg, rgba(216, 255, 231, .13), rgba(158, 220, 255, .08));
}
.answer-box.is-incorrect {
  border-color: rgba(255, 183, 220, .38);
  background: linear-gradient(135deg, rgba(255, 183, 220, .11), rgba(240, 212, 154, .08));
}
.quiz-reaction {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 13px;
  align-items: center;
}
.quiz-reaction-image {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 22px;
  border: 1px solid rgba(240, 212, 154, .38);
  background: rgba(255,255,255,.08);
  box-shadow: 0 10px 24px rgba(0,0,0,.20);
}
.quiz-reaction.is-image-missing {
  grid-template-columns: 1fr;
}
.quiz-reaction-text {
  margin: 0;
  color: #fff8d6;
  font-size: 18px;
  font-weight: 900;
}
.quiz-reaction-subtext {
  margin: 3px 0 0;
  color: var(--muted);
  font-weight: 800;
}
.quiz-explanation {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.13);
  color: #fff;
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .quiz-reaction {
    grid-template-columns: 64px 1fr;
    gap: 10px;
  }
  .quiz-reaction-image {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }
  .quiz-reaction-text { font-size: 16px; }
}

.quiz-card-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin: -2px 0 14px;
}
.quiz-bgm-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.bgm-toggle-btn {
  min-width: 120px;
  text-align: center;
}
.bgm-toggle-btn.is-bgm-on {
  color: #102018;
  background: linear-gradient(135deg, #d8ffe7, #8fe8b3);
  border-color: rgba(127, 229, 171, .95);
}
.answer-box.is-correct,
.answer-box.is-incorrect {
  position: relative;
  overflow: visible;
  margin-top: 26px;
  padding: 18px 18px 18px 20px;
}
.quiz-reaction {
  position: relative;
  min-height: 190px;
  grid-template-columns: minmax(210px, 30%) 1fr;
  gap: 20px;
  align-items: end;
  padding: 10px 10px 4px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.quiz-reaction::before {
  content: none;
}
.quiz-reaction-image {
  position: relative;
  z-index: 1;
  width: clamp(190px, 24vw, 285px);
  height: clamp(190px, 24vw, 285px);
  margin: -46px 0 -30px -18px;
  border-radius: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  transform: rotate(-2deg);
  filter: drop-shadow(0 26px 38px rgba(0,0,0,.38));
}
.quiz-reaction-body {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
  padding: 18px 20px;
  border-radius: 24px 24px 24px 8px;
  color: #15182a;
  background: linear-gradient(135deg, #fff8d6, #b7e5ff);
  box-shadow: 0 16px 36px rgba(0,0,0,.22);
}
.quiz-reaction-body::before {
  content: "";
  position: absolute;
  left: -16px;
  bottom: 28px;
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-right: 18px solid #fff8d6;
}
.quiz-reaction-text {
  color: #15182a;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.28;
}
.quiz-reaction-subtext {
  color: #33405c;
  font-size: 15px;
}
.quiz-explanation {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(3,4,10,.34);
}
@media (max-width: 720px) {
  .quiz-card-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .quiz-bgm-status { text-align: center; }
  .answer-box.is-correct,
  .answer-box.is-incorrect {
    margin-top: 18px;
    padding: 12px;
    overflow: hidden;
  }
  .quiz-reaction {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 4px;
    padding: 0;
  }
  .quiz-reaction::before { content: none; }
  .quiz-reaction-image {
    width: min(68vw, 230px);
    height: min(68vw, 230px);
    margin: -16px auto -20px;
    border-radius: 28px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .quiz-reaction-body {
    margin: 0;
    padding: 15px 16px;
    border-radius: 22px;
  }
  .quiz-reaction-body::before { display: none; }
  .quiz-reaction-text { font-size: 22px; }
}

.answer-box.is-conversation {
  white-space: normal;
  color: var(--text);
  border-color: rgba(158, 220, 255, .34);
  background: linear-gradient(135deg, rgba(158, 220, 255, .12), rgba(240, 212, 154, .08));
}
.conversation-choice small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.conversation-choice.choice-selected small { color: #33405c; }
.conversation-selected,
.conversation-alice-reply {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.12);
}
.conversation-selected span { color: var(--gold); font-weight: 800; }
.conversation-alice-reply {
  margin-top: 12px;
  color: #15182a;
  background: linear-gradient(135deg, #fff8d6, #b7e5ff);
}
.conversation-alice-reply strong { display: block; margin-bottom: 5px; }
.conversation-alice-reply p { margin: 0; color: #202a44; }
.question-alice-image {
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.28));
}

.conversation-choice .choice-english,
.conversation-selected .reply-english {
  display: block;
  font-weight: 900;
  line-height: 1.45;
}
.conversation-choice .choice-ja,
.conversation-selected .reply-ja {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.conversation-choice.choice-selected .choice-ja { color: #33405c; }
.conversation-reaction { margin-top: 12px; }
.conversation-follow-up {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px solid rgba(32,42,68,.18);
  font-weight: 800;
}
@media (max-width: 560px) {
  .conversation-choice .choice-english { font-size: 15px; }
  .conversation-choice .choice-ja { font-size: 12px; }
}

/* v0.7.2: conversation-first compact layout */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.alice-question-card {
  padding: 14px 16px 16px;
}
.quiz-card-toolbar {
  margin: -4px 0 8px;
}
.quiz-bgm-status {
  opacity: .72;
}
.bgm-toggle-btn {
  min-width: 96px;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}
.question-guide {
  margin-bottom: 8px;
}
.question-alice-image {
  width: 76px;
  height: 76px;
}
.question-help,
.question-expression-label {
  font-size: 12px;
  opacity: .82;
}
.question-expression-label {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}
.alice-question-intro {
  white-space: pre-line;
  line-height: 1.45;
}
.question-subhead {
  margin-top: 10px;
}
.choice-grid {
  margin-top: 8px;
}
.reply-option-section {
  display: grid;
  gap: 8px;
}
.reply-option-section-chat {
  grid-column: 1 / -1;
}
.reply-option-heading {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}
.reply-option-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.reply-option-section-actions .reply-option-list {
  grid-template-columns: 1fr;
}
.conversation-choice-action {
  border-color: rgba(158, 220, 255, .38);
  background: linear-gradient(135deg, rgba(158, 220, 255, .14), rgba(255,255,255,.06));
}
.choice-btn {
  min-height: 42px;
  padding: 10px 12px;
}
.conversation-current-reply {
  margin: 8px 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
.conversation-current-reply[hidden] + .question-subhead {
  margin-top: 6px;
}
.answer-box.is-conversation {
  border: 0;
  background: transparent;
}
.answer-box.is-conversation .quiz-reaction {
  display: none;
}
.conversation-selected,
.conversation-alice-reply {
  padding: 10px 12px;
}
.conversation-selected {
  font-size: 14px;
}
.conversation-alice-reply {
  margin-top: 8px;
}
.conversation-dev-note {
  margin-top: 12px;
}
.dev-scene-line {
  margin: 6px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.compact-history {
  margin-top: 8px;
}
@media (max-width: 720px) {
  .alice-question-card { padding: 12px; }
  .quiz-card-toolbar {
    display: flex;
    justify-content: flex-end;
  }
  .quiz-bgm-status { display: none; }
  .question-guide {
    grid-template-columns: 58px 1fr;
  }
  .question-alice-image {
    width: 58px;
    height: 58px;
  }
  .alice-question-intro { font-size: 15px; }
}

/* v0.7.3: LINE-like chat UI */
.question-expression-label,
.alice-question-intro {
  display: none !important;
}
.chat-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-history {
  max-height: min(52vh, 440px);
  overflow-y: auto;
  padding: 14px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(73, 98, 137, .22), rgba(8, 13, 28, .24));
  scroll-behavior: smooth;
}
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 10px 0;
}
.chat-row-alice { justify-content: flex-start; }
.chat-row-user { justify-content: flex-end; }
.chat-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  filter: drop-shadow(0 5px 10px rgba(0,0,0,.22));
}
.chat-bubble {
  max-width: min(76%, 560px);
  padding: 11px 13px;
  border-radius: 19px;
  box-shadow: 0 10px 22px rgba(0,0,0,.16);
}
.chat-row-alice .chat-bubble {
  border-bottom-left-radius: 6px;
  color: #172033;
  background: linear-gradient(135deg, #fff9dd, #dff4ff);
}
.chat-row-user .chat-bubble {
  border-bottom-right-radius: 6px;
  color: #fff;
  background: linear-gradient(135deg, #5f8fff, #6d62d8);
}
.chat-en,
.chat-ja {
  display: block;
  line-height: 1.55;
}
.chat-en { font-weight: 850; }
.chat-ja { margin-top: 3px; opacity: .86; font-size: 13px; }
.chat-row-user .chat-ja { color: rgba(255,255,255,.82); }
.chat-row-alice .chat-ja { color: #44506a; }
.alice-question-card .choice-grid {
  position: sticky;
  bottom: 8px;
  z-index: 5;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  background: rgba(9, 14, 30, .86);
  backdrop-filter: blur(12px);
}
.alice-question-card .conversation-choice {
  text-align: left;
  border-color: rgba(158, 220, 255, .26);
}
.alice-question-card .conversation-choice:disabled { opacity: 1; }
@media (max-width: 720px) {
  .chat-history {
    max-height: 48vh;
    padding: 10px 8px;
  }
  .chat-bubble { max-width: 82%; }
  .choice-grid { grid-template-columns: 1fr; }
}

/* v0.7.7: context-matched API-assisted text conversation and free input */
.option-btn small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.option-btn.is-selected small { color: #33405c; }
.free-chat-form {
  position: sticky;
  bottom: 8px;
  z-index: 6;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  background: rgba(9, 14, 30, .88);
  backdrop-filter: blur(12px);
}
.free-chat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.free-chat-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border-radius: 999px;
  border: 1px solid rgba(158, 220, 255, .28);
  color: var(--text);
  background: rgba(255,255,255,.08);
  outline: none;
}
.free-chat-input:focus {
  border-color: rgba(240, 212, 154, .76);
  box-shadow: 0 0 0 3px rgba(240, 212, 154, .12);
}
.free-chat-submit {
  min-height: 46px;
  white-space: nowrap;
}
.free-chat-input:disabled,
.free-chat-submit:disabled,
.conversation-choice:disabled {
  cursor: wait;
  opacity: .68;
}
.free-chat-note {
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  opacity: .82;
}
@media (max-width: 720px) {
  .free-chat-row { grid-template-columns: 1fr; }
  .free-chat-submit { width: 100%; }
}

/* v0.7.8: natural chat pause, thinking bubble, and independent SFX toggle */
.sfx-toggle-btn.is-sfx-on {
  border-color: rgba(240, 212, 154, .55);
  box-shadow: 0 0 0 2px rgba(240, 212, 154, .10);
}
.chat-thinking-bubble {
  opacity: .86;
}
.chat-thinking-bubble .chat-en::after,
.chat-thinking-bubble .chat-ja::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  overflow: hidden;
  vertical-align: bottom;
  animation: aliceThinkingDots 1.2s steps(4, end) infinite;
}
@keyframes aliceThinkingDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75%, 100% { content: '...'; }
}
@media (max-width: 720px) {
  .quiz-card-toolbar {
    gap: 8px;
    flex-wrap: wrap;
  }
  .sfx-toggle-btn { flex: 1 1 auto; }
}

/* v0.8.4: screen-switching Alice conversation UI */
.today-screen-nav {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
  margin: 14px 0 12px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
}
.today-screen-tab {
  min-height: 38px;
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}
.today-screen-tab.is-active {
  color: #15182a;
  background: linear-gradient(135deg, #fff0b5, #8bd3ff);
}
.today-mini-screen { min-height: 0; }
.status-summary-card {
  grid-template-columns: minmax(108px, 18%) 1fr;
  align-items: center;
}
.alice-status-image,
.alice-hero-image {
  width: 100%;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 28px 38px rgba(0,0,0,.38));
}
.alice-status-image { max-height: 210px; }
.alice-hero-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr);
  gap: 18px;
  align-items: center;
  min-height: clamp(420px, 58vh, 620px);
  padding: 22px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 28px;
  background: radial-gradient(circle at 74% 20%, rgba(255,183,220,.28), transparent 32%), rgba(255,255,255,.055);
  overflow: hidden;
}
.alice-hero-copy h3 {
  margin: 0;
  font-size: clamp(28px, 4.6vw, 54px);
  line-height: 1.12;
}
.alice-hero-copy p:not(.premium-kicker) { color: var(--muted); }
.alice-hero-image { max-height: min(58vh, 560px); justify-self: center; }
.alice-chat-screen .alice-question-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  max-height: calc(100dvh - 220px);
  min-height: 560px;
  overflow: hidden;
}
.alice-chat-screen .chat-shell { min-height: 0; }
.alice-chat-screen .chat-history {
  flex: 1 1 auto;
  max-height: none;
  min-height: 210px;
}
.alice-chat-screen .choice-grid,
.alice-chat-screen .free-chat-form { position: static; }

@media (min-width: 900px) {
  .alice-chat-screen .alice-question-card {
    grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 10px 16px;
  }
  .alice-chat-screen .quiz-card-toolbar,
  .alice-chat-screen .question-guide,
  .alice-chat-screen .chat-shell { grid-column: 1; }
  .alice-chat-screen .choice-grid,
  .alice-chat-screen .free-chat-form,
  .alice-chat-screen .conversation-current-reply,
  .alice-chat-screen .conversation-dev-note { grid-column: 2; }
  .alice-chat-screen .question-guide {
    grid-template-columns: minmax(180px, 260px) 1fr;
    align-items: center;
  }
  .alice-chat-screen .question-alice-image {
    width: clamp(180px, 24vw, 280px);
    height: clamp(180px, 24vw, 280px);
  }
}

@media (max-width: 720px) {
  html, body { min-height: 100%; overflow: hidden; }
  body { height: 100dvh; }
  .premium-app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100%;
    padding: 8px;
    overflow: hidden;
  }
  .premium-hero, .premium-notice, .premium-progress, .premium-footer { display: none; }
  .premium-screen {
    flex: 1 1 auto;
    margin: 0;
    min-height: 0;
    overflow: hidden;
  }
  #todayScreen {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  #todayScreen.is-active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  #todayScreen .premium-section-head { flex: 0 0 auto; }
  #todayScreen .premium-section-head p { display: none; }
  #todayScreen .premium-section-head h2 { font-size: 22px; }
  .today-screen-nav { width: 100%; flex: 0 0 auto; margin: 10px 0; }
  .today-mini-screen {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #todayScreen .today-mini-screen {
    flex: 0 0 auto;
    overflow: visible;
  }
  .today-mini-screen.is-active { display: flex; flex-direction: column; }
  .status-summary-card {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: 72px 1fr;
    align-items: start;
    padding: 12px;
    overflow: hidden;
  }
  #todayScreen .status-summary-card {
    flex: 0 0 auto;
    overflow: visible;
  }
  .alice-status-image { max-height: 92px; }
  .alice-message { font-size: 15px; line-height: 1.55; }
  .learning-status-card, .mission-clear-card, .daily-task { font-size: 12px; line-height: 1.45; }
  .status-summary-card .dev-note, .status-summary-card .mission-after-comment { display: none; }
  .today-screen-actions { flex: 0 0 auto; margin-top: 10px; }
  .alice-hero-screen {
    min-height: 0;
    padding: 16px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    text-align: center;
  }
  .alice-hero-copy h3 { font-size: 30px; }
  .alice-hero-copy p:not(.premium-kicker) { margin: 8px 0 0; font-size: 13px; }
  .alice-hero-image { max-height: 48dvh; }
  .alice-chat-screen .alice-question-card {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    margin: 0;
    padding: 10px;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  }
  .alice-chat-screen .question-guide { grid-template-columns: 88px 1fr; }
  .alice-chat-screen .question-alice-image { width: 88px; height: 88px; }
  .alice-chat-screen .chat-history { min-height: 0; }
  .alice-chat-screen .conversation-dev-note { display: none; }
  .alice-chat-screen .choice-grid {
    max-height: 28dvh;
    overflow-y: auto;
    padding: 8px;
  }
  .chat-footer-actions { display: none; }
}

@media (max-width: 720px) and (orientation: landscape) {
  #todayScreen .premium-section-head { display: none; }
  .today-screen-nav { margin: 0 0 8px; }
  .alice-hero-screen { grid-template-columns: .85fr 1.15fr; grid-template-rows: 1fr auto; text-align: left; }
  .alice-hero-image { max-height: 62dvh; }
  .alice-hero-screen .today-screen-actions { grid-column: 1 / -1; }
  .alice-chat-screen .question-guide { grid-template-columns: 72px 1fr; }
  .alice-chat-screen .question-alice-image { width: 72px; height: 72px; }
}
.today-return-link { text-align: center; text-decoration: none; }

/* v0.8.5: chat-first LINE timeline layout */
.today-screen-nav {
  grid-template-columns: repeat(2, minmax(96px, 1fr));
}
.alice-chat-screen {
  min-height: 0;
}
.alice-chat-screen .alice-question-card {
  width: min(960px, 100%);
  margin: 0 auto;
  min-height: clamp(620px, calc(100dvh - 190px), 860px);
  max-height: calc(100dvh - 190px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  overflow: hidden;
}
.alice-chat-screen .quiz-card-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.alice-chat-screen .question-guide {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
}
.alice-chat-screen .question-alice-image {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.22));
}
.alice-chat-screen .question-guide-text .premium-kicker,
.alice-chat-screen .question-help {
  margin: 0;
}
.alice-chat-screen .question-help {
  font-size: 13px;
  line-height: 1.45;
}
.alice-chat-screen .chat-shell {
  min-height: 0;
  gap: 0;
}
.alice-chat-screen .chat-history {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  padding: 18px 16px;
  border-radius: 24px;
}
.alice-chat-screen .question-subhead {
  margin: 8px 2px 0;
  font-size: 12px;
}
.alice-chat-screen .choice-grid {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 86px;
  overflow-y: auto;
  padding: 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}
.alice-chat-screen .conversation-choice {
  flex: 0 1 auto;
  min-height: 34px;
  width: auto;
  padding: 7px 12px;
  border-radius: 999px;
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
  box-shadow: none;
}
.alice-chat-screen .conversation-choice .choice-english,
.alice-chat-screen .conversation-choice .choice-ja {
  display: inline;
  margin: 0;
  font-size: inherit;
  line-height: inherit;
}
.alice-chat-screen .conversation-choice .choice-ja + .choice-english::before,
.alice-chat-screen .conversation-choice .choice-english + .choice-ja::before {
  content: " / ";
  opacity: .7;
}
.alice-chat-screen .free-chat-form {
  position: static;
  z-index: auto;
  margin-top: 0;
  padding: 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}
.alice-chat-screen .free-chat-note {
  margin-top: 5px;
}
.chat-bubble {
  max-width: min(78%, 620px);
  font-size: 15px;
}
.chat-ja { font-size: 14px; }
.chat-avatar {
  width: 34px;
  height: 34px;
}
@media (min-width: 900px) {
  .alice-chat-screen .alice-question-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 10px;
  }
  .alice-chat-screen .quiz-card-toolbar,
  .alice-chat-screen .question-guide,
  .alice-chat-screen .chat-shell,
  .alice-chat-screen .choice-grid,
  .alice-chat-screen .free-chat-form,
  .alice-chat-screen .conversation-current-reply,
  .alice-chat-screen .conversation-dev-note {
    grid-column: 1;
  }
}
@media (max-width: 720px) {
  .today-screen-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alice-chat-screen .alice-question-card {
    height: 100%;
    max-height: none;
    min-height: 0;
    padding: 8px;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  }
  .alice-chat-screen .quiz-card-toolbar { gap: 6px; }
  .alice-chat-screen .question-guide {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 6px 8px;
  }
  .alice-chat-screen .question-alice-image { width: 44px; height: 44px; }
  .alice-chat-screen .question-help { font-size: 12px; }
  .alice-chat-screen .chat-history { padding: 12px 8px; }
  .chat-bubble { max-width: 80%; font-size: 14px; padding: 10px 12px; }
  .chat-ja { font-size: 13px; }
  .chat-avatar { width: 30px; height: 30px; }
  .alice-chat-screen .choice-grid { max-height: 74px; padding-top: 6px; }
  .alice-chat-screen .conversation-choice { min-height: 32px; padding: 6px 10px; font-size: 12px; }
  .alice-chat-screen .free-chat-row { grid-template-columns: 1fr auto; }
  .alice-chat-screen .free-chat-submit { width: auto; min-height: 42px; }
  .free-chat-input { min-height: 42px; }
}

/* v0.8.6: prioritize a LINE-style tall vertical conversation timeline */
body.is-chat-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: min(100dvh, 900px);
}
body.is-chat-view .premium-section-head {
  margin-bottom: 6px;
}
body.is-chat-view .premium-section-head .premium-kicker,
body.is-chat-view .premium-section-head h2 {
  margin: 0;
}
body.is-chat-view .premium-section-head h2 {
  font-size: clamp(18px, 2.4vw, 24px);
}
body.is-chat-view .today-screen-nav {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
body.is-chat-view .alice-chat-screen.is-active {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
body.is-chat-view .alice-chat-screen .alice-question-card {
  width: min(820px, 100%);
  height: calc(100dvh - 132px);
  min-height: 680px;
  max-height: 900px;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: clamp(10px, 1.8vw, 16px);
  border-radius: 28px;
}
body.is-chat-view .alice-chat-screen .quiz-card-toolbar {
  grid-row: 1;
  justify-content: flex-start;
  align-items: center;
  padding: 0 2px;
  min-height: 32px;
}
body.is-chat-view .alice-chat-screen .question-guide {
  grid-row: 1;
  justify-self: end;
  max-width: min(420px, 62%);
  padding: 0;
  border: 0;
  background: transparent;
}
body.is-chat-view .alice-chat-screen .question-alice-image {
  width: 36px;
  height: 36px;
}
body.is-chat-view .alice-chat-screen .question-guide-text .premium-kicker {
  font-size: 12px;
}
body.is-chat-view .alice-chat-screen .question-help {
  display: none;
}
body.is-chat-view .alice-chat-screen .chat-shell {
  grid-row: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}
body.is-chat-view .alice-chat-screen .chat-history {
  min-height: 0;
  height: auto;
  overflow-y: auto;
  padding: clamp(14px, 2vw, 22px) clamp(10px, 2vw, 18px);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(154, 193, 230, .30), rgba(119, 155, 197, .18));
}
body.is-chat-view .alice-chat-screen .question-subhead {
  display: none;
}
body.is-chat-view .alice-chat-screen .choice-grid {
  grid-row: 3;
  grid-template-columns: 1fr;
  max-height: 72px;
  overflow-y: auto;
  align-content: start;
  padding-top: 4px;
}
body.is-chat-view .alice-chat-screen .reply-option-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
body.is-chat-view .alice-chat-screen .reply-option-section-actions .reply-option-list {
  grid-template-columns: 1fr;
}
body.is-chat-view .alice-chat-screen .free-chat-form {
  grid-row: 4;
  padding-top: 6px;
}
body.is-chat-view .chat-footer-actions,
body.is-chat-view .conversation-current-reply,
body.is-chat-view .conversation-dev-note {
  display: none;
}
body.is-chat-view .chat-row {
  margin: 12px 0;
}
body.is-chat-view .chat-bubble {
  max-width: min(78%, 560px);
}

@media (max-width: 720px) {
  body.is-chat-view {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }
  body.is-chat-view .premium-section-head {
    display: none;
  }
  body.is-chat-view .alice-chat-screen .alice-question-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    border-radius: 22px;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    padding: 8px;
  }
  body.is-chat-view .alice-chat-screen .quiz-card-toolbar {
    gap: 6px;
    flex-wrap: nowrap;
  }
  body.is-chat-view .alice-chat-screen .question-guide {
    max-width: 42%;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 6px;
  }
  body.is-chat-view .alice-chat-screen .question-guide-text .premium-kicker {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.is-chat-view .alice-chat-screen .question-alice-image {
    width: 32px;
    height: 32px;
  }
  body.is-chat-view .alice-chat-screen .choice-grid {
    max-height: 62px;
    gap: 6px;
  }
  body.is-chat-view .alice-chat-screen .conversation-choice {
    min-height: 30px;
    padding: 5px 9px;
  }
  body.is-chat-view .alice-chat-screen .free-chat-note {
    display: none;
  }
}

/* v0.8.4: strict tall smartphone-style LINE chat frame */
body.is-chat-view {
  justify-items: center;
  min-height: 900px;
}

body.is-chat-view .alice-chat-screen.is-active {
  width: min(92vw, 480px);
  justify-items: center;
  overflow: visible;
}

body.is-chat-view .alice-chat-screen .alice-question-card {
  width: min(92vw, 480px);
  max-width: 480px;
  height: clamp(860px, 84vh, 1040px);
  min-height: 860px;
  max-height: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  overflow: hidden;
  border-radius: 34px;
  padding: 14px;
}

body.is-chat-view .alice-chat-screen .quiz-card-toolbar {
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

body.is-chat-view .alice-chat-screen .question-guide {
  grid-row: 2;
  justify-self: stretch;
  max-width: none;
  width: 100%;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(108, 74, 42, .12);
  border-radius: 18px;
  background: rgba(255, 251, 242, .76);
}

body.is-chat-view .alice-chat-screen .question-alice-image {
  width: 44px;
  height: 44px;
}

body.is-chat-view .alice-chat-screen .chat-shell {
  grid-row: 3;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.is-chat-view .alice-chat-screen .chat-history {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 10px 18px;
  border-radius: 24px;
}

body.is-chat-view .alice-chat-screen .choice-grid {
  grid-row: 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0 0;
}

body.is-chat-view .alice-chat-screen .conversation-choice {
  min-height: 52px;
  padding: 8px 10px;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

body.is-chat-view .alice-chat-screen .free-chat-form {
  grid-row: 5;
  padding-top: 2px;
}

body.is-chat-view .alice-chat-screen .free-chat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

body.is-chat-view .alice-chat-screen .free-chat-input {
  width: 100%;
  min-width: 0;
}

body.is-chat-view .alice-chat-screen .free-chat-submit {
  min-height: 46px;
  width: auto;
  padding-inline: 14px;
}

body.is-chat-view .chat-bubble {
  max-width: 82%;
}

@media (max-width: 720px) {
  body.is-chat-view {
    min-height: 100dvh;
  }

  body.is-chat-view .alice-chat-screen.is-active,
  body.is-chat-view .alice-chat-screen .alice-question-card {
    width: min(96vw, 480px);
  }

  body.is-chat-view .alice-chat-screen .alice-question-card {
    height: min(100dvh, 940px);
    min-height: 820px;
    max-height: none;
    border-radius: 28px;
  }

  body.is-chat-view .alice-chat-screen .choice-grid {
    max-height: 140px;
  }

  body.is-chat-view .alice-chat-screen .conversation-choice {
    min-height: 52px;
  }
}

/* v0.8.5: PC two-column chat controls and mobile timeline-first cleanup */
.alice-chat-screen .question-guide,
body.is-chat-view .alice-chat-screen .question-guide {
  display: none !important;
}

body.is-chat-view {
  justify-items: stretch;
  min-height: 0;
}

body.is-chat-view .alice-chat-screen.is-active {
  width: 100%;
  justify-items: stretch;
  overflow: hidden;
}

body.is-chat-view .alice-chat-screen .alice-question-card {
  width: min(1080px, 100%);
  max-width: 1080px;
  height: clamp(620px, calc(100dvh - 150px), 840px);
  min-height: 620px;
  max-height: 840px;
  grid-template-columns: minmax(0, 58%) minmax(300px, 42%);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px 16px;
  padding: 16px;
  overflow: hidden;
}

body.is-chat-view .alice-chat-screen .quiz-card-toolbar {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

body.is-chat-view .alice-chat-screen .chat-shell {
  grid-column: 1;
  grid-row: 1 / 4;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

body.is-chat-view .alice-chat-screen .chat-history {
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
}

body.is-chat-view .alice-chat-screen .choice-grid {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: none;
  overflow: visible;
  padding: 0;
}

body.is-chat-view .alice-chat-screen .conversation-choice {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 18px;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

body.is-chat-view .alice-chat-screen .conversation-choice .choice-english,
body.is-chat-view .alice-chat-screen .conversation-choice .choice-ja {
  display: block;
  margin: 0;
}

body.is-chat-view .alice-chat-screen .conversation-choice .choice-ja {
  margin-top: 4px;
}

body.is-chat-view .alice-chat-screen .conversation-choice .choice-english + .choice-ja::before {
  content: none;
}

body.is-chat-view .alice-chat-screen .free-chat-form {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  padding-top: 0;
}

body.is-chat-view .alice-chat-screen .free-chat-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

body.is-chat-view .alice-chat-screen .free-chat-note {
  display: block;
}

@media (max-width: 899px) {
  body.is-chat-view .alice-chat-screen .alice-question-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  body.is-chat-view .alice-chat-screen .quiz-card-toolbar,
  body.is-chat-view .alice-chat-screen .chat-shell,
  body.is-chat-view .alice-chat-screen .choice-grid,
  body.is-chat-view .alice-chat-screen .free-chat-form {
    grid-column: 1;
  }
  body.is-chat-view .alice-chat-screen .quiz-card-toolbar { grid-row: 1; }
  body.is-chat-view .alice-chat-screen .chat-shell { grid-row: 2; }
  body.is-chat-view .alice-chat-screen .choice-grid { grid-row: 3; }
  body.is-chat-view .alice-chat-screen .free-chat-form { grid-row: 4; }
}

@media (max-width: 720px) {
  html, body { overflow-x: hidden; }
  body.is-chat-view .alice-chat-screen.is-active,
  body.is-chat-view .alice-chat-screen .alice-question-card {
    width: 100%;
    max-width: none;
  }
  body.is-chat-view .alice-chat-screen .alice-question-card {
    height: 100%;
    min-height: 0;
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 8px;
    border-radius: 20px;
  }
  body.is-chat-view .alice-chat-screen .quiz-card-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }
  body.is-chat-view .alice-chat-screen .quiz-card-toolbar .compact-btn,
  body.is-chat-view .alice-chat-screen .quiz-card-toolbar .ghost-btn {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    min-height: 30px;
    padding: 5px 9px;
    font-size: 11px;
  }
  body.is-chat-view .alice-chat-screen .chat-history {
    padding: 12px 8px;
  }
  body.is-chat-view .alice-chat-screen .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  body.is-chat-view .alice-chat-screen .conversation-choice {
    min-height: 54px;
    padding: 7px 8px;
    font-size: 12px;
  }
  body.is-chat-view .alice-chat-screen .free-chat-note {
    display: none;
  }
  body.is-chat-view .chat-bubble {
    max-width: 84%;
    overflow-wrap: anywhere;
  }
}

/* v0.8.6: mobile quick replies stay in one horizontal scroll row; PC controls sit at the bottom of the right column. */
@media (min-width: 900px) {
  body.is-chat-view .alice-chat-screen .alice-question-card {
    grid-template-columns: minmax(0, 58%) minmax(300px, 42%);
    grid-template-rows: minmax(0, 1fr) auto auto auto;
  }

  body.is-chat-view .alice-chat-screen .chat-shell {
    grid-column: 1;
    grid-row: 1 / 5;
  }

  body.is-chat-view .alice-chat-screen .choice-grid {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: none;
    overflow: visible;
  }

  body.is-chat-view .alice-chat-screen .free-chat-form {
    grid-column: 2;
    grid-row: 3;
    align-self: end;
  }

  body.is-chat-view .alice-chat-screen .quiz-card-toolbar {
    grid-column: 2;
    grid-row: 4;
    align-self: end;
  }
}

@media (max-width: 767px) {
  html,
  body,
  .premium-app,
  body.is-chat-view,
  body.is-chat-view .alice-chat-screen.is-active,
  body.is-chat-view .alice-chat-screen .alice-question-card {
    overflow-x: hidden;
  }

  body.is-chat-view .alice-chat-screen .choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 6px 4px 10px;
    white-space: normal;
  }

  body.is-chat-view .alice-chat-screen .choice-grid::after {
    content: none;
  }

  body.is-chat-view .alice-chat-screen .reply-option-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  body.is-chat-view .alice-chat-screen .conversation-choice {
    flex: 0 0 auto;
    width: 42vw;
    min-width: 140px;
    max-width: 180px;
    min-height: 44px;
    scroll-snap-align: start;
    white-space: normal;
  }

  body.is-chat-view .alice-chat-screen .conversation-choice .choice-english {
    display: none;
  }

  body.is-chat-view .alice-chat-screen .conversation-choice .choice-ja {
    display: block;
    margin: 0;
  }
}

.conversation-node-debug {
  margin: 0.5rem 0 0;
  color: #7a6f8f;
  font-size: 0.72rem;
  line-height: 1.4;
  word-break: break-word;
}

.app-action-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(158, 220, 255, .38);
  color: var(--text);
  background: linear-gradient(135deg, rgba(158, 220, 255, .14), rgba(255,255,255,.06));
  cursor: pointer;
  text-align: left;
  transition: .16s;
}
.app-action-btn span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.app-action-btn:active { transform: scale(.98); }

@media (max-width: 720px) {
  body.is-chat-view .alice-chat-screen .reply-option-list {
    display: grid;
    grid-template-columns: 1fr;
    overflow-x: hidden;
    overflow-y: visible;
    scroll-snap-type: none;
  }
  body.is-chat-view .alice-chat-screen .conversation-choice,
  body.is-chat-view .alice-chat-screen .app-action-btn {
    min-width: 0;
    white-space: normal;
  }
}

/* Recovery: keep mobile reply candidates horizontally scrollable. */
@media (max-width: 760px) {
  body.is-chat-view .alice-chat-screen .choice-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  body.is-chat-view .alice-chat-screen .reply-option-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  body.is-chat-view .alice-chat-screen .choice-grid button,
  body.is-chat-view .alice-chat-screen .choice-grid .choice-btn,
  body.is-chat-view .alice-chat-screen .conversation-choice {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 240px;
    width: auto;
    scroll-snap-align: start;
    white-space: normal;
  }
}

/* ========================================================================
   v20260708-simple-ui: conversation screen cleanup
   - PC: hide hero / notice, shrink tabs while chatting
   - Mobile: return-to-guide button in the top toolbar
   - Mobile: only conversation reply buttons scroll horizontally
   ======================================================================== */

/* Mobile-only return button next to BGM / SFX buttons */
.mobile-return-btn {
  display: none;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .mobile-return-btn { display: inline-flex; align-items: center; justify-content: center; }
}

/* Chat view (PC included): hide the tall hero / notice, keep tabs subtle */
body.is-chat-view .premium-hero,
body.is-chat-view .premium-notice {
  display: none;
}
body.is-chat-view .premium-progress {
  margin-top: 6px;
  padding: 6px;
  opacity: .65;
}
body.is-chat-view .premium-progress .premium-tab {
  padding: 5px 8px;
  font-size: 11px;
}
body.is-chat-view .premium-app {
  padding-top: 10px;
}
/* PC keeps the bottom return button visible in chat view */
@media (min-width: 761px) {
  body.is-chat-view .premium-footer { display: block; }
}

/* Reply option section: single conversation section, no operations column */
.reply-option-section { width: 100%; }
.reply-option-section-actions { display: none; }

/* Mobile: only the conversation reply buttons scroll horizontally */
@media (max-width: 760px) {
  body.is-chat-view .alice-chat-screen .choice-grid {
    display: block;
    max-height: none;
    overflow: visible;
    padding: 6px 0 2px;
  }
  body.is-chat-view .alice-chat-screen .reply-option-heading {
    margin: 0 2px 4px;
    font-size: 11px;
  }
  body.is-chat-view .alice-chat-screen .reply-option-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }
  body.is-chat-view .alice-chat-screen .reply-option-list .conversation-choice,
  body.is-chat-view .alice-chat-screen .reply-option-list button {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 240px;
    width: auto;
    min-height: 48px;
    scroll-snap-align: start;
    white-space: normal;
  }
  body.is-chat-view .alice-chat-screen .conversation-choice .choice-ja { display: block; margin: 0; }
  body.is-chat-view .alice-chat-screen .conversation-choice .choice-english { display: none; }
}

/* Hide internal developer notes from normal user screens. Add ?debug=1 to the URL
   or set localStorage.oretanPremiumDebug = "true" when debugging. */
.dev-note,
.conversation-dev-note,
.conversation-node-debug,
#selectedQuestionInfo,
#conversationHistoryPreview,
#sceneSubhead {
  display: none;
}

html.is-debug-mode .dev-note,
html.is-debug-mode .conversation-dev-note,
html.is-debug-mode .conversation-node-debug,
html.is-debug-mode #selectedQuestionInfo,
html.is-debug-mode #conversationHistoryPreview,
html.is-debug-mode #sceneSubhead,
html.is-debug-mode body.is-chat-view .conversation-dev-note {
  display: block;
}

/* Intro tab: richer premium overview */
.intro-panel {
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 10%, rgba(139, 211, 255, .16), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(240, 212, 154, .12), transparent 32%),
    var(--panel);
}
.intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr);
  gap: 18px;
  align-items: stretch;
}
.intro-copy { display: grid; gap: 16px; }
.intro-heading p { max-width: 760px; }
.intro-step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.intro-step-card,
.intro-feature-card,
.intro-video-card {
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 16px 42px rgba(0,0,0,.22);
}
.intro-step-card {
  min-height: 178px;
  padding: 15px;
  border-radius: 22px;
}
.intro-step-label {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #15182a;
  background: linear-gradient(135deg, #fff0b5, #8bd3ff);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}
.intro-step-card h3,
.intro-feature-card h3,
.intro-video-card h3 { margin: 0; color: #fff; line-height: 1.35; }
.intro-step-card p,
.intro-video-card p { margin: 8px 0 0; color: var(--muted); }
.intro-feature-card {
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(158, 220, 255, .12), rgba(240, 212, 154, .08));
}
.intro-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.intro-feature-list li {
  position: relative;
  padding: 10px 12px 10px 34px;
  border-radius: 16px;
  color: #fff;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}
.intro-feature-list li::before {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 10px;
  color: var(--gold);
  font-weight: 900;
}
.intro-video-card {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  min-height: 100%;
  border-radius: 26px;
  overflow: hidden;
}
.intro-video-thumb {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  background:
    linear-gradient(135deg, rgba(5, 7, 19, .15), rgba(5, 7, 19, .62)),
    radial-gradient(circle at 50% 35%, rgba(255, 183, 220, .42), transparent 28%),
    linear-gradient(145deg, #18204a, #0d75a6 48%, #f0d49a);
}
.intro-video-glow {
  width: min(72%, 260px);
  aspect-ratio: 1;
  border-radius: 36px;
  background:
    radial-gradient(circle at 42% 30%, rgba(255,255,255,.92), transparent 7%),
    linear-gradient(135deg, rgba(255, 240, 181, .86), rgba(255, 183, 220, .82) 52%, rgba(139, 211, 255, .86));
  filter: blur(.1px);
  opacity: .84;
  transform: rotate(-6deg);
}
.intro-video-play {
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 36px rgba(0,0,0,.35);
}
.intro-video-play::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 23px;
  border-left: 22px solid #15182a;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
}
.intro-video-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff8d6;
  background: rgba(3, 4, 10, .48);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 12px;
  font-weight: 900;
}
.intro-video-text { padding: 17px; background: rgba(8, 12, 31, .82); }
@media (max-width: 900px) {
  .intro-layout { grid-template-columns: 1fr; }
  .intro-step-grid { grid-template-columns: 1fr; }
  .intro-video-card { grid-template-rows: auto auto; }
}
@media (max-width: 720px) {
  .intro-feature-list { grid-template-columns: 1fr; }
  .intro-video-thumb { min-height: 230px; }
  .intro-video-play { width: 64px; height: 64px; }
  .intro-video-play::after { left: 26px; top: 19px; border-left-width: 19px; border-top-width: 13px; border-bottom-width: 13px; }
}

.daily-call-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  max-width: 760px;
  margin: 0 auto 16px;
  padding: 15px;
  border: 1px solid rgba(255, 211, 238, .30);
  border-radius: 24px;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 211, 238, .22), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(139, 211, 255, .07));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255,255,255,.12);
}
.daily-call-avatar-wrap { display: flex; justify-content: center; }
.daily-call-avatar {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
}
.daily-call-body { min-width: 0; }
.daily-call-message {
  position: relative;
  margin: 0;
  padding: 13px 15px;
  border-radius: 18px 18px 18px 6px;
  color: #2a1730;
  background: linear-gradient(135deg, #fff8fb, #ffe0f1);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.6;
}
.daily-call-replies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.daily-call-reply-btn {
  min-height: 66px;
  padding: 11px 12px;
  border-radius: 17px;
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text);
  background: rgba(255,255,255,.08);
  cursor: pointer;
  text-align: left;
  transition: transform .16s, filter .16s, border-color .16s, background .16s;
}
.daily-call-reply-btn:hover,
.daily-call-reply-btn:focus-visible {
  filter: brightness(1.08);
  border-color: rgba(255, 211, 238, .56);
  background: rgba(255,255,255,.12);
}
.daily-call-reply-btn:active { transform: scale(.98); }
.daily-call-reply-btn span,
.daily-call-selected span { display: block; font-weight: 900; color: #fff; }
.daily-call-reply-btn small,
.daily-call-selected small { display: block; margin-top: 2px; color: var(--muted); font-weight: 800; }
.daily-call-selected {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(135deg, rgba(158, 220, 255, .25), rgba(240, 212, 154, .16));
  border: 1px solid rgba(158, 220, 255, .30);
}
.daily-call-reaction {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 6px;
  color: #fff8d6;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(240, 212, 154, .24);
  font-weight: 800;
}
.daily-call-actions { margin-top: 12px; }
.daily-call-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.setting-label {
  display: block;
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}
.daily-call-static-setting {
  padding: 12px 13px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.daily-call-static-setting strong { color: #fff; }
.daily-call-dev-note .compact-btn { width: auto; min-height: 38px; margin-top: 8px; padding: 8px 12px; }
.daily-call-test-actions {
  margin-top: 14px;
  padding: 13px;
  border: 1px dashed rgba(255, 211, 238, .32);
  border-radius: 18px;
  background: rgba(255,255,255,.05);
}
.daily-call-test-actions .ghost-btn { width: auto; }
.daily-call-test-actions .setting-hint { margin: 8px 0 0; }
@media (max-width: 720px) {
  .daily-call-card { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 12px; border-radius: 20px; }
  .daily-call-avatar { width: 46px; height: 46px; border-radius: 16px; }
  .daily-call-message { font-size: 16px; padding: 12px 13px; }
  .daily-call-replies, .daily-call-settings-grid { grid-template-columns: 1fr; }
  .daily-call-reply-btn { min-height: 62px; }
}
.web-notification-settings {
  border-color: rgba(255, 211, 238, .30);
  background: linear-gradient(135deg, rgba(255, 159, 216, .10), rgba(158, 220, 255, .07));
}
.notification-actions { margin-top: 12px; }
.notification-support-note {
  min-height: 1.5em;
  margin: 10px 0 0;
  color: #fff8d6;
  font-size: 13px;
}
.notification-status-card strong { color: #fff8d6; }

.notification-landing-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 1000;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border: 1px solid rgba(255, 211, 238, .42);
  border-radius: 999px;
  color: #2a1730;
  background: linear-gradient(135deg, #fff8fb, #ffe0f1);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .30);
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.notification-landing-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.alice-today-letter-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 211, 238, .34);
  background: linear-gradient(135deg, rgba(255, 159, 216, .13), rgba(158, 220, 255, .10));
}
.alice-today-letter-card.is-ready,
.alice-today-letter-card.is-complete {
  border-color: rgba(240, 212, 154, .5);
  background: linear-gradient(135deg, rgba(255, 240, 181, .18), rgba(255, 159, 216, .13), rgba(158, 220, 255, .12));
  box-shadow: 0 12px 34px rgba(240, 212, 154, .12);
}
.alice-today-letter-card.is-waiting {
  opacity: .86;
}
.alice-today-letter-card h3 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 16px;
}
.alice-today-letter-summary {
  display: grid;
  gap: 3px;
  color: var(--text);
}
.alice-today-letter-summary p {
  margin: 0;
  overflow-wrap: anywhere;
}
.alice-letter-line {
  margin: 10px 0 0;
  color: #fff8d6;
  font-weight: 800;
}
.x-share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.x-share-action {
  display: grid;
  align-content: start;
  gap: 6px;
}
.x-share-action .primary-btn,
.x-share-action .ghost-btn {
  width: 100%;
}
.x-share-action .primary-btn:disabled,
.x-share-action .ghost-btn:disabled {
  cursor: not-allowed;
  opacity: .55;
  filter: grayscale(.35);
  transform: none;
}
.x-share-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .alice-today-letter-card {
    padding: 13px;
  }
  .x-share-actions {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.instant-start-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 211, 238, .42);
  background: radial-gradient(circle at 10% 0%, rgba(255, 159, 216, .26), transparent 40%), linear-gradient(135deg, rgba(255,255,255,.10), rgba(139,211,255,.08));
  box-shadow: 0 18px 50px rgba(255, 159, 216, .12), inset 0 1px 0 rgba(255,255,255,.12);
}
.instant-start-copy h3 { margin: 0; font-size: 22px; color: #fff; }
.instant-start-copy p:last-child { margin: 8px 0 0; color: var(--muted); }
.instant-start-button {
  display: grid;
  place-items: center;
  min-width: 132px;
  min-height: 132px;
  border: 0;
  border-radius: 32px;
  color: #1a1122;
  font-weight: 900;
  cursor: pointer;
  background: conic-gradient(from 210deg, #fff1b7, #ff9fd8, #8bd3ff, #fff1b7);
  box-shadow: 0 0 0 6px rgba(255,255,255,.08), 0 20px 46px rgba(139,211,255,.18);
  transition: transform .16s, filter .16s;
}
.instant-start-button:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.06); }
.instant-start-count { font-size: 30px; line-height: 1; }
.ux-rail-card {
  margin: 12px 0;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 211, 238, .30);
  background: linear-gradient(135deg, rgba(255, 159, 216, .13), rgba(158, 220, 255, .10));
}
.ux-rail-head { display:flex; justify-content:space-between; gap:10px; color: var(--gold); font-weight:900; }
.ux-rail-meter { height: 12px; margin: 10px 0; overflow:hidden; border-radius:999px; background: rgba(255,255,255,.10); }
.ux-rail-fill { display:block; height:100%; width: var(--ux-progress, 0%); border-radius:inherit; background: linear-gradient(90deg, #ff9fd8, #fff1b7, #8bd3ff); box-shadow: 0 0 18px rgba(255, 159, 216, .35); }
.ux-rail-steps { display:grid; grid-template-columns: repeat(3, 1fr); gap:8px; margin: 0; padding: 0; list-style:none; }
.ux-rail-steps li { padding: 8px 9px; border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.06); font-size: 12px; font-weight: 800; }
.ux-rail-steps li.is-done { color:#152018; background: linear-gradient(135deg, #d8ffe7, #8fe8b3); }
@media (max-width: 720px) {
  .instant-start-card { grid-template-columns: 1fr; }
  .instant-start-button { width: 100%; min-height: 96px; border-radius: 24px; }
  .ux-rail-steps { grid-template-columns: 1fr; }
}

/* v0.8.9: mobile recovery for locked initial record screen / inactive global navigation. */
@media (max-width: 720px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body {
    min-height: 100dvh;
  }

  .premium-app {
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .premium-hero,
  .premium-notice,
  .premium-footer {
    display: none;
  }

  .premium-progress {
    display: grid;
    position: sticky;
    top: 0;
    z-index: 40;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    margin: 0 0 8px;
    padding: calc(6px + env(safe-area-inset-top)) 6px 6px;
    border-radius: 0 0 18px 18px;
    background: rgba(20, 13, 34, .92);
    backdrop-filter: blur(14px);
  }

  .premium-tab {
    min-height: 40px;
    padding: 6px 3px;
    font-size: 11px;
    line-height: 1.2;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .chat-tab {
    gap: 2px;
  }

  .chat-tab-icon {
    width: 14px;
    height: 14px;
  }

  .premium-screen {
    min-height: calc(100dvh - 64px);
    height: auto;
    overflow: visible;
  }

  #todayScreen,
  #todayScreen.is-active {
    height: auto;
    min-height: calc(100dvh - 64px);
    overflow-y: visible;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  #todayScreen .today-mini-screen,
  .status-summary-card {
    overflow: visible;
  }

  body.is-chat-view,
  body.is-chat-view .premium-app {
    height: 100dvh;
    overflow: hidden;
  }

  body.is-chat-view .premium-progress,
  body.is-chat-view .premium-footer {
    display: none;
  }

  body.is-chat-view .alice-chat-screen.is-active {
    height: 100%;
    overflow: hidden;
  }
}
