/* yaio interface v2 — iOS-style Liquid Glass in yaio's greens.

   Loaded only by pages behind the v2 preview gate (app/ui_v2.py). Every
   rule is scoped under html.v2, so a v1 page that loads this file by
   mistake does not change (tests/test_ui_v2.py checks the scoping).

   Layers: a soft green ambient light on the page, content on light glass
   cards (.v2-glass), floating chrome on thinner glass (.v2-chrome).
   Glass needs something behind it to blur — on flat gray it looks flat,
   which is why v1's glass read as dull.

   Type: the system font (SF on iPhone and Mac), Inter everywhere else;
   rounded numerals (SF Rounded) for metrics. Serial numbers and codes use
   the text font with tabular digits, not a code font. Bump ?v= on every change:
   nginx serves /static/ immutable for 30 days. */

/* ── Tokens ─────────────────────────────────────────────────────────── */
html.v2 {
  --v2-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  --v2-font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, Inter, sans-serif;
  --v2-mono: "JetBrains Mono", ui-monospace, monospace;

  --v2-ink: #0f1f19;
  --v2-ink-2: #1f3a30;
  --v2-ink-sec: #4b5e56;          /* 6.5:1 on glass — every small grey text */
  --v2-ink-ter: #6b7c74;          /* graphics and large text only */
  --v2-sep: rgba(6, 78, 59, .10);
  --v2-fill: rgba(6, 78, 59, .08);
  --v2-fill-2: rgba(6, 78, 59, .14);

  --v2-accent: #059669;           /* logo, charts, large numbers */
  --v2-accent-text: #047857;      /* links and text buttons */
  --v2-btn-top: #0c946c;          /* primary button gradient; white text 5.5:1 at the bottom */
  --v2-btn-bottom: #047857;
  --v2-red: #dc2626;
  --v2-red-text: #b91c1c;
  --v2-amber: #d97706;
  --v2-amber-text: #92400e;
  --v2-indigo: #4f46e5;
  --v2-indigo-text: #4338ca;

  /* Data colours: the same in every chart. */
  --v2-price: #1f3a30;
  --v2-sun: #f59e0b;
  --v2-export: #059669;
  --v2-battery: #4f46e5;
  --v2-grid: #9aa8a1;
  --v2-house: #0f1f19;
  --v2-below: rgba(220, 38, 38, .08);
  --v2-bar: #aab8b1;              /* a price slot above the threshold: grey, so power and red read first */
  --v2-bar-below: #ef5b5b;        /* a price slot below it: export stops */
  --v2-bar-rim: #1f3a30;          /* a grey bar's top edge, dark like the price line before it */
  --v2-bar-below-rim: #ffd2d2;    /* a red bar's top edge (glass) */
  --v2-load: #8b5cf6;             /* site flows: the house's load */
  --v2-gridflow: #2563eb;         /* the grid: + export / − import */
  --v2-soc: #0d9488;              /* the battery's charge */
  /* the battery's plan: sells, charges from the grid, charges from the sun
     (the battery page's chart and the dashboard's price bars) */
  --v2-plan-sell: #10b981;
  --v2-plan-grid: #3b82f6;
  --v2-plan-solar: #facc15;          /* yellow: apart from the amber PV (the user, 2026-10-22) */

  --v2-bg: #e8f2ec;
  --v2-ambient:
    radial-gradient(1100px 720px at 4% -6%, rgba(52, 211, 153, .42), rgba(52, 211, 153, 0) 62%),
    radial-gradient(900px 660px at 100% 12%, rgba(45, 212, 191, .32), rgba(45, 212, 191, 0) 60%),
    radial-gradient(800px 600px at 62% 58%, rgba(110, 231, 183, .22), rgba(110, 231, 183, 0) 64%),
    radial-gradient(1200px 820px at 46% 104%, rgba(163, 230, 53, .24), rgba(163, 230, 53, 0) 62%);
  /* Liquid glass: see-through enough to take the colour behind it, a bright
     rim where light catches the top edge, a soft lip at the bottom. */
  --v2-glass-bg:
    radial-gradient(140% 90% at 0% 0%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, .40));
  --v2-glass-border: rgba(255, 255, 255, .78);
  --v2-glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .45),
    inset 0 0 0 1px rgba(255, 255, 255, .18),
    0 14px 40px rgba(6, 78, 59, .12), 0 2px 6px rgba(6, 78, 59, .06);
  --v2-glass-filter: blur(30px) saturate(200%);
  --v2-chrome-bg: rgba(255, 255, 255, .60);
  --v2-chrome-border: rgba(255, 255, 255, .90);
  --v2-chrome-shadow: inset 0 1px 0 #fff, 0 10px 30px rgba(6, 78, 59, .14);
  --v2-inset-bg: rgba(255, 255, 255, .62);    /* a list or card inside a glass card */
  --v2-inset-border: rgba(255, 255, 255, .90);
  --v2-knob: #fff;

  --v2-r-card: 28px;
  --v2-r-inner: 18px;
  --v2-r-tile: 9px;
}

html.v2[data-theme="dark"] {
  --v2-ink: #ecf5f0;
  --v2-ink-2: #d3e3db;
  --v2-ink-sec: #a7b8b0;
  --v2-ink-ter: #7f938a;
  --v2-sep: rgba(255, 255, 255, .09);
  --v2-fill: rgba(255, 255, 255, .08);
  --v2-fill-2: rgba(255, 255, 255, .14);

  --v2-accent: #34d399;
  --v2-accent-text: #6ee7b7;
  --v2-red: #f87171;
  --v2-red-text: #fca5a5;
  --v2-amber: #fbbf24;
  --v2-amber-text: #fcd34d;
  --v2-indigo: #818cf8;
  --v2-indigo-text: #a5b4fc;

  --v2-price: #d3e3db;
  --v2-house: #ecf5f0;
  --v2-grid: #7f938a;
  --v2-below: rgba(248, 113, 113, .12);
  --v2-bar: #5e6f68;
  --v2-bar-below: #f06868;
  --v2-bar-rim: #d3e3db;
  --v2-bar-below-rim: #ffb4b4;
  --v2-load: #a78bfa;
  --v2-gridflow: #60a5fa;
  --v2-soc: #2dd4bf;
  --v2-plan-sell: #34d399;
  --v2-plan-grid: #60a5fa;
  --v2-plan-solar: #fde047;

  --v2-bg: #07120e;
  --v2-ambient:
    radial-gradient(1100px 720px at 4% -6%, rgba(16, 185, 129, .22), rgba(16, 185, 129, 0) 62%),
    radial-gradient(900px 660px at 100% 12%, rgba(20, 184, 166, .14), rgba(20, 184, 166, 0) 60%),
    radial-gradient(1200px 820px at 46% 104%, rgba(101, 163, 13, .12), rgba(101, 163, 13, 0) 62%);
  --v2-glass-bg:
    radial-gradient(140% 90% at 0% 0%, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(30, 46, 39, .66), rgba(20, 33, 28, .54));
  --v2-glass-border: rgba(255, 255, 255, .10);
  --v2-glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(255, 255, 255, .04),
    0 14px 40px rgba(0, 0, 0, .40), 0 2px 6px rgba(0, 0, 0, .25);
  --v2-chrome-bg: rgba(28, 44, 37, .66);
  --v2-chrome-border: rgba(255, 255, 255, .10);
  --v2-chrome-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 30px rgba(0, 0, 0, .45);
  --v2-inset-bg: rgba(255, 255, 255, .05);
  --v2-inset-border: rgba(255, 255, 255, .07);
  --v2-knob: #f4faf7;
}

/* ── Page ───────────────────────────────────────────────────────────── */
/* The page is lang="bg", and Apple's system font then draws the Bulgarian
   letter forms (г like s, д like g, т like m) — not what Bulgarian readers
   see in v1's Inter or on their phones. Keep the standard Cyrillic shapes:
   WebKit picks them by locale, Chrome and Firefox by the "locl" feature
   (the font shorthand resets that, hence !important on every element). */
html.v2 { -webkit-locale: "ru"; }
html.v2, html.v2 *, html.v2 *::before, html.v2 *::after { font-feature-settings: "locl" 0 !important; }
/* Native parts (scrollbars, form controls, system colours) follow the page's
   theme, not the computer's: the color-scheme meta allows both, so a light
   page on a Mac in dark mode drew black scrollbars. */
html.v2 { color-scheme: light; }
html.v2[data-theme="dark"] { color-scheme: dark; }

html.v2 body {
  margin: 0;
  min-height: 100vh;
  background: var(--v2-ambient), var(--v2-bg);
  background-attachment: fixed;
  color: var(--v2-ink);
  font-family: var(--v2-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html.v2 a { color: var(--v2-accent-text); }
html.v2 :focus-visible { outline: 3px solid rgba(5, 150, 105, .45); outline-offset: 2px; }

html.v2 .v2-wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }

/* ── Type ───────────────────────────────────────────────────────────── */
html.v2 .v2-title-lg { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
html.v2 .v2-title { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
html.v2 .v2-headline { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600; }
html.v2 .v2-sub { font-size: 13px; color: var(--v2-ink-sec); }
html.v2 .v2-foot { font-size: 12px; color: var(--v2-ink-sec); }
html.v2 .v2-sec { color: var(--v2-ink-sec); }
html.v2 .v2-num { font-variant-numeric: tabular-nums; }
html.v2 .v2-rnd { font-family: var(--v2-font-round); font-variant-numeric: tabular-nums; }
html.v2 .v2-mono { font-family: var(--v2-mono); }

/* ── Materials ──────────────────────────────────────────────────────── */
html.v2 .v2-glass {
  background: var(--v2-glass-bg);
  -webkit-backdrop-filter: var(--v2-glass-filter);
  backdrop-filter: var(--v2-glass-filter);
  border: 1px solid var(--v2-glass-border);
  box-shadow: var(--v2-glass-shadow);
  border-radius: var(--v2-r-card);
}
html.v2 .v2-chrome {
  background: var(--v2-chrome-bg);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--v2-chrome-border);
  box-shadow: var(--v2-chrome-shadow);
  border-radius: 999px;
}
html.v2 .v2-inset {
  background: var(--v2-inset-bg);
  border: 1px solid var(--v2-inset-border);
  border-radius: var(--v2-r-inner);
}

/* ── Buttons: capsules ──────────────────────────────────────────────── */
html.v2 .v2-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; box-sizing: border-box;
  border-radius: 999px; border: 1px solid var(--v2-chrome-border);
  background: var(--v2-chrome-bg);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 8px rgba(6, 78, 59, .10);
  color: var(--v2-accent-text);
  font: 600 14px var(--v2-font);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .1s ease-out, box-shadow .15s ease;
}
html.v2 .v2-btn:active { transform: scale(.97); }
html.v2 .v2-btn:disabled, html.v2 .v2-btn[aria-disabled="true"] {
  background: var(--v2-fill); color: var(--v2-ink-ter); box-shadow: none; border-color: transparent; cursor: not-allowed;
}
html.v2 .v2-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
html.v2 .v2-btn--primary {
  border: none; color: #fff;
  background: linear-gradient(180deg, var(--v2-btn-top), var(--v2-btn-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px rgba(4, 120, 87, .28);
}
html.v2 .v2-btn--primary:hover { color: #fff; }
html.v2 .v2-btn--plain { color: var(--v2-ink); }
html.v2 .v2-btn--danger { color: var(--v2-red-text); }
html.v2 .v2-btn--sm { height: 30px; padding: 0 14px; font-size: 13px; }
html.v2 .v2-btn--lg { height: 50px; padding: 0 26px; font-size: 16px; }
html.v2 .v2-btn--icon { width: 40px; padding: 0; }
html.v2 .v2-btn--icon.v2-btn--sm { width: 30px; }

/* ── Segmented control ──────────────────────────────────────────────── */
html.v2 .v2-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--v2-fill); }
html.v2 .v2-seg > a, html.v2 .v2-seg > button {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px;
  border: none; border-radius: 999px; background: transparent;
  font: 500 13px var(--v2-font); color: var(--v2-ink-2); text-decoration: none; cursor: pointer;
}
html.v2 .v2-seg > [aria-pressed="true"], html.v2 .v2-seg > [aria-current="page"] {
  background: var(--v2-knob); color: var(--v2-ink); font-weight: 600;
  box-shadow: 0 2px 6px rgba(6, 78, 59, .16);
}
html.v2[data-theme="dark"] .v2-seg > [aria-pressed="true"],
html.v2[data-theme="dark"] .v2-seg > [aria-current="page"] { background: rgba(255, 255, 255, .16); color: var(--v2-ink); }

/* ── Status pill ────────────────────────────────────────────────────── */
html.v2 .v2-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--v2-fill); color: var(--v2-ink-2);
}
html.v2 .v2-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--v2-ink-ter); }
html.v2 .v2-pill--plain::before { display: none; }
html.v2 .v2-pill--ok { background: rgba(5, 150, 105, .12); color: var(--v2-accent-text); }
html.v2 .v2-pill--ok::before { background: var(--v2-accent); }
html.v2 .v2-pill--stop { background: rgba(220, 38, 38, .10); color: var(--v2-red-text); }
html.v2 .v2-pill--stop::before { background: var(--v2-red); }
html.v2 .v2-pill--warn { background: rgba(245, 158, 11, .16); color: var(--v2-amber-text); }
html.v2 .v2-pill--warn::before { background: var(--v2-amber); }
html.v2 .v2-pill--off { background: rgba(107, 124, 116, .14); color: var(--v2-ink-2); }
html.v2 .v2-pill--off::before { background: var(--v2-grid); }
html.v2 .v2-pill--battery { background: rgba(79, 70, 229, .12); color: var(--v2-indigo-text); }
html.v2 .v2-pill--battery::before { background: var(--v2-indigo); }

/* ── Icons: white glyph on a coloured rounded square ────────────────── */
html.v2 .v2-icon { width: 18px; height: 18px; flex-shrink: 0; fill: currentColor; }
html.v2 .v2-tile {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: var(--v2-r-tile); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 2px rgba(6, 78, 59, .18);
  --ic-bg: #059669;               /* glyph details are drawn in the tile colour */
}
/* The symbol fills most of its tile, so it reads at a glance. */
html.v2 .v2-tile .v2-icon { width: 22px; height: 22px; }
html.v2 .v2-tile--sm { width: 28px; height: 28px; border-radius: 8px; }
html.v2 .v2-tile--sm .v2-icon { width: 20px; height: 20px; }
html.v2 .v2-tile--lg { width: 44px; height: 44px; border-radius: 13px; }
html.v2 .v2-tile--lg .v2-icon { width: 32px; height: 32px; }
html.v2 .v2-tile--green  { background: linear-gradient(180deg, #34d399, #059669); --ic-bg: #059669; }
html.v2 .v2-tile--mint   { background: linear-gradient(180deg, #4ade80, #16a34a); --ic-bg: #16a34a; }
html.v2 .v2-tile--teal   { background: linear-gradient(180deg, #2dd4bf, #0d9488); --ic-bg: #0d9488; }
html.v2 .v2-tile--lime   { background: linear-gradient(180deg, #a3e635, #65a30d); --ic-bg: #65a30d; }
html.v2 .v2-tile--amber  { background: linear-gradient(180deg, #fcd34d, #f59e0b); --ic-bg: #d97706; }
html.v2 .v2-tile--orange { background: linear-gradient(180deg, #fbbf24, #d97706); --ic-bg: #d97706; }
html.v2 .v2-tile--red    { background: linear-gradient(180deg, #f87171, #dc2626); --ic-bg: #dc2626; }
html.v2 .v2-tile--indigo { background: linear-gradient(180deg, #818cf8, #4f46e5); --ic-bg: #4f46e5; }
html.v2 .v2-tile--gray   { background: linear-gradient(180deg, #b8c2bd, #7c8a84); --ic-bg: #7c8a84; }
html.v2 .v2-tile--slate  { background: linear-gradient(180deg, #6b7c74, #3f4f48); --ic-bg: #3f4f48; }
html.v2 .v2-tile--ink    { background: linear-gradient(180deg, #4b5e56, #0f1f19); --ic-bg: #0f1f19; }
html.v2[data-theme="dark"] .v2-tile--ink { background: linear-gradient(180deg, #6b7c74, #34443d); --ic-bg: #34443d; }

/* Brand logo on a white rounded square (the plant list, integrations). */
html.v2 .v2-logo {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 9px; background: #fff;
  box-shadow: 0 0 0 1px rgba(6, 78, 59, .08), 0 1px 2px rgba(6, 78, 59, .10);
}
html.v2 .v2-logo img { width: 22px; height: 22px; object-fit: contain; }

/* ── Grouped list (Settings) ────────────────────────────────────────── */
html.v2 .v2-list {
  background: var(--v2-inset-bg); border: 1px solid var(--v2-inset-border);
  border-radius: var(--v2-r-inner); overflow: hidden;
}
html.v2 .v2-row {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px;
  font-size: 15px; color: var(--v2-ink); text-decoration: none;
}
html.v2 .v2-row + .v2-row { position: relative; }
html.v2 .v2-row + .v2-row::before {      /* inset separator, as in iOS lists */
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--v2-sep);
}
html.v2 .v2-list--icons .v2-row + .v2-row::before { left: 58px; }   /* past the 30 px icon tile */
html.v2 .v2-row__label { flex: 1; min-width: 0; }
html.v2 .v2-row__value { color: var(--v2-ink-sec); }
html.v2 .v2-row__chev { width: 14px; height: 14px; color: var(--v2-ink-ter); }
html.v2 .v2-row input:not([type="checkbox"]) {
  border: none; outline: none; background: transparent; text-align: right;
  font: 400 15px var(--v2-font); color: var(--v2-accent-text); min-width: 0;
}

/* ── Inputs ─────────────────────────────────────────────────────────── */
html.v2 .v2-search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 999px; background: var(--v2-fill);
}
html.v2 .v2-search svg { width: 17px; height: 17px; color: var(--v2-ink-sec); }
html.v2 .v2-search input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font: 400 15px var(--v2-font); color: var(--v2-ink);
}
html.v2 .v2-input {
  height: 40px; padding: 0 14px; box-sizing: border-box; width: 100%;
  border-radius: 12px; border: 1px solid var(--v2-fill-2); background: var(--v2-inset-bg);
  font: 400 15px var(--v2-font); color: var(--v2-ink);
}
html.v2 .v2-input:focus { outline: none; border-color: var(--v2-accent); box-shadow: 0 0 0 3px rgba(5, 150, 105, .18); }

/* iOS switch on a real checkbox: <input type="checkbox" class="v2-switch"> */
html.v2 .v2-switch {
  -webkit-appearance: none; appearance: none; margin: 0; flex-shrink: 0; cursor: pointer;
  position: relative; width: 51px; height: 31px; border-radius: 999px;
  background: var(--v2-fill-2); transition: background .2s ease;
}
html.v2 .v2-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16);
  transition: transform .25s cubic-bezier(.3, .7, .4, 1);
}
html.v2 .v2-switch:checked { background: #34b97f; }
html.v2 .v2-switch:checked::after { transform: translateX(20px); }

/* ── Stat card (Health) ─────────────────────────────────────────────── */
html.v2 .v2-stat { padding: 14px 16px 16px; border-radius: 22px; display: flex; flex-direction: column; gap: 10px; }
html.v2 .v2-stat__head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
html.v2 .v2-stat__when { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--v2-ink-sec); }
html.v2 .v2-stat__value { font-family: var(--v2-font-round); font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
html.v2 .v2-stat__unit { font-size: 17px; font-weight: 500; color: var(--v2-ink-sec); }
html.v2 .v2-tone--amber  { color: #b45309; }
html.v2 .v2-tone--red    { color: var(--v2-red-text); }
html.v2 .v2-tone--teal   { color: #0f766e; }
html.v2 .v2-tone--green  { color: var(--v2-accent-text); }
html.v2 .v2-tone--indigo { color: var(--v2-indigo-text); }
html.v2 .v2-tone--gray   { color: var(--v2-ink-2); }
html.v2[data-theme="dark"] .v2-tone--amber { color: #fcd34d; }
html.v2[data-theme="dark"] .v2-tone--teal  { color: #5eead4; }

/* ── Notices ────────────────────────────────────────────────────────── */
html.v2 .v2-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 10px 10px 12px;
  border-radius: 22px; border: 1px solid var(--v2-inset-border);
  font-size: 14px; line-height: 1.4;
}
/* On a phone the action drops under the text instead of squeezing it. */
html.v2 .v2-notice__text { flex: 1 1 220px; min-width: 0; }
html.v2 .v2-notice > .v2-btn { margin-left: auto; }
html.v2 .v2-notice--warn  { background: rgba(255, 251, 235, .78); color: #451a03; box-shadow: 0 6px 18px rgba(146, 64, 14, .08); }
html.v2 .v2-notice--error { background: rgba(254, 242, 242, .82); color: #7f1d1d; box-shadow: 0 6px 18px rgba(127, 29, 29, .08); }
html.v2 .v2-notice--ok    { background: rgba(236, 253, 245, .82); color: #064e3b; box-shadow: 0 6px 18px rgba(6, 78, 59, .08); }
html.v2[data-theme="dark"] .v2-notice--warn  { background: rgba(120, 53, 15, .35); color: #fde68a; }
html.v2[data-theme="dark"] .v2-notice--error { background: rgba(127, 29, 29, .35); color: #fecaca; }
html.v2[data-theme="dark"] .v2-notice--ok    { background: rgba(6, 78, 59, .40); color: #a7f3d0; }

/* ════════════════════════════════════════════════════════════════════
   The v2 frame (app/templates/base_v2.html)
   ════════════════════════════════════════════════════════════════════ */

/* v1 token names, so inline style="…var(--ink-muted)…" in templates and in
   strings dashboard.js builds keep working on a v2 page (light and dark). */
html.v2 {
  --ink: var(--v2-ink);
  --ink-soft: var(--v2-ink-2);
  --ink-muted: var(--v2-ink-sec);
  --text: var(--v2-ink);
  --muted: var(--v2-ink-sec);
  --green: var(--v2-accent);
  --green-dark: var(--v2-accent-text);
  --green-light: #10b981;
  --green-pale: rgba(5, 150, 105, .14);
  --green-wash: rgba(5, 150, 105, .08);
  --red: var(--v2-red);
  --red-pale: rgba(220, 38, 38, .10);
  --amber: var(--v2-amber);
  --amber-pale: rgba(245, 158, 11, .16);
  --bg: var(--v2-bg);
  --glass: var(--v2-inset-bg);
  --glass-border: var(--v2-inset-border);
  --border: var(--v2-sep);
  --error-bg: rgba(220, 38, 38, .10);
  --error-text: var(--v2-red-text);
  --font-ui: var(--v2-font);
  --mono: var(--v2-mono);
  --radius: var(--v2-r-card);
  --radius-sm: var(--v2-r-inner);
}

html.v2 .v2-topbar { position: sticky; top: 0; z-index: 50; padding: 12px 24px 0; }
html.v2 .v2-header {
  max-width: 1232px; margin: 0 auto; height: 56px; box-sizing: border-box;
  display: flex; align-items: center; gap: 16px; padding: 0 8px 0 22px;
}
html.v2 .v2-brand { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--v2-accent); text-decoration: none; }
html.v2 .v2-header__center { flex: 1; display: flex; justify-content: center; }
html.v2 .v2-header__end { display: flex; gap: 8px; }

/* Profile menu: base.js closes any open details.user-menu on an outside click. */
html.v2 .v2-menu { position: relative; }
html.v2 .v2-menu > summary { list-style: none; padding: 0 12px 0 4px; font-weight: 500; font-size: 13px; max-width: 280px; }
html.v2 .v2-menu > summary::-webkit-details-marker { display: none; }
html.v2 .v2-menu__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.v2 .v2-menu__chev { width: 14px; height: 14px; color: var(--v2-ink-sec); }
html.v2 .v2-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #34d399, #059669); color: #fff; font-size: 13px; font-weight: 700;
}
html.v2 .v2-menu__panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 290px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px; border-radius: 24px;
  background: var(--v2-chrome-bg); border: 1px solid var(--v2-chrome-border); box-shadow: var(--v2-chrome-shadow);
  -webkit-backdrop-filter: blur(30px) saturate(200%); backdrop-filter: blur(30px) saturate(200%);
  transform-origin: top right;
  background: rgba(255, 255, 255, .88);   /* a menu over cards: denser than the bar */
}
html.v2[data-theme="dark"] .v2-menu__panel { background: rgba(24, 38, 32, .94); }
html.v2 .v2-menu[open] .v2-menu__panel { animation: v2-pop .18s ease-out; }
@keyframes v2-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
html.v2 .v2-menu__head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 6px; }
html.v2 .v2-menu__head-email { font-size: 13px; color: var(--v2-ink-sec); word-break: break-all; }
html.v2 .v2-menu form { margin: 0; }
html.v2 .v2-row--button {
  width: 100%; border: none; background: transparent; cursor: pointer; text-align: left;
  font: 400 15px var(--v2-font); color: var(--v2-ink);
}
@media (hover: hover) { html.v2 a.v2-row:hover, html.v2 .v2-row--button:hover { background: var(--v2-fill); } }
html.v2 .v2-row--danger { color: var(--v2-red-text); }
/* A row inside a form (Изход) still gets its separator. */
html.v2 .v2-list > form > .v2-row { position: relative; }
html.v2 .v2-list > .v2-row + form > .v2-row::before {
  content: ""; position: absolute; top: 0; left: 58px; right: 0; height: 1px; background: var(--v2-sep);
}

html.v2 .v2-main { display: block; max-width: 1280px; margin: 0 auto; padding: 24px 24px 40px; box-sizing: border-box; }

html.v2 .site-footer {
  max-width: 1280px; margin: 0 auto; padding: 8px 24px 32px; box-sizing: border-box;
  font-size: 13px; color: var(--v2-ink-sec);
}
html.v2 .site-footer p { margin: 0; }
html.v2 .site-footer a { color: var(--v2-ink-sec); margin-right: 20px; }

/* Phone: the sections as a floating glass tab bar. */
html.v2 .v2-tabbar { display: none; }
@media (max-width: 767px) {
  html.v2 .v2-topbar { padding: 8px 12px 0; }
  html.v2 .v2-header { padding: 0 6px 0 18px; }
  html.v2 .v2-header__center { visibility: hidden; }
  html.v2 .v2-menu__email, html.v2 .v2-menu__chev { display: none; }
  html.v2 .v2-menu > summary { padding: 0; width: 44px; justify-content: center; }
  html.v2 .v2-main { padding: 16px 12px 112px; }
  html.v2 .site-footer { padding-bottom: 112px; }
  html.v2 .v2-tabbar {
    display: flex; position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
    bottom: calc(12px + env(safe-area-inset-bottom)); height: 64px; padding: 0 8px; gap: 2px; align-items: center;
  }
  html.v2 .v2-tabbar a {
    width: 76px; height: 52px; border-radius: 999px; text-decoration: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 11px; font-weight: 500; color: var(--v2-ink-2);
  }
  html.v2 .v2-tabbar a .v2-icon { width: 22px; height: 22px; }
  html.v2 .v2-tabbar a[aria-current="page"] { background: rgba(5, 150, 105, .12); color: var(--v2-accent-text); font-weight: 600; }
}

/* ── Settings pages (account area, sign-in; the battery page's rules) ──
   A page column, a ‹ back, small-capital section headings over glass
   grouped lists, an ⓘ beside a name whose explanation opens under the row
   (_v2.html named()/help(), v2.js), right-aligned values and inputs. */
html.v2 .v2-page { max-width: 720px; margin: 0 auto; }
html.v2 .v2-page__top { margin: 0 0 6px; }
html.v2 .v2-page__title { margin: 0 0 14px; }
html.v2 .v2-page > .v2-notice { margin: 0 0 12px; }
html.v2 .v2-sec { margin: 24px 0 0; }
html.v2 .v2-sec__h {
  display: flex; align-items: center; margin: 0 0 8px; padding: 0 16px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--v2-ink-sec);
}
html.v2 .v2-sec__h .v2-row__label { flex: none; }
html.v2 .v2-sec > .v2-help { padding: 0 16px 10px; }
html.v2 .v2-sec__foot { margin: 8px 16px 0; font-size: 13px; line-height: 1.5; color: var(--v2-ink-sec); }
html.v2 .v2-group { padding: 0; border-radius: 22px; overflow: hidden; }
html.v2 .v2-group .v2-row { min-height: 50px; }
html.v2 .v2-group form { margin: 0; }
html.v2 .v2-info {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: -3px;
  width: 22px; height: 22px; margin: 0 0 0 4px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--v2-ink-ter); cursor: pointer;
}
html.v2 .v2-info .v2-icon { width: 17px; height: 17px; }
html.v2 .v2-info[aria-expanded="true"] { color: var(--v2-accent-text); }
@media (hover: hover) { html.v2 .v2-info:hover { color: var(--v2-accent-text); } }
html.v2 .v2-help { padding: 0 16px 12px; font-size: 13px; line-height: 1.5; color: var(--v2-ink-sec); }
html.v2 .v2-help[hidden] { display: none; }
html.v2 .v2-help + .v2-row, html.v2 .v2-group > form + .v2-row, html.v2 .v2-group > .v2-row + form > .v2-row { position: relative; }
html.v2 .v2-help + .v2-row::before, html.v2 .v2-group > form + .v2-row::before, html.v2 .v2-group > .v2-row + form > .v2-row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--v2-sep);
}
html.v2 .v2-field { flex: 1 1 auto; width: auto; max-width: 62%; min-width: 0; }
html.v2 .v2-field::placeholder { color: var(--v2-ink-ter); }
html.v2 .v2-row--stack { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
html.v2 .v2-row--stack > .v2-input { flex: 1 1 100%; }
html.v2 .v2-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
html.v2 .v2-card { padding: 16px 18px; border-radius: 24px; }
html.v2 .v2-card > p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
html.v2 .v2-card > p:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  html.v2 .v2-group .v2-row { padding: 0 14px; gap: 10px; font-size: 14px; }
  html.v2 .v2-card { padding: 14px; }
}

/* Sign-in pages (V2_AWARE): v1's form card centred as one glass card —
   a large centred title, stacked labelled fields, a full-width capsule,
   the other ways out as links under it. Fields are 16 px (iOS zooms a
   page into a smaller one on focus). */
html.v2 .v2-auth { max-width: 420px; margin: 5vh auto 0; }
html.v2 .v2-auth > .glass { padding: 30px 28px 24px; border-radius: 30px; }
html.v2 .v2-auth h1 {
  margin: 0 0 20px; text-align: center; font-size: 28px; font-weight: 700; line-height: 1.15;
  letter-spacing: -.01em; color: var(--v2-ink);
}
html.v2 .v2-auth label { display: block; margin: 0 0 6px 4px; font-size: 13px; font-weight: 600; color: var(--v2-ink-sec); }
html.v2 .v2-auth label:has(> input[type="checkbox"]) { margin-left: 0; font-weight: 400; color: var(--v2-ink-2); }
html.v2 .v2-auth input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; display: inline-grid; place-content: center; flex-shrink: 0;
  width: 22px; height: 22px; margin: 0 !important; border-radius: 7px; cursor: pointer;
  border: 1.5px solid var(--v2-ink-ter); background: var(--v2-inset-bg);
}
html.v2 .v2-auth input[type="checkbox"]:checked { background: var(--v2-accent); border-color: var(--v2-accent); }
html.v2 .v2-auth input[type="checkbox"]:checked::after {
  content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2.4px 2.4px; transform: translateY(-1px) rotate(-45deg);
}
html.v2 .v2-auth input[type="checkbox"]:focus-visible { outline: 2px solid var(--v2-accent); outline-offset: 2px; }
html.v2 .v2-auth label:has(> input[type="checkbox"]) { gap: 10px !important; align-items: center !important; }
html.v2 .v2-auth label:has(> input[type="checkbox"]) + .hint { margin-left: 32px; }
html.v2 .v2-auth .glass-input {
  width: 100%; height: 48px; padding: 0 16px; box-sizing: border-box; border-radius: 16px;
  border: 1px solid var(--v2-fill-2); background: var(--v2-inset-bg);
  font: 400 16px var(--v2-font); color: var(--v2-ink);
}
html.v2 .v2-auth .glass-input:focus { outline: none; border-color: var(--v2-accent); box-shadow: 0 0 0 3px rgba(5, 150, 105, .18); }
html.v2 .v2-auth .hint, html.v2 .v2-auth > .glass > p { font-size: 13.5px; line-height: 1.5; color: var(--v2-ink-sec); }
html.v2 .v2-auth .hint { margin: 6px 0 0 4px; }
html.v2 .v2-auth > .glass > p.hint { margin: 0 0 4px; text-align: center; }
html.v2 .v2-auth ul { color: var(--v2-ink-sec) !important; }
html.v2 .v2-auth a { color: var(--v2-accent-text); font-weight: 600; text-decoration: none; }
html.v2 .v2-auth .alt-link { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--v2-ink-sec); }
html.v2 .v2-auth .alt-link + .alt-link { margin-top: 8px; }
html.v2 .v2-auth .flash-ok, html.v2 .v2-auth .flash-err { border-radius: 16px; }
@media (max-width: 600px) {
  html.v2 .v2-auth { margin-top: 8px; }
  html.v2 .v2-auth > .glass { padding: 24px 18px 20px; border-radius: 26px; }
  html.v2 .v2-auth h1 { font-size: 26px; }
}
/* The same card for the error pages (a request id to quote) and the
   unsubscribe page (a wider card, its buttons full width). */
html.v2 .v2-auth code {
  padding: 2px 7px; border-radius: 7px; background: var(--v2-fill);
  font-family: var(--v2-mono); font-size: 12.5px; color: var(--v2-ink);
}
html.v2 .v2-unsub { max-width: 520px; }
html.v2 .v2-unsub .muted { color: var(--v2-ink-sec); }
html.v2 .v2-unsub .btn { width: 100%; }
html.v2 .v2-unsub p > a.muted { font-weight: 500; color: var(--v2-ink-sec); }

/* /terms and /privacy (V2_AWARE): the text on one glass sheet, a reading width. */
html.v2 .legal {
  max-width: 760px; margin: 0 auto; padding: 30px 34px 18px; box-sizing: border-box;
  font-size: 15px; line-height: 1.65; color: var(--v2-ink-2);
}
html.v2 .legal h1 {
  margin: 0 0 16px; font-size: 28px; font-weight: 700; line-height: 1.15;
  letter-spacing: -.01em; color: var(--v2-ink);
}
html.v2 .legal p { margin: 0 0 14px; }
html.v2 .legal strong { font-weight: 600; color: var(--v2-ink); }
html.v2 .legal a { color: var(--v2-accent-text); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  html.v2 .legal { padding: 22px 18px 10px; border-radius: 26px; font-size: 14.5px; }
  html.v2 .legal h1 { font-size: 26px; }
}

/* Onboarding wizard (V2_AWARE): v1's .ob-* markup — the three steps as
   numbered circles on a line, one glass card for the current step, the
   skip as a plain text button under it. */
html.v2 .ob-wrap { max-width: 520px; margin: 4vh auto 0; }
html.v2 .ob-progress-wrap { margin: 0 6px 22px; }
html.v2 .ob-progress { display: flex; align-items: center; }
html.v2 .ob-step-dot {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-sizing: border-box;
  width: 32px; height: 32px; border-radius: 50%; font: 700 14px var(--v2-font-round);
}
html.v2 .ob-step-dot .v2-icon { width: 16px; height: 16px; }
html.v2 .ob-step-dot.done { background: var(--v2-accent); color: #fff; box-shadow: 0 4px 12px rgba(4, 120, 87, .28); }
html.v2 .ob-step-dot.active {
  background: var(--v2-chrome-bg); color: var(--v2-accent-text);
  box-shadow: inset 0 0 0 2px var(--v2-accent), 0 4px 12px rgba(4, 120, 87, .16);
}
html.v2 .ob-step-dot.pending { background: var(--v2-fill); color: var(--v2-ink-ter); }
html.v2 .ob-step-line { flex: 1; height: 2px; margin: 0 8px; border-radius: 1px; background: var(--v2-fill-2); }
html.v2 .ob-step-line.done { background: var(--v2-accent); }
html.v2 .ob-progress-labels { display: flex; margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--v2-ink-ter); }
html.v2 .ob-progress-labels span { flex: 1; text-align: center; }
html.v2 .ob-progress-labels span:first-child { text-align: left; }
html.v2 .ob-progress-labels span:last-child { text-align: right; }
html.v2 .ob-progress-labels span.active { color: var(--v2-accent-text); font-weight: 600; }
html.v2 .ob-progress-labels span.done { color: var(--v2-accent-text); }
html.v2 .ob-card {
  padding: 28px; border-radius: 30px; background: var(--v2-glass-bg); border: 1px solid var(--v2-glass-border);
  box-shadow: var(--v2-glass-shadow); -webkit-backdrop-filter: var(--v2-glass-filter); backdrop-filter: var(--v2-glass-filter);
}
html.v2 .ob-step-label { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--v2-accent-text); }
html.v2 .ob-card h2 { margin: 0 0 10px; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: var(--v2-ink); }
html.v2 .ob-card p { margin: 0 0 20px; font-size: 15px; line-height: 1.55; color: var(--v2-ink-sec); }
html.v2 .ob-card p strong { font-weight: 600; color: var(--v2-ink); }
html.v2 .ob-card .hint { margin: 14px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--v2-ink-sec); }
html.v2 .ob-check { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 15px; color: var(--v2-ink-2); }
html.v2 .ob-check strong { font-weight: 600; overflow-wrap: anywhere; }
html.v2 .ob-check + .btn { margin-top: 10px; }
html.v2 .ob-card form { display: flex !important; justify-content: center; margin: 2px 0 0 !important; }   /* v1's inline display:inline */
html.v2 .ob-card p:empty { display: none; }   /* the parser closes v1's <p> before its <form> */
html.v2 .ob-card .link-btn {
  padding: 4px 8px; border: none; background: none; cursor: pointer;
  font: 600 14px var(--v2-font); color: var(--v2-accent-text) !important;
}
html.v2 .ob-skip { margin-top: 12px; text-align: center; }
html.v2 .ob-skip .btn-ghost {
  background: none; border: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  color: var(--v2-ink-sec); font-weight: 500;
}
@media (hover: hover) { html.v2 .ob-skip .btn-ghost:hover { color: var(--v2-accent-text); } }
@media (max-width: 600px) {
  html.v2 .ob-wrap { margin-top: 8px; }
  html.v2 .ob-card { padding: 22px 18px; border-radius: 26px; }
  html.v2 .ob-card h2 { font-size: 22px; }
}

/* OAuth connect pop-up result (_oauth_result_v2.html): a tile and two
   lines on one glass card, in the middle of the small window. */
html.v2 .v2-oauth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; box-sizing: border-box; }
html.v2 .v2-oauth__card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; max-width: 320px; padding: 28px 22px 24px; box-sizing: border-box; border-radius: 28px; text-align: center;
}
html.v2 .v2-oauth__card .v2-tile { margin-bottom: 8px; }
html.v2 .v2-oauth__card p { margin: 0; }
html.v2 .v2-oauth__title { font-size: 17px; font-weight: 600; color: var(--v2-ink); }

/* A page that keeps its v1 markup inside the v2 frame (V2_AWARE). */
html.v2 .v2-legacy h1 { font-size: 28px !important; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; color: var(--v2-ink); }
@media (max-width: 600px) { html.v2 .v2-legacy .glass { padding: 18px 16px; } }
html.v2 .v2-legacy .alt-link a, html.v2 .v2-legacy a.alt-link { color: var(--v2-accent-text); text-decoration: none; font-weight: 600; }
html.v2 .v2-legacy .glass { margin-bottom: 14px; }
html.v2 .v2-legacy .glass h2 { color: var(--v2-ink); }
html.v2 .v2-legacy .glass-input {
  height: 40px; padding: 0 14px; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--v2-fill-2);
  background: var(--v2-inset-bg); font: 400 15px var(--v2-font); color: var(--v2-ink);
}
html.v2 .v2-legacy .data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
html.v2 .v2-legacy .data-table th, html.v2 .v2-legacy .data-table td { padding: 8px; text-align: left; border-top: 1px solid var(--v2-sep); }

/* „Интеграции“: one row per brand opening its card's content (V2_AWARE). */
html.v2 .int2-lead { margin: -4px 0 14px; font-size: 14px; line-height: 1.5; color: var(--v2-ink-sec); }
html.v2 .int2-lead a { color: var(--v2-accent-text); font-weight: 600; text-decoration: none; }
html.v2 .int2-list { display: flex; flex-direction: column; gap: 10px; }
html.v2 .int2-brand { padding: 0; border-radius: 22px; overflow: hidden; }
html.v2 .int2-sum {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 16px;
  list-style: none; cursor: pointer; font-size: 15px;
}
html.v2 .int2-sum::-webkit-details-marker { display: none; }
html.v2 .int2-logo {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 10px; background: #fff; color: #1f3a30;   /* a white tile in dark mode too */
  box-shadow: 0 0 0 1px rgba(6, 78, 59, .08), 0 1px 2px rgba(6, 78, 59, .10);
}
html.v2 .int2-logo img { width: 22px; height: 22px; object-fit: contain; }
html.v2 .int2-logo .v2-icon { width: 20px; height: 20px; }
html.v2 .int2-name { flex: 1; min-width: 0; font-weight: 600; }
html.v2 .int2-off { font-size: 13px; color: var(--v2-ink-sec); white-space: nowrap; }
html.v2 .int2-chev { width: 16px; height: 16px; color: var(--v2-ink-ter); transition: transform .2s ease; }
html.v2 .int2-brand[open] .int2-chev { transform: rotate(180deg); }
html.v2 .int2-body { padding: 14px 16px 16px; border-top: 1px solid var(--v2-sep); font-size: 14px; }
html.v2 .int2-body .glass-input, html.v2 .v2-legacy .glass-input {
  width: 100%; height: 40px; padding: 0 14px; box-sizing: border-box; border-radius: 12px;
  border: 1px solid var(--v2-fill-2); background: var(--v2-inset-bg); font: 400 15px var(--v2-font); color: var(--v2-ink);
}
html.v2 .int2-body .glass-input:focus { outline: none; border-color: var(--v2-accent); box-shadow: 0 0 0 3px rgba(5, 150, 105, .18); }
html.v2 .int2-body input[type="file"] { max-width: 100%; font: 400 13px var(--v2-font); color: var(--v2-ink-sec); }
html.v2 .int2-body input[type="file"]::file-selector-button {
  margin: 0 10px 0 0; padding: 6px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--v2-fill); color: var(--v2-ink); font: 600 13px var(--v2-font);
}
html.v2 .int2-list + p { color: var(--v2-ink-sec) !important; }
@media (prefers-reduced-motion: reduce) { html.v2 .int2-chev { transition: none; } }

/* The account area: the profile hub's head, the report figures, billing. */
html.v2 .acct-head { display: flex; align-items: center; gap: 14px; }
html.v2 .acct-head__avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 56px; height: 56px; border-radius: 50%; color: #fff; font: 600 24px var(--v2-font-round);
  background: linear-gradient(180deg, var(--v2-btn-top), var(--v2-btn-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
html.v2 .acct-head__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
html.v2 .acct-head__email { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
html.v2 .acct-sections { margin-top: 16px; }
html.v2 .acct-due { color: var(--v2-amber-text); font-weight: 600; }
html.v2 .rep2-month { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
html.v2 .rep2-month__name { min-width: 130px; text-align: center; font: 600 16px var(--v2-font-round); }
html.v2 .rep2-card { margin: 0 0 14px; }
html.v2 .rep2-card--all { box-shadow: var(--v2-glass-shadow), inset 0 0 0 1.5px rgba(5, 150, 105, .28); }
html.v2 .rep2-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
html.v2 .rep2-head .v2-headline { min-width: 0; overflow-wrap: anywhere; }
html.v2 .rep2-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
html.v2 .rep2-figs > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 16px; background: var(--v2-inset-bg); border: 1px solid var(--v2-inset-border); min-width: 0; }
html.v2 .rep2-figs span { font-size: 12px; font-weight: 600; }
html.v2 .rep2-figs strong { font-size: 21px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
html.v2 .rep2-figs small { font-size: 13px; font-weight: 500; color: var(--v2-ink-sec); }
html.v2 .bill2-brand { text-transform: capitalize; font-weight: 600; }
html.v2 .bill2-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
html.v2 .bill2-plan {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; border-radius: 22px;
  text-align: left; cursor: pointer; font: inherit; color: var(--v2-ink);
}
html.v2 .bill2-plan.selected { box-shadow: var(--v2-glass-shadow), inset 0 0 0 2px var(--v2-accent); }
html.v2 .bill2-plan__name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
html.v2 .bill2-plan__price { font-size: 28px; font-weight: 600; line-height: 1.1; }
html.v2 .bill2-plant { padding-top: 8px; padding-bottom: 8px; }
html.v2 .bill2-plant__info { display: flex; flex-direction: column; gap: 4px; }
html.v2 .bill2-plant__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
html.v2 .bill2-select {
  flex-shrink: 0; padding: 0 18px 0 0; border: 0; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none;
  font: 400 15px var(--v2-font); color: var(--v2-accent-text);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%236b7c74' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right center / 14px 14px;
}
html.v2[data-theme="dark"] .bill2-select option { background: #1c2c25; color: var(--v2-ink); }
html.v2 .bill2-pay { align-items: center; }
html.v2 .bill2-terms { margin: 0; padding-left: 18px; }
html.v2 .bill2-terms li { margin: 0 0 4px; }
@media (max-width: 600px) {
  html.v2 .rep2-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html.v2 .bill2-plans { gap: 8px; }
  html.v2 .bill2-plan { padding: 12px 14px; }
  html.v2 .bill2-plan__name { flex-wrap: wrap; gap: 4px 8px; }
  html.v2 .bill2-plan__price { font-size: 24px; }
  html.v2 .v2-group .bill2-plant { padding: 10px 14px; }
}

/* ════════════════════════════════════════════════════════════════════
   v1 markup on a v2 page — the classes base.html used to style
   ════════════════════════════════════════════════════════════════════ */
html.v2 .glass {
  background: var(--v2-glass-bg); border: 1px solid var(--v2-glass-border); box-shadow: var(--v2-glass-shadow);
  -webkit-backdrop-filter: var(--v2-glass-filter); backdrop-filter: var(--v2-glass-filter);
  border-radius: var(--v2-r-card); padding: 20px 22px;
}
html.v2 .glass h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; color: var(--v2-ink); letter-spacing: 0; text-transform: none; }
html.v2 .mono { font-family: var(--v2-font); font-variant-numeric: tabular-nums; }
html.v2 .hint { font-size: 12px; color: var(--v2-ink-sec); margin-top: 4px; }
html.v2 .empty-state { padding: 28px 16px; text-align: center; color: var(--v2-ink-sec); font-size: 14px; }
html.v2 .empty-state a { color: var(--v2-accent-text); font-weight: 600; }
html.v2 .icon { width: 16px; height: 16px; flex-shrink: 0; }

html.v2 .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; box-sizing: border-box; white-space: nowrap; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--v2-chrome-border); background: var(--v2-chrome-bg);
  -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 8px rgba(6, 78, 59, .10);
  font: 600 14px var(--v2-font); color: var(--v2-ink); text-decoration: none;
  transition: transform .1s ease-out;
}
html.v2 .btn:active { transform: scale(.97); }
html.v2 .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
html.v2 .btn svg { width: 15px; height: 15px; }
html.v2 .btn-primary {
  border: none; color: #fff; background: linear-gradient(180deg, var(--v2-btn-top), var(--v2-btn-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px rgba(4, 120, 87, .28);
}
html.v2 .btn-danger { color: var(--v2-red-text); }
html.v2 .btn-success { color: var(--v2-accent-text); }
html.v2 .btn-ghost { color: var(--v2-ink); }
html.v2 .btn-sm { height: 30px; padding: 0 14px; font-size: 13px; }
html.v2 .btn-lg { height: 48px; padding: 0 24px; font-size: 16px; }
html.v2 .btn-block { display: flex; width: 100%; }

html.v2 .pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--v2-fill); color: var(--v2-ink-2); text-decoration: none;
}
html.v2 .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--v2-grid); flex-shrink: 0; }
html.v2 .pill.ok   { background: rgba(5, 150, 105, .12); color: var(--v2-accent-text); }
html.v2 .pill.ok::before { background: var(--v2-accent); }
html.v2 .pill.fail { background: rgba(220, 38, 38, .10); color: var(--v2-red-text); }
html.v2 .pill.fail::before { background: var(--v2-red); }
html.v2 .pill.warn { background: rgba(245, 158, 11, .16); color: var(--v2-amber-text); }
html.v2 .pill.warn::before { background: var(--v2-amber); }

html.v2 .flash-ok, html.v2 .flash-err, html.v2 .flash-warn {
  padding: 12px 16px; margin: 0 0 16px; border-radius: 20px; font-size: 14px; line-height: 1.45;
  border: 1px solid var(--v2-inset-border);
}
html.v2 .flash-ok   { background: rgba(236, 253, 245, .82); color: #064e3b; }
html.v2 .flash-err  { background: rgba(254, 242, 242, .85); color: #7f1d1d; }
html.v2 .flash-warn { background: rgba(255, 251, 235, .82); color: #451a03; }
html.v2[data-theme="dark"] .flash-ok   { background: rgba(6, 78, 59, .40); color: #a7f3d0; }
html.v2[data-theme="dark"] .flash-err  { background: rgba(127, 29, 29, .35); color: #fecaca; }
html.v2[data-theme="dark"] .flash-warn { background: rgba(120, 53, 15, .35); color: #fde68a; }
html.v2 .flash-warn a, html.v2 .flash-err a, html.v2 .flash-ok a { color: inherit; font-weight: 600; }
html.v2 .flash-warn form { display: inline; margin: 0; }
html.v2 .flash-warn .link-btn { background: none; border: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* Dialogs: same open/close contract as v1 (.modal-backdrop.open). */
html.v2 .modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; padding: 20px;
  display: none; align-items: center; justify-content: center;
  background: rgba(7, 18, 14, .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
html.v2 .modal-backdrop.open { display: flex; }
html.v2 .modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-sizing: border-box;
  padding: 26px; border-radius: 30px; animation: v2-pop .2s ease-out;
  background: var(--v2-chrome-bg); border: 1px solid var(--v2-chrome-border); box-shadow: 0 30px 80px rgba(7, 18, 14, .30);
  -webkit-backdrop-filter: blur(30px) saturate(200%); backdrop-filter: blur(30px) saturate(200%);
}
html.v2[data-theme="dark"] .modal { background: rgba(24, 38, 32, .92); }
html.v2 .modal h3 { margin: 0 0 18px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--v2-ink); }
html.v2 .modal-body { margin-bottom: 18px; }
html.v2 .modal-field { margin-bottom: 14px; }
html.v2 .modal-field label, html.v2 #brandSelector > label {
  display: block; margin: 0 0 6px; font-size: 13px; font-weight: 500;
  color: var(--v2-ink-sec) !important; text-transform: none !important; letter-spacing: 0 !important;
}
html.v2 .modal .input, html.v2 .modal select.input {
  width: 100%; height: 42px; padding: 0 14px; box-sizing: border-box;
  border-radius: 12px; border: 1px solid var(--v2-fill-2); background: var(--v2-inset-bg);
  font: 400 15px var(--v2-font); color: var(--v2-ink); outline: none;
}
html.v2 .modal .input:focus { border-color: var(--v2-accent); box-shadow: 0 0 0 3px rgba(5, 150, 105, .18); }
html.v2 .modal-readonly {
  padding: 11px 14px; border-radius: 12px; background: var(--v2-fill);
  font-size: 15px; color: var(--v2-ink-2);
}
html.v2 .modal-error { padding: 12px 14px; margin-bottom: 14px; border-radius: 16px; background: rgba(220, 38, 38, .10); color: var(--v2-red-text); font-size: 14px; }
html.v2 .modal-loading { padding: 20px; text-align: center; font-size: 14px; color: var(--v2-ink-sec); }
html.v2 .modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid var(--v2-sep); }
html.v2 .modal-footer .btn { height: 42px; padding: 0 20px; }
/* A destructive confirmation is the one place for a filled red button. */
html.v2 .modal-footer .btn-danger { border: none; color: #fff; background: linear-gradient(180deg, #ef4444, #dc2626); box-shadow: 0 6px 16px rgba(220, 38, 38, .25); }

/* ── Accessibility fallbacks ────────────────────────────────────────── */
@media (prefers-reduced-transparency: reduce) {
  html.v2 { --v2-glass-bg: #fff; --v2-chrome-bg: #fff; --v2-inset-bg: #f6faf8; --v2-ambient: none; }
  html.v2[data-theme="dark"] { --v2-glass-bg: #15231d; --v2-chrome-bg: #1a2b24; --v2-inset-bg: #1d3029; }
  html.v2 .v2-glass, html.v2 .v2-chrome, html.v2 .v2-btn { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  html.v2 { --v2-glass-border: rgba(15, 31, 25, .35); --v2-chrome-border: rgba(15, 31, 25, .35); --v2-sep: rgba(15, 31, 25, .3); }
}
@media (prefers-reduced-motion: reduce) {
  html.v2 .v2-btn, html.v2 .v2-switch, html.v2 .v2-switch::after { transition: none; }
  html.v2 .v2-btn:active { transform: none; }
}
