/* TripTalk styles. Zen palette carried over from the original app. */

:root {
  --bg: #F5F3EF;
  --card: #FDFCFA;
  --ink: #2C2825;
  --muted: #8B8680;
  --line: #D4CFC4;
  --line-soft: #E8E4DC;
  --bamboo: #6B7F5F;
  --bamboo-deep: #5A6F50;
  --bamboo-soft: #E8EDE4;
  --clay: #C4A98A;
  --clay-soft: #F0E8DE;
  --clay-ink: #6B5344;
  --water: #89A4B8;
  --water-deep: #6B8A9E;
  --water-soft: #E4EDF2;
  --sakura: #D4A5A5;
  --sakura-deep: #C48B8B;
  --sakura-soft: #F5EAEA;
  --accent: #C45C3E;
  --shadow: 0 4px 20px rgba(44, 40, 37, 0.08);
  --shadow-soft: 0 2px 12px rgba(44, 40, 37, 0.06);
  --watermark: rgba(196, 179, 150, 0.3);
  --sakura-wm: rgba(212, 165, 165, 0.4);
  --motif-wm: rgba(176, 158, 128, 0.4);
  --orn: rgba(196, 120, 120, 0.55);
  --orn-neutral: rgba(150, 128, 92, 0.6);
  --font-ui: -apple-system, 'Hiragino Sans', 'Noto Sans JP', system-ui, sans-serif;
  --font-display: 'Noto Serif JP', 'Hiragino Mincho ProN', Georgia, serif;
}

[data-theme="dark"] {
  --bg: #171512;
  --card: #211E1A;
  --ink: #EDE8E0;
  --muted: #9C948A;
  --line: #3A352F;
  --line-soft: #2C2824;
  --bamboo: #8BA07D;
  --bamboo-deep: #74896A;
  --bamboo-soft: rgba(107, 127, 95, 0.22);
  --clay: #C4A98A;
  --clay-soft: rgba(196, 169, 138, 0.14);
  --clay-ink: #D8BFA4;
  --water: #8FABC0;
  --water-deep: #7795A9;
  --water-soft: rgba(137, 164, 184, 0.14);
  --sakura: #C99A9A;
  --sakura-deep: #B98888;
  --sakura-soft: rgba(212, 165, 165, 0.14);
  --accent: #E0855F;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.35);
  --watermark: rgba(196, 179, 150, 0.08);
  --sakura-wm: rgba(212, 165, 165, 0.16);
  --motif-wm: rgba(196, 179, 150, 0.16);
  --orn: rgba(222, 160, 160, 0.5);
  --orn-neutral: rgba(206, 186, 150, 0.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  overscroll-behavior-y: contain;
  font-family: var(--font-ui);
  color: var(--ink);
  transition: background-color 0.25s ease, color 0.25s ease;
}

button {
  font-family: var(--font-ui);
  color: var(--ink);
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

/* Faint kanji watermarks behind everything, carried over from the original */

.bg-kanji {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-kanji span {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  user-select: none;
  color: var(--watermark);
  transition: color 0.25s ease;
}

.bg-kanji .motif {
  position: absolute;
  display: block;
  color: var(--sakura-wm);
  transition: color 0.25s ease;
}

.bg-kanji .motif.neutral { color: var(--motif-wm); }

.bg-kanji .motif svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--ink);
}

.brand-kanji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent);
  color: #FDFCFA;
  font-size: 18px;
}

.icon-btn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 17px;
  cursor: pointer;
  color: var(--muted);
}

.topbar-btns { display: flex; gap: 8px; }

/* Language picker sheet */

.lang-sheet {
  background: var(--card);
  border-radius: 24px;
  padding: 22px 16px 14px;
  max-width: 380px;
  width: 100%;
  max-height: 78vh;
  max-height: 78dvh;
  display: flex;
  flex-direction: column;
}

.lang-head { text-align: center; margin-bottom: 12px; }

.lang-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  margin: 4px 0 0;
}

.lang-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px; }

.lang-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 15px;
}

.lang-row.on { border-color: var(--bamboo); background: var(--bamboo-soft); }

.lang-flag { font-size: 24px; }

.lang-names { flex: 1; display: flex; flex-direction: column; gap: 1px; }

.lang-name { font-weight: 600; }

.lang-name small { font-weight: 500; color: var(--muted); font-size: 12px; }

.lang-native { color: var(--muted); font-size: 12.5px; }

.lang-check { color: var(--bamboo-deep); font-weight: 700; }

/* Word-style background watermarks (Latin-script languages) */

.bg-kanji .wm-word { font-style: italic; letter-spacing: 1px; white-space: nowrap; }

/* Screen */

.screen {
  padding: 8px 16px 110px;
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}

.screen-head { text-align: center; margin: 10px 0 24px; }

.screen-head .kicker {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 5px;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 8px;
}

.screen-head h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 2px;
  margin: 0 0 6px;
}

.screen-head .head-rule {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px auto 10px;
}

.screen-head .rule {
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--bamboo), var(--water));
  border-radius: 2px;
}

.screen-head .orn {
  display: block;
  width: 28px;
  height: 28px;
  color: var(--orn);
  transform: rotate(-14deg);
}

.screen-head .orn.flip { transform: scaleX(-1) rotate(-14deg); }
.screen-head .orn.neutral { color: var(--orn-neutral); }

.screen-head .orn.edge {
  position: absolute;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  opacity: 0.45;
}

.screen-head .orn.edge.left { left: 10px; transform: rotate(-24deg); }
.screen-head .orn.edge.right { right: 10px; transform: scaleX(-1) rotate(-24deg); }
.screen-head .orn svg { width: 100%; height: 100%; display: block; }

.screen-head p { color: var(--muted); font-size: 14px; margin: 0; }

/* Cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
}

.card-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 500;
  margin-bottom: 10px;
}

.progress-num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
}

.progress-num small { font-size: 18px; color: var(--muted); }

.bar {
  background: var(--line);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 10px;
}

.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--bamboo), var(--water));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Quick actions */

.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }

.quick-btn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 10px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.quick-btn .q-ico { font-size: 24px; margin-bottom: 6px; }
.quick-btn .q-name { font-weight: 700; font-size: 14px; }
.quick-btn .q-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Category rows */

.cat-list { display: flex; flex-direction: column; gap: 10px; }

.cat-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.cat-ico { font-size: 26px; }
.cat-body { flex: 1; min-width: 0; }
.cat-name { font-weight: 700; font-size: 15px; }
.cat-desc { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-mini-bar { margin-top: 8px; background: var(--line); border-radius: 3px; height: 4px; overflow: hidden; }
.cat-mini-bar > i { display: block; height: 100%; background: var(--bamboo); }
.cat-count { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* Phrase cards */

.phrase-list { display: flex; flex-direction: column; gap: 14px; }

.phrase-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.pc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

.mastery-chip {
  background: var(--bamboo);
  color: #FDFCFA;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}

.ghost-btns { display: flex; gap: 6px; }

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  color: var(--muted);
}

.ghost-btn.faved { color: var(--accent); border-color: var(--accent); }

.pc-center { text-align: center; margin-bottom: 14px; }

.pc-native {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 3px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.pc-roman { font-size: 15px; color: var(--muted); font-style: italic; margin-bottom: 6px; }

.pc-phon {
  font-size: 12px;
  color: var(--bamboo);
  background: var(--bamboo-soft);
  padding: 5px 12px;
  border-radius: 20px;
  display: inline-block;
  font-family: ui-monospace, Menlo, monospace;
}

.pc-eng {
  text-align: center;
  padding: 12px 10px;
  border-top: 2px solid var(--line-soft);
  border-bottom: 2px solid var(--line-soft);
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--accent);
}

.pc-tip {
  background: var(--clay-soft);
  border-left: 4px solid var(--clay);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--clay-ink);
  line-height: 1.5;
  margin-bottom: 12px;
}

.pc-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.pc-act {
  border: none;
  border-radius: 10px;
  padding: 11px 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pc-act.listen { background: var(--bamboo-soft); color: var(--bamboo-deep); }
.pc-act.slow { background: var(--water-soft); color: var(--water-deep); }
.pc-act.say { background: var(--sakura-soft); color: var(--sakura-deep); }
[data-theme="dark"] .pc-act.listen { color: var(--bamboo); }
[data-theme="dark"] .pc-act.slow { color: var(--water); }
[data-theme="dark"] .pc-act.say { color: var(--sakura); }

/* Back link and section heads */

.crumb {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 16px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.sect-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sect-head .s-ico { font-size: 34px; }
.sect-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 500; margin: 0; }
.sect-head p { color: var(--muted); font-size: 12px; margin: 2px 0 0; }

/* Search */

.search-box {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--ink);
  font-family: var(--font-ui);
  outline: none;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}

.search-box::placeholder { color: var(--muted); }
.empty-note { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 10px; }

/* Practice */

.quiz-type-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  color: #FDFCFA;
  text-align: left;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
}

.quiz-type-btn.fc { background: linear-gradient(135deg, var(--bamboo), var(--bamboo-deep)); }
.quiz-type-btn.mc { background: linear-gradient(135deg, var(--water), var(--water-deep)); }
.quiz-type-btn .t-name { font-weight: 700; font-size: 16px; margin-bottom: 3px; }
.quiz-type-btn .t-sub { font-size: 13px; opacity: 0.9; }

.prac-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 8px;
}

.prac-row .p-ico { font-size: 20px; }
.prac-row .p-name { flex: 1; font-size: 14px; font-weight: 500; }

.mini-btn {
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mini-btn.fc { background: var(--bamboo-soft); border: 2px solid var(--bamboo); color: var(--bamboo); }
.mini-btn.mc { background: var(--water-soft); border: 2px solid var(--water); color: var(--water-deep); }

.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

.quiz-count {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.quiz-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quiz-kicker {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 500;
  margin-bottom: 18px;
}

.quiz-eng { font-family: var(--font-display); font-weight: 600; font-size: 24px; color: var(--accent); }

.big-btn {
  background: linear-gradient(135deg, var(--bamboo), var(--bamboo-deep));
  border: none;
  border-radius: 12px;
  padding: 17px 34px;
  color: #FDFCFA;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.grade-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.grade-no {
  background: var(--card);
  border: 3px solid var(--clay);
  border-radius: 12px;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--clay-ink);
  cursor: pointer;
}

.grade-yes {
  background: linear-gradient(135deg, var(--bamboo), var(--bamboo-deep));
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  color: #FDFCFA;
  cursor: pointer;
}

.mc-option {
  width: 100%;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
}

.mc-option .mc-native { font-family: var(--font-display); font-size: 23px; letter-spacing: 2px; margin-bottom: 5px; }
.mc-option .mc-roman { font-size: 13px; color: var(--muted); font-style: italic; }
.mc-option.right { background: var(--bamboo-soft); border-color: var(--bamboo); }
.mc-option.wrong { background: var(--clay-soft); border-color: var(--clay); }

.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px 28px;
  text-align: center;
  box-shadow: var(--shadow);
}

.result-emoji { font-size: 52px; margin-bottom: 16px; }
.result-score { font-family: var(--font-display); font-size: 46px; color: var(--bamboo); margin: 8px 0; }

.soft-btn {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 12px;
  padding: 15px 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}

/* Allergy builder */

.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }

.chip {
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}

.chip.on { background: var(--sakura-soft); border-color: var(--sakura-deep); color: var(--sakura-deep); }
[data-theme="dark"] .chip.on { color: var(--sakura); }

/* Tab bar */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: flex;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 60;
}

.tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 7px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
}

.tab .tab-ico { font-size: 20px; }
.tab .tab-label { font-size: 11px; font-weight: 600; }
.tab.active { background: var(--bamboo-soft); color: var(--bamboo-deep); }
[data-theme="dark"] .tab.active { color: var(--bamboo); }

/* Overlays: speech modal and show card */

.overlay-back {
  position: fixed;
  inset: 0;
  background: rgba(24, 21, 18, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--card);
  border-radius: 24px;
  padding: 34px 26px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.mic-btn {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: none;
  font-size: 36px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--bamboo), var(--bamboo-deep));
  box-shadow: 0 6px 20px rgba(107, 127, 95, 0.4);
}

.mic-btn.listening {
  background: linear-gradient(135deg, var(--sakura), var(--sakura-deep));
  animation: listening 1.5s infinite;
}

@keyframes listening {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 165, 165, 0.7); }
  50% { box-shadow: 0 0 0 20px rgba(212, 165, 165, 0); }
}

.score-num { font-family: var(--font-display); font-size: 46px; font-weight: 700; }

.heard-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 14px 0;
}

/* Show card: always light so it is readable when shown to someone */

.showcard {
  position: fixed;
  inset: 0;
  background: #FDFCFA;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  cursor: pointer;
}

.showcard .sc-native {
  font-family: var(--font-display);
  color: #2C2825;
  line-height: 1.45;
  letter-spacing: 2px;
  margin-bottom: 26px;
}

.showcard .sc-eng { font-size: 16px; color: #8B8680; max-width: 420px; }

.showcard .sc-hint {
  position: absolute;
  bottom: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  font-size: 12px;
  color: #B5AFA6;
  letter-spacing: 1px;
}

.showcard .sc-flag {
  position: absolute;
  top: 26px;
  font-size: 13px;
  color: #8B8680;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* Convo tab: tap-to-talk live translation */

.convo-pair {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.convo-log { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }

.bubble {
  max-width: 88%;
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.bubble.me { align-self: flex-end; border-color: var(--bamboo); border-bottom-right-radius: 6px; }

.bubble.them { align-self: flex-start; border-color: var(--water); border-bottom-left-radius: 6px; }

.bubble .b-heard { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.bubble .b-text {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.5;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  display: block;
  width: 100%;
}

.bubble.live .b-text { color: var(--muted); font-style: italic; }

.bubble .b-row { display: flex; gap: 8px; margin-top: 9px; }

.b-play {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 12px;
  padding: 5px 10px;
  color: var(--muted);
  cursor: pointer;
}

.convo-error { text-align: center; color: var(--accent); font-size: 13.5px; margin: 8px 0; }

.convo-type { display: flex; gap: 7px; margin-bottom: 10px; }

.convo-input {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 15px;
  font-family: var(--font-ui);
  color: var(--ink);
}

.convo-input:focus { outline: none; border-color: var(--bamboo); }

.type-send {
  border: none;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #FDFCFA;
  cursor: pointer;
  white-space: nowrap;
}

.type-send.me { background: var(--bamboo); }

.type-send.them { background: var(--water-deep); }

.type-send:disabled, .convo-input:disabled { opacity: 0.55; }

.convo-talk {
  position: fixed;
  bottom: calc(86px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 488px;
  display: flex;
  gap: 10px;
  z-index: 50;
}

.talk-btn {
  flex: 1;
  border: none;
  border-radius: 18px;
  padding: 13px 10px;
  font-size: 15.5px;
  font-weight: 700;
  color: #FDFCFA;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.talk-btn small { font-size: 11px; font-weight: 500; opacity: 0.85; }

.talk-btn.me { background: linear-gradient(135deg, var(--bamboo), var(--bamboo-deep)); }

.talk-btn.them { background: linear-gradient(135deg, var(--water), var(--water-deep)); }

.talk-btn.listening {
  background: linear-gradient(135deg, var(--sakura), var(--sakura-deep));
  animation: listening 1.5s infinite;
}

.talk-btn:disabled { opacity: 0.55; }

@media (max-width: 380px) {
  .pc-native { font-size: 26px; }
  .screen-head h1 { font-size: 24px; }
}
