:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #162033;
  background: #f3f6fa;
  font-synthesis: none;
  --ink: #162033;
  --ink-2: #33435c;
  --muted: #78859a;
  --subtle: #a6b0c0;
  --line: #e4e9f0;
  --line-strong: #d5dde8;
  --card: #ffffff;
  --soft: #f7f9fc;
  --blue: #356fe8;
  --blue-soft: #edf3ff;
  --green: #16956a;
  --green-soft: #e9f8f1;
  --red: #dc5b66;
  --red-soft: #fff0f1;
  --amber: #a87522;
  --amber-soft: #fff7e7;
  --shadow: 0 14px 40px rgba(25, 42, 71, .06);
  --shadow-lg: 0 24px 70px rgba(25, 42, 71, .13);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: #f3f6fa; }
body { margin: 0; min-width: 320px; background: linear-gradient(145deg, #f8fafc 0%, #f2f5f9 52%, #edf2f8 100%); }
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
input, textarea, select { width: 100%; color: var(--ink); background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px; outline: 0; transition: border-color .18s, box-shadow .18s, background .18s; }
input, select { min-height: 44px; padding: 0 13px; }
textarea { min-height: 100px; padding: 12px 13px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #b0b8c5; }
input:focus, textarea:focus, select:focus { border-color: #98b8f4; background: #fff; box-shadow: 0 0 0 4px rgba(53, 111, 232, .11); }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 15%, rgba(223, 235, 255, .9), transparent 35%), radial-gradient(circle at 85% 85%, rgba(226, 248, 239, .75), transparent 32%), #f5f8fc; }
.auth-card { width: min(450px, 100%); padding: 48px 42px 40px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 30px; background: rgba(255, 255, 255, .9); box-shadow: var(--shadow-lg); text-align: center; backdrop-filter: blur(18px); }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 17px; background: linear-gradient(145deg, #1b2a40, #0c1523); color: #fff; font-size: 23px; font-weight: 850; box-shadow: 0 10px 22px rgba(17, 32, 55, .2); }
.brand-mark.small { width: 34px; height: 34px; margin: 0; border-radius: 11px; font-size: 15px; }
.auth-card h1 { margin: 6px 0 10px; color: #101c30; font-size: 36px; letter-spacing: -.065em; }
.auth-card .muted { max-width: 300px; margin: auto; line-height: 1.7; }
.auth-card .stack { margin-top: 28px; }
.auth-card .tiny { margin-top: 17px; }
.eyebrow { margin: 0 0 9px; color: #8d9aae; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--muted); }
.tiny { color: var(--subtle); font-size: 11px; line-height: 1.5; }
.mode-switch { display: flex; gap: 5px; margin-top: 27px; padding: 5px; border: 1px solid #e9edf3; border-radius: 14px; background: #f2f5f8; }
.mode-switch button { flex: 1; padding: 10px 8px; border-radius: 10px; color: var(--muted); background: transparent; }
.mode-switch button.selected { color: var(--ink); background: #fff; box-shadow: 0 4px 12px rgba(32, 47, 72, .1); font-weight: 700; }

.stack { display: grid; gap: 12px; }
.primary, .secondary, .ghost, .danger-button { min-height: 42px; padding: 0 16px; border-radius: 11px; font-size: 13px; font-weight: 700; transition: transform .18s, background .18s, box-shadow .18s, color .18s; }
.primary { color: #fff; background: linear-gradient(135deg, #1b2a40, #263a58); box-shadow: 0 7px 16px rgba(24, 42, 68, .16); }
.primary:hover { transform: translateY(-1px); background: linear-gradient(135deg, #223552, #30496d); box-shadow: 0 10px 20px rgba(24, 42, 68, .2); }
.secondary { color: #2461d2; background: var(--blue-soft); }
.secondary:hover { background: #dfeaff; }
.ghost { color: #56657a; background: #f3f6f9; }
.ghost:hover { color: var(--ink); background: #e9eef5; }
.danger-button { color: #bf4d59; background: var(--red-soft); }
.danger-button:hover { background: #ffe0e3; }
.wide { width: 100%; margin-top: 4px; }
.error { margin: 12px 0 0; color: #c8434f; font-size: 13px; line-height: 1.55; }
.text-green { color: var(--green) !important; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; width: 252px; display: flex; flex-direction: column; padding: 26px 16px 18px; border-right: 1px solid rgba(218, 226, 237, .9); background: rgba(255, 255, 255, .88); backdrop-filter: blur(18px); }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 12px; color: #142137; font-size: 18px; font-weight: 850; letter-spacing: -.04em; }
.side-caption { margin: 11px 12px 30px; color: #a1acbb; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 0 13px; border-radius: 12px; color: #78869a; background: transparent; text-align: left; font-size: 13px; font-weight: 600; }
.sidebar nav button span { width: 20px; color: #8e9bad; font-size: 18px; line-height: 1; text-align: center; }
.sidebar nav button:hover { color: var(--ink); background: #f4f7fb; }
.sidebar nav button.active { color: #2865d6; background: linear-gradient(100deg, #edf3ff, #e7f0ff); box-shadow: inset 3px 0 0 #4c82eb; font-weight: 800; }
.sidebar nav button.active span { color: #2865d6; }
.side-foot { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 12px; color: #8793a5; font-size: 11px; }
.dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.dot.green { background: #36bf82; box-shadow: 0 0 0 4px #e2f7ed; }
.icon-button { margin-left: auto; padding: 6px 8px; color: #8390a2; background: transparent; font-size: 11px; }
.icon-button:hover { color: #c24955; }

.main { width: calc(100% - 252px); min-width: 0; margin-left: 252px; padding: 0 42px 72px; }
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h2 { margin: 0; color: #142137; font-size: 29px; letter-spacing: -.06em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.status-pill, .quality { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 99px; color: #77859a; background: #f1f4f7; font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.status-pill.ok, .quality { color: #158459; background: var(--green-soft); }
.status-pill.off, .quality.warn { color: #ad6d23; background: var(--amber-soft); }
.user-chip { padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; color: #68778c; background: #fff; font-size: 11px; box-shadow: 0 4px 12px rgba(30, 48, 76, .04); }
.toast { position: fixed; z-index: 10; top: 23px; right: 30px; max-width: min(420px, calc(100vw - 40px)); padding: 13px 16px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px; color: var(--ink-2); background: #fff; box-shadow: var(--shadow-lg); font-size: 13px; }
.toast.bad { border-left-color: var(--red); }

.page-grid, .research-page { display: grid; gap: 18px; }
.card { min-width: 0; border: 1px solid rgba(221, 228, 237, .9); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.panel { padding: 25px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-head h2, .panel-head h3 { margin: 0; color: #17243a; letter-spacing: -.045em; }
.panel-head h2 { font-size: 22px; }
.panel-head h3 { font-size: 17px; }
.panel-head .eyebrow { margin-bottom: 6px; }
.compact-head { align-items: center; margin-top: 26px; margin-bottom: 12px; }
.compact-head h3 { font-size: 15px; }
.empty { padding: 24px; border: 1px dashed #d9e0ea; border-radius: 13px; color: #8996a8; background: #fbfcfd; font-size: 13px; line-height: 1.7; text-align: center; }

.hero { display: flex; align-items: center; justify-content: space-between; min-height: 270px; padding: 34px 38px; overflow: hidden; background: radial-gradient(circle at 84% 50%, rgba(210, 227, 255, .72), transparent 28%), linear-gradient(122deg, #fff 0%, #f5f8ff 100%); }
.hero h1 { margin: 4px 0 13px; color: #12213a; font-size: 34px; letter-spacing: -.075em; }
.max { max-width: 630px; font-size: 13px; line-height: 1.8; }
.hero-orbit { display: flex; align-items: center; gap: 12px; color: #7893c7; font-size: 10px; font-weight: 800; letter-spacing: .13em; white-space: nowrap; }
.hero-orbit b { color: var(--blue); font-size: 18px; }
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.metric { padding: 20px 21px; }
.metric span, .metric small { color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 12px; color: #16243a; font-size: 28px; letter-spacing: -.06em; }
.metric small { margin-left: 5px; }
.mini-list, .table-list { display: grid; }
.mini-item, .table-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-width: 0; padding: 14px 0; border-bottom: 1px solid #eef1f5; color: #68768a; font-size: 12px; }
.mini-item:last-child, .table-row:last-child { border-bottom: 0; }
.symbol { color: #1b2a40; font-weight: 850; letter-spacing: .04em; }
.push-right { margin-left: auto; }
.status-text { color: #718dbb; }

.two-col { grid-template-columns: minmax(0, 1.25fr) minmax(330px, .85fr); align-items: start; }
.research-control { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); align-items: end; gap: 20px; padding: 29px; }
.research-control h1 { margin: 0 0 7px; color: #15243a; font-size: 29px; letter-spacing: -.065em; }
.research-control > .wide { grid-column: 1 / -1; }
.research-input { display: flex; gap: 9px; min-width: 0; }
.research-input input { min-width: 0; }
.mode-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.mode-row button { min-height: 72px; padding: 13px 14px; border: 1px solid transparent; border-radius: 13px; color: #6e7d92; background: #f5f7fa; text-align: left; }
.mode-row button:hover { border-color: #dce5f4; background: #f1f5fb; }
.mode-row button b, .mode-row button span { display: block; }
.mode-row button b { margin-bottom: 6px; color: #26364f; font-size: 13px; }
.mode-row button span { font-size: 10px; line-height: 1.5; }
.mode-row button.modeActive { border-color: #bcd1fa; color: #2b61c5; background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(53, 111, 232, .04); }
.snapshot-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 18px; }
.quote-card, .indicators, .progress-card { padding: 25px; }
.quote-card h2 { margin: 0; color: #1b2a40; font-size: 23px; }
.quote-card h2 small { margin-left: 7px; color: #94a0b1; font-size: 12px; font-weight: 500; }
.quote-main { display: flex; align-items: baseline; gap: 14px; margin: 31px 0 18px; }
.quote-main strong { color: #12213a; font-size: 43px; letter-spacing: -.075em; }
.quote-main span { font-size: 20px; font-weight: 800; }
.up { color: var(--red); }
.down { color: var(--green); }
/* A-share convention: gain/up = red; loss/down = green.
   Keep these separate from success/error colors used by system health UI. */
.market-gain { color: #d94f5b !important; }
.market-loss { color: #16855f !important; }
.market-flat { color: var(--muted) !important; }
.facts { display: flex; flex-wrap: wrap; gap: 9px 15px; color: #8b97a8; font-size: 10px; }
.explain { margin: 17px 0 0; padding: 11px 13px; border-radius: 10px; color: #718097; background: #f5f9ff; font-size: 11px; line-height: 1.65; }
.indicator-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.indicator-grid div { padding: 12px; border: 1px solid #eef1f5; border-radius: 11px; background: #fafbfd; }
.indicator-grid small, .indicator-grid b { display: block; }
.indicator-grid small { margin-bottom: 6px; color: #8996a8; font-size: 10px; }
.indicator-grid b { color: #283850; font-size: 12px; }
.progress-line { display: flex; flex-wrap: wrap; gap: 8px; }
.progress-line span { padding: 8px 10px; border-radius: 9px; color: #8b97a8; background: #f4f6f8; font-size: 11px; }
.progress-line span.done { color: #18855e; background: var(--green-soft); }
.progress-line i { margin-left: 4px; font-style: normal; }
.analyst-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.analyst-card { min-height: 205px; padding: 19px; }
.analyst-head { display: flex; align-items: center; gap: 10px; }
.analyst-avatar { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #2865d6; background: var(--blue-soft); font-size: 12px; font-weight: 850; }
.analyst-head b, .analyst-head small { display: block; }
.analyst-head b { color: #25344b; font-size: 12px; }
.analyst-head small { margin-top: 4px; color: #8c98a8; font-size: 10px; line-height: 1.45; }
.analyst-head .tiny { margin-left: auto; white-space: nowrap; }
.stance { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; margin: 22px 0 8px; }
.stance strong { color: #20314a; font-size: 17px; }
.stance span { color: #8b97a7; font-size: 10px; white-space: nowrap; }
.analyst-card p { min-height: 38px; margin: 0 0 12px; color: #66758a; font-size: 12px; line-height: 1.6; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 4px 7px; border-radius: 6px; color: #758398; background: #f3f5f8; font-size: 10px; }
.tag.risk { color: #bc5962; background: var(--red-soft); }
.judge-card { padding: 29px; background: radial-gradient(circle at 85% 20%, rgba(221, 234, 255, .85), transparent 28%), linear-gradient(125deg, #fff 0%, #f5f9ff 100%); }
.judge-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.judge-top h2 { margin: 0; color: #182840; font-size: 25px; letter-spacing: -.055em; }
.judge-top h2 span { color: var(--blue); }
.judge-score { text-align: right; }
.judge-score b { display: block; color: #1d2d46; font-size: 35px; letter-spacing: -.06em; }
.judge-score small { color: #8693a6; font-size: 10px; }
.judge-summary { margin: 25px 0; color: #5f6e83; font-size: 14px; line-height: 1.8; }
.decision-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 13px 0 19px; }
.decision-facts span { padding: 8px 10px; border-radius: 8px; color: #64738a; background: #f3f6fa; font-size: 11px; }
.judge-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding-top: 19px; border-top: 1px solid var(--line); }
.judge-cols h4 { margin: 0 0 9px; color: #33435b; font-size: 12px; }
.judge-cols ul { margin: 0; padding-left: 18px; color: #68778c; font-size: 12px; line-height: 1.75; }
.guardrail { margin-top: 20px; padding: 11px 13px; border-radius: 9px; color: #936d2d; background: var(--amber-soft); font-size: 11px; line-height: 1.6; }

.data-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.data-grid > div { min-width: 0; padding: 15px; border: 1px solid #edf1f5; border-radius: 13px; background: #fafbfd; }
.data-grid > div > b { display: block; margin-bottom: 12px; color: #30415b; font-size: 12px; }
.data-grid p { display: flex; justify-content: space-between; gap: 8px; margin: 9px 0 0; color: #6f7d91; font-size: 11px; }
.data-grid p span { font-weight: 800; }
.calendar-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.calendar-row span { padding: 9px 8px; border-radius: 8px; color: #8a96a6; background: #f4f6f8; font-size: 10px; text-align: center; }
.calendar-row span.done { color: #18855d; background: var(--green-soft); }

.category-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 12px; }
.category-tabs button { padding: 9px 12px; border-radius: 9px; color: #6d7b8f; background: #f3f6f9; font-size: 11px; }
.category-tabs button.selected { color: #2865d6; background: var(--blue-soft); font-weight: 800; }
.category-tabs small { margin-left: 4px; color: #9ba6b5; }
.helper-text { margin: 7px 0 15px; font-size: 11px; line-height: 1.65; }
.inline-select, .full-select { min-height: 38px; padding: 0 10px; border-radius: 9px; font-size: 11px; }
.field-label { display: grid; gap: 6px; color: #7a8799; font-size: 11px; }
.field-label input, .field-label select { margin-top: 1px; }
.check-label { display: flex; align-items: center; gap: 8px; color: #6f7d91; font-size: 12px; }
.check-label input, .switches input, .slot-row input, .source-row input, .task-row input { width: auto; min-height: 0; accent-color: var(--blue); }
.watch-row { grid-template-columns: minmax(150px, 1fr) minmax(145px, .72fr) minmax(115px, .65fr) auto; }
.security-cell { display: grid; gap: 4px; min-width: 0; }
.security-cell b { overflow: hidden; color: #25354c; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.security-cell small { color: #94a0b0; font-size: 10px; letter-spacing: .05em; }
.pagination-bar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 15px; color: #8a96a7; font-size: 10px; }
.pagination-bar > span { margin-right: auto; }
.pagination-bar label { display: inline-flex; align-items: center; gap: 5px; }
.pagination-bar select { min-height: 30px; padding: 0 7px; border: 1px solid #e6ebf2; border-radius: 7px; color: #68778b; background: #fbfcfe; font-size: 10px; }
.pagination-bar .ghost { min-height: 30px; padding: 0 10px; }
.panel-wide { grid-column: 1 / -1; }
.category-research-panel { border-color: #dfe9fb; background: radial-gradient(circle at 93% 0%, rgba(215, 230, 255, .78), transparent 28%), #fff; }
.category-query { display: flex; gap: 10px; }
.category-query input { min-width: 0; flex: 1; }
.batch-badge { padding: 8px 10px; border-radius: 999px; color: #2562c7; background: var(--blue-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.category-result-list { margin-top: 17px; border-top: 1px solid #e9eff8; }
.category-result-row { display: grid; grid-template-columns: minmax(140px, .7fr) 110px 135px minmax(220px, 1.5fr); align-items: center; gap: 14px; min-width: 0; padding: 13px 0; border-bottom: 1px solid #eef2f7; }
.category-result-row:last-child { border-bottom: 0; }
.decision-chip, .score-chip { justify-self: start; padding: 6px 8px; border-radius: 7px; font-size: 10px; white-space: nowrap; }
.decision-chip { color: #2674c9; background: #edf5ff; }
.decision-chip.buy { color: #17835b; background: var(--green-soft); }
.decision-chip.sell, .decision-chip.reduce { color: #bb5b62; background: var(--red-soft); }
.score-chip { color: #6e7d92; background: #f4f6f9; }
.category-summary { overflow: hidden; margin: 0; color: #68778b; font-size: 11px; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }

.admin-page { gap: 18px; }
.admin-welcome { display: flex; align-items: center; gap: 26px; padding: 27px 29px; }
.admin-welcome > div:first-child { flex: 1; min-width: 0; }
.admin-welcome h2 { margin: 0 0 7px; color: #17263d; letter-spacing: -.055em; }
.setup-progress { display: flex; flex-wrap: wrap; gap: 6px; }
.setup-progress span { padding: 8px 10px; border-radius: 9px; color: #8a96a7; background: #f3f5f8; font-size: 11px; white-space: nowrap; }
.setup-progress span.done { color: #18855d; background: var(--green-soft); }
.simple-guide { border-color: #d9e7fb; color: #526d91; background: linear-gradient(110deg, #f7fbff, #f2f7ff); font-size: 12px; line-height: 1.75; }
.simple-guide b { color: #2e5eae; }
.simple-guide p { margin: 7px 0 0; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .88fr); gap: 18px; align-items: start; }
.admin-page .provider-form { display: grid; gap: 11px; margin-bottom: 21px; }
.admin-page .provider-form input { margin-top: 2px; }
.provider-list, .users { border-top: 1px solid var(--line); }
.provider-card { grid-template-columns: minmax(130px, 1fr) minmax(170px, 1fr) auto; min-height: 72px; }
.provider-card > span, .users .table-row > span { min-width: 0; }
.provider-card b, .provider-card small, .table-row small { display: block; }
.provider-card b { overflow: hidden; color: #26364e; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.provider-card small, .table-row small { margin-top: 4px; color: #99a4b3; font-size: 10px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.row-actions .primary, .row-actions .secondary, .row-actions .ghost, .row-actions .danger-button { min-height: 36px; padding: 0 11px; font-size: 11px; }
.status-dot { width: 7px; height: 7px; display: inline-block; margin: 0 5px 1px 0; border-radius: 50%; background: #aab4c1; }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-dot.off { background: #c8ced7; }
.subsection { padding: 17px 0; border-top: 1px solid #edf0f4; }
.subsection h4 { margin: 0 0 12px; color: #304059; font-size: 12px; }
.users .table-row { grid-template-columns: minmax(130px, 1fr) auto auto; }
.budget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 21px; }
.budget-grid label { color: #7b8798; font-size: 11px; }
.budget-grid input { margin-top: 6px; }
.switches { display: grid; gap: 11px; color: #68778b; font-size: 12px; }
.switches label { display: flex; align-items: center; gap: 8px; }
.health-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 21px; color: #788598; font-size: 12px; }
.health-row b { color: #243650; }
.error-log { padding: 10px 0; border-bottom: 1px solid #eef1f4; color: #b6515a; font-size: 11px; }
.error-log span { margin-right: 7px; padding: 3px 6px; border-radius: 4px; background: var(--red-soft); }
.slot-grid, .prompt-row { display: grid; gap: 0; }
.slot-row { display: grid; grid-template-columns: minmax(230px, 1.1fr) minmax(220px, 1fr) auto auto; align-items: center; gap: 14px; min-width: 0; padding: 15px 0; border-bottom: 1px solid #edf0f4; }
.slot-row:last-child, .source-row:last-child, .task-row:last-child { border-bottom: 0; }
.slot-row span, .source-row > span, .task-row > span { min-width: 0; }
.slot-row b, .slot-row small, .source-row b, .source-row small, .task-row b, .task-row small { display: block; }
.slot-row b, .source-row b, .task-row b { color: #26364f; font-size: 12px; }
.slot-row small, .source-row small, .task-row small { margin-top: 4px; color: #909cab; font-size: 10px; line-height: 1.5; }
.slot-row select { min-width: 0; }
.slot-row label, .source-row label, .task-row label { display: flex; align-items: center; gap: 6px; color: #69788b; font-size: 11px; white-space: nowrap; }
.slot-row .ghost, .source-row .ghost, .task-row .ghost, .task-row .secondary, .task-row .danger-button { min-height: 36px; padding: 0 11px; font-size: 11px; white-space: nowrap; }
.prompt-row { padding: 16px 0; border-bottom: 1px solid #edf0f4; }
.prompt-row:last-child { border-bottom: 0; }
.prompt-row .panel-head { align-items: center; margin-bottom: 10px; }
.prompt-row textarea { min-height: 108px; font-size: 11px; line-height: 1.65; }
.source-row { display: grid; grid-template-columns: minmax(205px, 1fr) minmax(250px, 1.35fr) auto auto auto; align-items: center; gap: 11px; padding: 15px 0; border-bottom: 1px solid #edf0f4; }
.source-row.itick-source { grid-template-columns: minmax(205px, 1fr) minmax(220px, 1.05fr) minmax(190px, .88fr) auto auto auto auto; }
.source-row input { min-width: 0; min-height: 38px; font-size: 11px; }
.source-token-input { letter-spacing: .02em; }
.task-form { display: grid; grid-template-columns: 1.2fr .8fr 1fr 1.1fr .9fr auto; gap: 9px; margin-bottom: 13px; }
.task-form input, .task-form select { min-width: 0; min-height: 42px; font-size: 11px; }
.task-row { display: grid; grid-template-columns: minmax(210px, 1.5fr) auto auto auto auto auto; align-items: center; gap: 10px; padding: 15px 0; border-bottom: 1px solid #edf0f4; }
.task-row .tiny { white-space: nowrap; }

.knowledge-search { display: flex; gap: 9px; }
.knowledge-search input { min-width: 0; }
.search-results { display: grid; gap: 8px; margin-top: 11px; }
.doc-list { display: grid; gap: 9px; margin-top: 20px; }
.doc-item { min-width: 0; padding: 13px 14px; border: 1px solid #edf0f4; border-radius: 11px; background: #fafbfd; }
.doc-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.doc-item-head .danger-button { min-height: 30px; padding: 0 9px; font-size: 10px; }
.doc-item b { color: #30405a; font-size: 12px; }
.doc-item small { display: block; margin-top: 5px; color: #9aa5b4; font-size: 10px; }
.doc-item p { margin: 8px 0 0; color: #68778b; font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.knowledge-note { margin-top: 16px; padding: 14px; border: 1px solid #f4e5be; border-radius: 11px; color: #8d6b30; background: #fffaf0; font-size: 11px; line-height: 1.65; }
.knowledge-note p { margin: 5px 0 0; }
.upload-box { display: block; padding: 12px; border: 1px dashed #b7c9e7; border-radius: 10px; color: #5674a3; background: #f7faff; font-size: 12px; text-align: center; }
.upload-box input { display: none; }

@media (max-width: 1240px) {
  .main { padding-right: 28px; padding-left: 28px; }
  .admin-grid { grid-template-columns: 1fr; }
  .task-form { grid-template-columns: repeat(3, 1fr); }
  .task-form .primary { grid-column: span 3; }
  .source-row { grid-template-columns: 1fr 1.2fr auto auto auto; }
  .source-row.itick-source { grid-template-columns: minmax(190px, 1fr) minmax(210px, 1fr) minmax(175px, .8fr) auto auto auto auto; }
}
@media (max-width: 1000px) {
  .sidebar { width: 220px; }
  .main { width: calc(100% - 220px); margin-left: 220px; padding: 0 22px 68px; }
  .hero-orbit { display: none; }
  .snapshot-grid, .two-col { grid-template-columns: 1fr; }
  .analyst-grid { grid-template-columns: repeat(2, 1fr); }
  .data-grid { grid-template-columns: repeat(2, 1fr); }
  .slot-row { grid-template-columns: 1fr 1fr auto auto; }
  .source-row, .source-row.itick-source { grid-template-columns: 1fr 1fr auto auto; }
  .source-row .source-url-input, .source-row .source-token-input { grid-column: 1 / -1; grid-row: auto; }
  .task-row { grid-template-columns: minmax(170px, 1fr) auto auto auto; }
  .task-row > span:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .auth-shell { padding: 16px; }
  .auth-card { padding: 36px 22px 30px; border-radius: 24px; }
  .auth-card h1 { font-size: 32px; }
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 68px; display: block; padding: 5px 7px; border-top: 1px solid var(--line); border-right: 0; background: rgba(255, 255, 255, .93); }
  .side-brand, .side-caption, .side-foot { display: none; }
  .sidebar nav { display: flex; justify-content: space-around; height: 100%; gap: 2px; }
  .sidebar nav button { display: grid; flex: 1; place-items: center; gap: 2px; min-height: 0; padding: 4px 2px; border-radius: 9px; font-size: 9px; text-align: center; }
  .sidebar nav button span { width: auto; font-size: 18px; }
  .sidebar nav button.active { box-shadow: none; }
  .main { width: 100%; margin-left: 0; padding: 0 13px 87px; }
  .topbar { min-height: 86px; }
  .topbar h2 { font-size: 22px; }
  .top-actions { gap: 5px; }
  .user-chip { display: none; }
  .status-pill { min-height: 25px; padding: 0 8px; font-size: 9px; }
  .toast { top: 12px; right: 13px; left: 13px; max-width: none; }
  .panel { padding: 18px; }
  .hero { min-height: 0; padding: 25px 22px; }
  .hero h1 { font-size: 27px; }
  .metric-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric { padding: 16px; }
  .metric strong { font-size: 24px; }
  .research-control { grid-template-columns: 1fr; padding: 21px; }
  .research-input { flex-direction: column; }
  .mode-row { grid-template-columns: 1fr; }
  .indicator-grid { grid-template-columns: repeat(2, 1fr); }
  .analyst-grid { grid-template-columns: 1fr; }
  .judge-top { flex-direction: column; }
  .judge-score { text-align: left; }
  .judge-cols { grid-template-columns: 1fr; gap: 10px; }
  .data-grid { grid-template-columns: 1fr 1fr; }
  .calendar-row { grid-template-columns: repeat(2, 1fr); }
  .source-row, .source-row.itick-source { grid-template-columns: 1fr auto auto; gap: 8px; }
  .source-row > span, .source-row .source-url-input, .source-row .source-token-input { grid-column: 1 / -1; }
  .source-row > label { justify-self: start; }
  .watch-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .watch-row .inline-select { grid-column: 1; }
  .watch-row .icon-button { grid-column: 2; grid-row: 1; }
  .category-query { flex-direction: column; }
  .category-result-row { grid-template-columns: 1fr auto; gap: 8px; }
  .category-result-row .security-cell { grid-column: 1; }
  .category-result-row .decision-chip, .category-result-row .score-chip { grid-column: 2; }
  .category-summary { grid-column: 1 / -1; white-space: normal; }
  .pagination-bar { justify-content: flex-start; }
  .pagination-bar > span { width: 100%; margin-right: 0; }
  .admin-welcome { align-items: stretch; flex-direction: column; gap: 16px; padding: 21px; }
  .admin-welcome .ghost { width: 100%; }
  .setup-progress { display: grid; grid-template-columns: repeat(3, 1fr); }
  .setup-progress span { padding: 8px 5px; font-size: 10px; text-align: center; white-space: normal; }
  .provider-card { grid-template-columns: 1fr auto; gap: 9px; }
  .provider-card > span:nth-child(2) { grid-column: 1; }
  .provider-card .row-actions { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; }
  .task-form { grid-template-columns: 1fr; }
  .task-form .primary { grid-column: auto; }
  .slot-row { grid-template-columns: 1fr auto; gap: 10px; }
  .slot-row select { grid-column: 1 / -1; }
  .source-row { grid-template-columns: 1fr 1fr; }
  .source-row input { grid-column: 1 / -1; }
  .source-row label { justify-self: start; }
  .source-row .ghost { justify-self: start; }
  .task-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .task-row > span:first-child { grid-column: 1 / -1; }
  .task-row .tiny { grid-column: 1 / -1; }
  .knowledge-search { flex-direction: column; }
  .topbar .eyebrow { margin-bottom: 5px; }
}

/* =========================================================
   PGDS UI FINISH — visual-only refinement layer
   No business logic / API / data behavior changes.
   ========================================================= */
:root {
  --ink: #0d1728;
  --ink-2: #26364c;
  --muted: #68778d;
  --subtle: #9aa7b8;
  --line: #e6ebf2;
  --line-strong: #d7dfe9;
  --card: rgba(255,255,255,.96);
  --soft: #f7f9fc;
  --blue: #285fd7;
  --blue-2: #174aa9;
  --blue-soft: #edf3ff;
  --green: #0e9b6c;
  --green-soft: #eaf8f3;
  --red: #d94f5c;
  --red-soft: #fff0f2;
  --amber: #a96e16;
  --amber-soft: #fff7e8;
  --shadow: 0 8px 30px rgba(20, 35, 58, .055), 0 1px 2px rgba(20,35,58,.03);
  --shadow-lg: 0 24px 70px rgba(20, 35, 58, .14), 0 2px 8px rgba(20,35,58,.06);
}
html { background:#f5f7fb; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -10%, rgba(72,116,218,.10), transparent 24%),
    radial-gradient(circle at 88% 8%, rgba(49,174,132,.055), transparent 20%),
    linear-gradient(180deg,#f8faff 0%,#f4f7fb 46%,#f6f8fb 100%);
}
body, button, input, textarea, select { -webkit-font-smoothing: antialiased; }
::selection { background:#dce8ff; color:#0f2345; }

input, textarea, select {
  border-color:#e3e9f1;
  border-radius:10px;
  background:#fbfcfe;
  box-shadow: inset 0 1px 0 rgba(15,28,48,.012);
}
input:hover, textarea:hover, select:hover { border-color:#d2dbe7; background:#fff; }
input:focus, textarea:focus, select:focus {
  border-color:#8eafea;
  box-shadow:0 0 0 3px rgba(40,95,215,.09), 0 5px 14px rgba(36,74,145,.04);
}

.auth-shell {
  background:
    radial-gradient(circle at 18% 15%, rgba(66,113,219,.16), transparent 27%),
    radial-gradient(circle at 82% 78%, rgba(41,168,127,.10), transparent 24%),
    linear-gradient(145deg,#f8faff,#eef3f9);
}
.auth-card {
  border:1px solid rgba(255,255,255,.95);
  border-radius:28px;
  background:rgba(255,255,255,.92);
  box-shadow:0 32px 90px rgba(30,50,84,.16), 0 2px 10px rgba(30,50,84,.05);
}
.brand-mark {
  background:linear-gradient(145deg,#14243c 0%,#091321 100%);
  box-shadow:0 12px 28px rgba(13,28,51,.25), inset 0 1px 0 rgba(255,255,255,.16);
}
.auth-card h1 { color:#0c182a; font-weight:850; }

.primary, .secondary, .ghost, .danger-button {
  border-radius:9px;
  letter-spacing:-.01em;
  box-shadow:none;
}
.primary {
  background:linear-gradient(180deg,#18345c 0%,#102744 100%);
  box-shadow:0 6px 16px rgba(18,45,79,.15), inset 0 1px 0 rgba(255,255,255,.15);
}
.primary:hover { background:linear-gradient(180deg,#1d4070,#153054); box-shadow:0 8px 20px rgba(18,45,79,.18); }
.secondary { color:#245ec8; background:#edf3ff; border:1px solid #dfe9fb; }
.secondary:hover { background:#e5efff; }
.ghost { color:#526178; background:#f3f6f9; border:1px solid #ebeff4; }
.ghost:hover { background:#eaf0f6; }
.danger-button { border:1px solid #f5dfe2; }

.sidebar {
  width:244px;
  padding:22px 14px 16px;
  border-right:1px solid rgba(217,225,236,.92);
  background:rgba(249,251,254,.89);
  box-shadow:10px 0 40px rgba(30,48,76,.025);
  backdrop-filter:blur(24px) saturate(1.15);
}
.side-brand { padding:3px 10px; font-size:17px; color:#0f1e33; }
.side-caption { margin:10px 10px 25px; color:#a1adbc; font-size:8px; letter-spacing:.19em; }
.sidebar nav { gap:4px; }
.sidebar nav button {
  min-height:43px;
  padding:0 11px;
  border:1px solid transparent;
  border-radius:10px;
  color:#6c7a8e;
  font-size:12px;
  font-weight:650;
  transition:all .16s ease;
}
.sidebar nav button span { color:#93a0b1; font-size:17px; }
.sidebar nav button:hover { color:#263951; background:rgba(255,255,255,.75); border-color:#e9edf3; }
.sidebar nav button.active {
  color:#173e84;
  border-color:#dbe7fb;
  background:linear-gradient(180deg,#f4f8ff 0%,#edf4ff 100%);
  box-shadow:0 6px 18px rgba(58,101,185,.07), inset 0 1px 0 #fff;
  font-weight:800;
}
.sidebar nav button.active::before {
  content:"";
  width:3px;
  height:17px;
  margin-left:-12px;
  margin-right:-3px;
  border-radius:4px;
  background:#316bd8;
  box-shadow:0 0 0 3px rgba(49,107,216,.07);
}
.sidebar nav button.active span { color:#2b63ca; }
.side-foot { border-top:1px solid #edf1f5; margin-top:auto; padding-top:15px; }

.main { width:calc(100% - 244px); margin-left:244px; padding:0 38px 76px; }
.topbar {
  min-height:96px;
  position:sticky;
  top:0;
  z-index:4;
  margin:0 -12px 10px;
  padding:0 12px;
  background:linear-gradient(180deg,rgba(247,249,253,.94) 0%,rgba(247,249,253,.83) 72%,rgba(247,249,253,0) 100%);
  backdrop-filter:blur(15px);
}
.topbar h2 { color:#0f1c30; font-size:25px; font-weight:850; letter-spacing:-.055em; }
.user-chip { border-color:#e4e9f0; background:rgba(255,255,255,.9); box-shadow:0 4px 14px rgba(29,46,73,.04); }
.status-pill, .quality { border:1px solid #e8edf3; background:#f2f5f8; }
.status-pill.ok, .quality { border-color:#d7eee6; }
.status-pill.off, .quality.warn { border-color:#f2e4c9; }

.toast { border-radius:10px; box-shadow:0 18px 50px rgba(26,42,68,.16); backdrop-filter:blur(15px); }

.page-grid, .research-page, .admin-page { gap:16px; }
.card {
  border:1px solid rgba(222,228,237,.95);
  border-radius:16px;
  background:rgba(255,255,255,.96);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.card:hover { border-color:#d8e0ea; }
.panel { padding:22px; }
.panel-head { margin-bottom:17px; }
.panel-head h2 { font-size:20px; font-weight:850; }
.panel-head h3 { font-size:16px; font-weight:800; }
.eyebrow { color:#8492a7; font-size:9px; letter-spacing:.18em; }
.empty { border-radius:10px; background:#fafcfe; }

.hero {
  min-height:245px;
  padding:31px 34px;
  border-color:#dce5f2;
  background:
    radial-gradient(circle at 86% 42%, rgba(46,96,205,.12), transparent 24%),
    radial-gradient(circle at 72% 100%, rgba(31,166,121,.06), transparent 25%),
    linear-gradient(125deg,#ffffff 0%,#f7faff 58%,#eef4ff 100%);
  box-shadow:0 14px 40px rgba(38,66,110,.075);
}
.hero::after {
  content:"";
  position:absolute;
  width:220px;
  height:220px;
  right:-70px;
  top:-80px;
  border:1px solid rgba(57,103,201,.10);
  border-radius:50%;
  box-shadow:0 0 0 32px rgba(57,103,201,.028),0 0 0 70px rgba(57,103,201,.018);
  pointer-events:none;
}
.hero { position:relative; }
.hero h1 { color:#0c1b30; font-size:32px; font-weight:900; }
.hero .muted { color:#66758a; }
.hero-orbit { color:#7189b8; }
.hero-orbit b { color:#1f59ca; }

.metric-row { gap:14px; }
.metric {
  position:relative;
  padding:18px 19px;
  border-radius:14px;
}
.metric::before {
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:2px;
  background:linear-gradient(90deg,#325fc0,rgba(50,95,192,0));
  opacity:.4;
}
.metric strong { margin-top:9px; font-size:25px; font-variant-numeric:tabular-nums; color:#11223a; }
.metric span { color:#77869a; font-weight:650; }

.mini-item, .table-row { padding:13px 3px; border-bottom-color:#edf1f5; }
.table-row:hover, .mini-item:hover { background:#fafcff; }
.symbol { color:#152941; }

.research-control {
  padding:25px;
  border-color:#dbe5f2;
  background:linear-gradient(135deg,#fff,#fbfdff);
}
.research-control h1 { color:#0f2037; font-size:27px; }
.mode-row { gap:8px; }
.mode-row button { border:1px solid #e4eaf2; background:#f7f9fc; }
.mode-row button.selected { border-color:#cfdcf4; background:#edf4ff; color:#1e55bb; box-shadow:inset 0 0 0 1px rgba(69,111,199,.05); }

.snapshot-card { border-color:#dde6f2; }
.snapshot-grid > div, .indicator-grid > div, .data-grid > div {
  border-color:#e8edf3;
  background:linear-gradient(180deg,#fbfcfe 0%,#f8fafc 100%);
  border-radius:11px;
}
.snapshot-grid strong, .indicator-grid strong { font-variant-numeric:tabular-nums; }

.analyst-grid { gap:12px; }
.analyst-card {
  padding:18px;
  border-radius:14px;
  background:linear-gradient(180deg,#fff,#fbfcfe);
}
.analyst-card:hover { box-shadow:0 10px 25px rgba(24,46,80,.065); transform:translateY(-1px); transition:.15s ease; }
.analyst-avatar {
  width:31px;
  height:31px;
  border-radius:9px;
  background:linear-gradient(145deg,#1b3760,#102440);
  color:#fff;
  box-shadow:0 5px 12px rgba(22,48,83,.16);
}
.analyst-head b { color:#22344d; }
.stance { border-top:1px solid #edf1f5; border-bottom:1px solid #edf1f5; }

.judge-card {
  position:relative;
  padding:27px;
  border-color:#cfddf3;
  background:
    radial-gradient(circle at 90% 10%,rgba(68,112,215,.13),transparent 23%),
    linear-gradient(125deg,#ffffff 0%,#f7faff 70%,#f0f5ff 100%);
  box-shadow:0 16px 40px rgba(38,69,119,.09);
}
.judge-card::before {
  content:"最终裁决";
  position:absolute;
  top:0;
  right:22px;
  padding:6px 10px;
  border-radius:0 0 8px 8px;
  color:#315fae;
  background:#eaf2ff;
  font-size:9px;
  font-weight:800;
  letter-spacing:.08em;
}
.judge-top h2 { color:#132844; }
.judge-score b { color:#173a72; font-variant-numeric:tabular-nums; }
.decision-facts span { border:1px solid #e4eaf2; background:#f7f9fc; }
.guardrail { border:1px solid #f1e2c6; }

.category-tabs button { border:1px solid transparent; }
.category-tabs button.selected { border-color:#dce7fa; box-shadow:0 3px 10px rgba(52,96,181,.05); }
.batch-badge { border:1px solid #d8e5fb; }

.pagination-bar { border-top:1px solid #edf1f5; margin-top:4px; }
.inline-select, .full-select { background:#fbfcfe; }

.admin-welcome {
  border-color:#dbe5f2;
  background:
    radial-gradient(circle at 90% 0%,rgba(53,102,208,.10),transparent 26%),
    linear-gradient(130deg,#fff,#f8fbff);
}
.setup-progress span { border:1px solid #e7ecf2; }
.setup-progress span.done { border-color:#d8eee6; }
.simple-guide { background:#f7faff; }
.provider-list, .users { border-top-color:#e9edf3; }
.provider-card:hover, .users .table-row:hover, .source-row:hover, .task-row:hover, .slot-row:hover { background:#fafcff; }
.status-dot.on { box-shadow:0 0 0 3px rgba(14,155,108,.10); }

.doc-item { border-color:#e7ecf2; background:#fbfcfe; }
.doc-item:hover { border-color:#d9e2ed; background:#fff; }
.knowledge-note { border-color:#f0e2c5; background:#fffbf3; }
.upload-box { border-color:#c9d7ec; color:#4f6f9e; background:#f7faff; }

/* clearer decision chips */
.decision-chip, .score-chip { border:1px solid #e5eaf1; box-shadow:inset 0 1px 0 rgba(255,255,255,.7); }
.decision-chip.buy, .decision-chip.strong_buy, .decision-chip.small_buy { color:#c14450; background:#fff1f2; border-color:#f3dfe2; }
.decision-chip.sell, .decision-chip.reduce { color:#16805b; background:#ecf8f2; border-color:#d9eee5; }
.decision-chip.hold, .decision-chip.wait { color:#7a651f; background:#fff8e8; border-color:#f1e4c8; }

/* stronger numeric hierarchy */
.metric strong, .judge-score b, .score-chip, .snapshot-grid strong, .indicator-grid strong { font-feature-settings:"tnum" 1,"ss01" 1; }

/* compact scrollbars */
* { scrollbar-width:thin; scrollbar-color:#cbd4df transparent; }
*::-webkit-scrollbar { width:8px; height:8px; }
*::-webkit-scrollbar-track { background:transparent; }
*::-webkit-scrollbar-thumb { background:#ccd5e0; border:2px solid transparent; background-clip:padding-box; border-radius:999px; }
*::-webkit-scrollbar-thumb:hover { background:#b9c4d1; border:2px solid transparent; background-clip:padding-box; }

@media (max-width:1240px) {
  .main { padding-right:24px; padding-left:24px; }
}
@media (max-width:1000px) {
  .sidebar { width:214px; }
  .main { width:calc(100% - 214px); margin-left:214px; padding:0 20px 68px; }
}
@media (max-width:720px) {
  .sidebar {
    height:70px;
    padding:5px 6px 7px;
    background:rgba(255,255,255,.96);
    box-shadow:0 -8px 30px rgba(23,40,65,.07);
  }
  .sidebar nav button { border:0; border-radius:10px; }
  .sidebar nav button.active::before { display:none; }
  .sidebar nav button.active { background:#edf4ff; }
  .main { padding:0 12px 88px; }
  .topbar { min-height:76px; margin:0 -4px 8px; padding:0 4px; }
  .topbar h2 { font-size:21px; }
  .card { border-radius:14px; }
  .panel { padding:17px; }
  .hero { padding:23px 20px; border-radius:15px; }
  .hero h1 { font-size:26px; }
  .metric-row { gap:8px; }
  .metric { padding:14px; }
  .metric strong { font-size:22px; }
  .judge-card { padding:21px; }
  .judge-card::before { right:14px; }
  .analyst-card { padding:16px; }
}


/* === V1.0.1 Provider connectivity + AI slot recommendation refinement === */
.form-actions {
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.15fr);
  gap:10px;
  margin-top:2px;
}
.test-provider-button {
  min-height:44px;
  padding:0 16px;
  border:1px solid #c9dbff;
  border-radius:9px;
  color:#184fba;
  background:linear-gradient(180deg,#f4f8ff 0%,#eaf2ff 100%);
  font-size:13px;
  font-weight:800;
  letter-spacing:-.01em;
  cursor:pointer;
  transition:all .16s ease;
}
.test-provider-button:hover:not(:disabled) {
  transform:translateY(-1px);
  border-color:#a9c4f7;
  background:#e3eeff;
  box-shadow:0 7px 18px rgba(35,85,174,.10);
}
.test-provider-button:disabled { opacity:.55; cursor:wait; }

.connection-result {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:12px 14px;
  border:1px solid;
  border-radius:10px;
  line-height:1.5;
}
.connection-result > div { min-width:0; }
.connection-result b,
.connection-result span,
.connection-result small { display:block; }
.connection-result b { margin-bottom:2px; font-size:12px; }
.connection-result span { font-size:11px; overflow-wrap:anywhere; }
.connection-result small { max-width:240px; font-size:10px; text-align:right; }
.connection-result.success {
  border-color:#cbe9dd;
  color:#167155;
  background:#f2fbf7;
}
.connection-result.success small { color:#6b9887; }
.connection-result.failed {
  border-color:#f1d4d8;
  color:#ad3f4a;
  background:#fff5f6;
}
.connection-result.failed small { color:#a97980; }

.provider-card .test-ok { color:#278064; }
.provider-card .test-bad { color:#bd5961; }

.recommend-legend {
  padding:6px 9px;
  border:1px solid #dfe8f7;
  border-radius:999px;
  color:#607797;
  background:#f7faff;
  font-size:10px;
  white-space:nowrap;
}
.slot-row {
  grid-template-columns:minmax(205px,.92fr) minmax(270px,1.08fr) minmax(240px,1fr) auto auto;
  gap:16px;
  padding:17px 0;
}
.slot-role b { font-size:12px; }
.slot-role small { max-width:360px; }
.slot-recommend {
  display:flex;
  align-items:flex-start;
  gap:9px;
  min-width:0;
  padding:9px 11px;
  border:1px solid #e4ebf6;
  border-radius:10px;
  background:linear-gradient(180deg,#fbfdff,#f6f9fd);
}
.slot-recommend .recommend-label {
  flex:0 0 auto;
  margin-top:1px;
  padding:3px 6px;
  border:1px solid #d7e4fb;
  border-radius:5px;
  color:#2d65c7;
  background:#edf4ff;
  font-size:9px;
  font-weight:800;
  letter-spacing:.04em;
}
.slot-recommend > div { min-width:0; }
.slot-recommend b {
  color:#1b355b;
  font-size:11px;
  line-height:1.35;
}
.slot-recommend small {
  margin-top:3px;
  color:#77869a;
  font-size:9.5px;
  line-height:1.45;
}
.slot-recommend em {
  display:block;
  margin-top:4px;
  color:#9aa5b3;
  font-size:9px;
  font-style:normal;
}
.slot-row select {
  min-height:42px;
  border-color:#e1e7ef;
  background:#fbfcfe;
}
.slot-footnote {
  margin-top:14px;
  padding:11px 13px;
  border:1px solid #e5eaf1;
  border-radius:9px;
  color:#68788e;
  background:#fafbfd;
  font-size:10.5px;
  line-height:1.65;
}
.slot-footnote b { color:#31465f; }

@media (max-width:1380px) {
  .slot-row {
    grid-template-columns:minmax(190px,.85fr) minmax(235px,1fr) minmax(220px,.9fr) auto auto;
    gap:11px;
  }
}
@media (max-width:1120px) {
  .slot-row {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto;
  }
  .slot-recommend { grid-column:2; grid-row:1 / span 2; }
  .slot-row select { grid-column:1 / 3; }
}
@media (max-width:720px) {
  .form-actions { grid-template-columns:1fr; }
  .connection-result { flex-direction:column; gap:7px; }
  .connection-result small { max-width:none; text-align:left; }
  .recommend-legend { display:none; }
  .slot-row { grid-template-columns:1fr auto; gap:10px; }
  .slot-role { grid-column:1 / -1; }
  .slot-recommend { grid-column:1 / -1; grid-row:auto; }
  .slot-row select { grid-column:1 / -1; }
}


/* V1.0.4 数据源管理 */
.data-source-add{display:grid;grid-template-columns:1.2fr 1.35fr 1.2fr .55fr auto auto;gap:10px;align-items:end;padding:16px;margin:8px 0 18px;border:1px dashed #b9c9df;border-radius:16px;background:#f8fbff}
.data-source-add>div:first-child{grid-column:1/-1;display:flex;flex-direction:column;gap:4px;color:#172b4d}.data-source-add small{color:#718096;font-weight:400}
.data-source-add label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#667892}.data-source-add .check-label{flex-direction:row;align-items:center;align-self:center}
.source-test-message { max-width:460px; overflow:hidden; color:#8a96a7; text-overflow:ellipsis; white-space:nowrap; }
.source-row:has(.source-test-message) .source-test-message { color:#72839a; }
@media(max-width:1100px){.data-source-add{grid-template-columns:1fr 1fr}.data-source-add>div:first-child{grid-column:1/-1}}
@media(max-width:700px){.data-source-add{grid-template-columns:1fr}.data-source-add>div:first-child{grid-column:auto}.research-input{flex-wrap:wrap}}

.research-note { margin:8px 0 0; color:#6f8097; font-size:12px; line-height:1.6; }

/* V1.0.5 历史研判详情：整条记录可点击，保留当时快照与全部结构化结论 */
.history-row { cursor:pointer; transition:background .16s ease, border-color .16s ease; }
.history-row:hover { background:#f5f9ff; border-bottom-color:#dce8f8; }
.history-row > button { justify-self:end; }
.history-detail { margin-top:18px; padding:18px; border:1px solid #dce7f6; border-radius:14px; background:linear-gradient(135deg,#fbfdff 0%,#f5f9ff 100%); box-shadow:0 10px 28px rgba(35,71,122,.06); }
.history-detail .compact-head { margin-top:0; }
.history-detail h3 small { margin-left:6px; font-size:11px; font-weight:500; }
.history-facts { display:flex; flex-wrap:wrap; gap:7px; margin:12px 0; }
.history-facts span, .history-decision-grid span { padding:7px 9px; border:1px solid #e4ebf4; border-radius:8px; color:#64758b; background:#fff; font-size:10.5px; }
.history-judge { display:grid; gap:9px; padding:14px; border:1px solid #dce8f8; border-radius:11px; background:rgba(255,255,255,.82); }
.history-judge > b, .history-columns > div > b { color:#2d4260; font-size:12px; }
.history-judge > strong { color:#4f627b; font-size:12px; font-weight:600; line-height:1.7; }
.history-decision-grid { display:flex; flex-wrap:wrap; gap:7px; }
.history-note { margin:0; padding:9px 11px; border-radius:8px; color:#7b6b3c; background:#fff9ec; font-size:10.5px; line-height:1.6; }
.history-columns { display:grid; grid-template-columns:1fr 1fr; gap:16px; padding-top:11px; border-top:1px solid #edf1f6; }
.history-columns ul { margin:7px 0 0; padding-left:17px; color:#68798f; font-size:10.5px; line-height:1.7; }
.history-analysts { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:9px; margin-top:12px; }
.history-analyst { min-width:0; padding:12px; border:1px solid #e7edf4; border-radius:10px; background:#fff; }
.history-analyst b, .history-analyst span { display:block; }
.history-analyst b { overflow:hidden; color:#2b405f; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.history-analyst span { margin-top:5px; color:#3773cd; font-size:10px; }
.history-analyst p { min-height:0; margin:8px 0; color:#6b7b90; font-size:10.5px; line-height:1.6; }
.history-analyst .tag { display:inline-block; margin:2px 2px 0 0; }

@media(max-width:720px){
  .history-detail { padding:13px; }
  .history-row { grid-template-columns:minmax(0,1fr) auto; gap:6px 9px; }
  .history-row > span:nth-child(2), .history-row > span:nth-child(3) { grid-column:1; }
  .history-row > button { grid-column:2; grid-row:1 / span 3; }
  .history-columns, .history-analysts { grid-template-columns:1fr; }
}

/* V2.0 — readiness / six-provider setup / data-quality polish */
.readiness-badge {
  min-width:210px; display:grid; gap:3px; padding:12px 14px; border:1px solid #e4eaf1;
  border-radius:12px; background:#f8fafc; box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.readiness-badge b { color:#3a4b61; font-size:11.5px; }
.readiness-badge small { color:#8794a6; font-size:9.5px; }
.readiness-badge.ready { border-color:#d8eee5; background:#f1faf6; }
.readiness-badge.ready b { color:#17835b; }
.readiness-badge.blocked { border-color:#f2dfe1; background:#fff7f7; }
.readiness-badge.blocked b { color:#ba505a; }
.readiness-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:18px; align-items:start; }
.readiness-panel > div { display:grid; align-content:start; gap:7px; min-width:0; }
.readiness-panel > div > b { color:#2f425d; font-size:11px; }
.readiness-error, .readiness-warning { display:block; padding:7px 9px; border-radius:8px; font-size:10px; line-height:1.45; }
.readiness-error { color:#b44f58; background:#fff3f4; }
.readiness-warning { color:#826b2b; background:#fff9ec; }
.readiness-actions { min-width:285px; padding-left:18px; border-left:1px solid #e9edf3; }
.readiness-actions .secondary { width:100%; min-height:40px; }
.readiness-actions small { color:#8593a5; font-size:9.5px; line-height:1.55; }
.preset-note { margin:-4px 0 2px; color:#6f8097; font-size:10px; line-height:1.55; }
.source-options { display:flex !important; flex-wrap:wrap; gap:8px 12px; margin-top:8px !important; }
.source-options label { color:#65758b !important; font-size:9.5px !important; }
.source-options input { min-height:0 !important; }
.quality-breakdown { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; padding-top:12px; border-top:1px solid #edf1f5; }
.quality-breakdown span { display:inline-flex; gap:5px; align-items:center; padding:5px 8px; border:1px solid #e6ebf2; border-radius:7px; color:#8290a3; background:#fafbfd; font-size:9.5px; }
.quality-breakdown b { color:#52647b; font-weight:700; }

/* source row has name + URL + optional replacement token + enabled + test + save + optional delete */
.source-row { grid-template-columns:minmax(210px,1.15fr) minmax(180px,.9fr) minmax(180px,.9fr) auto auto auto auto; }
.source-token-input { min-width:180px !important; }
@media(max-width:1240px){
  .readiness-panel { grid-template-columns:1fr 1fr; }
  .readiness-actions { grid-column:1/-1; min-width:0; padding:14px 0 0; border-left:0; border-top:1px solid #e9edf3; }
  .source-row { grid-template-columns:1fr 1fr 1fr auto auto auto; }
  .source-row > span { grid-column:1/-1; }
}
@media(max-width:1000px){
  .source-row { grid-template-columns:1fr auto auto auto auto; }
  .source-row > input { grid-column:1/-1 !important; grid-row:auto !important; }
}
@media(max-width:720px){
  .readiness-badge { min-width:0; width:100%; }
  .readiness-panel { grid-template-columns:1fr; gap:14px; }
  .readiness-actions { grid-column:auto; }
  .source-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .source-row > span, .source-row > input { grid-column:1/-1 !important; }
  .source-row label, .source-row .ghost, .source-row .danger-button { justify-self:stretch; }
  .source-row .ghost, .source-row .danger-button { width:100%; }
}

/* V2.0.1 auth preflight */
.auth-probe{margin:10px 0 14px;padding:10px 12px;border-radius:12px;font-size:12px;line-height:1.55;background:#f4f7fb;color:#60718a;border:1px solid #e4eaf2}
.auth-probe.good{background:#f0faf6;color:#247357;border-color:#d8efe5}
.auth-probe.bad{background:#fff4f4;color:#b34141;border-color:#f1d3d3}
.auth-card input:disabled,.auth-card button:disabled{cursor:not-allowed;opacity:.6}

/* V2.0.5 all-free market data */
.free-source-banner{display:flex;flex-direction:column;gap:5px;margin:4px 0 14px;padding:13px 15px;border:1px solid #d7eee6;border-radius:13px;background:#f3fbf7;color:#187153}
.free-source-banner b{font-size:12px}.free-source-banner small{font-size:10px;line-height:1.55;color:#678579}
.source-row.legacy-source{opacity:.62;background:#fafafa}
.source-row.legacy-source b{text-decoration:line-through;text-decoration-color:#9aa6b5}

/* === V2.0.6 live research progress / compact admin / TXT watchlist === */
.research-progress-card { padding:22px 24px; }
.progress-now { margin:7px 0 0; font-size:11px; }
.progress-percent { display:flex; align-items:center; gap:10px; }
.progress-percent > b { min-width:58px; color:#173a72; font-size:27px; line-height:1; text-align:right; font-variant-numeric:tabular-nums; }
.research-progress-track { position:relative; height:9px; margin:2px 0 14px; overflow:hidden; border:1px solid #e2e8f1; border-radius:999px; background:#eef2f7; }
.research-progress-track i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#2f68d2,#3f86e9); box-shadow:0 0 14px rgba(47,104,210,.25); transition:width .45s ease; }
.progress-line span.pending { color:#a2acba; background:#f5f7fa; }
.progress-line span.running { color:#285dad; border:1px solid #d6e3f8; background:#edf4ff; }
.progress-line span.failed { color:#bd4b57; border:1px solid #f2dfe2; background:#fff0f1; }
.judge-handoff { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:14px; padding:11px 13px; border:1px solid #dce6f5; border-radius:10px; color:#52657f; background:#f7faff; font-size:11px; }
.judge-handoff b { color:#1b4f9f; }
.judge-provider { margin:7px 0 0; color:#7b899c; font-size:10px; }
.judge-failed-card { display:flex; justify-content:space-between; gap:20px; padding:20px 22px; border-color:#f0d9dc; color:#a84752; background:#fff8f8; }
.judge-failed-card b { color:#983943; }
.judge-failed-card p { margin:7px 0 0; font-size:12px; line-height:1.65; }
.judge-failed-card > span { align-self:center; white-space:nowrap; color:#8d6b70; font-size:11px; }
.analyst-provider { color:#a0aab8 !important; font-size:9px !important; }
.fallback-note { margin:10px 0 0; padding:8px 10px; border-radius:8px; color:#7e641e; background:#fff8e8; font-size:10px; line-height:1.5; }

.admin-tabs { position:sticky; top:94px; z-index:3; display:flex; gap:6px; padding:7px; overflow-x:auto; border:1px solid #e0e6ee; border-radius:13px; background:rgba(248,250,253,.94); box-shadow:0 8px 24px rgba(31,49,77,.06); backdrop-filter:blur(16px); }
.admin-tabs button { flex:0 0 auto; min-height:38px; padding:0 14px; border:1px solid transparent; border-radius:9px; color:#6c7b90; background:transparent; font-size:11px; font-weight:750; white-space:nowrap; }
.admin-tabs button:hover { color:#284a7c; background:#f0f4f9; }
.admin-tabs button.active { color:#194fAD; border-color:#d3e1f8; background:#edf4ff; box-shadow:0 3px 10px rgba(52,96,181,.06); }
.admin-tabs small { margin-left:4px; padding:2px 5px; border-radius:99px; background:rgba(255,255,255,.8); font-size:9px; }
.admin-single-panel { min-height:360px; }
.compact-provider-form { max-width:920px; display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px !important; }
.compact-provider-form .preset-note, .compact-provider-form .form-actions, .compact-provider-form .connection-result, .compact-provider-form .check-label { grid-column:1/-1; }
.compact-provider-list { margin-top:20px; }
.account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-bottom:20px; }
.compact-source-add { grid-template-columns:minmax(230px,1.2fr) minmax(160px,.8fr) minmax(220px,1fr) minmax(180px,.8fr) 110px auto !important; }

.watchlist-head-actions { display:flex; align-items:center; gap:7px; }
.watchlist-head-actions .ghost { min-height:34px; padding:0 11px; font-size:10px; }
.hidden-file-input { display:none !important; }
.txt-format-note { display:flex; flex-wrap:wrap; gap:7px 13px; margin:0 0 13px; padding:10px 12px; border:1px solid #e1e8f1; border-radius:10px; color:#758399; background:#f8fafd; font-size:10px; line-height:1.55; }
.txt-format-note b { color:#38516f; }

@media (max-width:900px) {
  .compact-provider-form { grid-template-columns:1fr; }
  .compact-provider-form > * { grid-column:1 !important; }
  .account-grid { grid-template-columns:1fr; }
  .compact-source-add { grid-template-columns:1fr 1fr !important; }
  .compact-source-add > div { grid-column:1/-1; }
  .admin-tabs { top:76px; }
}
@media (max-width:720px) {
  .research-progress-card { padding:17px; }
  .progress-percent > b { font-size:22px; }
  .judge-handoff, .judge-failed-card { align-items:flex-start; flex-direction:column; }
  .watchlist-head-actions { flex-wrap:wrap; justify-content:flex-end; }
  .txt-format-note { display:grid; }
  .compact-source-add { grid-template-columns:1fr !important; }
  .compact-source-add > * { grid-column:1 !important; }
}

/* V2.0.6 compact watchlist / knowledge center */
.compact-page { align-items:start; }
.watchlist-shell, .knowledge-shell { padding:22px 24px; }
.watchlist-main-head, .knowledge-head { align-items:center; margin-bottom:14px; }
.count-badge {
  display:inline-flex; align-items:center; min-height:30px; padding:0 10px;
  border:1px solid #e2e8f0; border-radius:999px; color:#64748b; background:#f8fafc;
  font-size:10px; font-weight:800; white-space:nowrap;
}
.sub-tabs { display:flex; flex-wrap:wrap; gap:6px; padding:4px; border:1px solid #e8edf4; border-radius:12px; background:#f6f8fb; }
.sub-tabs button { min-height:34px; padding:0 13px; border-radius:9px; color:#718096; background:transparent; font-size:11px; font-weight:700; }
.sub-tabs button:hover { color:#334155; background:#fff; }
.sub-tabs button.active { color:#245fca; background:#fff; box-shadow:0 3px 10px rgba(32,55,87,.07); }
.sub-tabs button small { margin-left:5px; color:#9aa6b6; }
.watch-sub-tabs { margin:0 0 14px; max-width:440px; }
.watchlist-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:10px 0 13px; border-bottom:1px solid #edf1f5; }
.watchlist-toolbar .push-right { margin-left:auto; }
.inline-add-card { display:grid; grid-template-columns:minmax(120px,.8fr) minmax(160px,1.2fr) minmax(150px,.85fr) auto; gap:8px; padding:12px; margin:12px 0; border:1px solid #e4eaf2; border-radius:13px; background:#fafcff; }
.format-details, .knowledge-add-details { margin:10px 0 12px; border:1px solid #e8edf3; border-radius:11px; background:#fbfcfe; }
.format-details summary, .knowledge-add-details summary { padding:10px 12px; color:#6d7c91; font-size:11px; font-weight:700; cursor:pointer; }
.format-details pre { margin:0 12px 12px; padding:11px; overflow:auto; border-radius:9px; color:#4a5b72; background:#f2f5f9; font-size:10px; line-height:1.65; }
.category-research-compact { padding-top:2px; }
.sweep-hint { margin:0 0 12px; color:#8190a4; font-size:11px; line-height:1.7; }

.knowledge-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; margin:0 0 14px; }
.knowledge-metrics > div { min-width:0; padding:12px 13px; border:1px solid #e9eef4; border-radius:12px; background:#fafbfd; }
.knowledge-metrics span, .knowledge-metrics small, .knowledge-metrics b { display:block; }
.knowledge-metrics span { color:#7d899b; font-size:10px; }
.knowledge-metrics b { margin:6px 0 3px; color:#22344d; font-size:20px; letter-spacing:-.04em; }
.knowledge-metrics small { overflow:hidden; color:#9aa5b4; font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.knowledge-tabs { margin-bottom:14px; }
.knowledge-toolbar { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.knowledge-search { display:flex; flex:1; min-width:240px; gap:7px; }
.knowledge-search input { min-width:0; }
.file-upload-button { position:relative; display:inline-flex; align-items:center; justify-content:center; min-height:42px; padding:0 14px; white-space:nowrap; cursor:pointer; }
.file-upload-button input { position:absolute; width:1px; height:1px; overflow:hidden; opacity:0; pointer-events:none; }
.inline-knowledge-form { display:grid; grid-template-columns:minmax(190px,.65fr) minmax(300px,1.6fr) auto; gap:8px; padding:0 12px 12px; align-items:end; }
.inline-knowledge-form textarea { min-height:72px; }
.compact-search-results { max-height:300px; overflow:auto; margin:10px 0 13px; padding:12px; border:1px solid #dce6f5; border-radius:13px; background:#f9fbff; }
.compact-search-results .compact-head { margin:0 0 8px; }
.paged-doc-list { display:grid; gap:7px; }
.paged-doc-list .doc-item { margin:0; padding:12px 13px; border-radius:11px; }
.paged-doc-list .doc-item p { display:-webkit-box; margin:7px 0 0; overflow:hidden; color:#6f7d91; font-size:11px; line-height:1.6; -webkit-line-clamp:3; -webkit-box-orient:vertical; }
.inline-rule-form { display:grid; grid-template-columns:minmax(180px,.65fr) minmax(320px,1.5fr) auto; gap:8px; align-items:end; margin-bottom:12px; }
.inline-rule-form textarea { min-height:68px; }
.compact-memory-note { margin:0 0 10px; padding:11px 12px; }
.compact-memory-note b { color:#47617f; }
.compact-memory-note p { margin:5px 0 0; color:#77879b; font-size:10px; line-height:1.6; }
.memory-regime-chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.memory-regime-chips span { padding:6px 8px; border:1px solid #e6ebf2; border-radius:999px; color:#6b7b90; background:#fafbfd; font-size:9px; }

@media (max-width:1000px) {
  .knowledge-metrics { grid-template-columns:repeat(2,1fr); }
  .inline-add-card, .inline-knowledge-form, .inline-rule-form { grid-template-columns:1fr 1fr; }
  .inline-add-card > button, .inline-knowledge-form > button, .inline-rule-form > button { grid-column:1 / -1; }
}
@media (max-width:720px) {
  .watchlist-shell, .knowledge-shell { padding:16px; }
  .watchlist-main-head, .knowledge-head { align-items:flex-start; }
  .count-badge { white-space:normal; }
  .knowledge-metrics { grid-template-columns:1fr 1fr; }
  .knowledge-toolbar, .knowledge-search { align-items:stretch; flex-direction:column; min-width:0; }
  .knowledge-toolbar .file-upload-button { width:100%; }
  .inline-add-card, .inline-knowledge-form, .inline-rule-form { grid-template-columns:1fr; }
  .inline-add-card > button, .inline-knowledge-form > button, .inline-rule-form > button { grid-column:auto; }
  .watchlist-toolbar .push-right { margin-left:0; }
}
.watchlist-head-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:7px; }
.hidden-file-input { position:absolute !important; width:1px !important; height:1px !important; opacity:0; pointer-events:none; }
.inline-add-card { grid-template-columns:minmax(105px,.72fr) minmax(150px,1fr) minmax(125px,.72fr) minmax(150px,.9fr) auto; align-items:end; }
.inline-add-card > div:first-child { grid-column:1 / -1; display:flex; align-items:baseline; gap:10px; }
.inline-add-card > div:first-child b { color:#33445c; font-size:12px; }
.inline-add-card > div:first-child small { color:#8e9aab; font-size:10px; }
.format-details > div { display:flex; flex-wrap:wrap; gap:7px; padding:0 12px 12px; align-items:center; }
.format-details code { padding:7px 9px; border-radius:7px; color:#4b607c; background:#f1f5f9; font-size:10px; white-space:pre-line; }
.format-details span { color:#8b97a8; font-size:10px; }
.sweep-hint { display:flex; flex-wrap:wrap; align-items:center; gap:7px 14px; }
.compact-watch-table .watch-row { grid-template-columns:minmax(150px,1fr) minmax(140px,.55fr) auto; }
@media (max-width:1000px) {
  .inline-add-card { grid-template-columns:1fr 1fr; }
  .inline-add-card > div:first-child { grid-column:1 / -1; }
}
@media (max-width:720px) {
  .watchlist-head-actions { justify-content:flex-start; width:100%; }
  .inline-add-card { grid-template-columns:1fr; }
  .inline-add-card > div:first-child { grid-column:auto; display:grid; gap:4px; }
  .compact-watch-table .watch-row { grid-template-columns:minmax(120px,1fr) minmax(105px,.7fr) auto; }
}

/* V2.0.6 portfolio decision board */
.portfolio-page { gap:14px; }
.portfolio-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.portfolio-stat { padding:15px 16px; border:1px solid #e7edf4; }
.portfolio-stat span,.portfolio-stat small,.portfolio-stat b { display:block; }
.portfolio-stat span { color:#7a8799; font-size:10px; font-weight:700; }
.portfolio-stat b { margin:7px 0 3px; color:#182a43; font-size:22px; letter-spacing:-.04em; font-variant-numeric:tabular-nums; }
.portfolio-stat small { color:#9aa5b4; font-size:9px; }
.portfolio-layout { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(300px,.72fr); gap:14px; align-items:start; }
.portfolio-list-panel,.portfolio-entry-panel { min-width:0; }
.portfolio-entry-panel { position:sticky; top:96px; }
.portfolio-card-list { display:grid; gap:10px; }
.position-card { padding:15px; border:1px solid #e7edf4; border-radius:14px; background:#fff; box-shadow:0 7px 22px rgba(38,57,82,.035); }
.position-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:11px; border-bottom:1px solid #eef2f6; }
.position-actions { display:flex; align-items:center; gap:6px; }
.position-facts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin-top:11px; }
.position-facts > div { min-width:0; padding:9px 10px; border-radius:10px; background:#f8fafc; }
.position-facts span,.position-facts small,.position-facts b { display:block; }
.position-facts span { color:#8a97a8; font-size:9px; }
.position-facts b { margin-top:4px; color:#30425b; font-size:13px; font-variant-numeric:tabular-nums; }
.position-facts small { margin-top:2px; color:#a0aaba; font-size:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.position-pnl { margin-top:8px; padding:8px 10px; border-radius:9px; font-size:10px; font-weight:650; }
.position-pnl.positive { color:#c94350; background:#fff1f2; }
.position-pnl.negative { color:#157b59; background:#eef9f4; }
.position-advice { margin-top:10px; padding:11px 12px; border:1px solid #dfe8f3; border-radius:12px; background:#fbfcff; }
.advice-head { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.advice-head > span { color:#5f6e83; font-size:10px; font-weight:800; }
.advice-head > small { margin-left:auto; color:#99a4b4; font-size:9px; }
.advice-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin-top:9px; }
.advice-grid > span { min-width:0; padding:8px 9px; border:1px solid #ebeff5; border-radius:9px; background:#fff; }
.advice-grid small,.advice-grid b { display:block; }
.advice-grid small { color:#929eae; font-size:8px; }
.advice-grid b { margin-top:4px; color:#3b4b61; font-size:11px; font-variant-numeric:tabular-nums; }
.advice-summary { display:-webkit-box; margin:9px 0 0; overflow:hidden; color:#68778b; font-size:10px; line-height:1.6; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.advice-warning { margin:8px 0 0; padding:7px 9px; border-radius:8px; color:#9a6d28; background:#fff7e9; font-size:9px; line-height:1.5; }
.position-no-advice { display:flex; align-items:center; gap:9px; margin-top:10px; padding:10px 11px; border:1px dashed #dce3ec; border-radius:11px; background:#fafbfc; }
.position-no-advice b { color:#64748b; font-size:11px; white-space:nowrap; }
.position-no-advice span { flex:1; color:#95a0af; font-size:9px; line-height:1.5; }
.position-no-advice .secondary { min-height:32px; padding:0 10px; white-space:nowrap; }
.portfolio-form { display:grid; gap:9px; margin-top:12px; }
.portfolio-form label { display:grid; gap:5px; }
.portfolio-form label > span { color:#69788d; font-size:10px; font-weight:700; }
.portfolio-form-total { padding:11px 12px; border:1px solid #dce7f4; border-radius:11px; background:#f8fbff; }
.portfolio-form-total span,.portfolio-form-total small,.portfolio-form-total b { display:block; }
.portfolio-form-total span { color:#718096; font-size:9px; }
.portfolio-form-total b { margin:5px 0 2px; color:#1f3f67; font-size:18px; font-variant-numeric:tabular-nums; }
.portfolio-form-total small { color:#9aa5b4; font-size:8px; }
@media (max-width:1100px) {
  .portfolio-layout { grid-template-columns:1fr; }
  .portfolio-entry-panel { position:static; }
  .position-facts,.advice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:720px) {
  .portfolio-summary-grid { grid-template-columns:1fr; }
  .position-head,.position-no-advice { align-items:flex-start; flex-direction:column; }
  .position-actions { width:100%; justify-content:flex-end; }
  .position-facts,.advice-grid { grid-template-columns:1fr 1fr; }
  .advice-head > small { width:100%; margin-left:0; }
  .position-no-advice .secondary { width:100%; }
}

/* V2.0.7 — visible release marker + stale-cache proof */
.side-version { margin-left:5px; padding:2px 5px; border:1px solid #dce5f0; border-radius:99px; color:#6f8199; background:#f7f9fc; font-size:8px; letter-spacing:0; }

/* V2.0.7 — market quality is human-readable, never dumps dict/object strings */
.quality-breakdown.human { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; padding:12px; border:1px solid #e8edf3; border-radius:12px; background:#fafbfd; }
.quality-breakdown.human span { display:grid; gap:3px; min-width:0; padding:8px 9px; border-radius:9px; background:#fff; }
.quality-breakdown.human span.ok { border-color:#d9eee6; background:#f5fbf8; }
.quality-breakdown.human span.miss { border-color:#f1dddd; background:#fff8f8; }
.quality-breakdown.human b { overflow:hidden; color:#465a73; font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.quality-breakdown.human small { color:#8997a9; font-size:8px; line-height:1.35; }
@media (max-width:1100px) { .quality-breakdown.human { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:720px) { .quality-breakdown.human { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* V2.0.7 — admin partial-loading diagnostics */
.admin-load-errors { display:grid; grid-template-columns:minmax(180px,.8fr) minmax(0,2fr) auto; gap:12px; align-items:center; padding:13px 14px; border:1px solid #f1dddd; background:#fff9f9; }
.admin-load-errors > div:first-child { display:grid; gap:3px; }
.admin-load-errors > div:first-child b { color:#a94d55; font-size:11px; }
.admin-load-errors > div:first-child span { color:#8c7380; font-size:9px; line-height:1.5; }
.admin-load-error-list { display:flex; flex-wrap:wrap; gap:6px; }
.admin-load-error-list > span { display:grid; gap:2px; max-width:330px; padding:7px 8px; border:1px solid #efdddd; border-radius:8px; background:#fff; }
.admin-load-error-list b { color:#744e55; font-size:9px; }
.admin-load-error-list code { overflow:hidden; color:#687789; font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
.admin-load-error-list small { color:#a06067; font-size:8px; line-height:1.35; }
@media (max-width:900px) { .admin-load-errors { grid-template-columns:1fr; } }

/* V2.0.7 — accuracy / validation dashboard */
.performance-page { gap:12px; }
.performance-hero { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:22px 24px; background:linear-gradient(125deg,#fff 10%,#f6f9fd 100%); }
.performance-score { min-width:190px; padding:14px 16px; border:1px solid #dde7f2; border-radius:15px; background:rgba(255,255,255,.86); text-align:right; }
.performance-score small,.performance-score span,.performance-score b { display:block; }
.performance-score small { color:#8290a3; font-size:9px; font-weight:750; }
.performance-score b { margin:5px 0 2px; color:#153c69; font-size:34px; letter-spacing:-.06em; font-variant-numeric:tabular-nums; }
.performance-score span { color:#98a3b2; font-size:9px; }
.performance-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.performance-metrics .card { padding:14px 16px; }
.performance-metrics span,.performance-metrics small,.performance-metrics b { display:block; }
.performance-metrics span { color:#7b899b; font-size:9px; font-weight:750; }
.performance-metrics b { margin:6px 0 3px; color:#263b57; font-size:20px; font-variant-numeric:tabular-nums; }
.performance-metrics small { color:#9aa5b4; font-size:8px; }
.evaluation-rule-card { display:grid; grid-template-columns:auto 1fr; gap:4px 12px; padding:14px 16px; border-color:#e4eaf2; background:#fafbfd; }
.evaluation-rule-card b { grid-row:1/3; align-self:start; padding:5px 8px; border-radius:7px; color:#45617f; background:#eef4fa; font-size:9px; }
.evaluation-rule-card p { margin:0; color:#657489; font-size:10px; line-height:1.55; }
.evaluation-rule-card small { color:#9aa4b3; font-size:8px; }
.performance-table { overflow:hidden; border:1px solid #e8edf3; border-radius:11px; }
.performance-row { display:grid; grid-template-columns:.8fr 1fr 1.2fr .7fr .65fr 1fr; gap:10px; align-items:center; min-height:44px; padding:9px 12px; border-top:1px solid #eef2f6; color:#5f7086; font-size:9.5px; }
.performance-row:first-child { border-top:0; }
.performance-row.header { min-height:36px; color:#8c98a8; background:#f7f9fb; font-size:8.5px; font-weight:800; }
.performance-row strong { font-size:11px; }
.performance-row small { color:#a1aab7; font-size:8px; }
.recent-eval-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.recent-eval { display:grid; grid-template-columns:minmax(100px,.8fr) auto minmax(180px,1.2fr); gap:10px; align-items:center; padding:10px 11px; border:1px solid #e9eef4; border-radius:10px; background:#fbfcfd; }
.recent-eval > div { display:grid; gap:2px; }
.recent-eval b { color:#30445f; font-size:10px; }
.recent-eval small,.recent-eval span { color:#8794a6; font-size:8.5px; }
.recent-eval strong { padding:4px 7px; border-radius:99px; font-size:8.5px; }
.recent-eval strong.hit { color:#18795b; background:#eaf8f2; }
.recent-eval strong.miss { color:#b04e55; background:#fff0f1; }
@media (max-width:900px) { .performance-hero { align-items:flex-start; flex-direction:column; } .performance-score { width:100%; text-align:left; } .recent-eval-grid { grid-template-columns:1fr; } .performance-row { grid-template-columns:1fr 1fr 1fr; } .performance-row.header { display:none; } }
@media (max-width:650px) { .performance-metrics { grid-template-columns:1fr; } .performance-row { grid-template-columns:1fr 1fr; } .recent-eval { grid-template-columns:1fr auto; } .recent-eval > span { grid-column:1/-1; } }

/* V2.0.7 — task run ledger; result is visible, not just OK:N */
.task-list-v207 { display:grid; gap:9px; margin-top:12px; }
.task-card-v207 { padding:12px 13px; border:1px solid #e6ebf2; border-radius:12px; background:#fff; }
.task-card-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
.task-card-head > div { display:grid; gap:3px; }
.task-card-head b { color:#2b3f5a; font-size:11px; }
.task-card-head small { color:#8e9aaa; font-size:8.5px; line-height:1.45; }
.task-run-status { flex:0 0 auto; padding:5px 8px; border-radius:99px; color:#776b57; background:#f7f3eb; font-size:8.5px; font-weight:750; }
.task-run-status.ok { color:#16765a; background:#eaf8f2; }
.task-last-summary { display:flex; flex-wrap:wrap; gap:5px 12px; margin-top:9px; padding:8px 10px; border-radius:9px; background:#f7f9fc; }
.task-last-summary span,.task-last-summary b { color:#748399; font-size:8.5px; }
.task-last-summary b { color:#425874; }
.task-card-actions { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; align-items:center; margin-top:9px; }
.task-card-actions label { margin-right:auto; color:#77869a; font-size:9px; }
.task-result-panel { margin-top:10px; padding-top:10px; border-top:1px solid #edf1f5; }
.task-run-detail { border:1px solid #e9eef4; border-radius:10px; background:#fafbfd; }
.task-run-detail + .task-run-detail { margin-top:6px; }
.task-run-detail summary { display:flex; gap:10px; justify-content:space-between; padding:9px 10px; cursor:pointer; color:#62738a; font-size:9px; }
.task-run-items { display:grid; gap:6px; padding:0 9px 9px; }
.task-result-item { display:grid; grid-template-columns:minmax(130px,1fr) minmax(120px,.8fr) minmax(100px,.55fr) auto; gap:8px; align-items:center; padding:8px 9px; border:1px solid #e7edf4; border-radius:9px; background:#fff; }
.task-result-item > span:first-child { display:grid; }
.task-result-item b { color:#344a66; font-size:9.5px; }
.task-result-item small,.task-result-item > span { color:#8492a5; font-size:8.5px; }
.task-result-item p { grid-column:1/-1; margin:0; }
@media (max-width:850px) { .task-result-item { grid-template-columns:1fr 1fr; } .task-result-item button { justify-self:end; } }
.task-legacy-note { margin-top:8px; padding:8px 10px; border:1px dashed #e3d8c7; border-radius:9px; color:#8e7656; background:#fffaf2; font-size:8.5px; line-height:1.5; }

/* ========================================================================== */
/* V2.0.8 — iOS / macOS glass visual system                                    */
/* ========================================================================== */
:root {
  --ios-blue: #0a84ff;
  --ios-blue-strong: #0574e8;
  --ios-blue-soft: rgba(10,132,255,.105);
  --ios-green: #20a66a;
  --ios-red: #e45662;
  --ios-amber: #b7832d;
  --glass: rgba(255,255,255,.72);
  --glass-strong: rgba(255,255,255,.88);
  --glass-soft: rgba(248,250,253,.72);
  --glass-border: rgba(255,255,255,.82);
  --ios-line: rgba(126,145,171,.16);
  --ios-shadow: 0 14px 38px rgba(43,58,82,.075), 0 2px 8px rgba(43,58,82,.035);
  --ios-shadow-hover: 0 18px 48px rgba(43,58,82,.105), 0 3px 10px rgba(43,58,82,.045);
  --radius-xl: 22px;
  --radius-lg: 17px;
  --radius-md: 13px;
  --radius-sm: 10px;
}

html, body { min-height:100%; }
html { background:#eef3f9; }
body {
  color:#17243a;
  background:
    radial-gradient(circle at 13% 8%, rgba(187,214,255,.42), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(211,239,232,.36), transparent 26%),
    linear-gradient(145deg,#f7f9fc 0%,#f1f5fa 50%,#edf3f8 100%);
  background-attachment:fixed;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/* Frosted shell */
.sidebar {
  width:238px;
  padding:22px 14px 16px;
  border-right:1px solid rgba(132,149,171,.15);
  background:rgba(247,250,253,.74);
  box-shadow:12px 0 38px rgba(45,62,86,.035);
  backdrop-filter:blur(28px) saturate(170%);
  -webkit-backdrop-filter:blur(28px) saturate(170%);
}
.main { width:calc(100% - 238px); margin-left:238px; padding:0 34px 64px; }
.topbar {
  position:sticky; top:0; z-index:4;
  min-height:96px;
  padding:0 2px;
  border-bottom:1px solid rgba(125,143,166,.08);
  background:linear-gradient(180deg,rgba(245,248,252,.86),rgba(245,248,252,.56));
  backdrop-filter:blur(24px) saturate(165%);
  -webkit-backdrop-filter:blur(24px) saturate(165%);
}
.topbar h2 { font-size:27px; letter-spacing:-.055em; }
.side-caption { margin:9px 12px 25px; }
.side-brand { padding:0 10px; font-size:17px; }
.brand-mark.small { width:36px; height:36px; border-radius:12px; box-shadow:0 10px 24px rgba(19,36,59,.14); }
.side-version { color:#687b94; border-color:rgba(112,137,169,.18); background:rgba(255,255,255,.62); }

.sidebar nav { gap:4px; }
.sidebar nav button {
  min-height:44px;
  padding:0 12px;
  border:1px solid transparent;
  border-radius:13px;
  color:#6f7e92;
  font-size:12.5px;
  transition:background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.sidebar nav button span {
  width:26px; height:26px; display:grid; place-items:center;
  border-radius:8px; color:#8a99ac; background:rgba(255,255,255,.48);
  font-size:15px;
}
.sidebar nav button:hover { color:#253954; background:rgba(255,255,255,.68); transform:translateX(1px); }
.sidebar nav button.active {
  color:#0b63c7;
  border-color:rgba(10,132,255,.13);
  background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(231,242,255,.92));
  box-shadow:0 8px 22px rgba(63,102,159,.08), inset 0 0 0 1px rgba(255,255,255,.58);
}
.sidebar nav button.active span { color:#0671df; background:rgba(10,132,255,.10); }
.side-foot { padding:11px 10px; border-radius:12px; background:rgba(255,255,255,.42); }

/* Cards / panels */
.page-grid, .research-page, .admin-page, .performance-page { gap:14px; }
.card {
  border:1px solid var(--glass-border);
  border-radius:var(--radius-xl);
  background:var(--glass);
  box-shadow:var(--ios-shadow);
  backdrop-filter:blur(28px) saturate(155%);
  -webkit-backdrop-filter:blur(28px) saturate(155%);
  transition:box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.card:hover { border-color:rgba(255,255,255,.96); box-shadow:var(--ios-shadow-hover); }
.panel { padding:21px 22px; }
.panel-head { margin-bottom:16px; }
.panel-head h2 { font-size:21px; }
.panel-head h3 { font-size:16px; }
.eyebrow { color:#8390a2; font-size:9px; letter-spacing:.18em; }
.muted { color:#74839a; }
.empty {
  padding:20px;
  border:1px dashed rgba(115,139,170,.22);
  border-radius:14px;
  color:#8795a8;
  background:rgba(255,255,255,.46);
}

/* iOS form controls */
input:not([type="checkbox"]), textarea, select {
  border:1px solid rgba(112,136,166,.16);
  border-radius:12px;
  color:#21334d;
  background:rgba(255,255,255,.68);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
input:not([type="checkbox"]), select { min-height:42px; padding:0 13px; }
textarea { padding:12px 13px; }
input:not([type="checkbox"]):hover, textarea:hover, select:hover { border-color:rgba(87,123,170,.25); background:rgba(255,255,255,.82); }
input:not([type="checkbox"]):focus, textarea:focus, select:focus {
  border-color:rgba(10,132,255,.44);
  background:rgba(255,255,255,.94);
  box-shadow:0 0 0 4px rgba(10,132,255,.10), inset 0 1px 0 #fff;
}

/* Every boolean control is a compact iOS switch; this also fixes the giant task checkbox. */
input[type="checkbox"] {
  appearance:none;
  -webkit-appearance:none;
  width:42px !important;
  min-width:42px !important;
  height:24px !important;
  min-height:24px !important;
  margin:0;
  padding:0;
  position:relative;
  flex:0 0 42px;
  border:0 !important;
  border-radius:999px !important;
  outline:0;
  cursor:pointer;
  background:rgba(116,130,151,.22);
  box-shadow:inset 0 0 0 1px rgba(89,104,126,.08), inset 0 2px 5px rgba(48,63,84,.07);
  transition:background .2s ease, box-shadow .2s ease;
}
input[type="checkbox"]::after {
  content:"";
  position:absolute;
  top:2px; left:2px;
  width:20px; height:20px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 6px rgba(32,43,59,.22), 0 0 0 .5px rgba(76,88,107,.12);
  transition:transform .2s cubic-bezier(.2,.8,.2,1);
}
input[type="checkbox"]:checked {
  background:linear-gradient(180deg,#19a5ff,#0a84ff);
  box-shadow:inset 0 0 0 1px rgba(0,96,200,.06), 0 0 0 3px rgba(10,132,255,.08);
}
input[type="checkbox"]:checked::after { transform:translateX(18px); }
input[type="checkbox"]:disabled { opacity:.45; cursor:not-allowed; }
.check-label, .switches label, .slot-row label, .source-row label, .task-card-actions label { gap:9px !important; }

/* Buttons */
.primary, .secondary, .ghost, .danger-button, .test-provider-button {
  min-height:39px;
  padding:0 14px;
  border:1px solid transparent;
  border-radius:12px;
  font-size:11.5px;
  font-weight:750;
  letter-spacing:-.01em;
  box-shadow:0 4px 10px rgba(39,58,84,.035);
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.primary {
  color:#fff;
  border-color:rgba(0,103,215,.10);
  background:linear-gradient(180deg,#258fff 0%,#0a7ce8 100%);
  box-shadow:0 8px 18px rgba(10,132,255,.20), inset 0 1px 0 rgba(255,255,255,.24);
}
.primary:hover { transform:translateY(-1px); background:linear-gradient(180deg,#3298ff,#0876dd); box-shadow:0 10px 22px rgba(10,132,255,.25); }
.secondary, .test-provider-button {
  color:#086dce;
  border-color:rgba(10,132,255,.10);
  background:rgba(10,132,255,.095);
}
.secondary:hover, .test-provider-button:hover { transform:translateY(-1px); background:rgba(10,132,255,.145); }
.ghost {
  color:#53667f;
  border-color:rgba(112,136,166,.10);
  background:rgba(255,255,255,.56);
}
.ghost:hover { transform:translateY(-1px); color:#263a56; border-color:rgba(112,136,166,.17); background:rgba(255,255,255,.84); }
.danger-button {
  color:#c64d58;
  border-color:rgba(214,77,91,.10);
  background:rgba(228,86,98,.085);
}
.danger-button:hover { transform:translateY(-1px); background:rgba(228,86,98,.13); }
button:active:not(:disabled) { transform:scale(.985); }

/* Status / pills */
.status-pill, .quality, .task-run-status, .decision-chip, .score-chip, .batch-badge {
  border:1px solid rgba(111,137,168,.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6);
}
.status-pill.ok, .quality { color:#137653; background:rgba(36,178,111,.10); }
.user-chip {
  border-color:rgba(110,134,164,.13);
  border-radius:13px;
  background:rgba(255,255,255,.62);
  box-shadow:0 6px 18px rgba(39,56,79,.04);
  backdrop-filter:blur(14px);
}
.toast {
  border:1px solid rgba(255,255,255,.88);
  border-left:0;
  border-radius:15px;
  background:rgba(255,255,255,.88);
  box-shadow:0 20px 55px rgba(31,45,65,.16);
  backdrop-filter:blur(24px) saturate(170%);
  -webkit-backdrop-filter:blur(24px) saturate(170%);
}
.toast::before { content:""; width:4px; position:absolute; inset:9px auto 9px 0; border-radius:99px; background:var(--ios-green); }
.toast.bad::before { background:var(--ios-red); }

/* Segmented controls / tabs */
.admin-tabs, .category-tabs, .knowledge-tabs, .mode-switch {
  border:1px solid rgba(115,139,168,.13);
  background:rgba(240,244,249,.68);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72), 0 7px 22px rgba(39,58,83,.04);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
}
.admin-tabs { top:86px; border-radius:15px; padding:5px; }
.admin-tabs button, .category-tabs button, .knowledge-tabs button {
  border-radius:11px;
  transition:background .18s ease, color .18s ease, box-shadow .18s ease;
}
.admin-tabs button.active, .category-tabs button.selected, .knowledge-tabs button.active {
  color:#0b66c7;
  border-color:rgba(255,255,255,.82);
  background:rgba(255,255,255,.90);
  box-shadow:0 4px 12px rgba(43,61,86,.08), inset 0 0 0 1px rgba(10,132,255,.06);
}

/* Tables and rows */
.table-list, .provider-list, .source-list { border-top:0; }
.mini-item, .table-row, .slot-row, .source-row, .task-row {
  border-bottom-color:rgba(113,136,164,.10);
}
.table-row:hover, .mini-item:hover, .provider-card:hover, .source-row:hover, .slot-row:hover {
  background:rgba(255,255,255,.42);
}

/* Admin page */
.admin-welcome {
  min-height:158px;
  padding:23px 25px;
  background:
    radial-gradient(circle at 92% 35%,rgba(182,214,255,.38),transparent 26%),
    rgba(255,255,255,.69);
}
.readiness-badge {
  border-color:rgba(125,148,176,.12);
  border-radius:15px;
  background:rgba(255,255,255,.62);
}
.readiness-badge.ready { border-color:rgba(35,165,104,.13); background:rgba(231,249,240,.72); }
.admin-single-panel { overflow:hidden; }
.budget-grid { gap:10px; }
.health-row { padding-top:12px; border-top:1px solid rgba(113,136,164,.10); }

.admin-load-errors {
  padding:0;
  overflow:hidden;
  border:1px solid rgba(201,146,75,.16);
  border-radius:15px;
  background:rgba(255,249,239,.72);
  box-shadow:0 10px 30px rgba(97,72,35,.035);
}
.admin-load-errors summary {
  list-style:none;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:10px;
  align-items:center;
  padding:11px 13px;
  cursor:pointer;
}
.admin-load-errors summary::-webkit-details-marker { display:none; }
.admin-error-icon {
  width:24px; height:24px; display:grid; place-items:center;
  border-radius:50%; color:#9a681f; background:rgba(222,165,70,.13); font-size:12px; font-weight:850;
}
.admin-load-errors summary div { display:grid; gap:2px; }
.admin-load-errors summary b { color:#72562f; font-size:10.5px; }
.admin-load-errors summary small { color:#927d5f; font-size:8.5px; }
.admin-error-count { padding:5px 8px; border-radius:99px; color:#8d6a35; background:rgba(255,255,255,.58); font-size:8.5px; }
.admin-load-error-body { display:flex; gap:10px; align-items:flex-end; padding:0 13px 12px; border-top:1px solid rgba(187,149,91,.10); }
.admin-load-error-list { flex:1; padding-top:10px; }
.admin-load-error-list > span { border-color:rgba(193,145,76,.12); background:rgba(255,255,255,.55); }

/* Research */
.research-progress-card { padding:19px 21px; }
.research-progress-track {
  height:8px;
  border:0;
  background:rgba(106,128,156,.12);
  box-shadow:inset 0 1px 2px rgba(56,75,100,.07);
}
.research-progress-track i {
  background:linear-gradient(90deg,#0a84ff,#58a7ff);
  box-shadow:0 0 16px rgba(10,132,255,.24);
}
.progress-percent > b { color:#0b65c4; font-size:25px; }
.analyst-card, .judge-card, .history-detail, .history-analyst {
  border-color:rgba(111,136,166,.12);
  background:rgba(255,255,255,.62);
  box-shadow:0 8px 22px rgba(42,57,79,.035);
}

/* Portfolio / watchlist / knowledge */
.position-card, .watchlist-shell, .knowledge-shell, .portfolio-entry-panel {
  border-color:rgba(112,136,166,.12);
  background:rgba(255,255,255,.64);
}
.position-card { border-radius:17px; box-shadow:0 10px 26px rgba(38,57,82,.04); }
.portfolio-form-total, .knowledge-metrics > div, .performance-score, .evaluation-rule-card {
  border-color:rgba(112,136,166,.12);
  background:rgba(255,255,255,.52);
}
.watchlist-toolbar, .knowledge-toolbar { border-bottom-color:rgba(113,136,164,.10); }
.format-details, .knowledge-add-details, .task-run-detail {
  border-color:rgba(112,136,166,.12);
  background:rgba(255,255,255,.48);
}

/* Data center */
.data-grid { gap:10px; }
.data-grid > div {
  padding:14px;
  border-color:rgba(112,136,166,.11);
  border-radius:15px;
  background:rgba(255,255,255,.54);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.68);
}
.quality-breakdown.human {
  border-color:rgba(112,136,166,.11);
  border-radius:15px;
  background:rgba(255,255,255,.38);
}
.quality-breakdown.human span { border-radius:11px; background:rgba(255,255,255,.64); }

/* Performance */
.performance-hero {
  border-radius:var(--radius-xl);
  background:
    radial-gradient(circle at 90% 20%,rgba(184,215,255,.38),transparent 28%),
    rgba(255,255,255,.70);
}
.performance-score { border-radius:17px; }
.performance-score b { color:#0c5eaf; }
.performance-row { border-top-color:rgba(112,136,166,.09); }
.performance-row.header { background:rgba(242,246,250,.58); }
.recent-eval, .performance-table { border-color:rgba(112,136,166,.11); background:rgba(255,255,255,.48); }

/* Automation — compact, obvious, no raw giant checkbox */
.automation-panel { padding:20px 21px; }
.task-form {
  grid-template-columns:1.15fr .68fr .95fr 1.15fr .82fr auto;
  gap:8px;
  margin-bottom:12px;
  padding:10px;
  border:1px solid rgba(111,136,166,.10);
  border-radius:15px;
  background:rgba(246,249,252,.58);
}
.task-list-v207 { gap:8px; }
.task-card-v207 {
  padding:12px 13px;
  border:1px solid rgba(111,136,166,.11);
  border-radius:15px;
  background:rgba(255,255,255,.56);
  box-shadow:0 8px 22px rgba(38,57,82,.03);
}
.task-card-v207:hover { background:rgba(255,255,255,.72); }
.task-card-head b { font-size:11.5px; }
.task-card-head small { font-size:8.8px; }
.task-run-status { padding:6px 9px; border-radius:99px; }
.task-last-summary { border:1px solid rgba(112,136,166,.08); background:rgba(244,247,251,.56); }
.task-card-actions { gap:7px; margin-top:10px; }
.task-card-actions label {
  display:inline-flex; align-items:center;
  margin-right:auto;
  padding:5px 8px 5px 6px;
  border:1px solid rgba(112,136,166,.09);
  border-radius:999px;
  background:rgba(255,255,255,.52);
  color:#61728a;
  font-size:9px;
}
.task-card-actions .ghost, .task-card-actions .secondary, .task-card-actions .danger-button { min-height:35px; padding:0 11px; border-radius:10px; font-size:10px; }
.task-legacy-note { border-color:rgba(196,153,83,.16); background:rgba(255,249,237,.62); }
.task-result-panel { border-top-color:rgba(112,136,166,.10); }
.task-run-detail summary { padding:10px 11px; }
.task-result-item { border-color:rgba(112,136,166,.10); border-radius:11px; background:rgba(255,255,255,.62); }

/* Auth */
.auth-shell {
  background:
    radial-gradient(circle at 15% 16%,rgba(185,214,255,.60),transparent 30%),
    radial-gradient(circle at 86% 82%,rgba(205,240,231,.48),transparent 30%),
    #f3f7fb;
}
.auth-card {
  border:1px solid rgba(255,255,255,.92);
  border-radius:30px;
  background:rgba(255,255,255,.70);
  box-shadow:0 30px 80px rgba(35,52,76,.13);
  backdrop-filter:blur(30px) saturate(170%);
  -webkit-backdrop-filter:blur(30px) saturate(170%);
}
.mode-switch { border-radius:15px; background:rgba(228,234,242,.60); }
.mode-switch button.selected { border-radius:11px; background:rgba(255,255,255,.90); }

/* Responsive polish */
@media (max-width:1180px) {
  .main { padding-left:24px; padding-right:24px; }
  .task-form { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .task-form .primary { grid-column:span 3; }
}
@media (max-width:900px) {
  .sidebar { width:218px; }
  .main { width:calc(100% - 218px); margin-left:218px; padding:0 18px 50px; }
  .topbar { min-height:82px; }
  .admin-tabs { top:74px; }
  .admin-load-error-body { align-items:stretch; flex-direction:column; }
}
@media (max-width:720px) {
  .sidebar {
    width:100%; height:auto; inset:auto 0 0 0;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top:1px solid rgba(115,138,166,.14); border-right:0;
    box-shadow:0 -10px 30px rgba(38,52,72,.07);
  }
  .side-brand, .side-caption, .side-foot { display:none; }
  .sidebar nav { grid-template-columns:repeat(5,1fr); gap:3px; }
  .sidebar nav button { min-height:48px; justify-content:center; padding:3px; font-size:0; }
  .sidebar nav button span { width:30px; height:30px; margin:0; font-size:16px; }
  .main { width:100%; margin-left:0; padding:0 12px 84px; }
  .topbar { min-height:74px; top:0; }
  .topbar h2 { font-size:23px; }
  .top-actions { gap:6px; }
  .user-chip { display:none; }
  .status-pill { min-height:26px; font-size:9px; }
  .panel { padding:16px; }
  .card { border-radius:18px; }
  .admin-tabs { top:68px; }
  .task-form { grid-template-columns:1fr; padding:8px; }
  .task-form .primary { grid-column:auto; }
  .task-card-actions { justify-content:flex-start; }
  .task-card-actions label { width:100%; margin-right:0; justify-content:space-between; }
  .task-card-actions .ghost, .task-card-actions .secondary, .task-card-actions .danger-button { flex:1 1 auto; }
  .data-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:450px) {
  .sidebar nav { grid-template-columns:repeat(5,1fr); }
  .data-grid { grid-template-columns:1fr; }
  .admin-load-errors summary { grid-template-columns:auto 1fr; }
  .admin-error-count { display:none; }
}

/* ========================================================================== */
/* V2.0.9 — privacy, inline history, closed positions & mobile navigation      */
/* ========================================================================== */
.text-red { color:#d8515d !important; }
.top-actions { min-width:auto; }
.research-control h3 { margin:0 0 7px; color:#102239; font-size:20px; letter-spacing:-.035em; }

/* Active / sold portfolio ledger */
.portfolio-summary-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.portfolio-tabs { width:max-content; max-width:100%; margin:0 0 14px; }
.position-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.sell-button { color:#8b641f; border-color:rgba(199,150,69,.18); background:rgba(255,248,232,.72); }
.subtle-delete { color:#9b6570; opacity:.72; }
.sell-editor {
  display:grid; grid-template-columns:1fr 1fr minmax(170px,.75fr) auto; gap:9px; align-items:end;
  margin:10px 0; padding:12px; border:1px solid rgba(199,150,69,.16); border-radius:14px;
  background:linear-gradient(135deg,rgba(255,251,241,.82),rgba(255,255,255,.66));
}
.sell-editor > div { display:grid; gap:5px; }
.sell-editor small { color:#8f7a5c; font-size:8.5px; }
.sell-preview b { font-size:13px; }
.sell-editor-actions { display:flex !important; grid-auto-flow:column; gap:6px !important; }
.sell-editor-actions button { min-height:40px; white-space:nowrap; }
.sold-position-card { background:linear-gradient(145deg,rgba(255,255,255,.68),rgba(247,249,252,.72)); }
.sold-facts { grid-template-columns:repeat(4,minmax(0,1fr)); }
.realized-result {
  display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:center;
  margin-top:10px; padding:12px 14px; border-radius:13px; border:1px solid rgba(109,133,162,.10);
}
.realized-result span { color:#73839a; font-size:9px; font-weight:700; }
.realized-result b { font-size:18px; letter-spacing:-.035em; }
.realized-result strong { padding:5px 8px; border-radius:999px; font-size:10px; }
.realized-result.profit { background:rgba(255,239,241,.80); color:#c94350; }
.realized-result.profit strong { background:rgba(220,79,91,.11); color:#c94350; }
.realized-result.loss { background:rgba(237,249,243,.82); color:#157b59; }
.realized-result.loss strong { background:rgba(22,149,106,.11); color:#157b59; }
.sold-note { margin:9px 2px 0; font-size:9px; }

/* History: each detail belongs to its own row */
.history-panel > .panel-head { margin-bottom:10px; }
.history-list-v209 { display:grid; gap:8px; }
.history-entry {
  overflow:hidden; border:1px solid rgba(111,136,166,.11); border-radius:15px;
  background:rgba(255,255,255,.52); transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.history-entry:hover { border-color:rgba(10,132,255,.14); background:rgba(255,255,255,.68); }
.history-entry.expanded { border-color:rgba(10,132,255,.16); box-shadow:0 12px 32px rgba(39,68,105,.06); }
.history-row-v209 {
  display:grid; grid-template-columns:minmax(250px,1.35fr) minmax(120px,.55fr) minmax(180px,.72fr) auto;
  gap:14px; align-items:center; min-height:74px; padding:12px 14px; cursor:pointer;
}
.history-status-chip { justify-self:start; padding:5px 8px; border-radius:999px; color:#677990; background:rgba(237,242,248,.78); font-size:9px; font-weight:700; }
.history-decision { display:grid; gap:2px; }
.history-decision b { color:#334a67; font-size:11px; }
.history-decision small { color:#8b98a8; font-size:8.5px; }
.history-toggle {
  min-width:104px; min-height:38px; display:inline-flex; justify-content:center; align-items:center; gap:7px;
  border:1px solid rgba(10,132,255,.12); border-radius:11px; color:#1769c8;
  background:rgba(237,246,255,.78); font-size:9.5px; font-weight:800;
}
.history-toggle span { font-size:12px; }
.inline-history-detail { margin:0; padding:14px; border-width:1px 0 0; border-radius:0; box-shadow:none; background:rgba(247,250,253,.56); }
.inline-judge-head { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:8px; }
.inline-judge-head small { color:#98a4b4; font-size:8.5px; }
.analyst-details-fold { margin-top:10px; border:1px solid rgba(111,136,166,.10); border-radius:12px; background:rgba(255,255,255,.46); }
.analyst-details-fold summary { padding:10px 12px; cursor:pointer; color:#667990; font-size:9px; font-weight:750; }
.analyst-details-fold .history-analysts { padding:0 10px 10px; }
.history-pagination { margin-top:12px; }

/* V2.0.9 mobile tab bar: icon + Chinese label; less-used tools live in a side sheet. */
.mobile-tabbar, .mobile-menu-backdrop { display:none; }

@media (max-width:1180px) {
  .portfolio-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sell-editor { grid-template-columns:1fr 1fr; }
  .sell-editor-actions { justify-content:flex-end; }
  .history-row-v209 { grid-template-columns:minmax(220px,1fr) minmax(115px,.45fr) minmax(160px,.65fr) auto; gap:10px; }
}

@media (max-width:720px) {
  body { background:linear-gradient(155deg,#f5f8fc 0%,#eef4f9 58%,#edf5f3 100%); }
  .sidebar { display:none !important; }
  .main { width:100%; margin-left:0; padding:0 10px calc(88px + env(safe-area-inset-bottom)); }
  .topbar {
    min-height:66px; margin:0 -2px 8px; padding:0 4px;
    background:linear-gradient(180deg,rgba(245,249,253,.94),rgba(245,249,253,.72));
  }
  .topbar .eyebrow { margin-bottom:2px; font-size:7px; }
  .topbar h2 { font-size:20px; letter-spacing:-.045em; }
  .status-pill { min-height:25px; padding:0 9px; font-size:8px; }
  .user-chip { display:none !important; }

  .mobile-tabbar {
    position:fixed; z-index:40; left:8px; right:8px; bottom:calc(7px + env(safe-area-inset-bottom));
    display:grid; grid-template-columns:repeat(5,1fr); gap:4px; padding:5px;
    border:1px solid rgba(255,255,255,.88); border-radius:19px;
    background:rgba(249,251,254,.88); box-shadow:0 12px 38px rgba(36,52,73,.16);
    backdrop-filter:blur(28px) saturate(180%); -webkit-backdrop-filter:blur(28px) saturate(180%);
  }
  .mobile-tabbar button {
    min-width:0; min-height:53px; display:grid; place-items:center; align-content:center; gap:3px; padding:4px 1px;
    border:0; border-radius:14px; color:#8290a3; background:transparent;
  }
  .mobile-tabbar button span { width:28px; height:25px; display:grid; place-items:center; border-radius:9px; font-size:15px; font-weight:800; }
  .mobile-tabbar button em { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-style:normal; font-size:8px; font-weight:700; }
  .mobile-tabbar button.active { color:#0870d9; background:rgba(229,241,255,.82); }
  .mobile-tabbar button.active span { background:rgba(10,132,255,.10); }

  .mobile-menu-backdrop {
    position:fixed; z-index:50; inset:0; display:block; background:rgba(20,31,47,.22);
    backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  }
  .mobile-menu-sheet {
    position:absolute; right:0; top:0; bottom:0; width:min(84vw,340px); padding:calc(16px + env(safe-area-inset-top)) 12px 18px;
    border-left:1px solid rgba(255,255,255,.86); background:rgba(248,251,254,.92);
    box-shadow:-18px 0 50px rgba(31,45,64,.16); backdrop-filter:blur(30px) saturate(180%); -webkit-backdrop-filter:blur(30px) saturate(180%);
  }
  .mobile-menu-head { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 6px 16px; }
  .mobile-menu-head > div { display:grid; gap:2px; }
  .mobile-menu-head small { color:#8b98a9; font-size:8px; letter-spacing:.12em; }
  .mobile-menu-head b { color:#182943; font-size:20px; }
  .mobile-menu-sheet > button:not(.mobile-logout) , .mobile-logout {
    width:100%; min-height:50px; display:grid; grid-template-columns:34px 1fr auto; gap:8px; align-items:center;
    padding:0 10px; border:0; border-bottom:1px solid rgba(111,136,166,.10); color:#566b85; background:transparent; text-align:left;
  }
  .mobile-menu-sheet > button span { width:29px; height:29px; display:grid; place-items:center; border-radius:9px; background:rgba(255,255,255,.60); }
  .mobile-menu-sheet > button b { font-size:12px; }
  .mobile-menu-sheet > button i { color:#a4afbd; font-style:normal; font-size:20px; }
  .mobile-menu-sheet > button.active { color:#086bce; background:rgba(231,242,255,.62); border-radius:12px; border-bottom-color:transparent; }
  .mobile-logout { margin-top:14px !important; color:#b65661 !important; }

  .card { border-radius:17px; box-shadow:0 9px 28px rgba(40,57,79,.055); }
  .panel { padding:14px; }
  .page-grid, .research-page, .admin-page, .performance-page { gap:10px; }
  .hero { min-height:auto; padding:23px 20px; }
  .hero h1 { font-size:29px; line-height:1.1; }
  .hero-orbit { display:none; }
  .metric-row { gap:9px; }
  .metric { min-height:112px; padding:17px; }
  .metric strong { font-size:27px; }
  .research-control { padding:16px; gap:12px; }
  .research-control h3 { font-size:17px; }
  .research-input { display:grid; grid-template-columns:1fr auto; gap:7px; }
  .mode-row { grid-template-columns:1fr; gap:6px; }
  .snapshot-grid, .analyst-grid, .judge-cols, .portfolio-layout { grid-template-columns:1fr !important; }
  .portfolio-summary-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .portfolio-stat { min-height:102px; padding:15px; }
  .portfolio-stat b { font-size:19px; }
  .portfolio-list-panel { order:1; }
  .portfolio-entry-panel { order:2; position:static !important; }
  .position-head { align-items:flex-start; gap:8px; }
  .position-actions { justify-content:flex-end; }
  .position-actions button { min-height:34px; padding:0 9px; font-size:8.5px; }
  .position-facts, .sold-facts { grid-template-columns:1fr 1fr; gap:7px; }
  .position-facts > div { padding:10px; }
  .advice-grid { grid-template-columns:1fr 1fr; }
  .sell-editor { grid-template-columns:1fr; }
  .sell-editor-actions { grid-auto-flow:row; grid-template-columns:1fr 1fr; }
  .realized-result { grid-template-columns:1fr auto; }
  .realized-result span { grid-column:1/-1; }
  .realized-result b { font-size:17px; }
  .portfolio-tabs { width:100%; display:grid; grid-template-columns:1fr 1fr; }

  .history-panel { padding:14px; }
  .history-panel > .panel-head { align-items:flex-start; }
  .history-row-v209 { grid-template-columns:1fr auto; gap:7px 10px; min-height:0; padding:12px; }
  .history-row-v209 .security-cell { grid-column:1; }
  .history-status-chip { grid-column:2; grid-row:1; align-self:start; }
  .history-decision { grid-column:1; }
  .history-toggle { grid-column:2; grid-row:2; min-width:84px; min-height:34px; padding:0 7px; }
  .inline-history-detail { padding:11px; }
  .history-facts, .history-decision-grid, .history-columns { grid-template-columns:1fr 1fr; }
  .history-columns { gap:8px; }
  .history-analysts { grid-template-columns:1fr !important; }
  .history-pagination { flex-wrap:wrap; }

  .knowledge-metrics { grid-template-columns:1fr 1fr; }
  .knowledge-toolbar, .knowledge-search { grid-template-columns:1fr; }
  .admin-tabs { top:62px; overflow-x:auto; justify-content:flex-start; scrollbar-width:none; }
  .admin-tabs::-webkit-scrollbar { display:none; }
  .admin-tabs button { flex:0 0 auto; }
  .task-card-actions .ghost, .task-card-actions .secondary, .task-card-actions .danger-button { min-width:calc(50% - 5px); }
  .data-grid { grid-template-columns:1fr; }
}

@media (max-width:430px) {
  .main { padding-left:8px; padding-right:8px; }
  .portfolio-summary-grid { grid-template-columns:1fr 1fr; }
  .portfolio-stat { padding:13px; }
  .portfolio-stat span { font-size:8px; }
  .portfolio-stat b { font-size:17px; }
  .history-facts, .history-decision-grid, .history-columns { grid-template-columns:1fr; }
  .mobile-tabbar { left:6px; right:6px; }
}

/* V2.0.10 — A-share color convention & ZSHTEC notice */

.copyright-notice {
  max-width: 900px;
  margin: 8px 0 0;
  color: #6f7d91;
  font-size: 12px;
  line-height: 1.75;
  letter-spacing: .01em;
}
@media (max-width: 720px) {
  .copyright-notice { font-size: 11px; line-height: 1.65; }
}


/* V2.3.0 — natural-language research, deterministic buy decision, stop controls, trial users */
.research-run-actions,.progress-actions,.history-row-actions,.category-query{display:flex;align-items:center;gap:10px}
.research-run-actions .wide{flex:1 1 auto}
.stop-button{appearance:none;border:1px solid rgba(203,62,73,.22);background:rgba(255,239,241,.92);color:#c43e4a;border-radius:13px;min-height:44px;padding:0 16px;font-weight:800;box-shadow:0 8px 22px rgba(191,55,67,.08);cursor:pointer}
.stop-button.compact{min-height:34px;padding:0 11px;border-radius:10px;font-size:12px}
.emergency-stop-button{appearance:none;min-height:40px;padding:0 13px;border-radius:12px;border:1px solid rgba(192,65,75,.18);background:rgba(255,255,255,.64);color:#b84852;font-weight:750;cursor:pointer}
.emergency-stop-button.compact{min-height:32px;font-size:11px}
.trial-note{color:#6e5d33!important;background:rgba(255,248,229,.78);border:1px solid rgba(205,169,76,.18);border-radius:12px;padding:9px 11px}
.trial-top-badge,.trial-inline-note{display:inline-flex;align-items:center;min-height:28px;border-radius:999px;padding:0 10px;font-size:11px;font-weight:750;border:1px solid rgba(61,105,185,.14);background:rgba(238,244,255,.78);color:#54709c}
.natural-query input{min-width:min(720px,62vw)}
.resolved-question{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:10px 12px;border-radius:12px;background:rgba(239,245,255,.58);border:1px solid rgba(80,120,190,.1);font-size:12px}
.resolved-question span{color:var(--muted)} .resolved-question b{font-weight:750}
.question-echo,.history-question{margin:6px 0 10px;color:var(--muted);font-size:13px}
.buy-decision{display:inline-flex;align-items:center;padding:5px 11px;border-radius:999px;font-size:.82em}
.buy-decision.buy,.decision-chip.buy{background:#fff0f1;color:#c94653;border:1px solid rgba(201,70,83,.13)}
.buy-decision.wait,.decision-chip.wait{background:#fff8e8;color:#9a7221;border:1px solid rgba(176,128,38,.14)}
.buy-decision.avoid,.decision-chip.avoid{background:#eef8f4;color:#177657;border:1px solid rgba(23,118,87,.12)}
.position-decision{margin:8px 0 0;color:var(--muted)} .position-decision b{color:var(--text)}
.decision-rule-box{display:grid;gap:5px;margin:14px 0;padding:12px 14px;border-radius:14px;background:rgba(241,246,255,.72);border:1px solid rgba(71,112,181,.11)}
.decision-rule-box b{font-size:14px}.decision-rule-box span{font-size:12px;color:var(--muted);line-height:1.55}
.batch-progress-track{height:7px;overflow:hidden;border-radius:999px;background:rgba(88,113,148,.10);margin-top:10px}
.batch-progress-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#2a8ff2,#68b3ff);transition:width .35s ease}
.trial-user-list{display:grid;gap:12px;margin-top:16px}
.trial-user-card{border:1px solid rgba(93,112,139,.12);background:rgba(255,255,255,.66);border-radius:18px;padding:14px;box-shadow:0 12px 28px rgba(32,51,80,.045);backdrop-filter:blur(18px)}
.trial-user-main{display:grid;grid-template-columns:minmax(170px,1.1fr) auto auto minmax(160px,auto) auto;gap:10px;align-items:center}
.trial-user-main>span:first-child{display:flex;flex-direction:column;gap:3px}
.trial-user-editor{margin-top:12px;padding-top:12px;border-top:1px solid rgba(90,112,140,.10);display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:end}
.trial-user-editor label{display:grid;gap:6px;color:var(--muted);font-size:12px}
.trial-user-editor .check-label,.trial-user-editor .form-actions{grid-column:1/-1}
.trial-fixed-rule{display:grid;gap:4px;padding:10px 12px;border-radius:12px;background:rgba(239,245,255,.76);border:1px solid rgba(70,116,196,.13);color:#49658d}
.trial-fixed-rule small{color:var(--muted);line-height:1.55}
@media(max-width:900px){.trial-user-main{grid-template-columns:1fr auto}.trial-user-main .row-actions{grid-column:1/-1}}
@media(max-width:720px){.research-run-actions,.category-query{align-items:stretch;flex-direction:column}.research-run-actions>* ,.category-query>*{width:100%}.natural-query input{min-width:0}.trial-top-badge{display:none}.trial-user-editor{grid-template-columns:1fr}.trial-user-editor .check-label,.trial-user-editor .form-actions{grid-column:auto}}


/* V2.3.1 — desktop overflow fix + clearer decision diagnostics + mobile final polish */
.natural-research-control{
  grid-template-columns:1fr;
  align-items:stretch;
  gap:16px;
  overflow:hidden;
}
.natural-research-control .research-intro,
.natural-research-control .natural-query,
.natural-research-control .resolved-question,
.natural-research-control .mode-row,
.natural-research-control .research-run-actions{grid-column:1/-1; width:100%; min-width:0}
.natural-research-control .natural-query{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
}
.natural-research-control .natural-query input{min-width:0 !important; width:100%;}
.natural-research-control .natural-query button{white-space:nowrap; min-width:126px;}
.score-origin-box{
  display:flex; align-items:flex-start; gap:10px; margin:10px 0 14px; padding:11px 13px;
  border:1px solid rgba(86,119,168,.12); border-radius:14px; background:rgba(246,249,253,.76);
  color:#65758a; font-size:12px; line-height:1.55;
}
.score-origin-box b{flex:0 0 auto; color:#2f435f; font-size:12px;}
.history-status-chip.done{color:#22785c; background:rgba(235,248,243,.84); border-color:rgba(35,120,92,.12)}

@media (max-width:720px){
  body{background:linear-gradient(165deg,#f7f9fc 0%,#eef4fa 54%,#f1f6f4 100%);}
  .main{padding:0 12px calc(96px + env(safe-area-inset-bottom));}
  .topbar{
    min-height:70px; position:sticky; top:0; z-index:30; margin:0 -12px 10px; padding:0 14px;
    border-bottom:1px solid rgba(255,255,255,.78);
    background:rgba(247,250,253,.78);
    backdrop-filter:blur(24px) saturate(170%); -webkit-backdrop-filter:blur(24px) saturate(170%);
  }
  .topbar .eyebrow{font-size:8px; letter-spacing:.15em; color:#8a98aa;}
  .topbar h2{font-size:22px; line-height:1.1;}
  .status-pill{font-size:9px; min-height:27px; padding:0 10px;}
  .card{border-radius:20px; border-color:rgba(255,255,255,.88); box-shadow:0 12px 34px rgba(36,54,79,.075);}
  .panel{padding:16px;}
  .page-grid,.research-page,.admin-page,.performance-page{gap:12px;}

  .natural-research-control{padding:18px; gap:14px;}
  .natural-research-control .research-intro h3{font-size:20px; margin-bottom:8px;}
  .natural-research-control .research-intro .muted{font-size:13px; line-height:1.7;}
  .natural-research-control .research-note{font-size:11px; line-height:1.65;}
  .natural-research-control .natural-query{grid-template-columns:1fr;}
  .natural-research-control .natural-query input{min-height:50px; font-size:15px; border-radius:14px;}
  .natural-research-control .natural-query button{width:100%; min-height:44px; border-radius:13px; font-size:12px;}
  .resolved-question{display:grid; gap:4px; padding:11px 12px; font-size:11px;}
  .resolved-question b{font-size:12px; line-height:1.55;}

  .mode-row{display:grid !important; grid-template-columns:1fr; gap:8px;}
  .mode-row button{min-height:64px; padding:12px 14px; border-radius:15px; text-align:left;}
  .mode-row button b{font-size:13px;}
  .mode-row button span{font-size:10px; line-height:1.5;}
  .research-run-actions{display:grid !important; grid-template-columns:1fr 1fr; gap:8px;}
  .research-run-actions .primary{grid-column:1/-1; min-height:48px; border-radius:14px; font-size:13px;}
  .research-run-actions .stop-button,.research-run-actions .emergency-stop-button{width:100%; min-height:42px; font-size:11px;}

  .snapshot-grid{gap:10px;}
  .quote-card,.indicators{padding:16px;}
  .quote-main strong{font-size:40px;}
  .facts{display:grid; gap:4px; font-size:10px; line-height:1.5;}
  .indicator-grid{grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;}
  .indicator-grid>div{padding:11px; border-radius:13px; background:rgba(248,250,253,.9);}

  .research-progress-card{padding:16px;}
  .progress-card .panel-head{align-items:flex-start; gap:10px;}
  .progress-actions{align-items:flex-end; gap:7px;}
  .progress-percent b{font-size:28px;}
  .progress-line{display:flex; overflow-x:auto; gap:7px; padding-bottom:3px; scrollbar-width:none;}
  .progress-line::-webkit-scrollbar{display:none;}
  .progress-line span{flex:0 0 auto; min-height:34px; padding:0 10px; border-radius:11px; font-size:10px;}

  .judge-card{padding:17px;}
  .judge-top{display:grid; grid-template-columns:1fr auto; gap:10px; align-items:start;}
  .judge-top>div:first-child{min-width:0;}
  .judge-top h2{font-size:21px; line-height:1.35;}
  .buy-decision{font-size:14px; padding:5px 9px; vertical-align:middle;}
  .judge-score{min-width:84px; padding:10px 8px; border-radius:15px; text-align:center;}
  .judge-score b{font-size:30px;}
  .judge-score small{font-size:8px; line-height:1.4;}
  .decision-rule-box,.score-origin-box{margin:10px 0; padding:11px 12px; border-radius:13px;}
  .score-origin-box{display:grid; gap:4px;}
  .judge-summary{font-size:13px; line-height:1.75;}
  .decision-facts{display:grid; grid-template-columns:1fr 1fr; gap:7px;}
  .decision-facts span{min-height:38px; display:flex; align-items:center; padding:8px 10px; border-radius:11px; font-size:10px;}
  .judge-cols{grid-template-columns:1fr !important; gap:10px;}
  .judge-cols>div{padding:12px; border-radius:14px; background:rgba(249,251,253,.72);}

  .analyst-grid{gap:10px;}
  .analyst-card{padding:15px; border-radius:18px;}
  .analyst-head{align-items:flex-start;}
  .analyst-head b{font-size:13px;}
  .analyst-head small{font-size:9px; line-height:1.45;}
  .analyst-card .stance{align-items:flex-start; gap:7px;}
  .analyst-card .stance strong{font-size:18px; line-height:1.25;}
  .analyst-card p{font-size:12px; line-height:1.7;}

  .history-panel{padding:15px;}
  .history-row-v209{padding:13px; border-radius:15px; margin-bottom:8px; background:rgba(255,255,255,.62); border:1px solid rgba(95,118,146,.10);}
  .history-row-actions{grid-column:1/-1 !important; display:flex; justify-content:flex-end; gap:7px; width:100%;}
  .history-toggle{min-height:36px; min-width:92px;}
  .inline-history-detail{margin-top:8px; padding:13px; border-radius:15px;}
  .history-facts{display:grid; grid-template-columns:1fr 1fr; gap:7px;}
  .history-facts span{padding:8px 9px; border-radius:10px; background:rgba(248,250,253,.82); font-size:10px;}

  .mobile-tabbar{
    left:10px; right:10px; bottom:calc(8px + env(safe-area-inset-bottom)); padding:6px; gap:5px;
    border-radius:22px; background:rgba(250,252,255,.90); box-shadow:0 16px 44px rgba(27,45,70,.18);
  }
  .mobile-tabbar button{min-height:57px; border-radius:15px; gap:4px;}
  .mobile-tabbar button span{width:31px; height:28px; font-size:16px;}
  .mobile-tabbar button em{font-size:10px; font-weight:760; letter-spacing:-.01em;}
}

@media(max-width:430px){
  .main{padding-left:9px; padding-right:9px;}
  .topbar{margin-left:-9px; margin-right:-9px; padding-left:11px; padding-right:11px;}
  .judge-top{grid-template-columns:1fr;}
  .judge-score{width:100%; display:flex; justify-content:space-between; align-items:center; text-align:left;}
  .judge-score small{font-size:9px;}
  .decision-facts,.history-facts{grid-template-columns:1fr;}
  .portfolio-summary-grid{grid-template-columns:1fr 1fr;}
}


/* V2.3.2 — contextual stop button and read-only history */
.research-run-actions .research-stop{
  flex:0 0 auto; min-width:104px; min-height:44px; padding:0 18px;
  border-radius:14px; border:1px solid rgba(205,72,82,.18);
  background:rgba(255,245,246,.88); color:#c24650; font-size:14px; font-weight:800;
  box-shadow:0 8px 20px rgba(178,56,68,.06); backdrop-filter:blur(16px);
}
.research-run-actions .research-stop:hover{background:#fff0f2; box-shadow:0 10px 24px rgba(178,56,68,.09)}
.history-row-actions{justify-content:flex-end}
@media (max-width:720px){
  .research-run-actions .research-stop{width:100%; min-height:42px; font-size:13px}
}

/* V2.3.3 — API spend center */
.health-cost-link{
  display:grid; gap:2px; min-width:210px; text-align:left; border:1px solid rgba(49,118,214,.12);
  background:linear-gradient(135deg,rgba(239,247,255,.9),rgba(248,251,255,.72)); border-radius:14px;
  padding:10px 14px; color:inherit; cursor:pointer; box-shadow:0 7px 22px rgba(47,85,139,.05);
}
.health-cost-link span{font-size:11px;color:var(--muted)}
.health-cost-link b{font-size:18px;color:#1767c7}.health-cost-link small{font-size:9px;color:#8291a7}
.provider-price-mini{color:#657b98!important}.provider-price-mini.warning{color:#b6802e!important}
.api-cost-page{display:grid;gap:16px;grid-column:1/-1}
.api-cost-hero{overflow:hidden;position:relative;background:linear-gradient(135deg,rgba(255,255,255,.84),rgba(235,246,255,.72))}
.api-cost-hero:after{content:"";position:absolute;width:310px;height:310px;border-radius:50%;right:-120px;top:-190px;background:radial-gradient(circle,rgba(67,146,255,.12),transparent 68%);pointer-events:none}
.cost-catalog-badge{padding:7px 11px;border-radius:999px;background:rgba(236,245,255,.88);border:1px solid rgba(61,124,219,.13);color:#56749d;font-size:10px;font-weight:760}
.cost-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:6px;position:relative;z-index:1}
.cost-summary-grid article{display:grid;gap:5px;padding:16px;border-radius:17px;border:1px solid rgba(92,115,145,.10);background:rgba(255,255,255,.62);box-shadow:0 10px 26px rgba(42,63,94,.045);backdrop-filter:blur(18px)}
.cost-summary-grid article small{font-size:10px;color:var(--muted);font-weight:700}.cost-summary-grid article b{font-size:27px;letter-spacing:-.03em}.cost-summary-grid article span{font-size:9px;color:#8b9aae}
.cost-summary-grid article.total{background:linear-gradient(145deg,rgba(230,243,255,.86),rgba(255,255,255,.72));border-color:rgba(53,128,227,.13)}
.cost-summary-grid article.total b{color:#1469ce}
.cost-token-strip{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:12px;padding:10px 12px;border-radius:13px;background:rgba(248,250,253,.68);border:1px solid rgba(92,115,145,.08);font-size:10px;color:var(--muted)}
.cost-token-strip b{color:var(--text)}.cost-notice{margin-top:9px;color:#8a7a5f;font-size:10px;line-height:1.55;padding:9px 11px;border-radius:12px;background:rgba(255,248,228,.65);border:1px solid rgba(194,153,62,.12)}
.provider-cost-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.provider-cost-card{display:grid;gap:11px;padding:15px;border:1px solid rgba(88,111,142,.11);border-radius:18px;background:rgba(255,255,255,.62);box-shadow:0 10px 25px rgba(31,52,83,.04)}
.provider-cost-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.provider-cost-head>div{display:grid;gap:3px}.provider-cost-head b{font-size:14px}.provider-cost-head small{font-size:9px;color:var(--muted)}
.slot-badge{padding:5px 8px;border-radius:999px;background:rgba(234,244,255,.86);color:#4e76a8;font-size:9px;font-weight:750}
.provider-cost-total{display:grid;grid-template-columns:1fr auto;align-items:end;gap:3px;padding:12px;border-radius:14px;background:linear-gradient(135deg,rgba(246,250,255,.9),rgba(255,255,255,.62))}.provider-cost-total small{grid-column:1/-1;color:var(--muted);font-size:9px}.provider-cost-total b{font-size:24px;color:#1269cf}.provider-cost-total span{font-size:9px;color:#8290a5}
.provider-period-row{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.provider-period-row span{display:grid;gap:3px;padding:8px 9px;border-radius:11px;background:rgba(248,250,253,.72);font-size:9px;color:var(--muted)}.provider-period-row b{font-size:11px;color:var(--text)}
.provider-token-row{display:flex;gap:12px;flex-wrap:wrap;color:#8594a8;font-size:9px}
.provider-price-box{display:grid;gap:3px;padding:9px 10px;border-radius:11px;background:rgba(242,248,255,.66);border:1px solid rgba(70,126,205,.09);font-size:9px}.provider-price-box>span,.provider-price-box small{color:var(--muted);line-height:1.45}.provider-price-box>b{font-size:10px}.provider-price-box.unknown{background:rgba(255,247,237,.72);border-color:rgba(193,141,69,.12)}
.pricing-source-link{font-size:9px;color:#3d78bd;text-decoration:none}.pricing-source-link:hover{text-decoration:underline}.cost-data-warning{font-size:9px;color:#b37c2e}
.api-cost-lower-grid{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:16px}.api-cost-lower-grid>.card{min-width:0}
.research-cost-list{display:grid;gap:8px}.research-cost-list>div{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:12px;padding:11px 12px;border-radius:13px;background:rgba(248,250,253,.68);border:1px solid rgba(91,113,142,.08)}.research-cost-list span{display:grid;gap:2px}.research-cost-list span small,.research-cost-list strong small{font-size:9px;color:var(--muted);font-weight:500}.research-cost-list strong{display:grid;text-align:right;color:#1768c7}.research-cost-list em{font-size:9px;color:#8694a6;font-style:normal}
.recent-cost-list{display:grid;gap:5px;max-height:430px;overflow:auto;padding-right:2px}.recent-cost-list>div{display:grid;grid-template-columns:minmax(130px,1fr) auto auto auto;gap:9px;align-items:center;padding:9px 10px;border-bottom:1px solid rgba(92,115,145,.07)}.recent-cost-list>div>span:first-child{display:grid;gap:2px}.recent-cost-list b{font-size:10px}.recent-cost-list small{font-size:8px;color:var(--muted)}.cost-log-tokens{font-size:9px;color:#7c8ba0}.recent-cost-list strong{font-size:10px;color:#1768c7}

@media(max-width:1000px){
  .cost-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .provider-cost-grid{grid-template-columns:1fr}
  .api-cost-lower-grid{grid-template-columns:1fr}
}
@media(max-width:720px){
  .api-cost-page{gap:10px}.api-cost-page .card{padding:15px}
  .cost-summary-grid{grid-template-columns:1fr 1fr;gap:8px}.cost-summary-grid article{padding:12px;border-radius:14px}.cost-summary-grid article b{font-size:21px}
  .cost-token-strip{gap:8px}.provider-cost-card{padding:12px;border-radius:15px}.provider-cost-total b{font-size:20px}
  .provider-period-row{grid-template-columns:1fr 1fr 1fr}.recent-cost-list>div{grid-template-columns:1fr auto}.recent-cost-list>div>small{grid-column:1/-1}.cost-log-tokens{justify-self:end}
  .research-cost-list>div{grid-template-columns:1fr auto}.research-cost-list em{grid-column:1/-1}
  .health-cost-link{min-width:0;width:100%}
}
@media(max-width:430px){
  .cost-summary-grid{grid-template-columns:1fr 1fr}.cost-summary-grid article b{font-size:18px}.provider-period-row{grid-template-columns:1fr}.provider-cost-head{align-items:center}
}

/* ========================================================================== */
/* V2.4.1 — mobile-first PWA research console + verified Fast mode             */
/* Desktop layout deliberately stays on the V2.3.5 visual system.             */
/* ========================================================================== */
.mobile-research-tools,
.analyst-mobile-verdict,
.analyst-mobile-summary,
.analyst-mobile-toggle,
.mobile-snapshot-toggle,
.judge-mobile-toggle,
.mobile-top-menu { display:none; }

.accelerate-button {
  min-height:44px; padding:0 15px; border-radius:14px;
  border:1px solid rgba(198,145,45,.18); color:#9a6a17;
  background:linear-gradient(145deg,rgba(255,250,232,.88),rgba(255,255,255,.82));
  box-shadow:0 8px 22px rgba(158,111,24,.06); font-weight:800; white-space:nowrap; cursor:pointer;
}
.accelerate-button.active {
  color:#8c5a00; border-color:rgba(226,157,28,.28);
  background:linear-gradient(145deg,rgba(255,241,189,.96),rgba(255,250,228,.9));
  box-shadow:0 10px 26px rgba(190,128,18,.12), inset 0 1px 0 rgba(255,255,255,.85);
}
.fast-badge {
  display:inline-flex; align-items:center; min-height:25px; padding:0 8px; margin-left:7px;
  border-radius:999px; color:#966100; background:rgba(255,239,184,.84); border:1px solid rgba(216,151,30,.16);
  font-size:8px; font-weight:850; letter-spacing:.04em;
}

/* PWA control center */
.pwa-admin-panel { overflow:hidden; }
.pwa-state-chip { padding:7px 10px; border-radius:999px; background:rgba(239,243,248,.82); color:#718097; font-size:10px; font-weight:800; }
.pwa-state-chip.ok { color:#15795b; background:rgba(232,248,241,.9); }
.pwa-status-card {
  display:flex; align-items:center; gap:13px; padding:15px; margin:6px 0 14px;
  border:1px solid rgba(83,111,151,.10); border-radius:18px;
  background:linear-gradient(145deg,rgba(246,250,255,.9),rgba(255,255,255,.68));
}
.pwa-app-icon { width:54px; height:54px; flex:0 0 54px; display:grid; place-items:center; border-radius:16px; background:#12243c; color:#fff; font-size:23px; font-weight:900; box-shadow:0 10px 24px rgba(18,36,60,.16); }
.pwa-status-card>div:last-child { display:grid; gap:3px; }
.pwa-status-card b { font-size:15px; }
.pwa-status-card span { color:#587397; font-size:11px; }
.pwa-status-card small { color:var(--muted); font-size:9px; }
.pwa-action-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.pwa-action {
  min-height:108px; display:grid; grid-template-columns:40px 1fr; grid-template-rows:auto auto; gap:3px 10px; align-items:center;
  padding:14px; text-align:left; border:1px solid rgba(86,112,147,.10); border-radius:17px;
  background:rgba(255,255,255,.62); color:var(--text); box-shadow:0 9px 24px rgba(36,58,90,.04); cursor:pointer;
}
.pwa-action>span { grid-row:1/3; width:40px; height:40px; display:grid; place-items:center; border-radius:13px; background:rgba(234,243,255,.9); color:#236fc8; font-size:20px; font-weight:850; }
.pwa-action>b { align-self:end; font-size:12px; }
.pwa-action>small { align-self:start; color:var(--muted); font-size:8.5px; line-height:1.45; }
.pwa-action.primary-action { border-color:rgba(25,118,226,.14); background:linear-gradient(145deg,rgba(236,246,255,.9),rgba(255,255,255,.72)); }
.pwa-action.danger-action>span { color:#bc4852; background:rgba(255,237,240,.92); }
.pwa-action.danger-action { border-color:rgba(190,67,78,.11); }

@media (max-width:720px) {
  /* App shell: the research console is the product on mobile. */
  .main { padding:0 9px calc(79px + env(safe-area-inset-bottom)); }
  .topbar {
    min-height:54px; height:54px; margin:0 -1px 7px; padding:0 2px;
    background:rgba(245,249,253,.78); backdrop-filter:blur(22px); -webkit-backdrop-filter:blur(22px);
  }
  .topbar .eyebrow { display:none; }
  .topbar h2 { font-size:17px; letter-spacing:-.035em; }
  .top-actions .status-pill { min-height:23px; padding:0 8px; font-size:7.5px; }
  .mobile-top-menu {
    display:inline-flex; min-height:29px; align-items:center; padding:0 10px; border:1px solid rgba(88,112,143,.10);
    border-radius:10px; background:rgba(255,255,255,.66); color:#60728a; font-size:10px; font-weight:780;
  }

  /* Only 研判 / 持仓 / 更多 stay in the fixed bar. */
  .mobile-tabbar {
    grid-template-columns:repeat(3,1fr); left:12px; right:12px;
    bottom:calc(8px + env(safe-area-inset-bottom)); padding:5px 6px; gap:6px; border-radius:21px;
  }
  .mobile-tabbar button { min-height:50px; border-radius:14px; grid-template-columns:auto auto; place-content:center; gap:7px; }
  .mobile-tabbar button span { width:26px; height:26px; font-size:14px; }
  .mobile-tabbar button em { font-size:10.5px; }
  .mobile-menu-sheet { width:min(88vw,355px); }
  .mobile-menu-sheet > button:not(.mobile-logout), .mobile-logout { min-height:52px; }
  .mobile-menu-sheet > button b { font-size:13px; }

  /* Reorder research results: input -> progress -> final result -> 6 AI -> raw market data. */
  .research-page { display:flex; flex-direction:column; gap:9px; }
  .research-page>.natural-research-control { order:1; }
  .research-page>.research-progress-card { order:2; }
  .research-page>.judge-card,
  .research-page>.judge-failed-card { order:3; }
  .research-page>.analyst-grid { order:4; }
  .research-page>.mobile-snapshot-toggle { order:5; }
  .research-page>.snapshot-grid { order:6; }

  /* Input card: no manual, no repeated title. */
  .natural-research-control { padding:12px; gap:9px; border-radius:20px; }
  .natural-research-control .research-intro { display:none; }
  .natural-research-control .natural-query { display:block; }
  .natural-research-control .natural-query input {
    width:100%; min-height:58px; padding:0 15px; border-radius:16px; font-size:15px; font-weight:650;
    background:rgba(255,255,255,.80); border:1px solid rgba(72,104,148,.12); box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
  }
  .natural-research-control .natural-query .ghost { display:none; }
  .resolved-question { margin:0; padding:8px 10px; border-radius:12px; gap:3px; }
  .resolved-question span { font-size:8.5px; }
  .resolved-question b { font-size:10.5px; line-height:1.45; }

  .mobile-research-tools { display:flex; gap:7px; align-items:center; }
  .research-options-button,
  .mobile-research-tools .accelerate-button {
    min-height:35px; border-radius:11px; border:1px solid rgba(84,111,147,.10); background:rgba(248,250,253,.78);
    color:#60738e; padding:0 11px; font-size:10px; font-weight:760;
  }
  .research-options-button { flex:1 1 auto; display:flex; justify-content:space-between; align-items:center; }
  .research-options-button span { color:#8a98aa; font-size:9px; }
  .mobile-research-tools .accelerate-button { display:inline-flex; align-items:center; width:auto; flex:0 0 auto; color:#916116; }
  .mobile-research-tools .accelerate-button.active { color:#875800; background:rgba(255,242,196,.9); }
  .desktop-accelerate { display:none !important; }

  .natural-research-control .mode-row { display:none; grid-template-columns:1fr; gap:6px; }
  .natural-research-control .mode-row.mobile-options-open { display:grid; }
  .natural-research-control .mode-row button { min-height:48px; padding:9px 11px; border-radius:12px; }
  .natural-research-control .mode-row button b { font-size:11px; }
  .natural-research-control .mode-row button span { font-size:8.5px; }
  .research-run-actions { display:flex !important; flex-direction:row !important; gap:7px; }
  .research-run-actions .primary { width:auto !important; flex:1 1 auto; min-height:48px; border-radius:15px; font-size:13px; }
  .research-run-actions .research-stop { width:auto !important; flex:0 0 92px; min-height:48px; border-radius:15px; }

  /* Progress becomes a compact live strip rather than a second page. */
  .research-progress-card { padding:12px; border-radius:18px; }
  .research-progress-card .panel-head { align-items:center; margin-bottom:7px; }
  .research-progress-card .eyebrow { display:none; }
  .research-progress-card h3 { font-size:13px; margin:0; }
  .research-progress-card .progress-now { font-size:9px; line-height:1.4; margin-top:2px; }
  .research-progress-card .progress-percent b { font-size:18px; }
  .research-progress-card .progress-percent .status-pill { display:none; }
  .research-progress-track { height:6px; margin:7px 0; }
  .progress-line { display:flex; flex-wrap:nowrap; overflow-x:auto; gap:5px; padding-bottom:2px; scrollbar-width:none; }
  .progress-line::-webkit-scrollbar { display:none; }
  .progress-line span { flex:0 0 auto; min-height:27px; padding:0 8px; display:flex; align-items:center; gap:4px; font-size:8px; border-radius:9px; }
  .judge-handoff { margin-top:7px; padding:8px 10px; }
  .judge-handoff b { font-size:10px; }.judge-handoff span{font-size:8.5px;}

  /* Final answer first. Keep the first screen decisive, details behind one button. */
  .judge-card { padding:14px; border-radius:20px; }
  .judge-top { gap:8px; margin-bottom:7px; }
  .judge-top .eyebrow { display:none; }
  .question-echo { font-size:9px; line-height:1.45; margin-bottom:5px; color:#8290a3; }
  .judge-top h2 { font-size:18px; line-height:1.32; margin:0; }
  .position-decision { margin-top:5px; font-size:10px; }
  .judge-provider { display:none; }
  .judge-score { min-width:76px; padding:8px; border-radius:14px; }
  .judge-score b { font-size:28px; }
  .judge-score small { font-size:7.5px; }
  .decision-rule-box { margin:8px 0; padding:9px 10px; }
  .decision-rule-box b { font-size:10.5px; line-height:1.5; }
  .decision-rule-box span { display:none; }
  .judge-summary { margin:8px 0; font-size:11.5px; line-height:1.65; }
  .decision-facts { grid-template-columns:1fr 1fr; gap:6px; }
  .decision-facts span { min-height:34px; padding:7px 8px; font-size:9px; }
  .judge-mobile-toggle {
    display:flex; width:100%; min-height:36px; justify-content:center; align-items:center; margin-top:9px;
    border:1px solid rgba(61,111,179,.10); border-radius:11px; background:rgba(241,247,255,.72); color:#4e75a5; font-size:10px; font-weight:780;
  }
  .judge-card .score-origin-box,
  .judge-card .judge-cols,
  .judge-card .guardrail { display:none; }
  .judge-card.mobile-detail-open .score-origin-box,
  .judge-card.mobile-detail-open .judge-cols,
  .judge-card.mobile-detail-open .guardrail { display:grid; }
  .judge-card.mobile-detail-open .guardrail { display:block; }

  /* Six AI cards are summaries by default; tap only the analyst you care about. */
  .compact-mobile-analysts { display:grid; grid-template-columns:1fr; gap:7px; }
  .compact-mobile-analysts .analyst-card { min-height:0; padding:11px 12px; border-radius:16px; }
  .compact-mobile-analysts .analyst-head { display:grid; grid-template-columns:31px minmax(0,1fr) auto; gap:8px; align-items:center; }
  .compact-mobile-analysts .analyst-avatar { width:31px; height:31px; border-radius:10px; }
  .compact-mobile-analysts .analyst-head b { font-size:11px; }
  .compact-mobile-analysts .analyst-head small { font-size:8px; }
  .compact-mobile-analysts .analyst-provider { display:none; }
  .analyst-mobile-verdict { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:8px 0 4px 39px; }
  .analyst-mobile-verdict b { color:#234264; font-size:12px; }
  .analyst-mobile-verdict span { color:#8794a5; font-size:8.5px; }
  .analyst-mobile-summary {
    display:-webkit-box; min-height:0 !important; margin:0 0 0 39px !important; color:#68788e !important;
    font-size:10px !important; line-height:1.55 !important; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  }
  .analyst-mobile-toggle {
    display:flex; margin:7px 0 0 auto; min-height:29px; align-items:center; padding:0 9px; border:0; border-radius:9px;
    background:rgba(239,245,252,.72); color:#6280a6; font-size:8.5px; font-weight:760;
  }
  .compact-mobile-analysts .analyst-detail-body { display:none; margin-top:8px; padding-top:8px; border-top:1px solid rgba(90,116,150,.08); }
  .compact-mobile-analysts .analyst-card.mobile-open .analyst-detail-body { display:block; }
  .compact-mobile-analysts .analyst-card.mobile-open .analyst-provider { display:block; }
  .compact-mobile-analysts .analyst-card.mobile-open .analyst-mobile-summary { -webkit-line-clamp:unset; }
  .compact-mobile-analysts .analyst-detail-body>.stance { display:none; }
  .compact-mobile-analysts .analyst-detail-body>p { min-height:0; margin:0 0 7px; font-size:10px; line-height:1.6; }
  .compact-mobile-analysts .tag { font-size:8px; line-height:1.35; }

  /* Raw snapshot is available, but never blocks the result flow. */
  .mobile-snapshot-toggle {
    display:flex; width:100%; min-height:38px; justify-content:center; align-items:center; border:1px solid rgba(81,109,148,.09);
    border-radius:13px; background:rgba(255,255,255,.52); color:#6e819a; font-size:10px; font-weight:760;
  }
  .research-page>.snapshot-grid { display:none; gap:7px; }
  .research-page>.snapshot-grid.mobile-snapshot-open { display:grid; }
  .snapshot-grid .quote-card,.snapshot-grid .indicators { padding:12px; border-radius:16px; }
  .snapshot-grid .explain { display:none; }
  .snapshot-grid .quote-main strong { font-size:28px; }
  .snapshot-grid .facts { gap:5px; font-size:8px; }
  .snapshot-grid .indicator-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
  .snapshot-grid .indicator-grid>div { padding:7px; }

  /* PWA admin is touch-friendly and named; no mystery icon-only actions. */
  .pwa-action-grid { grid-template-columns:1fr; gap:7px; }
  .pwa-action { min-height:78px; grid-template-columns:36px 1fr; padding:10px 12px; border-radius:15px; }
  .pwa-action>span { width:36px; height:36px; border-radius:11px; font-size:18px; }
  .pwa-status-card { padding:12px; border-radius:16px; }
  .pwa-app-icon { width:46px; height:46px; flex-basis:46px; border-radius:14px; font-size:19px; }
}

@media (max-width:430px) {
  .mobile-tabbar { left:9px; right:9px; }
  .research-run-actions .research-stop { flex-basis:82px; padding:0 8px; font-size:11px; }
  .judge-top { grid-template-columns:minmax(0,1fr) 72px; }
  .judge-score { width:auto; display:block; text-align:center; }
  .decision-facts { grid-template-columns:1fr 1fr; }
}

.fast-inline { color:#1d76d2; font-weight:800; }
.fast-provider-note { color:#176cc1 !important; }

/* V2.4.1 — Prompt Engine V2 */
.prompt-actions{display:flex;align-items:center;gap:10px}
.prompt-actions .check-label{display:flex;align-items:center;gap:5px;font-size:12px;color:#778396;white-space:nowrap}
.prompt-actions input{width:auto;min-height:0}

/* V8.0.2 — transparent decision calibration */
.accuracy-basis-box{margin-top:12px;padding:12px 14px;border:1px solid rgba(36,119,255,.16);border-radius:16px;background:rgba(245,249,255,.72);display:grid;gap:5px}
.accuracy-basis-box b{font-size:14px}.accuracy-basis-box span,.accuracy-basis-box small{color:var(--muted);font-size:12px;line-height:1.55}
.position-decision span{font-weight:400;color:var(--muted);font-size:12px}

/* V8.9.0 — personal portfolio review cockpit */
.portfolio-v803 { gap:14px; }
.portfolio-summary-v803 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.portfolio-stat-primary { background:linear-gradient(145deg,#f7fbff 0%,#ffffff 72%); border-color:#dce9f8; }
.portfolio-quick-entry { padding:18px 20px; overflow:hidden; }
.portfolio-inline-form { display:grid; grid-template-columns:.72fr .9fr .72fr .82fr .8fr 1.15fr auto auto; gap:9px; align-items:end; padding-top:14px; border-top:1px solid #edf2f7; margin-top:13px; }
.portfolio-inline-form label { display:grid; gap:5px; min-width:0; }
.portfolio-inline-form label > span { color:#6d7d91; font-size:9px; font-weight:750; white-space:nowrap; }
.portfolio-inline-form input { width:100%; min-width:0; }
.portfolio-inline-cost { min-height:52px; padding:8px 11px; border:1px solid #dfebf8; border-radius:11px; background:#f8fbff; white-space:nowrap; }
.portfolio-inline-cost span,.portfolio-inline-cost b { display:block; }
.portfolio-inline-cost span { color:#7d8c9f; font-size:8px; }
.portfolio-inline-cost b { margin-top:4px; color:#183b67; font-size:15px; font-variant-numeric:tabular-nums; }
.portfolio-save-button { min-height:52px; padding-inline:18px; white-space:nowrap; }
.portfolio-review-panel { padding:20px; overflow:hidden; }
.portfolio-review-head { align-items:flex-start; }
.review-head-actions { display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.portfolio-period-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:14px; padding:9px; border:1px solid #e7edf5; border-radius:14px; background:#f9fbfd; }
.period-pills { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.period-pills button,.calendar-mode-toggle button { min-height:34px; padding:0 12px; border:0; border-radius:9px; color:#758399; background:transparent; font-weight:700; font-size:10px; cursor:pointer; }
.period-pills button.active,.calendar-mode-toggle button.active { color:#176ec9; background:#e8f3ff; box-shadow:inset 0 0 0 1px #cfe4fb; }
.period-controls { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex-wrap:wrap; }
.period-controls input { width:auto; min-height:34px; padding:0 9px; }
.calendar-mode-toggle { display:flex; padding:2px; border:1px solid #e2e9f2; border-radius:10px; background:#fff; }
.calendar-mode-toggle button { min-width:35px; padding:0 9px; }
.portfolio-performance-hero { display:grid; grid-template-columns:minmax(280px,.78fr) minmax(0,1.22fr); gap:14px; margin-top:12px; padding:18px; border:1px solid #e4ebf4; border-radius:16px; background:linear-gradient(135deg,#fbfdff,#f5f9fd); }
.portfolio-performance-hero > div:first-child { display:grid; grid-template-columns:auto auto; grid-template-areas:'small small' 'strong pct' 'range range'; justify-content:start; align-items:end; column-gap:12px; }
.portfolio-performance-hero > div:first-child small { grid-area:small; color:#7d8b9e; font-size:9px; }
.portfolio-performance-hero > div:first-child strong { grid-area:strong; margin-top:5px; font-size:28px; letter-spacing:-.05em; font-variant-numeric:tabular-nums; }
.portfolio-performance-hero > div:first-child b { grid-area:pct; padding-bottom:4px; font-size:15px; font-variant-numeric:tabular-nums; }
.portfolio-performance-hero > div:first-child span { grid-area:range; margin-top:5px; color:#8996a8; font-size:9px; }
.performance-mini-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.performance-mini-stats span { min-width:0; padding:10px 11px; border:1px solid #e9eef5; border-radius:11px; background:rgba(255,255,255,.86); }
.performance-mini-stats small,.performance-mini-stats b { display:block; }
.performance-mini-stats small { color:#8a97a8; font-size:8px; }
.performance-mini-stats b { margin-top:5px; color:#31455f; font-size:12px; font-variant-numeric:tabular-nums; }
.portfolio-review-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr); gap:12px; margin-top:12px; }
.portfolio-calendar-card,.portfolio-contribution-card { min-width:0; padding:15px; border:1px solid #e7edf4; border-radius:15px; background:#fff; }
.review-section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:11px; }
.review-section-head h3 { margin:0; color:#263a54; font-size:14px; }
.review-section-head small { display:block; margin-top:3px; color:#99a4b4; font-size:9px; }
.calendar-weekdays,.portfolio-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
.calendar-weekdays { margin-bottom:6px; }
.calendar-weekdays span { color:#9aa5b4; font-size:9px; text-align:center; }
.portfolio-day { position:relative; min-height:66px; padding:8px 7px; border:1px solid #edf1f5; border-radius:10px; background:#fafbfd; text-align:left; overflow:hidden; }
.portfolio-day.blank { border-color:transparent; background:transparent; }
.portfolio-day b,.portfolio-day strong,.portfolio-day small { display:block; }
.portfolio-day b { color:#34465e; font-size:10px; }
.portfolio-day strong { margin-top:9px; font-size:10px; font-variant-numeric:tabular-nums; }
.portfolio-day small { margin-top:10px; color:#c1c7d0; font-size:9px; text-align:center; }
.portfolio-day i { position:absolute; right:6px; top:6px; color:#9da8b7; font-size:7px; font-style:normal; }
.portfolio-day.gain { border-color:#f2dddd; background:#fff4f4; }
.portfolio-day.gain strong { color:#cf4c56; }
.portfolio-day.loss { border-color:#dceee7; background:#f1faf6; }
.portfolio-day.loss strong { color:#16825e; }
.portfolio-day.flat strong { color:#8b97a7; }
.portfolio-day.rest { opacity:.72; }
.calendar-long-range-note { display:grid; place-items:center; min-height:220px; padding:24px; border:1px dashed #dfe6ee; border-radius:12px; color:#8997a9; background:#fbfcfd; font-size:10px; text-align:center; line-height:1.7; }
.compact-empty { min-height:120px !important; }
.contribution-list { display:grid; gap:7px; }
.contribution-row { display:grid; grid-template-columns:minmax(105px,.8fr) minmax(80px,1fr) auto; align-items:center; gap:9px; padding:9px 0; border-bottom:1px solid #f0f3f7; }
.contribution-row:last-child { border-bottom:0; }
.contribution-bar { height:6px; overflow:hidden; border-radius:99px; background:#f0f3f7; }
.contribution-bar i { display:block; height:100%; border-radius:inherit; }
.contribution-bar i.gain { background:#ef9ca4; }
.contribution-bar i.loss { background:#83cdb3; }
.contribution-number { min-width:82px; text-align:right; font-variant-numeric:tabular-nums; }
.contribution-number b,.contribution-number small { display:block; }
.contribution-number b { font-size:10px; }
.contribution-number small { margin-top:2px; color:#8996a8; font-size:8px; }
.portfolio-settings-card { display:grid; grid-template-columns:minmax(230px,1.2fr) repeat(5,minmax(110px,.55fr)) minmax(180px,.8fr) auto; align-items:end; gap:9px; margin-top:12px; padding:14px; border:1px solid #dfeaf6; border-radius:14px; background:#f8fbff; }
.portfolio-settings-card > div:first-child { align-self:center; }
.portfolio-settings-card > div:first-child b,.portfolio-settings-card > div:first-child small { display:block; }
.portfolio-settings-card > div:first-child b { color:#334a66; font-size:11px; }
.portfolio-settings-card > div:first-child small { margin-top:4px; color:#8897aa; font-size:8px; line-height:1.45; }
.portfolio-settings-card label { display:grid; gap:4px; min-width:0; }
.portfolio-settings-card label > span { color:#6d7d91; font-size:8px; font-weight:700; white-space:nowrap; }
.portfolio-settings-card .portfolio-fee-check { align-self:center; display:flex; align-items:center; gap:6px; color:#66778c; font-size:9px; line-height:1.4; }
.portfolio-data-warning { margin:10px 0 0; padding:9px 11px; border-radius:10px; color:#976b2d; background:#fff8eb; font-size:9px; line-height:1.5; }
.portfolio-list-v803 { min-width:0; }
.sell-editor-v803 { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:8px; align-items:end; margin-top:10px; }
.sell-editor-v803 label { display:grid; gap:4px; }
.sell-editor-v803 label small { color:#7b899c; font-size:8px; }
.sell-preview-card { grid-column:1/-1; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; padding:10px; border:1px solid #e4ebf4; border-radius:11px; background:#f9fbfd; }
.sell-preview-card span { min-width:0; color:#7e8b9d; font-size:8px; }
.sell-preview-card b,.sell-preview-card strong,.sell-preview-card small { display:block; margin-top:4px; font-variant-numeric:tabular-nums; }
.sell-preview-card b { color:#43546a; font-size:11px; }
.sell-preview-card strong { font-size:13px; }
.sell-preview-card small { color:#8d99a9; font-size:8px; }
.sell-editor-v803 .sell-editor-actions { grid-column:1/-1; display:flex; justify-content:flex-end; gap:7px; }
.realized-v803 span small { display:block; margin-top:3px; opacity:.72; font-size:8px; }
.fee-breakdown { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; margin-top:8px; color:#8b97a8; font-size:8px; }

@media (max-width:1350px) {
  .portfolio-inline-form { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .portfolio-note-field { grid-column:span 2; }
  .portfolio-settings-card { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .portfolio-settings-card > div:first-child { grid-column:1/-1; }
  .portfolio-fee-check { grid-column:span 2; }
}
@media (max-width:1000px) {
  .portfolio-review-grid,.portfolio-performance-hero { grid-template-columns:1fr; }
  .portfolio-inline-form { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .portfolio-note-field { grid-column:span 2; }
  .performance-mini-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .portfolio-settings-card { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .sell-editor-v803 { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:720px) {
  .portfolio-summary-v803 { grid-template-columns:1fr 1fr !important; }
  .portfolio-quick-entry,.portfolio-review-panel { padding:15px; }
  .portfolio-inline-form { grid-template-columns:1fr 1fr; }
  .portfolio-inline-form .portfolio-note-field { grid-column:1/-1; }
  .portfolio-inline-cost,.portfolio-save-button { min-height:48px; }
  .portfolio-period-toolbar { align-items:stretch; flex-direction:column; }
  .period-pills { display:grid; grid-template-columns:repeat(5,1fr); gap:3px; }
  .period-pills button { min-width:0; padding:0 5px; font-size:8px; }
  .period-controls { justify-content:flex-start; }
  .period-controls input { flex:1; min-width:120px; }
  .portfolio-performance-hero { padding:14px; }
  .portfolio-performance-hero > div:first-child strong { font-size:24px; }
  .portfolio-calendar-card,.portfolio-contribution-card { padding:12px; }
  .calendar-weekdays,.portfolio-calendar-grid { gap:4px; }
  .portfolio-day { min-height:56px; padding:6px 5px; border-radius:8px; }
  .portfolio-day strong { margin-top:7px; font-size:8px; }
  .portfolio-day b { font-size:9px; }
  .portfolio-day i { display:none; }
  .contribution-row { grid-template-columns:minmax(95px,1fr) minmax(55px,.8fr) auto; }
  .portfolio-settings-card { grid-template-columns:1fr 1fr; }
  .portfolio-settings-card > div:first-child,.portfolio-fee-check { grid-column:1/-1; }
  .portfolio-settings-card > button { grid-column:1/-1; }
  .sell-editor-v803 { grid-template-columns:1fr 1fr; }
  .sell-editor-v803 label:nth-child(3),.sell-editor-v803 label:nth-child(5) { grid-column:1/-1; }
  .sell-preview-card { grid-template-columns:1fr 1fr; }
  .position-actions { flex-wrap:wrap; }
}
@media (max-width:430px) {
  .portfolio-summary-v803 { grid-template-columns:1fr !important; }
  .portfolio-inline-form { grid-template-columns:1fr; }
  .portfolio-inline-form .portfolio-note-field { grid-column:auto; }
  .portfolio-settings-card { grid-template-columns:1fr; }
  .portfolio-settings-card > div:first-child,.portfolio-fee-check,.portfolio-settings-card > button { grid-column:auto; }
}
.portfolio-inline-cost small { display:block; margin-top:2px; color:#91a0b2; font-size:7px; }


/* V8.9.0 — portfolio visual polish + broker fee profiles */
.portfolio-stat-top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.mini-link-button{border:0;background:transparent;padding:2px 0;color:#3387e8;font-size:9px;font-weight:750;cursor:pointer;white-space:nowrap}
.mini-link-button:hover{color:#0d6fd8}
.portfolio-equity-card,.portfolio-fee-stat{position:relative}
.portfolio-settings-overlay{position:fixed;inset:0;z-index:1200;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(27,45,68,.25);backdrop-filter:blur(8px)}
.portfolio-settings-modal{width:min(880px,calc(100vw - 32px));max-height:min(88vh,820px);overflow:auto;padding:22px;border:1px solid rgba(211,225,241,.95);box-shadow:0 28px 80px rgba(40,64,92,.22)}
.portfolio-settings-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:16px;border-bottom:1px solid #edf2f7}
.portfolio-settings-head h2{margin:4px 0 5px;font-size:22px;color:#192f4c}
.modal-close-button{width:38px;height:38px;flex:0 0 38px;border:1px solid #e3eaf2;border-radius:12px;background:#fff;color:#718096;font-size:23px;line-height:1;cursor:pointer}
.portfolio-settings-section{padding:17px 0;border-bottom:1px solid #edf2f7}
.portfolio-settings-section:last-of-type{border-bottom:0}
.settings-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.settings-section-title b,.settings-section-title small{display:block}
.settings-section-title b{font-size:12px;color:#243b58}
.settings-section-title small{margin-top:4px;color:#8997a9;font-size:9px;line-height:1.45}
.settings-value-chip{padding:6px 9px;border:1px solid #dce9f8;border-radius:999px;background:#f5faff;color:#3779be;font-size:9px;font-weight:750;white-space:nowrap}
.capital-section{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.55fr);align-items:end;gap:14px}
.capital-section .settings-section-title{margin:0}
.principal-input,.fee-fields-grid label{display:grid;gap:5px}
.principal-input>span,.fee-fields-grid label>span{color:#66778c;font-size:9px;font-weight:750}
.principal-input input{font-size:18px;font-weight:750;color:#173b65}
.broker-preset-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.broker-preset-button{min-height:58px;padding:10px 11px;border:1px solid #e1e9f2;border-radius:12px;background:#fff;text-align:left;cursor:pointer;transition:.18s ease}
.broker-preset-button b,.broker-preset-button small{display:block}
.broker-preset-button b{color:#344b67;font-size:10px}
.broker-preset-button small{margin-top:4px;color:#98a5b5;font-size:8px}
.broker-preset-button:hover{border-color:#b8d6fa;background:#f8fbff}
.broker-preset-button.active{border-color:#86baf7;background:#eef6ff;box-shadow:inset 0 0 0 1px rgba(60,139,233,.08)}
.broker-preset-button.active b{color:#1672d4}
.fee-fields-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.fee-fields-grid label small{color:#9aa6b5;font-size:7px;line-height:1.35}
.fee-rule-note{display:flex;flex-wrap:wrap;gap:6px 12px;margin-top:12px;padding:10px 12px;border:1px solid #e6edf5;border-radius:11px;background:#fafcfe;color:#6d7c90;font-size:8px;line-height:1.5}
.fee-rule-note b{color:#3e546e}
.portfolio-settings-actions{display:flex;justify-content:flex-end;gap:9px;padding-top:16px}
.portfolio-settings-actions button{min-width:110px}
@media(max-width:980px){.broker-preset-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.fee-fields-grid{grid-template-columns:1fr 1fr}.capital-section{grid-template-columns:1fr}}
@media(max-width:620px){.portfolio-settings-overlay{padding:10px;align-items:flex-end}.portfolio-settings-modal{width:100%;max-height:92vh;padding:16px;border-radius:20px 20px 14px 14px}.portfolio-settings-head h2{font-size:18px}.broker-preset-grid,.fee-fields-grid{grid-template-columns:1fr 1fr}.settings-section-title{align-items:flex-start;flex-direction:column}.portfolio-settings-actions{position:sticky;bottom:-16px;margin:0 -16px -16px;padding:12px 16px;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-top:1px solid #edf2f7}.portfolio-settings-actions button{flex:1;min-width:0}}
@media(max-width:420px){.broker-preset-grid,.fee-fields-grid{grid-template-columns:1fr}}


/* V8.9.0 — formal research workstation polish */
.research-control,.judge-card,.portfolio-review-panel,.position-card{border:1px solid rgba(219,229,241,.92);box-shadow:0 16px 42px rgba(39,68,101,.07)}
.judge-card{position:relative;overflow:hidden}
.judge-card:before{content:"";position:absolute;left:0;top:0;width:4px;height:100%;background:linear-gradient(180deg,#268cf4,#83bfff);opacity:.9}
.judge-top h2{letter-spacing:-.02em}
.position-decision{margin-top:8px;padding:9px 12px;border:1px solid #dfeaf6;border-radius:10px;background:#f8fbff;color:#405a77}
.position-card{transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.position-card:hover{transform:translateY(-1px);border-color:#cbdff4;box-shadow:0 18px 48px rgba(39,68,101,.09)}
.portfolio-stat{min-height:102px}
.portfolio-stat>span,.portfolio-stat-top>span{letter-spacing:.01em}
.sell-preview-card{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.sell-preview-card>span{background:#fff;border:1px solid #e6edf5;border-radius:10px;padding:9px 10px}
@media(max-width:720px){.sell-preview-card{grid-template-columns:1fr 1fr}.judge-card:before{width:3px}}

/* V9 smart-live evidence: compact, formal and readable on PC/mobile. */
.live-evidence-card{padding:18px 20px}.live-evidence-grid{display:grid;grid-template-columns:repeat(9,minmax(90px,1fr));gap:8px}.live-evidence-grid span{padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:var(--soft,#f7f8fa);display:flex;flex-direction:column;gap:3px}.live-evidence-grid small{color:var(--muted);font-size:11px}.live-evidence-grid b{font-size:14px}.live-evidence-missing{border-color:#f0cfc9}.live-evidence-empty{display:flex;flex-direction:column;gap:7px;padding:14px 16px;border:1px solid #f0d7d1;border-radius:14px;background:#fff8f6;color:var(--text)}.live-evidence-empty b{font-size:14px}.live-evidence-empty span,.live-evidence-empty small{color:var(--muted);line-height:1.6}.live-evidence-empty small{font-size:11px;word-break:break-word}.sweep-hint span{white-space:normal}@media(max-width:900px){.live-evidence-grid{grid-template-columns:repeat(3,1fr)}.live-evidence-card{padding:14px}.live-evidence-grid span{padding:9px 10px}}


/* V9.1.0 explicit add/replenish workflow */
.add-button { color:#176b52; border-color:rgba(45,151,112,.22); background:rgba(236,249,244,.9); }
.add-editor-v910 { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:8px; align-items:end; margin-top:10px; padding:12px; border:1px solid #dfece7; border-radius:13px; background:#fbfefd; }
.add-editor-v910 .add-editor-title { grid-column:1/-1; display:flex; align-items:baseline; gap:10px; padding-bottom:3px; }
.add-editor-v910 .add-editor-title b { color:#204438; font-size:12px; }
.add-editor-v910 .add-editor-title small,.add-editor-v910 label small { color:#71887f; font-size:8px; }
.add-editor-v910 label { display:grid; gap:4px; }
.add-preview-card { grid-column:1/-1; display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:7px; padding:10px; border:1px solid #e0ece7; border-radius:11px; background:#f6fbf9; }
.add-preview-card span { min-width:0; color:#738a80; font-size:8px; }
.add-preview-card b,.add-preview-card strong,.add-preview-card small { display:block; margin-top:4px; font-variant-numeric:tabular-nums; }
.add-preview-card b { color:#3e5b50; font-size:10.5px; }
.add-preview-card strong { color:#176b52; font-size:13px; }
.add-cost-note { grid-column:1/-1; margin:0; padding:8px 10px; border-radius:9px; color:#6c7f77; background:#f4f8f6; font-size:8.5px; line-height:1.55; }
.add-editor-actions { grid-column:1/-1; display:flex; justify-content:flex-end; gap:7px; }
.advice-position-reason { margin:8px 0 0; padding:8px 10px; border-left:3px solid #c9d9e8; border-radius:7px; color:#4b5f77; background:#f7f9fc; font-size:9px; line-height:1.6; }
@media(max-width:1080px){.add-editor-v910{grid-template-columns:repeat(3,minmax(0,1fr))}.add-preview-card{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){.add-editor-v910{grid-template-columns:1fr 1fr}.add-editor-v910 label:nth-of-type(3),.add-editor-v910 label:nth-of-type(5){grid-column:1/-1}.add-preview-card{grid-template-columns:1fr 1fr}.add-editor-actions{grid-template-columns:1fr 1fr}.position-actions{flex-wrap:wrap}.position-actions .add-button,.position-actions .sell-button{flex:1 1 42%}}
.portfolio-entry-rule { grid-column:1/-1; padding:8px 10px; border:1px solid #e3eaf3; border-radius:9px; color:#64748b; background:#f8fafc; font-size:9px; line-height:1.55; }
.portfolio-entry-rule b { color:#176b52; }

/* V9.2.0 · post-trade conditional playbook */
.position-playbook{margin-top:10px;border:1px solid var(--line);border-radius:16px;overflow:hidden;background:var(--surface-soft,#f8f9fb)}
.playbook-title{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid var(--line)}
.playbook-title span{font-size:12px;color:var(--muted)}
.playbook-row{display:grid;grid-template-columns:minmax(130px,1.1fr) minmax(95px,.7fr) auto;gap:8px 12px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line)}
.playbook-row:last-child{border-bottom:0}
.playbook-row>span{display:flex;flex-direction:column;gap:2px}.playbook-row>span small,.playbook-row>small{color:var(--muted);font-style:normal}.playbook-row>small{grid-column:1/-1;line-height:1.45}.playbook-row>em{font-size:12px;font-style:normal;color:var(--muted);text-align:right}
@media(max-width:680px){.playbook-title{align-items:flex-start;flex-direction:column}.playbook-row{grid-template-columns:1fr auto}.playbook-row>em{grid-column:2}.playbook-row>small{grid-column:1/-1}}


/* V9.3.0 · objective multi-horizon + disagreement audit */
.horizon-view-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.horizon-view-card{border:1px solid rgba(48,72,110,.11);border-radius:16px;background:rgba(250,251,253,.86);padding:12px 14px;display:grid;gap:6px}
.horizon-view-card>div{display:flex;align-items:center;justify-content:space-between;gap:10px}.horizon-view-card b{font-size:13px}.horizon-view-card strong{font-size:22px}.horizon-view-card span,.horizon-view-card p{font-size:12px;color:var(--muted);line-height:1.55}.horizon-view-card p{margin:0}
.disagreement-box{margin-top:10px;padding:11px 13px;border:1px solid rgba(48,72,110,.12);border-radius:15px;background:rgba(249,250,252,.8);display:grid;gap:5px}.disagreement-box>div{display:flex;justify-content:space-between;gap:12px;align-items:center}.disagreement-box b{font-size:13px}.disagreement-box span,.disagreement-box p,.disagreement-box small{font-size:11.5px;color:var(--muted);line-height:1.55}.disagreement-box p{margin:0}.disagreement-box.level-high{border-color:rgba(202,112,36,.28);background:rgba(255,248,238,.82)}.disagreement-box.level-medium{border-color:rgba(172,145,52,.22)}
@media(max-width:760px){.horizon-view-grid{grid-template-columns:1fr}.disagreement-box>div{align-items:flex-start;flex-direction:column;gap:3px}}
/* Evidence audit: action, market evidence, and execution are separate. */
.decision-audit-panel{margin:20px 0;padding:20px;border:1px solid #dce4ee;border-radius:16px;background:#f8fafc}
.audit-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.audit-head h2,.audit-head h3{margin:4px 0 12px}.audit-head .eyebrow{margin:0}
.execution-chip{padding:7px 12px;border-radius:100px;background:#e9edf3;color:#526174;font-size:12px;font-weight:600}
.execution-chip.ready{background:#e2f4ed;color:#20604b}
.audit-checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
.audit-checks>div{background:#fff;border:1px solid #e3e8ef;border-radius:10px;padding:13px}
.audit-checks span{font-size:13px;color:#637389;font-weight:600}.audit-checks span.passed{color:#25765a}
.audit-checks p{margin:7px 0 0;font-size:12px;line-height:1.65;color:#5f6d80;overflow-wrap:anywhere}
.audit-adjustment{font-size:12px;padding:8px 12px;background:#edf2fa;border-radius:8px;color:#385579;margin:10px 0}
.scoped-risk-list{display:grid;gap:8px;margin-top:14px}.scoped-risk-list>div{display:flex;align-items:flex-start;gap:10px}
.scoped-risk-list p{margin:0;font-size:12px;line-height:1.7;color:#536174;flex:1;overflow-wrap:anywhere}
.risk-kind{flex:none;padding:3px 7px;border-radius:6px;background:#e9edf3;color:#526174;font-size:11px}
.risk-kind.hard_risk{background:#fde8e8;color:#a43535}.risk-kind.conditional{background:#e8effa;color:#466899}
.risk-kind.execution_limit{background:#fff0d9;color:#896127}.risk-kind.data_gap,.risk-kind.review_required{background:#f2eafa;color:#755692}
.original-model-view{margin-top:14px;font-size:12px;color:#647389}.original-model-view summary{cursor:pointer}.original-model-view p{line-height:1.7}
.decision-monitor{padding:24px}.monitor-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:14px 0}
.monitor-stats>div{padding:16px;background:#f6f8fb;border-radius:12px}.monitor-stats span,.monitor-stats small{display:block;color:#718096;font-size:12px}
.monitor-stats b{display:block;font-size:25px;color:#253750;margin:6px 0}.monitor-issues{display:grid;gap:8px}
.monitor-issues>div{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 0;border-top:1px solid #edf0f4}
.monitor-issues b,.monitor-issues small{display:block}.monitor-issues small{font-size:12px;line-height:1.6;color:#718096;margin-top:3px}
@media(max-width:640px){.decision-audit-panel{padding:14px}.audit-checks{grid-template-columns:1fr}.decision-monitor{padding:16px}.monitor-stats{gap:8px}.monitor-stats>div{padding:10px}.monitor-stats b{font-size:20px}.monitor-stats small{font-size:10px}.scoped-risk-list>div{gap:7px}.monitor-issues .ghost{white-space:nowrap}.decision-v230 .decision-audit-panel{display:block}}

/* V10 account dashboard */
.portfolio-page{gap:20px;min-width:0}.account-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:2px 0 0}.account-heading h2{font-size:28px;letter-spacing:-.04em;margin:0}.account-heading p:not(.eyebrow){font-size:13px;color:#8390a3;margin:8px 0 0}.account-heading-actions{display:flex;gap:10px;flex-wrap:wrap}.account-heading-actions button{border-radius:10px;font-size:12px;min-height:38px}
.account-hero{display:grid;grid-template-columns:1.3fr 1fr;border-radius:22px;background:radial-gradient(ellipse at 92% 0%,#325e92 0%,transparent 50%),linear-gradient(120deg,#162b49,#193b61);color:#fff;padding:30px 34px;box-shadow:0 15px 34px #1738591c;overflow:hidden;position:relative}.account-hero-main{min-width:0}.account-basis-tabs{display:flex;gap:5px;background:#ffffff12;padding:4px;border:1px solid #ffffff16;border-radius:9px;width:max-content;margin-bottom:23px}.account-basis-tabs button{background:transparent;color:#b7c9df;font-size:12px;padding:6px 14px;border-radius:6px}.account-basis-tabs button.active{background:#fff;color:#193b61;box-shadow:0 2px 6px #00000015;font-weight:700}.account-hero-caption{display:block;color:#becce0;font-size:13px}.account-hero-caption small{margin-left:8px;font-size:10px;letter-spacing:.13em;color:#8eabc9}.account-hero-main>strong{display:block;font-size:46px;letter-spacing:-.035em;line-height:1.3;font-variant-numeric:tabular-nums;font-weight:650;margin:6px 0 9px}.account-hero-main>p{color:#aac0d7;font-size:11px;line-height:1.7;margin:0}.account-hero-main .account-setup-link{color:#fff;margin-top:10px;background:none;padding:0;font-size:12px}.account-hero-side{border-left:1px solid #ffffff1f;padding:16px 0 0 36px;display:flex;flex-direction:column;justify-content:space-between;margin-left:25px}.account-hero-side>div>span{display:block;color:#becce0;font-size:13px}.account-hero-side b{display:block;font-size:29px;letter-spacing:-.025em;margin:10px 0;font-variant-numeric:tabular-nums}.account-hero-side small{color:#a8bdd3;font-size:11px}.account-hero-side .market-gain{color:#ff969c!important}.account-hero-side .market-loss{color:#76d7b4!important}.account-hero-side .market-flat{color:#fff!important}.account-hero-footer{display:flex;justify-content:space-between;gap:10px;margin-top:36px;padding-top:20px;border-top:1px solid #ffffff1f}.account-hero-side .account-hero-footer span{font-size:11px;color:#a8bdd3}
.account-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.account-kpis>.card{padding:22px;border-radius:16px;box-shadow:0 3px 15px #1e334607}.account-kpis span{font-size:12px;color:#6f7f96}.account-kpis b{display:block;margin:10px 0 8px;font-size:25px;letter-spacing:-.04em;font-variant-numeric:tabular-nums;white-space:nowrap}.account-kpis small{font-size:11px;color:#97a1b1;line-height:1.5;display:block}
.account-overview-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:18px}.account-trend,.account-allocation{padding:24px;border-radius:18px;min-width:0}.account-section-head{display:flex;align-items:start;justify-content:space-between;gap:14px}.account-section-head h3{font-size:16px;margin:0;letter-spacing:-.02em}.account-section-head p{font-size:11px;color:#8b98aa;margin:6px 0 0}.account-section-head>strong{font-size:23px;letter-spacing:-.04em;white-space:nowrap}.account-chart-periods{margin:16px 0 6px;gap:6px}.account-chart-periods button{min-height:28px;font-size:11px;padding:5px 12px;border-radius:6px}.account-chart-wrap{position:relative;min-height:200px}.account-chart-wrap svg{display:block;width:100%;height:212px;overflow:visible;touch-action:pan-y}.account-chart-wrap text{fill:#97a4b5;font-size:11px;font-family:inherit}.account-chart-tooltip{position:absolute;z-index:2;right:12px;top:10px;background:#ffffffed;border:1px solid #e6edf5;box-shadow:0 5px 15px #17385913;border-radius:10px;padding:10px 13px;pointer-events:none}.account-chart-tooltip span,.account-chart-tooltip small{display:block;font-size:10px;color:#8896a9}.account-chart-tooltip b{font-size:15px;display:block;margin:5px 0}.account-trend-footer{border-top:1px solid #edf1f6;padding-top:15px;display:flex;justify-content:space-between;gap:8px;font-size:10px;color:#8996a8}.account-trend-footer b{font-weight:600;color:#334863;margin-left:5px}.allocation-main{display:flex;align-items:center;gap:22px;margin-top:26px}.allocation-donut{width:150px;height:150px;position:relative;flex-shrink:0}.allocation-donut svg{display:block;width:100%;height:100%}.allocation-donut>div{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column}.allocation-donut b{font-size:26px;letter-spacing:-.05em}.allocation-donut small{font-size:10px;color:#8d9bad;margin-top:5px}.allocation-legend{flex:1;min-width:0;display:grid;gap:15px}.allocation-legend>div{display:flex;gap:9px;align-items:flex-start}.allocation-legend i{width:8px;height:8px;border-radius:3px;flex-shrink:0;margin-top:4px}.allocation-legend span{font-size:12px;flex:1;min-width:0}.allocation-legend small{display:block;font-size:10px;color:#91a0b2;margin-top:5px}.allocation-legend b{font-size:12px;font-weight:600;color:#536681}
.portfolio-page .portfolio-quick-entry{padding:20px 24px;border-radius:16px}.portfolio-page .portfolio-quick-entry .panel-head{margin-bottom:0}.portfolio-page .portfolio-quick-entry h3{font-size:15px}.portfolio-page .portfolio-quick-entry .eyebrow{display:none}.portfolio-page .portfolio-inline-form{margin-top:18px}.portfolio-page .portfolio-list-panel{padding:24px;border-radius:18px}.portfolio-page .portfolio-list-panel>.panel-head h2{font-size:19px}.portfolio-page .portfolio-list-panel>.panel-head .eyebrow{font-size:9px}.portfolio-page .portfolio-list-panel>.panel-head p.muted{font-size:12px;margin:6px 0 0}.account-list-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:18px 0}.account-list-toolbar .portfolio-tabs{margin:0}.account-list-controls{display:flex;gap:8px;align-items:center}.account-list-controls input{max-width:160px;min-height:34px;font-size:11px;border-radius:8px}.account-list-controls button{font-size:11px;white-space:nowrap;padding:8px 10px;min-height:34px;border-radius:8px}.account-position-header,.account-position-row{display:grid;grid-template-columns:1.05fr 1fr 1fr 1fr 1fr .85fr;gap:14px;align-items:center}.account-position-header{font-size:10px;color:#8795a8;background:#f6f8fc;border-radius:8px;padding:12px 10px}.account-position-row{padding:21px 10px;border-bottom:1px solid #edf1f6;font-size:12px;font-variant-numeric:tabular-nums}.account-position-row>span{min-width:0}.account-position-row b{font-size:12px;display:block;font-weight:650}.account-position-row .security-cell b{font-size:14px}.account-position-row small{display:block;font-size:10px;color:#95a0b1;margin-top:6px;line-height:1.5}.account-row-actions{display:flex;gap:7px;flex-wrap:wrap}.account-row-actions button{color:#3478f6;background:none;padding:5px 0;font-size:11px}.account-action-tag{display:inline-block!important;padding:5px 7px;border-radius:6px;font-size:10px!important;background:#f2f5fa;color:#6a7a92}.account-action-tag.buy{background:#fff0f1;color:#d65660}.account-action-tag.avoid{background:#edf8f3;color:#198b68}.account-position-detail .position-card{background:#f7f9fd;border:1px solid #e2eaf5;border-radius:12px;margin-top:16px;box-shadow:none}.account-table-note{font-size:10px;color:#96a2b4;line-height:1.8;margin:13px 0 0}.account-ledger-head,.account-ledger-row{display:grid;grid-template-columns:1.1fr 1fr 1.15fr 1fr 1.05fr;gap:16px;align-items:center}.account-ledger-head{background:#f6f8fc;padding:12px;border-radius:8px;color:#8795a8;font-size:10px}.account-ledger-row{padding:18px 12px;border-bottom:1px solid #edf1f6}.account-ledger-row b{font-size:12px;font-weight:600;display:block}.account-ledger-row small{display:block;font-size:10px;color:#91a0b2;margin-top:6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-ledger-row i{display:inline-block;font-style:normal;font-size:9px;padding:3px 5px;border-radius:4px;margin-left:4px}.ledger-buy{color:#d85864;background:#fff0f1}.ledger-sell{color:#148c68;background:#edf8f2}.portfolio-page .portfolio-review-panel{border-radius:18px;padding:24px}.portfolio-page .portfolio-review-panel h2{font-size:19px}.portfolio-page .portfolio-review-head .eyebrow{font-size:9px}.portfolio-page .account-period-summary{padding:20px;border-radius:12px;background:#f8faff}.portfolio-page .account-period-summary>div:first-child strong{font-size:29px}.portfolio-page .portfolio-calendar-card,.portfolio-page .portfolio-contribution-card{border-radius:12px}
@media(max-width:1200px){.account-overview-grid{grid-template-columns:1.3fr 1fr}.allocation-main{gap:12px;flex-direction:column;margin-top:17px}.allocation-donut{width:136px;height:136px}.allocation-legend{width:100%;grid-template-columns:1fr;gap:10px}.account-kpis>.card{padding:18px}.account-kpis b{font-size:22px}.account-list-toolbar{align-items:start;flex-wrap:wrap}.account-position-header,.account-position-row{gap:10px;grid-template-columns:1.1fr 1fr 1fr 1fr 1fr .8fr}.account-position-row{padding-left:0;padding-right:0}.account-position-row b{font-size:11px}.account-position-row .security-cell b{font-size:12px}}
@media(max-width:900px){.account-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.account-overview-grid{grid-template-columns:1fr}.allocation-main{flex-direction:row;gap:30px;margin-top:20px}.allocation-legend{max-width:none}.account-hero{padding:25px}.account-hero-main>strong{font-size:38px}.account-hero-side{padding-left:22px;margin-left:15px}.account-hero-side b{font-size:23px}.account-position-header{display:none}.account-position-row{grid-template-columns:1.1fr 1fr 1fr;gap:15px;padding:20px 0}.account-position-row>span:nth-child(2)::before{content:'成本 / 参考价';display:block;font-size:9px;color:#91a0b2;margin-bottom:5px}.account-position-row>span:nth-child(3)::before{content:'投入 / 参考市值';display:block;font-size:9px;color:#91a0b2;margin-bottom:5px}.account-position-row>span:nth-child(4)::before{content:'参考浮盈亏';display:block;font-size:9px;color:#91a0b2;margin-bottom:5px}.account-row-actions{justify-content:flex-end}.account-position-row b{font-size:12px}.account-position-row .security-cell b{font-size:14px}}
@media(max-width:640px){.portfolio-page{gap:14px}.account-heading{align-items:flex-start}.account-heading h2{font-size:23px}.account-heading .eyebrow{font-size:9px;letter-spacing:.1em}.account-heading p:not(.eyebrow){font-size:11px;max-width:175px;line-height:1.6}.account-heading-actions{gap:5px;max-width:90px;justify-content:flex-end}.account-heading-actions button{font-size:10px;padding:8px 10px;min-height:31px}.account-hero{grid-template-columns:1fr;border-radius:16px;padding:23px}.account-basis-tabs{margin-bottom:17px}.account-hero-main>strong{font-size:42px}.account-hero-main>p{font-size:10px}.account-hero-side{border-left:0;border-top:1px solid #ffffff1f;padding:18px 0 0;margin:19px 0 0}.account-hero-side b{font-size:24px;margin:8px 0}.account-hero-footer{margin-top:20px;padding-top:15px}.account-kpis{gap:10px}.account-kpis>.card{padding:17px 14px;border-radius:12px}.account-kpis b{font-size:20px}.account-kpis span{font-size:11px}.account-kpis small{font-size:9px}.account-trend,.account-allocation{padding:18px;border-radius:14px}.account-section-head h3{font-size:15px}.account-section-head>strong{font-size:19px}.account-chart-wrap{min-height:174px}.account-chart-wrap svg{height:180px}.account-trend-footer{font-size:9px;gap:5px;flex-wrap:wrap}.account-trend-footer b{margin-left:3px}.allocation-main{gap:16px}.allocation-donut{width:124px;height:124px}.allocation-donut b{font-size:23px}.allocation-legend span,.allocation-legend b{font-size:11px}.portfolio-page .portfolio-quick-entry,.portfolio-page .portfolio-list-panel,.portfolio-page .portfolio-review-panel{padding:18px;border-radius:14px}.account-list-toolbar{gap:12px;margin:16px 0}.account-list-toolbar .portfolio-tabs{width:100%;justify-content:space-between;gap:5px}.account-list-toolbar .portfolio-tabs button{font-size:11px;padding:9px 7px;white-space:nowrap}.account-list-controls{width:100%;justify-content:space-between}.account-list-controls input{max-width:none;flex:1;min-width:0}.account-position-row{gap:15px 8px}.account-position-row .security-cell b{font-size:12px}.account-position-row b{font-size:10px}.account-position-row small{font-size:9px}.account-row-actions{gap:9px}.account-row-actions button{font-size:10px}.account-position-row .account-action-tag{font-size:9px!important;padding:4px 5px}.account-ledger-head{display:none}.account-ledger-row{grid-template-columns:1fr 1fr;gap:14px 10px;padding:18px 0}.account-ledger-row>span:last-child{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between}.account-ledger-row>span:last-child small{margin:0}.account-ledger-row b{font-size:11px}.account-ledger-row small{font-size:9px;max-width:140px}.portfolio-page .account-period-summary{padding:15px}.account-period-summary .performance-mini-stats{gap:10px}}

@media(max-width:640px){.portfolio-page .portfolio-quick-entry{order:4}.portfolio-page .portfolio-list-panel{order:5}.portfolio-page .portfolio-review-panel{order:6}}
