/* ============================================================ RemoteOps UI */
:root {
  --bg: #05080d;
  --bg-2: #080e16;
  --panel: #0d1520;
  --panel-2: #131f2c;
  --panel-3: #182636;
  --line: rgba(146, 176, 210, .13);
  --line-2: rgba(146, 176, 210, .26);
  --text: #e9eff7;
  --muted: #8ba1b9;
  --muted-2: #61788f;
  --accent: #2ee6b8;
  --accent-2: #57a1ff;
  --violet: #a78bfa;
  --danger: #ff5f6d;
  --danger-soft: rgba(255, 95, 109, .12);
  --grad: linear-gradient(135deg, #2ee6b8 0%, #57a1ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(46, 230, 184, .16), rgba(87, 161, 255, .16));
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .85);
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(46, 230, 184, .10), transparent 62%),
    radial-gradient(1000px 700px at 92% 4%, rgba(87, 161, 255, .12), transparent 60%),
    linear-gradient(180deg, #060a10 0%, #05080d 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(46, 230, 184, .28); }

/* thin, dark scrollbars */
* { scrollbar-width: thin; scrollbar-color: #26374a transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #223142; border: 3px solid transparent; background-clip: content-box; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #2f4459; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------- primitives */
button, input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 13px;
  outline: none;
  transition: border-color .16s ease, background .16s ease, transform .12s ease, box-shadow .16s ease;
}

input::placeholder, textarea::placeholder { color: #5d748c; }
input:hover, select:hover, textarea:hover { border-color: var(--line-2); }
textarea { resize: vertical; min-height: 108px; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(46, 230, 184, .55);
  box-shadow: 0 0 0 3px rgba(46, 230, 184, .12);
}

select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238ba1b9' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; }

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  font-weight: 550;
  letter-spacing: .1px;
}
button svg { width: 16px; height: 16px; flex: none; }
button:hover:not(:disabled) { border-color: var(--line-2); background: var(--panel-3); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .38; cursor: not-allowed; }
button:focus-visible { box-shadow: 0 0 0 3px rgba(87, 161, 255, .3); }

.primary {
  background: var(--grad);
  border-color: transparent;
  color: #04120f;
  font-weight: 700;
  box-shadow: 0 10px 24px -12px rgba(46, 230, 184, .7);
}
.primary:hover:not(:disabled) { background: var(--grad); filter: brightness(1.08); border-color: transparent; }

.accent {
  background: rgba(46, 230, 184, .12);
  border-color: rgba(46, 230, 184, .35);
  color: #8ff5dd;
}
.accent:hover:not(:disabled) { background: rgba(46, 230, 184, .2); border-color: rgba(46, 230, 184, .6); }

.danger { background: var(--danger-soft); border-color: rgba(255, 95, 109, .3); color: #ff9ba3; }
.danger:hover:not(:disabled) { background: rgba(255, 95, 109, .2); border-color: rgba(255, 95, 109, .55); }

.ghost { background: transparent; }
.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .04); }
.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.wide { width: 100%; padding: 11px 16px; border-radius: 11px; }
.muted { color: var(--muted); }
.small-text { font-size: 12.5px; }
.center { text-align: center; }
.error { color: #ff8f97; font-size: 12.5px; margin: 0; }
.code {
  display: block;
  padding: 11px 13px;
  background: #060c13;
  border: 1px solid var(--line);
  border-radius: 10px;
  word-break: break-all;
  font-family: "Cascadia Mono", Consolas, "SF Mono", monospace;
  font-size: 12px;
  color: #a9e9da;
  margin: 0;
}

.eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted-2);
  font-weight: 700;
}

/* ------------------------------------------------------------------ brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid rgba(46, 230, 184, .28);
  color: #7df0d6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-mark.small { width: 32px; height: 32px; border-radius: 10px; }
.brand-mark.small svg { width: 18px; height: 18px; }
.brand-text { font-size: 17px; font-weight: 650; letter-spacing: -.2px; }
.brand-text b { font-weight: 750; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }

.login-visual {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 64px clamp(32px, 6vw, 88px);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(700px 500px at 20% 10%, rgba(46, 230, 184, .10), transparent 70%),
    linear-gradient(160deg, #0a1420 0%, #060a10 70%);
}
.login-visual-inner { position: relative; z-index: 2; max-width: 540px; display: grid; gap: 22px; }
.login-visual h1 {
  margin: 14px 0 0;
  font-size: clamp(30px, 3.6vw, 47px);
  line-height: 1.08;
  letter-spacing: -1.4px;
  font-weight: 700;
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-lede { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; max-width: 480px; }

.feature-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 11px; }
.feature-list li { display: flex; align-items: center; gap: 11px; color: #c3d3e4; font-size: 13.5px; }
.tick {
  width: 22px; height: 22px; flex: none;
  display: grid; place-items: center;
  border-radius: 7px;
  background: rgba(46, 230, 184, .12);
  border: 1px solid rgba(46, 230, 184, .26);
  color: var(--accent);
  font-size: 11px; font-weight: 800;
}
.login-foot { color: var(--muted-2); font-size: 11.5px; letter-spacing: .3px; margin-top: 10px; }

.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; }
.blob-a { width: 420px; height: 420px; right: -90px; top: -80px; background: rgba(46, 230, 184, .18); }
.blob-b { width: 460px; height: 460px; left: -120px; bottom: -160px; background: rgba(87, 161, 255, .16); }

.login-panel { display: grid; place-items: center; padding: 40px 24px; background: rgba(5, 8, 13, .5); }

.card {
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 26px;
  background: linear-gradient(180deg, rgba(19, 31, 44, .92), rgba(13, 21, 32, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.card h1, .card h2 { margin: 0; letter-spacing: -.4px; }
.card h2 { font-size: 23px; font-weight: 680; }
.login-card { max-width: 392px; gap: 13px; }
.login-card h2 { margin-top: -6px; }

.field { display: grid; gap: 7px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .2px; }
.field input { padding: 11px 13px; background: #0a121b; }
.login-card .primary { margin-top: 6px; }

/* ----------------------------------------------------------------- console */
.app { height: 100vh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 14, 22, .78);
  backdrop-filter: blur(16px) saturate(1.2);
  position: relative;
  z-index: 5;
}
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(46, 230, 184, .4), rgba(87, 161, 255, .35), transparent);
  opacity: .7;
}
.version-chip {
  font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted-2); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 999px; margin-left: 2px;
}
.topbar-right { display: flex; align-items: center; gap: 9px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(19, 31, 44, .7);
}
.who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #cddaea; }
.who-mail { font-weight: 550; }
.who-role {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(46, 230, 184, .13); color: #7ff0d6; border: 1px solid rgba(46, 230, 184, .25);
}
.who-role.readonly { background: rgba(167, 139, 250, .14); color: #c4b5fd; border-color: rgba(167, 139, 250, .3); }

.icon-text { padding: 8px 11px; font-size: 12.5px; }

.layout {
  display: grid;
  grid-template-columns: 302px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

/* ---------------------------------------------------------------- sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 17, 26, .8), rgba(6, 11, 17, .9));
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
}
.sidebar-title { display: flex; align-items: center; gap: 8px; }
.sidebar-head h2 {
  margin: 0; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--muted-2); font-weight: 750;
}
.count {
  min-width: 20px; height: 19px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(87, 161, 255, .14);
  border: 1px solid rgba(87, 161, 255, .22);
  color: #9dc7ff; font-size: 10.5px; font-weight: 700;
}

.devices { list-style: none; margin: 0; padding: 4px 10px 12px; overflow: auto; display: grid; gap: 6px; align-content: start; flex: 0 1 auto; min-width: 0; }

.device {
  position: relative;
  padding: 11px 12px 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(19, 31, 44, .45);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.device::before {
  content: "";
  position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px;
  border-radius: 2px; background: transparent; transition: background .15s ease;
}
.device:hover { background: rgba(24, 38, 54, .75); border-color: var(--line); }
.device.active { background: rgba(24, 38, 54, .95); border-color: rgba(46, 230, 184, .28); }
.device.active::before { background: var(--accent); box-shadow: 0 0 12px rgba(46, 230, 184, .8); }
.device.empty-card { cursor: default; background: transparent; border: 1px dashed var(--line); text-align: center; }
.device-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; padding-right: 22px; }
.device-meta { color: var(--muted-2); font-size: 11.5px; margin-top: 4px; padding-left: 16px; display: flex; gap: 6px; flex-wrap: wrap; }
.device-meta .sep { opacity: .45; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #3d4a59; flex: none; }
.dot.online { background: var(--accent); box-shadow: 0 0 0 3px rgba(46, 230, 184, .14), 0 0 10px rgba(46, 230, 184, .7); }
.dot.live { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 95, 109, .16), 0 0 10px rgba(255, 95, 109, .7); animation: pulse 1.8s ease-in-out infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.device-actions { position: absolute; top: 7px; right: 7px; display: flex; gap: 2px; }
.device-actions .device-del { position: static; top: auto; right: auto; }

.device-note-btn.has-note { opacity: .8; color: var(--accent); }

.device-note {
  margin: 5px 0 0 16px;
  padding: 4px 8px;
  border-left: 2px solid rgba(245, 197, 66, .75);
  border-radius: 0 6px 6px 0;
  background: rgba(245, 197, 66, .10);
  color: #f7c948;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.device-del {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; padding: 0;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.device-del svg { width: 13px; height: 13px; }
.device:hover .device-del, .device.active .device-del, .device-del:focus-visible { opacity: 1; }
.device-actions .device-note-btn.has-note { opacity: .8; }
.device-del:hover { background: var(--danger-soft); border-color: rgba(255, 95, 109, .35); color: #ff9ba3; }

.audit {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 13px 16px 16px;
  overflow: auto;
  max-height: 40%;
  background: rgba(6, 11, 17, .5);
}
.audit-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.audit h3 { margin: 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted-2); font-weight: 750; }
.dot-led { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(46, 230, 184, .9); }
.audit ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.audit li {
  font-size: 11.5px; color: var(--muted-2);
  border-left: 1px solid var(--line-2);
  padding-left: 9px; line-height: 1.45;
}
.audit li b { color: #b9cbe0; font-weight: 600; }

/* Activity lives in its own dialog now, not under the device list. */
#activity-dialog { max-width: min(620px, 94vw); }
.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-height: 55vh;
  overflow: auto;
}
.audit-list li {
  font-size: 12px;
  color: var(--muted-2);
  border-left: 1px solid var(--line-2);
  padding-left: 10px;
  line-height: 1.5;
}
.audit-list li b { color: #b9cbe0; font-weight: 600; }

/* ------------------------------------------------------------------ stage */
.stage {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 16px 18px 14px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.stage > .toolbar, .stage > .browser-bar, .stage > .hint, .stage > .nav, .stage > .notice { flex: 0 0 auto; }
.stage > .nav[hidden], .stage > .notice[hidden] { display: none !important; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.toolbar-title { min-width: 0; }
.device-title { font-size: 17px; font-weight: 660; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-sub { color: var(--muted-2); font-size: 12px; margin-top: 2px; }
.toolbar-actions { display: flex; align-items: center; gap: 7px; }

.screen {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(87, 161, 255, .06), transparent 70%),
    #04070b;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 20px 50px -30px #000;
}
.screen::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
}

#view {
  display: none;
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  outline: none;
  cursor: default;
}
#view.visible { display: block; }
#view:focus-visible { box-shadow: 0 0 0 2px rgba(46, 230, 184, .5); }

.placeholder { color: var(--muted); text-align: center; padding: 26px; max-width: 420px; display: grid; justify-items: center; gap: 6px; }
.placeholder-icon {
  width: 54px; height: 54px; display: grid; place-items: center;
  border-radius: 15px; margin-bottom: 6px;
  background: rgba(87, 161, 255, .07);
  border: 1px solid var(--line);
  color: #5f7c9b;
}
.placeholder-icon svg { width: 26px; height: 26px; }
.placeholder-title { margin: 0; font-weight: 650; color: #c2d2e4; font-size: 14px; }
.placeholder-text { margin: 0; font-size: 12.5px; color: var(--muted-2); }

.live {
  position: absolute;
  top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(58, 20, 23, .82);
  border: 1px solid rgba(255, 95, 109, .4);
  color: #ffb0b6;
  font-size: 10px; font-weight: 800; letter-spacing: 1.3px;
  backdrop-filter: blur(6px);
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: pulse 1.6s ease-in-out infinite; }

/* The Copy offer that appears under a fresh selection in the hidden page. */
.selection-copy {
  position: absolute;
  z-index: 6;
}
.selection-copy button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 9px;
  background: linear-gradient(180deg, #1c2c3d, #12202d);
  border: 1px solid rgba(46, 230, 184, .55);
  color: #eafff9;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 14px 30px -12px #000, 0 0 0 1px rgba(0, 0, 0, .35);
  animation: toast-in .12s ease-out;
}
.selection-copy button:hover { border-color: var(--accent); background: linear-gradient(180deg, #233749, #172837); }
.selection-copy svg { width: 14px; height: 14px; flex: none; }

/* ------------------------------------------------------------ browser bar */
.browser-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(19, 31, 44, .7), rgba(10, 17, 26, .7));
}
.bar-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--muted-2); font-weight: 750; padding-right: 4px;
}
.browser-bar input { flex: 0 0 auto; padding: 7px 11px; background: #0a121b; font-size: 13px; }
.browser-bar select { padding: 7px 30px 7px 11px; font-size: 13px; background-color: #0a121b; }
.browser-bar #url { flex: 1 1 180px; }
.browser-bar button { padding: 7px 13px; font-size: 12.5px; }

.hint { margin: 0; color: var(--muted-2); font-size: 12px; }
.hint summary {
  cursor: pointer; color: var(--muted); font-weight: 600; font-size: 11.5px;
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.hint summary::-webkit-details-marker { display: none; }
.hint summary::before { content: "?"; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 9px; }
.hint[open] summary { margin-bottom: 7px; }
.hint p { margin: 0 0 6px; max-width: 980px; line-height: 1.6; }
.hint code { background: #060c13; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 11px; color: #9fe6d5; }

/* --------------------------------------------------------- nav / tabstrip */
.nav { display: grid; gap: 7px; }
.nav-row { display: flex; align-items: center; gap: 6px; }
.nav-btn { padding: 7px; width: 34px; height: 34px; border-radius: 9px; }
.wide-btn { width: auto; height: 34px; padding: 0 13px; font-size: 12.5px; }

.address-wrap { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.address-lock { position: absolute; left: 11px; width: 14px; height: 14px; color: #5b7a97; pointer-events: none; }
.address-wrap input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: 9px;
  background: #070d15;
  font-size: 12.5px;
}

.tabstrip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabstrip::-webkit-scrollbar { display: none; }
.tab {
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(19, 31, 44, .8);
  color: var(--muted-2);
  border: 1px solid transparent;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.tab:hover { color: var(--muted); background: var(--panel-3); }
.tab.active { background: rgba(46, 230, 184, .1); color: #d6fff6; border-color: rgba(46, 230, 184, .28); }

/* ---------------------------------------------------------------- notices */
.notice {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px;
  border-radius: 11px;
  background: rgba(87, 161, 255, .08);
  border: 1px solid rgba(87, 161, 255, .22);
  color: #cfe0f5;
  font-size: 12.5px;
}
.notice::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2);
  animation: pulse 1.4s ease-in-out infinite;
}
.notice.error { background: var(--danger-soft); border-color: rgba(255, 95, 109, .3); color: #ffb3b9; }
.notice.error::before { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: none; }

/* ---------------------------------------------------------------- dialogs */
dialog {
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 0;
  max-width: min(560px, 94vw);
  width: 100%;
}
dialog::backdrop { background: rgba(2, 5, 9, .72); backdrop-filter: blur(4px); }
.dialog-card { gap: 12px; }
.dialog-card h2 { font-size: 20px; margin-top: -4px; }
.dialog-card .code { max-height: 50vh; overflow: auto; white-space: pre-wrap; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.enroll-result { display: grid; gap: 9px; padding-top: 4px; }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 50;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 15px;
  border-radius: 11px;
  background: rgba(58, 20, 23, .95);
  border: 1px solid rgba(255, 95, 109, .35);
  color: #ffb3b9;
  font-size: 12.5px;
  box-shadow: 0 18px 40px -18px #000;
  animation: toast-in .22s ease-out;
  max-width: 380px;
}
.toast.ok { background: rgba(10, 40, 34, .95); border-color: rgba(46, 230, 184, .35); color: #9df3de; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1150px) {
  .login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
}

@media (max-width: 940px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .audit { display: none; }
  .devices { display: flex; min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 12px; }
  .device { min-width: 208px; }
  .stage { padding: 12px; }
  .device-title { font-size: 15px; }
  .icon-text span { display: none; }
  .icon-text { padding: 8px; }
}

@media (max-width: 620px) {
  .topbar { padding: 10px 12px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions #start { flex: 1; }
  .browser-bar .bar-label { display: none; }
  .browser-bar #url { flex-basis: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------- fleet installer */

.head-actions { display: flex; align-items: center; gap: 6px; }
.dialog-actions.start { justify-content: flex-start; }
.danger-text { color: #ff9aa2; }
.danger-text:hover:not(:disabled) { border-color: rgba(255, 122, 132, .5); }
#fleet-dialog .field input.mono {
  font-family: "Cascadia Mono", Consolas, "SF Mono", monospace;
  font-size: 12.5px;
  letter-spacing: .2px;
  color: #a9e9da;
}
#fleet-dialog .code { margin-top: 2px; }
#fleet-dialog .build-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(46, 230, 184, .22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(46, 230, 184, .10), rgba(87, 161, 255, .07));
}
#fleet-dialog .build-box .build-copy { flex: 1; min-width: 0; }
#fleet-dialog .build-box strong { font-size: 13.5px; letter-spacing: .1px; }
#fleet-dialog .build-box p { margin: 3px 0 0; }
#fleet-dialog .build-box .primary { flex: none; }
#fleet-dialog .build-box .primary.busy { opacity: .7; cursor: progress; }
