:root {
  color-scheme: dark;
  --ink: #eef1f8;          /* primary text */
  --cyan: #4fd2f7;
  --teal: #6fd9cb;
  --yellow: #ffcf4d;
  --red: #ff6a52;
  --bg: #0a0d16;           /* page */
  --card: #121623;         /* panels */
  --card-2: #191e2e;       /* raised / hover */
  --line: #262c3f;
  --muted: #98a1b8;
  --chrome: #0d1019;       /* top bar */
  --input: #0d111c;
  --accent-soft: rgba(79,210,247,.12);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 500px at 80% -10%, #1a2140 0%, var(--bg) 55%) fixed, var(--bg);
  line-height: 1.5;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
  color: #fff;
}
.topbar .brand img { display: block; filter: brightness(0) invert(1); }
.mainnav { display: flex; gap: 22px; flex: 1; }
.mainnav a { color: #cfd3e2; font-weight: 500; }
.mainnav a:hover { color: #fff; text-decoration: none; }
.userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #cfd3e2; }
.userbox form { margin: 0; }

/* ---- Layout ---- */
.container { max-width: 1180px; margin: 0 auto; padding: 26px 24px 60px; }
.sitefooter {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  max-width: 1180px; margin: 0 auto; padding: 18px 24px; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--line);
}

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 26px 0 10px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.subtle { color: var(--muted); font-size: 13px; }

/* ---- Cards & grid ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.stat .num { font-size: 30px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.stat.accent-cyan { border-top: 3px solid var(--cyan); }
.stat.accent-teal { border-top: 3px solid var(--teal); }
.stat.accent-yellow { border-top: 3px solid var(--yellow); }
.stat.accent-red { border-top: 3px solid var(--red); }

/* ---- Tables ---- */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--card-2); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:hover td { background: var(--card-2); }
.mono { font-family: Consolas, 'Courier New', monospace; font-size: 12.5px; word-break: break-all; }

/* ---- Definition rows ---- */
dl.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; }

/* ---- Buttons ---- */
.btn { display: inline-block; border: 1px solid transparent; border-radius: 7px; padding: 8px 16px; font-size: 14px; cursor: pointer; font-weight: 600; }
.btn-primary { background: var(--cyan); color: #062a35; }
.btn-primary:hover { background: #37b4da; text-decoration: none; }
.btn-teal { background: var(--teal); color: #0a3b34; }
.btn-dark { background: #3a4060; color: #fff; }
.btn-dark:hover { background: #464d73; text-decoration: none; }
.btn-ghost { background: transparent; border-color: #cfd3e2; color: #cfd3e2; }
.btn-ghost:hover { border-color: #fff; color: #fff; text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--cyan); text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }

/* ---- Forms ---- */
.form-row { margin-bottom: 14px; max-width: 620px; }
.form-row label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=password],
.form-row input[type=date], .form-row input[type=number], .form-row textarea, .form-row select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-family: inherit;
  background: var(--input); color: var(--ink);
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(79,210,247,.15);
}
.form-row textarea { min-height: 90px; }
.form-check { display: flex; gap: 9px; align-items: flex-start; max-width: 620px; margin-bottom: 14px; }
.field-validation-error, .validation-summary-errors { color: var(--red); font-size: 13px; }
.validation-summary-errors ul { margin: 6px 0; padding-left: 18px; }

/* ---- Alerts / badges ---- */
.alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.alert-info { background: rgba(79,210,247,.10); border: 1px solid rgba(79,210,247,.35); color: #bfeafa; }
.alert-warn { background: rgba(255,207,77,.10); border: 1px solid rgba(255,207,77,.35); color: #ffe6a1; }
.alert-danger { background: rgba(255,106,82,.10); border: 1px solid rgba(255,106,82,.4); color: #ffc0b4; }
.alert-success { background: rgba(111,217,203,.10); border: 1px solid rgba(111,217,203,.35); color: #bdeee6; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-gray { background: #2a3048; color: #b9c0d8; }
.badge-cyan { background: rgba(79,210,247,.16); color: #8fe2fb; }
.badge-teal { background: rgba(111,217,203,.16); color: #9be6da; }
.badge-yellow { background: rgba(255,207,77,.16); color: #ffdf91; }
.badge-red { background: rgba(255,106,82,.16); color: #ffab9d; }

.sev-Critical, .sev-High { color: var(--red); font-weight: 700; }
.sev-Medium { color: #e5ab3f; font-weight: 600; }
.sev-Low, .sev-Informational { color: var(--muted); }

pre.log { background: #0b0e1c; border: 1px solid var(--line); color: #ccd3e8; padding: 14px 16px; border-radius: 8px; font-size: 12.5px; overflow-x: auto; white-space: pre-wrap; }
pre.code { background: #0b0e1c; border: 1px solid var(--line); color: #e7ebf5; padding: 14px 16px; border-radius: 8px; font-size: 12.5px; line-height: 1.55; overflow-x: auto; white-space: pre-wrap; word-break: break-word; font-family: Consolas, 'SF Mono', Menlo, monospace; }

/* Expandable web-vuln finding rows. */
.wv-findings .wv-row { cursor: pointer; }
.wv-findings .wv-row:hover td { background: rgba(79,210,247,.06); }
.wv-findings .wv-row.is-open td { background: rgba(79,210,247,.1); }
.wv-findings .wv-caret span { display: inline-block; transition: transform .15s ease; color: var(--muted); }
.wv-findings .wv-row.is-open .wv-caret span { transform: rotate(90deg); }
.wv-findings .wv-detail > td { background: rgba(11,14,28,.5); }
.wv-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 4px 0 12px; }
.wv-dl dt { color: var(--muted); font-size: 12.5px; }
.wv-dl dd { margin: 0; font-size: 13px; }
.wv-fix-h { font-size: 13.5px; margin: 10px 0 6px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--teal); padding: 4px 0 14px 16px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.timeline .t-time { font-size: 12px; color: var(--muted); }

.notice { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--yellow); padding: 12px 16px; border-radius: 6px; font-size: 13.5px; color: #d9cfae; margin-bottom: 16px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---- Virtual phone reader ---- */
.reader-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.reader-nav a {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 13px 6px 7px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.reader-nav a:hover { border-color: var(--cyan); text-decoration: none; }
.reader-nav a.active { background: var(--cyan); border-color: var(--cyan); color: #062a35; }

/* App icon chips (brand colours) */
.chip {
  width: 54px; height: 54px; border-radius: 14px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff; font-family: inherit;
  box-shadow: inset 0 -14px 22px rgba(0,0,0,.10), 0 1px 3px rgba(20,24,40,.18);
}
.chip-mini { width: 22px; height: 22px; border-radius: 7px; font-size: 12px; box-shadow: none; }
.chip-home     { background: linear-gradient(160deg, #3a3e55, #23263a); }
.chip-sms      { background: linear-gradient(160deg, #67e57f, #23b93f); }
.chip-contacts { background: linear-gradient(160deg, #b0b6c6, #7d8496); }
.chip-calls    { background: linear-gradient(160deg, #52d5b0, #159a86); }
.chip-wa       { background: linear-gradient(160deg, #45d868, #1faf51); }
.chip-tg       { background: linear-gradient(160deg, #37bbfe, #067ec0); }
.chip-fb       { background: linear-gradient(160deg, #2b9cff, #0064e0); font-family: Georgia, serif; font-style: italic; }
.chip-ig       { background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); font-size: 17px; letter-spacing: .5px; }
.chip-tt       { background: #16181d; text-shadow: -1.5px 0 #25F4EE, 1.5px 1px #FE2C55; }
.chip-x        { background: #0f1419; }
.chip-mail     { background: linear-gradient(160deg, #6ab7ff, #1257c9); }
.chip-device   { background: linear-gradient(160deg, #7f8698, #4a5062); }
.scope-picker { border: 1px solid var(--line, #d8dce6); border-radius: 8px; padding: 10px 12px; }
.scope-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2px 18px; }
.scope-grid .form-check { margin: 2px 0; }
.chip-gallery  { background: linear-gradient(160deg, #fdfdfd, #dfe4ee); }
.chip-web      { background: linear-gradient(160deg, #6ab7ff, #1f6fe0); }
.chip-files    { background: linear-gradient(160deg, #8f96a8, #5d6375); }

/* Home screen */
.phone-shell { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; margin-bottom: 18px; }
.phone-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.app-tile {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
  border: 1px solid transparent; border-radius: 16px; padding: 18px 12px 14px; color: var(--ink);
}
.app-tile:hover { text-decoration: none; background: var(--card-2); border-color: var(--line); }
.app-tile .app-name { font-weight: 700; font-size: 14px; margin-top: 3px; }
.app-tile .app-detail { color: var(--muted); font-size: 12px; line-height: 1.3; }
.app-tile-empty { opacity: .38; filter: saturate(.4); }

/* Chat browser */
.chat-layout { display: grid; grid-template-columns: minmax(250px, 330px) 1fr; gap: 16px; align-items: start; --accent: var(--cyan); --me-bubble: #0a84ff; --me-ink: #fff; }
@media (max-width: 800px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-threads { max-height: 660px; overflow-y: auto; padding: 10px; }
.chat-threads-head { font-weight: 700; padding: 6px 10px 10px; display: flex; justify-content: space-between; align-items: center; }
.chat-thread { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; color: var(--ink); }
.chat-thread:hover { background: var(--card-2); text-decoration: none; }
.chat-thread.active { background: color-mix(in srgb, var(--accent) 24%, var(--card)); }
.chat-thread-body { min-width: 0; flex: 1; }
.chat-thread-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-thread-name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-thread-time { color: var(--muted); font-size: 11.5px; flex: none; }
.chat-thread-preview { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  color: #fff; font-weight: 700; font-size: 16px;
}

.chat-pane { padding: 0; overflow: hidden; }
.chat-pane-head { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--card-2); }
.chat-pane-title { font-weight: 700; }
.chat-empty { display: flex; flex-direction: column; align-items: center; padding: 70px 0; }
.chat-empty-icon { font-size: 40px; opacity: .5; }

.chat-scroll { max-height: 580px; overflow-y: auto; padding: 18px 18px 10px; background: #121628; }
.bubble-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.bubble-row.me { align-items: flex-end; }
.bubble { max-width: 68%; border-radius: 18px; padding: 8px 13px; background: #262c46; color: var(--ink); }
.bubble-row.them .bubble { border-bottom-left-radius: 6px; }
.bubble-row.me .bubble { background: var(--me-bubble); color: var(--me-ink); border-bottom-right-radius: 6px; }
.bubble-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.45; }
.bubble-meta { color: var(--muted); font-size: 10.5px; margin: 3px 6px 0; }

/* Per-app chat theming */
.chat-app-imessage  { --accent: #23b93f; --me-bubble: #0a84ff; --me-ink: #fff; }
.chat-app-whatsapp  { --accent: #1faf51; --me-bubble: #d9fdd3; --me-ink: #14331c; }
.chat-app-telegram  { --accent: #2aabee; --me-bubble: #effdde; --me-ink: #1d3522; }
.chat-app-facebook  { --accent: #0064e0; --me-bubble: #0084ff; --me-ink: #fff; }
.chat-app-instagram { --accent: #dd2a7b; --me-bubble: #3797f0; --me-ink: #fff; }
.chat-app-tiktok    { --accent: #fe2c55; --me-bubble: #fe2c55; --me-ink: #fff; }
.chat-app-x         { --accent: #1d9bf0; --me-bubble: #1d9bf0; --me-ink: #fff; }
.chat-app-whatsapp .chat-scroll { background: #131d16; }
.chat-app-telegram .chat-scroll { background: #101a24; }

/* Gallery */
.gallery-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gallery-item { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery-item img, .gallery-item video { display: block; width: 100%; height: 140px; object-fit: cover; background: #1c1f2b; }
.gallery-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 140px; background: var(--card-2); font-size: 26px; color: var(--muted); }
.gallery-placeholder span { font-size: 12px; font-weight: 700; }
.gallery-item figcaption { padding: 8px 10px; }
.gallery-name { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-meta { display: block; color: var(--muted); font-size: 11.5px; }

/* ---- USB acquisition ---- */
.usb-devices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.usb-device {
  display: flex; gap: 12px; align-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.usb-device:hover { border-color: var(--cyan); }
.usb-device:has(input:checked) { border-color: var(--cyan); background: rgba(79,210,247,.08); }
.usb-device-blocked { opacity: .55; cursor: not-allowed; }
.usb-device-icon { font-size: 26px; }
.usb-device-name { display: block; font-weight: 700; }
.usb-device-detail { display: block; font-size: 12.5px; color: var(--muted); }
.usb-device-id { display: block; font-size: 11px; color: var(--muted); }

/* ---- Live acquisition progress ---- */
.hidden { display: none; }
.acq-progress { border-left: 4px solid var(--cyan); }
.acq-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.acq-phase { font-size: 16px; font-weight: 700; }
.acq-detail { font-size: 13px; }
.acq-pct { font-size: 20px; font-weight: 700; color: var(--cyan); min-width: 56px; text-align: right; }
.acq-spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--cyan); border-radius: 50%; animation: acq-spin .8s linear infinite; flex: none; }
@keyframes acq-spin { to { transform: rotate(360deg); } }
.acq-bar { height: 8px; background: #232946; border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.acq-bar-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--teal)); border-radius: 6px; transition: width .4s ease; }
.acq-bar-fill.indeterminate { width: 35% !important; animation: acq-indet 1.2s ease-in-out infinite; }
@keyframes acq-indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.acq-lines { max-height: 220px; overflow-y: auto; margin: 0; }

/* ---- Live phone details ---- */
.device-hero {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(135deg, #1c2347 0%, #12162b 60%), var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 22px 26px; margin-bottom: 18px;
  box-shadow: 0 12px 34px rgba(0,0,0,.32);
}
.device-hero-glyph {
  width: 76px; height: 76px; border-radius: 22px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: linear-gradient(160deg, #303a66, #1a1f38);
  border: 1px solid #3a4570; box-shadow: inset 0 -16px 26px rgba(0,0,0,.35);
}
.device-hero-name { font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.device-hero-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.device-hero .toolbar { margin-left: auto; }
.device-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; margin-right: 8px;
  background: rgba(79,210,247,.10); border: 1px solid rgba(79,210,247,.3);
  color: #a9e8fb; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600;
}

.prop-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); margin-bottom: 18px; }
.prop-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.prop-card h3 {
  display: flex; align-items: center; gap: 9px; margin: 0 0 8px;
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.prop-card h3 .chip-mini { font-size: 12px; }
.prop-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 7px 2px; border-bottom: 1px dashed var(--line); }
.prop-row:last-child { border-bottom: none; }
.prop-key { color: var(--muted); font-size: 13px; flex: none; }
.prop-val { font-family: Consolas, 'Courier New', monospace; font-size: 12.5px; text-align: right; word-break: break-all; cursor: copy; }
.prop-val:hover { color: var(--cyan); }
.copy-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--cyan); color: #062a35; font-weight: 700; font-size: 13px;
  padding: 8px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 50;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Sectioned forms (case create) ---- */
.section-card { border-left: 4px solid var(--cyan); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 2px; font-size: 16px; }
.section-sub { margin: 0 0 14px; }
.gps-readout { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.gps-readout .device-pill { margin-top: 0; }

/* ---- Dashboard ---- */
.dash-hero {
  display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(135deg, #1c2347 0%, #12162b 60%), var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; margin-bottom: 18px;
  box-shadow: 0 12px 34px rgba(0,0,0,.32);
}
.dash-hero-kicker { font-size: 11px; letter-spacing: .18em; color: var(--cyan); font-weight: 700; margin-bottom: 4px; }
.dash-hero-title { margin: 0 0 4px; font-size: 26px; }
.stat-link { display: block; color: var(--ink); position: relative; transition: transform .12s ease, border-color .12s ease; }
.stat-link:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--cyan); }
.stat-icon { position: absolute; top: 14px; right: 16px; font-size: 22px; opacity: .8; }
.dash-list { display: flex; flex-direction: column; }
.dash-row {
  display: flex; gap: 12px; align-items: center; padding: 9px 8px; border-radius: 10px;
  color: var(--ink); border-bottom: 1px dashed var(--line);
}
.dash-row:last-child { border-bottom: none; }
a.dash-row:hover { background: var(--card-2); text-decoration: none; }
.dash-row-icon {
  width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; font-size: 16px;
}
.dash-row-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.dash-row-title { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; font-size: 12px; }
.job-list { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.job-row { padding: 12px 8px; }
.job-row-live { background: rgba(79,210,247,.05); border-left: 3px solid var(--cyan); border-radius: 10px; }
/* ---- Inline SVG charts ---- */
.viz-card svg text { font-family: 'Segoe UI', Roboto, Arial, sans-serif; }
.viz-axis { fill: var(--muted); font-size: 10.5px; }
.viz-val { fill: var(--ink); font-size: 11px; font-weight: 600; }
.viz-hover { transition: filter .1s ease; }
.viz-hover:hover { filter: brightness(1.25); }
.viz-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.viz-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.viz-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---- Command Center ---- */
.cc-bar {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: space-between;
  background: linear-gradient(135deg, #241322 0%, #12162b 60%), var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 22px; margin-bottom: 16px;
  box-shadow: 0 12px 34px rgba(0,0,0,.32);
}
.cc-status { display: flex; align-items: center; gap: 12px; }
.cc-clock { font-size: 15px; color: var(--cyan); font-weight: 700; }
.cc-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cc-layout { grid-template-columns: 1fr; } }
.cc-wall { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.cc-tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.cc-tile-video { position: relative; aspect-ratio: 16/9; background: #05070f; display: flex; align-items: center; justify-content: center; }
.feed-video { width: 100%; height: 100%; object-fit: cover; background: #05070f; display: block; }
.cc-tile-idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.cc-tile-glyph { font-size: 40px; opacity: .5; }
.cc-live-dot { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #d03b3b; box-shadow: 0 0 0 rgba(208,59,59,.6); animation: cc-pulse 1.6s infinite; }
.cc-live-dot.off { background: #616a84; animation: none; }
@keyframes cc-pulse { 0%{box-shadow:0 0 0 0 rgba(208,59,59,.5);} 70%{box-shadow:0 0 0 8px rgba(208,59,59,0);} 100%{box-shadow:0 0 0 0 rgba(208,59,59,0);} }
.cc-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 2px; }
.cc-tile-label { font-weight: 700; font-size: 13.5px; }
.cc-tile-meta { padding: 0 12px 8px; font-size: 12px; }
.cc-x { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.cc-x:hover { color: var(--red); background: var(--card-2); }
.cc-capture { display: flex; gap: 8px; padding: 0 12px 12px; }
.cc-note { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--input); color: var(--ink); font-size: 13px; }
.cc-flash { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(12,163,12,.92); color: #fff; font-size: 12.5px; font-weight: 600; text-align: center; padding: 6px 8px; }
.cc-tile { position: relative; }
.cc-side { position: sticky; top: 16px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.cc-scenes { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.cc-scene { display: flex; gap: 10px; align-items: center; }
.cc-scene-new { animation: cc-in .5s ease; }
@keyframes cc-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cc-scene-thumb { width: 68px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; }
.cc-scene-marker { background: var(--card-2); color: var(--yellow); font-size: 20px; }
.cc-scene-body { min-width: 0; }
.cc-scene-note { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cc-gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cc-shot { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.cc-shot img { display: block; width: 100%; height: 150px; object-fit: cover; background: #05070f; }
.cc-shot-marker { height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--card-2); color: var(--yellow); font-size: 34px; }
.cc-shot-marker span { font-size: 12px; color: var(--muted); }
.cc-shot figcaption { padding: 10px 12px; }
.cc-shot-note { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.cc-shot-hash { font-size: 10px; color: var(--muted); word-break: break-all; margin-top: 4px; }

/* ---- Command Center tactical map ---- */
.cc-map-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: stretch; }
@media (max-width: 900px) { .cc-map-wrap { grid-template-columns: 1fr; } }
#ccMap { height: 420px; border-radius: 12px; border: 1px solid var(--line); background: #05070f; z-index: 0; }
.leaflet-container { background: #0b0e1c; font-family: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--ink); }
.cc-units { display: flex; flex-direction: column; min-height: 0; }
.cc-units-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cc-unit-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.cc-unit-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; border: 1px solid rgba(255,255,255,.5); }
.cc-unit-list { overflow-y: auto; max-height: 200px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.cc-unit { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px dashed var(--line); }
.cc-unit-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.cc-unit-call { font-weight: 650; font-size: 13px; }
.cc-unit-actions { display: flex; gap: 4px; flex: none; }
.cc-mini { background: var(--card-2); border: 1px solid var(--line); color: var(--ink); border-radius: 6px; font-size: 10.5px; padding: 3px 7px; cursor: pointer; white-space: nowrap; }
.cc-mini:hover { border-color: var(--cyan); }
.cc-add-unit { border-top: 1px solid var(--line); padding-top: 10px; }
.cc-add-unit label { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 3px; }
.cc-add-unit input, .cc-add-unit select { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--input); color: var(--ink); font-size: 12.5px; }
.cc-pos-row { display: flex; gap: 6px; margin-top: 8px; }
.cc-pos-row input { flex: 1; min-width: 0; }

/* ---- Phone-relay feed tiles ---- */
.cc-relay-idle { gap: 6px; padding: 10px; }
.cc-qr { background: #fff; padding: 6px; border-radius: 8px; line-height: 0; }
.cc-qr img, .cc-qr canvas { display: block; }
.cc-relay-link { font-size: 10px; color: var(--muted); word-break: break-all; max-width: 92%; }
.cc-fallback { border-left: 4px solid var(--teal); }
img.feed-relay { object-fit: cover; }
.cc-relay-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 8px; }
.cc-relay-status { font-size: 12px; font-weight: 600; }
.cc-fs { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 6px; border-radius: 6px; margin-left: auto; }
.cc-fs:hover { color: var(--cyan); background: var(--card-2); }
.cc-tile-head .cc-tile-label { margin-right: 4px; }
.cc-tile-video:fullscreen { background: #000; }
.cc-tile-video:fullscreen .feed-video { object-fit: contain; }
.cc-clip-thumb { display:flex; align-items:center; justify-content:center; background:#05070f center/cover no-repeat; color:#fff; font-size:16px; text-shadow:0 1px 4px #000; text-decoration:none; }
.cc-clip-thumb:hover { text-decoration:none; }

/* ---- Scene log (Timeline) ---- */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.chip-toggle {
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip-toggle:hover { border-color: var(--cyan); }
.chip-toggle.active { background: var(--cyan); border-color: var(--cyan); color: #062a35; }
.scene-group { margin-bottom: 16px; }
.scene-group .section-title { margin-top: 0; }
.cc-shot { position: relative; }
.cc-shot-tag {
  position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 10px; font-weight: 700;
  letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; color: #fff; background: rgba(11,14,28,.8);
  border: 1px solid rgba(255,255,255,.15);
}
.cc-tag-video { color: #8fe2fb; } .cc-tag-photo { color: #cfe6ff; }
.cc-tag-audio { color: #ffdf91; } .cc-tag-marker { color: #ffab9d; }

/* ==== Modern theme: app shell and shared components ==== */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
* { scrollbar-color: #333a50 transparent; scrollbar-width: thin; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-weight: 650; letter-spacing: -.01em; }

/* App shell */
.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 12px; background: var(--chrome); border-right: 1px solid var(--line); overflow-y: auto;
}
.sidebar .brand { padding: 2px 8px; }
.sidebar .brand img { display: block; filter: brightness(0) invert(1); }
.sidenav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidenav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: #b4bbcf; font-size: 14px; font-weight: 500; transition: background .12s ease, color .12s ease;
}
.sidenav a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidenav a:hover { background: var(--card-2); color: #fff; text-decoration: none; }
.sidenav a.active { background: var(--accent-soft); color: var(--cyan); font-weight: 600; }
.side-user { border-top: 1px solid var(--line); padding: 14px 8px 2px; font-size: 12.5px; color: var(--muted); }
.side-user-name { display: block; margin-bottom: 9px; overflow-wrap: anywhere; color: #cfd5e6; }
.side-user form { margin: 0; }
.side-user .btn { width: 100%; }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-main .container { width: 100%; max-width: 1640px; flex: 1; padding: 24px 28px 44px; }
.app-main .sitefooter { width: 100%; max-width: 1640px; padding: 16px 28px; }

/* Cards and heroes */
.card { border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.dash-hero {
  padding: 18px 24px; border-radius: 16px; box-shadow: var(--shadow);
  background: linear-gradient(120deg, rgba(79,210,247,.13), rgba(111,217,203,.03) 48%, transparent 75%), var(--card);
}
.dash-hero-title { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.section-card { border-left: 1px solid var(--line); }
.prop-card, .phone-shell { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Stat tiles */
.stat { position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat.accent-cyan, .stat.accent-teal, .stat.accent-yellow, .stat.accent-red { border-top: 1px solid var(--line); }
.stat[class*="accent-"]::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--muted); }
.stat.accent-cyan::before { background: var(--cyan); }
.stat.accent-teal::before { background: var(--teal); }
.stat.accent-yellow::before { background: var(--yellow); }
.stat.accent-red::before { background: var(--red); }
.stat .num { font-size: 30px; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-link:hover { transform: translateY(-1px); }

/* Tables. table.grid is what the canvass pages use, and it must not take the page-grid display. */
table.grid { display: table; width: 100%; gap: 0; border-collapse: collapse; font-size: 14px; }
table.data, table.grid { font-variant-numeric: tabular-nums; }
table.data th, table.grid th {
  background: var(--card-2); color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: left;
  text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
table.data td, table.grid td { padding: 10px 12px; border-bottom: 1px solid rgba(38,44,63,.7); text-align: left; vertical-align: top; }
table.data th:first-child, table.grid th:first-child { border-top-left-radius: 9px; }
table.data th:last-child, table.grid th:last-child { border-top-right-radius: 9px; }
table.data tr:last-child td, table.grid tr:last-child td { border-bottom: none; }
table.data tr:hover td, table.grid tr:hover td { background: rgba(79,210,247,.05); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Buttons */
.btn { border-radius: 9px; padding: 8px 15px; line-height: 1.4; transition: background .12s ease, border-color .12s ease, color .12s ease; }
.btn-primary:hover, .btn-teal:hover, .btn-danger:hover { filter: brightness(.92); text-decoration: none; }
.btn-outline { background: var(--card-2); }
.btn-outline:hover { color: var(--cyan); }
.btn-ghost { border-color: var(--line); }
.btn-sm { border-radius: 8px; padding: 5px 11px; }

/* Forms */
.form-row label { color: #c5cbdc; font-size: 13px; }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=password],
.form-row input[type=date], .form-row input[type=number], .form-row input[type=search],
.form-row input[type=tel], .form-row input[type=url], .form-row input[type=datetime-local],
.form-row input[type=file], .form-row textarea, .form-row select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--input); color: var(--ink); font: inherit; font-size: 14px;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: #6d7690; }

/* Alerts, badges, and small parts */
.alert { border-radius: 11px; }
.badge { border-radius: 999px; }
.notice { border-radius: 11px; border-left-width: 3px; }
pre.log { border-radius: 11px; }
.reader-nav a.active { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Phones and small windows: the sidebar becomes a scrolling top bar */
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar {
    position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center;
    gap: 10px; padding: 8px 12px; border-right: none; border-bottom: 1px solid var(--line); overflow-x: auto;
  }
  .sidebar .brand { flex: none; padding: 0; }
  .sidebar .brand img { height: 30px; }
  .sidenav { flex-direction: row; }
  .sidenav a { white-space: nowrap; padding: 7px 10px; font-size: 13px; }
  .side-user { border-top: none; padding: 0; flex: none; }
  .side-user-name { display: none; }
  .app-main .container { padding: 16px 16px 36px; }
  .app-main .sitefooter { padding: 14px 16px; }
  dl.kv { grid-template-columns: 1fr; gap: 2px 0; }
  dl.kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
