:root {
  color-scheme: light;
  --ink: #152724;
  --muted: #64736f;
  --paper: #f3f5f0;
  --surface: #ffffff;
  --line: #dfe5de;
  --green: #126c59;
  --green-dark: #0c4e41;
  --mint: #d9f2e8;
  --amber: #ad6b16;
  --rose: #b13c4b;
  --shadow: 0 20px 60px rgba(25, 55, 48, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.permission-hidden { display: none !important; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(380px, .9fr); }
.brand-panel { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 8rem); color: white; background: linear-gradient(145deg, #0b493d, #177763 65%, #31977d); display: flex; flex-direction: column; justify-content: center; }
.brand-panel::after { content: ""; position: absolute; width: 40rem; height: 40rem; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; right: -18rem; bottom: -19rem; box-shadow: 0 0 0 5rem rgba(255,255,255,.035), 0 0 0 10rem rgba(255,255,255,.025); }
.brand-panel h1 { max-width: 650px; font-family: Georgia, serif; font-size: clamp(3rem, 6vw, 6rem); line-height: .98; letter-spacing: -.045em; margin: 1rem 0 1.5rem; }
.brand-panel > p:not(.eyebrow) { max-width: 520px; color: rgba(255,255,255,.78); font-size: 1.1rem; line-height: 1.7; }
.brand-mark { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: #e9b85b; color: #16352f; font: 700 1.6rem Georgia, serif; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.brand-mark.small { width: 2.3rem; height: 2.3rem; border-radius: .7rem; font-size: 1rem; }
.eyebrow { margin: 2.5rem 0 0; text-transform: uppercase; letter-spacing: .15em; font-size: .72rem; font-weight: 800; opacity: .8; }
.signal-art { display: flex; align-items: end; gap: .5rem; height: 3rem; margin-top: 3rem; }
.signal-art span { display: block; width: .6rem; border-radius: 1rem; background: rgba(255,255,255,.8); }
.signal-art span:nth-child(1) { height: 30%; } .signal-art span:nth-child(2) { height: 60%; } .signal-art span:nth-child(3) { height: 100%; }
.auth-panel { padding: clamp(2rem, 7vw, 7rem); display: flex; flex-direction: column; justify-content: center; background: var(--surface); }
.tabs { display: flex; gap: .4rem; padding: .35rem; background: var(--paper); border-radius: .85rem; margin-bottom: 3rem; }
.tab { flex: 1; border: 0; padding: .8rem; border-radius: .65rem; background: transparent; color: var(--muted); }
.tab.active { color: var(--ink); background: white; box-shadow: 0 3px 12px rgba(20,50,43,.08); font-weight: 700; }
.auth-form { display: grid; gap: 1.2rem; max-width: 470px; width: 100%; margin: 0 auto; }
.auth-form h2 { margin: 0; font: 700 2.4rem Georgia, serif; }
.auth-form > p { color: var(--muted); margin: -.5rem 0 1rem; }
label { display: grid; gap: .5rem; color: #40504c; font-size: .86rem; font-weight: 700; }
.form-hint { color: var(--muted); font-size: .72rem; font-weight: 500; line-height: 1.4; }
.form-note { grid-column: 1 / -1; margin: 0; padding: .75rem .9rem; border: 1px solid #b9dfd2; border-radius: .75rem; color: var(--green-dark); background: #edf8f4; font-size: .82rem; line-height: 1.45; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: .75rem; padding: .85rem 1rem; background: white; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,108,89,.12); }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; color: var(--muted); background: #edf0ed; opacity: 1; }
.primary, .secondary { border: 0; border-radius: .75rem; padding: .85rem 1.1rem; font-weight: 750; }
.primary { color: white; background: var(--green); box-shadow: 0 8px 20px rgba(18,108,89,.2); }
.primary:hover { background: var(--green-dark); }
.primary:disabled { cursor: wait; opacity: .58; box-shadow: none; }
.secondary { color: var(--green-dark); background: var(--mint); }
.text-button { justify-self: end; margin-top: -.65rem; padding: 0; border: 0; color: var(--green); background: transparent; font-size: .84rem; font-weight: 750; }
.text-button:hover { color: var(--green-dark); text-decoration: underline; }
.turnstile-shell { min-height: 65px; width: 100%; }
.turnstile-shell iframe { max-width: 100%; }
.message.error { color: var(--rose); max-width: 470px; width: 100%; margin: 1rem auto 0; }
.message.success { color: var(--green); max-width: 470px; width: 100%; margin: 1rem auto 0; }
.dashboard { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.5rem; background: #102f29; color: white; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 3rem; }
.mobile-nav-toggle { display: none; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; border: 1px solid rgba(255,255,255,.18); border-radius: .7rem; padding: .6rem .8rem; color: white; background: rgba(255,255,255,.08); font-weight: 750; }
.sidebar nav { display: grid; gap: .45rem; }
.nav-item { text-align: left; border: 0; border-radius: .7rem; padding: .8rem 1rem; color: rgba(255,255,255,.7); background: transparent; }
.nav-item.active, .nav-item:hover { color: white; background: rgba(255,255,255,.1); }
.admin-nav-group { display: grid; gap: .3rem; }.admin-subnav { display: grid; gap: .18rem; margin-left: 1rem; padding-left: .65rem; border-left: 1px solid rgba(255,255,255,.18); }.admin-subnav-item { border: 0; border-radius: .55rem; padding: .5rem .65rem; color: rgba(255,255,255,.58); background: transparent; text-align: left; font-size: .78rem; line-height: 1.2; }.admin-subnav-item:hover, .admin-subnav-item.active { color: white; background: rgba(255,255,255,.09); }
.account-card { margin-top: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.12); }
.account-card small { display: block; color: rgba(255,255,255,.55); text-transform: capitalize; }
.avatar { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 50%; background: #e9b85b; color: #16352f; font-weight: 800; }
.icon-button { border: 0; color: white; background: transparent; font-size: 1.2rem; }
.workspace { padding: clamp(1.5rem, 4vw, 4rem); max-width: 1500px; width: 100%; margin: 0 auto; }
.workspace header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.workspace header .eyebrow { margin: 0 0 .45rem; color: var(--green); }
.workspace header h1 { font: 700 clamp(2.3rem, 4vw, 4rem) Georgia, serif; margin: 0; letter-spacing: -.03em; }
.verification-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: -0.5rem 0 2rem; padding: 1rem 1.15rem; border: 1px solid #e8c880; border-radius: .9rem; color: #63470d; background: #fff6dc; }.verification-banner strong { display: block; }.verification-banner p { margin: .2rem 0 0; font-size: .85rem; }.verification-banner .secondary { flex: none; color: #63470d; background: #f5dfaa; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stats-grid article, .panel { padding: 1.4rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: 0 8px 28px rgba(25,55,48,.05); }
.stat-label { display: block; color: var(--muted); font-size: .82rem; }
.stats-grid strong { display: block; margin-top: .5rem; font: 700 2.4rem Georgia, serif; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 2.5rem 0 1rem; }.section-heading.divided { padding-top: 1.5rem; border-top: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 1.25rem; }.section-heading p { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.device-card { padding: 1.25rem; border-radius: 1rem; border: 1px solid var(--line); background: white; transition: transform .2s, box-shadow .2s; }
.device-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.device-card-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }.device-card-link:focus-visible { outline: 3px solid rgba(18,108,89,.3); outline-offset: 3px; }
.device-top { display: flex; justify-content: space-between; gap: 1rem; }.device-top h3 { margin: 0; font-size: 1rem; }.device-id { color: var(--muted); font-family: ui-monospace, monospace; font-size: .74rem; margin-top: .3rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; height: fit-content; padding: .35rem .6rem; border-radius: 10rem; font-size: .72rem; font-weight: 800; }
.badge::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.badge.online { color: var(--green); background: var(--mint); }.badge.offline { color: var(--rose); background: #f9e5e8; }.badge.inactive { color: var(--muted); background: #edf0ed; }
.device-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-top: 1.2rem; margin-top: 1.2rem; border-top: 1px solid var(--line); }
.device-meta span { display: block; color: var(--muted); font-size: .72rem; }.device-meta strong { display: block; margin-top: .25rem; font-size: .84rem; overflow-wrap: anywhere; }
.hierarchy-list { display: grid; gap: 1rem; }
.hierarchy-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: 0 8px 28px rgba(25,55,48,.05); }
.hierarchy-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.hierarchy-card-header h3 { margin: 0; font-size: 1.05rem; }
.hierarchy-card-header p { margin: .3rem 0 0; color: var(--muted); font-size: .82rem; }
.hierarchy-summary { display: flex; flex-wrap: wrap; gap: .45rem; }
.hierarchy-devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.hierarchy-device { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-width: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .75rem; color: inherit; background: var(--paper); text-decoration: none; }
.hierarchy-device:hover { border-color: #b9cbc4; background: white; }
.hierarchy-device > div { min-width: 0; }
.hierarchy-device strong, .hierarchy-site strong { display: block; overflow-wrap: anywhere; }
.hierarchy-device small, .hierarchy-site small { display: block; margin-top: .2rem; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.hierarchy-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.hierarchy-site { padding: .85rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--paper); }
.hierarchy-empty-copy { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .82rem; }
.empty-state { text-align: center; padding: 5rem 1rem; border: 1px dashed #bcc7c1; border-radius: 1rem; color: var(--muted); }.empty-state div { font-size: 3rem; color: var(--green); }.empty-state h3 { color: var(--ink); }
.admin-grid { display: grid; gap: 1.2rem; }.panel .section-heading { margin-top: 0; }.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: .8rem; }.device-filter-form { grid-template-columns: minmax(200px, 2fr) minmax(150px, 1fr) minmax(140px, .8fr) auto; }
.secret-box { margin-top: 1rem; padding: 1rem; border-radius: .8rem; background: #fff6dc; color: #6e4c12; overflow-wrap: anywhere; }
.secret-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.secret-box dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem .8rem; margin: .8rem 0; }
.secret-box dt { font-size: .75rem; font-weight: 800; }
.secret-box dd { margin: 0; min-width: 0; user-select: all; }
.secret-box small { display: block; }
.secret-box code { display: block; margin-top: .5rem; padding: .6rem; border-radius: .5rem; background: rgba(255,255,255,.65); user-select: all; overflow-wrap: anywhere; }
.danger-button { border: 1px solid var(--rose); border-radius: .75rem; padding: .85rem 1.1rem; color: white; background: var(--rose); font-weight: 750; }
.danger-button:hover { background: #8f2f3c; }
.compact-list .user-row { padding: .7rem .85rem; }
.inventory-heading { margin: .3rem 0 .8rem; }.inventory-heading.divided { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }.inventory-heading h3 { margin: 0; }.inventory-heading p { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; }
.terminal-dialog { width: min(1100px, calc(100vw - 2rem)); height: min(760px, calc(100vh - 2rem)); padding: 0; border: 1px solid #294740; border-radius: 1rem; background: #071613; box-shadow: 0 30px 100px rgba(0,0,0,.45); overflow: hidden; }
.terminal-dialog[open] { display: flex; flex-direction: column; }
.terminal-dialog::backdrop { background: rgba(4,20,17,.72); backdrop-filter: blur(4px); }
.terminal-header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; color: white; background: #102f29; }.terminal-header .eyebrow { margin: 0 0 .2rem; color: #9bd7c6; }.terminal-header h2 { margin: 0; font-size: 1rem; }.terminal-header .icon-button { font-size: 1.8rem; }.terminal-header-actions { display: flex; align-items: center; gap: .5rem; }.terminal-control { border: 1px solid #3d675e; border-radius: .55rem; padding: .45rem .65rem; color: #d8eee7; background: #173d35; font-size: .74rem; font-weight: 700; }.terminal-control:hover, .terminal-control:focus-visible { border-color: #9bd7c6; background: #205346; }.terminal-link { display: inline-block; margin-top: .25rem; color: #bfe9dc; font-size: .75rem; }
.terminal-screen { flex: 1; min-height: 0; padding: .75rem; overflow: hidden; }.terminal-screen .xterm { height: 100%; }.terminal-screen .xterm-viewport { overflow-y: scroll !important; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; scrollbar-color: #5f8f83 #0a1f1b; scrollbar-width: auto; }.terminal-screen .xterm-viewport::-webkit-scrollbar { width: 14px; }.terminal-screen .xterm-viewport::-webkit-scrollbar-track { background: #0a1f1b; }.terminal-screen .xterm-viewport::-webkit-scrollbar-thumb { border: 3px solid #0a1f1b; border-radius: 8px; background: #5f8f83; }
.terminal-status { margin: .25rem 0 0; color: #bfe9dc; font-size: .75rem; }.terminal-status.error { color: #ffabb5; }
.settings-dialog { width: min(760px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: 1rem; background: white; box-shadow: var(--shadow); }.settings-dialog::backdrop { background: rgba(4,20,17,.62); backdrop-filter: blur(4px); }.settings-dialog form { display: grid; max-height: calc(100vh - 2rem); }
.management-dialog { width: min(920px, calc(100vw - 2rem)); }.membership-list { display: grid; gap: .55rem; }.membership-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, auto) auto; align-items: center; gap: .65rem; padding: .7rem; border: 1px solid var(--line); border-radius: .7rem; }.membership-row span { min-width: 0; font-weight: 750; overflow-wrap: anywhere; }.membership-row span small { display: block; margin-top: .2rem; color: var(--muted); font-weight: 500; }.membership-row select { padding: .55rem .7rem; }.membership-add-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(140px, .65fr) auto; align-items: end; gap: .7rem; margin-top: .8rem; }.empty-copy { margin: 0; color: var(--muted); font-size: .82rem; }
.settings-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.4rem; border-bottom: 1px solid var(--line); }.settings-header .eyebrow { margin: 0 0 .2rem; color: var(--green); }.settings-header h2 { margin: 0; }.dialog-close { border: 0; background: transparent; color: var(--muted); font-size: 1.8rem; }
.confirmation-dialog { width: min(520px, calc(100vw - 2rem)); }.confirmation-details { display: grid; grid-template-columns: minmax(7rem, auto) minmax(0, 1fr); gap: .65rem 1rem; margin: .5rem 0 0; }.confirmation-details dt { color: var(--muted); font-weight: 700; }.confirmation-details dd { margin: 0; overflow-wrap: anywhere; }
.settings-body { display: grid; gap: 1rem; padding: 1.4rem; overflow-y: auto; }.settings-body fieldset { display: grid; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; }.settings-body legend { padding: 0 .4rem; font-weight: 800; }.settings-grid { display: grid; grid-template-columns: 2fr 1fr; gap: .8rem; }.checkbox-label { display: flex; grid-template-columns: none; align-items: center; gap: .55rem; }.checkbox-label input { width: auto; }
.settings-actions { display: flex; justify-content: flex-end; gap: .7rem; padding: 1rem 1.4rem; border-top: 1px solid var(--line); }
.settings-tabs { display: flex; gap: .35rem; padding: .3rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--paper); }.settings-tabs button { flex: 1; min-height: 42px; border: 0; border-radius: .55rem; color: var(--muted); background: transparent; font-weight: 800; cursor: pointer; }.settings-tabs button[aria-selected="true"] { color: white; background: var(--green); }.settings-body [data-settings-panel] { display: grid; gap: 1rem; }.settings-body [data-settings-panel][hidden] { display: none; }.settings-warning { padding: .85rem; border: 1px solid #d9a441; border-radius: .65rem; background: #fff8e7; color: #654913; line-height: 1.45; }.settings-status { padding: .8rem; border-radius: .65rem; background: var(--paper); color: var(--muted); overflow-wrap: anywhere; }
.user-list { display: grid; gap: .8rem; }.panel > .inline-form ~ .user-list, .panel > .user-list ~ .inline-form, .panel > .inline-form + .inline-form { margin-top: 1rem; }.user-row { border: 1px solid var(--line); border-radius: .85rem; padding: 1rem; display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 1rem; min-width: 0; }.user-row > * { min-width: 0; }.user-row h3 { margin: 0; font-size: .95rem; }.user-row p { margin: .25rem 0; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }.user-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }.user-controls select { width: auto; padding: .5rem; }.user-management-row { grid-template-columns: minmax(220px, 1fr) minmax(420px, 2fr); }.user-management-row .user-controls { display: grid; grid-template-columns: minmax(150px, .75fr) auto minmax(220px, 1.4fr); align-items: center; }.user-management-row .user-controls select { width: 100%; min-width: 0; }.small-button { border: 1px solid var(--line); border-radius: .55rem; background: white; padding: .5rem .7rem; font-size: .76rem; }.small-button:disabled { cursor: default; opacity: .45; }.small-button.danger { color: var(--rose); }.small-button.terminal-button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 6.4rem; color: #fff; -webkit-text-fill-color: #fff; border-color: #126c59; background: #126c59; font-weight: 750; }.small-button.terminal-button:hover { background: #0c4e41; }.access-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .45rem; min-width: 0; }.access-chip { display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .55rem; border-radius: .5rem; background: var(--paper); font-size: .74rem; }.access-chip button { border: 0; background: transparent; color: var(--rose); }.mobile-device-actions { display: none; }.pagination-controls { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; margin-top: 1rem; color: var(--muted); font-size: .82rem; }.security-sections { display: grid; gap: 0; }.security-section { padding: 1.2rem 0; border-top: 1px solid var(--line); }.security-section:first-child { padding-top: 0; border-top: 0; }.security-section:last-child { padding-bottom: 0; }.security-section h3 { margin: 0; font-size: 1rem; }.security-section > p { margin: .3rem 0 1rem; color: var(--muted); font-size: .84rem; }.security-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.user-management-row { grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); }.user-management-row .user-controls { grid-template-columns: minmax(120px, .75fr) auto minmax(160px, 1.4fr); }
.toast { position: fixed; right: 1.5rem; bottom: 1.5rem; max-width: 420px; padding: .9rem 1.1rem; border-radius: .8rem; color: white; background: var(--ink); box-shadow: var(--shadow); }
@media (max-width: 850px) { .auth-shell { grid-template-columns: 1fr; }.brand-panel { min-height: 40vh; padding: 2.5rem; }.brand-panel h1 { font-size: 3.3rem; }.signal-art { display: none; }.dashboard { grid-template-columns: 1fr; }.sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: .7rem; padding: .8rem 1rem; overflow: visible; }.sidebar-brand { margin: 0; }.mobile-nav-toggle { display: inline-flex; margin-left: auto; }.sidebar nav { order: 4; display: none; align-items: stretch; width: 100%; padding-top: .25rem; border-top: 1px solid rgba(255,255,255,.12); }.sidebar.mobile-nav-open nav { display: grid; }.admin-nav-group { display: grid; align-items: stretch; }.admin-subnav { display: grid; margin: 0 0 0 .8rem; padding: 0 0 0 .65rem; border: 0; border-left: 1px solid rgba(255,255,255,.18); }.account-card { margin: 0; padding: 0; border: 0; }.account-card > div { display: none; }.account-card .icon-button { display: none; }.workspace { padding: 1.35rem 1rem 2rem; }.workspace header h1 { font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.04; }.verification-banner { align-items: stretch; flex-direction: column; }.stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }.stats-grid article { padding: 1rem; }.stats-grid strong { font-size: 2rem; }.inline-form, .device-filter-form, .settings-grid { grid-template-columns: minmax(0, 1fr); }.inline-form button { min-height: 44px; }.user-row, .user-management-row { grid-template-columns: minmax(0, 1fr); }.user-management-row .user-controls { grid-template-columns: minmax(0, 1fr); width: 100%; }.user-management-row .user-controls select, .user-management-row .user-controls button { width: 100%; min-width: 0; }.nav-item, .admin-subnav-item, .small-button, .dialog-close, .icon-button, .access-chip button, .mobile-device-actions summary { min-height: 44px; }.dialog-close, .icon-button, .access-chip button { min-width: 44px; }.desktop-device-actions { display: none; }.mobile-device-actions { display: block; grid-column: 1 / -1; }.mobile-device-actions summary { display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: .65rem; padding: .6rem .8rem; color: var(--green-dark); background: white; font-size: .82rem; font-weight: 750; cursor: pointer; }.mobile-device-action-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: .5rem; }.mobile-device-action-list .small-button { width: 100%; }.pagination-controls { justify-content: space-between; }.section-heading { align-items: flex-start; gap: .8rem; }.section-heading > button { flex: none; }.security-actions > button { min-height: 44px; }.terminal-header { align-items: flex-start; }.terminal-header-actions { flex-wrap: wrap; justify-content: flex-end; }.terminal-control { min-height: 40px; } }
@media (max-width: 850px) { .settings-dialog { width: calc(100vw - 1rem); }.settings-dialog form, .settings-body, .settings-body [data-settings-panel], .settings-warning, .settings-status { min-width: 0; }.settings-body { padding: 1rem; }.settings-tabs { display: grid; grid-template-columns: minmax(0, 1fr); }.settings-tabs button { width: 100%; }.settings-warning { overflow-wrap: anywhere; } }
@media (max-width: 850px) { .membership-row, .membership-add-row { grid-template-columns: minmax(0, 1fr); }.membership-row .small-button, .membership-add-row button { width: 100%; min-height: 44px; }.settings-actions { flex-wrap: wrap; }.settings-actions button { min-height: 44px; } }
@media (min-width: 600px) and (max-width: 850px) { .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.device-filter-form { grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(120px, 1fr) auto; } }
@media (max-width: 850px) { .account-card .icon-button { display: inline-grid; place-items: center; } }
@media (max-width: 440px) { .sidebar { gap: .35rem; padding: .65rem .6rem; }.sidebar-brand { gap: .5rem; }.sidebar-brand .brand-mark.small { width: 2.1rem; height: 2.1rem; }.mobile-nav-toggle { margin-left: 0; padding: .5rem .65rem; }.account-card { display: block; }.account-card .avatar { display: none; }.workspace header h1 { font-size: 2rem; }.section-heading { flex-direction: column; }.section-heading > button { width: 100%; min-height: 44px; }.mobile-device-action-list { grid-template-columns: 1fr; }.hierarchy-card-header { flex-direction: column; }.hierarchy-summary { width: 100%; } }
@media (max-width: 440px) { .account-card { margin-left: auto; } }

/* Console workspace: consistent reading rhythm and accessible controls. */
:root { --ink: #1b302c; --muted: #596d66; --paper: #f5f7f6; --line: #dce5e0; --shadow: 0 12px 36px rgba(19,48,39,.09); }
body { line-height: 1.5; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #339b81; outline-offset: 3px; }
#page-title:focus, #workspace:focus { outline: none; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 100; padding: .75rem 1rem; border-radius: .5rem; color: white; background: var(--green-dark); }
.skip-link:focus { top: 1rem; }
.dashboard { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { padding: 1.6rem 1rem 1rem; background: #112e27; scrollbar-width: thin; }
.sidebar-brand { padding: 0 .7rem; margin-bottom: 2rem; }
.sidebar-brand strong { font-size: 1.13rem; letter-spacing: -.02em; }
.brand-caption { display: block; margin-top: .1rem; color: #a4c2b5; font-size: .59rem; font-weight: 600; letter-spacing: .18em; }
.brand-mark { background: #c8e3a9; box-shadow: none; font-family: inherit; }
.nav-label { padding: .3rem 1rem; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; color: #a1b9ae; }
.sidebar nav { gap: .25rem; }
.nav-item { display: flex; align-items: center; gap: .75rem; min-height: 43px; padding: .65rem .85rem; font-size: .87rem; font-weight: 600; color: #c2d3ca; border-radius: .5rem; }
.nav-icon { display: inline-grid; place-items: center; width: 1.2rem; font-size: 1.1rem; }
.nav-item.active { background: #dceacb; color: #203b2e; }
.nav-item:hover:not(.active), .admin-subnav-item:hover:not(.active) { background: #24463a; color: white; }
.admin-nav-group { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid #345046; }
.admin-subnav { margin-left: 1.45rem; padding-left: .6rem; border-color: #3b554a; }
.admin-subnav-item { min-height: 35px; font-size: .79rem; line-height: 1.35; color: #b8cbbf; padding: .45rem .7rem; }
.admin-subnav-item.active { color: #e3f2cc; background: #2b4e3d; box-shadow: inset 3px 0 #c3dfa3; }
.account-card { margin-top: auto; padding: 1rem .45rem 0; font-size: .8rem; }
.account-card > div { min-width: 0; overflow-wrap: anywhere; }.account-card small { font-size: .72rem; color: #b3c9bd; }
.avatar { background: #dceacb; font-size: .85rem; }
.workspace { max-width: 1720px; padding: 2rem clamp(1.4rem, 3vw, 3rem) 3rem; min-width: 0; }
.workspace > header { align-items: center; margin-bottom: 1.8rem; }
.workspace header .eyebrow { text-transform: none; letter-spacing: .025em; font-weight: 550; font-size: .75rem; color: var(--muted); opacity: 1; }
.workspace header h1 { font-family: inherit; font-size: clamp(1.8rem, 2.5vw, 2.5rem); font-weight: 650; letter-spacing: -.045em; line-height: 1.2; }
.page-description { color: var(--muted); font-size: .87rem; margin: .5rem 0 0; max-width: 680px; }
.connection-status { display: flex; align-items: center; gap: .5rem; flex: none; max-width: 240px; font-size: .73rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--muted); }
.connection-dot, .status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 100%; background: #83948c; flex: none; }
[data-status="live"] .connection-dot, .status-dot.online { background: #19866a; }
[data-status="reconnecting"] { background: #fff8e7; border-color: #e7c479; color: #765112; }
[data-status="reconnecting"] .connection-dot { background: #ba7617; }
.status-dot.offline { background: #c87b26; }.status-dot.inactive { background: #83948c; }
.stats-grid { gap: 1rem; }.stats-grid article, .panel { border-radius: .75rem; box-shadow: none; }
.stats-grid strong { font-family: inherit; font-weight: 650; font-size: 2.25rem; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.fleet-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { text-align: left; padding: 1.15rem 1.2rem; border: 1px solid var(--line); border-radius: .75rem; background: white; color: var(--ink); }
.stat-card .stat-label { display: flex; justify-content: space-between; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; }
.stat-card small { display: block; color: var(--muted); font-size: .72rem; margin-top: .25rem; }
.stat-card.active { border-color: #7aab94; box-shadow: 0 0 0 1px #7aab94; background: #f2f8ee; }
.stat-card:hover { border-color: #7aab94; }.stat-card[data-fleet-status="offline"] strong { color: #956018; }
.section-heading { margin: 1.8rem 0 .8rem; }.section-heading h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -.02em; }.section-heading p { font-size: .82rem; line-height: 1.55; }.section-heading.divided { margin-top: 1.5rem; padding-top: 1.25rem; }
.fleet-toolbar { margin: 1.7rem 0 .5rem; }.fleet-toolbar .section-heading { margin-top: 0; }
.fleet-filters { display: grid; grid-template-columns: minmax(200px, 2.1fr) repeat(4, minmax(110px, 1fr)); gap: .7rem; align-items: end; }
label { font-size: .78rem; font-weight: 600; gap: .4rem; }
input, select, textarea { border-radius: .5rem; padding: .65rem .8rem; font-size: .85rem; min-height: 42px; }
textarea { min-height: 90px; resize: vertical; }input[type="checkbox"] { min-height: auto; accent-color: var(--green); }
input::placeholder { color: #6a7c74; opacity: 1; }
.primary, .secondary, .danger-button { border-radius: .5rem; padding: .7rem 1rem; font-size: .83rem; min-height: 42px; box-shadow: none; }
.secondary { border: 1px solid var(--line); background: #f6f9f6; color: var(--green-dark); }.secondary:hover { background: #eaf2e8; }
.view-switch { display: flex; flex: none; padding: 3px; border: 1px solid var(--line); border-radius: .5rem; background: #eaf0eb; }
.view-switch button { border: 0; background: transparent; border-radius: .3rem; padding: .35rem .7rem; min-height: 34px; font-size: .78rem; color: var(--muted); }
.view-switch [aria-pressed="true"] { color: var(--green-dark); background: white; box-shadow: 0 1px 4px #1b302c12; font-weight: 650; }
.filter-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .7rem; min-height: 28px; font-size: .76rem; color: var(--muted); }
.filter-summary .text-button { margin: 0; font-size: .76rem; min-height: 30px; }
.device-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr)); gap: .9rem; }
.device-card { border-radius: .7rem; padding: 1.1rem; min-width: 0; transition: border-color .15s; }
.device-card:hover { transform: none; box-shadow: none; border-color: #91b7a4; }
.device-top { gap: .6rem; }.device-top > div { min-width: 0; }.device-top h3 { font-size: .93rem; font-weight: 650; overflow-wrap: anywhere; }.device-id { font-size: .7rem; overflow-wrap: anywhere; }
.badge { font-size: .68rem; font-weight: 650; white-space: nowrap; padding: .25rem .5rem; }.badge.offline { background: #fcf0db; color: #845316; }
.device-meta { gap: .8rem; padding-top: .85rem; margin-top: .85rem; }.device-meta span { font-size: .7rem; }.device-meta strong { font-size: .79rem; font-weight: 550; }
.device-card-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; margin: 1rem -1.1rem -1.1rem; padding: .65rem 1.1rem; border-top: 1px solid var(--line); background: #f8faf8; border-radius: 0 0 .7rem .7rem; font-size: .66rem; color: var(--muted); }
.device-card-link .device-card-footer span:last-child { color: var(--green); font-weight: 650; }
.list-layout .device-grid { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.list-layout .device-card { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.8fr); align-items: center; gap: 1.5rem; }
.list-layout .device-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); border: 0; padding: 0; margin: 0; }
.list-layout .device-card-footer { grid-column: 1 / -1; margin-top: -.5rem; }
.directory-search { margin: 1rem 0 .5rem; max-width: 620px; }.results-copy { color: var(--muted); font-size: .75rem; margin: .4rem 0 .8rem; }
.hierarchy-card { border-radius: .7rem; box-shadow: none; }.hierarchy-device, .hierarchy-site { border-radius: .5rem; background: #f8faf8; }.hierarchy-site { width: 100%; text-align: left; color: var(--ink); }.hierarchy-card-header h3 { font-size: 1rem; }
.panel { padding: 1.3rem; }.inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }.inline-form > button[type="submit"] { justify-self: start; align-self: end; }.device-filter-form { grid-template-columns: minmax(160px, 2fr) 1fr 1fr auto; }
.user-row { border-radius: .5rem; padding: .9rem; }.user-row h3 { font-weight: 650; }.user-row p { line-height: 1.6; }.small-button { min-height: 34px; font-size: .75rem; }.small-button:hover:not(:disabled) { border-color: #7aab94; }.user-controls { gap: .5rem; }
.settings-dialog { border-radius: .85rem; }.settings-body fieldset { border-radius: .6rem; }.settings-header h2 { font-size: 1.25rem; }.settings-actions { background: #f8faf8; }.settings-tabs button { font-size: .8rem; }.form-hint { line-height: 1.6; }
.toast { z-index: 100; line-height: 1.6; border: 1px solid #547667; font-size: .85rem; max-width: min(460px, calc(100vw - 2rem)); }
.auth-form h2 { font-family: inherit; font-size: 2rem; letter-spacing: -.04em; }.brand-panel h1 { font-family: inherit; font-weight: 600; font-size: clamp(3rem, 5vw, 5rem); line-height: 1.08; }.brand-panel { background: #143e30; }.auth-panel .tabs { max-width: 470px; width: 100%; margin: 0 auto 2rem; }.auth-form { gap: 1rem; }
@media (min-width: 851px) and (max-width: 1190px) { .fleet-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }.fleet-filters .search-field { grid-column: 1 / -1; }.connection-status { max-width: 175px; }.workspace { padding: 1.5rem; }.list-layout .device-card { grid-template-columns: 1fr; gap: 1rem; } }
@media (max-width: 850px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); }.sidebar { padding: .8rem 1rem; }.sidebar-brand { margin: 0; padding: 0; }.sidebar nav { gap: .3rem; }.admin-nav-group { margin: 0; padding: .5rem 0; }.nav-label { padding: .8rem .8rem .2rem; }.account-card { margin: 0; padding: 0; }.workspace { padding: 1.4rem 1rem 2rem; }.workspace > header { align-items: flex-start; flex-direction: column; gap: .8rem; }.workspace header h1 { font-size: 1.9rem; }.connection-status { max-width: none; }.fleet-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }.stat-card { padding: .9rem; }.fleet-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }.fleet-filters .search-field { grid-column: 1 / -1; }.fleet-toolbar .section-heading { flex-direction: row; }.inline-form, .device-filter-form { grid-template-columns: minmax(0, 1fr); }.inline-form > button[type="submit"] { justify-self: stretch; }.list-layout .device-card { grid-template-columns: minmax(0, 1fr); gap: 1rem; }.list-layout .device-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }.list-layout .device-card-footer { margin-top: 0; }.nav-item, .admin-subnav-item, .small-button, .view-switch button { min-height: 44px; }.settings-tabs { grid-template-columns: 1fr; }.settings-actions { padding: .8rem 1rem; }.brand-panel { padding: 2rem; min-height: auto; }.brand-panel h1 { font-size: 2.6rem; }.brand-panel .eyebrow { margin-top: 1.5rem; }.auth-panel { padding: 2rem 1.25rem; }.hierarchy-devices, .hierarchy-sites { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 440px) { .sidebar { padding: .65rem; gap: .4rem; }.sidebar-brand { gap: .5rem; }.sidebar-brand strong { font-size: 1rem; }.brand-caption { font-size: .5rem; }.account-card { margin-left: auto; }.stat-card small { font-size: .66rem; }.stat-card .stat-label { font-size: .73rem; }.fleet-toolbar .section-heading { flex-wrap: wrap; }.device-grid { grid-template-columns: minmax(0, 1fr); }.settings-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

.user-row small, .access-chip, .artifact-details { overflow-wrap: anywhere; min-width: 0; }
.artifact-details { color: var(--muted); font-size: .75rem; margin-top: .5rem; }
.artifact-details summary { cursor: pointer; color: var(--green); padding: .35rem 0; }
.artifact-details dl { margin: .5rem 0 0; padding: .75rem; background: var(--paper); border-radius: .4rem; }
.artifact-details dt { font-weight: 650; margin-top: .4rem; }.artifact-details dd { margin: .15rem 0 .5rem; }.artifact-details code { font-size: .7rem; }
.inline-form > *, fieldset { min-width: 0; }

#action-dialog form { grid-template-rows: auto minmax(0, 1fr) auto; }
#action-dialog-fields { display: grid; gap: 1rem; }
#action-dialog-fields textarea { min-height: 6rem; resize: vertical; }
