:root {
  --bg: #0b1017;
  --panel: #151d2b;
  --panel-2: #1c2738;
  --text: #eef3fb;
  --muted: #93a4bc;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --border: #2a3648;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 500px at 10% -10%, #1a2740 0%, var(--bg) 45%);
  color: var(--text);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.app-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
.site-credits {
  flex-shrink: 0;
  margin-top: auto;
  padding: 1.25rem 1.25rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: rgba(11, 16, 23, 0.6);
}
.site-credits-heading {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-credits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}
.site-credits-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 36rem;
}
.site-credits-name {
  color: var(--text);
  font-weight: 500;
}
.site-credits-matric {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.site-credits-matric::before {
  content: "·";
  margin-right: 0.65rem;
  color: var(--border);
}
@media (min-width: 640px) {
  .site-credits-list li {
    flex-wrap: nowrap;
  }
}

.icon {
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: -0.2rem;
  margin-right: 0.35rem;
}

.topbar {
  padding: 0.85rem 1.25rem;
  background: rgba(21, 29, 43, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  width: 100%;
  max-width: 1240px;
  min-width: 0;
  margin: 0 auto;
}
.topbar-head {
  display: contents;
}
.nav-toggle { display: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: #93c5fd; font-weight: 600; }
.brand-logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.login-brand .brand-logo {
  width: 2.5rem;
  height: 2.5rem;
}
.nav-main { display: flex; flex-wrap: wrap; gap: 0.35rem; flex: 1; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.92rem;
}
.nav-link:hover { color: var(--text); background: var(--panel-2); }
.nav-link.active { color: #dbeafe; background: var(--accent-soft); }

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}
.user-email {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container {
  padding: 1.25rem;
  max-width: 1240px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }

.page-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.page-toolbar > div:first-child {
  min-width: 0;
  flex: 1 1 12rem;
}
.page-title {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.page-subtitle {
  margin: 0.35rem 0 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.last-updated { font-size: 0.82rem; white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-sm { padding: 0.4rem 0.65rem; font-size: 0.85rem; }
.btn-primary { background: var(--accent); border-color: #2563eb; font-weight: 600; }
.login-card .btn-primary,
.stack-form > .btn-primary,
.stack > .btn-primary { width: 100%; }
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: #b91c1c;
  color: #fecaca;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.28); }
.btn-secondary:hover { border-color: #64748b; background: #243044; }
.btn-ghost { background: transparent; border-color: transparent; color: #93c5fd; }
.btn-ghost:hover { background: var(--panel-2); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.spinning .icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #101722;
  color: var(--text);
}
.password-input-wrap {
  position: relative;
  width: 100%;
}
.password-input-wrap .input {
  padding-right: 2.85rem;
}
.password-toggle {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-toggle:hover {
  color: var(--text);
  background: var(--panel-2);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.password-toggle-icon {
  width: 1.15rem;
  height: 1.15rem;
}
.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.55rem;
  line-height: 1.35;
}
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
.form-panel {
  max-width: min(720px, 100%);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.stack-form .field { display: flex; flex-direction: column; gap: 0; }
.stack-form .input,
.stack-form select.input { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.field-error { font-size: 0.82rem; color: #fca5a5; }
.panel-narrow { max-width: 520px; margin-bottom: 1.25rem; }
.admin-actions-panel { border-color: #7f1d1d; }
.admin-actions-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }
.admin-danger-details summary { cursor: pointer; list-style: none; }
.admin-danger-details summary::-webkit-details-marker { display: none; }
.admin-delete-form { margin-top: 0.75rem; max-width: 420px; }
.admin-delete-form .btn-danger { width: auto; }
.inline-form { display: inline; }
.small { font-size: 0.85rem; }
.stack { display: grid; gap: 0.75rem; }

.login-layout {
  min-height: calc(100vh - 2rem);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-layout--standalone {
  flex: 1;
  min-height: 0;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    1rem max(1rem, env(safe-area-inset-left));
}
.login-card {
  width: min(480px, 100%);
  padding: 1.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.login-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}
.login-brand h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; }
.login-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 28rem;
}
.login-foot {
  margin: 1.15rem 0 0;
  line-height: 1.5;
  text-align: center;
}
.login-form { gap: 0.85rem; }
.login-form .field-label { margin-bottom: 0.3rem; }

.info-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.info-box h2 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.info-box ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.info-box li { margin: 0.35rem 0; }
.info-box a { color: #93c5fd; }
.demo-hint { margin-top: 1rem; line-height: 1.5; }
.demo-hint code { word-break: break-word; }

.info-banner {
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  min-width: 0;
}
.card.accent { border-color: rgba(59, 130, 246, 0.45); }
.card.warn { border-color: rgba(245, 158, 11, 0.45); }
.card-label { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.metric {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0.35rem 0 0;
  line-height: 1;
  overflow-wrap: anywhere;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  max-width: 100%;
  min-width: 0;
}
.panel h2 { margin: 0 0 0.85rem; font-size: 1.05rem; }
.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.panel-header .muted {
  overflow-wrap: anywhere;
}
.panel-header h2 { margin: 0; }

.source-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.source-chip {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}
.source-chip span { color: var(--muted); }

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 10px;
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 36rem; }
td.mono {
  max-width: 11rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.8rem;
}
th, td { padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
td.cell-wrap {
  max-width: 14rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
th { background: var(--panel-2); color: #cbd5e1; font-weight: 600; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.empty-cell { text-align: center; color: var(--muted); padding: 1.5rem !important; }

.pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #243044;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill-active { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.pill-stopped { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.pill-not_tracking { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.pill-expired { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

#map.trail-map {
  width: 100%;
  max-width: 100%;
  height: 68vh;
  min-height: 360px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #e8e8e8;
}
.google-map-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 68vh;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #e8e8e8;
}
.map-actions {
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.trail-map-heading { margin: 1.25rem 0 0.5rem; font-size: 1rem; font-weight: 600; }
.map-foot {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.track-back {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.track-back a { color: var(--accent); text-decoration: none; }
.track-back a:hover { text-decoration: underline; }
.track-meta { margin-bottom: 1rem; }
.track-meta .card {
  min-width: 0;
}
.track-meta .metric-sm {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.track-meta .card:last-child .metric-sm {
  font-size: 0.92rem !important;
}
.metric-sm { font-size: 1.05rem !important; line-height: 1.35; }
.track-map-panel { margin-bottom: 1.25rem; }
.track-map-panel .map-lazy,
.track-map-panel .map-skeleton {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.panel-header-meta {
  flex: 1 1 100%;
  line-height: 1.45;
}
table.table-fleet { min-width: 36rem; }
table.table-locations { min-width: 28rem; }
table.table-sessions-narrow,
table.table-sessions-fleet { min-width: 18rem; }
table.table-team { min-width: 34rem; }
.cell-time {
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 11rem;
}
.cell-device-name {
  max-width: 11rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cell-actions {
  white-space: normal;
  vertical-align: middle;
}
.cell-actions .btn {
  white-space: nowrap;
}
.login-layout {
  width: 100%;
  max-width: 100%;
}
.device-chip {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.modal-wide {
  max-width: min(520px, calc(100vw - 2rem));
}
.empty-cell code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.pagination-status { font-size: 0.88rem; }
.btn-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 10, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none !important; }
body.modal-open { overflow: hidden; }
.modal {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
.modal-title { margin: 0 0 0.5rem; font-size: 1.1rem; }
.modal-body { margin: 0 0 1rem; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}
.modal-actions .btn-primary,
.modal-actions .btn-danger { width: auto; }
#confirm-modal-fields .field { margin-top: 0.75rem; }

.map-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  height: 52vh;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  font-size: 0.92rem;
}
.map-lazy .google-map-frame { margin: 0; }

.messages {
  max-width: 1240px;
  width: 100%;
  margin: 0.75rem auto 0;
  padding: 0 1.25rem;
  box-sizing: border-box;
}
.message { padding: 0.6rem 0.8rem; border-radius: 8px; margin-bottom: 0.5rem; }
.message.error { background: #3f1d1d; color: #fecaca; }
.message.info { background: #1e293b; color: #cbd5e1; }

@media (max-width: 900px) {
  .page-title { font-size: 1.35rem; }
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .panel-header .muted { font-size: 0.85rem; line-height: 1.4; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { font-size: 1.5rem; }
  .google-map-frame,
  #map.trail-map {
    height: 52vh;
    min-height: 260px;
  }
}

@media (max-width: 960px) {
  .container { padding: 0.85rem; }
  .messages { padding: 0 0.85rem; }

  .topbar { padding: 0.65rem 0.85rem; }
  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .topbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
    margin-bottom: 0;
  }
  .brand { font-size: 0.95rem; }
  .brand span { display: none; }
  .nav-toggle { display: inline-flex; flex-shrink: 0; }

  .nav-main {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0.2rem;
    padding: 0.65rem 0 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.65rem;
  }
  .topbar.is-nav-open .nav-main { display: flex; }
  .nav-link {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
  }

  .user-menu {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.65rem;
    margin-top: 0.65rem;
    border-top: 1px solid var(--border);
  }
  .user-email {
    display: inline-flex;
    min-width: 0;
    flex: 1 1 auto;
    max-width: min(240px, 62vw);
    font-size: 0.82rem;
  }
  .user-menu form {
    flex-shrink: 0;
  }

  .page-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  .toolbar-actions .btn { flex: 1; max-width: 10rem; }
  .last-updated { display: none; }

  .info-banner { font-size: 0.88rem; padding: 0.65rem 0.85rem; }

  .login-card { padding: 1.25rem; border-radius: 12px; }
  .login-brand h1 { font-size: 1.15rem; }
  .info-box { font-size: 0.85rem; padding: 0.75rem 0.85rem; }

  .field-row { grid-template-columns: 1fr; }
  .form-panel { max-width: none; }
  .admin-delete-form { max-width: none; }
  .admin-actions-grid { flex-direction: column; align-items: stretch; }
  .admin-actions-grid .btn { width: 100%; justify-content: center; }

  .cards { grid-template-columns: 1fr; gap: 0.65rem; }
  .card { padding: 0.85rem; }
  .track-meta.cards { grid-template-columns: 1fr 1fr; }

  table { font-size: 0.84rem; }
  table.table-fleet { min-width: 30rem; }
  table.table-locations { min-width: 24rem; }
  table.table-team { min-width: 28rem; }
  th, td { padding: 0.55rem 0.6rem; }

  .cell-time,
  .cell-device-name,
  td.cell-wrap,
  td.mono {
    max-width: 9rem;
  }

  .cell-actions .btn {
    display: inline-flex;
    padding: 0.45rem 0.55rem;
    font-size: 0.82rem;
  }

  .map-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .map-actions .btn {
    width: 100%;
    max-width: none;
  }

  .track-meta.cards {
    grid-template-columns: 1fr;
  }

  .team-actions-cell {
    white-space: normal;
    min-width: 8.5rem;
  }
  .team-actions-cell .btn {
    margin: 0.2rem 0.25rem 0.2rem 0;
  }

  .table-pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .table-pagination .btn { width: 100%; justify-content: center; }
  .pagination-status { order: -1; margin-bottom: 0.25rem; }

  .map-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 380px) {
  .track-meta.cards { grid-template-columns: 1fr; }
}

@media (min-width: 961px) {
  .nav-toggle { display: none !important; }
  .topbar-head { display: contents; }
  .nav-main {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }
  .user-menu {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
    width: auto;
    flex-shrink: 0;
  }
}

.supervisor-scope-block {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}
.device-access-fieldset {
  border: none;
  margin: 0;
  padding: 0;
}
.device-access-fieldset legend {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  padding: 0;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  margin: 0 0 0.5rem;
}
.checkbox-row input { margin-top: 0.25rem; flex-shrink: 0; }
.checkbox-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.4;
}
.checkbox-row-text .muted { font-size: 0.85rem; }
.device-access-hint { margin: 0 0 0.75rem; line-height: 1.45; }
.device-scope-panel { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.device-search-results { margin: 0.5rem 0; max-height: 220px; overflow-y: auto; }
.device-search-list { list-style: none; margin: 0; padding: 0; }
.device-search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 0.88rem;
}
.device-search-item:hover { background: #243044; }
.device-selected-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.device-chip-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.15rem;
}
.form-panel .btn-primary { width: auto; align-self: flex-start; }
.team-actions-cell { white-space: nowrap; }
.team-actions-cell .btn { margin: 0.15rem 0.1rem 0.15rem 0; }
.modal-wide { width: min(520px, 100%); }
