/* Recipe Garden — design tokens + base + components
   Adapted from the Recipe Garden design bundle (Conservatory theme). */

:root {
  /* Conservatory (dark) — default */
  --bg:        oklch(0.165 0.018 155);
  --bg-grad:   oklch(0.205 0.022 158);
  --surface:   oklch(0.215 0.022 155);
  --surface-2: oklch(0.255 0.024 155);
  --surface-3: oklch(0.305 0.025 155);
  --line:      oklch(0.34  0.022 155 / 0.6);
  --line-soft: oklch(0.34  0.022 155 / 0.28);
  --ink:       oklch(0.965 0.006 150);
  --ink-2:     oklch(0.82  0.012 150);
  --muted:     oklch(0.62  0.015 150);

  --chloro:      oklch(0.84 0.17 145);
  --chloro-dim:  oklch(0.55 0.13 145);
  --chloro-glow: oklch(0.84 0.17 145 / 0.45);
  --bloom:       oklch(0.78 0.14 35);
  --plum:        oklch(0.70 0.13 340);

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --shadow-card: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 12px 40px oklch(0 0 0 / 0.35);
  --shadow-pop:  0 1px 0 oklch(1 0 0 / 0.06) inset, 0 24px 60px oklch(0 0 0 / 0.45);

  --serif: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --sans:  "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--chloro); text-decoration: none; }
a:hover { color: var(--chloro-dim); }

/* ============ AMBIENT BACKDROP ============ */
.rg-backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--bg-grad), transparent 70%),
    radial-gradient(ellipse 60% 50% at 90% 100%, oklch(0.3 0.06 145 / 0.18), transparent 70%),
    radial-gradient(ellipse 60% 50% at 5% 80%, oklch(0.3 0.06 35 / 0.08), transparent 70%);
}
.rg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
  opacity: 0.5;
}

/* ============ LAYOUT SHELL ============ */
.rg-shell {
  position: relative; z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

/* ============ TOP BAR ============ */
.rg-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--surface) 80%, transparent),
    color-mix(in oklch, var(--surface-2) 70%, transparent));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  margin-bottom: 36px;
}
.rg-brand {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
}
.rg-brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 30%, var(--chloro), var(--chloro-dim));
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.1) inset, 0 0 18px var(--chloro-glow);
  flex-shrink: 0;
  color: oklch(0.16 0.04 155);
}
.rg-brand-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
}

.rg-search {
  position: relative;
  min-width: 0;
  max-width: 420px;
  justify-self: center;
  width: 100%;
}
.rg-search input {
  width: 100%;
  padding: 10px 38px 10px 38px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 50%, transparent);
  color: var(--ink);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rg-search input::placeholder { color: var(--muted); }
.rg-search input:focus {
  border-color: var(--chloro-dim);
  box-shadow: 0 0 0 3px var(--chloro-glow);
}
.rg-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.rg-search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px;
  white-space: nowrap;
}

.rg-actions { display: flex; align-items: center; gap: 10px; }
.rg-actions .rg-btn { white-space: nowrap; }

/* ============ BUTTONS ============ */
.rg-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  text-decoration: none;
}
.rg-btn:hover { background: var(--surface-3); border-color: var(--chloro-dim); color: var(--ink); }
.rg-btn-primary {
  background: linear-gradient(180deg, var(--chloro), var(--chloro-dim));
  color: oklch(0.12 0.04 155);
  border: 1px solid var(--chloro);
  font-weight: 600;
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.12) inset, 0 8px 28px var(--chloro-glow);
}
.rg-btn-primary:hover {
  transform: translateY(-1px);
  border-color: var(--chloro);
  color: oklch(0.12 0.04 155);
}
.rg-btn-ghost { background: transparent; }
.rg-btn-sm { padding: 6px 12px; font-size: 13px; }
.rg-btn-lg { padding: 12px 22px; font-size: 15px; }
.rg-btn-block { width: 100%; justify-content: center; }
.rg-btn-danger {
  background: color-mix(in oklch, var(--bloom) 18%, var(--surface-2));
  color: var(--bloom);
  border-color: color-mix(in oklch, var(--bloom) 40%, var(--line));
}
.rg-btn-danger:hover {
  background: color-mix(in oklch, var(--bloom) 30%, var(--surface-2));
  color: var(--bloom);
}

.rg-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--plum), var(--bloom));
  display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 16px; color: white;
  border: 1px solid var(--line);
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
}

/* ============ FLASH MESSAGES ============ */
.rg-flashes { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.rg-flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--chloro-dim);
  background: color-mix(in oklch, var(--chloro) 12%, var(--surface));
  color: var(--ink);
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.rg-flash::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--chloro);
  box-shadow: 0 0 12px var(--chloro);
  flex-shrink: 0;
}
.rg-flash-error {
  border-color: color-mix(in oklch, var(--bloom) 50%, var(--line));
  background: color-mix(in oklch, var(--bloom) 12%, var(--surface));
  color: var(--ink);
}
.rg-flash-error::before { background: var(--bloom); box-shadow: 0 0 12px var(--bloom); }

/* ============ PAGE HEADING ============ */
.rg-page-head { margin-bottom: 32px; }
.rg-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chloro);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rg-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--chloro);
  box-shadow: 0 0 12px var(--chloro);
  flex-shrink: 0;
}
.rg-title {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 12px;
}
.rg-title em { font-style: italic; color: var(--chloro); font-weight: 400; }
@media (max-width: 720px) { .rg-title { font-size: 44px; } }

.rg-subtitle {
  color: var(--muted);
  font-size: 15px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.rg-stat-divider { width: 1px; height: 14px; background: var(--line); }
.rg-stat { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.rg-stat-num { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); }
.rg-stat-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }

/* ============ CATEGORY BEDS ============ */
.rg-section { margin-bottom: 56px; }
.rg-section-head {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 20px;
  gap: 16px;
}
.rg-section-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  margin: 0;
  color: var(--ink);
  display: flex; align-items: baseline; gap: 12px;
  white-space: nowrap;
}
.rg-section-title-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  font-style: normal;
  white-space: nowrap;
}
.rg-section-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  display: inline-flex; gap: 8px; align-items: center;
  white-space: nowrap;
}
.rg-section-link:hover { color: var(--chloro); }

.rg-beds {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
@media (max-width: 1080px) { .rg-beds { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .rg-beds { grid-template-columns: repeat(2, 1fr); } }

.rg-bed {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.3s ease, border-color 0.3s;
  isolation: isolate;
  text-decoration: none;
  display: block;
}
.rg-bed:hover { transform: translateY(-3px); border-color: var(--chloro-dim); }
.rg-bed-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.05) brightness(0.85);
  transition: transform 0.6s ease, filter 0.3s;
}
.rg-bed:hover .rg-bed-img { transform: scale(1.05); filter: saturate(1.15) brightness(0.95); }
.rg-bed-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, oklch(0.12 0.02 155 / 0.65) 75%, oklch(0.1 0.02 155 / 0.92) 100%);
}
.rg-bed-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px 16px;
}
.rg-bed-tag {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: oklch(0.96 0.01 150);
  background: oklch(0 0 0 / 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid oklch(1 0 0 / 0.18);
  padding: 4px 8px;
  border-radius: 999px;
}
.rg-bed-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  color: white;
}
.rg-bed-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: oklch(0.85 0.01 150);
  margin-top: 6px;
  letter-spacing: 0.05em;
}
.rg-bed-empty {
  background: repeating-linear-gradient(135deg,
    var(--surface-2) 0 12px,
    var(--surface-3) 12px 24px);
}

/* ============ RECIPE GRID ============ */
.rg-grid-recipes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.rg-grid-recipes.compact { grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1080px) { .rg-grid-recipes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .rg-grid-recipes { grid-template-columns: 1fr; } }

.rg-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s;
  position: relative;
  isolation: isolate;
  text-decoration: none;
  color: inherit;
  display: block;
}
.rg-card:hover {
  transform: translateY(-3px);
  border-color: var(--chloro-dim);
  box-shadow: var(--shadow-pop);
  color: inherit;
}
.rg-card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-3);
}
.rg-card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s ease;
}
.rg-card:hover .rg-card-img-wrap img { transform: scale(1.04); }
.rg-card-cat {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: oklch(0.1 0.02 155 / 0.65);
  backdrop-filter: blur(8px);
  color: white;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid oklch(1 0 0 / 0.15);
}
.rg-card-body { padding: 18px 18px 20px; }
.rg-card-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
.rg-card-meta {
  display: flex; gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  flex-wrap: wrap;
}
.rg-card-meta span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

.rg-card-placeholder {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg,
      var(--surface-2) 0 12px,
      var(--surface-3) 12px 24px);
  display: grid; place-items: center;
  color: var(--muted);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase;
}

/* ============ EMPTY STATE ============ */
.rg-empty {
  text-align: center;
  padding: 60px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in oklch, var(--surface) 60%, transparent);
  color: var(--muted);
}
.rg-empty h3 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  color: var(--ink);
  margin: 0 0 8px;
  font-weight: 400;
}
.rg-empty p { margin: 0 0 18px; }

/* ============ DETAIL PAGE ============ */
.rg-detail {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
}
@media (max-width: 1080px) { .rg-detail { grid-template-columns: 1fr; } }

.rg-detail-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
}
.rg-detail-img-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 32px;
}

.rg-detail-img-btn {
  display: block;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.rg-detail-img-btn:focus-visible {
  outline: 2px solid var(--chloro);
  outline-offset: 3px;
}
.rg-detail-img-btn .rg-detail-img {
  display: block;
}

/* Action chip variant (e.g. regenerate cover) — clickable button */
button.rg-chip {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.5;
}
.rg-chip-action {
  border-color: var(--chloro-dim);
  color: var(--chloro);
  background: color-mix(in oklch, var(--chloro) 6%, var(--surface));
  transition: background 160ms ease, transform 120ms ease;
}
.rg-chip-action:hover {
  background: color-mix(in oklch, var(--chloro) 14%, var(--surface));
}
.rg-chip-action:active {
  transform: translateY(1px);
}

/* Lightbox */
.rg-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0 0 0 / 0.86);
  z-index: 1000;
  padding: 24px;
}
.rg-lightbox[hidden] { display: none; }
.rg-lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-pop);
  background: var(--surface);
}
.rg-lightbox-close,
.rg-lightbox-prev,
.rg-lightbox-next {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 80%, transparent);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease;
}
.rg-lightbox-close { top: 20px; right: 20px; font-size: 24px; }
.rg-lightbox-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.rg-lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.rg-lightbox-close:hover,
.rg-lightbox-prev:hover,
.rg-lightbox-next:hover {
  background: color-mix(in oklch, var(--chloro) 20%, var(--surface));
}
.rg-lightbox-prev[hidden],
.rg-lightbox-next[hidden] { display: none; }
@media (max-width: 600px) {
  .rg-lightbox-prev { left: 8px; }
  .rg-lightbox-next { right: 8px; }
  .rg-lightbox-close { top: 12px; right: 12px; }
}

.rg-detail-head { margin-bottom: 28px; }
.rg-detail-title {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}
.rg-detail-title em { font-style: italic; color: var(--chloro); }
@media (max-width: 720px) { .rg-detail-title { font-size: 40px; } }

.rg-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.rg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: color-mix(in oklch, var(--surface) 60%, transparent);
  white-space: nowrap;
}
.rg-chip-accent {
  border-color: var(--chloro-dim);
  color: var(--chloro);
  background: color-mix(in oklch, var(--chloro) 8%, var(--surface));
}
.rg-chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--chloro);
  box-shadow: 0 0 8px var(--chloro);
}

/* Field-guide ingredient list */
.rg-fieldguide {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: linear-gradient(180deg, var(--surface), color-mix(in oklch, var(--surface) 50%, transparent));
  margin-bottom: 24px;
}
.rg-fieldguide-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.rg-fieldguide-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
}
.rg-fieldguide-head span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.rg-ing-list { list-style: none; padding: 0; margin: 0; }
.rg-ing-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.rg-ing-item:last-child { border-bottom: none; }
.rg-ing-amount {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--chloro);
  text-align: right;
}
.rg-ing-name {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
}
.rg-ing-unit {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.rg-instructions {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
}
.rg-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.rg-step:last-child { border-bottom: none; }
.rg-step-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  color: var(--chloro);
  line-height: 1;
}
.rg-step-text { margin: 0; }

/* Sidebar specimen card */
.rg-specimen {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 24px;
}
.rg-specimen h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  display: flex; justify-content: space-between;
  font-weight: 500;
}
.rg-specimen-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  gap: 12px;
}
.rg-specimen-row:last-child { border-bottom: none; }
.rg-specimen-key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.rg-specimen-val {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  text-align: right;
  line-height: 1.2;
}
.rg-specimen-val small {
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0.1em;
}

/* ============ UPLOAD / GERMINATE ============ */
.rg-upload {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
}
@media (max-width: 1080px) { .rg-upload { grid-template-columns: 1fr; } }

.rg-chamber {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--bg));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px;
  min-height: 540px;
  overflow: hidden;
}
.rg-chamber-frame {
  position: absolute; inset: 12px;
  border-radius: calc(var(--radius-xl) - 8px);
  border: 1px dashed var(--line);
  pointer-events: none;
}
.rg-chamber-corner {
  position: absolute; width: 16px; height: 16px;
  border: 1px solid var(--chloro);
  opacity: 0.5;
}
.rg-chamber-corner.tl { top: 18px; left: 18px;  border-right: none;  border-bottom: none; }
.rg-chamber-corner.tr { top: 18px; right: 18px; border-left: none;   border-bottom: none; }
.rg-chamber-corner.bl { bottom: 18px; left: 18px;  border-right: none; border-top: none; }
.rg-chamber-corner.br { bottom: 18px; right: 18px; border-left: none;  border-top: none; }

.rg-chamber-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
  position: relative; z-index: 1;
}
.rg-chamber-head h3 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  margin: 0;
  font-weight: 400;
  white-space: nowrap;
}
.rg-chamber-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-2);
}
.rg-chamber-status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--chloro);
  box-shadow: 0 0 12px var(--chloro);
  animation: rg-pulse 2s ease-in-out infinite;
}
.rg-chamber-body { position: relative; z-index: 1; }

@keyframes rg-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.rg-dropzone {
  border: 1.5px dashed var(--chloro-dim);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  background: color-mix(in oklch, var(--chloro) 4%, transparent);
  cursor: pointer;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  min-height: 380px;
  display: grid; place-items: center;
}
.rg-dropzone:hover { background: color-mix(in oklch, var(--chloro) 8%, transparent); }
.rg-dropzone.is-dragover {
  background: color-mix(in oklch, var(--chloro) 14%, transparent);
  border-color: var(--chloro);
}
.rg-dropzone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}
.rg-dropzone-inner {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  pointer-events: none;
}
.rg-dropzone-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1px solid var(--chloro-dim);
  background: radial-gradient(circle at 50% 60%, var(--chloro-glow), transparent 70%);
  display: grid; place-items: center;
  color: var(--chloro);
  position: relative;
}
.rg-dropzone-icon::before {
  content: ""; position: absolute; inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--chloro-dim);
  opacity: 0.4;
  animation: rg-ripple 3s ease-out infinite;
}
@keyframes rg-ripple {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.5); opacity: 0; }
}
.rg-dropzone-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
  max-width: 360px;
}
.rg-dropzone-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.rg-loaded-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  text-align: left;
  pointer-events: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.06em;
}
.rg-loaded-list li {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 6px 10px;
  background: color-mix(in oklch, var(--surface) 70%, transparent);
}

/* Scan stage — appears during germinate */
.rg-scan-stage {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: oklch(0.12 0.02 155);
  border: 1px solid var(--line);
  width: 100%;
  min-height: 380px;
  display: grid; place-items: center;
}
.rg-scan-line {
  position: absolute; left: 0; right: 0; height: 4px;
  background: linear-gradient(180deg, transparent, var(--chloro), transparent);
  box-shadow: 0 0 24px 8px var(--chloro-glow);
  top: 0;
  animation: rg-scan 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes rg-scan {
  0%   { top: 0%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.rg-scan-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--chloro-glow) 1px, transparent 1px),
    linear-gradient(to bottom, var(--chloro-glow) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.15;
  pointer-events: none;
}
.rg-scan-bracket {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--chloro);
  pointer-events: none;
}
.rg-scan-bracket.tl { top: 12px; left: 12px;  border-right: none; border-bottom: none; }
.rg-scan-bracket.tr { top: 12px; right: 12px; border-left: none;  border-bottom: none; }
.rg-scan-bracket.bl { bottom: 12px; left: 12px;  border-right: none; border-top: none; }
.rg-scan-bracket.br { bottom: 12px; right: 12px; border-left: none;  border-top: none; }

.rg-scan-label {
  position: absolute; bottom: 16px; left: 16px; right: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chloro);
  display: flex; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rg-console {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  background: oklch(0.12 0.02 155);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  max-height: 180px;
  overflow: hidden;
  position: relative;
}
.rg-console-line {
  display: flex; gap: 12px;
  padding: 2px 0;
  animation: rg-typein 0.2s ease backwards;
}
.rg-console-time { color: var(--muted); }
.rg-console-tag  { color: var(--chloro); letter-spacing: 0.05em; }
@keyframes rg-typein { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
.rg-blink {
  display: inline-block;
  animation: rg-blink 1s steps(2, start) infinite;
}
@keyframes rg-blink { 50% { opacity: 0; } }

/* ============ FORMS ============ */
.rg-form-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.rg-form-card + .rg-form-card { margin-top: 22px; }
.rg-field { margin-bottom: 20px; }
.rg-field:last-child { margin-bottom: 0; }
.rg-field-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
.rg-field-help {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 6px;
}
.rg-input, .rg-textarea, .rg-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 30%, transparent);
  color: var(--ink);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rg-input:focus, .rg-textarea:focus, .rg-select:focus {
  border-color: var(--chloro-dim);
  box-shadow: 0 0 0 3px var(--chloro-glow);
}
.rg-textarea {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  min-height: 160px;
  resize: vertical;
}
.rg-input-large {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 0;
}
.rg-input-large:focus { border-bottom-color: var(--chloro); box-shadow: none; }

.rg-field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 640px) { .rg-field-grid { grid-template-columns: 1fr; } }

.rg-ingredient-edit {
  display: grid;
  grid-template-columns: 80px 110px 1fr 36px;
  gap: 10px;
  margin-bottom: 8px;
  align-items: center;
}
@media (max-width: 640px) {
  .rg-ingredient-edit { grid-template-columns: 70px 90px 1fr 36px; }
}
.rg-ing-amt-input,
.rg-ing-unit-input,
.rg-ing-name-input {
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 30%, transparent);
  color: var(--ink);
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  width: 100%;
}
.rg-ing-amt-input  { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--chloro); text-align: center; }
.rg-ing-unit-input { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); text-align: center; }
.rg-ing-remove {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 10px; cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.rg-ing-remove:hover { color: var(--bloom); border-color: var(--bloom); }

.rg-ing-header {
  display: grid;
  grid-template-columns: 80px 110px 1fr 36px;
  gap: 10px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.rg-ing-header span:first-child,
.rg-ing-header span:nth-child(2) { text-align: center; }

/* Tabs */
.rg-tabs {
  display: flex; gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.rg-tabs::-webkit-scrollbar { display: none; }
.rg-tab {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.rg-tab:hover { color: var(--ink); }
.rg-tab.active { color: var(--chloro); border-bottom-color: var(--chloro); }
.rg-tab-count { color: var(--muted); margin-left: 6px; font-size: 10px; }

/* Misc */
.rg-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rg-spacer { flex: 1; }
.rg-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 28px;
  cursor: pointer;
  background: none; border: none;
  padding: 0;
  white-space: nowrap;
}
.rg-back:hover { color: var(--chloro); }

/* Auth shell */
.rg-auth-shell {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 32px 20px;
}
.rg-auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-pop);
}
.rg-auth-brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.rg-auth-brand .rg-brand-mark { width: 52px; height: 52px; }
.rg-auth-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  margin: 0;
  font-weight: 400;
  color: var(--ink);
  text-align: center;
}
.rg-auth-sub {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: -8px 0 0;
}
.rg-auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* Hidden by default helpers */
.rg-hidden { display: none !important; }
