/* ================================================================
   GLP-1 BODY CHANGE CHECK — builds on physique-rater.css (page shell,
   hero, sections, FAQ, cross-links). Signature color: TEAL, so the
   page reads as its own tool in the photo-tool family.
   ================================================================ */

.g1-body {
  --pr-amber: #12937f;
  --pr-amber-50: rgba(18, 147, 127, 0.10);
  --g1-teal: #12937f;
  --g1-teal-50: rgba(18, 147, 127, 0.10);
  --g1-teal-ink: #0b7263;
  --g1-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --g1-coral: #e2674a;
  --g1-warn-bg: #fff4e5;
  --g1-warn-ink: #8a4b00;
}

.g1-card { max-width: 680px; }

/* ---------------- Stepper ---------------- */

.g1-steps {
  list-style: none; margin: 0 0 20px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.g1-steps li {
  font-size: 13px; font-weight: 600; color: var(--pr-faint);
  padding-top: 10px;
  background:
    linear-gradient(var(--g1-teal), var(--g1-teal)) left top / 0% 3px no-repeat,
    linear-gradient(var(--pr-line), var(--pr-line)) left top / 100% 3px no-repeat;
  transition: background-size 0.55s var(--g1-ease), color 0.2s;
}
.g1-steps li, .g1-steps li button { display: flex; align-items: center; gap: 8px; }
.g1-steps li button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  border-radius: 6px;
}
.g1-steps li button:hover { color: var(--pr-ink); }
.g1-steps li span {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  font-family: var(--pr-mono); font-size: 12px;
  background: var(--pr-paper-2); color: var(--pr-muted);
  transition: background 0.25s, color 0.25s;
}
.g1-steps li.is-current, .g1-steps li.is-done { background-size: 100% 3px, 100% 3px; }
.g1-steps li.is-current { color: var(--pr-ink); }
.g1-steps li.is-current span { background: var(--g1-teal); color: #fff; }
.g1-steps li.is-done { color: var(--pr-muted); }
.g1-steps li.is-done span { background: var(--g1-teal-50); color: var(--g1-teal-ink); }

.g1-panel { display: grid; gap: 16px; }
.g1-panel-title { font-size: 1.2rem; margin: 0; letter-spacing: -0.01em; }

/* ---------------- Photo slots ---------------- */

.g1-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g1-slot {
  position: relative;
  display: grid; justify-items: center; align-content: center; gap: 4px;
  aspect-ratio: 4 / 5;
  border: 1.5px dashed var(--pr-line-2);
  transition: border-color 0.2s, background 0.2s;
  border-radius: var(--pr-radius-sm);
  background: var(--pr-paper-2);
  cursor: pointer; overflow: hidden;
  font: inherit; color: var(--pr-ink);
  padding: 12px;
}
.g1-slot:hover, .g1-slot.is-over { border-color: var(--g1-teal); background: var(--g1-teal-50); }
.g1-slot.has-photo { border-style: solid; border-color: var(--pr-line); }
.g1-slot:hover .g1-slot-empty, .g1-slot.is-over .g1-slot-empty { transform: scale(1.08); border-color: var(--g1-teal); }
.g1-slot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g1-slot-empty {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pr-paper); border: 1px solid var(--pr-line);
  color: var(--g1-teal); margin-bottom: 4px;
  transition: transform 0.3s var(--g1-ease), border-color 0.2s;
}
.g1-slot-label, .g1-slot-hint { position: relative; z-index: 1; }
.g1-slot-label { font-weight: 700; }
.g1-slot-hint { font-size: 12px; color: var(--pr-muted); }
.g1-slot:has(.g1-slot-img) .g1-slot-label,
.g1-slot:has(.g1-slot-img) .g1-slot-hint {
  align-self: end;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px; padding: 2px 10px;
}
.g1-slot:has(.g1-slot-img) { align-content: end; }

.g1-tip { margin: 0; font-size: 13px; color: var(--pr-muted); }

/* ---------------- Medication tiles + chips ---------------- */

.g1-meds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .g1-meds { grid-template-columns: repeat(4, 1fr); } }
.g1-med {
  display: grid; gap: 2px; text-align: left;
  padding: 12px; min-height: 64px;
  border: 1px solid var(--pr-line-2); border-radius: 12px;
  background: var(--pr-paper); cursor: pointer;
  font: inherit; color: var(--pr-ink);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.g1-med strong { font-size: 14px; line-height: 1.2; }
.g1-med span { font-size: 12px; color: var(--pr-muted); }
.g1-med:hover { border-color: var(--g1-teal); }
.g1-med.is-active { border-color: var(--g1-teal); background: var(--g1-teal-50); box-shadow: inset 0 0 0 1px var(--g1-teal); }

.g1-field { display: grid; gap: 8px; }
.g1-field-label { font-size: 13px; font-weight: 600; }
.g1-chips, .g1-units { display: flex; flex-wrap: wrap; gap: 8px; }
.g1-chip {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--pr-line-2); background: var(--pr-paper);
  font: inherit; font-size: 14px; color: var(--pr-ink); cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.g1-chip:hover { border-color: var(--g1-teal); }
.g1-chip.is-active { background: var(--g1-teal); border-color: var(--g1-teal); color: #fff; }

/* ---------------- Weight inputs ---------------- */

.g1-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.g1-input { display: grid; gap: 6px; font-size: 13px; font-weight: 600; position: relative; }
.g1-input input {
  width: 100%; box-sizing: border-box;
  padding: 11px 40px 11px 12px;
  border: 1px solid var(--pr-line-2); border-radius: 10px;
  font: inherit; font-size: 16px; font-weight: 500; color: var(--pr-ink);
  background: var(--pr-paper);
}
.g1-input input:focus { outline: 2px solid var(--g1-teal); outline-offset: 0; border-color: transparent; }
.g1-input em {
  position: absolute; right: 12px; bottom: 12px;
  font-style: normal; font-size: 13px; color: var(--pr-muted);
}
.g1-input--height div { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 6px; }
.g1-input--height input { padding-right: 8px; }
.g1-input--height em { position: static; }

.g1-warn {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--g1-warn-bg); color: var(--g1-warn-ink); font-size: 14px;
}

/* ---------------- Nav buttons ---------------- */

.g1-nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.g1-next, .g1-back {
  font: inherit; font-weight: 600; font-size: 15px;
  border-radius: 999px; padding: 12px 20px; cursor: pointer;
  transition: transform 0.15s var(--g1-ease), background 0.15s, opacity 0.2s;
}
.g1-next:not(:disabled):hover { background: #2c2c2c; }
.g1-next:not(:disabled):active, .g1-back:active { transform: scale(0.98); }
.g1-back:hover { border-color: var(--pr-ink); }
.g1-next { background: var(--pr-ink); color: #fff; border: 1px solid var(--pr-ink); }
.g1-panel > .g1-next { justify-self: stretch; }
.g1-nav .g1-next { flex: 1; }
.g1-next:disabled { opacity: 0.35; cursor: not-allowed; }
.g1-back { background: transparent; color: var(--pr-ink); border: 1px solid var(--pr-line-2); }
.g1-fine { margin: 0; text-align: center; font-family: var(--pr-mono); font-size: 11px; color: var(--pr-faint); }

/* ---------------- Processing ---------------- */

.g1-processing { display: grid; justify-items: center; gap: 14px; padding: 18px 0; }
.g1-processing-pair { display: flex; gap: 10px; }
.g1-processing-pair span {
  position: relative; display: block; overflow: hidden;
  width: 108px; height: 144px; border-radius: 12px;
}
.g1-processing-pair img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g1-processing-steps { list-style: none; display: flex; gap: 6px; margin: 4px 0 0; padding: 0; }
.g1-processing-steps li {
  width: 34px; height: 3px; border-radius: 3px;
  background: linear-gradient(var(--g1-teal), var(--g1-teal)) left / 0% 100% no-repeat, var(--pr-line);
  transition: background-size 1.4s linear;
}
.g1-processing-steps li.is-done { background-size: 100% 100%, auto; transition-duration: 0s; }
.g1-processing-steps li.is-current { background-size: 100% 100%, auto; }

/* ---------------- Result ---------------- */

.g1-result { display: grid; gap: 16px; }
.g1-result-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g1-result-photos figure { margin: 0; position: relative; }
.g1-result-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; display: block; }
.g1-result-photos figcaption {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(255, 255, 255, 0.92); border-radius: 999px;
  padding: 2px 10px; font-size: 12px; font-weight: 700;
}
.g1-headline { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.g1-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.g1-badge {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--g1-teal-50); color: var(--g1-teal-ink);
}
.g1-badge--possible_loss { background: rgba(226, 103, 74, 0.12); color: var(--g1-coral); }
.g1-badge--mixed, .g1-badge--unclear, .g1-badge--muted { background: var(--pr-paper-2); color: var(--pr-muted); }
.g1-badge--muted { font-weight: 600; }

.g1-block {
  display: grid; gap: 10px;
  border-top: 1px solid var(--pr-line); padding-top: 16px;
}
.g1-block h3 { margin: 0; font-size: 1.1rem; letter-spacing: -0.01em; }
.g1-block p { margin: 0; }
.g1-block-eyebrow {
  font-family: var(--pr-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--g1-teal);
}
.g1-list, .g1-actions { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.g1-actions li::marker { color: var(--g1-teal); font-weight: 700; }
.g1-callout {
  background: var(--g1-teal-50); border-radius: 12px; padding: 12px 14px; font-size: 15px;
}
.g1-small { font-size: 13px; color: var(--pr-muted); }
.g1-result-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------------- Chart ---------------- */

.g1-chart { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
.g1-chart-grid { stroke: var(--pr-line); stroke-width: 1; }
.g1-chart-axis { fill: var(--pr-faint); font-family: var(--pr-mono); font-size: 9px; }
.g1-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.g1-chart-line--0 { stroke: var(--g1-teal); }
.g1-chart-line--1 { stroke: #8b8b86; stroke-dasharray: 5 4; }
.g1-chart-label { font-size: 10px; font-weight: 700; }
.g1-chart-label--0 { fill: var(--g1-teal); }
.g1-chart-label--1 { fill: #6f6f6b; }
.g1-chart-you { fill: var(--g1-coral); stroke: #fff; stroke-width: 2; }
.g1-chart-you-ring { fill: none; stroke: var(--g1-coral); stroke-width: 1.5; opacity: 0; }
.g1-chart-you-label { fill: var(--g1-coral); font-size: 11px; font-weight: 700; }

/* ---------------- Results table ---------------- */

.g1-table-wrap { overflow-x: auto; background: var(--pr-paper); border: 1px solid var(--pr-line); border-radius: var(--pr-radius-sm); }
.g1-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.g1-table th, .g1-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--pr-line); vertical-align: top; }
.g1-table th { font-family: var(--pr-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--pr-muted); font-weight: 600; }
.g1-table tr:last-child td { border-bottom: 0; }
.g1-table td span { display: block; font-size: 12px; color: var(--pr-muted); }
.g1-table td:not(:first-child) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.g1-sources { font-size: 12px; color: var(--pr-faint); }

@media (max-width: 480px) {
  .g1-card { padding: 16px; }
  .g1-steps li { font-size: 12px; }
}

/* ---------------- Drug pages ---------------- */

.g1-crumbs {
  display: inline-flex; gap: 8px; align-items: center;
  font-family: var(--pr-mono); font-size: 12px; color: var(--pr-muted);
}
.g1-crumbs a { color: var(--g1-teal); text-decoration: none; }
.g1-crumbs a:hover { text-decoration: underline; }
.g1-meta-item { display: inline-flex; align-items: center; gap: 10px; }
.g1-table--months { min-width: 0; }
.g1-drug-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.g1-drug-links a {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--pr-line-2); background: var(--pr-paper);
  color: var(--pr-ink); text-decoration: none; font-size: 14px; font-weight: 600;
}
.g1-drug-links a:hover { border-color: var(--g1-teal); color: var(--g1-teal); }
.g1-body .pr-section-inner > p + p,
.g1-body .pr-section-inner > p + .g1-table-wrap,
.g1-body .pr-section-inner > .g1-table-wrap + p,
.g1-body .pr-section-inner > p + .g1-drug-links { margin-top: 12px; }

/* ---------------- Focus, selection ---------------- */

.g1-body ::selection { background: rgba(18, 147, 127, 0.22); }
.g1-body :is(.g1-chip, .g1-med, .g1-next, .g1-back, .g1-slot, .g1-steps button, .g1-drug-links a):focus-visible {
  outline: 2px solid var(--g1-teal); outline-offset: 2px;
}
.g1-body input { caret-color: var(--g1-teal); }

/* ---------------- Example result ---------------- */

.g1-top-sample { padding: 0 var(--pr-pad-x); }
.g1-sample {
  max-width: 680px; margin: 20px auto 0; box-sizing: border-box;
  background: var(--pr-paper); border: 1px solid var(--pr-line);
  border-radius: 16px; padding: 18px 18px 14px;
  display: grid; gap: 12px;
}
.g1-sample-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.g1-sample-tag {
  font-size: 12px; font-weight: 700; color: var(--g1-teal-ink);
  background: var(--g1-teal-50); border-radius: 999px; padding: 3px 10px;
}
.g1-sample-meta { font-size: 13px; color: var(--pr-muted); font-variant-numeric: tabular-nums; }
.g1-sample-title { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.g1-sample-chart { max-width: none; }
.g1-sample-rows { margin: 0; display: grid; }
.g1-sample-rows > div {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--pr-line);
}
.g1-sample-rows dt { font-size: 13px; color: var(--pr-muted); padding-top: 1px; }
.g1-sample-rows dd { margin: 0; display: grid; gap: 1px; }
.g1-sample-rows strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.g1-sample-rows dd span { font-size: 13px; color: var(--pr-muted); }
.g1-sample-foot { margin: 0; font-size: 12px; color: var(--pr-muted); }

/* ---------------- Two-column top (desktop) ---------------- */

@media (min-width: 1040px) {
  .g1-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
    grid-template-rows: auto 1fr;
    grid-template-areas: "text tool" "sample tool";
    column-gap: 56px; align-items: start;
    max-width: 1120px; margin: 0 auto; padding: 52px 24px 8px;
  }
  .g1-top-text { grid-area: text; padding: 0; }
  .g1-top-text .pr-hero-inner { text-align: left; margin: 0; }
  .g1-top-text h1 { font-size: clamp(2.3rem, 3.5vw, 2.9rem); text-wrap: balance; }
  .g1-top-text .pr-hero-sub { margin-left: 0; max-width: 500px; }
  .g1-top-text .pr-hero-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .g1-top-text .pr-hero-meta .sep { display: none; }
  .g1-top-tool { grid-area: tool; padding: 0; }
  .g1-top-tool .g1-card { max-width: none; margin: 0; }
  .g1-top-sample { grid-area: sample; padding: 0; }
  .g1-sample { margin: 28px 0 0; max-width: 500px; }

  /* Once the real result is on screen it takes the full width, and the
     example steps aside. */
  .g1-top:has(.g1-result) {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "tool"; row-gap: 28px;
  }
  .g1-top:has(.g1-result) .g1-top-sample { display: none; }
  .g1-top:has(.g1-result) .g1-top-text .pr-hero-inner { text-align: center; margin: 0 auto; }
  .g1-top:has(.g1-result) .g1-top-text .pr-hero-sub { margin-left: auto; }
  .g1-top:has(.g1-result) .g1-top-text .pr-hero-meta { justify-content: center; }
  .g1-top:has(.g1-result) .g1-card { max-width: 680px; margin: 0 auto; }
}

/* ---------------- Motion ---------------- */

@media (prefers-reduced-motion: no-preference) {
  @keyframes g1-rise { from { opacity: 0; transform: translateY(10px); } }
  @keyframes g1-fade-in { from { opacity: 0; } }
  @keyframes g1-draw { from { stroke-dashoffset: 1; } }
  @keyframes g1-pop { from { opacity: 0; transform: scale(0.2); } 70% { transform: scale(1.15); } }
  @keyframes g1-ping { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(3.2); } }
  @keyframes g1-photo-in { from { opacity: 0; transform: scale(1.04); filter: blur(6px); } }
  @keyframes g1-scan { from { transform: translateY(-100%); } to { transform: translateY(260%); } }

  /* The example result assembles once: line, then the dot, then the read. */
  .g1-draw { stroke-dasharray: 1; animation: g1-draw 1.5s var(--g1-ease) 0.3s backwards; }
  .g1-fade { animation: g1-fade-in 0.6s ease-out 0.5s backwards; }
  .g1-fade--late { animation-delay: 1.2s; }
  .g1-you { animation: g1-fade-in 0.2s linear 1.3s backwards; }
  .g1-chart-you, .g1-chart-you-ring { transform-box: fill-box; transform-origin: center; }
  .g1-chart-you { animation: g1-pop 0.55s var(--g1-ease) 1.3s backwards; }
  .g1-chart-you-ring { animation: g1-ping 1.5s ease-out 1.7s 2; }
  .g1-sample-rows > div { animation: g1-rise 0.6s var(--g1-ease) backwards; }
  .g1-sample-rows > div:nth-child(1) { animation-delay: 1.55s; }
  .g1-sample-rows > div:nth-child(2) { animation-delay: 1.7s; }
  .g1-sample-rows > div:nth-child(3) { animation-delay: 1.85s; }

  /* Tool: each step slides in, picked photos resolve, the read scans. */
  .g1-panel { animation: g1-rise 0.4s var(--g1-ease); }
  .g1-slot-img { animation: g1-photo-in 0.5s var(--g1-ease); }
  .g1-processing-pair span::after {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40%;
    background: linear-gradient(180deg, transparent, rgba(18, 147, 127, 0.28) 85%, rgba(255, 255, 255, 0.9));
    animation: g1-scan 1.7s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }
  .g1-processing-pair span:nth-child(2)::after { animation-delay: 0.25s; }
  .g1-processing-msg { animation: g1-rise 0.35s var(--g1-ease); }

  /* Result: photos first, then each part of the read in order. */
  .g1-result > * { animation: g1-rise 0.55s var(--g1-ease) backwards; }
  .g1-result > :nth-child(2) { animation-delay: 0.08s; }
  .g1-result > :nth-child(3) { animation-delay: 0.16s; }
  .g1-result > :nth-child(4) { animation-delay: 0.26s; }
  .g1-result > :nth-child(n + 5) { animation-delay: 0.36s; }
  .g1-result .g1-draw { animation-delay: 0.6s; }
  .g1-result .g1-fade { animation-delay: 0.8s; }
  .g1-result .g1-fade--late { animation-delay: 1.5s; }
  .g1-result .g1-you, .g1-result .g1-chart-you { animation-delay: 1.6s; }
  .g1-result .g1-chart-you-ring { animation-delay: 2s; }
}
