:root {
  color-scheme: light;
  --paper: #f3f5f4;
  --panel: #ffffff;
  --ink: #1d2428;
  --muted: #627078;
  --line: #d8e0df;
  --accent: #12615b;
  --accent-dark: #0d4844;
  --done: #257342;
  --warn: #9a5a12;
  --shadow: 0 14px 34px rgba(28, 45, 48, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

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

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  padding: 10px 2px 14px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 7vw, 2.1rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 7vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.secondary-button,
.primary-button,
.phase-pill,
.jump-toggle,
.jump-step {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.progress-card,
.step-panel,
.jump-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.progress-card {
  padding: 14px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.93rem;
}

.progress-copy strong {
  color: var(--accent-dark);
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9e8;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--done));
  transition: width 180ms ease;
}

.phase-strip {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.phase-strip::-webkit-scrollbar {
  display: none;
}

.phase-pill {
  display: block;
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 112px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.05;
  background: #f8fbfa;
}

.phase-pill.is-active {
  border-color: rgba(18, 97, 91, 0.3);
  color: var(--accent-dark);
  background: rgba(18, 97, 91, 0.08);
}

.step-panel {
  overflow: hidden;
  margin-top: 14px;
}

.photo-frame {
  position: relative;
  display: grid;
  height: clamp(300px, 56svh, 560px);
  aspect-ratio: 3 / 4;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #1f2428;
}

.photo-stage {
  position: relative;
  height: 100%;
  aspect-ratio: 3 / 4;
  max-width: 100%;
}

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

.annotation-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.callout {
  position: absolute;
  transform: translate(-50%, -50%);
}

.callout-circle {
  border: 5px solid #e02f2f;
  border-radius: 999px;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.72),
    0 6px 18px rgba(0, 0, 0, 0.28);
}

.photo-placeholder {
  position: absolute;
  inset: 18px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 20px;
  border: 2px dashed rgba(21, 94, 99, 0.35);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
}

.photo-placeholder strong {
  color: var(--accent-dark);
}

.photo-placeholder.is-hidden {
  display: none;
}

.step-content {
  padding: 20px 18px 18px;
}

.step-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 9px;
  border: 1px solid rgba(21, 94, 99, 0.2);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(21, 94, 99, 0.08);
}

#stepInstruction {
  margin-bottom: 12px;
  color: #3f454a;
  font-size: 1.12rem;
  font-weight: 650;
}

.step-note {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  color: #3d464a;
  font-size: 0.95rem;
  background: rgba(154, 90, 18, 0.08);
}

.controls {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px;
  padding: 14px 0 max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(243, 245, 244, 0), var(--paper) 28%);
}

.secondary-button,
.primary-button {
  min-height: 54px;
  border-radius: 8px;
  font-weight: 850;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--accent-dark);
  background: #ffffff;
}

.primary-button {
  color: white;
  background: var(--accent);
  box-shadow: 0 12px 26px rgba(21, 94, 99, 0.2);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.jump-list {
  overflow: hidden;
  margin-top: 2px;
}

.jump-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--accent-dark);
  font-weight: 850;
  background: transparent;
}

.jump-items {
  display: grid;
  border-top: 1px solid var(--line);
}

.jump-items[hidden] {
  display: none;
}

.jump-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  background: #fbfdfc;
}

.jump-heading {
  padding: 11px 16px 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  background: #f3f7f6;
}

.jump-step:last-child {
  border-bottom: 0;
}

.jump-step span:first-child {
  min-width: 0;
}

.jump-step small {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
}

.jump-step.is-active {
  color: var(--accent-dark);
  background: rgba(21, 94, 99, 0.09);
}

.jump-step.is-complete small {
  color: var(--done);
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 26px;
  }

  .step-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.95fr);
  }

  .photo-frame {
    height: 520px;
    min-height: 520px;
    aspect-ratio: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .step-content {
    align-self: center;
    padding: 28px;
  }
}
