:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: #1e2e27;
  background: #f4f6f2;
  font-size: 14px;
  line-height: 1.55;
  --ink: #1e2e27;
  --muted: #536257;
  --border: #e1e7df;
  --card: #fff;
  --green: #27604c;
  --green-dark: #1b4939;
  --green-soft: #e8f2eb;
  --rail: #142c26;
  --rail-soft: #253e35;
  --amber: #7e4c1a;
  --amber-soft: #fbf0df;
  --red: #983d37;
  --red-soft: #f9ece9;
  --shadow: 0 1px 2px rgba(27, 51, 38, .04);
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: default; }
a { color: var(--green-dark); }
a:hover { color: var(--green); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid #3f8465; outline-offset: 3px; }
p, h1, h2, h3, h4 { margin: 0; }
ul, ol { margin-block: 0; }
strong { font-weight: 675; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 12;
  transform: translateY(-150%);
  padding: .6rem .9rem;
  background: #fff;
  border-radius: 5px;
}
.skip-link:focus { transform: none; }

.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  padding: 23px 14px 18px;
  background: var(--rail);
  color: #f6fffa;
}
.sidebar :focus-visible { outline-color: #a8dbc1; }
.brand {
  --brand-ink: #102b50;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-self: start;
  flex-shrink: 0;
  width: min(100%, 208px);
  gap: 7px;
  padding: 5px 4px 8px;
  margin: 0 0 24px;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}
.brand-wordmark {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 1;
  object-fit: cover;
  object-position: center 74%;
}
.brand-product {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--brand-ink);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-signal {
  position: relative;
  flex: 0 0 27px;
  height: 22px;
  background: var(--brand-ink);
  border-radius: 7px 7px 7px 3px;
}
.brand-signal::before {
  content: "";
  position: absolute;
  inset: 5px 4px;
  background: #fff;
  clip-path: polygon(0 58%, 24% 58%, 41% 8%, 57% 65%, 68% 43%, 82% 43%, 92% 17%, 100% 30%, 87% 62%, 74% 62%, 55% 95%, 40% 41%, 30% 77%, 0 77%);
}
.brand-signal::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dd2330;
  box-shadow: 0 0 0 2px #fff;
}
.main-nav { display: grid; align-content: start; gap: 4px; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 11px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 43px;
  color: #c1d2c8;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 565;
}
.nav-link:hover { background: #203a31; color: #f4fff9; }
.nav-link[aria-current="page"] {
  background: #2c4b3e;
  border-color: #385a4b;
  color: #fff;
}
.nav-link[aria-current="page"]::before {
  position: absolute;
  content: "";
  width: 3px;
  height: 17px;
  left: -1px;
  background: #a7d5af;
  border-radius: 2px;
}
.nav-link[data-page="settings"] { margin-top: 14px; }
.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 18px;
  color: #aed1be;
  font: 17px/1 -apple-system, BlinkMacSystemFont, "Segoe UI Symbol", sans-serif;
}
.model-indicator {
  margin: auto 4px 0;
  padding: 15px 9px 1px;
  border-top: 1px solid #355048;
  color: #cad8cf;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.model-row { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.model-row strong { color: #eff7ef; }
.model-name { margin: 6px 0 0; color: #c3d6c9; }
.model-indicator details { margin: 5px 0 0; }
.model-indicator summary { cursor: pointer; color: #d1e5d7; width: fit-content; }
.model-indicator details p { margin-top: 4px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.model-state { color: #b7dcb9; white-space: nowrap; }
.model-state.missing { color: #e0c38f; }

.workspace { min-width: 0; }
.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  min-height: 64px;
  padding: 9px clamp(18px, 3vw, 46px);
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.context-title {
  display: grid;
  min-width: 145px;
  gap: 0;
}
.context-title strong { font-size: 14px; }
.context-title small, .muted, .meta, .field-hint { color: var(--muted); }
.context-title small, .meta, .field-hint { font-size: 12px; }
.toolbar-controls { display: flex; flex-wrap: wrap; column-gap: 13px; row-gap: 7px; align-items: center; min-width: 0; }
.toolbar-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 625; white-space: nowrap; min-width: 0; }
.toolbar-label select { width: auto; max-width: min(28vw, 310px); min-height: 35px; font-size: 13px; }
.toolbar-label select#company-select { max-width: 225px; }
.toolbar-label select#run-select { max-width: 210px; }

main { max-width: 1520px; padding: 26px clamp(18px, 3vw, 46px) 45px; margin: 0 auto; }
main:focus { outline: none; }
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 19px;
  margin-bottom: 18px;
}
.page-header h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 735; letter-spacing: -.035em; line-height: 1.22; }
.page-header .page-sub { margin-top: 5px; }
.page-sub { color: var(--muted); font-size: 13px; }
.page-header .actions { justify-content: flex-end; }
.page-header h1:focus { outline: none; }
h2 { font-size: 18px; line-height: 1.38; letter-spacing: -.015em; font-weight: 700; }
h3 { font-size: 15px; line-height: 1.45; font-weight: 700; }
h4 { font-size: 13px; line-height: 1.45; font-weight: 690; }

.section, .card, .metric, .focus-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.section { padding: 18px; }
.card { padding: 15px; }
.section-head, .item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 13px;
}
.section-head { margin-bottom: 12px; }
.section-head p { margin-top: 3px; }
.item-head > div:first-child { min-width: 0; }
.item-body { margin-top: 8px; overflow-wrap: anywhere; }
.stack { display: grid; gap: 14px; min-width: 0; }
.compact-stack { display: grid; gap: 8px; min-width: 0; }
.columns { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.overview-columns { grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); }
.evidence-columns { grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); }

.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.btn, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  vertical-align: middle;
  min-height: 37px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid #d7e1d9;
  background: #fff;
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 640;
  white-space: normal;
  line-height: 1.3;
}
.btn:hover, .icon-button:hover { background: #edf4ee; border-color: #9db9a9; color: var(--green-dark); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn.subtle { border-color: transparent; background: transparent; padding-inline: 5px; }
.btn.subtle:hover { border-color: transparent; background: #edf4ee; }
.btn.small { padding: 6px 9px; min-height: 33px; font-size: 12px; }
.btn:disabled { opacity: .62; background: #f0f2ee; border-color: #d9dfd9; color: var(--muted); }
.btn.primary:disabled { background: #dce7df; border-color: #dce7df; color: #415d4b; }
.icon-button { width: 36px; min-height: 36px; padding: 0; font-size: 21px; }
.action-arrow { display: inline-block; font-size: 16px; line-height: 1; }
.return-link { text-decoration: none; }
.return-link:hover { text-decoration: underline; }

.pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 5px;
  background: #eef1ed;
  color: #46584b;
  font-size: 12px;
  font-weight: 640;
  overflow-wrap: anywhere;
}
.pill.good { background: var(--green-soft); color: #24543e; }
.pill.warning { background: var(--amber-soft); color: var(--amber); }
.pill.risk { background: var(--red-soft); color: var(--red); }
.pill.dark { background: #335747; color: #e8f6ec; }
.tags, .meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; min-width: 0; }
.meta-row { color: var(--muted); font-size: 12px; }
.meta-row > * + *::before { content: "·"; margin-right: 8px; color: #84918a; }
.meta-row > * { min-width: 0; overflow-wrap: anywhere; }
.meta-row a { text-underline-offset: 2px; }
.data-number { font-variant-numeric: tabular-nums; }
.status-msg, .placeholder {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}
.status-msg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; }
.status-msg.error { background: var(--red-soft); color: #81322b; border-color: #edccc7; }
.status-msg.notice { background: var(--amber-soft); color: var(--amber); border-color: #edddc6; }
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 100px;
  text-align: center;
}
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid #d3e4d7;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.focus-card { padding: 19px 22px 17px; background: #eaf1e8; border-color: #d9e5da; }
.focus-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.focus-overline { color: #315f4e; font-size: 12px; font-weight: 690; letter-spacing: .045em; }
.focus-card h2 { font-size: clamp(20px, 2.3vw, 25px); margin-top: 4px; }
.focus-card .summary { margin-top: 5px; color: #42574c; max-width: 85ch; overflow-wrap: anywhere; }
.focus-card .tags { margin-top: 8px; }
.focus-top .actions { justify-content: flex-end; flex-shrink: 0; }
.checkpoints {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 13px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid #d0dfd2;
  gap: 0;
}
.checkpoint {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 0 8px 0 0;
  line-height: 1.35;
  font-size: 13px;
}
.checkpoint + .checkpoint { padding-left: 11px; border-left: 1px solid #d0dfd2; }
.checkpoint small { display: block; margin-top: 3px; color: #50675a; font-size: 11px; }
.checkpoint-icon {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border: 1px solid #b7c9bb;
  border-radius: 50%;
  background: #f7faf6;
  color: #405b4d;
  font-size: 11px;
}
.checkpoint.complete .checkpoint-icon { background: #cde2d2; color: #284d3e; border-color: #bbd3c0; }
.checkpoint.followup .checkpoint-icon { background: #f3e6d0; color: var(--amber); border-color: #e6d6b9; }
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}
.metric {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px 13px;
}
.metric .metric-label { color: var(--muted); font-weight: 610; font-size: 12px; }
.metric .metric-value { font-size: 24px; font-weight: 720; line-height: 1.22; letter-spacing: -.02em; color: var(--ink); }
.metric .metric-note { color: var(--muted); font-size: 11px; }
.metric .metric-value small { color: var(--muted); font-size: 12px; font-weight: 565; margin-left: 3px; }
.overview-columns .section { height: 100%; }
.case-list { display: grid; gap: 7px; }
.case-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
  align-items: center;
  width: 100%;
  min-height: 57px;
  padding: 8px 11px;
  text-align: left;
  background: #f8faf7;
  border: 1px solid #e8ede6;
  border-radius: 8px;
  color: var(--ink);
}
.case-choice:hover { border-color: #a0beaa; }
.case-choice[aria-current="true"] { background: #eaf3ec; border-color: #a9c8b1; box-shadow: inset 3px 0 #4e8768; }
.case-choice strong { overflow-wrap: anywhere; }
.case-choice .case-date { display: block; margin-top: 3px; }
.case-choice .case-status { display: grid; justify-items: end; gap: 3px; }
.review-question {
  margin: 0 0 10px;
  padding: 10px 11px;
  border-radius: 7px;
  background: #f2f6f0;
}
.review-question h3 { margin-bottom: 3px; color: #355647; font-size: 12px; }
.list-rows { display: grid; gap: 0; list-style: none; padding: 0; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.list-row a { text-underline-offset: 3px; overflow-wrap: anywhere; }
.list-row .pill { flex-shrink: 0; text-align: center; }
.list-row .meta { display: block; margin-top: 2px; }
.section-foot { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-top: 8px; gap: 7px; }

.filter-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.filter-controls .field { min-width: min(100%, 155px); }
.filter-controls .field:first-child { flex: 1; }
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  overflow: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--border);
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 655;
  white-space: nowrap;
}
.tab:hover { color: var(--green-dark); background: #f3f7f4; }
.tab[aria-pressed="true"] { color: var(--green-dark); border-bottom-color: var(--green); }
.tab:focus-visible { outline-offset: -4px; }
.segmented {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  width: fit-content;
  padding: 3px;
  background: #edf1ed;
  border: 1px solid #e3eae4;
  border-radius: 8px;
}
.segmented .tab { border: 1px solid transparent; border-radius: 5px; padding: 5px 11px; }
.segmented .tab[aria-pressed="true"] { background: #fff; border: 1px solid #dce5db; box-shadow: var(--shadow); }

.signal-list { list-style: none; margin: 0; padding: 0; }
.signal {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.signal:last-child { border-bottom: 0; padding-bottom: 0; }
.signal .item-head { align-items: center; }
.signal .meta-row { margin-top: 2px; }
.quote {
  margin: 9px 0 0;
  border-left: 3px solid #afc7b6;
  padding: 6px 10px;
  background: #f4f7f3;
  color: #324d3f;
  border-radius: 0 6px 6px 0;
  overflow-wrap: anywhere;
}
.evidence-card { scroll-margin-top: 16px; }
.evidence-card .meta-row { margin-top: 5px; }
.evidence-card .source-action { margin-top: 8px; }
.evidence-card.pending { border-style: dashed; background: #fcfdfb; }
.reference-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 9px; margin-top: 7px; font-size: 12px; }
.reference-list a { text-underline-offset: 2px; }
.reference-list .reference-empty { color: var(--muted); }
.analysis-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; align-items: end; }
.analysis-box .analysis-result { margin-top: 12px; padding-top: 13px; border-top: 1px solid var(--border); }
.analysis-result h3 { margin-top: 7px; margin-bottom: 3px; }
.analysis-result .analysis-summary, .qa-content, .pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.analysis-questions { list-style: none; padding: 0; display: grid; gap: 5px; }
.analysis-questions li { display: flex; align-items: center; flex-wrap: wrap; column-gap: 7px; }
.citation-items { padding-inline-start: 1.4em; margin: 5px 0 0; }
.citation-items li + li { margin-top: 5px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 13px; }
.form-grid .full { grid-column: 1 / -1; }
.field { min-width: 0; display: grid; gap: 4px; font-size: 13px; color: var(--ink); }
.field > label { font-weight: 650; }
input:not([type="checkbox"], [type="radio"]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid #cbd8cf;
  color: var(--ink);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: #66756c; }
input[type="date"] { min-height: 38px; }
textarea { resize: vertical; min-height: 84px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; flex: 0 0 16px; margin: 2px 0 0; accent-color: var(--green); }
.check-field { display: flex; align-items: flex-start; gap: 7px; cursor: pointer; }
.check-field strong { font-size: 13px; }
.check-field .field-hint { display: block; }
fieldset { margin: 0; padding: 9px 10px 10px; min-width: 0; border: 1px solid var(--border); border-radius: 8px; }
legend { padding: 0 4px; font-size: 13px; font-weight: 675; }
.checklist { display: grid; gap: 7px; }
.inline-error:empty { display: none; }
.inline-error { color: var(--red); font-weight: 630; font-size: 13px; overflow-wrap: anywhere; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 7px; }

.timeline { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.timeline li {
  display: grid;
  grid-template-columns: minmax(0, 145px) minmax(0, 1fr);
  gap: 7px 11px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.task-grid { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-resolution { margin-top: 7px; padding: 8px 9px; background: #f2f6f1; border-radius: 6px; }
.qa-content { padding: 9px 10px; border-radius: 7px; background: #f5f7f3; }
.settings-group { margin-top: 12px; }
.settings-group:first-child { margin-top: 0; }
.settings-group h3 { margin-bottom: 7px; }
.object-grid { display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.object-tile { padding: 7px 8px; border: 1px solid var(--border); border-radius: 7px; background: #fbfcfa; }
.object-tile:has(input:checked) { border-color: #c3d8c9; background: #f2f7f1; }
.object-tile span { min-width: 0; overflow-wrap: anywhere; }
.setting-section-intro { min-width: 0; overflow-wrap: anywhere; }
.catalog-table { min-width: 0; display: grid; gap: 0; }
.catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 7px 15px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.catalog-row .actions { justify-content: flex-end; }
.catalog-row h3 { font-size: 14px; }
.catalog-row summary { width: fit-content; cursor: pointer; margin-top: 4px; color: var(--green-dark); }
.catalog-row details p { margin-top: 3px; }
.report {
  padding: clamp(14px, 3vw, 26px);
  max-width: 950px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.report h2 { font-size: 22px; }
.report h2, .report h3, .report h4 { margin-top: 14px; }
.report h2:first-child, .report h3:first-child { margin-top: 0; }
.report p, .report ol, .report ul { margin-top: 5px; }
.report ul, .report ol { padding-left: 1.4em; }
.report pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.report hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

.dialog {
  width: min(660px, calc(100vw - 24px));
  max-width: 100%;
  max-height: min(88vh, 840px);
  max-height: min(88dvh, 840px);
  padding: 0;
  border: 1px solid #cad9ce;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(13, 38, 23, .25);
}
.dialog::backdrop { background: rgba(15, 33, 26, .48); }
.dialog-header {
  z-index: 1;
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 17px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.dialog-body { padding: 16px 17px 18px; }
.toast {
  position: fixed;
  z-index: 11;
  right: 18px;
  bottom: 18px;
  max-width: min(91vw, 510px);
  padding: 10px 14px;
  border: 1px solid #496451;
  border-radius: 8px;
  box-shadow: 0 3px 18px rgba(22, 38, 28, .16);
  background: var(--rail);
  color: #fff;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.toast:empty { display: none; }
.toast.error { background: #73332c; border-color: #73332c; }

@media (max-width: 1150px) {
  .app-shell { grid-template-columns: 189px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .workspace-header { padding-inline: 19px; }
  main { padding-inline: 19px; }
  .toolbar-label select { max-width: min(28vw, 250px); }
  .toolbar-label select#run-select { max-width: 170px; }
  .object-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 940px) {
  .workspace-header { align-items: flex-start; }
  .toolbar-label select { max-width: min(41vw, 270px); }
  .focus-top { flex-wrap: wrap; gap: 9px; }
  .focus-top .actions { justify-content: flex-start; flex-shrink: 1; }
  .columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    padding: 10px 12px 8px;
    overflow: visible;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 9px;
  }
  .brand { width: min(100%, 178px); margin: 0; }
  .model-indicator { grid-row: 1; grid-column: 2; margin: 0; padding: 1px 0; border: 0; align-self: center; }
  .model-row { gap: 5px; font-size: 11px; }
  .model-name, .model-indicator details { display: none; }
  .main-nav {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
  }
  .nav-link { gap: 4px; min-height: 35px; padding: 5px 7px; font-size: 12px; }
  .nav-link[data-page="settings"] { margin-top: 0; }
  .nav-icon { width: 15px; height: 15px; font-size: 14px; }
  .nav-link:focus-visible { outline-offset: -2px; }
  .workspace-header { gap: 4px 10px; padding: 8px 12px; min-height: auto; }
  .context-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; min-width: 0; }
  .toolbar-controls { width: 100%; column-gap: 8px; }
  .toolbar-label select { max-width: min(65vw, 270px); }
  .toolbar-label select#company-select { max-width: min(50vw, 225px); }
  main { padding: 17px 12px 32px; }
  .page-header { align-items: flex-start; margin-bottom: 12px; }
  .page-header .actions { justify-content: flex-start; }
  .focus-card { padding: 14px 13px; }
  .section { padding: 13px; }
  .card { padding: 11px; }
  .stack, .columns { gap: 10px; }
  .metrics { gap: 7px; }
  .metric { padding: 9px; }
  .metric .metric-value { font-size: 21px; }
  .catalog-row { grid-template-columns: minmax(0, 1fr) auto; }
  .catalog-row > .catalog-description { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 490px) {
  .page-header { flex-wrap: wrap; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checkpoints { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 0; }
  .checkpoint:nth-child(3) { padding-left: 0; border-left: 0; }
  .toolbar-controls { align-items: start; }
  .toolbar-label { width: 100%; }
  .toolbar-label select, .toolbar-label select#company-select, .toolbar-label select#run-select { flex: 1; max-width: none; }
  .analysis-form, .form-grid, .task-grid { grid-template-columns: minmax(0, 1fr); }
  .analysis-form .btn { justify-self: start; }
  .object-grid { grid-template-columns: minmax(0, 1fr); }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

.case-progress {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.case-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.case-context .tags { margin: 0; }
.case-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  list-style: none;
  padding: 0;
}
.case-flow a {
  display: grid;
  align-content: center;
  gap: 2px;
  height: 100%;
  min-height: 53px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--canvas, #f4f6fb);
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.case-flow a:hover, .case-flow .current a {
  border-color: var(--accent-border, #dce2fa);
  background: var(--green-soft);
}
.case-flow strong { font-size: 13px; }
.case-flow small { color: var(--muted); font-size: 11px; }
.analysis-empty {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  color: var(--muted);
  margin-top: 7px;
}
.analysis-history { margin-top: 12px; color: var(--muted); }
.analysis-history summary, .source-details summary { cursor: pointer; color: var(--green-dark); }
.analysis-history .card { margin-top: 6px; }
.linked-signal {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.linked-signal:last-child { border-bottom: 0; }
.linked-signal a { overflow-wrap: anywhere; }
.source-metrics .metric { box-shadow: none; }
.source-list { display: grid; gap: 7px; }
.source-card { padding: 12px 13px; overflow-wrap: anywhere; box-shadow: none; }
.source-card h3 { font-size: 14px; }
.source-card .section-foot { margin-top: 8px; }
.source-details { margin-block: 6px; }
.source-details > p { margin-top: 5px; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.monitor-plan { min-width: 0; overflow-wrap: anywhere; }
.plan-sources { display: grid; gap: 8px; margin-top: 10px; }
.plan-sources strong { color: var(--muted); font-size: 12px; }
.plan-source-links { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.plan-source-links .btn { white-space: normal; text-align: left; }
.plan-action {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  background: var(--canvas, #f4f6fb);
}
#plan-results, #account-results { margin-top: 12px; }

@media (max-width: 760px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .case-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case-flow a { padding: 6px 8px; }
  .source-card .actions { gap: 4px; }
}
@media (max-width: 420px) {
  .case-flow a { padding: 5px 6px; }
  .case-flow strong { font-size: 12px; }
  .case-flow small { font-size: 10px; }
  .source-card .section-foot { flex-wrap: wrap; }
}
