:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-alt: #f7f9fb;
  --text: #182230;
  --muted: #687586;
  --subtle: #8b97a7;
  --border: #dfe5ec;
  --border-strong: #cdd6e0;
  --primary: #0b75b9;
  --primary-hover: #075f99;
  --primary-soft: #e7f3fa;
  --green: #16875d;
  --green-soft: #e7f6ef;
  --orange: #c77710;
  --orange-soft: #fff2df;
  --red: #c8414f;
  --red-soft: #fdecef;
  --ink-blue: #20405d;
  --shadow: 0 10px 28px rgba(23, 43, 61, 0.08);
  --radius: 7px;
  --sidebar-width: 244px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(11, 117, 185, 0.18); outline-offset: 2px; }
svg { display: block; }

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand { min-height: 74px; padding: 15px 16px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--border); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--primary); border-radius: 7px; }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 2; }
.brand strong { display: block; font-size: 16px; line-height: 1.3; }
.brand span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.sidebar-close { display: none; margin-left: auto; }

.workspace-switcher { padding: 18px 13px 10px; }
.eyebrow { display: block; padding: 0 8px; color: var(--subtle); font-size: 10px; font-weight: 700; margin-bottom: 8px; }
.workspace-button { width: 100%; border: 1px solid var(--border); background: var(--surface-alt); border-radius: 6px; padding: 9px 8px; display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer; }
.workspace-button:hover { border-color: var(--border-strong); background: #f1f5f8; }
.workspace-avatar { flex: 0 0 32px; height: 32px; display: grid; place-items: center; background: var(--ink-blue); color: white; border-radius: 5px; font-size: 13px; font-weight: 800; }
.workspace-button > span:nth-child(2) { min-width: 0; flex: 1; }
.workspace-button strong, .workspace-button small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-button strong { font-size: 12px; }
.workspace-button small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.workspace-button svg { width: 14px; color: var(--muted); }

.main-nav { padding: 8px 12px; display: grid; gap: 3px; }
.nav-item { position: relative; min-height: 41px; border: 0; background: transparent; border-radius: 6px; display: flex; align-items: center; gap: 11px; padding: 0 12px; color: #435062; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.9; color: #748193; }
.nav-item span { flex: 1; }
.nav-item b { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 10px; background: #edf1f5; font-size: 10px; color: var(--muted); }
.nav-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary); }
.nav-item.is-active::before { content: ""; position: absolute; left: -12px; width: 3px; height: 23px; border-radius: 0 2px 2px 0; background: var(--primary); }
.nav-item.is-active svg { color: var(--primary); }
.nav-divider { height: 1px; margin: 8px 20px 0; background: var(--border); }

.sidebar-footer { margin-top: auto; min-height: 72px; display: flex; align-items: center; gap: 9px; padding: 14px 15px; border-top: 1px solid var(--border); }
.user-avatar { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #e6edf3; color: #33485d; font-weight: 800; font-size: 12px; }
.sidebar-footer > div:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer span { color: var(--muted); font-size: 10px; margin-top: 3px; }

.main-area { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 30; height: 74px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title h1 { margin: 0; font-size: 17px; line-height: 1.3; }
.topbar-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.connection-state { height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; background: var(--green-soft); color: var(--green); border-radius: 5px; font-size: 11px; font-weight: 700; }
.connection-state.demo-state { background: var(--orange-soft); color: #9b5c0c; }
.connection-state.demo-state svg { width: 14px; height: 14px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #1aa675; box-shadow: 0 0 0 3px rgba(26, 166, 117, 0.13); }
.notification-dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; background: var(--red); border-radius: 50%; border: 1px solid white; }
.sidebar-open { display: none !important; }

.content { width: min(1480px, 100%); margin: 0 auto; padding: 24px 28px 36px; }
.view { display: none; }
.view.is-visible { display: block; animation: view-in 180ms ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.icon-button { position: relative; flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; }
.icon-button:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.icon-button svg { width: 16px; height: 16px; }
.primary-button, .secondary-button { min-height: 36px; border-radius: 6px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.primary-button { color: white; background: var(--primary); border-color: var(--primary); }
.primary-button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.secondary-button { background: var(--surface); border-color: var(--border-strong); color: #344254; }
.secondary-button:hover { background: var(--surface-alt); }
.primary-button svg, .secondary-button svg { width: 15px; height: 15px; }
.text-button { border: 0; padding: 4px 0; background: transparent; color: var(--primary); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.text-button:hover { color: var(--primary-hover); }
.text-button svg { width: 13px; height: 13px; }
.full-width { width: 100%; }

.application-banner { position: relative; min-height: 134px; padding: 24px 25px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.application-banner::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary); border-radius: var(--radius) 0 0 var(--radius); }
.application-identity { display: flex; align-items: center; gap: 17px; min-width: 0; }
.application-icon { flex: 0 0 58px; height: 58px; display: grid; place-items: center; border-radius: 7px; background: var(--ink-blue); color: white; box-shadow: 0 7px 18px rgba(32, 64, 93, .2); }
.application-icon svg { width: 29px; height: 29px; stroke-width: 1.7; }
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.title-row h2, .title-row h3 { margin: 0; }
.application-identity h2 { font-size: 20px; }
.application-identity p { margin: 6px 0 12px; color: var(--muted); font-size: 12px; }
.state-label, .success-label, .table-status { display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.state-label { padding: 4px 7px; color: var(--green); background: var(--green-soft); }
.state-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.success-label { color: var(--green); }
.success-label svg { width: 15px; }
.metadata-row { display: flex; flex-wrap: wrap; gap: 15px; color: #526173; font-size: 10px; }
.metadata-row span { display: inline-flex; align-items: center; gap: 5px; }
.metadata-row svg { width: 13px; height: 13px; color: #8290a1; }
.application-actions { position: relative; display: flex; align-items: center; gap: 8px; }
.action-menu-button { flex-basis: 36px; }
.action-menu { position: absolute; top: 43px; right: 0; z-index: 20; min-width: 164px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); }
.action-menu button { width: 100%; min-height: 34px; border: 0; background: transparent; display: flex; align-items: center; gap: 9px; padding: 0 9px; border-radius: 4px; font-size: 11px; cursor: pointer; }
.action-menu button:hover { background: var(--surface-alt); }
.action-menu svg { width: 14px; }
.danger-text { color: var(--red); }

.metric-strip { margin: 16px 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.metric-strip article { min-height: 112px; padding: 19px 22px; border-right: 1px solid var(--border); }
.metric-strip article:last-child { border-right: 0; }
.metric-strip article > span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-strip strong { display: block; margin-top: 8px; font-size: 25px; line-height: 1; }
.metric-strip strong small { font-size: 12px; color: var(--subtle); }
.metric-strip strong.text-value { font-size: 22px; }
.metric-strip p { margin: 10px 0 0; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.metric-strip p svg { width: 12px; height: 12px; }
.metric-strip p.positive { color: var(--green); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(330px, .82fr); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-heading { min-height: 69px; padding: 16px 19px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.panel-heading h3 { margin: 0; font-size: 14px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.resource-summary { padding: 22px 22px 8px; display: grid; grid-template-columns: 132px 1fr; align-items: center; gap: 26px; }
.gauge { --value: calc(var(--gauge-value) * 1%); width: 116px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--primary) var(--value), #e8edf2 0); position: relative; }
.gauge::after { content: ""; position: absolute; width: 84px; aspect-ratio: 1; border-radius: 50%; background: var(--surface); }
.gauge > div { position: relative; z-index: 1; text-align: center; }
.gauge strong, .gauge span { display: block; }
.gauge strong { font-size: 22px; }
.gauge span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.resource-bars { display: grid; gap: 16px; }
.resource-row { display: grid; grid-template-columns: 72px 1fr 38px; align-items: center; gap: 11px; }
.resource-row > span { display: flex; align-items: center; gap: 7px; color: #4e5c6d; font-size: 11px; }
.resource-row > span svg { width: 14px; height: 14px; color: #7b8897; }
.resource-row > strong { font-size: 11px; text-align: right; }
.progress-track { height: 6px; overflow: hidden; border-radius: 3px; background: #e9eef3; }
.progress-track span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width 400ms ease; }
.progress-track.storage span { background: #3e8d75; }
.progress-track.load span { background: #d38a2a; }
.traffic-chart { padding: 5px 20px 16px; }
.chart-legend { display: flex; justify-content: flex-end; gap: 15px; color: var(--muted); font-size: 9px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend b { width: 12px; height: 2px; background: var(--primary); }
.chart-legend b.upload { background: #7a8797; }
.traffic-chart svg { width: 100%; height: 110px; overflow: visible; }
.grid-lines line { stroke: #e8edf2; stroke-width: 1; }
.chart-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.download-line { stroke: var(--primary); }
.upload-line { stroke: #7a8797; stroke-dasharray: 5 5; }
.download-area { fill: rgba(11, 117, 185, .08); }
.chart-axis { display: flex; justify-content: space-between; color: var(--subtle); font-size: 9px; }

.deployment-steps { margin: 0; padding: 18px 19px 8px; list-style: none; }
.deployment-steps li { position: relative; display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; min-height: 58px; }
.deployment-steps li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 25px; bottom: 0; width: 1px; background: #cfe6dc; }
.deployment-steps li > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.deployment-steps li > span svg { width: 13px; }
.deployment-steps strong, .deployment-steps small { display: block; }
.deployment-steps strong { font-size: 11px; }
.deployment-steps small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.deployment-steps time { padding-top: 2px; color: var(--subtle); font-size: 9px; }
.deployment-panel > .secondary-button { width: calc(100% - 38px); margin: 0 19px 18px; }

.activity-panel { margin-top: 16px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { height: 36px; padding: 0 18px; background: var(--surface-alt); color: #738092; text-align: left; font-size: 9px; font-weight: 700; white-space: nowrap; }
td { height: 52px; padding: 0 18px; border-top: 1px solid var(--border); color: #536172; white-space: nowrap; }
td strong { color: var(--text); font-size: 11px; }
td:first-child { min-width: 160px; }
.event-icon { width: 28px; height: 28px; margin-right: 9px; display: inline-grid; place-items: center; vertical-align: middle; border-radius: 5px; }
.event-icon svg { width: 14px; }
.event-icon.deploy { background: var(--primary-soft); color: var(--primary); }
.event-icon.sync { background: #e9f4f1; color: #287e69; }
.event-icon.backup { background: var(--orange-soft); color: var(--orange); }
.event-icon.node { background: #edf0f4; color: #556677; }
.table-status { padding: 4px 7px; }
.table-status.success { background: var(--green-soft); color: var(--green); }
.table-status.neutral { background: #eef1f4; color: #637081; }
.table-status.running { background: var(--primary-soft); color: var(--primary); }

.section-toolbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-toolbar h2 { margin: 0; font-size: 18px; }
.section-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.node-detail { overflow: hidden; }
.node-header { min-height: 110px; padding: 22px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--border); }
.node-header > div:nth-child(2) { flex: 1; }
.node-header h3 { margin: 0; font-size: 16px; }
.node-header p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.router-illustration { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 7px; background: #eaf2f7; color: var(--ink-blue); }
.router-illustration svg { width: 28px; }
.router-illustration .status-dot { position: absolute; right: -1px; bottom: -1px; border: 3px solid white; width: 12px; height: 12px; box-shadow: none; }
.node-specs { margin: 0; padding: 6px 22px 22px; display: grid; grid-template-columns: repeat(3, 1fr); }
.node-specs div { padding: 18px 12px 2px 0; }
.node-specs dt { color: var(--muted); font-size: 10px; }
.node-specs dd { margin: 7px 0 0; font-size: 12px; font-weight: 700; }
.file-button { position: relative; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.version-table td:last-child { text-align: right; }
.version-table td:first-child { min-width: 190px; }
.cell-note { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 500; }
.release-boundary { display: grid; grid-template-columns: 1.4fr .7fr .7fr 2.1fr; margin-bottom: 16px; overflow: hidden; }
.release-boundary > div { min-height: 72px; padding: 15px 17px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.release-boundary > div:last-child { border-right: 0; }
.release-boundary span, .release-boundary strong, .release-boundary small { display: block; }
.release-boundary > div > span { color: var(--muted); font-size: 9px; }
.release-boundary > div > strong { margin-top: 6px; font-size: 11px; }
.release-boundary .data-safety { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; background: #f5faf8; }
.release-boundary .data-safety > svg { flex: 0 0 20px; width: 20px; color: var(--green); }
.release-boundary .data-safety strong { font-size: 11px; }
.release-boundary .data-safety small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.release-list-panel { overflow: hidden; }
.demo-label { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 4px; background: var(--orange-soft); color: #9b5c0c; font-size: 9px; font-weight: 700; }
.demo-label svg { width: 12px; height: 12px; }
.release-policy, .signature-state { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.release-policy { padding: 4px 7px; border-radius: 4px; }
.release-policy.optional { color: var(--primary); background: var(--primary-soft); }
.release-policy.mandatory { color: var(--red); background: var(--red-soft); }
.signature-state svg { width: 13px; height: 13px; }
.signature-state.signed { color: var(--green); }
.signature-state.pending { color: var(--orange); }
.manifest-panel { margin-top: 16px; overflow: hidden; }
.manifest-method { padding: 5px 7px; border-radius: 4px; background: #eef2f5; color: #506070; font-family: Consolas, monospace; font-size: 9px; }
.manifest-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.manifest-grid div { min-height: 68px; padding: 14px 17px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.manifest-grid div:nth-child(4n) { border-right: 0; }
.manifest-grid div:nth-last-child(-n + 4) { border-bottom: 0; }
.manifest-grid dt { color: var(--muted); font-family: Consolas, monospace; font-size: 9px; }
.manifest-grid dd { margin: 7px 0 0; overflow-wrap: anywhere; color: var(--text); font-size: 10px; font-weight: 700; }

.backup-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.backup-summary > div { padding: 22px; border-right: 1px solid var(--border); }
.backup-summary > div:last-child { border-right: 0; }
.backup-summary span, .backup-summary strong, .backup-summary small { display: block; }
.backup-summary span { color: var(--muted); font-size: 10px; }
.backup-summary strong { margin-top: 8px; font-size: 15px; }
.backup-summary small { margin-top: 5px; color: var(--subtle); font-size: 9px; }
.backup-list { overflow: hidden; }

.log-panel { overflow: hidden; }
.log-toolbar { padding: 12px 15px; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.segmented-control { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-alt); }
.segmented-control button { min-width: 52px; height: 28px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.segmented-control button.is-active { background: white; color: var(--text); box-shadow: 0 1px 4px rgba(31, 47, 61, .12); font-weight: 700; }
.search-field { width: min(260px, 42vw); height: 35px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: white; }
.search-field svg { width: 14px; color: var(--muted); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; font-size: 11px; }
.log-stream { padding: 8px 0; min-height: 360px; font-family: Consolas, "SFMono-Regular", monospace; }
.log-stream > div { min-height: 43px; padding: 0 17px; display: grid; grid-template-columns: 70px 48px 1fr; align-items: center; border-bottom: 1px solid #eef2f5; font-size: 10px; }
.log-stream > div:last-child { border-bottom: 0; }
.log-stream time { color: #8591a0; }
.log-stream p { margin: 0; color: #3f4d5d; }
.log-level { font-size: 9px; font-weight: 800; }
.log-level.info { color: var(--primary); }
.log-level.warning { color: var(--orange); }

.settings-form { overflow: hidden; }
.form-section { padding: 23px 22px; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(420px, 2fr); gap: 40px; border-bottom: 1px solid var(--border); }
.form-section h3 { margin: 0; font-size: 13px; }
.form-section > div:first-child p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-fields label:not(.toggle-row), .form-control { display: grid; gap: 6px; color: #4a5868; font-size: 10px; font-weight: 700; }
.form-fields input[type="text"], .form-fields input[type="number"], .form-fields select, .form-control input, .form-control select, .form-control textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 5px; padding: 0 10px; background: white; color: var(--text); font-size: 11px; }
.form-fields input[type="text"], .form-fields input[type="number"], .form-fields select, .form-control input, .form-control select { height: 36px; }
.form-control textarea { min-height: 88px; padding-top: 9px; padding-bottom: 9px; resize: vertical; line-height: 1.5; }
.toggle-row { min-height: 51px; display: flex; align-items: center; justify-content: space-between; gap: 20px; grid-column: 1 / -1; cursor: pointer; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 11px; }
.toggle-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.toggle-input { appearance: none; flex: 0 0 38px; width: 38px; height: 21px; border-radius: 12px; background: #cbd3dc; position: relative; cursor: pointer; transition: background 160ms ease; }
.toggle-input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform 160ms ease; }
.toggle-input:checked { background: var(--primary); }
.toggle-input:checked::after { transform: translateX(17px); }
.form-actions { padding: 16px 22px; display: flex; justify-content: flex-end; gap: 8px; }

.modal { width: min(520px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 24px 70px rgba(16, 32, 46, .24); }
.modal::backdrop { background: rgba(24, 34, 48, .44); backdrop-filter: blur(2px); }
.modal-heading { min-height: 82px; padding: 17px 19px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--border); }
.modal-heading > div { display: flex; align-items: center; gap: 12px; }
.modal-heading h2 { margin: 0; font-size: 16px; }
.modal-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.modal-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.modal-icon.warning { background: var(--orange-soft); color: var(--orange); }
.modal-icon svg { width: 19px; }
.modal-body { padding: 20px; display: grid; gap: 16px; }
.deploy-target { min-height: 69px; padding: 11px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 6px; }
.router-mini { flex: 0 0 39px; height: 39px; display: grid; place-items: center; border-radius: 5px; color: var(--ink-blue); background: #eaf2f7; }
.router-mini svg { width: 20px; }
.deploy-target > div:nth-child(2) { flex: 1; }
.deploy-target span, .deploy-target strong, .deploy-target small { display: block; }
.deploy-target span, .deploy-target small { color: var(--muted); font-size: 9px; }
.deploy-target strong { margin: 3px 0; font-size: 11px; }
.deploy-target > svg { width: 18px; color: var(--green); }
.deployment-progress { padding: 13px; background: var(--surface-alt); border-radius: 6px; }
.deployment-progress > div:first-child { margin-bottom: 8px; display: flex; justify-content: space-between; font-size: 10px; }
.release-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.release-form-grid .full-field { grid-column: 1 / -1; }
.package-rule { min-height: 64px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid #cde5da; border-radius: 6px; background: #f3faf7; }
.package-rule > svg { flex: 0 0 19px; width: 19px; color: var(--green); }
.package-rule strong, .package-rule small { display: block; }
.package-rule strong { font-size: 10px; }
.package-rule small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.modal-actions { min-height: 67px; padding: 15px 19px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; border-top: 1px solid var(--border); }
.compact-modal { width: min(440px, calc(100vw - 28px)); }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 280px; max-width: min(380px, calc(100vw - 30px)); min-height: 50px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; background: #172838; color: white; border-radius: 6px; box-shadow: var(--shadow); animation: toast-in 220ms ease-out; font-size: 11px; }
.toast svg { width: 16px; color: #63d3a9; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: 180ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

.sidebar-scrim { display: none; }

@media (max-width: 1080px) {
  .overview-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip article:nth-child(2) { border-right: 0; }
  .metric-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform 180ms ease; box-shadow: var(--shadow); }
  body.sidebar-visible .sidebar { transform: none; }
  .sidebar-close, .sidebar-open { display: inline-grid !important; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(24, 34, 48, .35); }
  body.sidebar-visible .sidebar-scrim { display: block; }
  .main-area { margin-left: 0; }
  .topbar { padding: 0 17px; }
  .content { padding: 17px 15px 28px; }
  .application-banner { align-items: flex-start; flex-direction: column; }
  .application-actions { width: 100%; }
  .application-actions .secondary-button, .application-actions .primary-button { flex: 1; }
  .node-specs { grid-template-columns: repeat(2, 1fr); }
  .form-section { grid-template-columns: 1fr; gap: 18px; }
  .release-boundary { grid-template-columns: repeat(2, 1fr); }
  .release-boundary > div:nth-child(2) { border-right: 0; }
  .release-boundary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .manifest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manifest-grid div:nth-child(4n) { border-right: 1px solid var(--border); }
  .manifest-grid div:nth-child(2n) { border-right: 0; }
  .manifest-grid div:nth-last-child(-n + 4) { border-bottom: 1px solid var(--border); }
  .manifest-grid div:nth-last-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 560px) {
  .topbar { height: 66px; }
  .topbar-title h1 { font-size: 15px; }
  .topbar-title p { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .connection-state { width: 31px; padding: 0; justify-content: center; font-size: 0; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article { min-height: 100px; padding: 15px; }
  .metric-strip strong { font-size: 21px; }
  .application-banner { padding: 19px 17px; }
  .application-icon { flex-basis: 48px; height: 48px; }
  .application-icon svg { width: 24px; }
  .application-identity { align-items: flex-start; gap: 12px; }
  .application-identity h2 { font-size: 17px; }
  .metadata-row { gap: 8px 12px; }
  .application-actions .secondary-button { font-size: 0; flex: 0 0 38px; padding: 0; }
  .application-actions .secondary-button svg { width: 16px; }
  .overview-grid { gap: 12px; }
  .resource-summary { grid-template-columns: 1fr; justify-items: center; }
  .resource-bars { width: 100%; }
  .activity-panel { margin-top: 12px; }
  .section-toolbar { align-items: flex-start; min-height: 88px; padding-top: 10px; }
  .section-toolbar .primary-button, .section-toolbar .secondary-button { flex: 0 0 37px; width: 37px; padding: 0; font-size: 0; }
  .node-header { align-items: flex-start; flex-wrap: wrap; }
  .node-header .secondary-button { width: 100%; }
  .node-specs { grid-template-columns: 1fr; }
  .backup-summary { grid-template-columns: 1fr; }
  .backup-summary > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .backup-summary > div:last-child { border-bottom: 0; }
  .log-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .log-stream > div { grid-template-columns: 62px 42px 1fr; padding: 0 11px; }
  .form-fields { grid-template-columns: 1fr; }
  .release-boundary { grid-template-columns: 1fr; }
  .release-boundary > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .release-boundary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .release-boundary > div:last-child { border-bottom: 0; }
  .manifest-grid { grid-template-columns: 1fr; }
  .manifest-grid div, .manifest-grid div:nth-child(2n), .manifest-grid div:nth-child(4n), .manifest-grid div:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--border); }
  .manifest-grid div:last-child { border-bottom: 0; }
  .release-form-grid { grid-template-columns: 1fr; }
  .toast-region { right: 15px; bottom: 15px; }
}

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