@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* =====================================================================
   Ronica Organic - storefront + member panel + admin panel
   A single design system: brand green anchors it, a spectrum of accent
   colours carries the data. Every screen shares these tokens.
   ===================================================================== */

:root {
  /* Brand scale. admin/settings.php overwrites these through
     brandStyleTag(), so everything else is derived from them. */
  --green-900: #0f3d28;
  --green-800: #16563a;
  --green-700: #1c7a4f;
  --green-600: #24a066;
  --green-500: #3fbf82;
  --green-100: #dff5e9;
  --green-050: #f1fbf6;

  --gold-600: #b4780a;
  --gold-500: #e2a416;
  --gold-100: #fdf3d9;

  /* Accent spectrum - independent of branding, used to colour-code data. */
  --sky-600: #1d6fd6;    --sky-100: #e4efff;
  --violet-600: #7141d8; --violet-100: #efe8fe;
  --rose-600: #d92a5c;   --rose-100: #ffe6ed;
  --teal-600: #0d9488;   --teal-100: #d7f5f1;
  --orange-600: #de6a12; --orange-100: #ffeeda;
  --lime-600: #5d9c0d;   --lime-100: #eaf7d5;

  /* Neutrals */
  --ink-900: #10201a;
  --ink-700: #33473d;
  --ink-500: #62786c;
  --ink-300: #9aaba1;
  --line: #e0eae5;
  --line-soft: #edf3f0;
  --bg: #f4f8f6;
  --white: #ffffff;

  /* Status */
  --danger: #cc2f22;  --danger-bg: #fdeceb;
  --warn: #a76b00;    --warn-bg: #fff5e0;
  --info: #1d6fd6;    --info-bg: #e4efff;
  --success: var(--green-700);

  /* Shape + depth */
  --radius-xs: 8px;
  --radius-sm: 11px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-xs: 0 1px 2px rgba(15, 61, 40, .06);
  --shadow-sm: 0 2px 8px rgba(15, 61, 40, .07);
  --shadow: 0 10px 28px -10px rgba(15, 61, 40, .22);
  --shadow-lg: 0 26px 60px -22px rgba(15, 61, 40, .38);
  --ring: 0 0 0 3px rgba(36, 160, 102, .22);

  /* Signature gradients */
  --grad-brand: linear-gradient(135deg, var(--green-700), var(--green-600) 55%, var(--green-500));
  --grad-deep: linear-gradient(150deg, var(--green-900), var(--green-800) 45%, var(--green-700));
  --grad-gold: linear-gradient(135deg, var(--gold-500), #f2c14e);
  --grad-line: linear-gradient(90deg, var(--green-600), var(--gold-500) 45%, var(--sky-600) 75%, var(--violet-600));

  --font: "Plus Jakarta Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --header-h: 68px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink-900);
  background:
    radial-gradient(1100px 520px at 8% -10%, rgba(36, 160, 102, .07), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(226, 164, 22, .07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-700); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--green-800); text-decoration: none; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }

h1, h2, h3, h4 {
  margin: 0 0 .6rem;
  line-height: 1.22;
  color: var(--green-900);
  letter-spacing: -.015em;
  font-weight: 700;
}
h1 { font-size: 1.85rem; font-weight: 800; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: .98rem; }
p { margin: 0 0 1rem; }
b, strong { font-weight: 700; }

::selection { background: var(--green-100); color: var(--green-900); }
:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1200px, 92%); margin: 0 auto; }
.container-narrow { width: min(820px, 92%); margin: 0 auto; }

/* =====================================================================
   Top bar / storefront header
   ===================================================================== */
.topbar {
  background: var(--grad-deep);
  color: #cfe6da;
  font-size: .8rem;
  padding: .45rem 0;
  position: relative;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--grad-line); opacity: .85;
}
.topbar .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.topbar a { color: #eaf5ef; font-weight: 500; }
.topbar a:hover { color: #fff; }

.site-header {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
  transition: box-shadow .2s ease, background .2s ease;
}
.site-header.is-stuck { box-shadow: var(--shadow); background: rgba(255, 255, 255, .96); }
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-height: var(--header-h);
  padding: .55rem 0;
}

.brand { display: flex; align-items: center; gap: .65rem; font-weight: 800; font-size: 1.2rem; color: var(--green-900); letter-spacing: -.02em; }
.brand:hover { color: var(--green-800); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad-brand);
  color: #fff; display: grid; place-items: center;
  font-size: 1rem; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 6px 16px -6px rgba(28, 122, 79, .8);
  flex-shrink: 0;
}
.brand small {
  display: block; font-size: .64rem; font-weight: 600; color: var(--ink-500);
  letter-spacing: .1em; text-transform: uppercase; line-height: 1.4;
}

.main-nav { display: flex; gap: .2rem; margin-left: auto; align-items: center; }
.main-nav a {
  color: var(--ink-700); font-weight: 600; font-size: .9rem;
  padding: .45rem .7rem; border-radius: 999px; position: relative;
  transition: background .15s ease, color .15s ease;
}
.main-nav a:hover { color: var(--green-800); background: var(--green-050); }
.main-nav a.active { color: var(--green-800); background: var(--green-100); }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.cart-link {
  position: relative; display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .85rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-700); font-weight: 600; font-size: .88rem; background: var(--white);
  transition: .15s ease;
}
.cart-link:hover { border-color: var(--green-500); color: var(--green-800); box-shadow: var(--shadow-xs); }
.cart-count {
  position: absolute; top: -7px; right: -7px;
  background: var(--grad-gold); color: #3a2a00;
  border-radius: 999px; font-size: .66rem; font-weight: 800;
  min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2); border: 2px solid var(--white);
}

.nav-toggle {
  display: none; background: var(--white); border: 1px solid var(--line);
  border-radius: 10px; width: 42px; height: 42px; font-size: 1.15rem; cursor: pointer;
  color: var(--green-800); align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-toggle:hover { background: var(--green-050); border-color: var(--green-500); }
.nav-backdrop {
  position: fixed; inset: 0; background: rgba(9, 30, 20, .5);
  backdrop-filter: blur(2px); z-index: 55; opacity: 0; transition: opacity .2s ease;
}
.nav-backdrop.show { opacity: 1; }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.2rem; border-radius: var(--radius-xs);
  border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .92rem;
  letter-spacing: .005em; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(28, 122, 79, .9); }
.btn-primary:hover { color: #fff; box-shadow: 0 12px 24px -10px rgba(28, 122, 79, .95); filter: brightness(1.04); }

.btn-gold { background: var(--grad-gold); color: #402d00; box-shadow: 0 6px 16px -8px rgba(226, 164, 22, .95); }
.btn-gold:hover { color: #402d00; box-shadow: 0 12px 24px -10px rgba(226, 164, 22, 1); filter: brightness(1.04); }

.btn-outline { background: transparent; border-color: var(--green-600); color: var(--green-700); }
.btn-outline:hover { background: var(--green-050); color: var(--green-800); border-color: var(--green-700); }

.btn-light { background: var(--white); border-color: var(--line); color: var(--ink-700); box-shadow: var(--shadow-xs); }
.btn-light:hover { background: var(--green-050); border-color: var(--green-500); color: var(--green-800); }

/* Outline button sitting on one of the dark green bands. */
.btn-on-dark { border-color: rgba(255, 255, 255, .55); color: #fff; background: rgba(255, 255, 255, .06); }
.btn-on-dark:hover { background: rgba(255, 255, 255, .16); border-color: #fff; color: #fff; }

.btn-danger { background: linear-gradient(135deg, #d9382a, #b32418); color: #fff; box-shadow: 0 6px 16px -8px rgba(204, 47, 34, .9); }
.btn-danger:hover { color: #fff; filter: brightness(1.05); }

.btn-sm { padding: .38rem .78rem; font-size: .82rem; border-radius: 7px; }
.btn-lg { padding: .82rem 1.7rem; font-size: 1.02rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; box-shadow: none; }

/* =====================================================================
   Cards / panels
   ===================================================================== */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card-pad { padding: 1.35rem; }
.card-head {
  padding: 1rem 1.35rem;
  background: linear-gradient(180deg, var(--green-050), var(--white));
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 1.02rem; letter-spacing: -.01em; }
.card-body { padding: 1.35rem; }
.card-body > :last-child, .card-pad > :last-child { margin-bottom: 0; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 350px; align-items: start; }

/* =====================================================================
   Alerts / badges
   ===================================================================== */
.alert {
  padding: .85rem 1.05rem .85rem 1.15rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; border: 1px solid; border-left-width: 4px; font-size: .91rem;
  box-shadow: var(--shadow-xs);
}
.alert > :last-child { margin-bottom: 0; }
.alert-success { background: var(--green-100); border-color: #b6e2c9; border-left-color: var(--green-600); color: var(--green-800); }
.alert-danger  { background: var(--danger-bg); border-color: #f5c3bf; border-left-color: var(--danger); color: #93261b; }
.alert-warning { background: var(--warn-bg); border-color: #f2dcaa; border-left-color: var(--gold-500); color: #7a4f00; }
.alert-info    { background: var(--info-bg); border-color: #c6dcfa; border-left-color: var(--sky-600); color: #164e9c; }

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .02em; line-height: 1.5;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-success { background: var(--green-100); color: var(--green-800); border-color: #b6e2c9; }
.badge-warning { background: var(--warn-bg); color: var(--warn); border-color: #f2dcaa; }
.badge-danger  { background: var(--danger-bg); color: var(--danger); border-color: #f5c3bf; }
.badge-info    { background: var(--info-bg); color: var(--sky-600); border-color: #c6dcfa; }
.badge-muted   { background: #eef2f0; color: var(--ink-500); border-color: var(--line); }
.badge-gold    { background: var(--gold-100); color: var(--gold-600); border-color: #f0dcae; }

/* =====================================================================
   Forms
   ===================================================================== */
.form-row { margin-bottom: 1.05rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; }
label { display: block; font-weight: 700; font-size: .82rem; color: var(--ink-700); margin-bottom: .35rem; letter-spacing: .01em; }
.req::after { content: " *"; color: var(--danger); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=tel], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: .65rem .8rem; font: inherit; font-size: .93rem; color: var(--ink-900);
  border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--white);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--ink-300); }
input:hover, select:hover, textarea:hover { border-color: #c9dbd2; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green-600); box-shadow: var(--ring); background: var(--white);
}
input[type=file] { padding: .45rem .55rem; background: var(--green-050); }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2362786c' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.1rem;
}
textarea { min-height: 115px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--green-600); width: 17px; height: 17px; }
.help { font-size: .78rem; color: var(--ink-500); margin-top: .3rem; }
.checkline { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; }
.checkline input { margin-top: .28rem; flex-shrink: 0; }
.checkline label { font-weight: 500; margin: 0; font-size: .88rem; color: var(--ink-700); }

/* =====================================================================
   Tables
   ===================================================================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cfded6; border-radius: 999px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }

table.data { width: 100%; border-collapse: collapse; font-size: .885rem; }
table.data th, table.data td {
  padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle;
}
table.data thead th {
  background: linear-gradient(180deg, var(--green-050), #e9f5ef);
  color: var(--green-800); font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.data tbody tr { transition: background .12s ease; }
table.data tbody tr:nth-child(even) { background: #fbfdfc; }
table.data tbody tr:hover { background: var(--green-050); }
table.data tfoot th, table.data tfoot td {
  background: var(--green-050); color: var(--green-900); font-weight: 800; border-top: 2px solid var(--line); border-bottom: 0;
}
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:last-child td { border-bottom: 0; }
.empty { padding: 2.75rem 1rem; text-align: center; color: var(--ink-500); font-size: .92rem; }

/* =====================================================================
   Hero / sections
   ===================================================================== */
.hero {
  background: var(--grad-deep);
  color: #eafaf1;
  padding: 3.75rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before,
.hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.hero::before {
  width: 520px; height: 520px; right: -140px; top: -190px;
  background: radial-gradient(circle, rgba(226, 164, 22, .30), transparent 68%);
}
.hero::after {
  width: 460px; height: 460px; left: -170px; bottom: -230px;
  background: radial-gradient(circle, rgba(63, 191, 130, .32), transparent 68%);
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.08fr .92fr; gap: 2.5rem; align-items: center; }
.hero h1 { color: #fff; font-size: 2.6rem; max-width: 17ch; font-weight: 800; letter-spacing: -.03em; }
.hero p { color: #cbe8da; font-size: 1.05rem; max-width: 52ch; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.4rem; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-top: 2.1rem; }
.hero-stat {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: var(--radius-sm); padding: .85rem .9rem;
  backdrop-filter: blur(6px);
}
.hero-stat b { display: block; font-size: 1.35rem; color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: .7rem; color: #a9d4bd; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
/* Admin-only reminder shown beside the private counters. */
.hero-note {
  grid-column: 1 / -1; font-size: .74rem; line-height: 1.5; color: #f0d9a2;
  background: rgba(226, 164, 22, .13); border: 1px dashed rgba(226, 164, 22, .45);
  border-radius: var(--radius-xs); padding: .5rem .7rem;
}
.hero-note b { color: #fff; }

.section { padding: 3.25rem 0; }
.section-head { text-align: center; margin-bottom: 2.1rem; }
.section-head h2 { font-size: 1.9rem; letter-spacing: -.025em; }
.section-head p { color: var(--ink-500); max-width: 62ch; margin: 0 auto; }
.eyebrow {
  display: inline-block; color: var(--green-700); font-weight: 800;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .4rem;
}
.section-head .eyebrow { display: block; }
/* On the dark hero the green eyebrow and summary totals disappear. */
.hero .eyebrow { color: var(--gold-500); }
.hero .card { box-shadow: none; }
.hero .summary-line { border-bottom-color: rgba(255, 255, 255, .13); }
.hero .summary-line.total { color: #fff; border-top-color: rgba(255, 255, 255, .28); }

/* Closing call-to-action band. */
.cta-band {
  background: var(--grad-deep); color: #cfe6da;
  padding: 3rem 0; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad-line);
}
.cta-band::after {
  content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px;
  border-radius: 50%; background: radial-gradient(circle, rgba(226, 164, 22, .26), transparent 68%);
  pointer-events: none;
}
.cta-band .container {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.4fr auto; gap: 2rem; align-items: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #b6d5c5; margin: 0; }
.cta-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }

/* =====================================================================
   Product cards
   ===================================================================== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 1.2rem; }
.product-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: #cbe6d8; }
.product-thumb {
  position: relative; aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, var(--green-050), #eef6f2);
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card:hover .product-thumb img { transform: scale(1.05); }
.product-tag {
  position: absolute; top: .6rem; left: .6rem; z-index: 2;
  background: var(--grad-gold); color: #3a2a00; font-size: .65rem; font-weight: 800;
  padding: .22rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em;
  box-shadow: 0 3px 10px -3px rgba(0, 0, 0, .35);
}
.product-off {
  position: absolute; top: .6rem; right: .6rem; z-index: 2;
  background: linear-gradient(135deg, var(--rose-600), #f0517d); color: #fff;
  font-size: .68rem; font-weight: 800; padding: .22rem .55rem; border-radius: 999px;
  box-shadow: 0 3px 10px -3px rgba(217, 42, 92, .6);
}
.product-body { padding: .95rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.product-name { font-weight: 700; font-size: .95rem; color: var(--ink-900); line-height: 1.38; }
.product-name a { color: inherit; }
.product-name a:hover { color: var(--green-700); }
.price-row { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.price { font-size: 1.18rem; font-weight: 800; color: var(--green-800); font-variant-numeric: tabular-nums; }
.mrp { font-size: .84rem; color: var(--ink-300); text-decoration: line-through; }
.product-body .btn { margin-top: auto; }
.product-body form { margin: auto 0 0; }

/* =====================================================================
   Product detail
   ===================================================================== */
.gallery-main {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--white); aspect-ratio: 1/1; box-shadow: var(--shadow-sm);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-top: .65rem; }
.gallery-thumbs img {
  border: 2px solid var(--line); border-radius: var(--radius-xs);
  aspect-ratio: 1/1; object-fit: cover; cursor: pointer; transition: .15s ease;
}
.gallery-thumbs img:hover { border-color: var(--green-500); }
.gallery-thumbs img.active { border-color: var(--green-600); box-shadow: var(--ring); }

.lightbox {
  position: fixed; inset: 0; background: rgba(8, 24, 16, .93);
  display: none; place-items: center; z-index: 200; padding: 2rem;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.25rem; color: #fff; font-size: 1.6rem;
  cursor: pointer; background: rgba(255, 255, 255, .12); border: 0;
  width: 44px; height: 44px; border-radius: 50%; line-height: 1;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .22); }

.qty-box {
  display: inline-flex; align-items: center; border: 1px solid var(--line);
  border-radius: var(--radius-xs); overflow: hidden; background: var(--white);
}
.qty-box button {
  width: 40px; height: 42px; border: 0; background: var(--green-050);
  font-size: 1.1rem; cursor: pointer; color: var(--green-800); font-weight: 700;
}
.qty-box button:hover { background: var(--green-100); }
.qty-box input { width: 54px; border: 0; text-align: center; height: 42px; font-weight: 700; border-radius: 0; }
.qty-box input:focus { box-shadow: none; }

/* =====================================================================
   Cart / checkout
   ===================================================================== */
.summary-line { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; font-size: .91rem; border-bottom: 1px dashed var(--line-soft); }
.summary-line:last-child { border-bottom: 0; }
.summary-line.total {
  border-top: 2px solid var(--line); border-bottom: 0; margin-top: .55rem; padding-top: .8rem;
  font-size: 1.12rem; font-weight: 800; color: var(--green-800);
}
.coupon-form { display: flex; gap: .5rem; }
.cart-item {
  display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid var(--line-soft);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 86px; height: 86px; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--line); }

/* =====================================================================
   Member / admin panel shell
   ===================================================================== */
.panel { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }

.panel-side {
  background: var(--grad-deep);
  color: #d6ebe0; padding: 1rem 0 2rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
  border-right: 1px solid rgba(255, 255, 255, .07);
}
.panel-side::-webkit-scrollbar { width: 7px; }
.panel-side::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 999px; }
.panel-side .brand {
  color: #fff; padding: .35rem 1.2rem 1.1rem; font-size: 1.06rem;
  margin-bottom: .3rem; border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.panel-side .brand small { color: #8fc7aa; }
.panel-side .brand-mark { box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .55); }

.side-group {
  padding: 1.05rem 1.2rem .35rem; font-size: .65rem; text-transform: uppercase;
  letter-spacing: .14em; color: #7fb69b; font-weight: 800;
}
.panel-side a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1.2rem; color: #cbe4d8; font-size: .875rem; font-weight: 500;
  border-left: 3px solid transparent; transition: background .14s ease, color .14s ease;
}
.panel-side a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.panel-side a.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04));
  color: #fff; border-left-color: var(--gold-500); font-weight: 700;
}
.panel-side .badge { margin-left: auto; }
/* The mobile drawer overlay. It is a child of .panel, so it must be removed
   from the grid on desktop or it would consume the sidebar's column. */
.panel-backdrop { display: none; }

.panel-main { min-width: 0; display: flex; flex-direction: column; }
.panel-top {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: .8rem 1.6rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow-xs);
}
.panel-top h1 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.panel-top .spacer { margin-left: auto; }
.panel-content { padding: 1.6rem; flex: 1; }

/* ---- Stat tiles: colour-coded, cycling through the accent spectrum ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat {
  --stat-a: var(--green-600);
  --stat-b: var(--green-500);
  --stat-soft: var(--green-100);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.05rem 1.15rem 1.05rem 1.3rem; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--stat-a), var(--stat-b));
}
.stat::after {
  content: ""; position: absolute; right: -32px; top: -32px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--stat-soft); opacity: .55; pointer-events: none;
}
.stat > * { position: relative; z-index: 1; }
.stat b {
  display: block; font-size: 1.55rem; font-weight: 800; color: var(--green-900);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.2;
}
.stat span { font-size: .74rem; color: var(--ink-500); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.stat .sub { font-size: .76rem; color: var(--ink-500); text-transform: none; letter-spacing: 0; margin-top: .15rem; font-weight: 500; }

/* Automatic colour rotation so a row of tiles never reads as a grey wall. */
.stat:nth-child(5n+2) { --stat-a: var(--gold-500);   --stat-b: #f2c14e;  --stat-soft: var(--gold-100); }
.stat:nth-child(5n+3) { --stat-a: var(--sky-600);    --stat-b: #5b9cf0;  --stat-soft: var(--sky-100); }
.stat:nth-child(5n+4) { --stat-a: var(--violet-600); --stat-b: #a37cf0;  --stat-soft: var(--violet-100); }
.stat:nth-child(5n+5) { --stat-a: var(--teal-600);   --stat-b: #3fc7bb;  --stat-soft: var(--teal-100); }

/* Explicit variants declared last so page-level classes win the cascade. */
.stat.gold { --stat-a: var(--gold-500);   --stat-b: #f2c14e; --stat-soft: var(--gold-100); }
.stat.blue { --stat-a: var(--sky-600);    --stat-b: #5b9cf0; --stat-soft: var(--sky-100); }
.stat.red  { --stat-a: var(--danger);     --stat-b: #f0705f; --stat-soft: var(--danger-bg); }
.stat.red b { color: #93261b; }

/* =====================================================================
   Binary tree
   ===================================================================== */
.tree-scroll { overflow-x: auto; padding: 1.75rem .5rem; -webkit-overflow-scrolling: touch; }
.tree { display: flex; justify-content: center; min-width: max-content; }
.tree ul { display: flex; padding-top: 24px; position: relative; margin: 0; list-style: none; }
.tree li { position: relative; padding: 24px 8px 0; text-align: center; list-style: none; }
.tree li::before, .tree li::after {
  content: ""; position: absolute; top: 0; right: 50%;
  border-top: 2px solid #cfe0d7; width: 50%; height: 24px;
}
.tree li::after { right: auto; left: 50%; border-left: 2px solid #cfe0d7; }
.tree li:only-child::after, .tree li:only-child::before { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
.tree li:last-child::before { border-right: 2px solid #cfe0d7; border-radius: 0 7px 0 0; }
.tree li:first-child::after { border-radius: 7px 0 0 0; }
.tree ul ul::before {
  content: ""; position: absolute; top: 0; left: 50%;
  border-left: 2px solid #cfe0d7; width: 0; height: 24px;
}
.node {
  display: inline-block; min-width: 144px; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--white);
  font-size: .8rem; color: var(--ink-900); box-shadow: var(--shadow-xs);
  transition: .15s ease;
}
.node:hover { border-color: var(--green-500); box-shadow: var(--shadow-sm); transform: translateY(-2px); color: var(--ink-900); }
.node.self { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: var(--shadow); }
.node.self .node-code { color: #cdeddd; }
.node.empty { background: #f5f8f6; border-style: dashed; color: var(--ink-300); box-shadow: none; }
.node-name { font-weight: 700; display: block; }
.node-code { font-size: .72rem; color: var(--ink-500); font-family: var(--font-mono); }
.node-legs { font-size: .7rem; color: var(--green-700); margin-top: .22rem; font-weight: 700; }
.node.self .node-legs { color: #b6e6cd; }

/* =====================================================================
   Referral link box
   ===================================================================== */
.copy-box { display: flex; gap: .5rem; }
.copy-box input {
  font-family: var(--font-mono); font-size: .82rem;
  background: var(--green-050); border-color: #cde6da;
}

/* =====================================================================
   Pager, tabs, filters, utilities
   ===================================================================== */
.pager { display: flex; gap: .35rem; justify-content: center; margin-top: 1.4rem; flex-wrap: wrap; }
.pager a, .pager span {
  padding: .45rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: var(--white); font-size: .85rem; font-weight: 600; color: var(--ink-700);
  min-width: 40px; text-align: center;
}
.pager a:hover { border-color: var(--green-500); background: var(--green-050); color: var(--green-800); }
.pager .current { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: var(--shadow-xs); }

.tabs {
  display: flex; gap: .35rem; border-bottom: 2px solid var(--line);
  margin-bottom: 1.35rem; flex-wrap: wrap;
}
.tabs a {
  padding: .55rem 1rem; border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  color: var(--ink-700); font-size: .89rem; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tabs a:hover { color: var(--green-800); background: var(--green-050); }
.tabs a.active { color: var(--green-800); font-weight: 800; border-bottom-color: var(--green-600); background: var(--green-050); }

.filters { display: flex; gap: .65rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1.15rem; }
.filters .form-row { margin: 0; }
.filters input, .filters select { min-width: 150px; }

.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.15rem; }
.muted { color: var(--ink-500); }
.small { font-size: .84rem; }
.tiny { font-size: .75rem; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.pos-green { color: var(--green-700); font-weight: 700; }
.pos-red { color: var(--danger); font-weight: 700; }

/* =====================================================================
   Plan / info blocks
   ===================================================================== */
.plan-card {
  --plan-c: var(--green-700); --plan-soft: var(--green-100);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.plan-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--plan-c), transparent);
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.plan-card h3 { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; }
.plan-card ul { margin: 0; padding-left: 1.15rem; color: var(--ink-700); font-size: .91rem; }
.plan-card li { margin-bottom: .38rem; }
.plan-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--plan-soft); color: var(--plan-c);
  display: grid; place-items: center; font-size: 1rem; font-weight: 800;
}
/* Rotate the accent so a row of plan cards reads as a colourful set. */
.plan-card:nth-child(5n+2) { --plan-c: var(--gold-600);   --plan-soft: var(--gold-100); }
.plan-card:nth-child(5n+3) { --plan-c: var(--sky-600);    --plan-soft: var(--sky-100); }
.plan-card:nth-child(5n+4) { --plan-c: var(--violet-600); --plan-soft: var(--violet-100); }
.plan-card:nth-child(5n+5) { --plan-c: var(--teal-600);   --plan-soft: var(--teal-100); }

.terms h3 { margin-top: 1.9rem; color: var(--green-800); padding-left: .7rem; border-left: 4px solid var(--green-500); }
.terms p, .terms li { color: var(--ink-700); }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
  background: var(--grad-deep); color: #b6d5c5; margin-top: 3.5rem;
  padding: 3rem 0 1.4rem; font-size: .89rem; position: relative;
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad-line);
}
.site-footer h4 { color: #fff; font-size: .82rem; margin-bottom: .85rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.site-footer a { color: #b6d5c5; display: block; padding: .2rem 0; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.2fr; gap: 2.25rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .13); margin-top: 2rem; padding-top: 1.1rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: #96bda9;
}

/* =====================================================================
   Auth pages
   ===================================================================== */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 2.5rem 1rem;
  background: var(--grad-deep); position: relative; overflow: hidden;
}
.auth-wrap::before,
.auth-wrap::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-wrap::before {
  width: 560px; height: 560px; top: -220px; right: -180px;
  background: radial-gradient(circle, rgba(226, 164, 22, .28), transparent 68%);
}
.auth-wrap::after {
  width: 520px; height: 520px; bottom: -240px; left: -200px;
  background: radial-gradient(circle, rgba(63, 191, 130, .3), transparent 68%);
}
.auth-card {
  position: relative; z-index: 1;
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(560px, 100%); padding: 2.25rem; border: 1px solid rgba(255, 255, 255, .5);
}
.auth-card.wide { width: min(780px, 100%); }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head .brand { justify-content: center; }
.auth-head h1 { font-size: 1.55rem; }

/* =====================================================================
   Print
   ===================================================================== */
@media print {
  .panel-side, .panel-top, .site-header, .site-footer, .topbar,
  .nav-backdrop, .panel-backdrop, .no-print { display: none !important; }
  .panel { grid-template-columns: 1fr; }
  .panel-content { padding: 0; }
  body { background: #fff; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
}

/* =====================================================================
   Responsive - tablet
   ===================================================================== */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
  .hero .container { grid-template-columns: 1fr; gap: 1.75rem; }
  .cta-band .container { grid-template-columns: 1fr; gap: 1.25rem; }
  .cta-actions { justify-content: flex-start; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem; }
}

/* Panel sidebar becomes an off-canvas drawer. The toggle button in
   .panel-top appears at exactly the same width, so it is never orphaned. */
@media (max-width: 1024px) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .panel-side {
    position: fixed; left: 0; top: 0; width: 272px; max-width: 86vw; height: 100dvh;
    z-index: 100; transform: translateX(-102%);
    transition: transform .24s cubic-bezier(.4, 0, .2, 1);
    box-shadow: var(--shadow-lg);
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    visibility: hidden;
  }
  .panel-side.open { transform: translateX(0); visibility: visible; }
  .panel-backdrop {
    position: fixed; inset: 0; background: rgba(9, 30, 20, .5);
    backdrop-filter: blur(2px); z-index: 90; display: none;
  }
  .panel-backdrop.show { display: block; }
  .panel-top .nav-toggle { display: inline-flex; }
  .panel-top { padding: .7rem 1rem; }
  .panel-content { padding: 1.1rem; }

  /* Storefront navigation becomes a right-hand drawer. */
  .site-header .nav-toggle { display: inline-flex; order: 3; }
  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: 288px; max-width: 84vw;
    background: var(--white); flex-direction: column; align-items: stretch;
    gap: .15rem; padding: 1.15rem .9rem calc(1.5rem + env(safe-area-inset-bottom));
    margin: 0; z-index: 70; overflow-y: auto;
    box-shadow: var(--shadow-lg); border-left: 1px solid var(--line);
    transform: translateX(102%); transition: transform .24s cubic-bezier(.4, 0, .2, 1);
    visibility: hidden;
  }
  .main-nav.open { transform: translateX(0); visibility: visible; }
  .main-nav::before {
    content: "Menu"; display: block; font-size: .65rem; font-weight: 800;
    letter-spacing: .16em; text-transform: uppercase; color: var(--ink-300);
    padding: 0 .75rem .6rem;
  }
  .main-nav a { padding: .75rem .8rem; border-radius: var(--radius-xs); font-size: .95rem; }
  body.nav-open, body.side-open { overflow: hidden; }
}

/* =====================================================================
   Responsive - phone
   ===================================================================== */
@media (max-width: 860px) {
  body { font-size: 15px; }
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.25rem; }
  .section { padding: 2.25rem 0; }
  .section-head { margin-bottom: 1.5rem; text-align: left; }
  .section-head h2 { font-size: 1.45rem; }
  .section-head p { margin: 0; }

  .container, .container-narrow { width: 92%; }

  .topbar { font-size: .74rem; }
  .topbar .container { justify-content: center; text-align: center; gap: .15rem .75rem; }

  .site-header .container { gap: .6rem; min-height: 60px; }
  .brand { font-size: 1.02rem; gap: .5rem; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: .9rem; }
  .brand small { font-size: .58rem; letter-spacing: .08em; }
  .header-actions { margin-left: auto; gap: .4rem; }
  .header-actions .btn { padding: .42rem .7rem; font-size: .8rem; }
  .cart-link { padding: .42rem .7rem; font-size: .82rem; }

  .hero { padding: 2.5rem 0 2.75rem; }
  .hero h1 { font-size: 1.85rem; max-width: none; }
  .hero p { font-size: .98rem; }
  .hero-actions .btn, .cta-actions .btn { flex: 1 1 auto; justify-content: center; }
  .cta-band { padding: 2.25rem 0; }
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .hero-stat { padding: .65rem .5rem; text-align: center; }
  .hero-stat b { font-size: 1.05rem; }
  .hero-stat span { font-size: .58rem; letter-spacing: .05em; }

  .grid { gap: 1rem; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .stat { padding: .85rem .8rem .85rem 1rem; border-radius: var(--radius-sm); }
  .stat b { font-size: 1.2rem; }
  .stat span { font-size: .66rem; letter-spacing: .05em; }
  .stat .sub { font-size: .7rem; }

  .card-pad, .card-body, .card-head { padding: 1rem; }
  .card { border-radius: var(--radius-sm); }

  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .product-body { padding: .7rem; gap: .4rem; }
  .product-name { font-size: .86rem; }
  .price { font-size: 1rem; }
  .mrp { font-size: .76rem; }
  .product-body .btn { padding: .45rem .6rem; font-size: .78rem; }

  .cart-item { grid-template-columns: 64px minmax(0, 1fr); gap: .75rem; }
  .cart-item img { width: 64px; height: 64px; }
  .cart-item > :last-child { grid-column: 1 / -1; }

  .gallery-thumbs { grid-template-columns: repeat(4, 1fr); }

  /* Filter/toolbar controls go full width so they are tappable. */
  .filters { gap: .5rem; }
  .filters .form-row, .filters input, .filters select, .filters .btn { width: 100%; min-width: 0; }

  /* Toolbar buttons pair up two-per-row; loose text (counts, hints) drops
     to a line of its own instead of being squeezed off the edge. */
  .toolbar > .btn, .toolbar > form { flex: 1 1 150px; }
  .toolbar > .btn, .toolbar > form .btn { justify-content: center; width: 100%; }
  .toolbar > span, .toolbar > .muted { flex: 1 0 100%; }
  .coupon-form { flex-wrap: wrap; }
  .coupon-form input { flex: 1 1 60%; }

  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .site-footer { padding: 2.25rem 0 1.25rem; margin-top: 2.25rem; }
  .footer-bottom { flex-direction: column; gap: .5rem; }

  .auth-card { padding: 1.5rem 1.25rem; border-radius: var(--radius); }
  .panel-top h1 { font-size: 1rem; }
  .panel-top { gap: .5rem; }
  .panel-top .small { font-size: .74rem; }

  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; }

  /* 16px inputs stop iOS from zooming the viewport on focus. */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
  input[type=tel], input[type=search], input[type=url], select, textarea { font-size: 16px; padding: .7rem .8rem; }

  /* Comfortable tap targets everywhere. */
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }
  .pager a, .pager span { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
}

/* ---- Data tables collapse into cards. main.js labels each cell from
       its column header and marks only tables that are safe to stack. ---- */
@media (max-width: 720px) {
  table.data.stackable { font-size: .875rem; }
  table.data.stackable thead { display: none; }
  table.data.stackable, table.data.stackable tbody, table.data.stackable tfoot { display: block; width: 100%; }
  table.data.stackable tr {
    display: block; background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: .35rem .75rem; margin-bottom: .65rem;
    box-shadow: var(--shadow-xs);
  }
  table.data.stackable tbody tr:nth-child(even) { background: var(--white); }
  table.data.stackable tbody tr:hover { background: var(--green-050); }
  table.data.stackable td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: .4rem 0; border-bottom: 1px dashed var(--line-soft); text-align: right;
  }
  table.data.stackable tr td:last-child { border-bottom: 0; }
  table.data.stackable td::before {
    content: attr(data-label); flex: 0 0 40%; text-align: left;
    font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-500);
  }
  table.data.stackable td:not([data-label])::before { content: none; }
  table.data.stackable td[data-label=""]::before { content: none; }
  table.data.stackable td.num { text-align: right; }
  table.data.stackable td.full, table.data.stackable td[colspan] {
    display: block; text-align: center;
  }
  table.data.stackable td.full::before, table.data.stackable td[colspan]::before { content: none; }
  table.data.stackable tfoot tr { background: var(--green-050); }
  table.data.stackable tfoot th { display: flex; justify-content: space-between; padding: .4rem 0; border: 0; background: none; }
}

@media (max-width: 420px) {
  .product-grid { gap: .6rem; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { grid-template-columns: minmax(0, 1fr); }
  .hero-stat { display: flex; align-items: baseline; justify-content: space-between; text-align: left; }
  .panel-content { padding: .85rem; }
  .stat { padding: .75rem .65rem .75rem .9rem; }
  .stat b { font-size: 1.05rem; }
  /* The brand tagline and the secondary header button are the first
     things to go when the header runs out of room. */
  .brand small { display: none; }
  .header-actions .btn-light { display: none; }
}

@media (max-width: 360px) {
  .stat-grid, .product-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .btn:hover, .card:hover, .stat:hover, .product-card:hover, .plan-card:hover, .node:hover { transform: none; }
}
