:root {
  --ink: #15231e;
  --muted: #647169;
  --paper: #f5f3ed;
  --panel: #fffef9;
  --line: #d9ddd5;
  --green: #1f7a53;
  --green-bright: #a7efbe;
  --green-pale: #e5f4e9;
  --orange: #d36a3c;
  --orange-pale: #f8e8de;
  --nav: #13241d;
  --nav-muted: #9db0a6;
  --shadow: 0 18px 44px rgba(21, 35, 30, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(31, 122, 83, .28); outline-offset: 2px; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 22px 24px; background: var(--nav); color: white; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; letter-spacing: -.02em; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font-size: 20px; }
.brand small { margin-top: 5px; color: var(--green-bright); font-size: 9px; letter-spacing: .22em; }
.brand-mark { width: 36px; height: 36px; border: 1px solid rgba(167, 239, 190, .35); border-radius: 50%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 9px; }
.brand-mark span { width: 4px; border-radius: 4px; background: var(--green-bright); }
.brand-mark span:nth-child(1) { height: 8px; }.brand-mark span:nth-child(2) { height: 16px; }.brand-mark span:nth-child(3) { height: 12px; }
.nav-list { margin-top: 54px; display: grid; gap: 8px; }
.nav-item { appearance: none; border: 0; background: transparent; color: var(--nav-muted); width: 100%; text-align: left; padding: 13px 12px; border-radius: 10px; cursor: pointer; font-weight: 650; display: flex; gap: 12px; align-items: center; }
.nav-item span { font-size: 10px; color: #71857b; letter-spacing: .08em; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.08); color: white; }
.nav-item.active span { color: var(--green-bright); }
.sidebar-status { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px; display: grid; gap: 17px; }
.status-row { display: flex; gap: 11px; align-items: center; }
.status-row > span:last-child { display: grid; gap: 3px; }
.status-row small { color: #73877d; font-size: 9px; letter-spacing: .14em; }
.status-row strong { color: #dfe8e3; font-size: 12px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 4px rgba(167,239,190,.12); }
.status-dot.disconnected { background: #f0ad86; box-shadow: 0 0 0 4px rgba(240,173,134,.12); }
.status-dot.muted { background: #61736a; box-shadow: none; }
.logout-form { margin-top: 20px; }.logout-form button { border: 0; padding: 8px 0; background: none; color: #82948b; cursor: pointer; font-size: 12px; }.logout-form button:hover { color: white; }

.main-content { min-width: 0; padding: 32px clamp(24px, 4vw, 64px) 24px; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 7px; text-transform: uppercase; letter-spacing: .16em; font-size: 10px; font-weight: 800; color: var(--green); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(31px, 4vw, 46px); line-height: 1; letter-spacing: -.035em; font-weight: 500; }
h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 24px; line-height: 1.1; font-weight: 500; letter-spacing: -.02em; }
h3 { font-size: 17px; margin-bottom: 5px; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.market-clock { color: var(--muted); font-size: 12px; }
.button { border: 0; border-radius: 10px; min-height: 42px; padding: 0 18px; cursor: pointer; font-weight: 750; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button-primary { background: var(--ink); color: white; }.button-primary:hover { background: var(--green); }
.button-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button.full { width: 100%; }
.text-button { border: 0; background: none; color: var(--green); font-weight: 750; cursor: pointer; padding: 5px; }

.setup-banner { border-radius: 14px; padding: 16px 18px; margin-bottom: 24px; background: #fff3df; border: 1px solid #edc991; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.banner-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #edc175; font-weight: 900; }
.setup-banner strong { font-size: 14px; }.setup-banner p { margin: 4px 0 0; color: #725d3a; font-size: 12px; }
.banner-tag { font-size: 9px; letter-spacing: .14em; color: #7f5d21; font-weight: 850; }
.view { display: none; animation: reveal .22s ease; }.view.active { display: block; }
@keyframes reveal { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -24px; bottom: -30px; width: 90px; height: 90px; border: 1px solid #e7e8e2; border-radius: 50%; }
.metric-card.accent-green { background: var(--green-pale); border-color: #c5dfcc; }.metric-card.accent-orange { background: var(--orange-pale); border-color: #edcfbe; }
.metric-card > span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .11em; font-weight: 750; }
.metric-card > strong { display: block; margin: 19px 0 10px; font-family: Georgia, serif; font-weight: 500; font-size: 41px; line-height: .9; }
.metric-card > strong.metric-text { font-family: inherit; font-size: 17px; font-weight: 800; line-height: 1.15; }
.metric-card > small { color: var(--muted); font-size: 11px; }
.section-heading, .panel-heading, .page-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.section-heading { margin: 38px 0 15px; }.section-note { color: var(--muted); font-size: 11px; }
.signal-list { display: grid; gap: 11px; }
.empty-state { border: 1px dashed #c7cec6; border-radius: var(--radius); padding: 40px 24px; text-align: center; background: rgba(255,255,255,.45); }
.empty-state strong { display: block; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }.empty-state p { color: var(--muted); margin: 8px auto 0; max-width: 520px; font-size: 13px; }
.signal-card { display: grid; grid-template-columns: 88px minmax(150px, 1fr) repeat(4, minmax(80px, .55fr)) minmax(170px, 1.25fr); gap: 16px; align-items: center; padding: 17px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.signal-symbol { display: flex; align-items: center; gap: 10px; }.signal-badge { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--green-pale); color: var(--green); font-size: 10px; font-weight: 850; }.signal-badge.sell { background: var(--orange-pale); color: var(--orange); }
.signal-symbol strong { font-size: 15px; }.signal-company { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signal-stat small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 5px; }.signal-stat strong { font-size: 14px; }
.news-links { display: flex; flex-wrap: wrap; gap: 6px; }.news-links a { color: var(--ink); background: #eef1eb; border-radius: 999px; padding: 6px 9px; font-size: 10px; text-decoration: none; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }.news-links a:hover { background: var(--green-pale); color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-top: 30px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; }
.rule-flow { margin-top: 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }.rule-node { position: relative; border-left: 2px solid var(--green); padding: 3px 10px; }.rule-node small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }.rule-node strong { display: block; margin-top: 5px; font-size: 13px; }
.compact-list { display: grid; margin-top: 15px; }.compact-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-top: 1px solid #e9ebe5; }.compact-row:first-child { border-top: 0; }.compact-row strong { font-size: 13px; }.compact-row small { display: block; color: var(--muted); margin-top: 3px; }.compact-value { text-align: right; }

.page-intro { align-items: center; margin: 6px 0 24px; }.page-intro p:not(.eyebrow) { max-width: 660px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }.safety-chip { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; font-weight: 750; color: var(--muted); }.safety-chip span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.criteria-form { display: grid; gap: 14px; }.form-section { padding: 26px; }.form-section-title { display: flex; gap: 14px; align-items: flex-start; border-bottom: 1px solid #e7e9e3; padding-bottom: 17px; margin-bottom: 20px; }.form-section-title > span { color: var(--green); font-size: 10px; letter-spacing: .1em; font-weight: 850; margin-top: 4px; }.form-section-title h3 { margin: 0; }.form-section-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.field-grid { display: grid; gap: 14px; }.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: #405049; font-size: 11px; font-weight: 750; }
input, textarea { width: 100%; border: 1px solid #cfd5cd; border-radius: 10px; padding: 11px 12px; background: #fbfbf7; color: var(--ink); transition: border .15s ease, box-shadow .15s ease; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,122,83,.1); outline: none; }
textarea { resize: vertical; }
.choice-group { border: 0; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.choice-group legend { margin-bottom: 8px; color: #405049; font-size: 11px; font-weight: 750; }.choice-card { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 13px; cursor: pointer; }.choice-card:has(input:checked) { border-color: var(--green); background: var(--green-pale); }.choice-card input { width: auto; margin-top: 2px; accent-color: var(--green); }.choice-card strong, .choice-card small { display: block; }.choice-card small { color: var(--muted); line-height: 1.4; margin-top: 4px; font-weight: 500; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; cursor: pointer; }.switch-row strong, .switch-row small { display: block; }.switch-row small { margin-top: 4px; color: var(--muted); font-weight: 500; }.switch-row input { position: absolute; opacity: 0; pointer-events: none; }.switch-row i { position: relative; width: 44px; height: 24px; flex: 0 0 44px; border-radius: 999px; background: #ced4cd; transition: background .15s; }.switch-row i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }.switch-row input:checked + i { background: var(--green); }.switch-row input:checked + i::after { transform: translateX(20px); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 18px; }.form-actions span { color: var(--green); font-size: 12px; }

.portfolio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }.count-pill { padding: 5px 9px; background: #eef1eb; border-radius: 999px; color: var(--muted); font-size: 10px; }.table-wrap { overflow-x: auto; margin: 18px -8px -5px; }table { width: 100%; border-collapse: collapse; min-width: 720px; }th { padding: 10px 8px; text-align: left; color: #7b867f; font-size: 9px; letter-spacing: .11em; text-transform: uppercase; border-bottom: 1px solid var(--line); }td { padding: 14px 8px; border-bottom: 1px solid #eceee8; font-size: 12px; }td strong { font-size: 13px; }.research-link { color: var(--green); font-weight: 750; text-decoration: none; }.icon-button { border: 0; background: transparent; color: #8c9891; cursor: pointer; font-weight: 800; }.icon-button:hover { color: var(--orange); }.add-position-panel h2 { margin-bottom: 20px; }.add-position-panel form { display: grid; gap: 14px; }
.alert-list { display: grid; gap: 10px; }.alert-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }.alert-card.new { border-left: 4px solid var(--orange); }.alert-type { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--green); background: var(--green-pale); font-size: 10px; font-weight: 850; text-transform: uppercase; }.alert-type.sell { color: var(--orange); background: var(--orange-pale); }.alert-copy strong { display: block; font-size: 14px; }.alert-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }.alert-copy small { display: block; margin-top: 6px; color: #98a29c; }.alert-actions { display: flex; gap: 8px; }
footer { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 18px; display: flex; justify-content: space-between; gap: 20px; color: #7c8881; font-size: 10px; }footer p { margin: 0; }footer strong { color: var(--orange); }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 16px; border-radius: 11px; background: var(--ink); color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; font-size: 12px; z-index: 20; }.toast.show { opacity: 1; transform: translateY(0); }

.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--nav); padding: 24px; }
.login-shell { width: min(920px, 100%); min-height: 560px; display: grid; grid-template-columns: 1fr .9fr; border-radius: 28px; overflow: hidden; background: var(--panel); box-shadow: 0 40px 90px rgba(0,0,0,.25); }
.login-panel { padding: clamp(36px, 7vw, 74px); display: flex; flex-direction: column; align-items: flex-start; }.login-panel .brand-mark { border-color: #bcd6c4; margin-bottom: 45px; }.login-panel h1 { max-width: 390px; }.login-intro { color: var(--muted); line-height: 1.6; margin: 20px 0 30px; }.login-form { width: 100%; display: grid; gap: 13px; }.login-form .button { margin-top: 5px; }.form-error { color: #a8412c; background: #fce9e2; border-radius: 8px; padding: 9px 11px; margin: 0; font-size: 12px; }.login-note { margin-top: auto; padding-top: 30px; color: #87928c; font-size: 10px; line-height: 1.5; }
.login-aside { position: relative; overflow: hidden; display: grid; place-items: center; background: #1b392d; }.radar-orbit { position: absolute; border: 1px solid rgba(167,239,190,.18); border-radius: 50%; }.orbit-one { width: 190px; height: 190px; }.orbit-two { width: 330px; height: 330px; }.orbit-three { width: 500px; height: 500px; }.radar-sweep { position: absolute; width: 250px; height: 250px; background: conic-gradient(from 270deg, rgba(167,239,190,.34), transparent 25%); border-radius: 50%; animation: sweep 8s linear infinite; }.radar-point { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 6px rgba(167,239,190,.1); }.point-one { transform: translate(82px,-70px); }.point-two { transform: translate(-105px,95px); }.login-aside p { position: relative; z-index: 2; display: grid; text-align: center; color: white; font-size: 12px; letter-spacing: .08em; }.login-aside strong { font-family: Georgia, serif; font-size: 72px; line-height: 1; font-weight: 500; color: var(--green-bright); }.login-aside span { margin-top: 7px; font-size: 9px; color: #9fb9ac; letter-spacing: .18em; }@keyframes sweep { to { transform: rotate(360deg); } }

@media (max-width: 1100px) { .metric-grid { grid-template-columns: repeat(2, 1fr); }.signal-card { grid-template-columns: 78px minmax(150px,1fr) repeat(2,minmax(80px,.5fr)); }.signal-card .signal-stat:nth-of-type(n+3) { display: none; }.news-links { grid-column: 2 / -1; }.portfolio-layout { grid-template-columns: 1fr; }.add-position-panel { max-width: 520px; } }
@media (max-width: 760px) { .app-shell { display: block; }.sidebar { position: static; width: 100%; height: auto; padding: 17px 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; }.nav-list { grid-column: 1 / -1; margin: 14px -4px 0; display: flex; overflow-x: auto; }.nav-item { width: auto; white-space: nowrap; padding: 10px; }.nav-item span { display: none; }.sidebar-status, .logout-form { display: none; }.main-content { padding: 22px 16px; }.topbar { align-items: flex-start; }.market-clock { display: none; }.metric-grid { grid-template-columns: 1fr 1fr; }.dashboard-grid { grid-template-columns: 1fr; }.field-grid.three, .field-grid.two, .choice-group { grid-template-columns: 1fr; }.rule-flow { grid-template-columns: 1fr 1fr; }.signal-card { grid-template-columns: 74px 1fr 80px; }.signal-card .signal-stat:nth-of-type(n+2) { display: none; }.news-links { grid-column: 1 / -1; }.setup-banner { grid-template-columns: auto 1fr; }.banner-tag { display: none; }.page-intro { align-items: flex-start; }.safety-chip { display: none; }.login-shell { grid-template-columns: 1fr; min-height: 0; }.login-aside { display: none; }.login-panel { min-height: 560px; } }
@media (max-width: 480px) { .metric-grid { grid-template-columns: 1fr; }.top-actions { flex-direction: column; align-items: flex-end; }.rule-flow { grid-template-columns: 1fr; }.alert-card { grid-template-columns: auto 1fr; }.alert-actions { grid-column: 2; }.section-heading { align-items: flex-start; }.section-note { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
