/* Hailport on top of Tabler (static/tabler/, MIT). Colours: brand/README.md (#002691 → #007EE5). */
:root, [data-bs-theme=light] {
  --tblr-primary: #0063c4;
  --tblr-primary-rgb: 0, 99, 196;
  --tblr-primary-text: #0063c4;
  --tblr-link-color: #0063c4;
  --tblr-link-color-rgb: 0, 99, 196;
}
[data-bs-theme=dark] {
  --tblr-primary: #3b8fe8;
  --tblr-primary-rgb: 59, 143, 232;
  --tblr-primary-text: #64a8f0;
  --tblr-link-color: #64a8f0;
  --tblr-link-color-rgb: 100, 168, 240;
}

/* Brand in the sidebar and above sign-in cards. */
.hp-brand-image { width: 32px; height: 32px; background: #fff; border-radius: 8px; padding: 3px; margin-right: 8px; vertical-align: middle; }
.hp-brand-name { font-weight: 700; font-size: 1.1rem; vertical-align: middle; }
.navbar-vertical .navbar-brand a { color: inherit; text-decoration: none; }
/* The console's sidebar in Hailport's dark blue; the admin app's in near-black with an amber edge. */
body.hp-console .navbar-vertical { background: linear-gradient(180deg, #0a2a63 0%, #002691 100%); }
body.hp-admin .navbar-vertical { background: #111827; border-right: 3px solid #f59f00; }
body.hp-admin .page-pretitle { color: #f59f00; }

/* "Skip to content": hidden until focused with the keyboard, then on top at the left. */
.hp-skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 2000; padding: 8px 14px; border-radius: 6px;
  background: var(--tblr-bg-surface); color: var(--tblr-body-color); box-shadow: 0 0 0 3px var(--tblr-primary); }
#main-content:focus { outline: none; }

/* Small helpers not in Tabler. */
.mono { font-family: var(--tblr-font-monospace); font-size: 12px; }
.qr { width: 220px; max-width: 100%; }
.qr svg { width: 100%; height: auto; display: block; border-radius: 6px; }
dl.info { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 13px; }
dl.info dt { color: var(--tblr-secondary); font-weight: 400; }
dl.info dd { margin: 0; overflow-wrap: anywhere; }
tr.hp-details > td { background: var(--tblr-bg-surface-secondary); }
table.records input, table.records select { min-width: 70px; }
.hp-narrow { max-width: 220px; }
.hp-code-input { max-width: 320px; }
.hp-code-input input { font-family: var(--tblr-font-monospace); letter-spacing: .15em; }
.hp-save-bar { position: sticky; bottom: 12px; z-index: 5; }
.hp-org-switch { text-align: left; }
/* Forms with a single button sit in button rows like the buttons around them. */
.btn-list > form { display: inline-flex; margin: 0; }

/* Console messages: thread bottom-up (newest in view), bubbles in and out. */
.hp-thread { display: flex; flex-direction: column-reverse; gap: 8px; max-height: 60vh; overflow-y: auto; }
.hp-message { max-width: 80%; padding: 6px 10px; border-radius: 10px; background: var(--tblr-bg-surface-secondary); }
.hp-message-out { align-self: flex-end; background: rgba(var(--tblr-primary-rgb), .12); }
.hp-message-meta { font-size: 11px; color: var(--tblr-secondary); }
.hp-message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.hp-conversations { max-height: 70vh; overflow-y: auto; }

/* Console map: fills most of the view; device markers (faded when the position is older than 15 min). */
.hp-map { height: 60vh; min-height: 320px; border-radius: var(--tblr-card-border-radius); }
.hp-map-pin { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.hp-map-marker { width: 16px; height: 16px; flex: none; border-radius: 50%; background: #0063c4; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.hp-map-name { font-size: 12px; font-weight: 600; color: #1d273b; background: rgba(255,255,255,.85); padding: 0 4px; border-radius: 4px; white-space: nowrap; }
/* Network map (docs/network-map.md): IP location (hollow), no licence, no channel, talking, hearing, selected, dimmed. */
.hp-map-ip .hp-map-marker { background: #fff; border-color: #0063c4; box-shadow: 0 0 0 4px rgba(0, 99, 196, .2); }
.hp-map-offline .hp-map-marker { background: #adb5bd; }
.hp-map-offline.hp-map-ip .hp-map-marker { background: #fff; border-color: #adb5bd; box-shadow: 0 0 0 4px rgba(134, 142, 150, .2); }
.hp-map-offline .hp-map-name { color: #667382; font-weight: 500; }
.hp-map-old .hp-map-marker { opacity: .5; }
.hp-map-off .hp-map-marker { background: #adb5bd; }
.hp-map-off .hp-map-name { color: #667382; text-decoration: line-through; }
.hp-map-alone .hp-map-marker { box-shadow: 0 0 0 3px #d63939; }
.hp-map-hearing .hp-map-marker { box-shadow: 0 0 0 4px #2fb344; }
.hp-map-talking .hp-map-marker { box-shadow: 0 0 0 4px #d63939; animation: hp-map-pulse 1s ease-in-out infinite alternate; }
@keyframes hp-map-pulse { to { box-shadow: 0 0 0 9px rgba(214, 57, 57, .25); } }
@media (prefers-reduced-motion: reduce) { .hp-map-talking .hp-map-marker { animation: none; } }
.hp-map-selected .hp-map-name { outline: 2px solid #1d273b; }
.hp-map-dim { opacity: .3; }
.hp-map-hub { font-size: 11px; font-weight: 600; line-height: 1; color: #1d273b; background: #fff; border: 3px solid #0063c4; border-radius: 999px;
  padding: 3px 7px; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.hp-map-legend { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; max-width: 100%; }
.hp-map-chip { gap: 6px; white-space: normal; text-align: left; }
.hp-map-key { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.hp-map-key > span { display: inline-flex; align-items: center; gap: 6px; }
.hp-map-key .hp-map-marker { width: 14px; height: 14px; }
.hp-map-chip-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Widths in 5 % steps (progress bars; no inline styles under the CSP). */
.hp-w-0 { width: 0%; }
.hp-w-5 { width: 5%; }
.hp-w-10 { width: 10%; }
.hp-w-15 { width: 15%; }
.hp-w-20 { width: 20%; }
.hp-w-25 { width: 25%; }
.hp-w-30 { width: 30%; }
.hp-w-35 { width: 35%; }
.hp-w-40 { width: 40%; }
.hp-w-45 { width: 45%; }
.hp-w-50 { width: 50%; }
.hp-w-55 { width: 55%; }
.hp-w-60 { width: 60%; }
.hp-w-65 { width: 65%; }
.hp-w-70 { width: 70%; }
.hp-w-75 { width: 75%; }
.hp-w-80 { width: 80%; }
.hp-w-85 { width: 85%; }
.hp-w-90 { width: 90%; }
.hp-w-95 { width: 95%; }
.hp-w-100 { width: 100%; }
/* Settings lists: the drag grip only with records.js; the row being dragged. */
.hp-grip { display: none; cursor: grab; color: var(--tblr-secondary); vertical-align: middle; }
.hp-js .hp-grip { display: inline-flex; }
tr.hp-dragging { opacity: .5; }
/* The form's first submit button, for Enter in a field: Save, not a row's ↑. */
.hp-default-submit { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
