:root {
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: #17212f;
  background: #eef3f7;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1080px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
.login-gate { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; background: rgba(238,243,247,.97); }
.login-gate[hidden] { display: none; }
.login-card { width: min(390px, calc(100vw - 36px)); display: grid; gap: 13px; padding: 28px; background: #fff; border: 1px solid #dce4ea; border-radius: 10px; box-shadow: 0 18px 50px rgba(29,48,57,.14); }
.login-card label { display: grid; gap: 7px; color: #48616f; font-size: 12px; font-weight: 800; }
.login-card input { padding: 10px 11px; border: 1px solid #cddbe1; border-radius: 5px; }
.login-card p { color: #607783; font-size: 13px; line-height: 1.5; }
.login-error { min-height: 18px; margin: 0; color: #a33f38 !important; }

.app-header {
  min-height: 86px;
  padding: 16px 28px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #ffffff;
  border-bottom: 1px solid #dce4ea;
}
.eyebrow { margin: 0 0 4px; color: #5d7484; font-size: 11px; font-weight: 750; letter-spacing: 0.08em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 23px; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 17px; }
.header-status { display: flex; align-items: center; gap: 10px; }
#version-label { color: #4e6675; font-size: 13px; }
.primary-button, .secondary-button, .icon-button, .small-icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
}
.primary-button { padding: 10px 16px; color: #fff; background: #137d6d; }
.secondary-button { padding: 10px 14px; color: #315365; background: #eef4f7; border-color: #d3e0e6; }
.icon-button { width: 36px; height: 36px; color: #315365; background: #eef4f7; border-color: #d3e0e6; font-size: 20px; }
.small-icon-button { width: 24px; height: 24px; color: #137d6d; background: #e5f3ef; border-color: #b7dcd4; font-size: 18px; line-height: 1; }
.primary-button:hover { background: #0e695c; }
.secondary-button:hover, .icon-button:hover { background: #e5eef2; }

.workspace { min-height: calc(100vh - 86px); display: grid; grid-template-columns: 254px minmax(520px, 1fr) 336px; }
.navigator { padding: 22px 14px; background: #f7fafb; border-right: 1px solid #dce4ea; }
.nav-section + .nav-section { margin-top: 22px; }
.nav-heading { width: 100%; padding: 0 10px 9px; color: #6a7d89; font-size: 12px; font-weight: 800; }
.nav-section-toggle { display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; text-align: left; cursor: pointer; }
.nav-section-toggle:hover { color: #137d6d; }
.nav-section-chevron { color: #8296a1; font-size: 16px; line-height: 1; transition: transform .16s ease; }
.nav-section.collapsed .nav-section-chevron { transform: rotate(-90deg); }
.nav-section.collapsed nav { display: none; }
.nav-heading-rules { display: flex; align-items: center; justify-content: space-between; padding-right: 0; }
.nav-heading-rules .nav-section-toggle { flex: 1; padding-right: 7px; }
.nav-item { width: 100%; min-height: 45px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 6px; color: #263944; background: transparent; text-align: left; }
.nav-item:hover { background: #e9f0f3; }
.nav-item.selected { color: #0b675b; background: #dff2ec; }
.nav-item .nav-icon { width: 22px; text-align: center; font-size: 16px; }
.nav-item small { display: block; margin-top: 2px; color: #778b96; font-size: 11px; font-weight: 600; }
.nav-item .disabled { margin-left: auto; color: #b18036; font-size: 11px; }

.editor-region { padding: 26px; background: #fff; }
.notice { min-height: 0; margin-bottom: 0; border-radius: 6px; color: #2f5c55; font-size: 13px; }
.notice:not(:empty) { min-height: 38px; padding: 10px 12px; margin-bottom: 18px; background: #e4f3ef; border: 1px solid #c1e1d9; }
.notice.error { color: #993e36; background: #fbeceb; border-color: #f2c2bd; }
.editor-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid #e5ecef; }
.editor-title h2 { font-size: 21px; }
.editor-title p { margin: 6px 0 0; color: #66808e; font-size: 13px; }
.remove-button { padding: 8px 11px; color: #b2433a; background: #fff4f2; border: 1px solid #efc7c2; border-radius: 5px; font-size: 13px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 22px 0; }
.form-grid.single { grid-template-columns: 1fr; }
.field { display: grid; gap: 7px; }
.field.span-two { grid-column: 1 / -1; }
.field label { color: #48616f; font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; color: #1d3039; background: #fff; border: 1px solid #cddbe1; border-radius: 5px; outline: none; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #159985; box-shadow: 0 0 0 3px rgba(21, 153, 133, 0.12); }
.route-address { margin: 1px 0 0; color: #738793; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.route-address code { color: #315365; font-size: 11px; }
.route-list { display: grid; gap: 8px; max-height: 520px; overflow: auto; padding: 12px; border: 1px solid #dce6ea; border-radius: 6px; background: #f8fbfc; }
.route-row { display: grid; grid-template-columns: minmax(118px, 0.36fr) minmax(0, 1fr); align-items: center; gap: 10px; }
.route-row code { overflow: hidden; color: #3c5f70; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.route-row input { min-width: 0; padding: 9px 10px; color: #1d3039; background: #fff; border: 1px solid #cddbe1; border-radius: 5px; outline: none; font-size: 12px; }
.route-row input:focus { border-color: #159985; box-shadow: 0 0 0 3px rgba(21, 153, 133, 0.12); }
.switch-field { display: flex; align-items: center; gap: 9px; padding-top: 26px; }
.switch-field input { width: 18px; height: 18px; accent-color: #137d6d; }
.section-caption { margin: 8px 0 0; color: #728792; font-size: 13px; line-height: 1.55; }
.empty-state { min-height: 380px; display: grid; place-content: center; gap: 7px; color: #748994; text-align: center; }
.compact-empty { min-height: 130px; }
.management-summary { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 0; }
.management-summary span { min-width: 150px; padding: 12px 14px; color: #5a707c; background: #f4f8f9; border: 1px solid #dce7ea; border-radius: 6px; font-size: 12px; }
.management-summary strong { display: block; margin-bottom: 3px; color: #183c47; font-size: 18px; }
.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.management-card { padding: 15px; border: 1px solid #dce6ea; border-radius: 7px; background: #fbfdfd; }
.management-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.management-card-heading strong { display: block; color: #223b47; font-size: 14px; }
.management-card-heading small, .management-table small { display: block; margin-top: 4px; color: #718690; font-size: 11px; overflow-wrap: anywhere; }
.management-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin: 13px 0; }
.management-metrics span { padding: 4px 7px; color: #526d78; background: #edf4f5; border-radius: 4px; font-size: 11px; }
.management-actions { min-height: 32px; display: flex; align-items: center; justify-content: flex-end; }
.compact { padding: 6px 9px; font-size: 12px; }
.muted-text { color: #788c95; font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; color: #516873; background: #e8eff2; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill.success { color: #0b685b; background: #dff2ec; }
.status-pill.warning { color: #8b5b17; background: #fff0d8; }
.status-pill.error { color: #9b3c34; background: #fbe6e4; }
.status-pill.working { color: #315d85; background: #e3eef8; }
.table-shell { width: 100%; margin: 12px 0 26px; overflow: auto; border: 1px solid #dce6ea; border-radius: 7px; }
.management-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 12px; }
.management-table th { padding: 10px 11px; color: #536b77; background: #f2f7f8; border-bottom: 1px solid #dce6ea; text-align: left; white-space: nowrap; }
.management-table td { max-width: 260px; padding: 11px; color: #304852; border-bottom: 1px solid #e8eef0; vertical-align: top; overflow-wrap: anywhere; }
.management-table tr:last-child td { border-bottom: 0; }
.management-table.devices { min-width: 820px; }
.table-scroll-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: #70848f; font-size: 12px; }
.table-scroll-toolbar > div { display: flex; gap: 6px; }
.device-table-shell { position: relative; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; scrollbar-gutter: stable; scrollbar-color: #92aeb9 #edf3f5; }
.device-table-shell:focus { outline: 3px solid rgba(21, 153, 133, .18); outline-offset: 2px; }
.device-table-shell::-webkit-scrollbar { height: 12px; }
.device-table-shell::-webkit-scrollbar-track { background: #edf3f5; border-radius: 99px; }
.device-table-shell::-webkit-scrollbar-thumb { background: #92aeb9; border: 3px solid #edf3f5; border-radius: 99px; }
.device-table-shell .device-primary-cell { position: sticky; left: 0; z-index: 2; width: 156px; min-width: 156px; max-width: 156px; background: #fff; box-shadow: 7px 0 10px -10px rgba(26, 52, 63, .52); }
.device-table-shell .device-primary-cell strong, .device-table-shell .device-primary-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-table-shell thead .device-primary-cell { z-index: 4; background: #f2f7f8; }
.device-table-shell .device-action-cell { position: sticky; right: 0; z-index: 2; min-width: 132px; background: #fff; box-shadow: -7px 0 10px -10px rgba(26, 52, 63, .52); }
.device-table-shell thead .device-action-cell { z-index: 4; background: #f2f7f8; }
.progress-track { width: 150px; height: 7px; overflow: hidden; background: #dde7ea; border-radius: 99px; }
.progress-track span { height: 100%; display: block; background: #159985; border-radius: inherit; }
.release-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 20px 0; }
.release-card { min-height: 140px; display: grid; align-content: start; gap: 7px; padding: 15px; border: 1px solid #dce6ea; border-radius: 7px; background: #fbfdfd; }
.release-card small { color: #70838e; font-weight: 800; }
.release-card strong { color: #173d48; font-size: 20px; }
.release-card > span { color: #55717e; font-size: 12px; }
.release-card p { margin: 3px 0 0; color: #748791; font-size: 12px; line-height: 1.5; }
.release-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0 22px; border-bottom: 1px solid #e5ecef; }
.validation-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.validation-list li { display: grid; gap: 4px; padding: 9px 10px; border-radius: 5px; font-size: 12px; }
.validation-list li.error { color: #903f38; background: #fbeceb; }
.validation-list li.warning { color: #805d1f; background: #fff4df; }
.validation-list code { color: inherit; font-size: 11px; }

.telemetry-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 18px 0 4px; }
.telemetry-toolbar label { display: grid; gap: 6px; color: #536b77; font-size: 11px; font-weight: 800; }
.telemetry-toolbar select { min-width: 130px; padding: 8px 10px; color: #263f4a; background: #fff; border: 1px solid #cddbe1; border-radius: 5px; }
.telemetry-toolbar > span { margin-left: auto; padding-bottom: 8px; color: #718690; font-size: 11px; }
.telemetry-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 16px 0 24px; }
.telemetry-card { min-height: 128px; display: grid; align-content: start; gap: 6px; padding: 14px; border: 1px solid #dce6ea; border-radius: 8px; background: #fbfdfd; }
.telemetry-card.primary { border-color: #8dcec2; background: #eaf7f3; }
.telemetry-card small { color: #5c7480; font-size: 11px; font-weight: 800; }
.telemetry-card strong { color: #173d48; font-size: 23px; }
.telemetry-card.primary strong { color: #0b685b; }
.telemetry-card p { margin: 0; color: #748891; font-size: 10px; line-height: 1.45; }
.telemetry-panels { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr); gap: 18px; margin-bottom: 22px; }
.telemetry-panels > section { min-width: 0; padding: 16px; border: 1px solid #dce6ea; border-radius: 8px; background: #fbfdfd; }
.telemetry-trend { display: grid; gap: 9px; margin-top: 17px; max-height: 270px; overflow: auto; }
.telemetry-trend-row { display: grid; grid-template-columns: 42px minmax(80px, 1fr) 48px; align-items: center; gap: 8px; font-size: 10px; }
.telemetry-trend-row time { color: #70858f; }
.telemetry-trend-row strong { color: #315d57; text-align: right; }
.telemetry-trend-track { height: 9px; overflow: hidden; background: #e2ecee; border-radius: 99px; }
.telemetry-trend-track i { height: 100%; display: block; background: linear-gradient(90deg, #19a18a, #6db9ab); border-radius: inherit; }
.telemetry-table { min-width: 540px; }
.telemetry-method { margin-top: 22px; padding: 16px 18px; color: #49636f; background: #f1f7f7; border-left: 4px solid #159985; border-radius: 5px; }
.telemetry-method strong { color: #0b685b; }
.telemetry-method p { margin: 7px 0 0; font-size: 12px; line-height: 1.55; }

.preview-region { padding: 22px 18px; background: #f7fafb; border-left: 1px solid #dce4ea; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.preview-device { padding: 5px 8px; color: #5d7180; background: #e7eef1; border-radius: 4px; font-size: 11px; font-weight: 750; }
.phone-preview { position: relative; min-height: 664px; padding: 20px 14px 14px; overflow: hidden; color: #f7fcff; border: 8px solid #23323b; border-radius: 32px; background: linear-gradient(165deg, #19384b, #071118 54%, #04090d); box-shadow: 0 16px 38px rgba(32, 58, 72, 0.2); }
.context-panel { min-height: 100%; padding: 22px 16px; color: #e8f7f4; }
.context-panel h3 { margin: 6px 0 22px; font-size: 21px; }
.context-panel dl { display: grid; grid-template-columns: 1fr auto; gap: 12px 8px; margin: 0 0 26px; }
.context-panel dt { color: #a8c2cb; font-size: 12px; }
.context-panel dd { margin: 0; color: #e8f7f4; font-size: 13px; font-weight: 800; text-align: right; }
.context-panel p:last-child { color: #a8c2cb; font-size: 12px; line-height: 1.6; }
.phone-notch { width: 104px; height: 20px; margin: -12px auto 30px; border-radius: 0 0 14px 14px; background: #23323b; }
.preview-message { width: 86%; padding: 13px; color: #e8f8f4; background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; font-size: 13px; line-height: 1.5; }
.preview-bottom { position: absolute; right: 0; bottom: 0; left: 0; padding: 12px 10px calc(12px + env(safe-area-inset-bottom)); background: rgba(10, 28, 38, 0.96); border-top: 1px solid rgba(255,255,255,0.12); }
.preview-voice { min-height: 58px; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; background: rgba(255,255,255,0.08); }
.preview-voice-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: #16a58e; font-size: 18px; }
.preview-voice-copy { min-width: 0; flex: 1; font-size: 12px; font-weight: 750; }
.preview-voice-copy small { display: block; margin-top: 3px; color: #a7c3cc; font-size: 10px; font-weight: 600; }
.preview-input { padding: 7px 8px; color: #bdd3da; border-radius: 9px; background: rgba(255,255,255,0.10); font-size: 10px; }
.preview-quick { display: flex; gap: 5px; margin: 9px 0; }
.preview-quick span { min-width: 0; flex: 1; padding: 5px 3px; overflow: hidden; color: #8be6d3; border-radius: 6px; background: rgba(41, 190, 166, 0.12); font-size: 9px; font-weight: 750; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.preview-dock { display: grid; gap: 2px; }
.preview-dock.count-1 { grid-template-columns: 1fr; }.preview-dock.count-2 { grid-template-columns: repeat(2,1fr); }.preview-dock.count-3 { grid-template-columns: repeat(3,1fr); }.preview-dock.count-4 { grid-template-columns: repeat(4,1fr); }.preview-dock.count-5 { grid-template-columns: repeat(5,1fr); }
.preview-dock-item { min-width: 0; display: grid; justify-items: center; gap: 2px; color: #e6f2f6; font-size: 9px; font-weight: 750; text-align: center; }
.preview-dock-item strong { font-size: 17px; line-height: 1; }.preview-dock-item span { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.preview-note { margin: 14px 4px 0; color: #6f828d; font-size: 12px; line-height: 1.5; }

@media (max-width: 1460px) { .telemetry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .telemetry-panels { grid-template-columns: 1fr; } }
@media (max-width: 1180px) { .workspace { grid-template-columns: 224px minmax(480px, 1fr) 306px; } .editor-region { padding: 22px; } .management-grid, .release-grid { grid-template-columns: 1fr; } .telemetry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
