:root {
  color-scheme: dark;
  --bg: #090512;
  --bg-soft: #120a1f;
  --panel: #1b102a;
  --panel-soft: #241633;
  --input: #12091d;
  --accent: #8b6cff;
  --pink: #e9a4c9;
  --text: #fff8ff;
  --text-soft: #cdbbea;
  --text-weak: #8e7da8;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --ease: 200ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 16%, rgba(123, 92, 255, 0.16), transparent 28%),
    radial-gradient(circle at 82% 84%, rgba(233, 164, 201, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  letter-spacing: 0;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.phone-shell {
  position: relative;
  width: min(420px, 100%);
  min-height: 860px;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(22, 13, 34, 0.98) 0%, rgba(11, 7, 18, 0.99) 100%);
  box-shadow: var(--shadow);
}

.phone-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 12px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.screen-scroll {
  min-height: calc(860px - 41px);
  padding: 24px 18px 26px;
}

.screen-scroll--with-tabbar {
  padding-bottom: 106px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero-title {
  margin: 12px 0 0;
  font-size: 32px;
  line-height: 1.08;
  font-weight: 700;
}

.hero-copy,
.panel-copy,
.footer-tip,
.field-help {
  color: var(--text-soft);
  line-height: 1.68;
}

.hero-copy {
  margin-top: 14px;
  font-size: 15px;
}

.panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(27, 16, 42, 0.92);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.panel--hero {
  background:
    linear-gradient(180deg, rgba(35, 21, 56, 0.96) 0%, rgba(26, 17, 41, 0.94) 100%);
}

.panel--nested {
  margin-top: 0;
  height: 100%;
}

.panel-kicker,
.panel-block__label,
.subsection-title,
.attachment-prompt__title {
  color: var(--text-soft);
  font-size: 13px;
}

.panel-title {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

.panel-title--soft {
  color: #e7dbf6;
}

.panel-headline,
.question-title {
  margin: 8px 0 0;
  font-size: 26px;
  line-height: 1.18;
  font-weight: 700;
}

.landing-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.landing-brand__side {
  max-width: 156px;
  padding-top: 2px;
  color: var(--text-weak);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.landing-actions {
  margin-top: 18px;
}

.note-card--landing {
  margin-top: 14px;
}

.landing-steps {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(27, 16, 42, 0.72);
}

.step-list {
  margin-top: 12px;
}

.step-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.step-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.step-item__index {
  min-width: 30px;
  color: var(--pink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.step-item__main {
  flex: 1;
}

.step-item__title {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 700;
}

.step-item__desc {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

.text-entry-link {
  width: 100%;
  margin-top: 14px;
  padding: 8px 0 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.method-grid,
.choice-grid,
.question-choice-grid,
.loading-steps,
.summary-grid,
.bullet-list,
.speech-grid,
.action-stack,
.phase-list,
.dual-grid,
.score-grid {
  display: grid;
  gap: 12px;
}

.bullet-list,
.speech-grid,
.phase-list,
.action-stack,
.loading-steps,
.score-grid {
  margin-top: 14px;
}

.method-card,
.summary-item,
.speech-card,
.phase-card,
.quote-card,
.upload-box,
.result-box,
.score-card,
.bullet-item {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(36, 22, 51, 0.78);
}

.method-card,
.summary-item,
.speech-card,
.phase-card,
.quote-card,
.upload-box,
.result-box,
.score-card {
  padding: 16px;
}

.summary-grid {
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-item span {
  display: block;
  color: var(--text-weak);
  font-size: 12px;
}

.summary-item strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.summary-item--wide {
  grid-column: 1 / -1;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}

.mini-chip--accent {
  background: rgba(139, 108, 255, 0.16);
  border-color: rgba(139, 108, 255, 0.24);
  color: var(--text);
}

.button {
  width: 100%;
  margin-top: 14px;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--ease), border-color var(--ease), background var(--ease), opacity var(--ease);
}

.button:active,
.choice-chip:active,
.method-card:active,
.score-card:active,
.tabbar-btn:active {
  transform: scale(0.98);
}

.button--primary {
  background: linear-gradient(90deg, #7b5cff 0%, #e79ac4 100%);
  box-shadow: 0 12px 32px rgba(123, 92, 255, 0.24);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
  color: var(--text-soft);
}

.button--compact {
  width: auto;
  min-height: 42px;
  padding-inline: 16px;
}

.back-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  cursor: pointer;
}

.field {
  display: block;
  margin-top: 14px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
}

.field-input,
.field-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(18, 9, 29, 0.92);
  color: var(--text);
  padding: 14px 15px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.field-input:focus,
.field-textarea:focus {
  border-color: rgba(139, 108, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.12);
}

.field-textarea {
  min-height: 120px;
  resize: vertical;
}

.field-textarea--chat {
  min-height: 220px;
}

.field-textarea--small {
  min-height: 96px;
}

.choice-grid,
.question-choice-grid,
.dual-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-chip,
.method-card,
.score-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform var(--ease), border-color var(--ease), background var(--ease);
}

.choice-chip {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.choice-chip.is-active,
.method-card--active,
.score-card--active {
  background: linear-gradient(90deg, rgba(123, 92, 255, 0.24) 0%, rgba(231, 154, 196, 0.15) 100%);
  border-color: rgba(139, 108, 255, 0.28);
}

.method-card strong {
  display: block;
  font-size: 15px;
}

.method-card span {
  display: block;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.note-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  line-height: 1.65;
}

.upload-title,
.speech-card__title,
.phase-card__title {
  font-size: 14px;
  font-weight: 700;
}

.quote-card,
.result-box {
  line-height: 1.7;
  color: var(--text);
}

.bullet-item {
  padding: 14px 16px;
  line-height: 1.6;
  color: var(--text);
}

.stack-list,
.plain-list,
.timeline-list,
.chat-transcript {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.plain-list__item {
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.7;
  color: var(--text);
}

.plain-list__item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0;
}

.action-card--surface {
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(36, 22, 51, 0.78);
}

.action-main {
  flex: 1;
}

.action-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.action-desc,
.panel-copy--tight {
  margin-top: 6px;
  color: var(--text-soft);
  line-height: 1.65;
}

.action-arrow,
.list-subtitle {
  color: var(--text-weak);
  font-size: 13px;
}

.timeline-item {
  position: relative;
  padding-left: 20px;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7b5cff 0%, #e79ac4 100%);
}

.timeline-line {
  position: absolute;
  left: 3px;
  top: 18px;
  bottom: -10px;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.timeline-item:last-child .timeline-line {
  display: none;
}

.timeline-main {
  min-width: 0;
}

.evidence-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-weak);
  font-size: 12px;
}

.evidence-content {
  margin-top: 6px;
  line-height: 1.7;
}

.chat-row {
  display: flex;
}

.chat-row--me {
  justify-content: flex-end;
}

.chat-row--ta {
  justify-content: flex-start;
}

.chat-row--system {
  justify-content: center;
}

.chat-system {
  color: var(--text-weak);
  font-size: 12px;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.65;
}

.chat-bubble--ta {
  background: rgba(49, 38, 68, 0.96);
}

.chat-bubble--me {
  background: linear-gradient(90deg, rgba(123, 92, 255, 0.92) 0%, rgba(231, 154, 196, 0.72) 100%);
}

.attachment-prompt {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.progress-track {
  width: 100%;
  height: 10px;
  margin-top: 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-track--soft {
  background: rgba(255, 255, 255, 0.04);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7b5cff 0%, #e79ac4 100%);
  transition: width 320ms ease;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-weak);
  transform: translateY(8px);
  opacity: 0.7;
  transition: transform var(--ease), opacity var(--ease), border-color var(--ease), background var(--ease);
}

.loading-step__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.loading-step.is-active,
.loading-step.is-done {
  transform: translateY(0);
  opacity: 1;
}

.loading-step.is-active {
  border-color: rgba(139, 108, 255, 0.24);
  background: rgba(139, 108, 255, 0.12);
  color: var(--text);
}

.loading-step.is-active .loading-step__dot,
.loading-step.is-done .loading-step__dot {
  background: linear-gradient(90deg, #7b5cff 0%, #e79ac4 100%);
}

.loading-step.is-done {
  color: var(--text-soft);
}

.score-grid--test {
  grid-template-columns: 1fr;
}

.score-card {
  min-height: 56px;
  text-align: left;
  cursor: pointer;
}

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(12, 8, 20, 0.96);
  backdrop-filter: blur(18px);
}

.tabbar-btn {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-weak);
  cursor: pointer;
  transition: transform var(--ease), background var(--ease), color var(--ease);
}

.tabbar-btn--active {
  background: rgba(139, 108, 255, 0.18);
  color: var(--text);
}

.empty-text {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--text-soft);
  line-height: 1.7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(14px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(23, 16, 34, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease);
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.is-hidden {
  display: none;
}

.reveal {
  animation: rise-in 200ms ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .stage {
    padding: 0;
  }

  .phone-shell {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
  }

  .screen-scroll {
    min-height: calc(100vh - 41px);
  }

  .hero-title {
    font-size: 30px;
  }

  .choice-grid,
  .question-choice-grid,
  .dual-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}
