:root {
  --bg: #0e1116;
  --panel: #151a21;
  --panel-2: #1c222b;
  --border: #262d37;
  --text: #e4e8ee;
  --muted: #8a94a3;
  --faint: #737d8c;
  --accent: #5aa2ff;
  --warn: #f2cc60;
  --danger: #ef6b63;
  color-scheme: dark;
  scrollbar-color: #343c48 transparent;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 13px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font: 12px ui-monospace, Consolas, monospace; background: var(--bg); padding: 1px 4px; border-radius: 3px; color: #c9d4e3; }

button { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
button:hover { border-color: #3a4452; background: #222a34; }
button.primary { background: var(--accent); border-color: var(--accent); color: #06101f; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--danger); }
button.ghost { background: none; border-color: transparent; color: var(--muted); }
button.icon { background: none; border: 0; color: var(--muted); padding: 2px 6px; }

input, select, textarea { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
.muted { color: var(--muted); }

#app {
  --lw: 270px; --rw: 320px; --th: 116px;
  display: grid; height: 100vh;
  grid-template-columns: var(--lw) minmax(0, 1fr) var(--rw);
  grid-template-rows: auto minmax(0, 1fr) var(--th);
  grid-template-areas: "top top top" "left main right" "time time time";
}
#app.no-left { --lw: 0px; }
#app.no-right { --rw: 0px; }
#app.no-time { --th: 0px; }
#app.no-left #left, #app.no-right #right, #app.no-time #timeline { display: none; }
.seg.panels button { padding: 4px 8px; color: var(--muted); display: grid; place-items: center; }
.seg.panels button.on { color: var(--text); background: var(--panel-2); }
.seg.panels svg { width: 16px; height: 16px; }

header { grid-area: top; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; min-height: 48px;
  border-bottom: 1px solid var(--border); background: var(--panel); min-width: 0; }
.logo { color: var(--accent); font-size: 18px; flex: none; }
.hgrp { display: flex; align-items: center; gap: 6px; flex: none; }
.hgrp.case-grp { flex: 0 1 auto; min-width: 0; }
.hsep { width: 1px; height: 22px; background: var(--border); flex: none; margin: 0 2px; }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button.ib { display: inline-flex; align-items: center; gap: 6px; }
button.ib .caret { color: var(--muted); font-size: 10px; margin-left: -2px; }
.settings button.ib { padding: 5px 8px; color: var(--muted); }
.settings button.ib:hover { color: var(--text); }
#caseName { color: var(--muted); padding: 3px 6px; border-radius: 4px; outline: none; max-width: 220px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#caseName:hover { background: var(--panel-2); }
#caseName:focus { background: var(--bg); color: var(--text); }
#search { flex: 1 1 160px; min-width: 110px; max-width: 260px; margin-left: auto; }
@media (max-width: 1600px) { #btnCases .lbl, #btnEvidence .lbl, #btnSources .lbl { display: none; } #caseName { max-width: 150px; } }
@media (max-width: 1400px) { #btnShapes .lbl, #btnLayout .lbl { display: none; } }
@media (max-width: 1340px) { #caseName { max-width: 110px; } #search { min-width: 90px; } }
.seg { display: flex; flex: none; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: none; color: var(--muted); }
.seg button.on { background: var(--panel-2); color: var(--text); }
.seg.hist button { color: var(--text); padding: 5px 8px; display: grid; place-items: center; }
.seg.hist button:disabled { color: var(--faint); cursor: default; }
.seg.hist button + button { border-left: 1px solid var(--border); }

aside { background: var(--panel); overflow: auto; }
#left { grid-area: left; border-right: 1px solid var(--border); }
#right { grid-area: right; border-left: 1px solid var(--border); }
.blk { padding: 12px 14px; border-bottom: 1px solid var(--border); }
h3 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600;
  display: flex; justify-content: space-between; }
.h-hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }
h4 { margin: 18px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hint { color: var(--faint); font-size: 11px; }
.row .ghost { margin-left: auto; }
.help { margin-top: 10px; font-size: 12px; color: var(--muted); }
.help p { margin: 0 0 8px; }
#quick { font: 12px/1.5 ui-monospace, Consolas, monospace; }

.chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 5px; cursor: pointer; user-select: none; }
.chip:hover { background: var(--panel-2); }
.chip.off { opacity: .35; }
.chip .n, .list .n { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }
.sw { width: 11px; height: 11px; border-radius: 50%; flex: none; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 5px; cursor: pointer; }
.list li:hover { background: var(--panel-2); }
.list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0; cursor: pointer; }
.check input { width: auto; }

#views { grid-area: main; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; min-width: 0; overflow: hidden; }
#views.graph { grid-template-columns: minmax(0, 1fr); }
#views.graph #map { display: none; }
#views.map { grid-template-columns: minmax(0, 1fr); }
#views.map #graph { display: none; }
#graph { min-height: 0; background-color: var(--bg);
  background-image: radial-gradient(#1e252e 1px, transparent 1px); background-size: 22px 22px; }
#map { min-height: 0; border-left: 1px solid var(--border); background: #0b0d10; position: relative; }
#views.map #map { border-left: 0; }
#mapHint { position: absolute; z-index: 500; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center;
  background: rgba(21, 26, 33, .92); border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; color: var(--muted); pointer-events: none; }

#chips { position: absolute; z-index: 600; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.fchip { pointer-events: auto; display: flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid #34404f;
  border-radius: 20px; padding: 2px 4px 2px 10px; font-size: 12px; }
.fchip.path { border-color: var(--warn); color: var(--warn); }
.fchip button { background: none; border: 0; padding: 0 6px; color: var(--muted); }
#banner { position: absolute; z-index: 700; top: 10px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #06101f;
  font-weight: 600; padding: 7px 14px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
#banner kbd { background: rgba(0,0,0,.15); border-radius: 3px; padding: 0 4px; font: inherit; }
#empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); pointer-events: none; z-index: 400; }
#empty h2 { color: var(--text); margin: 0 0 4px; font-size: 18px; }

#timeline { grid-area: time; border-top: 1px solid var(--border); background: var(--panel); padding: 8px 14px 10px; display: flex; flex-direction: column; min-width: 0; }
.tl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tl-head h3 { margin: 0; }
.tl-head button { padding: 2px 9px; font-size: 12px; }
.spacer { flex: 1; }
#tlBody { position: relative; height: 66px; }
#tlSvg { width: 100%; height: 100%; display: block; }
#tlSvg .grid { stroke: #232a33; }
#tlSvg .yr { fill: var(--faint); font-size: 10px; }
#tlSvg .sel { fill: rgba(90, 162, 255, .08); }
#tlSvg circle { cursor: pointer; stroke: var(--bg); stroke-width: 1; }
#tlSvg circle.out { opacity: .25; }
#tlEmpty { padding-top: 14px; }
.dual { position: absolute; inset: 0; pointer-events: none; }
.dual input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: none;
  -webkit-appearance: none; appearance: none; pointer-events: none; }
.dual input[type=range]::-webkit-slider-runnable-track { background: none; height: 66px; }
.dual input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 6px; height: 66px;
  background: var(--accent); border-radius: 3px; cursor: ew-resize; }
.dual input[type=range]::-moz-range-track { background: none; }
.dual input[type=range]::-moz-range-thumb { pointer-events: auto; width: 6px; height: 66px; background: var(--accent); border: 0; border-radius: 3px; cursor: ew-resize; }

#inspector { padding: 14px; }
.insp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.insp-head .kind { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.insp-head .icon { margin-left: auto; }
#inspector label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
#inspector label > input, #inspector label > select, #inspector label > textarea { margin-top: 3px; font-size: 13px; color: var(--text); }
#inspector .big { font-size: 15px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 6px; }
.wide { width: 100%; margin-bottom: 10px; }
.rels li { font-size: 12px; }
.rels .dir { color: var(--faint); }
.rels .lbl { color: var(--muted); }
.rels b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rels b:hover { color: var(--accent); }
.conf { width: 16px; flex: none; border-top: 2px solid #c4ccd6; }
.c-probable { opacity: .65; }
.c-possible { border-top-style: dashed; opacity: .6; }
.c-doubtful { border-top-style: dotted; opacity: .5; }
.endpoints { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; margin-bottom: 12px; }
.endpoints .ep { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoints .ep:hover { border-color: var(--accent); }
.conf-desc { font-size: 11px; color: var(--faint); margin: -6px 0 10px; }
.sums { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12px; }
.sums b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.sum-link { cursor: pointer; border-radius: 4px; }
.sum-link:hover { color: var(--text); }
.sub-h { margin: 10px 0 6px; font-size: 12px; font-weight: 600; color: var(--text); }
h4.first { margin-top: 4px; }
.help-card { max-width: 620px; }
.help-tips { padding: 4px 22px 18px 34px; font-size: 13px; line-height: 1.55; }
.help-tips li { margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 11px; }
.warn-n { color: var(--warn); }
.tips { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.tips li { margin-bottom: 4px; }
.danger-zone { margin-top: 18px; }

.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #06101f;
  font-size: 11px; font-weight: 700; text-align: center; }
.badge:empty { display: none; }
.ev-ic { width: 18px; text-align: center; flex: none; }
.ev-list li { font-size: 12px; }
.ev-empty { cursor: default !important; font-size: 12px; line-height: 1.4; }
.ev-add { display: flex; gap: 6px; margin: 8px 0 4px; }
.ev-add select { flex: 1; min-width: 0; padding: 4px 6px; }
.ev-url-row { display: flex; gap: 6px; margin: 6px 0; }
.ok { color: #3fbf8f; }
.bad { color: var(--danger); }
#right { position: relative; }
#right.drop-over::after { content: "Drop to attach as evidence"; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 10px;
  background: rgba(90, 162, 255, .12); display: grid; place-items: center; color: var(--accent); font-weight: 600; pointer-events: none; }
.stat-wide { grid-column: 1 / -1; cursor: pointer; }
.stat-wide:hover { outline: 1px solid var(--accent); }
.center { text-align: center; }
a.button { display: inline-block; text-align: center; text-decoration: none; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; color: var(--text); }
a.button:hover { border-color: #3a4452; }

#modal { position: fixed; inset: 0; z-index: 3000; background: rgba(5, 7, 10, .72); display: grid; place-items: center; padding: 24px; }
.modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; width: min(1100px, 100%); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head .icon:last-child { margin-left: auto; font-size: 15px; }
.ev-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; flex: 1; }
.ev-preview { background: #0a0c10; display: grid; place-items: center; min-height: 420px; overflow: auto; }
.ev-preview img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.ev-preview iframe { width: 100%; height: calc(100vh - 140px); border: 0; background: #fff; }
.ev-preview pre { align-self: stretch; justify-self: stretch; margin: 0; padding: 16px; font: 12px/1.5 ui-monospace, Consolas, monospace;
  white-space: pre-wrap; overflow: auto; max-height: calc(100vh - 140px); }
.url-card { max-width: 440px; text-align: center; padding: 24px; }
.url-card a { color: var(--accent); word-break: break-all; }
.url-big { font-size: 40px; margin-bottom: 8px; }
.ev-meta { padding: 14px 16px; border-left: 1px solid var(--border); overflow: auto; }
.ev-meta label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.ev-meta label > * { margin-top: 3px; font-size: 13px; color: var(--text); }
.ev-meta dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12px; margin: 4px 0 12px; }
.ev-meta dt { color: var(--muted); }
.ev-meta dd { margin: 0; }
.hash { font: 11px/1.4 ui-monospace, Consolas, monospace; word-break: break-all; color: #c9d4e3; }
.ev-meta .list .icon { margin-left: auto; opacity: 0; }
.ev-meta .list li:hover .icon { opacity: 1; }
.locker-card { width: min(900px, 100%); }
.locker-tools { display: flex; gap: 8px; padding: 12px 16px; }
.locker-wrap { overflow: auto; padding: 0 16px; }
table.locker { width: 100%; border-collapse: collapse; font-size: 12px; }
.locker th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  padding: 6px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); }
.locker td { padding: 7px 8px; border-bottom: 1px solid #1d232b; }
.locker tbody tr[data-ev] { cursor: pointer; }
.locker tbody tr[data-ev]:hover { background: var(--panel-2); }
.locker .nm { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.locker-foot { padding: 10px 16px 14px; margin: 0; font-size: 12px; }
@media (max-width: 800px) { .ev-body { grid-template-columns: 1fr; } .ev-meta { border-left: 0; border-top: 1px solid var(--border); } }

.ticon { --c: #888; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--c); color: #0e1116; flex: none; }
.ticon.social-ic { box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.social-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 12px; }
.social-pick button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; background: var(--panel-2);
  border: 2px solid transparent; opacity: .5; }
.social-pick button:hover { opacity: .85; }
.social-pick button.on { opacity: 1; border-color: var(--accent); background: rgba(90, 162, 255, .12); }
.social-pick button.none { width: auto; padding: 0 9px; font-size: 11.5px; color: var(--muted); }
.social-pick .ticon.sm { width: 22px; height: 22px; }
.social-pick .ticon.sm svg { width: 13px; height: 13px; }
.ticon svg { width: 14px; height: 14px; }
.ticon.sm { width: 18px; height: 18px; }
.ticon.sm svg { width: 11px; height: 11px; }
kbd { font: 11px ui-monospace, Consolas, monospace; background: var(--panel-2); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 4px; color: var(--muted); }

.pop { position: fixed; z-index: 2500; background: var(--panel); border: 1px solid #34404f; border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
#palette { width: 390px; padding: 10px; max-height: calc(100vh - 16px); overflow: auto; }
#palette.compact { width: 226px; padding: 6px; transition: opacity .15s; }
#palette.compact:not(:hover) { opacity: .7; }
.pal-row { display: flex; align-items: center; gap: 4px; }
#palette.compact .pal-input { font-size: 12.5px; padding: 5px 7px; }
#palette.compact .pal-icons { gap: 1px; margin-top: 5px; }
#palette.compact .pal-icons .pal-tile { padding: 2px 0; }
#palette.compact .pal-icons .ticon { width: 20px; height: 20px; }
#palette.compact .pal-icons .ticon svg { width: 12px; height: 12px; }
#palette.compact .pal-detect { font-size: 11px; margin-top: 4px; }
#palette.compact .pal-match { padding: 3px 4px; font-size: 12px; }
.pal-head { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--muted); margin: 2px 2px 8px; }
.pal-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; flex: 1; }
.pal-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pal-size { padding: 0 4px; font-size: 13px; line-height: 1.2; }
.pal-icons { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin-top: 8px; }
.pal-icons .pal-tile { justify-content: center; padding: 4px 0; }
.pal-link { margin-top: 8px; font-size: 11.5px; color: var(--accent); }
#palette.compact .pal-foot { display: none; }
.pal-head b { color: var(--text); }
.pal-input { font-size: 14px; padding: 8px 10px; }
.pal-detect { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent); margin: 6px 2px 0; }
.pal-matches { margin-top: 4px; }
.pal-match { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 5px 6px; text-align: left; }
.pal-match:hover { background: var(--panel-2); }
.pal-match .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-match .muted { margin-left: auto; font-size: 11px; }
.pal-group { margin-top: 10px; }
.pal-gl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 2px 4px; }
.pal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.pal-tile { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; padding: 5px 6px;
  text-align: left; font-size: 12.5px; }
.pal-tile:hover { background: var(--panel-2); border-color: transparent; }
.pal-tile.hi { border-color: var(--accent); background: rgba(90, 162, 255, .1); }
.pal-foot { margin-top: 10px; font-size: 11px; color: var(--faint); }

#ctx { min-width: 230px; max-width: 340px; padding: 5px; max-height: calc(100vh - 16px); overflow-y: auto; }
.ctx-look { padding: 2px 8px 6px; }
.ctx-look label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.ctx-look label > select { margin-top: 2px; padding: 3px 6px; font-size: 12px; }
.ctx-look .segbtns button { font-size: 14px; padding: 3px; }
.ctx-look .arrow-grid button { padding: 3px 0; }
.ctx-look .swatches { margin: 2px 0 6px; gap: 4px; }
.ctx-look .sw-btn { width: 17px; height: 17px; }
.ctx-look .sw-custom { width: 17px; height: 17px; }
.ctx-look .btns { margin: 2px 0 0; }
.ctx-look .btns button { font-size: 11.5px; padding: 3px 6px; }
#bendHandle { position: fixed; z-index: 890; width: 16px; height: 16px; border-radius: 50%; background: var(--bg);
  border: 3px solid var(--accent); cursor: move; box-shadow: 0 2px 8px rgba(0,0,0,.5); touch-action: none; }
#bendHandle:hover { transform: scale(1.2); }
#shapeHandle { position: fixed; z-index: 890; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--bg); cursor: nwse-resize; box-shadow: 0 2px 8px rgba(0,0,0,.5); touch-action: none; }
#shapeHandle:hover { transform: scale(1.2); }
#lineBendHandle { position: fixed; z-index: 890; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--bg);
  border: 3px solid var(--accent); cursor: move; box-shadow: 0 2px 8px rgba(0,0,0,.5); touch-action: none; }
#lineBendHandle:hover { transform: scale(1.2); }
#labelHandle { position: fixed; z-index: 890; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 5px; background: var(--accent);
  color: #06101f; font: 700 11px/18px system-ui, sans-serif; text-align: center; cursor: move; box-shadow: 0 2px 8px rgba(0,0,0,.5);
  touch-action: none; user-select: none; }
#labelHandle:hover { transform: scale(1.15); }
.tpos { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -4px 0 4px; font-size: 11.5px; }
.tpos > .muted { flex: 1; }
.tpos .segbtns { flex: 1 0 100%; margin: 0; order: 2; }
.shape-ic { display: inline-flex; width: 18px; justify-content: center; font-size: 14px; color: var(--muted); }
.bend-row { display: flex; align-items: flex-end; gap: 6px; }
.bend-row label { flex: 1; }
.bend-row button { margin-bottom: 8px; padding: 2px 8px; }
.ctx-look .bend-row button { margin-bottom: 6px; }
.sp-color { width: 100%; height: 26px; padding: 2px; margin-top: 4px; }
.ctx-item { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-radius: 6px; padding: 6px 8px;
  text-align: left; color: var(--text); text-decoration: none; font-size: 13px; }
.ctx-item:hover { background: var(--panel-2); }
.ctx-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item.danger { color: var(--danger); }
.ctx-item.arr { align-items: flex-start; text-align: left; }
.ctx-item.arr .ctx-l { white-space: normal; }
.ctx-item.arr small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 1px; }
.ctx-item.arr small b { color: var(--text); font-weight: 600; }
.ctx-k { margin-left: auto; padding-left: 12px; color: var(--faint); font-size: 11px; }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.ctx-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px 4px; font-size: 11px; color: var(--muted); font-weight: 600;
  overflow: hidden; white-space: nowrap; }
.ctx-head span { overflow: hidden; text-overflow: ellipsis; }
.ctx-sub, .lp-sub { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 4px 8px 0; }
.lp-sub { padding: 2px 0 0; }
.ctx-conf, .lp-conf { display: flex; gap: 4px; padding: 4px 6px 6px; flex-wrap: wrap; }
.lp-conf { padding: 4px 0 0; }
.lp-c { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 7px; color: var(--muted); }
.lp-c.on { border-color: var(--accent); color: var(--text); background: rgba(90, 162, 255, .1); }
.ctx-links, .pivot-links { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 8px 6px; }
.pivot-links { padding: 2px 0 6px; }
.ctx-links a, .pivot-links a { font-size: 12px; color: var(--accent); text-decoration: none; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 12px; padding: 2px 9px; }
.ctx-links a:hover, .pivot-links a:hover { border-color: var(--accent); }
.pivot { display: flex; align-items: center; gap: 8px; text-align: left; margin-bottom: 6px; }
.pivot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#linkpick { width: 360px; padding: 10px; }
.lp-head { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 8px; }
.lp-head b { font-weight: 600; max-width: 115px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#rename { position: fixed; z-index: 2400; width: 220px; text-align: center; font-weight: 600; border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
#handle { position: fixed; z-index: 900; width: 24px; height: 24px; border-radius: 50%; padding: 0; background: var(--accent); color: #06101f;
  border: 2px solid var(--bg); font-weight: 800; font-size: 15px; line-height: 1; cursor: crosshair; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4); touch-action: none; }
#handle:hover { transform: scale(1.15); }
#dock { position: absolute; z-index: 500; left: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 3px;
  padding: 5px; background: rgba(21, 26, 33, .94); border: 1px solid var(--border); border-radius: 10px; }
#dock button { background: none; border: 0; padding: 3px; border-radius: 6px; cursor: grab; display: grid; place-items: center; }
#dock button:hover { background: var(--panel-2); }
#dock .more { color: var(--muted); font-weight: 700; height: 30px; cursor: pointer; }
#views.map #dock { display: none; }
#zoomCtl { position: absolute; z-index: 500; right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px; background: rgba(21, 26, 33, .94); border: 1px solid var(--border); border-radius: 10px; }
#zoomCtl button { background: none; border: 0; width: 30px; height: 30px; padding: 0; border-radius: 6px; display: grid; place-items: center; color: var(--text); }
#zoomCtl button:hover { background: var(--panel-2); }
#zoomCtl svg.i { width: 17px; height: 17px; }
#zoomPct { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 1px 0; }
#views.split #zoomCtl { right: calc(50% + 12px); }
#views.map #zoomCtl { display: none; }

#stylepanel { width: 300px; padding: 12px 14px; max-height: calc(100vh - 16px); overflow-y: auto; }
.sp-head { font-weight: 600; margin-bottom: 10px; }
.sp-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.sp-slider { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 2px; }
.sp-slider span, #inspector label > span.muted { float: right; font-size: 11px; }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); height: 22px; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 10px; align-items: center; }
.sw-btn { width: 20px; height: 20px; border-radius: 50%; padding: 0; background: var(--c); border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); font-size: 11px; color: #0e1116; line-height: 1; }
.sw-btn:hover { background: var(--c); transform: scale(1.12); }
.sw-btn.on { border-color: var(--text); }
.sw-btn.big { width: 30px; height: 30px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(128,128,128,.4); }
.sw-custom { position: relative; width: 20px; height: 20px; border-radius: 50%; overflow: hidden; cursor: pointer;
  background: conic-gradient(#e0637f, #f2d45c, #3fbf8f, #38bcd0, #5aa2ff, #a184f5, #e0637f); }
.sw-custom.big { width: 30px; height: 30px; border-radius: 8px; }
.sw-custom input { position: absolute; inset: -6px; width: 200%; height: 200%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
#inspector .sw-custom { margin: 0; }
.photo-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.photo-prev { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--border); }
.photo-prev.empty { display: grid; place-items: center; background: var(--panel-2); }
.photo-actions { min-width: 0; }
.photo-actions .hint { margin-top: 4px; line-height: 1.35; }
.row.tight { margin-top: 0; }
.row.wrap { flex-wrap: wrap; }

.segbtns { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: 4px 0 8px; }
.segbtns button { flex: 1; border: 0; border-radius: 0; background: none; color: var(--muted); padding: 5px 4px; font-size: 12px; }
.segbtns button + button { border-left: 1px solid var(--border); }
.segbtns button.on { background: rgba(90, 162, 255, .14); color: var(--text); }
.segbtns.small button { padding: 3px 4px; font-size: 11.5px; }
.arrow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 4px 0 6px; }
.arrow-grid button { display: grid; place-items: center; padding: 5px 0; color: var(--muted); background: var(--bg); }
.arrow-grid button.on { color: var(--accent); border-color: var(--accent); background: rgba(90, 162, 255, .1); }
.arrow-grid.disabled { opacity: .35; pointer-events: none; }
.sp-gap { margin-top: 12px; }
.btns.stack { grid-template-columns: 1fr; }
.btns button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#stylepanel select { margin-top: 3px; }

.pills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.pill { display: inline-flex; align-items: center; gap: 5px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 2px 8px 2px 3px; font-size: 12px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill:hover { border-color: var(--accent); }
.wide-sel { margin-top: 8px; }
button.tiny { padding: 0 6px; font-size: 11px; text-transform: none; letter-spacing: 0; }
#groupList .gtoggle { margin-left: 4px; font-weight: 700; padding: 0 6px; }
#groupList .gtoggle:hover { color: var(--text); }
.list .rm { margin-left: auto; opacity: 0; }
.list li:hover .rm { opacity: 1; }
#gbtns { position: fixed; inset: 0; pointer-events: none; z-index: 800; }
.gbtn { position: fixed; pointer-events: auto; width: 20px; height: 20px; padding: 0; border-radius: 5px; background: var(--panel);
  border: 1.5px solid var(--accent); color: var(--text); font-weight: 800; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.gbtn:hover { background: var(--panel-2); transform: scale(1.1); }
#boxsel { position: fixed; z-index: 850; border: 1.5px dashed var(--accent); background: rgba(90, 162, 255, .1); pointer-events: none; }

.export-card { width: min(980px, 100%); }
.x-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; padding: 14px 16px 16px; overflow: auto; }
.x-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.x-report { grid-row: span 3; }
.x-card h3 { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.x-card p { margin: 0 0 10px; font-size: 12px; line-height: 1.45; }
.x-card label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.x-card label > input:not([type=checkbox]):not([type=radio]) { margin-top: 3px; font-size: 13px; color: var(--text); }
.x-card .check { color: var(--text); font-size: 12.5px; margin: 3px 0; }
.x-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; margin: 4px 0 6px; }
.x-opts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 12.5px; }
.x-opts > span { width: 78px; color: var(--muted); font-size: 11px; }
.x-opts .radio { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--text); font-size: 12.5px; cursor: pointer; }
.x-opts input, .x-card .check input { width: auto; accent-color: var(--accent); }
.x-opts .check { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.x-card .x-note { margin: 2px 0 8px 22px; padding: 6px 9px; border-radius: 6px; font-size: 11.5px; color: var(--warn);
  background: rgba(242, 204, 96, .08); border: 1px solid rgba(242, 204, 96, .3); }
@media (max-width: 800px) { .x-grid { grid-template-columns: 1fr; } .x-report { grid-row: auto; } }

button.danger-solid { background: var(--danger); border-color: var(--danger); color: #1a0606; font-weight: 600; }
button.danger-solid:hover { filter: brightness(1.08); background: var(--danger); }
#lockScreen { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background: radial-gradient(circle at 50% 30%, #18202b, #0b0d10 70%); }
#lockScreen[hidden] { display: none !important; }
.lock-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px 26px 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6); }
.lock-card h1 { font-size: 20px; margin: 4px 0 8px; }
.lock-card h2 { font-size: 16px; margin: 0 0 6px; }
.lock-card p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
.lock-card label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.lock-card label > input:not([type=checkbox]) { margin-top: 4px; font-size: 15px; padding: 9px 11px; color: var(--text); }
.lock-card .check { color: var(--text); font-size: 12.5px; line-height: 1.4; align-items: flex-start; }
.lock-card .check input { margin-top: 2px; }
.lock-card .wide { padding: 9px; font-size: 14px; margin-top: 4px; }
.lock-logo { font-size: 30px; color: var(--accent); }
.lock-note { background: rgba(90, 162, 255, .1); border: 1px solid rgba(90, 162, 255, .35); border-radius: 8px; padding: 8px 10px; color: var(--text) !important; }
.lock-error { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-bottom: 6px; }
.strength { font-size: 12px; margin: -6px 0 8px; min-height: 16px; }
.strength .bad { color: var(--danger); } .strength .mid { color: var(--warn); } .strength .good { color: #3fbf8f; }
.forgot { display: block; margin: 10px auto 0; font-size: 12px; }
#secretDlg { position: fixed; inset: 0; z-index: 5100; display: grid; place-items: center; background: rgba(5, 7, 10, .7); }
#secretDlg[hidden] { display: none !important; }
.lock-card.small { width: min(380px, 100%); }
.cases-card { width: min(820px, 100%); }
.cases-tools { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; }
.cases-list { overflow: auto; padding: 0 16px; max-height: 46vh; }
.case-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.case-row.current { border-color: var(--accent); background: rgba(90, 162, 255, .06); }
.case-main { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.case-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-title { display: flex; align-items: center; min-width: 0; }
.case-main .muted { font-size: 12px; }
.case-main:hover b { color: var(--accent); }
.case-actions { display: flex; gap: 5px; flex: none; }
.case-actions button { font-size: 12px; padding: 4px 9px; }
.tag { display: inline-block; margin-left: 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 8px; padding: 0 6px; vertical-align: 2px; }
.vault-box { margin: 10px 16px 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.vault-box h3 { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.vault-grid { display: grid; gap: 6px; font-size: 12.5px; margin-bottom: 10px; }
.vault-grid .k { display: inline-block; min-width: 110px; color: var(--muted); }
.k-row { display: flex; align-items: center; gap: 6px; }
.k-row select { width: auto; padding: 3px 6px; }
.pad { padding: 12px 16px; margin: 0; }
.x-warn { margin: 0 16px 16px; padding: 8px 12px; border-radius: 8px; font-size: 12px; color: var(--warn);
  background: rgba(242, 204, 96, .08); border: 1px solid rgba(242, 204, 96, .3); }

.merge-card { width: min(860px, 100%); }
.merge-body { overflow: auto; padding: 12px 16px; }
.merge-body > p { margin: 0 0 10px; font-size: 12.5px; }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mchip { border: 1px solid var(--border); border-radius: 12px; padding: 2px 10px; font-size: 12px; background: var(--panel-2); }
.mchip.add { border-color: rgba(63, 191, 143, .5); color: #3fbf8f; }
.mchip.warn { border-color: rgba(242, 204, 96, .5); color: var(--warn); }
.mchip.same { color: var(--muted); }
.msec { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: var(--panel-2); }
.msec.off { opacity: .55; }
.msec summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; }
.msec summary .muted { font-size: 12px; }
.msec-body { padding: 0 12px 10px; }
.msec-body .check { margin: 0 0 6px; font-size: 12.5px; }
.mlist { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; font-size: 12.5px; }
.mlist li { display: flex; align-items: center; gap: 6px; padding: 3px 0; flex-wrap: wrap; }
.mlist .muted { font-size: 12px; }
.mtable { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.mtable th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.mtable td { padding: 5px 6px; border-bottom: 1px solid #1d232b; vertical-align: top; }
.merge-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.merge-foot .muted { margin-right: auto; font-size: 12px; }

img.flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.nat { margin-bottom: 10px; }
.nat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.nat-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nat-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 2px 2px 2px 6px; font-size: 12.5px; }
.nat-chip .icon { padding: 0 5px; }
.nat-add { position: relative; flex: 1; min-width: 150px; }
.nat-add input { padding: 4px 8px; font-size: 12.5px; }
.nat-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 3px); background: var(--panel); border: 1px solid #34404f;
  border-radius: 8px; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-height: 260px; overflow: auto; }
.nat-results button, .addr-hit { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-radius: 6px;
  padding: 5px 6px; text-align: left; font-size: 12.5px; }
.nat-results button:hover, .nat-results button.hi, .addr-hit:hover { background: var(--panel-2); }
.nat-results .muted { margin-left: auto; font-size: 11px; }
.addr { margin-bottom: 8px; }
.addr .row input { flex: 1; min-width: 0; }
.addr-results { margin: 6px 0 2px; }
.addr-hit { align-items: flex-start; }
.addr-hit > span { display: flex; flex-direction: column; min-width: 0; }
.addr-hit .muted { font-size: 11.5px; line-height: 1.35; }
.addr .hint { margin-top: 4px; line-height: 1.35; }

.secret { -webkit-text-security: disc; font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.secret::placeholder { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; }

#tabWarning { position: fixed; z-index: 5200; top: 10px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px; background: #3a2f10; color: var(--warn); border: 1px solid rgba(242, 204, 96, .5);
  border-radius: 8px; padding: 7px 8px 7px 14px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
#tabWarning[hidden] { display: none; }

#updateBar { position: fixed; z-index: 2600; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 10px 8px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
#newVersionBar { position: fixed; z-index: 5100; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 10px 8px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
#newVersionBar { align-items: flex-start; max-width: 460px; }
#newVersionBar ol { margin: 6px 0; padding-left: 20px; }
#newVersionBar a { color: var(--accent); }
.src-grades { display: grid; gap: 8px; margin: -2px 0 12px; }
.src-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-items: center; font-size: 12px; }
.src-name { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.grade-sel { width: 100%; min-width: 0; padding: 2px 4px; font-size: 12px; }
.case-actions .grade-sel { width: auto; max-width: 220px; }
.grade { font: 600 11px ui-monospace, Consolas, monospace; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; color: var(--text); }
.src-items { margin-top: 6px; }
.src-items li { display: flex; gap: 8px; align-items: center; }
.src-items li { flex-wrap: wrap; }
.src-items li .nm { flex: 1 1 220px; min-width: 0; }
.src-items .grade-sel { width: 190px; flex: none; }
.src-card .case-main a { color: var(--accent); }
.src-url { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 12px; color: var(--muted); }
.src-url input { flex: 1; min-width: 0; }
.src-card .case-actions { flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; padding: 4px 8px; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.on { color: var(--accent); border-color: var(--accent); }
#inspector input.invalid { border-color: #e0637f; box-shadow: 0 0 0 1px #e0637f; }
.upd-choice { overflow-x: hidden; color: var(--text); }
.upd-choice:focus { outline: none; }
.dlg-x { position: absolute; top: 12px; right: 12px; }
.upd-choice h3 { padding-right: 32px; }
.upd-choice h3 { display: block; text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--text); }
.upd-choice .opt-badge { display: inline-block; line-height: 1.5; }
.upd-opts { display: grid; gap: 8px; margin-top: 12px; }
.upd-now { margin-top: 12px; align-items: center; }
.upd-opt { box-sizing: border-box; min-width: 0; white-space: normal; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px;
  background: var(--panel-2); color: var(--text); border: 2px solid var(--border); border-radius: 8px; }
.upd-opt:hover { border-color: var(--accent); }
.upd-opt.on { border-color: var(--accent); background: rgba(90, 162, 255, .14); }
.upd-opt b { display: block; font-size: 14px; }
.upd-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.upd-ic { font-size: 20px; }
.upd-cur { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #0b1220; font-size: 11px; font-weight: 700; white-space: nowrap; }
.opt-badge { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #0b1220;
  font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; vertical-align: middle; }

#toast { position: fixed; bottom: 136px; left: 50%; transform: translate(-50%, 20px); background: var(--panel-2); border: 1px solid #34404f;
  padding: 8px 14px; border-radius: 6px; opacity: 0; transition: .2s; pointer-events: none; z-index: 5300; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.leaflet-container { background: #0b0d10; font: inherit; }
.dark-tiles { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.85) saturate(.5); }
#map.no-tiles .leaflet-container, #map.no-tiles { background-color: #0b0d10;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 40px 40px; }
.sp-note { margin: 6px 0 0; line-height: 1.4; }
#stylepanel select[data-maptiles] { margin-top: 4px; }
.leaflet-tooltip { background: var(--panel-2); color: var(--text); border: 1px solid #34404f; box-shadow: none; }
.leaflet-tooltip-top:before { border-top-color: #34404f; }
.leaflet-bar a, .map-fit, .map-close { background: var(--panel-2) !important; color: var(--text) !important; border-color: var(--border) !important; }
.map-fit, .map-close { border: 2px solid rgba(0,0,0,.3) !important; }
.map-fit { padding: 4px 10px; }
.map-close { width: 30px; height: 30px; font-size: 15px; line-height: 1; padding: 0; margin-bottom: 6px; border-radius: 4px; }
.map-close:hover { background: var(--panel) !important; color: var(--danger) !important; }
.leaflet-control-attribution { background: rgba(14,17,22,.75) !important; color: var(--faint); }
.leaflet-control-attribution a { color: var(--muted); }
.placing #map, .placing .leaflet-container { cursor: crosshair; }

@media (max-width: 900px) {
  #caseName { display: none; }
}
@media (max-width: 1399px) {
  #app { --lw: 0px; --rw: 0px; }
  #left, #right { grid-area: main; position: relative; z-index: 950; align-self: stretch; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
  #left { justify-self: start; width: 270px; }
  #right { justify-self: end; width: 330px; }
  #app #left, #app #right { display: none; }
  #app.show-left #left, #app.show-right #right, #app.has-sel #right { display: block; }
  #app.show-right #views.graph #zoomCtl, #app.has-sel #views.graph #zoomCtl { right: 342px; }
}
