/* queue_map.css - public Interconnection Queue Map (owned by queue_map.js).
   Dark REST 2.0 tracker palette inside the light page. Every rule is scoped to
   .qm-root except the two body.qm-fs-open rules for pseudo-fullscreen. */

body.qm-fs-open { overflow: hidden; }
body.qm-fs-open .feedback-fab { display: none; }

@keyframes qm-spin { to { transform: rotate(360deg); } }

.qm-root {
    --qm-bg: #0f172a;
    --qm-panel: #1e293b;
    --qm-border: #334155;
    --qm-line: #1f2937;
    --qm-text: #e2e8f0;
    --qm-text-strong: #f1f5f9;
    --qm-text-2: #94a3b8;
    --qm-muted: #64748b;
    --qm-amber: #f59e0b;
    --qm-amber-2: #fbbf24;
    --qm-blue: #60a5fa;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    height: 760px;
    background: var(--qm-bg);
    color: var(--qm-text);
    border: 1px solid var(--qm-border);
    border-radius: 12px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    text-align: left;
    box-sizing: border-box;
}
.qm-root *, .qm-root *::before, .qm-root *::after { box-sizing: border-box; }
.qm-root button, .qm-root input, .qm-root select { font-family: inherit; }
.qm-root [hidden] { display: none !important; }
.qm-root.qm-fs {
    position: fixed;
    inset: 0;
    z-index: 1600;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
}

/* ---------- utility colours */
.qm-root .qm-muted { color: var(--qm-muted); }
.qm-root .qm-amber { color: var(--qm-amber-2); }
.qm-root .qm-green { color: #4ade80; }
.qm-root .qm-red { color: #f87171; }
.qm-root .qm-violet { color: #a78bfa; }
.qm-root .qm-ic-blue { color: var(--qm-blue); }
.qm-root .qm-ic-amber { color: var(--qm-amber); }
.qm-root .qm-ic-red { color: #f87171; }
.qm-root .qm-lock { font-size: 9px; opacity: .75; margin-left: 3px; }

.qm-root .qm-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(148, 163, 184, .25);
    border-top-color: var(--qm-amber);
    border-radius: 50%;
    animation: qm-spin .8s linear infinite;
    vertical-align: -3px;
    margin-right: 6px;
}

/* ---------- top bar */
.qm-root .qm-top {
    flex-shrink: 0;
    padding: 8px 12px 6px;
    background: #0b1220;
    border-bottom: 1px solid var(--qm-line);
}
.qm-root .qm-top1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qm-root .qm-mkts {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid var(--qm-border);
    border-radius: 7px;
    overflow: hidden;
}
.qm-root .qm-mkt {
    background: transparent;
    border: 0;
    border-left: 1px solid var(--qm-line);
    color: var(--qm-text-2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 5px 14px;
    cursor: pointer;
}
.qm-root .qm-mkt:first-child { border-left: 0; }
.qm-root .qm-mkt:hover { color: var(--qm-text); }
.qm-root .qm-mkt.qm-on { background: rgba(245, 158, 11, .16); color: var(--qm-amber-2); }
.qm-root .qm-prov {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    color: var(--qm-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qm-root .qm-prov strong { color: var(--qm-text-strong); font-weight: 600; }
.qm-root .qm-prov i { margin-right: 4px; }
.qm-root .qm-iconbtn {
    flex-shrink: 0;
    width: 30px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .05);
    color: var(--qm-text-2);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.qm-root .qm-iconbtn:hover { color: var(--qm-amber-2); border-color: rgba(245, 158, 11, .5); }

.qm-root .qm-cmp { font-size: 11px; color: var(--qm-text-2); }
.qm-root .qm-cmp:empty { display: none; }
.qm-root .qm-cmp-line { margin-top: 5px; }
.qm-root .qm-cmp-line i { margin-right: 5px; }
.qm-root .qm-cmp-line strong { color: var(--qm-text-strong); font-weight: 600; }
.qm-root .qm-cmp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.qm-root .qm-cmpsel {
    background: var(--qm-bg);
    border: 1px solid var(--qm-border);
    border-radius: 4px;
    color: var(--qm-text);
    font-size: 11px;
    padding: 3px 6px;
    max-width: 150px;
}
.qm-root .qm-arrow { font-size: 9px; opacity: .7; }
.qm-root .qm-cmp-note { color: var(--qm-muted); font-size: 10.5px; margin-left: 4px; }

.qm-root .qm-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--qm-blue);
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
}
.qm-root .qm-link:hover { text-decoration: underline; }
.qm-root .qm-link-muted { color: var(--qm-muted); margin-left: 4px; }

/* ---------- body: panel + map */
.qm-root .qm-body { flex: 1; display: flex; min-height: 0; }
.qm-root .qm-panel {
    width: 420px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--qm-panel);
    border-right: 1px solid var(--qm-border);
}
.qm-root .qm-pscroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px 14px 14px;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}
.qm-root .qm-collapse { display: none; }
.qm-root .qm-mapwrap { position: relative; flex: 1; min-width: 0; background: #242424; }
.qm-root .qm-map { position: absolute; inset: 0; }
.qm-root .qm-mapover {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.qm-root .qm-mapmsg {
    pointer-events: auto;
    background: rgba(15, 23, 42, .92);
    border: 1px solid var(--qm-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--qm-text);
    display: flex; align-items: center; gap: 8px;
    max-width: 90%;
}

.qm-root .qm-center {
    padding: 24px 8px;
    font-size: 13px;
    color: var(--qm-text-2);
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.qm-root .qm-btn {
    background: rgba(59, 130, 246, .12);
    color: var(--qm-blue);
    border: 1px solid rgba(59, 130, 246, .3);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}
.qm-root .qm-btn:hover { background: rgba(59, 130, 246, .2); }

/* ---------- tabs */
.qm-root .qm-tabs {
    display: flex;
    border: 1px solid var(--qm-border);
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 10px;
}
.qm-root .qm-tab {
    flex: 1;
    min-width: 0;
    padding: 7px 2px;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--qm-line);
    color: var(--qm-text-2);
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qm-root .qm-tab:first-child { border-left: 0; }
.qm-root .qm-tab i:first-child { margin-right: 5px; }
.qm-root .qm-tab:hover { color: var(--qm-text); }
.qm-root .qm-tab.qm-on { background: rgba(245, 158, 11, .16); color: var(--qm-amber-2); }
.qm-root .qm-tab.qm-locked { color: var(--qm-muted); }

/* ---------- stat tiles */
.qm-root .qm-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.qm-root .qm-stat {
    background: var(--qm-bg);
    border: 1px solid var(--qm-border);
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    color: inherit;
    min-width: 0;
}
.qm-root .qm-stat:hover { border-color: #475569; }
.qm-root .qm-stat.qm-on { background: rgba(245, 158, 11, .10); border-color: var(--qm-amber); }
.qm-root .qm-stat-v { font-size: 18px; font-weight: 700; line-height: 1.25; }
.qm-root .qm-stat-l {
    font-size: 9px;
    color: var(--qm-text-2);
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.2;
}
.qm-root .qm-stat-e .qm-stat-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-root .qm-stat.qm-on .qm-stat-l { color: var(--qm-amber-2); }

/* ---------- cards, inputs, chips */
.qm-root .qm-card {
    background: var(--qm-bg);
    border: 1px solid var(--qm-border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
}
.qm-root .qm-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qm-root .qm-filters-plain { margin-bottom: 8px; }
.qm-root .qm-input {
    background: var(--qm-bg);
    border: 1px solid var(--qm-border);
    border-radius: 5px;
    color: var(--qm-text);
    font-size: 11px;
    padding: 4px 7px;
    min-width: 0;
    max-width: 100%;
    height: 26px;
}
.qm-root select.qm-input { padding-right: 4px; flex: 0 1 auto; max-width: 190px; }
.qm-root .qm-input:focus { outline: none; border-color: var(--qm-amber); box-shadow: 0 0 0 2px rgba(245, 158, 11, .15); }
.qm-root .qm-search { flex: 1 1 130px; min-width: 110px; }
.qm-root .qm-search::placeholder { color: var(--qm-muted); }
.qm-root .qm-search[data-search="roll"] { width: 100%; padding: 5px 8px; margin-bottom: 8px; }

.qm-root .qm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--qm-text);
    cursor: pointer;
    margin-bottom: 6px;
}
.qm-root .qm-check input { accent-color: var(--qm-amber); margin: 0; }
.qm-root .qm-hint { margin-left: auto; font-size: 10px; color: var(--qm-muted); }
.qm-root .qm-swatch { margin-left: auto; width: 90px; height: 8px; border-radius: 4px; flex-shrink: 0; }
.qm-root .qm-sw-cap { background: linear-gradient(to right, rgba(56, 189, 248, .6), #a78bfa, #f472b6); }
.qm-root .qm-sw-chg { background: linear-gradient(to right, rgba(250, 204, 21, .6), #f97316, #dc2626); }

.qm-root .qm-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qm-root .qm-fuels { margin-top: 8px; }
.qm-root .qm-chips-l { font-size: 10px; color: var(--qm-text-2); }
.qm-root .qm-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 1.6;
    border: 1px solid var(--qm-border);
    background: transparent;
    color: var(--qm-text-2);
    cursor: pointer;
    white-space: nowrap;
}
.qm-root .qm-chip:hover { border-color: #475569; color: var(--qm-text); }
.qm-root .qm-chip.qm-on { border-color: var(--qm-amber); background: rgba(245, 158, 11, .15); color: var(--qm-amber-2); }
.qm-root .qm-chip-n { color: var(--qm-muted); font-size: 10px; }
.qm-root .qm-chip.qm-on .qm-chip-n { color: rgba(251, 191, 36, .75); }
.qm-root .qm-chip-link { color: var(--qm-blue); border-color: rgba(96, 165, 250, .35); }
.qm-root .qm-dot7, .qm-root .qm-dot8, .qm-root .qm-dot9 { display: inline-block; border-radius: 50%; flex-shrink: 0; }
.qm-root .qm-dot7 { width: 7px; height: 7px; }
.qm-root .qm-dot8 { width: 8px; height: 8px; }
.qm-root .qm-dot9 { width: 9px; height: 9px; }
.qm-root .qm-fdot { display: inline-block; border-radius: 50%; opacity: .75; vertical-align: -1px; margin-right: 5px; }
.qm-root .qm-ficon { vertical-align: -2px; flex-shrink: 0; }

/* changed-column filter */
.qm-root .qm-fieldcard { padding: 8px 10px; }
.qm-root .qm-fieldhead {
    display: flex; align-items: center; gap: 7px; width: 100%;
    background: none; border: 0; padding: 0; color: var(--qm-text);
    font-size: 11.5px; cursor: pointer; text-align: left;
}
.qm-root .qm-fieldhead i:first-child { width: 10px; font-size: 9px; }
.qm-root .qm-fieldcount { margin-left: auto; font-size: 10.5px; color: var(--qm-muted); }
.qm-root .qm-fieldbody { margin-top: 8px; max-height: 190px; overflow-y: auto; }
.qm-root .qm-fieldrow { display: flex; align-items: center; gap: 7px; font-size: 11px; padding: 2px 0; cursor: pointer; }
.qm-root .qm-fieldrow input { accent-color: var(--qm-amber); margin: 0; }
.qm-root .qm-pill-n {
    margin-left: auto;
    font-size: 10px; font-weight: 700;
    color: var(--qm-amber);
    background: rgba(245, 158, 11, .12);
    border-radius: 999px;
    padding: 0 6px;
}
.qm-root .qm-fieldbody .qm-link { font-size: 10.5px; margin-bottom: 4px; }

/* summary lines, info */
.qm-root .qm-sumline { font-size: 10.5px; color: var(--qm-text-2); margin: 0 2px 8px; }
.qm-root .qm-sumline strong { color: var(--qm-text-strong); }
.qm-root .qm-info { font-size: 11px; color: var(--qm-text-2); }
.qm-root .qm-intro {
    background: var(--qm-bg);
    border: 1px solid var(--qm-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--qm-text-2);
    margin-bottom: 8px;
}
.qm-root .qm-intro strong { color: var(--qm-text); }
.qm-root .qm-legend { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 9.5px; color: var(--qm-muted); }
.qm-root .qm-legend-bar {
    flex: 1; height: 8px; border-radius: 4px;
    background: linear-gradient(to right, rgba(250, 204, 21, .35), rgba(249, 115, 22, .6), rgba(220, 38, 38, .8));
}

/* active-filter bar + open chip */
.qm-root .qm-afb, .qm-root .qm-openbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.qm-root .qm-afb > i { font-size: 10px; }
.qm-root .qm-afchip, .qm-root .qm-openchip { padding: 0 3px 0 7px; cursor: default; }
.qm-root .qm-openchip i:first-child { margin-right: 2px; }
.qm-root .qm-x {
    background: none; border: 0; color: inherit; cursor: pointer;
    padding: 0 3px; font-size: 10px; line-height: 1; opacity: .8;
}
.qm-root .qm-x:hover { opacity: 1; color: #f43f5e; }
.qm-root .qm-afb .qm-link { font-size: 10.5px; }
.qm-root .qm-note {
    font-size: 10.5px;
    color: #fde68a;
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .3);
    border-radius: 6px;
    padding: 6px 8px;
    margin: -2px 0 8px;
}
.qm-root .qm-note i { color: var(--qm-amber); margin-right: 4px; }

/* ---------- results */
.qm-root .qm-summary { font-size: 11px; color: var(--qm-text-2); padding: 0 2px 8px; }
.qm-root .qm-summary strong { color: var(--qm-text-strong); }
.qm-root .qm-summary strong.qm-violet { color: #a78bfa; }
.qm-root .qm-list { display: flex; flex-direction: column; gap: 6px; }
.qm-root .qm-list-tight { gap: 4px; }
.qm-root .qm-list .qm-card { margin-bottom: 0; }
.qm-root .qm-empty { font-size: 11.5px; color: var(--qm-muted); padding: 12px 4px; text-align: center; }
.qm-root .qm-pcard { padding: 8px 10px; cursor: pointer; }
.qm-root .qm-ccard { padding: 6px 8px; cursor: pointer; border-color: var(--qm-line); }
.qm-root .qm-pcard:hover, .qm-root .qm-ccard:hover { border-color: #475569; }
.qm-root .qm-pcard.qm-sel, .qm-root .qm-ccard.qm-sel { background: var(--qm-panel); border-color: #475569; }
.qm-root .qm-pcard:focus-visible, .qm-root .qm-ccard:focus-visible, .qm-root .qm-roll:focus-visible, .qm-root .qm-county:focus-visible {
    outline: 2px solid var(--qm-amber); outline-offset: 1px;
}
.qm-root .qm-dim { opacity: .65; }
.qm-root .qm-dim2 { opacity: .75; }
.qm-root .qm-row1 { display: flex; align-items: center; gap: 7px; min-width: 0; }
.qm-root .qm-qn { font-size: 12px; font-weight: 600; color: var(--qm-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qm-root .qm-tsp { font-size: 10px; color: var(--qm-muted); white-space: nowrap; }
.qm-root .qm-right { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qm-root .qm-badge { font-size: 10px; font-weight: 700; white-space: nowrap; }
.qm-root .qm-pill {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qm-root .qm-pname { font-size: 11px; color: #cbd5e1; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-root .qm-pcust { color: var(--qm-text-2); }
.qm-root .qm-pcust i { font-size: 9px; opacity: .8; margin-right: 4px; }
.qm-root .qm-row3 {
    display: flex; flex-wrap: wrap; gap: 4px 10px;
    font-size: 10.5px; color: var(--qm-text-2); margin-top: 4px;
}
.qm-root .qm-row3 i { margin-right: 4px; font-size: 9.5px; }
.qm-root .qm-zeg {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 0 6px; border-radius: 999px; line-height: 15px;
    font-size: 9.5px; font-weight: 700; border: 1px solid transparent;
}
.qm-root .qm-zeg i { font-size: 8px; margin: 0; }
.qm-root .qm-meta { font-size: 10px; color: var(--qm-text-2); margin-top: 3px; }
.qm-root .qm-chline { font-size: 10.5px; margin-top: 2px; display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.qm-root .qm-chl { color: var(--qm-text-2); white-space: nowrap; }
.qm-root .qm-from { color: #f87171; text-decoration: line-through; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qm-root .qm-arr { color: var(--qm-muted); }
.qm-root .qm-to { color: #4ade80; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qm-root .qm-more { font-size: 10px; color: var(--qm-muted); margin-top: 2px; }

.qm-root .qm-pager {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: 10px; font-size: 11px; color: var(--qm-text-2);
}
.qm-root .qm-pager strong { color: #cbd5e1; }
.qm-root .qm-pbtn {
    padding: 4px 10px; font-size: 11px; font-weight: 600; border-radius: 5px; cursor: pointer;
    background: rgba(59, 130, 246, .12); color: var(--qm-blue); border: 1px solid rgba(59, 130, 246, .25);
}
.qm-root .qm-pbtn:disabled {
    background: rgba(255, 255, 255, .03); color: #475569; border-color: rgba(255, 255, 255, .06); cursor: not-allowed;
}

/* rollups */
.qm-root .qm-roll { padding: 8px 10px; cursor: pointer; }
.qm-root .qm-roll:hover { border-color: #475569; }
.qm-root .qm-roll.qm-picked { background: var(--qm-panel); border-color: var(--qm-amber); }
.qm-root .qm-rkey { font-size: 12.5px; font-weight: 700; color: var(--qm-text-strong); white-space: nowrap; }
.qm-root .qm-rname { font-size: 10.5px; color: var(--qm-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qm-root .qm-rn { font-size: 10.5px; color: var(--qm-muted); white-space: nowrap; }
.qm-root .qm-rmw { font-size: 11.5px; font-weight: 600; color: #a78bfa; }
.qm-root .qm-ract { display: flex; gap: 10px; font-size: 10.5px; margin-top: 3px; }
.qm-root .qm-bar { height: 5px; border-radius: 3px; background: rgba(51, 65, 85, .5); margin-top: 6px; overflow: hidden; }
.qm-root .qm-bar-fill { display: flex; height: 100%; min-width: 2px; }
.qm-root .qm-bar-fill span { display: block; height: 100%; }
.qm-root .qm-rstat { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 5px; font-size: 9.5px; color: var(--qm-text-2); }
.qm-root .qm-rstat .qm-dot7 { margin-right: 4px; }
.qm-root .qm-county {
    background: var(--qm-bg); border: 1px solid var(--qm-line); border-radius: 6px;
    padding: 7px 9px; cursor: pointer; font-size: 11px;
}
.qm-root .qm-county:hover { border-color: #475569; }
.qm-root .qm-county.qm-picked { border-color: var(--qm-amber); background: var(--qm-panel); }
.qm-root .qm-sub { font-size: 10px; color: var(--qm-muted); margin-top: 2px; }

/* ---------- co-located picker */
.qm-root .qm-picker {
    position: absolute;
    z-index: 1680;
    width: 308px;
    max-height: 330px;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, .97);
    border: 1px solid rgba(245, 158, 11, .5);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .55);
    overflow: hidden;
}
.qm-root .qm-pk-head {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(0, 0, 0, .3);
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--qm-text);
}
.qm-root .qm-pk-head i { color: var(--qm-amber-2); }
.qm-root .qm-pk-head .qm-x { margin-left: auto; color: var(--qm-text-2); font-size: 12px; }
.qm-root .qm-pk-list { overflow-y: auto; padding: 4px; }
.qm-root .qm-pk-row {
    display: block; width: 100%; text-align: left;
    background: transparent; border: 0; border-radius: 6px;
    padding: 7px 9px; color: var(--qm-text); cursor: pointer;
}
.qm-root .qm-pk-row:hover, .qm-root .qm-pk-row:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
.qm-root .qm-pk-name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qm-root .qm-pk-sub { font-size: 10.5px; color: var(--qm-text-2); margin-top: 2px; padding-left: 14px; }

/* ---------- drawer */
.qm-root .qm-drawer {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 380px;
    max-width: 100%;
    z-index: 1650;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-left: 1px solid rgba(255, 255, 255, .07);
    box-shadow: -8px 0 40px rgba(0, 0, 0, .5);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .14s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .14s;
}
.qm-root .qm-drawer.qm-open { transform: translateX(0); visibility: visible; transition: transform .14s cubic-bezier(.4, 0, .2, 1); }
.qm-root .qm-dr-head {
    flex-shrink: 0;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    background: rgba(0, 0, 0, .25);
}
.qm-root .qm-dr-row1 { display: flex; align-items: center; gap: 8px; }
.qm-root .qm-dr-badge {
    font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
    letter-spacing: .06em; text-transform: uppercase; border: 1px solid transparent; white-space: nowrap;
}
.qm-root .qm-dr-row2 { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.qm-root .qm-dr-tblock { flex: 1; min-width: 0; }
.qm-root .qm-dr-title {
    margin: 0; font-size: 16px; font-weight: 700; color: var(--qm-text-strong);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.qm-root .qm-dr-tsp { font-size: 12px; font-weight: 600; color: var(--qm-text-2); }
.qm-root .qm-dr-name { font-size: 13px; font-weight: 600; margin-top: 3px; color: var(--qm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-root .qm-dr-cust { color: #cbd5e1; }
.qm-root .qm-dr-cust i { font-size: 11px; color: var(--qm-text-2); margin-right: 5px; }
.qm-root .qm-dr-sub { font-size: 11px; color: var(--qm-muted); margin-top: 3px; line-height: 1.5; }
.qm-root .qm-round {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05);
    color: var(--qm-text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.qm-root .qm-round:hover { color: var(--qm-amber-2); }
.qm-root .qm-round-x:hover { color: #f43f5e; }
.qm-root .qm-dr-note { font-size: 10.5px; color: var(--qm-text-2); margin-top: 8px; }
.qm-root .qm-dr-btn {
    margin-top: 10px; width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    border-radius: 6px; padding: 7px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.qm-root .qm-dr-btn + .qm-dr-btn { margin-top: 8px; }
.qm-root .qm-dr-btn-blue { background: rgba(59, 130, 246, .10); border: 1px solid rgba(59, 130, 246, .35); color: var(--qm-blue); }
.qm-root .qm-dr-btn-amber { background: rgba(245, 158, 11, .10); border: 1px solid rgba(245, 158, 11, .4); color: var(--qm-amber-2); }
.qm-root .qm-dr-btn:hover { filter: brightness(1.15); }
.qm-root .qm-dr-body { flex: 1; overflow-y: auto; padding: 2px 0 20px; }
.qm-root .qm-dr-sec { padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.qm-root .qm-dr-sectitle { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.qm-root .qm-dr-sectitle i { margin-right: 6px; }
.qm-root .qm-dr-win { margin-left: 6px; color: var(--qm-muted); letter-spacing: 0; text-transform: none; font-weight: 500; }
.qm-root .qm-dr-allt { padding: 12px 20px 4px; margin: 0; color: var(--qm-text-2); }
.qm-root .qm-dr-empty { font-size: 11px; color: var(--qm-muted); }
.qm-root .qm-rail { position: relative; padding-left: 16px; }
.qm-root .qm-rail-line { position: absolute; left: 3px; top: 5px; bottom: 5px; width: 2px; background: rgba(255, 255, 255, .12); }
.qm-root .qm-step { position: relative; }
.qm-root .qm-step-dot { position: absolute; left: -16px; top: 3px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px #0f172a; }
.qm-root .qm-step-date { font-size: 11.5px; font-weight: 700; color: var(--qm-text); margin-bottom: 6px; }
.qm-root .qm-step-note { font-size: 11px; color: #a5b4fc; font-style: italic; margin-bottom: 5px; }
.qm-root .qm-step-ch { font-size: 11px; margin-bottom: 5px; line-height: 1.4; word-break: break-word; }
.qm-root .qm-step-l { color: var(--qm-text-2); font-weight: 600; }
.qm-root .qm-arr2 { color: #475569; }
.qm-root .qm-dr-frow {
    display: flex; gap: 12px; padding: 9px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .045); font-size: 12px;
}
.qm-root .qm-dr-frow.qm-zebra { background: rgba(255, 255, 255, .015); }
.qm-root .qm-dr-fl { width: 128px; flex-shrink: 0; color: var(--qm-text-2); font-weight: 500; }
.qm-root .qm-dr-fv { flex: 1; text-align: right; word-break: break-word; color: var(--qm-text); min-width: 0; }
.qm-root .qm-dr-subline { font-size: 9.5px; color: var(--qm-muted); margin-top: 2px; }
.qm-root .qm-dr-foot {
    flex-shrink: 0; padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, .06); background: rgba(0, 0, 0, .25);
    font-size: 11px; color: var(--qm-text-2);
}
.qm-root .qm-dr-foot i { color: #3b82f6; margin-right: 6px; }

/* ---------- upgrade modal */
.qm-root .qm-modal {
    position: absolute;
    inset: 0;
    z-index: 1700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 6, 23, .72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.qm-root .qm-mcard {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 100%;
    overflow-y: auto;
    background: #0f172a;
    border: 1px solid var(--qm-line);
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
    padding: 24px 24px 20px;
    color: var(--qm-text);
}
.qm-root .qm-mclose {
    position: absolute; top: 10px; right: 12px;
    background: none; border: 0; color: var(--qm-muted); font-size: 16px; cursor: pointer; line-height: 1;
}
.qm-root .qm-mclose:hover { color: var(--qm-text); }
.qm-root .qm-mlogo { display: block; height: 34px; width: auto; max-width: 70%; margin-bottom: 14px; }
.qm-root .qm-mtitle { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--qm-text-strong); line-height: 1.3; }
.qm-root .qm-mreason { margin: 0 0 14px; font-size: 12.5px; color: #cbd5e1; line-height: 1.5; }
.qm-root .qm-mlist { list-style: none; margin: 0 0 18px; padding: 0; font-size: 12px; color: var(--qm-text); }
.qm-root .qm-mlist li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.qm-root .qm-mlist i { color: #4ade80; font-size: 10px; }
.qm-root .qm-mbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.qm-root .qm-mbtn {
    flex: 1 1 160px;
    text-align: center;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}
.qm-root .qm-mbtn-primary { background: #F05A42; color: #fff; border: 1px solid #F05A42; }
.qm-root .qm-mbtn-primary:hover { background: #e04a32; }
.qm-root .qm-mbtn-sec { background: transparent; color: var(--qm-text); border: 1px solid #475569; }
.qm-root .qm-mbtn-sec:hover { border-color: var(--qm-text-2); }

/* ---------- tablet */
@media (min-width: 769px) and (max-width: 1100px) {
    .qm-root { height: min(78vh, 760px); }
    .qm-root.qm-fs { height: 100vh; height: 100dvh; }
    .qm-root .qm-panel { width: 336px; }
    .qm-root .qm-drawer { width: min(300px, 46vw); }
    .qm-root .qm-tab i:first-child { display: none; }
    .qm-root .qm-cmp-note { display: block; margin-left: 0; width: 100%; }
}

/* ---------- mobile: panel stacks above the map, collapsible */
@media (max-width: 768px) {
    .qm-root { height: auto; }
    .qm-root .qm-top { padding: 8px 10px 6px; }
    .qm-root .qm-top1 { flex-wrap: wrap; }
    .qm-root .qm-prov { order: 3; flex-basis: 100%; white-space: normal; }
    .qm-root .qm-fsbtn { margin-left: auto; }
    .qm-root .qm-cmp-note { display: block; margin-left: 0; width: 100%; }
    .qm-root .qm-body { flex-direction: column; }
    .qm-root .qm-panel { width: 100%; border-right: 0; border-bottom: 1px solid var(--qm-border); }
    .qm-root .qm-collapse {
        display: flex; align-items: center; justify-content: center; gap: 6px;
        width: 100%; padding: 7px 10px;
        background: #0b1220; color: var(--qm-text-2);
        border: 0; border-bottom: 1px solid var(--qm-line);
        font-size: 11px; font-weight: 600; cursor: pointer;
    }
    .qm-root .qm-pscroll { max-height: 70vh; padding: 10px; }
    .qm-root.qm-collapsed .qm-pscroll { display: none; }
    .qm-root .qm-mapwrap { flex: none; height: 60vh; min-height: 320px; }
    /* Map first on phones: stacked panel-first put the map ~820 px down, entirely below the
       fold of a 812 px screen, so tapping "Map" showed no map. Filters + list follow it. */
    .qm-root .qm-mapwrap { order: -1; }
    /* Reclaim header height on phones; the locked options and "full history" link still
       open the upgrade prompt. */
    .qm-root .qm-cmp-line, .qm-root .qm-cmp-note { display: none; }
    /* The stacked root is taller than the viewport: size the drawer to the screen (below the page
       header) instead of the whole root, so its header, body and footer are all reachable. */
    .qm-root .qm-drawer {
        width: 100%; border-left: 0;
        bottom: auto;
        height: calc(100vh - 96px);
        height: calc(100dvh - 96px);
        max-height: 100%;
    }
    .qm-root.qm-fs .qm-drawer { height: 100vh; height: 100dvh; }
    .qm-root .qm-tab i:first-child { display: none; }
    .qm-root select.qm-input { max-width: 100%; flex: 1 1 140px; }
    .qm-root.qm-fs { overflow-y: auto; }
    .qm-root.qm-fs .qm-body { flex: none; }
}
