:root {
  --ink: #17191d;
  --muted: #676c75;
  --line: #d9dce1;
  --line-strong: #b8bdc6;
  --surface: #ffffff;
  --surface-soft: #f5f6f7;
  --surface-warm: #fbf8f3;
  --charcoal: #202329;
  --danger: #b42318;
  --danger-dark: #8f1810;
  --danger-soft: #fbe9e7;
  --amber: #a15c00;
  --amber-soft: #fff1d6;
  --green: #13735b;
  --green-soft: #e4f4ef;
  --focus: #2563a6;
  --shadow: 0 8px 24px rgba(23, 25, 29, 0.08);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body {
  overflow: hidden;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 3px solid rgba(37, 99, 166, 0.28);
  outline-offset: 1px;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.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;
}

.app-shell {
  display: grid;
  grid-template-rows: 64px 72px minmax(0, 1fr);
  height: 100vh;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(320px, 1.5fr) minmax(240px, 0.8fr);
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  border-bottom: 1px solid #353940;
  background: var(--charcoal);
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.brand-mark {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #777d87;
  border-radius: 6px;
  background: #f3f4f6;
  color: #1a1d22;
  font-size: 17px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: #bfc4cc;
  font-size: 11px;
}

.global-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  height: 38px;
}

.global-search input {
  min-width: 0;
  border: 1px solid #4a4f58;
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #2b2f36;
  color: #ffffff;
  padding: 0 13px;
}

.global-search input::placeholder {
  color: #aeb4bd;
}

.global-search button {
  min-width: 76px;
  border: 1px solid #6c727d;
  border-radius: 0 6px 6px 0;
  background: #f1f2f4;
  color: #202329;
  font-size: 13px;
  font-weight: 700;
}

.global-search button:hover {
  background: #ffffff;
}

.system-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px;
  color: #d8dbe0;
  font-size: 12px;
}

.status-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5cc59f;
  box-shadow: 0 0 0 3px rgba(92, 197, 159, 0.15);
}

.status-dot.is-offline {
  background: #e36a5d;
  box-shadow: 0 0 0 3px rgba(227, 106, 93, 0.15);
}

.environment-badge {
  flex: 0 0 auto;
  margin-left: 6px;
  border: 1px solid #555b64;
  border-radius: 4px;
  padding: 4px 7px;
  color: #d7dae0;
  font-size: 10px;
  text-transform: uppercase;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) minmax(170px, 1.3fr);
  align-items: stretch;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 10px 24px;
  border-right: 1px solid var(--line);
}

.metric:first-child {
  padding-left: 0;
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong {
  margin-top: 5px;
  overflow: hidden;
  font-size: 20px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-context strong {
  color: var(--green);
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 0;
}

.alert-panel,
.case-panel {
  min-height: 0;
  background: var(--surface);
}

.alert-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line-strong);
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.queue-heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.online-entry {
  min-height: 30px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: #ffffff;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 700;
}

.online-entry:hover {
  background: #34383f;
}

.panel-heading {
  padding: 18px 18px 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.25;
}

.text-button,
.copy-button {
  border: 0;
  background: transparent;
  color: var(--focus);
  font-size: 12px;
  font-weight: 700;
}

.queue-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.queue-controls select {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 0 8px;
  font-size: 12px;
}

.alert-list {
  min-height: 0;
  overflow: auto;
}

.alert-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  min-height: 92px;
  padding: 14px 14px 13px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid transparent;
  background: var(--surface);
  text-align: left;
}

.alert-item:hover {
  background: var(--surface-soft);
}

.alert-item.is-active {
  border-left-color: var(--danger);
  background: #fff8f7;
}

.alert-rank {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.alert-copy {
  min-width: 0;
}

.alert-copy strong,
.alert-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-copy strong {
  margin-top: 1px;
  font-size: 13px;
}

.alert-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.alert-score {
  min-width: 47px;
  text-align: right;
}

.alert-score strong,
.alert-score span {
  display: block;
}

.alert-score strong {
  font-size: 15px;
}

.alert-score span {
  margin-top: 6px;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.severity-critical,
.severity-high {
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.severity-medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.severity-low {
  background: var(--green-soft);
  color: var(--green);
}

.list-loading,
.list-empty,
.case-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  min-height: 160px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.list-loading {
  height: 100%;
}

.case-panel {
  min-width: 0;
  overflow: auto;
}

.case-empty {
  height: 100%;
}

.case-empty strong {
  color: var(--ink);
  font-size: 16px;
}

.case-content {
  min-height: 100%;
}

.case-header {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  min-height: 122px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-warm);
}

.title-line,
.case-metadata,
.risk-verdict,
.case-actions {
  display: flex;
  align-items: center;
}

.title-line {
  min-width: 0;
  gap: 7px;
}

.copy-button {
  flex: 0 0 auto;
}

.case-metadata {
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.case-metadata span {
  overflow-wrap: anywhere;
}

.risk-verdict {
  gap: 14px;
  min-width: 220px;
}

.score-ring {
  --score-angle: 0deg;
  display: grid;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  place-content: center;
  border: 7px solid #e3e5e8;
  border-top-color: var(--danger);
  border-right-color: var(--danger);
  border-radius: 50%;
  background: var(--surface);
  text-align: center;
}

.score-ring strong {
  font-size: 18px;
  line-height: 1;
}

.score-ring span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.decision-badge {
  display: inline-block;
  border-radius: 4px;
  padding: 5px 8px;
  background: var(--danger-soft);
  color: var(--danger-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.decision-badge.decision-review {
  background: var(--amber-soft);
  color: var(--amber);
}

.decision-badge.decision-allow {
  background: var(--green-soft);
  color: var(--green);
}

.risk-verdict p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.case-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 210px;
}

.secondary-button,
.danger-button,
.fit-button,
.icon-button {
  min-height: 32px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}

.secondary-button,
.fit-button,
.icon-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.secondary-button {
  padding: 0 10px;
}

.secondary-button:hover,
.fit-button:hover,
.icon-button:hover {
  background: var(--surface-soft);
}

.danger-button {
  border: 1px solid var(--danger-dark);
  background: var(--danger);
  color: #ffffff;
  padding: 0 12px;
}

.danger-button:hover {
  background: var(--danger-dark);
}

.case-body {
  display: grid;
  grid-template-columns: minmax(520px, 1.55fr) minmax(300px, 0.75fr);
  min-height: 620px;
}

.evidence-area {
  min-width: 0;
  border-right: 1px solid var(--line-strong);
}

.evidence-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
}

.tabs,
.graph-controls,
.segmented-control {
  display: flex;
  align-items: center;
}

.tabs {
  align-self: stretch;
  gap: 18px;
}

.tab {
  align-self: stretch;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 2px;
  font-size: 12px;
  font-weight: 700;
}

.tab.is-active {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.graph-controls {
  gap: 6px;
}

.segmented-control {
  margin-right: 4px;
}

.segmented-control button {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  background: var(--surface);
  padding: 0 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.segmented-control button:first-child {
  border-radius: 5px 0 0 5px;
}

.segmented-control button:last-child {
  border-right: 1px solid var(--line-strong);
  border-radius: 0 5px 5px 0;
}

.segmented-control button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.icon-button {
  width: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.fit-button {
  min-width: 42px;
  padding: 0 8px;
}

.graph-view {
  position: relative;
  height: min(61vh, 610px);
  min-height: 430px;
  background: #fafafa;
  overflow: hidden;
}

#risk-graph {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#risk-graph.is-dragging {
  cursor: grabbing;
}

.graph-tooltip {
  position: absolute;
  z-index: 3;
  max-width: 210px;
  pointer-events: none;
  border: 1px solid #3f444c;
  border-radius: 5px;
  background: rgba(32, 35, 41, 0.96);
  color: #ffffff;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  font-size: 10px;
  line-height: 1.5;
}

.graph-tooltip strong,
.graph-tooltip span {
  display: block;
}

.graph-tooltip span {
  color: #d8dbe0;
}

.graph-legend {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 9px;
}

.graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.graph-legend span:last-child {
  margin-left: auto;
}

.legend-node {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8b929c;
}

.legend-node.selected {
  background: var(--ink);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--ink);
}

.legend-node.high {
  background: var(--danger);
}

.legend-node.normal {
  background: var(--green);
}

.timeline-view {
  min-height: 520px;
  padding: 20px 24px 28px;
  background: var(--surface);
}

.timeline-view ol {
  position: relative;
  max-width: 760px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-view ol::before {
  position: absolute;
  top: 9px;
  bottom: 10px;
  left: 68px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 50px 18px minmax(0, 1fr);
  gap: 10px;
  min-height: 74px;
}

.timeline-step {
  padding-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.timeline-dot {
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 1px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.timeline-item.is-subject .timeline-dot {
  background: var(--danger);
}

.timeline-copy strong {
  display: block;
  font-size: 12px;
}

.timeline-copy span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.detail-rail {
  min-width: 0;
  background: var(--surface);
}

.detail-section {
  padding: 19px 20px 22px;
  border-bottom: 1px solid var(--line-strong);
}

.section-heading > span {
  max-width: 130px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.factor-list {
  margin-top: 17px;
}

.factor-item + .factor-item {
  margin-top: 17px;
}

.factor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.factor-head strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.factor-head span {
  color: var(--muted);
  font-size: 10px;
}

.factor-track {
  height: 5px;
  margin-top: 7px;
  border-radius: 3px;
  background: #e8eaed;
  overflow: hidden;
}

.factor-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.factor-item.is-strong .factor-fill {
  background: var(--danger);
}

.factor-item.is-limited .factor-fill {
  background: var(--green);
}

.factor-item.is-lowering .factor-fill {
  background: var(--green);
}

.factor-item.is-context .factor-fill {
  background: var(--amber);
}

.factor-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.explanation-boundary {
  margin: 16px 0 0;
  border-left: 2px solid var(--line-strong);
  padding-left: 9px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.neighbor-section {
  border-bottom: 0;
}

.neighbor-list {
  margin: 14px -20px -22px;
}

.neighbor-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  min-height: 67px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 11px 20px;
  text-align: left;
}

.neighbor-item:hover {
  background: var(--surface-soft);
}

.neighbor-main,
.neighbor-score {
  min-width: 0;
}

.neighbor-main strong,
.neighbor-main span,
.neighbor-score strong,
.neighbor-score span {
  display: block;
}

.neighbor-main strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.neighbor-main span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.neighbor-score {
  text-align: right;
}

.neighbor-score strong {
  font-size: 12px;
}

.neighbor-score span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  border-radius: 6px;
  background: var(--charcoal);
  color: #ffffff;
  padding: 11px 14px;
  box-shadow: var(--shadow);
  font-size: 12px;
}

.online-modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(23, 25, 29, 0.58);
  padding: 22px;
  overflow: auto;
}

.online-dialog {
  width: min(900px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(23, 25, 29, 0.22);
}

.online-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-warm);
}

.online-dialog-header h2 {
  font-size: 20px;
}

.online-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.online-boundary {
  margin: 8px 0 0;
  color: #7b4d00;
  font-size: 11px;
  font-weight: 700;
}

.online-close {
  flex: 0 0 32px;
  font-size: 15px;
  text-transform: lowercase;
}

.online-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-strong);
}

.online-form label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.online-form label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.online-form input,
.online-form select,
.online-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 8px 9px;
  font-size: 12px;
}

.online-form input,
.online-form select {
  height: 34px;
}

.online-form textarea {
  min-height: 84px;
  resize: vertical;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.online-features-field {
  grid-column: 1 / -1;
}

.online-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.online-status-line {
  min-height: 35px;
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
  color: var(--muted);
  font-size: 10px;
}

.online-status-line.is-error {
  color: var(--danger-dark);
}

.online-result {
  padding: 20px 24px 22px;
  border-bottom: 1px solid var(--line-strong);
}

.online-result-head,
.online-replay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.online-result-head h3 {
  overflow-wrap: anywhere;
}

.online-result-verdict {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.online-result-verdict > strong {
  font-size: 25px;
}

.online-result-verdict small {
  color: var(--muted);
  font-size: 10px;
}

.online-result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 26px;
  margin-top: 20px;
}

.online-result-grid section {
  min-width: 0;
}

.online-reasons,
.online-context-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 28px;
  margin-top: 9px;
}

.online-reason {
  border: 1px solid #e7c6c1;
  border-radius: 4px;
  background: var(--danger-soft);
  color: var(--danger-dark);
  padding: 5px 7px;
  font-size: 10px;
  font-weight: 700;
}

.online-context-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.online-context-stat {
  border-top: 2px solid var(--line-strong);
  padding-top: 5px;
}

.online-context-stat strong,
.online-context-stat span {
  display: block;
}

.online-context-stat strong {
  font-size: 15px;
}

.online-context-stat span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.online-context-link {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
  color: var(--focus);
  font-size: 10px;
}

.online-replay {
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 18px 24px 20px;
}

.online-replay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.replay-summary {
  flex: 1 1 100%;
  min-height: 26px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 210px minmax(280px, 1fr) auto;
    gap: 16px;
  }

  .system-status #system-status-text {
    display: none;
  }

  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .case-header {
    grid-template-columns: minmax(230px, 1fr) auto;
    gap: 16px;
  }

  .case-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    max-width: none;
  }

  .case-body {
    grid-template-columns: minmax(430px, 1.3fr) minmax(270px, 0.7fr);
  }

  .online-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 116px;
    padding: 12px 16px;
  }

  .global-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .environment-badge {
    margin-left: 0;
  }

  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
  }

  .metric {
    min-height: 68px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
  }

  .metric:first-child {
    padding-left: 16px;
  }

  .metric:nth-child(2n) {
    border-right: 0;
  }

  .metric-context {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .workspace {
    display: block;
  }

  .alert-panel {
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .alert-list {
    display: flex;
    min-height: 104px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .alert-item {
    flex: 0 0 286px;
    border-right: 1px solid var(--line);
    border-left: 0;
    border-bottom: 4px solid transparent;
  }

  .alert-item.is-active {
    border-bottom-color: var(--danger);
  }

  .case-panel {
    overflow: visible;
  }

  .case-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 18px 16px;
  }

  .case-body {
    display: block;
    min-height: 0;
  }

  .evidence-area {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .graph-view {
    height: 480px;
    min-height: 420px;
  }

  .detail-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-section {
    border-right: 1px solid var(--line-strong);
    border-bottom: 0;
  }

  .detail-section:last-child {
    border-right: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .brand small,
  .system-status .status-dot {
    display: none;
  }

  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric strong {
    font-size: 18px;
  }

  .panel-heading {
    padding-top: 15px;
  }

  .queue-heading-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .online-entry {
    min-height: 28px;
    padding: 0 7px;
  }

  .queue-controls {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .queue-controls > span {
    display: none;
  }

  .case-header {
    display: block;
  }

  .risk-verdict {
    margin-top: 18px;
  }

  .case-actions {
    margin-top: 16px;
  }

  .evidence-toolbar {
    display: block;
    padding-bottom: 10px;
  }

  .tabs {
    height: 38px;
  }

  .graph-controls {
    justify-content: space-between;
    margin-top: 8px;
  }

  .graph-view {
    height: 430px;
    min-height: 430px;
  }

  .graph-legend span:last-child {
    width: 100%;
    margin-left: 0;
  }

  .timeline-view {
    min-height: 430px;
    padding: 18px 14px;
  }

  .detail-rail {
    display: block;
  }

  .detail-section {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .detail-section:last-child {
    border-bottom: 0;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }

  .online-modal {
    align-items: start;
    padding: 10px;
  }

  .online-dialog {
    max-height: calc(100vh - 20px);
  }

  .online-dialog-header,
  .online-form,
  .online-result,
  .online-replay {
    padding-left: 15px;
    padding-right: 15px;
  }

  .online-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .online-result-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .online-result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .online-result-verdict {
    justify-content: flex-start;
  }
}

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