:root {
  --blue: #1374e8;
  --blue-dark: #0759bd;
  --blue-soft: #eaf4ff;
  --ink: #152033;
  --muted: #6d788c;
  --line: #e7ebf1;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --green: #19ad73;
  --green-soft: #e8f8f1;
  --coral: #ed6a67;
  --coral-soft: #fff0ef;
  --violet: #7357d8;
  --violet-soft: #f0edff;
  --shadow: 0 18px 45px rgba(29, 47, 75, .09);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: #4e8edc; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.eyebrow.light { color: rgba(255, 255, 255, .7); }
.eyebrow.light-blue { color: #4d8ee4; }

.login-screen { min-height: 100vh; display: grid; place-items: center; overflow: hidden; position: relative; padding: 32px; background: linear-gradient(135deg, #0d65ce 0%, #167cea 50%, #5ba7f5 100%); }
.login-screen::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 46px 46px; mask-image: linear-gradient(to right, black, transparent 75%); }
.login-orb { position: absolute; border-radius: 50%; filter: blur(2px); background: rgba(255,255,255,.12); }
.orb-one { width: 430px; height: 430px; top: -170px; right: -100px; }
.orb-two { width: 280px; height: 280px; bottom: -100px; left: 10%; }
.login-layout { position: relative; z-index: 1; width: min(1040px, 100%); display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 90px; }
.login-intro { color: #fff; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #2089fb, #0863cd); font-weight: 900; box-shadow: 0 9px 18px rgba(5, 82, 171, .22); }
.brand-mark-large { width: 58px; height: 58px; margin-bottom: 34px; border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.16); box-shadow: none; backdrop-filter: blur(8px); font-size: 24px; }
.login-intro h1 { margin: 0; font-size: clamp(42px, 5vw, 68px); line-height: 1.08; letter-spacing: -.04em; }
.login-intro > p:not(.eyebrow) { max-width: 520px; margin: 22px 0 34px; color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.8; }
.login-features { display: flex; flex-wrap: wrap; gap: 11px; }
.login-features span { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.17); border-radius: 999px; background: rgba(255,255,255,.09); color: rgba(255,255,255,.84); font-size: 12px; backdrop-filter: blur(6px); }
.login-features i { width: 6px; height: 6px; border-radius: 50%; background: #9fe7ca; box-shadow: 0 0 0 4px rgba(159,231,202,.12); }
.login-card { padding: 48px; border: 1px solid rgba(255,255,255,.54); border-radius: 26px; background: rgba(255,255,255,.96); box-shadow: 0 28px 70px rgba(4, 52, 111, .23); backdrop-filter: blur(14px); }
.login-card h2 { margin: 0; font-size: 29px; letter-spacing: -.02em; }
.login-copy { margin: 10px 0 30px; font-size: 14px; }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 30px; font-weight: 800; }
.field-label { display: block; margin: 17px 0 8px; font-size: 13px; font-weight: 700; color: #3d4a5e; }
.input-wrap { position: relative; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--ink); background: #fafbfc; transition: border-color .2s, box-shadow .2s, background .2s; }
input, select { height: 46px; padding: 0 14px; }
textarea { min-height: 120px; resize: vertical; padding: 13px 14px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: #77b2f5; background: #fff; box-shadow: 0 0 0 4px rgba(19,116,232,.1); }
.input-wrap input { padding-left: 43px; padding-right: 68px; }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #78a9df; font-size: 9px; }
.key-icon { font-size: 11px; }
.password-toggle { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #6e7c90; font-size: 12px; }
.form-error { min-height: 18px; margin: 9px 0 0; color: #dc4b4b; font-size: 12px; }
.primary-button, .secondary-button, .white-button, .text-button, .logout-button, .icon-button, .page-button { border: 0; border-radius: 10px; transition: transform .15s, background .2s, opacity .2s, box-shadow .2s; }
.primary-button { min-height: 42px; padding: 0 18px; color: #fff; background: linear-gradient(135deg, #1683f3, #0966d3); font-weight: 700; box-shadow: 0 8px 18px rgba(19,116,232,.18); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 11px 22px rgba(19,116,232,.25); }
.primary-button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.login-button { width: 100%; height: 49px; display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }
.security-note { margin: 22px 0 0; text-align: center; color: #8590a1; font-size: 11px; }
.security-note span { color: var(--green); margin-right: 5px; }

.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; background: var(--canvas); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; }
.sidebar-brand { height: 78px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid #edf0f4; }
.sidebar-brand > div:last-child { display: grid; gap: 3px; }
.sidebar-brand strong { font-size: 15px; }
.sidebar-brand span { color: #8b95a6; font-size: 11px; }
.nav-list { display: grid; gap: 6px; padding: 21px 14px; overflow-y: auto; }
.nav-item { height: 46px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; border: 0; border-radius: 11px; padding: 0 14px; color: #546174; background: transparent; text-align: left; font-weight: 650; }
.nav-item:hover { background: #f6f8fb; }
.nav-item.active { color: #0867d0; background: #eaf4ff; }
.nav-icon { width: 24px; font-size: 20px; font-weight: 400; }
.nav-count { min-width: 23px; padding: 3px 7px; border-radius: 99px; background: #edf0f4; color: #7b8595; font-size: 10px; text-align: center; }
.nav-item.active .nav-count { background: #d5eaff; color: #0967ce; }
.sidebar-footer { margin-top: auto; padding: 15px 14px 19px; }
.safe-mode { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid #dcefe7; border-radius: 12px; background: #f1fbf7; }
.safe-mode > div { display: grid; gap: 4px; }
.safe-mode strong { font-size: 11px; }
.safe-mode span:not(.pulse-dot) { color: #698078; font-size: 9px; line-height: 1.5; }
.pulse-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(25,173,115,.12); }
.logout-button { width: 100%; height: 42px; margin-top: 10px; color: #687488; background: transparent; }
.logout-button:hover { color: #d34f4f; background: #fff2f2; }
.logout-button span { margin-right: 7px; }

.page-shell { min-width: 0; }
.topbar { height: 78px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.91); backdrop-filter: blur(16px); }
.topbar-kicker { margin: 0 0 3px; color: #97a0ae; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.topbar h2 { margin: 0; font-size: 18px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.connection-chip { height: 31px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border-radius: 99px; background: var(--green-soft); color: #238560; font-size: 10px; }
.connection-chip span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(25,173,115,.1); }
.connection-chip.offline { color: #967239; background: #fff8e7; }
.connection-chip.offline span { background: #e7a728; box-shadow: none; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; color: #536175; font-size: 18px; }
.icon-button:hover { background: #f5f8fc; }
.menu-button { display: none; margin-right: 12px; }
.user-menu { display: flex; align-items: center; gap: 9px; padding-left: 5px; }
.user-menu > div:last-child { display: grid; gap: 2px; }
.user-menu strong { font-size: 12px; }
.user-menu span { color: #8a94a4; font-size: 10px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #7b61df, #2991ed); font-size: 13px; font-weight: 800; box-shadow: 0 6px 14px rgba(47,119,209,.24); }

.main-content { padding: 25px 30px 40px; }
.view { display: none; animation: view-in .23s ease-out; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.hero-card { min-height: 174px; display: flex; align-items: center; justify-content: space-between; overflow: hidden; position: relative; padding: 34px 40px; border-radius: 20px; background: linear-gradient(116deg, #eff2ff 0%, #e8f4ff 57%, #dcedff 100%); }
.hero-card::after { content: ""; position: absolute; width: 310px; height: 310px; right: -80px; top: -165px; border: 45px solid rgba(255,255,255,.42); border-radius: 50%; }
.hero-card h1 { margin: 0 0 12px; font-size: 29px; letter-spacing: -.03em; }
.hero-card p:not(.eyebrow) { margin: 0; color: #64738b; font-size: 13px; }
.white-button { position: relative; z-index: 1; height: 43px; padding: 0 18px; color: #fff; background: var(--blue); font-weight: 700; box-shadow: 0 10px 22px rgba(19,116,232,.22); }
.white-button span { margin-left: 8px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 17px; }
.metric-card { min-height: 144px; position: relative; overflow: hidden; padding: 23px; border: 1px solid; border-radius: 16px; background: #fff; }
.metric-card.blue { border-color: #dcecff; background: linear-gradient(135deg, #fff, #eef7ff); }
.metric-card.green { border-color: #d3efe4; background: linear-gradient(135deg, #fff, #ebfaf4); }
.metric-card.coral { border-color: #f8dcda; background: linear-gradient(135deg, #fff, #fff1f0); }
.metric-card.violet { border-color: #e5ddfb; background: linear-gradient(135deg, #fff, #f3efff); }
.metric-card p { margin: 0 0 8px; color: #68758a; font-size: 12px; }
.metric-card strong { display: block; margin-bottom: 5px; font-size: 31px; letter-spacing: -.03em; }
.metric-card > span { color: #98a0ad; font-size: 10px; }
.metric-icon { position: absolute; right: 18px; top: 20px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: rgba(19,116,232,.08); font-size: 22px; }
.green .metric-icon { color: var(--green); background: rgba(25,173,115,.1); }
.coral .metric-icon { color: var(--coral); background: rgba(237,106,103,.1); }
.violet .metric-icon { color: var(--violet); background: rgba(115,87,216,.1); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .7fr); gap: 17px; margin-top: 17px; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 3px 12px rgba(36,51,73,.025); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 21px 22px 14px; }
.panel-head h3 { margin: 0; font-size: 17px; }
.text-button { padding: 7px 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 700; }
.recent-device-list { min-height: 240px; padding: 0 13px 13px; }
.recent-device { display: grid; grid-template-columns: 42px minmax(120px, 1.4fr) minmax(110px, 1fr) minmax(100px, .7fr) auto; align-items: center; gap: 12px; padding: 13px 10px; border-top: 1px solid #eff1f5; }
.device-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #1374e8; background: #edf6ff; font-size: 18px; }
.recent-device strong, .device-name { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.recent-device small { display: block; overflow: hidden; margin-top: 4px; color: #9099a7; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.status-badge, .permission-badge, .status-pill { display: inline-flex; align-items: center; gap: 5px; width: fit-content; border-radius: 99px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-badge { padding: 6px 9px; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-badge.online { color: #16865f; background: #e8f8f1; }
.status-badge.online::before { background: #19ad73; }
.status-badge.offline { color: #8c96a5; background: #f0f2f5; }
.status-badge.offline::before { background: #9da5b0; }
.health-panel { padding-bottom: 17px; }
.health-ring { width: 138px; height: 138px; display: grid; place-items: center; margin: 5px auto 18px; border-radius: 50%; background: conic-gradient(var(--blue) var(--health-angle, 0%), #edf1f6 0); position: relative; }
.health-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #fff; }
.health-ring > div { position: relative; z-index: 1; display: grid; text-align: center; }
.health-ring strong { font-size: 25px; }
.health-ring span { color: #8a95a5; font-size: 9px; }
.health-lines { padding: 0 20px; }
.health-lines > div { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid #eff1f5; font-size: 10px; }
.health-lines span { display: flex; align-items: center; gap: 7px; color: #667286; }
.health-lines i { width: 7px; height: 7px; border-radius: 50%; background: #e4a832; }
.health-lines .green-dot { background: var(--green); }
.health-lines .blue-dot { background: var(--blue); }
.success-text { color: var(--green); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 5px 0 21px; }
.section-heading h1 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.03em; }
.section-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.table-panel { overflow: hidden; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, 150px) auto auto; gap: 9px; padding: 16px; border-bottom: 1px solid var(--line); }
.filter-bar input, .filter-bar select { height: 39px; font-size: 11px; }
.search-box { position: relative; }
.search-box span { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: #8d98a7; }
.search-box input { padding-left: 37px; }
.small { min-height: 39px; height: 39px; padding: 0 15px; font-size: 11px; }
.secondary-button { min-height: 42px; padding: 0 17px; border: 1px solid #dfe4ea; color: #526074; background: #fff; font-weight: 700; }
.secondary-button:hover { background: #f7f9fc; }
.table-wrap { overflow-x: auto; }
.device-table { width: 100%; min-width: 1050px; border-collapse: collapse; }
.device-table th { height: 45px; padding: 0 14px; background: #fafbfc; color: #778295; font-size: 10px; font-weight: 700; text-align: left; white-space: nowrap; }
.device-table td { height: 69px; padding: 10px 14px; border-top: 1px solid #edf0f4; color: #3a4658; font-size: 11px; vertical-align: middle; }
.device-table tbody tr { transition: background .15s; }
.device-table tbody tr:hover { background: #fbfdff; }
.device-subline { display: block; max-width: 175px; overflow: hidden; margin-top: 4px; color: #96a0ae; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.battery-cell { display: flex; align-items: center; gap: 7px; }
.battery-shell { width: 28px; height: 12px; position: relative; padding: 2px; border: 1px solid #bcc5d1; border-radius: 3px; }
.battery-shell::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 5px; border-radius: 0 2px 2px 0; background: #bcc5d1; }
.battery-fill { height: 100%; max-width: 100%; border-radius: 1px; background: var(--green); }
.battery-low .battery-fill { background: var(--coral); }
.permission-stack { display: flex; flex-wrap: wrap; gap: 4px; max-width: 170px; }
.permission-badge { padding: 4px 6px; color: #647187; background: #f0f2f5; }
.permission-badge.yes { color: #16865f; background: #e8f8f1; }
.row-button { height: 31px; padding: 0 10px; border: 1px solid #dbe8f7; border-radius: 8px; color: #1673de; background: #f5faff; font-size: 10px; font-weight: 700; }
.empty-state { min-height: 330px; display: grid; place-items: center; align-content: center; padding: 30px; text-align: center; }
.empty-state > * { margin: 0; }
.empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 18px; color: var(--blue); background: var(--blue-soft); font-size: 30px; }
.empty-state p { margin: 7px 0 17px; color: var(--muted); font-size: 11px; }
.pagination { min-height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-top: 1px solid var(--line); color: #818b9b; font-size: 10px; }
.pagination > div { display: flex; align-items: center; gap: 8px; }
.pagination select { width: 70px; height: 32px; font-size: 10px; }
.page-button { width: 31px; height: 31px; border: 1px solid var(--line); color: #526074; background: #fff; font-size: 18px; }
.page-button:disabled { cursor: not-allowed; opacity: .4; }

.full-width { width: 100%; margin-top: 20px; }

.link-button { display: inline-flex; align-items: center; text-decoration: none; }
.system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.system-card { min-height: 138px; display: grid; grid-template-columns: 46px 1fr auto; align-items: start; gap: 15px; padding: 21px; }
.system-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--blue); background: var(--blue-soft); font-size: 22px; }
.system-card h3 { margin: 2px 0 7px; font-size: 15px; }
.system-card p { margin: 0 0 11px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.system-card code { padding: 4px 7px; border-radius: 5px; color: #4c627c; background: #f1f3f6; font-size: 9px; }
.status-pill { padding: 6px 8px; }
.status-pill.success { color: #16865f; background: var(--green-soft); }
.status-pill.warning { color: #9b7329; background: #fff6df; }
.status-pill.neutral { color: #768294; background: #f0f2f5; }
.status-pill.unavailable { color: #bb4f50; background: var(--coral-soft); }
.boundary-panel { display: grid; gap: 0; margin-top: 15px; padding: 22px; }
.boundary-panel h3 { margin: 0 0 9px; }
.boundary-panel > div { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid #edf0f4; }
.boundary-panel > div > span { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.boundary-panel p { margin: 2px 0 0; color: #718095; font-size: 11px; line-height: 1.6; }
.boundary-panel strong { color: var(--ink); margin-right: 8px; }

.capability-legend { display: flex; flex-wrap: wrap; gap: 7px; }
.capability-legend span, .capability-status { padding: 6px 9px; border-radius: 99px; font-size: 10px; font-weight: 800; }
.capability-legend .implemented, .capability-status.implemented, .summary-icon.implemented { color: #16865f; background: var(--green-soft); }
.capability-legend .planned, .capability-status.not_implemented, .summary-icon.planned { color: #9a7125; background: #fff5dc; }
.capability-legend .blocked, .capability-status.unavailable, .summary-icon.blocked { color: #bb4f50; background: var(--coral-soft); }
.capability-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 15px; }
.capability-summary article { display: flex; align-items: center; gap: 13px; min-height: 89px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.summary-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; }
.capability-summary strong { display: block; font-size: 22px; }
.capability-summary p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.capability-panel { overflow: hidden; }
.capability-list { display: grid; }
.capability-group-head { padding: 12px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #65738a; background: #f8fafc; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.capability-group-head:first-child { border-top: 0; }
.capability-row { display: grid; gap: 12px; padding: 18px; border-bottom: 1px solid #edf0f4; }
.capability-row:last-child { border-bottom: 0; }
.capability-row h3 { margin: 0; font-size: 12px; }
.capability-row p { margin: 4px 0 0; color: #8994a4; font-size: 9px; line-height: 1.55; }
.capability-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.capability-interfaces { display: flex; flex-wrap: wrap; gap: 5px; }
.capability-interfaces code { padding: 5px 7px; border-radius: 6px; color: #496079; background: #f1f4f7; font-size: 9px; overflow-wrap: anywhere; }
.capability-protocol-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.capability-protocol-grid section { min-width: 0; }
.capability-protocol-grid b, .capability-storage b { display: block; margin-bottom: 6px; color: #66758b; font-size: 9px; }
.capability-protocol-grid pre { min-height: 94px; max-height: 260px; margin: 0; padding: 11px; overflow: auto; border: 1px solid #e2e7ed; border-radius: 8px; color: #33465e; background: #f7f9fb; font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.capability-storage { display: flex; align-items: center; gap: 8px; }
.capability-storage b { margin: 0; }
.capability-storage code { padding: 5px 7px; border-radius: 6px; color: #496079; background: #eef4fb; font-size: 9px; overflow-wrap: anywhere; }
.capability-row.unavailable { background: #fffbfb; }
.capability-row.not_implemented { background: #fffdfa; }

.command-filters { grid-template-columns: minmax(260px, 1fr) 190px 150px auto; }
.command-table .command-id { display: block; max-width: 145px; overflow: hidden; color: #3d526d; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; text-overflow: ellipsis; }
.command-result { max-width: 220px; overflow: hidden; color: #788496; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.command-state { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: 9px; font-weight: 800; }
.command-state.success, .command-state.acknowledged { color: #16865f; background: var(--green-soft); }
.command-state.failed { color: #bb4f50; background: var(--coral-soft); }
.command-state.sent, .command-state.queued { color: #326ea8; background: var(--blue-soft); }

.management-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.management-panel { overflow: hidden; }
.compact-form { display: grid; grid-template-columns: .8fr 1.2fr auto; gap: 8px; padding: 0 20px 18px; border-bottom: 1px solid var(--line); }
.compact-form input { height: 40px; font-size: 11px; }
.stack-form { display: grid; gap: 9px; }
.stack-form input, .stack-form select { height: 41px; font-size: 11px; }
.stack-form textarea { min-height: 88px; font-size: 11px; }
.management-panel > .stack-form { padding: 0 20px 18px; border-bottom: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.management-list { max-height: 390px; overflow-y: auto; padding: 8px 20px 18px; }
.management-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid #edf0f4; }
.management-item:last-child { border-bottom: 0; }
.management-item h4 { margin: 0 0 5px; font-size: 11px; }
.management-item p { margin: 0; color: #8893a4; font-size: 9px; line-height: 1.55; }
.management-item code { display: inline-block; margin-top: 6px; padding: 3px 6px; border-radius: 5px; background: #f1f4f7; color: #53677e; font-size: 8px; }
.management-count { min-width: 30px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 800; }

.account-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .6fr); gap: 16px; align-items: start; }
.create-account-panel { position: sticky; top: 99px; }
.padded-form { padding: 0 22px 23px; }
.padded-form .field-label { margin-bottom: -2px; }
.password-section { border-top: 1px solid var(--line); }
.password-section .panel-head { padding-bottom: 8px; }
.user-table { min-width: 790px; }
.user-actions { display: flex; gap: 5px; }
.mini-button { min-height: 28px; padding: 0 8px; border: 1px solid #dce5ef; border-radius: 7px; color: #4e6179; background: #fff; font-size: 9px; }
.mini-button.danger { color: #b94a4a; border-color: #f2d4d4; background: #fff7f7; }
.mini-button.success { color: #16865f; border-color: #ccebdd; background: #f2fbf7; }

.template-grid { display: grid; grid-template-columns: minmax(300px, .55fr) minmax(0, 1.45fr); gap: 16px; align-items: start; }
.template-form-panel, .template-list-panel { overflow: hidden; }
.template-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 650px; overflow-y: auto; padding: 0 20px 20px; }
.template-item { position: relative; min-height: 130px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.template-item h4 { margin: 0 60px 9px 0; font-size: 12px; }
.template-item p { margin: 0; color: #65738a; font-size: 10px; line-height: 1.7; }
.template-item small { display: block; margin-top: 12px; color: #9aa3b1; font-size: 8px; }
.template-item .capability-status { position: absolute; top: 13px; right: 13px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.row-actions button { min-height: 30px; padding: 0 9px; border: 1px solid #dbe3eb; border-radius: 7px; color: #45627e; background: #fff; font-size: 9px; }
.row-actions button.danger { color: #c94a58; border-color: #f0d5d8; }
.template-item .row-actions { margin-top: 12px; }
.multiline-cell { max-width: 220px; white-space: pre-line; overflow-wrap: anywhere; }
.password-panel { margin-top: 16px; }

.metadata-form { display: grid; gap: 8px; }
.metadata-form select, .metadata-form input { height: 38px; font-size: 10px; }
.metadata-form textarea { min-height: 70px; font-size: 10px; }
.metadata-form .primary-button { justify-self: end; min-height: 36px; font-size: 10px; }

.screen-modal { width: min(980px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 18px; background: #111820; box-shadow: 0 30px 90px rgba(0,0,0,.38); }
.screen-modal::backdrop { background: rgba(8,14,22,.72); backdrop-filter: blur(4px); }
.screen-modal-head { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; color: #fff; background: #18222e; }
.screen-modal-head h3 { margin: 0; font-size: 17px; }
.screen-modal-head .icon-button { border-color: #35414e; color: #dce5ef; background: #202d3b; }
.screen-stage { height: min(68vh, 650px); position: relative; display: grid; place-items: center; overflow: hidden; background: #080c11; }
.screen-stage img { width: 100%; height: 100%; object-fit: contain; }
.screen-waiting { display: grid; place-items: center; color: #d7e1ec; text-align: center; }
.screen-waiting h3 { margin: 18px 0 7px; font-size: 16px; }
.screen-waiting p { margin: 0; color: #8190a1; font-size: 10px; }
.screen-loader { width: 45px; height: 45px; border: 3px solid #293b4e; border-top-color: #3d9aff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.screen-modal-footer { min-height: 64px; display: flex; align-items: center; gap: 13px; padding: 0 20px; color: #8f9dac; background: #18222e; }
.screen-modal-footer p { margin: 0; font-size: 9px; }
.screen-modal-footer .danger-button { margin-left: auto; }
.danger-button { min-height: 37px; padding: 0 14px; border: 0; border-radius: 9px; color: #fff; background: #d65454; font-weight: 700; }

.drawer-backdrop { position: fixed; z-index: 39; inset: 0; background: rgba(16,29,48,.35); backdrop-filter: blur(2px); }
.device-drawer { position: fixed; z-index: 40; top: 0; right: 0; width: min(570px, 100%); height: 100vh; transform: translateX(105%); background: #f8fafc; box-shadow: -25px 0 60px rgba(24,39,61,.18); transition: transform .26s ease; }
.device-drawer.open { transform: none; }
.drawer-head { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: #fff; }
.drawer-head h2 { margin: 0; font-size: 20px; }
.drawer-content { height: calc(100vh - 82px); overflow-y: auto; padding: 19px; }
.detail-hero { display: flex; align-items: center; gap: 15px; padding: 20px; border-radius: 15px; color: #fff; background: linear-gradient(135deg, #167eea, #125fb9); }
.detail-hero .device-avatar { width: 52px; height: 52px; flex: 0 0 52px; color: #fff; background: rgba(255,255,255,.16); }
.detail-hero h3 { margin: 0 0 5px; }
.detail-hero p { margin: 0; color: rgba(255,255,255,.72); font-size: 10px; }
.detail-hero .status-badge { margin-left: auto; color: #116f4f; background: #fff; }
.detail-section { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.detail-section h4 { margin: 0 0 14px; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 17px; }
.detail-item span { display: block; margin-bottom: 4px; color: #919baa; font-size: 9px; }
.detail-item strong { display: block; overflow-wrap: anywhere; font-size: 11px; }
.command-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.command-button { min-height: 55px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #e0e8f1; border-radius: 11px; color: #3d5069; background: #f8fbff; text-align: left; font-size: 10px; font-weight: 700; }
.command-button span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: #e6f2ff; font-size: 14px; }
.command-button:hover { border-color: #b8d8fa; background: #f1f8ff; }
.command-button:disabled { cursor: not-allowed; opacity: .45; }
.unavailable-actions { background: #fffbfb; }
.unavailable-command-list { display: grid; gap: 8px; }
.unavailable-command-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.unavailable-command { width: 100%; color: #778292; background: #f6f7f9; }
.unavailable-command span { color: #8c96a5; background: #e9edf1; }
.unavailable-command-list em { padding: 6px 9px; border-radius: 99px; color: #bb4f50; background: var(--coral-soft); font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.unavailable-help { margin: 11px 0 0; color: #9a6f70; font-size: 9px; line-height: 1.55; }
.event-list { display: grid; }
.event-item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid #eff1f4; }
.event-item:first-child { border-top: 0; }
.event-item > i { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #6ea8ec; }
.event-item strong { display: block; font-size: 10px; }
.event-item small { display: block; margin-top: 4px; color: #97a0ad; font-size: 9px; }
.loading-block { min-height: 250px; display: grid; place-items: center; color: #8d98a8; font-size: 12px; }

.modal { width: min(480px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(17,29,48,.5); backdrop-filter: blur(3px); }
.modal form { padding: 23px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal > form > p { font-size: 11px; line-height: 1.6; }
.modal textarea, .modal input { margin-top: 12px; }
.character-count { margin-top: 5px; color: #939dab; font-size: 9px; text-align: right; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.small-modal { width: min(420px, calc(100% - 28px)); }
.toast-container { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 390px; display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 9px; padding: 13px 14px; border: 1px solid #dce5ef; border-radius: 12px; background: #fff; box-shadow: 0 15px 40px rgba(28,45,69,.16); animation: toast-in .2s ease; font-size: 11px; }
.toast > span:first-child { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); }
.toast.error > span:first-child { background: var(--coral); }
.toast button { border: 0; color: #8a95a5; background: transparent; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Reference-material navigation and inventory layout. */
#view-dashboard .metrics-grid { grid-template-columns: 1fr 1fr; }
.material-status-tabs { display: flex; align-items: center; gap: 3px; padding: 14px 16px 4px; }
.material-status-tabs button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 8px; color: #6f7b8c; background: #f4f5f7; font-size: 10px; }
.material-status-tabs button.active { color: #fff; background: var(--blue); box-shadow: 0 5px 13px rgba(30,126,232,.2); }
#view-devices .filter-bar { grid-template-columns: 130px 150px 130px 115px 140px minmax(180px,1fr) auto auto; }
#view-devices .filter-bar > input { min-width: 0; height: 39px; }
.device-summary-strip { display: flex; flex-wrap: wrap; gap: 7px; padding: 1px 16px 13px; }
.device-summary-strip span { padding: 6px 9px; border-radius: 6px; font-size: 9px; font-weight: 700; }
.device-summary-strip .blue { color: #236eae; background: #e7f3ff; }
.device-summary-strip .green { color: #17865e; background: #e8f8f0; }
.device-summary-strip .red { color: #bd4e63; background: #ffeaf0; }
.device-summary-strip .purple { color: #7451a7; background: #f0e9fb; }
.device-summary-strip .orange { color: #9b6f25; background: #fff2d6; }
#view-devices .device-table { min-width: 2200px; }
.clickable-device-row { cursor: pointer; }
.realtime-icons { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.realtime-icons > i { width: 8px; height: 8px; border-radius: 50%; background: #d7dce3; }
.realtime-icons > i.on { background: #29ce83; box-shadow: 0 0 0 4px #e6faef; }
.realtime-icons span.enabled { color: #12a96d; }
.realtime-icons span.disabled { color: #d85a67; }
.realtime-icons span.unknown { color: #a8b0bc; }
.realtime-icons b { font-size: 18px; }
.network-quality { display: inline-flex; padding: 5px 8px; border-radius: 99px; color: #9b6f25; background: #fff4dc; font-size: 9px; white-space: nowrap; }
.network-quality.good { color: #17865e; background: #e7f8ef; }
.network-type-pill { display: inline-flex; padding: 5px 8px; border-radius: 8px; color: #7047a0; background: #f0e6fa; font-size: 9px; }
.package-cell { display: block; max-width: 190px; overflow-wrap: anywhere; }

.material-admin-head { padding-bottom: 10px; }
.material-admin-head h1 { margin: 0; font-size: 20px; }
.material-admin-filters { display: grid; grid-template-columns: 160px minmax(220px,1fr) auto auto; gap: 9px; padding: 0 16px 14px; }
.material-user-table { min-width: 1200px; }
.material-toggle { width: 39px; height: 22px; position: relative; padding: 0; border: 0; border-radius: 99px; background: #ccd3dc; }
.material-toggle i { width: 17px; height: 17px; position: absolute; top: 2.5px; left: 3px; border-radius: 50%; background: #fff; transition: transform .15s; }
.material-toggle.on { background: #1683ee; }
.material-toggle.on i { transform: translateX(16px); }
.material-toggle:disabled { opacity: .7; }
.material-modal { width: min(760px, calc(100% - 28px)); }
.material-modal form, .build-modal form { max-height: min(820px, calc(100vh - 50px)); overflow-y: auto; }
.material-switch-row { height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-radius: 9px; background: #f5f6f8; }
.material-switch-row input { width: auto; margin: 0; }
.reserved-note, .reserved-module-banner { padding: 10px 12px; border: 1px solid #f1dda9; border-radius: 9px; color: #80652b; background: #fff8e7; font-size: 9px; line-height: 1.55; }

.build-filter-bar { grid-template-columns: 135px 140px 140px 160px 130px 140px minmax(170px,1fr) auto auto; }
.build-table { min-width: 1050px; }
.build-summary { align-items: center; padding-top: 4px; }
.build-summary small { margin-left: auto; color: #8c96a5; }
.empty-state.compact { min-height: 250px; }
.build-modal { width: min(1120px, calc(100% - 28px)); }
.build-assets { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.build-assets > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.asset-placeholder { min-height: 75px; display: grid; place-items: center; margin-top: 10px; border-radius: 10px; color: #8c97a5; background: #f3f5f8; font-size: 10px; }
.asset-placeholder.wide { background: linear-gradient(135deg,#111,#f2f2f2); }
.form-section-title { margin: 20px 0 8px; padding-left: 10px; border-left: 4px solid var(--blue); }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-row label { display: grid; gap: 7px; color: #667386; font-size: 10px; }
.build-toggle-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.build-toggle-grid label { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 13px; border-radius: 9px; background: #f3f4f6; font-size: 10px; }
.build-toggle-grid input { width: auto; margin: 0; }
.build-details-content { max-height: min(820px, calc(100vh - 50px)); overflow-y: auto; padding: 23px; }
.build-detail-section { margin-top: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.build-detail-section h4 { margin: 0 0 13px; }
.artifact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.artifact-grid article { display: grid; gap: 8px; padding: 14px; border: 1px solid #bdebd6; border-radius: 10px; background: #f0fcf6; }
.artifact-grid article span { color: #7c8a98; font-size: 9px; }
.artifact-grid article button { min-height: 38px; border: 0; border-radius: 7px; color: #fff; background: #25d977; font-weight: 700; }
.build-progress { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 12px; }
.build-progress > div { display: grid; justify-items: center; gap: 6px; min-width: 72px; }
.build-progress > div b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #9aa5b2; }
.build-progress > div.done b { background: #2bd785; }
.build-progress > i { height: 2px; background: #dce3ea; }

/* Full-width device workbench seen in the reference video. */
.device-drawer { width: min(1500px, calc(100vw - 28px)); }
.drawer-content { padding: 14px; }
.workbench-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 10px; }
.workbench-toolbar > div, .workbench-toolbar label { display: flex; align-items: center; gap: 7px; }
.workbench-toolbar select { width: 145px; height: 33px; }
.workbench-toolbar input[type="range"] { width: 100px; }
.workbench-toolbar output { min-width: 32px; color: #687689; font-variant-numeric: tabular-nums; }
.device-workbench { display: grid; grid-template-columns: minmax(400px,1.25fr) minmax(135px,.35fr) minmax(220px,.65fr) minmax(230px,.58fr) minmax(220px,.65fr); gap: 12px; margin-top: 12px; align-items: start; transform-origin: top left; }
.workbench-data-panel, .overlay-mode-panel, .remote-stage-panel, .remote-control-panel { min-height: 650px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.device-workbench button, .device-workbench input, .device-workbench select, .device-workbench textarea, .device-workbench strong, .device-workbench p, .device-workbench th, .device-workbench td { font-size: var(--wb-control-font); }
.device-workbench small, .device-workbench span, .device-workbench label, .device-workbench em { font-size: var(--wb-small-font); }
.device-workbench.theme-light { padding: 8px; border-radius: 14px; background: #f8fbff; }
.device-workbench.theme-dark { padding: 8px; border-radius: 14px; color: #e6ebf2; background: #18202b; }
.device-workbench.theme-dark .workbench-data-panel, .device-workbench.theme-dark .overlay-mode-panel, .device-workbench.theme-dark .remote-stage-panel, .device-workbench.theme-dark .remote-control-panel, .device-workbench.theme-dark button { color: #e6ebf2; border-color: #3b4655; background: #222c39; }
.device-workbench.theme-dark input, .device-workbench.theme-dark select, .device-workbench.theme-dark textarea, .device-workbench.theme-dark .detail-item, .device-workbench.theme-dark pre { color: #e6ebf2; border-color: #455164; background: #18202b; }
.workbench-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); }
.workbench-tabs button { flex: 0 0 auto; min-height: 45px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; color: #647187; background: transparent; font-size: 10px; }
.workbench-tabs button.active { color: #1a1f2a; border-bottom-color: var(--blue); background: #f6faff; }
.workbench-panel { display: none; padding: 14px; }
.workbench-panel.active { display: block; }
.workbench-panel > .search-box { margin: 10px 0; }
.module-placeholder { min-height: 470px; display: grid; place-items: center; align-content: center; gap: 9px; text-align: center; }
.module-placeholder > * { margin: 0; }
.module-placeholder.has-data { min-height: 0; display: block; text-align: left; }
.module-placeholder.has-data > .empty-icon, .module-placeholder.has-data > h3, .module-placeholder.has-data > button { display: none; }
.module-placeholder code { max-width: 95%; padding: 7px; border-radius: 7px; color: #586a81; background: #f1f4f7; overflow-wrap: anywhere; font-size: 8px; }
.module-result { width: min(100%, 560px); max-height: 300px; overflow: auto; text-align: left; }
.module-result.structured-result { max-height: 510px; }
.module-result-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: #526177; }
.module-result-head strong { margin-right: auto; }
.module-result-head button { min-height: 28px; padding: 0 8px; border: 1px solid #dbe3eb; border-radius: 7px; background: #fff; }
.module-result-head small { color: #8a95a5; }
.module-result pre { margin: 0; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; color: #304057; background: #f7f9fb; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.permission-header { display: flex; align-items: center; gap: 15px; }
.permission-header h3 { margin-right: auto; }
.permission-header small { color: #8993a2; font-weight: 400; }
.permission-list { display: grid; gap: 8px; margin: 15px 0; }
.permission-row { min-height: 55px; display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid #e0e4e9; border-left: 4px solid #cbd1d8; border-radius: 9px; }
.permission-row.enabled { border-color: #bfead7; border-left-color: #27c77e; }
.permission-row > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: #667384; background: #edf0f3; }
.permission-row.enabled > span { color: #1db976; background: #e1f8ed; }
.permission-row em { color: #8993a2; font-size: 9px; font-style: normal; }
.overlay-mode-panel { display: flex; flex-direction: column; gap: 12px; padding: 16px 10px; }
.overlay-mode-panel select { width: 100%; min-height: 35px; }
.overlay-mode-panel small { color: #8993a2; line-height: 1.5; }
.remote-stage-panel { position: relative; display: grid; place-items: center; padding: 45px 12px 20px; background: #eef0f3; }
.overlay-picker { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.overlay-picker select { width: 150px; height: 35px; }
.phone-frame { width: min(280px,90%); aspect-ratio: 9/19; position: relative; padding: 8px; border: 5px solid #111; border-radius: 28px; background: #111; box-shadow: 0 18px 35px rgba(0,0,0,.22); }
.phone-camera { width: 8px; height: 8px; position: absolute; z-index: 1; top: 10px; left: calc(50% - 4px); border-radius: 50%; background: #111; }
.phone-screen { height: 100%; display: grid; place-items: center; align-content: center; gap: 10px; border-radius: 19px; color: #627083; background: #fff; text-align: center; }
.phone-screen small { max-width: 190px; line-height: 1.5; }
.phone-screen button { padding: 8px 12px; border: 1px solid #d9dee5; border-radius: 8px; background: #f7f8fa; }
.remote-control-panel { padding: 13px; }
.remote-state { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wide-control { width: 100%; min-height: 43px; margin: 5px 0; border: 1px solid #dce4ec; border-radius: 10px; color: #58687b; background: #f7f9fb; font-weight: 700; }
.wide-control.green { color: #20875f; border-color: #bde8d5; background: #e9f9f1; }
.inline-controls { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.inline-controls button { min-height: 38px; border: 1px solid #dce4ec; border-radius: 9px; background: #fff; }
.control-toggle, .control-list-button { width: 100%; min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 4px; border: 0; border-bottom: 1px solid #eef0f3; background: #fff; text-align: left; }
.control-toggle div, .control-list-button div { display: grid; gap: 4px; }
.control-toggle small, .control-list-button small { color: #8b95a4; font-size: 8px; }
.control-toggle > i { width: 36px; height: 20px; position: relative; border-radius: 99px; background: #d2d8df; }
.control-toggle > i::after { content: ""; width: 16px; height: 16px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: #fff; }
.control-toggle > i.on { background: #1683ee; }
.control-toggle > i.on::after { transform: translateX(16px); }
.control-list-button > span { width: 30px; color: var(--blue); text-align: center; font-size: 18px; }
.camera-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.camera-actions button { padding: 8px 12px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); }
.camera-copy { display: grid; gap: 3px; margin-top: 18px; }
.camera-copy small { color: #8993a2; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-section-head h4 { margin: 0; }
.stage-label { position: absolute; top: 15px; left: 16px; right: 16px; color: #69778a; text-align: center; font-weight: 700; }
.action-media-result { margin-top: 12px; }
.action-result-image { width: 100%; height: 100%; max-height: 480px; object-fit: contain; border-radius: 14px; }
.phone-screen > .action-result-image { max-height: none; }
.phone-screen pre { width: 90%; max-height: 75%; overflow: auto; margin: 0; padding: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-cards, .app-cards, .contact-list { display: grid; gap: 9px; }
.message-card { position: relative; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.message-card > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.message-card p { margin: 10px 0; line-height: 1.55; }
.message-card > small { color: #8b95a4; }
.message-card > button { position: absolute; right: 10px; bottom: 8px; border: 0; color: var(--blue); background: transparent; }
.module-tools { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; margin-bottom: 10px; }
.module-tools > * { min-width: 0; height: 35px; }
.app-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.app-icon { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; color: #fff; background: var(--blue); font-weight: 800; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-card > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.app-card small { overflow: hidden; color: #7f8b9c; text-overflow: ellipsis; }
.app-card span { color: #9aa4b2; }
.app-card-actions { display: flex; gap: 5px; }
.app-card-actions button, .contact-list button, .module-table button, .clipboard-panel button { min-height: 30px; padding: 0 9px; border: 1px solid #dbe3eb; border-radius: 7px; background: #fff; }
.module-link { display: inline-flex; min-height: 30px; align-items: center; padding: 0 9px; border: 1px solid #dbe3eb; border-radius: 7px; color: var(--blue); background: #fff; text-decoration: none; }
.app-card-actions button.danger { color: #c94a58; }
.permission-summary { display: flex; gap: 8px; margin: 10px 0; }
.permission-summary > * { padding: 7px 10px; border-radius: 8px; background: #f0f4f8; }
.gallery-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.gallery-grid article { min-width: 0; display: grid; gap: 5px; }
.gallery-grid img, .gallery-placeholder { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; background: #edf1f5; }
.gallery-placeholder { display: grid; place-items: center; color: #94a0b0; font-size: 22px; }
.gallery-grid strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-grid small { color: #8b95a4; }
.contact-list article { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 9px; border-bottom: 1px solid var(--line); }
.contact-list article > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #66a4ea; }
.contact-list article > div { display: grid; gap: 3px; }
.file-path { margin: 8px 0; color: #65758a; }
.module-table { width: 100%; border-collapse: collapse; }
.module-table th, .module-table td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; }
.clipboard-panel { display: grid; gap: 12px; }
.clipboard-panel label { display: grid; gap: 7px; }
.clipboard-panel textarea { min-height: 90px; resize: vertical; }
.clipboard-panel > div { display: flex; gap: 7px; }
.module-detail-grid { margin-top: 10px; }

@media (max-width: 1120px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { grid-template-columns: 1fr 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .flow-panel { grid-template-columns: 1fr 1fr; }
  .flow-panel > i { display: none; }
  .account-grid { grid-template-columns: 1fr; }
  .create-account-panel { position: static; }
  #view-devices .filter-bar { grid-template-columns: repeat(3,1fr); }
  .device-workbench { grid-template-columns: 1fr 1fr; }
  .workbench-data-panel { grid-column: 1 / -1; }
  .overlay-mode-panel { min-height: 180px; }
  .build-toggle-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 820px) {
  .login-layout { grid-template-columns: 1fr; max-width: 440px; }
  .login-intro { display: none; }
  .mobile-brand { display: flex; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 244px; box-shadow: 20px 0 50px rgba(27,43,67,.18); transition: transform .23s; }
  .sidebar.open { transform: none; }
  .menu-button { display: grid; }
  .connection-chip b { display: none; }
  .content-grid, .system-grid, .management-grid, .template-grid { grid-template-columns: 1fr; }
  .device-workbench, .build-assets, .form-row.three { grid-template-columns: 1fr; }
  .workbench-data-panel { grid-column: auto; }
  .material-admin-filters, .build-filter-bar { grid-template-columns: 1fr 1fr; }
  .capability-protocol-grid { grid-template-columns: 1fr; }
}

@media (max-width: 590px) {
  .login-screen { padding: 14px; }
  .login-card { padding: 30px 24px; border-radius: 20px; }
  .topbar { height: 68px; padding: 0 15px; }
  .topbar-kicker, .user-menu > div:last-child, .connection-chip { display: none; }
  .main-content { padding: 17px 14px 30px; }
  .hero-card { min-height: 220px; align-items: flex-start; flex-direction: column; padding: 27px; }
  .hero-card h1 { font-size: 25px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 132px; padding: 18px; }
  .metric-card strong { font-size: 27px; }
  .metric-icon { width: 35px; height: 35px; top: 15px; right: 14px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar select { grid-column: auto; }
  .pagination { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px 16px; }
  .recent-device { grid-template-columns: 38px 1fr auto; }
  .recent-device > div:nth-child(3), .recent-device > div:nth-child(4) { display: none; }
  .detail-grid, .command-grid { grid-template-columns: 1fr; }
  .system-card { grid-template-columns: 42px 1fr; }
  .system-card .status-pill { grid-column: 2; }
  .capability-summary { grid-template-columns: 1fr; }
  .capability-legend { width: 100%; }
  .command-filters, .compact-form, .form-row { grid-template-columns: 1fr; }
  .screen-modal-footer p { display: none; }
  .template-list { grid-template-columns: 1fr; }
  .toast-container { right: 12px; left: 12px; bottom: 12px; }
  .toast { min-width: 0; width: 100%; }
}
