:root {
  color-scheme: dark;
  --bg: #11111a;
  --bg-soft: #151520;
  --surface: #1b1b28;
  --surface-raised: #232333;
  --surface-high: #2a2a3b;
  --surface-inset: #14141e;
  --border: #313146;
  --border-light: #41415b;
  --text: #eeeeF7;
  --text-soft: #c3c3d3;
  --muted: #9191a7;
  --muted-2: #6e6e84;
  --accent: #a398ff;
  --accent-strong: #8072ef;
  --accent-dark: #4f478e;
  --accent-wash: rgba(163, 152, 255, .12);
  --green: #68d8ac;
  --yellow: #f0c878;
  --red: #f27e91;
  --shadow: 0 18px 45px rgba(0,0,0,.28);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 78% -12%, rgba(116,103,212,.12), transparent 34%), var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(163,152,255,.36); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #c3bcff; }

.boot-screen, .center-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 26px; }
.auth-wrap { width: min(100%, 440px); }
.brand-lockup { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 0 auto 25px; }
.brand-mark { width: 48px; height: 48px; object-fit: contain; border-radius: 12px; filter: drop-shadow(0 8px 20px rgba(163,152,255,.16)); }
.brand-wordmark { width: 230px; max-width: 70%; height: 48px; object-fit: contain; object-position: left center; }
.auth-card { padding: 28px; background: linear-gradient(152deg, rgba(37,37,54,.96), rgba(25,25,37,.98)); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0 0 7px; font-size: 25px; letter-spacing: -.04em; }
.auth-card .subhead { margin: 0 0 24px; color: var(--muted); }
.auth-footer { padding: 16px 5px; text-align: center; font-size: 12px; color: var(--muted-2); }
.auth-notice { border: 1px solid rgba(240,200,120,.28); background: rgba(240,200,120,.08); color: var(--yellow); padding: 11px 13px; border-radius: 10px; margin: 0 0 17px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--muted-2); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.projection-source-tabs { margin-bottom: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; min-width: 0; }
.field label, .field-label { color: var(--text-soft); font-size: 12px; font-weight: 650; letter-spacing: .015em; }
.field input, .field textarea, .input { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); background: var(--surface-inset); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); transition: border-color .16s, box-shadow .16s, background .16s; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:hover, .field textarea:hover, .input:hover { border-color: var(--border-light); }
.field input:focus, .field textarea:focus, .input:focus { border-color: var(--accent-strong); outline: none; box-shadow: 0 0 0 3px rgba(163,152,255,.13), inset 0 1px 2px rgba(0,0,0,.22); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field-help { color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.full { grid-column: 1 / -1; }
.input:disabled, input:disabled { opacity: .58; cursor: not-allowed; }

.btn { --btn-top: #7770ba; --btn-mid: #61599b; --btn-bottom: #514982; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 9px 14px; border: 1px solid rgba(198,191,255,.28); border-radius: 9px; color: #f4f2ff; background: linear-gradient(180deg,var(--btn-top) 0%,var(--btn-mid) 55%,var(--btn-bottom) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.19), inset 0 -1px 0 rgba(13,12,23,.28), 0 3px 0 #393453, 0 6px 13px rgba(0,0,0,.22); font-weight: 670; cursor: pointer; transition: filter .15s, transform .15s, box-shadow .15s; }
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(13,12,23,.25), 0 4px 0 #393453, 0 9px 16px rgba(0,0,0,.28); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 0 #393453, 0 2px 6px rgba(0,0,0,.2); }
.btn:disabled { opacity: .52; cursor: not-allowed; transform: none; filter: grayscale(.2); }
.btn.secondary { --btn-top: #343447; --btn-mid: #29293a; --btn-bottom: #232332; border-color: var(--border-light); color: var(--text-soft); box-shadow: inset 0 1px 0 rgba(255,255,255,.055), inset 0 -1px 0 rgba(0,0,0,.25), 0 3px 0 #171722, 0 5px 10px rgba(0,0,0,.18); }
.btn.ghost { min-height: 34px; padding: 7px 10px; color: var(--text-soft); border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-high); transform: none; box-shadow: none; }
.btn.danger { --btn-top: #9a4d61; --btn-mid: #733a4c; --btn-bottom: #603242; }
.btn.small { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.btn-row.end { justify-content: flex-end; }

.custom-select { position: relative; min-width: 150px; }
.custom-select > button { display: flex; width: 100%; min-height: 40px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; background: var(--surface-inset); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); text-align: left; cursor: pointer; }
.custom-select > button:hover, .custom-select.open > button { border-color: var(--accent-strong); }
.custom-select .select-menu { position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; right: 0; display: none; padding: 5px; max-height: 270px; overflow: auto; border: 1px solid var(--border-light); border-radius: 10px; background: #232333; box-shadow: var(--shadow); }
.custom-select.open .select-menu { display: block; }
.select-option { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; color: var(--text-soft); background: transparent; text-align: left; cursor: pointer; }
.select-option:hover, .select-option[aria-selected="true"] { color: var(--text); background: var(--accent-wash); }
.switch-row { display: inline-flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 12px; cursor: pointer; }
.switch-row input { accent-color: var(--accent-strong); width: 16px; height: 16px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 17px 12px 14px; border-right: 1px solid rgba(255,255,255,.055); background: rgba(18,18,28,.92); backdrop-filter: blur(18px); }
.side-brand { display: flex; align-items: center; gap: 10px; min-height: 47px; padding: 2px 9px 13px; border-bottom: 1px solid rgba(255,255,255,.06); }
.side-brand img { width: 31px; height: 31px; object-fit: contain; }
.side-brand span { font-weight: 720; letter-spacing: -.02em; }
.side-brand small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .12em; }
.side-section { padding: 17px 9px 7px; color: var(--muted-2); font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.side-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; min-height: 0; margin-top: 5px; overflow-y: auto; scrollbar-width: thin; }
.nav-item { position: relative; display: flex; align-items: center; width: 100%; gap: 12px; padding: 10px 11px; border: 1px solid transparent; border-radius: 9px; color: var(--text-soft); background: transparent; text-align: left; cursor: pointer; transition: .16s ease; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.045); }
.nav-item.active { color: #ddd9ff; background: linear-gradient(90deg,rgba(138,126,235,.2),rgba(138,126,235,.08)); border-color: rgba(163,152,255,.16); }
.nav-manager-links { display: grid; gap: 2px; margin: 0 0 4px; padding: 2px 4px 6px 34px; }
.nav-manager-item { width: 100%; min-height: 30px; padding: 6px 9px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; text-align: left; font-family: inherit; font-size: 11px; font-weight: 500; line-height: 1.35; cursor: pointer; }
.nav-manager-item:hover { color: var(--text); background: rgba(255,255,255,.045); }
.nav-manager-item.active { border-color: rgba(163,152,255,.13); color: #ddd9ff; background: rgba(138,126,235,.11); }
.nav-icon { width: 18px; color: var(--muted); font-size: 15px; text-align: center; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-count { margin-left: auto; padding: 1px 7px; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); font-size: 10px; }
.side-bottom { margin-top: auto; padding: 10px 3px 0; border-top: 1px solid rgba(255,255,255,.06); }
.connection-pill { display: flex; align-items: center; gap: 8px; padding: 10px 9px; color: var(--muted); font-size: 11px; }
.dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 99px; background: var(--green); box-shadow: 0 0 0 3px rgba(104,216,172,.11); }
.dot.off { background: var(--yellow); box-shadow: 0 0 0 3px rgba(240,200,120,.1); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 10px 8px 3px; }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(163,152,255,.26); border-radius: 50%; color: #d7d2ff; background: var(--accent-wash); font-size: 12px; font-weight: 750; }
.side-user-name { min-width: 0; flex: 1; overflow: hidden; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.side-user-name small { display: block; color: var(--muted); font-size: 10px; }

.main-column { min-width: 0; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 61px; padding: 0 clamp(17px,3vw,35px); border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(17,17,26,.86); backdrop-filter: blur(18px); }
.topbar-title { font-size: 14px; font-weight: 660; letter-spacing: -.01em; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.ws-state { display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; color: var(--muted); font-size: 11px; }
.topbar select { max-width: 120px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-soft); background: var(--surface); }
.notification-anchor { position: relative; display: flex; align-items: center; }
.notification-bell { position: relative; width: 38px; height: 38px; padding: 8px !important; }
.notification-bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notification-count { position: absolute; top: -3px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid var(--bg); border-radius: 10px; color: white; background: #bd566d; font-size: 9px; line-height: 13px; text-align: center; }
.notification-menu { position: absolute; z-index: 80; top: calc(100% + 10px); right: -78px; width: min(390px,calc(100vw - 22px)); max-height: min(70vh,560px); overflow: hidden; border: 1px solid var(--border-light); border-radius: 13px; background: linear-gradient(155deg,#252536,#191925); box-shadow: 0 18px 48px rgba(0,0,0,.45); }
.notification-menu > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.notification-menu > header strong { font-size: 13px; }
.text-button { padding: 5px; border: 0; color: var(--accent); background: transparent; font-size: 11px; cursor: pointer; }
.text-button:disabled { color: var(--muted-2); cursor: default; }
.notification-list { max-height: min(62vh,490px); overflow-y: auto; }
.notification-item { display: flex; width: 100%; gap: 10px; padding: 12px 14px; border: 0; border-bottom: 1px solid rgba(255,255,255,.045); color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.notification-item:hover { background: rgba(163,152,255,.08); }
.notification-item.unread { background: rgba(163,152,255,.045); }
.notification-mark { display: grid; flex: 0 0 29px; width: 29px; height: 29px; place-items: center; border: 1px solid rgba(163,152,255,.22); border-radius: 9px; color: var(--accent); background: var(--accent-wash); }
.notification-copy { display: grid; min-width: 0; gap: 3px; }
.notification-copy strong { font-size: 12px; line-height: 1.35; }
.notification-copy small, .notification-copy time { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.notification-empty { padding: 28px 15px; color: var(--muted); font-size: 12px; text-align: center; }
.mobile-menu { display: none; }
.content { width: min(100%, 1500px); margin: 0 auto; padding: clamp(18px,3vw,34px); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 23px; }
.page-heading h1 { margin: 0; font-size: clamp(23px,3vw,31px); letter-spacing: -.045em; line-height: 1.18; }
.page-heading p { max-width: 720px; margin: 7px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 10px; font-weight: 760; letter-spacing: .14em; text-transform: uppercase; }
.layout-grid { display: grid; gap: 15px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 0 0 20px; }
.stat-card, .panel, .card, .product-card, .benefit-card { border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(150deg,rgba(34,34,49,.95),rgba(26,26,39,.97)); box-shadow: 0 6px 20px rgba(0,0,0,.11); }
.stat-card { min-height: 106px; padding: 16px; }
.stat-card-link { display: block; width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .16s,border-color .16s,box-shadow .16s; }
.stat-card-link:hover { transform: translateY(-2px); border-color: var(--border-light); box-shadow: 0 10px 26px rgba(0,0,0,.24),inset 0 1px rgba(255,255,255,.04); }
.stat-open { display: block; margin-top: 7px; color: var(--accent); font-size: 10px; font-weight: 650; }
.stat-title { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.stat-value { margin-top: 8px; font-size: 26px; font-weight: 710; letter-spacing: -.04em; }
.stat-note { margin-top: 2px; color: var(--muted-2); font-size: 11px; }
.panel { padding: 18px; }
.panel + .panel { margin-top: 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.panel-heading h2, .section-title { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.notice { margin: 12px 0; padding: 12px 14px; border: 1px solid rgba(163,152,255,.19); border-radius: 9px; background: rgba(163,152,255,.075); color: #d2ceff; font-size: 12px; }
.notice.warning { border-color: rgba(240,200,120,.23); background: rgba(240,200,120,.07); color: #efd7a3; }
.notice.danger { border-color: rgba(242,126,145,.25); background: rgba(242,126,145,.08); color: #ffbcc6; }
.notice.success { border-color: rgba(104,216,172,.22); background: rgba(104,216,172,.07); color: #b3f1d6; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.055); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: rgba(13,13,22,.34); font-size: 10px; font-weight: 760; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
td { color: var(--text-soft); font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.018); }
.table-action { color: var(--accent); cursor: pointer; }
.table-primary { color: var(--text); font-weight: 650; }
.table-secondary { display: block; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 99px; color: var(--text-soft); background: rgba(255,255,255,.035); font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge.ok { color: var(--green); border-color: rgba(104,216,172,.22); background: rgba(104,216,172,.07); }
.badge.warn { color: var(--yellow); border-color: rgba(240,200,120,.23); background: rgba(240,200,120,.07); }
.badge.danger { color: var(--red); border-color: rgba(242,126,145,.22); background: rgba(242,126,145,.07); }
.badge.violet { color: var(--accent); border-color: rgba(163,152,255,.23); background: rgba(163,152,255,.08); }
.empty-state { display: grid; min-height: 120px; place-items: center; padding: 18px; border: 1px dashed var(--border-light); border-radius: 11px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; color: var(--text-soft); margin-bottom: 4px; }

.projection-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(320px,.85fr); gap: 15px; align-items: start; }
.goal-choices, .profile-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.choice-card { min-height: 88px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 5px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-soft); background: var(--surface-inset); text-align: left; cursor: pointer; transition: .16s; }
.choice-card:hover { border-color: var(--border-light); background: var(--surface-raised); }
.choice-card.selected { border-color: rgba(163,152,255,.54); color: var(--text); background: linear-gradient(145deg,rgba(110,98,198,.2),rgba(163,152,255,.075)); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 0 1px rgba(163,152,255,.07); }
.choice-card strong { font-size: 12px; }
.choice-card span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.product-list { display: grid; gap: 9px; }
.product-config { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(105px,.55fr) repeat(3,minmax(82px,.5fr)); align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: rgba(18,18,28,.5); }
.product-config-name { min-width: 0; }
.product-config-name strong { display: block; color: var(--text-soft); font-size: 12px; }
.product-config-name small { display: block; color: var(--muted); font-size: 10px; }
.product-config .field { margin: 0; gap: 4px; }
.product-config .field label { color: var(--muted); font-size: 9px; }
.product-config input { min-height: 34px; padding: 7px 8px; font-size: 11px; }
.product-config .product-selector { display: flex; align-items: center; gap: 7px; }
.product-selector input { accent-color: var(--accent-strong); width: 16px; height: 16px; }
.product-catalog { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.product-card { overflow: hidden; cursor: pointer; transition: transform .17s,border-color .17s,box-shadow .17s; }
.product-card:hover { transform: translateY(-2px); border-color: var(--border-light); box-shadow: var(--shadow); }
.product-card-top { display: flex; justify-content: space-between; gap: 8px; padding: 14px 15px 8px; }
.product-card h3 { margin: 0; font-size: 14px; }
.product-card-body { padding: 0 15px 15px; }
.product-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0 9px; }
.stars { color: #d8c071; letter-spacing: .04em; }
.product-card p { margin: 0; color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.detail-item { padding: 12px; border-radius: 9px; background: rgba(13,13,22,.35); }
.detail-item small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.detail-item strong { color: var(--text); font-weight: 620; }

.result-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.result-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 10px; margin: 13px 0; }
.result-card { padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: rgba(14,14,22,.45); }
.result-card small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.result-card strong { font-size: 18px; letter-spacing: -.035em; }
.scenario-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 3px 0 10px; }
.scenario-tab { padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: transparent; white-space: nowrap; cursor: pointer; }
.scenario-tab.active { color: #e2deff; border-color: rgba(163,152,255,.38); background: var(--accent-wash); }
.chart-panel { min-height: 285px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: #171722; overflow: hidden; }
.chart-panel svg { display: block; width: 100%; height: 260px; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 4px 0 10px; color: var(--muted); font-size: 10px; }
.chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: rgba(13,13,22,.24); }
.chart-controls label { color: var(--text-soft); font-size: 11px; }
.chart-controls input[type="range"] { width: min(180px,28vw); accent-color: var(--accent-strong); }
.chart-controls span { margin-left: auto; color: var(--muted); font-size: 10px; }
.cycle-range-note { display:block; margin-top:6px; color:var(--muted); font-size:10px; line-height:1.55; }
.projection-charts { margin-top:18px; }
.projection-charts-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:14px; margin:0 0 12px; }
.projection-charts-heading h3 { margin:0; font-size:16px; }
.projection-charts-heading p { margin:5px 0 0; color:var(--muted); font-size:11px; }
.projection-chart-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.insight-chart { min-width:0; padding:14px; border:1px solid var(--border); border-radius:12px; background:linear-gradient(155deg,rgba(29,29,43,.93),rgba(20,20,30,.96)); }
.insight-chart-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:8px; }
.insight-chart-title h4 { margin:0; font-size:12px; font-weight:650; }
.insight-chart-title small { display:block; margin-top:4px; color:var(--muted); font-size:10px; }
.insight-chart svg { display:block; width:100%; height:150px; overflow:visible; }
.insight-legend { display:flex; flex-wrap:wrap; gap:7px 13px; margin:5px 0 1px; color:var(--muted); font-size:9px; }
.insight-legend span { display:inline-flex; align-items:center; gap:5px; }
.allocation-chart { display:grid; grid-template-columns:minmax(110px,160px) minmax(0,1fr); align-items:center; gap:8px; }
.allocation-chart svg { width:100%; height:152px; }
.allocation-legend { display:grid; gap:8px; max-height:150px; overflow:auto; }
.allocation-legend-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:7px; color:var(--text-soft); font-size:9px; }
.allocation-legend-item strong { color:var(--text); font-size:9px; white-space:nowrap; }
.chart-metric-negative { color:#ff8e9d; font-size:12px; }
.positive-value { color:#61d6c2; font-weight:650; }
.negative-value { color:#ff8e9d; font-weight:650; }
.legend-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.tab-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 13px; }
.tab-button { padding: 8px 11px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.tab-button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab-button.active { border-color: var(--border); color: var(--text); background: var(--surface-raised); }

.benefit-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.benefit-card { padding: 15px; }
.benefit-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.benefit-card h3 { margin: 0; font-size: 14px; }
.benefit-card p { margin: 9px 0; color: var(--text-soft); font-size: 12px; }
.benefit-reason { padding: 10px; border-radius: 8px; color: var(--muted); background: rgba(13,13,22,.32); font-size: 11px; }
.benefit-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 11px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.checkbox-card { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-soft); background: rgba(13,13,22,.25); font-size: 12px; }
.checkbox-card input { accent-color: var(--accent-strong); }
.filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; margin-bottom: 12px; }
.filter-row .field { min-width: 140px; margin: 0; }
.filter-row .field.search { flex: 1; min-width: 210px; }
.tunnel-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.tunnel-status { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(13,13,22,.34); }
.tunnel-url { word-break: break-all; color: var(--accent); font-size: 12px; }
.profile-card { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: rgba(13,13,22,.35); }
.profile-card .avatar { width: 42px; height: 42px; }
.profile-meta strong { display: block; }
.profile-meta span { color: var(--muted); font-size: 11px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5,5,10,.74); backdrop-filter: blur(8px); animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(100%,760px); max-height: min(90vh,900px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border-light); border-radius: 16px; background: #1c1c2a; box-shadow: 0 28px 90px rgba(0,0,0,.58); }
.modal.wide { width: min(100%,1020px); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 17px 19px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 12px 18px; border-top: 1px solid var(--border); }
.close-button { width: 32px; height: 32px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; font-size: 19px; cursor: pointer; }
.close-button:hover { color: var(--text); background: var(--surface-high); }
.toast-root { position: fixed; z-index: 150; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; width: min(390px,calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--border-light); border-radius: 10px; color: var(--text); background: #282839; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.error { border-color: rgba(242,126,145,.42); }
.toast.success { border-color: rgba(104,216,172,.37); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.image-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 10px; }
.image-gallery button { display: grid; place-items: center; min-height: 140px; padding: 5px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-inset); cursor: zoom-in; }
.image-gallery img { display: block; max-width: 100%; max-height: 260px; object-fit: contain; }
.lightbox-image { max-width: 100%; max-height: 70vh; object-fit: contain; }
.file-drop { display: block; padding: 16px; border: 1px dashed var(--border-light); border-radius: 10px; color: var(--muted); background: rgba(13,13,22,.3); }
.disclaimer { margin: 15px 0 0; padding: 12px; border: 1px solid rgba(240,200,120,.19); border-radius: 8px; color: #c8b58f; background: rgba(240,200,120,.045); font-size: 10px; }
.hidden { display: none !important; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 218px minmax(0,1fr); }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .projection-layout { grid-template-columns: 1fr; }
  .product-config { grid-template-columns: minmax(0,1.2fr) minmax(100px,.55fr) repeat(3,minmax(74px,.5fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(288px,86vw); height: 100dvh; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-scrim { position: fixed; z-index: 45; inset: 0; background: rgba(0,0,0,.58); }
  .mobile-menu { display: inline-flex; }
  .topbar { min-height: 56px; padding: 0 14px; }
  .topbar-title { margin-right: auto; }
  .topbar { gap: 7px; }
  .topbar-tools { gap: 4px; }
  .topbar-tools > .btn { padding-inline: 7px; }
  .notification-menu { right: -65px; }
  .chart-controls span { flex-basis: 100%; margin-left: 0; }
  .projection-chart-grid { grid-template-columns:1fr; }
  .allocation-chart { grid-template-columns:minmax(100px,140px) minmax(0,1fr); }
  .ws-state span:last-child { display: none; }
  .content { padding: 19px 14px 30px; }
  .page-heading { display: block; }
  .page-heading > .btn-row { margin-top: 13px; }
  .form-grid.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .goal-choices, .profile-choices { grid-template-columns: 1fr; }
  .choice-card { min-height: 58px; }
  .product-catalog, .benefit-grid, .tunnel-grid { grid-template-columns: 1fr; }
  .product-config { min-width: 650px; }
  .product-config-scroll { overflow-x: auto; padding-bottom: 5px; }
  .result-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .result-card strong { font-size: 16px; }
  .modal-backdrop { padding: 9px; }
  .modal { max-height: 94dvh; border-radius: 12px; }
  .modal-body { padding: 14px; }
}
@media (max-width: 450px) {
  .auth-screen { padding: 13px; }
  .auth-card { padding: 22px 18px; }
  .brand-wordmark { width: 190px; height: 40px; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 92px; padding: 12px; }
  .stat-value { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.three { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .btn-row .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.gestor-frame{display:block;width:100%;height:calc(100dvh - 126px);min-height:660px;border:1px solid rgba(164,177,205,.16);border-radius:18px;background:#0b0c0f;box-shadow:0 20px 60px rgba(0,0,0,.24)}
@media(max-width:760px){.gestor-frame{height:calc(100dvh - 102px);min-height:620px;border-radius:12px}}
