:root {
  --ink: #132238;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --nav: #0f172a;
  --nav-muted: #94a3b8;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --danger: #b91c1c;
  --shadow: 0 12px 30px rgba(15, 23, 42, .06);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); color: var(--ink); font: 14px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* Login */
.login-view { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #e2e8f0, #f8fafc); z-index: 50; }
.login-card { width: min(100%, 390px); display: grid; gap: 16px; padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 24px 70px rgba(15,23,42,.12); }
.login-brand, .sidebar-head, .panel-head, .topbar, .review-toolbar, .rag-toolbar, .composer-actions, .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.login-brand { justify-content: flex-start; margin-bottom: 10px; }
.login-brand h1, .login-brand p { margin: 0; }
.login-brand p, .page-heading p, .section-title p, .feature-intro p, .index-card p { color: var(--muted); }
.login-mark, .brand-mark { display: grid; place-items: center; flex: 0 0 auto; background: var(--nav); color: white; font-weight: 900; }
.login-mark { width: 52px; height: 52px; border-radius: 15px; font-size: 20px; }
.login-card label, .form-grid label, .import-card > label, .select-label { display: grid; gap: 6px; color: #475569; font-weight: 700; }

/* Shell */
.app-view { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 18px auto 18px 18px; width: 252px; display: flex; flex-direction: column; gap: 22px; padding: 20px; border-radius: 18px; background: var(--nav); color: white; box-shadow: 0 20px 55px rgba(15,23,42,.16); transition: width .22s ease, padding .22s ease; }
.sidebar-head { justify-content: flex-start; }
.sidebar-head > div:nth-child(2) { display: grid; min-width: 0; }
.sidebar-head strong { font-size: 17px; letter-spacing: -.02em; }
.sidebar-head span, .sidebar-model small { color: var(--nav-muted); font-size: 12px; }
.sidebar-toggle { display: grid; flex: 0 0 auto; margin-left: auto; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.08); color: #cbd5e1; font-size: 22px; }
.sidebar-toggle:hover { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.16); color: white; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: white; color: var(--nav); }
.sidebar-close { display: none; margin-left: auto; }
.nav-menu { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid transparent; border-radius: 12px; color: #cbd5e1; transition: .18s ease; }
.nav-item:hover { background: #1e293b; color: white; }
.nav-item.active { background: white; color: var(--nav); box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.nav-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.1); font-size: 16px; }
.nav-item.active .nav-icon { background: var(--accent-soft); color: var(--accent); }
.nav-item span:last-child { display: grid; min-width: 0; }
.nav-item b { font-size: 14px; line-height: 1.3; }
.nav-item small { color: var(--nav-muted); font-size: 11px; }
.nav-item.active small { color: #64748b; }
.sidebar-model { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; }
.sidebar-model div { display: grid; min-width: 0; }
.sidebar-model b { overflow: hidden; color: #e2e8f0; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.model-dot, .service-status span { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #14b8a6; box-shadow: 0 0 0 4px rgba(20,184,166,.13); }
.logout { width: 100%; }
.sidebar-backdrop { display: none; }
.content { width: min(1440px, 100%); min-height: 100vh; margin: 0 auto; padding: 30px 32px 56px 300px; transition: padding-left .22s ease; }
.app-view.sidebar-collapsed .sidebar { width: 84px; padding: 16px 10px; }
.app-view.sidebar-collapsed .sidebar-head { justify-content: center; gap: 4px; }
.app-view.sidebar-collapsed .sidebar-head > div:nth-child(2), .app-view.sidebar-collapsed .nav-item > span:last-child, .app-view.sidebar-collapsed .sidebar-model > div, .app-view.sidebar-collapsed .logout { display: none; }
.app-view.sidebar-collapsed .brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 14px; }
.app-view.sidebar-collapsed .sidebar-toggle { width: 28px; min-height: 28px; padding: 0; margin-left: 0; font-size: 20px; }
.app-view.sidebar-collapsed .nav-item { justify-content: center; padding: 10px 0; }
.app-view.sidebar-collapsed .nav-icon { width: 32px; height: 32px; }
.app-view.sidebar-collapsed .sidebar-model { justify-content: center; padding: 10px 0; }
.app-view.sidebar-collapsed .content { padding-left: 132px; }
.topbar { align-items: flex-start; margin-bottom: 26px; }
.page-heading h1, .page-heading p { margin: 0; }
.page-heading h1 { font-size: 28px; letter-spacing: -.04em; line-height: 1.2; }
.page-heading p { margin-top: 7px; }
.service-status { display: inline-flex; align-items: center; gap: 9px; padding: 7px 11px; border: 1px solid #bbf7d0; border-radius: 999px; background: #f0fdf4; color: #15803d; font-size: 12px; }
.mobile-menu { display: none; }

/* Shared UI */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-head { align-items: flex-start; }
.panel-head h2, .section-title h2, .feature-intro h2, .review-toolbar h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.025em; }
.eyebrow { display: block; color: var(--subtle); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.section-title { margin-bottom: 24px; }
.section-title h2 { margin-top: 5px; }
.section-title p { margin: 7px 0 0; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #f8fafc; color: var(--ink); padding: 10px 12px; transition: border .16s, box-shadow .16s, background .16s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #0f766e; background: white; box-shadow: 0 0 0 3px rgba(20,184,166,.13); }
button { min-height: 40px; padding: 9px 15px; border-radius: 10px; background: var(--nav); color: white; font-weight: 800; transition: .16s ease; }
button:hover { background: #1e293b; transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: .68; transform: none !important; }
.button-spinner { display: inline-block; width: 13px; height: 13px; margin-right: 7px; vertical-align: -2px; border: 2px solid rgba(255,255,255,.42); border-top-color: currentColor; border-radius: 50%; animation: button-spin .7s linear infinite; }
button.ghost .button-spinner { border-color: rgba(71,85,105,.25); border-top-color: currentColor; }
@keyframes button-spin { to { transform: rotate(360deg); } }
button.ghost, .ghost { border: 1px solid var(--line); background: white; color: #475569; }
button.danger, .danger { border: 1px solid #fecaca; background: #fff1f2; color: var(--danger); }
.icon-button { display: grid; place-items: center; width: 34px; min-height: 34px; padding: 0; border: 1px solid var(--line); background: white; color: #475569; font-size: 20px; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.empty { display: grid; place-items: center; min-height: 130px; padding: 24px; color: var(--muted); text-align: center; }
.welcome-state { max-width: 560px; margin: auto; text-align: center; }
.welcome-state > span { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 13px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.welcome-state h2 { margin: 0; font-size: 18px; }
.welcome-state p { margin: 6px 0 0; color: var(--muted); }
.model-chip { display: inline-flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.model-chip span:last-child { display: grid; }
.model-chip b { font-size: 12px; }
.model-chip small { color: var(--muted); font-size: 11px; }

/* RAG workbench */
.rag-workspace { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .8fr); gap: 18px; align-items: stretch; }
.rag-main, .evidence-panel { min-height: 660px; padding: 22px; }
.rag-main { display: flex; flex-direction: column; }
.rag-toolbar { align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.select-label { max-width: 300px; margin-top: 5px; }
.retrieval-flow { display: flex; align-items: center; gap: 8px; margin: 17px 0; color: var(--subtle); font-size: 11px; }
.retrieval-flow i { color: #cbd5e1; font-style: normal; }
.flow-step.active { color: var(--accent); font-weight: 800; }
.rag-main > .output { flex: 1; min-height: 290px; overflow: auto; }
.ask-composer { margin-top: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.ask-composer textarea { min-height: 92px; border: 0; background: transparent; box-shadow: none; padding: 4px; }
.composer-actions { margin-top: 9px; color: var(--subtle); font-size: 11px; }
.composer-actions button { min-height: 36px; padding: 7px 12px; }
.answer-card { max-width: 780px; margin: 0 auto; }
.answer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.answer-top h3 { margin: 0; font-size: 18px; }
.answer-top > span { color: var(--accent); font-size: 12px; font-weight: 800; }
.qa-block { margin-top: 16px; }
.qa-block-title { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.qa-block-body { color: #334155; line-height: 1.85; }
.markdown pre { overflow: auto; padding: 12px; border-radius: 9px; background: #0f172a; color: #e2e8f0; }
.markdown code { padding: 2px 5px; border-radius: 5px; background: #f1f5f9; color: #0f766e; }
.summary-box { margin-top: 16px; padding: 12px 14px; border-left: 3px solid #14b8a6; background: #f0fdfa; }
.summary-box strong { color: #0f766e; font-size: 12px; }
.evidence-panel { display: flex; flex-direction: column; }
.source-count { padding: 4px 7px; border-radius: 6px; background: #f1f5f9; color: var(--muted); font-size: 10px; font-weight: 900; }
.source-list { display: grid; align-content: start; gap: 10px; margin-top: 18px; }
.source-list.empty { flex: 1; }
.source-card { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.source-card summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.source-card summary::-webkit-details-marker { display: none; }
.source-card h3 { margin: 0; font-size: 13px; line-height: 1.5; }
.source-score { flex: 0 0 auto; color: var(--accent); font-size: 11px; font-weight: 900; }
.source-meta { margin-top: 6px; color: var(--subtle); font-size: 11px; }
.source-preview { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.65; }
.advanced-search { margin-top: 18px; padding: 0; }
.advanced-search summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; cursor: pointer; list-style: none; }
.advanced-search summary::-webkit-details-marker { display: none; }
.advanced-search summary span { display: grid; }
.advanced-search summary small { margin-top: 3px; color: var(--muted); }
.advanced-search summary i { color: var(--muted); font-size: 20px; font-style: normal; }
.advanced-search[open] summary i { transform: rotate(45deg); }
.advanced-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.control-grid { display: grid; grid-template-columns: minmax(220px, 1.5fr) 160px repeat(3, 110px) auto; gap: 10px; align-items: end; padding-top: 16px; }
.control-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.compare-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.compare-col { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.compare-col h3 { margin: 0 0 10px; font-size: 13px; }
.result-grid { display: grid; gap: 10px; }
.mini-result { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.mini-head { display: flex; justify-content: space-between; gap: 10px; color: var(--accent); font-size: 11px; }
.mini-result .qa-block { margin-top: 10px; }

/* Feature pages */
.feature-shell { padding: 26px; }
.feature-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.feature-intro h2 { font-size: 24px; }
.feature-intro p { max-width: 680px; margin: 8px 0 0; }
.feature-controls { display: flex; gap: 9px; min-width: 280px; }
.feature-controls select { min-width: 160px; }
.interview-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.mode-card { display: grid; grid-template-columns: 34px 1fr; gap: 2px 11px; min-height: 78px; padding: 14px; border: 1px solid var(--line); background: #f8fafc; color: var(--ink); text-align: left; }
.mode-card:hover { border-color: #94a3b8; background: white; }
.mode-card.active { border-color: var(--accent); background: #f0fdfa; box-shadow: 0 0 0 2px rgba(15,118,110,.08); }
.mode-card > span { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e2e8f0; color: var(--muted); font-size: 11px; }
.mode-card.active > span { background: var(--accent); color: white; }
.mode-card strong { font-size: 15px; }
.mode-card small { color: var(--muted); font-weight: 500; }
.interview-config { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr); gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.project-config { display: grid; gap: 13px; }
.project-config > label, .interview-start-card > label { display: grid; gap: 6px; color: #475569; font-size: 12px; font-weight: 800; }
.project-upload { padding: 13px; border: 1px dashed #94a3b8; border-radius: 10px; background: white; cursor: pointer; }
.project-upload input { display: none; }
.project-upload span { color: var(--accent); font-weight: 900; }
.project-upload small { color: var(--muted); font-weight: 500; }
.general-config { display: grid; min-height: 260px; border-radius: 10px; background: white; }
.welcome-state.compact { align-self: center; padding: 28px; }
.interview-start-card { align-self: stretch; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.interview-start-card > label { margin-top: 15px; }
.interview-start-card ul { min-height: 102px; margin: 16px 0; padding-left: 19px; color: var(--muted); font-size: 12px; }
.interview-start-card button { width: 100%; }
.interview-board { min-height: 480px; padding-top: 22px; }
.interview-question { max-width: 840px; margin: 0 auto; }
.progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--accent); font-size: 12px; font-weight: 900; }
.progress span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress b { flex: 0 0 auto; }
.interview-note { padding: 11px 13px; border-left: 3px solid #f59e0b; background: #fffbeb; color: #92400e; }
.interview-question textarea { min-height: 190px; background: white; }
.feedback-card { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.result-grid .pill { padding: 8px 10px; border-radius: 8px; font-size: 12px; }
.pill.good { background: #dcfce7; color: #166534; }
.pill.warn { background: #fef3c7; color: #92400e; }
.follow-up { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.dimension-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin: 16px 0; }
.dimension-grid > div { display: grid; grid-template-columns: 1fr auto; gap: 5px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.dimension-grid span { color: var(--muted); font-size: 11px; }
.dimension-grid strong { color: var(--accent); }
.dimension-grid i { grid-column: span 2; height: 4px; overflow: hidden; border-radius: 99px; background: #e2e8f0; }
.dimension-grid i b { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.interview-report { max-width: 900px; margin: 0 auto; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.report-score { display: grid; place-items: center; padding: 20px; border-radius: 12px; background: var(--nav); color: white; }
.report-score span, .report-score small { color: #cbd5e1; }
.report-score strong { font-size: 48px; line-height: 1.15; }
.report-columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.report-columns article { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.report-columns h3 { margin: 0 0 8px; font-size: 14px; }
.report-columns ul { margin: 0; padding-left: 19px; color: var(--muted); }
.review-toolbar { align-items: flex-end; margin-bottom: 18px; }
.review-toolbar h2 { font-size: 24px; }
.review-toolbar p { margin: 5px 0 0; color: var(--muted); }
.segmented { display: flex; gap: 7px; }
.review-list { display: grid; gap: 13px; }
.review-card, .question-row, .bank-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.review-head { display: flex; align-items: center; gap: 10px; }
.review-head strong { font-size: 15px; }
.review-card > p { color: var(--muted); font-size: 12px; }
.rating-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Knowledge */
.knowledge-tabs { display: flex; gap: 5px; margin-bottom: 18px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.knowledge-tab { padding: 10px 13px; color: var(--muted); font-weight: 800; white-space: nowrap; }
.knowledge-tab.active { border-bottom: 2px solid var(--nav); color: var(--nav); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 18px; }
.stats article { padding: 17px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.stats span, .index-card > span { color: var(--muted); font-size: 12px; }
.stats strong { display: block; margin-top: 4px; font-size: 25px; letter-spacing: -.04em; }
.manage-panel, .form-panel, .import-card, .import-guide { padding: 22px; }
.toolbar, .bank-form { display: flex; gap: 9px; align-items: center; }
.toolbar input { flex: 1; }
.question-list { display: grid; gap: 10px; margin-top: 16px; }
.question-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 14px 16px; }
.qa-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.question-main .qa-block { margin-top: 0; }
.compact-question .qa-block-body { display: -webkit-box; overflow: hidden; max-height: 4.8em; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.question-answer { margin-top: 9px; border-top: 1px solid var(--line); }
.question-answer summary { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }
.question-answer summary::-webkit-details-marker { display: none; }
.question-answer summary span { font-size: 16px; line-height: 1; transition: transform .16s; }
.question-answer[open] summary span { transform: rotate(180deg); }
.question-answer-body { max-height: 260px; overflow: auto; margin-top: 7px; padding: 10px 12px; border-radius: 8px; background: #f8fafc; color: var(--muted); font-size: 12px; }
.meta-line { margin-top: 10px; color: var(--muted); font-size: 11px; }
.tag { display: inline-block; margin: 7px 5px 0 0; padding: 3px 7px; border-radius: 5px; background: #f1f5f9; color: #475569; font-size: 11px; }
.row-actions, .bank-actions { display: flex; flex-direction: column; gap: 7px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid label { font-size: 12px; }
.form-grid textarea { min-height: 110px; }
.import-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 18px; }
.upload { display: grid; place-items: center; gap: 9px; min-height: 210px; margin-top: 18px; padding: 20px; border: 2px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; text-align: center; cursor: pointer; }
.upload input { display: none; }
.upload > span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--nav); color: white; font-size: 22px; }
.upload em { color: var(--muted); font-size: 12px; font-style: normal; }
.upload-progress { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.upload-progress i { height: 8px; flex: 1; overflow: hidden; border-radius: 99px; background: #e2e8f0; }
.upload-progress b { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s; }
.upload-progress span { min-width: 100px; color: var(--muted); font-size: 11px; text-align: right; }
.import-guide pre { overflow: auto; margin: 20px 0; padding: 15px; border-radius: 10px; background: var(--nav); color: #e2e8f0; font: 12px/1.8 ui-monospace, monospace; white-space: pre-wrap; }
.import-guide p { color: var(--muted); }
.bank-space-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: 16px; }
.bank-create-card, .bank-space-guide { padding: 22px; }
.bank-create-card .section-title { margin-bottom: 16px; }
.bank-create-hint { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; padding: 12px 13px; border: 1px solid #99f6e4; border-radius: 10px; background: #f0fdfa; }
.bank-create-hint > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: white; font-size: 20px; }
.bank-create-hint div { display: grid; }
.bank-create-hint strong { font-size: 12px; }
.bank-create-hint small { color: var(--muted); font-size: 11px; }
.bank-space-guide h3 { margin: 6px 0 15px; font-size: 17px; }
.bank-space-guide ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bank-space-guide li { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bank-space-guide li:last-child { padding-bottom: 0; border-bottom: 0; }
.bank-space-guide li b { color: var(--ink); font-size: 13px; }
.bank-space-guide li span { color: var(--muted); font-size: 12px; }
.bank-form { margin: 0; align-items: end; }
.bank-form label { display: grid; flex: 1; gap: 6px; color: #475569; font-size: 12px; font-weight: 800; }
.bank-form button { min-width: 110px; }
.bank-list-section { margin-top: 22px; }
.bank-list-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bank-list-head h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.025em; }
.bank-list-count { padding: 5px 9px; border-radius: 999px; background: #e2e8f0; color: var(--muted); font-size: 11px; font-weight: 800; }
.bank-form input:first-child { flex: 1; }
.bank-form input:nth-child(2) { flex: 2; }
.bank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.bank-card { display: grid; gap: 13px; padding: 17px; }
.bank-card-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.bank-index { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--nav); color: white; font-size: 11px; font-weight: 900; }
.bank-card-head > div { display: grid; min-width: 0; }
.bank-card strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.bank-card-head small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.bank-count { display: grid; justify-items: end; }
.bank-count b { font-size: 21px; line-height: 1; letter-spacing: -.04em; }
.bank-count em { color: var(--subtle); font-size: 10px; font-style: normal; }
.bank-card p { min-height: 42px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.bank-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 11px; border-top: 1px solid var(--line); }
.bank-scope { color: var(--subtle); font-size: 11px; }
.bank-scope:first-letter { color: var(--accent); }
.bank-actions { flex-direction: row; }
.bank-actions button { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.bank-empty { grid-column: 1 / -1; min-height: 180px; border: 1px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; }
.bank-empty > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.bank-empty strong { margin-top: 8px; color: var(--ink); }
.bank-empty p { margin: 3px 0 0; font-size: 12px; }
.index-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.index-card { padding: 20px; }
.index-card strong { display: block; margin-top: 7px; font-size: 20px; letter-spacing: -.03em; word-break: break-word; }
.index-card p { margin: 8px 0 0; font-size: 13px; }

/* Modals and feedback */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(15,23,42,.42); }
.modal-card { width: min(100%, 760px); padding: 20px; border-radius: 14px; background: white; box-shadow: 0 30px 90px rgba(15,23,42,.25); }
.modal-head { margin-bottom: 13px; }
.modal-head h3 { margin: 0; }
.modal textarea { min-height: 360px; }
#toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; max-width: 360px; padding: 11px 14px; border-radius: 10px; background: var(--nav); color: white; box-shadow: 0 16px 35px rgba(15,23,42,.2); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s; }
#toast.show { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .sidebar { inset: 0 auto 0 0; width: min(300px, 88vw); border-radius: 0 18px 18px 0; transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .sidebar-close, .mobile-menu { display: grid; }
  .sidebar-toggle { display: none; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(15,23,42,.35); }
  .sidebar-backdrop.open { display: block; }
  .content { padding: 18px 16px 40px; }
  .app-view.sidebar-collapsed .sidebar { width: min(300px, 88vw); padding: 20px; }
  .app-view.sidebar-collapsed .sidebar-head { justify-content: flex-start; gap: 16px; }
  .app-view.sidebar-collapsed .sidebar-head > div:nth-child(2), .app-view.sidebar-collapsed .nav-item > span:last-child, .app-view.sidebar-collapsed .sidebar-model > div, .app-view.sidebar-collapsed .logout { display: grid; }
  .app-view.sidebar-collapsed .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: inherit; }
  .app-view.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 11px 12px; }
  .app-view.sidebar-collapsed .sidebar-model { justify-content: flex-start; padding: 12px; }
  .app-view.sidebar-collapsed .content { padding-left: 16px; }
  .mobile-menu { margin-top: 1px; }
  .topbar { align-items: flex-start; }
  .rag-workspace, .import-layout { grid-template-columns: 1fr; }
  .rag-main, .evidence-panel { min-height: auto; }
  .evidence-panel { min-height: 260px; }
  .control-grid { grid-template-columns: repeat(2, 1fr); }
  .control-grid input:first-child { grid-column: span 2; }
}
@media (max-width: 760px) {
  .topbar { gap: 10px; }
  .page-heading h1 { font-size: 22px; }
  .page-heading p { display: none; }
  .service-status b { display: none; }
  .rag-toolbar, .feature-intro, .review-toolbar { display: grid; }
  .interview-mode-switch, .interview-config, .report-columns { grid-template-columns: 1fr; }
  .dimension-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interview-config { padding: 12px; }
  .model-chip, .feature-controls { width: 100%; }
  .feature-controls { min-width: 0; }
  .feature-controls select { flex: 1; }
  .qa-pair, .stats, .form-grid, .bank-grid, .index-grid, .compare-grid, .bank-space-layout { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .question-row { grid-template-columns: 1fr; gap: 11px; padding: 13px; }
  .row-actions, .bank-actions { flex-direction: row; flex-wrap: wrap; }
  .toolbar, .bank-form { align-items: stretch; flex-direction: column; }
  .toolbar > *, .bank-form > * { width: 100%; }
  .bank-list-head { align-items: flex-start; }
  .control-grid { grid-template-columns: 1fr; }
  .control-grid input:first-child { grid-column: auto; }
  .composer-actions { align-items: flex-end; }
  .composer-actions > span { max-width: 120px; line-height: 1.35; }
}

/* v3.5 sidebar polish */
.sidebar { gap: 20px; border-radius: 16px; transition: width .22s ease, padding .22s ease, transform .2s ease; }
.sidebar-head { min-height: 40px; gap: 12px; }
.sidebar-edge-toggle { position: fixed; z-index: 31; left: 258px; top: 50%; display: grid; place-items: center; width: 28px; min-height: 58px; padding: 0; border: 1px solid rgba(15,23,42,.12); border-left: 0; border-radius: 0 999px 999px 0; background: rgba(255,255,255,.94); color: #475569; box-shadow: 0 12px 28px rgba(15,23,42,.12); font-size: 20px; line-height: 1; transform: translateY(-50%); transition: left .22s ease, background .16s ease, color .16s ease, box-shadow .16s ease; }
.sidebar-edge-toggle:hover { background: var(--nav); color: white; box-shadow: 0 16px 36px rgba(15,23,42,.18); transform: translateY(-50%); }
.app-view.sidebar-collapsed .sidebar { width: 76px; padding: 16px 9px; }
.app-view.sidebar-collapsed .sidebar-head { justify-content: center; }
.app-view.sidebar-collapsed .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
.app-view.sidebar-collapsed .nav-item { border-radius: 11px; }
.app-view.sidebar-collapsed .nav-icon { width: 34px; height: 34px; }
.app-view.sidebar-collapsed .sidebar-model { padding: 10px 0; border-color: rgba(255,255,255,.08); }
.app-view.sidebar-collapsed .content { padding-left: 124px; }
.app-view.sidebar-collapsed .sidebar-edge-toggle { left: 93px; }
.site-footer, .login-icp { color: var(--subtle); font-size: 12px; text-align: center; }
.site-footer { margin-top: 34px; padding: 18px 0 0; }
.site-footer a, .login-icp a { color: inherit; }
.site-footer a:hover, .login-icp a:hover { color: var(--accent); }
.login-icp { position: fixed; left: 24px; right: 24px; bottom: 18px; z-index: 51; }

@media (max-width: 1080px) {
  .sidebar-edge-toggle { display: none; }
  .sidebar-head { padding-right: 0; }
  .app-view.sidebar-collapsed .sidebar { width: min(300px, 88vw); padding: 20px; }
  .app-view.sidebar-collapsed .content { padding-left: 16px; }
}
