/* ============================================================
   MILK. × The Udder Way Waste Calculator — Styles
   iPad-optimised (1024×768 landscape primary, 1366×1024 Pro)
   MILK. brand leads; TUW appears subtly.
   No hover states — touch-first interface.
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=PT+Serif:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Custom Properties (brand tokens) ──────────────────────── */
:root {
  /* MILK. brand palette */
  --ted-cream:         #eeedeb;   /* MILK. background */
  --ted-cream-dark:    #e0deda;   /* slightly darker for borders/cards */
  --ted-cream-light:   #f4f3f1;   /* lightened for card backgrounds */
  --ted-black:         #111111;   /* MILK. text */
  --ted-black-mid:     #3a3632;   /* body text */
  --ted-gray:          #6b5f52;   /* MILK. muted */
  --ted-gray-light:    #a89e95;   /* captions/light labels */
  --ted-white:         #FFFFFF;
  --ted-green:         #c4b3a1;   /* MILK. accent (warm taupe) */
  --ted-border:        #d4cbc4;   /* divider/border tone on cream */

  /* TUW brand — appears only in footer/accents */
  --tuw-blush:         #F8E9E2;
  --tuw-mauve:         #B17095;
  --tuw-plum:          #664B4C;

  /* Typography — MILK. uses serif everywhere */
  --font-display:      'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-body:         'PT Serif', Georgia, 'Times New Roman', serif;

  /* Sizing — iPad 1024×768 landscape */
  --screen-w:          1024px;
  --screen-h:          768px;
  --spacing-xs:        8px;
  --spacing-sm:        16px;
  --spacing-md:        24px;
  --spacing-lg:        40px;
  --spacing-xl:        64px;

  /* Touch targets */
  --tap-min:           60px;

  /* Transitions */
  --transition-screen: 380ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:   180ms ease;
  --transition-med:    260ms ease;

  /* Shadows */
  --shadow-card:       0 2px 16px rgba(26, 23, 20, 0.10);
  --shadow-card-lg:    0 8px 40px rgba(26, 23, 20, 0.14);
  --shadow-btn:        0 2px 8px rgba(26, 23, 20, 0.20);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ted-cream);
  color: var(--ted-black);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  user-select: none;
}

/* ── App Shell ──────────────────────────────────────────────── */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ted-cream);
  /* Force a stacking context + GPU layer so absolute children
     are always contained correctly on iOS Safari */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* ── Screen System ──────────────────────────────────────────── */
/* All screens are in the layout but hidden by default.         */
/* visibility: hidden keeps layout but blocks interaction/paint. */
/* Use inset (top/right/bottom/left: 0) rather than width/height
   100% — more robust on iOS Safari for absolutely-positioned
   flex containers inside overflow:hidden parents. */
.screen {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  background: var(--ted-cream);
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
}

/* Active screen: fully visible, interactive */
.screen.screen--active {
  visibility: visible;
  pointer-events: all;
  z-index: 1;
  animation: screenSlideIn 360ms ease forwards;
}

/* Skip animation on first load */
.screen.screen--active.screen--instant {
  animation: none;
}

/* Exiting screen: stays visible while animating out */
.screen.screen--exiting {
  visibility: visible;
  pointer-events: none;
  z-index: 2;   /* above active so it fades over it */
  animation: screenFadeOut 280ms ease forwards;
}

/* Back-direction entry */
.screen.screen--active.screen--back {
  animation: screenSlideInBack 360ms ease forwards;
}

@keyframes screenSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes screenSlideInBack {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes screenFadeOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-24px); }
}

/* ── Screen Layout Regions ──────────────────────────────────── */
.screen__top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-lg);
  min-height: 80px;       /* accommodate the boxed TUW logo at co-equal size */
  flex-shrink: 0;
}

.screen__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-xl);
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen__main--left {
  align-items: flex-start;
  text-align: left;
}

.screen__main--scroll {
  justify-content: flex-start;
  padding-top: var(--spacing-md);
}

.screen__footer {
  flex-shrink: 0;
  padding: var(--spacing-sm) var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
}

/* ── Logo ───────────────────────────────────────────────────── */
.ted-wordmark {
  display: block;
  height: 20px;
  width: auto;
  fill: var(--ted-black);
  color: var(--ted-black);
}

.ted-wordmark--large {
  height: 28px;
}

.ted-wordmark--xl {
  height: 36px;
}

.ted-icon {
  display: block;
  height: 48px;
  width: auto;
  color: var(--ted-black);
}

.tuw-logo {
  display: block;
  height: 24px;
  width: auto;
  opacity: 0.6;
}

/* ── Typography ─────────────────────────────────────────────── */
.display-heading {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.5px;
  color: var(--ted-black);
  margin-bottom: var(--spacing-md);
}

.display-heading--lg {
  font-size: 62px;
}

.display-heading--sm {
  font-size: 38px;
}

.subhead {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 300;
  color: var(--ted-gray);
  margin-bottom: var(--spacing-lg);
  letter-spacing: 0.2px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ted-gray-light);
  margin-bottom: var(--spacing-xs);
}

.footer-text { color: #3a3632; font-size: 12px; opacity: 0.85; }

.caption {
  font-size: 12px;
  color: var(--ted-gray-light);
  margin-top: 6px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0 var(--spacing-lg);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.3px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), opacity var(--transition-fast);
  -webkit-appearance: none;
  white-space: nowrap;
}

.btn:active {
  opacity: 0.75;
  transform: scale(0.98);
}

.btn--primary {
  background: var(--ted-black);
  color: var(--ted-white);
  box-shadow: var(--shadow-btn);
}

.btn--secondary {
  background: transparent;
  color: var(--ted-black);
  border: 1.5px solid var(--ted-black);
}

.btn--ghost {
  background: transparent;
  color: var(--ted-gray);
  border: 1.5px solid var(--ted-cream-dark);
}

.btn--large {
  min-height: 72px;
  font-size: 18px;
  padding: 0 var(--spacing-xl);
  border-radius: 6px;
  letter-spacing: 0.4px;
}

.btn--xl {
  min-height: 80px;
  font-size: 20px;
  padding: 0 64px;
  border-radius: 8px;
}

.btn--full {
  width: 100%;
}

.btn--back {
  background: transparent;
  color: var(--ted-gray);
  font-size: 15px;
  padding: 0;
  min-height: var(--tap-min);
  gap: 8px;
}

.btn--text { background: transparent; border: none; color: #111111; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 8px 16px; font-family: var(--font-body); font-size: 14px; }

/* ── Welcome Screen ─────────────────────────────────────────── */
.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 680px;
  gap: var(--spacing-md);
  padding-top: 80px;
}

.welcome-icon-wrap {
  margin-bottom: var(--spacing-sm);
}

/* ── Search / Lookup Screen ─────────────────────────────────── */
.lookup-content {
  width: 100%;
  max-width: 640px;
}

.search-wrap {
  position: relative;
  margin-bottom: var(--spacing-sm);
}

.search-input {
  width: 100%;
  height: 72px;
  padding: 0 var(--spacing-lg);
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 300;
  color: var(--ted-black);
  background: var(--ted-white);
  border: 2px solid var(--ted-cream-dark);
  border-radius: 6px;
  outline: none;
  transition: border-color var(--transition-fast);
  -webkit-appearance: none;
}

.search-input:focus {
  border-color: var(--ted-black);
}

.search-input::placeholder {
  color: var(--ted-gray-light);
}

.suggestions-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--ted-white);
  border: 1.5px solid var(--ted-cream-dark);
  border-radius: 6px;
  box-shadow: var(--shadow-card-lg);
  overflow: hidden;
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: var(--tap-min);
  justify-content: center;
  cursor: pointer;
  border-bottom: 1px solid var(--ted-cream-dark);
  transition: background var(--transition-fast);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:active {
  background: var(--ted-cream);
}

.suggestion-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--ted-black);
}

.suggestion-address {
  font-size: 13px;
  color: var(--ted-gray);
  margin-top: 2px;
}

/* Place confirmation card */
.place-card {
  background: var(--ted-white);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-top: var(--spacing-md);
  display: flex;
  gap: 0;
}

.place-card__photo {
  width: 180px;
  height: 160px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ted-cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ted-gray-light);
  font-size: 40px;
}

.place-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.place-card__info {
  flex: 1;
  padding: var(--spacing-md);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.place-card__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 4px;
}

.place-card__address {
  font-size: 14px;
  color: var(--ted-gray);
  margin-bottom: 4px;
}

.place-card__type {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ted-gray-light);
  margin-bottom: var(--spacing-sm);
}

.place-card__actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* Manual entry form */
.manual-form {
  background: var(--ted-white);
  border-radius: 12px;
  padding: var(--spacing-md);
  box-shadow: var(--shadow-card);
  margin-top: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #3a3632;            /* solid body color, not muted */
}

.form-input,
.form-select {
  width: 100%;
  height: 56px;
  padding: 0 var(--spacing-sm);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ted-black);
  background: var(--ted-cream-light);
  border: 1.5px solid var(--ted-cream-dark);
  border-radius: 6px;
  outline: none;
  transition: border-color var(--transition-fast);
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--ted-black);
  background: var(--ted-white);
}

.form-input::placeholder {
  color: #6b5f52;            /* MILK. muted, not the lighter --ted-gray-light */
  opacity: 1;                /* override Firefox default */
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm);
}

/* ── Volume Screen ───────────────────────────────────────────── */
.volume-content {
  width: 100%;
  max-width: 680px;
}

.mode-toggle {
  display: flex;
  background: var(--ted-cream-dark);
  border-radius: 40px;
  padding: 4px;
  margin-bottom: var(--spacing-lg);
  width: fit-content;
}

.mode-btn {
  flex: 1;
  min-height: 52px;
  padding: 0 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ted-gray);
  background: transparent;
  border: none;
  border-radius: 36px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.mode-btn.mode-btn--active {
  background: var(--ted-white);
  color: var(--ted-black);
  box-shadow: 0 1px 6px rgba(26,23,20,0.12);
}

.slider-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  width: 100%;
}

.slider-value-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: var(--spacing-xs);
}

.slider-number {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 400;
  color: var(--ted-black);
  line-height: 1;
  min-width: 3ch;
  text-align: center;
}

.slider-unit {
  font-size: 18px;
  font-weight: 300;
  color: var(--ted-gray);
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--ted-cream-dark);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ted-black);
  box-shadow: 0 2px 8px rgba(26,23,20,0.25);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ted-black);
  border: none;
  box-shadow: 0 2px 8px rgba(26,23,20,0.25);
  cursor: pointer;
}

.volume-context {
  font-size: 16px;
  color: var(--ted-gray);
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--ted-white);
  border-radius: 40px;
  border: 1px solid var(--ted-cream-dark);
}

.volume-context strong {
  color: var(--ted-black);
  font-weight: 600;
}

/* ── Reveal Screen ───────────────────────────────────────────── */
.reveal-screen {
  background: var(--ted-cream);
  color: var(--ted-black);
}

.reveal-screen .screen__footer .footer-text {
  color: var(--ted-gray);
}

.reveal-content {
  width: 100%;
  max-width: 1000px;
}

.reveal-heading {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--ted-black);
  margin-bottom: var(--spacing-md);
  font-style: italic;
  text-align: center;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.metric-card {
  background: var(--ted-cream-light);
  border: 1px solid rgba(26, 23, 20, 0.08);
  border-radius: 12px;
  padding: var(--spacing-md) var(--spacing-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Headline savings card — MILK. accent taupe with dark text */
.metric-card--hero {
  background: var(--ted-green);   /* MILK. accent #c4b3a1 */
  border-color: var(--ted-green);
}
.metric-card--hero .metric-value { color: #FFFFFF !important; }
.metric-card--hero .metric-label { color: #FFFFFF !important; opacity: 1 !important; font-weight: 600 !important; }
.metric-card--hero .metric-note  { color: #FFFFFF !important; opacity: 1 !important; font-weight: 600 !important; font-size: 12px !important; letter-spacing: 0.3px; }

.metric-value {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  color: var(--ted-black);
  line-height: 1;
  margin-bottom: 4px;
}

.metric-value--lg {
  font-size: 48px;
}

/* Currency symbol now prepended in JS formatter (calculator.js formatCurrency / animateRevealCounters)
   The --gbp / --aud modifier classes are kept for potential future styling use.
   Do NOT add ::before content here — it would double the symbol. */

.metric-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ted-gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-note {
  font-size: 12px;
  font-weight: 500;
  color: var(--ted-black);
  opacity: 0.78;
  margin-top: 4px;
  letter-spacing: 0.2px;
}

/* Equivalents row */
.equivalents-row {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

.equiv-pill {
  background: rgba(196, 179, 161, 0.32);   /* stronger MILK. accent tint, reads as a container */
  border: 1px solid rgba(196, 179, 161, 0.45);
  border-radius: 40px;
  padding: 10px 20px;
  font-size: 14px;
  color: #111111 !important;                /* solid black on cream */
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.equiv-pill,
.equiv-pill * {
  color: #111111 !important;
}

.equiv-pill strong { color: var(--ted-black); font-weight: 700; }
.equiv-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ted-green);   /* heritage green accent */
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.equiv-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Capture Screen ──────────────────────────────────────────── */
.capture-content {
  width: 100%;
  max-width: 680px;
}

.prefill-badge {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--ted-cream-light);
  border: 1px solid var(--ted-cream-dark);
  border-radius: 8px;
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  text-align: left;
}

.prefill-badge__text {
  font-size: 14px;
  color: var(--ted-gray);
}

.prefill-badge__name {
  font-weight: 600;
  color: var(--ted-black);
}

/* ── Thank You Screen ────────────────────────────────────────── */
.thankyou-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  gap: var(--spacing-md);
}

.thankyou-check {
  width: 80px;
  height: 80px;
  background: var(--ted-green);   /* MILK. accent */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--ted-black);   /* dark on taupe for contrast */
  margin-bottom: var(--spacing-sm);
}

.thankyou-heading {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
  line-height: 1.15;
}

.thankyou-subhead {
  font-size: 18px;
  color: var(--ted-gray);
  margin-bottom: var(--spacing-md);
}

.newsletter-card {
  background: var(--ted-white);
  border-radius: 12px;
  padding: var(--spacing-md);
  box-shadow: var(--shadow-card);
  text-align: center;
  width: 100%;
  max-width: 480px;
}

.newsletter-card__title {
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 8px;
}

.newsletter-card__body {
  font-size: 14px;
  color: var(--ted-gray);
  margin-bottom: var(--spacing-sm);
}

.countdown-bar-wrap {
  width: 200px;
  height: 3px;
  background: var(--ted-cream-dark);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--spacing-sm);
}

.countdown-bar {
  height: 100%;
  background: var(--ted-gray-light);
  border-radius: 2px;
  transition: width 1s linear;
}

.countdown-text {
  font-size: 12px;
  color: var(--ted-gray-light);
  margin-top: 8px;
}

/* ── Loading / Spinner ───────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--ted-cream-dark);
  border-top-color: var(--ted-black);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--ted-gray);
  font-size: 14px;
  margin-top: var(--spacing-sm);
}

/* ── Utility ─────────────────────────────────────────────────── */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

.divider {
  width: 40px;
  height: 1px;
  background: var(--ted-cream-dark);
  margin: var(--spacing-sm) auto;
}

.divider--light {
  background: rgba(255,255,255,0.15);
}

/* TUW powered-by footer logo wrap */
.tuw-powered {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tuw-powered .footer-text {
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* ── iPad Pro 1366×1024 ──────────────────────────────────────── */
@media (min-width: 1200px) {
  .display-heading         { font-size: 64px; }
  .display-heading--lg     { font-size: 76px; }
  .metrics-grid            { gap: var(--spacing-md); }
  .metric-value            { font-size: 48px; }
  .metric-value--lg        { font-size: 58px; }
  .slider-number           { font-size: 88px; }
}

/* ── Safeguards for small screens (landscape phone etc) ──────── */
@media (max-width: 800px) {
  .display-heading         { font-size: 36px; }
  .metrics-grid            { grid-template-columns: repeat(2, 1fr); }
  .form-row                { grid-template-columns: 1fr; }
  .screen__main            { padding: var(--spacing-sm) var(--spacing-md); }
}

/* ── Albus AI Card ──────────────────────────────────────────── */

.albus-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--ted-cream-light);
  border: 1px solid rgba(58, 90, 64, 0.18);
  border-radius: 14px;
  padding: var(--spacing-sm) var(--spacing-md);
  box-shadow: 0 2px 14px rgba(26, 23, 20, 0.07);
  margin-top: var(--spacing-md);
  cursor: default;
  transition: opacity var(--transition-med);
  animation: albusCardIn 0.35s ease forwards;
}

@keyframes albusCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hidden: use this class instead of .hidden so transitions still work */
.albus-card--hidden {
  display: none !important;
}

/* Variant for the reveal screen — slightly wider feel */
.albus-card--reveal {
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.albus-card__avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  margin-top: 2px;
}

.albus-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
}

.albus-card__body {
  flex: 1;
  min-width: 0;
}

.albus-card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ted-green);
  margin-bottom: 7px;
}

.albus-card__text {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  font-style: italic;
  color: var(--ted-black);
  line-height: 1.6;
  min-height: 1.6em; /* prevent layout collapse while loading */
}

/* Blinking cursor while typing */
.albus-card__text--typing::after {
  content: '\25AE'; /* ▮ block cursor */
  font-size: 13px;
  font-style: normal;
  color: var(--ted-green);
  animation: albusBlinkCursor 0.65s step-end infinite;
  vertical-align: 1px;
  margin-left: 2px;
}

@keyframes albusBlinkCursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Subtle "tap to continue" hint shown after typing completes */
.albus-card__hint {
  font-size: 12px;
  color: var(--ted-gray-light);
  margin-top: 10px;
  animation: fadeInUp 0.4s ease forwards;
}

/* "Looking up X…" hint shown while Albus searches */
.albus-card__lookup-hint {
  font-size: 13px;
  color: var(--ted-gray);
  margin-top: 8px;
  font-style: italic;
}

.albus-lookup-name {
  font-style: normal;
  font-weight: 500;
  color: var(--ted-black);
}

/* ── Albus Typing Indicator (3 bouncing dots) ────────────────── */

.albus-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding-top: 4px;
}

.albus-typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ted-green);
  opacity: 0.55;
  animation: albusTypingBounce 1.2s ease-in-out infinite;
}

.albus-typing__dot:nth-child(2) { animation-delay: 0.20s; }
.albus-typing__dot:nth-child(3) { animation-delay: 0.40s; }

@keyframes albusTypingBounce {
  0%, 55%, 100% { transform: translateY(0);    opacity: 0.55; }
  27.5%          { transform: translateY(-7px); opacity: 1;    }
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.4s ease forwards;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.12s; }
.animate-in:nth-child(3) { animation-delay: 0.19s; }
.animate-in:nth-child(4) { animation-delay: 0.26s; }
.animate-in:nth-child(5) { animation-delay: 0.33s; }
.animate-in:nth-child(6) { animation-delay: 0.40s; }

/* Prevent FOUC for counter values */
[data-counter] {
  display: inline-block;
  min-width: 2ch;
}

/* ── Co-brand lockup (Estate Dairy × The Udder Way) ─────────── */
/* Treats both brands as equal partners in the header. */
.screen__top-bar--cobrand,
.screen__top-bar--cobrand-with-back {
  align-items: center;
}

.screen__top-bar--cobrand {
  justify-content: center;
  gap: var(--spacing-md);
}

.screen__top-bar--cobrand-with-back {
  justify-content: space-between;
}

.screen__top-bar--cobrand-with-back .brand-cobrand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.screen__top-bar--cobrand-with-back .back-spacer {
  /* keep brand-cobrand visually centred even with a back button on the left */
  display: inline-block;
  width: 80px;
}

.brand-mark {
  display: block;
  width: auto;
}

/* Co-brand sizing strategy:
   - Both marks aim for roughly equal optical mass around the × divider
   - TED is a thin horizontal wordmark; size it generously so the elegant serif
     reads at the same scale as TUW's compact square lockup
   - TUW is square; modest height keeps the boxed mark from dominating */
/* Sized so the letterforms (cap-height) match between the two marks.
   TED wordmark height includes generous padding above/below the letters;
   TUW letterforms fill the box more densely. */
.brand-mark--ted {
  height: 56px;
  max-width: 320px;
}

.brand-mark--milk {
  height: 56px;
  max-width: 220px;
}

.brand-mark--tuw {
  height: 56px;
  max-width: 60px;
}

.brand-mark--sm.brand-mark--ted  { height: 40px; max-width: 240px; }
.brand-mark--sm.brand-mark--milk { height: 40px; max-width: 160px; }
.brand-mark--sm.brand-mark--tuw  { height: 40px; max-width: 44px; }

.brand-cross {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--ted-gray-light);
  line-height: 1;
  user-select: none;
}

/* Reveal screen: keep cream-on-cream, but the cross is darker for contrast */
.reveal-screen .brand-cross { color: var(--ted-gray); }

/* ── Lookup form (Albus-driven) ─────────────────────────────── */
.lookup-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  width: 100%;
  max-width: 560px;
}

.lookup-form .form-group {
  width: 100%;
}

.form-input--lg {
  font-size: 22px;
  padding: 18px 20px;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

.label-optional { color: #6b5f52; font-style: italic; font-size: 12px; font-weight: 500; }

/* Albus lookup confirmation card (the magic moment) */
.albus-card--lookup {
  margin-top: var(--spacing-md);
  align-items: flex-start;
}

.lookup-card__found {
  background: var(--ted-cream);
  border: 1px solid var(--ted-border);
  border-radius: 8px;
  padding: var(--spacing-sm) var(--spacing-md);
  margin: var(--spacing-xs) 0 var(--spacing-sm) 0;
  width: 100%;
}

.lookup-card__type {
  font-size: 11px;
  font-weight: 500;
  color: var(--ted-gray);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

.lookup-card__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ted-black);
  line-height: 1.15;
  margin-bottom: 4px;
}

.lookup-card__address {
  font-size: 13px;
  color: var(--ted-gray);
  line-height: 1.4;
  margin-bottom: 6px;
}

.lookup-card__desc {
  font-size: 12px;
  color: var(--ted-gray);
  font-style: italic;
  margin-top: 4px;
}

.lookup-card__sustain {
  font-size: 12px;
  color: var(--ted-green);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--ted-border);
}

.lookup-card__sustain-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 10px;
  color: var(--ted-green);
  margin-right: 6px;
}

.lookup-card__actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  width: 100%;
}

.lookup-card__actions .btn {
  width: 100%;
  white-space: normal;
  line-height: 1.3;
  padding: 14px 20px;
}

.lookup-card__actions .btn--secondary {
  font-size: 14px;
  padding: 10px 16px;
}

/* ── Slider scale labels ────────────────────────────────────── */
.slider-scale {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 560px;
  margin: 6px auto 0;
  font-size: 11px;
  color: var(--ted-gray-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Volume manual-entry modal ─────────────────────────────── */
.volume-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 23, 20, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--spacing-md);
  animation: fadeIn 200ms ease forwards;
}

.volume-modal.hidden {
  display: none;
}

.volume-modal__panel {
  background: var(--ted-cream);
  border-radius: 12px;
  padding: var(--spacing-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-card-lg);
  animation: modalPop 240ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.volume-modal__heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--ted-black);
  margin-bottom: 6px;
}

.volume-modal__hint {
  font-size: 14px;
  color: var(--ted-gray);
  margin-bottom: var(--spacing-md);
}

.volume-modal__row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.volume-modal__row .form-input {
  flex: 1;
  text-align: right;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.01em;
}

.volume-modal__unit {
  font-size: 14px;
  color: var(--ted-gray);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.volume-modal__actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

.volume-modal__actions .btn {
  min-width: 120px;
}

/* === Hero card text — SHIP override at end-of-file to defeat any cascade conflicts === */
.metric-card--hero .metric-value,
.metric-card--hero .metric-label,
.metric-card--hero .metric-note {
  color: #FFFFFF !important;
  opacity: 1 !important;
}
.metric-card--hero .metric-label {
  font-weight: 700 !important;
}
.metric-card--hero .metric-note {
  font-weight: 600 !important;
  font-size: 12px !important;
}

/* ── Welcome screen with hero video background ───────────────── */
.screen--welcome-hero {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Full-bleed video behind everything */
.welcome-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Dim overlay so text is legible.
   Two stacked gradients: a vertical darkening top + bottom (so headline + footer
   read cleanly), plus a left-side darkener to suppress the café signage / props
   in the bottom-left of the MILK. delivery clip. */
.welcome-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(17, 17, 17, 0.65) 0%,
      rgba(17, 17, 17, 0.55) 25%,
      rgba(17, 17, 17, 0.40) 50%,
      rgba(17, 17, 17, 0.55) 75%,
      rgba(17, 17, 17, 0.80) 100%
    ),
    linear-gradient(
      90deg,
      rgba(17, 17, 17, 0.45) 0%,
      rgba(17, 17, 17, 0.10) 45%,
      rgba(17, 17, 17, 0.05) 100%
    );
  z-index: 1;
}

/* Layer the rest above */
.screen--welcome-hero .welcome-top,
.screen--welcome-hero .welcome-main,
.screen--welcome-hero .welcome-footer {
  position: relative;
  z-index: 2;
}

/* Brand marks: invert / lighten so they show against the dark video */
.welcome-brand-mark[alt="MILK."] {
  filter: brightness(0) invert(1);  /* render MILK. wordmark white */
}
.welcome-brand-mark[alt="The Udder Way"] {
  filter: brightness(0) invert(1);  /* same — white on dark */
}
.welcome-brand-cross {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Headline + subhead + CTA in white */
.welcome-headline {
  color: #FFFFFF !important;
  /* Layered shadows: tight halo for definition + soft glow for atmospheric lift */
  text-shadow:
    0 0 24px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(0, 0, 0, 0.35);
}
.welcome-subhead {
  color: #FFFFFF !important;
  text-shadow:
    0 0 16px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Primary CTA: cream bg with dark text — pops on the darkened video */
.welcome-cta {
  background: var(--ted-cream-light) !important;
  color: var(--ted-black) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
.welcome-cta:hover,
.welcome-cta:focus {
  background: #FFFFFF !important;
}

/* Footer text in white on dim */
.welcome-footer .footer-text {
  color: rgba(255, 255, 255, 0.85) !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  opacity: 1 !important;
}
