:root {
  --bg: #d7e0d4;
  --bg-elevated: #eef3ea;
  --surface: #dfe8dc;
  --border: rgba(12, 28, 22, 0.18);
  --text: #102018;
  --muted: #4a6356;
  --primary: #1f8a5a;
  --primary-end: #146b44;
  --link: #146b44;
  --danger: #b42318;
  --hover: rgba(31, 138, 90, 0.12);
  --input-bg: #f7faf5;
  --topbar-bg: rgba(8, 14, 18, 0.82);
  --overlay: rgba(8, 14, 18, 0.45);
  --ok-bg: rgba(22, 163, 74, 0.12);
  --ok-border: rgba(22, 163, 74, 0.35);
  --ok-text: #166534;
  --err-bg: rgba(185, 28, 28, 0.1);
  --err-border: rgba(185, 28, 28, 0.3);
  --err-text: #991b1b;
  --radius: 6px;
  --shadow: 0 8px 28px rgba(8, 14, 18, 0.18);
  --hud-glass: rgba(8, 14, 18, 0.78);
  --hud-line: rgba(90, 255, 196, 0.35);
  --hud-cyan: #5fffd0;
  --hud-amber: #ffd36a;
  --hud-ink: #e8fff6;
  --hud-muted: #8aa89a;
  --world-a: #c5d4c0;
  --world-b: #b7c8b2;
  --tile-bg: rgba(238, 243, 234, 0.92);
  --dash-warn-text: #7a4a00;
  --dash-info-text: #005c47;
  --dash-text-glow: none;
}

html[data-theme="dark"] {
  --bg: #071018;
  --bg-elevated: #0e1a24;
  --surface: #12222d;
  --border: rgba(95, 255, 208, 0.18);
  --text: #e8fff6;
  --muted: #8aa89a;
  --primary: #2ee6a6;
  --primary-end: #14b87f;
  --link: #5fffd0;
  --danger: #ff6b5a;
  --hover: rgba(47, 230, 166, 0.1);
  --input-bg: #0a151c;
  --topbar-bg: rgba(6, 12, 16, 0.86);
  --overlay: rgba(2, 6, 10, 0.72);
  --ok-bg: rgba(46, 230, 166, 0.1);
  --ok-border: rgba(46, 230, 166, 0.35);
  --ok-text: #b6ffde;
  --err-bg: rgba(255, 107, 90, 0.1);
  --err-border: rgba(255, 107, 90, 0.35);
  --err-text: #ffc4bc;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --world-a: #071018;
  --world-b: #0a1822;
  --tile-bg: rgba(14, 26, 36, 0.88);
  --dash-warn-text: #ffc94f;
  --dash-info-text: #7ef7dd;
  --dash-text-glow: 0 0 8px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body { min-height: 100%; }

.hud-body {
  height: 100%;
  overflow: hidden;
  font-family: "Rajdhani", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.app-body {
  min-height: 100vh;
  font-family: "Rajdhani", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.hud-world {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--world-a);
  background-image:
    linear-gradient(rgba(20, 80, 60, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 80, 60, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
html[data-theme="dark"] .hud-world {
  background-image:
    linear-gradient(rgba(95, 255, 208, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 255, 208, 0.06) 1px, transparent 1px);
}
.hud-scan {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
}

.hud-telemetry {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 2px;
  padding: 0 0 0 0.5rem;
  background: var(--hud-glass);
  border: 1px solid var(--hud-line);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  color: var(--hud-ink);
}
.header-casa {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 0.5rem;
}
a.hud-home,
a.hud-home:visited,
a.hud-home:hover {
  text-decoration: none;
  color: inherit;
}
.hud-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 0.45rem 1rem 0.4rem;
  border-right: 1px solid rgba(95, 255, 208, 0.18);
  min-width: 7.5rem;
}
.hud-stat--amp { min-width: 6.5rem; }
.hud-stat-label {
  font-family: "Share Tech Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hud-muted);
  line-height: 1.2;
}
.hud-stat-value {
  font-family: "Share Tech Mono", ui-monospace, monospace;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--hud-cyan);
  text-shadow: 0 0 12px rgba(95, 255, 208, 0.45);
}
.hud-stat-value--sm {
  font-size: 1.15rem;
  color: var(--hud-ink);
  text-shadow: none;
  text-transform: uppercase;
}
.hud-stat-value--rank {
  font-size: 1.15rem;
  color: var(--hud-amber);
  text-shadow: 0 0 10px rgba(255, 211, 106, 0.4);
}
.hud-telemetry-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.75rem 0 1rem;
  flex-shrink: 0;
}
.hud-sec {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
  padding: 0 0.4rem;
}
.hud-sec-link {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.7rem;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--hud-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 80ms ease, border-color 80ms ease, box-shadow 80ms ease;
}
.hud-sec-link:visited { color: var(--hud-muted); }
.hud-sec-link:hover {
  color: var(--hud-cyan);
  text-decoration: none;
  border-color: rgba(95, 255, 208, 0.35);
}
.hud-sec-link.is-on,
.hud-sec-link.is-on:visited {
  color: var(--hud-amber);
  border-color: var(--hud-amber);
  box-shadow: 0 0 10px rgba(255, 211, 106, 0.28);
}
.hud-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(95, 255, 208, 0.28);
  background: rgba(8, 20, 18, 0.5);
  color: var(--hud-cyan);
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  transition: transform 80ms ease, box-shadow 80ms ease, border-color 80ms ease, background 80ms ease;
}
.hud-icon-btn:hover {
  border-color: var(--hud-cyan);
  box-shadow: 0 0 12px rgba(95, 255, 208, 0.4);
  text-decoration: none;
}
.hud-icon-btn:active {
  transform: translateY(2px) scale(0.96);
  box-shadow: none;
}
.hud-icon-btn.is-on {
  color: var(--hud-amber);
  border-color: var(--hud-amber);
}
.hud-icon-btn[hidden] {
  display: none;
}

.hud-canvas {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow: auto;
  padding: 88px 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hud-canvas > * {
  width: 100%;
  max-width: 1200px;
}
body.is-panel .hud-canvas { padding-right: min(360px, 42vw); }

.hud-empty {
  margin: 2rem auto;
  max-width: 20rem;
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
}

.hud-panel {
  position: fixed;
  z-index: 28;
  top: 88px;
  right: 12px;
  bottom: 16px;
  width: min(320px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  background: var(--hud-glass);
  border: 1px solid var(--hud-line);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  color: var(--hud-ink);
  animation: hud-panel-in 140ms ease-out;
}
.hud-panel[hidden] { display: none; }
@keyframes hud-panel-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}
.hud-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(95, 255, 208, 0.18);
}
.hud-panel-head h2 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: "Share Tech Mono", ui-monospace, monospace;
  color: var(--hud-cyan);
}
.hud-panel-body {
  overflow: auto;
  padding: 0.75rem 0.85rem 100px;
}
.hud-module {
  border: 1px solid rgba(95, 255, 208, 0.16);
  background: rgba(6, 16, 14, 0.45);
  padding: 0.7rem 0.75rem 0.85rem;
  margin-bottom: 0.65rem;
}
.hud-module h3 {
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: "Share Tech Mono", ui-monospace, monospace;
  color: var(--hud-muted);
}
.hud-form .btn-primary { width: 100%; margin-top: 0.75rem; }

.muted { color: var(--muted); }
.inline-form { display: inline; }

.theme-switch {
  width: 44px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(95, 255, 208, 0.28);
  border-radius: 999px;
  background: rgba(8, 20, 18, 0.5);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--hud-cyan);
  transition: transform 0.15s ease;
}
html[data-theme="dark"] .theme-switch-thumb {
  transform: translateX(20px);
}
.theme-switch-fixed {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
}

.alert {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.alert-success { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.alert-error { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }

.card {
  background: var(--tile-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 0.55rem 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: transform 80ms ease, filter 80ms ease, box-shadow 80ms ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(2px) scale(0.98); }
.btn-primary {
  background: #146b44;
  border-color: #0f5334;
  color: #ffffff;
}
.btn-primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 12px rgba(20, 107, 68, 0.5);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-save {
  width: 100%;
  background: #146b44;
  border-color: #0f5334;
  color: #ffffff;
  font-size: 1.05rem;
  padding: 0.85rem 1.4rem;
  margin-top: 0.5rem;
}
.btn-save:hover { filter: brightness(1.12); box-shadow: 0 0 16px rgba(20, 107, 68, 0.5); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font: inherit; }
.link-btn:hover { text-decoration: underline; }

.input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}
.label { display: block; margin: 0.75rem 0 0.35rem; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; font-size: 1.35rem; letter-spacing: 0.08em; text-transform: uppercase; }
.page-head-actions { display: flex; gap: 0.5rem; align-items: center; }
.pick-account-form { margin-bottom: 0.5rem; }
.pick-account {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.pick-account:hover { border-color: var(--primary); background: var(--hover); }
.pick-account-name { font-weight: 700; font-size: 1rem; }
.colw-ctl { display: flex; align-items: center; width: 100%; }
.colw-ctl input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--hud-cyan);
  cursor: pointer;
}

.login-wrap { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.login-card { width: min(400px, 100%); }
.login-card h1 { margin: 0 0 1rem; font-size: 1.35rem; letter-spacing: 0.12em; text-transform: uppercase; }
.login-remember { display: flex; gap: 0.5rem; align-items: center; margin: 0.85rem 0 1rem; color: var(--muted); font-size: 0.9rem; }
.login-card .btn-primary { margin-top: 0.35rem; }
.login-extra { margin: 0.9rem 0 0; text-align: center; font-size: 0.9rem; }
.login-extra a { color: var(--link); text-decoration: none; }
.login-extra a:hover { text-decoration: underline; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tool-col, 180px)), 1fr));
  gap: 0.85rem;
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--tile-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: transform 90ms ease, border-color 90ms ease, box-shadow 90ms ease;
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(46, 230, 166, 0.22), var(--shadow);
  transform: translateY(-3px);
}
.tool-card:active { transform: translateY(1px) scale(0.99); }
.tool-card-grip {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: -4px 0 -4px -6px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: -2px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}
.tool-card-grip:active { cursor: grabbing; }
.tool-card.is-dragging {
  opacity: 0.5;
  pointer-events: none;
}
.tool-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1.35rem 1rem 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  text-align: center;
}
.tool-card-icon { font-size: 2.1rem; line-height: 1; }
.tool-card-name { display: block; }
.tool-card-link:hover {
  color: var(--text);
  text-decoration: none;
}
.tool-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 1rem 0.55rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.tools-edit .btn-primary { margin-bottom: 100px; }
.check { display: flex; gap: 0.5rem; align-items: center; margin: 1rem 0; color: var(--muted); }

.role-pick { display: grid; gap: 0.65rem; margin: 1rem 0; }
.role-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.role-card:hover { border-color: var(--primary); }
.role-card input[type="radio"] {
  appearance: none;
  width: 24px;
  height: 24px;
  flex: none;
  margin: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--input-bg);
  cursor: pointer;
  position: relative;
}
.role-card input[type="radio"]:checked {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 4px var(--input-bg);
}
.role-card:has(input[type="radio"]:checked) {
  border-color: var(--primary);
  background: var(--hover);
  box-shadow: 0 0 0 1px var(--primary);
}
.role-text { display: flex; flex-direction: column; gap: 0.15rem; }
.role-text strong { font-size: 1.1rem; color: var(--text); }
.role-text small { color: var(--muted); font-size: 0.82rem; }

.tool-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}
.tool-pick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 0.6rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  user-select: none;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.tool-pick-btn:hover { border-color: var(--primary); }
.tool-pick-btn input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  flex: none;
  margin: 0;
  border-radius: 5px;
  border: 2px solid var(--border);
  background: var(--input-bg);
  cursor: pointer;
}
.tool-pick-btn input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  background-size: 16px;
  background-position: center;
  background-repeat: no-repeat;
}
.tool-pick-btn:has(input[type="checkbox"]:checked) {
  border-color: var(--primary);
  background: var(--hover);
  color: var(--link);
}
.tool-pick-btn input[type="checkbox"]:disabled { opacity: 0.35; cursor: not-allowed; }
.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.users-account { margin-bottom: 1.25rem; }
.users-account-title { margin: 0 0 0.5rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.user-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  background: var(--tile-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.user-row a { font-weight: 700; color: var(--text); }
.pill {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}
.pill-ops { color: var(--link); border-color: var(--primary); background: var(--hover); }
.danger-card { margin-top: 1rem; }

.user-row-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.user-row-tools { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.3rem; font-size: 0.85rem; }
.tool-tags { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.tool-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--link);
  background: var(--hover);
  border: 1px solid var(--border);
}

.cfg-card { margin-bottom: 1rem; }
.cfg-card h2 {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.cfg-card .btn-primary { margin-top: 0.85rem; }
.cfg-pair {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cfg-pair--end { margin-bottom: 100px; }
.cfg-note { margin: 0 0 0.75rem; }
.cfg-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cfg-stack { display: grid; gap: 0.6rem; margin-top: 0.5rem; }
.cfg-stack .btn-primary { justify-self: start; margin-top: 0.15rem; }
.cfg-sub { margin: 1rem 0 0.5rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cfg-list { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.4rem; }
.cfg-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.cfg-list-label { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.cfg-list-label code {
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  background: var(--surface-2);
  color: var(--muted);
}
.cfg-list-label em { color: #e53e3e; font-style: normal; font-size: 0.8rem; }
.conn-list { display: grid; gap: 0.4rem; margin: 0; }
.conn-list .conn-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.8rem;
}
.conn-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
details.conn-item > summary.conn-head {
  position: relative;
  display: block;
  cursor: pointer;
  list-style: none;
  margin: -0.5rem -0.8rem 0;
  padding: 0.5rem 0.8rem;
  padding-right: 8.5rem;
  font-size: 0.92rem;
}
details.conn-item > summary.conn-head::-webkit-details-marker { display: none; }
details.conn-item > summary.conn-head::before {
  content: "\25B8";
  color: var(--muted);
  font-size: 0.7rem;
  margin-right: 0.4rem;
}
details.conn-item[open] > summary.conn-head { margin-bottom: 0; }
details.conn-item[open] > summary.conn-head::before { content: "\25BE"; }
details.conn-item > summary.conn-head .conn-state {
  position: absolute;
  top: 0.45rem;
  right: 0.7rem;
}
.conn-state {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.conn-state.is-on { color: #0a7a3d; background: #e3f5e9; }
details.conn-item[open] { padding-bottom: 0.8rem; }
.conn-item form { margin-top: 0.6rem; }
.conn-item :is(.cfg-actions, .cfg-stack) { margin-top: 0.6rem; }
.cfg-qr {
  display: block;
  width: 220px;
  height: 220px;
  margin: 0.4rem 0 0.7rem;
  padding: 0.5rem;
  background: #fff;
  border-radius: 10px;
}
.cfg-cmd {
  display: block;
  margin: 0.35rem 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.78rem;
  line-height: 1.4;
  word-break: break-all;
  user-select: all;
}
.claude-usage {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.9rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
}
.claude-usage strong { color: var(--text); }
.claude-usage-sep { opacity: 0.5; }
.claude-usage-icon { font-size: 1rem; }
.dash-foot {
  margin: 1.25rem 0 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}
.dash-foot-ia {
  color: var(--text);
  font-size: 0.85rem;
}
.dash-foot-ia strong { color: var(--text); }
.hud-hint {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.hud-tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.hud-tool-chip { margin: 0; }
.hud-tool-chip .btn { white-space: nowrap; }
.cfg-2col {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
}
.cfg-2col > div { flex: 1; }
.cfg-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  padding-bottom: 0.4rem;
  white-space: nowrap;
}
.bg-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.65rem;
}
.bg-swatch { display: grid; gap: 0.35rem; margin: 0; cursor: pointer; }
.bg-swatch input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bg-swatch-preview {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background-color: #c8d5cb;
}
.bg-swatch-preview--tile {
  background-repeat: repeat;
  background-position: 0 0;
}
.bg-swatch-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.bg-swatch-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}
.bg-swatch.is-selected .bg-swatch-preview,
.bg-swatch:has(input:checked) .bg-swatch-preview {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.bg-swatch.is-selected .bg-swatch-label,
.bg-swatch:has(input:checked) .bg-swatch-label {
  color: var(--text);
}
@media (min-width: 720px) {
  .cfg-pair { grid-template-columns: 1fr 1fr; }
  .cfg-pair--end { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 720px) {
  .hud-stat { min-width: 0; padding: 0.4rem 0.65rem; }
  .hud-stat-value { font-size: 1.35rem; }
  .hud-hide-sm { display: none; }
  .hud-canvas { padding: 118px 10px 24px; }
  body.is-panel .hud-canvas { padding-right: 10px; }
  .hud-panel {
    top: 118px;
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 16px;
  }
  .hud-sec {
    flex: 1 1 100%;
    order: 10;
    justify-content: flex-start;
    padding: 0.25rem 0.5rem 0.4rem;
  }
}

/* Timer en cabecera */
.hud-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-left: 1px solid rgba(95, 255, 208, 0.18);
  font-family: "Share Tech Mono", ui-monospace, monospace;
}
.hud-timer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: hud-timer-pulse 1.4s ease-in-out infinite;
}
@keyframes hud-timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.hud-timer-proj {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hud-muted);
}
.hud-timer-clock {
  font-size: 1rem;
  font-weight: 700;
  color: #e53e3e;
  text-shadow: 0 0 8px rgba(229, 62, 62, 0.4);
}

/* Status bar en portada - modo videojuego */
.dash-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.dash-status-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem 0.55rem 1.05rem;
  border-radius: 6px;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1px solid var(--hud-cyan);
  color: var(--dash-info-text);
  text-shadow: var(--dash-text-glow);
  background:
    linear-gradient(180deg, rgba(95, 255, 208, 0.18), rgba(95, 255, 208, 0.05)),
    var(--tile-bg);
  box-shadow:
    0 0 0 1px rgba(95, 255, 208, 0.1),
    0 0 16px rgba(95, 255, 208, 0.14),
    inset 0 0 12px rgba(95, 255, 208, 0.06),
    0 2px 0 rgba(0, 0, 0, 0.3);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.dash-status-item::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: dash-pulse 1.4s steps(2, start) infinite;
}
.dash-status-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.12) 38%, transparent 56%);
  transform: translateX(-130%);
  animation: dash-sheen 4.5s linear infinite;
}
.dash-status-item:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(95, 255, 208, 0.25),
    0 0 22px rgba(95, 255, 208, 0.28),
    inset 0 0 14px rgba(95, 255, 208, 0.1),
    0 3px 0 rgba(0, 0, 0, 0.3);
}
.dash-status-item--warn {
  border-color: var(--hud-amber);
  color: var(--dash-warn-text);
  text-shadow: var(--dash-text-glow);
  background:
    linear-gradient(180deg, rgba(255, 211, 106, 0.2), rgba(255, 211, 106, 0.05)),
    var(--tile-bg);
  box-shadow:
    0 0 0 1px rgba(255, 211, 106, 0.12),
    0 0 18px rgba(255, 211, 106, 0.2),
    inset 0 0 14px rgba(255, 211, 106, 0.08),
    0 2px 0 rgba(0, 0, 0, 0.3);
  animation: dash-warn-glow 1.6s ease-in-out infinite;
}
.dash-status-item--warn::before { animation: dash-pulse 0.9s steps(2, start) infinite; }
.dash-status-item--warn::after { animation-duration: 2.8s; }
.dash-status-item--warn:hover {
  box-shadow:
    0 0 0 1px rgba(255, 211, 106, 0.3),
    0 0 26px rgba(255, 211, 106, 0.34),
    inset 0 0 16px rgba(255, 211, 106, 0.12),
    0 3px 0 rgba(0, 0, 0, 0.3);
}
.dash-status-item--info { animation: dash-info-breathe 2.8s ease-in-out infinite; }
.dash-status-icon {
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px currentColor);
}
@keyframes dash-pulse { 50% { opacity: 0.25; } }
@keyframes dash-sheen {
  0% { transform: translateX(-130%); }
  55%, 100% { transform: translateX(130%); }
}
@keyframes dash-warn-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}
@keyframes dash-info-breathe {
  0%, 100% {
    box-shadow:
      0 0 10px rgba(95, 255, 208, 0.1),
      inset 0 0 10px rgba(95, 255, 208, 0.04),
      0 2px 0 rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow:
      0 0 20px rgba(95, 255, 208, 0.28),
      inset 0 0 14px rgba(95, 255, 208, 0.08),
      0 2px 0 rgba(0, 0, 0, 0.3);
  }
}
@media (max-width: 720px) {
  .hud-timer { display: none; }
}

.mcp-endpoint,
.mcp-token {
  display: block;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.9rem;
  word-break: break-all;
}
.mcp-token { margin-top: 0.5rem; font-weight: 600; }

.sug-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(20, 107, 68, 0.35);
  background: rgba(20, 107, 68, 0.1);
  color: inherit;
  text-decoration: none;
}
.sug-banner:hover { filter: brightness(1.03); }
.sug-banner-dot {
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  background: #146b44;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
