/* ============================================================
   EXPLORER'S HERBARIUM — Vintage Botanical Field Journal CSS
   ============================================================ */

/* ---- Font Variables ---- */
:root {
  --font-typewriter: 'Special Elite', 'Courier New', monospace;
  --font-handwriting: 'Caveat', 'Architects Daughter', cursive;
  --font-calligraphy: 'Playfair Display', 'IM Fell English', Georgia, serif;
  --font-body: 'Libre Baskerville', 'IM Fell English', Georgia, serif;

  /* Palette */
  --cream:        #f5ead6;
  --aged-paper:   #ede0c4;
  --deep-cream:   #e8d5b0;
  --sepia-light:  #c9a96e;
  --sepia:        #8b6914;
  --sepia-dark:   #5c4008;
  --ink:          #2c1f0e;
  --ink-faded:    #4a3520;
  --ink-lighter:  #6b4f2a;
  --olive:        #5a6632;
  --olive-light:  #7a8c42;
  --olive-faded:  #a0a86a;
  --brown-leather:#6b3f1e;
  --rust:         #8b3a2a;
  --tape-yellow:  rgba(220, 200, 120, 0.65);
  --tape-blue:    rgba(160, 190, 210, 0.50);
  --tape-green:   rgba(140, 170, 120, 0.55);
  --tape-pink:    rgba(210, 160, 140, 0.50);
  --tape-translucent: rgba(240, 230, 210, 0.40);
  --wax-red:      #8b1a1a;
  --wax-dark:     #5c0f0f;
  --shadow-soft:  rgba(44, 31, 14, 0.18);
  --shadow-medium:rgba(44, 31, 14, 0.30);
}

/* ============================================================
   BASE RESET & BODY — The Notebook Page
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  overflow-x: hidden;

  /* Aged notebook paper background — layered SVG + gradients */
  background-color: var(--aged-paper);
  background-image:
    /* Subtle horizontal ruling lines like notebook paper */
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 27px,
      rgba(100, 80, 40, 0.08) 27px,
      rgba(100, 80, 40, 0.08) 28px
    ),
    /* Faint vertical margin line */
    linear-gradient(
      to right,
      transparent 74px,
      rgba(160, 80, 60, 0.12) 74px,
      rgba(160, 80, 60, 0.12) 76px,
      transparent 76px
    ),
    /* Paper grain texture via noise-like radial gradients */
    radial-gradient(ellipse at 20% 10%, rgba(180,140,60,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(140,100,40,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 70%, rgba(160,120,50,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 80%, rgba(100,70,20,0.10) 0%, transparent 40%),
    radial-gradient(ellipse at 90% 90%, rgba(120,90,30,0.09) 0%, transparent 40%),
    /* Water stain blobs */
    radial-gradient(ellipse 300px 200px at 15% 35%, rgba(170,140,80,0.07) 0%, transparent 100%),
    radial-gradient(ellipse 250px 180px at 85% 60%, rgba(150,120,60,0.06) 0%, transparent 100%),
    radial-gradient(ellipse 400px 250px at 50% 15%, rgba(180,150,90,0.05) 0%, transparent 100%),
    /* Main paper gradient for yellowed aging */
    linear-gradient(
      160deg,
      #f0e3c5 0%,
      #ede0bc 15%,
      #e8d8b0 30%,
      #f2e6c8 50%,
      #ead9b4 65%,
      #e5d4a8 80%,
      #eddfc0 100%
    );
}

/* ============================================================
   DECKLED / TORN EDGE EFFECT — Page Boundaries
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 1000;

  /* Torn / deckled edges using clip-path-like box shadows and masks */
  box-shadow:
    /* Left torn edge shadow */
    inset 8px 0 20px rgba(44,31,14,0.14),
    inset -8px 0 20px rgba(44,31,14,0.14),
    /* Top worn edge */
    inset 0 6px 18px rgba(44,31,14,0.12),
    /* Bottom worn edge */
    inset 0 -6px 18px rgba(44,31,14,0.12);
}

/* Decorative torn paper SVG edges */
.page-edge-top,
.page-edge-bottom {
  position: fixed;
  left: 0; right: 0;
  height: 28px;
  pointer-events: none;
  z-index: 999;
}
.page-edge-top { top: 0; }
.page-edge-bottom { bottom: 0; transform: rotate(180deg); }

/* ============================================================
   DECKLED / TORN PAPER EDGES — SVG-based jagged border
   ============================================================ */

/* We inject deckled top/bottom via body pseudo-elements */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 22px;
  pointer-events: none;
  z-index: 998;
  /* Jagged torn edge - dark shadow from top */
  background: linear-gradient(to bottom,
    rgba(30, 18, 6, 0.22) 0%,
    rgba(30, 18, 6, 0.10) 40%,
    transparent 100%
  );
  /* Irregular mask for torn look */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1440' height='22' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L0,8 Q30,22 60,14 Q90,6 120,18 Q150,22 180,12 Q210,4 240,16 Q270,22 300,10 Q330,4 360,18 Q390,22 420,14 Q450,6 480,20 Q510,22 540,12 Q570,4 600,18 Q630,22 660,10 Q690,4 720,16 Q750,22 780,14 Q810,6 840,20 Q870,22 900,12 Q930,4 960,18 Q990,22 1020,14 Q1050,6 1080,16 Q1110,22 1140,10 Q1170,4 1200,18 Q1230,22 1260,14 Q1290,6 1320,20 Q1350,22 1380,12 Q1410,4 1440,16 L1440,0 Z' fill='%23000'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1440' height='22' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L0,8 Q30,22 60,14 Q90,6 120,18 Q150,22 180,12 Q210,4 240,16 Q270,22 300,10 Q330,4 360,18 Q390,22 420,14 Q450,6 480,20 Q510,22 540,12 Q570,4 600,18 Q630,22 660,10 Q690,4 720,16 Q750,22 780,14 Q810,6 840,20 Q870,22 900,12 Q930,4 960,18 Q990,22 1020,14 Q1050,6 1080,16 Q1110,22 1140,10 Q1170,4 1200,18 Q1230,22 1260,14 Q1290,6 1320,20 Q1350,22 1380,12 Q1410,4 1440,16 L1440,0 Z' fill='%23000'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* ============================================================
   SCATTERED BACKGROUND DECORATIONS
   ============================================================ */
.bg-decorations {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Ink blots */
.ink-blot {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(44,31,14,0.18) 0%, rgba(44,31,14,0.04) 60%, transparent 100%);
}
.ink-blot-1 { width: 18px; height: 14px; top: 12%; left: 88%; transform: rotate(20deg) scale(1, 0.7); }
.ink-blot-2 { width: 10px; height: 10px; top: 45%; left: 3%;  }
.ink-blot-3 { width: 22px; height: 16px; top: 72%; left: 92%; transform: rotate(-15deg) scale(1, 0.6); }
.ink-blot-4 { width: 8px;  height: 8px;  top: 28%; left: 7%;  }
.ink-blot-5 { width: 14px; height: 10px; top: 88%; left: 15%; transform: rotate(10deg); }

/* Tiny SVG botanical sketches scattered on background */
.bg-sketch {
  position: absolute;
  opacity: 0.07;
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
#root {
  position: relative;
  z-index: 2;
}

.herbarium-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
}

/* ============================================================
   HEADER
   ============================================================ */
.herb-header {
  position: relative;
  text-align: center;
  padding: 52px 20px 36px;
  border-bottom: none;
}

.header-logo-shell {
  position: absolute;
  z-index: 2;
  width: clamp(74px, 9vw, 108px);
  aspect-ratio: 1;
  padding: 6px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(252, 247, 232, 0.96), rgba(236, 222, 188, 0.88)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.92), transparent 62%);
  border: 1px solid rgba(139, 105, 20, 0.22);
  box-shadow:
    0 10px 20px rgba(44, 31, 14, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  backdrop-filter: blur(2px);
}

.header-logo-shell::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(139, 105, 20, 0.28);
  border-radius: 50%;
  pointer-events: none;
}

.header-logo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 6px 10px rgba(44, 31, 14, 0.18));
}

/* Decorative ink line under header */
.herb-header::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--sepia-light), var(--sepia), var(--sepia-light), transparent);
  margin-top: 28px;
  opacity: 0.6;
}

.header-eyebrow {
  font-family: var(--font-typewriter);
  font-size: 0.70rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sepia);
  opacity: 0.85;
  margin-bottom: 6px;
}

.header-title {
  font-family: var(--font-calligraphy);
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-shadow: 1px 2px 0px rgba(44,31,14,0.15);
  position: relative;
}

.header-title-main,
.header-title-sub {
  display: block;
}

.header-title-sub {
  font-size: clamp(1.15rem, 2.5vw, 1.9rem);
  line-height: 1;
  letter-spacing: 0.03em;
  margin-top: 6px;
  opacity: 0.82;
}

/* Ink-scratch underline effect */
.header-title::after {
  content: '〜';
  display: block;
  font-size: 1.8rem;
  color: var(--sepia-light);
  opacity: 0.5;
  letter-spacing: 0.2em;
  margin-top: -6px;
}

.header-subtitle {
  font-family: var(--font-typewriter);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--ink-lighter);
  margin-top: 10px;
  opacity: 0.8;
}

/* Header stamp decoration */
.header-stamp {
  position: absolute;
  top: 20px;
  right: 60px;
  width: 90px;
  height: 90px;
  border: 2.5px solid var(--sepia-light);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0.28;
  transform: rotate(12deg);
  font-family: var(--font-typewriter);
  font-size: 0.45rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sepia-dark);
  padding: 8px;
  text-align: center;
  line-height: 1.5;
}
.header-stamp::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--sepia-light);
  border-radius: 50%;
}

/* Corner decorations */
.corner-deco {
  position: absolute;
  width: 50px;
  height: 50px;
  opacity: 0.22;
}
.corner-deco svg { width: 100%; height: 100%; }
.corner-deco-tl { top: 22px; left: 22px; }
.corner-deco-tr { top: 22px; right: 22px; transform: scaleX(-1); }

/* ============================================================
   NAVIGATION — Worn Ribbon Bookmarks
   ============================================================ */
.herb-nav-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  padding: 0 20px;
  margin-top: 8px;
  overflow: visible;
}

.nav-tab {
  position: relative;
  font-family: var(--font-typewriter);
  font-size: 0.72rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-faded);
  text-decoration: none;
  padding: 10px 22px 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid rgba(139, 105, 20, 0.25);
  border-bottom: none;
  background: linear-gradient(to bottom, rgba(220,200,150,0.55), rgba(205,180,120,0.45));
  margin-right: 2px;
  top: 0;
  border-radius: 4px 4px 0 0;
  user-select: none;
}

/* Ribbon-like torn bottom */
.nav-tab::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 10%;
  right: 10%;
  height: 4px;
  background: linear-gradient(to right, transparent, rgba(180,150,80,0.3), transparent);
}

.nav-tab:hover,
.nav-tab.active {
  color: var(--ink);
  background: linear-gradient(to bottom, rgba(240,225,175,0.85), rgba(230,210,155,0.75));
  top: -3px;
  box-shadow: 0 -3px 10px rgba(44,31,14,0.12);
}

.nav-tab.active {
  font-weight: bold;
  border-color: rgba(139, 105, 20, 0.45);
}

.nav-divider {
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(139,105,20,0.35), var(--sepia-light), rgba(139,105,20,0.35), transparent);
  margin-top: 0;
}

/* ============================================================
   SEARCH BAR — Pencil Sketch Style
   ============================================================ */
.search-section {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 22px 20px 10px;
  gap: 14px;
}

.search-label {
  font-family: var(--font-handwriting);
  font-size: 0.95rem;
  color: var(--ink-lighter);
  opacity: 0.8;
  white-space: nowrap;
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.search-input {
  width: 100%;
  padding: 9px 42px 9px 14px;
  font-family: var(--font-handwriting);
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(139,105,20,0.45);
  outline: none;
  caret-color: var(--sepia-dark);
  transition: border-color 0.3s;
  letter-spacing: 0.02em;

  /* Pencil sketch border effect */
  border-image: none;
  position: relative;
}

.search-input::placeholder {
  color: var(--sepia-light);
  opacity: 0.65;
  font-style: italic;
}

.search-input:focus {
  border-bottom-color: var(--sepia);
}

/* Rough pencil border lines */
.search-container::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 1px;
  background: repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(139,105,20,0.2) 3px, rgba(139,105,20,0.2) 6px);
  pointer-events: none;
}

.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sepia-light);
  font-size: 1.1rem;
  pointer-events: none;
  opacity: 0.75;
}

.collection-add-button {
  position: relative;
  padding: 10px 18px 9px;
  border: 1px solid rgba(139,105,20,0.36);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(247,236,206,0.98), rgba(230,211,168,0.92)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.2) 0 4px, rgba(0,0,0,0.02) 4px 8px);
  color: var(--ink);
  font-family: var(--font-typewriter);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(44,31,14,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.collection-add-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(44,31,14,0.18);
  border-color: rgba(139,105,20,0.5);
}

.collection-add-button::before {
  content: "+";
  margin-right: 8px;
  font-size: 0.95rem;
}

.auth-controls-shell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-controls-shell-signed {
  justify-content: flex-end;
}

.auth-primary-button,
.auth-secondary-button {
  padding: 10px 16px 9px;
  border-radius: 999px;
  font-family: var(--font-typewriter);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-primary-button {
  border: 1px solid rgba(90,102,50,0.35);
  background: linear-gradient(135deg, rgba(125,146,82,0.92), rgba(95,113,56,0.92));
  color: #f7f1df;
  box-shadow: 0 3px 10px rgba(44,31,14,0.12);
}

.auth-secondary-button {
  border: 1px solid rgba(139,105,20,0.30);
  background: linear-gradient(135deg, rgba(245,233,204,0.98), rgba(237,224,184,0.96));
  color: var(--ink);
}

.auth-inline-note {
  max-width: 320px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-lighter);
}

.auth-inline-note-success {
  color: #425122;
}

.auth-inline-note-error {
  color: #6f271c;
}

.auth-user-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid rgba(139,105,20,0.24);
  border-radius: 14px;
  background: rgba(245,236,214,0.70);
  color: var(--ink);
}

.auth-user-label {
  font-family: var(--font-typewriter);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sepia);
}

.auth-switcher {
  position: relative;
  z-index: 2;
  display: inline-flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-switcher-button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(139,105,20,0.26);
  background: rgba(245,236,214,0.72);
  color: var(--ink-faded);
  font-family: var(--font-typewriter);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-switcher-button.active {
  border-color: rgba(90,102,50,0.35);
  background: linear-gradient(135deg, rgba(125,146,82,0.92), rgba(95,113,56,0.92));
  color: #f7f1df;
}

.auth-card {
  width: min(560px, 100%);
}

/* ============================================================
   MAIN LAYOUT — Content Area
   ============================================================ */
.herb-main-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 0 24px;
  padding: 18px 20px 40px;
  align-items: start;
}

@media (max-width: 860px) {
  .herb-main-layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   SIDEBAR — Index Tab Style
   ============================================================ */
.herb-sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-heading {
  font-family: var(--font-typewriter);
  font-size: 0.62rem;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--sepia);
  opacity: 0.75;
  margin-bottom: 10px;
  padding-left: 4px;
}

/* Index tab cards */
.index-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.80rem;
  color: var(--ink-faded);
  border: 1px solid rgba(139,105,20,0.22);
  background: linear-gradient(135deg, rgba(240,225,185,0.55) 0%, rgba(220,200,150,0.35) 100%);
  transition: all 0.2s ease;
  user-select: none;

  /* Tabbed index card protruding tab look */
  border-left: 4px solid transparent;
}

.index-tab:first-of-type { border-radius: 6px 6px 0 0; }
.index-tab:last-of-type  { border-radius: 0 0 6px 6px; }

.index-tab:hover {
  background: linear-gradient(135deg, rgba(250,235,195,0.75) 0%, rgba(235,215,165,0.55) 100%);
  border-left-color: var(--sepia-light);
  color: var(--ink);
  padding-left: 18px;
}

.index-tab.active {
  background: linear-gradient(135deg, rgba(255,245,210,0.90) 0%, rgba(245,225,175,0.75) 100%);
  border-left-color: var(--sepia);
  color: var(--ink);
  font-style: italic;
}

.index-tab-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.index-tab-count {
  margin-left: auto;
  font-family: var(--font-typewriter);
  font-size: 0.62rem;
  color: var(--sepia-light);
  opacity: 0.8;
}

/* Sidebar decorative divider */
.sidebar-divider {
  margin: 18px 0 14px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(139,105,20,0.30), transparent);
}

/* Sidebar note / annotation */
.sidebar-note {
  font-family: var(--font-handwriting);
  font-size: 0.88rem;
  color: var(--ink-lighter);
  line-height: 1.6;
  padding: 10px 12px;
  border-left: 2px solid rgba(139,105,20,0.25);
  opacity: 0.80;
  transform: rotate(-0.4deg);
}

/* Sidebar stats */
.sidebar-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 4px;
  border-bottom: 1px dashed rgba(139,105,20,0.20);
}
.sidebar-stat-label {
  font-family: var(--font-typewriter);
  font-size: 0.60rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--sepia);
  opacity: 0.75;
}
.sidebar-stat-value {
  font-family: var(--font-handwriting);
  font-size: 1.0rem;
  color: var(--ink);
}

/* ============================================================
   PLANT GRID — Polaroid / Scrapbook Layout
   ============================================================ */
.plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 38px 28px;
  padding: 14px 0 30px;
}

@media (max-width: 600px) {
  .plant-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 42px 18px;
  }
}

/* ============================================================
   PLANT CARD — Polaroid with Tape
   ============================================================ */
.plant-card {
  position: relative;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease;
  /* Each card gets a subtle natural tilt — set per card inline */
}

/* The polaroid white frame */
.polaroid {
  background: #faf7f0;
  padding: 10px 10px 56px;
  box-shadow:
    0 2px 4px rgba(44,31,14,0.12),
    0 6px 18px rgba(44,31,14,0.14),
    0 1px 0px rgba(255,255,255,0.6) inset;
  position: relative;
  border: 1px solid rgba(220,205,175,0.6);

  /* Slightly uneven border via clip path for handcut look */
  clip-path: polygon(
    0.3% 0.5%, 99.5% 0.2%, 99.8% 99.5%, 0.1% 99.8%
  );
}

/* Photographic image area */
.polaroid-img-wrap {
  position: relative;
  overflow: hidden;
  background: #e8dfc8;
  /* Slight vignette on photo */
}
.polaroid-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(20,12,4,0.18) 100%);
  pointer-events: none;
}

.polaroid-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  object-fit: cover;
  filter: sepia(0.18) contrast(0.92) brightness(0.97);
  transition: filter 0.4s ease, transform 0.4s ease;
}

/* Bottom white strip — handwritten tag area */
.polaroid-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 8px 7px;
  gap: 4px;
  overflow: hidden;
}

.polaroid-title {
  font-family: var(--font-handwriting);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.05;
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}

.polaroid-date {
  font-family: var(--font-typewriter);
  font-size: 0.48rem;
  line-height: 1.2;
  letter-spacing: 0.12em;
  color: var(--sepia);
  opacity: 0.75;
}

/* ============================================================
   WASHI / SCOTCH TAPE STRIPS
   ============================================================ */
.tape {
  position: absolute;
  transform-origin: center;
  pointer-events: none;
  z-index: 10;
}

/* Yellow washi tape — textured */
.tape-yellow {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(200,175,80,0.5) 0px,
      rgba(220,200,110,0.55) 2px,
      rgba(210,190,100,0.45) 4px,
      rgba(200,175,80,0.5) 6px
    ),
    linear-gradient(rgba(225,205,120,0.60), rgba(210,185,95,0.60));
  box-shadow: 0 1px 3px rgba(44,31,14,0.15);
}

/* Blue fabric-like tape */
.tape-blue {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(130,165,195,0.5) 0px,
      rgba(150,185,215,0.5) 1px,
      rgba(130,165,195,0.5) 2px
    ),
    linear-gradient(90deg, rgba(140,175,205,0.55), rgba(160,195,225,0.50));
  box-shadow: 0 1px 3px rgba(44,31,14,0.15);
}

/* Translucent scotch tape */
.tape-clear {
  background: linear-gradient(
    to bottom,
    rgba(240,235,210,0.25) 0%,
    rgba(220,215,190,0.38) 50%,
    rgba(240,235,210,0.25) 100%
  );
  border: 0.5px solid rgba(200,185,150,0.3);
  box-shadow: 0 1px 2px rgba(44,31,14,0.08);
}

/* Green washi tape */
.tape-green {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(100,140,90,0.5) 0px,
      rgba(120,160,110,0.55) 3px,
      rgba(100,140,90,0.45) 5px
    ),
    linear-gradient(rgba(115,150,100,0.55), rgba(105,140,90,0.55));
  box-shadow: 0 1px 3px rgba(44,31,14,0.15);
}

/* Pink washi tape */
.tape-pink {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(190,130,120,0.45) 0px,
      rgba(210,155,140,0.50) 3px,
      rgba(190,130,120,0.40) 5px
    ),
    linear-gradient(rgba(205,145,130,0.52), rgba(195,135,120,0.50));
  box-shadow: 0 1px 3px rgba(44,31,14,0.15);
}

/* Tape torn edge effect */
.tape::before,
.tape::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: inherit;
  opacity: 0.6;
  filter: blur(0.5px);
}
.tape::before { left: -1px; clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%); }
.tape::after  { right: -1px; clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 85%); }

/* Tape positioning on top corners */
.tape-tl {
  width: 52px;
  height: 14px;
  top: -7px;
  left: 12px;
  transform: rotate(-12deg);
}
.tape-tr {
  width: 52px;
  height: 14px;
  top: -7px;
  right: 12px;
  transform: rotate(10deg);
}
.tape-bl {
  width: 44px;
  height: 14px;
  bottom: 34px;
  left: 8px;
  transform: rotate(14deg);
}
.tape-br {
  width: 44px;
  height: 14px;
  bottom: 34px;
  right: 8px;
  transform: rotate(-11deg);
}
.tape-top-center {
  width: 58px;
  height: 14px;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
}
.tape-side-l {
  width: 42px;
  height: 13px;
  top: 30%;
  left: -14px;
  transform: rotate(88deg);
}

/* ============================================================
   WAX SEAL
   ============================================================ */
.wax-seal {
  position: absolute;
  width: 36px;
  height: 36px;
  z-index: 20;
  bottom: -10px;
  right: -8px;
  filter: drop-shadow(1px 2px 3px rgba(44,31,14,0.35));
}

.wax-seal svg {
  width: 100%;
  height: 100%;
}

/* ============================================================
   PAPER TAG (below Polaroid)
   ============================================================ */
.paper-tag {
  position: absolute;
  top: calc(100% - 10px);
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 80%;
  background: linear-gradient(
    135deg,
    #f5e9cc 0%,
    #ede0b8 40%,
    #f0e4c4 100%
  );
  border: 1px solid rgba(139,105,20,0.30);
  border-radius: 2px;
  padding: 5px 10px 6px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(44,31,14,0.18);
  z-index: 5;

  /* Slightly rough cut */
  clip-path: polygon(
    1% 3%, 99% 0%, 98.5% 97%, 0.5% 100%
  );
}

.paper-tag-text {
  font-family: var(--font-handwriting);
  font-size: 0.75rem;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
}
.paper-tag-latin {
  font-family: var(--font-body);
  font-size: 0.58rem;
  color: var(--sepia);
  font-style: italic;
  opacity: 0.85;
}

/* Tiny string/thread connecting tag */
.paper-tag::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 7px;
  background: rgba(139,105,20,0.50);
}

/* ============================================================
   HOVER EFFECT — Pick up from journal
   ============================================================ */
.plant-card:hover {
  z-index: 100;
  transform: translateY(-10px) rotate(0deg) scale(1.05) !important;
}
.plant-card:hover .polaroid {
  box-shadow:
    0 15px 40px rgba(44,31,14,0.28),
    0 6px 16px rgba(44,31,14,0.20),
    0 1px 0px rgba(255,255,255,0.7) inset;
}
.plant-card:hover .polaroid-img {
  filter: sepia(0.08) contrast(0.96) brightness(1.02);
}

/* ============================================================
   GRID SECTION HEADER
   ============================================================ */
.grid-section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(139,105,20,0.18);
}

.grid-section-title {
  font-family: var(--font-calligraphy);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-faded);
}

.grid-section-count {
  font-family: var(--font-typewriter);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--sepia-light);
}

.grid-section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(139,105,20,0.15), transparent);
}

/* ============================================================
   FOOTER
   ============================================================ */
.herb-footer {
  position: relative;
  text-align: center;
  padding: 36px clamp(24px, 6vw, 72px) 52px;
  margin-top: 20px;
}

.herb-footer::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--sepia-light), transparent);
  margin-bottom: 28px;
  opacity: 0.5;
}

.footer-flourish {
  font-family: var(--font-calligraphy);
  font-size: 1.3rem;
  color: var(--sepia-light);
  opacity: 0.55;
  margin-bottom: 8px;
  letter-spacing: 0.3em;
}

.footer-text {
  font-family: var(--font-typewriter);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sepia);
  opacity: 0.55;
}

.footer-edition {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-style: italic;
  color: var(--ink-lighter);
  opacity: 0.55;
  margin-top: 4px;
}

.footer-signature {
  margin-top: 18px;
  font-family: var(--font-handwriting);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  color: var(--ink-faded);
  opacity: 0.88;
}

.footer-signature a {
  color: var(--olive);
  text-decoration: none;
  border-bottom: 1px solid rgba(90, 102, 50, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
}

.footer-signature a:hover,
.footer-signature a:focus-visible {
  color: var(--sepia-dark);
  border-color: rgba(92, 64, 8, 0.48);
  text-shadow: 0 2px 6px rgba(139, 105, 20, 0.18);
}

.footer-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  max-width: 860px;
  margin: 0 auto;
}

.footer-copy {
  min-width: 0;
}

.footer-logo-shell {
  position: relative;
  left: auto;
  bottom: auto;
  width: clamp(68px, 7vw, 92px);
  justify-self: start;
  align-self: center;
}

/* ============================================================
   CARD GRID — Additional imperfect spacing
   ============================================================ */
.plant-card:nth-child(3n+1) { margin-top: 8px; }
.plant-card:nth-child(3n+2) { margin-top: 0px; }
.plant-card:nth-child(3n+3) { margin-top: 14px; }

/* ============================================================
   FEATURED / SELECTED CARD
   ============================================================ */
.plant-card.featured .polaroid {
  box-shadow:
    0 3px 8px rgba(44,31,14,0.15),
    0 8px 24px rgba(44,31,14,0.18),
    0 0 0 1.5px rgba(139,105,20,0.25),
    0 1px 0px rgba(255,255,255,0.7) inset;
}

/* ============================================================
   WATER STAIN OVERLAYS — fixed, scattered on page
   ============================================================ */
.water-stain {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(160,125,60,0.09) 0%, rgba(140,105,40,0.05) 40%, transparent 100%);
}

/* ============================================================
   PENCIL RULE LINE ACCENT — decorative ruling
   ============================================================ */
.pencil-rule {
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 4px,
    rgba(139,105,20,0.14) 4px,
    rgba(139,105,20,0.14) 8px
  );
  margin: 4px 0;
}

/* ============================================================
   MEDIA PRINT
   ============================================================ */
@media print {
  .lightbox-overlay { display: none; }
  body::before, body::after { display: none; }
}

/* ============================================================
   SCROLLBAR — Aged Parchment Look
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(205,180,130,0.3); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--sepia-light), var(--sepia));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--sepia); }

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 860px) {
  .herb-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
  }
  .sidebar-heading { grid-column: 1 / -1; }
  .sidebar-divider { grid-column: 1 / -1; }
  .sidebar-note { grid-column: 1 / -1; }
  .sidebar-stat { display: none; }
  .index-tab:first-of-type,
  .index-tab:last-of-type { border-radius: 4px; }
  .header-stamp { display: none; }
}

@media (max-width: 500px) {
  .herb-header { padding: 32px 16px 24px; }
  .herb-footer {
    padding: 32px 16px 40px;
  }
  .footer-content {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
  }
  .footer-copy {
    width: 100%;
  }
  .footer-logo-shell {
    width: 68px;
    justify-self: center;
    align-self: center;
  }
  .header-title { font-size: 2.2rem; }
  .plant-grid { gap: 48px 16px; }
  .herb-main-layout { padding: 12px 14px 30px; }
  .nav-tab { padding: 8px 14px 6px; font-size: 0.65rem; }
  .search-label { display: none; }
}

/* Hide notebook punch holes on small screens */
@media (max-width: 760px) {
  /* punch holes and margin line hidden via inline style — JS media query would be needed,
     but we keep the container hidden at narrow widths via this approach */
  body {
    /* remove margin line on mobile */
    background-image:
      repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 27px,
        rgba(100, 80, 40, 0.07) 27px,
        rgba(100, 80, 40, 0.07) 28px
      ),
      radial-gradient(ellipse at 20% 10%, rgba(180,140,60,0.12) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 30%, rgba(140,100,40,0.10) 0%, transparent 50%),
      radial-gradient(ellipse at 50% 70%, rgba(160,120,50,0.08) 0%, transparent 60%),
      radial-gradient(ellipse 300px 200px at 15% 35%, rgba(170,140,80,0.07) 0%, transparent 100%),
      radial-gradient(ellipse 250px 180px at 85% 60%, rgba(150,120,60,0.06) 0%, transparent 100%),
      linear-gradient(160deg, #f0e3c5 0%, #ede0bc 15%, #e8d8b0 30%, #f2e6c8 50%, #ead9b4 65%, #e5d4a8 80%, #eddfc0 100%);
  }
}

/* ============================================================
   UTILITY — Imperfect Placement Nudges
   ============================================================ */
.nudge-1 { transform: rotate(-2.5deg); }
.nudge-2 { transform: rotate(1.8deg); }
.nudge-3 { transform: rotate(-1.2deg); }
.nudge-4 { transform: rotate(2.1deg); }
.nudge-5 { transform: rotate(-0.8deg); }
.nudge-6 { transform: rotate(1.5deg); }
.nudge-7 { transform: rotate(-1.9deg); }
.nudge-8 { transform: rotate(2.8deg); }

/* Card hover resets rotation to near-zero */
.plant-card:hover { transform: translateY(-10px) rotate(0deg) scale(1.04) !important; }

/* ============================================================
   ANNOTATION MARKS — Scattered on page
   ============================================================ */
.page-annotation {
  position: absolute;
  font-family: var(--font-handwriting);
  color: var(--sepia-dark);
  opacity: 0.18;
  pointer-events: none;
  font-size: 0.72rem;
  line-height: 1.4;
  white-space: nowrap;
}

/* ============================================================
   SPECIMEN BADGE
   ============================================================ */
.specimen-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 15;
  background: var(--olive);
  color: #e8dfc0;
  font-family: var(--font-typewriter);
  font-size: 0.45rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 1px;
  opacity: 0.88;
}

/* ============================================================
   LIGHTBOX / MODAL — Expanded View
   ============================================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, 0.78);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-card {
  background: #f5ead6;
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 40px);
  padding: 56px 24px 32px;
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(20,12,4,0.6);
  position: relative;
  overflow-y: auto;
  transform: scale(0.88) rotate(-1deg);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);

  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0px, transparent 27px,
      rgba(100, 80, 40, 0.07) 27px, rgba(100, 80, 40, 0.07) 28px
    );
}
.lightbox-overlay.open .lightbox-card {
  transform: scale(1) rotate(-0.3deg);
}

.lightbox-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(38vh, 320px);
  object-fit: cover;
  filter: sepia(0.12) contrast(0.94);
  border: 8px solid #fdf8f0;
  box-shadow: 0 4px 12px rgba(44,31,14,0.20);
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 40;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(245,233,204,0.98), rgba(237,224,184,0.96));
  border: 1px solid rgba(139,105,20,0.35);
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(44,31,14,0.16);
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--sepia-dark);
  opacity: 0.95;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.lightbox-close:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(44,31,14,0.22);
}

.lightbox-title {
  font-family: var(--font-calligraphy);
  font-size: 1.75rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.15;
  margin: 16px 0 6px;
}
.lightbox-latin {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--sepia);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.lightbox-body {
  font-family: var(--font-handwriting);
  font-size: 1.08rem;
  line-height: 1.72;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: normal;
}
.lightbox-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(139,105,20,0.20);
}
.lightbox-meta-item label {
  font-family: var(--font-typewriter);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sepia-light);
  display: block;
}
.lightbox-meta-item span {
  font-family: var(--font-handwriting);
  font-size: 0.92rem;
  color: var(--ink);
}

.archive-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, 0.72);
  z-index: 5200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.archive-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.archive-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 36px 28px 28px;
  background:
    linear-gradient(180deg, rgba(249,240,218,0.98), rgba(238,224,192,0.97)),
    repeating-linear-gradient(to bottom, transparent 0 27px, rgba(100,80,40,0.05) 27px 28px);
  border: 1px solid rgba(139,105,20,0.26);
  border-radius: 10px;
  box-shadow: 0 28px 70px rgba(20,12,4,0.48);
}

.archive-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(139,105,20,0.22);
  border-radius: 8px;
  pointer-events: none;
}

.archive-tape {
  position: absolute;
  width: 78px;
  height: 18px;
  top: -8px;
  z-index: 5;
  opacity: 0.95;
}

.archive-tape-left {
  left: 28px;
  transform: rotate(-8deg);
  background: linear-gradient(rgba(225,205,120,0.65), rgba(210,185,95,0.62));
}

.archive-tape-right {
  right: 46px;
  transform: rotate(7deg);
  background: linear-gradient(90deg, rgba(140,175,205,0.6), rgba(160,195,225,0.52));
}

.archive-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 8;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(139,105,20,0.35);
  background: linear-gradient(135deg, rgba(245,233,204,0.98), rgba(237,224,184,0.96));
  color: var(--sepia-dark);
  box-shadow: 0 4px 10px rgba(44,31,14,0.16);
  cursor: pointer;
}

.archive-eyebrow {
  position: relative;
  z-index: 2;
  margin-bottom: 8px;
  font-family: var(--font-typewriter);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sepia);
  opacity: 0.78;
}

.archive-title {
  position: relative;
  z-index: 2;
  margin-bottom: 8px;
  font-family: var(--font-calligraphy);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-style: italic;
  color: var(--ink);
  line-height: 1.05;
}

.archive-subtitle {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin-bottom: 22px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-faded);
}

.archive-form {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
}

.archive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.archive-field {
  display: grid;
  gap: 6px;
}

.archive-label {
  font-family: var(--font-typewriter);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sepia);
}

.archive-field input,
.archive-field select,
.archive-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(139,105,20,0.24);
  border-radius: 8px;
  background: rgba(255,250,238,0.72);
  color: rgba(74,53,32,0.9);
  font-family: var(--font-handwriting);
  font-size: 1.02rem;
  line-height: 1.4;
}

.archive-field input:focus,
.archive-field select:focus,
.archive-field textarea:focus,
.archive-file-input:focus {
  outline: none;
  border-color: rgba(90,102,50,0.55);
  box-shadow: 0 0 0 3px rgba(122,140,66,0.12);
}

.archive-field textarea {
  resize: none;
}

.archive-field input:disabled,
.archive-field select:disabled,
.archive-field textarea:disabled,
.archive-upload-button:disabled,
.archive-primary:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.archive-upload {
  padding: 18px 16px;
  border: 1px dashed rgba(139,105,20,0.34);
  border-radius: 10px;
  background: rgba(245,236,214,0.62);
}

.archive-file-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(139,105,20,0.24);
  border-radius: 8px;
  background: rgba(255,250,238,0.78);
  color: rgba(74,53,32,0.9);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.archive-upload-title {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-handwriting);
  font-size: 1.06rem;
  color: var(--ink);
}

.archive-upload-note {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink-lighter);
}

.archive-upload-button,
.archive-primary,
.archive-secondary {
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--font-typewriter);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.archive-upload-button,
.archive-secondary {
  border: 1px solid rgba(139,105,20,0.3);
  background: linear-gradient(135deg, rgba(245,233,204,0.98), rgba(237,224,184,0.96));
  color: var(--ink);
}

.archive-primary {
  border: 1px solid rgba(90,102,50,0.35);
  background: linear-gradient(135deg, rgba(125,146,82,0.92), rgba(95,113,56,0.92));
  color: #f7f1df;
}

.archive-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.archive-status {
  position: relative;
  z-index: 2;
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.6;
}

.archive-status-error {
  border: 1px solid rgba(139,58,42,0.28);
  background: rgba(139,58,42,0.10);
  color: #6f271c;
}

.archive-status-success {
  border: 1px solid rgba(90,102,50,0.28);
  background: rgba(90,102,50,0.10);
  color: #425122;
}

.archive-status-info {
  max-width: 420px;
  margin: 36px auto;
  text-align: center;
  border: 1px solid rgba(139,105,20,0.24);
  background: rgba(245,236,214,0.72);
  color: var(--ink-faded);
}

.plants-loading-banner {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 5300;
  padding: 10px 14px;
  border: 1px solid rgba(139,105,20,0.24);
  border-radius: 999px;
  background: rgba(245,236,214,0.92);
  box-shadow: 0 10px 24px rgba(44,31,14,0.16);
  color: var(--ink-faded);
  font-family: var(--font-typewriter);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

@media (max-width: 640px) {
  .lightbox-overlay {
    padding: 12px;
  }

  .lightbox-card {
    max-height: calc(100vh - 24px);
    padding: 52px 18px 24px;
  }

  .lightbox-title {
    font-size: 1.45rem;
  }

  .lightbox-body {
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .lightbox-meta {
    grid-template-columns: 1fr;
  }

  .archive-card {
    max-height: calc(100vh - 24px);
    padding: 34px 16px 20px;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .archive-actions {
    flex-direction: column;
  }
}
