@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Literata:ital,opsz,wght@0,7..72,400;0,7..72,500;0,7..72,600;1,7..72,400&display=swap');

:root {
  /* Aged parchment palette */
  --parchment: #f4ede4;
  --parchment-dark: #e8dfd2;
  --parchment-edge: #d4c8b8;
  --ink: #2a2118;
  --ink-faded: #5c4f3d;
  --ink-light: #8a7c68;

  /* Forest depths */
  --forest-deep: #1a2e1f;
  --forest: #2d4a36;
  --moss: #4a6b4f;
  --lichen: #7a9974;

  /* Amber/copper accents */
  --amber: #c17f24;
  --amber-dark: #9e5f12;
  --copper: #b87333;
  --rust: #8b4513;

  /* Spore colors */
  --spore-cream: #f5f0e3;
  --spore-ochre: #d4a855;
  --spore-umber: #6b4423;

  --shadow-subtle: 0 2px 8px rgba(42, 33, 24, 0.08);
  --shadow-card: 0 4px 20px rgba(42, 33, 24, 0.12), 0 1px 3px rgba(42, 33, 24, 0.08);
  --shadow-elevated: 0 8px 32px rgba(42, 33, 24, 0.16), 0 2px 8px rgba(42, 33, 24, 0.08);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Literata', 'Georgia', serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--parchment);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Parchment texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1000;
}

/* Decorative botanical border frame */
body::after {
  content: "";
  position: fixed;
  inset: 12px;
  border: 1px solid var(--parchment-edge);
  pointer-events: none;
  z-index: 999;
}

/* Corner ornaments */
.shell::before,
.shell::after {
  content: "❧";
  position: fixed;
  font-size: 28px;
  color: var(--ink-light);
  opacity: 0.4;
  z-index: 1001;
  pointer-events: none;
}

.shell::before {
  top: 20px;
  left: 24px;
}

.shell::after {
  bottom: 20px;
  right: 24px;
  transform: rotate(180deg);
}

.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 40px 60px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  position: relative;
}

/* ===== TYPOGRAPHY ===== */

h1, h2, h3 {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--forest-deep);
}

h2 {
  font-size: 1.6rem;
  color: var(--forest);
  position: relative;
  display: inline-block;
}

h3 {
  font-size: 1.15rem;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ===== HERO ===== */

.hero {
  text-align: center;
  padding: 48px 24px;
  position: relative;
  animation: fadeIn 0.8s ease both;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-light), transparent);
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-light), transparent);
}

.hero--compact {
  padding: 32px 24px;
}

.hero--compact h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.hero--compact .subhead {
  margin-top: 12px;
  font-size: 1rem;
}

.eyebrow {
  font-family: 'EB Garamond', serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--amber-dark);
  margin: 0 0 20px;
  font-weight: 500;
}

.subhead {
  margin: 20px auto 0;
  font-size: 1.05rem;
  max-width: 580px;
  color: var(--ink-faded);
  font-style: italic;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.hero-top .eyebrow {
  margin: 0;
}

@media (max-width: 600px) {
  .hero-top {
    flex-direction: column;
    align-items: center;
  }

  .hero-top .eyebrow {
    order: 1;
  }

  /* Hide record button from hero on mobile - use FAB instead */
  .hero-top .record-btn {
    display: none;
  }
}

.record-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--forest);
  color: var(--parchment);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.record-btn:hover {
  background: var(--forest-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-subtle);
}

.record-btn svg {
  flex-shrink: 0;
}

/* ===== CARDS ===== */

.card {
  background: linear-gradient(135deg, #fffdf9 0%, var(--parchment) 100%);
  border: 1px solid var(--parchment-edge);
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-card);
}

/* Aged paper corner fold effect */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 24px 24px 0;
  border-color: transparent var(--parchment-dark) transparent transparent;
  filter: drop-shadow(-1px 1px 1px rgba(0,0,0,0.05));
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.03) 50%);
}

/* ===== CONTROLS ===== */

.controls {
  animation: slideUp 0.6s ease 0.1s both;
}

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

.control-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field--wide {
  grid-column: 1 / -1;
}

label {
  font-family: 'EB Garamond', serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--forest);
  font-weight: 500;
}

input[type="number"],
input[type="text"] {
  padding: 14px 16px;
  border: 1px solid var(--parchment-edge);
  background: #fffefa;
  font-family: 'Literata', serif;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(193, 127, 36, 0.12);
}

input::placeholder {
  color: var(--ink-light);
  font-style: italic;
}

.field-note {
  margin: 0;
  color: var(--ink-light);
  font-size: 0.85rem;
  font-style: italic;
}

.suggestions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.suggestion {
  border: 1px dashed var(--parchment-edge);
  padding: 10px 14px;
  background: #fffefa;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--forest);
  cursor: pointer;
  transition: all var(--transition);
}

.suggestion:hover {
  border-color: var(--amber);
  background: rgba(193, 127, 36, 0.05);
  border-style: solid;
}

/* Species search suggestions */
.species-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.species-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--parchment-dark);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.species-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.species-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.species-name {
  font-weight: 500;
  color: var(--ink);
}

.species-scientific {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-light);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px dashed var(--parchment-edge);
  border-bottom: 1px dashed var(--parchment-edge);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--ink-faded);
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
}

/* ===== BUTTONS ===== */

button {
  border: none;
  padding: 14px 28px;
  font-family: 'EB Garamond', serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.primary {
  background: var(--forest);
  color: var(--spore-cream);
  box-shadow: var(--shadow-subtle);
}

button.primary:hover:not(:disabled) {
  background: var(--forest-deep);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--parchment-edge);
  color: var(--ink-faded);
}

button.ghost:hover:not(:disabled) {
  border-color: var(--forest);
  color: var(--forest);
  background: rgba(45, 74, 54, 0.03);
}

.helper {
  margin: 0;
  color: var(--ink-light);
  font-size: 0.9rem;
  font-style: italic;
}

/* ===== WEATHER PANEL ===== */

.weather-panel {
  background: linear-gradient(135deg, var(--forest-deep) 0%, var(--forest) 100%);
  color: var(--spore-cream);
  padding: 28px 32px;
  border: 1px solid var(--forest);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.6s ease 0.15s both;
}

.weather-panel::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
  pointer-events: none;
}

.weather-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.weather-header h2 {
  color: var(--spore-cream);
  font-size: 1.3rem;
  margin: 0;
}

.weather-header h2::before {
  content: "☁ ";
  opacity: 0.7;
}

.weather-location {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.7;
  font-style: italic;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 24px;
  margin-bottom: 20px;
}

.weather-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weather-stat--primary {
  position: relative;
  padding-left: 16px;
}

.weather-stat--primary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--amber);
  border-radius: 2px;
}

.weather-label {
  font-family: 'EB Garamond', serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.weather-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.weather-unit {
  font-size: 0.8rem;
  opacity: 0.6;
}

.fruiting-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.fruiting-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

.fruiting-badge {
  font-family: 'EB Garamond', serif;
  padding: 6px 14px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 2px;
  font-weight: 600;
}

.fruiting-badge[data-level="excellent"] {
  background: rgba(122, 153, 116, 0.9);
  color: #fff;
}

.fruiting-badge[data-level="good"] {
  background: rgba(193, 127, 36, 0.9);
  color: #fff;
}

.fruiting-badge[data-level="fair"] {
  background: rgba(184, 115, 51, 0.7);
  color: #fff;
}

.fruiting-badge[data-level="poor"] {
  background: rgba(139, 69, 19, 0.7);
  color: rgba(255,255,255,0.9);
}

.fruiting-badge[data-level="unknown"] {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
}

/* ===== 7-DAY FORECAST ===== */

.forecast-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.forecast-section h3 {
  font-family: 'EB Garamond', serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin: 0 0 16px 0;
  color: var(--spore-cream);
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  text-align: center;
}

.forecast-day--best {
  background: rgba(193, 127, 36, 0.3);
  border: 1px solid var(--amber);
}

.forecast-day-name {
  font-family: 'EB Garamond', serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.forecast-day-icon {
  font-size: 1.4rem;
}

.forecast-day-rain {
  font-size: 0.85rem;
  font-weight: 600;
}

.forecast-day-temp {
  font-size: 0.75rem;
  opacity: 0.7;
}

@media (max-width: 600px) {
  .forecast-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== TRENDS BAR ===== */

.trends-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--parchment-dark);
  border: 1px solid var(--parchment-edge);
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.trend-label {
  color: var(--ink-light);
  font-family: 'EB Garamond', serif;
}

.trend-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.trend-indicator[data-trend="up"] {
  color: var(--forest);
}

.trend-indicator[data-trend="up"] .trend-arrow {
  color: var(--forest);
}

.trend-indicator[data-trend="down"] {
  color: var(--rust);
}

.trend-indicator[data-trend="down"] .trend-arrow {
  color: var(--rust);
}

.trend-indicator[data-trend="stable"] {
  color: var(--ink-light);
}

.trend-arrow {
  font-size: 1.2rem;
}

.trend-detail {
  color: var(--ink-light);
  font-size: 0.85rem;
  margin-left: auto;
}

/* ===== RESULTS ACTIONS ===== */

.results-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: 'EB Garamond', serif;
  font-size: 0.9rem;
  background: var(--parchment);
  border: 1px solid var(--parchment-edge);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--parchment-dark);
  border-color: var(--forest);
}

.action-icon {
  font-size: 1rem;
}

/* ===== OBSERVATION MAP ===== */

.map-section {
  animation: slideUp 0.6s ease 0.3s both;
}

.map-header {
  margin-bottom: 16px;
}

.map-header h2 {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1.5rem;
  color: var(--forest-deep);
  margin: 0 0 4px 0;
}

.map-note {
  color: var(--ink-light);
  font-size: 0.9rem;
  margin: 0;
}

.observation-map {
  height: 400px;
  border-radius: 8px;
  border: 1px solid var(--parchment-edge);
  background: var(--parchment-dark);
}

.map-legend {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ink-light);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot--recent {
  background: var(--forest);
}

.legend-dot--older {
  background: var(--amber);
}

/* ===== PARKS SECTION ===== */

.parks-section {
  animation: slideUp 0.6s ease 0.35s both;
}

.parks-header {
  margin-bottom: 16px;
}

.parks-header h2 {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1.5rem;
  color: var(--forest-deep);
  margin: 0 0 4px 0;
}

.parks-note {
  color: var(--ink-light);
  font-size: 0.9rem;
  margin: 0;
}

.parks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.parks-empty {
  color: var(--ink-light);
  font-style: italic;
}

.park-card {
  padding: 16px;
  background: var(--parchment);
  border: 1px solid var(--parchment-edge);
  border-radius: 8px;
  transition: var(--transition);
}

.park-card:hover {
  border-color: var(--forest);
  box-shadow: var(--shadow-subtle);
}

.park-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--forest-deep);
  margin: 0 0 8px 0;
}

.park-meta {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin: 0;
}

.park-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--amber-dark);
}

/* ===== EDIBILITY & SAFETY BADGES ===== */

.species-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-family: 'EB Garamond', serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
}

.badge--edible {
  background: rgba(45, 74, 54, 0.15);
  color: var(--forest);
  border: 1px solid var(--forest);
}

.badge--caution {
  background: rgba(193, 127, 36, 0.15);
  color: var(--amber-dark);
  border: 1px solid var(--amber);
}

.badge--toxic {
  background: rgba(139, 69, 19, 0.15);
  color: var(--rust);
  border: 1px solid var(--rust);
}

.badge--lookalike {
  background: rgba(139, 69, 19, 0.1);
  color: var(--rust);
  border: 1px dashed var(--rust);
}

.spore-print {
  font-size: 0.75rem;
  color: var(--ink-light);
  margin-top: 6px;
  font-style: italic;
}

.badge--deadly {
  background: rgba(120, 30, 30, 0.2);
  color: #8b0000;
  border: 1px solid #8b0000;
  font-weight: 600;
}

.badge--inedible {
  background: rgba(100, 100, 100, 0.15);
  color: var(--ink-faded);
  border: 1px solid var(--ink-light);
}

.badge--spore {
  background: rgba(180, 160, 120, 0.15);
  color: var(--ink-faded);
  border: 1px solid var(--parchment-edge);
  font-weight: 400;
}

/* Card badges row */
.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

/* Lookalike warning */
.lookalike-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  margin: 8px 0;
  background: rgba(139, 69, 19, 0.08);
  border: 1px dashed var(--rust);
  border-radius: 6px;
  font-size: 0.8rem;
}

.lookalike-icon {
  flex-shrink: 0;
  color: var(--rust);
}

.lookalike-text {
  color: var(--ink-faded);
  line-height: 1.4;
}

.lookalike-text strong {
  color: var(--rust);
}

/* Species notes */
.species-notes {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-light);
  margin: 6px 0;
  padding-left: 8px;
  border-left: 2px solid var(--parchment-edge);
}

/* Species info link */
.species-link {
  color: var(--forest);
  font-weight: 500;
}

.species-link:hover {
  color: var(--amber-dark);
}

/* ===== FAVORITE BUTTON ===== */

.favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--parchment-edge);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  z-index: 10;
}

.favorite-btn:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}

.favorite-btn[data-favorite="true"] {
  background: var(--amber);
  border-color: var(--amber-dark);
  color: #fff;
}

.action-btn--active {
  background: var(--forest) !important;
  color: #fff;
  border-color: var(--forest-deep) !important;
}

/* ===== STATUS ===== */

.status-wrapper {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.status {
  padding: 12px 24px;
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  background: #fffefa;
  border: 1px solid var(--parchment-edge);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-faded);
  font-style: italic;
}

.status[data-state="loading"] {
  color: var(--forest);
  font-style: normal;
}

.status[data-state="loading"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 1.4s ease-in-out infinite;
}

.status[data-state="success"] {
  background: rgba(74, 107, 79, 0.08);
  border-color: var(--moss);
  color: var(--forest);
}

.status[data-state="error"] {
  background: rgba(139, 69, 19, 0.08);
  border-color: var(--rust);
  color: var(--rust);
}

/* ===== SIGNALS ===== */

.signals {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.signals-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--parchment-edge);
}

.signals-header h2::before {
  content: "§ ";
  color: var(--amber);
}

.signals-header p {
  margin: 0;
  color: var(--ink-light);
  font-style: italic;
}

.signals-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.signal-card {
  padding: 24px;
}

.signal-card h3 {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--parchment-edge);
}

.signal-note {
  margin: 0 0 16px;
  color: var(--ink-light);
  font-size: 0.9rem;
  font-style: italic;
}

.signal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.signal-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--parchment-edge);
}

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

.signal-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 500;
  color: var(--ink);
}

.signal-count {
  font-family: 'EB Garamond', serif;
  font-size: 0.8rem;
  background: var(--parchment-dark);
  padding: 4px 12px;
  color: var(--forest);
  letter-spacing: 0.05em;
}

.signal-sub {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-light);
}

.signal-empty {
  color: var(--ink-light);
  font-style: italic;
}

/* ===== SEASONAL GUIDE ===== */

.seasonal-guide {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.seasonal-header {
  text-align: center;
}

.seasonal-header h2 {
  display: inline-block;
}

.seasonal-header h2::before {
  content: "§ ";
  color: var(--amber);
}

.seasonal-subhead {
  margin: 8px 0 0;
  color: var(--ink-faded);
  font-style: italic;
}

.seasonal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.season-card {
  background: linear-gradient(135deg, #fffdf9 0%, var(--parchment) 100%);
  border: 1px solid var(--parchment-edge);
  padding: 20px;
  position: relative;
  transition: all var(--transition);
}

.season-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--parchment-edge);
  transition: background var(--transition);
}

.season-card--active::before {
  background: var(--amber);
}

.season-card--active {
  border-color: var(--amber);
  box-shadow: var(--shadow-card);
}

.season-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 4px;
  color: var(--forest);
}

.season-months {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--ink-light);
  font-style: italic;
}

.season-species {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.season-species li {
  color: var(--ink-faded);
  padding-left: 12px;
  position: relative;
}

.season-species li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--moss);
}

.season-species li.season-highlight {
  color: var(--ink);
  font-weight: 500;
}

.season-species li.season-highlight::before {
  color: var(--amber);
  content: "★";
  font-size: 0.7em;
}

@media (max-width: 900px) {
  .seasonal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .seasonal-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== GUIDE ===== */

.guide {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: slideUp 0.6s ease 0.2s both;
}

.guide-header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--parchment-edge);
}

.guide-header h2 {
  display: inline-block;
}

.guide-header h2::before,
.guide-header h2::after {
  content: "✦";
  margin: 0 16px;
  font-size: 0.6em;
  color: var(--amber);
  vertical-align: middle;
}

.guide-subhead {
  margin: 12px 0 0;
  color: var(--ink-faded);
  font-style: italic;
}

.guide-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.guide-grid > div {
  position: relative;
  padding-left: 20px;
}

.guide-grid > div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--amber), var(--parchment-edge));
}

.guide-grid h3 {
  margin-bottom: 16px;
}

.guide-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--ink-faded);
}

.guide-list li::marker {
  color: var(--moss);
}

.guide-kit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding-top: 24px;
  border-top: 1px dashed var(--parchment-edge);
}

/* ===== RESULTS ===== */

.results {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--parchment-edge);
}

.results-header h2::before {
  content: "§ ";
  color: var(--amber);
}

.results-header p {
  margin: 0;
  color: var(--ink-light);
  font-style: italic;
}

.results-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Group headers for categorized results */
.results-group-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--parchment-edge);
  margin-top: 20px;
}

.results-group-header:first-child {
  margin-top: 0;
}

.results-group-header h3 {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--forest-deep);
  margin: 0;
  letter-spacing: 0.02em;
}

.results-group-header .group-count {
  background: var(--forest);
  color: var(--parchment);
  font-family: 'EB Garamond', serif;
  font-size: 0.85rem;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

/* Specimen card styling */
.result-card {
  background: linear-gradient(160deg, #fffefa 0%, var(--parchment) 100%);
  border: 1px solid var(--parchment-edge);
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  animation: cardReveal 0.5s ease both;
  animation-delay: var(--delay, 0ms);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
}

/* Specimen label stripe */
.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--forest), var(--moss));
}

.photo-frame {
  height: 180px;
  background: var(--parchment-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--parchment-edge);
  position: relative;
  overflow: hidden;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.result-card:hover .photo-frame img {
  transform: scale(1.05);
}

.photo-missing {
  color: var(--ink-light);
  font-style: italic;
  text-align: center;
  padding: 0 16px;
}

.result-card > *:not(.photo-frame) {
  padding: 0 20px;
}

.result-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin: 16px 0 4px;
  color: var(--ink);
}

.result-card .sci {
  font-style: italic;
  color: var(--ink-light);
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.result-card .meta {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--ink-faded);
  padding-bottom: 16px;
  border-bottom: 1px dotted var(--parchment-edge);
}

.result-card a {
  color: var(--amber-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.result-card a:hover {
  color: var(--amber);
  text-decoration: underline;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding-bottom: 20px !important;
  font-size: 0.9rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px 32px;
  text-align: center;
  color: var(--ink-light);
  font-style: italic;
  background: linear-gradient(135deg, #fffdf9 0%, var(--parchment) 100%);
  border: 1px dashed var(--parchment-edge);
}

/* ===== SAFETY ===== */

.safety {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.6s ease 0.3s both;
  border-left: 3px solid var(--rust);
}

.safety-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.safety-header h2::before {
  content: "⚠ ";
  color: var(--rust);
}

.tag {
  font-family: 'EB Garamond', serif;
  padding: 6px 14px;
  background: rgba(139, 69, 19, 0.1);
  color: var(--rust);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.disclaimer {
  margin: 0;
  color: var(--ink-faded);
  font-weight: 500;
  line-height: 1.6;
}

.tips {
  margin: 0;
  padding-left: 24px;
  color: var(--ink-faded);
  display: grid;
  gap: 8px;
}

.tips li::marker {
  color: var(--rust);
}

/* ===== PILLS ===== */

.pill {
  font-family: 'EB Garamond', serif;
  padding: 6px 16px;
  background: rgba(45, 74, 54, 0.08);
  color: var(--forest);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border: 1px solid rgba(45, 74, 54, 0.15);
}

/* ===== FOOTER ===== */

.footer {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid var(--parchment-edge);
  color: var(--ink-light);
  font-size: 0.9rem;
  font-style: italic;
}

.footer::before {
  content: "— ❦ —";
  display: block;
  margin-bottom: 16px;
  color: var(--ink-light);
  opacity: 0.5;
}

/* ===== DETAIL PAGE ===== */

.detail-shell {
  padding-top: 60px;
}

.detail-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--forest);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--amber-dark);
}

.back-link::before {
  content: "←";
}

.detail-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.detail-photo {
  height: 320px;
  background: var(--parchment-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--parchment-edge);
}

.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-meta {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dotted var(--parchment-edge);
  font-size: 0.95rem;
}

.meta-row span:last-child {
  text-align: right;
  color: var(--ink-faded);
}

.meta-label {
  font-weight: 600;
  color: var(--forest);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.detail-text {
  margin: 0;
  color: var(--ink-faded);
  line-height: 1.7;
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--parchment-edge);
}

.secondary-link {
  color: var(--forest);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

.secondary-link:hover {
  color: var(--amber-dark);
  text-decoration: underline;
}

/* ===== ANIMATIONS ===== */

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

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

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  body::after {
    inset: 8px;
  }

  .shell::before,
  .shell::after {
    display: none;
  }

  .shell {
    padding: 48px 20px 40px;
    gap: 36px;
  }

  .hero {
    padding: 32px 16px;
  }

  .card {
    padding: 24px;
  }

  .control-actions {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }

  .guide-header h2::before,
  .guide-header h2::after {
    display: none;
  }

  .results-header,
  .signals-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .card::before,
  .card::after {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   OBSERVATION SUBMISSION FORM
   ═══════════════════════════════════════════════════════════════════════════ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  color: var(--ink-light);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--amber);
}

.breadcrumb-sep {
  color: var(--ink-light);
  opacity: 0.5;
}

.submit-form-section {
  padding: 0;
  overflow: hidden;
}

.observation-form {
  display: flex;
  flex-direction: column;
}

.form-section {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--parchment-edge);
}

.form-section:last-child {
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--forest);
  color: var(--parchment);
  border-radius: 50%;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1rem;
}

.section-note {
  color: var(--ink-light);
  margin: 0 0 1.5rem 0;
  font-style: italic;
}

/* Photo Upload */
.photo-upload-area {
  border: 2px dashed var(--parchment-edge);
  border-radius: 12px;
  padding: 2rem;
  background: var(--parchment);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 200px;
}

.photo-upload-area:hover,
.photo-upload-area.dragover {
  border-color: var(--forest);
  background: rgba(45, 74, 54, 0.05);
}

.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--ink-light);
  min-height: 150px;
}

.upload-icon {
  opacity: 0.5;
}

.upload-text {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink-faded);
}

.upload-hint {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

.photo-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.photo-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.photo-preview-item:hover .photo-remove {
  opacity: 1;
}

.photo-primary-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: var(--forest);
  color: var(--parchment);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
}

.photo-add-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  aspect-ratio: 1;
  border: 2px dashed var(--parchment-edge);
  border-radius: 8px;
  color: var(--ink-light);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
}

.photo-add-more:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.photo-tips {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(45, 74, 54, 0.06);
  border-radius: 8px;
  border-left: 3px solid var(--forest);
}

.photo-tips h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--forest);
}

.tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.tips-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-faded);
}

.tip-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--moss);
  border-radius: 3px;
  flex-shrink: 0;
}

/* Location Section */
.location-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.location-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--forest);
  border-radius: 6px;
  background: transparent;
  color: var(--forest);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}

.location-btn:hover {
  background: var(--forest);
  color: var(--parchment);
}

.location-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.location-or {
  color: var(--ink-light);
  font-style: italic;
}

.location-instruction {
  color: var(--ink-light);
  font-size: 0.9rem;
}

.location-map {
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--parchment-edge);
  margin-bottom: 1rem;
}

.custom-location-marker {
  background: transparent;
}

.marker-pin {
  width: 30px;
  height: 40px;
  background: var(--forest);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.marker-pin::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--parchment);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.location-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.coord-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.coord-group--wide {
  grid-column: 1 / -1;
}

.coord-group label {
  font-size: 0.85rem;
  color: var(--ink-faded);
}

.coord-group input {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--parchment-edge);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--parchment);
}

.coord-group input:read-only {
  background: var(--parchment-dark);
  color: var(--ink-faded);
}

.location-privacy {
  margin-top: 0.5rem;
}

/* Species Section */
.confidence-selector {
  margin-top: 1.5rem;
}

.confidence-selector > label {
  display: block;
  font-size: 0.95rem;
  color: var(--ink-faded);
  margin-bottom: 0.75rem;
}

.confidence-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.confidence-option {
  flex: 1;
  min-width: 120px;
}

.confidence-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.confidence-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--parchment-edge);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.confidence-option input:checked + .confidence-label {
  border-color: var(--forest);
  background: rgba(45, 74, 54, 0.08);
  color: var(--forest);
}

.confidence-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

/* Species suggestions */
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: background var(--transition);
}

.suggestion-item:hover {
  background: rgba(45, 74, 54, 0.08);
}

.suggestion-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.suggestion-thumb--empty {
  background: var(--parchment-edge);
}

.suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.suggestion-common {
  font-weight: 500;
  color: var(--ink);
}

.suggestion-scientific {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-light);
}

.suggestion-empty {
  padding: 1rem;
  text-align: center;
  color: var(--ink-light);
  font-style: italic;
}

/* Details Section */
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.5rem;
}

.details-grid .field {
  margin-bottom: 0;
}

.details-grid select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--parchment-edge);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--parchment);
  cursor: pointer;
}

.field--full {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.field--full textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--parchment-edge);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 100px;
  background: var(--parchment);
}

/* Submit Section */
.submit-section {
  background: rgba(45, 74, 54, 0.04);
}

.submit-notice {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--parchment);
  border: 1px solid var(--parchment-edge);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.notice-icon {
  color: var(--amber);
  flex-shrink: 0;
}

.notice-text strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.notice-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-faded);
}

.submit-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.submit-actions .primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.submit-actions .primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  display: flex;
}

.submit-note {
  margin: 1.5rem 0 0 0;
  font-size: 0.8rem;
  color: var(--ink-light);
  text-align: center;
}

.submit-note a {
  color: var(--forest);
}

/* Drafts Section */
.drafts-section {
  margin-top: 2rem;
}

.drafts-header {
  margin-bottom: 1.5rem;
}

.drafts-header h2 {
  margin: 0 0 0.25rem 0;
}

.drafts-note {
  margin: 0;
  color: var(--ink-light);
  font-style: italic;
}

.drafts-empty {
  color: var(--ink-light);
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

.drafts-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.draft-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--parchment);
  border: 1px solid var(--parchment-edge);
  border-radius: 8px;
  transition: all var(--transition);
}

.draft-card:hover {
  box-shadow: var(--shadow-subtle);
}

.draft-photo {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.draft-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.draft-photo-empty {
  width: 100%;
  height: 100%;
  background: var(--parchment-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  font-size: 0.75rem;
}

.draft-info {
  flex: 1;
}

.draft-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
}

.draft-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-faded);
}

.draft-saved {
  margin: 0.25rem 0 0 0;
  font-size: 0.8rem;
  color: var(--ink-light);
}

.draft-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-self: center;
}

.draft-edit,
.draft-delete {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--parchment-edge);
  border-radius: 4px;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.draft-edit:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.draft-delete {
  color: var(--rust);
  border-color: transparent;
}

.draft-delete:hover {
  border-color: var(--rust);
}

/* Responsive adjustments for submission form */
@media (max-width: 600px) {
  .form-section {
    padding: 1.5rem;
  }

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

  .location-display {
    grid-template-columns: 1fr;
  }

  .confidence-options {
    flex-direction: column;
  }

  .submit-actions {
    flex-direction: column-reverse;
  }

  .submit-actions button {
    width: 100%;
    justify-content: center;
  }

  .draft-card {
    flex-direction: column;
  }

  .draft-photo {
    width: 100%;
    height: 150px;
  }

  .draft-actions {
    flex-direction: row;
    align-self: stretch;
  }

  .draft-actions button {
    flex: 1;
  }
}

/* ============================================
   PWA Install Banner
   ============================================ */

#pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pwa-install-banner.visible {
  transform: translateY(0);
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--forest-deep);
  color: var(--parchment);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.install-banner-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--parchment);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.install-banner-icon img {
  width: 40px;
  height: 40px;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install-banner-text strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--spore-cream);
}

.install-banner-text span {
  font-size: 0.85rem;
  color: var(--lichen);
  opacity: 0.9;
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.install-btn {
  padding: 10px 24px;
  background: var(--amber);
  color: var(--ink);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.install-btn:hover {
  background: var(--spore-ochre);
  transform: translateY(-1px);
}

.install-btn:active {
  transform: translateY(0);
}

.dismiss-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--lichen);
  border: 1px solid var(--moss);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dismiss-btn:hover {
  background: var(--forest);
  color: var(--parchment);
  border-color: var(--lichen);
}

/* Mobile adjustments for install banner */
@media (max-width: 500px) {
  .install-banner-content {
    flex-wrap: wrap;
    padding: 14px 16px;
    gap: 12px;
  }

  .install-banner-icon {
    width: 44px;
    height: 44px;
  }

  .install-banner-icon img {
    width: 36px;
    height: 36px;
  }

  .install-banner-text {
    flex: 1 1 calc(100% - 100px);
  }

  .install-banner-text strong {
    font-size: 1rem;
  }

  .install-banner-text span {
    font-size: 0.8rem;
  }

  .install-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .install-btn {
    flex: 1;
    padding: 12px 20px;
  }

  .dismiss-btn {
    flex-shrink: 0;
  }
}

/* ============================================
   Mobile Floating Action Button (FAB)
   ============================================ */

.mobile-record-fab {
  display: none;
}

@media (max-width: 600px) {
  .mobile-record-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--forest);
    color: var(--parchment);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(45, 74, 54, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    z-index: 9999;
    transition: all 0.2s ease;
  }

  .mobile-record-fab:hover,
  .mobile-record-fab:active {
    background: var(--forest-deep);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(45, 74, 54, 0.5), 0 3px 6px rgba(0, 0, 0, 0.15);
  }

  .mobile-record-fab svg {
    flex-shrink: 0;
  }

  /* Adjust FAB position when PWA banner is visible */
  #pwa-install-banner.visible ~ .mobile-record-fab,
  body:has(#pwa-install-banner.visible) .mobile-record-fab {
    bottom: 100px;
  }
}

/* ==========================================
   iNaturalist Authentication Styles
   ========================================== */

.auth-section {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 8px;
}

.auth-view {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--forest);
  color: var(--parchment);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-subtle);
}

.btn-login:hover {
  background: var(--forest-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.btn-login svg {
  flex-shrink: 0;
}

.btn-logout {
  padding: 8px 14px;
  background: transparent;
  color: var(--ink-faded);
  border: 1px solid var(--parchment-edge);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-logout:hover {
  background: var(--parchment-dark);
  color: var(--ink);
  border-color: var(--ink-light);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--parchment-edge);
}

.user-name {
  font-weight: 500;
  color: var(--ink);
  font-size: 0.95rem;
}

/* Submit notice states */
.submit-notice--success {
  background: rgba(74, 107, 79, 0.08);
  border-color: var(--moss);
}

.submit-notice--success .notice-icon {
  background: rgba(74, 107, 79, 0.15);
  color: var(--forest);
}

.notice-icon--success {
  background: rgba(74, 107, 79, 0.15) !important;
  color: var(--forest) !important;
}

/* ==========================================
   Computer Vision Suggestions Styles
   ========================================== */

.cv-suggestions {
  margin-top: 20px;
  background: var(--parchment);
  border: 1px solid var(--parchment-edge);
  border-radius: 12px;
  overflow: hidden;
}

.cv-suggestions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(to right, rgba(74, 107, 79, 0.1), transparent);
  border-bottom: 1px solid var(--parchment-edge);
}

.cv-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--forest);
  color: var(--parchment);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cv-badge::before {
  content: "✦";
  font-size: 0.65rem;
}

.cv-hint {
  font-size: 0.8rem;
  color: var(--ink-light);
}

.cv-suggestions-list {
  padding: 8px;
}

.cv-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: var(--ink-faded);
}

.cv-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--parchment-edge);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.cv-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all var(--transition);
}

.cv-suggestion-item:hover {
  background: var(--parchment-dark);
  border-color: var(--parchment-edge);
}

.cv-suggestion-item:active {
  background: rgba(74, 107, 79, 0.1);
  border-color: var(--moss);
}

.cv-suggestion-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--parchment-dark);
  flex-shrink: 0;
}

.cv-suggestion-icon--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  font-size: 1.5rem;
}

.cv-suggestion-icon--empty::after {
  content: "🍄";
}

.cv-suggestion-info {
  flex: 1;
  min-width: 0;
}

.cv-suggestion-name {
  display: block;
  font-weight: 500;
  color: var(--ink);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-suggestion-scientific {
  display: block;
  font-style: italic;
  color: var(--ink-faded);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-suggestion-score {
  flex-shrink: 0;
  padding: 4px 10px;
  background: var(--forest);
  color: var(--parchment);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.cv-disclaimer {
  padding: 12px 16px;
  margin: 0;
  background: var(--parchment-dark);
  border-top: 1px solid var(--parchment-edge);
  font-size: 0.8rem;
  color: var(--ink-light);
  text-align: center;
}

.cv-no-results,
.cv-error {
  padding: 24px;
  text-align: center;
  color: var(--ink-faded);
}

.cv-error {
  color: var(--rust);
}

/* Button spinner */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

/* ==========================================
   Community Features Styles
   ========================================== */

.community-actions {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--parchment-edge);
}

.community-actions h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 20px 0;
}

.action-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--parchment);
  border: 1px solid var(--parchment-edge);
  border-radius: 12px;
}

.action-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px 0;
}

.id-search-container {
  position: relative;
  margin-bottom: 12px;
}

.taxon-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--parchment-edge);
  border-radius: 8px;
  box-shadow: var(--shadow-elevated);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.taxon-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--parchment-edge);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background var(--transition);
}

.taxon-result:last-child {
  border-bottom: none;
}

.taxon-result:hover {
  background: var(--parchment-dark);
}

.taxon-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--parchment-dark);
}

.taxon-info {
  flex: 1;
  min-width: 0;
}

.taxon-name {
  display: block;
  font-weight: 500;
  color: var(--ink);
}

.taxon-scientific {
  display: block;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-faded);
}

/* Community action buttons */
.action-section .btn {
  margin-top: 12px;
}

.action-section textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--parchment-edge);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--transition);
}

.action-section textarea:focus {
  outline: none;
  border-color: var(--moss);
}

/* Mobile auth adjustments */
@media (max-width: 600px) {
  .auth-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .btn-login {
    width: 100%;
    justify-content: center;
  }

  .auth-view {
    width: 100%;
  }

  #logged-in-view {
    justify-content: space-between;
    width: 100%;
  }

  .cv-suggestion-item {
    padding: 10px 8px;
  }

  .cv-suggestion-icon {
    width: 40px;
    height: 40px;
  }

  .cv-suggestion-score {
    padding: 3px 8px;
    font-size: 0.8rem;
  }
}
