/* ── Variables ── */
:root {
  --cream:        #F5F0E8;
  --cream-dark:   #EDE6D6;
  --cream-border: rgba(28,26,22,0.1);
  --ink:          #1C1A16;
  --ink-muted:    #5C5648;
  --terra:        #C4512A;
  --terra-light:  #F0C9B8;
  --terra-dark:   #8C3318;
  --forest:       #2D5A3D;
  --forest-light: #BDD9C5;
  --forest-dark:  #1A3825;
  --gold:         #C8922A;
  --gold-light:   #F5DFA8;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-pill: 999px;

  --shadow-card: 0 2px 12px rgba(28,26,22,0.07), 0 0 0 0.5px rgba(28,26,22,0.06);
  --shadow-lift: 0 6px 28px rgba(28,26,22,0.11), 0 0 0 0.5px rgba(28,26,22,0.06);
  --transition:  0.18s ease;
}

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

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

a { color: var(--terra); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--terra-dark); }

.container-fluid { padding: 0 !important; }

.container-fluid > .row {
  margin: 0 !important;
  min-height: 100vh;
}

/* NAVBAR SEARCH */
.navbar-search-form {
  width: min(100%, 360px);
  gap: 0.5rem;
}

.navbar-search-input {
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--cream-border);
  font-size: 0.875rem;
}

.navbar-search-input:focus {
  border-color: var(--terra-light);
  box-shadow: 0 0 0 0.2rem rgba(196, 81, 42, 0.12);
}

.navbar-search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--terra);
  color: var(--cream);
  width: 38px;
  min-width: 38px;
  height: 38px;
}

.navbar-search-button:hover {
  background: var(--terra-dark);
  color: var(--cream);
}

.navbar-search-button:focus-visible {
  outline: 2px solid var(--terra-light);
  outline-offset: 2px;
}

/* SIDEBAR */
.col-sm-2 {
  background: #fff;
  border-right: 0.5px solid var(--cream-border);
  padding: 0 !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 0.5px solid var(--cream-border);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--terra);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--cream);
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.sidebar-nav {
  list-style: none;
  padding: 0.75rem 0.75rem 0;
  margin: 0;
}

.sidebar-nav + .sidebar-nav {
  padding-top: 0;
  margin-top: auto;
  border-top: 0.5px solid var(--cream-border);
  padding-bottom: 1rem;
}

.sidebar-nav li {
  margin-bottom: 2px;
}

.sidebar-nav li a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-muted);
  transition: background var(--transition), color var(--transition);
}

.sidebar-nav li a:hover {
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
}

.sidebar-nav li a.active {
  background: var(--terra-light);
  color: var(--terra-dark);
  font-weight: 500;
}

/* User info in sidebar */
.sidebar-nav li:has(strong),
.sidebar-user {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  padding: 8px 12px 4px;
}

.sidebar-nav li strong {
  color: var(--ink);
  font-weight: 500;
}

/* Logout button */
.sidebar-nav .btn-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--terra);
  padding: 7px 12px;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.sidebar-nav .btn-link:hover {
  background: var(--terra-light);
  color: var(--terra-dark);
}

/* MAIN CONTENT */
.main-content {
  background: var(--cream);
  padding: 2rem 2.5rem !important;
}

/* AUTH ACTIONS */
.auth-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auth-user {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.auth-user strong {
  color: var(--ink);
  font-weight: 500;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  border: 0.5px solid var(--cream-border);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), color var(--transition);
}

.auth-link:hover {
  background: var(--cream-dark);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.auth-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.auth-action-row .btn-outline-secondary {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.auth-action-row .btn-outline-secondary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.auth-action-row .btn-outline-secondary:active {
  transform: scale(0.98);
}

/* PAGINATION (base_generic block) */
.pagination {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 0.5px solid var(--cream-border);
}

.page-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.page-links a {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 0.5px solid var(--cream-border);
  color: var(--ink);
  font-weight: 500;
  transition: background var(--transition), box-shadow var(--transition);
}

.page-links a:hover {
  background: var(--cream-dark);
  box-shadow: var(--shadow-card);
}

.page-current {
  color: var(--ink-muted);
}

/* HOME — HERO */
.home-hero {
  padding: 3rem 0 2.5rem;
  border-bottom: 0.5px solid var(--cream-border);
  margin-bottom: 2rem;
  position: relative;
}

.home-hero::after {
  content: '';
  position: absolute;
  top: 0; right: -2.5rem;
  width: 360px; height: 360px;
  background: radial-gradient(circle, var(--terra-light) 0%, transparent 65%);
  opacity: 0.35;
  pointer-events: none;
}

.home-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.875rem;
}

.home-hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--terra);
}

.home-hero .lead {
  font-size: 1.0625rem;
  color: var(--ink-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.home-hero .meta-line {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.home-hero .meta-line strong {
  color: var(--ink);
  font-weight: 500;
}

/* SECTION CARDS */
.section-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--cream-border);
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}

.section-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.section-card p {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin-bottom: 0;
  line-height: 1.7;
}

.section-card ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.section-card ul li {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  padding: 5px 0 5px 1.25rem;
  position: relative;
  line-height: 1.6;
  border-bottom: 0.5px solid var(--cream-border);
}

.section-card ul li:last-child { border-bottom: none; }

.section-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terra);
}

.section-card ul li strong {
  color: var(--ink);
  font-weight: 500;
}

/* Section card accent variants */
.section-card--forest { border-left: 3px solid var(--forest); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.section-card--terra  { border-left: 3px solid var(--terra);  border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.section-card--gold   { border-left: 3px solid var(--gold);   border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }

/* RECIPE GRID */
.recipe-grid .card {
  border: 0.5px solid var(--cream-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  background: #fff;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.recipe-grid .card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.recipe-grid .card-img-top {
  height: 160px;
  object-fit: cover;
  border-bottom: 0.5px solid var(--cream-border);
}

.recipe-grid .card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.recipe-grid .card-text {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* badges NEED TO CHECK IF NEEDED AND IMPORTANT IN THIS CASE */ 
.badge.bg-success {
  background: var(--forest) !important;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}

.badge.bg-secondary {
  background: var(--cream-dark) !important;
  color: var(--ink-muted) !important;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}

/* .btn-primary */
.btn-primary {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--terra) !important;
  border: none !important;
  border-radius: var(--radius-pill) !important;
  padding: 8px 18px !important;
  color: var(--cream) !important;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary:hover {
  background: var(--terra-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(196,81,42,0.25) !important;
}

.btn-primary:active {
  transform: scale(0.98) !important;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  opacity: 0.45;
}

/* PAGE HEADER (reusable for other pages) */
.page-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 0.5px solid var(--cream-border);
}

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.25rem;
}

.page-header p {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin: 0;
}

/* UTILITY TAGS / PILLS */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 400;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 0.5px solid transparent;
}

.tag--ingredient {
  background: var(--forest-light);
  color: var(--forest-dark);
  border-color: rgba(45,90,61,0.15);
}

.tag--equipment {
  background: var(--gold-light);
  color: #6B4A0E;
  border-color: rgba(200,146,42,0.2);
}

/* STAR DIFFICULTY FILTER */
.star-filter {
  display: flex;
  gap: 6px;
  align-items: center;
}

.star-filter-btn {
  background: #fff;
  border: 0.5px solid var(--cream-border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 0.875rem;
  color: var(--gold);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition), box-shadow var(--transition);
}

.star-filter-btn:hover,
.star-filter-btn.active {
  background: var(--gold-light);
  box-shadow: var(--shadow-card);
  color: #7A5510;
}

/* RESPONSIVE */
@media (max-width: 576px) {
  .navbar-search-form {
    width: 100%;
    margin-top: 0.5rem;
  }

  .col-sm-2 {
    min-height: auto;
    border-right: none;
    border-bottom: 0.5px solid var(--cream-border);
  }

  .main-content {
    padding: 1.25rem !important;
  }

  .auth-actions {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .home-hero { padding: 2rem 0 1.5rem; }
  .home-hero::after { display: none; }
  .section-card { padding: 1.25rem; }
}

/* Search page redesign */
.search-header {
  display: block;
}

.search-active-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--terra);
  color: var(--cream);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}

.search-panel h2 {
  margin-bottom: 1rem;
}

.search-panel .form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.search-panel .form-control,
.search-panel .form-select {
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--cream-border);
  font-size: 0.9rem;
}

.search-panel .form-control:focus,
.search-panel .form-select:focus {
  border-color: var(--terra-light);
  box-shadow: 0 0 0 0.2rem rgba(196, 81, 42, 0.12);
}

.search-resource-picker-box {
  width: 100%;
  text-align: left;
  border: 0.5px dashed var(--forest);
  background: rgba(189, 217, 197, 0.25);
  color: var(--forest-dark);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.search-resource-picker-box:hover {
  background: rgba(189, 217, 197, 0.4);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.search-resource-picker-box:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

.search-selected-resource-tags,
.search-extra-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-selected-chip {
  gap: 0.45rem;
  padding-right: 0.35rem;
}

.search-selected-chip-remove {
  border: none;
  background: transparent;
  color: var(--forest-dark);
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--radius-pill);
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.search-selected-chip-remove:hover {
  background: rgba(26, 56, 37, 0.12);
}

.search-switch .form-check-input {
  cursor: pointer;
}

.search-switch .form-check-input:checked {
  background-color: var(--forest);
  border-color: var(--forest);
}

.search-switch .form-check-label {
  font-size: 0.9rem;
  color: var(--ink);
}

.search-submit-btn,
.search-reset-btn {
  padding: 14px 18px !important;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
}

.search-reset-btn {
  border: 0.5px solid var(--cream-border);
  background: #fff;
  color: var(--ink-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), box-shadow var(--transition), color var(--transition);
}

.search-reset-btn:hover {
  background: var(--cream-dark);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.search-skeleton-card {
  overflow: hidden;
  border: 0.5px solid var(--cream-border);
  border-radius: var(--radius-md);
}

.search-skeleton-image,
.search-skeleton-line {
  background: linear-gradient(90deg, rgba(237,230,214,0.55) 20%, rgba(245,240,232,0.95) 50%, rgba(237,230,214,0.55) 80%);
  background-size: 240% 100%;
  animation: search-skeleton-wave 1.2s ease-in-out infinite;
}

.search-skeleton-image {
  height: 160px;
  border-bottom: 0.5px solid var(--cream-border);
}

.search-skeleton-line {
  height: 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
}

.search-skeleton-line-lg { width: 88%; }
.search-skeleton-line-sm { width: 56%; }

@keyframes search-skeleton-wave {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Search result card image and metadata enhancements */
.recipe-grid .search-result-card {
  display: flex;
  flex-direction: column;
}

.search-result-image-wrap {
  position: relative;
  overflow: hidden;
  height: 220px;
  border-bottom: 0.5px solid var(--cream-border);
}

.recipe-grid .search-result-card .card-img-top,
.recipe-grid .search-result-card .search-result-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-bottom: none;
}

.search-result-image-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  background: linear-gradient(180deg, rgba(25, 23, 20, 0) 0%, rgba(25, 23, 20, 0.35) 100%);
  pointer-events: none;
}

.search-difficulty-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gold-light);
  color: var(--ink);
  border: 0.5px solid rgba(200, 146, 42, 0.28);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  z-index: 2;
}

.search-count-pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.search-count-pill--used {
  background: rgba(45, 90, 61, 0.13);
  color: var(--forest);
  border: 0.5px solid rgba(45, 90, 61, 0.2);
}

.search-count-pill--missing {
  background: rgba(196, 81, 42, 0.12);
  color: var(--terra-dark);
  border: 0.5px solid rgba(196, 81, 42, 0.22);
}

.search-skeleton-image {
  height: 220px;
}

/* Global responsive hardening for app-wide mobile/tablet support */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.main-content {
  overflow-wrap: anywhere;
}

.main-content table {
  width: 100%;
  border-collapse: collapse;
}

.main-content form input[type="text"],
.main-content form input[type="search"],
.main-content form input[type="email"],
.main-content form input[type="password"],
.main-content form input[type="number"],
.main-content form input[type="file"],
.main-content form select,
.main-content form textarea,
.main-content form .form-control,
.main-content form .form-select,
.main-content form .btn,
.main-content form button {
  max-width: 100%;
}

/* --- HELP DOCUMENTATION CSS --- */
.sticky-toc {
  position: sticky;
  top: 1.5rem;
}

.help-toc-link {
  display: block;
  padding: 0.5rem 0;
  color: var(--obsidian);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--cloud);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.help-toc-link:last-child {
  border-bottom: none;
}

.help-toc-link:hover,
.help-toc-link.active {
  color: var(--terra);
  padding-left: 0.5rem;
}

/* FAQ Accordion Styling */
.faq-accordion {
  margin-bottom: 1rem;
  border: 1px solid var(--forest-light);
  border-radius: var(--radius-sm);
  background: var(--ivory);
  overflow: hidden;
}

.faq-accordion summary {
  padding: 1rem;
  background: var(--forest-light);
  color: var(--forest-dark);
  font-weight: 600;
  cursor: pointer;
  list-style: none; /* remove default arrow */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Custom arrow for summary */
.faq-accordion summary::-webkit-details-marker {
  display: none;
}

.faq-accordion summary::after {
  content: '▼';
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.faq-accordion[open] summary::after {
  transform: rotate(-180deg);
}

.faq-accordion .faq-content {
  padding: 1rem;
  color: var(--obsidian);
  border-top: 1px solid var(--forest-light);
  background: var(--ivory);
}

/* Guest Callout Box */
.guest-callout {
  background: var(--terra-light);
  color: var(--terra-dark);
  padding: 1rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--terra);
}

@media (max-width: 991.98px) {
  .main-content {
    padding: 1.5rem !important;
  }

  .navbar .container-fluid {
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
  }

  .navbar-search-form,
  .navbar .navbar-collapse > form {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .main-content {
    padding: 1.1rem !important;
  }

  .auth-actions {
    justify-content: flex-start;
  }

  .page-links {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .recipe-grid .card-img-top,
  .recipe-grid .search-result-card .card-img-top,
  .recipe-grid .search-result-card .search-result-image,
  .search-result-image-wrap,
  .search-skeleton-image,
  .recipe-image-wrap .card-img-top {
    height: 180px;
  }

  .resource-instance-form,
  .step-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem;
    border: 0.5px solid var(--cream-border);
    border-radius: var(--radius-sm);
    background: #fff;
  }

  .resource-instance-form select,
  .resource-instance-form input,
  .step-form textarea,
  .step-form input,
  .step-form select {
    flex: 1 1 100%;
    min-width: 0;
  }

  .resource-instance-form button,
  .step-form button {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .main-content {
    padding: 0.9rem !important;
  }

  .section-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .section-card--forest,
  .section-card--terra,
  .section-card--gold {
    border-left-width: 2px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }

  .home-hero {
    padding: 1.4rem 0 1.15rem;
  }

  .home-hero h1 {
    font-size: 1.8rem;
  }

  .star-filter {
    flex-wrap: wrap;
  }

  .star-filter-btn {
    flex: 1 1 calc(33.333% - 6px);
    text-align: center;
    min-height: 40px;
  }

  .search-submit-btn,
  .search-reset-btn,
  .btn-primary,
  .auth-link {
    min-height: 42px;
  }

  .main-content form table,
  .main-content form tbody,
  .main-content form tr,
  .main-content form td,
  .main-content form th {
    display: block;
    width: 100%;
  }

  .main-content form tr {
    margin-bottom: 0.65rem;
  }

  .main-content form td,
  .main-content form th {
    padding: 0.15rem 0;
  }

  .main-content form td input,
  .main-content form td select,
  .main-content form td textarea,
  .main-content form td .form-control,
  .main-content form td .form-select {
    width: 100%;
  }
}

@media (max-width: 375px) {
  .main-content {
    padding: 0.75rem !important;
  }

  .navbar-brand {
    font-size: 1rem;
  }

  .page-header {
    margin-bottom: 1.1rem;
    padding-bottom: 0.85rem;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }

  .recipe-grid .card-title {
    font-size: 0.95rem;
  }
}

@media (min-width: 992px) {
  #search-real-results .recipe-grid > .col-lg-4 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

.recipe-grid .card {
  display: flex;
  flex-direction: column;
}

.recipe-image-wrap {
  position: relative;
  overflow: hidden;
  border-bottom: 0.5px solid var(--cream-border);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.recipe-grid .card-img-top {
  height: 220px;
  width: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.recipe-image-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.14) 42%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
}

.recipe-difficulty-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--gold-light);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-card);
}

.recipe-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.recipe-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  border: 0.5px solid transparent;
}

.recipe-meta-pill--used {
  background: var(--forest-light);
  color: var(--forest);
  border-color: rgba(45, 90, 61, 0.2);
}

.recipe-meta-pill--missing {
  background: rgba(196, 81, 42, 0.12);
  color: var(--terra);
  border-color: rgba(196, 81, 42, 0.25);
}

.search-skeleton-image {
  height: 220px;
}