/* ==========================================================
   Web Dispatch page (html/web/index.html). The console itself uses the
   in-game CAD stylesheets (cad-theme.css etc.); this file only fits the
   CAD window to the browser and styles the sign-on box and lookups.
   ========================================================== */
html, body.web { overflow: hidden; height: 100%; }
body.web { background: var(--bg-0); margin: 0; }
body.web .hidden { display: none !important; }

/* the CAD window fills the browser */
body.web #app { position: fixed; inset: 0; top: 0; left: 0; width: 100vw; height: 100vh; transform: none; display: flex; }
body.web #app.hidden { display: none !important; }
body.web #tablet-screen { flex: 1; border: none; border-radius: 0; box-shadow: none; }
html.cad-max { --mdt-w: 100vw; --mdt-h: 100vh; }
body.web.wd-hint { --cad-header-h: 150px; }

/* connection light in the title bar */
.wd-conn { margin-left: auto; margin-right: 8px; display: inline-flex; align-items: center; gap: 6px; height: 18px; padding: 0 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .6px; color: #d9f7e1; background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .18); }
.wd-conn .status-dot { width: 8px; height: 8px; }
.wd-conn.down { color: #ffd9d6; background: rgba(160, 20, 20, .45); }

/* toolbar right side */
#topbar .tb-right .btn.sm { height: 28px; }
#topbar .tb-user { cursor: default; }
#topbar #gsearch { display: block; }

.wd-sound-hint { flex: none; text-align: center; font-size: 11.5px; padding: 3px 6px; background: var(--warn-soft); color: var(--warn-strong); border-bottom: 1px solid var(--border); }
.wd-session { padding: 4px 8px 6px; font-size: 11px; color: var(--text-2); border-top: 1px solid var(--border-soft); }

/* field-unit controls that don't apply to a dispatcher at a desk */
body.web #cq-attach, body.web #cq-detach, body.web #cq-way,
body.web #dsp-weblogin-btn, body.web #dsp-logoff-btn, body.web #dsp-dispatcher-btn,
body.web #cad-max-btn, body.web #cad-min-btn,
body.web [data-act="waypoint"], body.web [data-act="respond"],
body.web .dsp-call-loc em, body.web .dsp-d-loc em,
body.web .fs-me, body.web .fs-seat-pick, body.web [data-signon],
body.web [data-notify], body.web [data-act="notify"], body.web [data-arr], body.web [data-fi="notify"] { display: none !important; }

/* views fill the space under the queue */
body.web #view-root { flex: 1; min-height: 0; overflow: auto; }

/* ---------------------------------------------------------------- sign on */
#wd-login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: #1d4f91; }
html.mdt-night #wd-login { background: #0d1622; }
.wd-login-card { width: 100%; max-width: 440px; background: var(--bg-1); border: 1px solid #0b1a33; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.wd-login-title { height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 8px; color: var(--cad-title-text, #fff);
  background: linear-gradient(180deg, var(--cad-title-1, #2a64b4), var(--cad-title-2, #1d4f91)); font-size: 12px; font-weight: 600; user-select: none; }
.wd-logo { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; background: #ffd36b; color: #10203a; font-size: 9px; font-weight: 900; }
.wd-login-body { padding: 18px 20px 16px; }
.wd-brand-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: .3px; color: var(--text-0); }
.wd-brand-title span { color: var(--accent); }
.wd-brand-sub { font-size: 11.5px; color: var(--text-2); }
.wd-help { font-size: 12px; color: var(--text-1); line-height: 1.5; margin: 14px 0 12px; }
.wd-label { display: block; margin: 0 0 4px; font-size: 11px; font-weight: 700; color: var(--text-1); }
.wd-opt { margin-left: 4px; font-weight: 400; color: var(--text-3); }
.wd-input, .wd-code-input { width: 100%; height: 30px; margin-bottom: 10px; padding: 0 8px; box-sizing: border-box;
  background: var(--cad-field, var(--bg-0)); color: var(--text-0); border: 1px solid var(--border-strong); border-radius: 0; font: inherit; font-size: 13px; }
.wd-code-input { height: 36px; font-family: var(--font-mono); font-size: 18px; letter-spacing: 4px; }
.wd-code-input::placeholder { letter-spacing: 0; font-family: var(--font-ui); font-size: 13px; }
.wd-input:focus, .wd-code-input:focus { outline: none; border-color: var(--accent); }
#wd-login .btn.block { width: 100%; height: 32px; justify-content: center; margin-top: 4px; }
.wd-error { min-height: 18px; margin-top: 8px; font-size: 12px; color: var(--danger); text-align: center; }
.wd-foot { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border-soft); font-size: 11px; color: var(--text-2); line-height: 1.5; }

/* narrow screens: drop the navigator, let things stack */
@media (max-width: 1100px) {
  body.web #sidebar { display: none; }
  body.web .cad-query-label, body.web .tb-user-text { display: none; }
}
@media (max-width: 760px) {
  body.web #cad-menubar .cad-menubar-right, body.web #cad-tools .cad-tool-label { display: none; }
  body.web .dsp-grid { grid-template-columns: 1fr !important; height: auto !important; }
}

/* ---------------------------------------------------------------- Dispatch Console (from desktop.css, same as the in-game app) */
.dsp-grid.console {
  grid-template-rows: minmax(0, 1fr) minmax(200px, 34%);
  height: calc(100vh - var(--cad-header-h) - var(--statusbar-h) - 160px);
  min-height: 520px;
}
.dsp-grid.console > .dsp-uboard { grid-column: 1 / -1; }
.dsp-uboard .panel-header { flex: none; }
.dsp-uboard-hint { font-size: 11px; font-weight: 400; color: var(--text-2); }
.dsp-uboard-body {
  flex: 1; min-height: 0; overflow: auto; padding: 4px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); align-content: start; gap: 4px;
}
.dsp-uboard-body > .dsp-disp-hint, .dsp-uboard-body > .dsp-disp-empty { grid-column: 1 / -1; }
.dsp-uboard-body .dsp-unit-group { border: 1px solid var(--border-soft); background: var(--bg-2); }
html[data-app="console"] .dsp-console-head { background: linear-gradient(180deg, #fff6f2, #f2e2da); }
html.mdt-night[data-app="console"] .dsp-console-head { background: linear-gradient(180deg, #3a2a24, #2b211d); }
@media (max-width: 1320px) { .dsp-grid.console { grid-template-rows: none; height: auto; } }
/* lookup drawer */
#wd-lookup { position: fixed; inset: 0; z-index: 900; }
#wd-lookup .lk-backdrop { position: absolute; inset: 0; background: rgba(5, 7, 12, .55); }
#wd-lookup .lk-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); display: flex; flex-direction: column;
  background: var(--bg-1); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: lk-in .18s var(--ease, ease-out); }
@keyframes lk-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.lk-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.lk-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text-2); }
.lk-search:focus-within { border-color: var(--accent-border); }
.lk-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-0); font: inherit; font-size: 14px; height: 100%; }
.lk-back.hidden { display: none; }
.lk-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; }
.lk-loading, .lk-empty { padding: 60px 20px; text-align: center; color: var(--text-2); font-size: 13px; }
.lk-empty .btn-ico svg { width: 28px; height: 28px; opacity: .5; }
.lk-empty .es-title { margin-top: 10px; color: var(--text-0); font-weight: 700; font-size: 15px; }
.lk-empty .es-sub { margin-top: 4px; max-width: 380px; margin-inline: auto; line-height: 1.5; }
.lk-spin { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: lk-spin .7s linear infinite; }
@keyframes lk-spin { to { transform: rotate(360deg); } }
.lk-sec, .lk-sub { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-2); }
.lk-sec:first-child { margin-top: 0; }
.lk-sec .count, .lk-sub .count { color: var(--text-3); }
.lk-sec::after, .lk-sub::after { content: ''; flex: 1; height: 1px; background: var(--border-soft); }
.lk-list, .lk-items { display: flex; flex-direction: column; gap: 6px; }
.lk-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; text-align: left; font: inherit; color: var(--text-1); cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.lk-row:hover { border-color: var(--border-strong); background: var(--bg-4); }
.lk-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lk-row-title { font-weight: 700; color: var(--text-0); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-row-sub { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-row-flags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 45%; }
.lk-row-flags.left { justify-content: flex-start; max-width: none; margin-top: 8px; }
.lk-flag { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 3px; font-size: 9.5px; font-weight: 800; letter-spacing: .5px; background: var(--neutral-soft); color: var(--text-1); }
.lk-flag.danger { background: var(--danger-soft); color: var(--danger-strong); }
.lk-flag.warn { background: var(--warn-soft); color: var(--warn-strong); }
.lk-flag.good { background: var(--good-soft); color: var(--good-strong); }
.lk-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-1); border: 1px solid var(--border-strong); font-size: 12px; font-weight: 800; color: var(--text-1); }
.lk-avatar.big { width: 76px; height: 76px; border-radius: 10px; font-size: 22px; }
.lk-plate { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 86px; height: 30px; padding: 0 8px; border-radius: 4px;
  font-family: var(--font-mono); font-weight: 800; font-size: 13px; letter-spacing: 1.5px; color: #10131c; background: #e9edf5; border: 2px solid #8d97ab; }
.lk-plate.big { min-width: 130px; height: 48px; font-size: 20px; letter-spacing: 3px; }
.lk-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.lk-card-top { display: flex; gap: 14px; align-items: flex-start; }
.lk-card-id { flex: 1; min-width: 0; }
.lk-card-name { font-family: var(--font-display); font-size: 21px; font-weight: 800; color: var(--text-0); }
.lk-card-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.lk-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.lk-fact .l { font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--text-2); }
.lk-fact .v { font-size: 13px; color: var(--text-0); margin-top: 2px; overflow-wrap: anywhere; }
.lk-owner { margin-top: 14px; }
.lk-alert { display: flex; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); font-size: 12.5px; line-height: 1.5; }
.lk-alert b { display: block; }
.lk-alert .btn-ico svg { width: 16px; height: 16px; margin-top: 1px; }
.lk-alert.danger { background: var(--danger-soft); color: var(--danger-strong); border: 1px solid rgba(224,70,75,.35); }
.lk-alert.warn { background: var(--warn-soft); color: var(--warn-strong); border: 1px solid rgba(232,163,23,.35); }
.lk-alert div div { color: var(--text-1); }
.lk-tabs { display: flex; gap: 4px; margin: 14px 0 4px; border-bottom: 1px solid var(--border-soft); }
.lk-tabs button { padding: 9px 12px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lk-tabs button.active { color: var(--text-0); border-bottom-color: var(--accent); }
.lk-tabs .count { font-size: 10.5px; color: var(--text-3); margin-left: 2px; }
.lk-tabbody { padding-top: 4px; }
.lk-item { padding: 9px 12px; background: var(--bg-3); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.lk-item.important { border-left: 3px solid var(--danger); }
.lk-item-main { font-size: 13px; color: var(--text-1); }
.lk-item-main b { color: var(--text-0); }
.lk-item-sub { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.lk-item-text { font-size: 12.5px; color: var(--text-1); margin-top: 4px; line-height: 1.5; white-space: pre-wrap; }
.lk-none { font-size: 12px; color: var(--text-3); padding: 4px 2px; }
.lk-tag { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; border-radius: 3px; font-size: 9.5px; font-weight: 800; letter-spacing: .4px; background: var(--neutral-soft); color: var(--text-1); vertical-align: 1px; }
.lk-tag.good { background: var(--good-soft); color: var(--good-strong); }
.lk-tag.warn { background: var(--warn-soft); color: var(--warn-strong); }
.lk-tag.danger { background: var(--danger-soft); color: var(--danger-strong); }
.lk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
@media (max-width: 560px) { .lk-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lk-row-flags { display: none; } }

/* ---------- Radio dock (RSRP_Radio console beside the CAD) ---------- */
#wd-radio { position: relative; flex: 0 0 auto; width: 520px; min-width: 360px; display: flex; flex-direction: column; border-left: 1px solid var(--border, #2a3442); background: #0b1016; }
#wd-radio.hidden { display: none !important; }
#wd-radio-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 3; }
#wd-radio-grip:hover { background: rgba(80, 160, 255, .25); }
html.wd-resizing #wd-radio iframe { pointer-events: none; }
html.wd-resizing { cursor: ew-resize; user-select: none; }
.wd-radio-head { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 12px; background: linear-gradient(180deg, var(--cad-head-1, #1d2a3a), var(--cad-head-2, #152030)); border-bottom: 1px solid var(--border, #2a3442); color: #e6edf5; font-size: 12px; }
.wd-radio-title { font-weight: 700; letter-spacing: .04em; margin-right: auto; }
.wd-radio-ptt { color: #9fb0c4; font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.wd-radio-ptt kbd { font-family: inherit; padding: 0 5px; border: 1px solid #4b5a6c; border-radius: 3px; }
.wd-radio-ptt.on { background: #e5383b; color: #fff; }
.wd-radio-body { position: relative; flex: 1; min-height: 0; display: flex; }
.wd-radio-body iframe { flex: 1; width: 100%; height: 100%; border: 0; display: block; background: #0b1016; }
.wd-radio-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: #8b9aaa; pointer-events: none; }
.wd-radio-msg:empty { display: none; }
.wd-radio-msg button { pointer-events: auto; margin-left: 8px; }
.wd-radio-dot { width: 7px; height: 7px; border-radius: 50%; background: #30d158; margin-left: auto; box-shadow: 0 0 0 3px rgba(48, 209, 88, .2); }
.wd-radio-dot.hidden { display: none; }
