:root {
  color-scheme: light;
  --ink: #17221f;
  --muted: #68736f;
  --muted-2: #8d9692;
  --paper: #f4f5f0;
  --panel: #ffffff;
  --line: #e4e7e1;
  --line-strong: #d5dad2;
  --green: #176b4f;
  --green-2: #248561;
  --green-soft: #e8f3ed;
  --green-wash: #f3f8f5;
  --navy: #243c54;
  --amber: #a66b1c;
  --amber-soft: #fff3dd;
  --red: #b54a3d;
  --red-soft: #fff0ed;
  --blue-soft: #edf4fb;
  --shadow: 0 12px 32px rgba(27, 43, 37, 0.07);
  --shadow-soft: 0 5px 18px rgba(27, 43, 37, 0.05);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }

body { min-width: 1080px; }

button, input, textarea { font: inherit; }
button { color: inherit; }

.boot-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}

.boot-screen strong, .boot-screen span { display: block; }
.boot-screen strong { color: var(--ink); font-size: 18px; margin-bottom: 3px; }
.boot-screen span { font-size: 13px; }
.boot-mark, .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  font-family: Georgia, serif;
  font-size: 23px;
  font-style: italic;
  box-shadow: 0 7px 18px rgba(23, 107, 79, .22);
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px 1fr; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  padding: 24px 16px 18px;
  background: #fbfcf9;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 28px; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 20px; }
.brand-name { font-size: 16px; font-weight: 760; letter-spacing: -.02em; }
.brand-sub { margin-top: 2px; color: var(--muted-2); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.nav-group { display: grid; gap: 5px; }
.nav-label { padding: 7px 12px 6px; color: #9aa29e; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.nav-item {
  appearance: none;
  border: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  color: #59645f;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 570;
}
.nav-item:hover { background: #f1f4ef; color: var(--ink); }
.nav-item.active { background: var(--green-soft); color: var(--green); font-weight: 700; }
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.8; }
.nav-item .nav-count { margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 99px; background: white; color: var(--muted); }
.nav-item .ai-count { font-size: 8px; }
.nav-item .ai-count.online { background: #dcefe5; color: var(--green); }

.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.scope-card { padding: 13px; border: 1px solid #dfe6de; background: #f6f9f5; border-radius: 12px; }
.scope-card-top { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; font-weight: 700; }
.scope-card p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.status-dot { width: 6px; height: 6px; border-radius: 99px; background: #37a878; box-shadow: 0 0 0 3px #dff1e8; }
.profile { display: flex; align-items: center; gap: 9px; padding: 9px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #d8e4dc; color: var(--green); font-weight: 750; font-size: 12px; }
.profile strong, .profile span { display: block; }
.profile strong { font-size: 11px; }
.profile span { margin-top: 2px; color: var(--muted-2); font-size: 9px; }

.main-shell { grid-column: 2; min-width: 0; }
.topbar {
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 249, .92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 8;
  backdrop-filter: blur(14px);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-weight: 680; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.data-badge { appearance: none; display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #dae4dc; background: var(--green-wash); border-radius: 9px; color: #496158; font-size: 10px; }
.data-badge b { color: var(--green); }
.ai-badge { cursor: pointer; background: white; border-color: var(--line); }
.ai-badge .status-dot { background: #a9b0ac; box-shadow: 0 0 0 3px #eef0ed; }
.ai-badge.connected { background: var(--green-wash); border-color: #d5e4da; }
.ai-badge.connected .status-dot { background: #37a878; box-shadow: 0 0 0 3px #dff1e8; }
.icon-button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: white; display: grid; place-items: center; cursor: pointer; }
.icon-button svg { width: 15px; height: 15px; }

.page { padding: 30px 34px 44px; max-width: 1440px; margin: 0 auto; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 7px 0 7px; font-family: Georgia, "Songti SC", serif; font-size: 30px; line-height: 1.15; font-weight: 520; letter-spacing: -.025em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.primary-button, .secondary-button, .ghost-button {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 690;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.primary-button { background: var(--green); color: white; box-shadow: 0 5px 13px rgba(23, 107, 79, .18); }
.primary-button:hover { background: #105e45; }
.primary-button:disabled { background: #c8cfca; box-shadow: none; cursor: not-allowed; }
.secondary-button { border: 1px solid var(--line-strong); background: white; color: #43504b; }
.secondary-button:hover { background: #f8f9f6; }
.ghost-button { padding: 8px 10px; background: transparent; color: var(--green); }
.button-icon { width: 14px; height: 14px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .72fr); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-soft); }
.hero-card { padding: 24px; min-height: 214px; position: relative; overflow: hidden; background: linear-gradient(135deg, white 0%, white 62%, #edf5ef 100%); }
.hero-card::after { content: ""; position: absolute; width: 240px; height: 240px; right: -100px; top: -115px; border: 1px solid rgba(23,107,79,.15); border-radius: 50%; box-shadow: 0 0 0 28px rgba(23,107,79,.025), 0 0 0 57px rgba(23,107,79,.02); }
.hero-card h2 { max-width: 620px; margin: 11px 0 9px; font-family: Georgia, "Songti SC", serif; font-weight: 520; font-size: 24px; line-height: 1.35; }
.hero-card p { max-width: 630px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.hero-actions { display: flex; gap: 9px; margin-top: 22px; }
.mini-flow { margin-top: 25px; padding-top: 17px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 10px; }
.mini-flow b { color: var(--ink); font-weight: 650; }
.flow-arrow { color: #b0b7b2; }

.data-card { padding: 20px; }
.card-label { color: var(--muted-2); font-size: 10px; font-weight: 740; letter-spacing: .1em; text-transform: uppercase; }
.data-date { margin: 12px 0 3px; font-size: 25px; font-family: Georgia, serif; color: var(--navy); }
.data-card > p { margin: 0; color: var(--muted); font-size: 11px; }
.readiness-list { margin-top: 18px; display: grid; gap: 10px; }
.readiness-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.readiness-item span:first-child { color: #53605b; }
.tiny-tag { padding: 4px 7px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 700; }
.tiny-tag.pending { background: var(--amber-soft); color: var(--amber); }
.data-disclaimer { margin-top: 16px; padding: 10px; border-radius: 8px; background: #f7f8f5; color: var(--muted); font-size: 9px; line-height: 1.5; }

.section-title { margin: 29px 0 13px; display: flex; justify-content: space-between; align-items: center; }
.section-title h3 { margin: 0; font-size: 14px; }
.strategy-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.strategy-card { padding: 17px; cursor: pointer; transition: .18s ease; box-shadow: none; }
.strategy-card:hover { transform: translateY(-2px); border-color: #cbd9d0; box-shadow: var(--shadow); }
.strategy-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.strategy-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.strategy-icon svg { width: 17px; height: 17px; }
.status-pill { padding: 4px 7px; border-radius: 99px; font-size: 9px; font-weight: 730; }
.status-pill.draft { background: var(--amber-soft); color: var(--amber); }
.status-pill.ready { background: var(--green-soft); color: var(--green); }
.status-pill.archived { background: #f0f1ee; color: var(--muted); }
.strategy-card h4 { margin: 14px 0 6px; font-size: 13px; }
.strategy-card p { height: 34px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.strategy-meta { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted-2); font-size: 9px; }

.workspace-page { padding: 18px 22px 22px; max-width: none; height: calc(100vh - 64px); }
.workspace-grid { height: 100%; display: grid; grid-template-columns: minmax(360px, .86fr) minmax(540px, 1.35fr); gap: 14px; }
.workspace-panel { min-height: 0; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-soft); overflow: hidden; }
.conversation-panel { display: flex; flex-direction: column; }
.panel-head { min-height: 61px; padding: 13px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title { display: flex; align-items: center; gap: 10px; }
.assistant-mark { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: var(--ink); color: white; font-family: Georgia, serif; font-style: italic; }
.panel-title strong, .panel-title span { display: block; }
.panel-title strong { font-size: 12px; }
.panel-title span { margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.subtle-pill { padding: 5px 8px; border-radius: 99px; background: #f2f4f0; color: var(--muted); font-size: 9px; }
.ai-panel-pill { border: 0; cursor: pointer; }
.ai-panel-pill.connected { background: var(--green-soft); color: var(--green); font-weight: 680; }

.conversation { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(#fff, #fdfefc); }
.message { display: flex; gap: 9px; max-width: 91%; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar { flex: 0 0 auto; width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 750; }
.message.user .message-avatar { background: #e8ece9; color: #58625e; }
.bubble { padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: #f3f5f1; color: #3e4945; font-size: 11px; line-height: 1.6; }
.message.user .bubble { border-radius: 12px 4px 12px 12px; background: var(--green); color: white; }
.bubble strong { color: var(--ink); }
.ai-message-meta { margin: 5px 0 0 3px; color: var(--muted-2); font-size: 8px; }
.question-card { margin: 2px 0 2px 34px; padding: 12px; border: 1px solid #dfe6df; border-radius: 11px; background: #fbfdfb; }
.question-number { color: var(--green); font-size: 9px; font-weight: 780; letter-spacing: .07em; }
.question-card h4 { margin: 5px 0 5px; font-size: 11px; }
.question-card p { margin: 0 0 9px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.option-row { display: flex; gap: 6px; flex-wrap: wrap; }
.option-chip { border: 1px solid var(--line-strong); background: white; border-radius: 7px; padding: 6px 8px; color: #55615c; font-size: 9px; cursor: pointer; }
.option-chip:hover { border-color: #98b5a7; color: var(--green); }
.option-chip.selected { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 700; }
.system-note { margin-left: 34px; color: var(--muted-2); font-size: 9px; display: flex; align-items: center; gap: 6px; }
.system-note::before { content: ""; width: 13px; height: 1px; background: var(--line-strong); }
.composer-wrap { padding: 10px 13px 13px; border-top: 1px solid var(--line); }
.quick-prompts { display: flex; gap: 6px; margin-bottom: 8px; overflow: hidden; }
.quick-prompt { border: 0; background: #f2f5f1; color: var(--muted); padding: 5px 8px; border-radius: 6px; font-size: 8px; white-space: nowrap; cursor: pointer; }
.quick-prompt:hover { color: var(--green); background: var(--green-soft); }
.composer { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 8px 8px 10px; background: white; }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; height: 35px; color: var(--ink); font-size: 10px; line-height: 1.5; }
.send-button { flex: 0 0 auto; width: 30px; height: 30px; border: 0; border-radius: 8px; display: grid; place-items: center; background: var(--green); color: white; cursor: pointer; }
.send-button svg { width: 13px; height: 13px; }
.send-button:disabled { cursor: wait; background: #9db8aa; }
.thinking-dot { width: 5px; height: 5px; border-radius: 50%; background: white; box-shadow: -7px 0 0 rgba(255,255,255,.45), 7px 0 0 rgba(255,255,255,.7); animation: thinking 1s ease-in-out infinite; }
@keyframes thinking { 50% { opacity: .4; transform: translateY(-1px); } }

.strategy-panel { display: flex; flex-direction: column; }
.strategy-panel-head { min-height: 61px; padding: 12px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.strategy-title-row { display: flex; align-items: center; gap: 8px; }
.strategy-title-row h2 { margin: 0; font-size: 13px; }
.version-badge { padding: 4px 7px; border-radius: 6px; background: #f0f2ee; color: var(--muted); font-size: 8px; font-weight: 700; }
.draft-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--amber); font-size: 9px; }
.draft-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d79d4c; }
.panel-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 8px; background: #f1f3ef; }
.panel-tab { border: 0; background: transparent; padding: 6px 9px; border-radius: 6px; color: var(--muted); font-size: 9px; cursor: pointer; }
.panel-tab.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(20,30,25,.07); font-weight: 680; }
.strategy-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 17px 90px; background: #fcfdfb; }
.intent-quote { padding: 11px 13px; border-left: 3px solid #9ebbaa; background: var(--green-wash); color: #51615b; font-size: 10px; line-height: 1.5; border-radius: 0 8px 8px 0; }
.strategy-section { margin-top: 15px; background: white; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.section-head { min-height: 42px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.section-head-left { display: flex; align-items: center; gap: 9px; }
.section-icon { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.section-icon svg { width: 13px; height: 13px; }
.section-head h3 { margin: 0; font-size: 10px; }
.source-tag { padding: 3px 6px; border-radius: 5px; background: var(--blue-soft); color: #446989; font-size: 8px; }
.source-tag.suggested { background: var(--amber-soft); color: var(--amber); }
.rule-list { padding: 2px 12px; }
.rule-row { min-height: 39px; display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid #eff1ed; font-size: 10px; }
.rule-row:last-child { border-bottom: 0; }
.rule-label { color: var(--muted-2); }
.rule-value { color: #35413d; font-weight: 590; }
.rule-value em { font-style: normal; color: var(--green); }
.rule-state { color: #7f8985; font-size: 8px; }
.rule-state.missing { color: var(--amber); }
.rule-state.changed { color: var(--red); background: var(--red-soft); padding: 3px 5px; border-radius: 4px; }
.logic-chip { display: inline-block; padding: 3px 5px; margin-right: 5px; border-radius: 4px; background: #f0f4f1; color: #506159; font-size: 8px; }
.pending-summary { margin-top: 15px; padding: 11px 12px; border-radius: 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--amber-soft); color: #79501a; font-size: 9px; }
.pending-summary b { font-size: 10px; }
.diff-card { margin-top: 12px; padding: 11px 12px; border: 1px solid #f2d8d2; background: #fff8f6; border-radius: 9px; }
.diff-card strong { display: block; font-size: 9px; color: var(--red); margin-bottom: 6px; }
.diff-row { font-size: 9px; color: var(--muted); }
.diff-row del { color: #9b8b88; }
.diff-row ins { color: var(--red); text-decoration: none; font-weight: 700; }
.strategy-footer { position: absolute; left: 0; right: 0; bottom: 0; padding: 11px 16px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.strategy-footer-note strong, .strategy-footer-note span { display: block; }
.strategy-footer-note strong { font-size: 10px; }
.strategy-footer-note span { margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.strategy-panel { position: relative; }

.result-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 13px; }
.result-stat { padding: 11px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.result-stat span, .result-stat strong { display: block; }
.result-stat span { color: var(--muted-2); font-size: 8px; }
.result-stat strong { margin-top: 5px; font-family: Georgia, serif; font-size: 17px; font-weight: 520; }
.result-stat small { font-size: 8px; color: var(--muted); }
.scope-warning { padding: 10px 11px; margin-bottom: 12px; border-radius: 8px; background: var(--amber-soft); color: #79501a; font-size: 9px; line-height: 1.5; display: flex; gap: 8px; }
.screen-table, .trade-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.screen-table th, .screen-table td, .trade-table th, .trade-table td { padding: 10px 9px; border-bottom: 1px solid #edf0eb; text-align: left; font-size: 9px; }
.screen-table th, .trade-table th { color: var(--muted-2); font-weight: 650; background: #fafbf8; }
.stock-cell strong, .stock-cell span { display: block; }
.stock-cell strong { font-size: 10px; }
.stock-cell span { margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.metric-up { color: var(--red); font-weight: 670; }
.reason-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.reason-tag { padding: 3px 5px; border-radius: 4px; background: var(--green-soft); color: var(--green); font-size: 8px; }
.empty-result { padding: 36px 20px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 10px; background: white; }
.empty-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin: 0 auto 10px; background: #f1f3ef; color: var(--muted); }
.empty-result h3 { margin: 0 0 5px; font-size: 12px; }
.empty-result p { margin: 0; color: var(--muted); font-size: 9px; }

.backtest-page { padding-top: 24px; }
.backtest-title-row { display: flex; align-items: center; gap: 10px; }
.backtest-title-row h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 520; }
.verified-label { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; background: var(--green-soft); color: var(--green); border-radius: 99px; font-size: 9px; font-weight: 700; }
.backtest-meta { margin-top: 7px; color: var(--muted); font-size: 10px; }
.backtest-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.backtest-actions { display: flex; gap: 8px; }
.limit-banner { margin-bottom: 15px; padding: 10px 12px; border-radius: 9px; border: 1px solid #ead4aa; background: #fff7e8; color: #775527; font-size: 9px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.limit-banner strong { color: #6b4616; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.metric-card { padding: 14px; background: white; border: 1px solid var(--line); border-radius: 11px; }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted-2); font-size: 9px; }
.metric-card strong { margin-top: 8px; font-family: Georgia, serif; font-size: 21px; font-weight: 520; }
.metric-card strong.positive { color: var(--red); }
.metric-card strong.negative { color: var(--green); }
.metric-card small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .72fr); gap: 14px; margin-bottom: 14px; }
.chart-card, .assumption-card, .log-card { background: white; border: 1px solid var(--line); border-radius: 12px; }
.card-head { padding: 13px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card-head h3 { margin: 0; font-size: 11px; }
.legend { display: flex; gap: 12px; color: var(--muted); font-size: 8px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 2px; background: var(--green); }
.legend .benchmark i { background: #aeb6b0; }
.chart-wrap { padding: 10px 12px 5px; height: 280px; }
.equity-chart { width: 100%; height: 100%; overflow: visible; }
.chart-axis { stroke: #e8ebe6; stroke-width: 1; }
.chart-label { fill: #99a19d; font-size: 8px; }
.strategy-line { fill: none; stroke: var(--green); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.benchmark-line { fill: none; stroke: #b1b8b3; stroke-width: 1.4; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.strategy-area { fill: url(#areaGradient); }
.chart-dot { fill: white; stroke: var(--green); stroke-width: 2; }
.assumption-card { padding-bottom: 8px; }
.assumption-list { padding: 6px 14px; }
.assumption-row { padding: 9px 0; border-bottom: 1px solid #edf0eb; }
.assumption-row:last-child { border-bottom: 0; }
.assumption-row span, .assumption-row strong { display: block; }
.assumption-row span { color: var(--muted-2); font-size: 8px; }
.assumption-row strong { margin-top: 4px; color: #44514c; font-size: 9px; font-weight: 620; line-height: 1.4; }
.log-card { overflow: hidden; }
.trade-table { border: 0; border-radius: 0; }
.trade-table td { white-space: nowrap; }
.trade-type { font-weight: 700; }
.trade-type.buy { color: var(--red); }
.trade-type.sell { color: var(--green); }
.trade-reason { white-space: normal !important; color: var(--muted); min-width: 180px; }
.no-trades { padding: 24px; text-align: center; color: var(--muted); font-size: 10px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 330px; padding: 11px 13px; border-radius: 10px; background: #1d2925; color: white; font-size: 10px; line-height: 1.5; box-shadow: 0 12px 30px rgba(0,0,0,.2); animation: toast-in .22s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(20, 31, 27, .42); backdrop-filter: blur(5px); animation: modal-fade .16s ease; }
.modal-card { width: min(470px, calc(100vw - 48px)); overflow: hidden; border: 1px solid rgba(255,255,255,.65); border-radius: 16px; background: white; box-shadow: 0 24px 70px rgba(10, 25, 19, .22); animation: modal-rise .2s ease; }
.modal-head { padding: 20px 21px 15px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 5px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 520; }
.modal-close { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--muted); cursor: pointer; font-size: 19px; line-height: 1; }
.modal-body { padding: 18px 21px 20px; }
.security-note { display: flex; gap: 9px; align-items: flex-start; padding: 11px; margin-bottom: 17px; border: 1px solid #dbe8df; border-radius: 9px; background: var(--green-wash); color: #4c6259; font-size: 9px; line-height: 1.55; }
.security-note svg { flex: 0 0 auto; color: var(--green); margin-top: 1px; }
.security-note b { color: #30463d; }
.security-note code { padding: 1px 4px; border-radius: 4px; background: #e5eee8; color: var(--green); font-size: 8px; }
.field-label { display: block; margin: 14px 0 6px; color: #3f4b47; font-size: 10px; font-weight: 700; }
.secret-field { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; background: white; overflow: hidden; }
.secret-field:focus-within { border-color: #7daa96; box-shadow: 0 0 0 3px rgba(23,107,79,.08); }
.secret-field input { flex: 1; min-width: 0; height: 39px; padding: 0 11px; border: 0; outline: 0; color: var(--ink); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.reveal-button { align-self: stretch; padding: 0 11px; border: 0; border-left: 1px solid var(--line); background: #fafbf8; color: var(--muted); cursor: pointer; font-size: 9px; }
.field-help { margin-top: 6px; color: var(--muted-2); font-size: 8px; }
.model-select { appearance: none; width: 100%; height: 39px; padding: 0 34px 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; background: white linear-gradient(45deg, transparent 50%, #7b8580 50%) calc(100% - 15px) 16px / 5px 5px no-repeat; color: var(--ink); font-size: 10px; }
.model-select:focus { border-color: #7daa96; box-shadow: 0 0 0 3px rgba(23,107,79,.08); }
.form-message { margin-top: 12px; padding: 9px 10px; border-radius: 8px; font-size: 9px; line-height: 1.45; }
.form-message.error { background: var(--red-soft); color: var(--red); }
.form-message.success { background: var(--green-soft); color: var(--green); }
.connected-row { margin-top: 13px; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; background: #f6f8f5; color: var(--muted); font-size: 9px; }
.connected-row span:first-child { color: var(--green); font-weight: 680; }
.connected-row i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #35a372; }
.modal-footer { padding: 13px 21px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); background: #fafbf8; }
.modal-footer > div { display: flex; gap: 8px; }
.ghost-button.danger { color: var(--red); font-size: 9px; }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }

@media (max-width: 1180px) {
  .workspace-grid { grid-template-columns: minmax(340px, .78fr) minmax(520px, 1.2fr); }
  .page { padding-left: 24px; padding-right: 24px; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
}
