:root {
  color-scheme: light;
  --gallery: #fff;
  --mist: #f5f5f7;
  --frost: #fafafc;
  --line: #d6d6d6;
  --control: #e6e6e8;
  --ink: #1d1d1f;
  --slate: #707070;
  --steel: #86868b;
  --blue: #0066cc;
  --blue-action: #0071e3;
  --green: #248a54;
  --red: #c53d3d;
  --amber: #9a6500;
  --font-display: "SF Pro Display", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-text: "SF Pro Text", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-card: 28px;
  --radius-nav: 20px;
  --radius-button: 9999px;
  --section-gap: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--gallery); color: var(--ink); font: 15px/1.45 var(--font-text); letter-spacing: -.02em; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }

.global-nav { position: sticky; top: 0; z-index: 20; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 0 max(24px, calc((100vw - 1320px)/2)); background: rgba(250,250,252,.92); border-bottom: 1px solid rgba(214,214,214,.75); backdrop-filter: blur(20px); }
.brand { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand-mark { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); }
.brand-mark svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font: 600 15px/1 var(--font-display); letter-spacing: -.5px; }
.brand-name span { color: var(--blue); }
.global-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); height: 100%; }
.global-links a { color: #5e5e63; font-size: 12px; transition: color .18s ease; }
.global-links a:hover, .global-links a.active { color: var(--ink); }
.global-actions { display: flex; align-items: center; gap: 13px; }
.sync-label { display: inline-flex; align-items: center; gap: 7px; color: var(--slate); font-size: 11px; white-space: nowrap; }
.live-dot { width: 6px; height: 6px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.icon-button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #515156; cursor: pointer; font-size: 18px; transition: background .18s ease, color .18s ease; }
.icon-button:hover { background: var(--control); color: var(--ink); }

.main-content { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }
.product-nav { position: sticky; top: 48px; z-index: 10; display: flex; align-items: center; justify-content: space-between; min-height: 58px; margin: 0 -14px; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(18px); }
.product-title { font: 600 19px/1.2 var(--font-display); letter-spacing: -.35px; }
.product-actions { display: flex; align-items: center; gap: 12px; }
.account-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--slate); font-size: 11px; }
.account-chip .live-dot { width: 7px; height: 7px; }
.button-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; padding: 0 15px; border-radius: var(--radius-button); background: var(--blue-action); color: white; font-size: 12px; transition: background .18s ease, transform .18s ease; }
.button-primary:hover { background: #0064c8; transform: translateY(-1px); }
.button-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; padding: 0 15px; border-radius: var(--radius-button); background: var(--control); color: var(--ink); font-size: 12px; margin-left: 8px; border: 1px solid var(--line); cursor: pointer; transition: background .18s ease; }
.button-secondary:hover { background: #d4d4d8; }

.hero-stage { min-height: 300px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 63px 4px 58px; }
.hero-copy { max-width: 720px; }
.eyebrow, .section-kicker { display: flex; align-items: center; gap: 8px; color: var(--slate); font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.eyebrow-line { width: 18px; height: 1px; background: var(--blue); }
.hero-stage h1 { margin: 14px 0 12px; font: 600 clamp(48px, 7.1vw, 80px)/1.02 var(--font-display); letter-spacing: -.06em; }
.hero-stage p { color: var(--slate); font-size: 17px; line-height: 1.4; letter-spacing: -.02em; }
.hero-status { display: flex; align-items: center; gap: 11px; min-width: 220px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-button); background: var(--gallery); }
.hero-status strong, .hero-status small { display: block; }
.hero-status strong { font-size: 12px; font-weight: 600; }
.hero-status small { margin-top: 3px; color: var(--slate); font-size: 11px; }
.status-orb { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.status-orb.off { background: var(--red); }

.metrics-band { width: 100vw; margin: 0 0 0 calc((min(1180px, 100vw - 64px) - 100vw)/2); padding: 43px max(32px, calc((100vw - 1180px)/2)) 48px; background: var(--mist); }
.section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-intro h2, .panel-heading h2 { margin: 5px 0 0; font: 600 30px/1.12 var(--font-display); letter-spacing: -.04em; }
.section-intro p { margin-top: 7px; color: var(--slate); font-size: 13px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-width: 0; min-height: 142px; padding: 20px; border-radius: 22px; background: var(--gallery); }
.metric-top, .metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-top { color: var(--slate); font-size: 12px; }
.metric-symbol { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-size: 12px; }
.metric-icon { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; }
.metric-icon.green { background: #e8f4ec; color: var(--green); }
.metric-icon.blue { background: #e9f2fc; color: var(--blue); }
.metric-icon.amber { background: #f6f0e2; color: var(--amber); }
.metric-value { overflow: hidden; margin: 13px 0 10px; color: var(--ink); font: 600 clamp(23px, 2.6vw, 32px)/1.1 var(--font-display); letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; }
.balance-card .metric-value { color: var(--blue); }
.metric-foot { justify-content: flex-start; color: var(--slate); font-size: 11px; }
.metric-subvalue { color: #55555a; font: 11px var(--font-mono); }
.metric-chip, .count-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 0 10px; border-radius: var(--radius-button); background: #e8f1fc; color: var(--blue); font-size: 10px; font-weight: 600; letter-spacing: .02em; }

.portfolio-band { width: 100vw; margin: 0 0 0 calc((min(1180px, 100vw - 64px) - 100vw)/2); padding: 54px max(32px, calc((100vw - 1180px)/2)) 60px; background: var(--gallery); }
.portfolio-band .section-intro { align-items: center; margin-bottom: 22px; }
.table-wrap { overflow: auto; border-radius: 22px; background: var(--mist); }
table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; }
th { padding: 15px 18px 12px; border-bottom: 1px solid var(--line); color: var(--slate); font-size: 11px; font-weight: 500; white-space: nowrap; }
td { padding: 16px 18px; border-bottom: 1px solid #e5e5e7; color: #39393d; font-size: 12px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.asset-cell { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.asset-cell small { color: var(--slate); font: 10px var(--font-mono); }
.asset-mini { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #e8f1fc; color: var(--blue); font-size: 9px; }
.side-pill { padding: 5px 9px; border-radius: var(--radius-button); background: #e8f4ec; color: var(--green); font-size: 10px; font-weight: 600; }
.side-pill.sell { background: #fbeceb; color: var(--red); }
.pnl-value { font: 12px var(--font-mono); }
.sl-tp { color: var(--slate); font: 11px var(--font-mono); }
.empty-cell { padding: 38px 18px; color: var(--slate); text-align: center; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.support-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 18px; margin-bottom: var(--section-gap); }
.support-card { min-width: 0; padding: 25px 26px; border-radius: var(--radius-card); background: var(--mist); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.panel-heading h2 { font-size: 24px; }
.health-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; white-space: nowrap; }
.health-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.health-badge.warn { color: var(--amber); }
.health-row { display: flex; align-items: center; gap: 10px; min-height: 46px; border-bottom: 1px solid #e1e1e4; }
.health-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e8e8eb; color: #56565b; font-size: 11px; }
.deriv-icon { background: #e8f1fc; color: var(--blue); font-weight: 700; }
.health-name { color: #444449; font-size: 12px; }
.health-state { margin-left: auto; color: var(--slate); font-size: 11px; }
.health-led { width: 6px; height: 6px; border-radius: 50%; background: #b7b7bc; }
.health-led.neutral { background: #aaaab0; }
.health-led.ok { background: var(--green); }
.health-led.bad { background: var(--red); }
.runtime-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 15px; color: var(--slate); font-size: 11px; }
.blocked-tag { color: #875a00; font-size: 10px; font-weight: 600; }
.text-link { color: var(--blue); font-size: 12px; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.deriv-account { margin-bottom: 8px; color: var(--slate); font-size: 12px; }
.deriv-market-list { min-height: 24px; }
.deriv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid #e1e1e4; }
.deriv-question { max-width: 75%; color: #39393d; font-size: 12px; line-height: 1.35; }
.deriv-question small { display: block; margin-top: 4px; color: var(--slate); font: 10px var(--font-mono); }
.deriv-label { color: var(--green); font: 12px var(--font-mono); white-space: nowrap; }
.deriv-footnote { margin-top: 10px; color: var(--slate); font-size: 11px; }
.empty-state { padding: 18px 0; color: var(--slate); font-size: 12px; }

.activity-section { padding: 46px 0 52px; border-top: 1px solid var(--line); }
.activity-section .section-intro { align-items: center; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 68px; border-top: 1px solid #e5e5e7; }
.activity-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #e8f4ec; color: var(--green); font-size: 14px; }
.activity-icon.loss { background: #fbeceb; color: var(--red); }
.activity-main { min-width: 0; }
.activity-main strong { display: block; color: #333338; font-size: 12px; font-weight: 600; }
.activity-main small { display: block; overflow: hidden; margin-top: 4px; color: var(--slate); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.scan-badge { display: inline-block; margin-left: 6px; padding: 3px 7px; border-radius: var(--radius-button); background: #e8e8eb; color: #626269; font-size: 9px; font-weight: 500; vertical-align: 1px; }
.activity-amount { color: #4a4a50; text-align: right; font: 12px var(--font-mono); }
.activity-amount small { display: block; margin-top: 4px; color: var(--slate); font: 9px var(--font-text); letter-spacing: .04em; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; padding: 18px 0 26px; border-top: 1px solid var(--line); color: var(--slate); font-size: 10px; }
.page-footer b { margin: 0 4px; color: var(--blue); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: calc(100vw - 32px); padding: 12px 17px; transform: translateY(8px); border: 1px solid var(--line); border-radius: var(--radius-button); background: var(--frost); color: var(--ink); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 900px) {
  .global-nav { gap: 18px; padding-inline: 24px; }
  .global-links { gap: 18px; }
  .main-content { width: calc(100% - 48px); }
  .metrics-band, .portfolio-band { margin-left: -24px; padding-inline: 24px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  :root { --section-gap: 48px; }
  .global-nav { height: 46px; gap: 12px; padding-inline: 16px; }
  .global-links { gap: 13px; }
  .global-links a { font-size: 11px; }
  .global-links a:nth-child(3) { display: none; }
  .sync-label { width: 7px; overflow: hidden; font-size: 0; }
  .sync-label .live-dot { width: 7px; height: 7px; }
  .global-actions { gap: 4px; }
  .main-content { width: calc(100% - 32px); }
  .product-nav { top: 46px; min-height: 52px; margin-inline: -4px; padding-inline: 4px; }
  .product-title { font-size: 17px; }
  .hero-stage { min-height: 0; display: block; padding: 47px 0 42px; }
  .hero-stage h1 { margin-top: 12px; font-size: clamp(46px, 12vw, 64px); }
  .hero-stage p { max-width: 340px; font-size: 15px; }
  .hero-status { width: fit-content; min-width: 0; margin-top: 22px; padding: 10px 14px; }
  .metrics-band, .portfolio-band { margin-left: -16px; padding: 32px 16px 36px; }
  .section-intro h2 { font-size: 26px; }
  .metrics-grid { gap: 8px; }
  .metric-card { min-height: 125px; padding: 15px; border-radius: 18px; }
  .metric-top { font-size: 11px; }
  .metric-value { font-size: clamp(21px, 7vw, 28px); }
  .metric-foot { flex-wrap: wrap; font-size: 10px; }
  .support-grid { grid-template-columns: 1fr; gap: 12px; }
  .support-card { padding: 21px; border-radius: 22px; }
  .activity-section { padding: 35px 0; }
  .activity-section .section-intro { align-items: flex-start; }
  .activity-section .section-intro > .text-link { max-width: 110px; white-space: normal; text-align: right; }
}
.strategies-section { padding: 46px 0 52px; border-top: 1px solid var(--line); }
.strategy-workspace { display: grid; grid-template-columns: minmax(310px, .82fr) minmax(0, 1.18fr); align-items: start; gap: 18px; }
.strategy-form-card, .strategy-list-card { min-width: 0; padding: 25px; border: 1px solid #e6e6e8; border-radius: var(--radius-card); background: var(--frost); }
.strategy-form-card { position: sticky; top: 124px; }
.strategy-editor-heading { margin-bottom: 21px; }
.strategy-editor-heading h3, .panel-heading h3 { margin: 6px 0 0; font: 600 23px/1.1 var(--font-display); letter-spacing: -.04em; }
.strategy-editor-heading p { margin: 8px 0 0; color: var(--slate); font-size: 12px; }
.strategy-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; align-items: end; }
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.form-field[hidden] { display: none !important; }
.form-field-full { grid-column: 1 / -1; }
.form-field label { color: var(--slate); font-size: 11px; font-weight: 600; }
.form-field input, .form-field select { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--steel); border-radius: 11px; outline: 0; background: var(--gallery); color: var(--ink); font: 12px var(--font-text); }
.form-field input:focus, .form-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #0066cc18; }
.form-field small.field-hint { margin-top: 1px; color: var(--steel); font-size: 10px; line-height: 1.4; }
.section-divider { grid-column: 1 / -1; padding: 0 0 8px; color: var(--slate); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.strategy-type-section { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 4px 0; }
.strategy-type-section[hidden] { display: none; }
.strategy-risk-note { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border-radius: 13px; background: #eaf2fb; color: #4f6178; font-size: 10px; line-height: 1.5; }
.risk-note-icon { display: grid; width: 17px; height: 17px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #d8e8fa; color: var(--blue); font-size: 11px; font-weight: 700; }
.strategy-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 3px; }
.strategy-enable { display: inline-flex; align-items: center; gap: 8px; color: #45454b; font-size: 11px; font-weight: 600; cursor: pointer; }
.strategy-enable input { accent-color: var(--blue-action); }
.strategy-action-buttons { display: flex; align-items: center; gap: 8px; }
.strategy-action-buttons .button-secondary { margin: 0; }
#s-cancel[hidden] { display: none !important; }
.strategy-list-card { background: var(--mist); }
.strategy-list-card .panel-heading { margin-bottom: 17px; }
.strategies-list { display: grid; gap: 10px; }
.strategy-item { min-width: 0; padding: 16px; border: 1px solid #e4e4e7; border-radius: 18px; background: var(--gallery); }
.strategy-item-head, .strategy-item-title, .strategy-item-actions { display: flex; align-items: center; }
.strategy-item-head { justify-content: space-between; gap: 12px; }
.strategy-item-title { min-width: 0; gap: 9px; }
.strategy-item-title > div { min-width: 0; }
.strategy-item-title strong { display: block; overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.strategy-item-title code { display: block; margin-top: 3px; color: var(--slate); font: 10px var(--font-mono); }
.strategy-item-actions { flex: 0 0 auto; gap: 3px; }
.strategy-item-actions button { width: 32px; height: 32px; }
.strategy-item-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #ededf0; }
.strategy-metric small, .strategy-metric strong { display: block; }
.strategy-metric small { color: var(--steel); font-size: 9px; }
.strategy-metric strong { overflow: hidden; margin-top: 3px; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.strategy-badge { display: inline-flex; align-items: center; min-height: 21px; padding: 0 8px; border-radius: var(--radius-button); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.strategy-badge.STEP300 { background: #e8f1fc; color: var(--blue); }
.strategy-badge.CRYPTO { background: #e9f2fc; color: #0066cc; }
.strategy-badge.ACCUMULATOR { background: #f6f0e2; color: var(--amber); }

@media (max-width: 920px) {
  .strategy-workspace { grid-template-columns: 1fr; }
  .strategy-form-card { position: static; }
}

@media (max-width: 420px) {
  .global-links a:nth-child(2) { display: none; }
  .brand-name { font-size: 14px; }
  .product-actions { gap: 8px; }
  .account-chip { font-size: 10px; }
  .button-primary { min-height: 30px; padding-inline: 12px; font-size: 11px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 12px; }
  .section-intro { gap: 10px; }
  .section-intro .metric-chip { font-size: 9px; }
  .strategy-form-card, .strategy-list-card { padding: 18px; border-radius: 21px; }
  .strategy-form-grid { gap: 11px; }
  .strategy-type-section { grid-template-columns: 1fr; }
  .strategy-item { padding: 13px; }
  .strategy-item-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .strategy-form-actions { align-items: flex-start; flex-direction: column; }
  .activity-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 9px; }
  .activity-main small { max-width: 55vw; }
}
