:root {
  --bg: #f5f2ff;
  --surface: #ffffff;
  --ink: #1a1838;
  --muted: #716d8c;
  --line: #ddd8ef;
  --violet: #7457ff;
  --coral: #ff665c;
  --green: #21b477;
  --shadow: 0 18px 55px rgba(44, 34, 94, 0.12);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.home {
  width: min(100%, 920px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));
}

.home-head, .talk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.brand span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--violet);
  color: white;
  font-family: Georgia, serif;
  font-size: 21px;
}
.free-mark {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.free-mark i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(33, 180, 119, 0.12); }

.welcome {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  align-items: end;
  gap: 34px;
  padding: 76px 0 52px;
}
.welcome h1 {
  max-width: 650px;
  margin: 0 0 18px;
  font-size: clamp(43px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}
.welcome > div > p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.profile-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border-radius: 26px;
  padding: 24px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
}
.profile-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -52px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--coral);
  opacity: 0.78;
}
.profile-card span { display: block; margin-bottom: 20px; color: #c8c1ff; font-size: 12px; font-weight: 750; }
.profile-card strong { display: block; font-size: 23px; }
.profile-card p { position: relative; z-index: 1; max-width: 210px; margin: 8px 0 0; color: #d9d5ed; font-size: 13px; line-height: 1.45; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-title h2 { margin: 0; font-size: 23px; letter-spacing: -0.025em; }
.section-title button {
  border: 0;
  background: transparent;
  color: var(--violet);
  font-size: 13px;
  font-weight: 750;
}
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.scenario-card {
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--surface);
  text-align: left;
  box-shadow: 0 8px 28px rgba(44, 34, 94, 0.045);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.scenario-card:active { transform: scale(0.985); }
.scenario-card:hover { border-color: var(--scenario); }
.scenario-number {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--scenario) 13%, white);
  color: var(--scenario);
  font-size: 13px;
  font-weight: 850;
}
.scenario-card strong { display: block; margin-bottom: 5px; font-size: 16px; letter-spacing: -0.015em; }
.scenario-card small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.scenario-card > svg { width: 18px; color: var(--scenario); }
.privacy-note { margin: 22px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

.conversation {
  --scenario: var(--violet);
  width: min(100%, 820px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
}
.talk-head {
  min-height: 72px;
  padding: calc(8px + env(safe-area-inset-top)) 20px 0;
}
.talk-head > div { display: grid; justify-items: center; gap: 2px; }
.talk-head strong { max-width: 240px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.talk-head span { color: var(--muted); font-size: 11px; }
.round-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
}
.round-button:first-child svg { transform: rotate(180deg); }
.text-button { color: var(--scenario); font-size: 13px; font-weight: 800; }

.stage {
  display: flex;
  min-height: calc(100dvh - 72px);
  flex-direction: column;
  align-items: center;
  padding: 20px 22px 180px;
  text-align: center;
}
.portrait-wrap {
  position: relative;
  width: min(48vw, 220px);
  aspect-ratio: 1;
  margin-top: 4px;
}
.portrait-halo {
  position: absolute;
  inset: -7%;
  border-radius: 50%;
  background: color-mix(in srgb, var(--scenario) 15%, white);
  border: 1px solid color-mix(in srgb, var(--scenario) 25%, white);
}
.portrait-wrap img { position: relative; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.status-dot {
  position: absolute;
  right: 5%;
  bottom: 7%;
  width: 21px;
  height: 21px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--green);
}
.person h1 { margin: 22px 0 3px; font-size: 31px; letter-spacing: -0.04em; }
.person p { margin: 0; color: var(--muted); font-size: 14px; }
.voice-state { display: flex; align-items: center; gap: 11px; margin: 22px 0 14px; color: var(--scenario); font-size: 13px; font-weight: 800; }
.wave { display: flex; height: 24px; align-items: center; gap: 3px; }
.wave i {
  width: 3px;
  height: 8px;
  border-radius: 5px;
  background: currentColor;
  animation: wave 0.9s ease-in-out infinite;
  animation-delay: var(--delay);
}
.wave.still i { height: 4px; animation: none; opacity: 0.5; }
@keyframes wave { 0%, 100% { height: 5px; opacity: 0.45; } 50% { height: 22px; opacity: 1; } }

.speech-card {
  position: relative;
  width: min(100%, 620px);
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px 56px 20px 21px;
  background: white;
  box-shadow: 0 14px 45px rgba(44, 34, 94, 0.07);
  text-align: left;
}
.speech-card.user-speech { border-color: color-mix(in srgb, var(--scenario) 48%, white); background: color-mix(in srgb, var(--scenario) 5%, white); }
.speech-card p { margin: 0; font-size: 17px; line-height: 1.55; }
.speech-card button {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  border: 1px solid color-mix(in srgb, var(--scenario) 55%, white);
  border-radius: 50%;
  background: white;
  color: var(--scenario);
  font-size: 19px;
}
.round-progress { display: flex; width: min(100%, 620px); align-items: center; gap: 13px; margin-top: 15px; color: var(--muted); font-size: 11px; }
.round-progress > div { height: 4px; flex: 1; overflow: hidden; border-radius: 10px; background: #ddd9e9; }
.round-progress i { display: block; height: 100%; border-radius: inherit; background: var(--scenario); transition: width 0.25s ease; }

.talk-dock {
  position: fixed;
  z-index: 5;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, 820px);
  transform: translateX(-50%);
  grid-template-columns: 1fr 1.45fr 1fr;
  align-items: end;
  padding: 12px 22px calc(15px + env(safe-area-inset-bottom));
  background: rgba(245, 242, 255, 0.91);
  backdrop-filter: blur(16px);
}
.talk-dock button { border: 0; background: transparent; }
.dock-action { display: grid; justify-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.dock-action span {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--scenario);
  font-size: 18px;
}
.dock-action:disabled { opacity: 0.42; }
.mic-button { display: grid; justify-items: center; gap: 7px; }
.mic-button > span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  box-shadow: 0 12px 30px rgba(255, 102, 92, 0.34);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mic-button > span svg { width: 32px; height: 32px; }
.mic-button strong { font-size: 12px; }
.mic-button.active > span { transform: scale(1.06); box-shadow: 0 0 0 11px rgba(255, 102, 92, 0.13), 0 12px 30px rgba(255, 102, 92, 0.34); }

.backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: rgba(20, 16, 49, 0.32);
  backdrop-filter: blur(2px);
}
.bottom-sheet {
  position: fixed;
  z-index: 21;
  bottom: 0;
  left: 50%;
  width: min(100%, 820px);
  max-height: 76dvh;
  overflow: auto;
  transform: translateX(-50%);
  border-radius: 28px 28px 0 0;
  padding: 25px 22px calc(26px + env(safe-area-inset-bottom));
  background: white;
  box-shadow: 0 -25px 70px rgba(23, 17, 70, 0.18);
  animation: sheetUp 0.24s ease-out;
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.sheet-head span { color: var(--violet); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.sheet-head h2 { margin: 4px 0 0; font-size: 26px; letter-spacing: -0.035em; }
.sheet-head button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: white; }
.coach-block { border-radius: 17px; padding: 16px; }
.coach-block + .coach-block { margin-top: 10px; }
.coach-block.original { background: #f4f2f8; }
.coach-block.improved { border: 1px solid #a7e6be; background: #effbf3; }
.coach-block small { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.coach-block p { margin: 7px 0 0; font-size: 16px; line-height: 1.48; }
.coach-note { margin: 16px 2px 0; color: var(--ink); font-size: 13px; line-height: 1.5; }
.accuracy-note { margin: 12px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.transcript-list { display: grid; gap: 10px; }
.turn { max-width: 88%; border-radius: 17px 17px 17px 5px; padding: 13px 15px; background: #f1eefb; }
.turn.you { justify-self: end; border-radius: 17px 17px 5px 17px; background: #effbf3; }
.turn small { color: var(--violet); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.turn p { margin: 5px 0 0; font-size: 14px; line-height: 1.45; }
.term-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.term-tabs::-webkit-scrollbar { display: none; }
.term-tabs button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: white; font-size: 12px; font-weight: 750; }
.term-tabs button.selected { border-color: var(--violet); background: var(--violet); color: white; }
.term-card { margin-top: 7px; border-radius: 20px; padding: 20px; background: var(--ink); color: white; }
.term-card small { color: #c9c1ff; font-size: 12px; font-weight: 800; }
.term-card h3 { margin: 8px 0 15px; font-size: 19px; line-height: 1.3; }
.term-card p { margin: 0; color: #dedbed; font-size: 14px; line-height: 1.5; }

@media (max-width: 680px) {
  .home { padding-inline: 18px; }
  .welcome { display: block; padding: 48px 0 36px; }
  .welcome h1 { font-size: clamp(40px, 12vw, 50px); line-height: 1.02; }
  .welcome > div > p { font-size: 15px; }
  .profile-card { min-height: 142px; margin-top: 27px; padding: 20px; }
  .profile-card span { margin-bottom: 14px; }
  .scenario-grid { grid-template-columns: 1fr; }
  .scenario-card { padding: 15px; }
  .stage { padding-top: 15px; }
  .portrait-wrap { width: min(48vw, 190px); }
  .person h1 { font-size: 28px; }
  .speech-card { min-height: 98px; }
}

@media (min-width: 700px) {
  .talk-dock { border: 1px solid var(--line); border-bottom: 0; border-radius: 25px 25px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
