:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-muted: #f8f9fb;
  --line: #e3e7ee;
  --line-strong: #d3d9e4;
  --text: #172033;
  --text-soft: #5e687a;
  --text-faint: #8c95a5;
  --brand: #3442c4;
  --brand-dark: #28349d;
  --brand-soft: #eef0ff;
  --green: #178568;
  --green-soft: #eaf7f2;
  --amber: #a96212;
  --amber-soft: #fff5e7;
  --red: #c63d4b;
  --red-soft: #fff0f1;
  --violet: #7056c8;
  --teal: #17848c;
  --sidebar: #11182a;
  --sidebar-soft: #1b2338;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(22, 32, 55, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg.icon { width: 20px; height: 20px; flex: 0 0 auto; }
[hidden] { display: none !important; }

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup img { width: 40px; height: 40px; }
.brand-lockup div { display: grid; gap: 2px; }
.brand-lockup strong { color: #172033; font-size: 16px; letter-spacing: 0.02em; }
.brand-lockup span { color: var(--text-faint); font-size: 9px; letter-spacing: 0.15em; }
.brand-lockup-light strong, .brand-lockup-light span { color: white; }
.brand-lockup-light span { opacity: 0.56; }

.eyebrow, .eyebrow-light { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow { color: var(--brand); }
.eyebrow-light { color: #aab3ff; }

.button {
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--text);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.button:hover { border-color: #aeb7c6; background: #fafbfc; }
.button:disabled { cursor: not-allowed; opacity: 0.58; }
.button.primary { color: white; border-color: var(--brand); background: var(--brand); }
.button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button.soft { color: var(--brand); border-color: var(--brand-soft); background: var(--brand-soft); }
.button.danger { color: var(--red); border-color: #f2c8cc; background: var(--red-soft); }
.button.small { min-height: 32px; padding: 0 11px; font-size: 12px; }
.button.wide { width: 100%; min-height: 44px; }
.button svg { width: 16px; height: 16px; }

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--text-soft);
  display: grid;
  place-items: center;
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--brand);
  font-size: 12px;
  font-weight: 700;
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip > div { display: grid; gap: 2px; }
.user-chip strong { font-size: 13px; }
.user-chip span:not(.avatar) { color: var(--text-faint); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }

.auth-body { min-height: 100vh; background: #eef1f6; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 40px; }
.auth-card { width: min(980px, 100%); min-height: 610px; display: grid; grid-template-columns: 1.06fr 0.94fr; background: white; border-radius: 18px; overflow: hidden; box-shadow: 0 22px 70px rgba(20, 30, 52, 0.15); }
.auth-brand { background: #17203a; color: white; padding: 44px 48px 38px; display: flex; flex-direction: column; }
.auth-brand-copy { margin: auto 0; max-width: 430px; }
.auth-brand-copy h1 { font-size: 38px; line-height: 1.28; letter-spacing: -0.035em; margin: 18px 0 18px; }
.auth-brand-copy p { margin: 0; color: rgba(255,255,255,.64); font-size: 14px; line-height: 1.9; }
.auth-security-note { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.54); font-size: 12px; }
.security-dot { width: 7px; height: 7px; border-radius: 50%; background: #54c8a1; box-shadow: 0 0 0 4px rgba(84,200,161,.12); }
.auth-form-panel { padding: 72px 58px 42px; display: flex; flex-direction: column; }
.auth-heading span { color: var(--brand); font-weight: 700; font-size: 12px; letter-spacing: .12em; }
.auth-heading h2 { font-size: 28px; margin: 12px 0 8px; }
.auth-heading p { color: var(--text-soft); margin: 0; font-size: 13px; }
.auth-form { display: grid; gap: 20px; margin-top: 38px; }
.auth-form label, .field { display: grid; gap: 8px; color: #3b4659; font-size: 12px; font-weight: 650; }
.auth-form input, .field input, .field textarea, .field select, .toolbar-input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: white; color: var(--text); outline: none;
}
.auth-form input, .field input, .field select, .toolbar-input { height: 42px; padding: 0 12px; }
.field textarea { min-height: 104px; resize: vertical; padding: 11px 12px; line-height: 1.65; }
.auth-form input:focus, .field input:focus, .field textarea:focus, .field select:focus, .toolbar-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(52,66,196,.09); }
.form-error { min-height: 18px; margin: -8px 0 -6px; color: var(--red); font-size: 12px; }
.auth-help { margin-top: auto; padding-top: 36px; border-top: 1px solid var(--line); display: grid; gap: 7px; color: var(--text-faint); font-size: 11px; }

.portal-body { min-height: 100vh; }
.portal-topbar { height: 72px; background: white; border-bottom: 1px solid var(--line); padding: 0 max(32px, calc((100vw - 1180px)/2)); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.portal-main { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 58px 0 48px; }
.portal-intro { display: flex; justify-content: space-between; gap: 40px; align-items: flex-end; }
.portal-intro h1 { font-size: 34px; margin: 12px 0 9px; letter-spacing: -.03em; }
.portal-intro p { margin: 0; color: var(--text-soft); font-size: 14px; }
.portal-summary { background: white; border: 1px solid var(--line); border-radius: 12px; height: 74px; padding: 0 24px; display: flex; align-items: center; gap: 22px; }
.portal-summary div { min-width: 72px; display: grid; gap: 4px; }
.portal-summary strong { font-size: 20px; }
.portal-summary span { color: var(--text-faint); font-size: 11px; }
.portal-summary i { width: 1px; height: 30px; background: var(--line); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 52px 0 18px; }
.section-heading h2 { font-size: 19px; margin: 0 0 6px; }
.section-heading p { color: var(--text-faint); font-size: 12px; margin: 0; }
.secure-badge { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 11px; font-weight: 650; }
.secure-badge svg { width: 15px; height: 15px; }
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.app-card { min-height: 238px; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; transition: transform .16s, box-shadow .16s, border-color .16s; }
.app-card:hover { transform: translateY(-2px); border-color: #cbd1dd; box-shadow: var(--shadow); }
.app-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.app-icon { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.app-icon svg { width: 23px; height: 23px; }
.app-teal .app-icon { background: #e9f6f5; color: var(--teal); }
.app-violet .app-icon { background: #f1edff; color: var(--violet); }
.status-pill { border-radius: 999px; padding: 4px 8px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 700; }
.status-pill.beta { color: var(--amber); background: var(--amber-soft); }
.app-card-copy { margin: 24px 0 20px; }
.app-card-copy h3 { margin: 0 0 9px; font-size: 20px; }
.app-card-copy p { color: var(--text-soft); font-size: 13px; line-height: 1.7; margin: 0; }
.app-card-footer { margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--text-soft); font-size: 12px; font-weight: 650; }
.app-card-footer svg { width: 17px; height: 17px; }
.portal-footnote { margin-top: 32px; padding: 18px 20px; display: flex; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fb; }
.footnote-icon { color: var(--brand); padding-top: 2px; }
.portal-footnote strong { font-size: 13px; }
.portal-footnote p { color: var(--text-soft); font-size: 12px; margin: 5px 0 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); background: var(--bg); }
.sidebar { height: 100vh; position: sticky; top: 0; background: var(--sidebar); color: white; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar-brand { min-height: 72px; padding: 0 20px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand img { width: 34px; height: 34px; }
.sidebar-brand div { display: grid; gap: 2px; }
.sidebar-brand strong { font-size: 14px; }
.sidebar-brand span { color: rgba(255,255,255,.42); font-size: 9px; letter-spacing: .12em; }
.sidebar-nav { padding: 18px 12px; display: grid; gap: 4px; }
.sidebar-nav-label { color: rgba(255,255,255,.35); font-size: 10px; letter-spacing: .14em; padding: 8px 10px 6px; }
.nav-item { width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.64); min-height: 40px; border-radius: 8px; padding: 0 11px; display: flex; align-items: center; gap: 10px; text-align: left; font-size: 13px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); }
.nav-item.active { color: white; background: rgba(98,113,255,.22); }
.nav-item svg { width: 18px; height: 18px; }
.nav-item .nav-badge { margin-left: auto; min-width: 21px; height: 19px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: rgba(255,255,255,.72); font-size: 10px; }
.sidebar-footer { margin-top: auto; padding: 14px 12px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.back-portal { width: 100%; display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.62); padding: 9px 10px; font-size: 12px; border-radius: 8px; }
.back-portal:hover { color: white; background: rgba(255,255,255,.05); }
.back-portal svg { transform: rotate(180deg); width: 17px; height: 17px; }

.app-main { min-width: 0; }
.app-topbar { height: 64px; padding: 0 26px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.page-title-small { display: grid; gap: 2px; }
.page-title-small strong { font-size: 15px; }
.page-title-small span { color: var(--text-faint); font-size: 10px; }
.model-badge { display: flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 7px; color: var(--amber); background: var(--amber-soft); font-size: 10px; font-weight: 700; }
.model-badge.connected { color: var(--green); background: var(--green-soft); }
.model-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.points-chip { padding: 7px 10px; border-radius: 8px; background: var(--panel-muted); color: var(--text-soft); font-size: 11px; }
.points-chip strong { color: var(--brand); margin-right: 3px; }
.app-content { padding: 24px 26px 44px; max-width: 1520px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.page-heading h1 { font-size: 24px; margin: 0 0 7px; letter-spacing: -.02em; }
.page-heading p { color: var(--text-soft); margin: 0; font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 9px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metric-card { background: white; border: 1px solid var(--line); border-radius: 11px; padding: 17px 18px; min-height: 104px; }
.metric-card span { color: var(--text-faint); font-size: 11px; }
.metric-card strong { display: block; margin-top: 12px; font-size: 24px; letter-spacing: -.03em; }
.metric-card small { display: block; color: var(--text-faint); margin-top: 5px; font-size: 10px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 16px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.panel-header { min-height: 54px; padding: 0 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 14px; }
.panel-header p { margin: 4px 0 0; color: var(--text-faint); font-size: 10px; }
.panel-body { padding: 17px; }
.panel-body.flush { padding: 0; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.borderless-panel { border: 0; }
.field textarea.tall-140 { min-height: 140px; }
.field textarea.tall-180 { min-height: 180px; }
.metric-card strong.principle-value { font-size: 16px; margin-top: 17px; }
.notice { border: 1px solid #f0dcc0; background: #fffbf4; color: #76511e; border-radius: 9px; padding: 11px 13px; font-size: 11px; line-height: 1.6; }

.method-ranking { display: grid; }
.ranking-row { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 57px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 16px; text-align: left; }
.ranking-row:last-child { border-bottom: 0; }
.rank-number { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--panel-muted); color: var(--text-soft); font-size: 10px; font-weight: 700; }
.ranking-row:first-child .rank-number { background: var(--brand-soft); color: var(--brand); }
.ranking-copy { min-width: 0; }
.ranking-copy strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-copy span { color: var(--text-faint); font-size: 10px; }
.score { color: var(--brand); font-size: 16px; font-weight: 750; }
.todo-list { display: grid; gap: 9px; }
.todo-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.todo-item div { display: grid; gap: 4px; }
.todo-item strong { font-size: 12px; }
.todo-item span { color: var(--text-faint); font-size: 10px; }

.workbench-layout { display: grid; grid-template-columns: minmax(420px, .9fr) minmax(520px, 1.1fr); gap: 16px; align-items: start; }
.workbench-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field.full { grid-column: 1 / -1; }
.field small { color: var(--text-faint); font-size: 10px; font-weight: 400; line-height: 1.5; }
.form-footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 4px; }
.result-empty { min-height: 520px; display: grid; place-items: center; text-align: center; padding: 40px; }
.empty-icon { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 15px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); }
.result-empty h3 { font-size: 15px; margin: 0 0 7px; }
.result-empty p { color: var(--text-faint); max-width: 320px; font-size: 11px; line-height: 1.7; margin: 0; }
.result-document { padding: 20px; }
.result-document h2 { font-size: 19px; margin: 0 0 8px; }
.result-hook { border-left: 3px solid var(--brand); background: var(--brand-soft); padding: 10px 12px; color: #273184; font-size: 12px; line-height: 1.7; margin: 14px 0; }
.script-body { white-space: pre-wrap; font-size: 13px; line-height: 1.95; color: #323d50; }
.result-section { margin-top: 22px; }
.result-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-section-title h3 { font-size: 13px; margin: 0; }
.shot-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.shot-row { display: grid; grid-template-columns: 62px minmax(140px, .85fr) minmax(180px, 1.15fr); gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.55; }
.shot-row:last-child { border-bottom: 0; }
.shot-row time { color: var(--brand); font-weight: 700; }
.shot-row span { color: var(--text-soft); }
.review-box { background: var(--panel-muted); border: 1px solid var(--line); border-radius: 9px; padding: 13px; display: grid; gap: 12px; }
.review-group strong { display: block; font-size: 11px; margin-bottom: 5px; }
.review-group ul { margin: 0; padding-left: 17px; color: var(--text-soft); font-size: 11px; line-height: 1.65; }

.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.search-box { position: relative; min-width: 280px; flex: 1; max-width: 440px; }
.search-box svg { position: absolute; left: 10px; top: 10px; width: 17px; height: 17px; color: var(--text-faint); }
.search-box input { padding-left: 35px; }
.toolbar-input { width: auto; min-width: 150px; font-size: 12px; }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.method-card { background: white; border: 1px solid var(--line); border-radius: 11px; padding: 17px; display: flex; flex-direction: column; min-height: 244px; }
.method-card:hover { border-color: #bdc5d4; }
.method-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.category-tag { padding: 4px 7px; border-radius: 5px; color: var(--brand); background: var(--brand-soft); font-size: 10px; font-weight: 700; }
.method-score { color: var(--text-faint); font-size: 10px; }
.method-score strong { color: var(--brand); font-size: 15px; margin-left: 3px; }
.method-card h3 { font-size: 15px; line-height: 1.45; margin: 15px 0 7px; }
.method-card > p { color: var(--text-soft); font-size: 11px; line-height: 1.65; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 13px 0; }
.tag { border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; color: var(--text-faint); font-size: 9px; }
.method-meta { margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--text-faint); font-size: 10px; }
.method-meta div { display: flex; gap: 10px; }
.method-card-actions { display: flex; gap: 7px; margin-top: 12px; }
.method-card-actions .button { flex: 1; }

.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { background: #f8f9fb; color: var(--text-soft); font-weight: 650; text-align: left; height: 40px; padding: 0 13px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.data-table td { height: 50px; padding: 8px 13px; border-bottom: 1px solid var(--line); color: #3d485a; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfd; }
.cell-main { display: grid; gap: 3px; min-width: 160px; }
.cell-main strong { color: var(--text); font-size: 11px; }
.cell-main span { color: var(--text-faint); font-size: 9px; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 650; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.completed, .status.verified { color: var(--green); }
.status.running, .status.review { color: var(--amber); }
.status.failed { color: var(--red); }
.status.draft { color: var(--text-faint); }
.table-actions { display: flex; gap: 5px; }
.link-button { border: 0; background: none; color: var(--brand); font-size: 10px; padding: 4px; }
.link-button:hover { text-decoration: underline; }
.empty-state { min-height: 240px; display: grid; place-items: center; text-align: center; padding: 30px; }
.empty-state h3 { font-size: 14px; margin: 0 0 6px; }
.empty-state p { color: var(--text-faint); font-size: 11px; margin: 0; }

.modal-layer { position: fixed; inset: 0; z-index: 100; display: none; }
.modal-layer.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 16, 29, .46); }
.modal { position: absolute; right: 0; top: 0; bottom: 0; width: min(660px, 92vw); background: white; box-shadow: -10px 0 35px rgba(0,0,0,.14); display: flex; flex-direction: column; }
.modal.wide { width: min(820px, 94vw); }
.modal-header { height: 64px; flex: 0 0 auto; border-bottom: 1px solid var(--line); padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { margin: 0; font-size: 17px; }
.modal-content { overflow-y: auto; padding: 20px; }
.modal-footer { min-height: 62px; padding: 11px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.detail-summary { color: var(--text-soft); font-size: 12px; line-height: 1.75; margin: 8px 0 18px; }
.detail-block { margin-top: 20px; }
.detail-block h3 { font-size: 12px; margin: 0 0 9px; }
.step-list { display: grid; gap: 8px; counter-reset: steps; }
.step-item { counter-increment: steps; display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 11px; background: var(--panel-muted); border: 1px solid var(--line); border-radius: 8px; color: var(--text-soft); font-size: 11px; line-height: 1.6; }
.step-item::before { content: counter(steps); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-note { grid-column: 1 / -1; color: var(--text-faint); font-size: 10px; line-height: 1.6; }

.feedback-list { display: grid; gap: 9px; }
.feedback-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 9px; }
.feedback-item strong { font-size: 12px; }
.feedback-item p { color: var(--text-faint); font-size: 10px; margin: 4px 0 0; }
.feedback-data { display: flex; gap: 18px; }
.feedback-data div { display: grid; gap: 3px; text-align: right; }
.feedback-data span { color: var(--text-faint); font-size: 9px; }
.feedback-data strong { font-size: 12px; }

.agent-workspace { display: grid; grid-template-columns: 248px minmax(430px, 1fr) 274px; gap: 14px; align-items: stretch; min-height: calc(100vh - 154px); }
.agent-rail, .memory-rail, .chat-panel { overflow: hidden; min-height: 650px; }
.agent-rail { display: flex; flex-direction: column; }
.agent-rail-section { display: grid; gap: 7px; padding: 14px; border-bottom: 1px solid var(--line); }
.rail-label { color: var(--text-faint); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.agent-card { width: 100%; border: 1px solid transparent; border-radius: 9px; background: transparent; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; padding: 9px; text-align: left; }
.agent-card:hover { background: var(--panel-muted); }
.agent-card.active { border-color: #ced3fa; background: var(--brand-soft); }
.agent-symbol { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: white; background: var(--brand); font-size: 11px; font-weight: 750; }
.agent-card > span:last-child { min-width: 0; display: grid; gap: 3px; }
.agent-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.agent-card small { color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.conversation-heading { min-height: 44px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; }
.small-icon { width: 28px; height: 28px; border-radius: 7px; }
.small-icon svg { width: 14px; height: 14px; }
.conversation-list { padding: 0 8px 12px; display: grid; align-content: start; gap: 4px; overflow-y: auto; }
.conversation-item { width: 100%; border: 0; border-radius: 8px; background: transparent; padding: 10px; display: grid; gap: 4px; text-align: left; }
.conversation-item:hover { background: var(--panel-muted); }
.conversation-item.active { background: #f0f2ff; }
.conversation-item strong, .conversation-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-item strong { color: var(--text); font-size: 11px; }
.conversation-item span { color: var(--text-soft); font-size: 9px; }
.conversation-item small { color: var(--text-faint); font-size: 8px; }
.rail-empty { padding: 28px 14px; text-align: center; color: var(--text-faint); font-size: 10px; line-height: 1.7; }
.chat-panel { display: flex; flex-direction: column; }
.chat-header { min-height: 62px; flex: 0 0 auto; border-bottom: 1px solid var(--line); padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-header > div:first-child { min-width: 0; display: grid; gap: 4px; }
.chat-header strong { font-size: 13px; }
.chat-header span { color: var(--text-faint); font-size: 9px; }
.chat-header-actions { display: flex; gap: 7px; }
.chat-messages { flex: 1 1 auto; min-height: 440px; overflow-y: auto; padding: 20px; display: grid; align-content: start; gap: 18px; background: #fbfcfe; }
.chat-message { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; max-width: 92%; }
.chat-message.user { margin-left: auto; grid-template-columns: minmax(0, 1fr) 30px; }
.chat-message.user .message-avatar { grid-column: 2; grid-row: 1; background: #6d7789; }
.chat-message.user .message-bubble { grid-column: 1; grid-row: 1; background: var(--brand-soft); border-color: #d8dcff; }
.message-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--brand); color: white; font-size: 9px; font-weight: 750; }
.message-bubble { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 11px 13px; }
.message-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--text-faint); font-size: 8px; }
.message-meta time { margin-left: auto; }
.message-kind { padding: 2px 5px; border-radius: 4px; color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.message-content { color: #303b4d; white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.8; }
.message-followup { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--brand); font-size: 10px; line-height: 1.6; }
.chat-composer { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 12px; background: white; }
.chat-composer textarea { width: 100%; min-height: 82px; max-height: 220px; resize: vertical; outline: none; border: 0; padding: 4px 5px; color: var(--text); line-height: 1.7; font-size: 12px; }
.chat-composer > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 7px; border-top: 1px solid var(--line); }
.chat-composer > div span { color: var(--text-faint); font-size: 9px; }
.chat-welcome { margin: auto; width: min(680px, 90%); text-align: center; padding: 48px 24px; }
.chat-welcome h2 { margin: 0 0 9px; font-size: 21px; }
.chat-welcome > p { margin: 0 auto; max-width: 530px; color: var(--text-soft); font-size: 11px; line-height: 1.75; }
.welcome-actions { display: flex; justify-content: center; gap: 8px; margin: 21px 0 30px; }
.welcome-guide { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: left; }
.welcome-guide div { border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: var(--panel-muted); }
.welcome-guide strong { display: block; color: var(--brand); font-size: 10px; margin-bottom: 5px; }
.welcome-guide span { color: var(--text-faint); font-size: 9px; line-height: 1.5; }
.memory-rail { display: flex; flex-direction: column; }
.memory-rail > header { min-height: 58px; border-bottom: 1px solid var(--line); padding: 0 13px; display: flex; align-items: center; justify-content: space-between; }
.memory-rail > header > div { display: grid; gap: 3px; }
.memory-rail > header strong { font-size: 12px; }
.memory-rail > header span { color: var(--text-faint); font-size: 8px; }
.memory-mini-list { flex: 1; overflow-y: auto; padding: 10px; display: grid; align-content: start; gap: 8px; }
.memory-mini { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: white; }
.memory-mini.proposed { border-style: dashed; background: #fffcf6; }
.memory-mini > div { display: flex; justify-content: space-between; gap: 8px; }
.memory-mini span, .memory-mini b { font-size: 8px; }
.memory-mini span { color: var(--brand); font-weight: 700; }
.memory-mini b { color: var(--text-faint); font-weight: 600; }
.memory-mini p { margin: 7px 0; color: var(--text-soft); font-size: 9px; line-height: 1.6; }
.memory-mini small { color: var(--text-faint); font-size: 8px; }
.memory-rule { border-top: 1px solid var(--line); padding: 12px 13px; background: var(--panel-muted); }
.memory-rule strong { font-size: 10px; }
.memory-rule p { margin: 5px 0 0; color: var(--text-faint); font-size: 8px; line-height: 1.6; }

.research-guide { display: grid; grid-template-columns: 1fr 20px 1fr 20px 1fr 20px 1fr; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 16px; }
.research-guide > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 9px; align-items: center; }
.research-guide > div > span { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-size: 9px; font-weight: 750; }
.research-guide strong { font-size: 11px; }
.research-guide p { color: var(--text-faint); font-size: 8px; margin: 3px 0 0; }
.research-guide > i { height: 1px; background: var(--line); }
.research-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.research-card { min-height: 228px; border: 1px solid var(--line); border-radius: 10px; padding: 15px; display: flex; flex-direction: column; }
.research-card-top { display: flex; align-items: center; justify-content: space-between; }
.research-card-top time { color: var(--text-faint); font-size: 9px; }
.research-card h3 { margin: 14px 0 6px; font-size: 13px; line-height: 1.5; }
.research-card > p { color: var(--text-soft); font-size: 10px; line-height: 1.6; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.research-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: auto; padding-top: 12px; }
.research-metrics span { color: var(--text-faint); font-size: 8px; }
.research-metrics strong { display: block; color: var(--text); font-size: 10px; margin-top: 2px; }
.analysis-source { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.analysis-source h3 { font-size: 17px; margin: 11px 0 6px; }
.analysis-source p { color: var(--text-faint); font-size: 9px; margin: 0; word-break: break-all; }
.analysis-metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 17px 0; }
.analysis-metric-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.analysis-metric-grid span { color: var(--text-faint); font-size: 8px; }
.analysis-metric-grid strong { display: block; margin-top: 6px; font-size: 15px; }
.analysis-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.analysis-section { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 13px; }
.analysis-section h3 { margin: 0 0 8px; font-size: 11px; }
.analysis-section > strong { display: block; font-size: 11px; line-height: 1.6; }
.analysis-section p, .analysis-section li { color: var(--text-soft); font-size: 10px; line-height: 1.7; }
.analysis-section p { margin: 6px 0 0; }
.analysis-section ul { padding-left: 17px; margin: 0; }
.analysis-section small { display: block; color: var(--text-faint); font-size: 8px; margin-top: 7px; line-height: 1.6; }
.risk-section { background: #fffafa; }
.planting-path { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.planting-path span { border-radius: 7px; padding: 9px; color: var(--text-soft); background: var(--panel-muted); font-size: 9px; line-height: 1.6; }
.transcript-box { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; padding: 13px; color: #2e394b; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 11px; line-height: 1.85; }

.memory-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.memory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.memory-card { border: 1px solid var(--line); border-radius: 9px; padding: 13px; }
.memory-card.proposed { border-style: dashed; background: #fffcf7; }
.memory-card-head { display: flex; align-items: center; justify-content: space-between; }
.memory-confidence { color: var(--text-faint); font-size: 9px; }
.memory-card > p { color: var(--text-soft); font-size: 10px; line-height: 1.7; margin: 10px 0; }
.memory-evidence { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--text-faint); font-size: 8px; }
.memory-actions { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 7px; }
.memory-actions > span { color: var(--amber); font-size: 9px; }
.feedback-work-summary { border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: var(--panel-muted); }
.feedback-work-summary > span, .form-subheading > span { display: block; color: var(--text-faint); font-size: 9px; }
.feedback-work-summary strong { display: block; font-size: 12px; margin: 5px 0; }
.feedback-work-summary p { color: var(--text-soft); font-size: 10px; line-height: 1.6; margin: 0; }
.form-subheading { display: flex; align-items: center; justify-content: space-between; padding-top: 5px; }
.form-subheading strong { font-size: 11px; }
.run-picker { display: grid; gap: 8px; }
.run-picker button { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.run-picker button:hover { border-color: #bcc4d2; background: var(--panel-muted); }
.run-picker button > span { min-width: 0; display: grid; gap: 4px; }
.run-picker strong, .run-picker small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-picker strong { font-size: 11px; }
.run-picker small { color: var(--text-faint); font-size: 9px; }
.run-picker b { flex: 0 0 auto; color: var(--brand); font-size: 10px; }

/* Content-growth operating system */
.brain-strip { min-height: 48px; margin-bottom: 14px; border: 1px solid #dfe3f6; border-radius: 10px; background: linear-gradient(90deg,#f7f8ff,#fbfcff); display: flex; align-items: center; justify-content: center; gap: 18px; padding: 9px 16px; color: var(--text-soft); font-size: 10px; }
.brain-strip span { display: flex; align-items: center; gap: 6px; }
.brain-strip b { color: var(--brand); font-size: 11px; }
.brain-strip i { color: #aab1cc; font-style: normal; }
.growth-studio { display: grid; grid-template-columns: 238px minmax(500px,1fr) 300px; gap: 14px; align-items: start; }
.task-rail { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow: hidden; }
.task-rail > header { min-height: 58px; padding: 0 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.task-rail > header > div { display: grid; gap: 3px; }
.task-rail > header b { font-size: 12px; }
.task-rail > header small { color: var(--text-faint); font-size: 9px; }
.task-rail > header .icon-button { width: 30px; height: 30px; }
.task-rail > div { max-height: calc(100vh - 154px); overflow-y: auto; padding: 8px; }
.growth-task { width: 100%; display: grid; gap: 6px; border: 1px solid transparent; border-radius: 9px; background: transparent; padding: 10px; text-align: left; }
.growth-task:hover { background: var(--panel-muted); }
.growth-task.active { border-color: #cfd4fa; background: var(--brand-soft); }
.growth-task .status { justify-self: start; }
.growth-task strong { font-size: 11px; line-height: 1.45; }
.growth-task small { color: var(--text-faint); font-size: 8px; line-height: 1.55; }
.studio-main { min-height: calc(100vh - 146px); display: flex; flex-direction: column; overflow: hidden; }
.studio-header { min-height: 76px; flex: 0 0 auto; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.studio-header > div:first-child { min-width: 0; }
.studio-header h2 { display: inline; margin: 0 8px; font-size: 14px; }
.studio-header p { color: var(--text-faint); font-size: 9px; margin: 7px 0 0; }
.studio-header > div:last-child { display: flex; gap: 6px; }
.context-banner { min-height: 37px; flex: 0 0 auto; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: #f8f9fc; border-bottom: 1px solid var(--line); color: var(--text-faint); font-size: 9px; }
.context-banner b { color: var(--text-soft); }
.growth-messages { flex: 1 1 auto; min-height: 300px; max-height: 48vh; overflow-y: auto; display: grid; align-content: start; gap: 16px; padding: 18px; background: #fbfcfe; }
.growth-message { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 9px; max-width: 92%; }
.growth-message.user { grid-template-columns: minmax(0,1fr) 30px; margin-left: auto; }
.growth-message.user .message-avatar { grid-column: 2; grid-row: 1; background: #6b7486; }
.growth-message.user > div:last-child { grid-column: 1; grid-row: 1; background: #f0f2ff; border-color: #d9dcfa; }
.growth-message > div:last-child { border: 1px solid var(--line); border-radius: 10px; background: white; padding: 10px 12px; }
.growth-message header { display: flex; align-items: center; gap: 7px; color: var(--text-faint); font-size: 8px; }
.growth-message header span { color: var(--brand); background: var(--brand-soft); border-radius: 4px; padding: 2px 5px; }
.growth-message header b { color: var(--text-soft); }
.growth-message header time { margin-left: auto; }
.growth-message p { white-space: pre-wrap; word-break: break-word; color: #303b4d; font-size: 11px; line-height: 1.8; margin: 7px 0 0; }
.message-version { margin-top: 8px; border: 0; background: transparent; color: var(--brand); font-size: 9px; padding: 0; }
.current-script { margin: 0 14px 12px; border: 1px solid #d9ddf4; border-radius: 9px; overflow: hidden; background: white; }
.current-script header { min-height: 41px; padding: 0 11px; background: #f6f7ff; display: flex; align-items: center; justify-content: space-between; }
.current-script header > div { display: grid; gap: 2px; }
.current-script header b { font-size: 10px; }
.current-script header span { color: var(--text-faint); font-size: 8px; }
.current-script > p { max-height: 180px; overflow-y: auto; white-space: pre-wrap; color: var(--text-soft); font-size: 10px; line-height: 1.8; margin: 0; padding: 11px 12px; }
.studio-composer { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 11px; }
.studio-composer textarea { width: 100%; min-height: 88px; max-height: 220px; resize: vertical; border: 0; outline: none; padding: 4px; line-height: 1.7; font-size: 11px; }
.studio-composer > div { border-top: 1px solid var(--line); padding-top: 8px; display: flex; align-items: center; gap: 7px; }
.studio-composer label { display: flex; align-items: center; gap: 5px; color: var(--text-faint); font-size: 9px; }
.studio-composer select { height: 31px; border: 1px solid var(--line); border-radius: 7px; padding: 0 7px; max-width: 160px; font-size: 9px; }
.studio-composer > div > span { margin-right: auto; color: var(--text-faint); font-size: 8px; }
.studio-side { display: grid; gap: 10px; position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow-y: auto; }
.side-section { padding: 12px; }
.side-section > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.side-section > header b { font-size: 11px; }
.side-section > header span { color: var(--brand); font-size: 9px; font-weight: 700; }
.side-section > p { color: var(--text-faint); font-size: 8px; line-height: 1.55; margin: 6px 0 0; }
.quota-bar { height: 6px; overflow: hidden; border-radius: 99px; background: #eceef4; }
.quota-bar i { display: block; height: 100%; background: var(--brand); }
.version-list { display: grid; gap: 7px; }
.version-card { border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.version-card.current { border-color: #cfd4fa; background: #f8f8ff; }
.version-card > div { display: flex; align-items: center; gap: 6px; }
.version-card > div span { color: var(--brand); font-size: 9px; font-weight: 750; }
.version-card > div b { font-size: 9px; }
.version-card > div small { margin-left: auto; color: var(--text-faint); font-size: 7px; }
.version-card p { color: var(--text-faint); font-size: 8px; line-height: 1.5; margin: 6px 0 8px; }
.review-mini { border-top: 1px solid var(--line); padding: 8px 0; }
.review-mini:first-child { border-top: 0; }
.review-mini span { color: var(--brand); font-size: 8px; }
.review-mini b { float: right; font-size: 8px; }
.review-mini p { clear: both; color: var(--text-soft); font-size: 8px; line-height: 1.55; margin: 5px 0 0; }
.side-empty { color: var(--text-faint); text-align: center; font-size: 8px; line-height: 1.6; padding: 12px 4px; }
.action-stack { display: grid; gap: 7px; padding: 10px; }
.version-editor-meta, .diff-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: var(--panel-muted); color: var(--text-soft); font-size: 9px; }
.diff-summary { background: #f3f5ff; color: #3e4971; }
.diff-summary b { margin-right: auto; }
.script-editor { min-height: 430px !important; font-size: 12px; line-height: 1.9 !important; }
.diff-timeline { display: grid; gap: 12px; }
.diff-timeline article { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.diff-timeline header { padding: 10px 12px; background: var(--panel-muted); display: flex; justify-content: space-between; gap: 12px; }
.diff-timeline header b { font-size: 11px; }
.diff-timeline header span { color: var(--text-faint); font-size: 9px; }
.diff-timeline article > div { display: grid; grid-template-columns: 1fr 1fr; }
.diff-timeline section { padding: 11px; }
.diff-timeline section + section { border-left: 1px solid var(--line); }
.diff-timeline section > b { font-size: 9px; }
.diff-timeline p { font-size: 9px; line-height: 1.6; padding: 6px; border-radius: 5px; }
.diff-timeline .removed { color: #913742; background: #fff1f2; text-decoration: line-through; }
.diff-timeline .added { color: #176a55; background: #ecf8f3; }
.inline-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.task-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.task-facts section, .source-detail section, .analysis-columns section { border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.task-facts section:last-child { grid-column: 1/-1; }
.task-facts b, .source-detail h3, .analysis-columns h3 { font-size: 11px; margin: 0 0 7px; }
.task-facts p, .source-detail p, .analysis-columns p { color: var(--text-soft); white-space: pre-wrap; font-size: 9px; line-height: 1.7; }
.source-detail { display: grid; gap: 10px; }
.source-detail > section { background: #fbfcfe; }
.research-principles { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.research-principles > div { min-height: 76px; display: grid; gap: 5px; align-content: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: white; }
.research-principles b { font-size: 11px; }
.research-principles span { color: var(--text-faint); font-size: 9px; line-height: 1.55; }
.cap-type-tabs { display: grid; grid-template-columns: 110px repeat(5,1fr); gap: 8px; margin-bottom: 14px; }
.cap-type-tabs button { min-height: 58px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 8px 10px; display: grid; align-content: center; gap: 3px; text-align: left; }
.cap-type-tabs button:first-child { text-align: center; }
.cap-type-tabs button:hover, .cap-type-tabs button.active { border-color: #bbc3f3; background: var(--brand-soft); }
.cap-type-tabs b { font-size: 10px; }
.cap-type-tabs span { color: var(--text-faint); font-size: 7px; line-height: 1.45; }
.capability-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.capability-card { min-height: 280px; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 15px; display: flex; flex-direction: column; }
.capability-card > header { display: flex; align-items: flex-start; justify-content: space-between; }
.capability-card > header > div { display: flex; align-items: center; gap: 6px; }
.capability-card > header small { color: var(--text-faint); font-size: 8px; }
.cap-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--brand); font-size: 11px; font-weight: 750; }
.cap-icon.method { background: var(--green); }.cap-icon.workflow { background: var(--violet); }.cap-icon.template { background: var(--amber); }.cap-icon.application { background: var(--teal); }
.capability-card h3 { font-size: 14px; margin: 15px 0 8px; }
.capability-card > p { color: var(--text-soft); font-size: 10px; line-height: 1.65; margin: 0; }
.capability-card .tag-list { margin: 12px 0; }
.capability-card .tag-list span { border-radius: 5px; background: var(--panel-muted); padding: 4px 6px; color: var(--text-faint); font-size: 8px; }
.cap-stats { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 10px; color: var(--text-faint); font-size: 8px; }
.capability-card footer { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.cap-detail-hero { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.cap-detail-hero b { font-size: 10px; color: var(--brand); }
.cap-detail-hero p { color: var(--text-soft); font-size: 11px; margin: 4px 0 0; }
.execution-box { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.execution-box h3 { font-size: 11px; }
.execution-box pre { max-height: 260px; overflow: auto; white-space: pre-wrap; color: var(--text-soft); background: var(--panel-muted); border-radius: 7px; padding: 10px; font: 9px/1.7 ui-monospace,monospace; }
.brain-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.brain-card { min-height: 130px; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 16px; display: flex; gap: 12px; }
.brain-card > span { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; color: white; background: var(--brand); font-weight: 750; }
.brain-card.project > span { background: var(--violet); }.brain-card.company > span { background: var(--green); }
.brain-card h3 { font-size: 13px; margin: 1px 0 7px; }
.brain-card p { color: var(--text-soft); font-size: 9px; line-height: 1.65; margin: 0 0 8px; }
.brain-card small { color: var(--text-faint); font-size: 8px; }
.experience-table > article { display: grid; grid-template-columns: 1fr 1.1fr 170px; gap: 16px; align-items: center; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.experience-table > article:last-child { border-bottom: 0; }
.experience-table h3 { font-size: 12px; margin: 7px 0 5px; }
.experience-table p { color: var(--text-soft); font-size: 9px; line-height: 1.6; margin: 0; }
.experience-table small { display: block; color: var(--text-faint); font-size: 8px; margin-top: 7px; }
.experience-method { border-left: 1px solid var(--line); padding-left: 15px; }
.experience-method b { font-size: 9px; }
.experience-method span { display: block; color: var(--text-faint); font-size: 8px; margin-top: 5px; }
.experience-table footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.maturity { display: inline-flex; border-radius: 999px; padding: 3px 7px; color: var(--amber); background: var(--amber-soft); font-size: 8px; font-weight: 700; }
.maturity.project_verified, .maturity.company_standard { color: var(--green); background: var(--green-soft); }
.maturity.company_candidate { color: var(--violet); background: #f1edff; }
.automation-flow { display: flex; align-items: center; overflow-x: auto; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.automation-flow > div { min-width: 95px; display: grid; gap: 3px; text-align: center; }
.automation-flow span { color: var(--brand); font-size: 8px; font-weight: 750; }
.automation-flow b { font-size: 9px; }
.automation-flow > i { color: #c1c6d1; font-style: normal; }
.workflow-card { border: 1px solid var(--line); border-radius: 9px; padding: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.workflow-card h3 { font-size: 11px; margin: 0 0 5px; }
.workflow-card p { color: var(--text-soft); font-size: 9px; margin: 0 0 7px; }
.workflow-card > div > div { display: flex; flex-wrap: wrap; gap: 4px; }
.workflow-card > div > div span { border-radius: 4px; background: var(--panel-muted); padding: 3px 5px; color: var(--text-faint); font-size: 7px; }
.rule-row { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.rule-row > div { display: grid; gap: 4px; }
.rule-row b { font-size: 10px; }.rule-row span { color: var(--text-faint); font-size: 8px; }
.run-table > div, .quota-table > div { min-height: 44px; display: grid; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); font-size: 9px; }
.run-table > div { grid-template-columns: 1.4fr 1fr .7fr .8fr .9fr; }
.run-table .run-head, .quota-table .quota-head { min-height: 36px; color: var(--text-faint); background: var(--panel-muted); font-size: 8px; font-weight: 700; }
.quota-table > div { grid-template-columns: 1.2fr 1fr .8fr .8fr .8fr .8fr 70px; }
.quota-table > div > span:first-child { display: grid; gap: 3px; }
.quota-table small { color: var(--text-faint); font-size: 8px; }
.usage-row { display: grid; grid-template-columns: 150px minmax(100px,1fr) 120px; align-items: center; gap: 10px; min-height: 35px; }
.usage-row b { font-size: 9px; }.usage-row span { color: var(--text-faint); text-align: right; font-size: 8px; }
.usage-row > div { height: 6px; border-radius: 99px; background: #eceef4; overflow: hidden; }.usage-row i { display: block; height: 100%; background: var(--brand); }
.quota-donut { width: 140px; height: 140px; margin: 18px auto 0; border-radius: 50%; background: conic-gradient(var(--brand) var(--used),#eceef4 0); display: grid; place-items: center; }
.quota-donut > div { width: 104px; height: 104px; border-radius: 50%; background: white; display: grid; place-content: center; text-align: center; }
.quota-donut b { font-size: 24px; }.quota-donut span { color: var(--text-faint); font-size: 9px; }
.provider-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding: 14px; }
.provider-grid article { border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.provider-grid article > div { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.provider-grid h3 { font-size: 10px; margin: 0; }.provider-grid p { color: var(--text-soft); font-size: 8px; }.provider-grid small { display: block; color: var(--text-faint); font-size: 8px; margin-bottom: 9px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.admin-principle { color: var(--text-soft); font-size: 10px; line-height: 1.75; }

/* Product-level long-term co-creation workspace */
.product-studio { display: grid; grid-template-columns: 250px minmax(520px, 1fr) 310px; gap: 12px; align-items: start; }
.workspace-rail { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow: hidden; display: flex; flex-direction: column; }
.workspace-rail > header { min-height: 58px; padding: 0 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workspace-rail > header > div { display: grid; gap: 3px; min-width: 0; }
.workspace-rail > header b { font-size: 11px; }
.workspace-rail > header small { color: var(--text-faint); font-size: 8px; }
.workspace-list { padding: 8px; display: grid; gap: 5px; max-height: 290px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.workspace-item { width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 8px; display: grid; grid-template-columns: 31px minmax(0,1fr); gap: 8px; align-items: center; text-align: left; }
.workspace-item:hover { background: var(--panel-muted); }
.workspace-item.active { border-color: #cbd1f4; background: #f2f4ff; }
.workspace-mark { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; color: white; background: var(--brand); font-size: 11px; font-weight: 750; }
.workspace-item > span:last-child { min-width: 0; display: grid; gap: 4px; }
.workspace-item strong, .workspace-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-item strong { font-size: 10px; }
.workspace-item small { color: var(--text-faint); font-size: 7px; }
.workspace-work-heading { min-height: 42px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; }
.workspace-work-heading > span { color: var(--text-faint); font-size: 8px; font-weight: 700; }
.workspace-work-list { flex: 1 1 auto; min-height: 180px; overflow-y: auto; padding: 0 7px 9px; display: grid; align-content: start; gap: 4px; }
.workspace-work { width: 100%; border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 8px 9px; display: grid; gap: 4px; text-align: left; }
.workspace-work:hover { background: var(--panel-muted); }
.workspace-work.active { border-color: var(--line); background: #f7f8fb; }
.workspace-work > span { justify-self: start; }
.workspace-work strong { font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-work small { color: var(--text-faint); font-size: 7px; }
.product-chat { min-height: calc(100vh - 154px); overflow: hidden; display: flex; flex-direction: column; }
.product-chat-header { min-height: 72px; padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-chat-header > div:first-child { min-width: 0; }
.workspace-kicker { color: var(--brand); font-size: 8px; font-weight: 700; }
.product-chat-header h2 { margin: 3px 0 4px; font-size: 15px; }
.product-chat-header p { max-width: 620px; margin: 0; color: var(--text-faint); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-chat-header > div:last-child { flex: 0 0 auto; display: flex; gap: 6px; }
.workspace-context-bar { min-height: 38px; padding: 0 13px; border-bottom: 1px solid var(--line); background: var(--panel-muted); display: flex; align-items: center; gap: 14px; color: var(--text-faint); font-size: 8px; overflow-x: auto; white-space: nowrap; }
.workspace-context-bar b { color: var(--text); font-size: 9px; margin-right: 2px; }
.product-timeline { flex: 1 1 auto; min-height: 360px; max-height: calc(100vh - 470px); overflow-y: auto; padding: 14px; display: grid; align-content: start; gap: 12px; background: #fbfcfe; }
.current-work-card { margin: 0 12px 10px; border: 1px solid #d9ddf4; border-radius: 9px; overflow: hidden; background: white; }
.current-work-card > header { min-height: 45px; padding: 7px 10px; background: #f6f7ff; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.current-work-card > header > div:first-child { min-width: 0; display: grid; gap: 3px; }
.current-work-card small { color: var(--text-faint); font-size: 7px; }
.current-work-card b { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-work-card > header > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.current-work-card > p { max-height: 145px; overflow-y: auto; margin: 0; padding: 10px 11px; color: var(--text-soft); white-space: pre-wrap; font-size: 9px; line-height: 1.75; }
.product-composer { border-top: 1px solid var(--line); background: white; padding: 10px 11px; }
.product-composer > textarea { width: 100%; min-height: 86px; max-height: 210px; border: 0; outline: 0; resize: vertical; padding: 4px; font-size: 11px; line-height: 1.75; }
.composer-targets { padding: 7px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(180px,1.4fr) minmax(130px,1fr) minmax(120px,.8fr); gap: 7px; }
.composer-targets label { display: grid; gap: 4px; color: var(--text-faint); font-size: 8px; }
.composer-targets select, .composer-targets input { width: 100%; height: 31px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 0 7px; font-size: 8px; }
.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.composer-actions > span { margin-right: auto; color: var(--text-faint); font-size: 7px; }
.product-brain { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow-y: auto; display: grid; gap: 9px; }
.brain-profile, .brain-insights, .publication-summary { padding: 11px; }
.brain-profile > header, .brain-insights > header, .publication-summary > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.brain-profile > header > div, .brain-insights > header > div { display: grid; gap: 3px; }
.brain-profile header b, .brain-insights header b, .publication-summary header b { font-size: 10px; }
.brain-profile header span, .brain-insights header span { color: var(--text-faint); font-size: 7px; line-height: 1.45; }
.brain-profile dl { display: grid; gap: 7px; margin: 0; }
.brain-profile dl > div { border-top: 1px solid var(--line); padding-top: 7px; }
.brain-profile dt { color: var(--text-faint); font-size: 7px; }
.brain-profile dd { max-height: 55px; overflow-y: auto; margin: 4px 0 0; color: var(--text-soft); white-space: pre-wrap; font-size: 8px; line-height: 1.6; }
.brain-insights > div { display: grid; gap: 6px; }
.workspace-insight { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: white; }
.workspace-insight.proposed { border-style: dashed; background: #fffcf7; }
.workspace-insight.validated { border-color: #bfe3d5; background: #f7fcfa; }
.workspace-insight > header { display: flex; justify-content: space-between; gap: 8px; }
.workspace-insight > header span { color: var(--brand); font-size: 7px; font-weight: 700; }
.workspace-insight > header b { color: var(--text-faint); font-size: 7px; }
.workspace-insight > strong { display: block; margin-top: 6px; font-size: 9px; }
.workspace-insight p { max-height: 58px; overflow-y: auto; margin: 5px 0; color: var(--text-soft); font-size: 8px; line-height: 1.55; }
.workspace-insight small { color: var(--text-faint); font-size: 7px; }
.workspace-insight footer { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.publication-summary > button { width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 8px 2px; display: grid; grid-template-columns: 1fr auto; gap: 4px; text-align: left; }
.publication-summary > button:hover { background: var(--panel-muted); }
.publication-summary > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.publication-summary > button b { font-size: 8px; }
.publication-summary > button small { grid-column: 1/-1; color: var(--text-faint); font-size: 7px; }
.snapshot-timeline { display: grid; gap: 10px; }
.snapshot-timeline article { border: 1px solid var(--line); border-radius: 9px; padding: 11px; }
.snapshot-timeline header { display: flex; align-items: center; justify-content: space-between; }
.snapshot-timeline header b { color: var(--brand); font-size: 10px; }
.snapshot-timeline header time { color: var(--text-faint); font-size: 8px; }
.snapshot-timeline article > div { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; margin: 10px 0; }
.snapshot-timeline article > div span { color: var(--text-faint); font-size: 7px; }
.snapshot-timeline article > div strong { display: block; margin-top: 4px; color: var(--text); font-size: 10px; }
.snapshot-timeline p { margin: 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--text-soft); white-space: pre-wrap; font-size: 8px; line-height: 1.6; }

@media (max-width: 1300px) {
  .growth-studio { grid-template-columns: 210px minmax(480px,1fr); }
  .studio-side { grid-column: 1/-1; position: static; max-height: none; grid-template-columns: repeat(4,1fr); }
  .product-studio { grid-template-columns: 220px minmax(500px,1fr); }
  .product-brain { grid-column: 1/-1; position: static; max-height: none; grid-template-columns: repeat(3,1fr); }
  .capability-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .provider-grid { grid-template-columns: repeat(3,1fr); }
}

.toast-stack { position: fixed; right: 22px; top: 22px; z-index: 200; display: grid; gap: 8px; }
.toast { min-width: 240px; max-width: 380px; transform: translateY(-8px); opacity: 0; padding: 12px 14px; border: 1px solid #bfe3d5; border-radius: 9px; background: white; color: var(--green); box-shadow: var(--shadow); font-size: 12px; transition: opacity .2s, transform .2s; }
.toast.error { color: var(--red); border-color: #efc4c8; }
.toast.show { opacity: 1; transform: translateY(0); }

.password-dialog { width: min(460px, calc(100vw - 32px)); border: 0; border-radius: 12px; padding: 0; color: var(--text); box-shadow: 0 22px 70px rgba(20, 30, 52, .2); }
.password-dialog::backdrop { background: rgba(10, 16, 29, .46); }
.password-dialog header { height: 64px; padding: 0 18px 0 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.password-dialog header > div { display: grid; gap: 4px; }
.password-dialog header strong { font-size: 15px; }
.password-dialog header span { color: var(--text-faint); font-size: 10px; }
.password-dialog-body { padding: 20px; display: grid; gap: 14px; }
.password-dialog footer { min-height: 62px; padding: 11px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench-layout { grid-template-columns: 1fr; }
  .agent-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .memory-rail { display: none; }
  .research-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .auth-shell { padding: 20px; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-brand { min-height: 280px; padding: 30px; }
  .auth-brand-copy h1 { font-size: 28px; }
  .auth-form-panel { padding: 40px 30px 30px; }
  .portal-topbar { padding: 0 22px; }
  .portal-main { width: calc(100% - 40px); }
  .portal-intro { align-items: flex-start; flex-direction: column; }
  .app-grid { grid-template-columns: 1fr; }
  .app-card { min-height: 210px; }
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar-brand { padding: 0; justify-content: center; }
  .sidebar-brand div, .sidebar-nav-label, .nav-item span, .back-portal span { display: none; }
  .sidebar-nav { padding: 18px 10px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item .nav-badge { display: none; }
  .sidebar-footer { padding: 14px 10px; }
  .back-portal { justify-content: center; padding: 10px 0; }
  .content-grid { grid-template-columns: 1fr; }
  .agent-workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .research-guide { grid-template-columns: 1fr 1fr; gap: 10px; }
  .research-guide > i { display: none; }
  .memory-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .portal-topbar .user-chip > div, .portal-topbar .brand-lockup div { display: none; }
  .portal-main { padding-top: 36px; }
  .portal-summary { width: 100%; justify-content: space-around; }
  .section-heading { align-items: flex-start; gap: 10px; flex-direction: column; }
  .app-content { padding: 18px 14px 40px; }
  .app-topbar { padding: 0 14px; }
  .page-title-small span, .points-chip { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .search-box { min-width: 100%; }
  .workbench-form, .form-grid { grid-template-columns: 1fr; }
  .field.full, .form-grid .span-2 { grid-column: 1; }
  .shot-row { grid-template-columns: 52px 1fr; }
  .shot-row span:last-child { grid-column: 2; }
  .user-chip > div { display: none; }
  .agent-workspace { display: block; }
  .agent-rail { min-height: 0; margin-bottom: 10px; }
  .agent-rail-section { grid-template-columns: 1fr 1fr; }
  .agent-rail-section .rail-label { grid-column: 1 / -1; }
  .conversation-list { max-height: 180px; }
  .chat-panel { min-height: 620px; }
  .chat-header-actions { display: none; }
  .welcome-guide, .research-grid, .memory-grid, .analysis-columns { grid-template-columns: 1fr; }
  .research-guide, .analysis-metric-grid, .planting-path { grid-template-columns: 1fr 1fr; }
  .brain-strip { align-items: flex-start; flex-direction: column; gap: 5px; }
  .brain-strip i { display: none; }
  .growth-studio { display: block; }
  .product-studio { display: block; }
  .workspace-rail, .product-brain { position: static; max-height: none; margin-bottom: 10px; }
  .workspace-list, .workspace-work-list { max-height: 220px; }
  .product-chat { min-height: 720px; margin-bottom: 10px; }
  .product-chat-header, .current-work-card > header, .composer-actions { align-items: flex-start; flex-wrap: wrap; }
  .product-timeline { max-height: 480px; }
  .composer-targets { grid-template-columns: 1fr; }
  .composer-actions > span { width: 100%; }
  .product-brain { display: grid; grid-template-columns: 1fr; }
  .snapshot-timeline article > div { grid-template-columns: 1fr 1fr; }
  .task-rail, .studio-side { position: static; max-height: none; margin-bottom: 10px; }
  .task-rail > div { max-height: 210px; }
  .studio-main { min-height: 720px; }
  .studio-header, .studio-composer > div { align-items: flex-start; flex-wrap: wrap; }
  .studio-composer > div > span { width: 100%; order: 2; }
  .studio-side { display: grid; grid-template-columns: 1fr; }
  .research-principles, .capability-grid, .brain-grid { grid-template-columns: 1fr; }
  .cap-type-tabs { grid-template-columns: 1fr 1fr; }
  .experience-table > article { grid-template-columns: 1fr; }
  .experience-method { border-left: 0; border-top: 1px solid var(--line); padding: 10px 0 0; }
  .provider-grid { grid-template-columns: 1fr; }
  .run-table, .quota-table { overflow-x: auto; }
  .run-table > div { min-width: 720px; }
  .quota-table > div { min-width: 820px; }
  .task-facts, .diff-timeline article > div { grid-template-columns: 1fr; }
  .diff-timeline section + section { border-left: 0; border-top: 1px solid var(--line); }
}
