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

:root {
  /* Colors — light */
  --bg-primary:    #FAFAFA;
  --bg-secondary:  #FFFFFF;
  --bg-elevated:   #FFFFFF;
  --text-primary:  #1A1A1A;
  --text-secondary:#666666;
  --text-tertiary: #999999;
  --text-muted:    #AAAAAA;
  --border-light:  #E5E5E5;
  --border-medium: #D0D0D0;
  --accent-primary:#B8860B;
  --accent-coffee: #6F4E37;
  --accent-secondary:#8B7355;
  --shadow-sm: rgba(0,0,0,.04);
  --shadow-md: rgba(0,0,0,.08);
  --shadow-lg: rgba(0,0,0,.14);

  /* Spacing */
  --sp-xs:  .25rem;  --sp-sm:  .5rem;   --sp-md:  1rem;
  --sp-lg:  1.5rem;  --sp-xl:  2rem;    --sp-2xl: 3rem;
  --sp-3xl: 4rem;    --sp-4xl: 5rem;

  /* Type */
  --text-xs:  .75rem;  --text-sm:  .875rem; --text-base: 1rem;
  --text-lg:  1.125rem;--text-xl:  1.25rem; --text-2xl:  1.5rem;
  --text-3xl: 1.875rem;--text-4xl: 2.25rem; --text-5xl:  3rem;
  --text-6xl: 4rem;

  /* Radius */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px;
}

/* Dark mode */
[data-theme="dark"] {
  --bg-primary:   #0A0A0A; --bg-secondary: #141414; --bg-elevated: #1A1A1A;
  --text-primary: #FAFAFA; --text-secondary:#A8A8A8; --text-tertiary:#707070; --text-muted:#606060;
  --border-light: #2A2A2A; --border-medium: #333333;
  --accent-primary:#D4AF37; --accent-coffee: #A0735A; --accent-secondary:#A0906B;
  --shadow-sm: rgba(0,0,0,.2); --shadow-md: rgba(0,0,0,.4); --shadow-lg: rgba(0,0,0,.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary:#0A0A0A; --bg-secondary:#141414; --bg-elevated:#1A1A1A;
    --text-primary:#E5E5E5; --text-secondary:#A0A0A0; --text-tertiary:#707070; --text-muted:#707070;
    --border-light:#2A2A2A; --border-medium:#2A2A2A;
    --accent-coffee:#A0735A;
    --shadow-sm:rgba(0,0,0,.2); --shadow-md:rgba(0,0,0,.4); --shadow-lg:rgba(0,0,0,.6);
  }
}

html { scroll-behavior: smooth; scroll-padding-top: 100px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color .4s ease, color .4s ease;
}

* { transition: background-color .3s ease, border-color .3s ease, color .3s ease; }

.no-transitions * {
  transition: none !important;
  animation-duration: 0s !important;
}

::selection { background: var(--accent-coffee); color: #fff; }
*:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

.menu-open { overflow: hidden; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--sp-4xl) var(--sp-xl);
}

@media (max-width: 768px) {
  .container { padding: var(--sp-3xl) var(--sp-lg); }
}

/* ============================================================
   FIXED UI CHROME (menu, theme)
   ============================================================ */
.menu-toggle, .theme-toggle {
  position: fixed;
  top: var(--sp-xl);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 48px; height: 48px;
  padding: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px var(--shadow-md);
  z-index: 1001;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}

.menu-toggle  { left:  var(--sp-xl); }
.theme-toggle { right: var(--sp-xl); z-index: 1000; }

.menu-toggle:hover  { border-color: var(--accent-primary); transform: translateY(-1px); box-shadow: 0 6px 16px var(--shadow-lg); }
.theme-toggle:hover { border-color: var(--accent-primary); transform: translateY(-1px) rotate(180deg); box-shadow: 0 6px 16px var(--shadow-lg); }

.theme-icon { width: 22px; height: 22px; color: var(--text-primary); }

/* Hamburger icon */
.menu-icon { width: 22px; height: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.menu-line { display: block; height: 1.5px; width: 100%; background: var(--text-primary); transform-origin: center; transition: all .3s cubic-bezier(.4,0,.2,1); }
.menu-open .menu-toggle .menu-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-toggle .menu-line:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle .menu-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .menu-toggle  { top: var(--sp-md); left:  var(--sp-md); width: 44px; height: 44px; }
  .theme-toggle { top: var(--sp-md); right: var(--sp-md); width: 44px; height: 44px; }
}

/* ============================================================
   NAVIGATION OVERLAY
   ============================================================ */
.nav-menu {
  position: fixed; inset: 0;
  background: var(--bg-primary);
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: all .5s cubic-bezier(.23,1,.32,1);
  overflow-y: auto;
}
.nav-menu.active { opacity: 1; visibility: visible; }

.nav-menu-content {
  max-width: 1200px; margin: 0 auto;
  padding: var(--sp-4xl) var(--sp-xl);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.nav-menu-header { padding: var(--sp-2xl) 0; border-bottom: 1px solid var(--border-light); margin-bottom: var(--sp-3xl); }
.nav-menu-label  { font-size: var(--text-sm); font-weight: 500; letter-spacing: .15em; text-transform: uppercase; color: var(--text-tertiary); }

.nav-menu-items  { flex: 1; display: flex; flex-direction: column; gap: var(--sp-xs); }

.nav-menu-item {
  display: flex; align-items: center;
  padding: var(--sp-xl) 0;
  text-decoration: none; color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  transition: all .4s cubic-bezier(.23,1,.32,1);
  position: relative; overflow: hidden;
  opacity: 0; transform: translateX(-30px);
}
.nav-menu.active .nav-menu-item { opacity: 1; transform: translateX(0); }
.nav-menu.active .nav-menu-item:nth-child(1) { transition-delay: .1s; }
.nav-menu.active .nav-menu-item:nth-child(2) { transition-delay: .15s; }
.nav-menu.active .nav-menu-item:nth-child(3) { transition-delay: .2s; }
.nav-menu.active .nav-menu-item:nth-child(4) { transition-delay: .25s; }

.nav-menu-item::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform .6s cubic-bezier(.23,1,.32,1);
}
.nav-menu-item:hover::before, .nav-menu-item.active::before { transform: scaleX(1); }
.nav-menu-item:hover { padding-left: var(--sp-md); }
.nav-menu-item:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 4px; }

.nav-menu-number { font-size: var(--text-sm); font-weight: 500; color: var(--text-tertiary); margin-right: var(--sp-2xl); letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.nav-menu-text   { flex: 1; font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl)); font-weight: 200; letter-spacing: .05em; text-transform: uppercase; transition: all .4s cubic-bezier(.23,1,.32,1); }
.nav-menu-item:hover .nav-menu-text, .nav-menu-item.active .nav-menu-text { color: var(--accent-primary); letter-spacing: .08em; }
.nav-menu-arrow  { font-size: var(--text-2xl); color: var(--accent-primary); opacity: 0; transform: translateX(-10px); transition: all .4s cubic-bezier(.23,1,.32,1); }
.nav-menu-item:hover .nav-menu-arrow, .nav-menu-item.active .nav-menu-arrow { opacity: 1; transform: translateX(0); }

.nav-menu-footer {
  padding-top: var(--sp-3xl); border-top: 1px solid var(--border-light); margin-top: auto;
  opacity: 0; transform: translateY(20px); transition: all .5s cubic-bezier(.23,1,.32,1); transition-delay: .4s;
}
.nav-menu.active .nav-menu-footer { opacity: 1; transform: translateY(0); }
.nav-menu-footer p { color: var(--text-muted); font-size: var(--text-sm); letter-spacing: .05em; }

/* Blur page content behind open menu */
.menu-open .container > *:not(.nav-menu):not(.menu-toggle) { filter: blur(5px); transition: filter .5s ease; }

@media (max-width: 768px) {
  .nav-menu-content { padding: var(--sp-3xl) var(--sp-lg); }
  .nav-menu-text    { font-size: var(--text-xl); }
  .nav-menu-number  { margin-right: var(--sp-lg); }
  .nav-menu-item    { padding: var(--sp-lg) 0; }
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  text-align: center;
  padding: var(--sp-3xl) 0 var(--sp-xl);
  margin-bottom: var(--sp-xl);
}
.header h1 {
  font-size: clamp(var(--text-3xl), 5.5vw, var(--text-5xl));
  font-weight: 200;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--sp-sm);
}
.header-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-base);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 400;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 1.2s cubic-bezier(.23,1,.32,1) forwards; opacity: 0; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   FLAVOR PROFILE SECTION
   ============================================================ */
.flavor-profile-section {
  padding: var(--sp-lg) 0 var(--sp-2xl);
  border-top: 1px solid var(--border-light);
}

/* ── One-row topbar: title | selector(s) | toggle ── */
.profile-topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-lg);
  flex-wrap: wrap;
}
.profile-topbar-title { flex-shrink: 0; }
.section-title {
  font-size: var(--text-xl);
  font-weight: 300;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 2px;
}
.section-description {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  letter-spacing: .02em;
}

/* Selector slot in topbar (flex-grow fills middle) */
.topbar-selector {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.topbar-selector--compare {
  max-width: 680px;
  flex: 2;
}
.compare-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
}
.compare-item { display: flex; flex-direction: column; gap: 4px; }

.control-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.clr-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.clr-1 { background: var(--accent-coffee); }
.clr-2 { background: var(--accent-primary); }

/* Mode toggle */
.mode-toggle {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 3px;
  flex-shrink: 0;
}
.mode-btn {
  background: transparent; border: none;
  border-radius: 17px;
  padding: 7px 18px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary); cursor: pointer;
  transition: all .22s cubic-bezier(.23,1,.32,1);
  white-space: nowrap;
}
.mode-btn.active { background: var(--accent-coffee); color: #fff; }
.mode-btn:not(.active):hover { color: var(--text-primary); }

/* ── Dropdowns ── */
.variety-dropdown {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  display: block; width: 100%;
  padding: 9px 36px 9px 14px;
  font-size: var(--text-sm); font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23999' d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.variety-dropdown:hover  { border-color: var(--accent-coffee); }
.variety-dropdown:focus  { border-color: var(--accent-coffee); outline: none; box-shadow: 0 0 0 3px rgba(111,78,55,.12); }
.variety-dropdown option { color: var(--text-primary); background-color: var(--bg-secondary); }

/* Custom select */
.visually-hidden { position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important; }
.custom-select { position: relative; display: block; width: 100%; z-index: 1; }
.custom-select.open { z-index: 999; }
.custom-select__control {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  padding: 9px 12px 9px 14px;
  border-radius: var(--r-md); border: 1px solid var(--border-light);
  background: var(--bg-secondary); color: var(--text-secondary);
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, box-shadow .15s;
  font-size: var(--text-sm);
}
.custom-select__control:hover  { border-color: var(--accent-coffee); }
.custom-select.open .custom-select__control,
.custom-select__control:focus  { border-color: var(--accent-coffee); outline: none; box-shadow: 0 0 0 3px rgba(111,78,55,.12); }
.custom-select__selected { display: block; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.custom-select__arrow { display: inline-flex; align-items: center; width: 18px; height: 18px; flex-shrink: 0; color: var(--text-tertiary); transition: transform .16s ease; }
.custom-select.open .custom-select__arrow { transform: rotate(180deg); }
.custom-select__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  border-radius: var(--r-md); box-shadow: 0 12px 32px var(--shadow-md);
  max-height: 260px; overflow: auto; padding: 4px 0;
  display: none; z-index: 1000;
}
.custom-select.open .custom-select__list { display: block; animation: cs-open .12s ease; }
@keyframes cs-open { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.custom-select__option {
  list-style:none; padding: 7px 14px;
  font-size: var(--text-sm); color: var(--text-primary); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  border-left: 3px solid transparent;
  transition: background-color .08s, border-left-color .08s;
}
.custom-select__option:hover, .custom-select__option:focus { background: rgba(111,78,55,.08); color: var(--accent-coffee); outline: none; }
.custom-select__option[aria-selected="true"] { border-left-color: var(--accent-coffee); background: rgba(111,78,55,.06); }
.custom-select__option[aria-selected="true"]::after { content:"✓"; color:var(--accent-coffee); font-size:11px; font-weight:700; }
.custom-select__group {
  font-size: 10px; font-weight: 700; color: var(--accent-coffee);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 7px 14px 3px;
  margin-top: 2px; border-top: 1px solid var(--border-light); pointer-events: none;
}
.custom-select__list > .custom-select__group:first-child { border-top: none; margin-top: 0; }

/* ════════════════════════════════════════════════════
   THE MAIN PANEL — fixed-height, nothing scrolls the page
   ════════════════════════════════════════════════════ */
.profile-main {
  display: grid;
  /* Radar: fixed 400px. Info: fills remaining space. */
  grid-template-columns: 400px 1fr;
  grid-template-rows: 420px;   /* single row, explicit height */
  gap: var(--sp-xl);
  align-items: stretch;         /* both columns same height */
}

/* ── Radar column ── */
.radar-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}
.radar-wheel {
  flex: 1;
  min-height: 0;               /* allow flex shrink */
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: 0 2px 16px var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* SVG fills its container, maintains 1:1 aspect ratio */
.wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.grid-circle { fill: none; stroke: var(--border-medium); stroke-width: 1; opacity: .3; }
.grid-line   { stroke: var(--border-medium); stroke-width: 1; opacity: .28; }
.axis-label  { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; fill: var(--text-secondary); text-anchor: middle; }
.center-dot  { fill: var(--text-tertiary); }

.flavor-shape    { fill: var(--accent-coffee); fill-opacity: .2;  stroke: var(--accent-coffee); stroke-width: 1.8; stroke-linejoin: round; transition: all .65s cubic-bezier(.23,1,.32,1); }
.compare-shape-1 { fill: var(--accent-coffee); fill-opacity: .16; stroke: var(--accent-coffee); stroke-width: 1.8; stroke-linejoin: round; transition: all .65s cubic-bezier(.23,1,.32,1); }
.compare-shape-2 { fill: var(--accent-primary); fill-opacity: .13; stroke: var(--accent-primary); stroke-width: 1.8; stroke-linejoin: round; stroke-dasharray: 5 3; transition: all .65s cubic-bezier(.23,1,.32,1); }

/* Radar legend */
.radar-legend {
  display: flex; gap: var(--sp-lg); justify-content: center; flex-shrink: 0;
  padding: 4px 0;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ld-1 { background: var(--accent-coffee); }
.ld-2 { background: var(--accent-primary); }
.legend-name { font-size: 11px; font-weight: 600; color: var(--text-secondary); }

/* ── Info panel column ── */
.info-panel-column {
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Empty / prompt state */
.info-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-md);
  border: 1px dashed var(--border-medium);
  border-radius: var(--r-lg);
  text-align: center;
  padding: var(--sp-xl);
}
.info-empty p { font-size: var(--text-sm); color: var(--text-muted); font-style: italic; }

/* Info card: fills full column height, inner content scrolls */
.info-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 2px 16px var(--shadow-sm);
  animation: slideIn .35s cubic-bezier(.23,1,.32,1);
}

/* Explore info — scrollable content area */
#singleInfo {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-lg);
  /* Custom scrollbar for aesthetics */
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}
#singleInfo::-webkit-scrollbar { width: 4px; }
#singleInfo::-webkit-scrollbar-track { background: transparent; }
#singleInfo::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 2px; }

.info-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  gap: var(--sp-sm);
}
.info-title {
  font-size: var(--text-base); font-weight: 700;
  color: var(--text-primary); line-height: 1.2;
}
.intensity-badge {
  padding: 4px 10px; border-radius: 12px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; white-space: nowrap; flex-shrink: 0;
}
.intensity-badge.delicate    { background: linear-gradient(135deg,#C4956A,#B5845A); }
.intensity-badge.medium      { background: linear-gradient(135deg,#8B5E3C,#7A5230); }
.intensity-badge.robust      { background: linear-gradient(135deg,#5E3A22,#4A2E14); }
.intensity-badge.very-robust { background: linear-gradient(135deg,#3A2010,#2A1208); }

.info-meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.meta-row  { display: flex; flex-direction: column; gap: 3px; }
.meta-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); }
.meta-value { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; }
.body-bar-wrap { display: flex; flex-direction: column; gap: 3px; }
.intensity-bar { width: 100%; height: 5px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; border: 1px solid var(--border-light); }
.intensity-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg,#C4956A 0%,#8B5E3C 50%,#5E3A22 100%); transition: width 1s cubic-bezier(.23,1,.32,1); }
.intensity-markers { display: flex; justify-content: space-between; }
.intensity-markers span { font-size: 9px; color: var(--text-muted); }

.info-sections { display: flex; flex-direction: column; gap: 6px; }
.info-section-block { padding: 8px 10px; background: var(--bg-secondary); border-radius: var(--r-md); }
.info-section-heading { font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-tertiary); margin: 0 0 5px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-cloud .tag, .tag-cloud .note-tag {
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  color: var(--text-secondary); padding: 2px 9px; border-radius: 12px;
  font-size: 11px; transition: all .18s ease;
}
.tag-cloud .tag:hover, .tag-cloud .note-tag:hover { border-color: var(--accent-coffee); color: var(--accent-coffee); }
.pairing-text { font-size: 11px; line-height: 1.55; color: var(--text-secondary); margin: 0; }

/* Compare info (inside card, scrollable) */
#compareInfo { flex: 1; overflow-y: auto; display: flex!important; flex-direction: column; }
.compare-header { padding: 10px 14px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.compare-title  { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-primary); margin: 0; }
.comparison-table { flex: 1; display: flex; flex-direction: column; }
.table-row { display: grid; grid-template-columns: 90px 1fr 1fr; border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.table-row:last-child { border-bottom: none; }
.header-row { background: var(--bg-secondary); }
.table-cell { padding: 8px 10px; display: flex; align-items: center; font-size: 11px; }
.attribute-cell { background: var(--bg-secondary); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); border-right: 1px solid var(--border-light); }
.variety-cell { justify-content: center; }
.variety-indicator { display: flex; align-items: center; gap: 5px; }
.color-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-1 { background: var(--accent-coffee); }
.dot-2 { background: var(--accent-primary); }
.variety-name { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.value-cell { color: var(--text-primary); flex-wrap: wrap; font-size: 11px; }
.intensity-indicator { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.intensity-indicator.delicate    { background: rgba(196,149,106,.2); color: #8B5E3C; }
.intensity-indicator.medium      { background: rgba(139,94,60,.2);   color: #7A5230; }
.intensity-indicator.robust      { background: rgba(94,58,34,.2);    color: #4A2E14; }
.intensity-indicator.very-robust { background: rgba(58,32,16,.25);   color: #3A2010; }
.flavor-comparison .value-cell { grid-column: 2/4; }
.flavor-bars { width: 100%; }
.flavor-bar-row { display: grid; grid-template-columns: 65px 1fr; gap: 8px; align-items: center; margin-bottom: 5px; }
.flavor-bar-row:last-child { margin-bottom: 0; }
.flavor-label { font-size: 9px; color: var(--text-tertiary); text-align: right; font-weight: 700; letter-spacing: .04em; }
.comparison-bars { display: flex; gap: 3px; }
.bar-container { flex: 1; height: 10px; background: var(--bg-secondary); border-radius: 5px; overflow: hidden; }
.bar { height: 100%; border-radius: 5px; transition: width .75s cubic-bezier(.23,1,.32,1); }
.bar-1 { background: var(--accent-coffee); opacity: .85; }
.bar-2 { background: var(--accent-primary); opacity: .85; }
.notes-list { display: flex; flex-wrap: wrap; gap: 3px; }
.notes-list .note-tag { background: var(--bg-secondary); border: 1px solid var(--border-light); padding: 1px 7px; border-radius: 8px; font-size: 10px; color: var(--text-secondary); }

/* Mobile comparison stacked layout */
.mobile-comparison { display: none; padding: var(--sp-md) 0; }
.mobile-varieties { display: flex; flex-direction: column; gap: var(--sp-lg); }
.mobile-variety-card { background: var(--bg-secondary); border: 2px solid var(--border-light); border-radius: var(--r-lg); padding: var(--sp-lg); }
.mobile-variety-card.variety-1 { border-color: var(--accent-coffee); }
.mobile-variety-card.variety-2 { border-color: var(--accent-primary); }
.mobile-variety-header { display: flex; align-items: center; gap: var(--sp-sm); margin-bottom: var(--sp-md); padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.mobile-variety-header .color-dot { width: 12px; height: 12px; }
.mobile-variety-header .variety-name { font-size: var(--text-base); font-weight: 700; }
.mobile-attribute { margin-bottom: var(--sp-md); }
.mobile-attribute-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 3px; }
.mobile-attribute-value { font-size: var(--text-sm); color: var(--text-primary); }
.mobile-flavor-section { margin-top: var(--sp-md); padding-top: var(--sp-md); border-top: 1px solid var(--border-light); }
.mobile-flavor-bars { display: flex; flex-direction: column; gap: 8px; }
.mobile-flavor-row { display: flex; align-items: center; gap: var(--sp-md); }
.mobile-flavor-label { font-size: 11px; color: var(--text-tertiary); font-weight: 700; width: 70px; flex-shrink: 0; }
.mobile-flavor-bar { flex: 1; height: 10px; background: var(--bg-elevated); border-radius: 5px; overflow: hidden; }
.mobile-flavor-fill { height: 100%; border-radius: 5px; transition: width .75s cubic-bezier(.23,1,.32,1); width: 0; }
.variety-1 .mobile-flavor-fill { background: var(--accent-coffee); }
.variety-2 .mobile-flavor-fill { background: var(--accent-primary); }
.mobile-notes { display: flex; flex-wrap: wrap; gap: 4px; }
.mobile-notes .note-tag { background: var(--bg-elevated); border: 1px solid var(--border-light); padding: 3px 8px; border-radius: 10px; font-size: var(--text-xs); color: var(--text-secondary); }
.mobile-vs-divider { display: flex; align-items: center; justify-content: center; position: relative; margin: var(--sp-sm) 0; }
.mobile-vs-divider::before { content:''; position:absolute; top:50%; left:0; right:0; height:1px; background: var(--border-light); }
.mobile-vs-text { background: var(--bg-primary); padding: 0 var(--sp-md); font-size: var(--text-sm); font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .05em; z-index: 1; position: relative; }

/* ── Responsive breakpoints ── */
/* At 1000px: keep 2-col but slightly narrower radar */
@media (max-width: 1050px) {
  .profile-main { grid-template-columns: 340px 1fr; grid-template-rows: 380px; }
}
/* At 780px: stack vertically, no fixed height — radar first */
@media (max-width: 780px) {
  .profile-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;   /* natural height */
    gap: var(--sp-lg);
  }
  .radar-column { height: auto; }
  .radar-wheel  { height: auto; aspect-ratio: 1; max-width: 380px; margin: 0 auto; }
  .wheel-svg    { width: 100%; height: auto; }
  .info-panel-column { height: auto; }
  .info-card    { max-height: 420px; } /* cap so it doesn't become a wall of text */
  .compare-pair { grid-template-columns: 1fr; gap: var(--sp-sm); }
}
/* Small mobile */
@media (max-width: 560px) {
  .profile-topbar { gap: var(--sp-md); }
  .topbar-selector { min-width: 0; max-width: 100%; flex: 1 1 100%; order: 2; }
  .mode-toggle { order: 1; align-self: flex-end; }
  .profile-topbar-title { flex: 1 1 100%; }
}

/* ============================================================
   EDUCATION SECTION
   ============================================================ */
.education-section {
  padding: var(--sp-2xl) 0;
  border-top: 1px solid var(--border-light);
}
.edu-title {
  font-size: var(--text-2xl); font-weight: 300;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: var(--sp-xl);
}

.edu-grid {
  display: grid;
  gap: var(--sp-lg);
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .edu-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .edu-grid { grid-template-columns: repeat(3, 1fr); } }

.edu-block {
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: var(--r-lg); padding: var(--sp-lg) var(--sp-xl);
  transition: border-color .3s, box-shadow .3s;
}
.edu-block:hover { border-color: var(--accent-coffee); box-shadow: 0 4px 16px var(--shadow-sm); }

.edu-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-md);
  background: rgba(111,78,55,.1); color: var(--accent-coffee);
  margin-bottom: var(--sp-md);
}
.edu-block h3 {
  font-size: var(--text-sm); font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-coffee);
  margin-bottom: var(--sp-md);
}

.edu-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.edu-row  { display: grid; grid-template-columns: 130px 1fr; gap: var(--sp-sm); align-items: baseline; }
.edu-row dt {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--text-primary); letter-spacing: .02em;
  padding-top: 2px;
}
.edu-row dd {
  font-size: var(--text-xs); line-height: 1.55;
  color: var(--text-secondary); margin: 0;
}
.edu-row dd strong { color: var(--text-primary); }

@media (max-width: 480px) {
  .edu-row { grid-template-columns: 1fr; gap: 2px; }
  .edu-row dt::after { content: ':'; }
}

/* ============================================================
   ORIGINS SECTION — SEARCH + FILTER + GRID
   ============================================================ */
.origins-section {
  padding-top: var(--sp-2xl);
  border-top: 1px solid var(--border-light);
}
.origins-header {
  text-align: center;
  margin-bottom: var(--sp-lg);
}
.origins-header .section-title       { margin-bottom: var(--sp-xs); }
.origins-header .section-description { margin-bottom: 0; }

/* Search */
.search-wrap { max-width: 480px; margin: var(--sp-lg) auto var(--sp-md); }
.search-input-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: 40px; padding: 0 var(--sp-md);
  box-shadow: 0 2px 8px var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.search-input-wrap:focus-within { border-color: var(--accent-coffee); box-shadow: 0 0 0 3px rgba(111,78,55,.12); }
.search-icon  { color: var(--text-tertiary); flex-shrink: 0; margin-right: var(--sp-sm); }
.search-input {
  flex: 1; background: none; border: none; outline: none;
  padding: 12px 0;
  font-size: var(--text-sm); color: var(--text-primary);
  font-family: inherit;
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); display: flex; align-items: center;
  padding: 4px; border-radius: 50%;
  transition: color .2s, background-color .2s;
}
.search-clear:hover { color: var(--text-primary); background: var(--bg-secondary); }

/* Filter pills */
.filter-pills {
  display: flex; gap: var(--sp-sm);
  flex-wrap: wrap; justify-content: center;
  margin-bottom: var(--sp-xl);
}
@media (max-width: 640px) {
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: var(--sp-sm);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar { display: none; }
}

.pill {
  flex-shrink: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: 24px; padding: 9px 20px;
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-secondary); cursor: pointer;
  transition: all .3s cubic-bezier(.23,1,.32,1);
}
.pill:hover  { border-color: var(--accent-coffee); color: var(--accent-coffee); transform: translateY(-1px); box-shadow: 0 4px 12px var(--shadow-md); }
.pill.active { background: var(--accent-coffee); color: #fff; border-color: var(--accent-coffee); }

/* Empty state */
.empty-state { text-align: center; color: var(--text-tertiary); font-size: var(--text-base); padding: var(--sp-3xl) 0; }

/* Card grid */
.coffee-grid {
  display: grid; gap: var(--sp-2xl);
  grid-template-columns: 1fr;
  margin-bottom: var(--sp-4xl);
  text-align: left;
}
@media (min-width: 768px)  { .coffee-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .coffee-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   OLIVE CARDS
   ============================================================ */
.coffee-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .4s cubic-bezier(.4,0,.2,1), box-shadow .4s cubic-bezier(.4,0,.2,1), border-color .3s;
  position: relative;
  /* Cards start hidden until intersection observer fires */
  opacity: 0;
  transform: translateY(16px);
}
.coffee-card.in-viewport {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .5s ease, transform .5s ease, box-shadow .4s cubic-bezier(.4,0,.2,1), border-color .3s;
}
.coffee-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px var(--shadow-md); border-color: var(--accent-coffee); }

/* Card preview (always visible) */
.coffee-card-preview  { padding: var(--sp-xl); cursor: pointer; }
.coffee-card-header   { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-lg); gap: var(--sp-md); }
.variety-info        { flex: 1; min-width: 0; }

.coffee-variety-name  {
  font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
  font-weight: 600; letter-spacing: -.02em;
  color: var(--text-primary); margin-bottom: var(--sp-sm); line-height: 1.2;
}
.origin-badge-new {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 5px 12px; border-radius: 20px;
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .03em;
  transition: all .3s ease; margin-top: .35rem;
}
.coffee-card:hover .origin-badge-new { background: var(--accent-coffee); color: #fff; border-color: var(--accent-coffee); }

/* Expand toggle */
.expand-toggle {
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  border-radius: 50%; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.expand-toggle:hover  { background: var(--accent-coffee); border-color: var(--accent-coffee); transform: scale(1.1); }
.expand-toggle:hover .expand-icon { color: #fff; }
.expand-icon { color: var(--text-secondary); transition: all .3s ease; }
.coffee-card.expanded .expand-icon { transform: rotate(180deg); }
.expand-toggle:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

/* Quick info grid */
.coffee-quick-info { display: flex; flex-direction: column; gap: var(--sp-lg); }
.info-highlights  { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-sm); }
.highlight-item {
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  border-radius: var(--r-md); padding: var(--sp-md);
  text-align: center; transition: border-color .3s;
}
.coffee-card:hover .highlight-item { border-color: rgba(111,78,55,.35); }
.highlight-label { display: block; font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); margin-bottom: var(--sp-xs); }
.highlight-value { display: block; font-size: var(--text-sm); font-weight: 700; color: var(--accent-primary); letter-spacing: -.01em; }

/* Intensity chip inside cards */
.intensity-chip { display: inline-block; border-radius: 10px; padding: 2px 8px; font-size: var(--text-xs); font-weight: 700; }
.intensity-chip.delicate    { color: #8B5E3C; }
.intensity-chip.medium      { color: #7A5230; }
.intensity-chip.robust      { color: #5E3A22; }
.intensity-chip.very-robust { color: #3A2010; }

/* Flavor tags */
.top-flavors   { display: flex; flex-wrap: wrap; gap: var(--sp-sm); }
.flavor-tag-new {
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  padding: 7px 14px; border-radius: 20px;
  font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary);
  transition: all .3s ease;
}
.coffee-card:hover .flavor-tag-new { border-color: var(--accent-coffee); color: var(--accent-coffee); }

/* Expandable details */
.coffee-card-details {
  max-height: 0; overflow: hidden;
  border-top: 1px solid transparent;
  transition: max-height .5s cubic-bezier(.4,0,.2,1), border-top-color .3s;
}
.coffee-card.expanded .coffee-card-details { max-height: 2400px; border-top-color: var(--border-light); }

.detail-content { padding: var(--sp-xl); padding-top: var(--sp-lg); }
.detail-section { margin-bottom: var(--sp-xl); }
.detail-section:last-child { margin-bottom: 0; }
.detail-heading {
  display: flex; align-items: center; gap: var(--sp-sm);
  font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-primary); margin-bottom: var(--sp-md);
}
.detail-heading svg { color: var(--accent-coffee); flex-shrink: 0; }
.detail-text { font-size: var(--text-base); line-height: 1.7; color: var(--text-secondary); text-align: left; }

.flavor-grid  { display: grid; gap: var(--sp-lg); }
.flavor-category { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--r-md); padding: var(--sp-md); }
.category-label  { display: block; font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); margin-bottom: var(--sp-sm); }
.flavor-tags-detail { display: flex; flex-wrap: wrap; gap: var(--sp-xs); }
.tag-detail { background: var(--bg-elevated); border: 1px solid var(--border-light); padding: 5px 11px; border-radius: 14px; font-size: var(--text-xs); font-weight: 500; color: var(--text-secondary); }

/* Mobile card tweaks */
@media (max-width: 768px) {
  .info-highlights { grid-template-columns: 1fr; gap: var(--sp-xs); }
  .highlight-item  { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: var(--sp-sm) var(--sp-md); }
  .highlight-label { margin-bottom: 0; }
  .expand-toggle   { width: 36px; height: 36px; }
  .expand-icon     { width: 20px; height: 20px; }
  .flavor-grid     { grid-template-columns: 1fr; }
  .detail-content  { padding: var(--sp-md); }
}

@media (max-width: 480px) {
  .expand-toggle { position: absolute; top: var(--sp-lg); right: var(--sp-lg); }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center; margin-top: var(--sp-4xl);
  padding-top: var(--sp-2xl); border-top: 1px solid var(--border-light);
}
.footer-content { display: flex; flex-direction: column; align-items: center; gap: var(--sp-md); }
.copyright { color: var(--text-muted); font-size: var(--text-sm); letter-spacing: .03em; }

.donation-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 24px; margin-bottom: var(--sp-sm);
  background: transparent; border: 1px solid var(--border-light);
  border-radius: 50px; color: var(--text-secondary);
  text-decoration: none; font-size: var(--text-sm); font-weight: 500;
  letter-spacing: .05em; text-transform: uppercase;
  transition: all .4s cubic-bezier(.23,1,.32,1);
}
.footer-icon { transition: transform .4s ease; color: var(--text-tertiary); }
.donation-btn:hover { border-color: var(--accent-coffee); color: var(--text-primary); transform: translateY(-2px); background: var(--bg-secondary); box-shadow: 0 4px 15px rgba(111,78,55,.1); }
.donation-btn:hover .footer-icon { transform: rotate(-8deg) scale(1.1); color: var(--accent-coffee); }

/* ============================================================
   ACCESSIBILITY + PRINT
   ============================================================ */
@media (prefers-contrast: high) {
  .coffee-card, .highlight-item, .expand-toggle { border-width: 2px; }
}

@media print {
  .coffee-card .coffee-card-details { max-height: none !important; border-top: 1px solid var(--border-light); }
  .expand-toggle, .menu-toggle, .theme-toggle, .filter-pills, .search-wrap { display: none; }
  .coffee-card { opacity: 1 !important; transform: none !important; break-inside: avoid; }
  .edu-block { break-inside: avoid; }
}
