/* ==========================================================================
   MarketPilot AI — личный кабинет
   ========================================================================== */

/* ---------- каркас ---------- */
.app { min-height: 100vh; background: var(--bg); }
.app-bg { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.abglow { position: absolute; border-radius: 50%; filter: blur(110px); }
.abglow-1 { width: 620px; height: 620px; top: -260px; left: 12%; background: radial-gradient(circle, rgba(79, 124, 255, 0.2), transparent 66%); }
.abglow-2 { width: 540px; height: 540px; top: 30%; right: -180px; background: radial-gradient(circle, rgba(124, 92, 255, 0.16), transparent 68%); }
.abglow-3 { width: 520px; height: 520px; bottom: -220px; left: 34%; background: radial-gradient(circle, rgba(46, 230, 168, 0.09), transparent 68%); }

.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

/* ---------- бренд ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #4f7cff, #7c5cff 60%, #a855f7);
  color: #fff; box-shadow: 0 8px 22px -10px rgba(94, 116, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { font-weight: 800; font-size: 17px; letter-spacing: -0.035em; }
.brand-ai { color: #8fa8ff; margin-left: 2px; }

/* ---------- сайдбар ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 16px;
  padding: 18px 14px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(12, 17, 30, 0.92), rgba(7, 10, 18, 0.96));
  backdrop-filter: blur(20px);
  z-index: 60;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 0; }
.side-close { display: none; width: 32px; height: 32px; border-radius: 9px; color: var(--muted); }
.side-close svg { width: 17px; height: 17px; margin: 0 auto; }
.side-close:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }

.workspace {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  text-align: left;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.workspace:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--stroke-strong); }
.ws-ava {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: linear-gradient(140deg, #2ee6a8, #0ea5e9); color: #04120c;
}
.ws-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ws-info b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-info small { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-chev { width: 15px; height: 15px; margin-left: auto; color: var(--muted-2); flex: none; }

.side-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted-2); padding: 12px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  font-size: 13.5px; color: var(--text-soft); font-weight: 500;
  position: relative;
  transition: background 0.22s var(--ease), color 0.22s var(--ease);
}
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--muted); transition: color 0.22s var(--ease); }
.nav-item:hover { background: rgba(255, 255, 255, 0.055); color: #fff; }
.nav-item:hover svg { color: #b9c6f5; }
.nav-item.is-active {
  color: #fff;
  background: linear-gradient(100deg, rgba(91, 140, 255, 0.24), rgba(124, 92, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(130, 155, 255, 0.26);
}
.nav-item.is-active svg { color: #a9bcff; }
.nav-item.is-active::before {
  content: ''; position: absolute; left: -4px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, #6d94ff, #a855f7);
}
.nav-badge {
  margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 6px;
  font-size: 10.5px; font-weight: 700;
  background: rgba(91, 140, 255, 0.2); color: #b8caff;
}
.nav-badge.danger { background: rgba(255, 107, 107, 0.18); color: #ffa3a3; }
.nav-badge.warn { background: rgba(251, 191, 36, 0.16); color: #ffd88a; }
.nav-ai {
  margin-left: auto; font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 5px; color: #fff;
  background: linear-gradient(135deg, #4a7bff, #a855f7);
}

.side-foot { display: flex; flex-direction: column; gap: 10px; }
.trial-card {
  padding: 12px; border-radius: 12px;
  background: linear-gradient(150deg, rgba(91, 140, 255, 0.16), rgba(124, 92, 255, 0.07));
  border: 1px solid rgba(120, 145, 255, 0.24);
}
.trial-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.trial-badge { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #b9caff; font-weight: 600; }
.trial-top b { font-size: 12px; color: #fff; }
.trial-bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-bottom: 9px; }
.trial-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6d94ff, #b388ff); }
.trial-card p { font-size: 11px; color: #a9b5d6; line-height: 1.45; margin-bottom: 10px; }

.side-user {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 8px; border-radius: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}
.side-user .ava {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #7c5cff, #4f7cff);
}
.side-user > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.side-user b { font-size: 12px; font-weight: 600; }
.side-user small { font-size: 10px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .icon-btn { margin-left: auto; }

.side-overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(3, 6, 12, 0.66);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.side-overlay.is-in { opacity: 1; }

/* ---------- топбар ---------- */
.app-body { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  min-height: var(--topbar-h);
  background: rgba(7, 10, 18, 0.78);
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.tb-title { min-width: 0; margin-right: auto; }
.tb-title h1 { font-size: 19px; letter-spacing: -0.03em; font-weight: 700; }
.tb-title p { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; position: relative;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
  transition: all 0.22s var(--ease);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.09); border-color: var(--stroke-strong); }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.ghost:hover { background: rgba(255, 255, 255, 0.07); }
.dot-badge {
  position: absolute; top: 7px; right: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px rgba(7, 10, 18, 0.9);
}
.burger { display: none; }

.seg-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: 10px; background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
}
.seg-seg button {
  padding: 6px 11px; border-radius: 7px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  transition: all 0.22s var(--ease); white-space: nowrap;
}
.seg-seg button:hover { color: var(--text); }
.seg-seg button.is-active { color: #fff; background: rgba(255, 255, 255, 0.1); box-shadow: 0 3px 10px -6px #000; }

.user-chip {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #7c5cff, #4f7cff);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* ---------- контент ---------- */
.view {
  padding: 22px;
  display: flex; flex-direction: column; gap: 18px;
  max-width: 1560px; width: 100%;
  animation: fade-up 0.4s var(--ease);
}
.view:focus { outline: none; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(21px, 2.2vw, 27px); letter-spacing: -0.035em; }
.page-head p { font-size: 13px; color: var(--muted); margin-top: 5px; }
.page-head .ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  padding: 18px;
  min-width: 0;
  position: relative;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi {
  padding: 14px 15px 10px; border-radius: 14px;
  border: 1px solid var(--stroke);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014));
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.kpi:hover { border-color: rgba(255, 255, 255, 0.16); transform: translateY(-2px); }
.kpi-top { display: flex; align-items: center; gap: 7px; }
.kpi-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-ico { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.kpi-ico svg { width: 12px; height: 12px; }
.kpi-value { font-size: clamp(17px, 1.65vw, 23px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: auto; }
.kpi-foot .badge { height: 20px; font-size: 10.5px; padding: 0 6px; border-radius: 5px; }
.kpi-foot small { font-size: 10.5px; color: var(--muted-2); }
.kpi-spark { height: 26px; margin-top: 2px; opacity: 0.92; }

/* ---------- инсайты / рекомендации ---------- */
.ins-list { display: flex; flex-direction: column; gap: 10px; }
.ins-item {
  display: flex; gap: 11px;
  padding: 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.ins-item:hover { background: rgba(255, 255, 255, 0.055); border-color: rgba(255, 255, 255, 0.14); }
.ins-item.tone-bad { border-color: rgba(255, 107, 107, 0.22); background: linear-gradient(120deg, rgba(255, 107, 107, 0.08), rgba(255, 255, 255, 0.02)); }
.ins-item.tone-good { border-color: rgba(46, 230, 168, 0.22); background: linear-gradient(120deg, rgba(46, 230, 168, 0.07), rgba(255, 255, 255, 0.02)); }
.ins-item.tone-warn { border-color: rgba(251, 191, 36, 0.22); background: linear-gradient(120deg, rgba(251, 191, 36, 0.07), rgba(255, 255, 255, 0.02)); }
.ins-ico { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, 0.07); }
.ins-ico svg { width: 14px; height: 14px; }
.ins-body { min-width: 0; flex: 1; }
.ins-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.ins-text { font-size: 12.2px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.ins-meta { display: flex; align-items: center; gap: 10px; margin-top: 7px; flex-wrap: wrap; }
.ins-meta span { font-size: 11px; color: var(--muted-2); }
.ins-meta b { color: var(--green); font-size: 11.5px; }
.ins-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }

.banner {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 17px; border-radius: 14px;
  background: linear-gradient(115deg, rgba(91, 140, 255, 0.16), rgba(124, 92, 255, 0.08) 60%, rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(120, 145, 255, 0.3);
}
.banner-ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1); color: #cdd9ff;
}
.banner-ico svg { width: 18px; height: 18px; }
.banner-body { flex: 1; min-width: 0; }
.banner-body h3 { font-size: 14px; margin-bottom: 4px; }
.banner-body p { font-size: 12.5px; color: #b8c4e6; line-height: 1.55; }
.banner-body strong { color: #fff; }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- графики ---------- */
.chart-box { position: relative; }
.chart-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.lg i { width: 9px; height: 9px; border-radius: 3px; }
.mini-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--stroke); }
.mini-tabs button { padding: 5px 10px; border-radius: 6px; font-size: 11.5px; color: var(--muted); transition: all 0.2s var(--ease); white-space: nowrap; }
.mini-tabs button.is-active { color: #fff; background: rgba(255, 255, 255, 0.1); }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl thead th {
  text-align: left; font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted-2); padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.014);
  position: sticky; top: 0; z-index: 1;
}
.tbl tbody td { padding: 11px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); vertical-align: middle; }
.tbl tbody tr { transition: background 0.2s var(--ease); }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl .strong { font-weight: 600; color: #fff; }
.tbl .muted-cell { color: var(--muted); font-size: 11.5px; }
.tbl-prod { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.p-ava {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(150deg, rgba(91, 140, 255, 0.5), rgba(124, 92, 255, 0.32));
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.p-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p-name b { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.p-name small { font-size: 10.5px; color: var(--muted-2); }
.mp-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.mp-tag.wb { background: rgba(203, 17, 171, 0.14); color: #f0a6e4; }
.mp-tag.ozon { background: rgba(0, 91, 255, 0.16); color: #9ec0ff; }
.mp-tag.yandex { background: rgba(255, 204, 0, 0.14); color: #ffe38a; }

.st { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.st i { width: 5px; height: 5px; border-radius: 50%; }
.st-scale { color: #7ef3c4; background: rgba(46, 230, 168, 0.12); border: 1px solid rgba(46, 230, 168, 0.24); }
.st-scale i { background: var(--green); }
.st-fix { color: #ffd88a; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.24); }
.st-fix i { background: var(--amber); }
.st-stop { color: #ffa3a3; background: rgba(255, 107, 107, 0.12); border: 1px solid rgba(255, 107, 107, 0.24); }
.st-stop i { background: var(--red); }

.mini-progress { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.09); overflow: hidden; min-width: 64px; }
.mini-progress i { display: block; height: 100%; border-radius: 99px; }

/* ---------- drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(3, 6, 12, 0.62);
  backdrop-filter: blur(5px);
  opacity: 0; transition: opacity 0.28s var(--ease);
}
.drawer-overlay.is-in { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 210;
  width: min(520px, 100%);
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, rgba(18, 25, 42, 0.99), rgba(8, 12, 22, 0.99));
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -40px 0 90px -40px #000;
  transform: translateX(100%);
  transition: transform 0.36s var(--ease-out);
}
.drawer.is-in { transform: none; }
.drawer-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.drawer-head h3 { font-size: 16px; line-height: 1.35; }
.drawer-head small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.drawer-close { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); flex: none; }
.drawer-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.drawer-close svg { width: 16px; height: 16px; }
.drawer-body { padding: 18px 20px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.d-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); margin-bottom: 10px; }
.d-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-kv > div { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--stroke); }
.d-kv span { display: block; font-size: 10.5px; color: var(--muted); }
.d-kv b { font-size: 14px; letter-spacing: -0.02em; }
.d-note { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.d-list { display: flex; flex-direction: column; gap: 8px; }
.d-list li { display: flex; gap: 9px; font-size: 12.5px; color: var(--text-soft); line-height: 1.45; }
.d-list li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #6d94ff; margin-top: 7px; flex: none; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- чат ---------- */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.chat-panel {
  display: flex; flex-direction: column;
  border-radius: var(--radius); border: 1px solid var(--stroke);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  height: calc(100vh - var(--topbar-h) - 150px);
  min-height: 460px;
  overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}
.chat-ava {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #4f7cff, #a855f7);
  box-shadow: 0 6px 18px -8px rgba(94, 116, 255, 0.9);
}
.chat-ava svg { width: 17px; height: 17px; }
.chat-head b { font-size: 13.5px; }
.chat-head small { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(46, 230, 168, 0.15); }
.chat-head-actions { margin-left: auto; display: flex; gap: 6px; }

.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; max-width: 88%; animation: fade-up 0.32s var(--ease); }
.msg-user { margin-left: auto; flex-direction: row-reverse; }
.msg-ava {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, #4f7cff, #a855f7);
}
.msg-ava.user-ava { background: linear-gradient(140deg, #2ee6a8, #0ea5e9); color: #04120c; }
.msg-bubble {
  padding: 12px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.6;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
  color: var(--text-soft);
  min-width: 0;
}
.msg-user .msg-bubble {
  background: linear-gradient(140deg, rgba(91, 140, 255, 0.3), rgba(124, 92, 255, 0.22));
  border-color: rgba(120, 145, 255, 0.36);
  color: #eaf0ff;
  border-bottom-right-radius: 5px;
}
.msg-ai .msg-bubble { border-bottom-left-radius: 5px; }
.msg-bubble p + p { margin-top: 9px; }
.msg-bubble strong { color: #fff; font-weight: 600; }
.msg-bubble ul, .msg-bubble ol { margin: 8px 0 2px; display: flex; flex-direction: column; gap: 5px; }
.msg-bubble li { position: relative; padding-left: 15px; font-size: 12.5px; }
.msg-bubble ul li::before { content: ''; position: absolute; left: 3px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: #8fa8ff; }
.msg-bubble ol { counter-reset: li; }
.msg-bubble ol li::before { counter-increment: li; content: counter(li); position: absolute; left: 0; top: 0; font-size: 10px; color: #8fa8ff; font-weight: 700; }
.msg-bubble .m-note { margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 11.5px; color: var(--muted); }
.m-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.m-table th { text-align: left; font-weight: 500; color: var(--muted-2); font-size: 10.5px; padding: 4px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.m-table td { padding: 5px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.m-table tr:last-child td { border-bottom: 0; }
.m-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }

.typing { display: flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #8fa8ff; animation: bounce2 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce2 { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-5px); opacity: 1; } }

.chat-suggest { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 16px 12px; }
.sug-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 99px;
  font-size: 11.5px; color: var(--text-soft);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
  transition: all 0.22s var(--ease);
}
.sug-chip:hover { color: #fff; background: rgba(91, 140, 255, 0.16); border-color: rgba(110, 140, 255, 0.4); }

.composer {
  display: flex; align-items: flex-end; gap: 9px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.018);
}
.composer textarea {
  flex: 1; min-height: 42px; max-height: 130px;
  resize: none; padding: 11px 13px;
  border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px; line-height: 1.45; color: var(--text);
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.composer textarea::placeholder { color: var(--muted-2); }
.composer textarea:focus { outline: none; border-color: rgba(110, 140, 255, 0.6); background: rgba(91, 140, 255, 0.06); }
.composer-send {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #4a7bff, #7c5cff);
  box-shadow: 0 8px 22px -10px rgba(94, 116, 255, 0.95);
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}
.composer-send:hover { transform: translateY(-2px); }
.composer-send:disabled { opacity: 0.5; transform: none; pointer-events: none; }
.composer-send svg { width: 18px; height: 18px; }

.chat-context { display: flex; flex-direction: column; gap: 14px; }
.ctx-card { padding: 15px; border-radius: 14px; border: 1px solid var(--stroke); background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.014)); }
.ctx-card h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); margin-bottom: 11px; font-weight: 600; }
.ctx-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.ctx-row:last-child { border-bottom: 0; }
.ctx-row span { color: var(--muted); }
.ctx-row b { font-weight: 600; }
.ctx-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ctx-tag { font-size: 10.5px; padding: 3px 8px; border-radius: 6px; background: rgba(91, 140, 255, 0.14); color: #b8caff; border: 1px solid rgba(91, 140, 255, 0.22); }

/* ---------- настройки ---------- */
.set-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.set-nav button {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 9px;
  font-size: 13px; color: var(--muted); text-align: left;
  transition: all 0.2s var(--ease);
}
.set-nav button svg { width: 16px; height: 16px; }
.set-nav button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.set-nav button.is-active { color: #fff; background: rgba(91, 140, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(120, 145, 255, 0.24); }
.set-panels { display: flex; flex-direction: column; gap: 16px; }

.connect-card {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 16px; border-radius: 14px;
  border: 1px solid var(--stroke);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.014));
}
.cc-logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
}
.cc-logo.wb { background: linear-gradient(140deg, #a41dc4, #6f1a9e); }
.cc-logo.ozon { background: linear-gradient(140deg, #005bff, #0038a8); }
.cc-logo.yandex { background: linear-gradient(140deg, #ffd400, #f59e0b); color: #241a00; }
.cc-logo svg { width: 20px; height: 20px; }
.cc-body { flex: 1; min-width: 0; padding-right: 10px; }
.cc-body h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 3px; flex-wrap: wrap; }
.cc-body p { font-size: 11.5px; color: var(--muted); }
.cc-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 9px; font-size: 11px; color: var(--muted-2); }
.cc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.cc-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; font-size: 11.5px; color: var(--text-soft); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px; color: var(--text);
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.field textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: rgba(110, 140, 255, 0.6);
  background: rgba(91, 140, 255, 0.07); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12);
}
.field input:disabled { opacity: 0.55; }
.field-err { display: block; font-size: 11px; color: #ff9c9c; margin-top: 4px; }
.form-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.form-foot small { font-size: 11px; color: var(--muted-2); }

.switch-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row > div:not(.switch) { flex: 1; min-width: 0; }
.switch-row b { display: block; font-size: 12.5px; font-weight: 500; }
.switch-row small { font-size: 11px; color: var(--muted); }
.switch {
  position: relative; width: 40px; height: 22px; flex: 0 0 40px;
  border-radius: 99px; background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.25s var(--ease);
  cursor: pointer;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s var(--ease);
}
.switch.is-on { background: linear-gradient(135deg, #4a7bff, #7c5cff); border-color: transparent; }
.switch.is-on::after { transform: translateX(18px); }

.plan-box {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px; border-radius: 14px;
  background: linear-gradient(130deg, rgba(91, 140, 255, 0.16), rgba(124, 92, 255, 0.07));
  border: 1px solid rgba(120, 145, 255, 0.28);
}
.plan-box .pb-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.12); color: #fff; }
.plan-box h4 { font-size: 14px; margin-bottom: 2px; }
.plan-box p { font-size: 11.5px; color: #b6c2e2; }
.plan-box .pb-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.usage { display: flex; flex-direction: column; gap: 10px; }
.usage-row { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.usage-row span { width: 150px; color: var(--muted); flex: none; }
.usage-row .bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.usage-row .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4a7bff, #a855f7); }
.usage-row b { width: 54px; text-align: right; font-size: 11.5px; }

.key-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--stroke);
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  overflow: hidden;
}
.key-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-zone { border-color: rgba(255, 107, 107, 0.26); background: linear-gradient(160deg, rgba(255, 107, 107, 0.06), rgba(255, 255, 255, 0.01)); }

.toggle-group { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--stroke); }
.toggle-group button { padding: 6px 11px; border-radius: 6px; font-size: 11.5px; color: var(--muted); transition: all 0.2s var(--ease); }
.toggle-group button.is-active { color: #fff; background: rgba(255, 255, 255, 0.1); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- мобильная навигация ---------- */
.mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(8, 12, 22, 0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mobile-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: 10px; font-size: 9.5px; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.mobile-nav a svg { width: 19px; height: 19px; }
.mobile-nav a.is-active { color: #a9bcff; background: rgba(91, 140, 255, 0.12); }

/* ---------- горизонтальные бары ---------- */
.hrow { margin-bottom: 12px; }
.hrow:last-child { margin-bottom: 0; }
.hrow-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; margin-bottom: 6px; }
.hrow-label { color: var(--text-soft); }
.hrow-val { font-weight: 600; color: #fff; font-size: 12.5px; white-space: nowrap; }
.hrow-track { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.hrow-fill { display: block; height: 100%; border-radius: 99px; }

/* ---------- адаптив ---------- */
@media (max-width: 1440px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {
  .kpi-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1240px) {
  .g-main, .g-side { grid-template-columns: minmax(0, 1fr); }
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .chat-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.36s var(--ease-out);
    box-shadow: 30px 0 80px -30px #000;
  }
  .sidebar.is-open { transform: none; }
  .side-close { display: block; }
  .burger { display: grid; }
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .set-nav button { white-space: nowrap; }
}

@media (max-width: 860px) {
  .topbar { padding: 10px 14px; gap: 9px; flex-wrap: wrap; row-gap: 8px; }
  .tb-title h1 { font-size: 17px; }
  .tb-title p { font-size: 10.5px; }
  .tb-title { flex: 1 1 auto; min-width: 0; }
  .tb-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
  .seg-seg button { padding: 6px 9px; font-size: 11.5px; }
  .hide-sm { display: none; }
  .ask-ai span { display: none; }
  .ask-ai { padding: 0 12px; }
  .view { padding: 16px 14px 88px; gap: 14px; }
  .mobile-nav { display: flex; }
  .kpi-grid, .kpi-grid.five, .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .chat-layout { gap: 12px; }
  .chat-context { grid-template-columns: minmax(0, 1fr); }
  .chat-panel { height: calc(100vh - var(--topbar-h) - 96px); min-height: 440px; }
  .msg { max-width: 94%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 100%; }
  .tbl-prod { min-width: 180px; }
  .p-name b { max-width: 180px; }
  .usage-row span { width: 110px; }
}

@media (max-width: 560px) {
  .topbar { row-gap: 8px; }
  .tb-title { flex: 1 1 calc(100% - 52px); }
  #syncBtn { display: none; }
  .seg-seg button { padding: 6px 8px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 18px; }
  .card { padding: 14px; }
  .page-head h1 { font-size: 20px; }
  .d-kv { grid-template-columns: 1fr; }
  .banner { flex-direction: column; }
  .chat-suggest { padding: 0 12px 10px; }
  .composer { padding: 10px 12px; }
  .plan-box .pb-actions { margin-left: 0; width: 100%; }
  .plan-box .pb-actions .btn { flex: 1; }
}

/* ==========================================================================
   Биллинг, тарифы, paywall
   ========================================================================== */
.trial-card.is-paid {
  background: linear-gradient(155deg, rgba(46, 230, 168, 0.12), rgba(91, 140, 255, 0.07));
  border-color: rgba(46, 230, 168, 0.24);
}
.trial-card.is-paid .trial-badge { background: rgba(46, 230, 168, 0.14); color: #7ef3c4; }

.paywall {
  max-width: 1000px; margin: 0 auto; padding: 18px 0 40px;
  display: flex; flex-direction: column; gap: 20px;
}
.empty-hero {
  max-width: 620px; margin: 8vh auto 0; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 38px 28px; border-radius: 22px;
  border: 1px solid var(--stroke);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}
.empty-hero .eyebrow { display: inline-block; }
.empty-hero h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -0.045em; }
.empty-hero p { color: var(--muted); font-size: 14px; line-height: 1.65; max-width: 500px; }
.empty-hero .ph-actions { justify-content: center; margin-top: 6px; }
.paywall-head { text-align: center; max-width: 650px; margin: 10px auto 0; }
.paywall-head .eyebrow { display: inline-block; margin-bottom: 12px; }
.paywall-head h1 { font-size: clamp(30px, 4.5vw, 46px); line-height: 1.08; letter-spacing: -0.045em; margin-bottom: 12px; }
.paywall-head p { color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.paywall-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted-2); font-size: 11.5px; padding: 4px 2px; }
.paywall-foot .link-inline { font-size: 12px; }

.is-paywall .mobile-nav { display: none; }
.is-paywall .tb-actions { visibility: hidden; }
.is-paywall .side-nav { opacity: 0.45; pointer-events: none; }
.is-paywall .side-nav .nav-badge { visibility: hidden; }
.is-paywall .burger { display: none; }

.pay-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pay-plan {
  position: relative; display: flex; flex-direction: column;
  padding: 22px; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease);
}
.pay-plan:hover { border-color: rgba(255, 255, 255, 0.17); }
.pay-plan.is-selected {
  border-color: rgba(112, 142, 255, 0.65);
  background: linear-gradient(165deg, rgba(91, 140, 255, 0.16), rgba(124, 92, 255, 0.06));
  box-shadow: 0 18px 50px -35px rgba(91, 140, 255, 0.9);
}
.pay-plan-featured { border-color: rgba(130, 155, 255, 0.32); }
.pay-plan-badge {
  position: absolute; top: -10px; right: 16px;
  padding: 4px 10px; border-radius: 99px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
  background: linear-gradient(135deg, #2ee6a8, #0ea5e9); color: #041510;
  box-shadow: 0 8px 20px -10px rgba(46, 230, 168, 0.8);
}
.pay-plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pay-plan-head h3 { font-size: 17px; }
.pay-plan-head span { font-size: 11px; color: var(--muted); }
.pay-plan-price { display: flex; align-items: baseline; gap: 7px; }
.pay-plan-price b { font-size: 29px; letter-spacing: -0.04em; line-height: 1; }
.pay-plan-price small { color: var(--muted); font-size: 12px; }
.pay-plan-eq { color: var(--muted-2); font-size: 11px; margin: 8px 0 14px; }
.pay-plan-list { list-style: none; display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.pay-plan-list li { position: relative; padding-left: 19px; color: var(--text-soft); font-size: 12px; line-height: 1.4; }
.pay-plan-list li::before {
  content: ''; position: absolute; left: 2px; top: 4px; width: 8px; height: 5px;
  border-left: 1.8px solid #2ee6a8; border-bottom: 1.8px solid #2ee6a8;
  transform: rotate(-45deg);
}
.pay-plan .btn { margin-top: auto; }

.pay-status {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  border-radius: 13px; border: 1px solid rgba(124, 92, 255, 0.25);
  background: linear-gradient(130deg, rgba(124, 92, 255, 0.1), rgba(255, 255, 255, 0.014));
}
.pay-status-ico {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 11px; font-size: 18px; font-weight: 800;
  background: rgba(124, 92, 255, 0.16); color: #cdbcff;
}
.pay-status > div { flex: 1; min-width: 0; }
.pay-status b { display: block; font-size: 13.5px; color: #fff; }
.pay-status p { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.pay-status-paid { border-color: rgba(46, 230, 168, 0.24); background: linear-gradient(130deg, rgba(46, 230, 168, 0.09), rgba(255, 255, 255, 0.014)); }
.pay-status-paid .pay-status-ico { background: rgba(46, 230, 168, 0.14); color: #7ef3c4; }
.pay-status-expired { border-color: rgba(255, 107, 107, 0.28); background: linear-gradient(130deg, rgba(255, 107, 107, 0.08), rgba(255, 255, 255, 0.014)); }
.pay-status-expired .pay-status-ico { background: rgba(255, 107, 107, 0.14); color: #ffa3a3; }

.modal-overlay.modal-wide .modal-card { width: min(780px, 100%); max-height: 92vh; overflow-y: auto; }
.modal-overlay.modal-wide .modal-card::-webkit-scrollbar { width: 6px; }
.modal-overlay.modal-wide .modal-card::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; }
.pay-modal-head { margin-bottom: 16px; }
.pay-modal-head .eyebrow { display: inline-block; margin-bottom: 7px; }
.pay-modal-head p { font-size: 12px; color: var(--muted); line-height: 1.55; }
.pay-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.pay-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; flex-wrap: wrap; }
.pay-form-head b { font-size: 14px; }
.pay-form-head span { font-size: 10.5px; color: #ffd88a; background: rgba(251, 191, 36, 0.1); padding: 3px 8px; border-radius: 99px; }
.pay-test-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 9px 11px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.035); border: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 10.5px; color: var(--muted);
}
.pay-test-hint b { color: var(--text-soft); font-weight: 500; }
.pay-consent {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 10px; font-size: 10.5px; line-height: 1.5; color: var(--muted);
  cursor: pointer;
}
.pay-consent input {
  width: 15px; height: 15px; margin: 1px 0 0; flex: none;
  accent-color: #5b8cff; cursor: pointer;
}
.pay-consent a { color: #9db2ff; text-decoration: underline; text-underline-offset: 2px; }
.pay-secure { margin-top: 12px; font-size: 10.5px; color: var(--muted-2); }
.auth-notice {
  margin-top: 10px; padding: 9px 11px; border-radius: 9px;
  background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.26);
  color: #ffb5b5; font-size: 12px; line-height: 1.4;
}
.pay-history { display: flex; flex-direction: column; gap: 7px; }
.pay-history h4 { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pay-history-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); font-size: 11.5px; color: var(--muted); }
.pay-history-row b { color: var(--text-soft); font-weight: 600; }

@media (max-width: 900px) {
  .pay-plans { grid-template-columns: minmax(0, 1fr); }
  .paywall { padding-top: 4px; }
  .modal-overlay.modal-wide .modal-card { width: min(620px, 100%); }
}

@media (max-width: 560px) {
  .pay-plan { padding: 18px; }
  .pay-plan-price b { font-size: 25px; }
  .modal-overlay.modal-wide .modal-card { padding: 20px 16px; }
  .pay-status { align-items: flex-start; }
  .pay-status .badge { display: none; }
  .paywall-foot { justify-content: center; text-align: center; }
}
