/* Telemarket - карта лояльности.
 * Телефон: одна колонка, липкая шапка и нижняя панель. Компьютер (>= 1024 px): портал - боковая навигация и две колонки.
 * Все стили во внешнем файле: CSP запрещает inline-стили (style-src 'self').
 */
:root {
  --bg: #f5f5f6;
  --surface: #ffffff;
  --ink: #1a1a1c;
  --muted: #5d6168;
  --line: #e3e3e7;
  --accent: #D40019;
  --accent-ink: #ffffff;
  --accent-soft: #fde8ea;
  --gain: #17703f;
  --spend: #D40019;
  --card-a: #D40019;
  --card-b: #610207;
  --shadow: 0 12px 30px -14px rgba(97, 2, 7, .55);

  --font-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-lg: 20px;
  --r-md: 14px;
  --col: 480px;
  --side: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121214; --surface: #1c1c1f; --ink: #ececee; --muted: #a3a3ac; --line: #2e2e33;
    --accent: #ff6b7d; --accent-ink: #1a0508; --accent-soft: #3a1a20;
    --gain: #5fd08f; --spend: #ff8a98;
    --shadow: 0 12px 30px -14px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .logo.logo-light, :root:not([data-theme="light"]) .login-logo.logo-light { display: none; }
  :root:not([data-theme="light"]) .logo.logo-dark, :root:not([data-theme="light"]) .login-logo.logo-dark { display: block; }
}
:root[data-theme="dark"] {
  --bg: #121214; --surface: #1c1c1f; --ink: #ececee; --muted: #a3a3ac; --line: #2e2e33;
  --accent: #ff6b7d; --accent-ink: #1a0508; --accent-soft: #3a1a20;
  --gain: #5fd08f; --spend: #ff8a98;
  --shadow: 0 12px 30px -14px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
:root[data-theme="dark"] .logo.logo-light, :root[data-theme="dark"] .login-logo.logo-light { display: none; }
:root[data-theme="dark"] .logo.logo-dark, :root[data-theme="dark"] .login-logo.logo-dark { display: block; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
img { max-width: 100%; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .04em; }
.num, .tx-amount, .tx-pts, .lcard-points, .history-sum b, .acc-bal { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- каркас (телефон) ---------- */
.app {
  max-width: var(--col);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}
.side { display: contents; }
.topbar {
  position: sticky; top: 0; z-index: 5; order: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; line-height: 0; border-radius: 6px; }
.logo { display: block; height: 22px; width: auto; }
.logo.logo-dark, .login-logo.logo-dark { display: none; }
.group-chip {
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  padding: 5px 10px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent);
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.offline-bar {
  order: 1;
  margin: 0 max(16px, env(safe-area-inset-right, 0px)) 4px max(16px, env(safe-area-inset-left, 0px));
  padding: 8px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.views {
  order: 2; flex: 1; min-width: 0;
  padding-block: 6px 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.view-title { font: 700 24px/1.15 var(--font-display); margin: 6px 0 0; letter-spacing: -.015em; text-wrap: balance; overflow-wrap: anywhere; }
.view-lead { margin: -6px 0 0; color: var(--muted); max-width: 60ch; }
.block { background: var(--surface); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.block h2 { font-size: 15px; font-weight: 600; margin: 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.link { font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.meta { font-size: 12px; color: var(--muted); margin: 0; text-align: center; }
.view-boot { align-items: center; padding-top: 30vh; gap: 12px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- пластиковая карта (ID-1, 85.6 x 54 мм) ---------- */
.lcard {
  aspect-ratio: 85.6 / 54;
  width: 100%;
  border-radius: 16px;
  padding: 16px 20px 16px;
  color: #fff;
  display: flex; flex-direction: column;
  background:
    repeating-radial-gradient(circle at 112% -20%, rgba(255,255,255,.07) 0 1px, transparent 1px 9px),
    radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,.2), transparent 55%),
    linear-gradient(135deg, var(--card-a), var(--card-b));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.lcard-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; }
.lcard-brand { display: inline-flex; align-items: center; gap: 8px; font: 700 17px/1 var(--font-display); flex: none; }
.lcard-mark { display: block; width: 20px; height: 22px; }
.lcard-group {
  font-size: 11px; font-weight: 600; letter-spacing: 0;
  padding: 4px 8px; border: 1px solid rgba(255,255,255,.55); border-radius: 6px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lcard-balance { margin-top: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lcard-points { font: 700 clamp(30px, 10vw, 44px)/1 var(--font-display); letter-spacing: -.02em; }
.lcard-unit { font-size: 15px; opacity: .92; }
.lcard-sub { font-size: 13px; opacity: .9; margin-top: 4px; min-height: 1.2em; }
.lcard-foot { margin-top: 10px; font-size: 13px; opacity: .95; }
.lcard-foot .holder { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard-foot .mono { letter-spacing: .1em; flex: none; }

/* ---------- код для кассы: всегда чёрное на белом, иначе сканер не прочитает ---------- */
.scan {
  background: #ffffff; color: #111;
  border-radius: var(--r-lg);
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 1px solid var(--line);
}
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.scan .seg { background: #eef0ef; }
.scan .seg button { color: #4b5350; }
.scan .seg button[aria-selected="true"] { background: #fff; color: #111; }
.scan .seg button:focus-visible { outline-color: #D40019; }
.seg button[disabled] { opacity: .45; cursor: default; }
.scan-code { width: 100%; display: flex; justify-content: center; min-height: 120px; align-items: center; }
.scan-code svg { display: block; width: 100%; height: auto; }
.scan-code.is-ean svg { max-width: 300px; }
.scan-code.is-qr svg { max-width: 190px; }
.scan-num { font-size: 15px; color: #111; overflow-wrap: anywhere; text-align: center; }
.scan-num.is-long { font-size: 12.5px; letter-spacing: .02em; }
.scan-hint { margin: 0; font-size: 13px; color: #4f5855; text-align: center; }

/* ---------- счета ---------- */
.acc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.acc { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.acc:first-child { border-top: 0; padding-top: 2px; }
.acc.is-link { display: block; padding: 0; }
.acc-a { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 11px 0; color: inherit; text-decoration: none; border-radius: 8px; }
.acc:first-child .acc-a { padding-top: 2px; }
.acc-a .chev { align-self: center; margin-left: -4px; }
.acc-name { font-weight: 500; min-width: 0; flex: 1 1 auto; overflow-wrap: break-word; }
.acc-bal { font: 700 17px/1.2 var(--font-display); white-space: nowrap; flex: none; margin-left: auto; }

/* ---------- операции ---------- */
.tx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tx-item { border-top: 1px solid var(--line); }
.tx-item:first-child { border-top: 0; }
.tx { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 11px 0; }
a.tx { color: inherit; text-decoration: none; border-radius: 8px; }
a.tx:hover .tx-title { color: var(--accent); }
.tx.is-link { grid-template-columns: minmax(0, 1fr) auto 16px; }
.tx.is-link .tx-amount, .tx.is-link .tx-pts { grid-column: 2; }
.tx.is-link .chev { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.chev { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tx-title { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.tx-sub { font-size: 12px; color: var(--muted); grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
.tx-sub .sub-line { display: block; }
.tx-amount { text-align: right; font-weight: 500; white-space: nowrap; }
.tx-pts { text-align: right; font-size: 13px; font-weight: 600; grid-column: 2; display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.tx-pts .gain { color: var(--gain); }
.tx-pts .spend { color: var(--spend); }
.tx-empty { font-size: 14px; color: var(--muted); display: block; grid-column: 1 / -1; }
.history-sum { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.history-sum div { background: var(--surface); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.history-sum b { font: 700 18px/1.2 var(--font-display); overflow-wrap: anywhere; }
.history-sum span { font-size: 12px; color: var(--muted); }
.day-group { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.day-group h3 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 8px 0 0; }
.day-group .tx-list { background: var(--surface); border-radius: var(--r-lg); padding: 0 16px; }

/* ---------- акции ---------- */
.offers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.offer { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.offer-img { display: block; width: 100%; height: auto; background: #fff; }
.offer-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.offer-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.tag.quiet { background: transparent; color: var(--muted); padding-left: 0; }
.tag.urgent { background: transparent; color: var(--spend); padding-left: 0; }
.offer h3 { margin: 0; font-size: 17px; font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; }
.offer p { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.offer p.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.link-btn { align-self: flex-start; border: 0; background: none; padding: 4px 0; color: var(--accent); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.offer.is-product { flex-direction: row; align-items: stretch; }
.offer.is-product .offer-img { width: 96px; flex: none; object-fit: contain; align-self: center; margin: 12px 0 12px 12px; border-radius: 12px; }
.offer.is-product .offer-body { padding-left: 14px; flex: 1; }

/* ---------- кнопки и формы ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 13px 18px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 16px; font-weight: 500; cursor: pointer; text-align: center; }
.btn-ghost.danger { color: var(--spend); }
.props { margin: 0; background: var(--surface); border-radius: var(--r-lg); padding: 4px 16px; }
.props > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.props > div:first-child { border-top: 0; }
.props dt { color: var(--muted); flex: none; }
.props dd { margin: 0; font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.profile-grid { display: flex; flex-direction: column; gap: 16px; }
.install p { margin: 0; color: var(--muted); font-size: 14px; }
.install .btn { align-self: flex-start; }
.profile-grid .col > .btn-ghost { width: 100%; }

.view-login { padding-top: 12px; gap: 14px; max-width: 440px; margin: 0 auto; width: 100%; }
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; }
.login-logo { height: 30px; width: auto; }
.view-login form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 17px; color: var(--ink); width: 100%;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field input[name="code"] { font-family: var(--font-mono); letter-spacing: .3em; font-size: 20px; }
.field input[name="code"]::placeholder { font-family: var(--font-body); letter-spacing: 0; font-size: 17px; }
.form-error { margin: 0; color: var(--spend); font-size: 14px; }
.form-info { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- нижняя панель ---------- */
.tabbar {
  position: sticky; bottom: 0; z-index: 5; order: 3;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; text-decoration: none; color: var(--muted);
  font-size: 11px; font-weight: 500; border-radius: 10px; min-width: 0;
}
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.1; }
.side-user { display: none; order: 5; }
.app.is-login .side, .app.is-boot .side { display: none; }
.app.is-login .offline-bar { display: none; }

/* ---------- тост и демо-плашка ---------- */
.toast {
  position: fixed; z-index: 20;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%);
  max-width: min(calc(100% - 32px), 420px);
  padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: var(--bg);
  font-size: 14px; text-align: center;
}
.app.is-login .toast { bottom: 24px; }
.demo-ribbon {
  position: sticky; top: 0; z-index: 30;
  background: #b00014; color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: 4px 12px;
}

@media (min-width: 560px) {
  .history-sum { grid-template-columns: repeat(4, 1fr); }
  .view-login { background: var(--surface); border-radius: var(--r-lg); padding: 28px; margin-top: 6vh; box-shadow: var(--shadow); }
  .app.is-login { justify-content: center; }
  .field input { background: var(--bg); }
}

/* ---------- портал: компьютер ---------- */
@media (min-width: 1024px) {
  :root { --col: 1240px; }
  .app {
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
  }
  .side {
    display: flex; flex-direction: column; gap: 22px;
    grid-column: 1; grid-row: 1 / span 2;
    position: sticky; top: 0;
    height: 100vh; height: 100dvh;
    padding: 28px 16px 20px;
    border-right: 1px solid var(--line);
    overflow: hidden auto;
  }
  .topbar { position: static; padding: 0 12px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; flex-direction: column; align-items: flex-start; gap: 10px; }
  .logo { height: 26px; }
  .group-chip { max-width: 100%; }
  .tabbar { position: static; display: flex; flex-direction: column; gap: 4px; padding: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: 15px; }
  .tabbar a:hover { background: var(--bg); }
  .tabbar a[aria-current="page"] { background: var(--accent-soft); }
  .side-user { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding: 12px; border-radius: var(--r-md); background: var(--bg); font-size: 13px; min-width: 0; }
  .side-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user span { color: var(--muted); font-size: 12px; }
  .offline-bar { grid-column: 2; grid-row: 1; margin: 20px 32px 0; }
  .views { grid-column: 2; grid-row: 2; padding-top: 28px; padding-bottom: 40px; }
  .offline-bar:not([hidden]) + .views { padding-top: 16px; }
  .app { align-items: stretch; }
  .view-title { font-size: 28px; margin-top: 0; }
  .view-card { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .views { padding-left: 24px; padding-right: 24px; }
  .view-card .col-a { position: sticky; top: 28px; }
  .view-card .col-b { gap: 20px; }
  .lcard-points { font-size: 44px; }
  .history-sum { gap: 12px; }
  .day-group { max-width: 860px; }
  .day-group .tx-list { padding: 0 24px; }
  .offers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .offer.is-banner, .offer.is-personal { grid-column: 1 / -1; }
  .offer.is-product .offer-img { width: 120px; }
  .profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .profile-grid .col { gap: 14px; }
  .toast { bottom: 28px; left: calc(50% + var(--side) / 2); }
  .app.is-login { display: flex; }
  .view-login { margin-top: 10vh; }
}
@media (min-width: 1180px) {
  .views { padding-left: 32px; padding-right: 32px; }
}
@media (min-width: 1024px) and (max-width: 1179px) {
  .view-card { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; }
}
/* ============ этап 1: чек, экономия, бонусы, магазины, сообщения ============ */
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); margin-right: -6px; }
.bell:hover { background: var(--surface); }
.bell svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bell-count { position: absolute; top: 1px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font: 600 11px/18px var(--font-body); text-align: center; }
.back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: 32px; padding: 4px 10px 4px 0; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; border-radius: 8px; }
.back:hover { color: var(--accent); }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.view-receipt .view-title, .view-savings .view-title, .view-bonus .view-title, .view-messages .view-title, .view-program .view-title { margin-top: 0; }
.view-savings, .view-bonus, .view-messages, .view-program { max-width: 760px; }
.view-receipt { max-width: 1000px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title-row .link-btn { flex: none; }
.title-row .view-title { margin: 0; }
.state-load { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 0; }
.state-box p { margin: 0; color: var(--muted); }
.state-box .btn-ghost { align-self: flex-start; }
.li-state { list-style: none; grid-column: 1 / -1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-ghost.sm { padding: 9px 14px; font-size: 14px; }
a.btn-ghost { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-ghost.with-ico { display: inline-flex; align-items: center; gap: 8px; }
.btn-ghost.with-ico svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tx-amount.spend { color: var(--spend); }

/* карта: предупреждение, push-баннер, плашка экономии */
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.notice .warn-ico { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.push-banner { background: var(--accent-soft); }
.push-banner p { margin: 0; font-size: 14px; color: var(--ink); }
.saving-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); color: inherit; text-decoration: none; }
.saving-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--gain) 14%, var(--surface)); }
.saving-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--gain); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.saving-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.saving-label { font-size: 13px; color: var(--muted); }
.saving-text b { font: 700 19px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }

/* герой-карточки (экономия, бонусы) */
.sv-hero, .bn-hero {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--r-lg); color: #fff; box-shadow: var(--shadow);
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,.18), transparent 55%), linear-gradient(135deg, var(--card-a), var(--card-b));
}
.sv-cap, .bn-cap { font-size: 14px; opacity: .92; }
.sv-big { font: 700 clamp(30px, 9vw, 40px)/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sv-lead, .bn-sub { font-size: 13px; opacity: .9; }
.bn-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bn-big b { font: 700 clamp(34px, 10vw, 46px)/1.05 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bn-big span { font-size: 16px; opacity: .92; }
.sv-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sv-tiles div { background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sv-tiles b { font: 700 18px/1.2 var(--font-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sv-tiles span { font-size: 12px; color: var(--muted); }
#savingsBody, #bonusBody, #messagesBody, #programBody { display: flex; flex-direction: column; gap: 16px; }
.pg-lead { margin: -4px 0 0; color: var(--muted); max-width: 60ch; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; height: 190px; }
.bar { display: flex; flex-direction: column; align-items: center; min-width: 0; height: 100%; }
.bar-track { position: relative; flex: 1; width: 100%; margin-top: 18px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.bar-fill { display: block; width: 72%; max-width: 34px; height: var(--h, 0%); border-radius: 5px 5px 0 0; background: color-mix(in srgb, var(--accent) 42%, var(--surface)); }
.bar.is-now .bar-fill { background: var(--accent); }
.bar.is-zero .bar-fill { height: 2px; border-radius: 0; background: var(--line); }
.bar-val { position: absolute; bottom: var(--h, 0%); left: 0; right: 0; text-align: center; font-size: 10px; line-height: 1.2; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-label { margin-top: 5px; font-size: 10.5px; color: var(--muted); text-transform: capitalize; white-space: nowrap; }
.bar.is-now .bar-label { color: var(--ink); font-weight: 600; }
.sv-note { margin: 0; font-size: 13px; color: var(--muted); }

/* бонусы */
.bn-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--bg); }
.bn-ico svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bn-ico.bn-accrual { background: color-mix(in srgb, var(--gain) 14%, var(--surface)); }
.bn-ico.bn-accrual svg { stroke: var(--gain); }
.bn-ico.bn-redeem svg, .bn-ico.bn-expire svg { stroke: var(--spend); }
.bn-row { grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
.bn-row.is-link { grid-template-columns: 36px minmax(0, 1fr) auto 16px; }
.bn-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bn-text .tx-sub { grid-column: auto; }
.bn-amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.bn-amt.gain { color: var(--gain); }
.bn-amt.spend { color: var(--spend); }
.bn-row.is-link .chev { grid-column: auto; grid-row: auto; }
.bn-empty { margin: 0; color: var(--muted); }
.bn-history .tx-list, .bn-expiring .tx-list { margin-top: -4px; }

/* электронный чек */
.rc-grid { display: flex; flex-direction: column; gap: 16px; }
.rc-main-col, .rc-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rc-head h2 { font-size: 18px; overflow-wrap: anywhere; }
.rc-when { margin: 0; color: var(--ink); }
.rc-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--muted); }
.rc-meta span { white-space: nowrap; }
.rc-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rc-line { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.rc-line:first-child { border-top: 0; padding-top: 4px; }
.thumb { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb.is-empty { background: var(--bg); }
.thumb.is-empty svg { width: 24px; height: 24px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.rc-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rc-name { font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; line-height: 1.3; }
.rc-calc { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-old { margin-left: 8px; text-decoration: line-through; opacity: .85; }
.rc-main .tag { align-self: flex-start; margin-top: 2px; }
.rc-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-sum { margin: 0; display: flex; flex-direction: column; }
.rc-sum > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; }
.rc-sum dt { color: var(--muted); }
.rc-sum dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.rc-sum .is-gain dd { color: var(--gain); }
.rc-sum .is-spend dd { color: var(--spend); }
.rc-sum .is-total { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.rc-sum .is-total dt { color: var(--ink); font-weight: 600; }
.rc-sum .is-total dd { font: 700 20px/1.2 var(--font-display); }

/* магазины */
.stores-bar { display: flex; }
.stores { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.store { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); min-width: 0; }
.store.is-mine { box-shadow: inset 0 0 0 2px var(--accent); }
.store-top { display: flex; align-items: center; gap: 8px; }
.store-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1; }
.store-name h3 { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.store-dist { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.star { display: grid; place-items: center; width: 40px; height: 40px; flex: none; margin: -6px -8px -6px 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.star:hover { background: var(--bg); }
.star svg { width: 24px; height: 24px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linejoin: round; }
.star[aria-pressed="true"] svg { fill: var(--accent); stroke: var(--accent); }
.store-addr { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.store-status { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.store-status .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--muted); }
.store-status.is-open { color: var(--gain); }
.store-status.is-open .dot { background: var(--gain); }
.store-status.is-closed .dot { background: var(--spend); }
.store-hours { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.store-hours.is-main { font-size: 14px; color: var(--ink); }
.store-actions { display: flex; gap: 8px; margin-top: 6px; }
.store-actions .btn-ghost { flex: 1; }

/* сообщения */
.msgs { list-style: none; margin: 0; padding: 0 16px; background: var(--surface); border-radius: var(--r-lg); }
.msg-item { border-top: 1px solid var(--line); }
.msg-item:first-child { border-top: 0; }
.msg { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; width: 100%; padding: 14px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; border-radius: 8px; }
.msg-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); }
.msg-ico svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msg-ico.msg-bonus { background: color-mix(in srgb, var(--gain) 14%, var(--surface)); }
.msg-ico.msg-bonus svg { stroke: var(--gain); }
.msg-ico.msg-security, .msg-ico.msg-info { background: var(--bg); }
.msg-ico.msg-security svg, .msg-ico.msg-info svg { stroke: var(--muted); }
.msg-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg-title { font-weight: 500; overflow-wrap: anywhere; }
.msg.is-unread .msg-title { font-weight: 700; }
.msg-text { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.msg-when { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* профиль: уведомления, контакты, ссылка на «Как работает» */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.switch-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.switch-text p { margin: 0; font-size: 14px; color: var(--muted); }
.switch { position: relative; width: 52px; height: 30px; flex: none; border: 0; border-radius: 15px; background: var(--line); cursor: pointer; transition: background .15s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] .knob { transform: translateX(22px); }
.switch[disabled] { opacity: .5; cursor: default; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { border-top: 1px solid var(--line); }
.contact-list li:first-child { border-top: 0; }
.contact-a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; color: inherit; text-decoration: none; border-radius: 8px; }
.ct-label { color: var(--muted); flex: none; }
.ct-value { font-weight: 500; color: var(--accent); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.contact-a:hover .ct-value { text-decoration: underline; }
.link-row { flex-direction: row; align-items: center; justify-content: space-between; color: inherit; text-decoration: none; font-weight: 500; }
.link-row:hover { color: var(--accent); }
.pg-list { display: flex; flex-direction: column; gap: 12px; }
.pg-item { flex-direction: row; align-items: flex-start; gap: 14px; }
.pg-num { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 14px/1 var(--font-display); }
.pg-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pg-text p { margin: 0; color: var(--muted); }
.pg-text .link { align-self: flex-start; }

@media (min-width: 560px) {
  .sv-tiles { gap: 12px; }
}
@media (min-width: 1024px) {
  .topbar-right { width: 100%; justify-content: space-between; }
  .bell { margin-right: 0; }
  .stores { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .rc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
  .rc-side { position: sticky; top: 28px; }
  .bars { height: 220px; gap: 6px; }
  .bar-val { font-size: 11px; }
  .bar-label { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
