:root {
  --bg: #fff8f2;
  --surface: #ffffff;
  --surface-soft: #f2e8e1;
  --text: #5f584b;
  --text-muted: #8f887d;
  --accent: #ffb820;
  --border: #e1d4ca;
  --success: #86a578;
  --danger: #c17767;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "SF Pro Text",
    "SF Pro Display",
    "Avenir Next",
    "Segoe UI",
    sans-serif;
}

.layout {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 1rem 0.9rem 2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1rem;
  box-shadow: 0 8px 28px rgba(95, 88, 75, 0.06);
}

.step {
  display: none;
}

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

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

h1,
h2 {
  margin: 0 0 0.6rem;
  line-height: 1.2;
}

h1 {
  font-size: 1.65rem;
}

h2 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
}

.small {
  font-size: 0.92rem;
}

.btn {
  appearance: none;
  border: 0;
  width: 100%;
  border-radius: 999px;
  padding: 0.9rem 1rem;
  background: var(--accent);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.row.is-hidden {
  display: none;
}

.proof-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffcf9;
  padding: 0.7rem;
  margin-bottom: 0.8rem;
}

.proof-score {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-weight: 700;
}

.proof-quote {
  margin: 0;
  font-size: 0.95rem;
}

.checklist {
  margin: 0 0 0.85rem;
  padding-left: 1.05rem;
}

.checklist li {
  margin-bottom: 0.4rem;
  color: var(--text);
}

.concern-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.concern-pill {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  min-height: 42px;
  font-weight: 600;
  cursor: pointer;
}

.concern-pill.is-selected {
  border-color: var(--text);
  background: #f7efe9;
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d6c7bb;
}

.dot.is-active {
  width: 18px;
  background: var(--text);
}

.auth-status {
  text-align: center;
  font-size: 0.86rem;
  margin-top: 0.65rem;
}

.auth-status.error {
  color: var(--danger);
}

.capture-layout .panel {
  min-height: calc(100dvh - 2rem);
}

.liqa-host {
  width: 100%;
  height: min(68dvh, 620px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  margin-top: 0.65rem;
}

.liqa-host hautai-liqa {
  display: block;
  width: 100%;
  height: 100%;
}

.analysis-loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(247, 241, 234, 0.95);
  padding: 1rem;
}

.analysis-loading-card {
  width: min(420px, 100%);
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 1rem;
  box-shadow: 0 10px 32px rgba(95, 88, 75, 0.14);
}

.analysis-steps {
  margin: 0.8rem 0 1rem;
  display: grid;
  gap: 0.5rem;
}

.analysis-step {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: #fefcf9;
}

.analysis-step.is-active {
  border-color: #cbb39e;
  color: var(--text);
  background: #f8efe7;
  font-weight: 600;
}

.analysis-fact-label {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.analysis-fact-text {
  margin: 0;
  color: var(--text);
  font-size: 0.93rem;
}

.error-details {
  margin: 0 0 0.7rem;
  padding: 0.65rem;
  border: 1px solid #e3b7ac;
  border-radius: 10px;
  background: #fff3ef;
  color: #8b3b2b;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.score-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mask-section {
  margin-bottom: 0.9rem;
}

.mask-preview {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 3 / 4;
  background: #f7efe9;
  margin-bottom: 0.6rem;
}

.mask-image-base,
.mask-image-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mask-image-overlay {
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.metric-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.metric-pill {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  min-height: 38px;
  font-weight: 600;
  cursor: pointer;
}

.metric-pill.is-selected {
  border-color: var(--text);
  background: #f7efe9;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.72rem;
  margin-bottom: 0.55rem;
  background: #fffcf9;
}

.score-value {
  color: var(--text);
  font-weight: 700;
}

.cta-block {
  border-top: 1px solid var(--border);
  margin-top: 0.8rem;
  padding-top: 0.9rem;
}

.cta-title {
  color: var(--text);
  font-weight: 700;
}

.is-hidden {
  display: none;
}
