/* =============================================
   COFFEE FEVER — Style Sheet
   Warm & Minimal Design System
   ============================================= */

:root {
  --bg:          #FAF8F5;
  --surface:     #F0EBE3;
  --surface-alt: #E8E0D6;
  --accent:      #C8956B;
  --accent-dark: #A67550;
  --accent-light:#F0DDD0;
  --text:        #1C1208;
  --text-muted:  #8A7060;
  --text-light:  #B09080;
  --highlight:   #E8D5B7;
  --border:      #E2D9CE;
  --white:       #FFFFFF;
  --green:       #5C7A6B;
  --green-light: #E8F0EC;
  --red:         #9B3A2A;
  --gold:        #C8956B;
  --shadow-sm:   rgba(28, 18, 8, 0.06);
  --shadow-md:   rgba(28, 18, 8, 0.10);
  --shadow-lg:   rgba(28, 18, 8, 0.16);
  --radius:      16px;
  --radius-sm:   10px;
  --radius-xs:   6px;
  --font-display:'Playfair Display', Georgia, serif;
  --font-body:   'DM Sans', system-ui, sans-serif;
  --font-mono:   'DM Mono', monospace;
  --transition:  0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- HEADER ---- */
.site-header {
  background: var(--text);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 4px 24px rgba(28,18,8,0.25);
}

.header-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 0 2rem;
  display: flex; align-items: center; gap: 2rem;
  height: 68px;
}

.logo-block {
  display: flex; align-items: center; gap: 0.75rem;
  flex-shrink: 0; text-decoration: none;
}

.logo-icon { font-size: 1.6rem; line-height: 1; }

.site-title {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700;
  color: var(--white); line-height: 1.1;
  letter-spacing: -0.01em;
}

.site-title em {
  color: var(--accent);
  font-style: italic;
}

.site-tagline {
  font-size: 0.68rem; color: rgba(255,255,255,0.45);
  font-weight: 300; letter-spacing: 0.06em;
  text-transform: uppercase;
}

.main-nav {
  display: flex; gap: 0.125rem;
  flex: 1; justify-content: center;
}

.nav-link {
  color: rgba(255,255,255,0.6); text-decoration: none;
  font-size: 0.875rem; font-weight: 400;
  padding: 0.4rem 1rem; border-radius: var(--radius-xs);
  transition: all var(--transition); letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.nav-link.active {
  color: var(--text);
  background: var(--accent);
  font-weight: 500;
}

.header-actions {
  display: flex; align-items: center; gap: 0.5rem;
  margin-left: auto; flex-shrink: 0;
}

/* ---- ADMIN LOCK BUTTON ---- */
.admin-lock-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.55);
  font-size: 1rem; width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.admin-lock-btn:hover {
  background: rgba(255,255,255,0.14);
  color: var(--white);
}
.admin-lock-btn.unlocked {
  background: rgba(200,149,107,0.2);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- HAMBURGER ---- */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: rgba(255,255,255,0.7); border-radius: 2px;
  transition: all 0.3s;
}

/* ---- SEARCH BAR ---- */
.search-bar-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  position: sticky; top: 68px; z-index: 100;
}

.search-bar-inner {
  flex: 1; max-width: 640px;
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 1rem;
  transition: border-color var(--transition);
}

.search-bar-inner:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,149,107,0.12);
}

.search-icon { color: var(--text-light); font-size: 1.2rem; flex-shrink: 0; }

.global-search {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font-body);
  font-size: 0.925rem; font-weight: 400;
}
.global-search::placeholder { color: var(--text-light); }

.search-clear {
  background: none; border: none; color: var(--text-light);
  cursor: pointer; font-size: 0.8rem; padding: 2px 6px;
  border-radius: 4px; transition: color var(--transition);
  display: none;
}
.search-clear:hover { color: var(--text); }
.search-clear.visible { display: block; }

/* ---- ADMIN BADGE ---- */
.admin-badge {
  display: flex; align-items: center; gap: 0.75rem;
  background: rgba(200,149,107,0.12);
  border: 1px solid rgba(200,149,107,0.3);
  border-radius: var(--radius-xs);
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem; font-weight: 500;
  color: var(--accent-dark);
}

.admin-badge-lock {
  background: none; border: 1px solid var(--accent);
  color: var(--accent); font-size: 0.75rem;
  padding: 0.1rem 0.5rem; border-radius: 4px;
  cursor: pointer; font-family: var(--font-body);
  transition: all var(--transition);
}
.admin-badge-lock:hover { background: var(--accent); color: var(--white); }

/* ---- LAYOUT ---- */
.main-content {
  max-width: 1320px; margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

.section { display: none; }
.section.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 700;
  color: var(--text); line-height: 1.1;
}

.section-sub {
  color: var(--text-muted); font-size: 0.9rem;
  margin-top: 0.25rem; font-style: italic;
}

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent); color: var(--white);
  border: none; cursor: pointer;
  padding: 0.6rem 1.25rem; border-radius: var(--radius-xs);
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 500;
  transition: all var(--transition); white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(200,149,107,0.3);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(200,149,107,0.4);
}

.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--white); color: var(--text-muted);
  border: 1.5px solid var(--border); cursor: pointer;
  padding: 0.55rem 1rem; border-radius: var(--radius-xs);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 400;
  transition: all var(--transition); white-space: nowrap;
  text-decoration: none;
}
.btn-secondary:hover {
  border-color: var(--text-muted); color: var(--text);
  background: var(--surface);
}

.btn-danger {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--white); color: #c0392b;
  border: 1.5px solid #e8c4c0; cursor: pointer;
  padding: 0.55rem 1rem; border-radius: var(--radius-xs);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 400;
  transition: all var(--transition); white-space: nowrap;
}
.btn-danger:hover { background: #fdf0ef; border-color: #c0392b; }

/* ---- STAT STRIP ---- */
.stat-strip {
  display: flex; gap: 0; flex-wrap: wrap;
  margin-bottom: 2.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow-sm);
}

.stat-strip-item {
  flex: 1; min-width: 120px;
  padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--border);
  text-align: center;
  transition: background var(--transition);
}

.stat-strip-item:last-child { border-right: none; }
.stat-strip-item:hover { background: var(--surface); }

.stat-strip-num {
  font-family: var(--font-display);
  font-size: 2.25rem; font-weight: 700;
  color: var(--accent); line-height: 1;
}

.stat-strip-label {
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 0.3rem; text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 500;
}

/* ---- FILTER BAR ---- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.875rem; align-items: flex-end;
  margin-bottom: 2rem;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: 0 2px 8px var(--shadow-sm);
}

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

.filter-label {
  font-size: 0.72rem; font-weight: 500; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}

.filter-select {
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--text); font-family: var(--font-body);
  font-size: 0.875rem; padding: 0.4rem 0.75rem;
  border-radius: var(--radius-xs); cursor: pointer;
  transition: border-color var(--transition); min-width: 140px;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A7060' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}
.filter-select:focus { outline: none; border-color: var(--accent); }

.filter-reset {
  background: none; border: 1.5px solid var(--border);
  color: var(--text-muted); font-family: var(--font-body);
  font-size: 0.85rem; padding: 0.4rem 0.9rem;
  border-radius: var(--radius-xs); cursor: pointer;
  transition: all var(--transition); align-self: flex-end;
}
.filter-reset:hover { border-color: var(--red); color: var(--red); }

/* ---- CARD IMAGE ---- */
.card-image {
  height: 180px; overflow: hidden;
  background: var(--surface);
  position: relative;
}

.card-image img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card-image--fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
}

.card-image--fallback::after {
  content: "☕";
  font-size: 2.75rem; opacity: 0.2;
}

/* ---- JOURNAL GRID ---- */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.875rem;
}

/* Compact journal card */
.journal-card--compact {
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 1.1rem 1.25rem 0.9rem;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 108px;
}
.journal-card--compact:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-md);
  border-color: var(--accent-light);
}

.jc-name {
  font-family: var(--font-display);
  font-size: 1rem; color: var(--text); font-weight: 600;
  line-height: 1.3; margin-bottom: 0.2rem;
}
.jc-method {
  font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: auto;
}
.jc-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
.jc-stars { color: var(--accent); font-size: 0.8rem; letter-spacing: -0.05em; }
.jc-date { font-size: 0.7rem; color: var(--text-light); font-family: var(--font-mono); }

.roast-badge {
  background: var(--surface); color: var(--text-muted);
  font-size: 0.7rem; font-weight: 500; padding: 0.2rem 0.55rem;
  border-radius: 20px; letter-spacing: 0.03em;
  border: 1px solid var(--border); white-space: nowrap;
  flex-shrink: 0; margin-left: 0.5rem;
}

.meta-chip {
  display: flex; align-items: center; gap: 0.25rem;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.775rem; color: var(--text-muted);
  padding: 0.2rem 0.55rem; border-radius: 20px;
}

.journal-scores {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem; margin-bottom: 0.875rem;
}

.score-item { text-align: center; }
.score-label { font-size: 0.62rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }
.score-bar-wrap { height: 3px; background: var(--surface); border-radius: 2px; margin: 4px 0; overflow: hidden; }
.score-bar { height: 100%; background: linear-gradient(90deg, var(--accent-light), var(--accent)); border-radius: 2px; transition: width 0.6s ease; }
.score-num { font-size: 0.75rem; font-weight: 600; color: var(--accent); font-family: var(--font-mono); }

.journal-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.75rem; }

.taste-tag {
  font-size: 0.71rem; padding: 0.18rem 0.55rem; border-radius: 20px;
  border: 1px solid; font-weight: 500;
}
.taste-tag.fruity { background: #fff3f0; color: #9b3a2a; border-color: #f5c8c0; }
.taste-tag.chocolatey { background: #fdf0e6; color: #7a4a20; border-color: #e8c8a0; }
.taste-tag.floral { background: #f8f0f8; color: #7a4a7a; border-color: #dcc0dc; }
.taste-tag.earthy { background: #f0f0e8; color: #5a5a30; border-color: #d0d0a8; }
.taste-tag.caramel { background: #fdf5e0; color: #8a6010; border-color: #e8d080; }
.taste-tag.spicy { background: #fdf0e8; color: #8a4010; border-color: #e8c0a0; }
.taste-tag.citrus { background: #f8f8e8; color: #6a6a00; border-color: #d8d880; }
.taste-tag.nutty { background: #f5ede0; color: #6a4820; border-color: #d8c0a0; }
.taste-tag.brown-sugar { background: #fdf4e0; color: #7a5010; border-color: #e8c870; }
.taste-tag.default { background: var(--surface); color: var(--text-muted); border-color: var(--border); }

.journal-date { font-size: 0.775rem; color: var(--text-light); font-family: var(--font-mono); }

.star-rating { color: var(--accent); font-size: 0.85rem; letter-spacing: -0.05em; }

/* ---- COFFEE CATALOG ---- */
.catalog-tabs {
  display: flex; gap: 0.5rem; margin-bottom: 2rem;
}

.catalog-tab {
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-muted); font-family: var(--font-body);
  font-size: 0.875rem; font-weight: 400;
  padding: 0.5rem 1.25rem; border-radius: 20px;
  cursor: pointer; transition: all var(--transition);
}
.catalog-tab:hover { border-color: var(--accent); color: var(--accent); }
.catalog-tab.active {
  background: var(--text); color: var(--white);
  border-color: var(--text); font-weight: 500;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.coffee-card {
  background: var(--white);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  box-shadow: 0 2px 12px var(--shadow-sm);
}
.coffee-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px var(--shadow-md);
}
.coffee-card:hover .card-image img { transform: scale(1.04); }

.coffee-card-body { padding: 1.25rem 1.5rem; }

.coffee-card-name {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 600; color: var(--text);
  line-height: 1.2; margin-bottom: 0.2rem;
}

.coffee-card-roaster { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.coffee-card-meta {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.875rem;
}

.coffee-process-tag {
  font-size: 0.7rem; font-weight: 500;
  padding: 0.18rem 0.55rem; border-radius: 20px;
  background: var(--accent-light); color: var(--accent-dark);
  border: 1px solid rgba(200,149,107,0.3);
}

.status-current {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 500;
  padding: 0.18rem 0.55rem; border-radius: 20px;
  background: var(--green-light); color: var(--green);
  border: 1px solid rgba(92,122,107,0.25);
}

.status-past {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 500;
  padding: 0.18rem 0.55rem; border-radius: 20px;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border);
}

.coffee-card-footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}

.coffee-date { font-size: 0.775rem; color: var(--text-light); font-family: var(--font-mono); }

/* ---- ROASTERS ---- */
.roaster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.roaster-card {
  background: var(--white);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  box-shadow: 0 2px 12px var(--shadow-sm);
}
.roaster-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px var(--shadow-md);
}
.roaster-card:hover .card-image img { transform: scale(1.04); }

.roaster-card-body { padding: 1.25rem 1.5rem; }

.roaster-name {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  margin-bottom: 0.2rem;
}

.roaster-location {
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.3rem;
}

.roaster-desc {
  font-size: 0.875rem; color: var(--text-muted); line-height: 1.65;
  margin-bottom: 1rem;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.roaster-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.roaster-tag {
  font-size: 0.73rem; background: var(--surface);
  color: var(--text-muted); border: 1px solid var(--border);
  padding: 0.18rem 0.6rem; border-radius: 20px;
}

.roaster-levels { display: flex; align-items: center; gap: 0.3rem; }
.level-dot {
  width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--border);
}
.level-dot.light { background: #e8d5b0; }
.level-dot.mediumlight { background: #d4a870; }
.level-dot.medium { background: #b07840; }
.level-dot.mediumdark { background: #7a4e28; }
.level-dot.dark { background: #3a2010; }

.roaster-card-footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}

/* ---- GEAR ---- */
.gear-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gear-card {
  background: var(--white);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  box-shadow: 0 2px 12px var(--shadow-sm);
}
.gear-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px var(--shadow-md);
}
.gear-card:hover .card-image img { transform: scale(1.04); }

.gear-type-badge {
  position: absolute; top: 0.75rem; left: 0.75rem;
  background: rgba(28,18,8,0.72); backdrop-filter: blur(4px);
  color: var(--white);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem; border-radius: 4px;
  text-transform: uppercase;
}

.gear-card-body { padding: 1.25rem 1.5rem; }

.gear-name {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  margin-bottom: 0.5rem;
}

.gear-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 0.875rem; }

.gear-grind {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 0.4rem 0.75rem; border-radius: var(--radius-xs);
}

/* ---- RECIPES ---- */
.recipe-filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem;
}

.recipe-filter-btn {
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-muted); font-family: var(--font-body);
  font-size: 0.85rem; padding: 0.4rem 1rem;
  border-radius: 20px; cursor: pointer; transition: all var(--transition);
}
.recipe-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.recipe-filter-btn.active { background: var(--accent); color: var(--white); border-color: var(--accent); }

.recipe-list { display: flex; flex-direction: column; gap: 1rem; }

.recipe-card {
  background: var(--white);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow-sm);
}

.recipe-card-header {
  padding: 1.25rem 1.75rem;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.recipe-card-header:hover { background: var(--surface); }

.recipe-title {
  font-family: var(--font-display);
  font-size: 1.1rem; color: var(--text); font-weight: 600;
}

.recipe-meta-row {
  display: flex; gap: 1.25rem; margin-top: 0.3rem; flex-wrap: wrap;
}

.recipe-meta-item { font-size: 0.78rem; color: var(--text-muted); }
.recipe-meta-item strong { color: var(--accent); font-weight: 600; }

.recipe-toggle {
  color: var(--text-muted); font-size: 1rem; transition: transform 0.3s;
  flex-shrink: 0;
}
.recipe-card.open .recipe-toggle { transform: rotate(180deg); }

.recipe-card-body {
  display: none; padding: 1.5rem 1.75rem;
  border-top: 1px solid var(--border);
}
.recipe-card.open .recipe-card-body { display: block; }

.recipe-info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem; margin-bottom: 1.5rem;
}

.recipe-info-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 0.6rem 0.875rem;
}
.recipe-info-label { font-size: 0.68rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.06em; }
.recipe-info-value { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-top: 0.15rem; font-family: var(--font-mono); }

.recipe-steps-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 500;
}

.recipe-steps { list-style: none; margin-bottom: 1.25rem; }
.recipe-step {
  display: flex; gap: 1rem; padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.recipe-step:last-child { border-bottom: none; }

.step-time {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--accent); min-width: 46px; font-weight: 600; flex-shrink: 0;
}
.step-action { font-size: 0.875rem; color: var(--text); line-height: 1.55; }

.recipe-notes-box {
  background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 0.75rem 1rem; font-size: 0.84rem;
  color: var(--text-muted); font-style: italic; line-height: 1.6;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  grid-column: 1 / -1; text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 {
  font-family: var(--font-display); font-size: 1.35rem;
  color: var(--text); margin-bottom: 0.5rem;
}
.empty-state p {
  max-width: 380px; margin: 0 auto; font-size: 0.9rem;
  line-height: 1.6; color: var(--text-muted);
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(28, 18, 8, 0.55); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 2rem;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--white); border-radius: var(--radius);
  max-width: 700px; width: 100%; max-height: 92vh; overflow-y: auto;
  position: relative; box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  animation: slideUp 0.25s ease;
}

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

.modal-close {
  position: sticky; top: 0.75rem; left: calc(100% - 2.75rem);
  float: right; margin: 0.75rem 0.75rem 0 0;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; color: var(--text-muted);
  font-size: 0.85rem; width: 30px; height: 30px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); z-index: 10;
}
.modal-close:hover { background: var(--surface-alt); color: var(--text); }

.modal-body { padding: 2rem; clear: both; }

/* Modal image hero */
.modal-hero {
  width: 100%; height: 240px; object-fit: cover;
  display: block; border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
}

/* ---- ADMIN PANEL (sliding drawer) ---- */
.admin-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 340px; z-index: 500;
  background: var(--white);
  box-shadow: -4px 0 32px rgba(28,18,8,0.16);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.admin-panel.open { transform: translateX(0); }

.admin-panel-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 499;
  background: rgba(28,18,8,0.35); backdrop-filter: blur(2px);
}
.admin-panel-overlay.visible { display: block; }

.admin-panel-inner { padding: 1.5rem; }

.admin-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-panel-title {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 600; color: var(--text);
}

.admin-panel-close {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; transition: all var(--transition);
}
.admin-panel-close:hover { background: var(--surface-alt); color: var(--text); }

.admin-label {
  display: block; font-size: 0.75rem; font-weight: 500;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 0.4rem;
}

.admin-input {
  width: 100%; background: var(--bg); border: 1.5px solid var(--border);
  color: var(--text); font-family: var(--font-body);
  font-size: 0.9rem; padding: 0.5rem 0.875rem;
  border-radius: var(--radius-xs); transition: border-color var(--transition);
  outline: none;
}
.admin-input:focus { border-color: var(--accent); }

.admin-field { margin-bottom: 1rem; }

.admin-hint {
  font-size: 0.82rem; color: var(--text-muted);
  line-height: 1.55; margin-bottom: 1rem;
}
.admin-hint code {
  background: var(--surface); padding: 0.05rem 0.35rem;
  border-radius: 4px; font-size: 0.8rem; font-family: var(--font-mono);
}

.admin-pat-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem;
  margin-bottom: 1rem;
}

.admin-pat-row {
  display: flex; gap: 0.5rem; margin-top: 0.5rem;
}

.admin-pat-row .admin-input { flex: 1; }

.admin-pat-status {
  font-size: 0.78rem; margin-top: 0.35rem;
  min-height: 1rem;
}
.admin-pat-status.ok { color: var(--green); }
.admin-pat-status.err { color: var(--red); }

.admin-setup-note {
  font-size: 0.78rem; color: var(--text-muted);
  font-style: italic; margin-top: 0.5rem;
}

/* ---- ADMIN FORMS (inside modal) ---- */
.admin-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; }

.form-field { display: flex; flex-direction: column; gap: 0.35rem; }

.form-label {
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-label span { color: var(--red); }

.form-input, .form-select, .form-textarea {
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--text); font-family: var(--font-body);
  font-size: 0.9rem; padding: 0.5rem 0.875rem;
  border-radius: var(--radius-xs); transition: border-color var(--transition);
  outline: none; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,149,107,0.1);
}

.form-select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A7060' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-textarea { resize: vertical; min-height: 90px; line-height: 1.55; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; }

.form-hint { font-size: 0.78rem; color: var(--text-light); }

/* Image upload */
.form-image-upload {
  border: 1.5px dashed var(--border); border-radius: var(--radius-xs);
  padding: 1rem; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.form-image-upload:hover { border-color: var(--accent); background: var(--accent-light); }
.form-image-upload input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.form-image-upload-label {
  font-size: 0.85rem; color: var(--text-muted); pointer-events: none;
}
.form-image-preview {
  width: 100%; height: 140px; object-fit: cover;
  border-radius: var(--radius-xs); margin-top: 0.75rem; display: none;
}

/* Score sliders */
.score-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.score-field { display: flex; flex-direction: column; gap: 0.3rem; }
.score-field-label {
  font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.score-range-wrap { display: flex; align-items: center; gap: 0.6rem; }
.score-range { flex: 1; accent-color: var(--accent); cursor: pointer; }
.score-preview {
  font-family: var(--font-mono); font-size: 0.875rem;
  font-weight: 600; color: var(--accent); min-width: 1.5rem; text-align: right;
}

/* Star rating input */
.star-rating-input { display: flex; gap: 0.25rem; flex-direction: row-reverse; justify-content: flex-end; }
.star-rating-input input { display: none; }
.star-rating-input label {
  font-size: 1.5rem; color: var(--border); cursor: pointer;
  transition: color var(--transition); line-height: 1;
}
.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
  color: var(--accent);
}

/* Taste tags input */
.taste-tags-input {
  width: 100%;
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--text); font-family: var(--font-body);
  font-size: 0.9rem; padding: 0.5rem 0.875rem;
  border-radius: var(--radius-xs); transition: border-color var(--transition);
  outline: none;
}
.taste-tags-input:focus { border-color: var(--accent); }

/* Form actions */
.form-actions {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  margin-top: 0.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.form-saving {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: var(--text-muted); font-style: italic;
}

/* Edit button (on cards, admin mode only) */
.card-edit-btn {
  background: rgba(255,255,255,0.9); border: 1px solid var(--border);
  border-radius: var(--radius-xs); font-size: 0.75rem; font-weight: 500;
  color: var(--text-muted); padding: 0.2rem 0.6rem;
  cursor: pointer; transition: all var(--transition);
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 5;
}
.card-edit-btn:hover { background: var(--white); color: var(--accent); border-color: var(--accent); }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 2000;
  background: var(--text); color: var(--white);
  padding: 0.75rem 1.25rem; border-radius: var(--radius-xs);
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(28,18,8,0.3);
  transform: translateY(120px); opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px; line-height: 1.4;
}
.toast.show { transform: none; opacity: 1; }
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error { border-left: 3px solid var(--red); }

/* ---- FOOTER ---- */
.site-footer {
  text-align: center; padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.84rem;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { color: var(--accent-dark); text-decoration: underline; }

/* ---- SEARCH HIGHLIGHT ---- */
.search-highlight {
  background: var(--highlight); border-radius: 2px; padding: 0 2px;
}

/* ---- LOADING / SKELETON ---- */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-alt) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---- MODAL DETAIL COMPONENTS ---- */
.modal-detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem; margin-bottom: 1.5rem;
}

.modal-detail-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 0.6rem 0.875rem;
}

.modal-detail-label {
  font-size: 0.68rem; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.modal-detail-value {
  font-size: 0.875rem; font-weight: 600; color: var(--text);
  margin-top: 0.15rem; font-family: var(--font-mono);
}

.modal-section-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 0.75rem;
  font-weight: 500; margin-top: 1.25rem;
}

.modal-entry-list { display: flex; flex-direction: column; gap: 0.5rem; }

.modal-entry-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 0.75rem 1rem;
  cursor: pointer; transition: background var(--transition);
}
.modal-entry-item:hover { background: var(--surface-alt); }

.modal-entry-name { font-weight: 500; font-family: var(--font-display); font-size: 0.95rem; }
.modal-entry-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .header-inner { padding: 0 1rem; height: 60px; }
  .main-nav {
    display: none; flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--text); padding: 0.75rem; gap: 0.25rem;
    border-bottom: 2px solid var(--accent);
  }
  .main-nav.open { display: flex; }
  .nav-link { padding: 0.65rem 1rem; border-radius: var(--radius-xs); text-align: center; }
  .hamburger { display: flex; }
  .search-bar-wrap { top: 60px; padding: 0.6rem 1rem; flex-direction: column; align-items: stretch; }
  .admin-badge { justify-content: space-between; }
  .main-content { padding: 1.5rem 1rem 3rem; }
  .section-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .filter-bar { padding: 1rem; gap: 0.75rem; }
  .filter-select { min-width: 0; width: 100%; }
  .filter-group { width: calc(50% - 0.375rem); }
  .journal-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .journal-card--compact { min-height: 96px; }
  .catalog-grid { grid-template-columns: 1fr; }
  .roaster-grid { grid-template-columns: 1fr; }
  .gear-grid { grid-template-columns: 1fr; }
  .stat-strip { flex-wrap: wrap; }
  .stat-strip-item { min-width: 50%; }
  .recipe-card-header { flex-direction: column; gap: 0.4rem; align-items: flex-start; }
  .recipe-meta-row { flex-wrap: wrap; gap: 0.6rem; }
  .admin-panel { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .score-fields { grid-template-columns: 1fr; }
  .modal { border-radius: var(--radius) var(--radius) 0 0; align-self: flex-end; margin: 0; max-width: 100%; }
  .modal-overlay { padding: 0; align-items: flex-end; }
}

@media (max-width: 480px) {
  .site-title { font-size: 1.1rem; }
  .site-tagline { display: none; }
  .section-title { font-size: 1.6rem; }
  .stat-strip-item { min-width: 50%; }
  .catalog-tabs { flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---- BAG OPENED TOGGLE ---- */
.bag-toggle {
  font-size: 0.7rem; font-weight: 500; padding: 0.15rem 0.5rem;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  cursor: pointer; transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.bag-toggle:hover { background: var(--accent-light); color: var(--accent-dark); border-color: var(--accent-light); }
.bag-toggle.opened { background: var(--accent-light); color: var(--accent-dark); border-color: var(--accent-light); }
.bag-toggle.no-click { cursor: default; pointer-events: none; }

/* ---- LASTED CHIP ---- */
.lasted-chip {
  font-size: 0.68rem; font-weight: 500; padding: 0.15rem 0.45rem;
  border-radius: 20px; background: var(--surface-alt); color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ---- COST FORM INPUT ---- */
.form-input-prefix-wrap { position: relative; display: flex; align-items: center; }
.form-input-prefix {
  position: absolute; left: 0.75rem; color: var(--text-muted);
  font-size: 0.875rem; pointer-events: none; z-index: 1;
}
.form-input--prefixed { padding-left: 1.75rem; }

/* ---- SPEND SECTION ---- */
.spend-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.spend-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem 1.75rem;
  text-align: center;
  box-shadow: 0 2px 8px var(--shadow-sm);
}
.spend-card-amount {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.spend-card-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.spend-card-sub { font-size: 0.75rem; color: var(--text-light); font-family: var(--font-mono); margin-top: 0.25rem; }

.spend-breakdown {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.spend-breakdown-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.75rem; }
.spend-breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.spend-breakdown-row:last-child { border-bottom: none; }
.spend-breakdown-amt { font-family: var(--font-mono); font-weight: 600; color: var(--text); }

.spend-list-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.75rem; }
.spend-list { display: flex; flex-direction: column; gap: 0.4rem; }
.spend-list-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem 1.25rem;
}
.spend-list-left { display: flex; align-items: center; gap: 0.75rem; }
.spend-list-icon { font-size: 1.1rem; }
.spend-list-name { font-size: 0.9rem; color: var(--text); font-weight: 500; }
.spend-list-date { font-size: 0.75rem; color: var(--text-light); font-family: var(--font-mono); margin-top: 0.1rem; }
.spend-list-cost { font-family: var(--font-mono); font-weight: 600; color: var(--accent); font-size: 0.95rem; }

/* ---- RECIPE STEP FORM ROWS ---- */
.recipe-step-row {
  display: grid;
  grid-template-columns: 70px 1fr 32px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.step-time-input { font-family: var(--font-mono); text-align: center; }
.recipe-step-remove {
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  cursor: pointer; font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.recipe-step-remove:hover { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

/* ---- FRESHNESS CHIP ---- */
.freshness-chip {
  font-size: 0.68rem; font-weight: 500; padding: 0.15rem 0.5rem;
  border-radius: 20px; border: 1px solid; white-space: nowrap;
}
.fresh-pre    { background: #f0f0f0; color: #666; border-color: #ddd; }
.fresh-early  { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.fresh-peak   { background: #dcfce7; color: #166534; border-color: #86efac; }
.fresh-good   { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.fresh-fading { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.fresh-stale  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ---- WISHLIST STATUS ---- */
.status-wishlist {
  font-size: 0.7rem; font-weight: 600; color: #7c3aed;
  background: #ede9fe; padding: 0.2rem 0.55rem;
  border-radius: 20px; border: 1px solid #c4b5fd;
}

/* ---- INSIGHTS SECTION ---- */
.insights-grid { display: flex; flex-direction: column; gap: 1.5rem; }

.insight-quick-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.insight-quick-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.25rem 1.5rem; text-align: center;
}
.iq-val {
  font-family: var(--font-display); font-size: 1.4rem;
  color: var(--accent); font-weight: 600; margin-bottom: 0.25rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.iq-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.insight-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.75rem;
}
.insight-card-title {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 1.25rem;
}

.insight-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.insight-bar-row { display: grid; grid-template-columns: 120px 1fr 32px; gap: 0.75rem; align-items: center; }
.insight-bar-label { font-size: 0.85rem; color: var(--text); }
.insight-bar-track { height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.insight-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-light), var(--accent)); border-radius: 4px; transition: width 0.6s ease; }
.insight-bar-count { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); text-align: right; }

.insight-method-table { display: flex; flex-direction: column; }
.insight-method-header {
  display: grid; grid-template-columns: 1fr 60px 80px 90px;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-light); padding: 0 0 0.5rem; border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}
.insight-method-row {
  display: grid; grid-template-columns: 1fr 60px 80px 90px;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border); align-items: center;
  font-size: 0.875rem;
}
.insight-method-row:last-child { border-bottom: none; }
.insight-method-name { color: var(--text); }
.insight-method-num { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.83rem; }

.insight-top-list { display: flex; flex-direction: column; gap: 0.5rem; }
.insight-top-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.insight-top-item:last-child { border-bottom: none; }
.insight-top-rank {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); color: var(--text-muted);
  font-size: 0.75rem; font-weight: 700; font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.insight-top-info { flex: 1; min-width: 0; }
.insight-top-name { font-size: 0.9rem; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insight-top-sub { font-size: 0.75rem; color: var(--text-light); margin-top: 0.1rem; }
.insight-top-rating { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; color: var(--accent); font-size: 0.85rem; }

/* ---- BEAN TYPE TAG ---- */
.bean-type-tag {
  font-size: 0.68rem; font-weight: 500; padding: 0.15rem 0.45rem;
  border-radius: 20px; background: var(--surface-alt); color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ---- BTN-LINK ---- */
.btn-link {
  background: none; border: none; padding: 0;
  color: var(--accent); font-family: var(--font-body);
  font-size: 0.82rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
  margin-top: 0.4rem; display: inline-block;
}
.btn-link:hover { color: var(--accent-dark); }

/* ============================
   SIDEBAR LAYOUT (desktop ≥900px)
   ============================ */
:root { --sidebar-w: 220px; }

@media (min-width: 900px) {
  .site-header {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    overflow-y: auto;
    flex-direction: column;
    z-index: 200;
    box-shadow: 1px 0 0 rgba(255,255,255,0.06), 4px 0 20px rgba(28,18,8,0.2);
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    padding: 1.5rem 1rem 1rem;
    gap: 0;
    max-width: none;
  }

  .logo-block {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
  }

  .main-nav {
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    gap: 0.2rem;
    margin-top: 1.5rem;
  }

  .nav-link {
    padding: 0.6rem 0.875rem;
    border-radius: var(--radius-sm);
    text-align: left;
  }

  .header-actions {
    margin-left: 0;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    justify-content: flex-start;
  }

  .hamburger { display: none; }

  .search-bar-wrap {
    margin-left: var(--sidebar-w);
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
  }

  .search-bar-inner { max-width: 560px; }

  .main-content {
    margin-left: var(--sidebar-w);
    max-width: none;
    width: calc(100% - var(--sidebar-w));
    box-sizing: border-box;
  }

  .site-footer { margin-left: var(--sidebar-w); }

  .bottom-nav { display: none !important; }

  /* Admin panel z-index above sidebar */
  .admin-panel { z-index: 500; }
  .admin-panel-overlay { z-index: 499; }

  /* Modal z-index */
  .modal-overlay { z-index: 600; }
}

/* ============================
   MOBILE LAYOUT (< 900px)
   ============================ */
@media (max-width: 899px) {
  .site-header {
    position: sticky; top: 0;
    z-index: 200;
  }

  .header-inner {
    height: 56px;
    padding: 0 1rem;
  }

  .logo-block { gap: 0.5rem; }
  .site-tagline { display: none; }

  .main-nav { display: none; }
  .hamburger { display: none; }

  .search-bar-wrap {
    top: 56px;
    padding: 0.5rem 1rem;
  }

  .main-content {
    padding: 1.5rem 1rem;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
    max-width: 100%;
  }

  .site-footer {
    display: none;
  }

  /* ---- BOTTOM NAV ---- */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--text);
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 300;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(28,18,8,0.2);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 0.55rem 0.25rem 0.5rem;
    color: rgba(255,255,255,0.45);
    font-size: 0.6rem;
    text-decoration: none;
    cursor: pointer;
    gap: 2px;
    letter-spacing: 0.03em;
    font-weight: 500;
    transition: color 0.15s;
    border: none; background: none;
    font-family: var(--font-body);
  }

  .bottom-nav-item .nav-icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .bottom-nav-item.active {
    color: var(--accent);
  }

  /* Admin panel and modal above bottom nav */
  .admin-panel { z-index: 500; }
  .modal-overlay { z-index: 600; }
}

/* ---- QUICK LOG FAB ---- */
.quick-log-fab {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  right: 1.25rem;
  z-index: 250;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 56px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 0.4rem;
  box-shadow: 0 4px 20px rgba(200,149,107,0.45);
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.quick-log-fab:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(200,149,107,0.55);
}
@media (min-width: 900px) {
  .quick-log-fab {
    bottom: 2rem;
    right: 2rem;
  }
}

/* ---- QUICK LOG FORM SPECIFICS ---- */
.quick-log-taste-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem;
}
.quick-log-chip {
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.quick-log-chip.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 500;
}
.brew-details-toggle {
  background: none; border: none;
  color: var(--accent); font-family: var(--font-body);
  font-size: 0.82rem; cursor: pointer;
  padding: 0.25rem 0; margin: 0.5rem 0;
  display: flex; align-items: center; gap: 0.3rem;
}
.brew-details-panel { display: none; }
.brew-details-panel.open { display: block; }

/* ---- IMPORT FROM URL ---- */
.import-url-section {
  background: linear-gradient(135deg, rgba(200,149,107,0.06), rgba(200,149,107,0.02));
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.import-url-row {
  display: flex; gap: 0.5rem; margin-top: 0.4rem;
}
.import-url-row .form-input { flex: 1; }
.import-url-status {
  font-size: 0.8rem; margin-top: 0.4rem;
  color: var(--text-muted); min-height: 1.1em;
  line-height: 1.4;
}

/* ---- PAGINATION ---- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.4rem; margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination-btn {
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-muted); padding: 0.4rem 0.875rem;
  border-radius: var(--radius-xs); font-family: var(--font-body);
  font-size: 0.875rem; cursor: pointer;
  transition: all var(--transition);
}
.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-light);
}
.pagination-btn.active {
  background: var(--text); color: var(--white);
  border-color: var(--text); font-weight: 500;
}
.pagination-btn:disabled {
  opacity: 0.3; cursor: not-allowed;
}
.pagination-info {
  font-size: 0.8rem; color: var(--text-muted);
  padding: 0 0.5rem; white-space: nowrap;
}

/* ---- SECTION HEROES ---- */
.section-hero {
  height: 100px;
  margin: -2.5rem -2rem 2rem;
  position: relative;
  overflow: hidden;
  pointer-events: none;
  border-radius: 0;
}

/* The Pour hero — warm radial glow + faint cup silhouette */
.pour-hero {
  background:
    radial-gradient(ellipse 70% 120% at 50% -10%, rgba(200,149,107,0.22) 0%, rgba(200,149,107,0.06) 50%, transparent 75%);
}
.pour-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 90px; height: 90px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 90'%3E%3C!-- steam --%3E%3Cpath d='M32 38 Q28 26 32 14 Q36 2 32 -8' stroke='%23C8956B' stroke-width='2' fill='none' opacity='0.4' stroke-linecap='round'/%3E%3Cpath d='M45 35 Q41 23 45 11 Q49 -1 45 -11' stroke='%23C8956B' stroke-width='2' fill='none' opacity='0.4' stroke-linecap='round'/%3E%3Cpath d='M58 38 Q54 26 58 14 Q62 2 58 -8' stroke='%23C8956B' stroke-width='2' fill='none' opacity='0.4' stroke-linecap='round'/%3E%3C!-- cup --%3E%3Cpath d='M22 44 L25 78 Q25 84 45 84 Q65 84 65 78 L68 44 Z' fill='%23C8956B' opacity='0.12'/%3E%3C!-- handle --%3E%3Cpath d='M65 52 Q78 52 78 62 Q78 72 65 72' stroke='%23C8956B' stroke-width='3' fill='none' opacity='0.12' stroke-linecap='round'/%3E%3C!-- saucer --%3E%3Cellipse cx='45' cy='85' rx='28' ry='4' fill='%23C8956B' opacity='0.1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 90px 90px;
  background-position: center bottom;
  opacity: 0.9;
}

/* Coffee hero — warm gradient + repeating bean scatter pattern */
.coffee-hero {
  background: linear-gradient(to bottom, rgba(200,149,107,0.1) 0%, transparent 100%);
}
.coffee-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 11px 7px at 12px 18px, rgba(200,149,107,0.4) 60%, transparent 100%),
    radial-gradient(ellipse 2px 8px at 12px 18px, rgba(166,117,80,0.5) 0%, transparent 100%),
    radial-gradient(ellipse 9px 6px at 42px 38px, rgba(200,149,107,0.3) 60%, transparent 100%),
    radial-gradient(ellipse 2px 7px at 42px 38px, rgba(166,117,80,0.4) 0%, transparent 100%),
    radial-gradient(ellipse 10px 6.5px at 28px 8px, rgba(200,149,107,0.35) 60%, transparent 100%),
    radial-gradient(ellipse 2px 7px at 28px 8px, rgba(166,117,80,0.45) 0%, transparent 100%);
  background-size: 56px 48px;
  background-repeat: repeat;
}

@media (max-width: 899px) {
  .section-hero {
    height: 70px;
    margin: -1.5rem -1rem 1.5rem;
  }
}

/* ---- DISPATCHES HERO ---- */
.dispatches-hero {
  background: linear-gradient(135deg, rgba(92,122,107,0.12) 0%, rgba(200,149,107,0.08) 50%, transparent 100%);
}
.dispatches-hero::after {
  content: '✍';
  position: absolute;
  right: 2rem; bottom: 0.5rem;
  font-size: 3.5rem;
  opacity: 0.06;
  line-height: 1;
}

/* ---- DISPATCHES PAGE ---- */
.dispatches-filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 2rem;
}

.dispatch-filter-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
  font-weight: 400;
}
.dispatch-filter-btn.active,
.dispatch-filter-btn:hover {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

.dispatches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}
.post-card:hover {
  box-shadow: 0 6px 24px var(--shadow-md);
  transform: translateY(-2px);
}

.post-card-cover {
  height: 180px; overflow: hidden;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-cover-fallback { font-size: 3rem; opacity: 0.2; }

.post-card-body {
  padding: 1.25rem; flex: 1;
  display: flex; flex-direction: column; gap: 0.5rem;
}

.post-category-badge {
  display: inline-block;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 4px;
  background: var(--surface); color: var(--text-muted);
  align-self: flex-start;
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  color: var(--text); line-height: 1.3;
}

.post-card-excerpt {
  font-size: 0.875rem; color: var(--text-muted);
  line-height: 1.6; flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-light);
  display: flex; justify-content: space-between; align-items: center;
}

/* Post modal body */
.post-body-text {
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--text);
  margin-top: 1.25rem;
}

.post-tags {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 1.25rem;
}
.post-tag {
  font-size: 0.75rem; color: var(--text-muted);
  background: var(--surface); border-radius: 20px;
  padding: 0.2rem 0.6rem;
}
