/* =========================================================================
   TASIRA design system — Arabic-first, RTL-native (logical properties),
   flat surfaces (no gradients), data-oriented typography.
   ========================================================================= */

/* IBM Plex Sans Arabic (SIL Open Font License) — self-hosted, arabic + latin subsets */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/ibm-plex-sans-arabic-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('../fonts/ibm-plex-sans-arabic-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('../fonts/ibm-plex-sans-arabic-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('../fonts/ibm-plex-sans-arabic-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}


:root {
  /* Brand — sampled from the TASIRA logo */
  --forest-950: #0c2416;
  --forest-900: #123320;
  --forest-800: #1a4629;
  --forest-700: #235532;
  --forest-600: #2c6a3f;
  --emerald-700: #267447;
  --emerald-600: #2e8752;
  --emerald-200: #bfe0cb;
  --emerald-100: #dcefe2;
  --emerald-50: #eef7f1;
  --gold-700: #7a5a0f;
  --gold-500: #cda53c;
  --gold-100: #f6edd2;
  --gold-50: #fbf6e8;

  /* Neutrals */
  --paper: #f5f5ef;
  --paper-2: #eeeee6;
  --surface: #ffffff;
  --surface-2: #fafaf6;
  --line: #e3e3da;
  --line-strong: #cdcdc1;
  --ink-900: #1b1f1c;
  --ink-800: #2a2f2b;
  --ink-700: #3d433f;
  --ink-600: #555c57;
  --muted: #5a615c;
  --ink-400: #8d938f;

  /* Semantic */
  --up: #1d7442;
  --up-bg: #e3f2e8;
  --down: #b42318;
  --down-bg: #fdecea;
  --flat: #555c57;
  --flat-bg: #efefe9;
  --warning: #8a5300;
  --warning-bg: #fdf1d8;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --info: #1f5f8b;
  --info-bg: #e6f0f7;
  --success: #1d7442;
  --success-bg: #e3f2e8;
  --whatsapp: #0f7a5c;
  --whatsapp-hover: #0b6049;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(16 36 22 / 0.06);
  --shadow: 0 1px 2px rgb(16 36 22 / 0.05), 0 6px 18px rgb(16 36 22 / 0.06);
  --shadow-lg: 0 16px 44px rgb(16 36 22 / 0.16);

  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, 'Noto Sans Arabic', Arial, sans-serif;
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-900);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink-900);
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
dl, dd { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
[hidden] { display: none !important; }
abbr[title] { text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--emerald-600);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--emerald-100); color: var(--forest-900); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------- utilities */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 820px; }
.container--form { max-width: 960px; }

.sr-only {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--forest-700);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.num { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12.5px; }
.text-lg { font-size: 18px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.stack-sm { --gap: 8px; }
.stack-lg { --gap: 28px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 10px); }
.cluster-sm { --gap: 6px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }

.grid { display: grid; gap: var(--gap, 20px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }

@media (max-width: 719px) { .hide-mobile { display: none !important; } }
@media (min-width: 720px) { .hide-tablet-up { display: none !important; } }
@media (min-width: 1024px) { .hide-desktop { display: none !important; } }
@media (max-width: 1023px) { .hide-below-desktop { display: none !important; } }

/* ----------------------------------------------------------------- icons */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.2em;
}
.icon--sm { width: 16px; height: 16px; }
.icon--md { width: 20px; height: 20px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 32px; height: 32px; }
/* Directional icons are drawn for RTL; mirror them in LTR layouts. */
[dir="ltr"] .icon--dir { transform: scaleX(-1); }

/* ---------------------------------------------------------------- banners */
.site-banner {
  padding: 7px var(--gutter);
  font-size: 13.5px;
  text-align: center;
  line-height: 1.5;
}
.site-banner--demo { background: var(--gold-100); color: var(--gold-700); border-bottom: 1px solid #ecdcae; }
.site-banner--info { background: var(--forest-700); color: #fff; }
.site-banner a, .site-banner button {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

/* ----------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(245 245 239 / 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: rgb(245 245 239 / 0.86); backdrop-filter: saturate(1.4) blur(10px); }
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.brand__mark { height: 30px; width: auto; }
.brand__word { height: 24px; width: auto; }

.main-nav { display: none; }
@media (min-width: 1024px) {
  .main-nav { display: flex; align-items: center; gap: 2px; }
}
.main-nav a {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-700);
  white-space: nowrap;
}
.main-nav a:hover { color: var(--forest-700); background: var(--emerald-50); }
.main-nav a[aria-current="page"] { color: var(--forest-700); font-weight: 600; }

.header-search { flex: 1 1 auto; max-width: 420px; display: none; }
@media (min-width: 1180px) { .header-search { display: block; } }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-700);
}
.icon-btn:hover { background: var(--emerald-50); color: var(--forest-700); }
.icon-btn .icon { width: 22px; height: 22px; }
.icon-btn__count {
  position: absolute;
  top: 5px;
  inset-inline-end: 4px;
  min-width: 18px;
  height: 18px;
  padding-inline: 5px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.user-menu { position: relative; }
.user-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--emerald-50); }
.user-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 230px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.user-menu__panel a,
.user-menu__panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  font-size: 15px;
  text-align: start;
  color: var(--ink-800);
}
.user-menu__panel a:hover,
.user-menu__panel button:hover { background: var(--emerald-50); color: var(--forest-700); }
.user-menu__head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--emerald-50);
  color: var(--forest-700);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 16px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.avatar--lg { width: 72px; height: 72px; border-radius: 18px; font-size: 24px; }
.avatar--xl { width: 96px; height: 96px; border-radius: 22px; font-size: 30px; }

/* Mobile navigation drawer */
.drawer {
  margin: 0;
  margin-inline-start: auto;
  width: min(360px, 90vw);
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.drawer::backdrop { background: rgb(12 36 22 / 0.42); }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer__body { padding: 12px; display: grid; gap: 4px; }
.drawer__body a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding-inline: 12px;
  border-radius: var(--radius);
  font-weight: 500;
}
.drawer__body a:hover { background: var(--emerald-50); color: var(--forest-700); }
.drawer__body hr { margin: 8px 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink-900);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { border-color: var(--ink-400); }
.btn .icon { width: 18px; height: 18px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn.is-busy { opacity: 0.7; cursor: progress; }

.btn--primary { --btn-bg: var(--forest-700); --btn-fg: #fff; --btn-border: var(--forest-700); }
.btn--primary:hover { --btn-bg: var(--forest-800); --btn-border: var(--forest-800); }
.btn--accent { --btn-bg: var(--emerald-700); --btn-fg: #fff; --btn-border: var(--emerald-700); }
.btn--accent:hover { --btn-bg: var(--forest-700); --btn-border: var(--forest-700); }
.btn--whatsapp { --btn-bg: var(--whatsapp); --btn-fg: #fff; --btn-border: var(--whatsapp); }
.btn--whatsapp:hover { --btn-bg: var(--whatsapp-hover); --btn-border: var(--whatsapp-hover); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--forest-700); --btn-border: transparent; }
.btn--ghost:hover { --btn-bg: var(--emerald-50); --btn-border: transparent; }
.btn--soft { --btn-bg: var(--emerald-50); --btn-fg: var(--forest-700); --btn-border: var(--emerald-100); }
.btn--soft:hover { --btn-bg: var(--emerald-100); --btn-border: var(--emerald-200); }
.btn--danger { --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-border: #f3c6c1; }
.btn--danger:hover { --btn-bg: var(--danger-bg); --btn-border: var(--danger); }
.btn--danger-solid { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: var(--danger); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 44px; padding: 0; }
.btn--icon.btn--sm { width: 36px; }
.btn[aria-pressed="true"] { --btn-fg: var(--forest-700); --btn-bg: var(--emerald-50); --btn-border: var(--emerald-200); }

.link { color: var(--forest-700); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--forest-700); font-weight: 600; font-size: 15px; }
.link-arrow:hover { gap: 9px; }
.link-arrow { transition: gap 0.15s; }

/* ------------------------------------------------------------------ forms */
.form { display: grid; gap: 20px; }
.form-grid { display: grid; gap: 18px 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.form-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.span-full { grid-column: 1 / -1; }

.form-section {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.form-section__head { display: grid; gap: 4px; }
.form-section__title { font-size: 18px; }
.form-section__step {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-inline-end: 8px;
  border-radius: 50%;
  background: var(--emerald-50);
  color: var(--forest-700);
  font-size: 14px;
  font-weight: 700;
  vertical-align: 2px;
}

.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field__label { font-size: 14.5px; font-weight: 600; color: var(--ink-800); }
.field__label .optional { font-weight: 400; color: var(--muted); font-size: 13px; }
.field__hint { font-size: 13px; color: var(--muted); line-height: 1.6; }
.field__error { font-size: 13.5px; color: var(--danger); font-weight: 500; }
.field__counter { font-size: 12px; color: var(--muted); text-align: end; }

.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-900);
  font-size: 16px; /* 16px prevents iOS zoom */
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--emerald-600);
  box-shadow: 0 0 0 3px rgb(46 135 82 / 0.18);
}
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--ink-400); cursor: not-allowed; }
.is-invalid, .input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 120px; resize: vertical; }
.input--sm, .select--sm { min-height: 38px; padding-block: 6px; font-size: 14.5px; }
.input[type="number"] { font-variant-numeric: tabular-nums; }
.input--ltr { direction: ltr; text-align: end; }
[dir="ltr"] .input--ltr { text-align: start; }

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23555c57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px;
}
[dir="rtl"] .select { background-position: left 12px center; }
[dir="ltr"] .select { background-position: right 12px center; }

.input-group { display: flex; align-items: stretch; }
.input-group > .input { border-start-end-radius: 0; border-end-end-radius: 0; min-width: 0; }
.input-group > .select,
.input-group > .input-group__addon {
  flex: 0 0 auto;
  width: auto;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  margin-inline-start: -1px;
}
.input-group__addon {
  display: grid;
  place-items: center;
  padding-inline: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 28px;
  font-size: 15px;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--emerald-700); flex-shrink: 0; }
.check--card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.check--card:has(input:checked) { border-color: var(--emerald-600); background: var(--emerald-50); }

.choice-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.choice-card { position: relative; display: block; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice-card__body {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.15s, background-color 0.15s;
}
.choice-card__title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.choice-card__title .icon { width: 22px; height: 22px; color: var(--emerald-700); }
.choice-card__text { color: var(--muted); font-size: 14px; }
.choice-card input:checked + .choice-card__body { border-color: var(--forest-700); background: var(--emerald-50); box-shadow: inset 0 0 0 1px var(--forest-700); }
.choice-card input:focus-visible + .choice-card__body { outline: 3px solid var(--emerald-600); outline-offset: 2px; }

.password-field { position: relative; }
.password-field .input { padding-inline-end: 50px; }
.password-field__toggle {
  position: absolute;
  inset-inline-end: 3px;
  top: 3px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--muted);
  border-radius: 8px;
}
.password-field__toggle:hover { color: var(--forest-700); background: var(--emerald-50); }

.hp-field {
  position: absolute !important;
  inset-inline-start: -10000px;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.form-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-inline: calc(var(--gutter) * -1);
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgb(245 245 239 / 0.95);
  border-top: 1px solid var(--line);
}

.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-preview img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* ------------------------------------------------------------ search box */
.searchbox { position: relative; }
.searchbox__form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.searchbox__form:focus-within { border-color: var(--emerald-600); box-shadow: 0 0 0 4px rgb(46 135 82 / 0.14); }
.searchbox__icon { margin-inline-start: 10px; color: var(--ink-400); width: 22px; height: 22px; }
.searchbox__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  font-size: 16px;
}
.searchbox__input:focus { outline: none; }
.searchbox--hero .searchbox__form { padding: 8px; border-radius: 16px; box-shadow: var(--shadow); }
.searchbox--hero .searchbox__input { min-height: 52px; font-size: 17px; }
.searchbox--hero .btn { min-height: 52px; padding-inline: 26px; border-radius: 12px; }
.searchbox--compact .searchbox__form { padding: 3px; border-radius: 12px; border-width: 1px; }
.searchbox--compact .searchbox__input { min-height: 38px; font-size: 15px; }
.searchbox--compact .btn { min-height: 38px; }

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline: 0;
  z-index: 70;
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.suggest__item a {
  display: grid;
  gap: 1px;
  padding: 9px 12px;
  border-radius: var(--radius);
}
.suggest__item a:hover,
.suggest__item[aria-selected="true"] a { background: var(--emerald-50); }
.suggest__label { font-weight: 600; }
.suggest__meta { font-size: 13px; color: var(--muted); }

.query-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; }
.query-hints__label { color: var(--muted); }

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-800);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}
a.chip:hover { border-color: var(--emerald-600); color: var(--forest-700); }
.chip--brand { background: var(--emerald-50); border-color: var(--emerald-100); color: var(--forest-700); font-weight: 600; }
.chip--remove .icon { width: 14px; height: 14px; color: var(--muted); }
.chip--remove:hover .icon { color: var(--danger); }
.chip--static { cursor: default; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 22px;
  white-space: nowrap;
  background: var(--flat-bg);
  color: var(--ink-700);
}
.badge .icon { width: 14px; height: 14px; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--gold { background: var(--gold-100); color: var(--gold-700); }
.badge--brand { background: var(--emerald-50); color: var(--forest-700); }
.badge--outline { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-700); line-height: 20px; }
.badge--demo { background: var(--gold-50); color: var(--gold-700); border: 1px dashed #e2c779; line-height: 20px; }
.badge--featured { background: var(--forest-700); color: #fff; }

.vbadge .icon { width: 15px; height: 15px; }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.card__body { padding: 20px; }
.card__body--lg { padding: clamp(20px, 3vw, 28px); }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card__title { font-size: 17px; font-weight: 700; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--line); }
.card--link { transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.card--link:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card--muted { background: var(--surface-2); }
.card--brand { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }
.card--brand h2, .card--brand h3 { color: #fff; }

/* ------------------------------------------------------------------ alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.65;
}
.alert .icon { width: 20px; height: 20px; margin-top: 3px; }
.alert--success { background: var(--success-bg); border-color: #bfe0cb; color: #144f2e; }
.alert--error { background: var(--danger-bg); border-color: #f3c6c1; color: #8c1d14; }
.alert--warning { background: var(--warning-bg); border-color: #f0d9a5; color: #6e4200; }
.alert--info { background: var(--info-bg); border-color: #cfe1ef; color: #184c70; }
.alert__close { margin-inline-start: auto; border: 0; background: none; color: inherit; opacity: 0.7; padding: 2px; }
.flash-stack { display: grid; gap: 10px; margin-top: 16px; }

.disclaimer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}
.disclaimer .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--ink-400); }

/* ---------------------------------------------------------------- sections */
.section { padding-block: clamp(40px, 6vw, 72px); }
.section--tight { padding-block: clamp(28px, 4vw, 44px); }
.section--surface { background: var(--surface); border-block: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.section-head h2 { font-size: clamp(22px, 1.2vw + 16px, 30px); }
.section-head p { color: var(--muted); margin-top: 4px; max-width: 640px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--emerald-700);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-500);
}

.page-head { padding-block: clamp(24px, 4vw, 40px) 8px; }
.page-head h1 { font-size: clamp(26px, 2vw + 16px, 38px); }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 720px; font-size: 17px; }

.crumbs { font-size: 14px; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: '‹'; color: var(--ink-400); }
[dir="ltr"] .crumbs li + li::before { content: '›'; }
.crumbs a:hover { color: var(--forest-700); text-decoration: underline; }

/* -------------------------------------------------------------------- hero */
.hero { padding-block: clamp(32px, 6vw, 72px) clamp(32px, 5vw, 56px); }
.hero__grid {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
  align-items: center;
}
@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}
.hero__title {
  font-size: clamp(34px, 4.2vw + 10px, 62px);
  line-height: 1.2;
  font-weight: 700;
}
.hero__title span { display: block; }
.hero__title .l2 { color: var(--forest-700); }
.hero__title .l3::after {
  content: '';
  display: inline-block;
  width: 0.2em;
  height: 0.2em;
  margin-inline-start: 0.12em;
  border-radius: 50%;
  background: var(--gold-500);
  vertical-align: 0.05em;
}
.hero__subtitle {
  margin-top: 16px;
  max-width: 560px;
  font-size: clamp(16px, 0.5vw + 14px, 19px);
  color: var(--ink-700);
}
.hero__search { margin-top: 26px; max-width: 640px; }
.hero__ctas { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }

.snapshot { overflow: hidden; }
.snapshot__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.snapshot__row:last-child { border-bottom: 0; }
.snapshot__row:hover { background: var(--surface-2); }
.snapshot__name { font-weight: 600; }
.snapshot__meta { font-size: 13px; color: var(--muted); }
.snapshot__price { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------- stats */
.stat {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.stat__label { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat__label .icon { width: 16px; height: 16px; color: var(--emerald-700); }
.stat__value {
  font-size: clamp(22px, 1vw + 16px, 28px);
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--ink-900);
}
.stat__value small { font-size: 14px; font-weight: 500; color: var(--muted); }
.stat__sub { font-size: 13px; color: var(--muted); }
.stat--brand { background: var(--forest-700); border-color: var(--forest-700); }
.stat--brand .stat__label, .stat--brand .stat__sub { color: #cfe6d6; }
.stat--brand .stat__value { color: #fff; }
.stat--brand .stat__label .icon { color: var(--gold-500); }

/* ------------------------------------------------------------ price blocks */
.price { font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--ink-900); white-space: nowrap; }
.price--lg { font-size: clamp(24px, 1.6vw + 14px, 34px); }
.price--sm { font-size: 16px; }
.price__unit { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }

.trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.trend .icon { width: 15px; height: 15px; }
.trend--rising { color: var(--up); background: var(--up-bg); }
.trend--falling { color: var(--down); background: var(--down-bg); }
.trend--stable { color: var(--flat); background: var(--flat-bg); }
.trend--none { color: var(--ink-400); background: transparent; font-weight: 500; }

.intel {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 26px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.intel__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.intel__range-label { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.intel__grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.intel__cell { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); }
.intel__cell dt { font-size: 13px; color: var(--muted); }
.intel__cell dd { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.intel__cell dd small { font-weight: 500; font-size: 13px; color: var(--muted); }

.rangebar { display: grid; gap: 6px; }
.rangebar svg { width: 100%; height: 26px; overflow: visible; }
[dir="rtl"] .rangebar svg { transform: scaleX(-1); }
.rangebar__track { fill: var(--paper-2); }
.rangebar__range { fill: var(--emerald-100); }
.rangebar__dot { fill: var(--emerald-600); opacity: 0.55; }
.rangebar__avg { fill: var(--forest-700); }
.rangebar__labels { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.rangebar__labels strong { color: var(--ink-800); font-weight: 600; }

/* ----------------------------------------------------------------- tables */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  -webkit-overflow-scrolling: touch;
}
.table { width: 100%; font-size: 15px; }
.table caption { text-align: start; padding: 12px 16px; font-size: 13.5px; color: var(--muted); caption-side: bottom; }
.table th {
  padding: 11px 16px;
  text-align: start;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-600);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th a { display: inline-flex; align-items: center; gap: 4px; }
.table th a:hover { color: var(--forest-700); }
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfbf8; }
.table--compact td { padding-block: 9px; }
.table .cell-strong { font-weight: 600; }
.table .cell-actions { white-space: nowrap; text-align: end; }

/* Stacked rows on small screens */
@media (max-width: 719px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    border: 0;
    text-align: end;
  }
  .table--stack td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 13px;
    text-align: start;
    font-weight: 500;
  }
  .table--stack td[data-label=""]::before,
  .table--stack td:not([data-label])::before { content: none; }
  .table--stack td.cell-primary { font-size: 16px; font-weight: 700; padding-bottom: 8px; }
  .table--stack td.cell-actions { justify-content: flex-start; padding-top: 10px; }
}

/* --------------------------------------------------------------- products */
.product-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.product-card__media { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card__body { display: grid; gap: 10px; align-content: start; padding: 16px 18px 18px; }
.product-card__name { font-size: 18px; font-weight: 700; }
.product-card__name a::after { content: ''; position: absolute; inset: 0; }
.product-card { position: relative; }
.product-card__en { font-size: 13px; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.product-card__facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); }
.product-card__facts span { display: inline-flex; align-items: center; gap: 5px; }
.product-card__facts .icon { width: 15px; height: 15px; }

.thumb-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--emerald-600);
  background: var(--emerald-50);
}
.thumb-placeholder .icon { width: 40px; height: 40px; opacity: 0.8; }

.category-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}
.category-tile__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--emerald-50);
  color: var(--emerald-700);
  flex-shrink: 0;
}
.category-tile__icon .icon { width: 24px; height: 24px; }
.category-tile a::after { content: ''; position: absolute; inset: 0; }

/* ------------------------------------------------------------ product page */
.product-hero { display: grid; gap: 20px; align-items: center; }
@media (min-width: 720px) { .product-hero { grid-template-columns: 220px minmax(0, 1fr); } }
@media (min-width: 1024px) { .product-hero { grid-template-columns: 260px minmax(0, 1fr); } }
.product-hero__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.product-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.product-hero h1 { font-size: clamp(28px, 2vw + 18px, 40px); }
.product-hero__sub { color: var(--muted); font-size: 15px; }
.product-hero__sub i { font-style: italic; }
.summary-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); margin-top: 16px; }
.summary-grid div { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.summary-grid dt { font-size: 12.5px; color: var(--muted); }
.summary-grid dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.quick-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.offer-hero { display: grid; gap: 16px; padding: clamp(18px, 3vw, 26px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); }
.offer-hero h1 { font-size: clamp(24px, 1.6vw + 16px, 34px); }
.market-compare { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.market-compare--below { color: var(--up); }
.market-compare--above { color: var(--warning); }
.market-compare--near { color: var(--flat); }
.history-list { display: grid; }
.history-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.history-list li:last-child { border-bottom: 0; }
.rating-input { display: flex; flex-wrap: wrap; gap: 8px; }
.rating-input label { position: relative; }
.rating-input input { position: absolute; opacity: 0; inset: 0; }
.rating-input span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-weight: 600;
  cursor: pointer;
}
.rating-input span .icon { color: var(--gold-500); width: 16px; height: 16px; }
.rating-input input:checked + span { border-color: var(--forest-700); background: var(--emerald-50); color: var(--forest-700); }
.rating-input input:focus-visible + span { outline: 3px solid var(--emerald-600); outline-offset: 2px; }

/* ----------------------------------------------------------------- offers */
.offer-list { display: grid; gap: 12px; }
.offer-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.offer-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.offer-card--featured { border-color: var(--emerald-200); }
.offer-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.offer-card__supplier { display: flex; align-items: center; gap: 10px; min-width: 0; }
.offer-card__supplier-name { font-weight: 700; font-size: 16px; }
.offer-card__supplier-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.offer-card__title { font-weight: 700; font-size: 17px; }
.offer-card__title a:hover { color: var(--forest-700); }
.offer-card__price { text-align: end; flex-shrink: 0; }
.offer-card__facts {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.fact { display: grid; gap: 0; min-width: 0; }
.fact dt { font-size: 12.5px; color: var(--muted); }
.fact dd { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.offer-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.offer-card__updated { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.offer-card__updated .icon { width: 15px; height: 15px; }
.offer-card__updated.is-stale { color: var(--warning); }
.offer-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 519px) {
  .offer-card__head { flex-direction: column; }
  .offer-card__price { text-align: start; }
  .offer-card__actions { width: 100%; }
  .offer-card__actions .btn:not(.btn--icon) { flex: 1 1 auto; }
}

/* -------------------------------------------------------------- suppliers */
.supplier-card { position: relative; display: grid; gap: 12px; padding: 18px; }
.supplier-card__head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.supplier-card__name { font-weight: 700; font-size: 16.5px; }
.supplier-card__name a::after { content: ''; position: absolute; inset: 0; }
.supplier-card__meta { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; }
.supplier-card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.supplier-card__meta .icon { width: 14px; height: 14px; }
.supplier-card__foot { display: flex; flex-wrap: wrap; gap: 6px; }

.profile-head {
  display: grid;
  gap: 20px;
  padding: clamp(20px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
@media (min-width: 720px) {
  .profile-head { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
}
.profile-head h1 { font-size: clamp(24px, 1.5vw + 16px, 32px); }
.profile-head__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.profile-head__meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile-head__meta .icon { width: 16px; height: 16px; }

.trust-list { display: grid; gap: 0; }
.trust-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.trust-item:last-child { border-bottom: 0; }
.trust-item dt { display: flex; align-items: center; gap: 8px; color: var(--ink-700); }
.trust-item dt .icon { width: 17px; height: 17px; color: var(--emerald-700); }
.trust-item dd { font-weight: 600; text-align: end; }

.stars { display: inline-flex; align-items: center; gap: 1px; color: var(--gold-500); }
.stars .icon { width: 16px; height: 16px; }
.stars .is-empty { color: var(--line-strong); }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.rating strong { font-variant-numeric: tabular-nums; }

.review { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review__reply {
  margin-top: 4px;
  padding: 10px 14px;
  border-inline-start: 3px solid var(--emerald-200);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
}

/* ------------------------------------------------------------- layouts */
.layout-sidebar { display: grid; gap: 24px; align-items: start; }
@media (min-width: 1024px) {
  .layout-sidebar { grid-template-columns: minmax(0, 1fr) 340px; }
  .layout-sidebar--start { grid-template-columns: 290px minmax(0, 1fr); }
  .sticky-aside { position: sticky; top: calc(var(--header-h) + 16px); }
}

/* Filters: a dialog on small screens, a static sidebar on desktop */
.filters {
  width: min(440px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}
.filters::backdrop { background: rgb(12 36 22 / 0.42); }
.filters__inner { display: flex; flex-direction: column; height: 100%; }
.filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
}
.filters__body { flex: 1 1 auto; overflow-y: auto; padding: 18px; display: grid; gap: 18px; align-content: start; }
.filters__foot {
  display: flex;
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.filters__foot .btn { flex: 1 1 auto; }
@media (min-width: 1024px) {
  .filters:not([open]) {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 16px);
    width: auto;
    height: auto;
    max-height: calc(100vh - var(--header-h) - 32px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
  }
  .filters:not([open]) .filters__head [data-dialog-close] { display: none; }
  .filters:not([open]) .filters__foot { position: sticky; bottom: 0; }
}
/* Dialog-only variant (pages that already have a sidebar) */
.filters.filters--modal:not([open]) { display: none; }

.filter-group { display: grid; gap: 8px; }
.filter-group__title { font-size: 14px; font-weight: 700; color: var(--ink-800); }
.range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.results-bar__count { font-weight: 700; font-size: 17px; }
.sort-select { width: auto; min-width: 190px; }

.understood {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--emerald-50);
  border: 1px solid var(--emerald-100);
  border-radius: var(--radius);
  font-size: 14px;
}
.understood__label { font-weight: 600; color: var(--forest-700); }

/* Mobile sticky action bar (product / offer / supplier pages) */
.sticky-actions {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgb(16 36 22 / 0.06);
}
.sticky-actions .btn { flex: 1 1 0; min-width: 0; }
@media (min-width: 1024px) { .sticky-actions { display: none; } }
@media (max-width: 1023px) { body.has-sticky-actions { padding-bottom: 76px; } }

/* ------------------------------------------------------------- charts */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart__grid line { stroke: var(--line); stroke-width: 1; }
.chart__axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart__band { fill: var(--emerald-100); opacity: 0.75; }
.chart__line { fill: none; stroke: var(--forest-700); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart__point { fill: var(--surface); stroke: var(--forest-700); stroke-width: 1.75; cursor: pointer; }
.chart__point:focus { outline: none; }
.chart__point.is-active, .chart__point:focus-visible { fill: var(--forest-700); stroke: var(--surface); stroke-width: 2; }
.chart__last { fill: var(--gold-500); stroke: var(--surface); stroke-width: 2; }
.chart__tip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 1px;
  padding: 6px 10px;
  background: var(--ink-900);
  color: #fff;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -100%);
  box-shadow: var(--shadow);
}
.chart__tip strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.chart__tip span { opacity: 0.8; }
.chart__guide {
  position: absolute;
  top: 8px;
  bottom: 30px;
  width: 1px;
  background: var(--line-strong);
  pointer-events: none;
}
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--forest-700); }
.chart-legend i.band { height: 10px; background: var(--emerald-100); }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.segmented a, .segmented button {
  padding: 5px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
  white-space: nowrap;
}
.segmented a:hover { color: var(--forest-700); }
.segmented [aria-current="true"], .segmented [aria-current="page"] {
  background: var(--surface);
  color: var(--forest-700);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.bar-list { display: grid; gap: 10px; }
.bar-list__row { display: grid; gap: 4px; }
.bar-list__label { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.bar-list__bar { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.bar-list__bar svg { width: 100%; height: 8px; }
[dir="rtl"] .bar-list__bar svg { transform: scaleX(-1); }
.bar-list__fill { fill: var(--emerald-600); }

/* Movers lists */
.movers { display: grid; }
.mover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
}
.mover:last-child { border-bottom: 0; }
.mover:hover { background: var(--surface-2); }

/* ------------------------------------------------------------------ RFQs */
.rfq-card { position: relative; display: grid; gap: 10px; padding: 16px 18px; }
.rfq-card__title { font-weight: 700; font-size: 17px; }
.rfq-card__title a::after { content: ''; position: absolute; inset: 0; }
.rfq-card__facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--ink-700); }
.rfq-card__facts span { display: inline-flex; align-items: center; gap: 6px; }
.rfq-card__facts .icon { width: 16px; height: 16px; color: var(--emerald-700); }

.score {
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  height: 56px;
  padding-inline: 6px;
  border-radius: 14px;
  background: var(--emerald-50);
  color: var(--forest-700);
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.score small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.score--high { background: var(--forest-700); color: #fff; }
.score--high small { color: #cfe6d6; }
.score--mid { background: var(--emerald-50); }
.score--low { background: var(--flat-bg); color: var(--ink-700); }

.breakdown { display: grid; gap: 8px; margin-top: 10px; }
.breakdown__row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 13.5px; }
.breakdown__row.is-na { color: var(--ink-400); }
.breakdown meter { width: 100%; height: 8px; }
meter { accent-color: var(--emerald-600); }
@media (max-width: 519px) { .breakdown__row { grid-template-columns: 1fr 40px; } .breakdown__row meter { grid-column: 1 / -1; } }

details.disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--forest-700);
  font-weight: 600;
  font-size: 14px;
  list-style: none;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon { transition: transform 0.2s; }
details.disclosure[open] > summary .icon { transform: rotate(180deg); }

/* --------------------------------------------------------------- dialogs */
.modal {
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--ink-900);
}
.modal::backdrop { background: rgb(12 36 22 / 0.45); }
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid var(--line);
}
.modal__title { font-size: 18px; }
.modal__body { padding: 20px; display: grid; gap: 16px; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* --------------------------------------------------------- distribution */
.distribution { margin: 0; display: grid; gap: 6px; }
.distribution svg { width: 100%; height: auto; }
[dir="rtl"] .distribution svg { transform: scaleX(-1); }
.distribution__axis { stroke: var(--line-strong); stroke-width: 1.5; }
.distribution__dot { fill: var(--emerald-600); fill-opacity: 0.55; stroke: var(--surface); stroke-width: 1.5; }
.distribution__avg { stroke: var(--forest-700); stroke-width: 3; stroke-linecap: round; }

.site-banner form { display: inline; margin-inline-start: 6px; }
.check .field__hint { display: block; }

/* --------------------------------------------------------------- empty */
.empty__actions { justify-content: center; margin-top: 6px; }
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: clamp(28px, 5vw, 48px) 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--emerald-50);
  color: var(--emerald-700);
}
.empty__icon .icon { width: 26px; height: 26px; }
.empty__title { color: var(--ink-900); font-weight: 700; font-size: 17px; }
.empty p { max-width: 460px; }

/* ------------------------------------------------------------ pagination */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 600;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.pagination a:hover { border-color: var(--emerald-600); color: var(--forest-700); }
.pagination [aria-current="page"] { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }
.pagination .is-disabled { color: var(--ink-400); background: var(--surface-2); }
.pagination__info { width: 100%; text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* ------------------------------------------------------------------ steps */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: step; }
.step { position: relative; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.step__num {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--forest-700);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}
.step h3 { font-size: 19px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 15px; }

.cta-band {
  display: grid;
  gap: 18px;
  padding: clamp(28px, 5vw, 48px);
  border-radius: var(--radius-xl);
  background: var(--forest-700);
  color: #fff;
}
@media (min-width: 900px) { .cta-band { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.cta-band h2 { color: #fff; font-size: clamp(24px, 1.6vw + 16px, 34px); }
.cta-band p { color: #d8ebdf; margin-top: 8px; max-width: 620px; }
.cta-band .btn--light { --btn-bg: #fff; --btn-fg: var(--forest-800); --btn-border: #fff; }
.cta-band .btn--outline-light { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgb(255 255 255 / 0.5); }
.cta-band .btn--outline-light:hover { --btn-border: #fff; }

/* ----------------------------------------------------------------- prose */
.prose { font-size: 17px; line-height: 1.95; color: var(--ink-800); }
.prose > * + * { margin-top: 14px; }
.prose h2 { font-size: 23px; margin-top: 34px; }
.prose h3 { font-size: 19px; margin-top: 26px; }
.prose ul { list-style: disc; padding-inline-start: 24px; }
.prose ol { list-style: decimal; padding-inline-start: 24px; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--forest-700); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink-900); }
.prose blockquote { margin: 0; padding: 10px 16px; border-inline-start: 3px solid var(--gold-500); background: var(--surface-2); }

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-weight: 600;
  font-size: 16.5px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { transition: transform 0.2s; color: var(--emerald-700); }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-item p { padding-bottom: 16px; color: var(--ink-700); }

/* ----------------------------------------------------------------- footer */
.site-footer {
  margin-top: clamp(40px, 6vw, 72px);
  padding-block: 44px 28px;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.footer-brand { grid-column: 1 / -1; max-width: 420px; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr); }
  .footer-brand { grid-column: auto; }
}
.footer-brand img { height: 84px; width: auto; }
.footer-brand p { margin-top: 10px; color: var(--muted); }
.footer-col h2 { font-size: 15px; margin-bottom: 12px; color: var(--ink-800); }
.footer-col ul { display: grid; gap: 8px; }
.footer-col a { color: var(--ink-700); }
.footer-col a:hover { color: var(--forest-700); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
}

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed;
  inset-inline: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 200;
  width: fit-content;
  max-width: calc(100vw - 32px);
  margin-inline: auto;
  padding: 10px 18px;
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
body.has-sticky-actions .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }

/* ------------------------------------------------------------- dashboard */
.dash { display: grid; gap: 24px; padding-block: 24px 48px; align-items: start; }
@media (min-width: 1024px) { .dash { grid-template-columns: 250px minmax(0, 1fr); gap: 32px; } }
.dash-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  scrollbar-width: none;
}
.dash-nav::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) {
  .dash-nav { position: sticky; top: calc(var(--header-h) + 16px); flex-direction: column; overflow: visible; padding: 8px; }
}
.dash-nav__group { display: contents; }
@media (min-width: 1024px) {
  .dash-nav__group { display: grid; gap: 2px; }
  .dash-nav__group + .dash-nav__group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
}
.dash-nav__title { display: none; }
@media (min-width: 1024px) {
  .dash-nav__title { display: block; padding: 4px 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
}
.dash-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding-inline: 12px;
  border-radius: var(--radius);
  color: var(--ink-700);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.dash-nav a .icon { width: 19px; height: 19px; color: var(--ink-400); }
.dash-nav a:hover { background: var(--surface-2); color: var(--forest-700); }
.dash-nav a[aria-current="page"] { background: var(--emerald-50); color: var(--forest-700); font-weight: 700; }
.dash-nav a[aria-current="page"] .icon { color: var(--emerald-700); }
.dash-nav__count {
  margin-inline-start: auto;
  min-width: 22px;
  padding-inline: 6px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 20px;
}
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.dash-head h1 { font-size: clamp(22px, 1.2vw + 16px, 28px); }
.dash-head p { color: var(--muted); margin-top: 4px; }
.dash-content { min-width: 0; display: grid; gap: 20px; align-content: start; }

.progress-row { display: grid; gap: 6px; }
progress {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 5px;
  background: var(--paper-2);
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}
progress::-webkit-progress-bar { background: var(--paper-2); border-radius: 5px; }
progress::-webkit-progress-value { background: var(--emerald-600); border-radius: 5px; }
progress::-moz-progress-bar { background: var(--emerald-600); border-radius: 5px; }

.checklist { display: grid; gap: 6px; font-size: 14.5px; }
.checklist li { display: flex; align-items: center; gap: 8px; }
.checklist .icon { width: 17px; height: 17px; }
.checklist .is-done { color: var(--muted); }
.checklist .is-done .icon { color: var(--success); }
.checklist .is-todo .icon { color: var(--ink-400); }

.quick-edit { display: flex; gap: 6px; align-items: center; }
.quick-edit .input { width: 130px; min-height: 36px; padding-block: 4px; font-size: 14.5px; }

/* Messaging */
.inbox { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 900px) { .inbox { grid-template-columns: 320px minmax(0, 1fr); min-height: 560px; } }
.inbox__list { border-bottom: 1px solid var(--line); max-height: 560px; overflow-y: auto; }
@media (min-width: 900px) { .inbox__list { border-bottom: 0; border-inline-end: 1px solid var(--line); } }
.inbox__item { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.inbox__item:hover { background: var(--surface-2); }
.inbox__item[aria-current="page"] { background: var(--emerald-50); }
.inbox__item.is-unread .inbox__name { font-weight: 700; }
.inbox__item.is-unread .inbox__name::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-start: 8px;
  border-radius: 50%;
  background: var(--emerald-600);
  vertical-align: 2px;
}
.inbox__name { font-weight: 600; }
.inbox__excerpt { font-size: 13.5px; color: var(--muted); }
.inbox__time { font-size: 12px; color: var(--ink-400); }
.thread { display: flex; flex-direction: column; min-height: 420px; }
.thread__head { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.thread__messages { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; padding: 18px; overflow-y: auto; max-height: 520px; background: var(--surface-2); }
.bubble { max-width: min(78%, 560px); padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.bubble--mine { align-self: flex-end; background: var(--forest-700); border-color: var(--forest-700); color: #fff; }
.bubble__meta { display: block; margin-top: 4px; font-size: 11.5px; opacity: 0.75; }
.bubble__context { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; opacity: 0.85; }
.bubble--mine .bubble__context a { color: #fff; text-decoration: underline; }
.thread__composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); }
.thread__composer .textarea { min-height: 48px; max-height: 180px; }

.notification-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item.is-unread { background: #f6fbf8; }
.notification-item__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--emerald-50); color: var(--emerald-700); }
.notification-item__title { font-weight: 600; }
.notification-item__body { font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------------ admin */
.admin-body { background: #f1f2ec; }
.admin-topbar { background: var(--forest-900); color: #fff; }
.admin-topbar .site-header__bar { min-height: 56px; }
.admin-topbar a { color: #fff; }
.admin-topbar .brand-label { font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; gap: 10px; }
.admin-topbar .brand-label img { height: 26px; background: #fff; border-radius: 6px; padding: 2px 4px; }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.funnel { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); counter-reset: funnel; }
.funnel__step { position: relative; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.funnel__step strong { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.funnel__step span { font-size: 13.5px; color: var(--muted); }
.funnel__rate { font-size: 12.5px; color: var(--emerald-700); font-weight: 600; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.filter-bar .field { min-width: 160px; flex: 1 1 160px; }
.filter-bar .field--wide { flex: 2 1 240px; }
.kv { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 8px 16px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 500; overflow-wrap: anywhere; }
.code-block {
  direction: ltr;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ auth */
.auth-shell { padding-block: clamp(28px, 6vw, 64px); }
.auth-card { max-width: 560px; margin-inline: auto; }
.auth-card--wide { max-width: 760px; }
.auth-card .card__body { padding: clamp(22px, 4vw, 36px); }
.auth-card h1 { font-size: clamp(24px, 1.2vw + 18px, 30px); }
.auth-card__sub { color: var(--muted); margin-top: 6px; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--muted); font-size: 15px; }

/* ----------------------------------------------------------------- errors */
.error-page { padding-block: clamp(48px, 10vw, 120px); text-align: center; }
.error-page__code { font-size: clamp(56px, 8vw, 96px); font-weight: 700; color: var(--emerald-200); line-height: 1; font-variant-numeric: tabular-nums; }
.error-page h1 { margin-top: 12px; font-size: clamp(24px, 2vw + 14px, 34px); }
.error-page p { margin: 12px auto 0; max-width: 520px; color: var(--muted); }
.error-page .cluster { justify-content: center; margin-top: 24px; }

/* ------------------------------------------------ dashboards & content */
.text-end { text-align: end; }
.dash-content > .dash-head { margin-bottom: 0; }

.admin-topbar .btn--ghost { --btn-fg: #fff; }
.admin-topbar .btn--ghost:hover { --btn-bg: rgb(255 255 255 / 0.12); --btn-border: transparent; }
.admin-topbar .header-actions { color: #d8ebdf; }

.row-list { display: grid; }
.row-list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.row-list > li:last-child { border-bottom: 0; }
.row-list__main { display: grid; gap: 2px; min-width: 0; }
.row-list__title { font-weight: 600; overflow-wrap: anywhere; }
a.row-list__title:hover { color: var(--forest-700); }
.row-list__meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; color: var(--muted); }

.tabs-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.segmented .badge { margin-inline-start: 6px; padding-inline: 7px; line-height: 18px; }

.stat--link { position: relative; transition: border-color 0.15s, box-shadow 0.15s; }
.stat--link:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.stat--link a::after { content: ''; position: absolute; inset: 0; }
.stat--alert .stat__value { color: var(--warning); }

.table tr.is-best td { background: var(--emerald-50); }
.table .cell-actions form { display: inline-flex; }
.actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.table .cell-actions .actions-row { justify-content: flex-end; }
@media (max-width: 719px) { .table--stack .cell-actions .actions-row { justify-content: flex-start; } }

.inline-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.inline-edit .input, .inline-edit .select { width: auto; min-width: 88px; max-width: 160px; min-height: 36px; padding-block: 4px; font-size: 14.5px; }

.media-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); }
.media-grid__item { display: grid; gap: 6px; align-content: start; }
.media-grid__item img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); }

.muted-box { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: 14.5px; }

.doc-list { display: grid; gap: 8px; }
.doc-list a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: 14.5px; }
.doc-list a:hover { border-color: var(--emerald-600); color: var(--forest-700); }

.quote-card { display: grid; gap: 12px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.quote-card.is-best { border-color: var(--emerald-600); box-shadow: inset 0 0 0 1px var(--emerald-600); }
.quote-card.is-declined { opacity: 0.72; }

@media (max-width: 899px) { .inbox--thread .inbox__list { display: none; } }
.inbox__placeholder { display: grid; place-items: center; min-height: 320px; padding: 24px; color: var(--muted); text-align: center; }

.post-card { position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.post-card__media { aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { display: grid; gap: 6px; align-content: start; padding: 16px 18px 18px; }
.post-card__title { font-size: 18px; font-weight: 700; }
.post-card__title a::after { content: ''; position: absolute; inset: 0; }
.post-title { font-size: clamp(26px, 2vw + 16px, 38px); }
.post-cover { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface-2); }
.post-cover img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.lead { font-size: 18px; line-height: 1.85; color: var(--ink-700); }
.breakdown__note { grid-column: 1 / -1; margin-top: -4px; }
.score small { margin-top: 2px; }
.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }

/* ------------------------------------------------------------------ print */
@media print {
  .site-header, .site-footer, .sticky-actions, .btn, .filters, .dash-nav, .site-banner { display: none !important; }
  body { background: #fff; }
  .card, .intel, .table-wrap { border-color: #ccc; }
}

/* --------------------------------------------------- approved account panel */
.approved-account {
  border-color: var(--c-brand);
  margin-bottom: var(--sp-6);
}

.approved-account__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 1.05rem;
  margin: 0;
}

.approved-account__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  margin: 0;
}

.approved-account__facts dt {
  color: var(--c-muted);
  font-size: 0.85rem;
  margin-bottom: var(--sp-1);
}

.approved-account__facts dd {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
}

.approved-account__password {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
}

.approved-account__message {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: var(--sp-3);
  margin: 0;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.8;
}
