:root {
  --ink: #14211d;
  --ink-soft: #42524c;
  --muted: #75817d;
  --paper: #f3f5f0;
  --panel: #ffffff;
  --line: #dfe5df;
  --dark: #101a17;
  --dark-soft: #192823;
  --accent: #d9f36a;
  --accent-dark: #79951a;
  --good: #37a46c;
  --danger: #d15c4d;
  --warning: #d4a130;
  --info: #3c82d1;
  --shadow: 0 18px 50px rgba(23, 39, 32, .08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
p { line-height: 1.55; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow.accent { color: var(--accent-dark); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.brand-mark {
  position: relative;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
}
.brand-mark span {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border: 2px solid var(--accent);
  border-radius: 50% 45% 52% 44%;
  transform: rotate(22deg);
}
.brand-mark span:nth-child(2) { width: 30px; height: 30px; transform: rotate(72deg); opacity: .7; }
.brand-mark span:nth-child(3) { width: 12px; height: 12px; border-width: 3px; opacity: 1; }
.brand-mark.small { width: 42px; height: 42px; }
.brand-mark.small span { width: 32px; height: 32px; }
.brand-mark.small span:nth-child(2) { width: 21px; height: 21px; }
.brand-mark.small span:nth-child(3) { width: 8px; height: 8px; }

/* Login */
.login-page {
  display: grid;
  place-items: center;
  padding: 28px;
  color: #f3f6f1;
  background:
    radial-gradient(circle at 12% 85%, rgba(217, 243, 106, .13), transparent 28%),
    radial-gradient(circle at 88% 15%, rgba(86, 145, 120, .13), transparent 25%),
    var(--dark);
}
.login-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 480px);
  width: min(1040px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 28px;
  box-shadow: 0 40px 100px rgba(0,0,0,.35);
}
.login-brand {
  position: relative;
  min-height: 650px;
  padding: 64px;
  background:
    linear-gradient(rgba(16,26,23,.33), rgba(16,26,23,.75)),
    repeating-linear-gradient(115deg, transparent 0 44px, rgba(255,255,255,.025) 44px 45px),
    #172820;
}
.login-brand::after {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  left: -100px;
  bottom: -120px;
  border: 1px solid rgba(217,243,106,.22);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(217,243,106,.025), 0 0 0 110px rgba(217,243,106,.018);
}
.login-brand h1 { margin: 74px 0 24px; font-size: clamp(48px, 6vw, 78px); line-height: .94; letter-spacing: -.055em; }
.login-intro { max-width: 430px; color: #a9b8b0; font-size: 17px; }
.login-pulse { position: absolute; bottom: 54px; display: flex; gap: 11px; align-items: center; color: #a9b8b0; font: 700 12px/1 monospace; letter-spacing: .08em; }
.login-pulse i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(217,243,106,.12); }
.login-card { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 58px; color: var(--ink); background: #fbfcf9; }
.login-card h2 { margin: 0; font-size: 32px; letter-spacing: -.035em; }
.login-card .muted { margin: 8px 0 0; }
.auth-form { display: grid; gap: 19px; }
label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-weight: 500; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: #91ad2f; box-shadow: 0 0 0 4px rgba(191,216,86,.18); }
textarea { resize: vertical; }
.login-footnote { margin: 0; color: var(--muted); font-size: 11px; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.notice-error { color: #832d22; background: #fbeae7; }
.notice-warning { color: #79580e; background: #fff5d6; }

/* Application shell */
.app-page { display: grid; grid-template-columns: 248px minmax(0, 1fr); background: var(--paper); }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 18px 20px;
  color: #eef3ef;
  background: var(--dark);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 30px; }
.brand strong { display: block; letter-spacing: .17em; font-size: 16px; }
.brand small { display: block; margin-top: 4px; color: #758880; font-size: 9px; letter-spacing: .12em; }
.main-nav { display: grid; gap: 5px; }
.nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  color: #9eb0a8;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}
.nav-link > span { display: grid; place-items: center; width: 21px; height: 21px; color: #72877e; font-size: 17px; }
.nav-link b { margin-left: auto; min-width: 23px; padding: 3px 6px; border-radius: 20px; color: #a9bbb3; background: rgba(255,255,255,.07); text-align: center; font-size: 10px; }
.nav-link:hover { color: #f6faf6; background: rgba(255,255,255,.045); }
.nav-link.active { color: #162019; background: var(--accent); }
.nav-link.active > span { color: #41510d; }
.nav-link.active b { color: #31400a; background: rgba(20,33,29,.13); }
.sidebar-bottom { display: grid; gap: 8px; margin-top: auto; }
.user-card { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.09); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #586b63; border-radius: 50%; color: var(--accent); background: #22322c; font-weight: 800; }
.user-card strong { display: block; overflow: hidden; color: #eff5f1; font-size: 12px; text-overflow: ellipsis; }
.user-card small { color: #71837c; font-size: 10px; }
.user-card form button { border: 0; color: #75877f; background: transparent; cursor: pointer; font-size: 18px; }

.workspace { min-width: 0; padding: 0 42px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 116px; gap: 24px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: clamp(25px, 3vw, 35px); letter-spacing: -.045em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.broker-state { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 30px; color: var(--muted); background: rgba(255,255,255,.55); font-size: 11px; font-weight: 700; }
.broker-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.broker-state.connected i { background: var(--good); box-shadow: 0 0 0 4px rgba(55,164,108,.12); }
.broker-state.disconnected i { background: var(--danger); }
.view { display: none; padding-top: 34px; }
.view.active { display: block; animation: view-in .24s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: transform .15s, background .15s, border-color .15s;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button-primary { color: #15200d; background: var(--accent); }
.button-primary:hover { background: #e3fa83; }
.button-secondary { border-color: var(--line); color: var(--ink); background: #fff; }
.button-light { color: var(--dark); background: #fff; }
.button-large { min-height: 49px; }
.text-button { border: 0; color: #5f7414; background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: #fff; cursor: pointer; font-size: 22px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { min-height: 152px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.72); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset; }
.metric-dark { border-color: var(--dark); color: #fff; background: var(--dark-soft); }
.metric-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metric-dark .metric-label { color: #8fa098; }
.metric-card > strong { display: block; margin: 23px 0 4px; font-size: 36px; line-height: 1; letter-spacing: -.05em; }
.metric-card p { margin: 0; color: var(--muted); font-size: 11px; }
.metric-dark p { color: #8fa098; }
.metric-dark p b { color: var(--accent); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #a8b0ac; box-shadow: 0 0 0 5px rgba(168,176,172,.1); }
.status-dot.good { background: var(--good); box-shadow: 0 0 0 5px rgba(55,164,108,.1); }
.status-dot.danger { background: var(--danger); box-shadow: 0 0 0 5px rgba(209,92,77,.1); }
.status-dot.info { background: var(--info); box-shadow: 0 0 0 5px rgba(60,130,209,.1); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; margin-top: 16px; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.76); }
.panel.span-two { min-height: 300px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.panel h2, .section-toolbar h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.panel-heading .badge { flex: 0 0 auto; }
.callout-panel { color: #f4f7f4; background: linear-gradient(145deg, #1a2b25, #101a17); border-color: #1b2b26; }
.callout-panel h2 { margin: 8px 0 12px; font-size: 25px; }
.callout-panel p:not(.eyebrow) { color: #a5b4ad; font-size: 13px; }
.callout-panel .button { margin-top: 16px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: #89938f; text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid #e8ece8; color: var(--ink-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr[data-device-id] { cursor: pointer; }
tbody tr[data-device-id]:hover td { background: rgba(217,243,106,.09); }
.device-cell { display: flex; align-items: center; gap: 10px; }
.device-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #557118; background: #eff6d1; font-weight: 900; }
.device-cell strong { display: block; color: var(--ink); font-size: 12px; }
.device-cell small { display: block; margin-top: 2px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.empty { padding: 32px !important; color: var(--muted); text-align: center; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 20px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.good, .badge.completed { color: #237a4e; background: #e5f5eb; }
.badge.offline, .badge.failed, .badge.publish_failed, .badge.completed_version_mismatch, .badge.attention, .badge.critical, .badge.error { color: #a44539; background: #f9e9e6; }
.badge.warning, .badge.queued, .badge.paused, .badge.observing { color: #956b0e; background: #fff3d3; }
.badge.published, .badge.scheduled, .badge.running, .badge.info { color: #2e6fad; background: #e7f1fc; }
.badge.waiting_online { color: #69746f; background: #edf0ee; }
.badge.neutral { color: #69746f; background: #edf0ee; }
.error-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 8px; color: #a44539; background: #f9e9e6; font-weight: 900; }

.compact-list { display: grid; gap: 4px; }
.compact-error { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid #e8ece8; }
.compact-error:last-child { border-bottom: 0; }
.compact-error > i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--danger); }
.compact-error.warning > i { background: var(--warning); }
.compact-error strong { display: block; font-size: 11px; }
.compact-error p { overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.compact-error time { color: #9aa39f; font-size: 9px; white-space: nowrap; }
.version-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.version-item { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.version-item code { display: block; overflow: hidden; color: var(--ink); font-weight: 900; text-overflow: ellipsis; }
.version-item strong { display: block; margin-top: 16px; font-size: 25px; }
.version-item span { color: var(--muted); font-size: 9px; text-transform: uppercase; }

.section-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 20px; }
.section-toolbar h2 { font-size: 26px; }
.section-toolbar p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.toolbar-controls { display: flex; align-items: center; gap: 9px; }
.toolbar-controls select { min-width: 170px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(360px, 100%); padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.search-box span { color: var(--muted); font-size: 20px; }
.search-box input { border: 0; box-shadow: none; background: transparent; }
.table-wrap.wide { min-height: 300px; }

.release-grid { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 16px; }
.release-card { display: flex; flex-direction: column; min-height: 275px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.78); }
.release-card header { display: flex; justify-content: space-between; gap: 16px; }
.release-card h3 { margin: 5px 0 0; font-size: 25px; letter-spacing: -.04em; }
.release-card .file-name { overflow: hidden; margin: 20px 0 4px; color: var(--ink-soft); font: 700 11px/1.4 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.release-card .hash { overflow: hidden; color: var(--muted); font: 9px/1.4 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.release-card .notes { display: -webkit-box; overflow: hidden; margin: 16px 0; color: var(--muted); font-size: 11px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.release-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; margin: 11px 0; }
.release-tag { padding: 4px 7px; border-radius: 7px; color: #426052; background: #edf2ed; font-size: 8px; font-weight: 800; }
.release-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.release-card .button { margin-top: 14px; }

.rollout-grid { display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.rollout-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.8); }
.rollout-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.rollout-card h3 { margin: 3px 0 0; font-size: 18px; }
.rollout-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 17px 0; }
.rollout-summary div { padding: 10px; border-radius: 9px; background: #f1f4ef; }
.rollout-summary strong { display: block; font-size: 18px; }
.rollout-summary span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.rollout-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: 9px; }
.rollout-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

.error-list { display: grid; gap: 10px; }
.error-card { display: grid; grid-template-columns: 9px minmax(170px, .7fr) minmax(250px, 1.6fr) auto; gap: 18px; align-items: center; padding: 17px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.78); }
.severity-line { width: 7px; height: 42px; border-radius: 5px; background: var(--danger); }
.severity-line.warning { background: var(--warning); }
.severity-line.info { background: var(--info); }
.error-card strong { display: block; font-size: 12px; }
.error-card small { color: var(--muted); font: 9px/1.5 ui-monospace, monospace; }
.error-card p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.error-card footer { min-width: 140px; text-align: right; }
.error-card time { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; }
.toggle { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 9px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle > span { position: relative; width: 35px; height: 20px; border-radius: 20px; background: #cbd2ce; transition: background .2s; }
.toggle > span::after { content: ""; position: absolute; width: 14px; height: 14px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle input:checked + span { background: var(--good); }
.toggle input:checked + span::after { left: 18px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 16px; }
.lab-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 16px; }
.simulator-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.simulator-actions { display: flex; align-items: flex-end; gap: 8px; grid-column: 1 / -1; }
.simulator-controls .deployment-warning { grid-column: 1 / -1; margin-top: 18px; }
.simulator-summary .detail-metrics { grid-template-columns: repeat(2, 1fr); }
.account-form { display: grid; gap: 13px; margin-top: 20px; }
.mfa-box { display: grid; gap: 14px; margin-top: 18px; padding: 16px; border-radius: 12px; background: #f0f3ee; }
.mfa-box p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.mfa-box code { overflow-wrap: anywhere; padding: 12px; border: 1px dashed #a8b4ae; border-radius: 8px; background: #fff; letter-spacing: .14em; }
.release-type-list { display: grid; gap: 7px; margin: 22px 0; }
.release-type-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf7; }
.release-type-item strong { font-size: 12px; }
.release-type-item span { color: var(--muted); font-size: 9px; }
.inline-create-form { display: grid !important; grid-template-columns: 1fr auto; align-items: end; gap: 10px !important; padding: 17px 0 0 !important; border-top: 1px solid var(--line); }

/* Modals */
.modal { width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 0; border-radius: 20px; color: var(--ink); box-shadow: 0 35px 100px rgba(6,20,13,.35); }
.modal.modal-wide { width: min(760px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(9, 20, 15, .68); backdrop-filter: blur(5px); }
.modal > form, .modal > div { padding: 28px; }
.modal form { display: grid; gap: 20px; }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.modal-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.file-drop { place-items: center; padding: 28px 16px; border: 1px dashed #aab7b0; border-radius: 13px; background: #f7f9f5; text-align: center; cursor: pointer; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop strong { color: var(--ink); font-size: 13px; }
.file-drop span { color: var(--muted); font-size: 10px; font-weight: 500; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.device-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; max-height: 250px; overflow-y: auto; padding: 3px; }
.device-checklist label { display: flex; grid-template-columns: none; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.device-checklist input { width: 16px; height: 16px; }
.device-checklist small { margin-left: auto; }
.choice-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice-group legend { grid-column: 1 / -1; }
.choice-group label { display: flex; grid-template-columns: none; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice-group input { width: 16px; height: 16px; margin-top: 2px; }
.choice-group strong, .choice-group small { display: block; }
.choice-group small { margin-top: 3px; font-size: 9px; line-height: 1.35; }
.rollout-parameters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; border-radius: 12px; background: #f1f4ef; }
.deployment-warning { padding: 13px 15px; border-left: 3px solid var(--warning); border-radius: 0 9px 9px 0; background: #fff7df; }
.deployment-warning strong { font-size: 11px; }
.deployment-warning p { margin: 3px 0 0; color: #7a662e; font-size: 10px; }
.device-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.device-detail-head h2 { margin: 0; font-size: 26px; }
.device-detail-head code { color: var(--muted); font-size: 10px; }
.detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0; }
.detail-metric { padding: 12px; border-radius: 10px; background: #f2f5f0; }
.detail-metric span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.detail-metric strong { display: block; margin-top: 5px; font-size: 17px; }
.metadata-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.metadata-form .full { grid-column: 1 / -1; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 10px; font-size: 14px; }

.toast-region { position: fixed; top: 18px; right: 22px; display: grid; gap: 8px; z-index: 100; }
.toast { min-width: 260px; max-width: 390px; padding: 13px 15px; border: 1px solid #cbd4ce; border-radius: 11px; color: #eef6f0; background: #20322b; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease-out; }
.toast.error { border-color: #8d4a41; background: #552d28; }
@keyframes toast-in { from { opacity: 0; transform: translateX(8px); } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .release-grid { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
  .rollout-grid { grid-template-columns: 1fr; }
  .version-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .app-page { display: block; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .brand { padding-bottom: 12px; }
  .main-nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .nav-link { flex: 0 0 auto; width: auto; }
  .nav-link b, .sidebar-bottom { display: none; }
  .workspace { padding: 0 18px 45px; }
  .topbar { min-height: 96px; }
  .topbar-actions .broker-state { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .panel.span-two { min-height: auto; }
  .settings-grid { grid-template-columns: 1fr; }
  .lab-grid { grid-template-columns: 1fr; }
  .error-card { grid-template-columns: 7px 1fr auto; }
  .error-card > p { grid-column: 2 / -1; }
}

@media (max-width: 620px) {
  .login-page { padding: 0; }
  .login-shell { display: block; border: 0; border-radius: 0; }
  .login-brand { min-height: 250px; padding: 35px 28px; }
  .login-brand h1 { margin: 35px 0 15px; font-size: 50px; }
  .login-intro, .login-pulse { display: none; }
  .login-card { padding: 38px 28px; }
  .topbar { align-items: flex-start; padding: 20px 0; }
  .topbar .button { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 135px; padding: 16px; }
  .metric-card > strong { margin-top: 18px; font-size: 30px; }
  .release-grid { grid-template-columns: 1fr; }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-controls { align-items: stretch; flex-direction: column; }
  .toolbar-controls .search-box { width: 100%; }
  .simulator-form { grid-template-columns: 1fr; }
  .simulator-actions { grid-column: auto; flex-direction: column; align-items: stretch; }
  .device-checklist { grid-template-columns: 1fr; }
  .choice-group, .rollout-parameters { grid-template-columns: 1fr; }
  .detail-metrics { grid-template-columns: 1fr 1fr; }
  .metadata-form { grid-template-columns: 1fr; }
  .metadata-form .full { grid-column: auto; }
  .error-card { grid-template-columns: 7px 1fr; }
  .error-card footer { grid-column: 2; text-align: left; }
}
