:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --line: #dde2e7;
  --line-strong: #cbd2d9;
  --text: #17212b;
  --muted: #66727f;
  --faint: #8a95a1;
  --blue: #265d97;
  --blue-soft: #eaf1f8;
  --green: #257451;
  --green-soft: #e9f5ef;
  --amber: #9a6817;
  --amber-soft: #fbf2df;
  --red: #a43c3c;
  --red-soft: #fbecec;
  --sidebar: #18232e;
  --sidebar-muted: #9ba8b4;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

body {
  min-width: 320px;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 228px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: var(--sidebar);
  color: #edf2f6;
  border-right: 1px solid #0f1821;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 24px;
  border-bottom: 1px solid #2a3743;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #6f8497;
  border-radius: 7px;
  font: 700 13px var(--mono);
  letter-spacing: 0.06em;
}

.brand strong,
.brand small,
.environment strong,
.environment small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}

.brand small {
  color: var(--sidebar-muted);
  font-size: 11px;
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 22px;
}

.nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  color: #cbd4dc;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
}

.nav a:hover:not(.disabled) {
  background: #22313e;
}

.nav a.active {
  color: #ffffff;
  background: #263746;
  border-color: #34495a;
}

.nav a.disabled {
  cursor: default;
  opacity: 0.54;
}

.nav a small {
  margin-left: auto;
  color: var(--sidebar-muted);
  font-size: 10px;
}

.nav-icon {
  color: #8294a4;
  font: 600 10px var(--mono);
}

.nav-divider {
  height: 1px;
  margin: 13px 8px;
  background: #2a3743;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #2a3743;
  padding: 18px 8px 0;
}

.environment,
.system-state {
  display: flex;
  align-items: center;
  gap: 9px;
}

.environment strong {
  font: 600 11px var(--mono);
  letter-spacing: 0.08em;
}

.environment small {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4bb886;
}

.workspace {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 3px 0 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0;
  color: var(--faint);
  font: 600 10px var(--mono);
  letter-spacing: 0.12em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.system-state {
  color: var(--muted);
  font-size: 12px;
}

.content {
  padding: 28px 32px 48px;
}

.button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.button.primary {
  color: #fff;
  background: var(--blue);
  border-color: #1e4e80;
}

.button.primary:hover {
  background: #204f81;
}

.button.secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button.secondary.danger-button,
.text-button.danger {
  color: var(--red);
}

.button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.loading-state,
.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.metric-card {
  padding: 18px 19px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  display: block;
  margin-top: 12px;
  font: 650 28px var(--mono);
  letter-spacing: -0.04em;
}

.metric-foot {
  display: block;
  margin-top: 8px;
  color: var(--faint);
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.panel-head {
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.text-link {
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

.text-button {
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  padding: 10px 16px;
  color: var(--faint);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf0f2;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fafbfd;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.contract-cell strong,
.contract-cell small {
  display: block;
}

.contract-cell strong {
  font-size: 12px;
  font-weight: 650;
}

.contract-cell small,
.mono-muted {
  margin-top: 4px;
  color: var(--faint);
  font: 10px var(--mono);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.badge.running,
.badge.pending {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #c6d9eb;
}

.badge.finished,
.badge.succeeded {
  color: var(--green);
  background: var(--green-soft);
  border-color: #c9e5d7;
}

.badge.failed {
  color: var(--red);
  background: var(--red-soft);
  border-color: #efcaca;
}

.badge.partial,
.badge.skipped {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #ecd9af;
}

.badge.neutral {
  color: var(--muted);
  background: #f0f2f4;
  border-color: var(--line);
}

.progress {
  width: 104px;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  background: #e6eaee;
  border-radius: 5px;
}

.progress-fill {
  height: 100%;
  background: var(--blue);
  transition: width 220ms ease;
}

.progress-label {
  display: block;
  margin-top: 5px;
  color: var(--faint);
  font: 10px var(--mono);
}

.mode-list {
  padding: 7px 18px 14px;
}

.mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  border-bottom: 1px solid #edf0f2;
}

.mode-row:last-child {
  border-bottom: 0;
}

.mode-row strong,
.mode-row small {
  display: block;
}

.mode-row strong {
  font-size: 12px;
}

.mode-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.page-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.filter-group {
  display: flex;
  gap: 7px;
}

.filter-button {
  min-height: 31px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
}

.filter-button.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #bfd3e7;
}

.task-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 19px 20px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.task-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.task-title-line h2 {
  margin: 0;
  font-size: 18px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.task-meta code {
  color: var(--text);
  font: 10px var(--mono);
}

.task-progress {
  width: 220px;
  align-self: center;
}

.task-progress .button {
  margin-top: 12px;
  width: 100%;
}

.task-progress-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.source-panel {
  margin-bottom: 16px;
}

.audit-log-panel {
  margin-bottom: 16px;
}

.audit-log-head {
  align-items: center;
}

.audit-log-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audit-toggle {
  min-height: 28px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
}

.audit-toggle:hover {
  color: var(--blue);
  border-color: #9ebbd5;
}

.audit-log-panel.collapsed .panel-head {
  border-bottom: 0;
}

.status-dot.stopped {
  background: var(--faint);
}

.audit-log-table {
  min-width: 0;
}

.audit-log-columns,
.audit-log-entry {
  display: grid;
  grid-template-columns: 54px 178px 112px 112px 86px minmax(260px, 1fr);
  gap: 12px;
  align-items: start;
}

.audit-log-columns {
  padding: 9px 16px;
  color: var(--faint);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line);
  font: 600 9px var(--mono);
  letter-spacing: 0.04em;
}

.audit-log-stream {
  min-height: 180px;
  max-height: 460px;
  overflow: auto;
}

.audit-log-entry {
  position: relative;
  padding: 11px 16px;
  border-bottom: 1px solid #eef1f3;
  font-size: 10px;
}

.audit-log-entry:last-child {
  border-bottom: 0;
}

.audit-log-entry::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--blue);
  content: "";
}

.audit-log-entry.level-success::before {
  background: var(--green);
}

.audit-log-entry.level-warning::before {
  background: var(--amber);
}

.audit-log-entry.level-error::before {
  background: var(--red);
}

.audit-sequence,
.audit-time,
.audit-agent,
.audit-event,
.audit-status {
  line-height: 1.55;
}

.audit-sequence,
.audit-time {
  color: var(--faint);
  font-family: var(--mono);
}

.audit-agent {
  color: var(--text);
  font-weight: 650;
}

.audit-event {
  color: var(--blue);
  font: 600 9px/1.7 var(--mono);
}

.audit-status {
  color: var(--muted);
}

.audit-message {
  min-width: 0;
  line-height: 1.55;
}

.audit-message strong,
.audit-message small {
  display: block;
}

.audit-message strong {
  font-size: 11px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.audit-message small {
  margin-top: 4px;
  color: var(--faint);
  font: 9px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

.audit-details {
  margin-top: 7px;
}

.audit-details summary {
  width: fit-content;
  color: var(--blue);
  cursor: pointer;
  font-size: 10px;
}

.audit-details pre {
  max-height: 320px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 11px;
  color: #d5dee7;
  background: #17212b;
  border-radius: 4px;
  font: 10px/1.55 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.source-view {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 17px 19px;
  color: #17212b;
  background: #f9fbfc;
  border-radius: 0 0 7px 7px;
  font: 11px/1.6 var(--mono);
  tab-size: 2;
  white-space: pre;
}

.agent-panel {
  position: sticky;
  top: 16px;
}

.agent-list {
  padding: 7px;
}

.agent-row {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
}

.agent-row:hover {
  background: var(--surface-subtle);
}

.agent-row.active {
  background: var(--blue-soft);
  border-color: #c7d9e9;
}

.agent-index {
  color: var(--faint);
  font: 10px var(--mono);
}

.agent-name {
  display: block;
  font-size: 12px;
  font-weight: 650;
}

.agent-description {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b6bec6;
}

.agent-state-dot.running {
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.agent-state-dot.succeeded,
.agent-state-dot.finished {
  background: var(--green);
}

.agent-state-dot.failed {
  background: var(--red);
}

.agent-state-dot.partial,
.agent-state-dot.skipped {
  background: var(--amber);
}

.inspect-panel {
  min-width: 0;
}

.report-panel {
  margin-top: 16px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 49px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

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

.tab-count {
  margin-left: 5px;
  color: var(--faint);
  font: 10px var(--mono);
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.log-stream {
  min-height: 480px;
  max-height: 650px;
  overflow: auto;
  padding: 8px 0;
}

.log-row {
  display: grid;
  grid-template-columns: 72px 102px minmax(0, 1fr);
  gap: 13px;
  padding: 11px 17px;
  border-bottom: 1px solid #eef1f3;
  font-size: 11px;
}

.log-row:last-child {
  border-bottom: 0;
}

.log-time {
  color: var(--faint);
  font: 10px var(--mono);
}

.log-type {
  color: var(--blue);
  font: 600 9px var(--mono);
  text-transform: uppercase;
}

.log-message {
  line-height: 1.55;
}

.log-message small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.json-view {
  min-height: 480px;
  max-height: 650px;
  overflow: auto;
  margin: 0;
  padding: 17px 19px;
  color: #d5dee7;
  background: #17212b;
  font: 11px/1.65 var(--mono);
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.plain-report-view {
  min-height: 560px;
  max-height: 760px;
  overflow: auto;
  margin: 0;
  padding: 20px 22px;
  color: var(--text);
  background: #ffffff;
  font: 12px/1.7 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.json-empty {
  min-height: 480px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.readable-view {
  min-height: 480px;
  max-height: 650px;
  overflow: auto;
  padding: 16px;
  background: var(--surface-subtle);
}

.readable-card {
  padding: 15px 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.readable-card:last-child {
  margin-bottom: 0;
}

.readable-card h3,
.readable-card h4 {
  margin: 0;
  font-size: 13px;
}

.readable-card .subsection-title {
  margin-top: 14px;
}

.readable-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.readable-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

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

.summary-grid div {
  padding: 10px;
  background: var(--surface-subtle);
  border: 1px solid #edf0f2;
  border-radius: 5px;
}

.summary-grid dt {
  color: var(--faint);
  font-size: 10px;
}

.summary-grid dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font: 11px var(--mono);
}

.finding-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.finding-card {
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px solid #edf0f2;
  border-radius: 5px;
}

.finding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.finding-card small {
  display: block;
  margin-top: 8px;
  color: var(--faint);
  font-size: 10px;
}

.poc-card h5 {
  margin: 14px 0 0;
  font-size: 11px;
}

.poc-script {
  max-height: 360px;
  overflow: auto;
  margin: 9px 0 0;
  padding: 12px;
  color: #dbe5ee;
  background: #18212a;
  border-radius: 5px;
  font: 11px/1.6 var(--mono);
  white-space: pre;
}

.compact-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.error-card {
  border-color: #efc6c6;
  background: #fffafa;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.config-list {
  margin: 0;
  padding: 7px 18px 15px;
}

.config-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f2;
}

.config-row:last-child {
  border-bottom: 0;
}

.config-row dt {
  color: var(--muted);
  font-size: 11px;
}

.config-row dd {
  overflow-wrap: anywhere;
  margin: 0;
  font: 11px var(--mono);
  text-align: right;
}

.notice {
  padding: 12px 15px;
  margin-bottom: 16px;
  color: #5d4b2b;
  background: #fff8e9;
  border: 1px solid #ead9b6;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.55;
}

.dialog {
  width: min(760px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 18px 55px rgb(23 33 43 / 20%);
}

.dialog::backdrop {
  background: rgb(17 26 35 / 48%);
}

.dialog form {
  padding: 22px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.dialog-head h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.icon-button {
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.dialog-copy {
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.field {
  display: block;
  margin-top: 14px;
}

.field select,
.field input,
.field textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.field select,
.field input {
  height: 40px;
  padding: 0 10px;
}

.field textarea {
  min-height: 260px;
  resize: vertical;
  padding: 11px 12px;
  font: 11px/1.55 var(--mono);
  tab-size: 2;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 360px;
  padding: 11px 14px;
  color: #fff;
  background: #263746;
  border-radius: 5px;
  box-shadow: 0 8px 26px rgb(20 31 42 / 22%);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.knowledge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.knowledge-main {
  display: grid;
  gap: 18px;
}

.knowledge-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
}

.knowledge-upload .field {
  margin: 0;
}

.knowledge-detail {
  position: sticky;
  top: 18px;
}

.knowledge-detail-body {
  padding: 18px;
}

.knowledge-detail-body h3 {
  margin: 14px 0 8px;
  font-size: 16px;
}

.knowledge-detail-body h4 {
  margin: 20px 0 8px;
  font-size: 12px;
}

.knowledge-detail-body p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.compact-select {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
}

.empty-inline,
.inline-error {
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
}

.inline-error {
  color: var(--red);
  background: #fff8f7;
}

.mini-progress {
  width: 100px;
  height: 5px;
  margin-bottom: 4px;
  overflow: hidden;
  border-radius: 3px;
  background: #e7ebef;
}

.mini-progress span {
  display: block;
  height: 100%;
  background: var(--blue);
}

@media (max-width: 1050px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .detail-grid,
  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  .knowledge-detail {
    position: static;
  }

  .agent-panel {
    position: static;
  }

  .agent-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 12px;
  }

  .brand {
    padding-bottom: 12px;
  }

  .nav {
    flex-direction: row;
    overflow-x: auto;
    padding-top: 12px;
  }

  .nav a {
    flex: 0 0 auto;
  }

  .nav-divider,
  .sidebar-foot {
    display: none;
  }

  .workspace {
    min-width: 0;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    padding: 18px;
  }

  .system-state {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .metric-grid,
  .config-grid,
  .agent-list {
    grid-template-columns: 1fr;
  }

  .knowledge-upload {
    grid-template-columns: 1fr;
  }

  .task-header {
    grid-template-columns: 1fr;
  }

  .task-progress {
    width: 100%;
  }

  .log-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .log-message {
    grid-column: 1 / -1;
  }

  .audit-log-columns {
    display: none;
  }

  .audit-log-entry {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .audit-time,
  .audit-agent,
  .audit-event,
  .audit-status,
  .audit-message {
    grid-column: 2;
  }
}
