:root {
  color-scheme: dark;
  --krs-bg: #130f11;
  --krs-bg-raised: #191316;
  --krs-wine-950: #1d0c12;
  --krs-wine-900: #2b101a;
  --krs-wine-800: #421724;
  --krs-wine-700: #5e2033;
  --krs-wine-600: #7a3346;
  --krs-gold-700: #a18451;
  --krs-gold-600: #b39862;
  --krs-gold-500: #c3a875;
  --krs-gold-300: #dfcca2;
  --krs-paper: #eee5d5;
  --krs-paper-soft: #f6f0e4;
  --krs-ink: #282125;
  --krs-text: #e9e0d4;
  --krs-text-soft: #c3b8ac;
  --krs-muted: #a2968b;
  --krs-muted-dark: #81756d;
  --krs-line: #413538;
  --krs-line-strong: #59484b;
  --krs-border: var(--krs-line);
  --krs-border-strong: var(--krs-line-strong);
  --krs-panel: #1e181b;
  --krs-panel-raised: #251e21;
  --krs-panel-warm: #2b2224;
  --green: #7ca08a;
  --green-soft: #203129;
  --blue: #91a8b5;
  --blue-soft: #222c31;
  --amber: var(--krs-gold-500);
  --amber-soft: #352c20;
  --red: #d08b86;
  --red-soft: #382124;
  --shadow: 0 22px 70px rgba(0, 0, 0, .34);
  --shadow-soft: 0 9px 26px rgba(0, 0, 0, .18);
  --sans: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --radius-lg: 16px;
  --radius-md: 11px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 82% 0%, rgba(94, 32, 51, .16), transparent 32rem),
    var(--krs-bg);
  color: var(--krs-text);
  font: 16px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: var(--krs-gold-300); text-decoration-color: rgba(195, 168, 117, .4); text-underline-offset: 3px; }
a:hover { color: #f2dfb6; }
::selection { color: var(--krs-wine-950); background: var(--krs-gold-300); }
:focus-visible { outline: 2px solid var(--krs-gold-500); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 20; top: 10px; left: 10px; transform: translateY(-150%); padding: 10px 14px; border-radius: 8px; background: var(--krs-paper); color: var(--krs-ink); }
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 288px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; min-height: 690px;
  display: flex; flex-direction: column; z-index: 5;
  padding: 27px 18px 22px;
  border-right: 1px solid rgba(223, 204, 162, .12);
  background:
    radial-gradient(circle at 20% 8%, rgba(122, 51, 70, .22), transparent 18rem),
    linear-gradient(165deg, #211016 0%, #1b1014 52%, #160f12 100%);
  color: var(--krs-text);
}
.brand { display: flex; align-items: center; gap: 13px; padding: 0 9px 24px; color: inherit; text-decoration: none; }
.brand-mark { width: 45px; height: 45px; flex: 0 0 45px; display: grid; place-items: center; border: 1px solid rgba(195, 168, 117, .68); border-radius: 50%; color: var(--krs-gold-300); box-shadow: inset 0 0 0 4px rgba(195, 168, 117, .07); }
.brand-mark span { font: 500 27px/.9 var(--serif); transform: translateY(-1px); }
.brand-copy strong { display: block; color: #f4ead9; font-size: 18px; line-height: 1.1; letter-spacing: .2em; }
.brand-copy small { display: block; margin-top: 6px; color: var(--krs-gold-500); font-size: 7px; font-weight: 700; letter-spacing: .14em; white-space: nowrap; }
.sidebar-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 11px 21px; border-top: 1px solid rgba(223, 204, 162, .14); }
.sidebar-intro-copy { min-width: 0; flex: 1; }
.sidebar-portrait { position: relative; flex: 0 0 54px; width: 54px; height: 74px; margin: 0; overflow: hidden; border: 1px solid rgba(195, 168, 117, .42); border-radius: 7px; background: radial-gradient(circle at 50% 35%, #d6c5a6 0%, #b8a382 100%); box-shadow: inset 0 0 12px rgba(34, 14, 21, .34), 0 6px 14px rgba(0, 0, 0, .28); }
.sidebar-portrait::after { content: ""; position: absolute; inset: 2px; border: 1px solid rgba(246, 232, 202, .22); border-radius: 5px; pointer-events: none; }
.sidebar-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 14%; mix-blend-mode: multiply; filter: sepia(.24) contrast(1.06) brightness(.97); }
.eyebrow, .nav-group-label { color: var(--krs-gold-600); font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-intro p { margin: 8px 0 0; color: #f0e7da; font: 500 17px/1.35 var(--serif); }
.main-nav { display: grid; gap: 17px; }
.nav-group { display: grid; gap: 4px; }
.nav-group-label { padding: 0 12px 5px; color: var(--krs-muted-dark); font-size: 8px; letter-spacing: .18em; }
.nav-item { min-width: 0; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 9px; padding: 10px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--krs-text-soft); text-align: left; font: 500 11px/1.3 var(--sans); cursor: pointer; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.nav-icon { display: grid; place-items: center; width: 22px; color: var(--krs-gold-700); font: 17px/1 var(--serif); }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { border-color: rgba(223, 204, 162, .12); background: rgba(255, 255, 255, .035); color: var(--krs-paper-soft); }
.nav-item.active { border-color: rgba(195, 168, 117, .18); background: linear-gradient(90deg, rgba(94, 32, 51, .6), rgba(94, 32, 51, .14)); color: #fff5e6; box-shadow: inset 2px 0 var(--krs-gold-500); }
.nav-item.active .nav-icon { color: var(--krs-gold-300); }
.sidebar-spacer { flex: 1; min-height: 26px; }
.research-principle { display: flex; align-items: flex-start; gap: 10px; margin: 0 1px 20px; padding: 13px 12px; border: 1px solid rgba(223, 204, 162, .17); border-radius: 9px; background: rgba(255, 255, 255, .025); }
.principle-mark { color: var(--krs-gold-500); font-size: 16px; }
.research-principle .eyebrow { color: var(--krs-muted); font-size: 7px; }
.research-principle p { margin: 5px 0 0; color: #e4d9ca; font: 12px/1.45 var(--serif); }
.research-principle i { color: var(--krs-gold-500); font-style: normal; }
.sidebar-foot { display: grid; gap: 4px; padding: 0 10px; color: var(--krs-muted-dark); font-size: 8px; letter-spacing: .1em; }
.sidebar-foot-title { color: var(--krs-gold-300); font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.sidebar-version { margin-top: 5px; padding-top: 8px; border-top: 1px solid rgba(223, 204, 162, .12); color: var(--krs-muted); letter-spacing: .1em; }

.main-area { width: 100%; max-width: 1760px; min-width: 0; margin: 0 auto; padding: 0 48px 28px; }
.topbar { height: 68px; margin: 0 -48px; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid rgba(223, 204, 162, .1); background: rgba(19, 15, 17, .82); backdrop-filter: blur(16px); }
.breadcrumb { min-width: 0; color: var(--krs-muted); font-size: 10px; }
.breadcrumb-root { color: var(--krs-gold-500); font-weight: 700; letter-spacing: .12em; }
.breadcrumb-divider { margin: 0 11px; color: #5d4e51; }
.breadcrumb strong { overflow: hidden; color: var(--krs-text-soft); font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.demo-badge, .model-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(124, 160, 138, .25); border-radius: 30px; background: rgba(32, 49, 41, .45); color: #c5d7cb; font-size: 8px; font-weight: 650; white-space: nowrap; }
.status-dot { display: inline-block; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(124, 160, 138, .12); }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--krs-line); border-radius: 8px; background: var(--krs-panel); color: var(--krs-gold-300); cursor: pointer; transition: border-color .18s, background .18s; }
.icon-button:hover { border-color: var(--krs-gold-700); background: var(--krs-panel-raised); }
.avatar { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid rgba(195, 168, 117, .42); border-radius: 50%; background: var(--krs-wine-800); color: var(--krs-gold-300); font: 600 11px var(--sans); }

.view { display: none; padding-top: 33px; animation: appear .24s ease both; }
.view.active-view { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.dashboard-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 245px; align-items: end; gap: 30px; overflow: hidden; margin: 2px 0 22px; padding: 36px 38px 32px; border: 1px solid rgba(195, 168, 117, .18); border-radius: var(--radius-lg); background: radial-gradient(ellipse at 83% 16%, rgba(122, 51, 70, .26), transparent 24rem), linear-gradient(118deg, #24151a 0%, #211619 52%, #1a1416 100%); box-shadow: var(--shadow-soft); }
.dashboard-hero::after { content: ""; position: absolute; top: -104px; right: 154px; width: 285px; height: 285px; border: 1px solid rgba(195, 168, 117, .11); border-radius: 50%; box-shadow: 0 0 0 24px rgba(195, 168, 117, .025), 0 0 0 48px rgba(195, 168, 117, .018); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; max-width: 790px; }
.hero-copy .eyebrow { display: flex; align-items: center; gap: 9px; color: var(--krs-gold-300); font-size: 8px; }
.eyebrow-rule { width: 19px; height: 1px; background: var(--krs-gold-500); }
.hero-version { margin-left: 3px; color: #9b8e84; font-size: 8px; }
.hero-copy h1, .page-heading h1 { margin: 15px 0 13px; color: #f1e7d8; font: 500 clamp(38px, 4.2vw, 58px)/1.02 var(--serif); letter-spacing: -.047em; }
.hero-copy h1 em, .page-heading h1 em { color: var(--krs-gold-300); font-weight: 500; }
.hero-copy p { max-width: 640px; margin: 0; color: var(--krs-text-soft); font: 14px/1.75 var(--serif); }
.hero-disciplines { display: flex; gap: 8px 17px; flex-wrap: wrap; margin-top: 23px; }
.hero-disciplines span { color: #a89b8d; font-size: 7px; font-weight: 700; letter-spacing: .13em; }
.hero-disciplines span + span::before { content: "·"; margin-right: 17px; color: var(--krs-gold-700); }
.hero-aside { position: relative; z-index: 1; padding: 4px 0 3px 22px; border-left: 1px solid rgba(223, 204, 162, .2); }
.hero-rule { display: block; width: 27px; height: 2px; margin-bottom: 17px; background: var(--krs-gold-600); }
.hero-aside .eyebrow { color: #c8b99e; font-size: 7px; }
.hero-aside p { margin: 9px 0 14px; color: var(--krs-text-soft); font: italic 13px/1.65 var(--serif); }
.text-button { display: inline-flex; align-items: center; gap: 7px; padding: 4px 0; border: 0; background: none; color: var(--krs-gold-300); font: 650 9px/1.4 var(--sans); cursor: pointer; text-align: left; }
.text-button:hover { color: #f1dfb6; }
.text-button span { font-size: 14px; }

.panel { min-width: 0; margin-bottom: 14px; padding: 21px 22px; border: 1px solid var(--krs-line); border-radius: var(--radius-md); background: linear-gradient(145deg, rgba(39, 31, 34, .96), rgba(29, 23, 26, .97)); box-shadow: 0 5px 17px rgba(0, 0, 0, .1); }
.research-launch { position: relative; overflow: hidden; margin-bottom: 32px; padding: 21px 24px 19px; border-color: rgba(195, 168, 117, .27); background: linear-gradient(120deg, #282023 0%, #211a1d 62%, #2a2021 100%); }
.research-launch::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: linear-gradient(180deg, var(--krs-gold-300), var(--krs-wine-600)); }
.launch-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.launch-heading h2, .section-heading h2 { margin: 5px 0 0; color: var(--krs-text); font: 500 24px/1.2 var(--serif); letter-spacing: -.025em; }
.model-chip { border-color: rgba(223, 204, 162, .2); background: rgba(19, 15, 17, .45); color: var(--krs-text-soft); font-size: 8px; }
.research-launch textarea, .question-panel textarea { display: block; width: 100%; min-height: 94px; resize: vertical; padding: 14px 16px; border: 1px solid #cfc2aa; border-radius: 8px; outline: none; background: var(--krs-paper-soft); color: var(--krs-ink); font: 14px/1.65 var(--serif); transition: border-color .18s ease, box-shadow .18s ease; }
.research-launch textarea::placeholder, .question-panel textarea::placeholder { color: #80746a; }
.research-launch textarea:focus, .question-panel textarea:focus { border-color: var(--krs-gold-600); box-shadow: 0 0 0 3px rgba(195, 168, 117, .19); }
.launch-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; }
.selection-summary { display: flex; align-items: center; gap: 10px; min-width: 0; }
.selection-glyph { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border: 1px solid rgba(195, 168, 117, .26); border-radius: 50%; color: var(--krs-gold-300); font-size: 13px; }
.selection-summary strong, .selection-summary small { display: block; }
.selection-summary strong { color: var(--krs-text); font-size: 9px; font-weight: 650; }
.selection-summary small { margin-top: 3px; color: var(--krs-muted); font-size: 8px; }
.launch-actions, .page-heading-actions, .toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; border: 1px solid transparent; border-radius: 7px; font: 650 9px/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(0, 0, 0, .22); }
.button:disabled { opacity: .58; cursor: wait; transform: none; box-shadow: none; }
.button-accent { border-color: #c6a76d; background: linear-gradient(180deg, #d0b780, #b5975f); color: #261a19; box-shadow: inset 0 1px rgba(255, 255, 255, .28), 0 3px 10px rgba(0, 0, 0, .12); }
.button-accent:hover { border-color: #e3ce9f; background: #d8c394; color: #201517; }
.button-dark { border-color: #754155; background: var(--krs-wine-800); color: #f7eee3; }
.button-dark:hover { border-color: var(--krs-gold-700); background: var(--krs-wine-700); color: #fff5e6; }
.button-outline { border-color: var(--krs-line-strong); background: rgba(255, 255, 255, .02); color: var(--krs-text-soft); }
.button-outline:hover { border-color: var(--krs-gold-700); background: rgba(195, 168, 117, .07); color: var(--krs-paper-soft); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 13px; }
.section-heading h2 { font-size: 22px; }
.section-heading-spaced { margin-top: 28px; }
.section-note, .live-note { color: var(--krs-muted); font-size: 8px; }
.live-note { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat-grid-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat-card { position: relative; min-width: 0; min-height: 116px; padding: 16px 16px 13px; border: 1px solid var(--krs-line); border-radius: 9px; background: linear-gradient(150deg, #241d20, #1c1719); box-shadow: inset 0 1px rgba(255, 255, 255, .018); transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: rgba(195, 168, 117, .34); background: linear-gradient(150deg, #2a2224, #211a1d); }
.stat-label { display: block; max-width: calc(100% - 34px); margin: 2px 0 13px; color: var(--krs-text-soft); font-size: 8px; font-weight: 600; letter-spacing: .015em; }
.stat-card strong { display: block; max-width: 100%; overflow-wrap: anywhere; color: var(--krs-paper-soft); font: 500 27px/1.05 var(--serif); letter-spacing: -.035em; }
.stat-card small { display: block; margin-top: 7px; color: var(--krs-muted); font-size: 8px; line-height: 1.4; }
.stat-icon { position: absolute; top: 13px; right: 14px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font: 12px var(--serif); }
.violet { background: rgba(94, 32, 51, .42); color: #d2a9ad; }
.blue { background: var(--blue-soft); color: var(--blue); }
.green { background: var(--green-soft); color: #a6c1ae; }
.amber { background: var(--amber-soft); color: var(--krs-gold-300); }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dashboard-grid-top { margin-bottom: 0; }
.dashboard-grid-bottom { align-items: stretch; }
.dashboard-grid-quality { margin-top: 3px; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.panel-title h2, .settings-head h2 { margin: 5px 0 0; color: var(--krs-text); font: 500 19px/1.25 var(--serif); letter-spacing: -.02em; }
.panel-mark { color: var(--krs-gold-700); font: 8px var(--sans); letter-spacing: .16em; }
.distribution-list { display: grid; gap: 4px; margin-top: 9px; }
.distribution-row { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(45px, 1.5fr) 36px; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(223, 204, 162, .08); font-size: 9px; }
.distribution-label { overflow: hidden; color: var(--krs-text-soft); text-overflow: ellipsis; white-space: nowrap; }
.distribution-meter { height: 3px; overflow: hidden; border-radius: 5px; background: #413639; }
.distribution-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--krs-wine-600), var(--krs-gold-500)); }
.distribution-count { color: var(--krs-gold-300); font-size: 8px; text-align: right; }
.empty-state { padding: 11px 0; color: var(--krs-muted); font-size: 9px; line-height: 1.65; }
.state-message { padding: 11px 0; color: var(--krs-muted); font-size: 9px; line-height: 1.65; }
.state-message.is-loading { color: var(--krs-gold-300); }
.state-message.is-error { color: #e6aaa4; }
.has-error { border-color: rgba(208, 139, 134, .25); }
.retry-button { display: inline-flex; margin: 7px 0 0; padding: 5px 8px; border: 1px solid var(--krs-line-strong); border-radius: 5px; background: transparent; color: var(--krs-gold-300); font-size: 8px; cursor: pointer; }
.retry-button:hover { border-color: var(--krs-gold-700); background: rgba(195, 168, 117, .08); }
.metric-empty { color: var(--krs-muted) !important; font-size: 18px !important; letter-spacing: 0 !important; }
.metric-error { color: #e6aaa4 !important; font: 650 9px/1.45 var(--sans) !important; letter-spacing: 0 !important; }
.recent-panel { min-width: 0; }
.recent-panel .panel-title { margin-bottom: 8px; }
.recent-documents { display: grid; }
.recent-document { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(223, 204, 162, .09); cursor: pointer; transition: background .16s ease; }
.recent-document:hover { background: rgba(255, 255, 255, .025); }
.document-glyph { width: 30px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(195, 168, 117, .24); border-radius: 6px; background: #291f22; color: var(--krs-gold-300); font: 14px var(--serif); }
.recent-document-main { min-width: 0; }
.recent-document-main strong { display: block; overflow: hidden; color: var(--krs-text); font: 550 10px var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.recent-document-main small { display: block; overflow: hidden; margin-top: 4px; color: var(--krs-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.status-chip { display: inline-flex; align-items: center; justify-content: center; padding: 5px 8px; border: 1px solid rgba(124, 160, 138, .3); border-radius: 30px; background: rgba(32, 49, 41, .45); color: #c3d5ca; font-size: 8px; font-weight: 650; white-space: nowrap; }
.status-completed, .status-ready, .status-lexical_only { border-color: rgba(124, 160, 138, .32); background: var(--green-soft); color: #bad0c0; }
.status-running, .status-indexing { border-color: rgba(145, 168, 181, .27); background: var(--blue-soft); color: #c0d0d7; }
.status-queued, .status-pending { border-color: rgba(195, 168, 117, .28); background: var(--amber-soft); color: #dfc88e; }
.status-failed { border-color: rgba(208, 139, 134, .3); background: var(--red-soft); color: #e6aaa4; }
.status-unknown { border-color: var(--krs-line-strong); background: var(--krs-panel-warm); color: var(--krs-text-soft); }
.job-list { display: grid; }
.job-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(223, 204, 162, .09); }
.job-bullet { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(195, 168, 117, .22); border-radius: 50%; color: var(--krs-gold-300); font-size: 12px; }
.job-detail { min-width: 0; }
.job-detail strong { display: block; overflow: hidden; color: var(--krs-text); font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.job-detail p { margin: 4px 0 0; color: var(--krs-muted); font-size: 8px; }
.job-open-button { padding: 6px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--krs-gold-300); font-size: 8px; font-weight: 700; cursor: pointer; }
.job-open-button:hover { background: rgba(195, 168, 117, .09); }
.active-job-list { display: grid; }
.active-job-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px 0; border-top: 1px solid rgba(223, 204, 162, .09); cursor: pointer; }
.active-job-row:hover .active-job-detail strong { color: var(--krs-gold-300); }
.active-job-dot { width: 7px; height: 7px; border-radius: 50%; background: #a6c1ae; box-shadow: 0 0 10px rgba(166, 193, 174, .32); }
.active-job-dot.queued { background: var(--krs-gold-500); box-shadow: 0 0 10px rgba(195, 168, 117, .25); }
.active-job-detail { min-width: 0; }
.active-job-detail strong { display: block; overflow: hidden; color: var(--krs-text); font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.active-job-detail small { display: block; margin-top: 4px; color: var(--krs-muted); font-size: 8px; }
.ai-usage-model { color: var(--krs-gold-300); font: 550 12px/1.45 var(--serif); overflow-wrap: anywhere; }
.ai-usage-query { margin: 7px 0 0; color: var(--krs-text); font-size: 9px; line-height: 1.55; }
.ai-usage-meta, .ai-usage-note, .ai-usage-fallback { margin: 5px 0 0; color: var(--krs-muted); font-size: 8px; line-height: 1.55; }
.ai-usage-fallback { color: #e0c78e; }
.ai-usage-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 5px; }
.ai-usage-metric { min-width: 0; padding: 9px; border: 1px solid rgba(223, 204, 162, .1); border-radius: 6px; background: rgba(255, 255, 255, .018); }
.ai-usage-metric dt { color: var(--krs-muted); font-size: 7px; }
.ai-usage-metric dd { margin: 4px 0 0; color: var(--krs-paper-soft); font: 500 17px/1.1 var(--serif); overflow-wrap: anywhere; }
.ai-usage-metric small { display: block; margin-top: 4px; color: var(--krs-muted-dark); font-size: 7px; }

.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 0 0 22px; }
.page-heading h1 { margin: 9px 0 9px; font-size: clamp(35px, 3.8vw, 49px); }
.page-heading p { max-width: 680px; margin: 0; color: var(--krs-text-soft); font: 13px/1.7 var(--serif); }
.page-heading-editorial { align-items: flex-end; }
.heading-note { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; color: var(--krs-muted); font-size: 8px; white-space: nowrap; }
.research-stats { margin-bottom: 14px; }
.research-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .88fr); gap: 12px; align-items: start; }
.question-panel textarea { min-height: 144px; margin-top: 7px; }
.field-label { display: block; margin: 14px 0 6px; color: var(--krs-text-soft); font-size: 9px; font-weight: 650; }
.question-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.question-footer .subtle { margin-right: auto; }
.subtle { color: var(--krs-muted); font-size: 9px; line-height: 1.6; }
.count-pill { padding: 5px 9px; border: 1px solid rgba(195, 168, 117, .3); border-radius: 30px; background: rgba(53, 44, 32, .55); color: var(--krs-gold-300); font-size: 9px; font-weight: 700; }
.selected-panel > .subtle { margin-top: -4px; }
.selected-list { min-height: 82px; margin: 13px 0 10px; padding-top: 10px; border-top: 1px solid var(--krs-line); }
.selected-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(223, 204, 162, .08); color: var(--krs-text-soft); font-size: 9px; }
.source-icon { color: var(--krs-gold-300); font-size: 12px; }
.selected-actions { display: flex; flex-wrap: wrap; gap: 15px; }
.research-layout > .panel { margin-bottom: 13px; }

.search-panel { padding: 15px 16px; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 12px; border: 1px solid var(--krs-line-strong); border-radius: 8px; background: #181316; }
.search-field:focus-within { border-color: var(--krs-gold-600); box-shadow: 0 0 0 3px rgba(195, 168, 117, .1); }
.search-field > span { color: var(--krs-gold-300); font: 19px var(--serif); }
.search-field input { flex: 1; min-width: 0; padding: 9px 2px; border: 0; outline: 0; background: transparent; color: var(--krs-paper-soft); font-size: 10px; box-shadow: none; }
.search-field input::placeholder { color: #958982; }
.search-field input:focus { box-shadow: none; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 11px 2px 0; }
.filter-chip { padding: 5px 9px; border: 1px solid rgba(195, 168, 117, .22); border-radius: 30px; background: rgba(53, 44, 32, .38); color: var(--krs-gold-300); font-size: 8px; font-weight: 650; }
.card-list { display: grid; gap: 10px; }
.literature-controls { margin-bottom: 12px; padding: 17px; }
.literature-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.literature-search-label { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 5px 12px; border: 1px solid var(--krs-line-strong); border-radius: 8px; background: #181316; color: var(--krs-gold-300); }
.literature-search-label:focus-within { border-color: var(--krs-gold-600); box-shadow: 0 0 0 3px rgba(195, 168, 117, .1); }
.literature-search-label > span { font: 19px var(--serif); }
.literature-search-label input { flex: 1; min-width: 0; padding: 9px 2px; border: 0; outline: 0; background: transparent; color: var(--krs-paper-soft); font-size: 11px; box-shadow: none; }
.literature-search-label input:focus { box-shadow: none; }
.literature-search-label input::placeholder { color: #958982; }
.literature-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 13px; }
.literature-filter { display: grid; gap: 5px; min-width: 0; color: var(--krs-muted); font-size: 8px; font-weight: 650; }
.literature-filter select { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--krs-line-strong); border-radius: 6px; background: #181316; color: var(--krs-paper-soft); font-size: 9px; }
.literature-filter-note { margin: 9px 0 0; color: var(--krs-muted); font-size: 8px; }
.literature-reference-panel { margin: 0 0 12px; padding: 14px 17px; }
.literature-reference-panel .panel-title { margin-bottom: 6px; }
.literature-reference-panel h2 { margin-bottom: 0; font-size: 15px; }
.literature-reference-panel > .subtle { margin: 0 0 10px; font-size: 8px; }
.literature-reference-links { display: flex; flex-wrap: wrap; gap: 8px; }
.literature-reference-links a { padding: 7px 9px; border: 1px solid var(--krs-line-strong); border-radius: 6px; color: var(--krs-gold-300); font-size: 8px; text-decoration: none; }
.literature-reference-links a:hover { border-color: var(--krs-gold-600); color: var(--krs-paper-soft); }
.literature-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.literature-counts > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid rgba(223, 204, 162, .12); border-radius: 7px; background: rgba(255, 255, 255, .025); color: var(--krs-muted); font-size: 8px; }
.literature-counts strong { color: var(--krs-gold-300); font-size: 13px; font-weight: 650; }
.literature-bulk-review, .literature-results-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin-top: 13px; padding-top: 11px; border-top: 1px solid rgba(223, 204, 162, .1); }
.literature-bulk-review { justify-content: flex-start; }
.literature-bulk-review strong, .literature-results-toolbar > span, .literature-page-label { color: var(--krs-text-soft); font-size: 9px; }
.literature-bulk-review .button, .literature-pagination .button { min-height: 30px; padding: 6px 9px; font-size: 8px; }
.literature-bulk-review button:disabled, .literature-card-actions button:disabled { opacity: .48; cursor: not-allowed; }
.literature-pagination { display: flex; align-items: center; gap: 9px; }
.literature-pagination span { min-width: 70px; color: var(--krs-muted); text-align: center; font-size: 8px; }
.literature-card { display: grid; grid-template-columns: minmax(90px, 112px) minmax(0, 1fr) minmax(110px, 142px); align-items: start; gap: 13px; padding: 16px 17px; border: 1px solid var(--krs-line); border-radius: 9px; background: linear-gradient(130deg, #241d20, #1e191b); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.literature-card h3 { margin: 0 0 7px; color: var(--krs-paper-soft); font: 500 17px/1.32 var(--serif); }
.literature-card .authors { margin: 0 0 7px; color: var(--krs-muted); font-size: 8px; line-height: 1.6; }
.literature-card .abstract { margin: 10px 0; color: var(--krs-text-soft); font: 12px/1.72 var(--serif); }
.literature-card > a, .literature-card .authors a { font-size: 8px; }
.literature-selectors, .literature-card-actions { display: grid; justify-items: start; gap: 8px; }
.literature-select-label { display: flex; align-items: flex-start; gap: 6px; color: var(--krs-muted); font-size: 7px; line-height: 1.35; cursor: pointer; }
.literature-select-label input { flex: 0 0 15px; }
.literature-review-select { color: var(--krs-gold-300); }
.literature-card-main { min-width: 0; }
.literature-primary-language { margin: 0 0 7px; color: var(--krs-gold-300); font-size: 9px; font-weight: 650; }
.literature-metadata-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 11px; margin: 10px 0; }
.literature-meta-item { min-width: 0; margin: 0; color: var(--krs-muted); font-size: 7px; line-height: 1.5; }
.literature-meta-item span { display: block; color: var(--krs-gold-600); font-size: 7px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.literature-meta-item strong { display: block; overflow-wrap: anywhere; color: var(--krs-text-soft); font-size: 8px; font-weight: 500; }
.literature-country-line { margin: 4px 0; color: var(--krs-muted); font-size: 7px; line-height: 1.5; }
.literature-details { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(223, 204, 162, .1); }
.literature-details summary { width: fit-content; color: var(--krs-gold-300); font-size: 8px; font-weight: 650; cursor: pointer; }
.literature-details[open] { padding-bottom: 3px; }
.literature-card-actions .select-button { width: 100%; text-align: center; }
.literature-card-actions .review-action { border-color: rgba(195, 168, 117, .28); color: var(--krs-gold-300); }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; padding: 4px 7px; border: 1px solid var(--krs-line-strong); border-radius: 5px; background: rgba(255, 255, 255, .025); color: var(--krs-text-soft); font-size: 7px; }
.tag.e2b { border-color: rgba(195, 168, 117, .31); background: rgba(53, 44, 32, .44); color: #dfc88e; }
.select-control { width: 15px; height: 15px; margin: 3px 0 0; accent-color: var(--krs-gold-600); cursor: pointer; }
.select-button { align-self: start; padding: 7px 9px; border: 1px solid var(--krs-line-strong); border-radius: 6px; background: rgba(255, 255, 255, .025); color: var(--krs-text-soft); font: 650 8px var(--sans); cursor: pointer; }
.select-button:hover { border-color: var(--krs-gold-700); color: var(--krs-gold-300); }

.table-wrap { overflow-x: auto; padding: 0; }
.table-wrap table { width: 100%; border-collapse: collapse; text-align: left; }
.table-wrap th { padding: 11px 13px; border-bottom: 1px solid var(--krs-line); background: rgba(20, 15, 18, .6); color: var(--krs-gold-600); font-size: 7px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.table-wrap td { padding: 12px 13px; border-top: 1px solid rgba(223, 204, 162, .075); color: var(--krs-text-soft); font-size: 8px; }
.table-wrap td strong { display: block; color: var(--krs-paper-soft); font-size: 9px; font-weight: 600; }
.table-wrap td small { display: block; margin-top: 4px; color: var(--krs-muted); font-size: 7px; }
.table-wrap .status-chip, .table-wrap .tag { font-size: 7px; }
.table-wrap .empty-state { padding: 15px; }
.passage-panel { margin-top: 4px; }
.synthetic-quote { padding: 16px 18px; border-left: 2px solid var(--krs-gold-600); border-radius: 0 8px 8px 0; background: #241d1f; color: var(--krs-text-soft); font: italic 15px/1.75 var(--serif); }
.passage-meta { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 11px; color: var(--krs-muted); font-size: 8px; }

.workflow-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 0 0 14px; padding: 0; overflow: hidden; border: 1px solid var(--krs-line); border-radius: 9px; background: var(--krs-panel); list-style: none; }
.workflow-steps li { position: relative; min-height: 60px; display: flex; align-items: center; padding: 12px 14px; border-right: 1px solid var(--krs-line); }
.workflow-steps li:last-child { border-right: 0; }
.workflow-steps b { color: var(--krs-text-soft); font: 500 10px/1.35 var(--serif); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--krs-line); border-radius: 9px; background: rgba(30, 24, 27, .7); }
.compact-summary { justify-content: flex-end; }
.packet-summary { margin-bottom: 14px; }
.packet-summary .stat-card { min-height: 91px; }
.packet-summary .stat-label { margin-bottom: 8px; }
.packet-output { overflow: auto; color: var(--krs-text-soft); font: 10px/1.75 var(--sans); white-space: pre-wrap; }
.packet-source { padding: 15px 0; border-top: 1px solid rgba(223, 204, 162, .1); }
.packet-source:first-child { padding-top: 0; border-top: 0; }
.packet-source > strong { display: block; color: var(--krs-paper-soft); font: 500 15px/1.4 var(--serif); }
.packet-source p { margin: 8px 0; color: var(--krs-text-soft); font: 12px/1.75 var(--serif); }
.packet-citation { margin-top: 5px; color: var(--krs-gold-300); font-size: 8px; letter-spacing: .04em; }
.omitted-panel h2 { color: var(--krs-text); font: 500 19px var(--serif); }
.omitted-row { padding: 10px 0; border-top: 1px solid rgba(223, 204, 162, .1); color: var(--krs-text-soft); font-size: 9px; }
.external-notice { margin: 0 0 13px; padding: 12px 14px; border: 1px solid rgba(195, 168, 117, .3); border-radius: 8px; background: rgba(53, 44, 32, .47); color: #e0cca2; font-size: 9px; line-height: 1.65; }

.job-panel { margin-top: 4px; }
.progress-track { height: 4px; overflow: hidden; margin: 16px 0 9px; border-radius: 8px; background: #42363a; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--krs-wine-600), var(--krs-gold-500)); transition: width .35s ease; }
.mono { color: var(--krs-muted); font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; }
.quality-tag { max-width: 220px; padding: 6px 8px; border: 1px solid rgba(195, 168, 117, .2); border-radius: 5px; background: rgba(53, 44, 32, .38); color: var(--krs-gold-300); font-size: 7px; letter-spacing: .07em; text-align: center; }
.result-content { padding-top: 13px; border-top: 1px solid var(--krs-line); }
.result-answer { color: var(--krs-paper-soft); font: 15px/1.85 var(--serif); white-space: pre-wrap; }
.result-claim { margin-bottom: 9px; padding: 13px 14px; border: 1px solid var(--krs-line); border-radius: 8px; background: rgba(255, 255, 255, .02); }
.result-claim .claim-type { color: var(--krs-gold-300); font-size: 7px; font-weight: 700; letter-spacing: .14em; }
.result-claim p { margin: 7px 0; color: var(--krs-text-soft); font: 12px/1.7 var(--serif); }
.result-claim blockquote { margin: 9px 0; padding-left: 11px; border-left: 2px solid var(--krs-gold-600); color: var(--krs-text-soft); font: italic 11px/1.7 var(--serif); }
.result-claim small { color: var(--krs-muted); font-size: 8px; line-height: 1.55; }

.settings-panel { position: fixed; z-index: 12; top: 58px; right: 24px; width: min(610px, calc(100vw - 32px)); max-height: calc(100vh - 76px); overflow: auto; padding: 22px; border: 1px solid var(--krs-line-strong); border-radius: 12px; background: #21191d; box-shadow: var(--shadow); }
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.settings-head h2 { font-size: 21px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 17px 0; }
.settings-grid label, .mapping-form label, .login-form label { display: grid; gap: 6px; color: var(--krs-text-soft); font-size: 8px; font-weight: 650; }
.settings-grid input, .settings-grid select, .mapping-form input, .mapping-form select, .login-form input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--krs-line-strong); border-radius: 6px; outline: none; background: #171215; color: var(--krs-paper-soft); font-size: 9px; }
.settings-grid input:focus, .settings-grid select:focus, .mapping-form input:focus, .mapping-form select:focus, .login-form input:focus { border-color: var(--krs-gold-600); }
.settings-grid .wide, .settings-note { grid-column: 1 / -1; }
.settings-note { margin: 0; color: var(--krs-muted); font-size: 8px; line-height: 1.65; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid var(--krs-line); }
.settings-actions span { color: var(--krs-text-soft); font-size: 8px; }
.admin-mapping-panel { margin-top: 19px; padding-top: 18px; border-top: 1px solid var(--krs-line); }
.mapping-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.mapping-form .button { grid-column: 1 / -1; justify-self: end; }
.mapping-list { margin-top: 12px; }
.mapping-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--krs-line); }
.mapping-row strong, .mapping-row small { display: block; }
.mapping-row strong { color: var(--krs-text); font-size: 9px; }
.mapping-row small { margin-top: 4px; overflow-wrap: anywhere; color: var(--krs-muted); font-size: 8px; }
.login-panel { max-width: 820px; margin: 16px auto; }
.login-panel > .subtle { margin-bottom: 0; }
.login-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; }
.notice { position: fixed; z-index: 15; right: 22px; bottom: 20px; max-width: 440px; padding: 12px 15px; border: 1px solid rgba(223, 204, 162, .24); border-radius: 8px; background: #2d2024; color: var(--krs-paper-soft); font-size: 9px; line-height: 1.6; box-shadow: var(--shadow); }
.notice.error { border-color: rgba(208, 139, 134, .4); background: #382124; }
.page-footer { display: flex; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 13px 2px 0; border-top: 1px solid rgba(223, 204, 162, .12); color: var(--krs-muted-dark); font-size: 8px; letter-spacing: .04em; }
.page-footer b { color: var(--krs-gold-500); letter-spacing: .13em; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1320px) {
  .main-area { padding-right: 34px; padding-left: 34px; }
  .topbar { margin-right: -34px; margin-left: -34px; padding-right: 34px; padding-left: 34px; }
  .stat-grid-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-hero { grid-template-columns: minmax(0, 1fr) 218px; padding-right: 30px; padding-left: 30px; }
}
@media (max-width: 1060px) {
  .app-shell { grid-template-columns: 238px minmax(0, 1fr); }
  .sidebar { padding-right: 13px; padding-left: 13px; }
  .main-area { padding-right: 25px; padding-left: 25px; }
  .topbar { margin-right: -25px; margin-left: -25px; padding-right: 25px; padding-left: 25px; }
  .research-layout { grid-template-columns: minmax(0, 1.3fr) minmax(238px, .9fr); }
  .workflow-steps li { padding-right: 9px; padding-left: 9px; }
  .workflow-steps b { font-size: 9px; }
}
@media (max-width: 860px) {
  .app-shell { display: flex; flex-direction: column; }
  .sidebar { position: sticky; top: 0; height: auto; min-height: 0; padding: 10px 17px 0; border-right: 0; border-bottom: 1px solid rgba(223, 204, 162, .14); }
  .brand { padding: 0 3px 10px; }
  .brand-mark { width: 35px; height: 35px; flex-basis: 35px; }
  .brand-mark span { font-size: 22px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { margin-top: 3px; font-size: 6px; }
  .sidebar-intro, .sidebar-spacer, .research-principle, .sidebar-foot { display: none; }
  .main-nav { display: flex; gap: 5px; overflow-x: auto; padding: 0 1px 9px; scrollbar-width: thin; }
  .nav-group { display: flex; flex: 0 0 auto; gap: 4px; }
  .nav-group-label { display: none; }
  .nav-item { grid-template-columns: 18px auto; gap: 6px; padding: 8px 9px; font-size: 8px; }
  .nav-icon { width: 17px; font-size: 13px; }
  .main-area { max-width: none; padding-right: 24px; padding-left: 24px; }
  .topbar { height: 57px; margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
  .view { padding-top: 25px; }
  .dashboard-hero { grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; }
  .dashboard-grid { gap: 10px; }
  .research-layout { grid-template-columns: 1fr; }
  .selected-panel { order: 0; }
  .workflow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workflow-steps li:nth-child(3) { border-right: 0; }
  .workflow-steps li:nth-child(n+4) { border-top: 1px solid var(--krs-line); }
  .workflow-steps li:nth-child(4) { border-right: 1px solid var(--krs-line); }
  .workflow-steps li:nth-child(5) { border-right: 1px solid var(--krs-line); }
  .workflow-steps li:nth-child(6) { border-right: 0; }
}
@media (max-width: 620px) {
  .sidebar { padding-right: 9px; padding-left: 9px; }
  .brand { padding-left: 4px; }
  .brand-mark { width: 31px; height: 31px; flex-basis: 31px; }
  .brand-copy strong { font-size: 12px; }
  .brand-copy small { max-width: 220px; overflow: hidden; font-size: 5px; text-overflow: ellipsis; }
  .main-nav { gap: 3px; }
  .nav-group { gap: 2px; }
  .nav-item { grid-template-columns: 15px auto; gap: 4px; padding: 7px 7px; font-size: 7px; }
  .nav-icon { width: 14px; font-size: 12px; }
  .main-area { padding: 0 14px 20px; }
  .topbar { height: 52px; margin: 0 -14px; padding: 0 14px; }
  .breadcrumb { font-size: 8px; }
  .breadcrumb-divider { margin: 0 6px; }
  .topbar-actions { gap: 6px; }
  .demo-badge { width: 25px; height: 25px; justify-content: center; overflow: hidden; padding: 0; font-size: 0; }
  .demo-badge .status-dot { flex-basis: 6px; }
  .icon-button { width: 29px; height: 29px; font-size: 12px; }
  .avatar { width: 28px; height: 28px; font-size: 9px; }
  .topbar-actions .button { max-width: 100px; min-height: 29px; overflow: hidden; padding: 6px 8px; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
  .view { padding-top: 19px; }
  .dashboard-hero { display: block; margin-bottom: 18px; padding: 24px 20px 21px; }
  .dashboard-hero::after { top: -120px; right: -100px; }
  .hero-copy h1, .page-heading h1 { font-size: 39px; }
  .hero-copy p { font-size: 12px; }
  .hero-disciplines { gap: 7px 10px; margin-top: 16px; }
  .hero-disciplines span { font-size: 6px; }
  .hero-disciplines span + span::before { margin-right: 10px; }
  .hero-aside { display: none; }
  .research-launch { margin-bottom: 25px; padding: 17px 15px 14px; }
  .launch-heading { align-items: flex-start; }
  .launch-heading h2 { font-size: 20px; }
  .launch-heading .model-chip { max-width: 115px; white-space: normal; font-size: 7px; }
  .research-launch textarea { min-height: 112px; font-size: 13px; }
  .launch-footer { align-items: flex-start; flex-direction: column; gap: 12px; }
  .launch-actions { width: 100%; }
  .launch-actions .button { flex: 1; min-height: 36px; padding: 8px 7px; font-size: 7px; }
  .section-heading { align-items: flex-end; }
  .section-heading h2 { font-size: 19px; }
  .section-note { max-width: 125px; text-align: right; }
  .live-note { font-size: 7px; }
  .stat-grid-six, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 14px; }
  .stat-card { min-height: 101px; padding: 12px 11px; }
  .stat-index { top: 9px; right: 9px; font-size: 7px; }
  .stat-label { max-width: calc(100% - 20px); margin: 1px 0 11px; font-size: 7px; }
  .stat-card strong { font-size: 24px; }
  .stat-card small { font-size: 7px; }
  .stat-icon { top: 10px; right: 26px; width: 19px; height: 19px; font-size: 10px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 0; }
  .dashboard-grid-quality { margin-top: 0; }
  .panel { padding: 15px; margin-bottom: 10px; }
  .panel-title h2 { font-size: 17px; }
  .distribution-row { grid-template-columns: minmax(85px, .8fr) minmax(35px, 1fr) 30px; gap: 7px; }
  .page-heading { align-items: flex-start; gap: 10px; }
  .page-heading h1 { font-size: 34px; }
  .page-heading p { max-width: 260px; font-size: 10px; }
  .page-heading > .button, .page-heading-actions .button { min-height: 32px; padding: 7px 8px; font-size: 7px; }
  .page-heading-actions { justify-content: flex-end; }
  .heading-note { max-width: 116px; white-space: normal; font-size: 7px; }
  .research-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-panel textarea { min-height: 137px; }
  .question-footer { align-items: stretch; }
  .question-footer .subtle { width: 100%; margin: 0 0 4px; }
  .question-footer .button { flex: 1; padding: 8px 6px; font-size: 7px; }
  .job-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 7px; }
  .job-row > .status-chip { grid-column: 2; justify-self: start; }
  .job-open-button { grid-column: 3; grid-row: 1 / 3; }
  .recent-document { grid-template-columns: 29px minmax(0, 1fr); }
  .recent-document > .status-chip { grid-column: 2; justify-self: start; }
  .search-panel { padding: 11px; }
  .search-field { gap: 6px; padding-left: 8px; }
  .search-field .button { min-height: 32px; padding: 7px 9px; }
  .literature-controls { padding: 11px; }
  .literature-search-row { grid-template-columns: 1fr; }
  .literature-search-row > .button { width: 100%; }
  .literature-filters { grid-template-columns: 1fr 1fr; gap: 8px; }
  .literature-counts { grid-template-columns: 1fr 1fr; }
  .literature-counts > div { padding: 8px; }
  .literature-bulk-review, .literature-results-toolbar { align-items: flex-start; }
  .literature-results-toolbar { flex-direction: column; }
  .literature-pagination { width: 100%; justify-content: space-between; }
  .literature-card { grid-template-columns: 1fr; gap: 9px; padding: 13px; }
  .literature-selectors { display: flex; flex-wrap: wrap; gap: 12px; }
  .literature-card-actions { display: flex; flex-wrap: wrap; gap: 7px; }
  .literature-card-actions .select-button { width: auto; }
  .literature-metadata-grid { grid-template-columns: 1fr; gap: 6px; }
  .literature-card h3 { font-size: 15px; }
  .table-wrap table { min-width: 610px; }
  .workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-steps li { min-height: 62px; padding: 9px 10px; }
  .workflow-steps li:nth-child(3) { border-right: 1px solid var(--krs-line); border-top: 1px solid var(--krs-line); }
  .workflow-steps li:nth-child(4) { border-right: 0; }
  .workflow-steps li:nth-child(5) { border-right: 1px solid var(--krs-line); }
  .workflow-steps li:nth-child(6) { border-top: 1px solid var(--krs-line); }
  .workflow-steps b { font-size: 8px; }
  .toolbar { align-items: flex-start; flex-direction: column; padding: 11px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .button { flex: 1; padding: 7px 6px; font-size: 7px; }
  .compact-summary { justify-content: flex-start; }
  .packet-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .packet-summary .stat-card { min-height: 88px; }
  .packet-heading { flex-direction: column; }
  .packet-heading .page-heading-actions { justify-content: flex-start; }
  .settings-panel { top: 48px; right: 7px; width: calc(100vw - 14px); max-height: calc(100vh - 57px); padding: 16px; }
  .settings-grid, .mapping-form, .login-form { grid-template-columns: 1fr; }
  .settings-grid .wide, .settings-note, .mapping-form .button { grid-column: auto; }
  .mapping-form .button { justify-self: stretch; }
  .settings-actions { align-items: flex-start; flex-direction: column; }
  .page-footer { flex-direction: column; }
  .notice { right: 10px; bottom: 10px; left: 10px; max-width: none; }
  .quality-tag { max-width: 120px; line-height: 1.45; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Comfortable 16px typographic hierarchy, unified controls, and HU/EN switcher */
body { font-size: 16px; line-height: 1.62; }
.app-shell { position: relative; isolation: isolate; }
.app-shell::before, .app-shell::after { content: ""; position: fixed; z-index: 0; pointer-events: none; }
.app-shell::before {
  right: clamp(8px, 4vw, 76px); bottom: -3vh; width: min(36vw, 470px); height: min(76vh, 690px);
  background: var(--krs-portrait-art) center bottom / contain no-repeat;
  opacity: .095; filter: saturate(.55) sepia(.42);
  mask-image: linear-gradient(to top, transparent 0%, #000 14%, #000 78%, transparent 100%);
}
.app-shell::after {
  top: 13vh; right: clamp(24px, 7vw, 112px); width: clamp(230px, 29vw, 410px); aspect-ratio: 1;
  border: 1px solid rgba(215, 183, 120, .055); border-top-color: rgba(223, 204, 162, .2);
  border-right-color: rgba(195, 168, 117, .105); border-radius: 48% 52% 50% 46%;
  transform-origin: center; animation: krs-gold-drift 38s ease-in-out infinite alternate;
}
@keyframes krs-gold-drift {
  from { transform: translate3d(0, 0, 0) rotate(-8deg); }
  to { transform: translate3d(-7px, 6px, 0) rotate(-2deg); }
}
.sidebar { z-index: 5; }
.main-area { position: relative; z-index: 1; }

/* Sidebar & topbar hierarchy */
.brand-copy strong { font-size: 20px; }
.brand-copy small { font-size: 11px; letter-spacing: .11em; }
.eyebrow { font-size: 12px; line-height: 1.4; letter-spacing: .12em; }
.nav-group-label { font-size: 11.5px; letter-spacing: .14em; }
.sidebar-intro p { font-size: 16.5px; line-height: 1.38; }
.nav-item { padding: 11px 11px; font-size: 14.5px; line-height: 1.38; }
.nav-label { white-space: normal; overflow-wrap: anywhere; }
.research-principle .eyebrow { font-size: 11px; }
.research-principle p { font-size: 14px; line-height: 1.48; }
.sidebar-foot, .sidebar-foot-title { font-size: 12px; line-height: 1.45; }

.topbar { min-height: 70px; height: auto; padding-top: 10px; padding-bottom: 10px; }
.breadcrumb { font-size: 14px; line-height: 1.4; }
.demo-badge, .model-chip { padding: 7px 12px; font-size: 13px; line-height: 1.35; }
.icon-button { width: 38px; height: 38px; font-size: 16px; }
.avatar { width: 38px; height: 38px; font-size: 14px; }

/* Headings & prose */
.hero-copy .eyebrow, .hero-version { font-size: 12.5px; }
.hero-copy h1 { font-size: clamp(42px, 4.4vw, 62px); line-height: 1.04; }
.page-heading h1 { font-size: clamp(36px, 3.8vw, 52px); line-height: 1.07; }
.hero-copy p { font-size: 17px; line-height: 1.72; }
.hero-disciplines span { font-size: 12.5px; letter-spacing: .1em; }
.hero-index { font-size: 13px; }
.hero-aside .eyebrow { font-size: 12px; }
.hero-aside p { font-size: 15px; line-height: 1.62; }
.launch-heading h2, .section-heading h2 { font-size: clamp(24px, 2.2vw, 29px); line-height: 1.22; }
.panel-title h2, .settings-head h2, .omitted-panel h2 { font-size: 21px; line-height: 1.28; }
.literature-reference-panel h2 { font-size: 19px; line-height: 1.32; }
.panel-mark { font-size: 12px; }
.page-heading p { font-size: 16px; line-height: 1.65; }
.section-note, .live-note, .heading-note { font-size: 13.5px; line-height: 1.45; }

/* Buttons, inputs, labels */
.button { min-height: 44px; padding: 10px 16px; font-size: 14.5px; line-height: 1.35; }
.text-button, .job-open-button { font-size: 14px; line-height: 1.45; }
.select-button, .retry-button { padding: 8px 12px; font-size: 14px; line-height: 1.35; }
.research-launch textarea, .question-panel textarea { font-size: 16px; line-height: 1.64; }
.field-label, .field-group label, .settings-grid label, .mapping-form label, .login-form label { font-size: 14px; line-height: 1.45; }
.search-field input, .literature-search-label input, .source-picker-search,
.literature-filter select, .research-settings-box select,
.field-group input, .field-group select, .field-group textarea,
.settings-grid input, .settings-grid select, .mapping-form input, .mapping-form select, .login-form input {
  font-size: 15px;
  line-height: 1.45;
  min-height: 44px;
}
.settings-grid input, .settings-grid select, .mapping-form input, .mapping-form select, .login-form input { height: 44px; }
.selection-summary strong { font-size: 15px; }
.selection-summary small { font-size: 13.5px; line-height: 1.45; }
.subtle, .empty-state, .state-message, .research-state, .result-error-box, .external-notice, .omitted-row { font-size: 14.5px; line-height: 1.62; }
.count-pill, .status-chip { font-size: 13px; line-height: 1.35; padding: 6px 10px; }
.tag { font-size: 12.5px; line-height: 1.35; padding: 5px 9px; }
.selected-item { font-size: 14.5px; line-height: 1.48; }

/* Stats, lists & telemetry */
.stat-card { min-height: 128px; padding: 17px 16px 15px; }
.stat-label { font-size: 14px; line-height: 1.38; margin: 4px 0 10px; }
.stat-card strong { font-size: 30px; line-height: 1.1; }
.stat-card small { font-size: 13.5px; line-height: 1.45; }
.metric-empty { font-size: 20px !important; }
.metric-error { font-size: 14.5px !important; line-height: 1.45 !important; }
.distribution-row { grid-template-columns: minmax(96px, .9fr) minmax(45px, 1.4fr) auto; font-size: 14.5px; line-height: 1.45; }
.distribution-count { font-size: 14px; }
.recent-document-main strong, .job-detail strong, .active-job-detail strong { font-size: 15px; line-height: 1.42; }
.recent-document-main small, .job-detail p, .active-job-detail small { font-size: 13.5px; line-height: 1.45; }
.ai-usage-model { font-size: 16px; line-height: 1.42; }
.ai-usage-query { font-size: 15px; line-height: 1.55; }
.ai-usage-meta, .ai-usage-note, .ai-usage-fallback { font-size: 13.5px; line-height: 1.5; }
.ai-usage-metric dt { font-size: 13px; }
.ai-usage-metric dd { font-size: 20px; line-height: 1.15; }
.ai-usage-metric small { font-size: 12.5px; }

/* Literature & documents */
.literature-filter { font-size: 14px; line-height: 1.4; }
.literature-filter-note, .literature-reference-panel > .subtle { font-size: 14px; line-height: 1.55; }
.literature-reference-links a { font-size: 14px; padding: 8px 12px; }
.literature-counts > div { font-size: 14px; }
.literature-counts strong { font-size: 18px; }
.literature-bulk-review strong, .literature-results-toolbar > span, .literature-page-label { font-size: 14.5px; }
.literature-bulk-review .button, .literature-pagination .button { min-height: 40px; font-size: 14px; padding: 8px 12px; }
.literature-pagination span { font-size: 14px; min-width: 90px; }
.literature-card h3 { font-size: 20px; line-height: 1.38; overflow-wrap: anywhere; }
.literature-card .authors { font-size: 14px; line-height: 1.55; }
.literature-card .abstract { font-size: 15.5px; line-height: 1.72; }
.literature-card > a, .literature-card .authors a { font-size: 14px; }
.literature-select-label { font-size: 13.5px; line-height: 1.4; }
.literature-primary-language { font-size: 14.5px; }
.literature-meta-item { font-size: 13.5px; }
.literature-meta-item span { font-size: 12px; }
.literature-meta-item strong { font-size: 14px; }
.literature-country-line { font-size: 13.5px; line-height: 1.5; }
.literature-details summary { font-size: 14.5px; }
.table-wrap th { font-size: 13px; line-height: 1.4; }
.table-wrap td { font-size: 14.5px; line-height: 1.5; }
.table-wrap td strong { font-size: 15px; line-height: 1.42; }
.table-wrap td small { font-size: 13px; line-height: 1.45; }
.table-wrap .status-chip, .table-wrap .tag { font-size: 12.5px; }

/* Packet, results & settings */
.workflow-steps b { font-size: 14.5px; line-height: 1.4; }
.packet-output { font-size: 15px; line-height: 1.72; }
.packet-source > strong { font-size: 18px; line-height: 1.4; }
.packet-source p { font-size: 15.5px; line-height: 1.72; }
.packet-citation, .passage-meta { font-size: 13.5px; }
.synthetic-quote { font-size: 16.5px; line-height: 1.75; }
.mono { font-size: 13px; }
.quality-tag { max-width: 260px; font-size: 12px; padding: 7px 10px; }
.result-answer { font-size: 17px; line-height: 1.82; }
.result-claim .claim-type { font-size: 12.5px; }
.result-claim p { font-size: 15.5px; line-height: 1.7; }
.result-claim blockquote { font-size: 15px; line-height: 1.7; }
.result-claim small { font-size: 13.5px; line-height: 1.55; }
.settings-note, .settings-actions span, .mapping-row small, .page-footer { font-size: 13.5px; line-height: 1.55; }
.mapping-row strong { font-size: 15px; }
.notice { font-size: 14.5px; line-height: 1.55; }

@media (max-width: 1060px) {
  .app-shell { grid-template-columns: 256px minmax(0, 1fr); }
  .workflow-steps b { font-size: 13.5px; }
}
@media (max-width: 860px) {
  .app-shell::before { right: -3vw; width: min(54vw, 330px); height: 56vh; opacity: .065; }
  .app-shell::after { top: 18vh; right: -8vw; width: 42vw; }
  .nav-item { font-size: 14px; padding: 9px 11px; }
  .nav-label { white-space: nowrap; }
}
@media (max-width: 620px) {
  .app-shell::before { right: -12vw; bottom: 0; width: 72vw; height: 47vh; opacity: .045; }
  .app-shell::after { top: auto; right: -18vw; bottom: 8vh; width: 62vw; }
  .topbar { min-height: 56px; height: auto; flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .breadcrumb { font-size: 13.5px; flex: 1 1 auto; }
  .topbar-actions { gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
  .topbar-actions .button { max-width: none; min-height: 36px; padding: 7px 11px; font-size: 13.5px; }
  .nav-item { font-size: 14px; padding: 8px 11px; gap: 6px; grid-template-columns: 18px auto; }
  .nav-icon { width: 16px; font-size: 15px; }
  .hero-copy h1 { font-size: 34px; line-height: 1.08; }
  .page-heading { flex-wrap: wrap; }
  .page-heading h1 { font-size: 30px; line-height: 1.1; }
  .page-heading p { max-width: 100%; font-size: 15px; line-height: 1.58; }
  .hero-copy p { font-size: 15.5px; line-height: 1.62; }
  .hero-disciplines span { font-size: 11.5px; }
  .launch-heading h2 { font-size: 22px; }
  .launch-heading .model-chip { max-width: none; font-size: 12px; }
  .research-launch textarea, .question-panel textarea { font-size: 16px; }
  .launch-actions .button, .question-footer .button, .toolbar-actions .button, .page-heading-actions .button {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 14px;
    white-space: normal;
    text-align: center;
  }
  .section-heading { flex-wrap: wrap; gap: 6px; }
  .section-heading h2 { font-size: 21px; }
  .section-note, .live-note, .heading-note { max-width: 100%; text-align: left; font-size: 13px; white-space: normal; }
  .stat-card { min-height: 112px; padding: 13px 12px; }
  .stat-label { font-size: 13px; max-width: calc(100% - 26px); overflow-wrap: break-word; }
  .stat-card strong { font-size: 25px; }
  .stat-card small { font-size: 12.5px; }
  .literature-filters { grid-template-columns: 1fr; gap: 10px; }
  .literature-card h3 { font-size: 18px; }
  .literature-card .abstract { font-size: 15px; }
  .literature-filter select { font-size: 15px; }
  .literature-bulk-review .button, .literature-pagination .button { min-height: 40px; font-size: 13.5px; white-space: normal; }
  .workflow-steps b { font-size: 13.5px; }
  .quality-tag { max-width: 100%; font-size: 11.5px; }
  .toolbar .source-picker-search { max-width: 100% !important; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell::after { animation: none !important; }
}

:root { --krs-portrait-art: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MjAgNzgwIiBmaWxsPSJub25lIiByb2xlPSJpbWciIGFyaWEtbGFiZWxsZWRieT0idGl0bGUgZGVzYyI+CiAgPHRpdGxlIGlkPSJ0aXRsZSI+U8O4cmVuIEt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jA5IiBzdHJva2Utd2lkdGg9IjEuMDUiIG9wYWNpdHk9Ii40MiIvPgogIDwvZz4KPC9zdmc+Cg=="); }
.dashboard-hero, .page-heading-editorial, .view-literature .page-heading { isolation: isolate; }
.dashboard-hero::before, .page-heading-editorial::before, .view-literature .page-heading::before {
  content: ""; position: absolute; z-index: 0; top: -12%; right: clamp(150px, 17vw, 280px);
  width: clamp(155px, 18vw, 225px); height: 124%; pointer-events: none;
  background: var(--krs-portrait-art) center / contain no-repeat;
  opacity: .12; filter: saturate(.55) sepia(.42);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 84%, transparent 100%);
}
.dashboard-hero .hero-copy, .dashboard-hero .hero-aside, .page-heading > * { position: relative; z-index: 1; }
@media (max-width: 620px) {
  .dashboard-hero::before, .page-heading-editorial::before, .view-literature .page-heading::before { display: none; }
}

/* Unified KRS workspace extensions */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(195, 168, 117, .36);
  border-radius: 9px;
  background: var(--krs-panel);
}
.lang-option {
  min-width: 38px;
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--krs-text-soft);
  font: 650 14px/1.1 var(--sans);
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.lang-option:hover { color: var(--krs-paper-soft); background: rgba(255, 255, 255, .06); }
.lang-option.active {
  background: linear-gradient(180deg, #d0b780, #b5975f);
  color: #201517;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.nav-group-compact { margin-top: 2px; }

.research-settings-box {
  margin-top: 14px;
  padding: 15px 17px;
  border: 1px solid var(--krs-line);
  border-radius: 8px;
  background: rgba(19, 15, 17, .48);
  display: grid;
  gap: 12px;
}
.research-settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--krs-text-soft);
}
.research-settings-row label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.research-settings-row input[type="checkbox"] { accent-color: var(--krs-gold-500); width: 17px; height: 17px; }
.research-settings-box select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--krs-line-strong);
  border-radius: 6px;
  background: #171215;
  color: var(--krs-paper-soft);
  font-size: 15px;
}

.source-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.source-picker-panel { display: flex; flex-direction: column; min-height: 310px; max-height: 480px; }
.source-picker-search {
  width: 100%;
  min-height: 42px;
  margin: 8px 0 10px;
  padding: 9px 12px;
  border: 1px solid var(--krs-line-strong);
  border-radius: 6px;
  background: #171215;
  color: var(--krs-paper-soft);
  font-size: 15px;
}
.source-picker-search:focus { border-color: var(--krs-gold-600); outline: none; }
.source-picker-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: 7px;
  align-content: start;
  padding-right: 4px;
}
.source-row {
  display: grid;
  grid-template-columns: 18px auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(223, 204, 162, .11);
  border-radius: 7px;
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.source-row:hover { border-color: rgba(195, 168, 117, .34); background: rgba(255, 255, 255, .04); }
.source-row input { margin-top: 3px; accent-color: var(--krs-gold-500); width: 17px; height: 17px; }
.source-tag {
  padding: 4px 7px;
  border: 1px solid rgba(195, 168, 117, .3);
  border-radius: 4px;
  background: rgba(94, 32, 51, .45);
  color: var(--krs-gold-300);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.source-title { display: block; color: var(--krs-paper-soft); font-size: 15px; font-weight: 600; line-height: 1.42; overflow-wrap: anywhere; }
.source-meta { display: block; margin-top: 4px; color: var(--krs-muted); font-size: 13.5px; line-height: 1.48; overflow-wrap: anywhere; }

.model-status-panel .statusline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid rgba(223, 204, 162, .09);
  font-size: 14.5px;
  line-height: 1.45;
}
.model-status-panel .statusline:first-of-type { border-top: 0; }
.model-workflow-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.model-role-card {
  padding: 14px 16px;
  border: 1px solid var(--krs-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .02);
}
.model-role-card.primary-role {
  border-color: rgba(195, 168, 117, .35);
  background: linear-gradient(135deg, rgba(66, 23, 36, .42), rgba(30, 24, 27, .9));
}
.model-role-card strong { display: block; color: var(--krs-paper-soft); font-size: 16px; margin-bottom: 5px; }

.research-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid var(--krs-line-strong);
  border-radius: 8px;
  background: #1b1518;
  color: var(--krs-text-soft);
  font-size: 15px;
  line-height: 1.55;
}
.research-state.done { border-color: rgba(124, 160, 138, .4); background: var(--green-soft); color: #c9ddd0; }
.research-state.error { border-color: rgba(208, 139, 134, .4); background: var(--red-soft); color: #ecc0bc; }
.research-spinner {
  width: 16px; height: 16px; flex: 0 0 16px;
  border: 2px solid rgba(223, 204, 162, .25);
  border-top-color: var(--krs-gold-300);
  border-radius: 50%;
  animation: krs-spin .8s linear infinite;
}
@keyframes krs-spin { to { transform: rotate(360deg); } }

.result-section-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(223, 204, 162, .12);
}
.result-section-block h3 {
  margin: 0 0 10px;
  color: var(--krs-gold-300);
  font: 500 20px/1.32 var(--serif);
}
.result-section-block h4 {
  margin: 14px 0 7px;
  color: var(--krs-text);
  font: 600 16px/1.4 var(--sans);
}
.gemini-assistance {
  margin: 18px 0;
  padding: 17px 19px;
  border: 1px solid rgba(195, 168, 117, .35);
  border-left: 3px solid var(--krs-gold-500);
  border-radius: 9px;
  background: linear-gradient(120deg, rgba(53, 44, 32, .45), rgba(30, 24, 27, .92));
}
.gemini-assistance h3 { margin: 8px 0 10px; color: var(--krs-gold-300); font: 500 20px/1.32 var(--serif); }
.gemini-assistance p, .gemini-assistance li { color: var(--krs-text-soft); font: 16px/1.72 var(--serif); }
.gemini-assistance ul { margin: 8px 0; padding-left: 22px; }

.result-error-box {
  margin-top: 14px;
  padding: 15px 17px;
  border: 1px solid rgba(208, 139, 134, .4);
  border-radius: 8px;
  background: var(--red-soft);
  color: #f0c2be;
  font-size: 15px;
  line-height: 1.62;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.field-group { display: grid; gap: 6px; }
.field-group label { color: var(--krs-text-soft); font-size: 14px; font-weight: 600; line-height: 1.45; }
.field-group input, .field-group select, .field-group textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--krs-line-strong);
  border-radius: 6px;
  background: #171215;
  color: var(--krs-paper-soft);
  font-size: 15px;
}
.field-group input:focus, .field-group select:focus, .field-group textarea:focus {
  border-color: var(--krs-gold-600); outline: none;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.settings-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.jobs-history-list { display: grid; gap: 8px; }
.jobs-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid rgba(223, 204, 162, .09);
}
.jobs-history-row:first-child { border-top: 0; }
.jobs-history-row strong { font-size: 15.5px; line-height: 1.42; overflow-wrap: anywhere; }
.jobs-history-row.is-selected {
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 7px;
  background: rgba(94, 32, 51, .26);
}

@media (max-width: 1060px) {
  .source-picker-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .source-picker-grid, .model-workflow-cards, .compare-grid, .settings-cards-grid, .upload-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .lang-option { min-width: 34px; min-height: 30px; padding: 4px 8px; font-size: 13px; }
  .jobs-history-row { grid-template-columns: 1fr; align-items: flex-start; gap: 8px; }
}

.login-links { display: flex; justify-content: flex-end; margin-top: 10px; }
.forgot-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--krs-line); display: grid; gap: 10px; }
.invite-link-box { margin-top: 12px; padding: 14px 16px; border: 1px solid rgba(195, 168, 117, .35); border-radius: 8px; background: rgba(53, 44, 32, .35); display: grid; gap: 10px; }
.invite-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.invite-link-row input { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--krs-line-strong); border-radius: 6px; background: #171215; color: var(--krs-paper-soft); font-size: 14px; }
.user-mgmt-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.change-password-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Scholarly Research & Results UI polish (Section 8) */
.page-heading-compact { margin-bottom: 18px; }
.page-heading-compact h1 { margin-bottom: 4px; }
.question-panel { border-left: 2px solid rgba(195, 168, 117, .55); padding: 24px 26px; }
.question-panel .panel-title { margin-bottom: 8px; }
.question-panel textarea { min-height: 158px; font-size: 16px; line-height: 1.68; }
.research-short-hint { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--krs-muted); }
.selected-panel { padding: 22px 22px 18px; background: rgba(27, 21, 24, .78); box-shadow: none; }
.selected-panel .selected-list { min-height: 76px; margin: 10px 0 12px; }
.research-process-panel { padding: 20px 24px; }
.tech-details {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(223, 204, 162, .14);
}
.tech-details > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--krs-gold-300);
  font: 600 14px/1.4 var(--sans);
  cursor: pointer;
  list-style: none;
}
.tech-details > summary::-webkit-details-marker { display: none; }
.tech-details > summary::before { content: "▸"; font-size: 12px; color: var(--krs-gold-500); transition: transform .15s ease; }
.tech-details[open] > summary::before { transform: rotate(90deg); }
.tech-details-body { margin-top: 12px; display: grid; gap: 14px; }
.tech-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.tech-metric {
  padding: 10px 12px;
  border: 1px solid rgba(223, 204, 162, .12);
  border-radius: 7px;
  background: rgba(255, 255, 255, .018);
}
.tech-metric span { display: block; color: var(--krs-muted); font-size: 13px; line-height: 1.35; }
.tech-metric strong { display: block; margin-top: 4px; color: var(--krs-paper-soft); font: 500 20px/1.15 var(--serif); }
.job-tech-details { margin-top: 12px; padding-top: 10px; }

.result-panel { padding: 26px 28px; }
.result-essay {
  max-width: 72ch;
  color: var(--krs-paper-soft);
  font: 400 17.5px/1.84 var(--serif);
  letter-spacing: -.003em;
}
.result-essay > *:first-child { margin-top: 0; }
.result-essay p { margin: 0 0 1.05em; }
.result-essay strong { color: #f6ede0; font-weight: 600; }
.result-essay em { color: #ebd9b8; }
.result-essay ul, .result-essay ol {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
  display: grid;
  gap: 0.45em;
}
.result-essay li { padding-left: 0.2em; }
.result-essay hr {
  border: 0;
  height: 1px;
  margin: 1.6em 0;
  background: linear-gradient(90deg, rgba(195, 168, 117, .35), rgba(223, 204, 162, .08));
}
.essay-heading {
  margin: 1.65em 0 0.55em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid rgba(195, 168, 117, .22);
  color: #f4ead8;
  font: 500 22px/1.3 var(--serif);
  letter-spacing: -.015em;
}
.essay-subheading {
  margin: 1.35em 0 0.45em;
  color: var(--krs-gold-300);
  font: 600 17.5px/1.4 var(--serif);
}
.essay-quote {
  margin: 1.15em 0;
  padding: 12px 16px;
  border-left: 2px solid var(--krs-gold-600);
  background: rgba(94, 32, 51, .18);
  color: #ede2d2;
  font-style: italic;
}
.essay-cite {
  display: inline;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(94, 32, 51, .34);
  color: var(--krs-gold-300);
  font: 600 0.84em/1.2 var(--sans);
  letter-spacing: .02em;
}
.result-accordions {
  margin-top: 24px;
  border-top: 1px solid rgba(223, 204, 162, .16);
}
.result-accordion {
  border-bottom: 1px solid rgba(223, 204, 162, .14);
  padding: 13px 0;
}
.result-accordion.tech-details {
  margin-top: 0;
  padding-top: 13px;
  border-top: 0;
}
.result-accordion > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--krs-text-soft);
  font: 600 15px/1.45 var(--sans);
  cursor: pointer;
  list-style: none;
  transition: color .15s ease;
}
.result-accordion > summary:hover { color: var(--krs-gold-300); }
.result-accordion > summary::-webkit-details-marker { display: none; }
.result-accordion > summary::before { content: "▸"; font-size: 12px; color: var(--krs-gold-500); transition: transform .15s ease; }
.result-accordion[open] > summary::before { transform: rotate(90deg); }
.result-accordion > .result-section-block,
.result-accordion > .gemini-assistance {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(223, 204, 162, .08);
}

@media (max-width: 860px) {
  .user-mgmt-columns, .invite-link-row, .change-password-form, .tech-metrics-row { grid-template-columns: 1fr; }
  .result-panel, .question-panel { padding: 18px 16px; }
  .result-essay { font-size: 16.5px; line-height: 1.76; }
  .essay-heading { font-size: 20px; }
}
