/* ============================================================
   АЗС Персоналізація — демо-дашборд · design tokens + components
   Light theme · fuel-orange accent · Manrope + IBM Plex Mono
   ============================================================ */

:root {
  /* neutral base */
  --bg:        #FBFAF8;
  --panel:     #F6F4EF;
  --card:      #FFFFFF;
  --card-2:    #FAF8F4;
  --border:    #ECE7DF;
  --border-2:  #E1DBD0;
  --ink:       #1B1A17;
  --ink-2:     #3D3A34;
  --muted:     #847C70;
  --faint:     #ABA396;

  /* fuel-energy green accent */
  --accent:    #52B04C;
  --accent-600:#449A3F;
  --accent-700:#2F7A2B;
  --accent-050:#EEF7ED;
  --accent-100:#D3EAD0;
  --accent-200:#ABDAA6;

  /* semantic + data palette */
  --good:      #1F9D55;
  --good-050:  #E9F7EF;
  --warn:      #E0941A;
  --info:      #2563C9;

  --c1: #52B04C; /* accent / this client cluster */
  --c2: #13888A; /* teal */
  --c3: #6E56CF; /* violet */
  --c4: #E0941A; /* amber */
  --c5: #5B6472; /* slate */

  /* shape */
  --r-card: 16px;
  --r-md:   11px;
  --r-sm:   8px;
  --shadow: 0 1px 2px rgba(24,20,15,.04), 0 10px 26px -14px rgba(24,20,15,.16);
  --shadow-sm: 0 1px 2px rgba(24,20,15,.05);
  --pad-card: 20px;
  --gap: 16px;

  --font-ui: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---- variant token overrides ---------------------------------- */
.v-a { /* classic, soft shadows, warm */ }

.v-b { /* focus stage, bordered editorial, paper white */
  --bg: #FFFFFF;
  --panel: #FFFFFF;
  --card: #FFFFFF;
  --card-2: #FBFAF8;
  --border: #E7E2D9;
  --r-card: 13px;
  --r-md: 9px;
  --shadow: none;
  --shadow-sm: none;
  --pad-card: 20px;
}
.v-b .az-card { border-color: var(--border-2); }

.v-c { /* dense analytical grid, tinted */
  --bg: #F2EFE9;
  --panel: #F2EFE9;
  --card: #FFFFFF;
  --card-2: #F7F4EE;
  --border: #E4DED3;
  --r-card: 12px;
  --r-md: 8px;
  --shadow: 0 1px 1px rgba(24,20,15,.04);
  --pad-card: 15px;
  --gap: 12px;
}

/* ============================================================
   base
   ============================================================ */
* { box-sizing: border-box; }

.az-root {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  line-height: 1.45;
}
.az-root *, .az-root *::before, .az-root *::after { box-sizing: border-box; }

.mono { font-family: var(--font-mono); letter-spacing: -0.02em; font-feature-settings: "tnum" 1; }

/* ============================================================
   header
   ============================================================ */
.az-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.v-b .az-header { background: #fff; }
.az-logo { display: flex; align-items: center; gap: 12px; }
.az-logo-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-600) 100%);
  display: grid; place-items: center; flex: 0 0 auto;
  box-shadow: 0 4px 12px -4px rgba(82,176,76,.4);
}
.az-logo-name { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; line-height: 1.1; }
.az-logo-sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.az-badge-demo {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--accent-700); background: var(--accent-050);
  border: 1px solid var(--accent-100);
  padding: 4px 9px; border-radius: 6px;
}
.az-header-spacer { flex: 1 1 auto; }
.az-header-meta {
  display: flex; align-items: center; gap: 18px;
  font-size: 12.5px; color: var(--muted); font-weight: 500;
}
.az-header-meta b { color: var(--ink-2); font-weight: 700; }

/* primary CTA */
.az-cta {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-ui); font-weight: 700; font-size: 14px;
  color: #fff; background: var(--accent);
  border: none; border-radius: 11px; padding: 11px 18px;
  cursor: pointer; letter-spacing: -0.01em;
  box-shadow: 0 6px 16px -6px rgba(82,176,76,.45);
  transition: background .15s, transform .08s, box-shadow .15s;
}
.az-cta:hover { background: var(--accent-600); box-shadow: 0 8px 20px -6px rgba(82,176,76,.55); }
.az-cta:active { transform: translateY(1px); }
.az-cta .dice { font-size: 16px; }

/* ============================================================
   card
   ============================================================ */
.az-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: var(--pad-card);
}
.az-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.az-card-head .ic {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--border);
  color: var(--ink-2);
}
.az-card-title { font-weight: 700; font-size: 14.5px; letter-spacing: -0.015em; }
.az-card-sub { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.az-card-head .tail { margin-left: auto; }

.az-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--faint);
}

/* ============================================================
   chips / pills / tags
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: var(--card-2); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.chip.sm { font-size: 11.5px; padding: 3px 9px; }
.chip.accent { color: var(--accent-700); background: var(--accent-050); border-color: var(--accent-100); }
.chip.dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex: 0 0 auto;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }

.tier {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 12px; letter-spacing: 0.02em;
  padding: 4px 10px 4px 8px; border-radius: 999px;
}
.tier::before { content:""; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); }
.tier.gold     { color: #8A6A12; background: #FCF3DC; border: 1px solid #F0DFAE; }
.tier.gold::before { background: #D9A82A; }
.tier.silver   { color: #5A6470; background: #F0F2F5; border: 1px solid #DFE3E9; }
.tier.silver::before { background: #9AA6B2; }
.tier.platinum { color: #2C4A55; background: #E8F3F4; border: 1px solid #CDE6E8; }
.tier.platinum::before { background: #4FA0A8; }

/* ============================================================
   progress bars (NPP)
   ============================================================ */
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.bar-row + .bar-row { margin-top: 13px; }
.bar-label { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; }
.bar-emoji { font-size: 16px; }
.bar-val { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.bar-track {
  grid-column: 1 / -1;
  height: 9px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--border); overflow: hidden; position: relative;
}
.v-c .bar-track, .v-b .bar-track { background: #F1EEE8; }
.bar-fill {
  position: absolute; inset: 0 auto 0 0; height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #79C873 100%);
}
.bar-fill.muted { background: linear-gradient(90deg, var(--c5) 0%, #7C8694 100%); opacity: .85; }

/* ============================================================
   stats / kv
   ============================================================ */
.stat-grid { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.stat { background: var(--card); padding: 11px 13px; }
.stat .k { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: -0.005em; }
.stat .v { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.stat .v small { font-size: 11px; font-weight: 600; color: var(--muted); }

/* ============================================================
   profile
   ============================================================ */
.az-avatar {
  width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
  color: var(--accent-700); background: var(--accent-050);
  border: 1px solid var(--accent-100); position: relative;
}
.az-avatar.anon { color: var(--muted); background: var(--panel); border: 1px dashed var(--border-2); }
.profile-top { display: flex; align-items: center; gap: 14px; }
.profile-id { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.profile-name { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }

.history { display: flex; flex-direction: column; }
.history-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 9px 0; border-top: 1px dashed var(--border);
  font-size: 13px;
}
.history-row .he { font-size: 15px; }
.history-row .ht { color: var(--ink-2); font-weight: 600; }
.history-row .hd { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
.history-row .hp { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink); }

.anon-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; border-radius: var(--r-md);
  background: repeating-linear-gradient(135deg, var(--panel) 0 10px, #F1EDE6 10px 20px);
  border: 1px dashed var(--border-2); color: var(--ink-2);
}
.anon-banner .t { font-weight: 700; font-size: 13.5px; }
.anon-banner .s { font-size: 12px; color: var(--muted); }

/* ============================================================
   context tiles
   ============================================================ */
.ctx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ctx-tile {
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px;
}
.ctx-tile .ct-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ctx-tile .ct-main { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; margin-top: 7px; display:flex; align-items:baseline; gap:6px; }
.ctx-tile .ct-sub { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.svc-row { display: flex; gap: 6px; margin-top: 9px; }
.svc {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  background: var(--card); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 7px;
}
.svc.off { color: var(--faint); opacity: .55; }

/* ============================================================
   incoming request — event ticker
   ============================================================ */
.req {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(100deg, #0E1A14 0%, #12251B 100%);
  color: #EAF6EF; border-radius: var(--r-card);
  padding: 16px 20px; border: 1px solid #234034;
}
.req .pulse {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; background: rgba(82,176,76,.20);
  border: 1px solid rgba(82,176,76,.45); color: #84CE7E; position: relative;
}
.req .pulse::after {
  content:""; position:absolute; inset:-1px; border-radius: 11px;
  border: 1px solid rgba(82,176,76,.5); animation: reqpulse 2.2s ease-out infinite;
}
@keyframes reqpulse { 0%{transform:scale(1);opacity:.8} 100%{transform:scale(1.5);opacity:0} }
.req .rk { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; color: #8FB3A1; text-transform: uppercase; }
.req .rt { font-weight: 600; font-size: 14.5px; margin-top: 3px; line-height: 1.4; }
.req .rt b { color: #A6DC9F; font-weight: 700; }
.req .rtail { margin-left: auto; text-align: right; font-family: var(--font-mono); font-size: 11px; color: #7E9C8D; flex: 0 0 auto; }

/* ============================================================
   result branch — model block
   ============================================================ */
.branch-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 5px 10px; border-radius: 7px;
}
.branch-tag.npp { color: #1D5E60; background: #E6F4F4; border: 1px solid #C9E6E6; }
.branch-tag.fp  { color: #4A3AA0; background: #EDEAFB; border: 1px solid #D8D2F4; }
.branch-tag .d { width: 7px; height: 7px; border-radius: 50%; }
.branch-tag.npp .d { background: var(--c2); }
.branch-tag.fp .d { background: var(--c3); }

.result-card { position: relative; overflow: hidden; }
.result-card::before {
  content:""; position: absolute; top:0; left:0; right:0; height: 3px;
}
.result-card.npp::before { background: linear-gradient(90deg, var(--c2), #3BB7B9); }
.result-card.fp::before  { background: linear-gradient(90deg, var(--c3), #9182E0); }

/* fp-growth rules */
.rule {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center;
  padding: 13px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--card-2);
}
.rule + .rule { margin-top: 10px; }
.rule-flow { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; flex-wrap: wrap; }
.rule-flow .arrow { color: var(--c3); font-size: 15px; }
.rule-flow .to { color: var(--accent-700); }
.rule-metrics { display: flex; gap: 8px; grid-column: 1 / -1; }
.metric {
  display: flex; flex-direction: column; gap: 1px; flex: 1 1 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 7px 10px;
}
.metric .mk { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.metric .mv { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.metric .mv.hi { color: var(--good); }

.basket-flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.basket-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 13px; color: var(--ink);
  background: var(--card); border: 1px solid var(--border-2); border-radius: 9px;
  padding: 8px 12px;
}

/* ============================================================
   LLM offer card
   ============================================================ */
.offer {
  background: linear-gradient(155deg, #F1FBF5 0%, #E1F5EA 100%);
  border: 1px solid var(--accent-100);
  border-radius: var(--r-card); padding: 20px; position: relative; overflow: hidden;
}
.offer::after {
  content:""; position:absolute; right:-40px; top:-40px; width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(82,176,76,.18), transparent 70%);
}
.offer-llm-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .03em;
  color: #2D6A29; background: rgba(255,255,255,.7); border: 1px solid var(--accent-100);
  padding: 5px 10px; border-radius: 7px;
}
.offer-text {
  font-size: 19px; font-weight: 700; line-height: 1.4; letter-spacing: -0.02em;
  color: #16240F; margin: 14px 0 16px; max-width: 90%; position: relative;
}
.v-b .offer-text { font-size: 21px; }
.offer-meta { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.offer-meta .chip { background: rgba(255,255,255,.75); border-color: var(--accent-100); color: #2D6A29; }
.offer-meta .chip b { color: var(--accent-700); }

/* ---- повна корзина клієнта над рекомендаціями ---- */
.offer-basket {
  position: relative; margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px dashed var(--accent-100);
}
.ob-cap {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: #2D6A29; margin-bottom: 9px;
}
.ob-items { display: flex; flex-wrap: wrap; gap: 7px; }
.ob-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.8); border: 1px solid var(--accent-100);
  border-radius: 8px; padding: 5px 9px;
}
.ob-e { font-size: 14px; }
.ob-t { font-size: 13px; font-weight: 700; color: #16240F; }
.ob-q { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.ob-p { font-size: 11px; font-weight: 700; color: var(--accent-700); font-family: var(--font-mono); }
.ob-empty { font-size: 12.5px; color: var(--faint); }

/* ---- offer як нумерований список рекомендацій (без LLM) ---- */
.offer-list {
  list-style: none; margin: 14px 0 16px; padding: 0;
  display: flex; flex-direction: column; gap: 8px; position: relative;
}
.offer-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.72); border: 1px solid var(--accent-100);
  border-radius: var(--r-md); padding: 11px 14px;
}
.offer-item.muted { opacity: .65; }
.oi-num {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: #fff; background: var(--accent);
}
.oi-emoji { font-size: 19px; flex: 0 0 auto; }
.oi-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: #16240F; flex: 1; min-width: 0; }
.v-b .oi-name { font-size: 17px; }

/* ---- обов'язкова рекламна вставка АЗС ---- */
.offer-promo {
  display: flex; align-items: center; gap: 10px; position: relative;
  margin: 14px 0 4px; padding: 11px 14px;
  background: linear-gradient(150deg, #FFF7E6 0%, #FFEFC9 100%);
  border: 1px solid #F0D89A; border-radius: var(--r-md);
}
.offer-promo-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  color: #8A5A00; background: rgba(255,255,255,.75); border: 1px solid #F0D89A;
  padding: 4px 8px; border-radius: 6px; flex: 0 0 auto;
}
.offer-promo .opn-emoji { font-size: 19px; }
.offer-promo .opn-name { font-size: 16px; font-weight: 700; color: #4A3500; }

/* ============================================================
   Прелоадер (overlay поки сервер готує відповідь)
   ============================================================ */
.az-busy { min-height: 220px; }
.az-loading {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: rgba(251,250,248,.62); backdrop-filter: blur(2px);
  border-radius: var(--r-card);
}
.az-loading-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.az-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--accent-100); border-top-color: var(--accent);
  animation: az-spin .8s linear infinite;
}
.az-loading-label {
  font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: -0.01em;
}
@keyframes az-spin { to { transform: rotate(360deg); } }

/* ============================================================
   RFM block
   ============================================================ */
.rfm-wrap { display: flex; gap: 18px; align-items: stretch; }
.rfm-scores { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; flex: 0 0 auto; }
.rfm-score {
  width: 70px; text-align: center;
  background: var(--card-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 11px 6px;
}
.rfm-score .rl { font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.rfm-score .rv { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin: 5px 0 4px; }
.rfm-score .rd { font-size: 10px; color: var(--faint); font-weight: 600; }
.rfm-seg {
  margin-top: 10px; display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px;
}

/* ============================================================
   segmented control / toggle (client type)
   ============================================================ */
.seg {
  display: inline-flex; background: var(--panel); border: 1px solid var(--border);
  border-radius: 11px; padding: 4px; gap: 4px; position: relative;
}
.seg-btn {
  font-family: var(--font-ui); font-weight: 700; font-size: 13px;
  color: var(--muted); background: transparent; border: none; cursor: pointer;
  padding: 9px 16px; border-radius: 8px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .18s;
}
.seg-btn .sd { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .4; }
.seg-btn.on { color: var(--ink); background: var(--card); box-shadow: var(--shadow-sm); }
.v-b .seg-btn.on { box-shadow: inset 0 0 0 1px var(--border-2); }
.seg-btn.on.reg .sd { background: var(--c2); opacity: 1; }
.seg-btn.on.anon .sd { background: var(--c3); opacity: 1; }

/* ============================================================
   settings panel form
   ============================================================ */
.field { margin-bottom: 16px; }
.field-label { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; display:flex; align-items:center; gap:6px; }
.field-label .req-dot { color: var(--accent); }
.field-hint { font-size: 11px; color: var(--faint); font-weight: 500; }

.select {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-ui); font-weight: 600; font-size: 13.5px; color: var(--ink);
  background: var(--card); border: 1px solid var(--border-2); border-radius: var(--r-md);
  padding: 10px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.select:hover { border-color: var(--accent-200); }
.select.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-050); }
.select .caret { color: var(--faint); flex: 0 0 auto; transition: transform .16s; }
.select.open .caret { transform: rotate(180deg); color: var(--accent); }
.select .val { display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pillset { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  font-family: var(--font-ui); font-weight: 600; font-size: 12.5px;
  color: var(--ink-2); background: var(--card); border: 1px solid var(--border-2);
  padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: all .14s;
  display: inline-flex; align-items: center; gap: 6px;
}
.pill:hover { border-color: var(--accent-200); }
.pill.on { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 9px -4px rgba(82,176,76,.5); }
.pill.on.check::before { content: "✓"; font-size: 11px; }
.pill.sm { padding: 4px 9px; font-size: 11px; gap: 5px; }

/* фільтри станцій усередині попапа «Локація / АЗС» */
.pop-filt { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.pop-filt .frow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pop-filt .fcap { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); width: 62px; flex: none; }
.pop-filt .fclear { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: none; cursor: pointer; padding: 2px 4px; }
.pop-filt .fclear:hover { color: var(--accent-700); }

.field-group {
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; background: var(--card-2);
}
.field-group + .field-group { margin-top: 12px; }
.fg-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; display:flex; align-items:center; gap:8px; }
.fg-title .ic { color: var(--accent); display:flex; }

.slider-wrap { display: flex; align-items: center; gap: 12px; }
.slider {
  flex: 1; height: 6px; border-radius: 999px; position: relative;
  background: var(--panel); border: 1px solid var(--border);
}
.slider .fill { position: absolute; left:0; top:0; bottom:0; border-radius: 999px; background: var(--accent); }
.slider .knob {
  position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent); transform: translate(-50%,-50%);
  box-shadow: var(--shadow-sm);
}
.slider-val { font-family: var(--font-mono); font-weight: 600; font-size: 13px; width: 52px; text-align: right; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ============================================================
   layout helpers
   ============================================================ */
.col { display: flex; flex-direction: column; }
.row { display: flex; }
.muted-note {
  font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 8px;
}
.muted-note .ic { color: var(--faint); flex: 0 0 auto; margin-top: 1px; }

.section-eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 2px 0 2px;
}
.section-eyebrow .ttl { font-weight: 800; font-size: 15px; letter-spacing: -0.02em; }
.section-eyebrow .line { flex: 1; height: 1px; background: var(--border); }

/* collapsible section header */
.collapse-head { display: flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.collapse-head .ttl { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.collapse-head .c-hint { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.collapse-head .c-sum { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; }
.collapse-head .line { flex: 1; height: 1px; background: var(--border); }
.collapse-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border-2);
  background: var(--card); color: var(--ink-2); display: grid; place-items: center;
  cursor: pointer; flex: 0 0 auto; transition: background .12s, border-color .12s;
}
.collapse-head:hover .collapse-btn { background: var(--card-2); border-color: var(--accent-200); }
.collapse-btn .chev { transition: transform .22s cubic-bezier(.2,.8,.3,1); }

/* ============================================================
   dropdown / select popover menus
   ============================================================ */
.ctrl { position: relative; }
.pop-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(20,26,18,.14); }
.pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  width: 320px; max-width: 92vw;
  background: var(--card); border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: 0 20px 54px -18px rgba(24,20,15,.40), 0 4px 14px rgba(24,20,15,.10);
  padding: 14px; animation: popin .15s cubic-bezier(.2,.8,.3,1);
  transform-origin: top left;
}
.pop.right { left: auto; right: 0; transform-origin: top right; }
.pop.wide { width: 420px; }
.pop.xwide { width: 540px; }
@keyframes popin { from { opacity: 0; transform: translateY(-7px) scale(.97); } to { opacity: 1; transform: none; } }

.pop-title { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 14px; letter-spacing: -0.01em; }
.pop-title .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-050); color: var(--accent-700); flex: 0 0 auto; }
.pop-sub { font-size: 11.5px; color: var(--muted); margin: 3px 0 12px 35px; }
.pop-section { }
.pop-section + .pop-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.pop-label { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
.pop-label .v { margin-left: auto; font-family: var(--font-mono); color: var(--accent-700); letter-spacing: 0; text-transform: none; }

.opt-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; margin: 0 -6px; padding: 0 2px; }
.opt { display: flex; align-items: center; gap: 11px; padding: 9px 9px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.opt:hover { background: var(--card-2); }
.opt.sel { background: var(--accent-050); }
.opt-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-2); flex: 0 0 auto; display: grid; place-items: center; transition: border-color .12s; }
.opt.sel .opt-radio { border-color: var(--accent); }
.opt.sel .opt-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.opt-ic { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--border); font-size: 15px; color: var(--ink-2); }
.opt.sel .opt-ic { background: #fff; border-color: var(--accent-200); }
.opt-body { min-width: 0; flex: 1; }
.opt-main { font-weight: 700; font-size: 13.5px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 7px; }
.opt-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.opt-tail { margin-left: auto; flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }

.pop-foot { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); align-items: center; }
.pop-foot .hint { font-size: 11px; color: var(--muted); font-weight: 500; }
.btn-ghost { font-family: var(--font-ui); font-weight: 700; font-size: 12.5px; color: var(--ink-2); background: var(--card); border: 1px solid var(--border-2); border-radius: 9px; padding: 8px 13px; cursor: pointer; transition: border-color .12s; }
.btn-ghost:hover { border-color: var(--accent-200); }
.btn-apply { font-family: var(--font-ui); font-weight: 700; font-size: 12.5px; color: #fff; background: var(--accent); border: none; border-radius: 9px; padding: 8px 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; box-shadow: 0 4px 11px -4px rgba(82,176,76,.55); }
.btn-apply:hover { background: var(--accent-600); }

.pop-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-2); border-radius: 9px; padding: 9px 11px; margin-bottom: 10px; color: var(--muted); }
.pop-search input { border: none; outline: none; font-family: var(--font-ui); font-size: 13px; width: 100%; background: transparent; color: var(--ink); }
.pop-search input::placeholder { color: var(--faint); }

.pop-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cart-cell {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px; cursor: pointer;
  border: 1px solid var(--border-2); border-radius: 10px; background: var(--card); transition: all .13s;
}
.cart-cell:hover { border-color: var(--accent-200); }
.cart-cell.on { border-color: var(--accent); background: var(--accent-050); }
.cart-cell .ce { font-size: 19px; flex: 0 0 auto; }
.cart-cell .cl { font-weight: 700; font-size: 13px; }
.cart-cell .cs { font-size: 11px; color: var(--muted); }
.cart-cell .ck { margin-left: auto; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-2); display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.cart-cell.on .ck { background: var(--accent); border-color: var(--accent); }

/* ієрархічний пікер кошика: категорія → конкретний товар */
.cart-acc { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; padding-right: 2px; }
.cart-head {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; cursor: pointer;
  border: 1px solid var(--border-2); border-radius: 10px; background: var(--card); transition: all .13s;
}
.cart-head:hover { border-color: var(--accent-200); }
.cart-head.on { border-color: var(--accent); background: var(--accent-050); }
.cart-head .ce { font-size: 18px; flex: 0 0 auto; }
.cart-head .cl { font-weight: 700; font-size: 13px; }
.cart-head .cs { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.cart-head .cs.has { color: var(--accent-700); font-weight: 600; }
.cart-head .chev { color: var(--muted); display: inline-flex; transition: transform .16s; flex: 0 0 auto; }
.cart-head.exp .chev { transform: rotate(180deg); }
.cart-head .ck { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-2); display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.cart-head .ck:hover { border-color: var(--accent); }
.cart-head.on .ck { background: var(--accent); border-color: var(--accent); }
.cart-prods { display: flex; flex-direction: column; gap: 2px; padding: 3px 3px 5px 32px; }
.cart-prod { display: flex; align-items: center; gap: 9px; padding: 7px 10px; cursor: pointer; border-radius: 8px; font-size: 12.5px; transition: background .1s; }
.cart-prod:hover { background: var(--accent-050); }
.cart-prod.sel { background: var(--accent-050); }
.cart-prod .radio { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--border-2); flex: 0 0 auto; display: grid; place-items: center; }
.cart-prod.sel .radio { border-color: var(--accent); }
.cart-prod.sel .radio::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cart-prod .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-prod .pp { font-size: 11px; color: var(--muted); font-family: var(--font-mono); flex: 0 0 auto; }

.tod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tod {
  display: flex; align-items: center; gap: 10px; padding: 10px; cursor: pointer;
  border: 1px solid var(--border-2); border-radius: 10px; transition: all .13s;
}
.tod:hover { border-color: var(--accent-200); }
.tod.on { border-color: var(--accent); background: var(--accent-050); }
.tod .te { font-size: 17px; }
.tod .tl { font-weight: 700; font-size: 13px; }
.tod .ts { font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); }
.day-row { display: flex; gap: 5px; }
.day {
  flex: 1; text-align: center; font-weight: 700; font-size: 12px; padding: 8px 0; cursor: pointer;
  border: 1px solid var(--border-2); border-radius: 8px; color: var(--ink-2); transition: all .12s;
}
.day:hover { border-color: var(--accent-200); }
.day.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.day.we { color: var(--accent-700); }
.day.we.on { color: #fff; }
