:root {
  --bg: #0a1016;
  --bg-2: #0f161e;
  --panel: #121a22;
  --panel-2: #162029;
  --input: #0e151c;
  --text: #eef4f8;
  --muted: #8799a8;
  --accent: #3db8c5;
  --accent-bright: #5fd4df;
  --accent-dim: rgba(61, 184, 197, 0.14);
  --accent-line: rgba(61, 184, 197, 0.35);
  --female: #e8a4c0;
  --female-bright: #f3c4d6;
  --female-deep: #c45f8c;
  --female-dim: rgba(232, 164, 192, 0.14);
  --female-line: rgba(232, 164, 192, 0.42);
  --danger: #e05555;
  --ok: #3cb371;
  --line: #1c2834;
  --line-strong: #2a3a4a;
  --sev-low: #6b8a9e;
  --sev-medium: #c9a227;
  --sev-high: #e07a3d;
  --sev-critical: #e05555;
  --font: "DM Sans", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 8px;
  --radius-sm: 6px;
  --header-h: 3.35rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(720px 360px at 12% -8%, rgba(61, 184, 197, 0.07) 0%, transparent 55%),
    radial-gradient(900px 420px at 92% 0%, rgba(30, 70, 90, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, #0c131b 0%, var(--bg) 42%);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 12%, var(--line));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: 100%;
  box-sizing: border-box;
  isolation: isolate;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 1 auto;
  min-width: 0;
  text-decoration: none !important;
  color: var(--text) !important;
}
.brand-icon {
  flex: 0 0 auto;
  height: 2.15rem;
  width: auto;
  object-fit: contain;
}
.brand-name {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(0.72rem, 1.55vw, 0.92rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}
.brand-name em {
  font-style: normal;
  color: var(--accent);
  font-weight: 700;
}
.brand:hover {
  color: #fff !important;
  text-decoration: none !important;
}
.brand:hover .brand-name em { color: var(--accent-bright); }

/* Detect staging backlog meter (header desktop / Settings mobile) */
.staging-meter {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}
.staging-meter-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.staging-meter-label strong {
  color: var(--text);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
}
.staging-meter-rate {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent-bright);
  opacity: 0.92;
}
.staging-meter-rate[hidden] {
  display: none !important;
}
.staging-meter-track {
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-2) 70%, var(--line));
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.staging-meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--ok);
  transition: width 0.85s cubic-bezier(0.33, 1, 0.68, 1), background-color 0.35s ease;
  position: relative;
  overflow: hidden;
  will-change: width;
}
.staging-meter[data-level="ok"] .staging-meter-fill { background: var(--ok); }
.staging-meter[data-level="soft"] .staging-meter-fill { background: var(--sev-medium); }
.staging-meter[data-level="hard"] .staging-meter-fill { background: var(--danger); }

/* Processing: soft pulse + diagonal stripes while cleanups are flowing */
.staging-meter[data-processing="1"] .staging-meter-fill {
  animation: staging-fill-pulse 2.4s ease-in-out infinite;
}
.staging-meter[data-processing="1"] .staging-meter-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -55deg,
    transparent 0,
    transparent 0.28rem,
    rgba(255, 255, 255, 0.14) 0.28rem,
    rgba(255, 255, 255, 0.14) 0.55rem
  );
  background-size: 1.1rem 1.1rem;
  animation: staging-stripe-drift 0.9s linear infinite;
  pointer-events: none;
}
.staging-meter[data-processing="1"] .staging-meter-track::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 35%,
    color-mix(in srgb, var(--text) 18%, transparent) 50%,
    transparent 65%
  );
  background-size: 220% 100%;
  animation: staging-shimmer 2.2s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.55;
}
@keyframes staging-fill-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}
@keyframes staging-stripe-drift {
  from { background-position: 0 0; }
  to { background-position: 1.1rem 0; }
}
@keyframes staging-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -40% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .staging-meter-fill {
    transition: width 0.2s ease, background-color 0.2s ease;
  }
  .staging-meter[data-processing="1"] .staging-meter-fill,
  .staging-meter[data-processing="1"] .staging-meter-fill::after,
  .staging-meter[data-processing="1"] .staging-meter-track::after {
    animation: none;
  }
}

.staging-meter-help {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}
.header-meters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
  margin-right: 0.45rem;
  align-self: center;
}
.staging-meter--header {
  flex: 0 0 auto;
  width: 8.5rem;
  margin-left: 0;
  margin-right: 0;
  align-self: center;
}
.staging-meter--header .staging-meter-label {
  font-size: 0.62rem;
  gap: 0.22rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staging-meter--header .staging-meter-name::after {
  content: ":";
}
.staging-meter--header .staging-meter-label strong {
  font-size: 0.72rem;
  flex: 0 0 auto;
}
.staging-meter--header .staging-meter-rate {
  font-size: 0.6rem;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staging-meter--header .staging-meter-track {
  height: 0.3rem;
  flex: 0 0 auto;
}
.staging-meter-settings {
  display: none;
}
.staging-meter--settings {
  max-width: 22rem;
  min-width: 0;
}
.staging-meter--settings .staging-meter-label {
  min-width: 0;
  overflow: hidden;
  flex-wrap: wrap;
  white-space: normal;
}
.staging-meter--settings .staging-meter-track {
  height: 0.55rem;
}

/* Disk space meters (header desktop / Settings mobile) — same visual language */
.storage-meters {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  min-width: 0;
}
.storage-meter {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}
.storage-meter[hidden] {
  display: none !important;
}
.storage-meter-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.storage-meter-label strong {
  color: var(--text);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
}
.storage-meter-track {
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-2) 70%, var(--line));
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.storage-meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--ok);
  transition: width 0.85s cubic-bezier(0.33, 1, 0.68, 1), background-color 0.35s ease;
  position: relative;
  overflow: hidden;
  will-change: width;
}
.storage-meter[data-level="ok"] .storage-meter-fill { background: var(--ok); }
.storage-meter[data-level="warn"] .storage-meter-fill { background: var(--sev-medium); }
.storage-meter[data-level="critical"] .storage-meter-fill { background: var(--danger); }
.storage-meter-help {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}
.storage-meters--header {
  flex: 0 0 auto;
  gap: 0.55rem;
}
.storage-meters--header .storage-meter {
  flex: 0 0 auto;
  width: 3.7rem;
}
.storage-meters--header .storage-meter[data-storage-disk="raid"] {
  width: 4.4rem;
}
.storage-meters--header .storage-meter-label {
  font-size: 0.62rem;
  gap: 0.2rem;
  letter-spacing: 0.02em;
}
.storage-meters--header .storage-meter-label strong {
  font-size: 0.7rem;
  flex: 0 0 auto;
}
.storage-meters--header .storage-meter-track {
  height: 0.3rem;
  flex: 0 0 auto;
}
.storage-meter-settings {
  display: none;
}
.storage-meters--settings {
  flex-direction: column;
  gap: 0.85rem;
  max-width: 22rem;
  min-width: 0;
}
.storage-meters--settings .storage-meter {
  min-width: 0;
  overflow: hidden;
}
.storage-meters--settings .storage-meter-label {
  min-width: 0;
  overflow: hidden;
  flex-wrap: wrap;
  white-space: normal;
}
.storage-meters--settings .storage-meter-track {
  height: 0.55rem;
}
@media (prefers-reduced-motion: reduce) {
  .storage-meter-fill {
    transition: width 0.2s ease, background-color 0.2s ease;
  }
}
/* Mid desktop: keep OS/RAID readable; shed rate → storage → all before brand/nav collide */
@media (max-width: 1400px) and (min-width: 901px) {
  .staging-meter--header {
    width: 6.75rem;
  }
  .staging-meter--header .staging-meter-rate {
    display: none !important;
  }
}
@media (max-width: 1280px) and (min-width: 901px) {
  /* Disk meters move to Settings; staging stays compact in header */
  .storage-meters--header {
    display: none !important;
  }
  .staging-meter--header {
    width: 5.75rem;
  }
  .staging-meter--header .staging-meter-name {
    font-size: 0;
  }
  .staging-meter--header .staging-meter-name::before {
    content: "Stg";
    font-size: 0.62rem;
  }
  .staging-meter--header .staging-meter-name::after {
    font-size: 0.62rem;
  }
}
@media (max-width: 900px) {
  .header-meters {
    display: none !important;
  }
  .staging-meter--header {
    display: none !important;
  }
  .staging-meter-settings {
    display: block;
  }
  .storage-meter-settings {
    display: block;
  }
}

.ico {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.15em;
  stroke: currentColor;
}
.ico-sm {
  width: 0.85rem;
  height: 0.85rem;
}
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem 0.35rem;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.top-nav a {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.top-nav a:hover {
  color: var(--text);
  background: var(--accent-dim);
  text-decoration: none;
}
.account-ico {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
.account-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.building-strip a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.section-title,
.time-rail h2,
.improve h2,
.email-alert-panel h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.meta .opened {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.empty-state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.login-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}
.login-icon {
  display: block;
  margin: 0 auto 0.85rem;
  height: 5.5rem;
  width: auto;
}
.login-brand .eyebrow {
  justify-content: center;
  width: 100%;
}
.login-brand h1 {
  margin: 0.2rem 0 0;
  letter-spacing: 0.04em;
  font-size: 1.75rem;
}
.login-mark {
  display: block;
  margin: 0 auto;
  height: auto;
  width: min(240px, 78vw);
  border-radius: 8px;
}
.fb-status {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}
.tile-empty {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  height: 100%;
  color: var(--muted);
  font-size: 0.85rem;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.top-nav .nav-sep {
  width: 1px;
  height: 1rem;
  margin: 0 0.35rem;
  background: var(--line);
}
.nav-menu {
  position: relative;
}
.nav-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.nav-menu-btn:hover,
.nav-menu.is-open .nav-menu-btn,
.nav-menu.is-active .nav-menu-btn {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}
.nav-caret {
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.nav-menu.is-open .nav-caret {
  transform: rotate(180deg);
}
.nav-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 0.45rem);
  min-width: 11.5rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 40;
  display: grid;
  gap: 0.1rem;
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.nav-dropdown a:hover {
  background: rgba(255, 255, 255, 0.06);
}
.nav-dropdown a.is-current {
  color: var(--accent-bright);
  background: var(--accent-dim);
  box-shadow: inset 2px 0 0 var(--accent);
}
.top-nav > a.is-current {
  color: var(--accent-bright);
  background: var(--accent-dim);
}
.nav-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.nav-menu-btn .nav-count {
  color: var(--accent-bright);
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  min-width: 1.35rem;
  text-align: center;
  line-height: 1.25;
}
.account-menu {
  position: relative;
  margin-left: 0.15rem;
}
.account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1a2430;
  color: #c5d0dc;
  cursor: pointer;
}
.account-btn:hover,
.account-menu.is-open .account-btn {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.account-ico { display: block; }
.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 12.5rem;
  padding: 0.4rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 40;
  display: grid;
  gap: 0.15rem;
}
.account-meta {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem 0.65rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid var(--line);
}
.account-meta strong {
  font-size: 0.9rem;
  color: var(--text);
  text-transform: none;
}
.account-meta span {
  font-size: 0.72rem;
  color: var(--muted);
}
.account-dropdown a {
  display: block;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.account-dropdown a:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.account-dropdown a.danger-link {
  color: #ffb4b4;
}
.account-dropdown a.danger-link:hover {
  background: rgba(224, 85, 85, 0.14);
  color: #ffc9c9;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.top-nav .who {
  margin: 0;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: #1a2430;
  border: 1px solid var(--line);
  color: #b7c4d4;
  font-size: 0.75rem;
  font-weight: 600;
}
@media (max-width: 900px) {
  .top {
    flex-wrap: wrap;
    row-gap: 0.45rem;
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
    background: #0c1117;
  }
  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }
  .brand-name {
    font-size: 0.68rem;
  }
  .top-nav {
    flex: 1 1 100%;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 0.1rem;
    padding-bottom: 0.1rem;
  }
  .top-nav a {
    padding: 0.55rem 0.7rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    justify-content: center;
  }
  .top-nav a .ico {
    width: 1.35rem;
    height: 1.35rem;
  }
  .nav-menu-btn {
    padding: 0.55rem 0.7rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    justify-content: center;
  }
  .nav-menu-btn .ico {
    width: 1.35rem;
    height: 1.35rem;
  }
  .nav-menu-btn .nav-caret {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    opacity: 0.85;
  }
  /* Keep horizontal scroll, but let open menus escape the clip */
  .nav-menu.is-open,
  .account-menu.is-open {
    z-index: 60;
  }
  .nav-menu.is-open .nav-dropdown,
  .account-menu.is-open .account-dropdown {
    position: fixed;
    z-index: 70;
  }
  .top-nav .nav-female {
    font-size: 1.35rem;
    line-height: 1;
  }
  .top-nav .nav-label {
    display: inline;
    font-size: .65rem;
    white-space: nowrap;
  }
  .top-nav > a, .top-nav .nav-menu-btn {
    flex-direction: column;
    gap: .25rem;
  }
  .top-nav { scrollbar-color: #526673 #0c1117; }
  .top-nav .nav-menu-btn { position: relative; }
  .top-nav .nav-menu-btn .nav-caret { position: absolute; top: .25rem; right: .15rem; width: .6rem; height: .6rem; }
  .top-nav .nav-sep {
    display: none;
  }
  .top-nav .who {
    padding: 0.45rem 0.55rem;
    min-height: 2.75rem;
  }
  .top-nav .who .ico {
    width: 1.25rem;
    height: 1.25rem;
  }
  .account-btn {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    justify-content: center;
  }
  .account-ico {
    width: 1.4rem;
    height: 1.4rem;
  }
}
@media (max-width: 640px) {
  .brand {
    white-space: normal;
    line-height: 1.25;
  }
}

main {
  padding: 1.25rem 1.25rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}
main.wide { max-width: 1280px; }
main.case-main { max-width: 1400px; }
main.units-main {
  max-width: min(1680px, 98vw);
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}
.lede { color: var(--muted); max-width: 36rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.85rem; }
.err { color: #ff9a9a; }

.home-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.home-hero h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}
.page-title .ico,
.ico-lg {
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  display: block;
  overflow: visible;
}
.building-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: flex-start;
  position: relative;
  z-index: 30;
  overflow: visible;
}
.building-menu {
  position: relative;
  z-index: 1;
}
.building-menu.is-open {
  z-index: 80;
}
.building-main {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
  font-size: 0.85rem;
  text-decoration: none;
  position: relative;
  z-index: 1;
}
.building-menu.is-open .building-main,
.building-menu:focus-within .building-main {
  border-color: var(--accent);
  text-decoration: none;
}
.building-flyout {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 90;
  min-width: max(100%, 10.5rem);
  padding: 0.3rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  flex-direction: column;
  gap: 0.15rem;
}
.building-menu.is-open .building-flyout {
  display: flex;
}
/* On narrow screens, keep the menu above everything and avoid clipping */
@media (max-width: 720px) {
  .home-hero {
    overflow: visible;
    position: relative;
    /* Stay below sticky .top (z-index 100) so page title never covers the nav */
    z-index: 1;
  }
  .building-menu.is-open .building-flyout {
    position: absolute;
    left: 0;
    right: auto;
    min-width: 12rem;
  }
}
.building-flyout a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
  min-height: 2.5rem;
  position: relative;
  z-index: 1;
}
.building-flyout a:hover,
.building-flyout a:active {
  background: var(--accent-dim);
  color: #fff;
  text-decoration: none;
}

/* Desktop: hover opens menu; click on chip still goes to Units 1–4 */
@media (hover: hover) and (pointer: fine) {
  .building-menu:hover {
    z-index: 80;
  }
  .building-menu::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 0.55rem;
    display: none;
  }
  .building-menu:hover::after,
  .building-menu.is-open::after {
    display: block;
  }
  .building-menu:hover .building-main {
    border-color: var(--accent);
    text-decoration: none;
  }
  .building-menu:hover .building-flyout {
    display: flex;
  }
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.case-tile-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.case-tile-wrap .case-tile {
  flex: 1;
}
.case-tile-wrap.has-reopen .case-tile,
.case-tile-wrap.has-entryway .case-tile {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.tile-reopen-form {
  margin: 0;
}
.tile-reopen-btn,
.tile-entryway-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: rgba(40, 70, 55, 0.4);
  color: #cfe6d8;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  min-height: 2.75rem;
  transition: background 0.12s ease, color 0.12s ease;
}
.tile-entryway-btn {
  background: rgba(45, 55, 75, 0.45);
  color: #cdd6e8;
}
.tile-reopen-btn:hover {
  background: rgba(60, 110, 85, 0.7);
  color: #eafff2;
}
.tile-entryway-btn:hover {
  background: rgba(70, 85, 120, 0.7);
  color: #eef2ff;
  text-decoration: none;
}
.tile-reopen-btn:focus-visible,
.tile-entryway-btn:focus-visible {
  outline: 2px solid #9fd4b0;
  outline-offset: -2px;
}
.tile-entryway-btn:focus-visible {
  outline-color: #a8b8e0;
}
.tile-reopen-btn .ico,
.tile-entryway-btn .ico {
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0.85;
}
.case-tile {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.case-tile:hover {
  border-color: var(--accent-line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
  text-decoration: none;
}
.case-tile.dim { opacity: 0.55; }
.tile-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
}
.tile-media img,
.tile-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile-media .tile-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: opacity 0.15s ease;
  background: #0a0e14;
}
.tile-media .tile-preview {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}
.case-tile.is-previewing .tile-preview {
  opacity: 1;
  z-index: 2;
}
.case-tile.is-previewing .tile-poster {
  opacity: 0;
  pointer-events: none;
}
/* Hover preview must never show native chrome over status chips */
.case-tile video.tile-preview::-webkit-media-controls {
  display: none !important;
}
.case-tile video.tile-preview::-webkit-media-controls-enclosure {
  display: none !important;
}
.tile-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
}
.tile-body { padding: 0.75rem 0.85rem 1rem; }
.tile-body h2 { margin: 0; font-size: 1rem; }
.tile-body p {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta .opened { color: #b7c4d4; }
.tile-body .meta { font-size: 0.78rem; color: var(--muted); }

.sev {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--line-strong);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
/* Case grid overlays: severity TL · status TR · reason BL (keep clear of hover chrome) */
.tile-status {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  max-width: min(11rem, calc(100% - 0.9rem));
  pointer-events: none;
}
.tile-status-tl {
  top: 0.45rem;
  left: 0.45rem;
  right: auto;
  bottom: auto;
  align-items: flex-start;
}
.tile-status-tr {
  top: 0.45rem;
  right: 0.45rem;
  left: auto;
  bottom: auto;
  align-items: flex-end;
}
.tile-status-bl {
  top: auto;
  right: auto;
  bottom: 0.45rem;
  left: 0.45rem;
  align-items: flex-start;
}
.tile-status .sev,
.tile-status .tile-verdict,
.tile-status .tile-alert,
.tile-status .badge-new,
.tile-status .badge-filed {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  z-index: auto;
  max-width: 100%;
}
.tile-status .sev {
  background: rgba(10, 14, 20, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.tile-media .sev {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 3;
}
.tile-media .tile-status .sev {
  position: static;
  top: auto;
  left: auto;
}
.tile-chips {
  position: absolute;
  bottom: 0.45rem;
  left: 0.45rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  max-width: calc(100% - 0.9rem);
  pointer-events: none;
}
.tile-alert {
  position: static;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  background: rgba(8, 12, 18, 0.88);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem;
  line-height: 1;
  max-width: 100%;
}
.tile-alert .k {
  color: inherit;
  text-transform: lowercase;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-alert.alert-softalert .k,
.tile-alert.alert-prealert .k {
  text-transform: none;
}
.tile-alert .alert-ico {
  width: 0.95rem;
  height: 0.95rem;
}

.badge-new {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.45rem;
  border-radius: 4px;
  background: #e8b84a;
  color: #1a1408;
}
.badge-filed {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.45rem;
  border-radius: 4px;
  background: rgba(107, 138, 158, 0.85);
  color: #e8f0f5;
}
.tile-verdict {
  position: static;
  z-index: auto;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: rgba(20, 28, 36, 0.82);
  color: #d7e2ea;
}
.tile-verdict.verdict-waiting { background: rgba(107, 138, 158, 0.9); }
.tile-verdict.verdict-hold { background: rgba(180, 120, 40, 0.92); color: #fff8e8; }
.tile-verdict.verdict-veto { background: rgba(140, 70, 70, 0.92); }
.tile-verdict.verdict-open { background: rgba(50, 120, 80, 0.9); }
.tile-blurb {
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0.25rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc-block { margin: 0.65rem 0; }
.desc-label {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8aa0b0;
}
.verdict-chip {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}
.verdict-chip.verdict-hold { color: #e0b060; }
.verdict-chip.verdict-veto { color: #e08888; }
.verdict-chip.verdict-waiting { color: #9bb0c0; }
.verdict-chip.verdict-open { color: #7cbc8e; }
.case-tile.is-new {
  border-color: rgba(232, 184, 74, 0.55);
}
.case-tile.is-filed {
  border-color: rgba(107, 138, 158, 0.45);
}
.home-case-filter {
  margin: 0.75rem 0 0.35rem;
}
.closed-filters {
  display: grid;
  gap: 0.45rem;
  margin: 0.65rem 0 0.25rem;
}
.closed-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.closed-filter-label {
  min-width: 2.6rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.sev-low { background: rgba(20, 28, 36, 0.92); color: #c5d6e2; box-shadow: inset 0 0 0 1px rgba(107, 138, 158, 0.45); }
.sev-medium { background: rgba(36, 28, 8, 0.92); color: #f0d78c; box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.5); }
.sev-high { background: rgba(40, 22, 10, 0.92); color: #ffc39a; box-shadow: inset 0 0 0 1px rgba(224, 122, 61, 0.5); }
.sev-critical { background: rgba(42, 14, 14, 0.92); color: #ffb4b4; box-shadow: inset 0 0 0 1px rgba(224, 85, 85, 0.5); }

.case-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.case-banner h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  max-width: 40rem;
}
.banner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
  color: var(--muted);
}
.case-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.viewer-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(18, 25, 32, 0.65);
}
.case-activity {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(18, 25, 32, 0.65);
}
.case-activity-summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}
.case-activity-summary::-webkit-details-marker {
  display: none;
}
.case-activity-summary::before {
  content: "▸ ";
  color: var(--muted);
  font-weight: 500;
}
.case-activity[open] > .case-activity-summary::before {
  content: "▾ ";
}
.case-activity[open] {
  gap: 0.65rem;
}
.case-activity:not([open]) {
  padding: 0.45rem 0.75rem;
}
.case-activity .activity-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.viewer-when {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 0.15rem;
}
.tile-activity {
  display: grid;
  gap: 0.2rem;
  margin: 0.35rem 0 0.15rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #c5d0dc;
}
.tile-activity-line strong {
  color: var(--text);
  font-weight: 700;
}
.viewer-strip-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  flex: 0 0 auto;
}
.viewer-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.viewer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem 0.28rem 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  line-height: 1;
  color: var(--muted);
}
.viewer-chip.is-opened {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: #d8ecff;
}
.viewer-chip.is-pending {
  opacity: 0.72;
  border-style: dashed;
}
.viewer-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #c8d8e8;
}
.viewer-chip.is-opened .viewer-initials {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  color: #081018;
}
.viewer-check {
  font-size: 0.7rem;
  color: #8dffc3;
  font-weight: 700;
}
.viewer-name {
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-recips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.75rem;
}
.email-recip-chip {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.unit-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.15rem;
  font-size: 0.88rem;
}
.unit-crumb a {
  color: var(--muted);
  text-decoration: none;
}
.unit-crumb a:hover {
  color: var(--text);
}
.unit-crumb .is-here {
  color: var(--text);
  font-weight: 600;
}
.unit-crumb-sep {
  color: var(--muted);
  opacity: 0.55;
}
.unit-picker-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}
.unit-tile-grid {
  display: grid;
  gap: 0.75rem;
}
.unit-tile-buildings {
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}
.unit-tile-units {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 28rem;
}
/* Desktop Units index: one full-width row of 8 units per building */
.unit-picker-desktop-all .unit-tile-units,
main.units-main .unit-picker .unit-tile-units {
  max-width: none;
  width: 100%;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .unit-picker-desktop-all .unit-tile-units,
  main.units-main .unit-picker .unit-tile-units {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .unit-tile-units {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.unit-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-height: 5.5rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.unit-tile:hover,
.unit-tile:focus-visible {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  outline: none;
}
.unit-tile:active {
  transform: scale(0.98);
}
.unit-tile-num {
  align-items: center;
  text-align: center;
  min-height: 5.25rem;
  padding: 0.75rem 0.5rem;
}
.unit-tile-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.unit-tile-main {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
}
.unit-tile-num .unit-tile-main {
  font-size: 1.75rem;
}
.unit-vacancy-legend {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.82rem;
}
.unit-le-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.unit-le-toolbar .ghost.is-on,
.unit-le-day.is-on {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: var(--accent-bright);
}
.unit-le-badge {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #9ec6ff;
}
.unit-tile-le {
  border-color: var(--accent-line);
  box-shadow: inset 0 0 0 1px rgba(61, 184, 197, 0.2);
}
.unit-tile.unit-le-mode.vacancy-likely-empty,
.unit-tile.unit-le-mode.vacancy-possibly-empty,
.unit-tile.unit-le-mode.vacancy-likely-occupied {
  opacity: 0.92;
}
.unit-building-block {
  margin: 0 0 1.5rem;
}
.unit-building-block .unit-picker-title {
  margin-bottom: 0.55rem;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.unit-le-building-total {
  font-size: 0.85rem;
}
.unit-le-empty {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.unit-picker-desktop-all {
  width: 100%;
}
.unit-building-block .unit-picker-title a {
  color: inherit;
  text-decoration: none;
}
.unit-building-block .unit-picker-title a:hover {
  color: #9ec6ff;
}
/* Desktop: expand all units; Mobile: building drill-down */
.unit-picker-desktop-all { display: none; }
@media (min-width: 900px) {
  .unit-picker-mobile { display: none; }
  .unit-picker-desktop-all { display: block; }
}
.vacancy-swatch {
  font-weight: 600;
}
.vacancy-swatch.vacancy-likely-empty { color: #e8a04a; }
.vacancy-swatch.vacancy-possibly-empty { color: #c9b06a; }
.vacancy-swatch.vacancy-likely-occupied { color: #6fb38a; }
.unit-tile.vacancy-likely-empty {
  border-color: rgba(232, 160, 74, 0.45);
  background: linear-gradient(160deg, rgba(232, 160, 74, 0.12), rgba(255, 255, 255, 0.02));
}
.unit-tile.vacancy-possibly-empty {
  border-color: rgba(201, 176, 106, 0.4);
  background: linear-gradient(160deg, rgba(201, 176, 106, 0.1), rgba(255, 255, 255, 0.02));
}
.unit-tile.vacancy-likely-occupied {
  border-color: rgba(111, 179, 138, 0.4);
  background: linear-gradient(160deg, rgba(111, 179, 138, 0.1), rgba(255, 255, 255, 0.02));
}
.unit-tile.vacancy-likely-empty .unit-tile-main { color: #e8a04a; }
.unit-tile.vacancy-possibly-empty .unit-tile-main { color: #d4c07a; }
.unit-tile.vacancy-likely-occupied .unit-tile-main { color: #7fc49a; }
.unit-vacancy-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.unit-tile.vacancy-likely-empty .unit-vacancy-tag { color: #e8a04a; }
.unit-tile.vacancy-possibly-empty .unit-vacancy-tag { color: #c9b06a; }
.unit-tile.vacancy-likely-occupied .unit-vacancy-tag { color: #6fb38a; }
.unit-vacancy-note {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  max-width: none;
}
.unit-vacancy-note.vacancy-likely-empty {
  border-color: rgba(232, 160, 74, 0.4);
  background: rgba(232, 160, 74, 0.08);
}
.unit-vacancy-note.vacancy-possibly-empty {
  border-color: rgba(201, 176, 106, 0.35);
  background: rgba(201, 176, 106, 0.07);
}
.unit-vacancy-note.vacancy-likely-occupied {
  border-color: rgba(111, 179, 138, 0.35);
  background: rgba(111, 179, 138, 0.07);
}
.unit-vacancy-note-title {
  margin: 0;
  font-size: 0.95rem;
}
.unit-vacancy-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.unit-open-case {
  margin: 0.35rem 0 0;
}
.unit-open-case-btn,
.open-case-form button {
  font-size: 0.82rem;
}
.open-case-form {
  margin: 0.65rem 0 0;
}
.building-open-case {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 0.85rem 0 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}
.building-open-case-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.75rem;
  margin: 0;
  flex: 1 1 16rem;
}
.building-open-case-note {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 14rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.building-open-case-note input {
  font: inherit;
  font-size: 0.95rem;
  color: var(--text, #e8eef4);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  min-height: 2.4rem;
}
.building-open-case-form button[type="submit"] {
  font-size: 0.9rem;
  min-height: 2.4rem;
  padding: 0.45rem 0.9rem;
}
.building-case-link {
  margin: 0;
  font-size: 0.85rem;
  flex: 1 1 100%;
}
.unit-vacancy-reasons {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.unit-vacancy-reasons li { margin: 0.15rem 0; }
.unit-tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.unit-tile-num .unit-tile-meta {
  justify-content: center;
  min-height: 0.7rem;
}
.unit-tile-meta .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  display: inline-block;
}
.dot-filed { background: var(--accent); }
.dot-maint { background: #f0c45c; }
.dot-sensor { background: #8bb4c8; }
.unit-picker-back {
  margin: 1rem 0 0;
  font-size: 0.88rem;
}
.unit-video-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.45rem;
}
.unit-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}
.unit-filter-chip.active {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-dim);
  font-weight: 600;
}
.unit-filter-help {
  margin: 0 0 1rem;
  font-size: 0.82rem;
}
.unit-player.unit-review {
  margin: 0 0 1rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0a0e14;
}
.unit-player-host:empty {
  display: none;
}
.nearby-clips .unit-player.unit-review,
.unit-tl-body > .unit-player.unit-review {
  margin-top: 0.65rem;
}
.unit-review-stage {
  position: relative;
  background: #000;
}
.unit-review-stage video {
  display: block;
  width: 100%;
  max-height: min(72vh, 720px);
  min-height: min(42vh, 360px);
  object-fit: contain;
  background: #000;
}
.unit-review-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.7rem 0.9rem;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.unit-review-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  font-size: 0.88rem;
  min-width: 0;
}
.unit-review-status strong {
  color: var(--text);
}
.unit-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
@media (max-width: 640px) {
  .unit-review-stage video {
    max-height: min(55vh, 480px);
    min-height: 220px;
  }
}
.unit-tl-thumb.is-playing {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nearby-clips.is-reviewing {
  border-top-color: var(--accent-line);
}
.unit-timeline {
  margin: 0.5rem 0 2rem;
}
.unit-day {
  margin-bottom: 1.35rem;
}
.unit-day-label {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}
.unit-day-events {
  list-style: none;
  margin: 0;
  padding: 0;
}
.unit-tl {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.65rem;
  position: relative;
}
.unit-tl + .unit-tl {
  margin-top: 0.15rem;
}
.unit-tl-rail {
  position: relative;
  display: flex;
  justify-content: center;
}
.unit-tl-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
}
.unit-tl:first-child .unit-tl-rail::before {
  top: 0.85rem;
}
.unit-tl:last-child .unit-tl-rail::before {
  bottom: calc(100% - 0.85rem);
}
.unit-tl-dot {
  position: relative;
  z-index: 1;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.7rem;
  border-radius: 50%;
  background: #8bb4c8;
  box-shadow: 0 0 0 3px rgba(12, 17, 23, 0.9);
}
.unit-tl-filed_case .unit-tl-dot { background: var(--accent); }
.unit-tl-maintenance .unit-tl-dot { background: #f0c45c; }
.unit-tl-sensor .unit-tl-dot { background: #8bb4c8; }
.unit-tl-video .unit-tl-dot { background: #7d8a96; }
.unit-tl-body {
  padding-bottom: 0.85rem;
  min-width: 0;
}
.unit-tl-when {
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
  font-variant-numeric: tabular-nums;
}
.unit-tl-card {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(18, 25, 32, 0.55);
}
.unit-tl-card.unit-tl-card-text {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 560px) {
  .unit-tl-card:not(.unit-tl-card-text) {
    grid-template-columns: 5.5rem 1fr;
  }
}
.unit-tl-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}
.unit-tl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.unit-tl-play {
  position: absolute;
  inset: auto auto 0.35rem 0.35rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}
.unit-tl-copy h4 {
  margin: 0.2rem 0 0.25rem;
  font-size: 0.95rem;
  line-height: 1.25;
}
.unit-tl-copy p {
  margin: 0.15rem 0;
  font-size: 0.82rem;
}
.unit-tl-maint-task,
.unit-tl-maint-notes,
.unit-tl-longtext-preview {
  margin: 0.3rem 0 0;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.unit-tl-maint-notes {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.88rem;
}
.unit-tl-maint-notes-label {
  display: inline-block;
  margin-right: 0.28rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.unit-tl-meta {
  margin-top: 0.35rem !important;
}
.unit-tl-maint-mobile {
  display: none;
}
.unit-tl-longtext {
  margin: 0.25rem 0 0.1rem;
  width: 100%;
}
.unit-tl-longtext > summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  gap: 0.3rem;
  width: 100%;
}
.unit-tl-longtext > summary::-webkit-details-marker {
  display: none;
}
.unit-tl-longtext-preview {
  display: block;
  max-height: 4.5em;
  overflow: hidden;
}
.unit-tl-longtext[open] > summary .unit-tl-longtext-preview {
  display: none;
}
.unit-tl-longtext-more {
  font-size: 0.78rem;
  font-weight: 600;
  color: #8ec7ff;
}
.unit-tl-longtext-hide {
  display: none;
}
.unit-tl-longtext[open] .unit-tl-longtext-show {
  display: none;
}
.unit-tl-longtext[open] .unit-tl-longtext-hide {
  display: inline;
}
.unit-tl-longtext-body {
  margin-top: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.55);
  max-height: min(55vh, 24rem);
  overflow: auto;
  width: 100%;
  box-sizing: border-box;
}
.nearby-clips-fold > summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
}
.nearby-clips-fold > summary::-webkit-details-marker {
  display: none;
}
.nearby-clips-fold > summary::after {
  content: " ▾";
  font-size: 0.75em;
}
.nearby-clips-fold[open] > summary::after {
  content: " ▴";
}
@media (max-width: 900px) {
  .unit-tl-maint-desktop {
    display: none !important;
  }
  .unit-tl-maint-mobile {
    display: block !important;
    width: 100%;
  }
  main:has(.unit-timeline) {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }
  .unit-tl-maintenance {
    display: block;
  }
  .unit-tl-maintenance .unit-tl-rail {
    display: none;
  }
  .unit-tl-maintenance .unit-tl-body {
    width: 100%;
    max-width: 100%;
  }
  .unit-tl-maintenance .unit-tl-card-text {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.7rem;
  }
  .unit-tl-maintenance .unit-tl-copy {
    width: 100%;
    max-width: 100%;
  }
  .nearby-clips-fold:not([open]) .nearby-clip-rail {
    display: none;
  }
}
@media (min-width: 901px) {
  .nearby-clips-fold > summary {
    pointer-events: none;
  }
  .nearby-clips-fold > summary::after {
    display: none;
  }
  .nearby-clips-fold .nearby-clip-rail {
    display: flex;
  }
}
.unit-tl-badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}
.unit-tl-badge-filed {
  color: #9ecfff;
  border-color: var(--accent-line);
}
.unit-tl-badge-maint {
  color: #f0c45c;
  border-color: rgba(240, 196, 92, 0.4);
}
.unit-tl-badge-sensor {
  color: #a8c8d6;
  border-color: rgba(139, 180, 200, 0.4);
}
.leak-cause {
  margin-top: 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.leak-cause-label {
  margin: 0 0 0.4rem;
}
.leak-cause-saved {
  margin: 0.4rem 0 0;
  color: var(--text);
}
.leak-cause-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.leak-cause-form {
  display: inline;
  margin: 0;
}
.leak-cause-btn {
  font-size: 0.85rem;
  min-height: 2.25rem;
}
.leak-cause-btn.is-active {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: #d6ebff;
}
.leak-cause-other {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
  max-width: 26rem;
}
.leak-cause-other[hidden] {
  display: none !important;
}
.unit-tl-badge-female {
  color: var(--female-bright);
  border-color: var(--female-line);
  background: var(--female-dim);
}
.unit-tl-badge-female-apparent {
  color: color-mix(in srgb, var(--female) 75%, var(--muted));
  border-color: color-mix(in srgb, var(--female) 35%, transparent);
  border-style: dashed;
  background: color-mix(in srgb, var(--female) 8%, transparent);
  font-style: italic;
}
.unit-tl-female-mark {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  z-index: 2;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.15rem 0.28rem;
  border-radius: 4px;
  background: var(--female-deep);
  color: #fff;
}
.unit-tl-female-mark.is-apparent {
  background: color-mix(in srgb, var(--female-deep) 55%, #3a2a35);
  font-size: 0.68rem;
  letter-spacing: -0.02em;
}
.unit-tl-card.has-female {
  border-color: var(--female-line);
}
.unit-tl-card.has-female-apparent {
  border-color: color-mix(in srgb, var(--female) 32%, transparent);
  border-style: dashed;
}
.unit-summary {
  margin-bottom: 1rem;
}
.unit-summary-head {
  display: flex;
  flex-direction: column;
  gap: 0.45rem 1.5rem;
  margin-bottom: 0.15rem;
}
.unit-summary-identity h2 {
  margin: 0 0 0.35rem;
}
.unit-summary-meta {
  margin: 0;
}
.unit-summary-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
  min-width: 0;
}
.unit-summary-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}
.unit-climate {
  margin: 0;
  font-size: 0.95rem;
}
.unit-climate-label {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (min-width: 900px) {
  .unit-summary-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
  .unit-summary-head .unit-climate {
    flex: 0 0 auto;
    text-align: right;
    line-height: 1.35;
  }
  .unit-summary-grid.has-side.has-climate {
    display: grid;
    grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr);
    gap: 0.9rem 1.35rem;
    align-items: stretch;
  }
  .unit-summary-grid.has-side.has-climate .unit-climate-panel {
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }
  .unit-summary-grid.has-side.has-climate .unit-climate-chart.is-detail {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
.unit-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.unit-card .unit-tile {
  height: 100%;
}
.unit-climate-chart {
  margin: 0;
  padding: 0.35rem 0.4rem 0.3rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 14, 18, 0.55);
}
.unit-climate-chart.is-rh-high {
  background: rgba(140, 28, 28, 0.55);
  border-color: rgba(220, 70, 70, 0.45);
}
.unit-climate-chart.is-spark {
  padding: 0.28rem 0.35rem 0.22rem;
}
.unit-climate-chart.is-detail {
  margin-top: 0;
  padding: 0.65rem 0.75rem 0.55rem;
}
.unit-climate-panel {
  margin: 0;
  max-width: none;
  min-width: 0;
}
.unit-climate-panel-title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.unit-climate-svg {
  display: block;
  width: 100%;
  height: auto;
}
.unit-climate-rh-threshold {
  stroke: rgba(255, 120, 120, 0.85);
  stroke-width: 1.25;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}
.unit-climate-chart.is-rh-high .unit-climate-rh-threshold {
  stroke: rgba(255, 200, 200, 0.95);
}
.unit-climate-rh {
  stroke: #5eb8e8;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.unit-climate-temp {
  stroke: #e8a04a;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
}
.unit-climate-chart.is-detail .unit-climate-rh,
.unit-climate-chart.is-detail .unit-climate-temp {
  stroke-width: 2;
}
.unit-climate-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.unit-climate-key {
  font-variant-numeric: tabular-nums;
}
.unit-climate-key-rh { color: #5eb8e8; }
.unit-climate-key-temp { color: #e8a04a; }
.unit-climate-key-threshold {
  color: rgba(255, 140, 140, 0.9);
}
.unit-climate-high-flag {
  color: #ffb4b4;
  font-weight: 600;
}
.unit-leak-status {
  margin: 0;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.25;
}
.unit-leak-status.is-compact {
  padding: 0.22rem 0.35rem;
  justify-content: center;
  text-align: center;
}
.unit-leak-status.is-detail {
  margin: 0;
  padding: 0.55rem 0.7rem;
  max-width: none;
  font-size: 0.95rem;
  align-items: center;
  gap: 0.25rem 0.65rem;
}
.unit-leak-status.is-wet {
  border-color: rgba(220, 70, 70, 0.45);
  background: rgba(140, 28, 28, 0.45);
}
.unit-leak-status.is-dry {
  border-color: rgba(111, 179, 138, 0.28);
  background: rgba(111, 179, 138, 0.08);
}
.unit-leak-kicker {
  display: inline-block;
  margin-right: 0.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #9aa3ad);
}
.unit-leak-state {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.unit-leak-status.is-wet .unit-leak-state {
  color: #ffb4b4;
}
.unit-leak-status.is-dry .unit-leak-state {
  color: #7fc49a;
}
.unit-leak-status.is-detail .unit-leak-state {
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.unit-leak-when {
  font-size: 0.68rem;
}
.unit-leak-status.is-detail .unit-leak-when {
  font-size: 0.82rem;
  margin-left: auto;
}
.unit-leak-status.is-compact.is-dry .unit-leak-when {
  display: none;
}
.unit-leak-status.is-compact.is-wet .unit-leak-when {
  width: 100%;
  text-align: center;
  font-size: 0.62rem;
  opacity: 0.9;
}
.unit-leak-panel {
  margin: 0;
  max-width: none;
  padding: 0.7rem 0.8rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 25, 32, 0.45);
}
.unit-leak-panel-title {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.unit-leak-panel .unit-leak-status.is-detail {
  margin-top: 0;
}
.unit-leak-dots {
  margin: 0.2rem 0 0;
}
.unit-leak-dots.is-compact {
  padding: 0.12rem 0.2rem 0.05rem;
}
.unit-leak-dots.is-detail {
  margin-top: 0.55rem;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}
.unit-leak-dots-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin: 0 0 0.35rem;
}
.unit-leak-dots-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text, #e8eef4);
}
.unit-leak-dots-axis {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.unit-leak-dot-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  width: 100%;
}
.unit-leak-dots.is-detail .unit-leak-dot-row {
  gap: 3px;
  justify-content: space-between;
}
.unit-leak-dot {
  flex: 1 1 0;
  min-width: 4px;
  max-width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(154, 163, 173, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.unit-leak-dots.is-detail .unit-leak-dot {
  flex: 1 1 0;
  width: auto;
  min-width: 8px;
  max-width: 12px;
}
.unit-leak-dot.is-dry {
  background: #6fb38a;
  box-shadow: none;
}
.unit-leak-dot.is-wet {
  background: #e86a6a;
  box-shadow: 0 0 0 1px rgba(232, 106, 106, 0.55);
}
.unit-leak-dots.is-detail .unit-leak-dot.is-wet {
  max-width: 13px;
  background: #f07171;
  box-shadow: 0 0 0 1px rgba(240, 113, 113, 0.7);
}
.unit-leak-dot.is-unknown {
  background: rgba(154, 163, 173, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.unit-leak-dots-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  margin: 0.45rem 0 0;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  line-height: 1.3;
}
.unit-leak-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
}
.unit-leak-dot-swatch {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: rgba(154, 163, 173, 0.28);
}
.unit-leak-dot-swatch.is-dry { background: #6fb38a; }
.unit-leak-dot-swatch.is-wet {
  background: #f07171;
  box-shadow: 0 0 0 1px rgba(240, 113, 113, 0.55);
}
.unit-leak-dot-swatch.is-unknown { background: rgba(154, 163, 173, 0.22); }
.unit-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.unit-add-panel {
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(18, 25, 32, 0.45);
  max-width: 28rem;
}
.unit-add-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.unit-add-panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
}
.unit-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.nearby-clips {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.nearby-clips.is-reviewing {
  border-top-color: var(--accent-line);
}
.nearby-clip-rail {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.45rem 0 0.25rem;
  -webkit-overflow-scrolling: touch;
}
.unit-tl-thumb-sm {
  flex: 0 0 5.5rem;
  width: 5.5rem;
  aspect-ratio: 16 / 10;
}
.unit-tl-sm-time {
  position: absolute;
  left: 0.25rem;
  bottom: 0.25rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}
.unit-tl-sm-24 {
  font-size: 0.55rem;
  opacity: 0.7;
}
.review-jump-ampm {
  color: var(--text);
  font-weight: 600;
}
.review-jump-24 {
  font-size: 0.75em;
  opacity: 0.65;
}
.unit-main-tl {
  margin-top: 0.25rem;
}
.unit-tl-insert {
  list-style: none;
  margin: 0.35rem 0;
}
.unit-tl-insert .unit-tl-card {
  margin: 0;
}
.unit-tl-insert-when {
  margin-left: 0.35rem;
  font-size: 0.8rem;
}
.unit-tl-rel {
  color: var(--muted);
  font-weight: 500;
}
.unit-tl-card-pin {
  border-color: rgba(240, 196, 92, 0.45);
  box-shadow: inset 3px 0 0 #f0c45c;
}
.unit-main-row.is-playing,
.unit-main-row.is-active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.unit-nearby-thumb.is-playing {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.filed-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.filed-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.filed-row:hover {
  border-color: var(--accent-line);
}
.filed-row strong {
  display: block;
}
.filed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.filed-links {
  margin: 0 0 0.75rem 0.9rem;
  font-size: 0.85rem;
}
.setting-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.setting-check input[type="checkbox"] {
  margin: 0.2rem 0 0;
  flex: 0 0 auto;
}
.setting-check .setting-label {
  margin: 0;
  line-height: 1.35;
}
.setting-field.setting-check {
  /* Checkbox rows are flex, not the default setting-field grid */
  display: flex;
  grid-template-columns: none;
}
.sms-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.sms-type-chip {
  margin: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  cursor: pointer;
}
.sms-type-chip:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-dim);
}
.sms-type-chip input {
  margin: 0;
}
.sms-profile {
  margin: 0.85rem 0 1.1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.sms-profile-add {
  border-style: dashed;
  opacity: 0.95;
}
.sms-profile-meta {
  display: grid;
  grid-template-columns: minmax(7rem, 0.9fr) minmax(9rem, 1.2fr) minmax(7rem, 0.8fr);
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
}
@media (max-width: 720px) {
  .sms-profile-meta {
    grid-template-columns: 1fr;
  }
}
.case-actions form { margin: 0; }
.email-alert-panel {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  gap: 0.65rem;
}
.delivery-fieldset {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 0.35rem;
}
.delivery-fieldset legend {
  padding: 0 0.25rem;
  font-size: 0.8rem;
  color: var(--muted, #9aa3ad);
}
.delivery-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  cursor: pointer;
}
.delivery-option input {
  margin-top: 0.2rem;
}
.emergency-recips {
  display: grid;
  gap: 0.4rem;
}
.emergency-recip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.emergency-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}
.emergency-chip input {
  margin: 0;
}
.hold-approve-panel {
  margin-top: 0.75rem;
}
.triage-panel {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  gap: 0.65rem;
}
.triage-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}
.triage-hint {
  margin: 0;
  font-size: 0.82rem;
}
.triage-form {
  display: grid;
  gap: 0.75rem;
}
.triage-fieldset {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.triage-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.triage-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.35rem 0.75rem;
}
.triage-check {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.3;
  cursor: pointer;
}
.triage-check input {
  margin-top: 0.15rem;
}
.triage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.triage-chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent-dim);
  color: #c5daf0;
  font-size: 0.75rem;
}
.staff-brief-banner {
  margin: 0.5rem 0 0;
  max-width: 40rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--text);
}
.case-title-line {
  margin: 0.55rem 0 0;
  max-width: 42rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
.story-edit-panel input[type="text"] {
  width: 100%;
  max-width: 42rem;
}
.visit-exit-mode {
  border: 0;
  margin: 0.75rem 0 0.35rem;
  padding: 0;
  max-width: 42rem;
}
.visit-exit-mode legend {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.25rem 0;
  font-size: 0.9rem;
  cursor: pointer;
}
.radio-row input {
  margin: 0;
}
.email-alert-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}
.email-recips {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-word;
}

.caption {
  margin: 0.75rem 0 0.35rem;
  color: var(--text);
  font-size: 0.98rem;
  max-width: 52rem;
  line-height: 1.45;
}
.disclaimer.slim,
.disclaimer {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.below-video {
  margin: 0.25rem 0 1.25rem;
  max-width: 52rem;
}
.alert-details {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0.35rem 0.75rem 0.55rem;
}
.alert-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0;
  list-style: none;
}
.alert-details summary::-webkit-details-marker { display: none; }
.alert-details summary::before {
  content: "▸ ";
  color: var(--accent);
}
.alert-details[open] summary::before { content: "▾ "; }
.alert-details-body {
  padding: 0.25rem 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.alert-details-body p { margin: 0.4rem 0; }
.alert-details-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.65rem 0;
}
.detector-notes #det-stats {
  display: inline;
  white-space: pre-wrap;
  word-break: break-word;
}
.unit-player .improve {
  margin: 0.65rem 0 0;
}
.unit-player .improve-top {
  margin-top: 0.65rem;
}
.unit-player .detector-notes,
.female-catcher-layout .detector-notes,
.veto-meta-panel .detector-notes {
  margin-top: 0.75rem;
}

.case-banner.compact h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: none;
}
.case-banner.compact .sev { font-size: 0.75rem; }

.theater {
  margin: 0.35rem 0 0.75rem;
}
/* Unified theater contract (Gender Detection / Building / Case / Veto) */
.video-theater {
  margin: 0.35rem 0 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.video-theater .video-theater-bar,
.video-theater .female-play-bar {
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
  position: static;
  top: auto;
  z-index: auto;
  box-shadow: none;
}
.video-theater .video-theater-stage,
.video-theater .female-player-stage {
  padding: 0.55rem 0.55rem 0.65rem;
}
.video-theater .video-theater-stack.female-dual,
.video-theater .female-dual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}
.video-theater .video-theater-pane,
.video-theater .female-pane {
  position: relative;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
}
.video-theater .video-theater-label,
.video-theater .female-pane-label {
  position: absolute;
  z-index: 60;
  pointer-events: none;
  top: 0.55rem;
  left: 0.55rem;
  right: 0.55rem;
  max-width: calc(100% - 1.1rem);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #d7e2ee;
  box-sizing: border-box;
  white-space: normal;
}
.video-theater .theater-time {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 0.35rem;
  margin-left: 0.15rem;
  text-transform: none;
  letter-spacing: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
}
.video-theater .theater-time-local {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
  text-transform: none;
}
.video-theater .theater-time-24 {
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(215, 226, 238, 0.55);
  letter-spacing: 0;
  text-transform: none;
}
/* Case / open review: larger Enter·Exit chip, below camera OSD timestamp */
.case-theater .video-theater-label,
.case-theater .female-pane-label,
.case-theater .pane-label {
  top: 2.15rem;
  left: 0.65rem;
  right: auto;
  max-width: min(22rem, calc(100% - 1.3rem));
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  gap: 0.45rem;
}
.case-theater .theater-time {
  gap: 0.4rem;
  margin-left: 0.2rem;
}
.case-theater .theater-time-local {
  font-size: 1.15rem;
  font-weight: 700;
}
.case-theater .theater-time-24 {
  font-size: 0.85rem;
}
.case-theater .video-theater-label .ico,
.case-theater .pane-label .ico {
  width: 1.05rem;
  height: 1.05rem;
}
/* Match Continuity step colors: pink enter · gold exit · teal supporting */
.case-theater .pane-label.role-enter,
.case-theater .video-theater-label.role-enter,
.case-theater .female-pane-label.role-enter {
  color: var(--female-bright);
}
.case-theater .pane-label.role-exit,
.case-theater .video-theater-label.role-exit,
.case-theater .female-pane-label.role-exit {
  color: #e8c070;
}
.case-theater .pane-label.role-supporting,
.case-theater .video-theater-label.role-supporting,
.case-theater .female-pane-label.role-supporting,
.case-theater .pane-label.role-context,
.case-theater .video-theater-label.role-context,
.case-theater .female-pane-label.role-context {
  color: #7eb8e8;
}
.case-theater .pane-label.role-stayed,
.case-theater .video-theater-label.role-stayed,
.case-theater .female-pane-label.role-stayed {
  color: #e89888;
}
.case-theater .pane-label.role-enter .theater-time-24,
.case-theater .pane-label.role-exit .theater-time-24,
.case-theater .pane-label.role-supporting .theater-time-24,
.case-theater .pane-label.role-context .theater-time-24,
.case-theater .pane-label.role-stayed .theater-time-24 {
  color: inherit;
  opacity: 0.72;
}
.case-theater .pane-label.role-enter .theater-time-local,
.case-theater .pane-label.role-exit .theater-time-local,
.case-theater .pane-label.role-supporting .theater-time-local,
.case-theater .pane-label.role-context .theater-time-local,
.case-theater .pane-label.role-stayed .theater-time-local {
  color: inherit;
}
.video-theater .video-theater-pane video,
.video-theater .female-pane video {
  width: 100%;
  display: block;
  max-height: min(58vh, 640px);
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: contain;
}
.video-theater .video-theater-pane .no-media,
.video-theater .female-parking-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  max-height: min(58vh, 640px);
  aspect-ratio: 16 / 9;
  padding: 1rem;
  text-align: center;
  color: var(--muted, #8a93a3);
  background: #0a0e14;
}
.video-theater .pane.secondary.is-empty .no-media,
.video-theater .female-pane.is-empty .female-parking-empty,
.video-theater .female-pane.is-empty .no-media {
  max-height: 160px;
  aspect-ratio: auto;
  min-height: 120px;
}
.veto-meta-below {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.veto-meta-below h2 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.95rem;
}
.veto-meta-below h2:first-child {
  margin-top: 0;
}
.unit-play-bar {
  border-radius: 10px 10px 0 0;
}
.video-theater.female-player {
  /* zone tint lives on bars; avoid double outer chrome */
  border-color: var(--line);
}
.video-first {
  margin: 0 0 0.5rem;
}
.tile-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a0e14;
  position: relative;
}
.tile-media .tile-poster,
.tile-media .tile-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-status-slot {
  min-height: 1.5rem;
  margin: 0 0 0.5rem;
}
.page-status-slot:empty {
  display: none;
}
.case-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0.35rem 0;
  padding: 0.55rem 0.65rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.case-tools .case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.case-panel-host {
  min-height: 0;
  margin: 0 0 0.35rem;
}
.case-tools + .case-panel-host {
  margin-top: 0.35rem;
}
.case-panel-host > .email-alert-panel,
.case-panel-host > .story-edit-panel,
.case-panel-host > .triage-panel,
.case-panel-host > .close-case-panel {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}
.case-context-images {
  margin: 0.65rem 0 1rem;
  padding: 0.75rem 0.85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.case-context-images-head {
  margin: 0 0 0.65rem;
}
.case-context-images-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 650;
}
.case-context-images .slim {
  margin: 0;
  font-size: 0.85rem;
}
.case-context-hero {
  margin: 0 0 0.85rem;
}
.case-context-hero a,
.case-context-hero .case-context-open {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111;
  max-height: 320px;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  color: inherit;
  text-align: left;
}
.case-context-hero img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #0a0c10;
}
.case-context-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0.35rem 0 0;
}
.case-context-hero-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted, #8a9099);
  flex: 1 1 auto;
}
.case-context-gallery {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}
.case-context-thumb {
  margin: 0;
  padding: 0;
  position: relative;
}
.case-context-thumb .case-context-open {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  color: inherit;
}
.case-context-thumb.is-primary .case-context-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.case-context-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.case-context-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--accent);
  color: #081018;
}
.case-context-cap {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--muted, #8a9099);
  line-height: 1.3;
}
.case-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.25rem 0 0;
}
.case-context-actions .danger-text {
  color: #c45c5c;
  font-size: 0.78rem;
  padding: 0.15rem 0.35rem;
}
.case-context-actions .ghost {
  font-size: 0.78rem;
  padding: 0.15rem 0.35rem;
}
.case-context-dl {
  font-size: 0.78rem;
  padding: 0.15rem 0.35rem;
}
.case-img-lightbox {
  border: none;
  padding: 0;
  max-width: min(96vw, 1100px);
  max-height: 94vh;
  background: transparent;
  color: #e8eef5;
}
.case-img-lightbox::backdrop {
  background: rgba(6, 10, 16, 0.82);
}
.case-img-lightbox-inner {
  position: relative;
  background: #121920;
  border: 1px solid #2a3542;
  border-radius: 12px;
  padding: 1rem 1rem 0.85rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.case-img-lightbox-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  font-size: 1.4rem;
  line-height: 1;
  z-index: 2;
  min-width: 2rem;
}
.case-img-lightbox img {
  display: block;
  max-width: min(92vw, 1040px);
  max-height: min(78vh, 820px);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  background: #0a0c10;
}
.case-img-lightbox-cap {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: #9db0c3;
  text-align: center;
}
.case-img-lightbox-actions {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.75rem 0 0.15rem;
}
.case-context-upload {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}
.case-context-upload input[type="file"],
.case-context-upload input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  box-sizing: border-box;
  font-size: 0.85rem;
}
.case-context-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}
.case-context-upload button[type="submit"] {
  align-self: flex-start;
}
.case-tile .tile-preview,
.case-tile .tile-thumb,
.veto-card .tile-preview {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  background: #0a0e14;
  display: block;
}
.case-tile {
  contain: layout;
}
.stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: start;
}
.stage.single { grid-template-columns: 1fr; }
.pane {
  position: relative;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
  height: fit-content;
}
.pane-label {
  position: absolute;
  z-index: 60;
  pointer-events: none;
  top: 0.55rem;
  left: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #d7e2ee;
}
.pane video {
  width: 100%;
  display: block;
  max-height: min(58vh, 640px);
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: contain;
  position: relative;
  z-index: 1;
}
.pane .no-media {
  max-height: min(58vh, 640px);
}
@media (min-width: 901px) {
  /*
   * Dual stacked: each pane = half of (viewport − site header − play bar).
   * Play bar stays above the feeds (never overlays entry footage).
   */
  .stage:not(.single) {
    gap: 0;
  }
  .stage:not(.single) .pane,
  .video-theater .video-theater-stack:not(.single) .video-theater-pane,
  .video-theater .female-dual .female-pane {
    height: var(--dual-video-max-h, 50vh);
    max-height: var(--dual-video-max-h, 50vh);
  }
  .video-theater:not(.theater-layout-pip) .stage:not(.single) .pane video,
  .video-theater:not(.theater-layout-pip) .stage:not(.single) .pane .no-media,
  .video-theater:not(.theater-layout-pip) .female-dual video,
  .video-theater:not(.theater-layout-pip) .female-dual .no-media,
  .video-theater:not(.theater-layout-pip) .female-dual .female-parking-empty,
  .video-theater:not(.theater-layout-pip) .video-theater-stack .video-theater-pane video,
  .video-theater:not(.theater-layout-pip) .video-theater-stack .video-theater-pane .no-media {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
  }
  .theater,
  .video-theater {
    margin: 0;
  }

  /* Viewport-fill dual theater (Gender Detection / Building / Case / Veto) */
  .video-theater.theater-viewport-fill {
    position: relative;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    overflow: visible;
  }
  .video-theater.theater-viewport-fill .video-theater-bar,
  .video-theater.theater-viewport-fill .female-play-bar {
    position: static;
    z-index: auto;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #0c1117;
    backdrop-filter: none;
  }
  /*
   * Flex column — .stage { align-items: start } otherwise sizes the stack to
   * content. With PiP the <video> is position:absolute (out of flow), so the
   * stack collapsed to minmax(12rem) and fisheye sat postage-stamp small in a
   * wide short black bar.
   */
  .video-theater.theater-viewport-fill .video-theater-stage,
  .video-theater.theater-viewport-fill .female-player-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    position: relative;
    height: var(--theater-stage-h, calc(100vh - var(--app-header-h, 56px) - 48px));
    min-height: var(--theater-stage-h, calc(100vh - var(--app-header-h, 56px) - 48px));
  }
  .video-theater.theater-viewport-fill .video-theater-stack.female-dual,
  .video-theater.theater-viewport-fill .female-dual {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
    gap: 0;
  }
  .video-theater.theater-viewport-fill .video-theater-pane,
  .video-theater.theater-viewport-fill .female-pane {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  /* Entry-only (empty parking): don't split stage height with the empty pane */
  .video-theater:not(.theater-layout-pip) .female-dual:has(> .pane.secondary.is-empty) > .pane.primary,
  .video-theater:not(.theater-layout-pip) .female-dual:has(> .female-pane.secondary.is-empty) > .female-pane.primary,
  .video-theater:not(.theater-layout-pip) .video-theater-stack:has(> .pane.secondary.is-empty) > .pane.primary {
    height: var(--theater-stage-h, var(--dual-video-max-h, 70vh));
    max-height: var(--theater-stage-h, var(--dual-video-max-h, 70vh));
  }
  .video-theater:not(.theater-layout-pip) .female-dual > .pane.secondary.is-empty,
  .video-theater:not(.theater-layout-pip) .female-dual > .female-pane.secondary.is-empty,
  .video-theater:not(.theater-layout-pip) .video-theater-stack > .pane.secondary.is-empty {
    height: auto;
    max-height: 160px;
  }

  /* Gender Detection parking PiP — entry owns the stage */
  .video-theater.theater-layout-pip.theater-viewport-fill .video-theater-stack.female-dual,
  .video-theater.theater-layout-pip.theater-viewport-fill .female-dual {
    display: grid;
    position: relative;
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  .video-theater.theater-layout-pip.theater-viewport-fill .pane.primary,
  .video-theater.theater-layout-pip.theater-viewport-fill .female-pane.primary {
    grid-area: 1 / 1;
    height: 100%;
    max-height: none;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    background: #000;
  }
  /* Entry fills remaining stage (flex) — avoid absolute <video> (Chrome often paints black). */
  .video-theater.theater-layout-pip.theater-viewport-fill:not(.is-pip-swapped) .pane.primary > video,
  .video-theater.theater-layout-pip.theater-viewport-fill:not(.is-pip-swapped) .female-pane.primary > video {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 1 1 auto;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    transform: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }
  /* Parking as main: fill the stage */
  .video-theater.theater-layout-pip.theater-viewport-fill.is-pip-swapped .pane.secondary,
  .video-theater.theater-layout-pip.theater-viewport-fill.is-pip-swapped .female-pane.secondary {
    grid-area: 1 / 1;
    height: 100%;
    max-height: none;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    background: #000;
  }
  .video-theater.theater-layout-pip.theater-viewport-fill.is-pip-swapped .pane.secondary video,
  .video-theater.theater-layout-pip.theater-viewport-fill.is-pip-swapped .female-pane.secondary video {
    position: relative !important;
    flex: 1 1 auto;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
    min-height: 0;
  }
  .video-theater.theater-layout-pip .pane.secondary,
  .video-theater.theater-layout-pip .female-pane.secondary,
  .video-theater.theater-layout-pip.theater-viewport-fill .pane.secondary,
  .video-theater.theater-layout-pip.theater-viewport-fill .female-pane.secondary {
    height: auto !important;
    max-height: none !important;
    border-left: 1px solid var(--accent-line);
    border-right: 1px solid var(--accent-line);
    border-radius: var(--radius);
  }
}
/* Parking PiP (Gender Detection experiment) — works stacked + viewport-fill */
.video-theater.theater-layout-pip .video-theater-stack.female-dual,
.video-theater.theater-layout-pip .female-dual {
  display: grid;
  position: relative;
  grid-template-columns: 1fr;
  /* Prefer measured stage height so absolute <video> never collapses to 12rem */
  grid-template-rows: minmax(var(--dual-video-max-h, var(--theater-stage-h, 50vh)), 1fr);
  min-height: var(--dual-video-max-h, var(--theater-stage-h, 50vh));
}
.video-theater.theater-layout-pip .pane.primary {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: #000;
  min-height: var(--dual-video-max-h, var(--theater-stage-h, 50vh));
  height: 100%;
}
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.primary > .pane-label,
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.primary > .female-pane-label,
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.primary > .video-theater-label,
.video-theater.theater-layout-pip:not(.is-pip-swapped) .female-pane.primary > .pane-label,
.video-theater.theater-layout-pip:not(.is-pip-swapped) .female-pane.primary > .female-pane-label,
.video-theater.theater-layout-pip:not(.is-pip-swapped) .female-pane.primary > .video-theater-label {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  max-width: none;
  width: 100%;
  flex: 0 0 auto;
  border-radius: 0;
  z-index: 2;
  pointer-events: none;
}
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.primary > video,
.video-theater.theater-layout-pip:not(.is-pip-swapped) .female-pane.primary > video {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  flex: 1 1 auto;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  transform: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  min-width: 0 !important;
  min-height: 0 !important;
}
.video-theater.theater-layout-pip .pane.secondary {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  left: auto;
  top: auto;
  z-index: 90;
  width: min(34%, 20.5rem);
  height: auto;
  max-height: none;
  border-radius: var(--radius);
  border: 1px solid var(--accent-line);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  background: #000;
  overflow: hidden;
  resize: none;
  display: flex;
  flex-direction: column;
}
.video-theater.theater-layout-pip .pane.secondary video,
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.secondary .no-media,
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.secondary .female-parking-empty,
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary video {
  flex: 1 1 auto;
  width: 100% !important;
  height: auto !important;
  max-height: none;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  min-height: 0;
  position: static !important;
}
.pip-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 95;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 0 var(--radius) 0;
  background:
    linear-gradient(
      135deg,
      transparent 0 42%,
      rgba(255, 255, 255, 0.35) 42% 48%,
      transparent 48% 62%,
      rgba(255, 255, 255, 0.55) 62% 68%,
      transparent 68%
    );
  cursor: nwse-resize;
  touch-action: none;
  box-shadow: none;
  min-height: 0;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
.pip-resize-handle:hover {
  background:
    linear-gradient(
      135deg,
      transparent 0 42%,
      var(--accent-bright) 42% 48%,
      transparent 48% 62%,
      var(--accent-bright) 62% 68%,
      transparent 68%
    );
  filter: none;
}
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.primary .pip-resize-handle,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary .pip-resize-handle {
  display: none !important;
}
/* Swapped: parking is main, entry floats */
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary {
  position: relative;
  inset: auto;
  right: auto;
  bottom: auto;
  left: auto;
  top: auto;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: #000;
}
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary > .pane-label,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary > .female-pane-label,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary > .video-theater-label {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  max-width: none;
  width: 100%;
  flex: 0 0 auto;
  border-radius: 0;
  z-index: 2;
}
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary video,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary .no-media,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary .female-parking-empty {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  flex: 1 1 auto;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  min-height: 0;
  object-fit: contain;
}
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary .no-media,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary .female-parking-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: unset;
}
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  left: auto;
  top: auto;
  z-index: 90;
  width: min(34%, 20.5rem);
  height: auto;
  max-height: none !important;
  border-radius: var(--radius);
  border: 1px solid var(--accent-line);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
  background: #000;
}
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary video {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  flex: 1 1 auto;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  margin: 0 !important;
  transform: none !important;
  aspect-ratio: auto;
  object-fit: contain;
}
.video-theater.theater-layout-pip .pane.secondary .pip-drag-handle,
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary .pip-drag-handle {
  pointer-events: auto;
  cursor: grab;
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
  box-sizing: border-box;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.3rem;
  padding: 0.32rem 0.42rem;
  background: rgba(8, 14, 20, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  user-select: none;
  touch-action: none;
  z-index: 2;
  overflow: hidden;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.62rem;
  line-height: 1.2;
}
.video-theater.theater-layout-pip .pane.secondary .pip-drag-handle .ico-sm,
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary .pip-drag-handle .ico-sm {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  opacity: 0.9;
}
.video-theater.theater-layout-pip .pane.secondary .pip-drag-handle .theater-time,
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary .pip-drag-handle .theater-time {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-theater.theater-layout-pip .pane.secondary .pip-drag-handle .theater-time-local,
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary .pip-drag-handle .theater-time-local {
  font-size: 0.72rem;
}
.video-theater.theater-layout-pip .pane.secondary .pip-drag-handle .theater-time-24,
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary .pip-drag-handle .theater-time-24 {
  display: none;
}
.video-theater.theater-layout-pip .pane.secondary .pip-drag-handle .pip-swap-btn,
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary .pip-drag-handle .pip-swap-btn {
  flex: 0 0 auto;
  margin-left: auto;
}
.video-theater.theater-layout-pip .pane.secondary .pip-drag-handle:active,
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary .pip-drag-handle:active {
  cursor: grabbing;
}
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.primary .pip-drag-handle {
  pointer-events: none;
  cursor: default;
}
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary .pip-drag-handle {
  pointer-events: none;
  cursor: default;
  position: absolute;
}
.video-theater.theater-layout-pip .pane.secondary video,
.video-theater.theater-layout-pip .pane.secondary .no-media,
.video-theater.theater-layout-pip .pane.secondary .female-parking-empty {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
  min-height: 0;
  object-fit: contain;
}
.video-theater.theater-layout-pip .pane.secondary.is-empty {
  width: min(40%, 16rem);
}
/* No lot clip: hide the floating PiP entirely (don't leave an empty box). */
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.secondary.is-empty {
  display: none !important;
}
.video-theater.theater-layout-pip .pane.secondary.is-empty .no-media,
.video-theater.theater-layout-pip .pane.secondary.is-empty .female-parking-empty {
  min-height: 4.5rem;
  aspect-ratio: auto;
  font-size: 0.78rem;
  padding: 0.65rem;
}
/* Keep main parking pane full-size while the next clip's lot feed loads */
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary.is-empty,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary.is-loading {
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
}
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary.is-empty .no-media,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary.is-empty .female-parking-empty,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary.is-loading .no-media,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary.is-loading .female-parking-empty {
  min-height: 100%;
  aspect-ratio: auto;
  font-size: 0.9rem;
}
/* Floating parking: hold last size while loading next lot clip */
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.secondary.is-loading {
  width: min(34%, 20.5rem);
  aspect-ratio: 16 / 9;
}
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.secondary.is-loading .female-parking-empty {
  min-height: 0;
  aspect-ratio: 16 / 9;
}
.pip-swap-btn,
.pip-size-btn {
  margin-left: auto;
  margin-top: 0;
  min-height: 1.45rem;
  min-width: auto;
  padding: 0.15rem 0.42rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #e8f0fa;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  pointer-events: auto;
  align-self: center;
}
.pip-swap-btn:hover,
.pip-size-btn:hover {
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  filter: none;
}
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.primary .pip-swap-btn,
.video-theater.theater-layout-pip.is-pip-swapped .pane.secondary .pip-swap-btn {
  display: none !important;
}
.video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.secondary .pip-swap-btn,
.video-theater.theater-layout-pip.is-pip-swapped .pane.primary .pip-swap-btn {
  display: inline-flex !important;
}
.btn-theater-layout.is-on {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: var(--accent-bright);
  box-shadow: none;
}
@media (max-width: 900px) {
  /* Phone: stacked dual view only — PiP is desktop-sized. */
  .btn-theater-layout {
    display: none !important;
  }
  .pip-resize-handle,
  .pip-swap-btn {
    display: none !important;
  }
}
.pane-video-shell {
  position: relative;
  z-index: 1;
  isolation: isolate;
  background: #000;
}
.pane-video-shell video {
  width: 100%;
  display: block;
  max-height: min(52vh, 560px);
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: contain;
  position: relative;
  z-index: 1;
}
.pane-play-gate {
  position: absolute;
  left: 50%;
  top: 50%;
  /* translateZ forces a layer above <video> on iOS (z-index alone is ignored) */
  transform: translate3d(-50%, -50%, 0);
  -webkit-transform: translate3d(-50%, -50%, 0);
  z-index: 50;
  display: none;
  width: 3.75rem;
  height: 3.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 17, 23, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  touch-action: manipulation;
}
.pane-play-gate.is-on {
  display: block;
}
.pane-play-gate span {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}
.pane-play-gate span::before {
  content: "";
  position: absolute;
  left: 55%;
  top: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.9rem;
  border-color: transparent transparent transparent #f2f5f8;
}
/* Below the video — never covered by the iOS video compositor layer */
.pane-play-bar {
  display: none;
  position: relative;
  z-index: 20;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #182028;
  color: #e8eef5;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pane-play-bar.is-on {
  display: block;
}
.pane video[hidden],
.no-media[hidden],
[hidden] {
  display: none !important;
}
.no-media {
  aspect-ratio: 16 / 9;
  max-height: min(52vh, 560px);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--bg-2);
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}
.pane.secondary.is-empty .no-media {
  max-height: 160px;
  aspect-ratio: auto;
  min-height: 120px;
}
.theater-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.theater-bar-top {
  margin-top: 0;
  margin-bottom: 0.65rem;
}
.btn-theater-play,
.btn-theater-nav {
  margin: 0;
  flex: 0 1 auto;
  min-width: 6.5rem;
  min-height: 3rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  box-shadow: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn-theater-play .ico,
.btn-theater-nav .ico {
  width: 1.15rem;
  height: 1.15rem;
}
.btn-theater-play:hover:not(:disabled),
.btn-theater-nav:hover:not(:disabled) {
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  color: var(--accent-bright);
  box-shadow: none;
  filter: none;
}
.btn-theater-play.is-primary {
  background: var(--accent);
  border-color: transparent;
  color: #041216;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 18%, transparent) inset;
}
.btn-theater-play.is-primary:hover:not(:disabled) {
  background: color-mix(in srgb, #fff 8%, var(--accent));
  border-color: transparent;
  color: #041216;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 22%, transparent) inset;
  filter: none;
}
.btn-theater-play:disabled,
.btn-theater-nav:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.35);
  box-shadow: none;
}
.btn-theater-play:disabled:hover,
.btn-theater-nav:disabled:hover,
.btn-theater-speed:disabled:hover {
  box-shadow: none;
  filter: grayscale(0.35);
}
.video-theater-speed {
  display: inline-flex;
  flex: 0 0 auto;
  flex-shrink: 0;
  gap: 0.28rem;
  align-items: stretch;
  margin-left: auto;
}
.btn-theater-speed {
  margin: 0;
  flex: 0 0 auto;
  min-width: 2.75rem;
  width: auto;
  min-height: 2.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn-theater-speed:hover:not(:disabled) {
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  color: var(--accent-bright);
  box-shadow: none;
  filter: none;
}
.btn-theater-speed.is-on {
  background: var(--accent);
  border-color: transparent;
  color: #041216;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 18%, transparent) inset;
}
.btn-theater-speed.is-on:hover:not(:disabled) {
  background: color-mix(in srgb, #fff 8%, var(--accent));
  border-color: transparent;
  color: #041216;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 22%, transparent) inset;
  filter: none;
}
@media (max-width: 640px) {
  .video-theater-speed {
    flex: 1 1 100%;
    justify-content: stretch;
    margin-left: 0;
  }
  .btn-theater-speed {
    flex: 1 1 0;
    min-height: 2.85rem;
    font-size: 0.95rem;
  }
}
.btn-theater-play.is-primary:disabled {
  background: #3a4554;
  border-color: #3a4554;
  color: #9aa8b8;
  filter: none;
}
@media (max-width: 640px) {
  .btn-theater-play,
  .btn-theater-nav {
    min-height: 3.35rem;
    font-size: 1.08rem;
    padding: 0.9rem 1rem;
  }
}
.parking-pick.inline {
  display: flex;
  flex: 1 1 14rem;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  min-width: min(100%, 12rem);
  max-width: 100%;
}
.parking-pick.inline label {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 auto;
}
.parking-pick.inline select {
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  text-overflow: ellipsis;
}
.parking-pick.inline button {
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 0;
  min-height: 2.75rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.parking-pick.inline button:hover:not(:disabled) {
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  color: var(--accent-bright);
  box-shadow: none;
  filter: none;
}
.video-theater-bar .btn-theater-layout.is-on,
.female-play-bar .btn-theater-layout.is-on,
.video-theater-bar .btn-case-rail-nav.is-on,
.female-play-bar .btn-case-rail-nav.is-on {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: var(--accent-bright);
  box-shadow: none;
}
.video-theater-bar .btn-theater-layout.is-on:hover:not(:disabled),
.female-play-bar .btn-theater-layout.is-on:hover:not(:disabled),
.video-theater-bar .btn-case-rail-nav.is-on:hover:not(:disabled),
.female-play-bar .btn-case-rail-nav.is-on:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-2));
  box-shadow: none;
  filter: none;
}
@media (max-width: 1100px) {
  .parking-pick.inline {
    flex: 1 1 100%;
  }
}

/* legacy dual-player alias */
.players {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
  align-items: start;
}
.players.single { grid-template-columns: 1fr; }
.sync-row { margin: 0 0 1rem; }

.cam-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 1rem;
}
.cam-chip, .cam-switch a {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.cam-chip.active, .cam-switch a.active {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: var(--accent-bright);
}
.cam-chip:hover, .cam-switch a:hover { text-decoration: none; border-color: var(--accent-line); }

.time-rail h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}
.rail-day { margin-bottom: 1rem; }
.rail-day h3 {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rail-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr));
  gap: 0.35rem;
}
.rail-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.3rem;
  row-gap: 0.05rem;
  align-items: center;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 3.15rem;
  box-sizing: border-box;
}
.rail-chip .t {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.15;
  gap: 0.05rem;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.rail-chip .t-local {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rail-chip .t-24 {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 500;
}
.rail-chip .alert-ico {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
.rail-chip .rail-female {
  position: absolute;
  top: -0.3rem;
  left: -0.2rem;
  z-index: 1;
}
.rail-chip.has-female {
  border-color: var(--female-line);
}
.rail-chip.has-female-apparent {
  border-color: rgba(180, 140, 160, 0.5);
  border-style: dashed;
}
.rail-female {
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.1rem 0.22rem;
  border-radius: 3px;
  background: var(--female-deep);
  color: #fff;
}
.rail-female.is-apparent {
  background: color-mix(in srgb, var(--female-deep) 55%, #3a2a35);
  font-size: 0.65rem;
}
.nav-female {
  font-size: 0.95rem;
  line-height: 1;
  color: var(--female-bright);
}
.female-catcher-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: var(--radius-sm);
  background: var(--female-dim);
  border: 1px solid var(--female-line);
  color: var(--female-bright);
  font-size: 1.05rem;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.female-catcher-tile.is-verified {
  border-color: var(--female-line);
}
.female-catcher-tile.is-apparent {
  border-color: color-mix(in srgb, var(--female) 28%, transparent);
}
.pill.female-pill {
  background: color-mix(in srgb, var(--female-deep) 88%, transparent);
  color: #fff;
  border-color: color-mix(in srgb, var(--female) 40%, transparent);
}
.pill.female-pill-apparent {
  background: color-mix(in srgb, var(--female) 16%, transparent);
  color: var(--female-bright);
  border-color: var(--female-line);
  border-style: dashed;
}
.female-catcher-hero {
  margin-bottom: 1rem;
}
.female-catcher-main:has(.female-catcher-layout #female-player) .female-catcher-hero .lede-tight,
.female-catcher-main:has(.female-catcher-layout #female-player) .female-catcher-hero .zone-legend {
  display: none;
}
.female-catcher-main:has(.female-catcher-layout #female-player) .female-catcher-hero .banner-meta {
  margin-top: 0.35rem;
}
.female-catcher-main:has(.female-catcher-layout #female-player) .female-catcher-hero h1.page-title {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
}
.female-catcher-main:has(.female-catcher-layout #female-player) .home-hero {
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 901px) {
  /* Review tab only — morning spot check keeps normal page scroll */
  main.female-catcher-main:has(.female-catcher-layout #female-player) {
    padding-top: 0;
    padding-bottom: 0;
    max-width: none;
  }
  .female-catcher-main:has(.female-catcher-layout #female-player) .female-catcher-hero,
  .female-catcher-main:has(.female-catcher-layout #female-player) .female-review-head {
    display: none;
  }
  .female-catcher-main:has(.female-catcher-layout #female-player) .female-catcher-layout {
    gap: 0;
    min-height: calc(100vh - var(--app-header-h, 56px));
    align-items: stretch;
  }
  .female-catcher-main:has(.female-catcher-layout #female-player) .female-entry-list {
    top: var(--app-header-h, 56px);
    max-height: calc(100vh - var(--app-header-h, 56px));
    border-radius: 0;
    border-top: 0;
    border-bottom: 0;
  }
  .female-catcher-main:has(.female-catcher-layout #female-player) .female-review {
    min-width: 0;
  }
  .female-catcher-main:has(.female-catcher-layout #female-player) #female-player {
    margin: 0;
  }
}
.female-day-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0.35rem;
}
.female-day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  touch-action: manipulation;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.female-day-chip:hover {
  border-color: var(--female-line);
  color: var(--female-bright);
  text-decoration: none;
}
.female-day-chip.is-active {
  border-color: var(--female-line);
  background: var(--female-dim);
  color: var(--female-bright);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--female) 18%, transparent);
}
.female-view-pick {
  margin-top: 0.4rem;
}
.female-sidebar-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
}
.female-sidebar-filters .female-day-chip {
  min-height: 2.15rem;
  padding: 0.3rem 0.35rem;
  font-size: 0.78rem;
}
.female-sidebar-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.7rem;
}
.female-sidebar-days .female-day-chip {
  min-height: 1.85rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
}
.female-entry-empty {
  margin: 0.35rem 0.15rem 0;
  font-size: 0.82rem;
}
.female-entry-list:not(.is-all) .female-entry-item.no-female-hit:not(.is-active) {
  display: none;
}
.female-entry-list.is-all .female-entry-empty-fem {
  display: none;
}
.hold-panel {
  /* unused — hold UI is .hold-bar */
  display: none;
}
.close-case-panel {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.close-case-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.close-reason-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.close-reason-form {
  display: inline;
  margin: 0;
}
.close-reason-btn {
  font-size: 0.9rem;
}
.close-case-other {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
  max-width: 28rem;
}
.close-case-other[hidden] {
  display: none !important;
}
.close-reason-banner {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.closed-case-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(90, 160, 120, 0.55);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(40, 90, 60, 0.35), rgba(20, 40, 30, 0.55));
  box-shadow: 0 0 0 1px rgba(120, 200, 150, 0.12);
}
.closed-case-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fd4b0;
}
.closed-case-msg {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.4;
  color: #e8f5ec;
  max-width: 40rem;
}
.closed-case-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: #b7cfc0;
}
.closed-case-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.closed-case-reopen-form {
  margin: 0;
  display: flex;
}
.closed-case-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  height: 2.35rem;
  padding: 0 0.9rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #cdebd8;
  color: #10291b;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.closed-case-cta:hover {
  background: #e6fbee;
}
.closed-case-cta:focus-visible {
  outline: 2px solid #9fd4b0;
  outline-offset: 2px;
}
.closed-case-cta-secondary {
  background: transparent;
  border-color: rgba(180, 214, 192, 0.35);
  color: #cfe6d8;
  font-weight: 550;
}
.closed-case-cta-secondary:hover {
  background: rgba(207, 230, 216, 0.1);
  border-color: rgba(180, 214, 192, 0.6);
  color: #eafff2;
}
.closed-case-cta .ico {
  width: 0.95rem;
  height: 0.95rem;
  opacity: 0.85;
}
@media (max-width: 640px) {
  .closed-case-actions {
    width: 100%;
  }
  .closed-case-reopen-form,
  .closed-case-cta {
    flex: 1;
  }
}
.female-mark-bar {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--female-line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--female) 10%, transparent), transparent 55%),
    var(--panel);
}
.female-mark-bar-wrap {
  margin: 0 0 0.85rem;
}
.female-mark-bar-details {
  border: 1px solid color-mix(in srgb, var(--female) 35%, var(--line));
  border-radius: var(--radius);
  background: var(--panel);
}
.female-mark-bar-details[open] {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--female) 8%, transparent), transparent 55%),
    var(--panel);
}
.female-mark-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
  color: var(--muted);
}
.female-mark-summary::-webkit-details-marker {
  display: none;
}
.female-mark-summary-label {
  font-weight: 700;
  color: var(--female-bright);
}
.female-mark-summary-pill {
  font-size: 0.78rem;
}
.female-mark-bar-details .female-mark-bar {
  margin: 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--female) 22%, var(--line));
  border-radius: 0 0 var(--radius) var(--radius);
  background: transparent;
}
.female-mark-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
}
.female-mark-copy {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1 1 12rem;
}
.female-mark-copy strong {
  color: var(--female-bright);
}
.female-mark-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.female-mark-actions .inline-form {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
}
.female-exit-form select {
  max-width: 9rem;
  font-size: 0.85rem;
}
.hold-bar {
  position: sticky;
  top: 3.6rem;
  z-index: 40;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(232, 160, 80, 0.5);
  border-radius: 8px;
  background: rgba(18, 24, 32, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.hold-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
}
.hold-bar-copy {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1 1 12rem;
}
.hold-bar-copy strong {
  color: #e8eef5;
}
.hold-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.hold-actions form {
  display: inline;
  margin: 0;
}
.hold-approve {
  font-weight: 600;
  min-height: 2.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-sm);
}
.hold-bar.is-watching {
  border-color: rgba(180, 100, 70, 0.55);
  background: rgba(28, 20, 18, 0.96);
}
.hold-watch,
.hold-cleared {
  font-weight: 600;
  border: 1px solid rgba(200, 120, 80, 0.55);
  background: rgba(180, 90, 50, 0.22);
  color: #f5e0d0;
}
.hold-watch:hover,
.hold-cleared:hover {
  background: rgba(180, 90, 50, 0.35);
}
.hold-watch-status {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
/* Mobile overrides AFTER desktop rules so they win the cascade */
@media (max-width: 720px) {
  .hold-bar {
    position: static;
    top: auto;
    z-index: auto;
    margin: 0 0 0.55rem;
    padding: 0.4rem 0.55rem;
    box-shadow: none;
  }
  .hold-bar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }
  .hold-bar-copy {
    flex: 0 0 auto;
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .hold-bar-hint {
    display: none;
  }
  .hold-watch-status {
    gap: 0.35rem;
    flex: 0 0 auto;
  }
  .hold-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    align-content: start;
  }
  .hold-actions form {
    display: block;
    width: 100%;
    margin: 0;
    min-width: 0;
  }
  .hold-actions form button,
  .hold-actions > button {
    width: 100%;
    min-height: 2.35rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
  }
  .female-mark-bar {
    margin: 0 0 0.5rem;
    padding: 0.4rem 0.55rem;
  }
  .female-mark-copy {
    font-size: 0.8rem;
    flex-basis: auto;
  }
  .female-mark-actions {
    gap: 0.3rem;
  }
  .female-mark-actions button,
  .female-mark-actions .btn-visit {
    min-height: 2.1rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }
  .case-actions {
    gap: 0.35rem;
    margin-bottom: 0.35rem;
  }
  .case-actions button,
  .case-actions .ghost {
    min-height: 2.1rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
  }
}
.watch-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.watch-chip.is-ready {
  border-color: rgba(80, 160, 110, 0.55);
  background: rgba(60, 130, 90, 0.22);
  color: #d8f0e0;
}
.watch-chip.is-missing {
  border-color: rgba(200, 120, 80, 0.45);
  background: rgba(160, 80, 40, 0.18);
  color: #f5d8c4;
  border-style: dashed;
}
.hold-attach-exit {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.hold-attach-exit-form {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  width: 100%;
}
.hold-attach-exit-form select {
  max-width: 14rem;
  font-size: 0.85rem;
}
.hold-exit-picker {
  margin: 0.55rem 0 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(200, 120, 80, 0.35);
  border-radius: 10px;
  background: rgba(16, 18, 22, 0.55);
}
.hold-exit-picker-head {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}
.hold-exit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.hold-exit-timeline {
  max-height: min(22rem, 48vh);
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}
.hold-exit-timeline > li {
  margin: 0;
}
.hold-exit-picker-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-top: 0.35rem;
}
.hold-exit-selected {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.85rem;
}
#hold-exit-attach:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pill.hold-pending {
  background: rgba(180, 110, 40, 0.35);
  color: #f5e6c8;
}
.pill.hold-watching {
  background: rgba(160, 70, 50, 0.4);
  color: #f8d8c8;
}
.tile-verdict.verdict-watching {
  background: rgba(160, 75, 50, 0.92);
  color: #fff4ee;
}
.danger-text {
  color: #f0a0a0 !important;
}
.female-catcher-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.female-entry-list {
  position: static;
  max-height: none;
  overflow: visible;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--female) 10%, var(--line));
  border-radius: var(--radius);
  background: var(--panel);
}
.female-pane-title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 900px) {
  .female-catcher-layout {
    grid-template-columns: 1fr;
  }
  .female-entry-list {
    max-height: none;
    overflow: visible;
  }
}
@media (min-width: 901px) {
  .female-entry-list {
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }
}
.female-entry-nav {
  display: grid;
  gap: 0.4rem;
}
.female-entry-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 0.85rem;
  min-height: 3.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  background: var(--input);
  touch-action: manipulation;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.female-entry-item:hover {
  border-color: var(--line-strong);
  text-decoration: none;
}
.female-entry-item.is-active {
  border-color: var(--female-line);
  background: var(--female-dim);
  box-shadow: inset 2px 0 0 var(--female);
}
.female-entry-item-title {
  font-weight: 600;
  font-size: 0.92rem;
}
.female-entry-item-sub {
  font-size: 0.78rem;
  color: var(--muted);
}
.female-entry-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 0.75rem;
}
.female-review-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.female-review-title {
  margin: 0;
  font-size: 1.2rem;
}
.female-player {
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  /* overflow visible so sticky play bar can pin while scrolling the timeline */
  overflow: visible;
  background: #0a0e14;
}
.female-player-stage {
  position: relative;
  background: #000;
}
.female-dual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.female-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.female-pane:first-child {
  border-top: 0;
}
.female-pane-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 620;
  color: #d5e0ec;
  background: rgba(10, 16, 24, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.female-pane.is-empty {
  background: #0c1218;
}
.female-parking-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 120px;
  padding: 1rem;
  text-align: center;
  font-size: 0.88rem;
  box-sizing: border-box;
}
.female-player video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(56vh, 620px);
  min-height: 0;
  object-fit: contain;
  background: #000;
  vertical-align: top;
}
@media (min-width: 901px) {
  .female-player .female-dual {
    gap: 0;
  }
  .female-player .female-pane {
    min-height: 0;
    height: var(--dual-video-max-h, 50vh);
    max-height: var(--dual-video-max-h, 50vh);
  }
  .female-player:not(.theater-layout-pip) .female-dual video,
  .female-player:not(.theater-layout-pip) .female-parking-empty {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
  }
  .female-player.theater-layout-pip:not(.is-pip-swapped) .pane.primary,
  .female-player.theater-layout-pip:not(.is-pip-swapped) .female-pane.primary,
  .video-theater.theater-layout-pip:not(.is-pip-swapped) .pane.primary,
  .video-theater.theater-layout-pip:not(.is-pip-swapped) .female-pane.primary {
    height: 100% !important;
    max-height: none !important;
  }
}
.female-player .detector-notes {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--input);
}
.female-nav-side {
  position: absolute;
  /* Over the entry pane (parking stacks below) */
  top: min(28vh, 260px);
  transform: translateY(-50%);
  z-index: 2;
  margin: 0;
  min-width: 3.25rem;
  min-height: 3.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.78);
  color: #f2f6fb;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
  touch-action: manipulation;
}
.female-nav-side:hover:not(:disabled) {
  background: rgba(20, 30, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
}
.female-nav-side:disabled {
  opacity: 0.28;
  cursor: default;
}
.female-nav-side.female-nav-prev {
  left: 0.65rem;
}
.female-nav-side.female-nav-next {
  right: 0.65rem;
}
.female-player-bar {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
}
.female-player-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  align-items: center;
  font-size: 0.92rem;
}
.female-player-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.female-open-case {
  margin: 0;
}
@media (max-width: 640px) {
  .female-player video {
    max-height: min(48vh, 420px);
  }
  .female-nav-side {
    min-width: 2.85rem;
    min-height: 2.85rem;
    padding: 0.7rem 0.75rem;
    font-size: 0.85rem;
  }
}
.female-visit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
  padding-top: 0.2rem;
}
.female-visit-exit-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
  flex: 1 1 auto;
}
.visit-pick {
  font: inherit;
  font-size: 0.95rem;
  min-height: 2.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  max-width: 14rem;
  touch-action: manipulation;
}
.btn-visit {
  margin: 0;
  min-height: 2.65rem;
  padding: 0.65rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--female-line);
  background: var(--female-dim);
  color: var(--female-bright);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn-visit.is-primary {
  flex: 1 1 10rem;
  background: color-mix(in srgb, var(--female-deep) 82%, transparent);
  border-color: color-mix(in srgb, var(--female) 55%, transparent);
  color: #fff5f9;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset;
}
.btn-visit:hover:not(:disabled) {
  background: color-mix(in srgb, var(--female) 22%, transparent);
  border-color: color-mix(in srgb, var(--female) 55%, transparent);
  filter: none;
}
.btn-visit.is-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--female-deep) 92%, transparent);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 6px 16px color-mix(in srgb, var(--female-deep) 28%, transparent);
}
.btn-visit:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}
.btn-visit.ok {
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: #b8ecc8;
}
.btn-visit.ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn-visit.ghost:hover:not(:disabled) {
  border-color: var(--accent-line);
  color: var(--accent-bright);
  background: var(--accent-dim);
}
.female-need-exit {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.7rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--female-line) 55%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--female-dim, rgba(200, 90, 140, 0.12)) 55%, var(--panel));
}
.female-need-exit .female-pane-title {
  margin-bottom: 0.2rem;
}
.female-need-exit-hint {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  line-height: 1.35;
}
.female-need-exit-empty {
  margin: 0;
  font-size: 0.82rem;
}
.female-need-exit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
}
.female-need-exit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem;
  align-items: stretch;
}
.female-need-exit-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.female-need-exit-item:hover {
  border-color: var(--female-line);
  background: color-mix(in srgb, var(--female-dim, rgba(200, 90, 140, 0.18)) 40%, var(--input));
}
.female-need-exit-item.is-active {
  border-color: var(--female-line);
  box-shadow: inset 2px 0 0 var(--female-bright, #e8a0c0);
}
.female-need-exit-x {
  flex: none;
  width: 1.7rem;
  min-height: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
  color: var(--muted, #9aa3ad);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.female-need-exit-x:hover {
  border-color: color-mix(in srgb, #c44 55%, var(--line));
  color: #e88;
  background: color-mix(in srgb, #c44 12%, var(--input));
}
.female-need-exit-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  justify-content: space-between;
}
.female-need-exit-where {
  font-size: 0.82rem;
  line-height: 1.3;
}
.female-need-exit-when {
  font-size: 0.78rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

/* Gender Detection — morning spot check tab */
.female-morning-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  width: fit-content;
  max-width: 100%;
}
.female-mode-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted, #9aa3ad);
  border: 1px solid transparent;
}
.female-mode-tab:hover {
  color: var(--text);
  background: var(--input);
}
.female-mode-tab.is-active {
  color: var(--text);
  background: var(--input);
  border-color: var(--female-line, #c87898);
  box-shadow: inset 2px 0 0 var(--female-bright, #e8a0c0);
}
.female-morning-panel {
  margin-bottom: 2rem;
}
.female-morning-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.female-morning-player-wrap {
  margin-bottom: 0.75rem;
}
.female-morning-panel #female-player {
  margin-bottom: 0.75rem;
}
.female-morning-panel #female-player .video-theater-stage,
.female-morning-panel #female-player .female-player-stage {
  height: auto;
  min-height: 0;
  max-height: none;
}
.female-morning-panel #female-player.theater-layout-pip .pane.primary,
.female-morning-panel #female-player.theater-layout-pip .female-pane.primary {
  height: auto;
  max-height: min(46vh, 520px);
}
.female-morning-panel #female-player video {
  max-height: min(46vh, 520px);
}
@media (min-width: 901px) {
  .female-morning-panel #female-player .female-pane {
    height: auto;
    max-height: min(46vh, 520px);
  }
  .female-morning-panel #female-player:not(.theater-layout-pip) .female-dual video,
  .female-morning-panel #female-player:not(.theater-layout-pip) .female-parking-empty {
    max-height: min(46vh, 520px);
    height: auto;
  }
}
.female-morning-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}
.female-morning-days {
  margin: 0;
}
.female-morning-summary {
  margin: 0 0 0.5rem;
}
.female-morning-legend {
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}
.female-heat-mode {
  display: inline-flex;
  gap: 0;
  margin: 0 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.female-heat-mode-btn {
  margin: 0;
  padding: 0.35rem 0.75rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--input);
  color: var(--muted, #9aa3ad);
  font-size: 0.78rem;
  cursor: pointer;
}
.female-heat-mode-btn:last-child {
  border-right: 0;
}
.female-heat-mode-btn.is-active {
  background: var(--accent-dim, rgba(100, 140, 180, 0.25));
  color: var(--text);
  font-weight: 600;
}
.female-heat-mode-btn:hover:not(.is-active) {
  color: var(--text);
}
.female-heat-cases-empty {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 6px;
}
.female-morning-heatmap.is-case-mode {
  min-width: 14rem;
  grid-template-columns: minmax(9rem, auto) minmax(3rem, 1fr);
}
.female-heat-cases-grid .heatmap-row-label {
  max-width: 11rem;
  font-size: 0.72rem;
}
.hm-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  vertical-align: middle;
}
.hm-dot.hm-enter {
  background: #6bc4a8;
  box-shadow: -2px 0 0 #6bc4a8;
}
.hm-dot.hm-exit {
  background: #e8a060;
  box-shadow: 2px 0 0 #e8a060;
}
.female-morning-heatmap-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
  padding-bottom: 0.25rem;
}
.female-morning-heatmap-wrap.is-dragging {
  user-select: none;
  cursor: crosshair;
}
.female-morning-heatmap {
  display: grid;
  grid-template-columns: minmax(5.5rem, auto) repeat(var(--hm-cols, 11), minmax(1.6rem, 1fr));
  gap: 3px;
  min-width: 32rem;
}
.heatmap-corner {
  min-height: 1.5rem;
}
.heatmap-hour-label {
  font-size: 0.65rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--muted, #9aa3ad);
  text-align: center;
  padding: 0.15rem 0;
}
.heatmap-row-label {
  font-size: 0.78rem;
  line-height: 1.25;
  padding: 0.35rem 0.4rem 0.35rem 0;
  align-self: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 8rem;
}
.heatmap-cell {
  position: relative;
  min-height: 1.75rem;
  margin: 0;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  background: color-mix(
    in srgb,
    var(--accent-dim, rgba(100, 140, 180, 0.25)) calc(var(--hm-intensity, 0) * 85%),
    var(--input)
  );
  font-size: 0.68rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--text);
}
.heatmap-cell.is-empty {
  opacity: 0.45;
  cursor: default;
}
.heatmap-cell.has-female {
  background: color-mix(
    in srgb,
    var(--female-dim, rgba(200, 90, 140, 0.35)) 55%,
    color-mix(
      in srgb,
      var(--accent-dim, rgba(100, 140, 180, 0.25)) calc(var(--hm-intensity, 0) * 70%),
      var(--input)
    )
  );
  border-color: color-mix(in srgb, var(--female-line) 65%, var(--line));
}
.heatmap-cell.has-enter {
  box-shadow: inset 3px 0 0 #6bc4a8;
}
.heatmap-cell.has-exit {
  box-shadow: inset -3px 0 0 #e8a060;
}
.heatmap-cell.has-enter.has-exit {
  box-shadow: inset 3px 0 0 #6bc4a8, inset -3px 0 0 #e8a060;
}
.heatmap-cell.is-filter-on {
  outline: 2px solid var(--female-bright, #e8a0c0);
  outline-offset: 1px;
  z-index: 1;
}
.heatmap-cell.is-filter-dim {
  opacity: 0.35;
}
.heatmap-cell.is-drag-preview {
  outline: 2px dashed var(--accent, #7eb8e8);
  outline-offset: 1px;
  z-index: 2;
}
.heatmap-cell.is-case-cell {
  background: color-mix(
    in srgb,
    #c85050 calc(var(--hm-case-intensity, 0) * 88%),
    var(--input)
  );
  border-color: color-mix(
    in srgb,
    #e07070 calc(var(--hm-case-intensity, 0) * 75% + 15%),
    var(--line)
  );
  color: color-mix(in srgb, var(--text) 85%, #fff);
}
.heatmap-cell.is-case-cell.is-filter-on {
  outline-color: #e07070;
}
.female-morning-heatmap {
  touch-action: none;
  user-select: none;
}
.female-heat-selection-pill {
  margin-left: 0.35rem;
}
.heatmap-cell-n {
  pointer-events: none;
}
.female-morning-timeline {
  margin-bottom: 1rem;
}
.female-morning-day {
  margin-bottom: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel, #121820);
  overflow: hidden;
}
.female-morning-day[open] {
  border-color: color-mix(in srgb, var(--female-line, #c87898) 45%, var(--line));
}
.female-morning-day-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.female-morning-day-title::-webkit-details-marker {
  display: none;
}
.female-morning-day-title::before {
  content: "▸";
  font-size: 0.75rem;
  color: var(--muted, #9aa3ad);
  width: 0.85rem;
  flex-shrink: 0;
}
.female-morning-day[open] > .female-morning-day-title::before {
  content: "▾";
}
.female-morning-day-title:hover {
  color: var(--female-bright, #e8a0c0);
}
.female-morning-day-count {
  font-weight: 400;
}
.female-morning-day-list {
  margin: 0;
  padding: 0 0.5rem 0.5rem;
  border-top: 1px solid var(--line);
}
.female-morning-day:not(.is-active-day) {
  opacity: 0.88;
}
.female-morning-day.is-active-day {
  opacity: 1;
}
.female-morning-day.is-active-day > .female-morning-day-title {
  color: var(--female-bright, #e8a0c0);
}
.female-morning-day-list .female-tl-row.is-active {
  outline: 2px solid var(--female-bright, #e8a0c0);
  outline-offset: 1px;
}
.female-morning-day-list .female-tl-item.is-filter-hidden {
  display: none;
}

.female-visits-panel {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.female-visits-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}
.female-visits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.female-visit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
}
.female-visit-row.status-open {
  border-color: var(--female-line);
}
.female-visit-row.status-exited {
  border-color: rgba(210, 160, 50, 0.35);
}
.female-visit-row.status-stayed {
  border-color: rgba(210, 90, 70, 0.4);
}
.female-visit-row-main {
  min-width: 0;
  flex: 1 1 14rem;
  font-size: 0.88rem;
}
.female-visit-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.visit-label {
  color: var(--female-bright);
}
.linkish {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-bright);
  font: inherit;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  box-shadow: none;
  min-height: 0;
}
.visit-badge {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--female) 18%, transparent);
  color: var(--female-bright);
  vertical-align: middle;
}
.female-tl-badges {
  display: inline;
}
.muted.small {
  font-size: 0.78rem;
  margin-top: 0.2rem;
}
.case-visit-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
}
.case-visit-strip-top {
  margin: 0.65rem 0 0.35rem;
  padding: 0.45rem 0.55rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.case-visit-strip-top::before {
  content: "Enter / Exit";
  display: block;
  width: 100%;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #8a93a3);
  margin: 0 0 0.35rem;
}
.case-clip-strips {
  display: grid;
  gap: 0.4rem;
  margin: 0.65rem 0 0.35rem;
}
.case-watch-strips {
  gap: 0.55rem;
  margin: 0.5rem 0 0.45rem;
  padding: 0.75rem 0.8rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--female) 28%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--female) 7%, var(--panel)), var(--panel) 42%);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 4%, transparent) inset;
}
details.case-watch-strips > summary.case-watch-head {
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
  padding-right: 1.4rem;
  position: relative;
}
details.case-watch-strips > summary.case-watch-head::-webkit-details-marker {
  display: none;
}
details.case-watch-strips > summary.case-watch-head::after {
  content: "▸";
  position: absolute;
  right: 0.1rem;
  top: 0.15rem;
  color: var(--muted);
  font-size: 0.95rem;
  transition: transform 0.15s ease;
}
details.case-watch-strips[open] > summary.case-watch-head::after {
  transform: rotate(90deg);
}
details.case-watch-strips:not([open]) {
  border-color: var(--line);
  background: var(--panel);
}
details.case-watch-strips:not([open]) .case-watch-title {
  color: var(--muted);
  font-weight: 600;
}
.case-watch-body {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}
.case-watch-head {
  margin: 0 0 0.15rem;
}
.case-watch-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}
.case-watch-hint {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}
.case-watch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
}
.case-watch-strips .case-visit-strip-top {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.case-watch-strips .case-visit-strip-top::before {
  display: none;
}
.case-watch-chip {
  min-height: 3.1rem;
  padding: 0.55rem 0.85rem 0.55rem 0.55rem;
  gap: 0.55rem;
  font-size: 0.92rem;
}
.case-watch-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  color: #061018;
  background: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, #fff 18%, transparent) inset;
}
.case-watch-chip.role-enter .case-watch-step {
  background: var(--female);
}
.case-watch-chip.role-exit .case-watch-step {
  background: #d4a050;
}
.case-watch-chip.role-supporting .case-watch-step {
  background: #6a9fd0;
}
.case-watch-chip-label {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  text-align: left;
}
.case-watch-chip-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent-bright) 70%, var(--muted));
}
.case-support-staff {
  flex: 1 1 100%;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.case-support-staff summary {
  cursor: pointer;
  padding: 0.35rem 0;
  font-weight: 600;
}
.case-support-staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem 0 0.15rem;
}
.case-theater.case-rail-nav-off:not(.case-rail-nav-on) .female-nav-side {
  display: none !important;
}
.case-clip-strips .case-visit-strip-top {
  margin: 0;
}
.case-support-strip::before {
  content: "Supporting";
}
.case-support-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.case-visit-chip.role-supporting {
  border-color: rgba(120, 160, 210, 0.5);
}
.case-visit-chip.case-support-add {
  font-weight: 600;
  border-style: dashed;
}
.case-visit-chip.case-use-exit {
  font-weight: 600;
  border-color: rgba(210, 160, 50, 0.55);
}
.case-support-empty {
  align-self: center;
}
.female-support-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.28rem;
}
.female-support-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.female-support-thumb {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  flex: 0 0 auto;
}
.time-rail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  margin-bottom: 0.45rem;
}
.time-rail-head h2 {
  margin: 0;
}
.time-rail-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.case-rail-zone-legend {
  margin: 0 0 0.65rem;
}
.case-female-rail {
  margin: 0;
  padding: 0;
  list-style: none;
}
.case-female-rail > li {
  margin: 0 0 0.35rem;
}
.case-female-rail .female-tl-row {
  width: 100%;
}
/* Case theater: Newer/Older steps the timeline (clips or Gender Detection). */
.case-visit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.case-visit-chip:hover {
  border-color: var(--accent-line);
}
.case-visit-chip.is-active {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.case-visit-chip.role-enter {
  border-color: var(--female-line);
}
.case-visit-chip.role-exit {
  border-color: rgba(210, 160, 50, 0.45);
}
.case-visit-chip.role-stayed {
  border-color: rgba(210, 90, 70, 0.45);
  cursor: default;
}
.female-play-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  position: static;
}
.female-play-actions,
.female-play-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}
.female-play-actions {
  flex: 1 1 18rem;
  min-width: min(100%, 16rem);
}
.female-play-nav {
  flex: 0 1 auto;
  min-width: 0;
}
.female-play-actions .btn-theater-play,
.female-play-nav .btn-theater-nav {
  flex: 0 1 auto;
  min-width: 6.5rem;
  /* Beat zone-tint color inheritance on the play bar */
  color: var(--text);
}
.female-play-actions .btn-theater-play.is-primary {
  color: #061018;
}
@media (max-width: 900px) {
  /*
   * Phone: speed + nav first, Play both full-width last in the bar —
   * right above the video for thumb reach (not separated by two rows).
   */
  .video-theater-bar.female-play-bar,
  .theater-bar.female-play-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding-top: 0.55rem;
    padding-bottom: 0.4rem;
  }
  .video-theater-bar .video-theater-speed {
    order: 1;
    flex: 1 1 auto;
    margin-left: 0;
  }
  .video-theater-bar .video-theater-nav,
  .video-theater-bar .female-play-nav {
    order: 2;
    width: 100%;
    justify-content: stretch;
  }
  .video-theater-bar .video-theater-nav .btn-theater-nav,
  .video-theater-bar .female-play-nav .btn-theater-nav {
    flex: 1 1 0;
    min-width: 0;
  }
  .video-theater-bar .video-theater-actions,
  .video-theater-bar .female-play-actions {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding-top: 0.35rem;
    border-top: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  }
  .video-theater-bar .video-theater-actions #btn-sync-play,
  .video-theater-bar .female-play-actions #btn-sync-play {
    order: 10;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    margin-top: 0.1rem;
  }
  /* Case: clip nav stays on-video (side chevrons), hidden until Browse clips */
  .case-theater .video-theater-nav,
  .case-theater .female-play-nav {
    display: none;
  }
  .case-theater.case-rail-nav-on .female-nav-side {
    top: 50%;
  }
  .case-theater.case-rail-nav-on:has(.pane.secondary:not(.is-empty)) .female-nav-side,
  .case-theater.case-rail-nav-on:has(.female-pane.secondary:not(.is-empty)) .female-nav-side {
    top: 28%;
  }
  .case-watch-chip {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: min(100%, 10.5rem);
  }
  .case-watch-chip.role-supporting {
    flex: 1 1 100%;
  }
}
.female-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.female-tl-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: stretch;
}
.female-tl-entry {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 3rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.45rem;
  text-decoration: none;
  touch-action: manipulation;
  align-self: stretch;
}
.female-tl-entry-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
@media (max-width: 640px) {
  .female-tl-entry {
    min-width: 2.75rem;
    padding: 0.4rem 0.35rem;
  }
  .female-tl-entry-label {
    display: none;
  }
}
.zone-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  margin: 0.75rem 0 0;
}
.zone-swatch,
.zone-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.zone-swatch.zone-curfew,
.zone-pill.zone-curfew,
.female-tl-row.zone-curfew,
.female-player.zone-curfew .female-play-bar,
.female-player.zone-curfew .female-player-bar {
  background: rgba(160, 52, 42, 0.28);
  border-color: rgba(210, 90, 70, 0.45);
  color: #ffc9c0;
}
.zone-swatch.zone-buffer,
.zone-pill.zone-buffer,
.female-tl-row.zone-buffer,
.female-player.zone-buffer .female-play-bar,
.female-player.zone-buffer .female-player-bar {
  background: rgba(150, 110, 28, 0.28);
  border-color: rgba(210, 160, 50, 0.45);
  color: #f5df9a;
}
.zone-swatch.zone-day,
.zone-pill.zone-day {
  background: rgba(40, 55, 70, 0.55);
  border-color: var(--line);
  color: var(--muted);
}
.female-tl-row.zone-day {
  background: var(--panel);
}
.female-player.zone-curfew,
.female-player.zone-buffer {
  border-radius: 10px;
  border: 1px solid transparent;
}
.female-player.zone-curfew {
  border-color: rgba(210, 90, 70, 0.4);
}
.female-player.zone-buffer {
  border-color: rgba(210, 160, 50, 0.4);
}
.female-player-when {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.female-tl-row {
  display: grid;
  grid-template-columns: 6.5rem 3.6rem 1.4rem minmax(0, 1fr) 5.25rem;
  gap: 0.5rem;
  align-items: center;
  min-height: 3.35rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}
.female-tl-row:hover {
  filter: brightness(1.08);
}
.female-tl-row.is-active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.female-tl-row.has-female {
  box-shadow: inset 3px 0 0 var(--female);
}
.female-tl-row.has-female-apparent {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--female) 55%, transparent);
}
.female-tl-row.is-quiet {
  opacity: 0.88;
}
.female-tl-time {
  display: grid;
  gap: 0.05rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  line-height: 1.15;
  color: var(--text);
}
.female-tl-clock {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.female-tl-24 {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.female-tl-when {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.female-tl-zone {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}
.female-tl-row.zone-day .female-tl-zone {
  color: var(--muted);
}
.female-tl-mark {
  text-align: center;
  color: var(--female);
  font-size: 0.95rem;
}
.female-tl-row.is-quiet .female-tl-mark {
  color: var(--muted);
}
.female-tl-label {
  font-size: 0.85rem;
  color: var(--muted);
}
.female-tl-thumb {
  width: 5.25rem;
  height: 3rem;
  object-fit: cover;
  border-radius: 5px;
  background: #000;
}
@media (max-width: 640px) {
  .female-tl-row {
    grid-template-columns: 4.5rem 1.2rem minmax(0, 1fr) 4.4rem;
    min-height: 3.5rem;
    padding: 0.6rem 0.55rem;
  }
  .female-tl-zone {
    display: none;
  }
  .female-tl-when {
    display: none;
  }
  .female-tl-24 {
    display: block;
  }
  .female-tl-thumb {
    width: 4.4rem;
    height: 2.55rem;
  }
}
.rail-chip .k {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  max-width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  text-transform: lowercase;
  font-family: var(--font);
  font-size: 0.72rem;
}
.rail-chip.alert-prealert .k,
.rail-chip.alert-softalert .k {
  text-transform: none;
}
.alert-ico {
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
  display: inline-block;
  background: currentColor;
  opacity: 0.9;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
  /* generic alert (bell) */
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/><path d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/><path d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/></svg>");
}
.alert-police .alert-ico {
  color: #7eb6ff;
  filter: drop-shadow(0 0 4px rgba(126, 182, 255, 0.45));
}
.alert-police .k { color: #9ec6ff; }
.alert-party .alert-ico {
  color: #f0a0ff;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M22 21v-2a4 4 0 0 0-3-3.87'/><path d='M16 3.13a4 4 0 0 1 0 7.75'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M22 21v-2a4 4 0 0 0-3-3.87'/><path d='M16 3.13a4 4 0 0 1 0 7.75'/></svg>");
}
.alert-female .alert-ico {
  color: var(--female-bright);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='8' r='5'/><path d='M12 13v8'/><path d='M9 18h6'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='8' r='5'/><path d='M12 13v8'/><path d='M9 18h6'/></svg>");
}
/* Apparent female (VL only) — dashed Venus + ?, not LLM-verified */
.alert-female_app .alert-ico {
  color: color-mix(in srgb, var(--female) 75%, var(--muted));
  opacity: 0.95;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='10' cy='8' r='4.5' stroke-dasharray='2.5 2'/><path d='M10 12.5v7' stroke-dasharray='2 2'/><path d='M7.5 17h5' stroke-dasharray='2 2'/><circle cx='18.5' cy='6.5' r='3.2'/><path d='M18.5 5.2v2.6'/><path d='M17.2 6.5h2.6'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='10' cy='8' r='4.5' stroke-dasharray='2.5 2'/><path d='M10 12.5v7' stroke-dasharray='2 2'/><path d='M7.5 17h5' stroke-dasharray='2 2'/><circle cx='18.5' cy='6.5' r='3.2'/><path d='M18.5 5.2v2.6'/><path d='M17.2 6.5h2.6'/></svg>");
}
.alert-female_app .k { color: color-mix(in srgb, var(--female) 75%, var(--muted)); font-style: italic; }
/* Male curfew — Mars */
.alert-male .alert-ico {
  color: #7eb6ff;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='10' cy='14' r='5'/><path d='M14 10l6-6'/><path d='M15 4h5v5'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='10' cy='14' r='5'/><path d='M14 10l6-6'/><path d='M15 4h5v5'/></svg>");
}
.alert-male .k { color: #9ec6ff; }
.alert-male_app .alert-ico {
  color: color-mix(in srgb, #7eb6ff 75%, var(--muted));
  opacity: 0.95;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='10' cy='14' r='4.5' stroke-dasharray='2.5 2'/><path d='M13.5 10.5l5-5' stroke-dasharray='2 2'/><path d='M15 4h5v5' stroke-dasharray='2 2'/><circle cx='18.5' cy='18.5' r='3.2'/><path d='M18.5 17.2v2.6'/><path d='M17.2 18.5h2.6'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='10' cy='14' r='4.5' stroke-dasharray='2.5 2'/><path d='M13.5 10.5l5-5' stroke-dasharray='2 2'/><path d='M15 4h5v5' stroke-dasharray='2 2'/><circle cx='18.5' cy='18.5' r='3.2'/><path d='M18.5 17.2v2.6'/><path d='M17.2 18.5h2.6'/></svg>");
}
.alert-male_app .k { color: color-mix(in srgb, #7eb6ff 75%, var(--muted)); font-style: italic; }
.alert-object .alert-ico {
  color: #ffc278;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m7.5 4.27 9 5.15'/><path d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/><path d='m3.3 7 8.7 5 8.7-5'/><path d='M12 22V12'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m7.5 4.27 9 5.15'/><path d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/><path d='m3.3 7 8.7 5 8.7-5'/><path d='M12 22V12'/></svg>");
}
.alert-loiter .alert-ico {
  color: #7ec8ff;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 6v6l4 2'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 6v6l4 2'/></svg>");
}
.alert-erratic .alert-ico {
  color: #ff7b7b;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M13 2 3 14h9l-1 8 10-12h-9l1-8z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M13 2 3 14h9l-1 8 10-12h-9l1-8z'/></svg>");
}
.alert-bike .alert-ico {
  color: #9ad7a4;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='18.5' cy='17.5' r='3.5'/><circle cx='5.5' cy='17.5' r='3.5'/><circle cx='15' cy='5' r='1'/><path d='M12 17.5V14l-3-3 4-3 2 3h3'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='18.5' cy='17.5' r='3.5'/><circle cx='5.5' cy='17.5' r='3.5'/><circle cx='15' cy='5' r='1'/><path d='M12 17.5V14l-3-3 4-3 2 3h3'/></svg>");
}
.alert-scene .alert-ico {
  color: #c4b5fd;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z'/><circle cx='12' cy='12' r='3'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z'/><circle cx='12' cy='12' r='3'/></svg>");
}
.alert-clip .alert-ico,
.alert-context .alert-ico,
.alert-raw .alert-ico {
  color: var(--muted);
  opacity: 0.7;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect width='18' height='18' x='3' y='3' rx='2'/><path d='M7 3v18'/><path d='M3 7.5h4'/><path d='M3 12h18'/><path d='M3 16.5h4'/><path d='M17 3v18'/><path d='M17 7.5h4'/><path d='M17 16.5h4'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect width='18' height='18' x='3' y='3' rx='2'/><path d='M7 3v18'/><path d='M3 7.5h4'/><path d='M3 12h18'/><path d='M3 16.5h4'/><path d='M17 3v18'/><path d='M17 7.5h4'/><path d='M17 16.5h4'/></svg>");
}
/* Soft-Alert: muted bell with a soft dash — near-threshold, still grey */
.alert-softalert .alert-ico,
.alert-prealert .alert-ico,
.alert-near .alert-ico {
  color: var(--muted);
  opacity: 0.75;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10.268 21a2 2 0 0 0 3.464 0'/><path d='M13.916 2.314A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .738-1.674c-.75-.793-1.683-1.845-2.226-3.185'/><path d='M16 8h6'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10.268 21a2 2 0 0 0 3.464 0'/><path d='M13.916 2.314A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .738-1.674c-.75-.793-1.683-1.845-2.226-3.185'/><path d='M16 8h6'/></svg>");
}
.alert-softalert .k,
.alert-prealert .k,
.alert-near .k {
  color: var(--muted);
}
.alert-party .k { color: #f0a0ff; }
.alert-female .k { color: var(--female-bright); }
.alert-object .k { color: #ffc278; }
.alert-loiter .k { color: #7ec8ff; }
.alert-erratic .k { color: #ff7b7b; }
.alert-bike .k { color: #9ad7a4; }
.alert-scene .k { color: #c4b5fd; }
.rail-chip.unsent { opacity: 0.72; }
.rail-chip.sent .k { /* keep type color */ }
.rail-chip.active {
  opacity: 1;
  border-color: var(--accent);
  border-width: 2px;
  background: color-mix(in srgb, var(--accent) 24%, var(--panel));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent),
    0 4px 14px color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
}
.rail-chip.active.unsent {
  opacity: 1;
}
.rail-chip.active .t-local {
  color: var(--accent-bright, var(--accent));
  font-weight: 700;
}
.rail-chip.active .t-24 {
  color: color-mix(in srgb, var(--accent-bright, var(--accent)) 70%, var(--text));
}
.rail-chip.active .k {
  color: var(--accent-bright, var(--accent));
  font-weight: 600;
}
.rail-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .rail-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .rail-chip {
    min-height: 3rem;
    padding: 0.35rem 0.4rem;
  }
  .rail-chip .t-local {
    font-size: 0.72rem;
  }
  .rail-chip .k {
    max-width: 100%;
    font-size: 0.65rem;
  }
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--line-strong);
  border: 1px solid transparent;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.pill.ok {
  background: color-mix(in srgb, var(--ok) 22%, transparent);
  color: #8dffc3;
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}

button, .ghost {
  margin-top: 0;
  padding: 0.55rem 1.05rem;
  min-height: 2.4rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #041216;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 18%, transparent) inset;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease,
    transform 0.12s ease;
}
button:hover:not(:disabled):not(.ghost):not(.nav-menu-btn):not(.account-btn):not(.rail-chip):not(.cam-chip):not(.unit-filter-chip):not(.file-pick-btn):not(.leak-cause-btn):not(.female-tl-row):not(.unit-tl-thumb):not(.pane-play-gate):not(.btn-theater-play):not(.btn-theater-nav):not(.btn-theater-speed):not(.female-nav-side):not(.linkish):not(.btn-visit):not(.case-visit-chip):not(.hold-watch):not(.tile-reopen-btn):not(.female-day-chip):not(.parking-pick.inline button) {
  filter: brightness(1.07);
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 22%, transparent) inset,
    0 6px 16px color-mix(in srgb, var(--accent) 22%, transparent);
}
button:active:not(:disabled):not(.ghost):not(.nav-menu-btn):not(.account-btn):not(.rail-chip):not(.cam-chip):not(.unit-filter-chip):not(.file-pick-btn):not(.leak-cause-btn):not(.female-tl-row):not(.unit-tl-thumb):not(.pane-play-gate):not(.btn-theater-play):not(.btn-theater-nav):not(.btn-theater-speed):not(.female-nav-side):not(.linkish):not(.btn-visit):not(.case-visit-chip):not(.parking-pick.inline button) {
  transform: translateY(1px);
  filter: brightness(0.98);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}
button:focus-visible,
.ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}
button.danger:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 6px 16px rgba(224, 85, 85, 0.28);
}
button.ghost.is-on, .ghost.is-on {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: var(--accent-bright);
  box-shadow: none;
}
button.ghost, .ghost {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
button.ghost:hover:not(:disabled),
.ghost:hover {
  border-color: var(--accent-line);
  color: var(--accent-bright);
  background: var(--accent-dim);
  text-decoration: none;
  filter: none;
}
a.ghost {
  text-decoration: none;
}

.parking-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.75rem;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.parking-pick select {
  flex: 1;
  min-width: 180px;
  padding: 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
}

.improve {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 8%, var(--line));
  border-radius: var(--radius);
  background: var(--panel);
}
.improve-top {
  margin-top: 0.65rem;
}
.improve-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.55rem;
}
.improve-head h2 {
  margin: 0;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.improve-head .muted {
  margin: 0;
}
.feedback { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fb-run-opt {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.fb-status {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  background: #1a2a22;
  border: 1px solid #2f5a40;
  color: #b6f0c8;
  font-size: 0.9rem;
}
.fb-status.is-err {
  background: #2a1a1a;
  border-color: #5a2f2f;
  color: #f0b6b6;
}
.fb-detail {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  gap: 0.75rem;
}
.fb-prompt {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
}
.fb-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.fb-presets button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.fb-presets button.is-selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent);
}
.fb-note-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}
.fb-note-label textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.fb-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.file-case-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  font-size: 1.02rem;
  font-weight: 650;
  user-select: none;
}
.file-case-summary::-webkit-details-marker,
.file-case-summary::marker {
  display: none;
}
.file-case-summary::before {
  content: "▸";
  color: var(--muted);
  font-weight: 500;
}
.file-case-panel[open] > .file-case-summary::before {
  content: "▾";
}
.file-case-panel:not([open]) {
  padding: 0.55rem 0.85rem;
}
.file-case-summary-meta {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.88rem;
}
.file-case-panel .setting-label {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.file-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
  margin: 0 0 0.35rem;
}
.file-unit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.file-pick-btn {
  min-height: 2.75rem;
  padding: 0.65rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.file-pick-btn.is-on {
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.file-pick-btn.is-hint:not(.is-on) {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.walk-unit-pick {
  margin: 0 0 0.85rem;
}
.file-case-actions {
  margin-top: 0.75rem;
}
.file-case-actions .hold-approve,
.file-case-actions button[type="submit"] {
  min-height: 2.75rem;
  flex: 1 1 9rem;
}
@media (max-width: 560px) {
  .file-pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .file-unit-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .file-pick-btn {
    min-height: 3rem;
    font-size: 1rem;
  }
}

.login-card {
  max-width: 380px;
  margin: 4rem auto;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.magic-loading {
  text-align: center;
}
.magic-loading-note {
  margin: 0.75rem 0 0;
}
.unit-view-only {
  margin: 0;
  font-size: 0.85rem;
}
@keyframes magic-spin {
  to { transform: rotate(360deg); }
}
label { display: block; margin: 0.75rem 0; }
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.85rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"],
input[type="text"],
input[type="email"],
input[type="password"],
input:not([type]) {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
  margin-top: 0;
}
/* Keep autofill readable on dark theme */
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--input) inset;
  transition: background-color 99999s ease-out;
}
main.settings-main {
  max-width: 1180px;
}
.settings-hero {
  margin-bottom: 1rem;
}
.settings-hero h1 { margin: 0; }
.settings-lede {
  margin: 0.4rem 0 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.settings-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.settings-account-block {
  border-color: color-mix(in srgb, var(--line-strong) 70%, var(--line));
}
.settings-account-block .settings-form {
  max-width: none;
}
.settings-shell {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: start;
}
.settings-nav {
  min-width: 0;
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  z-index: 6;
  padding: 0.7rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.settings-nav-label {
  margin: 0 0 0.45rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.settings-nav a {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
  line-height: 1.25;
}
.settings-nav a:hover {
  color: var(--text);
  background: var(--input);
  text-decoration: none;
}
.settings-nav a.is-active {
  color: var(--text);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}
.settings-nav a.is-group {
  margin-top: 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 85%, var(--accent));
}
.settings-nav a.is-group:first-child {
  margin-top: 0;
}
.settings-nav a.settings-nav-ext {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--line);
  border-left-color: transparent;
  font-weight: 600;
  color: var(--accent-bright);
}
.settings-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0 0 1rem;
  max-width: 920px;
  position: sticky;
  top: 0.4rem;
  z-index: 5;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(6px);
}
.settings-toc a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}
.settings-toc a:hover {
  color: var(--text);
  background: var(--input);
}
.settings-body {
  min-width: 0;
  display: grid;
  gap: 1.35rem;
}
.settings-form {
  display: grid;
  gap: 0.85rem;
  max-width: 920px;
}
.settings-form-main {
  max-width: none;
  padding-bottom: 4.5rem;
  gap: 1.35rem;
}
.settings-zone {
  display: grid;
  gap: 0.85rem;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}
.settings-zone-advanced {
  margin-top: 0.35rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
}
.settings-zone-head {
  margin: 0 0 0.15rem;
}
.settings-zone-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
}
.settings-zone-blurb {
  margin: 0.3rem 0 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}
.settings-block {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--accent) 8%, var(--line));
  border-radius: var(--radius);
  background: var(--panel);
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}
.settings-block-accent {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  box-shadow: inset 3px 0 0 var(--accent);
}
.settings-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.settings-block-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.settings-block-head p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  max-width: 44rem;
}
.settings-more {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--line);
}
.settings-more > summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}
.settings-more > summary::-webkit-details-marker { display: none; }
.settings-more > summary::before {
  content: "▸ ";
  color: var(--accent);
}
.settings-more[open] > summary::before { content: "▾ "; }
.settings-more .setting-field {
  margin-top: 0.7rem;
}
.settings-fold {
  padding: 0;
}
.settings-fold > summary {
  list-style: none;
  cursor: pointer;
}
.settings-fold > summary::-webkit-details-marker { display: none; }
.settings-fold-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.95rem 1.1rem;
}
.settings-fold-title {
  font-size: 1.02rem;
  font-weight: 700;
}
.settings-fold-title::before {
  content: "▸ ";
  color: var(--accent);
  font-weight: 600;
}
.settings-fold[open] .settings-fold-title::before { content: "▾ "; }
.settings-fold-hint {
  color: var(--muted);
  font-size: 0.8rem;
}
.settings-fold-body {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
}
.settings-detect-body {
  gap: 0.85rem;
  padding-top: 0.95rem;
  grid-template-columns: 1fr 1fr;
}
.settings-detect-panel {
  margin: 0;
  padding: 0.85rem 0.95rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--accent));
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in srgb, var(--panel) 88%, var(--input));
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}
.settings-detect-panel[data-detect="party"],
.settings-detect-panel[data-detect="loiter"],
.settings-detect-panel[data-detect="ai"],
.settings-detect-panel[data-detect="time-config"] {
  grid-column: 1 / -1;
}
.settings-detect-head {
  margin: 0 0 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.settings-detect-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}
.settings-detect-head p {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 42rem;
}
.settings-detect-fields {
  display: grid;
  gap: 0.85rem 1rem;
}
.settings-detect-fields.is-dwell,
.settings-detect-fields.is-time-config {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-detect-fields.is-party {
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
}
.settings-detect-fields.is-party .setting-toggle-block {
  grid-column: 1 / -1;
}
.settings-detect-fields.is-ai {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-detect-fields.is-ai .setting-field-span,
.settings-detect-fields.is-ai .setting-toggle-block:first-child {
  grid-column: 1 / -1;
}
.settings-detect-fields.is-ai .cloud-llm-openrouter-only[hidden],
.settings-detect-fields.is-ai .cloud-llm-codex-only[hidden] {
  display: none !important;
}
.cloud-llm-usage {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line);
}
.cloud-llm-usage-head h4 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}
.cloud-llm-usage-head p {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}
.cloud-llm-usage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.cloud-llm-usage-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  background: color-mix(in srgb, var(--panel, #12161c) 88%, transparent);
  border: 1px solid var(--line);
}
.cloud-llm-usage-stat span {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.72;
}
.cloud-llm-usage-stat strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.cloud-llm-usage-tables {
  display: grid;
  gap: 0.85rem;
}
.cloud-llm-usage-table h5 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
}
.cloud-llm-usage-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.cloud-llm-usage-table th,
.cloud-llm-usage-table td {
  text-align: left;
  padding: 0.28rem 0.35rem;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.cloud-llm-usage-table th {
  font-weight: 600;
  opacity: 0.8;
}
.settings-detect-fields.is-single {
  grid-template-columns: minmax(0, 16rem);
}
.curfew-gender-block {
  grid-column: 1 / -1;
  margin-top: 0.75rem;
}
.curfew-gender-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}
.curfew-gender-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.curfew-gender-table th,
.curfew-gender-table td {
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.curfew-gender-table th {
  font-weight: 600;
  opacity: 0.85;
}
.curfew-gender-table select {
  min-width: 7rem;
}
.settings-detect-fields .setting-toggle-block {
  gap: 0.35rem;
}
.settings-detect-fields .setting-toggle-block .setting-check {
  margin: 0;
  align-items: flex-start;
}
.settings-detect-fields .setting-toggle-block .setting-help {
  margin-left: 1.35rem;
}
.settings-detect-fields .setting-meta {
  margin-top: 0.35rem;
}
.settings-sub {
  padding-top: 0.75rem;
}
.settings-sub + .settings-sub {
  margin-top: 0.45rem;
  border-top: 1px dashed var(--line);
}
.settings-sub h3 {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.settings-sub-blurb {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 40rem;
}
.setting-meta {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.settings-ico {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--input);
  border: 1px solid var(--line);
}
.settings-ico .alert-ico {
  width: 1.15rem;
  height: 1.15rem;
}
.settings-ico-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.settings-ico-svg .ico {
  width: 1.15rem;
  height: 1.15rem;
}
.setting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem 1rem;
}
.setting-field {
  display: grid;
  gap: 0.28rem;
  margin: 0;
  align-content: start;
}
.settings-row-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.85rem 1rem;
  margin-top: 0.7rem;
}
.settings-row-2:first-child {
  margin-top: 0;
}
@media (max-width: 700px) {
  .settings-row-2 {
    grid-template-columns: 1fr;
  }
  .settings-detect-body {
    grid-template-columns: 1fr;
  }
  .settings-detect-fields.is-party,
  .settings-detect-fields.is-dwell,
  .settings-detect-fields.is-time-config,
  .settings-detect-fields.is-ai {
    grid-template-columns: 1fr;
  }
  .settings-detect-fields.is-single {
    grid-template-columns: 1fr;
  }
  .settings-detect-fields .setting-toggle-block .setting-help {
    margin-left: 0;
  }
}
.settings-block > .setting-field {
  margin-top: 0.7rem;
}
.settings-block > .setting-field:first-of-type,
.settings-fold-body > .setting-field:first-child {
  margin-top: 0;
}
.setting-label {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
}
.setting-help {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  max-width: 36rem;
}
.setting-help-follow {
  display: block;
  margin: 0.35rem 0 0.85rem;
  max-width: 42rem;
}
.setting-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.setting-input-wrap input,
.setting-field input[type="time"],
.setting-field input:not([type="checkbox"]),
.setting-field select {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font: inherit;
}
.account-form #account-email {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  border-color: var(--accent);
}
.setting-unit {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 3.6rem;
  white-space: nowrap;
}
.setting-field textarea {
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.setting-field.is-toggle .toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.15rem;
}
.toggle-state {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.settings-save-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0 1rem;
}
.settings-save-bar.is-inline {
  padding: 0.35rem 0 0;
}
.settings-save-bar.is-sticky {
  position: sticky;
  bottom: 0.5rem;
  z-index: 4;
  margin-top: 0.75rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(6px);
}
.settings-save-bar .muted {
  margin: 0;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .settings-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }
  .settings-nav {
    position: sticky;
    top: var(--header-h);
    z-index: 6;
    margin: 0;
    padding: 0.55rem 0.5rem 0.6rem;
    border-radius: var(--radius);
  }
  .settings-nav-label {
    margin: 0 0.35rem 0.35rem;
  }
  .settings-nav-list {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.3rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.15rem;
  }
  .settings-nav a {
    flex: 0 0 auto;
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
  }
  .settings-nav a.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
  .settings-nav a.is-group {
    margin-top: 0;
    font-size: 0.72rem;
    opacity: 0.9;
  }
  .settings-nav a.settings-nav-ext {
    margin-top: 0;
    padding-top: 0.4rem;
    border-top: none;
    border-left: 1px dashed var(--line);
    border-radius: 0 6px 6px 0;
  }
}

.settings-form .setting-row {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.settings-form .setting-row.stack {
  grid-template-columns: 1fr;
  align-items: stretch;
}
.settings-form textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.tips {
  background: var(--panel);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
}

/* Kimi veto QA */
.lede-tight {
  color: var(--muted);
  max-width: 40rem;
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
}
.pill.veto-pill,
.veto-pill {
  background: rgba(160, 100, 180, 0.28);
  color: #e4c4f2;
  border: 1px solid rgba(180, 120, 200, 0.35);
}
.tile-media .veto-pill {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 3;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
}
.tile-media .parking-pill {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  background: rgba(60, 120, 180, 0.28);
  color: #b8d4f0;
  border: 1px solid rgba(80, 140, 200, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.veto-snip {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.25rem 0 0.4rem;
  min-height: 3.4em;
}
.veto-theater {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.9fr);
  gap: 1.25rem;
  margin: 1rem 0 1.5rem;
  align-items: start;
}
.veto-stage {
  display: grid;
  gap: 0.65rem;
}
.veto-video {
  width: 100%;
  max-height: min(58vh, 640px);
  background: #000;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.veto-video.parking {
  max-height: min(52vh, 560px);
}
.veto-parking-missing {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
}
.veto-meta-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.veto-meta-panel h2 {
  margin: 0.9rem 0 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.veto-meta-panel h2:first-child { margin-top: 0; }
.veto-meta-panel p {
  margin: 0;
  line-height: 1.45;
  font-size: 0.95rem;
}
.veto-meta-panel .small { font-size: 0.8rem; }
.inline-form { display: inline; margin: 0; }
.veto-promote {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.veto-promote-form textarea {
  width: 100%;
  margin: 0.35rem 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.veto-promote-form button {
  width: 100%;
}
.veto-rail { margin-top: 1.5rem; }
.veto-rail-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}
.veto-chip {
  flex: 0 0 auto;
  width: 7.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  font-size: 0.75rem;
}
.veto-chip img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #000;
}
.veto-chip span {
  display: block;
  padding: 0.35rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.veto-chip.is-active,
.veto-chip:hover {
  border-color: var(--accent);
  text-decoration: none;
}
@media (max-width: 860px) {
  .veto-theater {
    grid-template-columns: 1fr;
  }
}

/* ----- Review walkthrough (veto Accept / hold Approve) ----- */
.veto-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 14rem);
  gap: 1rem;
  align-items: start;
}
.veto-layout-main {
  min-width: 0;
}
.veto-below-theater {
  margin-top: 0.85rem;
}

/* Desktop: theater owns the first viewport (same idea as Gender Detection) */
@media (min-width: 901px) {
  main.veto-review-main:has(#veto-player) {
    padding: 0;
    max-width: none;
  }
  .veto-review-main:has(#veto-player) .veto-review-banner {
    margin: 0;
    padding: 0.4rem 0.85rem;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid var(--line);
    background: #0c1117;
  }
  .veto-review-main:has(#veto-player) .veto-review-banner .eyebrow,
  .veto-review-main:has(#veto-player) .veto-review-banner .banner-meta {
    display: none;
  }
  .veto-review-main:has(#veto-player) .veto-review-banner h1.page-title {
    font-size: 1.05rem;
    gap: 0.4rem;
  }
  .veto-review-main:has(#veto-player) .veto-flash {
    margin: 0.35rem 0.85rem 0;
  }
  .veto-review-main:has(#veto-player) .veto-layout {
    gap: 0;
    min-height: calc(100vh - var(--app-header-h, 56px) - 3rem);
  }
  .veto-review-main:has(#veto-player) #veto-player {
    margin: 0;
  }
  .veto-review-main:has(#veto-player) .review-jump-rail {
    top: var(--app-header-h, 56px);
    max-height: calc(100vh - var(--app-header-h, 56px));
    margin: 0;
    border-radius: 0;
    border-top: 0;
    border-bottom: 0;
    border-right: 0;
  }
  .veto-review-main:has(#veto-player) .veto-below-theater {
    margin-top: 0;
    padding: 1rem 1.25rem 3rem;
  }
}
.review-jump-rail {
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 0.65rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.review-jump-rail .section-title {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
}
.review-jump-rail > .muted {
  margin: 0 0 0.55rem;
}
.review-jump-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.review-jump-item-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.1rem;
}
.review-jump-item-wrap .review-jump-item {
  border-color: transparent;
  background: transparent;
}
.review-jump-item-wrap.is-active,
.review-jump-item-wrap:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}
.review-jump-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.35rem;
  text-decoration: none;
  touch-action: manipulation;
}
.review-jump-item {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: center;
  padding: 0.25rem;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: transparent;
}
.review-jump-item img,
.review-jump-placeholder {
  width: 3.25rem;
  height: 2.15rem;
  object-fit: cover;
  border-radius: 5px;
  background: #0a0c10;
  display: block;
}
.review-jump-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.25;
}
.review-jump-meta strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-jump-item.is-active,
.review-jump-item:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}
.review-jump-item-wrap .review-jump-item.is-active,
.review-jump-item-wrap .review-jump-item:hover {
  border-color: transparent;
  background: transparent;
}
.hold-jump-rail {
  margin: 0.75rem 0 1rem;
  position: static;
  max-height: none;
}
.hold-jump-rail .review-jump-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.45rem;
}
/* Open queue: sticky right rail (same pattern as veto) — not the Hold grid */
.case-open-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 14rem);
  gap: 1rem;
  align-items: start;
}
.case-open-layout > .veto-layout-main {
  min-width: 0;
}
.case-open-layout > .open-jump-rail {
  position: sticky;
  top: calc(var(--app-header-h, 56px) + 0.5rem);
  max-height: calc(100vh - var(--app-header-h, 56px) - 1rem);
  overflow: auto;
  align-self: start;
}

/* Desktop open cases: full-bleed theater like veto; chrome stays above video */
@media (min-width: 901px) {
  main.case-open-review:has(#dual-player) {
    padding: 0;
    max-width: none;
  }
  .case-open-review:has(#dual-player) .case-open-layout {
    gap: 0;
    min-height: calc(100vh - var(--app-header-h, 56px) - 3rem);
  }
  .case-open-review:has(#dual-player) .case-open-layout > .veto-layout-main > .case-banner {
    margin: 0;
    padding: 0.4rem 0.85rem;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid var(--line);
    background: #0c1117;
    border-radius: 0;
  }
  .case-open-review:has(#dual-player) .case-open-layout > .veto-layout-main > .case-banner .eyebrow,
  .case-open-review:has(#dual-player) .case-open-layout > .veto-layout-main > .case-banner .banner-meta {
    display: none;
  }
  .case-open-review:has(#dual-player) .case-open-layout > .veto-layout-main > .case-banner h1 {
    font-size: 1.05rem;
    margin: 0;
  }
  .case-open-review:has(#dual-player) .video-first {
    margin: 0;
  }
  .case-open-review:has(#dual-player) #dual-player {
    margin: 0;
  }
  .case-open-review:has(#dual-player) .open-jump-rail {
    top: var(--app-header-h, 56px);
    max-height: calc(100vh - var(--app-header-h, 56px));
    margin: 0;
    border-radius: 0;
    border-top: 0;
    border-bottom: 0;
    border-right: 0;
  }
  .case-open-review:has(#dual-player) .case-open-layout > .veto-layout-main {
    padding: 0 0 3rem;
  }
  .case-open-review:has(#dual-player) .case-open-layout > .veto-layout-main > .case-banner + *,
  .case-open-review:has(#dual-player) .case-open-layout > .veto-layout-main > *:not(.case-banner):not(.video-first):not(.case-clip-strips) {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* Phones: no Open jump strip — use Cases list / next-after-close instead */
@media (max-width: 900px) {
  .case-open-layout {
    grid-template-columns: 1fr;
  }
  .case-open-layout > .open-jump-rail,
  .open-jump-rail {
    display: none !important;
  }
}
.triage-walk {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  scroll-margin-top: 4.1rem;
}
.triage-walk-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: -0.15rem -0.15rem 0.85rem;
  padding: 0.35rem 0.15rem 0.5rem;
  position: sticky;
  top: 3.55rem;
  z-index: 6;
  background: var(--panel);
  scroll-margin-top: 3.55rem;
}
.triage-walk-step {
  flex: 1 1 auto;
  min-width: 5.5rem;
  padding: 0.55rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #8a93a3);
  font-size: 0.78rem;
  cursor: pointer;
}
.triage-walk-step.is-active {
  border-color: var(--accent);
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
}
.triage-walk-pane h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.triage-walk-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 1rem;
}
.triage-walk-nav .hold-approve,
.triage-walk-nav button[type="submit"] {
  min-height: 2.6rem;
  padding: 0.65rem 1rem;
}
.triage-walk-desc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.55rem 0 0.15rem;
}
.triage-walk-desc-actions .ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.15rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 600;
}
.triage-walk-desc-actions .ghost .ico {
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0.85;
}
.triage-walk-desc-actions .js-walk-draft-status {
  flex: 1 1 8rem;
  min-width: 0;
}
.triage-checks-tap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.4rem;
}
.triage-checks-tap .triage-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.55rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.triage-checks-tap .triage-check:has(input:checked) {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}
.severity-tap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
.severity-tap-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.severity-tap-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.severity-tap-opt:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.severity-tap-opt.sev-critical:has(input:checked) {
  border-color: #d35a5a;
  box-shadow: inset 0 0 0 1px #d35a5a;
}
.severity-tap-opt.sev-high:has(input:checked) {
  border-color: #d3924a;
}
.veto-decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
@media (max-width: 900px) {
  .veto-layout {
    grid-template-columns: 1fr;
  }
  .review-jump-rail {
    position: static;
    max-height: none;
  }
  .hold-jump-rail .review-jump-list,
  .review-jump-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  }
}

/* ----- Test Lab ----- */
.lab-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}
.lab-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  font-size: 0.85rem;
}
.lab-stat strong { font-variant-numeric: tabular-nums; }
.lab-stat.is-on,
.lab-stat:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.lab-search {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.lab-search input[type="search"] {
  min-width: 14rem;
}
.lab-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
  margin: 0.75rem 0;
}
.lab-replay-note { flex: 1 1 12rem; min-width: 10rem; }
.lab-table-wrap { overflow-x: auto; }
.lab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.lab-table th,
.lab-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.lab-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: start;
}
.lab-player-row td {
  padding: 0.35rem 0.5rem 0.75rem;
  background: var(--panel-2, rgba(0, 0, 0, 0.12));
}
.lab-player-panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 42rem;
}
.lab-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.lab-player {
  width: 100%;
  max-height: 22rem;
  background: #000;
  border-radius: 4px;
}
.lab-relabel summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  color: var(--muted, #8a93a3);
}
.lab-relabel-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
  min-width: 11rem;
}
.lab-jobs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.lab-jobs li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.85rem;
}
.lab-save {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.lab-save h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.lab-save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.6rem;
}
.lab-save-row select,
.lab-save-row input[type="text"] {
  min-width: 10rem;
}
.setting-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}
.detector-backup-panel {
  grid-column: 1 / -1;
  margin: 0.25rem 0 0;
  padding: 0.85rem 0.95rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--accent));
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in srgb, var(--panel) 88%, var(--input));
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}
.detector-backup-panel .settings-detect-head p {
  max-width: 48rem;
}
.detector-backup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.detector-backup {
  margin: 0;
  padding: 0.7rem 0.8rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--line));
}
.detector-backup.is-protected {
  border-left-color: #7fd99a;
}
.detector-backup.is-current {
  border-left-color: var(--accent);
}
.detector-backup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
}
.detector-backup-main {
  min-width: 0;
  flex: 1 1 16rem;
}
.detector-backup-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.detector-backup-label {
  display: block;
  font-size: 0.92rem;
}
.detector-backup-summary {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.detector-backup-changes {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.detector-backup-changes li {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.28rem 0.35rem;
  margin: 0;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent-dim) 70%, var(--panel));
  font-size: 0.76rem;
  line-height: 1.35;
}
.detector-backup-chg-key {
  font-weight: 700;
  color: var(--text);
}
.detector-backup-chg-from,
.detector-backup-diff .chg-from {
  color: #f0b6b6;
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, #f0b6b6 55%, transparent);
}
.detector-backup-chg-to,
.detector-backup-diff .chg-to {
  color: #b6f0c8;
  font-weight: 700;
}
.detector-backup-chg-arrow {
  color: var(--muted);
}
.detector-backup-pill {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.detector-backup-pill.is-now {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.detector-backup-pill.is-warn {
  color: #f0c98a;
  border-color: color-mix(in srgb, #f0c98a 45%, var(--line));
}
.detector-backup-warn {
  margin: 0.45rem 0 0;
  color: #f0c98a;
  font-size: 0.8rem;
}
.detector-backup-actions {
  flex: 0 0 auto;
}
.detector-backup-actions .ghost {
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  font-size: 0.82rem;
}
.detector-backup-details {
  margin-top: 0.55rem;
}
.detector-backup-details > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}
.detector-backup-note,
.detector-backup-details .setting-help {
  margin: 0.45rem 0 0;
}
.detector-backup-diff-label {
  margin: 0.65rem 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}
.detector-backup-diff {
  margin: 0;
  padding: 0 0 0 1.05rem;
  font-size: 0.8rem;
  line-height: 1.45;
}
.detector-backup-diff code {
  font-size: 0.78rem;
}
.detector-backup-values {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.45rem 0.85rem;
  margin: 0.7rem 0 0;
}
.detector-backup-values > div {
  margin: 0;
}
.detector-backup-values dt {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.detector-backup-values dd {
  margin: 0.08rem 0 0;
  font-size: 0.86rem;
}
.detector-revert-form {
  display: none;
}

/* Compact phone header: one-line controls, with full labels and 44px targets. */
@media (max-width: 900px) {
  .top { padding: .35rem .6rem; gap: .2rem; }
  .top .brand-icon { width: 28px; height: 24px; }
  .top-nav { gap: .15rem; flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
  .top-nav > a, .top-nav .nav-menu-btn {
    flex-direction: row;
    gap: .3rem;
    padding: .3rem .5rem;
    min-height: 44px;
    min-width: 44px;
    box-sizing: border-box;
  }
  .top-nav > a .ico, .top-nav .nav-menu-btn > .ico:not(.nav-caret) {
    width: 1rem; height: 1rem;
  }
  .top-nav .nav-female { font-size: 1.1rem; }
  .top-nav .nav-label { font-size: .72rem; }
  .top-nav .nav-menu-btn .nav-caret { position: static; width: .6rem; height: .6rem; }
  .top-nav .nav-menu-btn .nav-count { position: static; font-size: .65rem; padding: .1rem .3rem; }
  .case-tools { padding: .35rem; gap: .3rem; }
  .case-tools .case-actions { gap: .3rem; }
  .case-tools button, .case-tools a.ghost { min-height: 44px; padding: .3rem .5rem; font-size: .78rem; }
}

/* Direct mobile navigation: all icons fit on one row. */
@media (max-width: 900px) {
  .top-nav { display: flex; flex-wrap: nowrap; gap: 0; overflow: visible; }
  .top-nav > a, .top-nav > .nav-menu, .top-nav > .account-menu, .top-nav > .who {
    flex: 1 1 0; min-width: 0; margin: 0;
  }
  .top-nav > a, .top-nav .nav-menu-btn, .top-nav .account-btn, .top-nav > .who {
    min-width: 0; width: 100%; min-height: 44px; height: 44px;
    padding: .25rem; justify-content: center; box-sizing: border-box;
  }
  .top-nav .nav-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .top-nav > a .ico, .top-nav .nav-menu-btn > .ico:not(.nav-caret) {
    width: 1.25rem; height: 1.25rem;
  }
  .top-nav .nav-female { font-size: 1.4rem; }
  .top-nav .nav-menu-btn .nav-caret { display: none; }
  .top-nav .nav-menu-btn .nav-count {
    position: absolute; right: 0; top: 0; max-width: 2rem;
    overflow: hidden; text-overflow: ellipsis; font-size: .6rem; padding: 0 .2rem;
  }
}

/* Phone rails remain swipeable without a persistent horizontal scrollbar. */
@media (max-width: 900px) {
  .top-nav,
  .settings-nav-list,
  .nearby-clip-rail,
  .veto-rail-scroll {
    scrollbar-width: none;
  }
  .top-nav::-webkit-scrollbar,
  .settings-nav-list::-webkit-scrollbar,
  .nearby-clip-rail::-webkit-scrollbar,
  .veto-rail-scroll::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 900px) {
  /* Match the account menu's positioning width; wrap long email addresses. */
  .account-dropdown {
    width: 12.5rem;
    overflow-wrap: anywhere;
  }
  .account-meta { min-width: 0; }
}
