/* GAIL's Overview — Upgraded Typeform-style submission form */

/* ============ Design tokens (scoped to form) ============ */

.gf-form {
  --red: #C8102E;
  --red-dark: #a00d24;
  --red-pale: #fdf0f2;
  --red-border: #f5c6cb;

  --cream: #FAFAF8;
  --cream-2: #F4F1EB;
  --cream-3: #EDE8DF;
  --cream-border: #E8E3D8;

  --green: #16a34a;
  --green-pale: #f0fdf4;
  --green-border: #bbf7d0;
  --amber: #d97706;
  --amber-pale: #fffbeb;
  --amber-border: #fde68a;

  --text: #1a1a1a;
  --text-mid: #555;
  --text-light: #8a857c;

  --shadow-sm: 0 1px 2px rgba(60, 50, 30, 0.05);
  --shadow-md: 0 6px 20px rgba(60, 50, 30, 0.08);
  --shadow-lg: 0 20px 50px rgba(60, 50, 30, 0.14);

  --gf-radius: 14px;
  --gf-radius-sm: 10px;
  --gf-radius-pill: 999px;

  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Monaco, monospace;

  --motion: 320ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ Shell ============ */

.gf-form {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  z-index: 50;
}

.gf-form::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(200, 16, 46, 0.025), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(200, 16, 46, 0.02), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ============ Topbar ============ */

.gf-topbar {
  position: relative;
  z-index: 5;
  padding: calc(14px + var(--sat, env(safe-area-inset-top, 0px))) 20px 0;
}

.gf-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gf-brand-mark {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.gf-brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.gf-brand-site {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-brand-week {
  font-size: 11px;
  color: var(--text-light);
  font-feature-settings: 'tnum';
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--gf-radius-pill);
  background: var(--white);
  border: 1px solid var(--cream-border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
}

.gf-chip-deadline {
  color: var(--red);
  background: var(--red-pale);
  border-color: var(--red-border);
  font-variant-numeric: tabular-nums;
}

.gf-chip-deadline .gf-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  position: relative;
}
.gf-chip-deadline .gf-pulse::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.4;
  animation: gfPulse 1.6s ease-in-out infinite;
}

@keyframes gfPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.8); opacity: 0; }
}

.gf-exit {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-mid);
  background: transparent;
  border: none;
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease);
}
.gf-exit:hover {
  background: var(--cream-2);
  color: var(--text);
}

/* ============ Progress ============ */

.gf-progress-wrap {
  padding: 14px 20px 10px;
  position: relative;
  z-index: 5;
}

.gf-progress-segments {
  display: flex;
  gap: 4px;
  height: 4px;
}

.gf-pseg {
  flex: 1;
  background: var(--cream-3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  transition: background var(--motion) var(--ease);
}

.gf-pseg-fill {
  position: absolute;
  inset: 0;
  background: var(--red);
  transform: translateX(-100%);
  transition: transform calc(var(--motion) * 1.6) var(--ease);
  border-radius: 2px;
}

.gf-pseg.done .gf-pseg-fill { transform: translateX(0); }
.gf-pseg.active .gf-pseg-fill {
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 60%, rgba(200, 16, 46, 0.4) 100%);
}

.gf-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  gap: 12px;
}

.gf-progress-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  font-feature-settings: 'tnum';
}

.gf-progress-section {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  font-style: italic;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

/* ============ Stage / slides ============ */

.gf-stage {
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.gf-viewport {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.gf-viewport > * {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.gf-slide {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Section intro */
.gf-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px 80px;
  min-height: 100%;
  justify-content: center;
  max-width: 560px;
  margin: 0 auto;
}

.gf-intro-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.gf-intro-eyebrow::before,
.gf-intro-eyebrow::after {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--red);
  opacity: 0.4;
}

.gf-intro-num {
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: italic;
  font-size: 140px;
  line-height: 0.9;
  color: var(--red);
  margin-bottom: 12px;
  letter-spacing: -0.04em;
  opacity: 0.92;
  position: relative;
}
.gf-intro-num::after {
  content: '.';
  color: var(--red);
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: italic;
  margin-left: 0.02em;
}

.gf-intro-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.gf-intro-sub {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.55;
  max-width: 380px;
  text-wrap: pretty;
  margin-bottom: 32px;
}

.gf-intro-stats {
  display: flex;
  gap: 20px;
  padding: 12px 22px;
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--gf-radius-pill);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
  align-items: center;
}

.gf-intro-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light);
}
.gf-intro-stat strong {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
  font-feature-settings: 'tnum';
}

.gf-intro-divider {
  width: 1px;
  height: 18px;
  background: var(--cream-border);
}

.gf-intro-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px 14px 28px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: var(--gf-radius-pill);
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(200, 16, 46, 0.28);
  transition: transform var(--motion) var(--ease), box-shadow var(--motion) var(--ease), background var(--motion) var(--ease);
  cursor: pointer;
}
.gf-intro-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(200, 16, 46, 0.36);
  background: var(--red-dark);
}
.gf-intro-cta:active { transform: translateY(0); }

.gf-intro-arrow {
  display: inline-block;
  transition: transform var(--motion) var(--ease);
}
.gf-intro-cta:hover .gf-intro-arrow { transform: translateX(4px); }

/* ---- Welcome (form opening screen) ---- */
/* The welcome has more content than a section intro, so it must TOP-align: with
   justify-content:center, overflowing content becomes unreachable above the
   scroll origin (the eyebrow was getting clipped). Top-align + tighter rhythm. */
.gf-welcome {
  justify-content: flex-start;
  padding-top: 40px;
  padding-bottom: 48px;
}
.gf-welcome .gf-intro-eyebrow { margin-bottom: 16px; }
.gf-welcome-title { font-size: 32px; margin-bottom: 12px; }
.gf-welcome-title em { font-style: italic; color: var(--red); }
.gf-welcome .gf-intro-sub { margin-bottom: 22px; }
.gf-welcome-sub { max-width: 440px; }
.gf-welcome .gf-intro-stats { margin-bottom: 22px; }
.gf-welcome-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin: 2px 0 22px;
  text-align: left;
}
.gf-welcome-step { display: flex; align-items: flex-start; gap: 13px; }
.gf-welcome-step-ic {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red-light);
  color: var(--red);
  font-size: 14px;
  margin-top: 1px;
}
.gf-welcome-step-h { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.3; }
.gf-welcome-step-sub { font-size: 12.5px; color: var(--text-mid); line-height: 1.45; margin-top: 2px; }

/* ============ Question ============ */

.gf-q-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.gf-q-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gf-q-num-arrow {
  display: inline-block;
  width: 10px;
  height: 1px;
  background: var(--red);
  position: relative;
}
.gf-q-num-arrow::after {
  content: '';
  position: absolute;
  right: 0; top: -2px;
  border-left: 4px solid var(--red);
  border-top: 2.5px solid transparent;
  border-bottom: 2.5px solid transparent;
}

.gf-q-status {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--gf-radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.gf-q-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.gf-q-status.green { background: var(--green-pale); color: var(--green); }
.gf-q-status.amber { background: var(--amber-pale); color: var(--amber); }
.gf-q-status.red { background: var(--red-pale); color: var(--red); }
.gf-q-status.neutral { background: var(--cream-2); color: var(--text-light); }
.gf-q-status.optional { background: var(--cream-2); color: var(--text-light); }

.gf-q-title {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 22px;
  letter-spacing: -0.01em;
  text-wrap: pretty;
  font-feature-settings: 'tnum';
}

.gf-q-sub {
  font-size: 14px;
  color: var(--text-mid);
  margin-top: -12px;
  margin-bottom: 22px;
  line-height: 1.5;
}

/* ============ Data card ============ */

.gf-dcard {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--gf-radius);
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.gf-dcard-ribbon {
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--red), transparent);
  opacity: 0.4;
}

.gf-dcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.gf-dcard-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gf-dcard-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green-pale);
}

.gf-dcard-source {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-light);
}

.gf-dcard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.gf-dcard-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.gf-dcard-grid.cols-1 { grid-template-columns: 1fr; }

.gf-dcell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gf-dcell-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
}

.gf-dcell-value {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.01em;
  font-feature-settings: 'tnum';
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.gf-dcell-value.green { color: var(--green); }
.gf-dcell-value.amber { color: var(--amber); }
.gf-dcell-value.red { color: var(--red); }

.gf-dcell-value .gf-unit {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.7;
}

.gf-dcell-sub {
  font-size: 11px;
  color: var(--text-light);
}

/* Category strip — Top 20 availability, inside .gf-dcard for availability_commentary.
   Class names + design agreed in mockups/top20-question.html (Option A). */
.gf-cats {
  border-top: 1px solid var(--cream-border);
  margin: 16px -20px -18px;
  padding: 14px 20px 16px;
  background: linear-gradient(180deg, #fdfcfa, #fff);
  border-radius: 0 0 var(--gf-radius) var(--gf-radius);
}
.gf-cats-head {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gf-cat-row { display: grid; gap: 7px; }
.gf-cat {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--gf-radius-sm);
  border: 1px solid transparent;
  background: var(--cream-2);
}
.gf-cat.red { background: var(--red-pale); border-color: var(--red-border); }
.gf-cat.amber { background: var(--amber-pale); border-color: var(--amber-border); }
.gf-cat.green { background: var(--green-pale); border-color: var(--green-border); }
.gf-cat-name { font-size: 13px; font-weight: 500; color: var(--text); }
.gf-cat-val {
  font-size: 15px;
  font-weight: 600;
  font-feature-settings: 'tnum';
  letter-spacing: -0.01em;
  min-width: 42px;
  text-align: right;
}
.gf-cat.red .gf-cat-val { color: var(--red); }
.gf-cat.amber .gf-cat-val { color: var(--amber); }
.gf-cat.green .gf-cat-val { color: var(--green); }
.gf-cat-delta {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  min-width: 46px;
  text-align: right;
  color: var(--text-light);
}
.gf-cat-delta.up { color: var(--green); }
.gf-cat-delta.down { color: var(--red); }

/* Day pills for forecast accuracy — full-width row below the ring.
   Explicit margin reset overrides an earlier iteration that used negative
   margins and got cached in some browsers. */
.gf-dpills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-top: none !important;
}
.gf-dpill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--gf-radius-pill);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.gf-dpill.green { background: var(--green-pale); color: var(--green); }
.gf-dpill.amber { background: var(--amber-pale); color: var(--amber); }
.gf-dpill.red { background: var(--red-pale); color: var(--red); }

/* Ring chart */
.gf-dring {
  width: 84px;
  height: 84px;
  position: relative;
  flex-shrink: 0;
}
.gf-dring svg { transform: rotate(-90deg); }
.gf-dring-bg { stroke: var(--cream-3); }
.gf-dring-fg {
  stroke-linecap: round;
  transition: stroke-dashoffset calc(var(--motion) * 2.5) var(--ease);
}
.gf-dring-fg.green { stroke: var(--green); }
.gf-dring-fg.amber { stroke: var(--amber); }
.gf-dring-fg.red { stroke: var(--red); }

.gf-dring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  font-feature-settings: 'tnum';
  letter-spacing: -0.01em;
}

.gf-dring-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gf-dring-text { flex: 1; min-width: 0; }
.gf-dring-text .gf-dcell-label { margin-bottom: 4px; }
.gf-dring-text .gf-dcell-value { font-size: 18px; }

/* ============ Inputs ============ */

.gf-inp-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-light);
  margin-bottom: 6px;
  display: block;
}

.gf-inp {
  width: 100%;
  padding: 16px 18px;
  background: var(--white);
  border: 1.5px solid var(--cream-border);
  border-radius: var(--gf-radius);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  transition: border-color var(--motion) var(--ease), box-shadow var(--motion) var(--ease);
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}
.gf-inp::placeholder { color: #b8b3a8; }
.gf-inp:hover { border-color: #d8d2c4; }
.gf-inp:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08), var(--shadow-sm);
}

/* Yes / No choice — paired buttons. Selected uses the green/red pale bands so
   the choice reads as the answer's status. */
.gf-yn {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.gf-yn-btn {
  flex: 1 1 160px;
  min-height: 72px;
  padding: 18px 22px;
  background: var(--white);
  border: 1.5px solid var(--cream-border);
  border-radius: var(--gf-radius);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--motion) var(--ease), background var(--motion) var(--ease), color var(--motion) var(--ease), box-shadow var(--motion) var(--ease);
  letter-spacing: -0.01em;
}
.gf-yn-btn:hover { border-color: #d8d2c4; }
.gf-yn-btn:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08);
}
.gf-yn-btn.yes.selected {
  background: var(--green-pale);
  border-color: var(--green);
  color: var(--green);
}
.gf-yn-btn.no.selected {
  background: var(--red-pale);
  border-color: var(--red);
  color: var(--red);
}

.gf-inp-num-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  width: 100%;
}

.gf-inp-num {
  width: 100%;
  padding: 18px 44px 18px 22px;
  background: var(--white);
  border: 1.5px solid var(--cream-border);
  border-radius: var(--gf-radius);
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  font-feature-settings: 'tnum';
  transition: border-color var(--motion) var(--ease), box-shadow var(--motion) var(--ease);
  letter-spacing: -0.01em;
}
.gf-inp-num::-webkit-outer-spin-button,
.gf-inp-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gf-inp-num { -moz-appearance: textfield; }
.gf-inp-num:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08);
}
.gf-inp-num-unit {
  position: absolute;
  right: 18px;
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text-light);
  pointer-events: none;
  font-weight: 500;
}

.gf-inp-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 520px) {
  .gf-inp-row { grid-template-columns: 1fr; }
  .gf-inp-num-wrap { max-width: 100%; }
}

/* Three-action rows */
.gf-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gf-action-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  transition: transform var(--motion) var(--ease);
}

.gf-action-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--red);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  display: grid;
  place-items: center;
  transition: all var(--motion) var(--ease-spring);
  border: 1.5px solid transparent;
}
.gf-action-row.filled .gf-action-num {
  background: var(--red);
  color: white;
  transform: scale(1.05);
}
.gf-action-row.focused .gf-action-num {
  border-color: var(--red);
  background: var(--white);
  color: var(--red);
}

.gf-action-input {
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--cream-border);
  border-radius: var(--gf-radius);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  transition: border-color var(--motion) var(--ease), box-shadow var(--motion) var(--ease);
  line-height: 1.5;
  resize: none;
  min-height: 52px;
  width: 100%;
}
.gf-action-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

/* Flag card */
.gf-flag {
  background: var(--amber-pale);
  border: 1px solid var(--amber-border);
  border-radius: var(--gf-radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.gf-flag-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--amber);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.gf-flag-text { color: var(--text-mid); line-height: 1.45; }
.gf-flag-meta { font-size: 11px; color: var(--text-light); margin-top: 4px; font-family: var(--font-mono); }

/* ============ Footer ============ */

.gf-footer {
  position: relative;
  z-index: 5;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--cream) 30%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gf-nav-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--cream-border);
  color: var(--text-mid);
  display: grid;
  place-items: center;
  transition: all var(--motion) var(--ease);
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
}
.gf-nav-btn:hover:not(:disabled) {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.gf-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gf-nav-btn.primary {
  background: var(--red);
  color: white;
  border-color: var(--red);
  width: auto;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 14px rgba(200, 16, 46, 0.25);
}
.gf-nav-btn.primary:hover:not(:disabled) {
  background: var(--red-dark);
  color: white;
  box-shadow: 0 8px 22px rgba(200, 16, 46, 0.35);
}
.gf-nav-btn.primary .gf-arrow { transition: transform var(--motion) var(--ease); }
.gf-nav-btn.primary:hover .gf-arrow { transform: translateX(3px); }

.gf-skip-review {
  height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--cream-border);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--motion) var(--ease);
  margin-left: auto;
  margin-right: 8px;
  position: relative;
  z-index: 6;
}
.gf-skip-review:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.gf-skip-review[hidden] { display: none; }
.gf-skip-review .gf-arrow { transition: transform var(--motion) var(--ease); }
.gf-skip-review:hover .gf-arrow { transform: translateX(3px); }

@media (max-width: 720px) {
  .gf-skip-review { padding: 0 12px; font-size: 12px; }
}

.gf-footer-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  min-width: 0;
  max-width: calc(100% - 200px);
}

.gf-kbd-hint {
  font-size: 11px;
  color: var(--text-light);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  opacity: 0.75;
  white-space: nowrap;
}
.gf-kbd-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--cream-border);
  border-radius: 4px;
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  margin: 0 1px;
}

@media (max-width: 720px), (hover: none) {
  .gf-kbd-hint { display: none; }
}

.gf-autosave {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-light);
  font-family: var(--font-mono);
}

.gf-autosave-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-pale);
  transition: background 200ms, box-shadow 200ms;
}
.gf-autosave.saving .gf-autosave-dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-pale); animation: gfPulseSoft 1s infinite; }
.gf-autosave.error .gf-autosave-dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-pale); }
@keyframes gfPulseSoft { 50% { opacity: 0.4; } }

/* ============ Slide transitions ============ */

/* Enter (forward + back) and exit (forward + back) animations */
.gf-form[data-dir="vertical"] .gf-slide-enter { animation: gfSlideInUp var(--motion) var(--ease) both; }
.gf-form[data-dir="vertical"] .gf-slide-enter-back { animation: gfSlideInDown var(--motion) var(--ease) both; }
.gf-form[data-dir="vertical"] .gf-slide-exit { animation: gfSlideOutUp var(--motion) var(--ease) both; }
.gf-form[data-dir="vertical"] .gf-slide-exit-back { animation: gfSlideOutDown var(--motion) var(--ease) both; }

.gf-form[data-dir="horizontal"] .gf-slide-enter { animation: gfSlideInRight var(--motion) var(--ease) both; }
.gf-form[data-dir="horizontal"] .gf-slide-enter-back { animation: gfSlideInLeft var(--motion) var(--ease) both; }
.gf-form[data-dir="horizontal"] .gf-slide-exit { animation: gfSlideOutLeft var(--motion) var(--ease) both; }
.gf-form[data-dir="horizontal"] .gf-slide-exit-back { animation: gfSlideOutRight var(--motion) var(--ease) both; }

.gf-form[data-dir="fade"] .gf-slide-enter,
.gf-form[data-dir="fade"] .gf-slide-enter-back { animation: gfSlideInFade var(--motion) var(--ease) both; }
.gf-form[data-dir="fade"] .gf-slide-exit,
.gf-form[data-dir="fade"] .gf-slide-exit-back { animation: gfSlideOutFade var(--motion) var(--ease) both; }

@keyframes gfSlideInUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gfSlideInDown { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gfSlideOutUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-28px); } }
@keyframes gfSlideOutDown { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(28px); } }

@keyframes gfSlideInRight { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes gfSlideInLeft { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes gfSlideOutLeft { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-100%); } }
@keyframes gfSlideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }

@keyframes gfSlideInFade { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes gfSlideOutFade { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.03); } }

/* ============ Tweaks panel ============ */

.gf-tweaks-fab {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-mid);
  background: transparent;
  border: none;
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease), transform var(--motion) var(--ease);
  cursor: pointer;
}
.gf-tweaks-fab:hover { background: var(--cream-2); color: var(--text); transform: rotate(20deg); }

.gf-tweaks {
  position: fixed;
  right: 14px;
  top: calc(58px + var(--sat, env(safe-area-inset-top, 0px)));
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--gf-radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  z-index: 1000;
  min-width: 240px;
  display: none;
  font-family: var(--font-body);
}
.gf-tweaks.open { display: block; animation: gfSlideInUp 180ms var(--ease); }

.gf-tweaks-head {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text);
}

.gf-tweak-row { margin-bottom: 10px; }
.gf-tweak-row:last-child { margin-bottom: 0; }
.gf-tweak-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}

.gf-seg {
  display: flex;
  background: var(--cream-2);
  border-radius: var(--gf-radius-sm);
  padding: 3px;
  gap: 2px;
}
.gf-seg button {
  flex: 1;
  padding: 6px 8px;
  border: none;
  border-radius: 7px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  background: transparent;
  cursor: pointer;
  transition: all 180ms var(--ease);
}
.gf-seg button.on {
  background: var(--white);
  color: var(--red);
  box-shadow: var(--shadow-sm);
}

.gf-stagger > * {
  animation: gfRiseIn calc(var(--motion) * 1.2) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms + 80ms);
}
@keyframes gfRiseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gfShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.gf-shake { animation: gfShake 320ms ease; }

/* ============ Review ============ */

.gf-review {
  max-width: 640px;
  margin: 0 auto;
  padding: 30px 24px 80px;
}

.gf-review-head { margin-bottom: 24px; }
.gf-review-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.gf-review-title {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.gf-review-title em { font-style: italic; color: var(--red); }
.gf-review-sub { color: var(--text-mid); font-size: 14px; }

.gf-review-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.gf-review-item {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--gf-radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--motion) var(--ease);
  font-family: inherit;
  text-align: left;
  width: 100%;
  border-left-width: 1px;
}
.gf-review-item:hover {
  border-color: var(--red);
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.gf-review-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.gf-review-num.complete { background: var(--green-pale); color: var(--green); }
.gf-review-num.incomplete { background: var(--amber-pale); color: var(--amber); }

.gf-review-body { flex: 1; min-width: 0; }
.gf-review-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
}
.gf-review-sub-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 1px;
}
.gf-review-arrow { color: var(--text-light); }

.gf-submit-wrap {
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--gf-radius);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.gf-btn-submit {
  width: 100%;
  padding: 16px 28px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: var(--gf-radius-pill);
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  transition: all var(--motion) var(--ease);
  box-shadow: 0 6px 18px rgba(200, 16, 46, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}
.gf-btn-submit:hover:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(200, 16, 46, 0.36);
}
.gf-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.gf-review-warn {
  background: var(--amber-pale);
  border: 1px solid var(--amber-border);
  color: var(--amber);
  border-radius: var(--gf-radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

/* ============ Success ============ */

/* Wrap replaces the whole .gf-form grid on success so layout isn't coupled to
   the 4-row form shell. Fills the viewport and scrolls if needed. */
.gf-success-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
}

.gf-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 80px;
}

.gf-success-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
}
.gf-success-ring svg { position: absolute; inset: 0; }
.gf-success-check {
  stroke: var(--green);
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* Path has pathLength="100" so dash values are proportional to total length.
     Use ease-out rather than inherited spring easing, an overshoot on
     stroke-dashoffset drives it negative, which shifts the dash pattern and
     can leave the stroke partially drawn at rest. */
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: gfDrawCheck 600ms 300ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.gf-success-circle {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  /* The ring uses a fixed radius of 54 so the circumference is 2*pi*54 ~= 339.3;
     rounded to 340. Kept explicit rather than using pathLength for parity with
     existing motion timing. */
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: gfDrawRing 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.gf-success-bg { fill: var(--green-pale); }
@keyframes gfDrawCheck { to { stroke-dashoffset: 0; } }
@keyframes gfDrawRing { to { stroke-dashoffset: 0; } }

.gf-success-title {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.gf-success-title em { font-style: italic; color: var(--red); }

.gf-success-sub {
  font-size: 15px;
  color: var(--text-mid);
  max-width: 360px;
  margin-bottom: 24px;
  line-height: 1.55;
}

.gf-receipt {
  background: var(--white);
  border: 1px solid var(--cream-border);
  border-radius: var(--gf-radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-md);
  max-width: 360px;
  width: 100%;
  margin-bottom: 28px;
  text-align: left;
  position: relative;
}
.gf-receipt::before,
.gf-receipt::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 10px;
  background-image: radial-gradient(circle at 6px 6px, var(--cream) 4px, transparent 5px);
  background-size: 12px 12px;
  background-position: 0 -6px;
}
.gf-receipt::before { top: 0; }
.gf-receipt::after { bottom: 0; transform: scaleY(-1); }

.gf-receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--cream-border);
  gap: 16px;
}
.gf-receipt-row:last-child { border: 0; }
.gf-receipt-row .lbl {
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.gf-receipt-row .val { color: var(--text); font-weight: 600; font-feature-settings: 'tnum'; }
.gf-receipt-row .val.green { color: var(--green); }
.gf-receipt-row .val.red { color: var(--red); }

.gf-btn-outline {
  padding: 12px 22px;
  background: transparent;
  border: 1.5px solid var(--cream-border);
  border-radius: var(--gf-radius-pill);
  color: var(--text-mid);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--motion) var(--ease);
  cursor: pointer;
}
.gf-btn-outline:hover { border-color: var(--red); color: var(--red); }

/* ============ Responsive ============ */

@media (max-width: 520px) {
  .gf-topbar { padding: calc(12px + var(--sat, env(safe-area-inset-top, 0px))) 16px 0; }
  .gf-progress-wrap { padding: 12px 16px 6px; }
  .gf-slide { padding: 22px 18px 40px; }
  .gf-review { padding: 24px 18px 40px; }
  .gf-intro { padding: 32px 18px 60px; }
  .gf-intro-num { font-size: 100px; }
  .gf-intro-title { font-size: 28px; }
  .gf-q-title { font-size: 20px; }
  .gf-success-title { font-size: 30px; }
  .gf-review-title { font-size: 26px; }
  .gf-dcard-grid { grid-template-columns: repeat(2, 1fr); }
  .gf-footer { padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
  .gf-nav-btn { width: 44px; height: 44px; }
  .gf-brand-site { font-size: 14px; }
}

@media (min-width: 900px) {
  .gf-slide { max-width: 720px; padding-top: 40px; }
  .gf-intro { padding-top: 60px; padding-bottom: 100px; }
  .gf-intro-title { font-size: 44px; }
  .gf-q-title { font-size: 26px; }
  .gf-review-title { font-size: 40px; }
  /* Welcome stays compact + top-aligned on large screens (more content than a
     section intro, so it must not adopt the tall centred-intro spacing). */
  .gf-welcome { padding-top: 48px; padding-bottom: 56px; }
  .gf-welcome-title { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .gf-form *, .gf-form *::before, .gf-form *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Auth Screens (PIN, Login, Member Select) ===== */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: calc(24px + var(--sat, env(safe-area-inset-top, 0px))) 24px calc(24px + env(safe-area-inset-bottom));
}

.auth-logo-wrap {
  margin-bottom: 32px;
  text-align: center;
}

.auth-card {
  background: var(--white);
  border-radius: 14px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--grey-border);
  animation: fadeInUp 0.4s ease both;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.auth-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 28px;
}

.auth-divider {
  height: 1px;
  background: var(--grey-border);
  margin: 20px 0;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-light);
}

.auth-field { margin-bottom: 18px; }

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.auth-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}
.auth-input::placeholder { color: #bbb; }

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 8px;
}
.btn-ghost:hover { color: var(--text-mid); }

/* ===== PIN Entry ===== */

.pin-input-wrap {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.pin-digit {
  width: 56px;
  height: 64px;
  border: 2px solid var(--grey-border);
  border-radius: var(--radius-sm);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pin-digit:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.pin-error {
  background: var(--red-light);
  border: 1px solid var(--red-border);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* Member selection */
.member-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
  text-align: left;
}

.member-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.member-card:hover {
  border-color: var(--red);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.member-name { font-size: 15px; font-weight: 600; }
.member-role { font-size: 12px; color: var(--text-light); }

@media (max-width: 640px) {
  .pin-digit { width: 48px; height: 56px; font-size: 20px; }
  .auth-card { padding: 28px 20px; }
}

/* ── Status Screens (post-PIN) ── */
.status-screen {
  text-align: center;
  max-width: 400px;
  padding: 48px 24px;
}
.status-icon { font-size: 48px; margin-bottom: 16px; }
.status-title {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--text-dark);
  margin-bottom: 12px;
}
.status-message {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.6;
}
.status-complete .status-title { color: var(--green); }
.status-missed .status-title { color: var(--red); }
.status-locked .status-title { color: var(--text-mid); }

/* Structured action gate block */
.gf-ablock { position: relative; margin-top: 18px; border: 1.5px solid var(--amber-border); border-radius: var(--gf-radius);
  background: linear-gradient(180deg, var(--amber-pale), transparent 60%); padding: 16px; }
.gf-ablock.red { border-color: var(--red-border, #fecaca); background: linear-gradient(180deg, var(--red-pale), transparent 60%); }
.gf-ablock-head { font-family: var(--font-mono); font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; color: var(--amber); display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.gf-ablock.red .gf-ablock-head { color: var(--red); }
.gf-ablock-req { margin-left: auto; background: var(--amber); color: #fff; font-size: 9px; padding: 2px 7px; border-radius: 999px; letter-spacing: .06em; }
.gf-ablock.red .gf-ablock-req { background: var(--red); }
.gf-ablock-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; margin-top: 12px; }
@media (max-width: 520px) { .gf-ablock-row { grid-template-columns: 1fr; } }
.gf-action-owner { min-height: 0; }
.gf-action-date { margin-top: 8px; padding: 10px 12px; border: 1.5px solid var(--cream-border);
  border-radius: var(--gf-radius-sm); font-family: var(--font-body); font-size: 14px; width: 100%; }
.gf-when-row { display: flex; gap: 6px; flex-wrap: wrap; }
.gf-when-pill { padding: 6px 10px; background: var(--white); border: 1.5px solid var(--cream-border);
  border-radius: var(--gf-radius-pill); font-size: 12px; font-weight: 500; color: var(--text-mid); cursor: pointer; white-space: nowrap; }
.gf-when-pill.sel { background: var(--red); border-color: var(--red); color: #fff; }

/* Spinner used during coach check */
.gf-spin { display:inline-block; width:13px; height:13px; border:2px solid rgba(255,255,255,.4);
  border-top-color:#fff; border-radius:50%; animation: gfspin .7s linear infinite; vertical-align:-2px; }
@keyframes gfspin { to { transform: rotate(360deg); } }

/* AI coach bubble */
.gf-coach { margin-top:10px; display:flex; gap:8px; align-items:flex-start; }
.gf-coach-av { flex:none; width:24px; height:24px; border-radius:8px; background:var(--red); color:#fff;
  display:grid; place-items:center; font-size:12px; }
.gf-coach-body { flex:1; background:var(--white); border:1.5px solid var(--cream-border);
  border-radius:4px 12px 12px 12px; padding:9px 11px; box-shadow:var(--shadow-sm); }
.gf-coach-who { font-family:var(--font-mono); font-size:8px; font-weight:600; text-transform:uppercase;
  letter-spacing:.1em; color:var(--red); margin-bottom:4px; }
.gf-coach-text { font-size:12.5px; color:var(--text); line-height:1.45; }
.gf-coach-foot { margin-top:8px; }
.gf-coach-skip { font-size:12px; color:var(--text-light); text-decoration:underline; cursor:pointer; }

/* ── Replay screen (prior-week action follow-through) ── */
.gf-replay { max-width: 560px; margin: 0 auto; }
.gf-replay-title { font-family: var(--font-heading); font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.gf-replay-sub { color: var(--text-mid); font-size: 13px; margin-bottom: 20px; }
.gf-replay-row { border: 1.5px solid var(--cream-border); border-left-width: 1.5px; border-radius: var(--gf-radius); padding: 15px 16px; margin-bottom: 12px; background: var(--white); transition: border-color .2s, background .2s; }
.gf-replay-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.gf-replay-overdue { color: var(--red); font-weight: 600; margin-left: 6px; }
.gf-replay-what { font-size: 15px; font-weight: 500; margin-bottom: 14px; line-height: 1.4; }

/* Choice buttons */
.gf-replay-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.gf-replay-btn { flex: 1 1 30%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 8px; border-radius: var(--gf-radius-sm); border: 1.5px solid var(--cream-border); background: var(--white); font-size: 13px; font-weight: 600; color: var(--text-mid); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.gf-replay-btn:hover { border-color: var(--text-light); }
.gf-replay-btn.done:hover { border-color: var(--green); color: var(--green); }
.gf-replay-btn.carry:hover { border-color: var(--amber); color: var(--amber); }
.gf-replay-btn.drop:hover { border-color: var(--red); color: var(--red); }
.gf-replay-btn.carry.chosen { background: var(--amber-pale); border-color: var(--amber); color: var(--amber); }
.gf-replay-btn.drop.chosen { background: var(--red-pale); border-color: var(--red); color: var(--red); }

/* Reason capture (carry / drop) — shown only while the row is collecting a reason */
.gf-replay-reason { display: none; margin-top: 12px; flex-direction: column; gap: 8px; }
.gf-replay-row[data-state="reason"] .gf-replay-reason { display: flex; }
.gf-replay-reason-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.gf-replay-reason-input { width: 100%; border: 1.5px solid var(--cream-border); border-radius: var(--gf-radius-sm); padding: 9px 11px; font-size: 13.5px; font-family: var(--font-body); resize: vertical; line-height: 1.4; box-sizing: border-box; }
.gf-replay-reason-input:focus { outline: none; border-color: var(--red); }
.gf-replay-reason-btns { display: flex; gap: 8px; justify-content: flex-end; }
.gf-replay-reason-cancel, .gf-replay-reason-confirm { padding: 8px 16px; border-radius: var(--gf-radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-body); border: 1.5px solid var(--cream-border); }
.gf-replay-reason-cancel { background: var(--white); color: var(--text-mid); }
.gf-replay-reason-confirm { background: var(--red); color: #fff; border-color: var(--red); }

/* Resolved bar — replaces the choices once a decision is made */
.gf-replay-resolved { display: none; }
.gf-replay-row[data-state="resolved"] .gf-replay-resolved { display: block; }
.gf-replay-row[data-state="resolved"] .gf-replay-choices,
.gf-replay-row[data-state="resolved"] .gf-replay-reason { display: none; }
.gf-replay-row[data-state="resolved"] { background: var(--cream); }
.gf-replay-row[data-resolution="done"]    { background: var(--green-pale); border-color: var(--green-border); }
.gf-replay-row[data-resolution="carried"] { background: var(--amber-pale); border-color: var(--amber-border); }
.gf-replay-row[data-resolution="dropped"] { background: var(--red-pale);   border-color: var(--red-border); }
.gf-replay-resolved-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gf-replay-resolved-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; }
.gf-replay-row[data-resolution="done"]    .gf-replay-resolved-tag { color: var(--green); }
.gf-replay-row[data-resolution="carried"] .gf-replay-resolved-tag { color: var(--amber); }
.gf-replay-row[data-resolution="dropped"] .gf-replay-resolved-tag { color: var(--red); }
.gf-replay-resolved-change { background: none; border: none; color: var(--text-light); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--font-body); text-decoration: underline; padding: 2px 4px; }
.gf-replay-resolved-change:hover { color: var(--text); }
.gf-replay-resolved-note { font-size: 13px; color: var(--text-mid); line-height: 1.45; margin-top: 6px; }

.gf-replay-progress { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-light); margin-top: 6px; font-family: var(--font-mono); letter-spacing: .03em; }
.gf-replay-progress.complete { color: var(--green); }
.gf-replay-footer { margin-top: 16px; text-align: center; }
.gf-replay-start { background: var(--red); color: #fff; border: none; border-radius: var(--gf-radius-sm); padding: 13px 28px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: opacity .2s; }
.gf-replay-start:disabled { opacity: .4; cursor: not-allowed; }

/* ============ Gated (red/amber) two-column layout ============ */
/* Wide screens: question title spans the top, metric + "what happened" on the
   left, the structured action on the right, everything visible, no scroll.
   The capture/gate logic is unchanged (keys off data-attributes). */
.gf-slide.gf-gated { max-width: 1080px; }
/* metric card spans the top — kept compact so the cards + coach fit the fold */
.gf-slide.gf-gated .gf-dcard { padding: 12px 16px; margin-bottom: 14px; }
.gf-slide.gf-gated .gf-dcard-head { margin-bottom: 8px; }
.gf-slide.gf-gated .gf-dcard .gf-dcell-value { font-size: 20px; }
.gf-gated-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;           /* both cards share the same height, bottoms align */
}
.gf-gated-left, .gf-gated-right { display: flex; flex-direction: column; min-width: 0; }

/* Left = "Your commentary" card, mirroring the "Your action" card on the right. */
.gf-comment-card {
  border: 1.5px solid var(--cream-border);
  background: var(--white);
  border-radius: var(--gf-radius);
  padding: 16px;
}
.gf-card-head-comment {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-mid);
  display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
}
.gf-comment-card .gf-inp { flex: 1 1 auto; min-height: 92px; }    /* fills the card to match the action card height */
.gf-gated-right .gf-ablock { margin-top: 0; flex: 1 1 auto; }     /* action card fills its column */
.gf-gated-right .gf-ablock [data-action-what] { min-height: 70px; }

/* Trim vertical spacing on gated slides so the cards + coach fit the fold. */
.gf-slide.gf-gated { padding-top: 18px; }
.gf-slide.gf-gated .gf-q-title { margin-bottom: 14px; }

/* Coach nudge: an anchored popover pointing at the action box (positioned by JS).
   Floats over the layout, so card height never clips it. */
.gf-action-flagged { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(200,16,46,.10) !important; }
.gf-coach-pop {
  position: absolute; left: 14px; right: 14px; z-index: 30;
  background: var(--white); border: 1.5px solid var(--cream-border); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(60,50,30,.20); padding: 13px 14px;
  animation: gfPopIn 160ms var(--ease, ease) both;
}
@keyframes gfPopIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.gf-coach-pop-arrow {
  position: absolute; top: -7px; left: 22px; width: 13px; height: 13px;
  background: var(--white); border-left: 1.5px solid var(--cream-border); border-top: 1.5px solid var(--cream-border);
  transform: rotate(45deg);
}
.gf-coach-pop-head { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.gf-coach-pop-av { width: 22px; height: 22px; border-radius: 7px; background: var(--red); color: #fff;
  display: grid; place-items: center; font-size: 12px; }
.gf-coach-pop-who { font-family: var(--font-mono); font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--red); }
.gf-coach-pop-text { font-size: 13px; line-height: 1.45; color: var(--text); margin-bottom: 12px; }
.gf-coach-pop-btns { display: flex; gap: 8px; justify-content: flex-end; }
.gf-coach-pop-skip, .gf-coach-pop-revise {
  height: 34px; padding: 0 14px; border-radius: 10px; font-family: var(--font-body);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.gf-coach-pop-skip { background: var(--white); border: 1.5px solid var(--cream-border); color: var(--text-mid); }
.gf-coach-pop-revise { background: var(--red); border: 1.5px solid var(--red); color: #fff;
  box-shadow: 0 4px 12px rgba(200,16,46,.22); }

/* Coach — centred modal (settings option). */
.gf-coach-modal-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(26,22,16,.34); padding: 20px; opacity: 0; transition: opacity 180ms var(--ease, ease); }
.gf-coach-modal-overlay.visible { opacity: 1; }
.gf-coach-modal { width: 430px; max-width: 92%; background: var(--white); border: 1px solid var(--cream-border);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(40,30,15,.34); padding: 22px 22px 18px;
  transform: translateY(8px) scale(.98); transition: transform 220ms var(--ease-spring, ease); }
.gf-coach-modal-overlay.visible .gf-coach-modal { transform: none; }
.gf-coach-modal-top { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.gf-coach-modal-av { flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--red), var(--red-dark, #a00d24)); color: #fff;
  display: grid; place-items: center; font-size: 17px; }
.gf-coach-modal-who { font-family: var(--font-mono); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--red); }
.gf-coach-modal-sub { font-size: 11px; color: var(--text-light); }
.gf-coach-modal-text { font-size: 15px; line-height: 1.5; color: var(--text); margin-bottom: 18px; }
.gf-coach-modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.gf-coach-modal-skip, .gf-coach-modal-revise { height: 40px; padding: 0 16px; border-radius: 11px;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.gf-coach-modal-skip { background: var(--white); border: 1.5px solid var(--cream-border); color: var(--text-mid); }
.gf-coach-modal-revise { background: var(--red); border: 1.5px solid var(--red); color: #fff; box-shadow: 0 4px 12px rgba(200,16,46,.22); }

/* Narrow screens / phones: fold back to one column and compact it so it fits
   without the long scroll (slim the metric card, shorter narrative). */
@media (max-width: 820px) {
  .gf-slide.gf-gated { max-width: 640px; }
  .gf-gated-cols { grid-template-columns: 1fr; gap: 0; }
  .gf-gated-right { margin-top: 16px; }
  .gf-gated-left .gf-inp { min-height: 84px; }
  /* compact the metric card on gated mobile slides: one tight row, no sub-text,
     so the action stays near the fold instead of being pushed way down */
  .gf-slide.gf-gated .gf-dcard { padding: 10px 13px; margin-bottom: 12px; }
  .gf-slide.gf-gated .gf-dcard-head { margin-bottom: 8px; }
  .gf-slide.gf-gated .gf-dcard-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .gf-slide.gf-gated .gf-dcard-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .gf-slide.gf-gated .gf-dcell-value { font-size: 17px; }
  .gf-slide.gf-gated .gf-dcell-sub { display: none; }
  .gf-slide.gf-gated .gf-q-title { font-size: 20px; margin-bottom: 14px; }
}

/* ── Optional rota step (last slide before Review) ──────────────────────────
   Deliberately quiet: a single outline button, no dashed drop-zone theatre.
   It is optional, and a screen that looks like it is demanding something is
   the wrong signal at the end of a twenty-minute form. */
.gf-rota-drop {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 18px; border: 1.5px solid var(--cream-border); border-radius: 14px;
  background: var(--white); margin-bottom: 14px;
}
.gf-rota-name {
  flex: 1 1 160px; min-width: 0; font-size: 13.5px; color: var(--text-mid);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gf-rota-msg { font-size: 13.5px; line-height: 1.5; color: var(--text-mid); min-height: 20px; }
.gf-rota-msg.ok { color: var(--green); font-weight: 600; }
.gf-rota-msg.bad { color: var(--red); }
