/* ══════════════════════════════════════════════════════════════
   KAMIS v2 — Stylesheet
   Kenya Agricultural Market Information System
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Premium agricultural palette */
  --forest:         #143d24;
  --forest-mid:     #1f5234;
  --soil:           #1a241c;
  --earth:          #3d4a40;
  --leaf:           #2a6340;
  --leaf-dark:      #1f4f32;
  --sprout:         #3d8b52;
  --harvest:        #9a6b1e;
  --gold:           #c9a227;
  --wheat:          #e8d48a;
  --chaff:          #f5f0e6;
  --cream:          #faf8f4;
  --sky:            #e8f0ea;
  --sage:           #d4e2d7;
  --mist:           #f4f7f4;
  --white:          #ffffff;
  --border:         #dde5de;
  --border-strong:  #c5d4c8;
  --text:           #1a241c;
  --text-secondary: #5c6b60;
  --text-muted:     #8a968c;
  --rise:           #2a7d4a;
  --fall:           #c0392b;
  --whatsapp:       #25D366;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 61, 36, 0.06);
  --shadow:    0 4px 14px rgba(20, 61, 36, 0.08);
  --shadow-lg: 0 10px 28px rgba(20, 61, 36, 0.1);

  --display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans:    'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'Consolas', monospace;
  --serif:   var(--display);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--cream);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a   { color: var(--leaf); text-decoration: none; transition: color .15s; }
a:hover { color: var(--leaf-dark); }

button, input, select, textarea {
  font-family: inherit; font-size: inherit; color: inherit;
}

/* ─── Layout ─────────────────────────────────────────────── */
.container {
  width: 100%; max-width: 1200px;
  margin: 0 auto; padding: 0 20px;
}
.main { min-height: calc(100vh - 64px - 240px); }
.section { padding: 24px 0 48px; }
.section-sm { padding: 24px 0; }

/* ─── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5 { font-family: var(--display); font-weight: 600; line-height: 1.22; color: var(--soil); letter-spacing: -0.02em; }
h1 { font-size: clamp(32px, 5vw, 48px); }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 20px; }
h4 { font-size: 16px; font-family: var(--sans); font-weight: 600; }

.mono { font-family: var(--mono); }
.muted { color: var(--text-secondary); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.center { text-align: center; }

.eyebrow {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em; color: var(--harvest);
}

/* ─── Top nav ────────────────────────────────────────────── */
.topnav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}
.topnav-inner {
  max-width: 1200px; margin: 0 auto;
  min-height: 60px; padding: 6px 20px;
  display: flex; align-items: center; gap: 14px;
}
.topnav .logo-img-box {
  padding: 6px 12px;
  border-radius: 12px;
}
.topnav .logo-img {
  height: 46px;
  max-width: min(220px, 48vw);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-mark {
  width: 36px; height: 36px;
  background: var(--leaf); color: var(--white);
  border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; font-size: 20px;
}
.logo-wordmark { min-width: 0; }

/* ─── Brand image (/img/logo.*) ───────────────────────────────── */
.logo--brand { gap: 12px; }
.logo-img-box {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border: 1px solid rgba(45, 106, 47, 0.18);
  box-shadow: 0 4px 14px rgba(26, 15, 0, 0.08);
  flex-shrink: 0;
}
.logo-img {
  display: block;
  height: 56px;
  width: auto;
  max-width: min(260px, 52vw);
  object-fit: contain;
  border-radius: 10px;
}
.logo--brand-sidebar .logo-img { height: 44px; max-width: min(230px, 70vw); }
.logo--brand-sidebar .logo-img-box { padding: 8px 12px; border-radius: 12px; }
.logo-img-box--header { padding: 10px 20px; }
.logo-img-box--sidebar { padding: 8px 12px; }
.logo-img-box--footer {
  background: linear-gradient(180deg, #fffef9 0%, #fdf3dc 100%);
  border-color: rgba(240, 180, 41, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.site-foot .logo--brand-footer .logo-img { height: 48px; max-width: min(260px, 72vw); }
.logo-img-box--auth-hero {
  background: var(--white);
  border: 1px solid var(--border-sage);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  padding: 12px 22px;
}
.logo--brand-auth-hero .logo-img { height: 64px; max-width: min(340px, 85vw); }
.logo-img-box--account {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.logo--brand-account .logo-img { height: 40px; max-width: min(200px, 78vw); }
.logo--brand-account { margin-bottom: 2px; }

@media (max-width: 560px) {
  .logo-img { height: 46px; }
  .logo--brand-auth-hero .logo-img { height: 52px; }
}
.logo-text { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--soil); line-height: 1; }
.logo-sub  { font-family: var(--sans); font-size: 10px; font-weight: 600; color: var(--harvest); letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }
.logo:hover .logo-text { color: var(--leaf); }

.nav-links { display: flex; gap: 4px; margin-left: 20px; flex: 1; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--earth); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-links a i { width: 1.1em; text-align: center; font-size: 13px; opacity: .85; }
.nav-links a:hover { background: var(--sky); color: var(--leaf); }
.nav-links a:hover i { opacity: 1; }
.nav-links a.active { background: var(--sky); color: var(--leaf); font-weight: 600; }
.nav-links a.active i { opacity: 1; }

.nav-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border-radius: var(--radius);
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  border: 1.5px solid transparent; background: transparent;
  cursor: pointer; transition: all .15s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--leaf); color: var(--white); border-color: var(--leaf); }
.btn-primary:hover { background: var(--leaf-dark); color: var(--white); }
.btn-ghost { background: transparent; color: var(--earth); border-color: var(--border); }
.btn-ghost:hover { background: var(--soil); color: var(--white); border-color: var(--soil); }
.btn-dark { background: var(--soil); color: var(--white); border-color: var(--soil); }
.btn-dark:hover { background: var(--earth); color: var(--white); }
.btn-whatsapp { background: var(--whatsapp); color: var(--white); border-color: var(--whatsapp); }
.btn-whatsapp:hover { background: #1ea853; color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; display: flex; }

.icon-btn {
  width: 40px; height: 40px;
  background: transparent; border: none; border-radius: var(--radius);
  display: grid; place-items: center; cursor: pointer;
  color: var(--soil); font-size: 22px;
}
.icon-btn:hover { background: var(--sky); }
.hamburger,
.hamburger::before,
.hamburger::after {
  display: block; width: 22px; height: 2px;
  background: var(--soil); content: ''; position: relative;
}
.hamburger::before { top: -7px; }
.hamburger::after  { top: 5px; }

/* ─── Sidebar drawer ─────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px; max-width: 80vw;
  background: var(--white); z-index: 200;
  transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.sidebar.open { transform: translateX(0); }
.sidebar-head .logo--brand { flex: 1; min-width: 0; align-items: center; }
.sidebar-nav { padding: 12px 12px; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius);
  color: var(--earth); font-weight: 500; margin-bottom: 2px;
}
.sidebar-nav a i { width: 1.2em; text-align: center; color: var(--harvest); font-size: 15px; }
.sidebar-nav a:hover { background: var(--mist); }
.sidebar-nav a.active { background: var(--sky); color: var(--leaf); font-weight: 600; }
.sidebar-nav a.active i { color: var(--leaf); }
.sidebar-nav .sidebar-wa-link i { color: var(--whatsapp); }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid var(--border); }
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 150; opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
}
.sidebar-overlay.visible { opacity: 1; pointer-events: all; }

/* ─── Flash messages ─────────────────────────────────────── */
.flash {
  padding: 12px 0; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.flash-success { background: var(--sky); color: #1c5320; border-color: var(--leaf); }
.flash-error   { background: #fde8e8; color: #842029; border-color: var(--fall); }
.flash-info    { background: var(--chaff); color: var(--earth); border-color: var(--gold); }

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  background: var(--forest);
  border-bottom: 3px solid var(--harvest);
  color: var(--white);
  padding: 64px 0;
}
.hero h1 { color: var(--white); }
.hero h1 em { color: var(--wheat); font-style: normal; }
.hero p { color: rgba(255,255,255,.75); font-size: 17px; max-width: 600px; margin-top: 16px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-top: 40px; padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.hero-stat-num { font-family: var(--sans); font-size: 28px; color: var(--wheat); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-stat-lbl { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 4px; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow .2s, transform .15s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--leaf); transform: translateY(-2px); }
.card-link { display: block; color: inherit; }
.card-title { font-family: var(--sans); font-weight: 600; font-size: 15px; color: var(--soil); }

/* ─── Price card ─────────────────────────────────────────── */
.price-card { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.price-card .icon { font-size: 28px; margin-bottom: 4px; }
.price-card .name { font-weight: 600; color: var(--soil); font-size: 15px; }
.price-card .meta { font-size: 12px; color: var(--text-secondary); font-family: var(--mono); }
.price-card .value { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--soil); margin-top: 8px; }
.price-card .change { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.change.up   { color: var(--rise); }
.change.down { color: var(--fall); }
.change.flat { color: var(--text-secondary); }

/* ─── Grids ──────────────────────────────────────────────── */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── Value Chain cards ──────────────────────────────────── */
.vc-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px; border-radius: var(--radius); background: var(--white);
  border: 1px solid var(--border);
  transition: all .15s; cursor: pointer; color: inherit;
}
.vc-card:hover { border-color: var(--leaf); box-shadow: var(--shadow); transform: translateY(-2px); }
.vc-card .icon { font-size: 36px; margin-bottom: 4px; }
.vc-card .name { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--soil); }
.vc-card .count { font-size: 12px; color: var(--text-secondary); font-family: var(--mono); }

/* ─── Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--white); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 14px 16px; text-align: left;
  font-size: 14px; border-bottom: 1px solid var(--border);
}
.table th {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-secondary); background: var(--mist);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--mist); }
.table .num { font-family: var(--mono); font-weight: 700; text-align: right; }
.table .icon-cell { font-size: 22px; width: 40px; padding-right: 0; }

@media (max-width: 768px) {
  .table-wrap.responsive .table { display: block; }
  .table-wrap.responsive thead { display: none; }
  .table-wrap.responsive tr {
    display: block; border-bottom: 1px solid var(--border); padding: 12px;
  }
  .table-wrap.responsive td {
    display: flex; justify-content: space-between; padding: 6px 0; border: none;
  }
  .table-wrap.responsive td::before {
    content: attr(data-label);
    font-family: var(--mono); font-size: 11px; text-transform: uppercase;
    color: var(--text-secondary); letter-spacing: .08em;
  }
}

/* ─── Filter chips ───────────────────────────────────────── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 100px;
  border: 1.5px solid var(--border); background: var(--white);
  font-size: 13px; font-weight: 500; color: var(--earth);
  cursor: pointer; transition: all .15s; user-select: none;
}
.chip:hover { border-color: var(--leaf); color: var(--leaf); }
.chip.active { background: var(--leaf); color: var(--white); border-color: var(--leaf); }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label,
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--earth); margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--white); font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(42, 99, 64, 0.14);
}
.form-help { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; border-bottom: 2px solid var(--border);
  margin-bottom: 24px; overflow-x: auto;
}
.tab {
  padding: 12px 18px; cursor: pointer; user-select: none;
  font-weight: 500; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; background: transparent; border-left: none; border-right: none; border-top: none;
}
.tab:hover { color: var(--leaf); }
.tab.active { color: var(--leaf); border-bottom-color: var(--leaf); font-weight: 600; }

/* ─── Section heading ───────────────────────────────────── */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.section-head h2 { margin: 0; }
.section-head .eyebrow { margin-bottom: 6px; display: block; }

/* ─── Subscribe band ─────────────────────────────────────── */
.subscribe-band {
  background: var(--leaf);
  color: var(--white);
  padding: 32px 0;
  margin-bottom: 0;
  text-align: center;
}
.subscribe-band h2 { color: var(--white); font-family: var(--display); font-size: clamp(22px, 3vw, 28px); margin-bottom: 0; }
.subscribe-band p { color: rgba(255,255,255,.85); max-width: 480px; margin: 8px auto 18px; font-size: 14px; line-height: 1.5; }

/* ─── Filter bar ─────────────────────────────────────────── */
.filter-bar {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px;
  margin-bottom: 24px;
}
.filter-bar--markets {
  margin-bottom: 0;
  grid-template-columns: minmax(160px, 2fr) minmax(140px, 1fr) minmax(190px, 260px);
  align-items: end;
}
.markets-filters {
  margin-bottom: 24px;
}
.markets-filters > .filter-bar {
  margin-bottom: 12px;
}
.markets-sort-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.markets-sort-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--harvest); font-weight: 600;
}
.markets-sort-field .form-select {
  width: 100%; min-width: 0;
}

/* ─── Filter grid (used by /commodities) ─────────────────── */
.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.4fr auto auto;
  gap: 10px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.filter-grid .form-input,
.filter-grid .form-select {
  padding: 9px 12px;
  font-size: 13px;
  background: #fafafa;
  border-radius: 8px;
  width: 100%;
}
.filter-grid .filter-row { display: flex; gap: 6px; }
.filter-grid .filter-row .form-input { padding: 9px 10px; font-size: 13px; }
@media (max-width: 1100px) { .filter-grid { grid-template-columns: 1fr 1fr 1fr 1fr; } }
@media (max-width: 700px)  { .filter-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px)  { .filter-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar--markets { grid-template-columns: 1fr; align-items: stretch; }
}

/* ─── Markets directory table (/markets) ─────────────────── */
.markets-table-count {
  font-size: 13px; color: var(--text-secondary); margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.markets-table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--white);
}
.market-table.markets-directory-table .markets-table-link {
  font-weight: 600; color: var(--soil); text-decoration: none;
}
.market-table.markets-directory-table .markets-table-link:hover {
  color: var(--leaf); text-decoration: underline;
}
.market-table.markets-directory-table .markets-table-num {
  font-family: var(--mono); font-size: 14px; white-space: nowrap;
}
.market-table.markets-directory-table .markets-table-num i { color: var(--harvest); margin-right: 4px; opacity: .85; }
.market-table.markets-directory-table .markets-table-explore {
  text-align: right; white-space: nowrap; width: 1%;
}
.market-table.markets-directory-table .markets-table-explore .btn-sm {
  padding: 7px 14px; font-size: 12px;
}
.stat-tile {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-tile .label { font-family: var(--mono); font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .08em; }
.stat-tile .value { font-family: var(--sans); font-size: 32px; font-weight: 700; color: var(--soil); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-tile .sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ─── Empty state ────────────────────────────────────────── */
.empty {
  text-align: center; padding: 48px 20px;
  color: var(--text-secondary);
}
.empty .icon { font-size: 40px; margin-bottom: 12px; }

/* ─── Footer ─────────────────────────────────────────────── */
.site-foot { background: #1a0f00; color: rgba(255,255,255,.65); margin-top: 0; }
.foot-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr;
  gap: 24px;
  padding: 28px 20px 20px;
}
@media (max-width: 768px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 20px; padding: 24px 20px 16px; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; gap: 16px; } }
.site-foot h4 {
  color: var(--white); font-size: 11px; font-family: var(--mono);
  letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 8px;
}
.site-foot a { display: block; color: rgba(255,255,255,.65); font-size: 12px; padding: 2px 0; line-height: 1.6; }
.site-foot a:hover { color: #f0b429; }
.site-foot .muted { color: rgba(255,255,255,.5); font-size: 12px; line-height: 1.55; }
.site-foot .logo { margin-bottom: 10px !important; }
.site-foot .logo-text { font-size: 18px; }
.site-foot .logo-sub { font-size: 9px; }
.foot-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 10px 0;
  font-size: 11px;
}

/* ─── Visibility helpers ─────────────────────────────────── */
.desktop-only { display: flex; }
.mobile-only  { display: none; }
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only  { display: inline-flex !important; }
  .nav-links { display: none; }
  .hero { padding: 40px 0; }
  .section { padding: 16px 0 32px; }
}

/* ════════════════════════════════════════════════════════════
   AUTH PAGES — top nav + centered panel
   ════════════════════════════════════════════════════════════ */
body.auth-page { background: var(--cream); min-height: 100vh; }
.auth-layout { display: flex; flex-direction: column; min-height: 100vh; }
.auth-topnav { position: sticky; top: 0; z-index: 100; }
.auth-topnav-logo { display: flex; align-items: center; text-decoration: none; }
.auth-topnav-logo .logo { pointer-events: none; }

.auth-main { flex: 1; padding: 32px 20px 56px; }
.auth-main__inner { max-width: 420px; margin: 0 auto; }
.auth-main__inner--wide { max-width: 600px; }
.auth-page-head { margin-bottom: 20px; }
.auth-page-head h1 {
  font-family: var(--display); font-size: clamp(26px, 3vw, 32px);
  color: var(--soil); margin: 0 0 6px; line-height: 1.2;
}
.auth-page-head .muted { margin: 0; font-size: 14px; }
.auth-return-hint {
  font-size: 13px; color: var(--text-secondary); background: var(--mist);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 18px; line-height: 1.5;
}
.auth-return-hint strong { color: var(--soil); font-weight: 600; }
.auth-panel {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 28px 24px; box-shadow: var(--shadow-sm);
}
.auth-link-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px; font-size: 13px;
}
.auth-foot-note {
  margin-top: 16px; font-size: 11px; color: var(--text-muted);
  text-align: center; line-height: 1.6;
}

/* Registration wizard */
.reg-wizard .wizard-panel {
  margin-top: 0; border: none; box-shadow: none; background: transparent; padding: 0;
}
.reg-wizard .wizard-steps { margin-bottom: 24px; }
.account-type-grid {
  display: grid; gap: 12px;
}
.account-type-card {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--border);
  border-radius: 10px; background: var(--white); cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.account-type-card:hover { border-color: var(--leaf); }
.account-type-card.selected {
  border-color: var(--leaf); box-shadow: 0 0 0 1px var(--leaf);
  background: rgba(45, 90, 45, .04);
}
.account-type-card input { position: absolute; opacity: 0; pointer-events: none; }
.account-type-card__icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--mist);
  display: flex; align-items: center; justify-content: center;
  color: var(--leaf); flex-shrink: 0; font-size: 16px;
}
.account-type-card.selected .account-type-card__icon {
  background: var(--leaf); color: #fff;
}
.account-type-card__title { font-weight: 600; font-size: 14px; color: var(--soil); margin-bottom: 4px; }
.account-type-card__desc { font-size: 12px; color: var(--text-secondary); line-height: 1.45; margin: 0 0 8px; }
.account-type-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.account-type-tag {
  font-size: 10px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 4px;
  background: var(--mist); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.account-type-card.selected .account-type-tag {
  background: rgba(45, 90, 45, .1); color: var(--leaf); border-color: rgba(45, 90, 45, .25);
}
.org-mode-tabs {
  display: flex; gap: 0; border: 1.5px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-bottom: 18px;
}
.org-mode-tab {
  flex: 1; padding: 9px 16px; font-size: 13px; font-weight: 600; background: none;
  border: none; cursor: pointer; color: var(--text-secondary); transition: all .12s;
  text-align: center;
}
.org-mode-tab.active { background: var(--leaf); color: #fff; }
.org-mode-tab:first-child { border-right: 1.5px solid var(--border); }
.org-section { display: none; }
.org-section.visible { display: block; }
.reg-summary {
  font-size: 14px; color: var(--text-secondary); line-height: 1.55;
  background: var(--mist); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px;
}
.reg-summary strong { color: var(--soil); }

@media (max-width: 640px) {
  .auth-panel { padding: 22px 18px 20px; }
  .auth-main { padding: 24px 16px 40px; }
}

/* Kept for any old references */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--mist); padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow); }

/* ════════════════════════════════════════════════════════════
   ACCOUNT APP SHELL
   ════════════════════════════════════════════════════════════ */
body.app-account { background: var(--cream); }

.app-shell {
  display: grid; grid-template-columns: 260px 1fr; min-height: 100vh;
}
.app-nav {
  background: linear-gradient(180deg, #0d2210 0%, #0a1a0c 100%);
  border-right: 1px solid rgba(255,255,255,.06);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.app-nav::-webkit-scrollbar { width: 4px; }
.app-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.app-nav-head { padding: 16px 18px 10px; flex-shrink: 0; }
.app-nav-brand { display: block; text-decoration: none; }
.app-nav-brand-mark {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  line-height: 1.2;
  transition: color .12s;
}
.app-nav-brand-sub {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-top: 3px;
}
.app-nav-brand:hover .app-nav-brand-mark { color: var(--wheat); }
.app-nav-brand:hover .app-nav-brand-sub { color: rgba(255,255,255,.65); }

.app-nav-section {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; color: rgba(255,255,255,.32);
  padding: 18px 18px 6px; flex-shrink: 0;
}
.app-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px; margin: 2px 10px; border-radius: 8px;
  color: rgba(255,255,255,.62); font-size: 13px; font-weight: 500;
  text-decoration: none; transition: background .12s, color .12s;
}
.app-nav-item i {
  width: 18px; text-align: center; font-size: 14px; opacity: .75; flex-shrink: 0;
}
.app-nav-item svg { opacity: .55; flex-shrink: 0; }
.app-nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.92); }
.app-nav-item:hover i { opacity: 1; }
.app-nav-item.active {
  background: rgba(255,255,255,.1); color: #fff; font-weight: 600;
}
.app-nav-item.active i { opacity: 1; color: var(--wheat); }
.app-nav-foot {
  margin-top: auto; padding: 14px 16px 18px;
  border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.app-nav-user { display: flex; align-items: center; gap: 10px; }
.app-nav-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--wheat);
  flex-shrink: 0;
}
.app-nav-user-meta { min-width: 0; flex: 1; }
.app-nav-user-name {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-nav-user-role { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 1px; }
.app-nav-logout {
  color: rgba(255,255,255,.35); padding: 8px; border-radius: 8px;
  display: flex; align-items: center; transition: color .12s, background .12s;
}
.app-nav-logout:hover { color: #fff; background: rgba(255,255,255,.08); }

.app-body {
  display: flex; flex-direction: column; min-height: 100vh;
  background: var(--cream);
}

.app-topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 24px; min-height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20; flex-shrink: 0;
}
.app-topbar-left { display: flex; align-items: center; gap: 12px; }
.app-topbar-breadcrumb {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.app-topbar-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.app-topbar-breadcrumb a:hover { color: var(--leaf); }
.app-topbar-breadcrumb .sep { font-size: 9px; opacity: .5; }
.app-topbar-breadcrumb .current { color: var(--soil); font-weight: 600; }
.app-topbar-right { display: flex; align-items: center; gap: 10px; }
.app-topbar-hamburger {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: none; border: none;
  border-radius: 8px; cursor: pointer; color: var(--soil); font-size: 18px;
}
.app-topbar-hamburger:hover { background: var(--mist); }

.app-flash .app-flash-inner { padding: 0 24px; }
.app-content { padding: 24px 28px 40px; flex: 1; }
@media (max-width: 768px) { .app-content { padding: 16px; } }

.app-page-head,
.account-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 14px; gap: 12px; flex-wrap: wrap;
}
.app-page-head h1,
.account-head h1 {
  font-family: var(--display); font-size: clamp(22px, 2.5vw, 28px);
  margin: 0 0 6px; color: var(--soil); line-height: 1.2;
}
.app-page-head .sub,
.account-head .muted { color: var(--text-secondary); font-size: 14px; margin: 0; }
.account-head .eyebrow {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted); display: block; margin-bottom: 6px;
}
.app-page-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  font-size: 13px; color: var(--text-secondary);
}
.app-page-meta .meta-sep { opacity: .4; }

.dash-welcome {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px; margin-bottom: 12px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.dash-welcome__title {
  font-family: var(--display); font-size: 1.15rem; margin: 0 0 4px; color: var(--soil);
}
.dash-welcome__meta {
  font-size: 12px; color: var(--text-secondary);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
}
.dash-welcome__actions { display: flex; flex-wrap: wrap; gap: 6px; }

.dash-stat-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px;
}
.dash-stat-section-label + .dash-stat-grid { margin-bottom: 10px; }
.dash-stat-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.dash-stat-grid > .dash-stat {
  flex: 1 1 0; min-width: min(100%, 120px);
}
.dash-stat {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; transition: box-shadow .15s, border-color .15s;
}
.dash-stat:hover { box-shadow: var(--shadow-sm); border-color: rgba(45, 90, 45, .2); }
.dash-stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dash-stat-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.dash-stat-icon.green  { background: #e8f3ea; color: var(--leaf); }
.dash-stat-icon.amber  { background: #faf4e6; color: #9a7b2e; }
.dash-stat-icon.blue   { background: #e8f0fa; color: #2a5f8f; }
.dash-stat-icon.purple { background: #f0e8f5; color: #6b4d7a; }
.dash-stat-icon.teal   { background: #e6f4f1; color: #2d6b5e; }
.dash-stat-icon.red    { background: #fce8ec; color: #a63d52; }
.dash-stat-trend {
  font-size: 10px; font-family: var(--mono); font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
}
.dash-stat-trend.up   { color: var(--rise); }
.dash-stat-trend.down { color: var(--fall); }
.dash-stat-trend.flat { color: var(--text-muted); }
.dash-stat-value {
  font-family: var(--mono); font-size: 1.35rem; font-weight: 700;
  color: var(--soil); line-height: 1.1;
}
.dash-stat-value--text { font-size: 0.95rem; font-family: var(--sans); font-weight: 600; }
.dash-stat-label { font-size: 12px; font-weight: 600; color: var(--soil); margin-top: 2px; }
.dash-stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.dash-panel {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 14px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.dash-panel-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.dash-panel-title { font-weight: 700; font-size: 14px; color: var(--soil); }
.dash-panel-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
/* Dashboard tables — same explorer panel as commodities page */
.dash-panel > .explorer-panel--dash {
  border: none; border-radius: 0; box-shadow: none;
  border-top: 1px solid var(--border);
}
.dash-panel > .explorer-panel--dash .explorer-panel__scroll {
  max-height: min(52vh, 480px);
}
.app-account .dash-prices-table {
  min-width: 820px;
  font-size: 12.5px;
}
.app-account .price-entry-table {
  min-width: 960px;
}
.app-account .dash-prices-table th {
  padding: 8px 12px;
  font-size: 9.5px;
}
.app-account .dash-prices-table td {
  padding: 7px 12px;
}
.app-account .dash-prices-table .num .num {
  display: inline;
}

/* ─── Account: inline price entry grid ─── */
.app-account .price-entry-panel {
  margin-bottom: 12px;
  overflow: hidden;
}
.app-account .price-entry-toolbar {
  padding: 12px 14px 10px;
  background: linear-gradient(135deg, #f4faf6 0%, #faf8f0 55%, #f7f5f2 100%);
  border-bottom: 1px solid var(--border);
}
.app-account .price-entry-toolbar__row {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(140px, 1.2fr) minmax(130px, auto) minmax(200px, 1.4fr);
  align-items: end;
  gap: 10px 12px;
}
@media (max-width: 900px) {
  .app-account .price-entry-toolbar__row {
    grid-template-columns: 1fr 1fr;
  }
  .app-account .price-entry-toolbar__tools {
    grid-column: 1 / -1;
  }
}
@media (max-width: 520px) {
  .app-account .price-entry-toolbar__row {
    grid-template-columns: 1fr;
  }
}
.app-account .price-entry-loc {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(26, 36, 28, .04);
}
.app-account .price-entry-loc__icon {
  color: var(--leaf);
  font-size: 14px;
  flex-shrink: 0;
}
.app-account .price-entry-loc__name {
  font-weight: 600;
  font-size: 13px;
  color: var(--soil);
  line-height: 1.2;
}
.app-account .price-entry-loc__meta {
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding-left: 6px;
  border-left: 1px solid var(--border);
}
.app-account .price-entry-loc__select {
  border: none;
  padding: 0;
  min-height: 0;
  font-weight: 600;
  font-size: 13px;
  background: transparent;
  box-shadow: none;
}
.app-account .price-entry-control {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
}
.app-account .price-entry-control__label {
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.app-account .price-entry-control__label i {
  color: var(--leaf);
  font-size: 10px;
}
.app-account .price-entry-control .form-select,
.app-account .price-entry-control .form-input {
  padding: 7px 10px;
  font-size: 13px;
  min-height: 36px;
}
.app-account .price-entry-market-slot {
  position: relative;
  min-height: 36px;
}
.app-account .price-entry-control__loading {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  min-height: 36px;
}
.app-account .price-entry-control--market .form-select {
  font-weight: 600;
  border-color: var(--leaf);
  background-color: var(--white);
}
.app-account .price-entry-panel--pick-market .price-entry-control--market .form-select {
  box-shadow: 0 0 0 2px rgba(42, 99, 64, .12);
}
.app-account .price-entry-toolbar__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.app-account .price-entry-search {
  position: relative;
  flex: 1;
  min-width: 0;
  margin: 0;
}
.app-account .price-entry-search i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.app-account .price-entry-search .form-input {
  width: 100%;
  padding-left: 30px;
  min-height: 36px;
  font-size: 13px;
}
.app-account .price-entry-save {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 36px;
  padding-left: 14px;
  padding-right: 14px;
}
.app-account .price-entry-sheet-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.app-account .price-entry-sheet-meta i {
  color: var(--leaf);
}
.app-account .price-entry-sheet-meta--hint {
  color: var(--earth, #5c4a32);
  background: rgba(201, 162, 39, .12);
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 10px;
}
.app-account .price-entry-result {
  padding: 0 14px;
}
.app-account .price-entry-result:not(:empty) {
  padding-top: 10px;
}
.app-account .price-entry-empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-secondary);
}
.app-account .price-entry-empty-state i {
  font-size: 28px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.app-account .price-entry-grid--locked {
  opacity: .55;
  pointer-events: none;
  user-select: none;
}
.app-account .price-entry-panel--ready .price-entry-grid {
  opacity: 1;
}
.app-account .price-entry-table .price-entry-input {
  width: 100%;
  min-width: 68px;
  max-width: 100px;
  padding: 5px 8px;
  font-size: 12px;
  text-align: right;
}
.app-account .price-entry-table .price-entry-input:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 2px rgba(42, 99, 64, .15);
}
.app-account .price-entry-table .muted-col {
  color: var(--text-muted);
  font-size: 11px;
}
.app-account .price-entry-table thead .muted-col {
  font-weight: 500;
}

/* Account pages — explorer tables (same as public commodities/markets) */
.app-account .account-explorer {
  margin-bottom: 28px;
}
.app-account .dash-panel .account-explorer--in-panel {
  margin-bottom: 0;
}
.app-account .dash-panel .account-explorer--in-panel .account-filter-bar--compact,
.app-account .dash-panel .account-explorer--in-panel .account-explorer-toolbar {
  margin-bottom: 10px;
}
.app-account .account-explorer .explorer-panel {
  box-shadow: var(--shadow-sm);
}
.app-account .account-explorer .kamis-table .cell-actions {
  white-space: nowrap;
}
.app-account .account-explorer .kamis-table .cell-actions > .btn,
.app-account .account-explorer .kamis-table .cell-actions > form:not(.action-menu__form) {
  display: inline-flex;
  vertical-align: middle;
}
.app-account .account-explorer-title {
  font-size: 15px; font-weight: 700; color: var(--soil);
  margin: 0 0 12px;
}

/* Compact filter bar (organizations etc.) */
.app-account .account-filter-bar--compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.app-account .account-filter-bar__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.app-account .account-filter-bar__search-field {
  position: relative;
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 280px;
}
.app-account .account-filter-bar__search-field > i {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
}
.app-account .account-filter-bar__search-field .form-input {
  width: 100%;
  padding: 5px 10px 5px 28px;
  min-height: 32px;
  font-size: 12px;
  border-radius: 8px;
}
.app-account .account-filter-bar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light, var(--border));
}
.app-account .account-filter-bar .filter-group--compact {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}
.app-account .account-filter-bar .filter-group__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  margin: 0;
}
.app-account .account-filter-bar .form-select--sm {
  min-width: 120px;
  max-width: 160px;
  min-height: 32px;
  padding: 5px 24px 5px 8px;
  font-size: 12px;
  border-radius: 8px;
}
.app-account .account-filter-bar .filter-group__chips,
.app-account .account-filter-bar .explorer-toolbar__chips {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
}
.app-account .account-filter-bar .chip {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1.3;
}
.app-account .account-filter-bar .chip i {
  font-size: 10px;
  opacity: 0.85;
}
.app-account .account-filter-bar__actions {
  flex-shrink: 0;
  margin-left: auto;
}
.app-account .account-filter-bar__actions .btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

/* Account aggregation detail */
.app-account .agg-detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  align-items: start;
}
.app-account .agg-detail-body { padding: 14px 16px; }
.app-account .agg-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}
.app-account .agg-detail-lbl {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.app-account .agg-progress {
  height: 6px;
  background: var(--mist);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}
.app-account .agg-progress > span {
  display: block;
  height: 100%;
  background: var(--leaf);
  border-radius: 999px;
}
.app-account .modal-dialog--wide { max-width: 520px; }
@media (max-width: 900px) {
  .app-account .agg-detail-grid { grid-template-columns: 1fr; }
  .app-account .agg-detail-aside { order: -1; }
}

/* Account demand post / edit form */
.app-account .account-demand-card {
  max-width: 820px;
}
.app-account .account-demand-card .agg-detail-body {
  padding: 20px 22px 24px;
}
.app-account .account-demand-form .form-section {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.app-account .account-demand-form .form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.app-account .account-demand-form .form-section__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--soil);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-account .account-demand-form .form-section__title i {
  color: var(--harvest);
  font-size: 13px;
}
.app-account .account-demand-form .form-section__desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.app-account .account-demand-form .form-grid {
  display: grid;
  gap: 14px 16px;
}
.app-account .account-demand-form .form-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}
.app-account .account-demand-form .form-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.app-account .account-demand-form .form-grid--metrics {
  margin-top: 14px;
}
.app-account .account-demand-form .form-span-2 {
  grid-column: 1 / -1;
}
.app-account .account-demand-form .form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.app-account .account-demand-form .form-input,
.app-account .account-demand-form .form-select {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  font-size: 14px;
  border-radius: 8px;
}
.app-account .account-demand-form textarea.form-input {
  min-height: auto;
  resize: vertical;
}
.app-account .account-demand-form__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.app-account .account-demand-form__error {
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .app-account .account-demand-form .form-grid--2,
  .app-account .account-demand-form .form-grid--3 {
    grid-template-columns: 1fr;
  }
  .app-account .account-demand-form .form-span-2 {
    grid-column: auto;
  }
}

/* Profile & organisation settings */
.account-settings-grid,
.account-settings-single {
  max-width: 720px;
}
.account-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  align-items: start;
}
.account-settings-card .dash-panel-head {
  padding: 10px 14px;
}
.account-settings-form {
  padding: 14px 16px 16px;
}
.account-settings-form .form-grid {
  display: grid;
  gap: 12px 14px;
}
.account-settings-form .form-grid--2 {
  grid-template-columns: 1fr 1fr;
}
.account-settings-form .form-span-2 {
  grid-column: 1 / -1;
}
.account-settings-form__foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.account-settings-divider {
  margin: 14px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.account-settings-divider__label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.account-settings-logo {
  display: flex; gap: 16px; align-items: flex-start;
  margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.account-settings-logo__preview {
  width: 88px; height: 88px; flex-shrink: 0;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--mist); display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.account-settings-logo__preview--sm {
  width: 56px; height: 56px;
}
.account-settings-logo__preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.account-settings-logo__placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; color: var(--muted);
  font-size: 32px;
}
.account-settings-logo__preview--sm .account-settings-logo__placeholder {
  font-size: 22px;
}
.account-org-logo-hero {
  display: flex; gap: 20px; align-items: center;
  padding: 20px; margin: -4px -4px 16px;
  background: var(--mist); border-radius: 12px;
  border: 1px solid var(--border);
}
.account-settings-logo__preview--hero {
  width: 112px; height: 112px; border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.account-org-logo-hero__meta { flex: 1; min-width: 0; }
.account-org-logo-hero__type {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); margin-bottom: 4px;
}
.account-org-logo-hero__name {
  margin: 0 0 8px; font-size: 1.25rem; font-weight: 700; line-height: 1.2;
}
.account-org-logo-upload {
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.account-settings-logo__fields {
  flex: 1; min-width: 0;
}
.account-settings-readonly {
  display: flex; gap: 14px; padding: 14px 16px 16px; align-items: flex-start;
}
.is-hidden { display: none !important; }
@media (max-width: 640px) {
  .account-settings-form .form-grid--2 {
    grid-template-columns: 1fr;
  }
  .account-settings-form .form-span-2 {
    grid-column: auto;
  }
  .account-settings-logo {
    flex-direction: column;
  }
  .account-org-logo-hero {
    flex-direction: column; text-align: center;
  }
}

/* Account row action menus */
.app-account .action-menu {
  position: relative;
  display: inline-block;
}
.app-account .action-menu__toggle .action-menu__label {
  margin-left: 4px;
}
.app-account .action-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 200px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.app-account .action-menu__panel[hidden] {
  display: none !important;
}
.app-account .action-menu__item,
.app-account .action-menu__form button.action-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--soil);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .1s;
}
.app-account .action-menu__item:hover,
.app-account .action-menu__form button.action-menu__item:hover {
  background: var(--mist);
}
.app-account .action-menu__item i {
  width: 16px;
  font-size: 12px;
  opacity: 0.75;
}
.app-account .action-menu__item--danger {
  color: #a32a1a;
}
.app-account .action-menu__item--danger:hover {
  background: #fde8e6;
}
.app-account .action-menu__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.app-account .action-menu__form {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}
.app-account .action-menu__form button.action-menu__item {
  box-sizing: border-box;
}
.app-account .kamis-table .cell-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
@media (max-width: 640px) {
  .app-account .account-filter-bar__search-field {
    flex: 1 1 100%;
    max-width: none;
  }
  .app-account .account-filter-bar__primary .filter-group--compact {
    flex: 1 1 auto;
  }
  .app-account .account-filter-bar .form-select--sm {
    flex: 1;
    max-width: none;
  }
  .app-account .account-filter-bar__actions {
    margin-left: 0;
  }
  .app-account .account-filter-bar__filters {
    flex-direction: column;
    align-items: flex-start;
  }
}

.dash-empty {
  padding: 48px 24px; text-align: center; color: var(--text-muted);
}
.dash-empty i { font-size: 2rem; color: var(--border); margin-bottom: 12px; display: block; }
.dash-empty p { margin: 0 0 16px; font-size: 14px; }

.dash-bars { padding: 8px 0 12px; }
.dash-bar-row {
  padding: 10px 20px; display: flex; align-items: center; gap: 12px;
}
.dash-bar-row__name { flex: 1; font-size: 14px; font-weight: 500; color: var(--soil); }
.dash-bar-row__track {
  width: 100px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.dash-bar-row__fill { height: 100%; background: var(--leaf); border-radius: 3px; }
.dash-bar-row__val {
  font-family: var(--mono); font-size: 12px; color: var(--text-secondary);
  min-width: 28px; text-align: right;
}

.dash-layout-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start;
}
@media (max-width: 960px) { .dash-layout-2 { grid-template-columns: 1fr; } }
.dash-layout-full { grid-column: 1 / -1; }

.dash-quick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.dash-quick-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 12px; display: flex; align-items: flex-start; gap: 10px;
  text-decoration: none; color: inherit; transition: all .15s; box-shadow: var(--shadow-sm);
}
.dash-quick-card:hover {
  border-color: var(--leaf); box-shadow: var(--shadow); transform: translateY(-1px);
}
.dash-quick-card:hover .dash-quick-icon { background: var(--leaf); color: #fff; }
.dash-quick-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--mist); color: var(--leaf);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  transition: background .15s, color .15s;
}
.dash-quick-label { font-weight: 600; font-size: 13px; color: var(--soil); display: block; line-height: 1.25; }
.dash-quick-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: block; line-height: 1.35; }

.commodity-icon-fa {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; background: var(--mist);
  color: var(--leaf); font-size: 12px;
}
.app-account .table .icon-cell { width: 48px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-nav {
    position: fixed; left: -260px; top: 0; height: 100vh; z-index: 200;
    transition: left .25s ease; width: 260px;
  }
  .app-nav.open { left: 0; }
  .app-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 199; }
  .app-overlay.visible { display: block; }
  .app-topbar { padding: 0 14px; }
  .app-topbar-hamburger { display: flex; }
}

.account-layout { display: contents; }

/* ─── Sticky bottom CTA (mobile) ─────────────────────────── */
.bottom-cta {
  position: sticky; bottom: 0; z-index: 30;
  background: var(--white); border-top: 1px solid var(--border);
  padding: 12px 16px; box-shadow: 0 -4px 12px rgba(0,0,0,.04);
  display: none;
}
@media (max-width: 768px) { .bottom-cta { display: flex; gap: 8px; } }

/* ─── Utility ────────────────────────────────────────────── */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }

/* ─── Tag pill ───────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  background: var(--sky); color: var(--leaf);
  font-size: 11px; font-weight: 600; font-family: var(--mono);
  letter-spacing: .04em; text-transform: uppercase;
}
.tag-harvest { background: rgba(200,120,26,.12); color: var(--harvest); }
.tag-fall { background: rgba(231,76,60,.12); color: var(--fall); }
.tag-rise { background: rgba(39,174,96,.12); color: var(--rise); }

/* ══════════════════════════════════════════════════════════
   LANDING PAGE — vibrant components
   ══════════════════════════════════════════════════════════ */

/* ─── Top live ticker bar ────────────────────────────────── */
.topbar {
  background: var(--soil);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  letter-spacing: .04em;
  position: relative;
  z-index: 60;
}
.topbar-label {
  white-space: nowrap;
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}
.topbar-label .live-dot { width: 6px; height: 6px; background: var(--sprout); border-radius: 50%; animation: pulse 2s infinite; }
.topbar-links { display: flex; gap: 16px; }
.topbar-links a { color: rgba(255,255,255,.55); text-decoration: none; transition: color .2s; }
.topbar-links a:hover { color: var(--gold); }

.ticker-wrap {
  flex: 1; overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}
.ticker {
  display: inline-flex; gap: 40px; white-space: nowrap;
  animation: ticker 60s linear infinite;
  will-change: transform;
}
.ticker-item { color: rgba(255,255,255,.85); }
.ticker .up   { color: var(--sprout); }
.ticker .down { color: #ff7a6b; }

@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,.5); }
  50%      { box-shadow: 0 0 0 6px rgba(76,175,80,0); }
}

/* hide topbar links on small screens */
@media (max-width: 768px) {
  .topbar { padding: 6px 16px; font-size: 10px; }
  .topbar-links { display: none; }
}

/* ─── Lively nav additions ───────────────────────────────── */
.btn-whatsapp.btn-sm svg { width: 14px; height: 14px; }
.nav-actions .btn-whatsapp { padding: 8px 14px; }

/* ─── Reimagined hero ────────────────────────────────────── */
.hero-v2 {
  background: var(--forest);
  border-bottom: 3px solid var(--harvest);
  color: var(--white);
  padding: 48px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero-v2::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-v2 .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 48px;
  align-items: flex-start; /* card starts at the top */
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(240,180,41,.14);
  border: 1px solid rgba(240,180,41,.4);
  color: var(--gold);
  padding: 5px 14px; border-radius: 100px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  margin-bottom: 22px;
}
.hero-v2 h1 {
  font-family: var(--display);
  font-size: clamp(38px, 5.4vw, 58px);
  color: var(--white); line-height: 1.1;
  margin-bottom: 22px;
  letter-spacing: -.02em;
  font-weight: 600;
}
.hero-v2 h1 em { color: var(--wheat); font-style: normal; }
.hero-v2 .hero-lead {
  color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.65;
  max-width: 540px; margin-bottom: 32px;
}
/* Hero action buttons — compact, always inline on one row */
.hero-v2 .hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap; /* force one row */
}
.hero-v2 .hero-actions .btn {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 10px;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .hero-v2 .hero-actions .btn { padding: 9px 14px; font-size: 13px; }
}
.btn-gold {
  background: var(--harvest); color: var(--white); border-color: var(--harvest);
}
.btn-gold:hover { background: #7d5a16; color: var(--white); border-color: #7d5a16; }
.btn-outline-light {
  background: rgba(255,255,255,.08); color: var(--white);
  border: 1.5px solid rgba(255,255,255,.3);
}
.btn-outline-light:hover { background: rgba(255,255,255,.16); color: var(--white); }

.hero-v2 .hero-stats {
  display: grid; grid-template-columns: repeat(4, auto);
  gap: 28px; margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.12);
}
@media (max-width: 600px) { .hero-v2 .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
.hero-v2 .hero-stat-num { font-family: var(--sans); font-size: 32px; color: var(--wheat); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-v2 .hero-stat-lbl { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 2px; }

/* live price glass card */
.hero-card {
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
.hero-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.hero-card-title {
  color: rgba(255,255,255,.55); font-size: 11px;
  font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase;
}
.live-tag { display: inline-flex; align-items: center; gap: 6px; }
.live-tag .live-dot {
  width: 7px; height: 7px; background: var(--sprout); border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
.live-tag span { color: rgba(255,255,255,.55); font-size: 11px; font-family: var(--mono); }

.price-rows { display: flex; flex-direction: column; gap: 8px; }
.price-row {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 10px;
  cursor: pointer; transition: background .2s, border-color .2s, transform .15s;
  text-decoration: none;
}
.price-row:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.12); transform: translateX(2px); }
.pr-name { color: var(--white); font-size: 14px; font-weight: 500; }
.pr-county { color: rgba(255,255,255,.4); font-size: 11px; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; margin-top: 1px; }
.pr-price { color: var(--gold); font-size: 15px; font-weight: 700; font-family: var(--mono); }
.pr-price .unit { font-size: 10px; font-weight: 400; color: rgba(240,180,41,.7); }
.pr-change { font-size: 12px; font-weight: 700; font-family: var(--mono); display: inline-flex; align-items: center; gap: 2px; }
.pr-change.up   { color: var(--sprout); }
.pr-change.down { color: #ff7a6b; }
.pr-change.flat { color: rgba(255,255,255,.4); }

.hero-card-footer {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; justify-content: space-between; align-items: center;
}
.view-all-link { color: var(--gold); font-size: 13px; text-decoration: none; font-weight: 600; }
.view-all-link:hover { color: #ffc94c; }
.last-update { color: rgba(255,255,255,.4); font-size: 10px; font-family: var(--mono); letter-spacing: .04em; }

@media (max-width: 980px) {
  .hero-card { max-width: 480px; margin: 0 auto; }
}

/* ─── Feature strip (full-width green) ───────────────────── */
.feature-strip {
  background: var(--leaf);
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 3px solid var(--forest);
}
.feature-pill {
  padding: 22px 26px; display: flex; align-items: center; gap: 14px;
  border-right: 1px solid rgba(255,255,255,.12);
  transition: background .2s;
  text-decoration: none; color: inherit;
}
.feature-pill:last-child { border-right: none; }
.feature-pill:hover { background: rgba(255,255,255,.08); color: inherit; }
.fp-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  font-size: 22px; flex-shrink: 0;
}
.fp-title { color: var(--white); font-weight: 600; font-size: 14px; }
.fp-desc { color: rgba(255,255,255,.7); font-size: 12px; margin-top: 2px; }

@media (max-width: 768px) {
  .feature-strip { grid-template-columns: 1fr 1fr; }
  .feature-pill { padding: 16px 18px; }
}
@media (max-width: 480px) {
  .feature-strip { grid-template-columns: 1fr; }
  .feature-pill { border-right: none; border-bottom: 1px solid rgba(255,255,255,.12); }
  .feature-pill:last-child { border-bottom: none; }
}

/* ─── Reimagined section heading w/ section-label ──────── */
.section-label {
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--leaf);
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.section-label::before {
  content: ''; display: inline-block; width: 3px; height: 14px;
  background: var(--harvest); border-radius: 2px;
}
.section-title-v2 {
  font-family: var(--display);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 600;
  color: var(--soil); line-height: 1.18;
  margin-bottom: 10px;
  letter-spacing: -.02em;
}
.section-sub-v2 { color: var(--text-secondary); font-size: 16px; line-height: 1.6; max-width: 580px; }

/* ─── Market price table (richer than .table) ───────────── */
.market-section { background: var(--white); padding: 64px 0; border-top: 1px solid var(--border); }
.market-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 24px;
}
.market-toolbar .form-input,
.market-toolbar .form-select { padding: 9px 14px; font-size: 14px; background: #fafafa; border-radius: 8px; }
.market-toolbar .form-input { flex: 1; min-width: 220px; }

.market-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.market-table { width: 100%; border-collapse: collapse; background: var(--white); }
.market-table th {
  background: var(--sky); padding: 13px 18px; text-align: left;
  font-size: 11px; font-family: var(--mono); letter-spacing: .08em;
  color: var(--earth); font-weight: 700; text-transform: uppercase;
  border-bottom: 2px solid #ddd;
}
.market-table td {
  padding: 14px 18px; border-bottom: 1px solid #f0f0f0;
  font-size: 14px; vertical-align: middle;
}
.market-table tbody tr:hover td { background: var(--mist); }
.market-table tbody tr:last-child td { border-bottom: none; }

.commodity-cell { display: flex; align-items: center; gap: 12px; }
.commodity-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--sky);
  display: grid; place-items: center; font-size: 20px; flex-shrink: 0;
}
.commodity-name { font-weight: 600; color: var(--soil); }
.commodity-unit { font-size: 11px; color: var(--text-muted); font-family: var(--mono); margin-top: 2px; }
.county-badge {
  background: var(--sky); color: var(--leaf); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 600;
}
.price-cell { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--soil); }
.change-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 700; font-family: var(--mono);
}
.change-badge.up   { background: rgba(39,174,96,.14); color: var(--rise); }
.change-badge.down { background: rgba(231,76,60,.14); color: var(--fall); }
.change-badge.flat { background: #f1f1f1; color: var(--text-muted); }

/* ─── Movers split (cream + dark) ────────────────────────── */
.movers-section {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 3px solid var(--soil);
}
@media (max-width: 900px) { .movers-section { grid-template-columns: 1fr; } }
.movers-panel { padding: 64px 48px; }
@media (max-width: 768px) { .movers-panel { padding: 40px 24px; } }
.movers-panel.cream { background: var(--chaff); border-right: 2px solid var(--soil); }
.movers-panel.dark  { background: var(--soil); color: var(--white); }
@media (max-width: 900px) { .movers-panel.cream { border-right: none; border-bottom: 2px solid var(--soil); } }

.movers-panel.dark .section-label { color: var(--gold); }
.movers-panel.dark .section-title-v2 { color: var(--white); font-family: var(--serif); font-size: clamp(28px, 3.5vw, 38px); }
.movers-panel.dark .section-sub-v2 { color: rgba(255,255,255,.7); margin-bottom: 28px; }

.mover-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.mover-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none; color: inherit;
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: center;
  transition: background .2s, border-color .2s, transform .15s;
}
.mover-card:hover { background: rgba(255,255,255,.1); border-color: rgba(240,180,41,.3); transform: translateX(2px); color: inherit; }
.mover-card .name { font-family: var(--serif); font-size: 20px; color: var(--white); }
.mover-card .name em { color: var(--gold); font-style: normal; margin-right: 6px; }
.mover-card .meta {
  color: rgba(255,255,255,.5); font-size: 12px; font-family: var(--mono);
  letter-spacing: .04em; text-transform: uppercase; margin-top: 4px;
}
.mover-card .value { font-family: var(--mono); font-weight: 700; color: var(--gold); font-size: 16px; }
.mover-card .delta { font-family: var(--mono); font-size: 12px; font-weight: 700; margin-top: 4px; text-align: right; }
.mover-card .delta.up { color: var(--sprout); }
.mover-card .delta.down { color: #ff7a6b; }

.cream-cta { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.cream-cta .btn { flex: 1; min-width: 180px; justify-content: center; }
.btn-outline-gold {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline-gold:hover { background: rgba(201, 162, 39, 0.12); color: var(--wheat); }

/* cream-side feature list */
.feature-list { list-style: none; margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.feature-list li {
  display: flex; align-items: flex-start; gap: 12px;
}
.feature-list .fl-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--leaf); color: var(--white);
  display: grid; place-items: center; font-size: 18px;
  flex-shrink: 0;
}
.feature-list .fl-title { font-weight: 600; font-size: 14px; color: var(--soil); }
.feature-list .fl-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ─── WhatsApp showcase ──────────────────────────────────── */
.wa-section {
  background: var(--sky);
  border-top: 2px solid #d0e8d1;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center;
  padding: 72px 48px;
}
@media (max-width: 900px) { .wa-section { grid-template-columns: 1fr; padding: 48px 24px; gap: 40px; } }

.wa-section .section-label { color: var(--whatsapp); }
.wa-section .section-title-v2 { font-size: clamp(28px, 3.4vw, 40px); }
.wa-features { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.wa-feat { display: flex; gap: 12px; align-items: flex-start; }
.wa-feat-icon {
  width: 40px; height: 40px; background: var(--whatsapp); border-radius: 10px;
  display: grid; place-items: center; font-size: 18px; flex-shrink: 0;
  color: var(--white);
}
.wa-feat-title { font-weight: 600; font-size: 14px; color: var(--soil); }
.wa-feat-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.btn-wa-big {
  background: var(--whatsapp); color: var(--white);
  border: none; padding: 14px 28px; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-top: 28px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s, transform .1s;
  box-shadow: 0 6px 18px rgba(37,211,102,.32);
  text-decoration: none;
}
.btn-wa-big:hover { background: #1ea853; color: var(--white); transform: translateY(-1px); }

/* WhatsApp mockup */
.wa-mockup {
  background: #e5ddd5;
  border-radius: 20px; overflow: hidden;
  border: 3px solid var(--soil);
  box-shadow: 10px 10px 0 var(--soil);
  max-width: 460px; width: 100%;
  margin-left: auto;
}
@media (max-width: 900px) { .wa-mockup { margin: 0 auto; } }
.wa-header {
  background: #075e54; padding: 14px 18px;
  display: flex; align-items: center; gap: 10px; color: var(--white);
}
.wa-avatar {
  width: 40px; height: 40px; background: var(--sprout);
  border-radius: 50%; display: grid; place-items: center; font-size: 20px;
}
.wa-name { font-weight: 600; font-size: 15px; }
.wa-status { font-size: 12px; opacity: .85; }
.wa-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow: hidden; }
.wa-bubble {
  max-width: 88%; padding: 10px 13px; border-radius: 12px;
  font-size: 13px; line-height: 1.5; position: relative;
}
.wa-bubble.bot { background: #fff; border-radius: 4px 12px 12px 12px; align-self: flex-start; color: #333; }
.wa-bubble.sent { background: #dcf8c6; border-radius: 12px 4px 12px 12px; align-self: flex-end; color: #333; }
.wa-time { font-size: 10px; color: #999; text-align: right; margin-top: 4px; }
.wa-tag { background: #075e54; color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 10px; display: inline-block; margin-bottom: 6px; font-family: var(--mono); letter-spacing: .04em; }

/* ─── Counties strip ─────────────────────────────────────── */
.counties-strip { background: var(--white); padding: 64px 0; border-top: 1px solid var(--border); }
.county-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.county-card-v2 {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  display: flex; flex-direction: column; gap: 4px;
  transition: all .2s;
  background: var(--white);
  color: inherit;
}
.county-card-v2:hover {
  border-color: var(--leaf);
  box-shadow: 0 6px 20px rgba(45,106,47,.14);
  transform: translateY(-2px);
  color: inherit;
}
.county-card-v2 .flag { font-size: 26px; margin-bottom: 4px; }
.county-card-v2 .name { font-weight: 600; font-size: 14px; color: var(--soil); }
.county-card-v2 .region { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.county-card-v2 .trend { font-size: 11px; font-weight: 700; font-family: var(--mono); margin-top: 6px; }
.county-card-v2 .trend.up   { color: var(--rise); }
.county-card-v2 .trend.down { color: var(--fall); }
.county-card-v2 .trend.flat { color: var(--text-secondary); }

/* ─── Value chain mosaic ─────────────────────────────────── */
.vc-section { background: var(--chaff); padding: 64px 0; border-top: 2px solid var(--soil); border-bottom: 2px solid var(--soil); }
.vc-grid-v2 {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px; margin-top: 28px;
}
.vc-card-v2 {
  background: var(--white);
  border: 1.5px solid #ead8a4;
  border-radius: 16px;
  padding: 20px 18px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 6px;
  transition: all .2s;
}
.vc-card-v2:hover {
  border-color: var(--harvest);
  box-shadow: 0 8px 24px rgba(200,120,26,.18);
  transform: translateY(-3px);
  color: inherit;
}
.vc-card-v2 .icon { font-size: 32px; margin-bottom: 4px; }
.vc-card-v2 .name { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--soil); line-height: 1.25; }
.vc-card-v2 .count { font-size: 12px; color: var(--harvest); font-family: var(--mono); font-weight: 700; }

/* ══════════════════════════════════════════════════════════
   Value Chains page — compact chip grid
   ══════════════════════════════════════════════════════════ */

/* Stats row in section-head */
.vc-stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.vc-stat-pill {
  display: flex; flex-direction: column; align-items: center;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 18px; min-width: 80px;
}
.vc-stat-num { font-family: var(--mono); font-weight: 700; font-size: 22px; color: var(--leaf); line-height: 1; }
.vc-stat-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-secondary); margin-top: 3px; }

/* Compact app-icon style chip */
.vc-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.vc-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--soil); text-decoration: none;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  transition: all .15s; position: relative; overflow: hidden;
}
.vc-chip:hover {
  border-color: var(--leaf); background: var(--sky);
  color: var(--leaf-dark); transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.vc-chip-active {
  border-color: #b5d9b6; background: #f0f8f0;
}
.vc-chip-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.vc-chip-name { flex: 1; line-height: 1.3; }
.vc-chip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sprout); flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(76,175,80,.25);
}

/* VC badge in tables */
.vc-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--chaff); color: var(--harvest);
  border: 1px solid #ead8a4; border-radius: 20px;
  padding: 3px 10px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}

/* Trend badge in tables */
.trend-badge { font-family: var(--mono); font-size: 12px; font-weight: 700; white-space: nowrap; }
.trend-badge.up   { color: var(--rise); }
.trend-badge.down { color: var(--fall); }
.trend-badge.flat { color: var(--text-secondary); }

/* Price movers strip */
.mover-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.mover-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--white); border: 1.5px solid var(--border);
  color: inherit; text-decoration: none; transition: all .15s;
}
.mover-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.mover-card.up  { border-left: 3px solid var(--rise); }
.mover-card.down{ border-left: 3px solid var(--fall); }
.mover-icon { font-size: 24px; flex-shrink: 0; }
.mover-body { flex: 1; min-width: 0; }
.mover-name { font-weight: 700; font-size: 13px; color: var(--soil); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mover-vc   { font-size: 11px; color: var(--text-secondary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mover-pct  { font-family: var(--mono); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.mover-pct.up   { color: var(--rise); }
.mover-pct.down { color: var(--fall); }
.mover-pct.flat { color: var(--text-secondary); }

/* Value chain activity grid */
.vc-activity-grid { display: flex; flex-direction: column; gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--white); }
.vc-activity-row {
  display: grid; grid-template-columns: 32px 1fr 160px 70px 70px;
  align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  color: inherit; text-decoration: none; transition: background .1s;
}
.vc-activity-row:last-child { border-bottom: none; }
.vc-activity-row:hover { background: var(--mist); }
.va-icon { font-size: 20px; text-align: center; }
.va-name { font-size: 14px; font-weight: 600; color: var(--soil); }
.va-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.va-bar { height: 100%; background: var(--leaf); border-radius: 3px; transition: width .4s ease; min-width: 2px; }
.va-count { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); text-align: right; }
.va-trend { font-family: var(--mono); font-size: 12px; font-weight: 700; text-align: right; }
.va-trend.up   { color: var(--rise); }
.va-trend.down { color: var(--fall); }
.va-trend.flat { color: var(--text-secondary); }

@media (max-width: 768px) {
  .vc-chip-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .vc-chip { padding: 9px 12px; font-size: 13px; }
  .vc-chip-icon { font-size: 18px; }
  .vc-activity-row { grid-template-columns: 28px 1fr 100px 50px; }
  .va-trend { display: none; }
  .vc-stat-row { gap: 8px; }
  .vc-stat-pill { padding: 8px 12px; }
  .mover-strip { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ══════════════════════════════════════════════════════════
   Counties page — data tables
   ══════════════════════════════════════════════════════════ */

.county-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--mist); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px;
  flex: 0 0 220px;
}
.county-search-input {
  border: none; background: transparent; outline: none;
  font-size: 14px; width: 100%; color: var(--text);
}
.county-search-input::placeholder { color: var(--text-muted); }

.region-filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.region-pill {
  padding: 5px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: transparent; cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); transition: all .15s; white-space: nowrap;
}
.region-pill:hover { border-color: var(--rc, var(--leaf)); color: var(--rc, var(--leaf)); }
.region-pill.active { background: var(--rc, var(--leaf)); border-color: var(--rc, var(--leaf)); color: var(--white); }

.county-region-block {}
.county-region-head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0 10px; margin-bottom: 0;
}
.county-region-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
  border: 1.5px solid; letter-spacing: .04em; text-transform: uppercase;
}
.county-region-count { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }

.county-table .county-name-cell { font-weight: 600; font-size: 14px; color: var(--soil); }
.county-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; opacity: .8; }

/* Activity bar in table cell */
.activity-bar-cell { display: flex; align-items: center; gap: 8px; }
.activity-bar-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; min-width: 60px; }
.activity-bar-fill { height: 100%; border-radius: 3px; min-width: 2px; transition: width .4s; }
.activity-bar-label { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); min-width: 20px; text-align: right; }

/* Numeric badge */
.num-badge {
  display: inline-block; background: var(--sky); color: var(--leaf);
  border: 1px solid #b5d9b6; border-radius: 10px;
  padding: 2px 8px; font-family: var(--mono); font-size: 12px; font-weight: 700;
}

/* Markets chip */
.markets-chip {
  display: inline-block; background: #fff8e1; color: var(--harvest);
  border: 1px solid #ead8a4; border-radius: 10px;
  padding: 2px 8px; font-family: var(--mono); font-size: 12px; font-weight: 700;
}

/* Status dot */
.status-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 10px;
}
.status-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: block; }
.status-active    { background: #e8f5e9; color: #2e7d32; }
.status-active::before { background: #4caf50; }
.status-reporting { background: #e3f2fd; color: #1565c0; }
.status-reporting::before { background: #42a5f5; }
.status-recent    { background: #fff8e1; color: #f57f17; }
.status-recent::before { background: #ffca28; }
.status-none      { background: var(--mist); color: var(--text-muted); }
.status-none::before { background: #ccc; }

/* Toolbar sticky bar */
.counties-toolbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 12px 0; position: sticky; top: 60px; z-index: 10;
}

/* County name cell */
.ct-name-cell { display: flex; align-items: center; gap: 9px; }
.ct-region-label { font-size: 11px; color: var(--text-muted); margin-top: 1px; letter-spacing: .02em; }
.ct-num { text-align: right !important; }
.ct-seq { color: var(--text-muted); font-size: 12px; }

/* Value chain tags in table */
.vc-tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.vc-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--chaff); border: 1px solid #ead8a4;
  color: var(--earth); border-radius: 20px;
  padding: 2px 9px; font-size: 11px; font-weight: 600;
  white-space: nowrap; line-height: 1.6;
}

/* Top commodity cell */
.top-commodity-cell { display: flex; align-items: center; gap: 9px; }
.tc-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.tc-body { min-width: 0; }
.tc-name { font-weight: 600; font-size: 13px; color: var(--soil); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-price { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--leaf); margin-top: 1px; }
.tc-unit { font-size: 10px; color: var(--text-muted); font-weight: 400; }

/* Responsive: hide value chains tags col on small screens */
@media (max-width: 960px) {
  .county-table th:nth-child(4), .county-table td:nth-child(4) { display: none; }
}
@media (max-width: 700px) {
  .county-table th:nth-child(5), .county-table td:nth-child(5) { display: none; }
  .county-search-wrap { flex: 1; }
}

/* ─── Footer v2 (lively) ─────────────────────────────────── */
.foot-bottom {
  background: #3b2005;
  color: rgba(255,255,255,.45);
  padding: 10px 0;
  font-size: 11px; font-family: var(--mono);
}
.foot-bottom .container {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.foot-bottom a { color: #f0b429; display: inline; }
.foot-bottom .foot-credit { letter-spacing: .03em; white-space: nowrap; }

/* ─── Chart panels (market/commodity/county pages) ─── */
.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
}
@media (max-width: 900px) { .chart-row { grid-template-columns: 1fr; } }

.chart-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-sm);
}
.chart-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.chart-panel-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.chart-panel-title::before {
  content: ''; display: inline-block; width: 14px; height: 2px;
  background: var(--harvest); border-radius: 2px;
}
.chart-panel h3 {
  font-family: var(--serif); font-weight: 700;
  font-size: 20px; color: var(--soil); line-height: 1.25;
}
.chart-panel .sub {
  font-size: 12px; color: var(--text-secondary); margin-top: 2px;
}
.chart-panel .chart-picker {
  font-family: var(--sans); font-size: 13px;
  padding: 6px 12px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--mist);
  color: var(--soil); outline: none; cursor: pointer;
  max-width: 180px;
}
.chart-panel .chart-picker:focus { border-color: var(--leaf); }
.chart-canvas-wrap {
  position: relative;
  height: 260px;
}
.chart-empty {
  height: 100%;
  display: grid; place-items: center;
  color: var(--text-muted); font-size: 13px; text-align: center;
}

/* range toggle (7D/30D/90D) */
.chart-range {
  display: inline-flex; gap: 2px;
  background: var(--mist); border-radius: 8px; padding: 3px;
  border: 1px solid var(--border);
}
.chart-range button {
  background: transparent; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  font-weight: 700; color: var(--text-secondary);
  padding: 5px 10px; border-radius: 6px;
  transition: background .15s, color .15s;
}
.chart-range button:hover { color: var(--soil); }
.chart-range button.active { background: var(--soil); color: var(--gold); }

/* tag-new pill */
.tag-new {
  background: var(--gold); color: var(--soil); font-size: 9px; font-weight: 800;
  padding: 2px 7px; border-radius: 4px; font-family: var(--mono);
  vertical-align: middle; margin-left: 6px; letter-spacing: .06em;
}

/* generic h1/h2 inside hero-v2 don't inherit serif default */
.hero-v2 h2 { color: var(--white); }

/* On home page, give the nav a subtle drop shadow over the dark hero */
body.page-home .topnav {
  border-bottom: none;
  box-shadow: 0 2px 16px rgba(26,15,0,.18);
}
body.page-home .main { background: transparent; }

/* ─── Modals ─────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
.modal-dialog {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 0;
}
.modal-head h3 { margin: 0; font-size: 20px; font-family: var(--sans); font-weight: 600; }
.modal-body { padding: 20px 24px 24px; }
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
}
@media (max-width: 768px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-dialog {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
  }
}

/* ─── Stat strip (used on directory pages) ───────────────── */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-num {
  font-family: var(--serif); font-weight: 700;
  font-size: 26px; color: var(--soil); line-height: 1.1;
}
.stat-card .stat-lbl {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--harvest); margin-top: 6px;
  display: inline-flex; align-items: center; gap: 6px;
}
@media (max-width: 768px) { .stat-strip { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .stat-strip { grid-template-columns: 1fr; } }

/* ─── Market directory cards ─────────────────────────────── */
.market-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.market-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 18px 14px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.market-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--leaf); }
.market-card-head { display: flex; gap: 12px; align-items: flex-start; }
.market-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--sky); color: var(--leaf);
  display: grid; place-items: center; font-size: 18px; flex-shrink: 0;
}
.market-card-name { font-weight: 700; font-size: 16px; color: var(--soil); line-height: 1.2; }
.market-card-county {
  font-family: var(--mono); font-size: 11px; color: var(--harvest);
  letter-spacing: .04em; text-transform: uppercase; margin-top: 4px;
  display: inline-flex; align-items: center; gap: 6px;
}
.market-card-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-top: 1px dashed var(--border); padding-top: 10px;
}
.market-card-count {
  font-size: 12px; color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
}
.market-type-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: var(--mist); color: var(--earth);
  border: 1px solid var(--border);
}
.market-type-pill.type-wholesale { background: #fff5e2; color: #a26200; border-color: #f2d29b; }
.market-type-pill.type-retail    { background: #e9f5ec; color: var(--leaf); border-color: #bfe0c8; }
.market-type-pill.type-both      { background: #eef3fb; color: #1e3a6f; border-color: #c6d4ec; }
.market-card-foot {
  font-size: 11px; font-family: var(--mono);
  color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
}

/* ─── Generic responsive utilities used by new pages ─────── */
.flex { display: flex; }
.gap-1 { gap: 10px; }
.flex-wrap { flex-wrap: wrap; }

/* ─── KAMIS-style 10-column price index ──────────────────── */
.price-index-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--white); }
.price-index { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1000px; }
.price-index th {
  background: var(--sky); padding: 11px 12px; text-align: left;
  font-size: 10.5px; font-family: var(--mono); letter-spacing: .08em;
  color: var(--earth); font-weight: 700; text-transform: uppercase;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.price-index td { padding: 11px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.price-index tbody tr:hover { background: var(--mist); }
.price-index .num { font-family: var(--mono); font-weight: 600; text-align: right; white-space: nowrap; }
.price-index .num.muted { color: var(--text-secondary); font-weight: 500; }
.price-index .col-commodity { font-weight: 600; color: var(--soil); }
.price-index .col-commodity a { color: inherit; text-decoration: none; }
.price-index .col-commodity a:hover { color: var(--leaf); }
.price-index .pill-mini {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; background: var(--mist); color: var(--earth);
}
.price-index .pill-mini.grade-grade1 { background: #e9f5ec; color: var(--leaf); }
.price-index .pill-mini.grade-grade2 { background: #fff5e2; color: #a26200; }
.price-index .pill-mini.grade-grade3 { background: #fde8e6; color: #a32a1a; }

.pager {
  display: flex; gap: 6px; align-items: center; justify-content: center;
  flex-wrap: wrap; margin-top: 18px;
}
.pager button, .pager a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--white);
  color: var(--earth); font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none;
}
.pager button:hover:not(:disabled), .pager a:hover { border-color: var(--leaf); color: var(--leaf); }
.pager .current { background: var(--leaf); border-color: var(--leaf); color: var(--white); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager .pager-info { color: var(--text-secondary); font-size: 12px; margin-left: 8px; }

/* ─── Organization cards (suppliers / offtakers) ────────── */
.org-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.org-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.org-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--leaf); }
.org-card-head { display: flex; gap: 12px; align-items: center; }
.org-card-logo {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--mist); display: grid; place-items: center;
  font-size: 24px; flex-shrink: 0;
}
.org-card-name { font-weight: 700; font-size: 16px; color: var(--soil); line-height: 1.2; }
.org-card-county {
  font-family: var(--mono); font-size: 11px; color: var(--harvest);
  letter-spacing: .04em; text-transform: uppercase; margin-top: 3px;
}
.org-card-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.5; flex: 1; }
.org-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.org-tag {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: var(--sky); color: var(--leaf); font-weight: 500;
}
.org-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--mist); color: var(--earth);
  border: 1px solid var(--border);
}
.org-pill.type-fpo         { background: #e9f5ec; color: var(--leaf); border-color: #bfe0c8; }
.org-pill.type-cooperative { background: #eef3fb; color: #1e3a6f; border-color: #c6d4ec; }
.org-pill.type-supplier    { background: #fff5e2; color: #a26200; border-color: #f2d29b; }
.org-pill.type-offtaker    { background: #fde8e6; color: #a32a1a; border-color: #f4c2bb; }

/* ─── Aggregation demand board ───────────────────────────── */
.demand-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.demand-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.demand-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--leaf); }
.demand-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.demand-org { font-family: var(--mono); font-size: 11px; color: var(--harvest); letter-spacing: .04em; text-transform: uppercase; }
.demand-commodity { font-weight: 700; font-size: 18px; color: var(--soil); margin-top: 3px; }
.demand-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.demand-stat { font-family: var(--mono); }
.demand-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demand-meta .lbl { font-size: 10.5px; color: var(--text-secondary); font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.demand-meta .val { font-size: 14px; font-weight: 600; color: var(--soil); margin-top: 2px; }
.demand-progress { background: var(--mist); border-radius: 999px; height: 6px; overflow: hidden; }
.demand-progress > span { display: block; height: 100%; background: var(--sprout); }
.demand-foot { display: flex; justify-content: space-between; align-items: center; }
.demand-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.demand-status.status-open      { background: #e9f5ec; color: var(--leaf); }
.demand-status.status-filling   { background: #eef3fb; color: #1e3a6f; }
.demand-status.status-urgent    { background: #fde8e6; color: #a32a1a; }
.demand-status.status-fulfilled { background: var(--mist); color: var(--text-secondary); }
.demand-status.status-closed,
.demand-status.status-cancelled { background: var(--mist); color: var(--text-secondary); }

/* ─── Multi-step form stepper ────────────────────────────── */
.stepper { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.stepper-item {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--white); color: var(--text-secondary); font-size: 13px;
}
.stepper-item .step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--mist); color: var(--text-secondary);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.stepper-item.active { border-color: var(--leaf); color: var(--soil); background: var(--sky); }
.stepper-item.active .step-num { background: var(--leaf); color: var(--white); }
.stepper-item.done { color: var(--leaf); }
.stepper-item.done .step-num { background: var(--leaf); color: var(--white); }

/* ─── Detail page hero strip ─────────────────────────────── */
.detail-hero {
  padding: 28px 0 24px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--leaf);
}
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-secondary); margin-bottom: 14px;
}
.breadcrumb a { color: var(--harvest); text-decoration: none; }
.breadcrumb a:hover { color: var(--leaf); }
.breadcrumb .sep { color: var(--text-secondary); opacity: .6; }

@media (max-width: 900px) { .responsive-grid-2-1 { grid-template-columns: 1fr !important; } }

/* ═══════════════════════════════════════════════════════════
   KAMIS Explorer — compact directory pages (markets, commodities, partners)
   ═══════════════════════════════════════════════════════════ */
.section--explorer { padding: 28px 0 48px; }
.section--explorer .section-title-v2 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 4px; }
.section--explorer .section-sub-v2 { font-size: 14px; max-width: 640px; margin-bottom: 0; }

.kamis-explorer { display: flex; flex-direction: column; gap: 16px; }

/* Hero strip */
.explorer-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  align-items: end;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.explorer-hero__actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-self: start;
}
.explorer-stats {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,.06);
}
.explorer-stat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--earth);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.explorer-stat strong {
  font-family: var(--mono); font-weight: 700; color: var(--soil); font-size: 13px;
}
.explorer-stat i { color: var(--harvest); font-size: 11px; }

/* Toolbar */
.explorer-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.explorer-toolbar .form-input,
.explorer-toolbar .form-select {
  padding: 8px 11px; font-size: 13px; border-radius: 8px; min-height: 38px;
}
.explorer-toolbar__search { flex: 1 1 200px; min-width: 160px; }
.explorer-toolbar__field { flex: 0 1 150px; min-width: 120px; }
.explorer-toolbar__field--wide { flex: 0 1 200px; }
.explorer-toolbar__chips {
  flex: 1 1 100%;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 4px;
}
.explorer-toolbar__chips .chip { padding: 6px 12px; font-size: 12px; }
.explorer-toolbar__dates { display: flex; gap: 8px; flex: 0 1 auto; }
.explorer-toolbar__dates .form-input { width: 130px; min-width: 0; }
.explorer-toolbar__actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* Data panel */
.explorer-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.explorer-panel__scroll {
  overflow-x: auto;
  max-height: min(68vh, 720px);
  overflow-y: auto;
}
.explorer-panel__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--mist);
}
.explorer-result-meta {
  font-size: 12px; color: var(--text-secondary);
  font-family: var(--mono); letter-spacing: .02em;
}
.explorer-result-meta strong { color: var(--soil); }

/* Unified compact table */
.kamis-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; min-width: 640px;
}
.kamis-table thead { position: sticky; top: 0; z-index: 2; }
.kamis-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--earth);
  background: var(--sky);
  border-bottom: 2px solid var(--border-strong);
  white-space: nowrap;
}
.kamis-table th i { margin-right: 4px; opacity: .75; font-size: 9px; }
.kamis-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.35;
}
.kamis-table tbody tr:nth-child(even) td { background: var(--mist); }
.kamis-table tbody tr:hover td { background: var(--sky); }
.kamis-table tbody tr:last-child td { border-bottom: none; }
.kamis-table .num { font-family: var(--mono); font-weight: 600; text-align: right; white-space: nowrap; }
.kamis-table .col-primary { font-weight: 600; }
.kamis-table a.col-link {
  color: var(--soil); text-decoration: none; font-weight: 600;
  transition: color .12s;
}
.kamis-table a.col-link:hover { color: var(--leaf); }
.kamis-table .muted { color: var(--text-secondary); font-weight: 400; }
.kamis-table-loading td,
.kamis-table-empty td {
  text-align: center; padding: 36px 16px !important;
  color: var(--text-secondary); background: var(--white) !important;
}
.kamis-table-empty td i { display: block; font-size: 22px; margin-bottom: 8px; opacity: .5; }
.kamis-table .cell-actions { text-align: right; white-space: nowrap; width: 1%; }
.kamis-table .btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 5px 11px; font-size: 11px; font-weight: 600;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--white); color: var(--soil);
  text-decoration: none; transition: all .12s;
}
.kamis-table .btn-icon:hover {
  background: var(--leaf); border-color: var(--leaf); color: var(--white);
}
.kamis-table .type-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
  white-space: nowrap;
}
.kamis-table .type-pill.type-wholesale { background: #fff5e2; color: #a26200; }
.kamis-table .type-pill.type-retail { background: #e9f5ec; color: var(--leaf); }
.kamis-table .type-pill.type-both { background: #eef3fb; color: #1e3a6f; }
.kamis-table .type-pill.type-fpo { background: #e9f5ec; color: var(--leaf); }
.kamis-table .type-pill.type-cooperative { background: #eef3fb; color: #1e3a6f; }
.kamis-table .type-pill.type-offtaker { background: #fde8e6; color: #a32a1a; }
.kamis-table .type-pill.type-open { background: #e9f5ec; color: var(--leaf); }
.kamis-table .type-pill.type-urgent { background: #fde8e6; color: #c0392b; }
.kamis-table .type-pill.type-filling { background: #fff5e2; color: #a26200; }
.kamis-table .type-pill.type-fulfilled { background: #eef3fb; color: #1e3a6f; }
.kamis-table .type-pill.type-closed,
.kamis-table .type-pill.type-cancelled { background: #f0f0f0; color: #666; }
.kamis-table .type-pill.grade-grade1 { background: #e9f5ec; color: var(--leaf); }
.kamis-table .type-pill.grade-grade2 { background: #fff5e2; color: #a26200; }
.kamis-table .type-pill.grade-grade3 { background: #f0f0f0; color: #666; }
.kamis-table .org-emoji { font-size: 18px; margin-right: 6px; vertical-align: middle; }

/* Compact price index inside explorer */
.kamis-explorer .price-index { min-width: 960px; font-size: 12.5px; }
.kamis-explorer .price-index th { padding: 8px 10px; font-size: 9.5px; }
.kamis-explorer .price-index td { padding: 7px 10px; }
.kamis-explorer .price-index-wrap { border: none; border-radius: 0; max-height: none; }
.kamis-explorer .filter-grid {
  margin: 0; padding: 0; border: none; box-shadow: none;
  background: transparent;
  display: contents;
}
.kamis-explorer .filter-grid .form-input,
.kamis-explorer .filter-grid .form-select {
  padding: 8px 11px; font-size: 13px; min-height: 38px;
}

/* Enhanced pager */
.explorer-panel__foot .pager,
.kamis-explorer > .pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 4px; margin: 0;
}
.pager button {
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: 8px; font-size: 12px; font-weight: 600;
}
.pager .pager-meta,
.pager .pager-info {
  font-size: 11px; color: var(--text-secondary);
  font-family: var(--mono); margin-left: 8px; white-space: nowrap;
}
.pager .pager-ellipsis { padding: 0 4px; color: var(--text-secondary); font-size: 12px; }

@media (max-width: 768px) {
  .explorer-hero { grid-template-columns: 1fr; }
  .explorer-hero__actions { justify-content: flex-start; }
  .explorer-toolbar__search,
  .explorer-toolbar__field { flex: 1 1 100%; }
  .explorer-panel__scroll { max-height: none; }
  .explorer-panel__foot { flex-direction: column; align-items: stretch; }
  .explorer-panel__foot .pager { justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════
   Modern detail pages + modals (supplier/offtaker/aggregation)
   ═══════════════════════════════════════════════════════════ */
.detail-shell { display: flex; flex-direction: column; gap: 16px; }
.detail-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  align-items: end;
}
.detail-header__main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.detail-avatar {
  width: 72px; height: 72px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 30px;
  flex-shrink: 0;
}
.detail-avatar--img,
.org-card-logo.detail-avatar--img {
  padding: 6px;
  overflow: hidden;
  font-size: 0;
}
.detail-avatar--img img,
.org-card-logo.detail-avatar--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.org-logo-thumb {
  display: inline-flex;
  vertical-align: middle;
  width: 28px;
  height: 28px;
  margin-right: 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  overflow: hidden;
  flex-shrink: 0;
}
.org-logo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.detail-title { margin: 4px 0 6px; font-size: clamp(24px, 3vw, 34px); }
.detail-sub {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  color: var(--text-secondary); font-size: 14px;
}
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-self: start; }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  align-items: start;
}
.detail-sticky { position: sticky; top: 84px; }
.detail-card { padding: 20px; }
.detail-card h3 { margin: 0 0 12px; font-family: var(--display); font-weight: 600; font-size: 18px; }
.detail-card p { color: var(--text-secondary); }

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  font-size: 13px;
  margin: 0;
}
.kv dt { color: var(--text-secondary); }
.kv dd { margin: 0; }

.kamis-alert {
  border: 1px solid var(--border);
  background: var(--mist);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--earth);
}
.kamis-alert.success { background: #e9f5ec; border-color: #bfe0c8; color: var(--leaf); }
.kamis-alert.danger  { background: #fde8e8; border-color: #f0b6b6; color: #842029; }

.kamis-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 220;
  padding: 18px;
}
.kamis-modal-backdrop.open { display: flex; }
.kamis-modal {
  width: min(760px, 100%);
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  overflow: hidden;
}
.kamis-modal__head {
  padding: 14px 16px;
  background: var(--mist);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.kamis-modal__title { font-family: var(--display); font-weight: 600; color: var(--soil); }
.kamis-modal__close {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
}
.kamis-modal__body { padding: 16px; max-height: min(78vh, 760px); overflow: auto; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-actions { justify-content: flex-start; }
  .detail-sticky { position: static; }
}

/* ═══════════════════════════════════════════════════════════
   Homepage — original hero / strip / subscribe (page-home only)
   ═══════════════════════════════════════════════════════════ */
.page-home .hero.hero-v2 {
  background: #1a0f00;
  background-image:
    radial-gradient(ellipse 60% 80% at 80% 40%, rgba(45, 106, 47, .45) 0%, transparent 70%),
    radial-gradient(ellipse 45% 60% at 8% 90%, rgba(200, 120, 26, .25) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(240, 180, 41, .1) 0%, transparent 70%);
  border-bottom: none;
}
.page-home .hero h1 em { color: #f0b429; }
.page-home .hero-v2 h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(38px, 5.4vw, 62px);
  font-weight: 700;
  letter-spacing: -.01em;
}
.page-home .hero-v2 h1 em { color: #f0b429; }
.page-home .hero-stat-num,
.page-home .hero-v2 .hero-stat-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  color: #f0b429;
  font-weight: 700;
  font-variant-numeric: normal;
}
.page-home .btn-gold {
  background: #f0b429;
  color: #1a0f00;
  border-color: #f0b429;
}
.page-home .btn-gold:hover {
  background: #dba01b;
  color: #1a0f00;
  border-color: #dba01b;
}
.page-home .feature-strip {
  background: #2d6a2f;
  background-image: linear-gradient(135deg, #2d6a2f 0%, #245a25 100%);
  border-bottom: 3px solid #1a0f00;
}
.page-home .subscribe-band {
  background: linear-gradient(135deg, #2d6a2f 0%, #235a25 100%);
}
.page-home .subscribe-band h2 {
  font-family: 'Playfair Display', Georgia, serif;
}
.page-home .section-head .section-label {
  font-family: var(--mono);
  font-weight: 700;
  color: #c8781a;
}
.page-home .section-head .section-label::before {
  width: 16px;
  height: 2px;
  background: #c8781a;
}
.page-home .section-head .section-title-v2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   Wizard form (post demand, etc.)
   ═══════════════════════════════════════════════════════════ */
.wizard-page {
  max-width: 640px;
  margin: 0 auto;
}
.wizard-page__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.wizard-page__head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.wizard-page__head .muted { margin-top: 4px; }

.wizard-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.wizard-steps {
  display: flex;
  align-items: center;
  padding: 18px 24px;
  background: var(--mist);
  border-bottom: 1px solid var(--border);
  gap: 0;
}
.wizard-steps .stepper-item {
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  position: relative;
}
.wizard-steps .stepper-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 13px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.wizard-steps .stepper-item.done:not(:last-child)::after {
  background: var(--leaf);
}
.wizard-steps .stepper-item .step-num {
  width: 28px;
  height: 28px;
  font-size: 12px;
  position: relative;
  z-index: 1;
  border: 2px solid var(--border);
  background: var(--white);
}
.wizard-steps .stepper-item.active {
  color: var(--soil);
  background: transparent;
}
.wizard-steps .stepper-item.active .step-num {
  background: var(--leaf);
  border-color: var(--leaf);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(42, 99, 64, 0.12);
}
.wizard-steps .stepper-item.done .step-num {
  background: var(--leaf);
  border-color: var(--leaf);
  color: var(--white);
}
.wizard-steps .stepper-item span:not(.step-num) {
  line-height: 1.2;
  max-width: 100%;
}

.wizard-form {
  padding: 28px 28px 24px;
}
.wizard-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.wizard-form .form-label {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.wizard-form .form-input,
.wizard-form .form-select {
  min-height: 42px;
  border-radius: 8px;
  background: var(--cream);
}
.wizard-form .form-input:focus,
.wizard-form .form-select:focus {
  background: var(--white);
}
.wizard-step-intro {
  margin-bottom: 22px;
}
.wizard-step-intro h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  font-family: var(--sans);
}
.wizard-step-intro p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.wizard-form .form-grid {
  display: grid;
  gap: 16px;
}
.wizard-form .form-grid--2 {
  grid-template-columns: 1fr 1fr;
}
.wizard-form .form-grid--3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.wizard-form .form-span-2 {
  grid-column: 1 / -1;
}
.wizard-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wizard-actions--end {
  justify-content: flex-end;
}
.wizard-summary {
  margin-top: 4px;
  padding: 16px 18px;
  background: var(--mist);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
}
.wizard-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.wizard-summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.wizard-summary-row dt {
  color: var(--text-secondary);
  font-weight: 500;
}
.wizard-summary-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--soil);
  text-align: right;
}

@media (max-width: 560px) {
  .wizard-form { padding: 20px 18px; }
  .wizard-form .form-grid--2,
  .wizard-form .form-grid--3 { grid-template-columns: 1fr; }
  .wizard-steps .stepper-item span:not(.step-num) { font-size: 10px; }
}

/* Marketplace product catalog (trade.php) */
.trade-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.trade-catalog-loading { grid-column: 1 / -1; text-align: center; padding: 32px; }
.trade-catalog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  height: 100%;
}
.trade-catalog-card__icon {
  font-size: 40px;
  line-height: 1;
}
.trade-catalog-card__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.trade-catalog-card__title a {
  color: inherit;
  text-decoration: none;
}
.trade-catalog-card__title a:hover { color: var(--leaf); }
.trade-catalog-price { margin: 6px 0 4px; }
.trade-catalog-from {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--leaf);
  font-size: 15px;
}
.trade-catalog-card__actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─── Marketplace shop bar & PDP ─────────────────────────── */
.shop-bar {
  background: var(--sky);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.shop-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.shop-bar__county {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.shop-bar__county:hover { border-color: var(--leaf); }
.shop-bar__actions { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.shop-bar__cart { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.shop-bar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--leaf);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.shop-nav-cart { position: relative; }
.shop-nav-cart .shop-bar__badge { position: absolute; top: -4px; right: -6px; }

.shop-pdp-hero__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}
.shop-pdp-hero__visual {
  width: 120px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--white) 0%, var(--sky) 100%);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.1);
  overflow: hidden;
}
.shop-pdp-hero__emoji {
  font-size: 56px;
  line-height: 1;
}
.shop-pdp-hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 640px) {
  .shop-pdp-hero__grid {
    gap: 16px;
  }
  .shop-pdp-hero__visual {
    width: 72px;
    height: 88px;
  }
  .shop-pdp-hero__emoji {
    font-size: 40px;
  }
}
.shop-pdp-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .shop-pdp-layout { grid-template-columns: 1fr; }
}
.shop-offers-table .shop-offer-row--best { background: rgba(45, 106, 79, 0.06); }
.shop-pdp-buy { position: sticky; top: 88px; padding: 20px; }
.shop-pdp-buy__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.shop-pdp-buy__continue {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
}
.shop-pdp-empty-cell { padding: 32px 24px !important; text-align: center; }
.shop-pdp-empty-county {
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.shop-pdp-empty-county__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(45, 106, 79, 0.08);
  color: var(--leaf);
  font-size: 18px;
}
.shop-pdp-empty-county__title {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}
.type-pill.type-muted {
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
}

.cart-lines { display: flex; flex-direction: column; gap: 12px; }
.cart-line {
  display: grid;
  grid-template-columns: 1fr 120px 100px 32px;
  gap: 16px;
  align-items: center;
  padding: 16px;
}
@media (max-width: 640px) {
  .cart-line { grid-template-columns: 1fr; }
}
.checkout-line { padding: 10px 0; border-bottom: 1px solid var(--border); }
.checkout-line:last-child { border-bottom: none; }

.checkout-complete__hero { text-align: center; margin-bottom: 20px; }
.checkout-complete__icon {
  font-size: 48px;
  margin-bottom: 12px;
  color: var(--leaf);
  line-height: 1;
}
.checkout-pay-focus { text-align: center; }
.checkout-pay-focus__hero { margin-bottom: 24px; }
.checkout-pay-focus__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sky);
  color: var(--leaf);
  font-size: 28px;
}
.checkout-pay-focus__amount {
  font-size: 28px;
  margin: 12px 0;
  line-height: 1.2;
}
.checkout-pay-focus__amount .muted { font-size: 15px; font-weight: 400; }
.checkout-pay-panel { margin: 0 auto; max-width: 420px; text-align: left; }
.checkout-pay-waiting--active {
  padding: 16px;
  background: var(--sky);
  border: 1px solid rgba(45, 106, 79, 0.15);
  border-radius: 10px;
}
.checkout-pay-focus__cta { margin-top: 12px; }
.checkout-pay-focus__note { margin-top: 20px; text-align: center; }
.checkout-pay-countdown { font-family: var(--mono); letter-spacing: 0.02em; }
.checkout-receipt-btn { margin-bottom: 0; }
.checkout-refs-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.checkout-refs-list li { margin: 8px 0; }
.checkout-pay-waiting {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}
.checkout-pay-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--leaf);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  animation: checkout-spin 0.8s linear infinite;
}
@keyframes checkout-spin { to { transform: rotate(360deg); } }
.checkout-pay-panel--paid { background: rgba(45, 106, 79, 0.08) !important; }

