/* Elixo AI Trade v2 — app shell. Mobile first, light + dark via tokens. */
:root {
    color-scheme: light;
    --bg: #f7fbf8;
    --grid: rgba(15, 143, 97, .05);
    --surface: #ffffff;
    --surface-2: #f4f7f5;
    --surface-3: #e8eeea;
    --field: #ffffff;
    --field-line: #b9cbc1;
    --field-line-hover: #9eb6aa;
    --line: #cddbd3;
    --ink: #10251d;
    --ink-2: #1f352b;
    --muted: #4c6258;
    --placeholder: #98a8a0;
    --accent: #0c8a5d;
    --accent-2: #08704b;
    --accent-ink: #ffffff;
    --accent-soft: #d9f1e5;
    --long: #08784f;
    --long-soft: #dcf5ea;
    --short: #c8362c;
    --short-soft: #fde6e3;
    --wait: #8a5c00;
    --wait-soft: #fbf0d6;
    --gold: #8f6a08;
    --gold-soft: #fbf1d4;
    --info-soft: #e5eefb;
    --info: #2d5fb5;
    --shadow: 0 1px 2px rgba(16, 37, 29, .05), 0 8px 22px rgba(23, 71, 51, .05);
    --shadow-lg: 0 16px 50px rgba(14, 29, 23, .18);
    --radius: 18px;
    --radius-sm: 12px;
    --font: "Segoe UI", Helvetica, Arial, sans-serif;
    --topbar-h: 62px;
    --tabbar-h: 66px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}
/* Dark theme: <html data-theme="dark">, set by the head script (config v2.theme_default + user choice). */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0a110e;
    --grid: rgba(255, 255, 255, .03);
    --surface: #111a16;
    --surface-2: #17221d;
    --surface-3: #1f2c26;
    --field: #17221d;
    --field-line: #3a4f44;
    --field-line-hover: #4d675a;
    --line: #2c3e35;
    --ink: #e8f1ec;
    --ink-2: #c9d6cf;
    --muted: #8fa298;
    --placeholder: #5e7268;
    --accent: #22c389;
    --accent-2: #3bd59c;
    --accent-ink: #04130d;
    --accent-soft: rgba(34, 195, 137, .14);
    --long: #2fd391;
    --long-soft: rgba(47, 211, 145, .14);
    --short: #ff6b5f;
    --short-soft: rgba(255, 107, 95, .14);
    --wait: #f2b23a;
    --wait-soft: rgba(242, 178, 58, .14);
    --gold: #f2c14e;
    --gold-soft: rgba(242, 193, 78, .14);
    --info-soft: rgba(96, 148, 240, .14);
    --info: #8fb2f5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 16px 50px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background-color: var(--bg);
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* icons */
.ic { width: 20px; height: 20px; flex: none; }
.ic--sm { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding-top: var(--safe-t);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--line);
}
.topbar__inner {
    max-width: 1180px;
    margin: 0 auto;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 17px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); font-weight: 750; }
.brand__mark {
    width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #0b3d2b));
    color: #fff;
}
.brand__mark .ic { width: 18px; height: 18px; }
/* Image logo (300x100 PNG, glyphs at y 25..72): crop the transparent padding. */
.brand__logo { display: block; height: 21px; overflow: hidden; border-radius: 7px; }
.brand__logo img { display: block; height: 42px; width: auto; margin-top: -10px; }
.brand--footer .brand__logo { height: 24px; }
.brand--footer .brand__logo img { height: 48px; margin-top: -12px; }
/* Dark letters of the logo need a light plate on dark backgrounds. */
[data-theme="dark"] .brand__logo { height: 27px; padding: 3px 7px; background: #f3f6f4; box-sizing: border-box; }
[data-theme="dark"] .brand__logo img { height: 42px; margin-top: -10px; }
[data-theme="dark"] .brand--footer .brand__logo { height: 30px; }
.topnav { display: none; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.plan-chip {
    display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 99px;
    background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums;
    border: 1px solid var(--field-line);
}
.plan-chip:hover { text-decoration: none; }
.plan-chip--pro, .plan-chip--one { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__btn {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--field-line); color: var(--ink-2);
}
.avatar { font-weight: 700; font-size: 16px; color: var(--accent); }
.menu__panel {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; padding: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
    display: grid; gap: 2px; z-index: 60;
}
.menu__panel > a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; color: var(--ink); }
.menu__panel > a:hover { background: var(--surface-2); text-decoration: none; }
.menu__who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.menu__who strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.menu__who span { font-size: 13px; color: var(--muted); }
.menu__langs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.menu__langs a { padding: 4px 8px; border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); }
.menu__langs a.is-active { background: var(--accent); color: var(--accent-ink); }
.menu__logout { color: var(--short) !important; }
.menu__theme { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 12px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 15px; color: var(--ink); }
.menu__theme > span { display: flex; align-items: center; gap: 10px; }
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.theme-switch button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 650; padding: 5px 9px; border-radius: 8px; cursor: pointer; }
.theme-switch button .ic { width: 15px; height: 15px; }
.theme-switch button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- tabbar */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(var(--tabbar-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-top: 1px solid var(--line);
}
.tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 12px; font-weight: 600;
}
.tabbar a:hover { text-decoration: none; }
.tabbar a .ic { width: 23px; height: 23px; }
.tabbar a.is-active { color: var(--accent); }

/* ---------------------------------------------------------------- layout */
.main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 36px; }
.hero { padding: 10px 2px 18px; }
.hero h1 { font-size: 25px; font-weight: 750; }
.hero p { color: var(--muted); margin: 8px 0 0; font-size: 15px; }
.page-head { display: grid; gap: 6px; padding: 6px 2px 20px; }
.page-head h1 { font-size: 25px; font-weight: 750; }
.page-head--center { text-align: center; justify-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 2px 14px; }
.section-head h2 { font-size: 18px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__head h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.card__head h3 .ic { color: var(--accent); }
.two-col { display: grid; gap: 20px; }
.grid-2, .grid-3 { display: grid; gap: 16px; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
    font-weight: 650; font-size: 16px; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--field-line); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--field-line-hover); }
.btn--google { background: var(--surface); color: var(--ink); border-color: var(--field-line); }
.btn--lg { min-height: 56px; font-size: 17px; border-radius: 14px; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--icon { min-height: 50px; width: 50px; padding: 0; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: default; pointer-events: none; box-shadow: none; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid currentColor; border-color: var(--accent-ink) transparent var(--accent-ink) transparent;
    animation: spin .8s linear infinite;
}

/* ---------------------------------------------------------------- forms */
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
    width: 100%; min-height: 50px; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--field-line);
    background: var(--field); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
/* Placeholders are examples, not values: noticeably lighter than typed text. */
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: var(--field-line-hover); }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.search input:focus, .check input:focus, .strategy input:focus, .segmented input:focus { box-shadow: none; }
.field { display: grid; gap: 8px; margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field__label { font-size: 14px; font-weight: 650; color: var(--ink-2); }
.field__hint { font-size: 13.5px; color: var(--muted); margin: -12px 0 20px; }
.check { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--field); border: 1px solid var(--field-line); font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-grid > .check { padding: 10px 11px; gap: 8px; }
/* Long words (Индикаторы, Криптоновости, Unternehmensdaten) wrap by syllables with a hyphen, not mid-word. */
.check > span { min-width: 0; overflow-wrap: break-word; }
.check-grid .check > span { -webkit-hyphens: auto; hyphens: auto; }
.check input { flex: none; }
@media (max-width: 359px) { .check-grid { grid-template-columns: 1fr; } }
.check.is-off { opacity: .45; }

.search {
    position: relative; display: flex; align-items: center; gap: 8px;
    background: var(--field); border: 1px solid var(--field-line); border-radius: 16px; padding: 0 7px 0 14px;
    transition: border-color .15s, box-shadow .15s;
}
.search:hover { border-color: var(--field-line-hover); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.search__icon { color: var(--muted); display: flex; }
.search input {
    flex: 1; border: 0 !important; background: transparent !important; min-height: 60px; padding: 0;
    font-size: 19px; font-weight: 650; letter-spacing: .01em; text-transform: none;
}
.search input::placeholder { font-weight: 400; color: var(--placeholder); font-size: 17px; }
.search__camera {
    display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 14px; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.search__camera-text { display: none; }

.chips { display: flex; gap: 10px; overflow-x: auto; padding: 14px 0 2px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips--wrap { flex-wrap: wrap; justify-content: center; overflow: visible; }
.chips--wrap .chip { flex: 0 1 auto; max-width: 100%; height: auto; min-height: 38px; padding: 8px 16px; border-radius: 19px; line-height: 1.3; white-space: normal; text-wrap: balance; }
.chip {
    flex: none; height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--field-line);
    background: var(--surface); color: var(--ink-2); font-weight: 650; font-size: 14.5px; cursor: pointer;
}
.chip:hover, .chip.is-active { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }

.segmented { display: grid; gap: 5px; padding: 5px; background: var(--field); border-radius: 14px; border: 1px solid var(--field-line); }
.segmented--3 { grid-template-columns: repeat(3, 1fr); }
.segmented--4 { grid-template-columns: repeat(4, 1fr); }
.segmented--2 { grid-template-columns: repeat(2, 1fr); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px;
    border-radius: 10px; padding: 4px 2px; text-align: center; color: var(--ink-2); transition: background .15s, color .15s;
}
.segmented span b { font-size: 14.5px; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
.segmented--4 { gap: 3px; padding: 4px; }
.segmented--4 span b { font-size: 13px; letter-spacing: -.01em; }
.segmented span small { font-size: 12px; font-variant-numeric: tabular-nums; }
.segmented input:checked + span { background: var(--accent-soft); color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent); }
.segmented .seg-long input:checked + span { background: var(--long-soft); color: var(--long); box-shadow: inset 0 0 0 1px var(--long); }
.segmented .seg-short input:checked + span { background: var(--short-soft); color: var(--short); box-shadow: inset 0 0 0 1px var(--short); }
.segmented--sm span { min-height: 42px; }

/* ---------------------------------------------------------------- analyze */
.analyze-card { padding: 18px; }
.analyze-form .chips { margin-bottom: 10px; }
.analyze-form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 16px; font-size: 14px; }
.usage { color: var(--muted); }
.link-advanced { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; white-space: nowrap; }
.photo-preview {
    display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; border-radius: 14px;
    background: var(--accent-soft); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
}
.photo-preview img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.photo-preview__body { flex: 1; display: grid; min-width: 0; font-size: 14px; }
.photo-preview__body strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-preview__warn { color: var(--wait); }
.photo-inline { display: grid; gap: 8px; margin-bottom: 14px; }

.progress__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress__head strong { display: block; font-size: 17px; }
.progress__spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
.steps { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.steps__dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; position: relative; }
.steps li.is-active { color: var(--ink); font-weight: 600; }
.steps li.is-active .steps__dot { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
.steps li.is-done { color: var(--ink-2); }
.steps li.is-done .steps__dot { border-color: var(--accent); background: var(--accent); }
.steps li.is-done .steps__dot::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- report */
.result { display: grid; grid-template-columns: minmax(0, 1fr); }
.report { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; animation: rise .35s ease; }
.result > *, .report > * { min-width: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tv-box { height: 320px; position: relative; background: var(--surface-2); }
.tv-box iframe { border: 0; }
.tv-box__placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.verdict { display: grid; gap: 16px; }
.verdict__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.verdict__instrument { display: grid; }
.verdict__pair { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.verdict__meta { font-size: 13.5px; color: var(--muted); }
.verdict__price { text-align: right; display: grid; font-variant-numeric: tabular-nums; }
.verdict__price strong { font-size: 19px; }
.verdict__price time { font-size: 13px; color: var(--muted); }
.verdict__main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.verdict__headline { font-size: 18px; font-weight: 700; line-height: 1.35; }
.verdict__summary { color: var(--ink-2); margin: 0; }

.pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; font-weight: 800; letter-spacing: .03em; font-size: 13px; height: 26px; padding: 0 10px; }
.pill--xl { height: 46px; padding: 0 22px; font-size: 19px; border-radius: 14px; }
.pill--long { background: var(--long-soft); color: var(--long); }
.pill--short { background: var(--short-soft); color: var(--short); }
.pill--wait { background: var(--wait-soft); color: var(--wait); }
.report--long .verdict { border-top: 3px solid var(--long); }
.report--short .verdict { border-top: 3px solid var(--short); }
.report--wait .verdict { border-top: 3px solid var(--wait); }

.confidence { display: flex; align-items: center; gap: 10px; }
.confidence small { color: var(--muted); font-size: 13px; max-width: 150px; line-height: 1.25; hyphens: auto; overflow-wrap: anywhere; }
.confidence__ring {
    --c: var(--accent);
    width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0);
}
.report--long .confidence__ring { --c: var(--long); }
.report--short .confidence__ring { --c: var(--short); }
.report--wait .confidence__ring { --c: var(--wait); }
.confidence__ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }

.notice { padding: 10px 12px; border-radius: 12px; font-size: 14.5px; margin: 0; }
.notice--warn { background: var(--wait-soft); color: var(--wait); }
.notice--info { background: var(--info-soft); color: var(--info); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 750; letter-spacing: .02em; background: var(--surface-2); color: var(--ink-2); }
.tag--long { background: var(--long-soft); color: var(--long); }
.tag--short { background: var(--short-soft); color: var(--short); }
.tag--pro { background: var(--gold-soft); color: var(--gold); }

.plan__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.plan__cell { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.plan__cell span { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan__cell strong { font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.plan__cell em { font-style: normal; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan__cell--tp em { color: var(--long); }
.plan__cell--sl em { color: var(--short); }
.plan__text { font-size: 15px !important; font-weight: 650; }
.plan__why { margin-top: 10px; font-size: 15px; }
.plan__why summary { cursor: pointer; font-weight: 650; color: var(--accent); }
.plan__why p { margin: 8px 0 0; color: var(--ink-2); }

.sections { display: grid; gap: 14px; }
.section { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--line); }
.section--bullish { border-left-color: var(--long); }
.section--bearish { border-left-color: var(--short); }
.section--neutral { border-left-color: var(--wait); }
.section p { margin: 10px 0 0; color: var(--ink-2); font-size: 15.5px; }
.section > summary { list-style: none; cursor: pointer; display: grid; gap: 4px; }
.section > summary::-webkit-details-marker { display: none; }
.section__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.section__title { font-size: 16px; font-weight: 750; line-height: 1.3; }
.section__title::after { content: "▾"; display: inline-block; margin-left: 6px; color: var(--muted); font-size: 13px; transition: transform .15s; }
.section[open] .section__title::after { transform: rotate(180deg); }
.section__takeaway { font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.signal { flex: none; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.signal--bullish { background: var(--long-soft); color: var(--long); }
.signal--bearish { background: var(--short-soft); color: var(--short); }
.signal--neutral { background: var(--wait-soft); color: var(--wait); }
.src-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.src { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 99px; font-size: 13px; font-weight: 650; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.src--technical { color: #2b6fd6; }
.src--market_data { color: var(--accent); }
.src--derivatives { color: #8a4fd8; }
.src--news { color: #c06a00; }
.src--social { color: #1d9bf0; }
.src--fundamentals { color: #6b6f12; }
.src--chart_photo, .src--chart_image { color: #c2387a; }


.list-title { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 8px; }
.list-title--pro .ic { color: var(--long); }
.list-title--con .ic { color: var(--short); }
.bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.bullets li { position: relative; padding-left: 18px; font-size: 15.5px; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 7px; height: 7px; border-radius: 50%; }
.bullets--pro li::before { background: var(--long); }
.bullets--con li::before { background: var(--short); }
.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.checklist li { position: relative; padding-left: 26px; font-size: 15.5px; }
.checklist li::before {
    content: ""; position: absolute; left: 0; top: .15em; width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c8a5d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.checklist--compact { margin: 12px 0 16px; }
.sources-used__list { display: grid; gap: 10px; margin-bottom: 10px; }
.source-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; font-size: 14.5px; }
.source-row__detail { color: var(--ink-2); flex: 1; min-width: 160px; padding-top: 2px; }
.disclaimer { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin: 4px 4px 14px; }
.disclaimer .ic { margin-top: 2px; }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.report-actions .btn { font-size: 15px; white-space: normal; text-align: center; line-height: 1.2; padding: 8px 10px; min-width: 0; }

/* ---------------------------------------------------------------- chat */
.chat-panel { scroll-margin-top: 80px; }
.chat-log { display: grid; gap: 14px; max-height: 460px; overflow-y: auto; padding: 4px 2px 8px; }
.chat-log--page { max-height: none; flex: 1; align-content: start; }
.msg { display: flex; }
.msg--user { justify-content: flex-end; }
.msg__bubble { max-width: 88%; padding: 12px 15px; border-radius: 16px; font-size: 15.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg__bubble p { margin: 0 0 .5em; }
.msg__bubble p:last-child { margin-bottom: 0; }
.msg__bubble ul { margin: .3em 0 .5em; padding-left: 1.2em; }
.msg--assistant .msg__bubble { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg--user .msg__bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.msg__link { display: inline-block; margin-top: 6px; font-weight: 700; }
.msg--typing .msg__bubble { display: inline-flex; align-items: center; gap: 10px; padding: 12px 14px; color: var(--muted); font-size: 15px; }
.typing-dots { display: inline-flex; gap: 4px; }
.msg--typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.msg--typing i:nth-child(2) { animation-delay: .2s; }
.msg--typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.msg-card { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-top: 8px; color: var(--ink); }
.msg-card:hover { text-decoration: none; border-color: var(--accent); }
.chat-suggest { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chat-suggest .chip { height: auto; min-height: 32px; padding: 6px 12px; text-align: left; white-space: nowrap; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { min-height: 50px; max-height: 160px; resize: none; border-radius: 14px; }
.chat-page { display: grid; gap: 16px; }
.chat-threads__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chat-threads__head h1 { font-size: 25px; }
.thread-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.thread-item { flex: none; width: 190px; display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.thread-item:hover { text-decoration: none; border-color: var(--accent); }
.thread-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.thread-item span { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item time { font-size: 12px; color: var(--muted); }
.chat-main { display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - 160px); }
.chat-context { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); margin-bottom: 10px; font-size: 15px; }
.chat-context:hover { text-decoration: none; }
.chat-context > span:nth-child(2) { flex: 1; }
.chat-welcome { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 20px 4px; }
.chat-welcome h2 { font-size: 21px; }
.chat-limit { margin: 8px 2px 0; }
.chat-form--page { scroll-margin-bottom: calc(var(--tabbar-h) + var(--safe-b) + 44px); }
@media (min-width: 900px) { .chat-form--page { scroll-margin-bottom: 44px; } }

/* ---------------------------------------------------------------- lists */
.run-list { display: grid; gap: 12px; }
.run-item { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: var(--shadow); }
.run-item:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.run-item__pill { width: 58px; flex: none; }
.run-item__body { flex: 1; display: grid; gap: 2px; min-width: 0; }
.run-item__top { display: flex; justify-content: space-between; gap: 8px; }
.run-item__top strong { font-size: 16.5px; }
.run-item__conf { font-weight: 750; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.run-item__text { font-size: 14.5px; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.run-item__meta { font-size: 13px; color: var(--muted); }
.run-item__arrow { color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0; }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 34px 18px; }
.empty > .ic { width: 38px; height: 38px; color: var(--accent); }
.empty h2 { font-size: 19px; }

.how { margin-top: 32px; }
.how h2 { font-size: 19px; margin: 0 2px 12px; }
.how__grid { display: grid; gap: 14px; }
.how__item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.how__num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.how__item h3 { font-size: 16px; margin-bottom: 4px; }
.how__item p { margin: 0; font-size: 15px; color: var(--muted); }
.how__sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ---------------------------------------------------------------- pricing */
.plans { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.plans > *, .two-col > *, .grid-2 > *, .grid-3 > *, .levels > *, .plan__grid > *, .chat-page > *, .segmented > * { min-width: 0; }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; box-shadow: var(--shadow); }
.plan-card > * { min-width: 0; }
.pay-buttons .btn { white-space: normal; text-align: center; line-height: 1.2; padding: 8px 10px; }
.plan-card.is-current { border-color: var(--accent); }
.plan-card--pro { border: 2px solid var(--gold); }
.plan-card__badge { position: absolute; top: -11px; right: 16px; background: var(--gold); color: #fff; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; letter-spacing: .03em; text-transform: uppercase; }
.plan-card h2 { display: flex; align-items: center; gap: 8px; font-size: 21px; }
.plan-card--pro h2 .ic { color: var(--gold); }
.price { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.price strong { font-size: 36px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price span { color: var(--muted); font-size: 15px; }
.plan-card__lead { margin: 0; color: var(--ink-2); font-size: 15px; }
.pay-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-more { font-size: 14px; text-align: center; }
.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }
.faq h2 { font-size: 18px; margin-bottom: 6px; }

/* ---------------------------------------------------------------- account */
.account-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account-plan h2 { font-size: 26px; }
.account-plan--pro, .account-plan--one { background: linear-gradient(135deg, var(--gold-soft), var(--surface)); }
.meters { display: grid; gap: 16px; margin-bottom: 10px; }
.meter__top { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 4px; }
.meter__bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter__bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.credit-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.credit-row > div { display: grid; }
.credit-row strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.credit-row .btn { margin-left: auto; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- advanced */
.strategy-btn { justify-content: flex-start; white-space: normal; text-align: left; height: auto; padding-top: 10px; padding-bottom: 10px; }
.strategy-btn span { min-width: 0; overflow-wrap: anywhere; }
.alert-card.is-locked .card__head h3 .ic { color: var(--gold); }
/* AI Alert: what it does, which settings it uses, how to connect a bot, then 2 groups of fields. */
.alert-lead { margin: 0 0 14px; color: var(--ink-2); line-height: 1.55; }
.alert-info { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--info-soft); margin-bottom: 12px; }
.alert-info > .ic { flex: none; color: var(--info); margin-top: 2px; }
.alert-info strong { display: block; margin-bottom: 3px; font-size: 15px; }
.alert-info p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.alert-flow { margin-bottom: 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; }
.alert-flow summary { cursor: pointer; font-weight: 650; font-size: 15px; color: var(--accent-2); }
.alert-flow ol { margin: 12px 0 10px; padding-left: 1.4em; display: grid; gap: 6px; font-size: 14.5px; }
.alert-flow .field__note { margin-bottom: 10px; }
.alert-flow a { font-size: 14.5px; font-weight: 650; }
.alert-group { margin: 0 0 20px; padding: 16px 16px 4px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.alert-group legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; margin-left: -6px; font-weight: 700; font-size: 16px; }
.alert-group__num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); font-size: 13px; font-weight: 800; }
.alert-group .alert-group__text { margin: 0 0 16px; }
.alert-risk input { margin: 0; }
.alert-group .grid-2 { align-items: start; }
.mini-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; line-height: 1.35; }
.mini-check input { flex: none; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); }
.alert-form .alert-credits { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }
.alert-form .alert-credits .ic { flex: none; color: var(--gold); }
.alert-connect { margin: -4px 0 20px; font-size: 14.5px; font-weight: 650; }
.locked { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.locked > .ic { width: 28px; height: 28px; color: var(--gold); }
.form-status { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 15px; }
.form-status.is-ok { background: var(--long-soft); color: var(--long); }
.form-status.is-err { background: var(--short-soft); color: var(--short); }
.strategy-combos { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.strategy-list { display: grid; gap: 10px; overflow-y: auto; max-height: 52vh; padding-right: 2px; }
.strategy { display: flex; gap: 12px; align-items: flex-start; padding: 13px; border-radius: 12px; background: var(--field); border: 1px solid var(--field-line); cursor: pointer; }
.strategy input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.strategy span { display: grid; gap: 2px; }
.strategy strong { font-size: 15px; }
.strategy small { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.strategy.has-conflict { outline: 2px solid var(--wait); }

/* ---------------------------------------------------------------- share / cta */
.share-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--accent-soft); border-color: transparent; }
.share-banner > div { display: grid; }
.cta-card { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 26px 18px; }
.cta-card .btn, .share-banner .btn { white-space: normal; text-align: center; max-width: 100%; }
.share-url { display: flex; gap: 8px; margin: 12px 0; }
.share-url input { flex: 1; min-width: 0; font-size: 14px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.share-grid a { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.share-grid a:hover { text-decoration: none; background: var(--surface-3); }

/* ---------------------------------------------------------------- login */
.login-card { max-width: 440px; margin: 10px auto; display: grid; gap: 12px; text-align: center; justify-items: center; }
.login-card > * { width: 100%; }
.auth-logo { display: flex; justify-content: center; margin: 0 auto 6px; }
.auth-logo .brand__logo { height: 24px; }
.auth-logo .brand__logo img { height: 48px; margin-top: -12px; }
[data-theme="dark"] .auth-logo .brand__logo { height: 30px; }
@media (min-width: 768px) {
    .login-card { max-width: 560px; margin-top: 28px; padding: 34px 44px; gap: 14px; }
}
.login-card h1 { font-size: 25px; }
.auth-form { display: grid; gap: 14px; text-align: left; }
.auth-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------------------------------------------------------- sheets */
.sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(5, 12, 9, .5); animation: fade .2s ease; }
.sheet__panel {
    position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
    background: var(--surface); border-radius: 24px 24px 0 0; padding: 26px 20px calc(18px + var(--safe-b));
    box-shadow: var(--shadow-lg); animation: up .25s cubic-bezier(.2, .9, .3, 1); display: grid; gap: 14px;
}
.sheet__panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 99px; background: var(--line); }
.sheet__panel--tall { max-height: 94vh; }
.sheet__panel h2 { font-size: 22px; }
.sheet__close { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.sheet__icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin: 0 auto 4px; }
.sheet__icon .ic { width: 28px; height: 28px; }
.sheet__icon--gold { background: var(--gold-soft); color: var(--gold); }
#sheet-auth .sheet__panel, #sheet-limit .sheet__panel, #sheet-card .sheet__panel { text-align: center; }
#sheet-auth .auth-form { text-align: left; }
#sheet-limit .checklist { text-align: left; }
.sheet__foot { font-size: 14.5px; color: var(--muted); margin: 4px 0 0; }
.sheet__actions { position: sticky; bottom: -18px; background: var(--surface); padding-top: 10px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
body.has-sheet { overflow: hidden; }

.toast {
    position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); transform: translateX(-50%);
    z-index: 120; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px;
    background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600; box-shadow: var(--shadow-lg);
    animation: up .2s ease;
}
.toast.is-error { background: var(--short); color: #fff; }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: 15px; }
.flash .ic { margin-top: 1px; }
.flash--ok { background: var(--long-soft); color: var(--long); }
.flash--err { background: var(--short-soft); color: var(--short); }
.flash--warn { background: var(--wait-soft); color: var(--wait); }
.inline-error { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--short-soft); color: var(--short); font-size: 15px; }

/* ---------------------------------------------------------------- footer
   Near copy of the main site footer (partials/footer.php): same structure and
   font sizes, colours from our tokens so dark mode keeps working. On phones the
   two link columns sit side by side instead of one under another. */
.footer { margin-top: 24px; padding: 34px 0 18px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); text-align: left; font-size: 16px; }
.footer-wrap { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; align-items: start; }
.footer-brand, .footer-column--contacts { grid-column: 1 / -1; }
.footer-brand { color: var(--muted); }
.footer-brand__copy { max-width: 55ch; margin: 17px 0 0; font-size: 14px; line-height: 1.62; }
.footer-brand__copy + .footer-brand__copy { margin-top: 12px; }
.footer-column { min-width: 0; }
.footer-column__title { margin: 2px 0 13px; color: var(--accent-2); font-size: 16px; font-weight: 800; line-height: 1.2; }
.footer-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.footer-list a, .footer-contact-link { color: var(--ink); font-size: 16px; line-height: 1.35; text-decoration: none; }
.footer-list a:hover, .footer-contact-link:hover { color: var(--accent-2); text-decoration: underline; }
.footer-contact-list { display: grid; gap: 13px; }
.footer-contact-link { display: inline-flex; align-items: center; gap: 9px; }
.footer-contact-link svg { width: 19px; height: 19px; flex: 0 0 auto; color: var(--accent-2); }
.footer-legal { display: grid; gap: 8px; margin-top: 23px; padding-top: 15px; border-top: 1px solid var(--line); }
.footer-legal a { color: var(--muted); font-size: 13px; line-height: 1.35; text-decoration: none; }
.footer-legal a:hover { color: var(--accent-2); text-decoration: underline; }
.footer-bottom { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }
.footer-utility { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.footer-socials { display: flex; align-items: center; gap: 7px; }
.footer-social-link { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: var(--accent-2); border: 1px solid transparent; border-radius: 9px; text-decoration: none; }
.footer-social-link:hover { background: var(--surface-2); border-color: var(--line); }
.footer-social-link svg { width: 18px; height: 18px; fill: currentColor; }
.footer-language { padding-left: 13px; border-left: 1px solid var(--line); }
.footer-analytics-notice { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.48; }
.footer-copyright { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; white-space: nowrap; }

/* language dropdown (markup from lang/_init.php get_lang_switcher_html) */
.lang-dropdown { position: relative; display: inline-block; }
.lang-dropdown-btn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); }
.lang-dropdown-btn:hover { background: var(--surface-2); }
.lang-icon { width: 20px; height: 20px; flex-shrink: 0; }
.lang-arrow { color: var(--muted); transition: transform .2s; }
.lang-dropdown.open .lang-arrow { transform: rotate(180deg); }
.lang-dropdown-menu { position: absolute; left: 0; bottom: calc(100% + 7px); min-width: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .2s; z-index: 100; overflow: hidden; }
.lang-dropdown.open .lang-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--muted); font-size: 14px; text-decoration: none; }
.lang-dropdown-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.lang-dropdown-item.active { background: var(--accent-soft); color: var(--accent-2); }
.lang-dropdown-item .lang-name { flex: 1; font-weight: 500; }
.lang-dropdown-item .lang-code-small { font-size: 11px; font-weight: 600; color: var(--muted); }

@media (max-width: 460px) {
    .footer-wrap { width: calc(100% - 24px); }
}
@media (min-width: 768px) {
    .footer { padding: 44px 0 19px; }
    .footer-wrap { width: min(1240px, calc(100% - 48px)); }
    .footer-grid { gap: 31px 46px; }
    .footer-brand { grid-column: auto; }
    .footer-column--contacts { grid-column: auto; }
    .footer-brand__copy { max-width: 44ch; margin-top: 22px; }
    .footer-column__title { margin-bottom: 16px; }
    .footer-bottom { grid-template-columns: auto 1fr; align-items: start; gap: 22px; margin-top: 37px; }
    .footer-copyright { grid-column: 2; text-align: right; }
}
@media (min-width: 1041px) {
    .footer-grid { grid-template-columns: minmax(230px, 1.16fr) repeat(3, minmax(158px, 1fr)); gap: 30px; }
    .footer-column { padding-left: 30px; border-left: 1px solid var(--line); }
    .footer-bottom { grid-template-columns: auto minmax(260px, 1fr) auto; align-items: center; }
    .footer-analytics-notice { text-align: center; }
    .footer-copyright { grid-column: auto; }
}

/* ---------------------------------------------------------------- larger screens */
@media (min-width: 600px) {
    .search__camera-text { display: inline; }
    .card { padding: 28px; }
    .analyze-card { padding: 24px; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .plan__grid { grid-template-columns: repeat(3, 1fr); }
    .report-actions { display: flex; flex-wrap: wrap; }
    .two-col { grid-template-columns: 1fr 1fr; }
    .how__grid { grid-template-columns: repeat(3, 1fr); }
    .tv-box { height: 420px; }
    .sheet { align-items: center; }
    .sheet__panel { border-radius: 24px; }
    .sheet__panel::before { display: none; }
    .check-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .check-grid > .check { padding: 11px 13px; gap: 10px; }
    .segmented--4 { gap: 5px; padding: 5px; }
    .segmented--4 span b { font-size: 14px; letter-spacing: 0; }
}
@media (min-width: 900px) {
    body { padding-bottom: 0; }
    .tabbar { display: none; }
    .topnav { display: flex; gap: 2px; margin-left: 18px; }
    .topnav a { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 11px; color: var(--ink-2); font-weight: 650; font-size: 15.5px; }
    .topnav a:hover { background: var(--surface-2); text-decoration: none; }
    .topnav a.is-active { background: var(--accent-soft); color: var(--accent-2); }
    .topnav .ic { width: 18px; height: 18px; }
    .main { padding-top: 32px; padding-bottom: 48px; }
    .page-analyze .main { max-width: 860px; }
    .page-advanced .main, .page-report .main, .page-share .main, .page-history .main, .page-account .main, .page-alerts .main { max-width: 960px; }
    .hero h1 { font-size: 34px; }
    .hero { padding: 10px 2px 18px; text-align: center; }
    .plans { grid-template-columns: repeat(3, 1fr); }
    .chat-page { grid-template-columns: 280px 1fr; align-items: start; }
    .thread-list { display: grid; overflow: visible; }
    .thread-item { width: auto; }
    .chat-main { min-height: calc(100vh - var(--topbar-h) - 70px); position: sticky; top: calc(var(--topbar-h) + 12px); }
    .toast { bottom: 24px; }
}

/* ---------------------------------------------------------------- AI Alerts page */
.page-head__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.alerts-count { margin: 0 2px 8px; }
.alert-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.alert-item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: grid; gap: 14px; min-width: 0; }
.alert-item.is-paused { border-left-color: var(--wait); }
.alert-item.is-paused .alert-facts, .alert-item.is-paused .alert-item__schedule { opacity: .7; }
.alert-item__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.alert-item__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.alert-item__title strong { font-size: 18px; }
.alert-item__dex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 14px; }
.alert-item__model { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.alert-item__schedule { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 13.5px; color: var(--muted); }
.alert-item__schedule strong { color: var(--ink-2); font-weight: 650; }
.alert-item__prompt summary { cursor: pointer; font-size: 14px; font-weight: 650; color: var(--accent); }
.alert-item__prompt p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.alert-item__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.alert-item__actions .btn { flex: 1 1 auto; }
.alert-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.alert-facts > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.alert-facts dt { font-size: 12px; color: var(--muted); font-weight: 650; }
.alert-facts dd { margin: 2px 0 0; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.alert-facts .pill { height: 22px; font-size: 12px; padding: 0 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-chip { flex: none; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 750; }
.status-chip--on { background: var(--long-soft); color: var(--long); }
.status-chip--off { background: var(--wait-soft); color: var(--wait); }
.btn--danger { background: var(--short-soft); color: var(--short); border-color: transparent; }
.btn--danger:hover { background: color-mix(in srgb, var(--short) 18%, transparent); }
.flash--info { background: var(--gold-soft); color: var(--ink-2); }
.flash--info .ic { color: var(--gold); }
.check--block { align-items: flex-start; margin-bottom: 12px; }
.check--block span { display: grid; gap: 2px; }
.check--block small { color: var(--muted); font-size: 13.5px; }
.field__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.delivery { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 20px; }
.delivery h4 { display: flex; align-items: center; gap: 6px; font-size: 15px; margin-bottom: 6px; }
.delivery h4 .ic { color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.vars summary { cursor: pointer; font-size: 14px; font-weight: 650; color: var(--accent); }
.vars__group { margin: 8px 0; display: grid; gap: 4px; }
.vars__group strong { font-size: 13.5px; }
.vars__group div { display: flex; flex-wrap: wrap; gap: 4px; }
.vars code { font-size: 12.5px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); overflow-wrap: anywhere; }
.row-actions--end { justify-content: flex-end; }
@media (max-width: 420px) {
    .alert-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Phones: four long labels do not fit in one row at a readable size. */
@media (max-width: 480px) {
    .segmented--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 5px; }
    .segmented--4 span b { font-size: 15px; letter-spacing: 0; }
    .lang-dropdown-menu { left: auto; right: 0; }
}

/* ---------------------------------------------------------------- field help ("?" next to labels) */
.field__label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.help-btn {
    position: relative; flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0;
    border-radius: 50%; border: 1px solid var(--field-line); background: var(--surface); color: var(--muted);
    font: inherit; font-size: 12px; font-weight: 800; line-height: 1; cursor: pointer;
}
.help-btn::after { content: ""; position: absolute; inset: -10px; }
.help-btn:hover, .help-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.help-pop {
    position: absolute; z-index: 130; padding: 16px 48px 16px 16px; background: var(--surface); color: var(--ink);
    border: 1px solid var(--field-line); border-radius: 14px; box-shadow: var(--shadow-lg);
    font-size: 15px; line-height: 1.5; animation: fade .15s ease;
}
.help-pop__title { display: block; font-size: 16px; line-height: 1.3; margin-bottom: 6px; }
.help-pop__text p { margin: 0 0 .55em; color: var(--ink-2); }
.help-pop__text p:last-child { margin-bottom: 0; }
.help-pop__close {
    position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%;
    background: var(--surface-2); color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
.help-pop__close .ic { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- strategy sets (advanced form) */
.field__note { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.presets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.preset {
    position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; min-width: 0; padding: 13px 14px;
    border: 1px solid var(--field-line); border-radius: 14px; background: var(--field); color: var(--ink);
    font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.preset:hover { border-color: var(--field-line-hover); }
.preset input { position: absolute; opacity: 0; pointer-events: none; }
.preset::before {
    content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; box-sizing: border-box;
    border-radius: 50%; border: 2px solid var(--field-line); background: var(--surface);
}
.preset.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.preset.is-active::before { border: 6px solid var(--accent); }
.preset:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.preset__body { flex: 1; display: grid; gap: 3px; min-width: 0; }
.preset__body strong { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 16px; line-height: 1.3; }
.preset__body strong .ic { color: var(--accent); }
.preset__body strong > span { flex: 1 1 8em; min-width: 0; }
.preset__body small { font-size: 14px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.preset.is-active .preset__body small { color: var(--ink-2); }
.preset__count {
    margin-left: auto; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-2);
    font-style: normal; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.preset.is-active .preset__count { background: var(--surface); }
.preset--manual { border-style: dashed; }
.preset--manual.is-active { border-style: solid; }
.link-btn {
    justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none;
    color: var(--accent-2); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.link-btn .ic { transition: transform .15s; }
.link-btn.is-open .ic { transform: rotate(180deg); }
.prompt-field textarea.is-full { min-height: 340px; font-size: 15px; line-height: 1.55; }
@media (min-width: 600px) {
    .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .prompt-field textarea.is-full { min-height: 420px; }
}

/* ---------------------------------------------------------------- report blocks (v3) */
.block-title { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0 0 6px; }
.block-title .ic { color: var(--accent); }
.block-sub { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.card > .block-title:only-child, .block-title + .two-col, .block-title + .scenario-list { margin-top: 12px; }
.plan__head { display: flex; align-items: flex-start; gap: 10px; font-size: 18px; line-height: 1.35; margin: 0 0 14px; }
.plan__head > .ic { flex: none; margin-top: 3px; color: var(--accent); }
.side { display: inline-block; padding: 1px 8px; border-radius: 8px; font-weight: 800; letter-spacing: .02em; }
.side--long { background: var(--long-soft); color: var(--long); }
.side--short { background: var(--short-soft); color: var(--short); }
.plan__box { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.plan__box strong { display: block; font-size: 14px; margin-bottom: 4px; }
.plan__box p { margin: 0; font-size: 15px; color: var(--ink-2); }
.plan__box--when { border-left: 3px solid var(--accent); }
.plan__box--when strong { color: var(--accent-2); }
.plan__box--cancel { margin: 14px 0 0; border-left: 3px solid var(--short); }
.plan__box--cancel strong { color: var(--short); }
.plan__grid + .plan__why { margin-top: 14px; }
.args > div { min-width: 0; }
.scenario-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.scenario-item { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.scenario-item strong { display: block; font-size: 15px; margin-bottom: 4px; }
.scenario-item p { margin: 0; font-size: 15px; color: var(--ink-2); }
.scenario-item--up strong { color: var(--long); }
.scenario-item--down strong { color: var(--short); }
.scenario-list + .list-title { margin-top: 18px; }
.ladder { display: grid; gap: 6px; }
.ladder__group { margin: 6px 0 0; font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.ladder__group--res { color: var(--short); }
.ladder__group--sup { color: var(--long); }
.ladder__row { display: grid; grid-template-columns: minmax(84px, auto) 1fr; gap: 4px 14px; align-items: baseline; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.ladder__row strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.ladder__row span { font-size: 14px; color: var(--ink-2); line-height: 1.4; min-width: 0; }
.ladder__row--res { background: color-mix(in srgb, var(--short-soft) 60%, var(--surface)); }
.ladder__row--sup { background: color-mix(in srgb, var(--long-soft) 60%, var(--surface)); }
.ladder__row--now { background: var(--surface); border: 2px dashed var(--field-line); }
.ladder__row--now span { font-weight: 700; color: var(--ink); }
.ladder__mark { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 99px; font-style: normal; font-size: 12px; font-weight: 750; }
.ladder__mark { background: var(--ink); color: var(--bg); }
