.asm-local { margin: 0; background: #edf2f5; }
[data-asmagic-dashboard] {
  --asm-page: #eef3f6;
  --asm-paper: #fff;
  --asm-ink: #172c38;
  --asm-muted: #526974;
  --asm-line: #d5e0e5;
  --asm-primary: #116c62;
  --asm-soft: #e2f3ed;
  --asm-tablet: #555b9c;
  --asm-alert: #9b372b;
  font: 400 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  color: var(--asm-ink);
  text-align: left;
  font-variant-numeric: tabular-nums;
}
[data-asmagic-dashboard] *, [data-asmagic-dashboard] *::before, [data-asmagic-dashboard] *::after { box-sizing: border-box; }
[data-asmagic-dashboard] :is(h1, h2, h3, h4, p, dl, dd) { color: inherit; font-family: inherit; margin: 0; }
[data-asmagic-dashboard] h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.12; letter-spacing: -.045em; font-weight: 700; }
[data-asmagic-dashboard] h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.026em; font-weight: 690; overflow-wrap: anywhere; }
[data-asmagic-dashboard] h3 { font-size: 16px; font-weight: 690; line-height: 1.3; }
[data-asmagic-dashboard] h4 { font-size: 13px; font-weight: 650; }
[data-asmagic-dashboard] :is(button, input, select) { font: inherit; margin: 0; }
[data-asmagic-dashboard] :is(button, input, select, a):focus-visible { outline: 3px solid #278d83; outline-offset: 3px; }
[data-asmagic-dashboard] [hidden] { display: none !important; }
[data-asmagic-dashboard] a { color: var(--asm-primary); font-weight: 600; text-underline-offset: 3px; }
.asm-shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: clamp(23px, 4.5vw, 60px);
  border: 1px solid var(--asm-line);
  border-radius: 22px;
  background: var(--asm-page);
}
.asm-local .asm-shell { min-height: 100vh; max-width: 1400px; border: 0; }
.asm-header { display: grid; gap: 19px; }
.asm-product, .asm-heading, .asm-status, .asm-card-header, .asm-form-row, .asm-bar, .asm-bar-left, .asm-workspace-actions {
  display: flex; align-items: center;
}
.asm-product { gap: 8px; font-size: 14px; font-weight: 690; }
.asm-mark, .asm-idle-glyph, .asm-auth-symbol, .asm-signal, .asm-node-glyph {
  display: grid; place-items: center; flex: none; color: var(--asm-primary);
}
.asm-mark { width: 29px; height: 29px; border-radius: 8px; color: white; background: var(--asm-primary); }
.asm-mark .asm-icon { transform: scale(.62); }
.asm-heading { justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--asm-line); }
.asm-status { gap: 6px; color: var(--asm-muted); font-size: 13px; padding: 6px 10px; border: 1px solid var(--asm-line); border-radius: 100px; background: var(--asm-paper); font-weight: 560; }
.asm-status i { background: #8d9ca2; border-radius: 100%; width: 7px; height: 7px; }
.asm-status[data-live="true"] { color: var(--asm-primary); border-color: #b7d8ce; }
.asm-status[data-live="true"] i { background: #198376; }
.asm-card { border: 1px solid var(--asm-line); border-radius: 16px; background: var(--asm-paper); min-width: 0; }
.asm-auth { width: min(100%, 570px); margin: clamp(22px, 5vw, 62px) auto 16px; padding: clamp(20px, 4vw, 38px); }
.asm-auth > * + * { margin-top: 13px !important; }
.asm-auth-symbol { width: 48px; height: 48px; background: var(--asm-soft); border-radius: 13px; }
[data-asmagic-dashboard] :is(.asm-auth, .asm-idle, .asm-stream-ready) p { color: var(--asm-muted); max-width: 51ch; }
.asm-form { display: grid; align-items: start; gap: 7px; padding-top: 5px; }
.asm-form label { font-size: 14px; font-weight: 650; }
.asm-form-row { gap: 9px; align-items: stretch; flex-wrap: wrap; }
[data-asmagic-dashboard] :is(input, select) {
  color: var(--asm-ink); background: #fff; padding: 8px 10px; border: 1px solid #bdccd2;
  min-height: 38px; box-shadow: none; border-radius: 8px;
}
.asm-form input { flex: 1; min-width: 120px; width: 100%; }
[data-asmagic-dashboard] .asm-error { color: var(--asm-alert); }
.asm-auth > a { display: inline-block; font-size: 14px; }
.asm-bar { min-height: 62px; padding-block: 8px; justify-content: space-between; gap: 12px; }
.asm-bar-left { gap: 12px; flex-wrap: wrap; }
.asm-connected-picker { font-size: 13px; color: var(--asm-muted); }
.asm-content { display: grid; gap: 18px; }
.asm-content--split { grid-template-columns: minmax(0, 1.65fr) minmax(240px, 1fr); }
.asm-button {
  display: inline-flex; min-height: 38px; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer;
  padding: 7px 12px; border: 1px solid #c4d2d8; background: var(--asm-paper); color: var(--asm-ink); font-weight: 640 !important;
  text-transform: none; letter-spacing: normal;
}
.asm-button--primary { color: white; background: var(--asm-primary); border-color: var(--asm-primary); }
.asm-button--quiet { color: var(--asm-muted); background: transparent; border-color: transparent; }
.asm-button:not(:disabled):hover { filter: brightness(.96); }
[data-asmagic-dashboard] :disabled { cursor: wait; opacity: .72; }
.asm-card-header { justify-content: space-between; gap: 14px; padding: 20px 23px 15px; }
.asm-meta { color: var(--asm-muted) !important; font-size: 13px; }
.asm-card-header .asm-meta { display: block; margin-top: 2px; }
.asm-signal { width: 40px; height: 40px; border-radius: 10px; background: var(--asm-soft); }
.asm-map {
  margin: 0 15px 15px; min-height: 220px; padding: 24px 14px; border-radius: 12px;
  display: grid; justify-items: center; align-content: center; gap: 30px;
  background-color: #f4f8f9; background-image: radial-gradient(circle, #c4d5db 0.9px, transparent 1px); background-size: 15px 15px;
}
.asm-map--with-devices { min-height: 245px; }
.asm-hub { display: grid; justify-items: center; gap: 3px; font-size: 13px; position: relative; }
.asm-hub small { color: var(--asm-muted); font-size: 12px; background: #f4f8f9; }
.asm-hub-shape { width: 61px; height: 61px; display: grid; place-items: center; border-radius: 17px; color: #fff; background: var(--asm-primary); box-shadow: 0 0 0 5px #d6e9e6; margin-bottom: 7px; }
.asm-map--with-devices .asm-hub::after { position: absolute; top: calc(100% + 2px); left: 50%; height: 27px; width: 1px; content: ""; background: #95b1b4; }
.asm-nodes { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; position: relative; width: min(100%, 880px); }
.asm-node {
  min-width: min(100%, 117px); max-width: min(100%, 160px); min-height: 99px;
  display: grid; align-content: start; justify-items: center; gap: 2px;
  padding: 8px; color: inherit; border: 1px solid #cbdbdf; border-radius: 11px; background: #fff;
  text-align: center; cursor: pointer;
}
.asm-node:hover { border-color: #7aa69f; }
.asm-node[aria-pressed="true"] { border-color: var(--asm-primary); background: #e9f6f1; }
.asm-node-glyph { width: 34px; height: 34px; border-radius: 9px; background: #e4f3ef; margin-bottom: 2px; }
.asm-node--tablet .asm-node-glyph { background: #eaeaf8; color: var(--asm-tablet); }
.asm-node-glyph--connected { box-shadow: inset 0 0 0 1px currentColor; }
.asm-device-name { max-width: 100%; font-size: 13px; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.asm-node-meta { color: var(--asm-muted); font-size: 11px; font-weight: 500; }
[data-asmagic-dashboard] .asm-map-help { color: var(--asm-muted); padding: 0 22px 17px; font-size: 13px; }
.asm-idle { display: grid; justify-items: start; align-content: center; gap: 10px; padding: 25px; min-height: 230px; }
.asm-idle-glyph { width: 44px; height: 44px; border-radius: 11px; background: #e7f1f3; }
.asm-device-intro > .asm-button { margin-top: 6px; }
.asm-workspace-header { padding: 17px 22px; display: flex; align-items: center; gap: 13px; }
.asm-workspace-header .asm-meta { margin-top: 2px; }
.asm-workspace-actions { margin-left: auto; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.asm-runtime { display: flex; gap: 10px; color: var(--asm-muted); font-size: 12px; flex-wrap: wrap; margin-top: 3px; }
.asm-runtime b { color: var(--asm-ink); font-weight: 620; }
.asm-stream-ready { border-top: 1px solid var(--asm-line); display: grid; gap: 9px; justify-items: start; padding: 21px 22px 24px; }
.asm-stream-ready button { margin-top: 4px; }
.asm-inline-error { padding: 0 22px 13px; }
.asm-console-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, 1fr); border-top: 1px solid var(--asm-line); }
.asm-monitor, .asm-controls { padding: 16px 19px 21px; min-width: 0; }
.asm-controls { border-left: 1px solid var(--asm-line); }
.asm-monitor-header { display: flex; min-height: 39px; margin-bottom: 10px; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.asm-preview { display: grid; place-items: center; background: #1d2f3b; min-height: 185px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; }
.asm-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.asm-preview img:not([hidden]) + .asm-preview-placeholder { display: none; }
.asm-preview-placeholder { display: grid; gap: 9px; justify-items: center; text-align: center; padding: 20px; color: #d9e9ee; font-size: 14px; }
.asm-sensor { padding: 12px 0 0; color: var(--asm-muted); font-size: 13px; }
.asm-sensor dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 9px; padding: 6px 0; border-bottom: 1px solid var(--asm-line); }
.asm-sensor dd { color: var(--asm-ink); }
.asm-control-group + .asm-control-group { margin-top: 17px; }
.asm-control-group h4 { color: var(--asm-muted); margin-bottom: 6px; }
.asm-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.asm-toggle, .asm-choice { color: var(--asm-ink); padding: 8px 10px; min-height: 58px; background: #f4f7f8; border: 1px solid #e0e9ec; border-radius: 9px; font-size: 13px !important; }
.asm-toggle { display: flex; gap: 4px; align-items: center; justify-content: space-between; text-align: left; cursor: pointer; }
.asm-toggle:hover:not(:disabled) { border-color: #9eb8bb; }
.asm-toggle > span:first-child { display: grid; gap: 3px; line-height: 1.2; overflow-wrap: anywhere; }
.asm-toggle .asm-icon { scale: .61; transform-origin: top left; height: 15px; color: var(--asm-primary); }
.asm-choice { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.asm-choice > select { max-width: 67%; }
.asm-switch { display: inline-flex; width: 28px; height: 17px; padding: 3px; flex: none; border-radius: 20px; background: #6d818a; }
.asm-switch::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: #fff; }
.asm-switch[data-on="true"] { justify-content: flex-end; background: var(--asm-primary); }
.asm-icon { display: inline-block; position: relative; width: 24px; height: 24px; }
.asm-icon::before, .asm-icon::after { content: ""; position: absolute; color: inherit; }
.asm-icon--hub::before { inset: 3px; border: 1.7px solid; border-radius: 5px; transform: rotate(45deg); }
.asm-icon--hub::after { inset: 9px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.asm-icon--phone::before, .asm-icon--tablet::before { inset: 1px 6px; border: 1.7px solid; border-radius: 4px; }
.asm-icon--phone::after, .asm-icon--tablet::after { width: 5px; height: 1.5px; background: currentColor; bottom: 5px; left: calc(50% - 2.5px); }
.asm-icon--tablet::before { inset: 2px 2px; }
.asm-icon--signal::before { inset: 6px 3px 3px; border-left: 2px solid; border-bottom: 2px solid; border-radius: 2px; }
.asm-icon--signal::after { inset: 5px 2px 6px 6px; background: currentColor; clip-path: polygon(0 69%, 17% 69%, 34% 20%, 54% 77%, 76% 41%, 100% 41%, 100% 55%, 84% 55%, 52% 100%, 33% 53%, 23% 84%, 0 84%); }
.asm-icon--camera::before { inset: 4px 2px; border: 1.7px solid; border-radius: 4px; }
.asm-icon--camera::after { inset: 8px; border: 1.7px solid; border-radius: 50%; }
.asm-icon--settings::before { inset: 3px; border: 1.7px solid; border-radius: 50%; }
.asm-icon--settings::after { inset: 9px; border: 1.7px solid; border-radius: 50%; }
@media (max-width: 850px) {
  .asm-content--split, .asm-console-grid { grid-template-columns: 1fr; }
  .asm-controls { border-left: 0; border-top: 1px solid var(--asm-line); }
  .asm-monitor { padding-bottom: 15px; }
}
@media (max-width: 480px) {
  .asm-shell { padding: 14px; }
  .asm-workspace-header { flex-wrap: wrap; padding: 14px; }
  .asm-workspace-actions { margin-left: 0; justify-content: flex-start; width: 100%; }
  .asm-card-header { padding-inline: 15px; }
  .asm-map { margin-inline: 9px; padding-inline: 7px; }
  .asm-monitor, .asm-controls { padding-inline: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .asm-button, .asm-node, .asm-toggle { transition: border-color .14s, background-color .14s; }
}
