:root {
  --primary: #f24e1e;
  --primary-soft: #fef0ec;
  --ink: #261a09;
  --muted: #7d756b;
  --line: #dedadc;
  --surface: #ffffff;
  --bg: #f0efef;
  --dark: #1c1b1a;
  --success: #0e8345;
  --warning: #f6bc2f;
  --tag-rose: #d45fa9;
  --tag-rose-stroke: #be1c83;
  --tag-peach: #fde79a;
  --tag-peach-stroke: #fd7716;
  --tag-sky: #79bfff;
  --tag-sky-stroke: #0b61e2;
  --tag-lavender: #c79bff;
  --tag-lavender-stroke: #7835cc;
  --tag-selected: #57f21e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.flow-shell {
  height: 100vh;
  padding: 14px 18px;
  display: grid;
  grid-template-rows: 44px 112px 1fr;
  gap: 10px;
  overflow: hidden;
}

.flow-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--primary);
  color: white;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: white;
  color: var(--primary);
  font-weight: 900;
}

.flow-topbar strong,
.flow-topbar span {
  display: block;
}

.flow-topbar span {
  font-size: 12px;
  opacity: 0.88;
}

.model-pill {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.model-pill span {
  font-size: 11px;
  font-weight: 850;
  opacity: 0.9;
}

.model-pill strong {
  font-size: 14px;
}

.mode-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.mode-button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  color: white;
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.mode-button.active {
  background: white;
  color: var(--primary);
}

.photo-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  gap: 8px;
  align-items: center;
}

.strip-arrow {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
}

.photo-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 2px 2px 8px;
}

.photo-thumb {
  flex: 0 0 132px;
  height: 98px;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  position: relative;
}

.photo-thumb.active {
  border-color: var(--primary);
}

.photo-thumb img {
  width: 100%;
  height: 58px;
  object-fit: cover;
  display: block;
}

.photo-thumb span,
.photo-thumb strong {
  display: block;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-thumb span {
  margin-top: 5px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.photo-thumb strong {
  font-size: 12px;
}

.stage {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 382px minmax(280px, 1fr);
  gap: 18px;
  align-items: center;
}

.phone-frame {
  justify-self: center;
  width: 382px;
  height: min(720px, calc(100vh - 190px));
  min-height: 590px;
  padding: 12px;
  border-radius: 38px;
  background: #11100f;
  box-shadow: 0 20px 42px rgba(28, 27, 26, 0.34);
  position: relative;
}

.phone-speaker {
  width: 74px;
  height: 5px;
  border-radius: 999px;
  background: #2a2826;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.phone-screen {
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
}

.android-screen {
  height: 100%;
  display: grid;
  grid-template-rows: 52px 84px 1fr auto;
  background: var(--surface);
}

.android-screen.hidden {
  display: none;
}

.android-appbar {
  display: grid;
  grid-template-columns: 44px 1fr 54px;
  align-items: center;
  padding: 0 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.android-appbar strong {
  font-size: 17px;
  text-align: center;
}

.icon-button {
  border: 0;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
}

.step-label {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.phone-photo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.phone-photo {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 2px solid transparent;
  overflow: hidden;
  padding: 0;
  background: var(--bg);
}

.phone-photo.selected {
  border-color: var(--primary);
}

.phone-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-wrap {
  min-height: 0;
  position: relative;
  background: #e8e2d4;
}

.android-map {
  position: absolute;
  inset: 0;
}

.map-hint {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.map-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid white;
  background: #7d756b;
  color: white;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(38, 26, 9, 0.28);
}

.target-marker {
  width: 44px;
  height: 44px;
  border: 4px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 17px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 3px 12px rgba(242, 78, 30, 0.22);
}

.tag-sheet {
  padding: 10px 14px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.tag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.tag-option {
  min-height: 60px;
  border: 0;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: 24px 1fr 14px;
  gap: 6px;
  align-items: center;
  text-align: left;
  cursor: default;
  color: var(--ink);
}

.tag-0 {
  background: color-mix(in srgb, var(--tag-rose), white 8%);
}

.tag-1 {
  background: var(--tag-peach);
}

.tag-2 {
  background: var(--tag-sky);
}

.tag-3 {
  background: var(--tag-lavender);
}

.tag-option.actual {
  outline: 3px solid var(--primary);
  background: var(--tag-selected);
}

.tag-rank {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-weight: 900;
}

.tag-copy {
  min-width: 0;
}

.tag-copy strong,
.tag-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-copy strong {
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.24);
  font-size: 13px;
}

.tag-copy small {
  color: var(--dark);
  font-size: 11px;
  margin-top: 2px;
}

.truth-star {
  color: var(--primary);
  font-size: 16px;
}

.outline-action,
.solid-action {
  width: 100%;
  margin-top: 12px;
  min-height: 46px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.outline-action {
  border: 1px solid var(--primary);
  color: var(--primary);
  background: var(--surface);
}

.solid-action {
  border: 0;
  color: white;
  background: var(--primary);
}

.missing-screen {
  grid-template-rows: 52px 1fr;
}

.missing-body {
  padding: 20px 16px 14px;
}

.missing-body h2 {
  margin: 0;
  font-size: 19px;
}

.missing-body p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--ink);
  background: white;
}

.field small {
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
}

.suggestion-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 0 2px;
}

.suggestion-row button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}

.suggestion-row button.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.truth-panel {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
}

.truth-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px;
}

.readiness-card dd {
  font-size: 13px;
  line-height: 1.35;
}

.panel-label {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
}

.truth-card h1 {
  margin: 0 0 12px;
  font-size: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-grid div {
  border-radius: 10px;
  background: var(--bg);
  padding: 10px;
}

.metric-grid span,
dt {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

dl {
  margin: 0;
}

dd {
  margin: 3px 0 12px;
  font-weight: 850;
}

.truth-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.truth-card .timing {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .flow-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    grid-template-rows: auto auto auto;
  }

  .stage {
    grid-template-columns: 1fr;
  }

  .left-spacer {
    display: none;
  }

  .truth-panel {
    align-content: start;
  }
}

@media (max-width: 760px) {
  .flow-topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 44px;
    padding: 8px 10px;
  }

  .model-pill {
    order: 3;
    margin-left: 0;
  }

  .mode-switch {
    margin-left: auto;
  }
}
