:root {
  --paper: #f4efe6;
  --paper-strong: #e9e0d1;
  --paper-line: rgba(120, 90, 46, 0.12);
  --header: #162031;
  --header-soft: #243148;
  --surface: rgba(255, 253, 249, 0.94);
  --surface-strong: #fffaf2;
  --surface-muted: #f7f1e8;
  --surface-tint: rgba(255, 255, 255, 0.74);
  --ink: #172033;
  --ink-soft: #566075;
  --ink-muted: #768094;
  --line: rgba(23, 32, 51, 0.12);
  --line-strong: rgba(23, 32, 51, 0.2);
  --brand: #e86a2b;
  --brand-strong: #c94f13;
  --brand-soft: #fff0e6;
  --brand-ink: #7a3113;
  --accent: #2f83d8;
  --accent-soft: #ebf5ff;
  --good: #187a49;
  --good-soft: rgba(24, 122, 73, 0.14);
  --fair: #b27a05;
  --fair-soft: rgba(178, 122, 5, 0.14);
  --bad: #d34444;
  --bad-soft: rgba(211, 68, 68, 0.14);
  --radius-2xl: 32px;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-xs: 0 8px 18px rgba(23, 32, 51, 0.05);
  --shadow-sm: 0 14px 26px rgba(23, 32, 51, 0.07);
  --shadow-md: 0 22px 44px rgba(23, 32, 51, 0.1);
  --shadow-lg: 0 34px 72px rgba(23, 32, 51, 0.14);
  --shadow-float: 0 26px 46px rgba(23, 32, 51, 0.12);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-emphasis: cubic-bezier(0.16, 1, 0.3, 1);
  --step-transition: 460ms var(--ease-emphasis);
  --surface-transition: 280ms var(--ease-smooth);
  --surface-transition-slow: 420ms var(--ease-emphasis);
  --button-gap: 14px;
  --button-gap-wide: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(232, 106, 43, 0.09), transparent 24rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 14rem),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 37px,
      rgba(120, 90, 46, 0.035) 37px,
      rgba(120, 90, 46, 0.035) 38px
    ),
    linear-gradient(180deg, #faf6ef 0%, var(--paper) 100%);
  color: var(--ink);
  font-family:
    "Avenir Next",
    "Segoe UI",
    "Helvetica Neue",
    sans-serif;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color-scheme: light;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
.brand-name,
.metric-value,
.price-field input,
.verdict-price-panel strong {
  font-family:
    "ui-rounded",
    "SF Pro Rounded",
    "Avenir Next",
    sans-serif;
}

h1,
h2 {
  color: var(--ink);
  letter-spacing: -0.05em;
  line-height: 1.04;
}

h1 {
  font-size: clamp(2.55rem, 6vw, 4.8rem);
}

h2 {
  font-size: clamp(2rem, 4.8vw, 3.3rem);
}

button,
input,
select {
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

img {
  display: block;
  max-width: 100%;
}

.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;
}

.hidden,
.is-hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.app-shell::before {
  background:
    radial-gradient(circle at 14% 18%, rgba(47, 131, 216, 0.08), transparent 18rem),
    radial-gradient(circle at 83% 10%, rgba(232, 106, 43, 0.09), transparent 20rem);
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center;
  animation: ambient-drift 20s ease-in-out infinite alternate;
}

.app-shell::after {
  background:
    linear-gradient(180deg, rgba(22, 32, 49, 0.06), transparent 8rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.38), transparent 12rem);
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center;
  animation: ambient-drift-reverse 26s ease-in-out infinite alternate;
}

.app-header,
.steps {
  position: relative;
  z-index: 1;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding:
    calc(12px + env(safe-area-inset-top))
    max(16px, env(safe-area-inset-left))
    12px
    max(16px, env(safe-area-inset-right));
  background:
    linear-gradient(180deg, rgba(22, 32, 49, 0.98), rgba(22, 32, 49, 0.92));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 32px rgba(22, 32, 49, 0.18);
  backdrop-filter: blur(14px);
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 12px;
}

.back-button,
.account-button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.94rem;
  font-weight: 700;
  transition:
    transform var(--surface-transition),
    background var(--surface-transition),
    border-color var(--surface-transition),
    box-shadow var(--surface-transition);
}

.back-button:hover,
.account-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.back-button:active,
.account-button:active {
  transform: scale(0.97);
}

.back-button.hidden {
  visibility: hidden;
  pointer-events: none;
  display: inline-flex !important;
}

.brand-pill {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: center;
  justify-content: center;
}

.brand-mark {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background:
    linear-gradient(135deg, #ffaf6d 0%, var(--brand) 55%, var(--brand-strong) 100%);
  box-shadow:
    0 0 0 6px rgba(232, 106, 43, 0.12),
    0 10px 18px rgba(232, 106, 43, 0.3);
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-button {
  max-width: 11rem;
  justify-self: end;
}

.account-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steps {
  flex: 1;
  position: relative;
  min-height: 0;
}

.step {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 26px, 0) scale(0.992);
  transform-origin: center top;
  will-change: opacity, transform;
  transition:
    opacity var(--step-transition),
    transform var(--step-transition),
    visibility var(--step-transition);
}

.step.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.step-card {
  width: 100%;
  min-height: calc(100dvh - 72px - env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding:
    18px
    max(18px, env(safe-area-inset-left))
    calc(32px + env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-right));
}

.step-card-home {
  gap: 12px;
}

.step.active .scene-stage,
.step.active .metric-strip,
.step.active .scene-card,
.step.active .scene-grid,
.step.active .scene-actions,
.step.active .support-callout,
.step.active .loading-shell,
.step.active .verdict-metrics,
.step.active .history-card,
.step.active .guess-button,
.step.active .clarify-option {
  animation: rise-in 620ms var(--ease-emphasis) both;
}

.step.active .scene-stage {
  animation-delay: 35ms;
}

.step.active .metric-strip,
.step.active .support-callout,
.step.active .verdict-metrics {
  animation-delay: 70ms;
}

.step.active .scene-card,
.step.active .scene-grid,
.step.active .loading-shell {
  animation-delay: 120ms;
}

.step.active .scene-actions {
  animation-delay: 180ms;
}

.step.active .history-card:nth-child(1),
.step.active .guess-button:nth-child(1),
.step.active .clarify-option:nth-child(1) {
  animation-delay: 120ms;
}

.step.active .history-card:nth-child(2),
.step.active .guess-button:nth-child(2),
.step.active .clarify-option:nth-child(2) {
  animation-delay: 170ms;
}

.step.active .history-card:nth-child(3),
.step.active .guess-button:nth-child(3),
.step.active .clarify-option:nth-child(3) {
  animation-delay: 220ms;
}

.scene-stage,
.scene-card,
.scene-actions,
.metric-strip,
.support-callout,
.verdict-metrics {
  min-width: 0;
}

.scene-stage {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 0;
}

.scene-stage-home {
  align-items: stretch;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
}

.scene-stage-compact {
  grid-template-columns: minmax(0, 1fr);
}

.scene-stage-media {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  align-items: start;
}

.scene-stage-verdict {
  padding: 24px;
  border-radius: var(--radius-2xl);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(22, 32, 49, 0.9), rgba(22, 32, 49, 0.8));
  color: #fff;
  box-shadow: var(--shadow-lg);
  transition:
    transform var(--surface-transition-slow),
    box-shadow var(--surface-transition-slow),
    background var(--surface-transition-slow);
}

.scene-stage-verdict h2 {
  color: #fff;
}

.stage-copy,
.header-block,
.verdict-content {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.stage-copy {
  padding: 8px 0;
}

.header-block {
  max-width: 38rem;
}

.eyebrow {
  color: var(--brand-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scene-stage-verdict .eyebrow,
.verdict-tone {
  color: rgba(255, 255, 255, 0.8);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.hero-tag,
.selection-label,
.preview-badge,
.guess-badge,
.guess-basis,
.history-verdict,
.account-status-badge,
.product-pill,
.price-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-tag {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 32, 51, 0.08);
  color: var(--ink-soft);
  box-shadow: var(--shadow-xs);
}

.hero-art {
  position: relative;
  min-height: 16.5rem;
  padding: 18px;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(47, 131, 216, 0.18), rgba(255, 255, 255, 0.78) 40%, rgba(232, 106, 43, 0.18)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 252, 246, 0.7));
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow-md);
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 26px;
  border: 1px dashed rgba(23, 32, 51, 0.08);
}

.hero-art-card {
  position: absolute;
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 32px rgba(23, 32, 51, 0.14);
}

.hero-art-main {
  left: 18px;
  right: 56px;
  bottom: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.hero-art-main strong {
  font-size: clamp(2.1rem, 7vw, 3rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero-art-label {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-art-floating {
  top: 20px;
  right: 20px;
  background: rgba(255, 246, 235, 0.88);
  border: 1px solid rgba(201, 79, 19, 0.18);
  color: var(--brand-ink);
  font-size: 0.84rem;
  font-weight: 800;
  animation: float-card 5.4s ease-in-out infinite;
}

.hero-art-floating.good {
  background: rgba(247, 255, 250, 0.88);
  border-color: rgba(24, 122, 73, 0.18);
  color: var(--good);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0);
}

.hero-orb-one {
  width: 88px;
  height: 88px;
  top: 22px;
  left: 26px;
  background: rgba(47, 131, 216, 0.16);
}

.hero-orb-two {
  width: 112px;
  height: 112px;
  bottom: 62px;
  right: 38px;
  background: rgba(232, 106, 43, 0.14);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.8);
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow-xs);
  will-change: transform, box-shadow;
  transition:
    transform var(--surface-transition-slow),
    box-shadow var(--surface-transition-slow),
    border-color var(--surface-transition),
    background var(--surface-transition);
}

.metric-value {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-label {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.scene-card {
  position: relative;
  padding: 20px;
  border-radius: var(--radius-xl);
  isolation: isolate;
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--surface-strong) 100%);
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow-sm);
  will-change: transform, box-shadow;
  transition:
    transform var(--surface-transition-slow),
    box-shadow var(--surface-transition-slow),
    border-color var(--surface-transition),
    background var(--surface-transition);
}

.scene-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 30%);
  pointer-events: none;
}

.scene-card::after {
  content: "";
  position: absolute;
  inset: auto -3.5rem -4.5rem auto;
  width: 11rem;
  height: 11rem;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  opacity: 0.55;
  pointer-events: none;
  transition:
    transform var(--surface-transition-slow),
    opacity var(--surface-transition-slow);
}

.scene-card > * {
  position: relative;
  z-index: 1;
}

.home-actions-card {
  padding: 16px;
}

.scene-grid {
  display: grid;
  gap: 16px;
}

.scene-grid-home {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.scene-grid-price {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: start;
}

.scene-grid-price > :first-child {
  grid-row: 1 / span 2;
}

.scene-grid-verdict {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
}

.section-heading,
.choice-section-header,
.account-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-panel,
.history-panel {
  display: grid;
  align-content: start;
}

.account-panel {
  gap: 18px;
}

.history-panel {
  gap: 16px;
}

.section-title {
  margin-top: 0;
  font-size: clamp(1.25rem, 2.8vw, 1.55rem);
  letter-spacing: -0.04em;
}

.account-copy,
.manual-hint,
.selection-meta,
.guess-reason,
.history-context,
.history-empty-copy,
.verdict-context,
.verdict-explanation,
.loading-product {
  color: var(--ink-soft);
}

.account-status-badge,
.selection-label {
  width: fit-content;
  padding: 8px 12px;
  background: rgba(23, 32, 51, 0.06);
  color: var(--ink-soft);
}

.account-status-badge.signed-in {
  background: rgba(24, 122, 73, 0.12);
  color: var(--good);
}

.account-home-actions,
.account-summary,
.action-stack,
.spinner-stack,
.manual-panel,
.clarify-panel,
.price-stack {
  display: grid;
  gap: 14px;
}

.account-home-actions,
.action-stack {
  gap: var(--button-gap-wide);
}

.account-home-actions {
  padding-top: 2px;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--button-gap);
  align-items: stretch;
}

.account-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-summary-stat {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(23, 32, 51, 0.04);
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.account-summary-value {
  font-family:
    "ui-rounded",
    "SF Pro Rounded",
    "Avenir Next",
    sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.account-summary-label,
.account-summary-copy {
  color: var(--ink-soft);
}

.account-summary-label {
  font-size: 0.8rem;
  font-weight: 700;
}

.account-summary-copy {
  font-size: 0.92rem;
}

.scene-actions {
  display: grid;
  gap: var(--button-gap-wide);
  padding-top: 6px;
  margin-top: auto;
}

.primary-button,
.secondary-button,
.text-button,
.choice-button,
.guess-button,
.clarify-option,
.history-card,
.auth-toggle-button {
  transition:
    transform var(--surface-transition),
    background var(--surface-transition),
    border-color var(--surface-transition),
    box-shadow var(--surface-transition),
    color var(--surface-transition),
    opacity var(--surface-transition);
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 56px;
  width: 100%;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 800;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  will-change: transform, box-shadow;
}

.primary-button {
  background:
    linear-gradient(135deg, #f48c55 0%, var(--brand) 55%, var(--brand-strong) 100%);
  color: #fff;
  box-shadow: 0 18px 28px rgba(201, 79, 19, 0.24);
}

.secondary-button {
  background: rgba(23, 32, 51, 0.05);
  border: 1px solid rgba(23, 32, 51, 0.08);
  color: var(--ink);
}

.text-button {
  min-height: 48px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px dashed rgba(23, 32, 51, 0.12);
}

.primary-button::before,
.secondary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.24), transparent 75%);
  transform: translateX(-130%);
  transition: transform 680ms var(--ease-emphasis);
  pointer-events: none;
}

.action-link {
  font-weight: 700;
}

.primary-button:active,
.secondary-button:active,
.text-button:active,
.choice-button:active,
.guess-button:active,
.clarify-option:active,
.history-card-main:active,
.history-mini-button:active,
.auth-toggle-button:active,
.back-button:active,
.account-button:active {
  transform: scale(0.97);
}

.primary-button:disabled,
.secondary-button:disabled,
.text-button:disabled {
  opacity: 0.6;
  box-shadow: none;
}

.manual-panel {
  gap: 16px;
}

.manual-field,
.currency-field {
  display: grid;
  gap: 8px;
}

.field-label {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manual-field input,
.currency-field select {
  min-height: 58px;
  width: 100%;
  padding: 0 18px;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  outline: none;
  transition:
    border-color var(--surface-transition),
    box-shadow var(--surface-transition),
    background var(--surface-transition);
}

.manual-field input::placeholder {
  color: var(--ink-muted);
}

.manual-field input:focus,
.currency-field select:focus,
.price-field:focus-within {
  border-color: rgba(232, 106, 43, 0.45);
  box-shadow:
    0 0 0 4px rgba(232, 106, 43, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.manual-hint,
.selection-meta,
.history-empty-copy,
.verdict-context,
.verdict-range,
.loading-product {
  font-size: 0.94rem;
}

.auth-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(23, 32, 51, 0.05);
  border: 1px solid rgba(23, 32, 51, 0.06);
}

.auth-toggle-button {
  min-height: 46px;
  border-radius: 14px;
  color: var(--ink-soft);
  font-weight: 800;
}

.auth-toggle-button.selected {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.auth-status-card {
  gap: 12px;
}

#clearHistoryButton {
  width: auto;
  min-width: 0;
  min-height: 38px;
  padding: 0 14px;
  flex: none;
}

.product-pill {
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  border: 1px solid rgba(232, 106, 43, 0.16);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-empty {
  display: grid;
  gap: 6px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(23, 32, 51, 0.04);
  border: 1px dashed rgba(23, 32, 51, 0.1);
}

.history-empty-title {
  font-size: 1rem;
  font-weight: 800;
}

.history-card {
  width: 100%;
  display: grid;
  gap: 0;
  padding: 0;
  text-align: left;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 238, 0.72));
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  will-change: transform, box-shadow;
}

.history-card.pinned {
  border-color: rgba(232, 106, 43, 0.22);
  box-shadow: 0 16px 28px rgba(201, 79, 19, 0.12);
}

.history-card-main,
.history-mini-button {
  transition:
    transform var(--surface-transition),
    background var(--surface-transition),
    border-color var(--surface-transition),
    box-shadow var(--surface-transition),
    color var(--surface-transition),
    opacity var(--surface-transition);
}

.history-card-main {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 16px;
  text-align: left;
}

.history-card-top,
.history-prices {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.history-verdict {
  padding: 7px 11px;
}

.history-verdict.good {
  background: var(--good-soft);
  color: var(--good);
}

.history-verdict.fair {
  background: var(--fair-soft);
  color: var(--fair);
}

.history-verdict.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.history-date {
  color: var(--ink-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.history-product {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.history-context,
.history-prices,
.history-difference {
  overflow-wrap: anywhere;
}

.history-prices {
  color: var(--ink-soft);
  font-size: 0.89rem;
  font-weight: 700;
}

.history-difference {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.history-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 2px 16px 14px;
}

.history-mini-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(23, 32, 51, 0.1);
  background: rgba(23, 32, 51, 0.04);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.history-mini-button:hover {
  background: rgba(23, 32, 51, 0.08);
  border-color: rgba(23, 32, 51, 0.14);
}

.history-mini-button.active {
  background: var(--brand-soft);
  border-color: rgba(232, 106, 43, 0.2);
  color: var(--brand-ink);
}

.history-note {
  margin: 0 16px 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(232, 106, 43, 0.08);
  border: 1px solid rgba(232, 106, 43, 0.12);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.loading-shell {
  width: min(100%, 33rem);
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-2xl);
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--surface-strong) 100%);
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow-md);
}

.centered-card {
  align-items: center;
  justify-content: center;
}

.spinner-stack {
  justify-items: center;
  text-align: center;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(232, 106, 43, 0.18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.pulse-dot-group {
  display: inline-flex;
  justify-content: center;
  gap: 8px;
}

.pulse-dot-group span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(47, 131, 216, 0.5);
  animation: pulse-dot 1s ease-in-out infinite;
}

.pulse-dot-group span:nth-child(2) {
  animation-delay: 0.12s;
}

.pulse-dot-group span:nth-child(3) {
  animation-delay: 0.24s;
}

.preview-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(23, 32, 51, 0.06), rgba(23, 32, 51, 0.02));
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow-xs);
  will-change: transform, box-shadow;
  transition:
    transform var(--surface-transition-slow),
    box-shadow var(--surface-transition-slow),
    border-color var(--surface-transition);
}

.preview-shell::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  pointer-events: none;
}

.preview-shell-stage {
  min-height: 15rem;
}

.preview-shell-inline {
  width: 100px;
  min-width: 100px;
  aspect-ratio: 1;
}

.loading-preview {
  width: 100%;
  max-width: 14rem;
  margin: 0 auto;
  aspect-ratio: 1;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 720ms var(--ease-emphasis),
    filter 420ms var(--surface-transition);
}

.preview-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.support-callout {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(47, 131, 216, 0.08);
  border: 1px solid rgba(47, 131, 216, 0.14);
  color: #275d95;
  font-weight: 700;
}

.scene-card-list,
.scene-card-question {
  padding: 14px;
}

.guess-list,
.clarify-options {
  display: grid;
  gap: 12px;
}

.guess-button,
.clarify-option {
  width: 100%;
  text-align: left;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow-xs);
}

.guess-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.guess-button.selected,
.clarify-option.selected,
.choice-button.selected {
  border-color: rgba(232, 106, 43, 0.4);
  box-shadow:
    0 0 0 4px rgba(232, 106, 43, 0.12),
    var(--shadow-sm);
}

.guess-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(23, 32, 51, 0.05);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.guess-copy {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.guess-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.guess-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guess-badge,
.guess-basis {
  padding: 7px 11px;
}

.guess-badge.high {
  background: var(--good-soft);
  color: var(--good);
}

.guess-badge.medium {
  background: rgba(47, 131, 216, 0.12);
  color: #2c69aa;
}

.guess-badge.low {
  background: var(--fair-soft);
  color: var(--fair);
}

.guess-basis {
  background: rgba(23, 32, 51, 0.06);
  color: var(--ink-soft);
}

.guess-reason {
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.guess-arrow {
  color: var(--ink-muted);
  font-size: 1.2rem;
  font-weight: 900;
}

.selection-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 251, 245, 0.86);
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow-xs);
  will-change: transform, box-shadow;
  transition:
    transform var(--surface-transition-slow),
    box-shadow var(--surface-transition-slow),
    border-color var(--surface-transition),
    background var(--surface-transition);
}

.selection-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.clarify-question {
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 800;
  line-height: 1.25;
}

.clarify-option {
  padding: 16px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.clarify-option:disabled {
  opacity: 0.72;
}

.price-entry-card {
  padding: 16px;
  align-self: stretch;
}

.price-field {
  min-height: 8rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 18px 18px 18px 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 245, 237, 0.85));
  border: 1px solid rgba(232, 106, 43, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    var(--shadow-xs);
  transition:
    box-shadow var(--surface-transition),
    border-color var(--surface-transition),
    transform var(--surface-transition-slow);
}

.price-field span {
  color: var(--brand-strong);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  line-height: 1;
}

.price-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: clamp(2.15rem, 7vw, 4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
}

.price-field input::placeholder {
  color: rgba(23, 32, 51, 0.28);
}

.choice-section {
  display: grid;
  gap: 14px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-button {
  min-height: 58px;
  padding: 0 14px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  border-radius: 16px;
  background: rgba(23, 32, 51, 0.04);
  border: 1px solid rgba(23, 32, 51, 0.08);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
  will-change: transform, box-shadow;
}

.verdict-card {
  position: relative;
  overflow: hidden;
}

.verdict-card.good .scene-stage-verdict {
  background:
    linear-gradient(180deg, rgba(16, 71, 43, 0.96), rgba(16, 71, 43, 0.88)),
    linear-gradient(140deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
}

.verdict-card.fair .scene-stage-verdict {
  background:
    linear-gradient(180deg, rgba(98, 68, 11, 0.96), rgba(98, 68, 11, 0.88)),
    linear-gradient(140deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
}

.verdict-card.bad .scene-stage-verdict {
  background:
    linear-gradient(180deg, rgba(117, 31, 31, 0.96), rgba(117, 31, 31, 0.88)),
    linear-gradient(140deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
}

.verdict-tone.good {
  color: rgba(202, 255, 226, 0.86);
}

.verdict-tone.fair {
  color: rgba(255, 241, 187, 0.88);
}

.verdict-tone.bad {
  color: rgba(255, 210, 210, 0.88);
}

.verdict-product {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.45;
}

.verdict-metrics {
  display: grid;
  gap: 14px;
}

.verdict-price-panel {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 238, 0.74));
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow-sm);
  will-change: transform, box-shadow;
  transition:
    transform var(--surface-transition-slow),
    box-shadow var(--surface-transition-slow),
    border-color var(--surface-transition),
    background var(--surface-transition);
}

.price-label {
  width: fit-content;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 0;
}

.verdict-price-panel strong {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.verdict-summary-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.verdict-difference {
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.3;
}

.verdict-range {
  font-size: 0.94rem;
  font-weight: 700;
}

.verdict-context {
  display: inline-flex;
  width: fit-content;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  background: rgba(23, 32, 51, 0.05);
  font-weight: 800;
}

.verdict-basis-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(23, 32, 51, 0.04);
  border: 1px solid rgba(23, 32, 51, 0.07);
}

.verdict-detail-label {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.verdict-basis-label {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: rgba(232, 106, 43, 0.1);
  color: var(--brand-ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.verdict-basis-summary {
  font-size: 0.98rem;
  line-height: 1.52;
}

.verdict-basis-row {
  display: grid;
  gap: 6px;
}

.verdict-basis-row-label {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.verdict-basis-row-copy {
  font-size: 0.94rem;
  line-height: 1.52;
}

.verdict-uncertainty-note {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.verdict-driver-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.verdict-driver-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(23, 32, 51, 0.08);
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.verdict-explanation {
  font-size: 1rem;
  line-height: 1.58;
}

.error-banner {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  top: calc(76px + env(safe-area-inset-top));
  z-index: 40;
  padding: 14px 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(211, 68, 68, 0.97), rgba(188, 48, 48, 0.95));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 20px 36px rgba(117, 31, 31, 0.28);
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
  transition:
    opacity 220ms var(--ease-out),
    transform 220ms var(--ease-out);
}

.error-banner.visible {
  opacity: 1;
  transform: translateY(0);
}

.loading-product {
  max-width: 22rem;
}

.history-card-main:focus-visible,
.history-mini-button:focus-visible,
.guess-button:focus-visible,
.clarify-option:focus-visible,
.choice-button:focus-visible,
.auth-toggle-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible,
.back-button:focus-visible,
.account-button:focus-visible,
.manual-field input:focus-visible,
.currency-field select:focus-visible,
.price-field input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(47, 131, 216, 0.18);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.985);
  }

  60% {
    opacity: 1;
    transform: translate3d(0, -2px, 0) scale(1.002);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

@keyframes float-card {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes ambient-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    transform: translate3d(0, -16px, 0) scale(1.03);
  }
}

@keyframes ambient-drift-reverse {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    transform: translate3d(0, 14px, 0) scale(1.02);
  }
}

@media (hover: hover) and (pointer: fine) {
  .back-button:hover,
  .account-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 24px rgba(22, 32, 49, 0.2);
  }

  .metric-card:hover,
  .scene-card:hover,
  .selection-summary:hover,
  .preview-shell:hover,
  .verdict-price-panel:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-float);
    border-color: rgba(23, 32, 51, 0.12);
  }

  .scene-card:hover::after {
    transform: translate3d(-10px, -8px, 0);
    opacity: 0.8;
  }

  .primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 38px rgba(201, 79, 19, 0.28);
  }

  .secondary-button:hover,
  .text-button:hover,
  .choice-button:hover {
    transform: translateY(-2px);
  }

  .secondary-button:hover {
    background: rgba(23, 32, 51, 0.08);
    border-color: rgba(23, 32, 51, 0.12);
    box-shadow: var(--shadow-xs);
  }

  .text-button:hover {
    background: rgba(255, 255, 255, 0.38);
    border-color: rgba(23, 32, 51, 0.16);
  }

  .primary-button:hover::before,
  .secondary-button:hover::before {
    transform: translateX(130%);
  }

  .history-card:hover,
  .guess-button:hover,
  .clarify-option:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-float);
  }

  .history-mini-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
  }

  .preview-shell:hover .preview-image {
    transform: scale(1.035);
    filter: saturate(1.04) contrast(1.01);
  }

  .price-field:hover {
    transform: translateY(-2px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      var(--shadow-float);
  }

  .scene-stage-verdict:hover {
    transform: translateY(-2px);
    box-shadow: 0 40px 78px rgba(23, 32, 51, 0.18);
  }
}

@media (max-width: 980px) {
  .scene-stage-home,
  .scene-stage-media,
  .scene-grid-price,
  .scene-grid-verdict {
    grid-template-columns: minmax(0, 1fr);
  }

  .scene-grid-price > :first-child {
    grid-row: auto;
  }

  .hero-art {
    min-height: 14rem;
  }
}

@media (max-width: 720px) {
  .step-card {
    gap: 16px;
    padding:
      16px
      max(14px, env(safe-area-inset-left))
      calc(26px + env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-right));
  }

  .top-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .brand-pill {
    justify-self: start;
    justify-content: start;
  }

  .scene-stage-verdict,
  .scene-card,
  .selection-summary,
  .loading-shell {
    border-radius: 24px;
  }

  .hero-art {
    min-height: 13rem;
  }

  .scene-grid-home,
  .metric-strip,
  .account-summary-grid,
  .action-row,
  .choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-shell-inline {
    width: 88px;
    min-width: 88px;
  }

  .guess-button {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .guess-arrow {
    display: none;
  }

  .selection-summary {
    align-items: start;
  }
}

@media (max-width: 520px) {
  .app-header {
    padding:
      calc(10px + env(safe-area-inset-top))
      max(12px, env(safe-area-inset-left))
      10px
      max(12px, env(safe-area-inset-right));
  }

  .back-button,
  .account-button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .brand-name {
    font-size: 0.92rem;
  }

  .brand-subtitle {
    font-size: 0.66rem;
  }

  .step-card {
    min-height: calc(100dvh - 68px - env(safe-area-inset-top));
  }

  .scene-stage-verdict {
    padding: 20px;
  }

  .scene-card,
  .selection-summary,
  .loading-shell,
  .hero-art,
  .metric-card {
    padding: 16px;
  }

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

  .price-field {
    min-height: 6.9rem;
    padding: 16px;
  }

  .price-field span {
    font-size: 1.8rem;
  }
}

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

  .step,
  .step.active {
    transform: none;
  }
}
