:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #64748b;
  --line: #d8e0ea;
  --line-strong: #c7d2df;
  --nav: #0f172a;
  --nav-soft: #182235;
  --blue: #2563eb;
  --green: #14784f;
  --red: #b42318;
  --amber: #a15c00;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #172033 50%, #22314a 100%);
  padding: 20px;
}

.login-screen.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
}

.login-card p {
  margin: -6px 0 4px;
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-card .inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.login-card .inline-check input {
  width: 18px;
  height: 18px;
}

.login-card input {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 10px;
}

.login-card button {
  height: 40px;
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.login-mark {
  width: 44px;
  height: 44px;
}

.login-notice {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

.setup-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--nav);
  color: #e5edf8;
  padding: 18px 14px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #e6f0ff;
  color: var(--blue);
  font-weight: 800;
}

.brand {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle,
.sidebar-footer {
  color: #94a3b8;
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 0 10px;
  font-weight: 700;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--nav-soft);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 8px 4px;
  line-height: 1.4;
}

.content-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.page-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 3px 0 0;
  font-size: 24px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.language-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.language-control select,
button,
input[type="number"] {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 7px;
}

.language-control select,
button {
  height: 36px;
  padding: 0 12px;
  font-weight: 700;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-pill strong {
  color: var(--blue);
}

.preview-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.viewer-mode .control-button {
  opacity: 0.45;
  cursor: not-allowed;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

main {
  width: min(1340px, calc(100% - 36px));
  margin: 18px auto 34px;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 14px 16px;
}

.metric span,
.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.panel {
  padding: 16px;
}

.notice-panel {
  margin-top: 12px;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h2 {
  margin: 0;
  font-size: 17px;
}

.panel-title span {
  color: var(--muted);
  font-size: 12px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.gate-list {
  display: grid;
  gap: 8px;
}

.gate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.gate-content {
  flex: 1;
  min-width: 0;
}

.gate-content > span {
  display: block;
  font-weight: 800;
}

.gate-progress {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe5f2;
}

.gate-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.badge {
  min-width: 58px;
  text-align: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.pass {
  background: #e9f7ef;
  color: var(--green);
}

.wait {
  background: #fff4df;
  color: var(--amber);
}

.danger {
  background: #feeceb;
  color: var(--red);
}

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

.stats div,
.setting-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: var(--panel-soft);
}

.stats strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 800;
}

.notice {
  min-height: 40px;
  line-height: 1.6;
  color: var(--muted);
}

.health-state strong {
  overflow-wrap: anywhere;
}

.log-tail {
  max-height: 220px;
  overflow: auto;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.strategy-grid {
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
}

.strategy-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.strategy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: auto;
  min-height: 42px;
  border-color: var(--line);
  text-align: left;
}

.strategy-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.strategy-item small {
  color: var(--muted);
  white-space: nowrap;
}

.strategy-item.selected {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-form select,
.profile-form input[type="text"] {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.profile-head {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

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

fieldset {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(110px, 160px);
  align-items: center;
  gap: 10px;
  margin: 9px 0;
}

.form-row span {
  color: var(--text);
  font-size: 13px;
}

input[type="number"] {
  width: 100%;
  height: 34px;
  padding: 0 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  justify-self: start;
}

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

.inline-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.compact-form {
  gap: 10px;
}

.compact-form label {
  display: grid;
  gap: 6px;
}

.compact-form input[type="number"],
.compact-form input[type="password"],
.compact-form input[type="text"],
.compact-form select,
.compact-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}

.compact-form input[type="number"],
.compact-form input[type="password"],
.compact-form input[type="text"],
.compact-form select {
  height: 38px;
  padding: 0 10px;
}

.compact-form textarea {
  min-height: 88px;
  padding: 10px;
  resize: vertical;
}

.checkbox-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.risk-ack-box {
  display: grid;
  gap: 6px;
  border: 1px solid #f2d49b;
  border-radius: 7px;
  padding: 12px;
  background: #fffaf0;
}

.risk-ack-box strong {
  color: var(--amber);
}

.risk-ack-box span {
  color: var(--text);
  line-height: 1.5;
}

.live-wizard {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.live-wizard-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--panel-soft);
}

.live-wizard-step.done {
  border-color: #bfe4ce;
  background: #f2fbf5;
}

.live-wizard-step.pending {
  border-color: #f0b9b2;
  background: #fff6f4;
}

.live-wizard-step.optional {
  border-color: #f2d49b;
  background: #fffaf0;
}

.wizard-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e6eef8;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.live-wizard-step > div:not(.wizard-index) > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.final-evidence-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.final-check-list {
  display: grid;
  gap: 8px;
}

.final-check-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--panel-soft);
}

.final-check-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.final-check-item strong,
.final-check-item small {
  display: block;
}

.final-check-item small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.final-note {
  display: grid;
  margin: 12px 0;
}

.equity-curve {
  min-height: 220px;
}

.equity-curve svg {
  width: 100%;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.equity-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.health-summary,
.validation-summary,
.market-feature-summary,
.activity-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.health-state,
.risk-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: var(--panel-soft);
}

.health-state span,
.risk-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.health-state strong,
.risk-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.gate-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.badge.fail {
  background: #fff1f0;
  color: var(--red);
}

.badge.manual {
  background: #fff8e8;
  color: var(--amber);
}

.backup-list,
.recommendation-list,
.restore-guide,
.service-status-list {
  display: grid;
  gap: 8px;
}

.monitor-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.monitor-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: var(--panel-soft);
}

.monitor-card span,
.monitor-card em,
.recommendation-item span,
.recommendation-item small {
  display: block;
}

.monitor-card > div {
  min-width: 0;
}

.monitor-card > div > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.monitor-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.monitor-card em,
.recommendation-item small {
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.recommendation-item.severity-high {
  border-color: #f0b9b2;
  background: #fff6f4;
}

.recommendation-item.severity-medium {
  border-color: #f2d49b;
  background: #fffaf0;
}

.recommendation-item.severity-low {
  border-color: #bfe4ce;
  background: #f2fbf5;
}

.backup-item,
.service-status-item,
.recommendation-item,
.restore-warning,
.restore-excluded {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.backup-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.service-status-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.task-actions button {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.task-runbook {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.recommendation-item {
  display: block;
  line-height: 1.5;
  color: var(--text);
}

.backup-policy,
.backup-section-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.backup-section-title {
  margin: 8px 0 0;
}

.restore-guide ol {
  margin: 0;
  padding-left: 22px;
  line-height: 1.7;
}

.restore-warning {
  display: block;
  border-color: #f3d19c;
  background: #fff8e8;
  color: var(--amber);
}

.restore-excluded {
  display: block;
  color: var(--muted);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.control-button {
  height: 48px;
  border-width: 1px;
}

.control-button.start {
  border-color: #a8d5bd;
  background: #ecfdf3;
  color: var(--green);
}

.control-button.stop {
  border-color: #f2b8b5;
  background: #fff1f0;
  color: var(--red);
}

.control-button.restart {
  border-color: #f3d19c;
  background: #fff8e8;
  color: var(--amber);
}

.control-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.strategy-switch-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 2fr) auto;
  gap: 10px;
  align-items: end;
}

.strategy-switch-grid label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.strategy-switch-grid select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
}

.switch-status {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.control-warning {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #f3d19c;
  background: #fff8e8;
  color: var(--amber);
  border-radius: 7px;
  line-height: 1.5;
  font-size: 13px;
}

.audit-log {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.activity-timeline {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
}

.activity-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--panel-soft);
}

.activity-item strong,
.activity-item span {
  display: block;
}

.activity-item span,
.activity-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.activity-item.pass {
  border-left-color: var(--green);
}

.activity-item.wait {
  border-left-color: var(--amber);
}

.activity-item.danger {
  border-left-color: var(--red);
}

.activity-item.manual {
  border-left-color: var(--blue);
}

.activity-log-tail {
  min-height: 430px;
  max-height: 430px;
}

.audit-tools {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(160px, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.audit-tools select,
.audit-tools input {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
}

.audit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.audit-item span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.audit-item em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.audit-diff {
  display: grid;
  gap: 3px;
  margin-top: 6px;
}

.audit-diff span {
  white-space: normal;
}

.user-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 110px minmax(120px, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.user-form input,
.user-form select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
}

.user-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.user-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.setting-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.setting-row strong {
  display: block;
  margin-top: 8px;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.warning-text {
  color: var(--amber);
}

.commercial-plan-list {
  display: grid;
  gap: 12px;
}

.commercial-plan-deferred {
  display: grid;
  gap: 8px;
}

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

.commercial-plan-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.commercial-plan-card.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.commercial-plan-card span,
.commercial-plan-card small {
  color: var(--muted);
  line-height: 1.45;
}

.commercial-plan-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

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

.tenant-runtime-list {
  display: grid;
  gap: 10px;
}

.tenant-runtime-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.tenant-runtime-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.tenant-runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}

.tenant-runtime-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.mini-status {
  display: inline-block;
  min-width: 38px;
  margin-left: 4px;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.tenant-runtime-grid .tenant-runtime-command {
  grid-column: 1 / -1;
  font-family: Consolas, "Courier New", monospace;
  color: var(--text);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
  }

  .nav-icon {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .actions {
    width: 100%;
  }

  main {
    width: calc(100% - 20px);
    margin-top: 10px;
  }

  .status-strip,
  .grid,
  .stats,
  .strategy-grid,
  .settings-grid,
  .risk-grid,
  .strategy-switch-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .commercial-plan-grid {
    grid-template-columns: 1fr;
  }

  .tenant-runtime-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .user-form {
    grid-template-columns: 1fr;
  }

  .user-item {
    align-items: flex-start;
    flex-direction: column;
  }
}
