/* ============================================================
   AURA — Shell: rail bottom, popovers, modals, auth, theming
   Loaded on every page after styles.css.
   ============================================================ */

/* rail bottom: authed group + guest start */
.rail-bottom { width: 100%; }
/* allow two-word nav labels (e.g. Photo Sessions) to wrap cleanly */
.nav-item span {
  white-space: normal;
  text-align: center;
  line-height: 1.12;
  max-width: 62px;
}
.rail-authed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.credits {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
}
.credits:hover { color: var(--accent-2); }
.avatar-wrap {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  justify-content: center;
  margin-top: 4px;
  transition: transform .12s;
}
.avatar-wrap:hover { transform: scale(1.05); }
.avatar { transition: box-shadow .15s; }
.avatar-wrap:hover .avatar,
.avatar-wrap.open .avatar { box-shadow: 0 0 0 2px var(--bg-rail), 0 0 0 4px var(--accent-ring); }

.upgrade-btn .plan-name { display: inline-block; }

/* guest "Старт" button */
.start-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  padding: 12px 0;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 10px 26px -8px var(--accent-ring);
  transition: filter .15s, transform .1s, box-shadow .2s;
}
.start-btn:hover { filter: brightness(1.08); box-shadow: 0 14px 32px -8px var(--accent-ring); }
.start-btn:active { transform: scale(.96); }

[data-auth="out"] .rail-authed { display: none; }
[data-auth="out"] .start-btn { display: flex; }

/* ============================================================
   POPOVERS (More / Profile) — fixed, JS-positioned
   ============================================================ */
.pop {
  position: fixed;
  z-index: 120;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 7px;
  box-shadow: 0 28px 64px -20px rgba(0,0,0,.88), 0 4px 12px -6px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(6px) scale(.98);
  transform-origin: left bottom;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.pop.open { opacity: 1; transform: none; pointer-events: auto; }

.pop-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text-2);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.pop-item:hover { background: var(--surface-2); color: var(--text); }
.pop-item svg { width: 19px; height: 19px; stroke-width: 1.7; color: var(--text-3); flex: 0 0 auto; }
.pop-item:hover svg { color: var(--accent-2); }
.pop-item .pi-sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3); margin-top: 1px; }
.pop-item .pi-main { display: flex; flex-direction: column; }
.pop-item .pi-tag {
  margin-left: auto;
  font-size: 9px; font-weight: 800; letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent-2);
  padding: 3px 6px; border-radius: 6px;
}
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* profile popover header */
.pop-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 9px 12px;
}
.pop-user .avatar { width: 40px; height: 40px; font-size: 16px; }
.pop-user .pu-meta { display: flex; flex-direction: column; min-width: 0; }
.pop-user .pu-name { font-weight: 700; font-size: 14.5px; color: var(--text); }
.pop-user .pu-mail { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* theme segmented control inside popover */
.pop-theme { padding: 8px 9px 4px; }
.pop-theme .pt-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 7px; }
.theme-seg {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
}
.theme-seg button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.theme-seg button svg { width: 16px; height: 16px; }
.theme-seg button:hover { color: var(--text); }
.theme-seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px -3px rgba(0,0,0,.5); }
.theme-seg button.active svg { color: var(--accent-2); }
.pop-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; }
.pop-theme-lbl { font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.pop-theme .theme-seg { flex-shrink: 0; }
.pop-theme .theme-seg button { padding: 6px 12px; font-size: 12.5px; }

.pop-item.danger { color: #ff8a8a; }
.pop-item.danger:hover { background: rgba(255,90,90,.12); color: #ff9b9b; }
.pop-item.danger svg { color: #ff8a8a; }

/* ============================================================
   MODAL SHELL (Settings / Plans / Auth)
   ============================================================ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 6, 9, 0.62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: 0 50px 120px -34px rgba(0,0,0,.92);
  width: 100%;
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(14px) scale(.985);
  transition: transform .2s ease;
}
.sheet-backdrop.open .sheet { transform: none; }

.sheet-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 6;
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 0;
  background: var(--surface-2);
  color: var(--text-2);
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 4;
  transition: background .14s, color .14s;
}
.sheet-close:hover { background: var(--surface-3); color: var(--text); }
.sheet-close svg { width: 17px; height: 17px; }

/* ---------- SETTINGS modal (tabbed) ---------- */
#sheet-settings .sheet { max-width: 980px; height: auto; max-height: 94vh; flex-direction: row; }
.set-nav {
  flex: 0 0 248px;
  background: var(--bg-rail);
  border-right: 1px solid var(--line);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.set-nav-head {
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px 20px;
}
.set-nav-head .avatar { width: 42px; height: 42px; font-size: 16px; }
.set-nav-head .snh-meta { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.set-nav-head .snh-name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-nav-head .snh-plan { font-size: 12px; color: var(--accent-2); font-weight: 700; white-space: nowrap; }
.set-tab {
  display: flex; align-items: center; gap: 11px;
  border: 0; background: transparent;
  color: var(--text-2);
  font-family: inherit; font-weight: 600; font-size: 14px;
  padding: 11px 12px; border-radius: 10px; cursor: pointer;
  text-align: left;
  transition: background .14s, color .14s;
}
.set-tab svg { width: 18px; height: 18px; color: var(--text-3); }
.set-tab:hover { background: var(--surface-2); color: var(--text); }
.set-tab.active { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.set-tab.active svg { color: var(--accent-2); }

.set-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 40px 40px 44px;
  position: relative;
}
.set-pane { display: none; animation: asstIn .18s ease; }
.set-pane.active { display: block; }
.set-pane h2 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700; margin: 0 0 4px;
}
.set-pane .pane-sub { color: var(--text-3); font-size: 13.5px; margin: 0 0 26px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.field input[type="text"], .field input[type="email"] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  padding: 12px 14px;
  outline: 0;
  transition: border-color .14s, box-shadow .14s;
}
.field input:focus { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }

.set-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.set-card.row { display: flex; align-items: center; gap: 16px; }
.set-card .sc-grow { flex: 1 1 auto; min-width: 0; }
.set-card h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.set-card p { font-size: 13px; color: var(--text-3); margin: 0; line-height: 1.5; }

.plan-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 800; letter-spacing: .03em;
  background: var(--accent-soft); color: var(--accent-2);
  padding: 5px 11px; border-radius: 99px;
  white-space: nowrap; flex: 0 0 auto;
}
.plan-badge svg { flex: 0 0 auto; }
.balance-big { display: flex; align-items: center; gap: 10px; }
.balance-big .coin { width: 26px; height: 26px; }
.balance-big .bb-num { font-family: var(--font-display); font-size: 30px; font-weight: 700; }

.btn {
  border: 0; border-radius: 11px;
  font-family: inherit; font-weight: 700; font-size: 13.5px;
  padding: 11px 20px; cursor: pointer;
  transition: filter .14s, background .14s, transform .1s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: #ffffff; color: #111111; box-shadow: 0 10px 26px -8px rgba(0,0,0,.25); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 14px 32px -8px var(--accent-ring); }
.btn.ghost { background: var(--surface-3); color: var(--text); }
.btn.ghost:hover { background: var(--line-strong); }
.btn.lime { background: var(--upgrade); color: #142400; }
.btn.lime:hover { filter: brightness(1.06); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* linked cards */
.card-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.card-chip {
  width: 44px; height: 30px; border-radius: 6px; flex: 0 0 auto;
  background: linear-gradient(135deg, #3a3a46, #1c1c22);
  border: 1px solid var(--line-strong);
  position: relative;
}
.card-chip::after { content:""; position:absolute; left:6px; top:10px; width:14px; height:10px; border-radius:2px; background: linear-gradient(135deg,#f0d97a,#c79a2e); }
.card-item .ci-num { font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.card-item .ci-exp { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card-item .ci-del { margin-left: auto; background: transparent; border: 0; color: var(--text-3); cursor: pointer; padding: 6px; border-radius: 8px; }
.card-item .ci-del:hover { color: #ff8a8a; background: rgba(255,90,90,.1); }
.card-item .ci-del svg { width: 17px; height: 17px; }

/* referral */
.ref-link {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  border-radius: 12px; padding: 6px 6px 6px 16px; margin-bottom: 18px;
}
.ref-link code { flex: 1 1 auto; font-family: var(--font-ui); font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-stats { display: flex; gap: 14px; }
.ref-stat { flex: 1 1 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.ref-stat .rs-num { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.ref-stat .rs-lbl { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- PLANS modal ---------- */
#sheet-plans .sheet { max-width: 1040px; }
.plans-head { text-align: center; padding: 38px 40px 8px; }
.plans-head h2 { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin: 0 0 8px; }
.plans-head p { color: var(--text-3); font-size: 14.5px; margin: 0; }
.plans-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  padding: 22px 28px 40px;
}
.plan {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px;
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: 0 10px 30px -20px rgba(0,0,0,.6);
}
.plan.featured { border-color: var(--accent-ring); box-shadow: 0 0 0 1px var(--accent-ring), 0 26px 60px -24px var(--accent-ring); }
.plan .plan-pop {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff;
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 99px;
}
.plan .plan-name2 { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.plan .plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin: 14px 0 4px; }
.plan .plan-price b { font-family: var(--font-display); font-size: 38px; font-weight: 700; line-height: 1; white-space: nowrap; }
.plan .plan-price span { color: var(--text-3); font-size: 13.5px; font-weight: 600; }
.plan .plan-tag { color: var(--text-3); font-size: 13px; min-height: 20px; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 20px; display: flex; flex-direction: column; gap: 9px; }
.plan li { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--text-2); line-height: 1.4; }
.plan li svg { width: 16px; height: 16px; color: var(--accent-2); flex: 0 0 auto; margin-top: 1px; }
.plan .btn { margin-top: auto; width: 100%; text-align: center; padding: 13px; }
.plan.current .btn { background: var(--surface-3); color: var(--text-3); cursor: default; }

/* ============================================================
   AUTH modal
   ============================================================ */
#sheet-auth .sheet { max-width: 412px; }
.auth-wrap { padding: 40px 38px 34px; text-align: center; max-height: calc(100vh - 56px); overflow-y: auto; }
.auth-logo {
  width: 56px; height: 56px; border-radius: 17px; margin: 0 auto 18px;
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 20%, var(--accent-2), var(--accent) 60%, #3a2a8c);
  box-shadow: 0 14px 36px -8px var(--accent-ring), 0 2px 8px -4px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.3);
}
.auth-logo svg { width: 32px; height: 32px; }
.auth-wrap h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.auth-wrap .auth-sub { color: var(--text-3); font-size: 14px; margin: 0 0 26px; }

.auth-providers { display: flex; flex-direction: column; gap: 10px; }
.auth-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  white-space: nowrap;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  font-family: inherit; font-weight: 700; font-size: 14.5px;
  padding: 13px 16px;
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .08s;
}
.auth-btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-3); box-shadow: 0 8px 22px -16px rgba(0,0,0,.7); }
.auth-btn:active:not(:disabled) { transform: scale(.99); }
.auth-btn:disabled { opacity: .42; cursor: not-allowed; }
.auth-btn .prov-ico {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.auth-btn .prov-ico svg { width: 17px; height: 17px; }
.prov-ico.yandex { background: #fc3f1d; color: #fff; }
.prov-ico.google { background: #fff; color: #4285f4; border: 1px solid var(--line-strong); }
.prov-ico.tg { background: #29a9ea; color: #fff; }
.prov-ico.mail { background: var(--surface-3); color: var(--accent-2); }
.auth-btn .ab-chev { margin-left: auto; color: var(--text-3); width: 16px; height: 16px; }
.auth-btn .ab-soon { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--text-3); background: var(--surface-3); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.auth-btn-soon { opacity: .7; }
.auth-btn-soon .prov-ico { opacity: .82; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-3); font-size: 12px; font-weight: 600; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1 1 0; height: 1px; background: var(--line); }

/* email expand */
.auth-email { display: none; flex-direction: column; gap: 10px; margin-top: 4px; text-align: left; }
.auth-email.open { display: flex; }
.auth-email input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); font-family: inherit; font-size: 14.5px;
  padding: 13px 15px; outline: 0;
}
.auth-email input:focus { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }

/* consent checkbox */
.auth-consent {
  display: flex; align-items: flex-start; gap: 11px;
  margin-top: 22px; text-align: left;
  cursor: pointer;
}
.auth-consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-consent .box {
  width: 20px; height: 20px; border-radius: 6px; flex: 0 0 auto; margin-top: 1px;
  border: 1.6px solid var(--line-strong);
  display: grid; place-items: center;
  color: transparent;
  transition: background .14s, border-color .14s, color .14s;
}
.auth-consent .box svg { width: 13px; height: 13px; stroke-width: 3; }
.auth-consent input:checked + .box { background: #ffffff; border-color: var(--accent); color: #111111; }
.auth-consent input:focus-visible + .box { box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-consent .ac-text { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.auth-consent .ac-text a { color: var(--accent-2); text-decoration: none; }
.auth-consent .ac-text a:hover { text-decoration: underline; }

.auth-foot { margin-top: 22px; font-size: 12.5px; color: var(--text-3); }
.auth-foot a { color: var(--text-2); text-decoration: none; font-weight: 700; }
.auth-foot a:hover { color: var(--text); }

/* tiny toast */
.aura-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line-strong);
  padding: 12px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.8);
  opacity: 0; pointer-events: none; z-index: 400;
  transition: opacity .2s, transform .2s;
}
.aura-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- cookie notice ---------- */
.cookie-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(24px);
  z-index: 180;
  width: min(620px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 28px 64px -22px rgba(0,0,0,.8), 0 4px 12px -6px rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.cookie-bar.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); flex: 1 1 auto; }
.cookie-bar a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cookie-ok {
  flex: 0 0 auto;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 22px;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.cookie-ok:hover { filter: brightness(1.08); }
.cookie-ok:active { transform: scale(.97); }
@media (max-width: 560px) {
  .cookie-bar { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ============================================================
   LIGHT THEME  (soft, never pure-white — avoids glare)
   ============================================================ */
:root[data-theme="light"] {
  --bg: #ececee;
  --bg-rail: #f7f7f8;
  --surface: #fafafa;
  --surface-2: #f1f1f3;
  --surface-3: #e7e7ea;
  --line: rgba(20, 20, 28, 0.10);
  --line-strong: rgba(20, 20, 28, 0.17);
  --text: #1b1b22;
  --text-2: #585862;
  --text-3: #8a8a94;
  --accent-soft: rgba(124, 92, 255, 0.13);
}
:root[data-theme="light"] body { background: var(--bg); }
:root[data-theme="light"] .rail { box-shadow: 1px 0 0 var(--line); }
:root[data-theme="light"] .nav-item:hover { background: var(--surface-2); }
:root[data-theme="light"] .badge-new { background: #16161b; color: #fff; }

/* dialogs / overlays — softer shadows, darker scrim */
:root[data-theme="light"] .sheet-backdrop { background: rgba(24,24,32,.42); }
:root[data-theme="light"] .pop { box-shadow: 0 24px 60px -22px rgba(20,20,30,.30); }
:root[data-theme="light"] .sheet { box-shadow: 0 40px 100px -34px rgba(20,20,30,.40); }
:root[data-theme="light"] .ctl-menu,
:root[data-theme="light"] .set-menu { box-shadow: 0 20px 50px -20px rgba(20,20,30,.32); }
:root[data-theme="light"] .prov-ico.mail { background: #e7e7ea; }
:root[data-theme="light"] .card-chip { background: linear-gradient(135deg,#c9c9d2,#e6e6ec); }
:root[data-theme="light"] .pop-item.danger:hover { background: rgba(220,60,60,.10); }

/* hardcoded-dark surfaces that must lighten
   (we leave .prompt-bar & .tool-ico dark — they sit over hero imagery) */
:root[data-theme="light"] .composer {
  background: var(--surface);
  box-shadow: 0 16px 40px -26px rgba(20,20,30,.5);
}

/* white-text-on-pale-purple active states are unreadable in light → use ink */
:root[data-theme="light"] .dim-cell.active,
:root[data-theme="light"] .num-cell.active { color: var(--text); }
:root[data-theme="light"] .dim-cell.active .frame { color: var(--accent); }

/* ============================================================
   PROMO CODE BOX (plans + tokens)
   ============================================================ */
.promo-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 8px 8px 8px 14px;
}
.promo-box .promo-ico { display: grid; place-items: center; color: var(--text-3); flex: 0 0 auto; }
.promo-box .promo-ico svg { width: 18px; height: 18px; }
.promo-box input {
  flex: 1 1 0; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--text); font-family: inherit; font-size: 14.5px;
  text-transform: uppercase; letter-spacing: .03em;
}
.promo-box input::placeholder { color: var(--text-3); text-transform: none; letter-spacing: 0; }
.promo-apply {
  flex: 0 0 auto;
  background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text);
  font-family: inherit; font-weight: 700; font-size: 13.5px;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.promo-apply:hover { background: var(--accent-soft); border-color: var(--accent-ring); }
.promo-msg { flex: 1 0 100%; font-size: 12.5px; font-weight: 600; padding-left: 2px; }
.promo-msg.ok { color: var(--accent-2); }
.promo-msg.err { color: #ef7a7a; }
.promo-msg:empty { display: none; }

.plans-promo { max-width: 460px; margin: 0 auto 26px; }
.plan { position: relative; }
.plan-save {
  position: absolute; top: 14px; right: 14px;
  background: #ffffff; color: #111111;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 99px;
}
.plan-price s { color: var(--text-3); font-weight: 600; margin-right: 4px; }

/* ============================================================
   TOKEN CALCULATOR
   ============================================================ */
.tokens-sheet { max-width: 540px; }
.tok-head { text-align: center; padding: 36px 36px 6px; }
.tok-head h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.tok-head p { color: var(--text-3); font-size: 14px; margin: 0 auto; max-width: 42ch; line-height: 1.5; }
.tok-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 22px 24px 6px; }
.tok-preset {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 14px 4px 11px; cursor: pointer; color: var(--text);
  transition: border-color .15s, background .15s, transform .08s;
}
.tok-preset:hover { border-color: var(--line-strong); }
.tok-preset:active { transform: scale(.97); }
.tok-preset.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-ring), 0 8px 22px -12px var(--accent-ring); }
.tok-preset .tp-num { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.tok-preset .tp-sub { font-size: 11.5px; color: var(--text-3); }
.tp-badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--line-strong);
  padding: 3px 8px; border-radius: 99px;
}
.tp-badge.save { background: #ffffff; color: #111111; border-color: transparent; }

.tok-slider-wrap { padding: 22px 30px 6px; }
.tok-slider-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.tok-slider-top span:first-child { font-size: 14px; font-weight: 600; color: var(--text-2); }
.tok-slider-top .tok-amount { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--text); }
.tok-slider-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: 8px; }
#tok-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 99px;
  background: var(--surface-3); outline: none; cursor: pointer;
}
#tok-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #ffffff; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: pointer;
}
#tok-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #ffffff; border: 3px solid #fff; cursor: pointer;
}
.tok-summary { margin: 18px 30px 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.ts-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.ts-row.disc { color: var(--accent-2); font-weight: 600; }
.ts-row.total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 3px; color: var(--text); font-weight: 800; font-size: 16px; }
.ts-row.total span:last-child { font-family: var(--font-display); }
.promo-box:not(.plans-promo) { margin: 16px 30px 0; }
.tok-buy { margin: 18px 30px 30px; width: calc(100% - 60px); padding: 14px; font-size: 16px; }

/* Светлая тема: мягкие тени вместо тёмных «грязных» (которые от dark-варианта) */
:root[data-theme="light"] .prompt-bar,
:root[data-theme="light"] .card,
:root[data-theme="light"] .feat-card,
:root[data-theme="light"] .assistant,
:root[data-theme="light"] .ps-card,
:root[data-theme="light"] .ps-bar,
:root[data-theme="light"] .bp-thumb,
:root[data-theme="light"] .tile { box-shadow: 0 4px 16px -10px rgba(30,30,60,.16) !important; }
:root[data-theme="light"] .tile:hover,
:root[data-theme="light"] .bp-card:hover .bp-thumb { box-shadow: 0 12px 30px -16px rgba(30,30,60,.22) !important; }
:root[data-theme="light"] .feat-card:hover { box-shadow: 0 14px 32px -16px rgba(30,30,60,.20) !important; }

/* ТОКЕНЫ: степпер − / + (вместо слайдера) */
.tok-stepper { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 22px 16px 6px; }
.tok-step { width: 62px; height: 62px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; transition: background .14s, border-color .14s, transform .08s; }
.tok-step:hover { background: var(--surface-3); border-color: var(--line-strong); }
.tok-step:active { transform: scale(.94); }
.tok-step:disabled { opacity: .35; cursor: not-allowed; }
.tok-step svg { width: 22px; height: 22px; }
.tok-step-mid { display: flex; flex-direction: column; align-items: center; min-width: 130px; }
.tok-step-mid .tok-amount { font-family: var(--font-display); font-size: 48px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.tok-step-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

/* ТАРИФЫ: переключатель период + радио-выбор + кнопка снизу */
.period-seg { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 0 0 14px; }
.period-seg button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; background: transparent; color: var(--text-2); font-family: inherit; font-weight: 700; font-size: 14px; padding: 10px; border-radius: 9px; cursor: pointer; transition: background .14s, color .14s; }
.period-seg button.active { background: var(--surface-3); color: var(--text); }
.period-save { background: var(--upgrade); color: #1a1a10; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 99px; }

.plan { padding-left: 48px; }
.plan-radio { position: absolute; top: 22px; left: 16px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); transition: border-color .15s; }
.plan.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 42px -22px var(--accent-ring); }
.plan.selected .plan-radio { border-color: var(--accent); }
.plan.selected .plan-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #ffffff; }

.plans-cta-wrap { position: sticky; bottom: 0; background: var(--surface); padding: 14px 0 2px; margin-top: 10px; border-top: 1px solid var(--line); }
.plans-cta { width: 100%; }
.plans-cta:disabled { opacity: .5; cursor: default; }
.plans-foot { text-align: center; font-size: 12px; color: var(--text-3); margin: 9px 0 0; }

/* НАСТРОЙКИ: стартовый дашборд (тариф, баланс, плитки) */
.set-hero { background: linear-gradient(135deg, rgba(124,92,255,.20), var(--surface-2)); border: 1px solid var(--accent-ring); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.sh-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sh-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.sh-plan { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; margin-bottom: 8px; }
.sh-sub { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.sh-sub b { color: var(--text); }

.set-bal { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.sb-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.set-bal .balance-big { margin-bottom: 12px; }
.sb-progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.sb-progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.sb-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }

.set-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.set-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; text-align: left; font-family: inherit; transition: background .14s, border-color .14s, transform .08s; }
.set-tile:hover { background: var(--surface-3); border-color: var(--line-strong); }
.set-tile:active { transform: scale(.98); }
.set-tile svg { width: 24px; height: 24px; color: var(--accent-2); margin-bottom: 6px; }
.set-tile b { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); }
.set-tile span { font-size: 12px; color: var(--text-3); }

/* ТАРИФЫ — десктоп: компактные переключатель и кнопка, скролл карточек */
#sheet-plans .sheet { display: flex; flex-direction: column; max-height: calc(100vh - 48px); overflow-y: auto; }
#sheet-plans .period-seg { max-width: 360px; margin-left: auto; margin-right: auto; }
#sheet-plans .plans-grid { overflow: visible; flex: 0 0 auto; }
#sheet-plans .plan { min-width: 0; }
#sheet-plans .plans-cta-wrap { flex: 0 0 auto; }
.plans-cta { max-width: 440px; margin-left: auto; margin-right: auto; display: block; }
.plan ul { flex-wrap: wrap; }

/* НАСТРОЙКИ: кнопка «назад» (только мобилка) + обёртка дашборда */
.set-back { display: none; align-items: center; gap: 6px; background: none; border: 0; color: var(--text-2); font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; padding: 0 0 18px; }
.set-back svg { width: 18px; height: 18px; flex: 0 0 auto; }
.set-back:hover { color: var(--text); }
.set-dash-row { display: contents; }   /* десктоп: блоки идут как были (друг под другом) */
/* страховка от побуквенного переноса в дашборде */
.set-hero, .set-bal, .set-tile { min-width: 0; }
.sh-plan, .set-tile b { overflow-wrap: normal; word-break: keep-all; }

/* НАСТРОЙКИ: бейдж тарифа не вылезает за карточку (Free/Studio) */
.set-hero { overflow: hidden; }
.set-hero .sh-top { min-width: 0; }
.set-hero .sh-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-hero .plan-badge { margin-right: 2px; }
.set-hero .plan-badge svg { width: 14px; height: 14px; }
/* заголовок Настройки виден только на мобилке */
.set-mtitle { display: none; }

/* ТАРИФЫ: карусель — десктоп показывает все 3 (стрелки скрыты) */
.plans-carousel { display: contents; }
.plans-arrow { display: none; }

/* ТАРИФЫ desktop: компактнее по высоте, чтобы влезало без вертикального скролла */
#sheet-plans .plans-head { padding-top: 40px; padding-bottom: 8px; }
#sheet-plans .plans-head p { margin: 6px 0 0; }
#sheet-plans .period-seg { margin-bottom: 12px; }
#sheet-plans .plans-promo { margin-bottom: 14px; }
#sheet-plans .plans-grid { padding-top: 4px; padding-bottom: 8px; }
#sheet-plans .plan ul { gap: 7px; }

/* НАСТРОЙКИ: бейдж тарифа в «Подписке» не вылезает за карточку */
.set-card { overflow: hidden; }
.set-card .plan-badge { margin-right: 2px; }
.set-card .plan-badge svg { width: 14px; height: 14px; }
/* пояснение про автопривязку карты */
.cards-note { font-size: 13px; color: var(--text-3); line-height: 1.5; padding: 4px 2px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.card-dots { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.card-unbind { flex: none; padding: 8px 14px; font-size: 13px; }
.cards-empty { font-size: 14px; color: var(--text-3); padding: 14px 16px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 14px; margin-bottom: 12px; }
.plan-status { font-size: 14px; color: var(--text-3); margin: 2px 0 0; }

/* ТОКЕНЫ desktop: блок чуть шире + читаемые компактные чипы (5 в ряд) */
#sheet-tokens .sheet { max-width: 600px; }
.tok-preset .tp-num { font-size: 18px; font-weight: 800; }
.tok-preset .tp-sub { font-size: 10.5px; }
.tok-preset .tp-badge { display: none; }   /* бейджи скидок в узких чипах мешают — убираем */

/* НАСТРОЙКИ desktop: контент ниже крестика (крестик не липнет к шейпу тарифа) */
@media (min-width: 821px) {
  #sheet-settings .set-body { padding-top: 52px; }
}

/* ── Виджет уведомлений (колокольчик) ── */
.mn-bell-wrap { position: fixed; top: 16px; right: 18px; z-index: 150; }
.mn-bell { position: relative; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2, rgba(255,255,255,.05)); border: 1px solid var(--line, rgba(255,255,255,.08)); color: var(--text-2, #a6a6b0); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mn-bell:hover { color: var(--text, #f4f4f6); border-color: var(--line-strong, rgba(255,255,255,.14)); }
.mn-bell svg { width: 19px; height: 19px; transform-origin: 50% 4px; }
.mn-bell.mn-ring svg { animation: mnRing .8s ease; }
@keyframes mnRing {
  0%, 100% { transform: rotate(0); }
  10%, 30%, 50% { transform: rotate(11deg); }
  20%, 40%, 60% { transform: rotate(-11deg); }
  70% { transform: rotate(6deg); }
  80% { transform: rotate(-6deg); }
}
/* красный бейдж с цифрой */
.mn-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff3b5c; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg, #08080b); }
.mn-pop { position: absolute; top: 50px; right: 0; width: 340px; max-width: 88vw; background: var(--surface, #15151a); border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 16px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.7); overflow: hidden; }
.mn-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); font-weight: 600; font-size: 14px; }
.mn-pop-actions { display: flex; gap: 12px; }
.mn-readall, .mn-clearall { background: none; border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; padding: 0; }
.mn-readall { color: var(--accent-2, #9d7bff); }
.mn-clearall { color: var(--text-3, #6f6f7a); }
.mn-clearall:hover { color: var(--text-2, #a6a6b0); }
.mn-list { max-height: 400px; overflow-y: auto; }
.mn-empty { padding: 28px 16px; text-align: center; color: var(--text-3, #6f6f7a); font-size: 13px; }
.mn-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line, rgba(255,255,255,.06)); color: inherit; transition: background .15s; }
.mn-item:hover { background: rgba(255,255,255,.03); }
.mn-item.unread { background: rgba(124,92,255,.07); }
.mn-ico { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.06); color: var(--text-2); margin-top: 1px; }
.mn-ico svg { width: 16px; height: 16px; }
.mn-item-main { flex: 1; min-width: 0; cursor: pointer; }
.mn-item-t { font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.mn-item.unread .mn-item-t::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #ffffff; margin-right: 6px; vertical-align: middle; }
.mn-item-b { font-size: 12.5px; color: var(--text-2, #a6a6b0); line-height: 1.4; }
.mn-item-time { font-size: 11px; color: var(--text-3, #6f6f7a); margin-top: 4px; }
.mn-item-x { flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; background: none; border: none; color: var(--text-3, #6f6f7a); font-size: 17px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.mn-item:hover .mn-item-x { opacity: 1; }
.mn-item-x:hover { background: rgba(255,90,122,.15); color: #ff5a7a; }

/* ── Мобильная панель «Ещё» (плавающая, выезжает слева) ── */
.sheet-extra-side .sheet-extra-drawer {
  position: fixed; top: 10px; left: 12px; bottom: 10px;
  width: calc(100vw - 24px); max-width: 460px;
  margin: 0; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 0; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  transform: translateX(calc(-100% - 20px)); transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 24px 0 70px -24px rgba(0,0,0,.75);
}
.sheet-extra-side .sheet-extra-drawer::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sheet-extra-side.open .sheet-extra-drawer { transform: translateX(0); }
/* шапка: бренд по центру, крестик справа без шейпа */
.exd-top { position: relative; display: flex; align-items: center; justify-content: center; padding: 23px 14px 12px; }
.exd-brand { font-family: var(--font-display, inherit); font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.exd-close { position: absolute; right: 12px; top: 18px; width: 34px; height: 34px; border-radius: 10px; background: none; border: none; color: var(--text-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.exd-close:hover { color: var(--text); }
.exd-close svg { width: 20px; height: 20px; }
.exd-list { display: flex; flex-direction: column; padding: 4px 12px 22px; gap: 2px; }
.exd-item { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px; background: none; border: none; cursor: pointer; text-decoration: none; color: var(--text); font-size: 15px; font-weight: 500; font-family: inherit; width: 100%; text-align: left; transition: background .15s; }
.exd-item:hover { background: var(--surface-2); }
.exd-item svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--text-2); }
.exd-item.disabled { opacity: .5; cursor: default; }
.exd-item.disabled:hover { background: none; }
.exd-soon { margin-left: auto; font-size: 11px; font-style: normal; color: var(--text-3); background: var(--surface-3); padding: 3px 9px; border-radius: 20px; }
.exd-sep { height: 1px; background: var(--line); margin: 8px 12px; }
/* ── Расширенная шторка «Ещё»: заголовки групп + двухстрочные пункты ── */
.exd-head { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: 14px 14px 6px; }
.exd-item .exd-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.exd-item .exd-txt b { font-weight: 600; font-size: 14.5px; line-height: 1.15; color: var(--text); }
.exd-item .exd-txt small { font-size: 12px; line-height: 1.2; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exd-badge { margin-left: auto; flex-shrink: 0; font-size: 9px; font-weight: 800; letter-spacing: .05em;
  border-radius: 6px; padding: 3px 6px; line-height: 1.2; align-self: center; }
.exd-badge.new { background: var(--pink, #FF5097); color: #fff; }
.exd-badge.top { background: #ffffff; color: var(--accent-ink, #1a1f05); }

/* ── Десктоп-поповер «Ещё» (модели / тарифы / поддержка) ── */
.pop-extra { width: 290px; padding: 14px; border-radius: 18px; }
.px-brand { font-family: var(--font-display, inherit); font-weight: 700; font-size: 17px; letter-spacing: .02em; padding: 4px 8px 12px; }
.px-group { display: flex; flex-direction: column; gap: 2px; }
.px-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; border-radius: 12px; background: none; border: none; cursor: pointer; text-decoration: none; color: var(--text); text-align: left; font-family: inherit; width: 100%; transition: background .15s; }
.px-item:hover { background: var(--surface-2); }
.px-item.disabled { opacity: .5; cursor: default; }
.px-item.disabled:hover { background: none; }
.px-ic { flex-shrink: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--text-2); margin-top: 1px; }
.px-ic svg { width: 22px; height: 22px; }
.px-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.px-txt b { font-size: 14px; font-weight: 600; line-height: 1.1; }
.px-txt small { font-size: 12px; color: var(--text-3); line-height: 1.25; }
.px-sep { height: 1px; background: var(--line); margin: 8px 4px; }

/* баланс токенов + тариф в меню профиля */
.pop-balance { padding: 4px 6px; }
.pop-bal-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 10px; background: none; border: none; cursor: pointer; color: var(--text); font-family: inherit; }
.pop-bal-row:hover { background: var(--surface-2); }
.pbr-ic { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.pbr-ic svg { width: 18px; height: 18px; }
.pbr-tx { font-size: 14px; font-weight: 500; }
.pbr-val { margin-left: auto; font-weight: 800; font-size: 14px; color: var(--text); }
/* акценты как в верхнем навбаре главной: число токенов и название тарифа — лаймовые */
.pbr-val.bal { color: var(--accent); }
.pbr-val.plan-name { color: var(--accent); }
/* Токены/Тариф как на десктопе: золотая монета + лаймовый чип тарифа */
.pop-bal-row .pbr-ic .coin { width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(160deg, #f0d97a, #c79a2e); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.pbr-val.bal { font-family: var(--font-display, 'Space Grotesk', sans-serif); font-size: 16px; font-weight: 700; }
.pbr-val.plan-chip { color: var(--accent-ink, #1a1f05); background: var(--accent); padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; }

/* ============================================================
   НОВАЯ ПАЛИТРА — тёмный текст на лаймовых акцентах (shell)
   ============================================================ */
.btn.primary { color: var(--accent-ink, #1a1f05) !important; }
.auth-consent input:checked + .box { color: var(--accent-ink, #1a1f05) !important; }
.tp-badge.save { color: var(--accent-ink, #1a1f05) !important; }
/* кнопка тарифа/Studio в навбаре и rail — лайм с тёмным текстом */
.upgrade-btn, .ht-plan, .tb-plan { color: var(--accent-ink, #1a1f05) !important; }

/* колокольчик уведомлений внутри бокового rail (десктоп) */
.mn-bell-wrap.mn-in-rail { position: static; top: auto; right: auto; z-index: auto; display: flex; justify-content: center; width: 100%; }
.mn-in-rail .mn-bell { width: 44px; height: 44px; border-radius: 12px; }
.mn-in-rail .mn-pop { position: fixed; left: calc(var(--rail-w, 86px) + 12px); bottom: 80px; top: auto; right: auto; }

/* ============================================================
   ЕДИНЫЙ ЛЕВЫЙ НАВБАР — flyout-подменю (десктоп)
   ============================================================ */
.nav-item.drail { position: relative; }
/* сам flyout — панель справа от рейла (идёт СРАЗУ ПОСЛЕ своего пункта в DOM).
   Без внешнего отступа (margin создавал «мёртвую зону», из-за которой панель пропадала
   при переходе мыши). Визуальный зазор — через прозрачный мостик ::before. */
.rail-fly { position: fixed; left: var(--rail-w, 86px); z-index: 300; min-width: 280px; max-width: 320px;
  margin-left: 10px; padding: 8px; border-radius: 14px;
  background: var(--surface, #15151a); border: 1px solid var(--line, rgba(255,255,255,.1));
  box-shadow: 0 24px 60px -16px rgba(0,0,0,.75);
  opacity: 0; visibility: hidden; transform: translateX(-6px); transition: opacity .16s, transform .16s, visibility .16s;
  pointer-events: none; }
/* прозрачный мостик слева — перекрывает зазор между рейлом и панелью,
   чтобы курсор не «проваливался» и hover не сбрасывался */
.rail-fly::before { content: ''; position: absolute; top: 0; bottom: 0; left: -16px; width: 16px; }
/* показываем flyout по классу .fly-show (управляется из JS — гарантирует, что открыт только один) */
.rail-fly.fly-show { opacity: 1; visibility: visible; transform: translateX(0); pointer-events: auto; }
.rail-fly-head { font-family: var(--font-display, sans-serif); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-2, #a6a6b0); padding: 8px 12px 6px; }
.rail-fly-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text, #f4f4f6); }
.rail-fly-link:hover { background: rgba(255,255,255,.05); }
.rail-fly-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--surface-2, #1e1e24);
  display: grid; place-items: center; color: var(--text, #f4f4f6); }
.rail-fly-ic svg { width: 19px; height: 19px; }
.rail-fly-tx { flex: 1; min-width: 0; }
.rail-fly-tx b { display: block; font-weight: 600; font-size: 14px; }
.rail-fly-tx span { display: block; font-size: 12px; color: var(--text-2, #a6a6b0); margin-top: 2px; }
.rail-fly-badge { flex: none; font-size: 9px; font-weight: 800; letter-spacing: .05em; padding: 3px 7px; border-radius: 6px; }
.rail-fly-badge.top { background: #ffffff; color: #14180a; }
.rail-fly-badge.new { background: rgba(99,102,241,.9); color: #fff; }

/* ============================================================
   Токены / Подписка в левом рейле — выделенные пункты БЕЗ иконок
   (как в навбаре главной). Без «стопки монет» и «короны».
   ============================================================ */
.nav-item.rail-chip { flex-direction: column; gap: 4px; margin: 2px 8px; padding: 8px 6px;
  border-radius: 12px; border: 1px solid var(--line, rgba(255,255,255,.1)); }
.nav-item.rail-chip span { font-size: 11px; font-weight: 600; }
.nav-item.rail-chip-token { background: rgba(228,244,130,.06); border-color: rgba(228,244,130,.22); }
.nav-item.rail-chip-token span { color: var(--accent, #E4F482); }
.nav-item.rail-chip-token:hover { background: rgba(228,244,130,.12); }
.nav-item.rail-chip-sub { background: rgba(255,255,255,.04); }
.nav-item.rail-chip-sub:hover { background: rgba(255,255,255,.08); }

/* Страховка: на главной (верхний навбар) выпадающие панели рейла не показываем вообще —
   даже если они как-то попали в DOM. Рейл на главной скрыт, панели не нужны. */
body.home-topnav .rail-fly { display: none !important; }

/* Подписки не используются: скрываем шейп «Текущий тариф», баланс — на всю ширину */
.set-hero { display: none !important; }
.set-bal { width: 100%; }
.btn-row .btn-full { width: 100%; flex: 1 1 100%; }

/* Комьюнити доступно только авторизованным — скрываем ссылки для гостей */
[data-auth="out"] a[href="/community"],
[data-auth="out"] .nav-item[data-nav="community"],
[data-auth="out"] .exd-item[href="/community"] { display: none !important; }
