/* Dark Occult UI */
:root{
  --bg: #07070a;
  --panel: rgba(10, 10, 16, 0.86);
  --panel2: rgba(14, 14, 22, 0.92);
  --text: rgba(240, 240, 255, 0.92);
  --muted: rgba(240, 240, 255, 0.64);
  --line: rgba(255, 255, 255, 0.10);
  --accent: rgba(220, 180, 120, 0.95);
  --accent2: rgba(150, 110, 220, 0.95);
  --danger: rgba(240, 80, 90, 0.95);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
}

*{ box-sizing:border-box; }
html, body { height:100%; margin:0; background: var(--bg); color: var(--text); font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; }

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 10, 16, 0.95), rgba(10, 10, 16, 0.78));
  position: sticky;
  top:0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.brand{ display:flex; gap:12px; align-items:center; }
.sigil{
  width: 34px; height: 34px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 30%, rgba(220, 180, 120, 0.9), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(150, 110, 220, 0.7), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.title{ font-weight: 700; letter-spacing: 0.4px; }
.subtitle{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.controls{ display:flex; gap:10px; align-items:center; }

/* =========================
   St. Brielle — Cycle Backgrounds
   (Cycle-reactive, subtle, mythos-forward)
   ========================= */
:root{


  /* default background layer (All / neutral) */
  --sb-bg-img: var(--sb-bg-img-all);
  --sb-bg-opacity: 0.22;
  --sb-bg-sat: 1.05;
  --sb-bg-contrast: 1.08;
}

/* Make room for a fixed background layer behind everything */
body{ position:relative; }

/* Background layer: image + mythic gradients */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;

  /* Always draw a base gradient so missing images still look intentional */
  background-image:
    var(--sb-bg-img),
    radial-gradient(1200px 900px at 18% 22%, rgba(220, 180, 120, 0.10), transparent 58%),
    radial-gradient(900px 700px at 82% 30%, rgba(150, 110, 220, 0.10), transparent 55%),
    radial-gradient(1100px 900px at 55% 90%, rgba(60, 120, 255, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.84));

  background-size: cover, cover, cover, cover, cover;
  background-position: center, center, center, center, center;
  background-repeat: no-repeat;

  opacity: var(--sb-bg-opacity);
  filter: saturate(var(--sb-bg-sat)) contrast(var(--sb-bg-contrast));
}

/* Cycle → swaps the background image and slightly shifts mood */
body.cycle-ink{
  --sb-bg-img: var(--sb-bg-img-ink);
  --sb-bg-opacity: 0.26;
  --sb-bg-sat: 0.92;
  --sb-bg-contrast: 1.10;
}

body.cycle-brass{
  --sb-bg-img: var(--sb-bg-img-brass);
  --sb-bg-opacity: 0.24;
  --sb-bg-sat: 0.98;
  --sb-bg-contrast: 1.12;
}

body.cycle-water{
  --sb-bg-img: var(--sb-bg-img-water);
  --sb-bg-opacity: 0.23;
  --sb-bg-sat: 0.96;
  --sb-bg-contrast: 1.08;
}

body.cycle-code{
  --sb-bg-img: var(--sb-bg-img-code);
  --sb-bg-opacity: 0.28;
  --sb-bg-sat: 1.08;
  --sb-bg-contrast: 1.16;
}

/* Investigate gets a hair more pressure */
body[data-ui-mode="investigate"]::before{
  opacity: calc(var(--sb-bg-opacity) + 0.04);
}
  
*{ box-sizing:border-box; }
html, body { height:100%; margin:0; background: var(--bg); color: var(--text); font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; }

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 10, 16, 0.95), rgba(10, 10, 16, 0.78));
  position: sticky;
  top:0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.brand{ display:flex; gap:12px; align-items:center; }
.sigil {
  background-image: url('/img/badge.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
    filter: drop-shadow(0 0 6px rgba(250, 205, 58, 0.35));
   width: 54px;
  height: 54px;
  object-fit: contain;
}

.title{ font-weight: 700; letter-spacing: 0.4px; }
.subtitle{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.controls{ display:flex; gap:10px; align-items:center; }

/* UI Mode switcher (Explore / Investigate / Search / Controls) */
.modebar{
  display:flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}
.modebtn{
  border-radius: 999px;
  padding: 7px 10px;
  box-shadow: none; 
}
.modebtn.active{
  background: rgba(220, 180, 120, 0.22) !important;
  border-color: rgba(220, 180, 120, 0.50) !important;
}

.explore-toggle{
  min-width: 38px;
  padding-inline: 10px;
}

.modebar{ position: relative; }

.explore-chooser{
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 28px));
  z-index: 1400;
}
.explore-chooser.hidden{ display:none; }
.explore-chooser-inner{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,10,16,.94);
  box-shadow: 0 24px 70px rgba(0,0,0,.46);
  padding: 14px;
  backdrop-filter: blur(14px);
}
.explore-chooser-title{
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.explore-chooser-subtitle{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.explore-chooser-actions{
  display:grid;
  gap:10px;
  margin-top: 12px;
}
.explore-option{
  display:block;
  width:100%;
  text-align:left;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 12px;
  cursor:pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.explore-option:hover{
  background: rgba(220,180,120,.10);
  border-color: rgba(220,180,120,.34);
}
.explore-option-title{
  display:block;
  font-weight: 800;
}
.explore-option-copy{
  display:block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.tour-overlay{
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 32px));
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) auto;
  align-items: end;
  gap: 14px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(180deg, rgba(20,22,30,.97), rgba(10,12,18,.95));
  box-shadow: 0 18px 48px rgba(0,0,0,.38);
  backdrop-filter: blur(12px);
  padding: 14px 16px;
}
.tour-overlay.hidden{ display:none; }
.tour-overlay-kicker{
  grid-column: 1 / 2;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.tour-overlay-progress{
  grid-column: 1 / 2;
  margin-top: -8px;
  font-size: 11px;
  color: var(--muted);
}
.tour-overlay-title{
  grid-column: 1 / 2;
  margin-top: -2px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}
.tour-overlay-text{
  grid-column: 1 / 2;
  margin-top: -4px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(240,240,255,.78);
  max-width: 56ch;
}
.tour-overlay-actions{
  grid-column: 2 / 3;
  grid-row: 1 / span 4;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  align-self:center;
  min-width: 210px;
  margin-top: 0;
  padding-top: 0;
  padding-left: 18px;
  border-top: 0;
  border-left: 1px solid rgba(255,255,255,.08);
}

.tour-overlay-actions .btn,
.tour-overlay-actions button{
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  box-shadow: none;
  white-space: nowrap;
}
.tour-overlay-actions .btn:hover,
.tour-overlay-actions button:hover{
  background: rgba(255,255,255,.08);
}

html[data-theme="light"] .explore-chooser-inner,
html[data-theme="light"] .tour-overlay{
  background: rgba(255,255,255,.96) !important;
  color:#162031 !important;
  border-color: rgba(52,77,118,.16) !important;
  box-shadow: 0 22px 60px rgba(49,72,112,.14) !important;
}
html[data-theme="light"] .explore-option{
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(243,247,251,.94)) !important;
  color:#162031 !important;
  border-color: rgba(52,77,118,.16) !important;
}
html[data-theme="light"] .explore-option-copy,
html[data-theme="light"] .explore-chooser-subtitle,
html[data-theme="light"] .tour-overlay-kicker,
html[data-theme="light"] .tour-overlay-progress,
html[data-theme="light"] .tour-overlay-text{
  color: rgba(22,32,49,.72) !important;
}

@media (max-width: 900px){
  .explore-chooser{
    left: 14px;
    right: 14px;
    width: auto;
    transform: none;
  }
  .tour-overlay{
    left: 14px;
    right: 14px;
    bottom: 12px;
    transform: none;
    width: auto;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }
  .tour-overlay-kicker,
  .tour-overlay-progress,
  .tour-overlay-title,
  .tour-overlay-text{
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .tour-overlay-actions{
    grid-column: 1 / -1;
    grid-row: auto;
    justify-content: flex-start;
    min-width: 0;
    padding-left: 0;
    padding-top: 10px;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.08);
  }
}

body[data-ui-mode="search"] .searchwrap{ outline: 2px solid rgba(220, 180, 120, 0.25); border-radius: 14px; }
.btn{
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  cursor:pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}
.btn:hover{ background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.22); }
.btn:active{ transform: translateY(1px); }
.btn.ghost{ background: rgba(220, 180, 120, 0.10); border-color: rgba(220, 180, 120, 0.25); }
.btn.ghost.active{ background: rgba(220, 180, 120, 0.20); border-color: rgba(220, 180, 120, 0.45); }

/* ===== UI MODES ===== */
body[data-ui-mode]{
  --ui-split-gap: 12px;
}

/* Investigate = split Caseboard + Archive */
body[data-ui-mode="investigate"] .caseboard{
  inset: 12px calc(50% + (var(--ui-split-gap) / 2)) 12px 12px;
  z-index: 4450;
}
body[data-ui-mode="investigate"] .archive{
  inset: 12px 12px 12px calc(50% + (var(--ui-split-gap) / 2));
  z-index: 4400;
}

/* Hide the standalone toggles we don't want emphasized in investigate */
body[data-ui-mode="investigate"] #toggleSidebar,
body[data-ui-mode="investigate"] #togglePlacement{
  display: none;
}

/* Controls overlay */
.controls-panel{ position: fixed; inset: 0; z-index: 4600; }
.controls-panel.hidden{ display:none; }
.controls-panel::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
}
.controls-panel-inner{
  position:absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  width: min(920px, calc(100vw - 24px));
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 16, 0.92);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.70);
  overflow: hidden;
}
.controls-panel-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
}
.controls-panel-title{ font-weight: 900; }
.controls-panel-body{ padding: 12px 14px 14px; }
.controls-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.controls-card{
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  min-height: 84px;
}
@media (max-width: 900px){
  .controls-grid{ grid-template-columns: 1fr; }
}

.layout{
  height: calc(100vh - 58px);
  display:grid;
  grid-template-columns: 1fr 380px;
}

.map{ height: 100%; width: 100%; position:relative; }

.sidebar{
  height: 100%;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow);
  overflow:auto;
}

.sidebar.hidden{ display:none; }

.sidebar-inner{ padding: 16px 16px 22px; }
.sidebar-head{ padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.panel-title{ font-size: 18px; font-weight: 700; }
.panel-meta{ font-size: 12px; color: var(--muted); margin-top: 6px; }

.panel-body p{ line-height: 1.45; }
.muted{ color: var(--muted); }

.h3{ font-size: 13px; letter-spacing: 0.4px; text-transform: uppercase; color: rgba(240, 240, 255, 0.78); margin: 16px 0 8px; }
.divider{ height: 1px; background: var(--line); margin: 14px 0; }

.list{ margin: 0; padding-left: 18px; color: rgba(240, 240, 255, 0.86); }
.list li{ margin: 6px 0; }

code{
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 12px;
}

.toast{
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 2000;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(10, 10, 16, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  color: rgba(240, 240, 255, 0.9);
  max-width: 560px;
  display:none;
}

/* Leaflet theming */
.leaflet-container{
  background: #000;
}
.leaflet-control-layers{
  background: rgba(10, 10, 16, 0.75) !important;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(10px);
}
.leaflet-control-layers label{ color: var(--text); }

.leaflet-tooltip{
  background: rgba(10, 10, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(240, 240, 255, 0.95);
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
}

/* Search */
.searchwrap{ position: relative; width: min(44vw, 420px); }
.search{
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}
.search::placeholder{ color: rgba(240, 240, 255, 0.45); }
.search:focus{
  border-color: rgba(220, 180, 120, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.search-results{
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  background: rgba(10, 10, 16, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 1600;
  backdrop-filter: blur(10px);
}

.search-item{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  cursor: pointer;
}
.search-item:last-child{ border-bottom: none; }
.search-item:hover, .search-item.active{
  background: rgba(220, 180, 120, 0.12);
}
.search-item .label{ font-weight: 700; }
.search-item .meta{ font-size: 12px; color: var(--muted); margin-top: 4px; }

.pill{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: rgba(240, 240, 255, 0.86);
}

/* Sidebar actions */
.panel-actions{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top: 10px;
}
.action{
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  cursor:pointer;
}
.action:hover{ background: rgba(255, 255, 255, 0.10); }
.action.active{
  background: rgba(220, 180, 120, 0.18);
  border-color: rgba(220, 180, 120, 0.45);
}
.action.starred{
  background: rgba(220, 180, 120, 0.18);
  border-color: rgba(220, 180, 120, 0.45);
}


/* Control strip */
.strip{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 10, 16, 0.82), rgba(10, 10, 16, 0.62));
  backdrop-filter: blur(10px);
  position: sticky;
  top: 58px;
  z-index: 999;
}
.strip-left{ display:flex; gap:14px; flex-wrap: wrap; align-items:center; }
.strip-right{ display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.seg{ display:flex; gap:8px; align-items:center; padding: 6px 8px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.10); background: rgba(255, 255, 255, 0.04); }
.seg-label{ font-size: 12px; color: var(--muted); }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.chip{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select:none;
  font-size: 12px;
}
.chip input{ accent-color: rgba(220, 180, 120, 0.95); }

.slider{ width: 160px; }

/* Legend */
.legend{
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 12px 12px 10px;
  margin-bottom: 12px;
}
.legend-title{ font-weight: 800; letter-spacing: 0.3px; }
.legend-grid{ display:grid; grid-template-columns: 1fr; gap: 10px; }
.legend-item{ display:flex; gap:10px; align-items:flex-start; }
.dot{ width: 12px; height: 12px; border-radius: 999px; margin-top: 4px; border: 1px solid rgba(255, 255, 255, 0.22); }
.dot.region{ background: rgba(220, 180, 120, 0.35); border-color: rgba(220, 180, 120, 0.65); }
.dot.road{ background: rgba(150, 110, 220, 0.40); border-color: rgba(150, 110, 220, 0.75); }
.dot.landmark{ background: rgba(220, 180, 120, 0.75); border-color: rgba(255, 255, 255, 0.25); }
.dot.fog{ background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.20); }
.dot.pulse{ background: rgba(240, 80, 90, 0.30); border-color: rgba(240, 80, 90, 0.75); }
.dot.link{ background: rgba(120, 200, 240, 0.18); border-color: rgba(120, 200, 240, 0.55); }

/* Ambience overlay */
body.ambience-on::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events:none;
  z-index: 3000;
  opacity: 0.18;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, rgba(0, 0, 0, 0) 1px 6px),
    radial-gradient(circle at 20% 10%, rgba(150, 110, 220, 0.10), transparent 42%),
    radial-gradient(circle at 80% 70%, rgba(220, 180, 120, 0.08), transparent 45%);
  mix-blend-mode: overlay;
  animation: drift 9s linear infinite;
}
@keyframes drift{
  0%{ transform: translate3d(0,0,0); }
  100%{ transform: translate3d(-20px, 20px, 0); }
}

/* Tour controls */
.btn.small{ padding: 6px 8px; border-radius: 12px; }
.btn.active{
  background: rgba(220, 180, 120, 0.20);
  border-color: rgba(220, 180, 120, 0.45);
}


/* Lightbox */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
}
.lightbox.active{ display: block; }

.lightbox-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
}

.lightbox-figure{
  position: absolute;
  inset: 6vh 6vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lightbox-figure img{
  max-width: 100%;
  max-height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

.lightbox-figure figcaption{
  margin-top: 12px;
  color: rgba(240, 240, 255, 0.9);
  font-size: 13px;
  text-align: center;
  pointer-events: auto;
}

.lightbox-close{
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 10, 16, 0.7);
  color: rgba(240, 240, 255, 0.9);
  cursor: pointer;
  pointer-events: auto;
}
.lightbox-close:hover{
  background: rgba(240, 80, 90, 0.8);
}


/* Lightbox v2 */
.lightbox-toolbar{
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 4100;
  pointer-events: auto;
}
.lb-spacer{ flex: 1; }
.lb-counter{
  font-size: 12px;
  color: rgba(240, 240, 255, 0.86);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 16, 0.55);
}
.lb-btn{
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 10, 16, 0.6);
  color: rgba(240, 240, 255, 0.92);
  cursor: pointer;
}
.lb-btn:hover{ background: rgba(255, 255, 255, 0.10); }
.lb-btn.ghost{ background: rgba(255, 255, 255, 0.06); }
.lb-btn.danger:hover{ background: rgba(240, 80, 90, 0.85); border-color: rgba(240, 80, 90, 0.95); }
.lb-btn.active{
  background: rgba(220, 180, 120, 0.18);
  border-color: rgba(220, 180, 120, 0.55);
}

.lb-stage{
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.lb-stage img{
  transform-origin: center center;
  pointer-events: auto;
  cursor: grab;
}
.lb-stage img:active{ cursor: grabbing; }

.lightbox.archival-on .lightbox-backdrop{
  background: rgba(0, 0, 0, 0.88);
}
.lightbox.archival-on::after{
  content:"";
  position: fixed;
  inset: 0;
  z-index: 4050;
  pointer-events:none;
  opacity: 0.22;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, rgba(0, 0, 0, 0) 1px 7px),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.06), transparent 42%),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.05), transparent 46%);
  mix-blend-mode: overlay;
  animation: flicker 2.8s infinite steps(2);
}
@keyframes flicker{
  0%{ opacity: 0.10; transform: translate3d(0,0,0); }
  10%{ opacity: 0.20; }
  22%{ opacity: 0.14; transform: translate3d(-2px, 1px, 0); }
  35%{ opacity: 0.24; }
  58%{ opacity: 0.13; transform: translate3d(2px, -1px, 0); }
  70%{ opacity: 0.21; }
  100%{ opacity: 0.12; transform: translate3d(0,0,0); }
}

/* Hotspots */
.lb-hotspots{
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.lb-dot{
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(220, 180, 120, 0.9);
  background: rgba(220, 180, 120, 0.24);
  box-shadow: 0 0 0 6px rgba(220, 180, 120, 0.10);
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.lb-dot:hover{
  background: rgba(240, 80, 90, 0.25);
  border-color: rgba(240, 80, 90, 0.95);
  box-shadow: 0 0 0 10px rgba(240, 80, 90, 0.10);
}

/* Popover */
.lb-popover{
  position: absolute;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  width: min(560px, 92vw);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 16, 0.92);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  padding: 12px 14px 12px;
  display: none;
  z-index: 4200;
}
.lb-popover.active{ display: block; }
.lb-popover-title{ font-weight: 800; margin-bottom: 6px; }
.lb-popover-body{ color: rgba(240, 240, 255, 0.88); font-size: 13px; line-height: 1.35; }
.lb-pop-close{
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(240, 240, 255, 0.9);
  cursor: pointer;
  padding: 4px 8px;
}
.lb-pop-close:hover{ background: rgba(240, 80, 90, 0.85); border-color: rgba(240, 80, 90, 0.95); }


/* Tooltip readability */
.sb-tooltip{
  background: rgba(10, 10, 16, 0.92) !important;
  color: rgba(240, 240, 255, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 12px !important;
  padding: 8px 10px !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65) !important;
}
.sb-tooltip b{ color: rgba(220, 180, 120, 0.95) !important; }

/* Region label styling */
.region-label{ background: transparent !important; border: none !important; }
.region-label span{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(10, 10, 16, 0.55);
  color: rgba(240, 240, 255, 0.86);
  font-weight: 800;
  letter-spacing: 0.2px;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.9);
}

/* Hotspot types */
.lb-dot[data-type="warning"]{ border-color: rgba(240, 80, 90, 0.95); background: rgba(240, 80, 90, 0.22); box-shadow: 0 0 0 8px rgba(240, 80, 90, 0.10); }
.lb-dot[data-type="clue"]{ border-color: rgba(120, 200, 240, 0.85); background: rgba(120, 200, 240, 0.18); box-shadow: 0 0 0 8px rgba(120, 200, 240, 0.10); }
.lb-dot[data-type="audio"]{ border-color: rgba(150, 110, 220, 0.9); background: rgba(150, 110, 220, 0.22); box-shadow: 0 0 0 8px rgba(150, 110, 220, 0.10); }

/* Jump button in popover */
.lb-popover .lb-jump{
  margin-top: 10px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(240, 240, 255, 0.92);
  cursor: pointer;
}
.lb-popover .lb-jump:hover{
  background: rgba(220, 180, 120, 0.14);
  border-color: rgba(220, 180, 120, 0.45);
}


/* Documents lightbox */
.docbox{
  position: fixed;
  inset: 0;
  z-index: 4500;
  display: none;
}
.docbox.active{ display:block; }
.docbox-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(4px);
}
.docbox-toolbar{
  position:absolute;
  top:14px;
  left:14px;
  right:14px;
  z-index: 4600;
  display:flex;
  gap:10px;
  align-items:center;
  pointer-events:auto;
}
.docbox-title{
  font-weight: 900;
  color: rgba(240, 240, 255, 0.94);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 16, 0.55);
  max-width: 44vw;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docbox-spacer{ flex:1; }
.docbtn{
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 10, 16, 0.6);
  color: rgba(240, 240, 255, 0.92);
  cursor: pointer;
}
.docbtn:hover{ background: rgba(255, 255, 255, 0.10); }
.docbtn.ghost{ background: rgba(255, 255, 255, 0.06); }
.docbtn.danger:hover{ background: rgba(240, 80, 90, 0.85); border-color: rgba(240, 80, 90, 0.95); }
.docbtn.active{ background: rgba(220, 180, 120, 0.18); border-color: rgba(220, 180, 120, 0.55); }

.docchip{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  cursor:pointer;
  user-select:none;
  font-size: 12px;
  color: rgba(240, 240, 255, 0.90);
}
.docchip input{ accent-color: rgba(220, 180, 120, 0.95); }

.docbox-body{
  position:absolute;
  inset: 62px 6vw 6vh;
  display:grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  z-index: 4550;
}
.docbox-view{
  position: relative;
  border-radius: 18px;
  overflow:hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 16, 0.55);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}
#docFrame{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  background: rgba(0, 0, 0, 0.2);
}
.doc-overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
}
/* Keep overlay non-interactive so the iframe beneath can still scroll.
   Interactive children (hotspots/redactions) explicitly opt-in below. */
.doc-overlay.on{ pointer-events:auto; }


.docbox-side{
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 16, 0.70);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  padding: 12px 12px 10px;
  overflow:auto;
}
.docmeta-row{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items:center;
  margin: 6px 0;
}
.badge{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.doc-hot{
  position:absolute;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(120, 200, 240, 0.90);
  background: rgba(120, 200, 240, 0.22);
  box-shadow: 0 0 0 10px rgba(120, 200, 240, 0.10);
  cursor: pointer;
}
.doc-hot:hover{
  border-color: rgba(240, 80, 90, 0.95);
  background: rgba(240, 80, 90, 0.18);
  box-shadow: 0 0 0 12px rgba(240, 80, 90, 0.12);
}
.doc-redact{
  position:absolute;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.doc-redact.revealed{
  background: rgba(220, 180, 120, 0.16);
  border-color: rgba(220, 180, 120, 0.45);
}
.doc-redact .doc-redact-text{
  display:none;
  position:absolute;
  inset: 0;
  padding: 6px 8px;
  font-size: 12px;
  color: rgba(240, 240, 255, 0.92);
  white-space: pre-wrap;
}
.doc-redact.revealed .doc-redact-text{ display:block; }

/* Doc overlay scroll fix: let iframe receive wheel/trackpad scroll */
.doc-overlay{ pointer-events: none !important; }
.doc-overlay.on{ pointer-events: none !important; } /* keep scroll enabled */
.doc-hot, .doc-redact{ pointer-events: auto !important; }


/* Occult redaction animation */
.doc-redact{
  overflow: hidden;
  position: absolute;
}
.doc-redact::before{
  content:"";
  position:absolute;
  inset:-20%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.05), transparent 45%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, rgba(0, 0, 0, 0) 1px 6px);
  opacity: 0;
  transform: scale(0.9);
}
.doc-redact::after{
  content:"";
  position:absolute;
  inset:-10%;
  background:
    radial-gradient(circle at 40% 40%, rgba(220, 180, 120, 0.20), transparent 55%),
    radial-gradient(circle at 60% 55%, rgba(240, 80, 90, 0.12), transparent 60%);
  opacity: 0;
  filter: blur(6px);
  mix-blend-mode: screen;
}

.doc-redact.revealed{
  animation: redact-jitter 520ms steps(2) 1;
}
.doc-redact.revealed::before{
  opacity: 0.22;
  animation: ink-bleed 900ms ease-out 1;
}
.doc-redact.revealed::after{
  opacity: 0.45;
  animation: burn-through 720ms ease-out 1;
}

@keyframes ink-bleed{
  0%{ opacity:0; transform: scale(0.85) rotate(-1deg); }
  30%{ opacity:0.32; transform: scale(1.02) rotate(0.5deg); }
  100%{ opacity:0.18; transform: scale(1.06) rotate(0deg); }
}
@keyframes burn-through{
  0%{ opacity:0; filter: blur(10px); transform: translate3d(-2px,1px,0); }
  35%{ opacity:0.55; filter: blur(6px); transform: translate3d(2px,-1px,0); }
  100%{ opacity:0.30; filter: blur(8px); transform: translate3d(0,0,0); }
}
@keyframes redact-jitter{
  0%{ transform: translate3d(0,0,0); }
  20%{ transform: translate3d(-1px,0,0); }
  40%{ transform: translate3d(2px,-1px,0); }
  60%{ transform: translate3d(-2px,1px,0); }
  80%{ transform: translate3d(1px,0,0); }
  100%{ transform: translate3d(0,0,0); }
}

/* Occult reveal text effect */
.doc-redact.revealed .doc-redact-text{
  animation: reveal-text 820ms ease-out 1;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}
@keyframes reveal-text{
  0%{ opacity:0; filter: blur(4px); transform: translate3d(0,6px,0); }
  60%{ opacity:1; filter: blur(0px); transform: translate3d(0,0,0); }
  100%{ opacity:1; }
}


/* Archive panel */
.archive{
  position: fixed;
  inset: 12px 12px 12px 12px;
  z-index: 4400;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 16, 0.88);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  overflow: hidden;
}
.archive.hidden{ display:none; }
.archive-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
}
.archive-title{
  font-weight: 900;
  letter-spacing: 0.2px;
  color: rgba(240, 240, 255, 0.95);
}
.archive-actions{ display:flex; gap: 10px; align-items:center; }
.archive-body{ padding: 12px 14px 14px; height: calc(100% - 54px); display:flex; flex-direction:column; gap: 12px; }
.archive-filters{
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}
.archive-row{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.select{
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 16, 0.65);
  color: rgba(240, 240, 255, 0.92);
  padding: 8px 10px;
}
.chip{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  cursor:pointer;
  user-select:none;
  font-size: 12px;
  color: rgba(240, 240, 255, 0.90);
}
.chip input{ accent-color: rgba(220, 180, 120, 0.95); }

.archive-main{
  flex:1;
  display:grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  min-height: 0;
}
.archive-results{
  border-radius: 18px;
  width: 380px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.20);
  padding: 10px;
  overflow: auto;
}
.archive-side{
  border-radius: 18px;
  width: 240px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  overflow: auto;
}
.archive-card{
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  margin-bottom: 10px;
}
.archive-card .title{ font-weight: 900; }
.archive-card .meta{ margin-top: 3px; color: rgba(240, 240, 255, 0.72); font-size: 12px; }
.archive-card .badges{ margin-top: 8px; display:flex; flex-wrap: wrap; gap: 8px; }
.archive-card .badge{ font-size: 12px; }
.archive-card .actions{ margin-top: 10px; display:flex; gap: 8px; flex-wrap: wrap; }
.archive-card .actions .action{ border-radius: 12px; }

/* Caseboard */
.caseboard{
  position: fixed; inset: 12px; z-index: 4450;
  border-radius: 22px; border:1px solid rgba(255, 255, 255, .12);
  background: rgba(10, 10, 16, .9); box-shadow:0 40px 120px rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px); overflow:hidden;
}
.caseboard.hidden{display:none}

/* UI_MODE=investigate: split Caseboard dimensions + Archive side-by-side */
body[data-ui-mode="investigate"] .caseboard{
  inset: 12px calc(35% + 6px) 12px 12px;
  z-index: 4450;
}
body[data-ui-mode="investigate"] .archive{
  inset: 12px 12px 12px calc(65% + 6px);
  z-index: 4400;
}

/* Reduce visual noise in Explore by hiding deep tooling buttons */
body[data-ui-mode="explore"] #toggleCaseboard,
body[data-ui-mode="explore"] #toggleArchive,
body[data-ui-mode="explore"] #toggleCharacters,
body[data-ui-mode="explore"] #toggleEntities,
body[data-ui-mode="explore"] #toggleManifestations{
  display:none;
}

/* Search mode leans on search + lore panel */
body[data-ui-mode="search"] #controlStrip .strip-right{
  opacity: 0.6;
}

/* Controls mode: keep primary tools visible, but we will also show an overlay */
body[data-ui-mode="controls"] #controlStrip{ box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45); }
.caseboard-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px; border-bottom:1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04)
}
.caseboard-title{font-weight:900;color:rgba(240, 240, 255, .95)}
.caseboard-actions{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.caseboard-body{display:grid; grid-template-columns: 1fr 320px; height: calc(100% - 54px)}
.caseboard-canvas{position:relative; background:
  radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .04), transparent 40%),
  radial-gradient(circle at 70% 80%, rgba(255, 255, 255, .03), transparent 46%),
  repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, rgba(0, 0, 0, 0) 1px 8px);
  overflow:hidden; cursor:grab}
.caseboard-canvas:active{cursor:grabbing}
.caseboard-side{padding:10px; border-left:1px solid rgba(255, 255, 255, .12); overflow:auto}
.cb-node{
  position:absolute; min-width:160px; max-width:240px;
  border-radius:14px; border:1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06); color:rgba(240, 240, 255, .95);
  box-shadow:0 20px 60px rgba(0, 0, 0, .5); padding:10px; cursor:move;
}
.cb-node .title{font-weight:900}
.cb-node .meta{font-size:12px; opacity:.8}
.cb-node.doc{border-color: rgba(220, 180, 120, .45)}
.cb-node.loc{border-color: rgba(120, 200, 240, .45)}
.cb-node.note{border-color: rgba(240, 80, 90, .45)}
.cb-node .actions{display:flex; gap:6px; margin-top:8px; flex-wrap:wrap}
.cb-thread{
  position:absolute; pointer-events:auto;
}
.cb-thread svg{overflow:visible}
.cb-thread path{
  fill:none; stroke: rgba(220, 180, 120, .6); stroke-width:2.2;
  filter: drop-shadow(0 0 6px rgba(220, 180, 120, .35));
}
.cb-thread:hover path{stroke: rgba(240, 80, 90, .9)}

.textarea{
  width:100%;
  min-height: 140px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 16, 0.65);
  color: rgba(240, 240, 255, 0.92);
  padding: 10px 10px;
  resize: vertical;
}

.cb-node.selected{ box-shadow:0 0 0 3px rgba(220, 180, 120, .45), 0 20px 60px rgba(0, 0, 0, .55); }
.cb-thread.selected path{ stroke: rgba(120, 200, 240, .95); stroke-width: 3.2; }
.cb-connector{
  position:absolute;
  right: 10px;
  top: 10px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.04);
  cursor: crosshair;
}
.cb-connector:hover{
  border-color: rgba(240, 80, 90, .9);
  background: rgba(240, 80, 90, .18);
  box-shadow: 0 0 0 12px rgba(240, 80, 90, .10);
}
.cb-thread text{
  font-size: 12px;
  fill: rgba(240, 240, 255, .85);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .65);
  stroke-width: 3px;
}

/* Caseboard stitch thread reason stamp */
.cb-thread text.cb-thread-stamp{
  font-size: 10px;
  letter-spacing: .14em;
  fill: rgba(244, 240, 230, .78);
  opacity: .72;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .45);
  stroke-width: 2px;
}

.cb-thread-stamp{
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .72;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 6px rgba(0,0,0,.55));
}

/* If SVG text */
svg .cb-thread-stamp{
  fill: rgba(244,240,230,.78); /* bone */
}

/* If HTML */
.cb-thread-stamp{
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(244,240,230,.22);
  background: rgba(7,7,11,.55);
}
.cb-ghostline{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.cb-ghostline svg path{
  fill:none;
  stroke: rgba(240, 80, 90, .75);
  stroke-width: 2.6;
  stroke-dasharray: 6 6;
  filter: drop-shadow(0 0 6px rgba(240, 80, 90, .3));
}


/* Occult string animation */
.cb-thread path{
  stroke-dasharray: 6 6;
  animation: stringPulse 4s linear infinite;
}
@keyframes stringPulse{
  to{ stroke-dashoffset: -120; }
}

/* Sigil stamps */
.cb-node.doc::before,
.cb-node.loc::before,
.cb-node.note::before{
  content:'';
  position:absolute;
  left:10px;
  bottom:10px;
  width:26px;
  height:26px;
  opacity:.35;
  background-size:contain;
  background-repeat:no-repeat;
}
.cb-node.doc::before{
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="46" fill="none" stroke="gold" stroke-width="6"/><path d="M50 10 L50 90 M10 50 L90 50" stroke="gold" stroke-width="6"/></svg>');
}
.cb-node.loc::before{
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><polygon points="50,6 94,50 50,94 6,50" fill="none" stroke="deepskyblue" stroke-width="6"/></svg>');
}
.cb-node.note::before{
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M10 50 Q50 10 90 50 Q50 90 10 50 Z" fill="none" stroke="crimson" stroke-width="6"/></svg>');
}
.badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  font-size: 12px;
  margin-right: 6px;
}

#charactersPanel{
  pointer-events: auto;
}

#map{
  pointer-events: auto;
}

#charactersPanel{
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  border-radius: 14px;
}

#charactersPanel .panel-header{
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(6px);
  z-index: 1;
}
.panel{
  padding-top: 0px; /* matches top nav height */
}

.searchwrap{
  position: relative;
  left: auto;
  margin: 0 auto;


}
.char-card{
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.char-thumb{
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .06);
}

.char-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.char-body{
  flex: 1;
}
.region-bubble{
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .55);
  color: rgba(255, 255, 255, .92);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .2px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}

.region-bubble:hover{
  background: rgba(0, 0, 0, .7);
}

.region-bubble:active{
  transform: translateY(1px);
}
/* Timeline controls */
.timeline-controls{ display:flex; gap:6px; align-items:center; }
.timeline-controls .btn{ padding:4px 8px; border-radius:10px; }

/* Tiny event pips under timeline */
.timeline-pips{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:6px;
  opacity:.9;
}
.timeline-pip{
  width:8px; height:8px;
  border-radius:999px;
  border:1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .10);
  cursor:pointer;
}
.timeline-pip:hover{ transform: translateY(-1px); }
.timeline-pip.active{ background: rgba(255, 255, 255, .55); }

/* Cycle grade overlays */
#map{ position:relative; }
#map::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:850;
  opacity:.35;
  mix-blend-mode: overlay;
  transition: opacity .35s ease;
}
#map::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:851;
  opacity:.12;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 3px 3px; /* subtle grain */
  mix-blend-mode: overlay;
}

/* Per-cycle looks (body data attribute set by JS) */
body[data-cycle="ink"]  #map::before{ background: radial-gradient(circle at 20% 25%, rgba(220, 180, 120, .22), transparent 45%), linear-gradient(120deg, rgba(0, 0, 0, .25), rgba(60, 40, 20, .25)); opacity:.42; }
body[data-cycle="brass"]#map::before{ background: radial-gradient(circle at 75% 20%, rgba(180, 140, 255, .22), transparent 45%), linear-gradient(120deg, rgba(10, 10, 18, .25), rgba(80, 60, 140, .20)); opacity:.38; }
body[data-cycle="water"]#map::before{ background: radial-gradient(circle at 35% 75%, rgba(120, 190, 255, .22), transparent 45%), linear-gradient(120deg, rgba(0, 0, 0, .20), rgba(10, 40, 60, .22)); opacity:.36; }
body[data-cycle="code"] #map::before{ background: radial-gradient(circle at 60% 60%, rgba(255, 255, 255, .18), transparent 50%), linear-gradient(120deg, rgba(0, 0, 0, .25), rgba(80, 80, 80, .18)); opacity:.30; }

/* Transition flash when swapping cycles */
#map.cycle-flash::before{
  opacity:.75;
}
/* ===========================
   Timeline + Cycle FX (FINAL)
   =========================== */

.seg .timeline-controls{
  display:inline-flex;
  gap:6px;
  margin-left:10px;
  vertical-align:middle;
}
.seg .timeline-controls .btn{
  padding:4px 10px;
  border-radius:12px;
}

/* pips */
.timeline-pips{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:6px;
  padding-left:2px;
  opacity:.95;
}
.timeline-pip{
  width:10px;
  height:10px;
  border-radius:999px;
  border:1px solid rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .10);
  cursor:pointer;
  transition: transform .12s ease, background .25s ease, opacity .25s ease;
}
.timeline-pip:hover{ transform: translateY(-1px) scale(1.05); }
.timeline-pip.active{
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 0 0 6px rgba(220, 180, 120, .10), 0 0 18px rgba(220, 180, 120, .18);
}

/* map overlays */
#map{ position:relative; }

/* Grade layer */
#map::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:850;
  opacity:.35;
  mix-blend-mode: overlay;
  transition: opacity .35s ease, filter .35s ease;
}

/* Grain layer */
#map::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:851;
  opacity:.12;
  background-image:
    radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

/* per-cycle grade */
body[data-cycle="ink"] #map::before{
  background:
    radial-gradient(circle at 18% 20%, rgba(220, 180, 120, .22), transparent 45%),
    linear-gradient(120deg, rgba(0, 0, 0, .30), rgba(60, 40, 20, .25));
  opacity:.48;
}
body[data-cycle="brass"] #map::before{
  background:
    radial-gradient(circle at 78% 18%, rgba(180, 140, 255, .22), transparent 45%),
    linear-gradient(120deg, rgba(10, 10, 18, .28), rgba(80, 60, 140, .20));
  opacity:.42;
}
body[data-cycle="water"] #map::before{
  background:
    radial-gradient(circle at 35% 78%, rgba(120, 190, 255, .22), transparent 45%),
    linear-gradient(120deg, rgba(0, 0, 0, .22), rgba(10, 40, 60, .22));
  opacity:.40;
}
body[data-cycle="code"] #map::before{
  background:
    radial-gradient(circle at 60% 60%, rgba(255, 255, 255, .16), transparent 52%),
    linear-gradient(120deg, rgba(0, 0, 0, .28), rgba(80, 80, 80, .18));
  opacity:.34;
}

/* occult flash */
#map.cycle-flash::before{ opacity:.82; }

/* extra: subtle “pulse” on cycle change */
@keyframes cyclePulse{
  0%{ filter: saturate(1) contrast(1); }
  55%{ filter: saturate(1.18) contrast(1.08); }
  100%{ filter: saturate(1) contrast(1); }
}
#map.cycle-flash{ animation: cyclePulse 240ms ease-out 1; }
body[data-cycle="ink"]  :root{ --accent: rgba(220, 180, 120, 0.95); }
body[data-cycle="brass"]:root{ --accent: rgba(150, 110, 220, 0.95); }
body[data-cycle="water"]:root{ --accent: rgba(120, 200, 240, 0.95); }
body[data-cycle="code"] :root{ --accent: rgba(240, 240, 255, 0.92); }
/* ===== Enhanced Timeline ===== */
.timeline-controls{ display:flex; gap:8px; align-items:center; margin-left: 8px; }
.timeline-pips{ display:flex; gap:8px; align-items:center; margin-top: 8px; }
.timeline-pip{
  width: 26px; height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(240, 240, 255, 0.92);
  cursor: pointer;
  display:grid;
  place-items:center;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.timeline-pip:hover{ transform: translateY(-1px); background: rgba(220, 180, 120, 0.10); border-color: rgba(220, 180, 120, 0.30); }
.timeline-pip.past{ background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.24); }
.timeline-pip.active{
  background: rgba(220, 180, 120, 0.22);
  border-color: rgba(220, 180, 120, 0.52);
  box-shadow: 0 0 0 4px rgba(220, 180, 120, 0.12), 0 14px 28px rgba(0, 0, 0, 0.35);
}

.timeline-hud{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: radial-gradient(120% 140% at 10% 10%, rgba(220, 180, 120, 0.10), rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.timeline-hud::before{
  content:'';
  position:absolute;
  inset:-40%;
  background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.07), transparent 55%),
              conic-gradient(from 180deg, rgba(220, 180, 120, 0.12), rgba(150, 110, 220, 0.10), rgba(220, 180, 120, 0.12));
  filter: blur(10px);
  opacity: 0.55;
  animation: huddrift 9s linear infinite;
  pointer-events:none;
}
@keyframes huddrift{
  0%{ transform: translate3d(-6%, -2%, 0) rotate(0deg); }
  100%{ transform: translate3d(6%, 2%, 0) rotate(360deg); }
}
.timeline-hud-top{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; position:relative; }
.timeline-hud-title{ font-weight: 900; letter-spacing: 0.3px; position:relative; }
.timeline-hud-tag{ font-size: 12px; color: rgba(240, 240, 255, 0.82); position:relative; }
.timeline-hud-desc{ margin-top: 6px; font-size: 12.5px; line-height: 1.35; color: rgba(240, 240, 255, 0.86); position:relative; }
.timeline-hud-hint{ margin-top: 8px; font-size: 11px; position:relative; }

.timeline-hud.pulse-once{
  animation: hudpulse 0.55s ease-out 1;
}
@keyframes hudpulse{
  0%{ transform: scale(0.99); }
  55%{ transform: scale(1.01); }
  100%{ transform: scale(1.0); }
}

/* Cycle-tinted ambience */
body.cycle-ink .map{ filter: saturate(0.85) contrast(1.05) brightness(0.98); }
body.cycle-brass .map{ filter: saturate(0.95) contrast(1.05) sepia(0.16); }
body.cycle-water .map{ filter: saturate(0.95) contrast(1.08) hue-rotate(-10deg); }
body.cycle-code .map{ filter: saturate(1.05) contrast(1.12) brightness(1.02); }

body.cycle-ink .sigil{ box-shadow: 0 0 0 1px rgba(220, 180, 120, 0.20), 0 10px 24px rgba(0, 0, 0, 0.35); }
body.cycle-brass .sigil{ box-shadow: 0 0 0 1px rgba(220, 180, 120, 0.24), 0 10px 24px rgba(0, 0, 0, 0.35); }
body.cycle-water .sigil{ box-shadow: 0 0 0 1px rgba(180, 210, 255, 0.20), 0 10px 24px rgba(0, 0, 0, 0.35); }
body.cycle-code .sigil{ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.20), 0 10px 24px rgba(0, 0, 0, 0.35); }

/* Cycle panel bits */
.cycle-card{ border:1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); border-radius: 18px; padding: 12px; }
.cycle-card-top{ display:flex; gap:10px; align-items:flex-start; }
.cycle-badge{ min-width:72px; text-align:center; padding:6px 10px; border-radius: 999px; border:1px solid rgba(220, 180, 120, 0.34); background: rgba(220, 180, 120, 0.14); font-weight: 900; }
.cycle-tag{ font-weight: 800; }
.cycle-lore-grid{ display:grid; gap:10px; grid-template-columns: 1fr; }
.cycle-lore-item{
  text-align:left;
  border:1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 10px 12px;
  cursor:pointer;
}
.cycle-lore-item:hover{ background: rgba(220, 180, 120, 0.10); border-color: rgba(220, 180, 120, 0.26); }
.cycle-lore-term{ font-weight: 900; }
.cycle-lore-short{ font-size: 12px; margin-top: 4px; }
.linklike{
  border: none;
  background: transparent;
  color: rgba(220, 180, 120, 0.95);
  cursor:pointer;
  padding: 6px 0;
  text-align:left;
}
.linklike:hover{ text-decoration: underline; }

/* Mobile: timeline HUD collapses */
@media (max-width: 900px){
  .timeline-hud{ display:none; }
  .timeline-controls{ display:none; }
}
.kv{
  display:grid;
  grid-template-columns: 140px 1fr;
  gap:10px;
  margin:8px 0;
}
.kv .k{ opacity:.7; }
.kv .v{ opacity:.95; }

.chiprow{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.chip{
  cursor:pointer;
  border:1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .35);
  color: rgba(255, 255, 255, .9);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
}

.char-gallery{ display:flex; gap:10px; margin:10px 0 14px; flex-wrap:wrap; }
.thumb{
  width:68px; height:68px;
  border-radius:12px;
  overflow:hidden;
  border:1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .04);
}
.thumb img{ width:100%; height:100%; object-fit:cover; }
.dossier-tagline{
  font-weight:700;
  letter-spacing:.2px;
  margin: 6px 0 10px;
  opacity:.95;
}

.dossier-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.dossier-block{
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .22);
  border-radius: 14px;
  padding: 10px 12px;
}

.dossier-block h4{
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .78;
}

.chiprow{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{
  cursor:pointer;
  border:1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .32);
  color: rgba(255, 255, 255, .9);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
}
.chip:hover{ background: rgba(0, 0, 0, .45); }
/* ── Dossier Seal / Ritual Open ── */
.dossier-seal{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .22);
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}

.dossier-seal::before{
  content:"";
  position:absolute;
  inset:-40%;
  background:
    radial-gradient(circle at 40% 35%, rgba(255, 255, 255, .12), transparent 55%),
    radial-gradient(circle at 68% 62%, rgba(220, 180, 120, .10), transparent 60%),
    linear-gradient(120deg, rgba(0, 0, 0, .0), rgba(0, 0, 0, .30));
  opacity:.0;
  transform: scale(1.04);
  transition: opacity .55s ease;
  pointer-events:none;
}

.dossier-seal .seal-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.dossier-seal .seal-title{
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .92;
}

.dossier-seal .seal-stamp{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .30);
  display:grid;
  place-items:center;
  font-weight:900;
  opacity:.86;
  position: relative;
}

.dossier-seal .seal-stamp::after{
  content:"";
  position:absolute;
  inset:-8px;
  border-radius:999px;
  border: 1px dashed rgba(255, 255, 255, .18);
  opacity:.35;
}

.dossier-tagline{
  margin-top: 8px;
  font-weight: 700;
  opacity:.94;
}

.dossier-casualties{
  margin-top: 10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  border:1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .26);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  opacity:.92;
}

.dossier-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 12px;
}

/* “Ritual open” animation */
@keyframes sealOpen {
  0%   { transform: translateY(6px); opacity: 0; filter: blur(2px); }
  60%  { transform: translateY(0); opacity: 1; filter: blur(0); }
  100% { transform: translateY(0); opacity: 1; }
}

.panel .dossier-seal.ritual{
  animation: sealOpen .35s ease-out 1;
}
.panel .dossier-seal.ritual::before{
  opacity: .85;
}
/* Route 47 toggle active state */
#route47Btn.active{
  border-color: rgba(255, 255, 255, .28);
  background: rgba(0, 0, 0, .35);
}

/* Leaflet markers for Route 47 */
.route47-stop{
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .55);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .2px;
  color: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
  cursor: pointer;
  white-space: nowrap;
}

.route47-stop .dot{
  display:inline-block;
  width:8px; height:8px;
  border-radius:999px;
  margin-right:8px;
  background: rgba(255, 255, 255, .65);
  box-shadow: 0 0 12px rgba(255, 255, 255, .22);
  vertical-align: middle;
}

/* ghost bus icon */
.route47-bus{
  width: 18px; height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(0, 0, 0, .62);
  box-shadow: 0 0 18px rgba(255, 255, 255, .14);
}
#route47Btn.active{
  border-color: rgba(255, 255, 255, .28);
  background: rgba(0, 0, 0, .35);
}

.route47-stop{
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .55);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
  color: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.route47-stop .dot{
  display:inline-block;
  width:8px; height:8px;
  border-radius:999px;
  margin-right:8px;
  background: rgba(255, 255, 255, .65);
  box-shadow: 0 0 12px rgba(255, 255, 255, .22);
  vertical-align: middle;
}

.route47-bus{
  width: 18px; height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(0, 0, 0, .62);
  box-shadow: 0 0 18px rgba(255, 255, 255, .14);
}
.char-gallery{
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.char-gallery .thumb{
  margin: 0;
}

.char-gallery .thumb-btn{
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.char-gallery .thumb-btn img{
  width: 100%;
  height: 110px;
  display: block;
  object-fit: cover;
}

.char-gallery figcaption{
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.75;
}
.cb-char{
  display:grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items:start;
}

.cb-portrait{
  width:64px;
  height:64px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  object-fit: cover;
  background: rgba(0, 0, 0, .25);
}

.cb-portrait.placeholder{
  display:grid;
  place-items:center;
  font-weight:900;
  opacity:.8;
}

.cb-title{
  font-weight: 800;
  letter-spacing:.2px;
  margin-bottom: 6px;
}

.cb-row{
  display:grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  font-size: 12px;
  opacity:.92;
  margin: 2px 0;
}

.cb-k{ opacity:.65; letter-spacing:.12em; }
.cb-badge{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .25);
  font-size: 11px;
}

.cb-chips{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  margin-top: 8px;
}

.cb-chip{
  cursor:pointer;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .25);
  color: rgba(255, 255, 255, .9);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
}
.cb-chip:hover{ background: rgba(0, 0, 0, .38); }
/* Left Character Rail */
.char-rail{
  position: fixed;
  left: 12px;
  top: 140px;      /* below topbar + strip */
  bottom: 12px;
  width: 220px;
  z-index: 9998;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.char-rail.hidden{ display:none; }

.char-rail-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.char-rail-title{
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  opacity: .9;
}

.char-rail-list{
  padding: 8px;
  overflow: auto;
}

.char-rail-item{
  width:100%;
  text-align:left;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(0, 0, 0, .25);
  color: rgba(255, 255, 255, .92);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.2;
}
.char-rail-item:hover{ background: rgba(0, 0, 0, .36); }
/* ======================================
   Street View (Pannellum) Cats are Cool
   ========================= */ 

.sv-modal{
  position: fixed;
  inset: 0;
  z-index: 10050;
}
.sv-modal.hidden{ display:none; }

.sv-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0, 0, 0, .72);
}

.sv-shell{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  width: min(1100px, calc(100vw - 24px));
  height: min(720px, calc(100vh - 24px));
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}

.sv-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.sv-title{
  font-weight: 800;
  letter-spacing: .04em;
  font-size: 14px;
}
.sv-actions{ display:flex; gap: 8px; }

.sv-viewer{
  flex: 1;
  min-height: 320px;
  background: rgba(0, 0, 0, .35);
}

.sv-footer{
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}

.sb-region-streetview-btn{
  width: 100%;
  margin-top: 10px;
  margin-bottom: 8px;
  padding: 12px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    linear-gradient(135deg, rgba(44,55,82,.58), rgba(10,12,20,.82));
  color: rgba(255, 255, 255, .96);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 10px 24px rgba(0,0,0,.28);
  transition:
    transform .16s ease,
    background .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    color .18s ease;
}

.sb-region-streetview-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(180, 215, 255, .38);
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03)),
    linear-gradient(135deg, rgba(58,72,108,.7), rgba(14,18,30,.92));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 14px 28px rgba(0,0,0,.34),
    0 0 0 1px rgba(130,170,255,.08);
}

.sb-region-streetview-btn:active{
  transform: translateY(0);
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,.18),
    0 6px 16px rgba(0,0,0,.26);
}

.sb-region-streetview-btn:focus-visible{
  outline: none;
  border-color: rgba(190, 225, 255, .62);
  box-shadow:
    0 0 0 2px rgba(145, 195, 255, .18),
    0 14px 28px rgba(0,0,0,.34);
}
.sb-region-streetview-btn sig{
  opacity: .92;
  margin-right: 0;
  font-size: 14px;
  filter: drop-shadow(0 0 10px rgba(150, 205, 255, .18));
}
.sb-region-streetview-btn::after{
  content: '↗';
  font-size: 13px;
  opacity: .7;
  transform: translateY(-.5px);
}

@media (max-width: 720px){
  .sv-shell{
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    border-radius: 16px;
  }
}
.sv-close{
  position:absolute;
  top: 10px;
  right: 10px;
  z-index: 99999;  /* above pannellum canvas */
}
.sv-dialog{ position: relative; }

#cbLinkBtn.active{
  border-color: rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .08);
}

/* =========================================
   Black Madonna Whisper UI
========================================= */
.bm-whisper{
  position: fixed;
  left: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10, 6, 6, 0.86);
  border: 1px solid rgba(220, 180, 120, 0.28);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  color: rgba(240, 235, 225, 0.92);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  letter-spacing: 0.2px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
  z-index: 99999;
}

.bm-whisper.visible{
  opacity: 1;
  transform: translateY(0);
}

.bm-whisper::before{
  content: "⟡";
  margin-right: 8px;
  color: rgba(220, 180, 120, 0.9);
}
.char-row{
  width:100%;
  text-align:left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor:pointer;
  margin-bottom: 8px;
}
.char-row:hover{ background: rgba(220, 180, 120, 0.10); border-color: rgba(220, 180, 120, 0.25); }
.char-row-name{ font-weight:700; }
.char-row-meta{ font-size:12px; color: var(--muted); margin-top:4px; }

.pill{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-size:12px;
  color: var(--text);
}




/* ==============================
   CASEBOARD OCCULT NODE STYLES
============================== */

.cb-node{
  background: var(--node-bg, rgba(12, 12, 12, .92));
  border: 1px solid var(--node-border, rgba(255, 255, 255, .15));
  color: var(--node-text, rgba(245, 245, 245, .92));
  border-radius: 16px;
  padding: 10px 10px 10px 10px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, .45),
    0 0 calc(30px * var(--node-glow, .25)) hsla(var(--node-hue, 40), 90%, 60%, .35);
  backdrop-filter: blur(6px);
  position: absolute;
  transform: translate3d(0,0,0);
}

.cb-node .cb-icon{
  width: 26px;
  height: 26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 10px;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  box-shadow: 0 0 18px hsla(var(--node-hue, 40), 90%, 60%, .20);
  font-weight: 800;
  letter-spacing: .5px;
}

.cb-node:hover{
  box-shadow:
    0 14px 40px rgba(0, 0, 0, .55),
    0 0 38px hsla(var(--node-hue, 40), 90%, 60%, .48);
  border-color: hsla(var(--node-hue, 40), 90%, 70%, .45);
}

.cb-node[data-kind="entity"]{
  border-width: 2px;
}

.cb-node[data-kind="manifestation"]{
  border-style: dashed;
}

/* Auras */
.cb-node.aura-entity::before{
  content:"";
  position:absolute;
  inset:-10px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% 20%, hsla(var(--node-hue, 4), 95%, 60%, .14), transparent 55%),
    radial-gradient(circle at 70% 80%, hsla(var(--node-hue, 4), 95%, 60%, .10), transparent 58%);
  filter: blur(6px);
  pointer-events:none;
  opacity:.9;
}

.cb-node.aura-mist::before{
  content:"";
  position:absolute;
  inset:-12px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 50%, hsla(var(--node-hue, 160), 95%, 60%, .12), transparent 60%);
  filter: blur(10px);
  pointer-events:none;
  opacity:.85;
  animation: mistPulse 4.2s ease-in-out infinite;
}

@keyframes mistPulse{
  0%,100%{ transform: scale(1); opacity:.75; }
  50%{ transform: scale(1.03); opacity:.95; }
}

/* Corruption state (optional) */
.cb-node.corrupted{
  border-color: rgba(255, 90, 90, .55);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, .60),
    0 0 52px rgba(255, 60, 60, .35);
  animation: corruptionFlicker 2.2s infinite;
}

@keyframes corruptionFlicker{
  0%, 100%{ filter: saturate(1) contrast(1); }
  45%{ filter: saturate(1.25) contrast(1.1); }
  50%{ filter: saturate(.6) contrast(1.25); }
  55%{ filter: saturate(1.3) contrast(1.05); }
}

.bm-stage-3 body { filter: saturate(1.03); }
.bm-stage-5 body { filter: saturate(1.06) contrast(1.03); }
.bm-stage-7 body { filter: saturate(1.08) contrast(1.05); }
.bm-stage-9 body { filter: saturate(1.10) contrast(1.07); }

.cb-node.corrupted{
  border-color: rgba(255, 90, 90, .55) !important;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, .60),
    0 0 52px rgba(255, 60, 60, .35) !important;
  animation: corruptionFlicker 2.2s infinite;
}

.cb-node.bm-entity-corrupt{
  border-width: 2px !important;
  box-shadow:
    0 20px 70px rgba(0, 0, 0, .65),
    0 0 70px rgba(255, 30, 30, .45) !important;
}

.cb-node.bm-manifest-corrupt{
  border-style: dashed !important;
  box-shadow:
    0 18px 60px rgb(43, 0, 235),
    0 0 64px rgb(27, 129, 96) !important;
}

.cb-node.witnessed::after{
  content:"WITNESSED";
  position:absolute;
  right: 10px;
  top: 10px;
  font-size: 10px;
  letter-spacing: .22em;
  opacity: .65;
  color: rgba(255, 230, 210, .9);
  transform: rotate(2deg);
}

@keyframes corruptionFlicker{
  0%, 100%{ filter: saturate(1) contrast(1); }
  45%{ filter: saturate(1.25) contrast(1.1); }
  50%{ filter: saturate(.6) contrast(1.25); }
  55%{ filter: saturate(1.3) contrast(1.05); }
}
.cb-node.bm-corrupted{
  box-shadow:
    0 0 30px rgba(255, 60, 60, .35),
    0 12px 40px rgba(0, 0, 0, .6);
  border-color: rgba(255, 80, 80, .6);
}

.cb-node.bm-entity{
  border-width: 2px;
}

.cb-node.bm-manifestation{
  border-style: dashed;
}

/* ===== Caseboard occult physics ===== */
.cb-node {
  transition: box-shadow .25s ease, border-color .25s ease, transform .12s ease;
}

.cb-node.bm-fielded {
  box-shadow:
    0 14px 50px rgba(0, 0, 0, .62),
    0 0 60px rgba(255, 40, 40, .18);
}

.cb-node.bm-corrupted{
  border-color: rgba(255, 80, 80, .65) !important;
  box-shadow:
    0 18px 70px rgba(0, 0, 0, .68),
    0 0 70px rgba(255, 40, 40, .32) !important;
  animation: bmFlicker 2.2s infinite;
}

.cb-node.bm-corrupted::after{
  content:"";
  position:absolute;
  inset:-10px;
  border-radius: 22px;
  pointer-events:none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 50, 50, .12), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(255, 50, 50, .08), transparent 60%);
  filter: blur(10px);
  opacity:.9;
}

@keyframes bmFlicker{
  0%,100% { filter: saturate(1) contrast(1); }
  45%     { filter: saturate(1.22) contrast(1.12); }
  50%     { filter: saturate(.7) contrast(1.2); }
  55%     { filter: saturate(1.28) contrast(1.06); }
}
.doc-extra-redaction .pdfLightbox .redactionLayer {
  opacity: 1 !important;
  filter: contrast(1.15) saturate(1.05);
  animation: bmFlicker 2.6s infinite;
}

/* =========================================================
   OCCULT CASEBOARD — SIGILS, GRAVITY, CORRUPTION
   Compatible with map_patched_occult_v1.js
   ========================================================= */

/* ---- Base node refinement ---- */
.cb-node {
  position: absolute;
  border-radius: 14px;
  background: linear-gradient(180deg, #141414, #0b0b0b);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e6e6e6;
  font-family: "Inter", "EB Garamond", serif;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, .65);
  overflow: hidden;
}

/* subtle “weight” */
.cb-node::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .06), transparent 40%);
  pointer-events:none;
}

/* ---- Node type sigils ---- */
.cb-node[data-kind="entity"]::after{
  content:"⛧";
  position:absolute;
  top:8px;
  right:10px;
  font-size:18px;
  color:#c94747;
  opacity:.9;
}

.cb-node[data-kind="manifestation"]::after{
  content:"✶";
  position:absolute;
  top:8px;
  right:10px;
  font-size:16px;
  color:#caa6ff;
}

.cb-node[data-kind="character"]::after{
  content:"☿";
  position:absolute;
  top:8px;
  right:10px;
  font-size:16px;
  color:#9ad0ff;
}

.cb-node[data-kind="doc"]::after{
  content:"⧉";
  position:absolute;
  top:8px;
  right:10px;
  font-size:15px;
  color:#bfa46a;
}

/* ---- Entity gravity field ---- */
.cb-node.bm-fielded{
  box-shadow:
    0 18px 55px rgba(0, 0, 0, .75),
    0 0 70px rgba(200, 70, 70, .25);
}

/* ---- Corruption ---- */
.cb-node.bm-corrupted{
  border-color: rgba(255, 80, 80, .65);
  box-shadow:
    0 22px 80px rgba(0, 0, 0, .8),
    0 0 80px rgba(255, 40, 40, .35);
  animation: bmCorruptPulse 2.4s infinite;
}

.cb-node.bm-corrupted::before{
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 50, 50, .15), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(255, 20, 20, .12), transparent 60%);
}

@keyframes bmCorruptPulse{
  0%,100% { filter: saturate(1) contrast(1); }
  40%     { filter: saturate(1.25) contrast(1.15); }
  55%     { filter: saturate(.75) contrast(1.3); }
}

/* ---- Corrupted threads (if you style links) ---- */
.cb-link.bm-corrupted{
  stroke: rgba(255, 80, 80, .6);
  stroke-width: 2.2;
  filter: drop-shadow(0 0 6px rgba(255, 40, 40, .4));
}

/* =========================================================
   DOCUMENT ARCHIVE — LIVING RECORDS
   ========================================================= */

.archive-item{
  background: linear-gradient(180deg, #161616, #0e0e0e);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 10px;
  padding: 10px 12px;
}

.archive-item:hover{
  border-color: rgba(255, 255, 255, .15);
  background: linear-gradient(180deg, #1b1b1b, #111);
}

/* rewritten / unstable docs */
.archive-item[data-unstable="true"]{
  border-color: rgba(200, 80, 80, .4);
  box-shadow: 0 0 24px rgba(200, 80, 80, .15);
}

/* extra redaction overlay */
.doc-extra-redaction .pdfLightbox{
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 40, 40, .08), transparent 60%),
    #000;
}

/* =========================================================
   BLACK MADONNA WHISPERS
   ========================================================= */

#bmWhisper{
  position: fixed;
  bottom: 18%;
  left: 24px;
  max-width: 260px;
  padding: 12px 14px;
  background: rgba(8, 8, 8, .88);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  color: #e8e8e8;
  font-family: "EB Garamond", serif;
  font-size: 15px;
  line-height: 1.35;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, .8);
  animation: bmWhisperIn .6s ease;
}

@keyframes bmWhisperIn{
  from{ opacity:0; transform:translateY(8px); }
  to{ opacity:1; transform:none; }
}

/* =========================================================
   SAFETY: MOBILE FRIENDLY
   ========================================================= */
@media (max-width: 768px){
  .cb-node{
    transform: scale(.92);
  }
  #bmWhisper{
    left: 12px;
    max-width: 220px;
  }
}
/* ==============================
   ROUTE 47: DRIVE LOG + DREAD UI
   ============================== */

#route47Panel {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(8, 8, 8, .55);
  overflow: hidden;
}

#route47PanelHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  letter-spacing:.08em;
  text-transform: uppercase;
  font-size: 11px;
  color: rgba(255, 255, 255, .78);
}

#route47Log{
  max-height: 220px;
  overflow:auto;
  padding: 10px 12px;
  font-family: "EB Garamond", serif;
  font-size: 14px;
  line-height: 1.35;
}

.r47-entry{
  margin: 0 0 10px 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .06);
  background: rgba(0, 0, 0, .35);
}

.r47-time{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  opacity: .7;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.r47-text{
  opacity: .92;
}

.r47-entry.dread{
  border-color: rgba(255, 80, 80, .22);
  box-shadow: 0 0 20px rgba(255, 50, 50, .08);
}

.r47-entry.system{
  border-color: rgba(140, 200, 255, .16);
}

html.route47-mode body{
  filter: saturate(1.02) contrast(1.02);
}

html.route47-mode .mapCanvas,
html.route47-mode #map,
html.route47-mode #mapWrap{
  /* subtle tunnel vision without breaking navigation */
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .62);
}

/* =========================
   COMPLIANCE INTERVIEW MODAL
   ========================= */

#gameModal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
}

#gameModal.open { display: block; }

#gameModal .gm-backdrop {
  position:absolute;
  inset:0;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(2px);
}

#gameModal .gm-panel {
  position:absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 92vw);
  max-height: 86vh;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: radial-gradient(circle at 20% 10%, rgba(255, 60, 60, .06), transparent 45%), #070708;
  color: rgba(255, 255, 255, .92);
  box-shadow: 0 30px 120px rgba(0, 0, 0, .75);
}

#gameModal .gm-head {
  display:flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}

#gameModal .gm-title {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .85;
}

#gameModal .gm-close {
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .9);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

#gameModal .gm-body { padding: 16px; }
#gameModal .gm-sub {
  font-size: 12px;
  opacity: .75;
  margin-bottom: 10px;
  line-height: 1.35;
}

#gameModal .gm-question {
  font-family: "EB Garamond", serif;
  font-size: 18px;
  line-height: 1.35;
  margin: 14px 0 12px 0;
}

#gameModal .gm-answers {
  display: grid;
  gap: 10px;
}

#gameModal .gm-btn {
  text-align: left;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .92);
  cursor: pointer;
  transition: transform .08s ease, border-color .15s ease;
}

#gameModal .gm-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 80, 80, .30);
}

#gameModal .gm-meterRow{
  display:flex;
  gap:10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

#gameModal .gm-pill{
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(0, 0, 0, .25);
  opacity: .9;
}

#gameModal .gm-foot {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
}

#gameModal .gm-progress {
  font-size: 12px;
  opacity: .75;
}

#gameModal .gm-next {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 80, 80, .10);
  color: rgba(255, 255, 255, .92);
  cursor: pointer;
}

.gm-injected {
  font-family: "EB Garamond", serif;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 80, 80, .20);
  background: rgba(255, 40, 40, .06);
  margin: 10px 0 0 0;
  opacity: .95;
}

/* fallback Play Game button (if nav injection fails) */
#playGameBtnFloating{
  position: fixed;
  left: 12px;
  bottom: 42px;
  z-index: 999998;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .55);
  color: rgba(255, 255, 255, .9);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(2px);
}

/* ============================
   Cycle Deck (consolidated)
   ============================ */
.cycle-legacy{ display:none !important; }

.cycle-deck{
  display:flex;
  gap:10px;
  align-items:stretch;
  flex-wrap:wrap;
}

.cycle-card{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:6px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(120% 140% at 10% 0%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04) 40%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, rgba(12, 12, 18, 0.75), rgba(8, 8, 12, 0.62));
  color: rgba(255, 255, 255, 0.92);
  cursor:pointer;
  min-width: 172px;
  height: 46px;
  text-align:left;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;
  overflow:hidden;
}

.cycle-card:hover{
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
}

.cycle-card:focus-visible{
  outline: 2px solid rgba(255, 255, 255, 0.38);
  outline-offset: 2px;
}

.cc-top{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; line-height:1; }
.cc-name{ font-weight:800; letter-spacing: .06em; text-transform:uppercase; font-size: 12px; }
.cc-years{ font-size: 12px; opacity:.78; font-variant-numeric: tabular-nums; }
.cc-tag{ font-size: 12px; opacity:.86; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.cycle-card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(90% 120% at 0% 0%, var(--cycleGlow, rgba(255, 255, 255, 0.06)), rgba(0, 0, 0, 0) 58%);
  opacity:.55;
  pointer-events:none;
}

.cycle-card.is-active{
  border-color: rgba(255, 255, 255, 0.30);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  filter: saturate(1.25) contrast(1.05);
}

.cycle-card.is-active::after{
  content:"";
  position:absolute;
  inset:-1px;
  background: radial-gradient(120% 180% at 20% 0%, var(--cycleGlow, rgba(255, 255, 255, 0.18)), rgba(0, 0, 0, 0) 62%);
  opacity:1;
  pointer-events:none;
}

.cycle-card[data-cycle="Ink"]{   --cycleGlow: rgba(168, 92, 255, 0.38); }
.cycle-card[data-cycle="Brass"]{ --cycleGlow: rgba(255, 196, 64, 0.38); }
.cycle-card[data-cycle="Water"]{ --cycleGlow: rgba(72, 232, 255, 0.34); }
.cycle-card[data-cycle="Code"]{  --cycleGlow: rgba(255, 86, 214, 0.34); }
.cycle-card[data-cycle="All"]{   --cycleGlow: rgba(160, 255, 214, 0.26); }

.cycle-mini-controls{
  display:flex;
  align-items:center;
  gap:6px;
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  height: 46px;
}

.strip{
  /* Keep the strip compact */
  padding: 8px 12px;
}

.strip-left{
  gap:10px;
}
/* Legend hidden by default */
.legend,
#legend,
.map-legend {
  display: none;
}

/* ==============================
   LANDMARKS THAT REMEMBER
   ============================== */
.leaflet-marker-icon.sb-touched{
  filter: drop-shadow(0 0 10px rgba(240, 210, 150, 0.35)) drop-shadow(0 0 22px rgba(240, 120, 180, 0.20));
  border-radius: 999px;
}
.leaflet-marker-icon.sb-touched{
  outline: 1px solid rgba(240, 210, 150, 0.18);
  outline-offset: 2px;
}
.sb-touched-path{
  filter: drop-shadow(0 0 8px rgba(240, 210, 150, 0.25));
}

.lm-item{
  width:100%;
  text-align:left;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px 10px;
  margin: 6px 0;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
}
.lm-item:hover{
  border-color: rgba(240, 210, 150, 0.20);
  background: rgba(240, 210, 150, 0.04);
}
.lm-item .lm-name{
  font-weight: 600;
  letter-spacing: .01em;
}
.lm-item.is-touched{
  border-color: rgba(240, 210, 150, 0.28);
  background: linear-gradient(90deg, rgba(240, 210, 150, 0.08), rgba(255, 255, 255, 0.00));
}
.lm-item.is-touched .lm-name::after{
  content: " · previously observed";
  font-weight: 500;
  opacity: .65;
  font-size: 12px;
}
/* ==============================
   SOFT TEMPORAL DRIFT
   Cycle-flavored phase transitions when layers appear/disappear.
   Applied to Leaflet marker icons (_icon) and SVG paths (_path).
   ============================== */

.sb-phase-in,
.sb-phase-out{
  will-change: opacity, transform, filter;
}

.sb-phase-in.sb-phase-ink{ animation: sbInkIn 560ms ease both; }
.sb-phase-out.sb-phase-ink{ animation: sbInkOut 560ms ease both; }

.sb-phase-in.sb-phase-brass{ animation: sbBrassIn 520ms cubic-bezier(.2,.9,.15,1) both; }
.sb-phase-out.sb-phase-brass{ animation: sbBrassOut 480ms cubic-bezier(.35,.05,.35,1) both; }

.sb-phase-in.sb-phase-water{ animation: sbWaterIn 620ms ease both; }
.sb-phase-out.sb-phase-water{ animation: sbWaterOut 520ms ease both; }

.sb-phase-in.sb-phase-code{ animation: sbCodeIn 560ms ease both; }
.sb-phase-out.sb-phase-code{ animation: sbCodeOut 520ms ease both; }

@keyframes sbInkIn{
  0%{ opacity: 0; filter: blur(2.5px) saturate(1.1); transform: translateY(2px) scale(.98); }
  55%{ opacity: .92; filter: blur(.6px) saturate(1.05); transform: translateY(0) scale(1.01); }
  100%{ opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}
@keyframes sbInkOut{
  0%{ opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
  100%{ opacity: 0; filter: blur(3px) contrast(1.05); transform: translateY(2px) scale(.985); }
}

@keyframes sbBrassIn{
  0%{ opacity: 0; filter: contrast(1.1); transform: translateY(-1px) scale(.94); }
  35%{ opacity: 1; transform: translateY(0) scale(1.04); }
  100%{ opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sbBrassOut{
  0%{ opacity: 1; transform: translateY(0) scale(1); }
  100%{ opacity: 0; transform: translateY(1px) scale(.92); filter: contrast(1.15); }
}

@keyframes sbWaterIn{
  0%{ opacity: 0; filter: blur(6px); transform: translateY(3px) scale(.985); }
  60%{ opacity: .95; filter: blur(1.2px); transform: translateY(0) scale(1.01); }
  100%{ opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}
@keyframes sbWaterOut{
  0%{ opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
  100%{ opacity: 0; filter: blur(7px); transform: translateY(3px) scale(.98); }
}

@keyframes sbCodeIn{
  0%{ opacity: 0; filter: contrast(1.15) saturate(1.15); transform: translateY(-2px) scale(.98); }
  20%{ opacity: .5; transform: translateY(0) scale(1.01); }
  45%{ opacity: 1; filter: contrast(1.1) saturate(1.05); }
  100%{ opacity: 1; filter: none; transform: translateY(0) scale(1); }
}
@keyframes sbCodeOut{
  0%{ opacity: 1; filter: none; transform: translateY(0) scale(1); }
  70%{ opacity: .35; filter: contrast(1.25) saturate(1.15); }
  100%{ opacity: 0; filter: contrast(1.35) blur(1px); transform: translateY(2px) scale(.97); }
}

/* ==============================
   Whisper Line (Investigate idle)
   ============================== */
.whisper-line{
  margin-top: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.00), rgba(0, 0, 0, 0.30));
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 260ms ease, transform 260ms ease;
  pointer-events: none;
  user-select: none;
}
.whisper-line.show{
  opacity: 1;
  transform: translateY(0);
}

/* Remembered landmarks prominence (HOME list) */
.landmark-li.touched .landmark-link{ font-weight: 650; text-shadow: 0 0 12px rgba(220, 180, 120, 0.25); }
.touched-tag{ margin-left:8px; padding:2px 8px; border-radius:999px; font-size:11px; letter-spacing:.06em; text-transform:uppercase; background: rgba(220, 180, 120, 0.14); border: 1px solid rgba(220, 180, 120, 0.22); color: rgba(240, 220, 190, 0.95); }

/* === Caseboard Detective Upgrades === */
.cb-node.ghost{
  opacity: 0.78;
  filter: saturate(0.9) contrast(0.95);
  border-color: rgba(200, 200, 200, 0.18) !important;
}
.cb-node.ghost .title::after{
  content: " · SOURCE LOST";
  font-size: 10px;
  letter-spacing: 0.14em;
  opacity: 0.6;
}
.cb-node .action[disabled]{
  opacity: 0.55;
  pointer-events: none;
}
.cb-node.false-lead{
  box-shadow: 0 0 0 2px rgba(255, 80, 90, 0.10), 0 0 34px rgba(255, 80, 90, 0.16);
}
.cb-node.false-lead.hot{
  animation: sbFalseLeadPulse 1.6s ease-in-out infinite;
}
@keyframes sbFalseLeadPulse{
  0%,100%{ transform: translateZ(0); filter: saturate(1) contrast(1); }
  50%{ transform: translateZ(0) scale(1.01); filter: saturate(1.25) contrast(1.05); }
}

.cb-thread.resonance svg path{
  stroke-width: 1.6px;
  stroke-dasharray: 3 6;
  animation: sbResonanceDash 4.5s linear infinite;
  opacity: 0.85;
}
.cb-thread.resonance svg text{
  opacity: 0.65;
  letter-spacing: 0.08em;
}
@keyframes sbResonanceDash{
  0%{ stroke-dashoffset: 0; }
  100%{ stroke-dashoffset: -120; }
}
/* ==============================
   "THIS LOCATION NO LONGER EXISTS" banner
   ============================== */
.sb-existence{
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
}
.sb-existence--gone{
  border-color: rgba(255, 80, 80, 0.22);
  background: linear-gradient(180deg, rgba(255, 65, 65, 0.10), rgba(0, 0, 0, 0.16));
}
.sb-existence__kicker{
  letter-spacing: 0.12em;
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 6px;
}
.sb-existence__row{
  display:flex;
  gap: 8px;
  align-items: baseline;
  margin: 2px 0;
}
.sb-existence__note{
  margin-top: 6px;
  line-height: 1.35;
}
/* --- Remembered landmarks emphasis (St. Brielle: "Previously observed") --- */
.lm-item{
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  text-align: left;
}
.lm-item:hover{
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.24);
}
.lm-item .lm-name{ font-weight: 600; }
.lm-item .lm-tag{
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(220, 180, 120, 0.35);
  color: rgba(220, 180, 120, 0.95);
  background: rgba(30, 18, 8, 0.35);
}
/* --- Canon badges (rare, irreversible) --- */
.lm-item .lm-tag.lm-tag--canon{
  border-color: rgba(180, 210, 255, 0.30);
  color: rgba(210, 230, 255, 0.95);
  background: rgba(8, 18, 30, 0.35);
}
.lm-item.is-canon-closed{ opacity: 0.78; }
.lm-item .lm-tag.lm-tag--closed{
  border-color: rgba(255, 120, 120, 0.28);
  color: rgba(255, 200, 200, 0.95);
  background: rgba(40, 8, 10, 0.30);
}
.lm-item .lm-tag.lm-tag--reclass{
  border-color: rgba(220, 180, 120, 0.26);
  color: rgba(230, 210, 170, 0.95);
  background: rgba(30, 18, 8, 0.28);
}

/* quietly remove UI affordances when canon says so */
.sb-hidden-canon{ display:none !important; }

/* Canon: quiet UI removals */
.sb-hidden-canon{ display:none !important; }

/* Canon badge shown on landmark panels */
.sb-canon-badge{
  display:inline-block;
  margin:6px 0 0 0;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(255, 255, 255, 0.22);
  background:rgba(255, 255, 255, 0.05);
  font-size:12px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  opacity:0.9;
}

.lm-item.is-touched{
  border-color: rgba(220, 180, 120, 0.35);
  box-shadow: 0 0 0 1px rgba(220, 180, 120, 0.10), 0 0 18px rgba(220, 180, 120, 0.10);
}

/* --- Live broadcast landmark (WSTB) --- */
.lm-item.is-live{
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 60, 80, 0.10), 0 0 18px rgba(255, 60, 80, 0.10);
  position: relative;
}
.lm-item .lm-live{
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 60, 80, 0.35);
  color: rgba(255, 210, 220, 0.95);
  background: rgba(60, 10, 18, 0.42);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  animation: sbLivePulse 1.8s ease-in-out infinite;
}
@keyframes sbLivePulse{
  0%,100%{ transform: translateY(0); filter: drop-shadow(0 0 0 rgba(255, 60, 80, 0)); opacity: 0.95; }
  50%{ transform: translateY(-1px); filter: drop-shadow(0 0 10px rgba(255, 60, 80, 0.35)); opacity: 1; }
}

/* Marker + footprint pulse for broadcast landmarks */
.sb-broadcast-marker,
.sb-broadcast-path{
  animation: sbBroadcastGlow 2.2s ease-in-out infinite;
  transform-origin: center;
}
.sb-broadcast-on{
  filter: drop-shadow(0 0 14px rgba(255, 60, 80, 0.35)) drop-shadow(0 0 22px rgba(255, 60, 80, 0.22));
}
@keyframes sbBroadcastGlow{
  0%,100%{ filter: drop-shadow(0 0 6px rgba(255, 60, 80, 0.18)); }
  50%{ filter: drop-shadow(0 0 14px rgba(255, 60, 80, 0.32)); }
}

/* Broadcast panel in landmark details */
.sb-bcast{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.22);
}
.sb-bcast-head{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-bottom: 6px;
}
.sb-bcast-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 60, 80, 0.95);
  box-shadow: 0 0 14px rgba(255, 60, 80, 0.35);
  animation: sbLiveDot 1.2s ease-in-out infinite;
}
@keyframes sbLiveDot{
  0%,100%{ transform: scale(0.9); opacity: 0.85; }
  50%{ transform: scale(1.2); opacity: 1; }
}
.sb-bcast-live{
  margin-left:auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 60, 80, 0.35);
  background: rgba(60, 10, 18, 0.35);
  color: rgba(255, 210, 220, 0.95);
  text-transform: uppercase;
}
.sb-bcast-sub{
  margin-bottom: 8px;
  line-height: 1.35;
}
.sb-bcast-feed{
  max-height: 180px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.26);
  padding: 8px 10px;
}
.sb-bcast-line{
  display:flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sb-bcast-line:last-child{ border-bottom: none; }
.sb-bcast-ts{
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
  min-width: 46px;
}
.sb-bcast-text{
  line-height: 1.35;
}
.sb-bcast-controls{
  margin-top: 8px;
  display:flex;
  justify-content:flex-end;
}

/* Sidebar baseline pulse when returning to "All" */
#sidebar.sb-baseline-pulse {
  animation: sbBaselinePulse 0.65s ease-out 1;
}
@keyframes sbBaselinePulse {
  0% { box-shadow: 0 0 0 rgba(255, 255, 255, 0); }
  35% { box-shadow: 0 0 24px rgba(255, 255, 255, 0.10), inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
  100% { box-shadow: 0 0 0 rgba(255, 255, 255, 0); }
}

/* ===== St. Brielle Cycle Background Layer (hard override) ===== */

html{ background: #07070a; }
body{ background: transparent !important; }

/* Background layer sits behind everything, reliably */
html::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background-image:
    var(--sb-bg-img),
    radial-gradient(1200px 900px at 18% 22%, rgba(220, 180, 120, 0.10), transparent 58%),
    radial-gradient(900px 700px at 82% 30%, rgba(150, 110, 220, 0.10), transparent 55%),
    radial-gradient(1100px 900px at 55% 90%, rgba(60, 120, 255, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.84));

  background-size: cover, cover, cover, cover, cover;
  background-position: center;
  background-repeat: no-repeat;

  opacity: var(--sb-bg-opacity, 0.22);
  filter: saturate(var(--sb-bg-sat, 1.05)) contrast(var(--sb-bg-contrast, 1.08));
}

/* Ensure your app sits above the background layer */
#app, #wrap, #mapWrap, #main, .app, .wrap, .shell{
  position: relative;
  z-index: 1;
}

/* Cycle swaps */
body.cycle-ink   { --sb-bg-img: var(--sb-bg-img-ink);   --sb-bg-opacity: 0.26; --sb-bg-sat: 0.92; --sb-bg-contrast: 1.10; }
body.cycle-brass { --sb-bg-img: var(--sb-bg-img-brass); --sb-bg-opacity: 0.24; --sb-bg-sat: 0.98; --sb-bg-contrast: 1.12; }
body.cycle-water { --sb-bg-img: var(--sb-bg-img-water); --sb-bg-opacity: 0.23; --sb-bg-sat: 0.96; --sb-bg-contrast: 1.08; }
body.cycle-code  { --sb-bg-img: var(--sb-bg-img-code);  --sb-bg-opacity: 0.28; --sb-bg-sat: 1.08; --sb-bg-contrast: 1.16; }
/* ===== Let St. Brielle background show through Leaflet ===== */

/* Leaflet root elements should not paint their own background */
.leaflet-container,
.leaflet-pane,
.leaflet-map-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-tooltip-pane,
.leaflet-popup-pane {
  background: transparent !important;
}

/* If your map wrapper has a background, kill it too */
#map, #mapWrap, .map, .map-wrap, .map-wrapper {
  background: transparent !important;
}

/* Optional: If you use a base tile layer and want your background to “bleed” through a bit */
.leaflet-tile {
  opacity: 0.92; /* try 0.85–1.0 */
}

/* Optional: If there’s a solid-color overlay div above the map (common), make it transparent */
.map-overlay, .overlay, .veil {
  background: transparent !important;
}
/* --- FIX: background vars must be visible to the pseudo-element.
   Using body::before (not html::before) so body-scoped cycle variables apply. --- */
body{
  position: relative;
  z-index: 0;
}
body::before{
  z-index: 0;
}
.leaflet-container,
#map, #mapWrap, .map, .map-container{
  background: transparent !important;
}
.leaflet-container { background: transparent !important; }
/* ===== FORCE cycle background swap (no CSS vars) ===== */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.24;
  filter: saturate(1.03) contrast(1.10);
}

/* Make sure app is above */
#app, #wrap, #mapWrap, #main, .app, .wrap, .shell, .leaflet-container{
  position: relative;
  z-index: 1;
}

/* IMPORTANT: Let background show through map/container */
.leaflet-container,
#map,
#mapWrap,
.map,
.map-wrap{
  background: transparent !important;
}

/* Default (All) */
body:not(.cycle-ink):not(.cycle-brass):not(.cycle-water):not(.cycle-code)::before{
  background-image: url("./img/ui/bg_all.jpg");
}

/* Cycle-specific */
body.cycle-ink::before{
  background-image: url("./img/ui/bg_ink.jpg");
  opacity: 0.26;
  filter: saturate(0.92) contrast(1.12);
}
body.cycle-brass::before{
  background-image: url("./img/ui/bg_brass.jpg");
  opacity: 0.24;
  filter: saturate(0.98) contrast(1.14);
}
body.cycle-water::before{
  background-image: url("./img/ui/bg_water.jpg");
  opacity: 0.23;
  filter: saturate(0.96) contrast(1.10);
}
body.cycle-code::before{
  background-image: url("./img/ui/bg_code.jpg");
  opacity: 0.28;
  filter: saturate(1.08) contrast(1.18);
}
/* ==========================================================
   ST. BRIELLE — CSS-ONLY BADASS PACK (Phase 1)
   Includes:
   - Micro-Corruption (Investigate mode)
   - Cycle-Sensitive Weather Overlay (map-only)
   - Mode-Specific Typography Drift
   ========================================================== */

/* ---- Mode-specific typography drift (subtle psychological state) ---- */
body[data-ui-mode="explore"] .sidebar{
  /* clean, readable */
  letter-spacing: 0.10px;
}
body[data-ui-mode="investigate"] .sidebar,
body.mode-investigate .sidebar{
  /* tighter tracking, heavier pressure */
  letter-spacing: -0.15px;
}
body[data-ui-mode="archive"] .sidebar{
  /* weight + quiet authority */
  letter-spacing: 0.0px;
}

body[data-ui-mode="explore"] .panel-title{
  text-shadow: none;
}
body[data-ui-mode="investigate"] .panel-title,
body.mode-investigate .panel-title{
  text-shadow: 0 0 18px rgba(220, 180, 120, 0.10);
}
body[data-ui-mode="archive"] .panel-title{
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.06);
}

/* Small header-space discipline */
body[data-ui-mode="explore"] .sidebar-head,
body[data-ui-mode="investigate"] .sidebar-head,
body.mode-investigate .sidebar-head{
  padding-bottom: 8px;
  margin-bottom: 10px;
}

/* ---- Micro-Corruption (Investigate only): deniable misalignment + haze ---- */
@keyframes sb_microJitter{
  0%   { transform: translate3d(0,0,0); }
  16%  { transform: translate3d(0.2px,-0.3px,0); }
  34%  { transform: translate3d(-0.3px,0.2px,0); }
  51%  { transform: translate3d(0.1px,0.1px,0); }
  69%  { transform: translate3d(-0.2px,-0.1px,0); }
  86%  { transform: translate3d(0.3px,0.0px,0); }
  100% { transform: translate3d(0,0,0); }
}

@keyframes sb_scanBreath{
  0%   { opacity: 0.06; }
  50%  { opacity: 0.11; }
  100% { opacity: 0.06; }
}

/* Apply micro-jitter ONLY to select UI surfaces (not entire app) */
body[data-ui-mode="investigate"] .leaflet-tooltip,
body.mode-investigate .leaflet-tooltip,
body[data-ui-mode="investigate"] .sidebar-head,
body.mode-investigate .sidebar-head{
  animation: sb_microJitter 9.5s infinite steps(1,end);
  will-change: transform;
}

body[data-ui-mode="investigate"] .sidebar,
body.mode-investigate .sidebar{
  /* barely perceptible haze */
  backdrop-filter: blur(11px) saturate(1.02);
}

/* A soft “pressure” veil over the MAP only during Investigate */
body[data-ui-mode="investigate"] .map::before,
body.mode-investigate .map::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5; /* above leaflet tiles, below your UI overlays */
  background:
    radial-gradient(1200px 800px at 20% 20%, rgba(0, 0, 0, 0.18), transparent 55%),
    radial-gradient(900px 600px at 80% 30%, rgba(0, 0, 0, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.18));
  mix-blend-mode: multiply;
  opacity: 0.55;
}

/* ---- Cycle-sensitive “weather” overlay (CSS only) ----
   Attached to .map so it never fights your global backgrounds.
*/
@keyframes sb_fogDrift{
  0%   { transform: translate3d(-1.2%, -0.8%, 0); }
  50%  { transform: translate3d(1.0%, 0.6%, 0); }
  100% { transform: translate3d(-1.2%, -0.8%, 0); }
}

@keyframes sb_steamLift{
  0%   { transform: translate3d(0, 1.2%, 0); opacity: 0.10; }
  50%  { transform: translate3d(0, -0.8%, 0); opacity: 0.16; }
  100% { transform: translate3d(0, 1.2%, 0); opacity: 0.10; }
}

@keyframes sb_grainShiver{
  0%   { opacity: 0.05; }
  50%  { opacity: 0.085; }
  100% { opacity: 0.05; }
}

.map{ position: relative; }

/* Base layer used by all cycles (very subtle grain) */
.map::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4; /* above map tiles, below tooltips (tooltips use their own panes) */
  opacity: 0;
}

/* INK — dust motes / parchment bloom */
body.cycle-ink .map::after{
  opacity: 0.12;
  background:
    radial-gradient(2px 2px at 12% 18%, rgba(255, 255, 255, 0.22), transparent 60%),
    radial-gradient(2px 2px at 32% 36%, rgba(255, 255, 255, 0.14), transparent 60%),
    radial-gradient(2px 2px at 62% 24%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(2px 2px at 78% 68%, rgba(255, 255, 255, 0.12), transparent 60%),
    radial-gradient(900px 700px at 30% 30%, rgba(220, 180, 120, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.14));
  animation: sb_grainShiver 7.5s infinite ease-in-out;
}

/* BRASS — steam bleed / industrial haze */
body.cycle-brass .map::after{
  opacity: 0.14;
  background:
    radial-gradient(900px 700px at 22% 84%, rgba(255, 255, 255, 0.10), transparent 62%),
    radial-gradient(1100px 900px at 74% 22%, rgba(255, 255, 255, 0.08), transparent 64%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 22%, rgba(255, 255, 255, 0.02) 55%, transparent 78%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.16));
  mix-blend-mode: screen;
  animation: sb_steamLift 8.8s infinite ease-in-out;
}

/* WATER — fog drift + coastal dulling */
body.cycle-water .map::after{
  opacity: 0.18;
  background:
    radial-gradient(1200px 900px at 40% 58%, rgba(255, 255, 255, 0.10), transparent 62%),
    radial-gradient(900px 700px at 72% 42%, rgba(255, 255, 255, 0.08), transparent 64%),
    linear-gradient(180deg, rgba(30, 60, 90, 0.05), rgba(0, 0, 0, 0.18));
  mix-blend-mode: screen;
  animation: sb_fogDrift 12.5s infinite ease-in-out;
}

/* CODE — faint scan shimmer */
body.cycle-code .map::after{
  opacity: 0.14;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.030) 0px,
      rgba(255, 255, 255, 0.030) 1px,
      transparent 2px,
      transparent 5px
    ),
    radial-gradient(1100px 800px at 58% 30%, rgba(150, 110, 220, 0.10), transparent 60%),
    radial-gradient(900px 700px at 30% 70%, rgba(60, 120, 255, 0.07), transparent 62%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.18));
  mix-blend-mode: overlay;
  animation: sb_scanBreath 6.5s infinite ease-in-out;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  body[data-ui-mode="investigate"] .leaflet-tooltip,
  body.mode-investigate .leaflet-tooltip,
  body[data-ui-mode="investigate"] .sidebar-head,
  body.mode-investigate .sidebar-head,
  body.cycle-ink .map::after,
  body.cycle-brass .map::after,
  body.cycle-water .map::after,
  body.cycle-code .map::after{
    animation: none !important;
  }
}
@keyframes sbRegionPulse {
  0%   { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0.0)); opacity: 0.85; transform: scale(1); }
  35%  { filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.25)); opacity: 1;    transform: scale(1.006); }
  70%  { filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.18)); opacity: 0.95; transform: scale(1.003); }
  100% { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0.0)); opacity: 0.85; transform: scale(1); }
}

/* Apply to SVG paths or region nodes */
.sb-region-pulse {
  transform-origin: center;
  animation: sbRegionPulse 900ms ease-in-out 0s 2; /* 2 beats */
}

/* Optional: if regions are SVG paths, this makes it feel more “alive” */
svg .sb-region-pulse {
  stroke-width: 2px;
}

/* =========================================================
   MOBILE RESPONSIVE — St. Brielle
   Goal: map-first, sidebar becomes bottom-sheet, controls accessible
   ========================================================= */

@media (max-width: 900px){

  /* Topbar: allow wrapping so Toggle Lore never gets pushed off-screen */
  .topbar{
    position: sticky;
    top: 0;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }
  .brand{ flex: 0 0 auto; }
  .controls{
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }
  .searchwrap{
    flex: 1 1 100%;
    min-width: 0;
  }
  .search{
    width: 100%;
  }

  /* Reduce button bulk on small screens */
  .btn{
    padding: 8px 10px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
  }

  /* Strip: wrap nicely */
  .strip{
    position: sticky;
    top: calc(58px + env(safe-area-inset-top, 0px));
    z-index: 950;
  }

  /* Layout: map stays full width; sidebar overlays as sheet */
  .layout{
    height: calc(100vh - 58px);
    grid-template-columns: 1fr;
  }

  /* Map should always fill */
  #map, .map{
    height: 100%;
    min-height: calc(100vh - 58px);
  }

  /* Sidebar becomes bottom-sheet overlay */
  .sidebar{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: min(76vh, 620px);
    max-height: calc(100vh - 120px);
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    z-index: 3200;
    overflow: hidden;
    transform: translateY(0);
    transition: transform 220ms ease, opacity 220ms ease;
    box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.65);
  }
  .sidebar-inner{
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }

  /* When "hidden" on mobile, slide it down instead of display:none
     (prevents the Toggle Lore button from becoming unreachable) */
  .sidebar.hidden{
    display: block;
    transform: translateY(calc(100% - 56px));
    opacity: 0.98;
  }

  /* Add a grab-handle look using existing header area */
  .sidebar-head{
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(10, 10, 16, 0.96), rgba(10, 10, 16, 0.78));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
  }
  .sidebar-head::before{
    content:"";
    display:block;
    width: 56px;
    height: 5px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.10);
  }

  /* Make legend less tall on mobile */
  .legend{ padding: 10px 10px 8px; border-radius: 16px; }
  .legend-grid{ gap: 8px; }

  /* Prevent the sidebar from clipping critical popups */
  .search-results{
    max-height: 44vh;
  }
}

/* Extra-small phones */
@media (max-width: 420px){
  .subtitle{ display:none; }
  .btn{ padding: 7px 9px; border-radius: 11px; }
  .panel-title{ font-size: 16px; }
}
/* ==============================
   ST. BRIGID'S HOSPITAL — PRESERVATION WARD MODULE
   ============================== */
.brigid-ward{
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 12, 0.55);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.brigid-ward-title{
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brigid-ward-sub{
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}
.brigid-ward-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
  margin-top: 10px;
}
.brigid-metric{
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.brigid-metric .k{
  font-size: 11px;
  opacity: 0.75;
}
.brigid-metric .v{
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}
.brigid-ward-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top: 10px;
}
.brigid-feed{
  margin-top: 10px;
  height: 140px;
  overflow:auto;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
}
.brigid-line{
  opacity: 0.92;
  padding: 2px 0;
}
.brigid-line:nth-child(3n){
  opacity: 0.75;
}
.brigid-echo{
  margin-top: 10px;
  padding: 10px;
  border-left: 3px solid rgba(170, 255, 220, 0.28);
  background: rgba(170, 255, 220, 0.06);
  border-radius: 10px;
}

/* Cul-de-sac (b21) module */
.culdesac-module{border:1px solid rgba(255, 255, 255, .08); background:rgba(10, 12, 18, .35); padding:12px; border-radius:12px;}
.culdesac-module .chip{display:inline-block; margin-left:6px; padding:2px 8px; border-radius:999px; font-size:11px; border:1px solid rgba(255, 255, 255, .14); background:rgba(255, 255, 255, .06);}
/* ==============================
   Landmark Modules Slot
============================== */
.lm-modules{
  margin-top: 12px;
  display: grid;
  gap: 12px;
}
.sb-module{
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.35);
}
/* ==============================
   Landmark Modules Slot
   ============================== */
.lm-modules{
  margin-top: 10px;
  display: grid;
  gap: 10px;
}
.lm-modules:empty{ display:none; }

.lm-modules{
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.sb-module{
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.35);
}
/* ==============================
   SB Rupture Pressure HUD
   ============================== */
.sb-rupture{
  margin:10px 10px 12px;
  padding:10px 12px;
  border:1px solid rgba(255, 255, 255, 0.10);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.22));
  cursor:pointer;
  user-select:none;
}
.sb-rupture-top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
}
.sb-rupture-title{
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
  opacity:.9;
}
.sb-rupture-val{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size:12px;
  opacity:.9;
}
.sb-rupture-bar{
  margin-top:8px;
  height:10px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255, 255, 255, 0.08);
  border:1px solid rgba(255, 255, 255, 0.10);
}
.sb-rupture-fill{
  height:100%;
  width:0%;
  background:rgba(255, 255, 255, 0.30);
  border-right:1px solid rgba(255, 255, 255, 0.15);
}
.sb-rupture-sub{
  margin-top:8px;
  font-size:11px;
  opacity:.8;
}

/* click-log */
.sb-rupture-log{
  margin-top:10px;
  border:1px solid rgba(255, 255, 255, 0.12);
  border-radius:12px;
  background:rgba(0, 0, 0, 0.30);
  overflow:hidden;
}
.sb-rupture-log-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 10px;
  border-bottom:1px solid rgba(255, 255, 255, 0.10);
}
.sb-rupture-x{
  border:1px solid rgba(255, 255, 255, 0.14);
  background:rgba(0, 0, 0, 0.20);
  color:inherit;
  border-radius:10px;
  padding:2px 8px;
  cursor:pointer;
}
.sb-rupture-log-body{
  padding:10px;
  max-height:160px;
  overflow:auto;
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size:12px;
  line-height:1.35;
}
.sb-rupture-row{
  display:flex;
  gap:10px;
  opacity:.9;
  padding:2px 0;
}
.sb-rupture-row .t{opacity:.6; min-width:70px;}
.sb-rupture-row .r{opacity:.95;}

/* Tier “atmosphere” (very light, safe) */
:root[data-sb-rupture-tier="2"] .sb-rupture-fill{ background:rgba(255, 255, 255, 0.42); }
:root[data-sb-rupture-tier="3"] .sb-rupture-fill{ background:rgba(255, 255, 255, 0.55); }
:root[data-sb-rupture-tier="4"] .sb-rupture-fill{ background:rgba(255, 255, 255, 0.70); }

/* Inbox collapsible */
.sb-inbox.is-collapsed .sb-inbox-body{ display:none !important; }
.sb-inbox-toggle{
  border:1px solid rgba(255, 255, 255, 0.14);
  background:rgba(0, 0, 0, 0.20);
  color:inherit;
  border-radius:10px;
  padding:2px 8px;
  cursor:pointer;
  line-height:1.2;
}
.sb-inbox-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

/* Inbox pin + collapse behavior */
.sb-inbox.is-collapsed .sb-inbox-body{ display:none !important; }

.sb-inbox-controls{
  display:flex;
  align-items:center;
  gap:8px;
}

.sb-inbox-toggle,
.sb-inbox-pin{
  border:1px solid rgba(255, 255, 255, 0.14);
  background:rgba(0, 0, 0, 0.20);
  color:inherit;
  border-radius:10px;
  padding:2px 8px;
  cursor:pointer;
  line-height:1.2;
}

.sb-inbox.is-pinned .sb-inbox-pin{
  border-color: rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.06);
}
.sb-inbox-root.is-collapsed .sb-inbox-tabs,
.sb-inbox-root.is-collapsed .sb-inbox-body{
  display:none;
}
.sb-inbox-hbtns{display:flex;gap:6px;align-items:center}
.sb-inbox-mini{
  border:1px solid rgba(255, 255, 255, .14);
  background:rgba(0, 0, 0, .18);
  color:inherit;
  padding:4px 8px;
  border-radius:10px;
  cursor:pointer;
  font-size:12px;
  line-height:1;
}
.sb-inbox-pin.is-on{filter:brightness(1.2)}

.wstb-btn.is-on{
  background:rgba(255, 255, 255, 0.08);
  border-color:rgba(255, 255, 255, 0.35);
}
/* Canon: quiet UI removals */
.sb-hidden-canon{ display:none !important; }

/* Canon badge shown on landmark panels */
.sb-canon-badge{
  display:inline-block;
  margin:6px 0 0 0;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(255, 255, 255, 0.22);
  background:rgba(255, 255, 255, 0.05);
  font-size:12px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  opacity:0.9;
}
/* =========================
   Canon UI Subtractions (silent)
   ========================= */
body.sb-canon-kill-reredact #docReRedact{ display:none !important; }
body.sb-canon-kill-revealall #docRevealAll{ display:none !important; }
body.sb-canon-kill-copylink #docCopyLink{ display:none !important; }

/* =========================
   Context-smart sidebar rails
   ========================= */
.panel-actions-rail{
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px 0 8px 0;
  margin: 0 0 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(to bottom, rgba(10, 10, 12, 0.92), rgba(10, 10, 12, 0.75));
  backdrop-filter: blur(6px);
}
.panel-content-rail{
  display:block;
}
.panel-badges{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.panel-badges .pbadge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  letter-spacing:0.06em;
  text-transform:uppercase;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  opacity:0.92;
}
.panel-badges .pbadge.dim{opacity:0.65;}
.panel-badges .pbadge.hot{border-color:rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.07);}
/* =========================
   Sidebar Rails (Header / Actions / Content)
   ========================= */
#panelHeaderRail{
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(6px);
}
#panelActionsRail{
  position: sticky;
  top: 64px; /* sits under header rail */
  z-index: 25;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 12, 0.86);
  backdrop-filter: blur(6px);
  min-height: 0;
}
#panelContentRail{
  padding: 10px 12px 14px 12px;
}
#panelBadges{ display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.sb-pill{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}
.sb-pill-cycle{ opacity:0.95; }
.sb-pill-obs{ border-color: rgba(255, 220, 120, 0.35); }

/* Mythic Search (Divination) */
.search-section{ padding:8px 10px 10px; border-bottom:1px solid rgba(255, 255, 255, 0.08); }
.search-section-title{
  font-size:11px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  opacity:0.75;
  margin:2px 0 6px;
}
.search-hint{
  font-size:12px;
  opacity:0.55;
  margin:0 0 8px;
}
.sheet{
  position:relative;
  background:var(--paper);
}

.sheet::before{
  content:"";
  position:absolute;
  inset:0;
  background:url('/img/sbhs/mascot.jpg') center/cover no-repeat;
  opacity:.18;
  filter:grayscale(100%) contrast(1.1);
  z-index:0;
}

.sheet > *{
  position:relative;
  z-index:1;
}

/* =========================
   Sidebar head toggles (Legend / Lore)
   ========================= */
.sidebar-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.sidebar-head-text{ min-width:0; }
.sidebar-head-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.btn.mini{ padding:6px 10px; font-size:12px; border-radius:12px; }
#togglePlacement[hidden]{ display:none !important; }

/* =========================
   Doc Viewer Layout Fixes
   - Prevent "weird" grid on smaller screens
   - Keep toolbar usable, avoid cramped title
   ========================= */
.docbox-toolbar{ flex-wrap: wrap; }
.docbox-title{ max-width: min(72vw, 720px); }

@media (max-width: 980px){
  .docbox-body{
    inset: 74px 12px 12px;
    grid-template-columns: 1fr;
  }
  .docbox-side{
    max-height: 34vh;
  }
}

@media (max-width: 520px){
  .docbox-toolbar{
    top: 10px; left: 10px; right: 10px;
    gap: 8px;
  }
  .docbtn{ padding: 8px 10px; }
  .docbox-body{ inset: 92px 8px 8px; gap: 10px; }
}
.archive-viewtabs{
  display:flex;
  gap:8px;
  margin:10px 0;
}
.archive-tabbtn{
  appearance:none;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  color:inherit;
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
}
.archive-tabbtn.active{
  border-color: rgba(255,255,255,.42);
  background: rgba(255,255,255,.12);
}
/* Archive: Quiet Log toggle (chip-style button) */
.chipbtn{
  appearance:none;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  color:inherit;
  padding:6px 10px;
  border-radius:999px;
  font:inherit;
  cursor:pointer;
  line-height:1.1;
  white-space:nowrap;
}
.chipbtn:hover{ background:rgba(255,255,255,.10); }
.chipbtn.active,
.chipbtn[aria-pressed="true"]{
  border-color: rgba(255,255,255,.42);
  background: rgba(255,255,255,.14);
}

/* Quiet view: de-emphasize filters without disabling clicks globally */
.archive.quiet-view .archive-row select,
.archive.quiet-view .archive-row label.chip,
.archive.quiet-view #archiveSearch{
  opacity:.55;
}
.valentina{
  width: 400px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}


/* Mythic search sections */
.search-sec{ padding: 8px 8px 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.search-sec:first-child{ border-top: 0; }
.search-sec-title{
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .75;
  margin: 2px 2px 8px;
}
/* Promo doc image: clickable dossier launcher */
.promo-doc{
  cursor: pointer;
  border-radius: 12px;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.promo-doc:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  filter: saturate(1.03) contrast(1.02);
}
.promo-doc:focus{
  outline: 2px solid rgba(141,122,76,.55);
  outline-offset: 4px;
}

/* Promo sidebar image button */
.promo-docbtn{
  display:block;
  width:100%;
  padding:0;
  margin:0;
  border:none;
  background:transparent;
  cursor:pointer;
}
.promo-docbtn img{
  display:block;
  width:100%;
  height:auto;
  border-radius:12px;
}
.promo-docbtn:focus-visible{
  outline:2px solid rgba(255,255,255,0.35);
  outline-offset:4px;
  border-radius:14px;
}

.pdf-lightbox{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99999;
}
.pdf-lightbox.is-open{ display: block; }

.pdf-lightbox__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
}

.pdf-lightbox__panel{
  position: relative;
  width: min(1100px, 92vw);
  height: min(86vh, 900px);
  margin: 6vh auto 0;
  background: #0b0b0c;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 70px rgba(0,0,0,.6);
}

.pdf-lightbox__close{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: #fff;
  cursor: pointer;
}

.pdf-lightbox__frame{
  width: 100%;
  .promo-pdf-dialog{
  width: min(1100px, 92vw);
  height: min(88vh, 950px);
  padding: 0;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  background: #0b0b0c;
  overflow: hidden;
  z-index: 2147483647;
}
.promo-pdf-dialog::backdrop{
  background: rgba(0,0,0,.75);
}
.promo-pdf-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.promo-pdf-title{ color:#fff; font-size: 14px; opacity:.9; }
.promo-pdf-close{
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: #fff;
  cursor: pointer;
}
.promo-pdf-object{
  width: 100%;
  height: calc(100% - 60px);
  display: block;
}
  height: 100%;
  border: 0;
  background: #111;
}
.promo-pdf-dialog{
  width: min(1100px, 92vw);
  height: min(88vh, 950px);
  padding: 0;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  background: #0b0b0c;
  overflow: hidden;
  z-index: 2147483647;
}
.promo-pdf-dialog::backdrop{
  background: rgba(0,0,0,.75);
}
.promo-pdf-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.promo-pdf-title{ color:#fff; font-size: 14px; opacity:.9; }
.promo-pdf-close{
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: #fff;
  cursor: pointer;
}
.promo-pdf-object{
  width: 100%;
  height: calc(100% - 60px);
  display: block;
}

/* Cycle pulse (ambient indicator in sidebar header rail) */
.cycle-pulse{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-top:10px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.18);
  width:fit-content;
}
.cycle-pulse .cp-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:rgba(255,255,255,.35);
  box-shadow:0 0 0 rgba(255,255,255,0);
}
.cycle-pulse .cp-label{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  opacity:.78;
}
.cycle-pulse.is-ink   .cp-dot{ background: rgba(180,180,200,.55); }
.cycle-pulse.is-brass .cp-dot{ background: rgba(190,165,105,.60); }
.cycle-pulse.is-water .cp-dot{ background: rgba(140,175,205,.62); }
.cycle-pulse.is-code  .cp-dot{ background: rgba(155,185,165,.62); }
.cycle-pulse.is-all   .cp-dot{ background: rgba(255,255,255,.40); }

@keyframes sbCyclePulse{
  0%   { transform:scale(1);   filter:brightness(1); }
  35%  { transform:scale(1.08); filter:brightness(1.35); }
  100% { transform:scale(1);   filter:brightness(1); }
}
.cycle-pulse.pulse{ animation: sbCyclePulse 520ms ease-out; }
.cycle-pulse.pulse .cp-dot{ box-shadow: 0 0 18px rgba(255,255,255,.22); }

.cyoa-modal{ position:fixed; inset:0; display:none; z-index:9999; }
.cyoa-modal[aria-hidden="false"]{ display:block; }

.cyoa-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.72); backdrop-filter: blur(6px); }

.cyoa-panel{
  position:absolute; left:50%; top:50%;
  transform:translate(-50%,-50%);
  width:min(980px, calc(100vw - 24px));
  height:min(82vh, 860px);
  background: rgba(10,12,16,.96);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  box-shadow:0 24px 80px rgba(0,0,0,.65);
  display:flex; flex-direction:column;
  overflow:hidden;
}

.cyoa-head{ display:flex; justify-content:space-between; gap:12px; padding:14px 14px; border-bottom:1px solid rgba(255,255,255,.08); }
.cyoa-work{ font-size:11px; letter-spacing:.14em; text-transform:uppercase; opacity:.7; }
.cyoa-title{ font-size:16px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.cyoa-meta{ font-size:12px; opacity:.7; margin-top:4px; }

.cyoa-body{
  padding:16px 16px 22px;
  overflow:auto;
  font-size:14px;
  line-height:1.7;
  color: rgba(244,240,230,.92);
  white-space:pre-wrap;
}

.cyoa-foot{ padding:12px 14px; border-top:1px solid rgba(255,255,255,.08); background:rgba(0,0,0,.18); }
.cyoa-footer{ font-size:11px; letter-spacing:.14em; text-transform:uppercase; opacity:.75; margin-bottom:10px; }
.cyoa-choices{ display:flex; flex-wrap:wrap; gap:10px; }
.cyoa-choices .action{ flex: 0 1 auto; }

/* ===== ST. BRIELLE ATMOSPHERE STACK ===== */
.sb-atmosphere{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sb-fog,
.sb-glow,
.sb-shimmer{
  position: absolute;
  inset: -8%;
  pointer-events: none;
}

/* fog */
.sb-fog{
  opacity: .16;
  filter: blur(12px);
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

.sb-fog-a{
  background:
    radial-gradient(circle at 18% 28%, rgba(210,220,235,.20), transparent 22%),
    radial-gradient(circle at 72% 38%, rgba(190,205,225,.14), transparent 20%),
    radial-gradient(circle at 46% 76%, rgba(225,235,245,.12), transparent 24%);
  animation: sbFogDriftA 42s linear infinite;
}

.sb-fog-b{
  background:
    radial-gradient(circle at 78% 18%, rgba(210,220,240,.16), transparent 18%),
    radial-gradient(circle at 26% 58%, rgba(200,215,230,.12), transparent 22%),
    radial-gradient(circle at 62% 82%, rgba(235,240,248,.10), transparent 18%);
  animation: sbFogDriftB 58s linear infinite reverse;
}

/* atmospheric bloom */
.sb-glow{
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,245,210,.08), transparent 34%),
    radial-gradient(circle at 18% 88%, rgba(90,120,170,.08), transparent 28%),
    radial-gradient(circle at 86% 74%, rgba(130,150,185,.06), transparent 24%);
  mix-blend-mode: screen;
  opacity: .72;
}

/* water shimmer */
.sb-shimmer{
  inset: auto 0 0 0;
  height: 38vh;
  opacity: .10;
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(170,190,220,.08) 30%,
      rgba(220,230,245,.12) 55%,
      rgba(120,150,190,.08) 100%
    );
  mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,.15), transparent);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,.15), transparent);
  animation: sbShimmer 9s ease-in-out infinite;
}

/* cycle tuning */
body.cycle-ink .sb-fog{ opacity: .12; }
body.cycle-ink .sb-glow{
  background:
    radial-gradient(circle at 50% 18%, rgba(210,185,120,.10), transparent 34%),
    radial-gradient(circle at 20% 80%, rgba(90,80,70,.08), transparent 28%);
}

body.cycle-brass .sb-fog{ opacity: .14; }
body.cycle-brass .sb-glow{
  background:
    radial-gradient(circle at 55% 14%, rgba(210,170,110,.12), transparent 32%),
    radial-gradient(circle at 82% 32%, rgba(120,90,50,.08), transparent 24%);
}

body.cycle-water .sb-fog{ opacity: .20; }
body.cycle-water .sb-shimmer{ opacity: .16; }
body.cycle-water .sb-glow{
  background:
    radial-gradient(circle at 50% 10%, rgba(210,230,255,.09), transparent 30%),
    radial-gradient(circle at 22% 86%, rgba(110,150,210,.12), transparent 28%);
}

body.cycle-code .sb-fog{ opacity: .10; }
body.cycle-code .sb-glow{
  background:
    radial-gradient(circle at 48% 15%, rgba(180,210,195,.10), transparent 30%),
    radial-gradient(circle at 85% 72%, rgba(110,170,150,.08), transparent 24%);
}

/* light mode discipline */
html[data-theme="light"] .sb-fog{
  opacity: .08;
  mix-blend-mode: multiply;
}
html[data-theme="light"] .sb-glow{
  opacity: .28;
}
html[data-theme="light"] .sb-shimmer{
  opacity: .05;
}

@keyframes sbFogDriftA{
  0%   { transform: translate3d(-2%, 0, 0) scale(1.03); }
  50%  { transform: translate3d(2%, -1.5%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 0, 0) scale(1.03); }
}

@keyframes sbFogDriftB{
  0%   { transform: translate3d(2%, 1%, 0) scale(1.05); }
  50%  { transform: translate3d(-2%, -1%, 0) scale(1.02); }
  100% { transform: translate3d(2%, 1%, 0) scale(1.05); }
}

@keyframes sbShimmer{
  0%   { transform: translateY(0); filter: brightness(1); }
  50%  { transform: translateY(-1.2%); filter: brightness(1.08); }
  100% { transform: translateY(0); filter: brightness(1); }
}
#sbAtmosphere[data-mode="investigate"] .sb-fog{
  opacity: .22;
}
#sbAtmosphere[data-mode="investigate"] .sb-glow{
  opacity: .9;
}
/* =========================================================
   ST. BRIELLE CASEBOARD POLISH PASS
   Put at very end of style.css so it wins cleanly
========================================================= */

/* Shell */
.caseboard{
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow:
    0 24px 70px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.04);
  overflow: hidden;
}

.caseboard-header{
  min-height: 56px;
  padding: 12px 14px;
  background:
    linear-gradient(180deg, rgba(20,24,32,.92), rgba(12,15,21,.88));
  border-bottom: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.03);
}

.caseboard-title{
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 900;
}

/* Layout */
.caseboard-body{
  grid-template-columns: minmax(0,1fr) 320px;
}

.caseboard-canvas{
  position: relative;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.03), transparent 18%),
    radial-gradient(circle at 75% 28%, rgba(220,180,120,.035), transparent 22%),
    linear-gradient(180deg, rgba(16,20,28,.96), rgba(9,12,18,.98));
  overflow: hidden;
}

.caseboard-canvas::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px;
  mask-image: radial-gradient(circle at center, rgba(0,0,0,.95), rgba(0,0,0,.55) 62%, transparent 100%);
  opacity:.22;
}

.caseboard-canvas::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at center, transparent 42%, rgba(0,0,0,.24) 100%);
}

/* Inspector */
.caseboard-side{
  background:
    linear-gradient(180deg, rgba(18,22,30,.96), rgba(12,16,22,.98));
  border-left: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 1px 0 0 rgba(255,255,255,.03);
}

.caseboard-side .legend-title,
.caseboard-side h3,
.caseboard-side strong{
  color: rgba(248,245,236,.96);
}

.caseboard-side .muted,
.caseboard-side .small,
.caseboard-side .meta{
  color: rgba(210,214,224,.72);
}

.caseboard-side #cbInspector{
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 12px;
}

/* Nodes */
.cb-node{
  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background:
    linear-gradient(180deg, rgba(37,43,56,.96), rgba(23,28,38,.98)) !important;
  box-shadow:
    0 12px 30px rgba(0,0,0,.38),
    inset 0 1px 0 rgba(255,255,255,.04) !important;
  color: rgba(244,246,251,.94) !important;
  transition:
    transform .16s ease,
    box-shadow .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.cb-node:hover{
  transform: translateY(-2px);
  box-shadow:
    0 18px 38px rgba(0,0,0,.45),
    0 0 0 1px rgba(255,255,255,.04),
    inset 0 1px 0 rgba(255,255,255,.05) !important;
}

.cb-node.selected{
  border-color: rgba(214,170,84,.72) !important;
  box-shadow:
    0 0 0 2px rgba(214,170,84,.22),
    0 18px 42px rgba(0,0,0,.48),
    0 0 24px rgba(214,170,84,.16) !important;
}

.cb-node .title,
.cb-node .cb-title{
  color: rgba(250,248,242,.98) !important;
  font-weight: 900;
  letter-spacing: .02em;
}

.cb-node .meta,
.cb-node .cb-row,
.cb-node .cb-k{
  color: rgba(209,214,223,.78) !important;
}

.cb-node .cb-badge,
.cb-node .cb-chip{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(243,245,249,.88) !important;
}

/* Node type accents */
.cb-node.doc{
  border-left: 3px solid rgba(214,170,84,.82) !important;
}
.cb-node.loc{
  border-left: 3px solid rgba(102,181,220,.82) !important;
}
.cb-node.note{
  border-left: 3px solid rgba(205,92,92,.82) !important;
}

/* If you have pin/thread elements */
.cb-thread,
.caseboard svg line,
.caseboard svg path{
  stroke: rgba(214,170,84,.34) !important;
}

/* Buttons inside caseboard */
.caseboard .btn,
.caseboard button{
  border-radius: 10px;
}

.caseboard .btn.ghost,
.caseboard button.ghost{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
}

.caseboard .btn.ghost:hover,
.caseboard button.ghost:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(214,170,84,.34);
}

/* ---------- LIGHT MODE ---------- */
html[data-theme="light"] .caseboard{
  border: 1px solid rgba(40,52,70,.12);
  box-shadow:
    0 24px 70px rgba(20,34,60,.14),
    inset 0 1px 0 rgba(255,255,255,.72);
  background: rgba(250,250,248,.94);
}

html[data-theme="light"] .caseboard-header{
  background:
    linear-gradient(180deg, rgba(248,247,243,.96), rgba(239,236,228,.94));
  border-bottom: 1px solid rgba(90,76,52,.14);
}

html[data-theme="light"] .caseboard-title{
  color: #2d2a24;
}

html[data-theme="light"] .caseboard-canvas{
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.55), transparent 18%),
    radial-gradient(circle at 78% 28%, rgba(201,162,84,.08), transparent 22%),
    linear-gradient(180deg, #f5f2e9, #ece7db);
}

html[data-theme="light"] .caseboard-canvas::before{
  background:
    linear-gradient(rgba(70,60,40,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70,60,40,.06) 1px, transparent 1px);
  opacity: .26;
}

html[data-theme="light"] .caseboard-canvas::after{
  background: radial-gradient(circle at center, transparent 45%, rgba(80,60,32,.06) 100%);
}

html[data-theme="light"] .caseboard-side{
  background:
    linear-gradient(180deg, rgba(248,246,240,.96), rgba(240,236,228,.98));
  border-left: 1px solid rgba(90,76,52,.14);
  box-shadow: inset 1px 0 0 rgba(255,255,255,.55);
}

html[data-theme="light"] .caseboard-side .legend-title,
html[data-theme="light"] .caseboard-side h3,
html[data-theme="light"] .caseboard-side strong{
  color: #2f2a21;
}

html[data-theme="light"] .caseboard-side .muted,
html[data-theme="light"] .caseboard-side .small,
html[data-theme="light"] .caseboard-side .meta{
  color: #6e675d;
}

html[data-theme="light"] .caseboard-side #cbInspector{
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(90,76,52,.12);
}

html[data-theme="light"] .cb-node{
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,242,234,.98)) !important;
  border: 1px solid rgba(84,72,56,.16) !important;
  box-shadow:
    0 10px 22px rgba(50,45,38,.10),
    inset 0 1px 0 rgba(255,255,255,.9) !important;
  color: #2f2a21 !important;
}

html[data-theme="light"] .cb-node:hover{
  box-shadow:
    0 16px 28px rgba(50,45,38,.14),
    0 0 0 1px rgba(214,170,84,.12),
    inset 0 1px 0 rgba(255,255,255,.95) !important;
}

html[data-theme="light"] .cb-node.selected{
  border-color: rgba(180,138,48,.56) !important;
  box-shadow:
    0 0 0 3px rgba(180,138,48,.18),
    0 16px 30px rgba(60,45,20,.14),
    0 0 20px rgba(180,138,48,.14) !important;
}

html[data-theme="light"] .cb-node .title,
html[data-theme="light"] .cb-node .cb-title{
  color: #272118 !important;
}

html[data-theme="light"] .cb-node .meta,
html[data-theme="light"] .cb-node .cb-row,
html[data-theme="light"] .cb-node .cb-k{
  color: #675f54 !important;
}

html[data-theme="light"] .cb-node .cb-badge,
html[data-theme="light"] .cb-node .cb-chip{
  background: rgba(186,154,80,.10) !important;
  border: 1px solid rgba(186,154,80,.18) !important;
  color: #6a5524 !important;
}

html[data-theme="light"] .cb-node.doc{
  border-left: 3px solid rgba(186,154,80,.82) !important;
}
html[data-theme="light"] .cb-node.loc{
  border-left: 3px solid rgba(83,145,185,.80) !important;
}
html[data-theme="light"] .cb-node.note{
  border-left: 3px solid rgba(176,88,88,.76) !important;
}

html[data-theme="light"] .cb-thread,
html[data-theme="light"] .caseboard svg line,
html[data-theme="light"] .caseboard svg path{
  stroke: rgba(186,154,80,.42) !important;
}
html[data-theme="light"] .lm-item.is-touched .lm-name::after,
html[data-theme="light"] .sb-pill-obs,
html[data-theme="light"] .sb-pill[data-state="observed"],
html[data-theme="light"] .canon-pill,
html[data-theme="light"] .obs-pill{
  color: #8a6618 !important;
  font-weight: 800 !important;
  letter-spacing: .02em;
}

html[data-theme="light"] .sb-pill-obs,
html[data-theme="light"] .sb-pill[data-state="observed"],
html[data-theme="light"] .canon-pill,
html[data-theme="light"] .obs-pill{
  background: linear-gradient(180deg, rgba(208,174,92,.16), rgba(180,138,48,.12)) !important;
  border-color: rgba(180,138,48,.32) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
/* =========================================================
   ST. BRIELLE ARCHIVE — DOCUMENT LIVING INDEX POLISH PASS
   Put at very end of style.css so it wins cleanly
========================================================= */

.archive{
  border: 1px solid rgba(255,255,255,.12);
  box-shadow:
    0 24px 80px rgba(0,0,0,.42),
    inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.archive::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 14% 12%, rgba(214,170,84,.10), transparent 20%),
    radial-gradient(circle at 82% 20%, rgba(110,145,190,.07), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 30%);
  opacity:.9;
}

.archive-header{
  position:relative;
  min-height:58px;
  padding:12px 14px;
  background:
    linear-gradient(180deg, rgba(19,23,30,.94), rgba(12,15,21,.90));
  border-bottom:1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.03);
}

.archive-header::after{
  content:"OFFICE OF PERPETUAL RECORD";
  position:absolute;
  right:322px;
  top:50%;
  transform:translateY(-50%);
  font-size:10px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(214,170,84,.76);
  font-weight:800;
  pointer-events:none;
}

.archive-title{
  color:rgba(248,245,236,.96) !important;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.archive-body{
  gap:14px;
}

.archive-filters{
  position:relative;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(24,28,36,.88), rgba(15,19,26,.92));
  box-shadow:
    0 12px 30px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.03);
}

.archive-row{
  gap:10px;
}

.archive-main{
  grid-template-columns: minmax(0,1fr) 320px;
  gap:14px;
}

.archive-results{
  position:relative;
  width:auto;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.04), transparent 18%),
    linear-gradient(180deg, rgba(17,21,28,.96), rgba(10,13,18,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 14px 34px rgba(0,0,0,.16);
}

.archive-results::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size:24px 24px, 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.5));
  opacity:.22;
}

.archive-side{
  width:auto;
  background:
    linear-gradient(180deg, rgba(19,22,29,.96), rgba(12,16,22,.98));
}

.archive-side .legend-title{
  color:rgba(248,245,236,.96);
  letter-spacing:.08em;
  text-transform:uppercase;
}

.archive-side .muted,
.archive-side .small,
.archive-side .meta{
  color:rgba(214,220,229,.74);
}

#casefileStats{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
}

.archive-card{
  position:relative;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(180deg, rgba(38,44,56,.92), rgba(24,29,39,.96));
  box-shadow:
    0 12px 26px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.04);
  transition:
    transform .16s ease,
    box-shadow .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.archive-card::before{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  bottom:10px;
  width:3px;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(214,170,84,.82), rgba(110,145,190,.45));
  opacity:.9;
}

.archive-card:hover{
  transform: translateY(-2px);
  border-color: rgba(214,170,84,.32);
  box-shadow:
    0 18px 34px rgba(0,0,0,.30),
    0 0 0 1px rgba(255,255,255,.03),
    inset 0 1px 0 rgba(255,255,255,.05);
}

.archive-card .title,
.archive-card .archive-title,
.archive-card strong{
  color:rgba(249,247,240,.98);
  font-weight:900;
}

.archive-card .meta,
.archive-card .muted,
.archive-card .subtitle{
  color:rgba(213,218,226,.74);
}

.archive-card .badges,
.archive-card .actions{
  position:relative;
  z-index:1;
}

.archive-card .badge,
.archive-card .chip,
.archive-card .pill{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color:rgba(241,244,248,.88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.archive-card .actions .action,
.archive-card .actions .btn,
.archive-card .actions button{
  border-radius:12px;
}

.archive-viewtabs{
  margin-top: 2px;
  display:flex;
  gap:8px;
  align-items:center;
}

.archive-tabbtn,
#archiveViewDocs,
#archiveViewQuiet,
#archiveViewQuietToggle{
  border-radius:999px;
  min-height:36px;
  padding:8px 12px;
}

#archiveViewDocs.active,
#archiveViewQuiet.active,
#archiveViewQuietToggle[aria-pressed="true"]{
  border-color: rgba(214,170,84,.38) !important;
  box-shadow: 0 0 0 2px rgba(214,170,84,.14), inset 0 1px 0 rgba(255,255,255,.06);
}

.archive-side::before{
  content:"⊕ LIVING INDEX";
  display:block;
  margin-bottom:12px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(214,170,84,.18);
  background:linear-gradient(180deg, rgba(214,170,84,.10), rgba(214,170,84,.05));
  color:rgba(214,170,84,.86);
  font-size:11px;
  letter-spacing:.14em;
  font-weight:800;
  text-transform:uppercase;
}

/* Light mode archive */
html[data-theme="light"] .archive{
  border:1px solid rgba(64,70,82,.14);
  background:rgba(249,248,244,.94);
  box-shadow:
    0 24px 70px rgba(40,36,28,.12),
    inset 0 1px 0 rgba(255,255,255,.76);
}

html[data-theme="light"] .archive::before{
  background:
    radial-gradient(circle at 15% 12%, rgba(186,154,80,.12), transparent 20%),
    radial-gradient(circle at 84% 18%, rgba(110,145,185,.08), transparent 23%),
    linear-gradient(180deg, rgba(255,255,255,.35), transparent 28%);
}

html[data-theme="light"] .archive-header{
  background:
    linear-gradient(180deg, rgba(248,246,240,.97), rgba(239,235,226,.95));
  border-bottom:1px solid rgba(90,76,52,.14);
}

html[data-theme="light"] .archive-header::after{
  color:#8a6618;
}

html[data-theme="light"] .archive-title{
  color:#2f2a21 !important;
}

html[data-theme="light"] .archive-filters{
  border:1px solid rgba(90,76,52,.12) !important;
  background:linear-gradient(180deg, rgba(255,255,255,.86), rgba(245,241,233,.90)) !important;
  box-shadow: 0 10px 22px rgba(60,50,32,.06), inset 0 1px 0 rgba(255,255,255,.8);
}

html[data-theme="light"] .archive-results{
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.55), transparent 18%),
    linear-gradient(180deg, rgba(245,241,233,.95), rgba(236,231,221,.98)) !important;
  border-color: rgba(90,76,52,.12) !important;
}

html[data-theme="light"] .archive-results::before{
  background:
    linear-gradient(rgba(82,70,48,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82,70,48,.05) 1px, transparent 1px);
  opacity:.22;
}

html[data-theme="light"] .archive-side{
  background:linear-gradient(180deg, rgba(248,246,240,.96), rgba(239,235,226,.98)) !important;
  border-color: rgba(90,76,52,.12) !important;
  box-shadow: inset 1px 0 0 rgba(255,255,255,.55), 0 14px 28px rgba(60,50,32,.06);
}

html[data-theme="light"] .archive-side::before{
  color:#8a6618;
  border-color: rgba(180,138,48,.24);
  background:linear-gradient(180deg, rgba(208,174,92,.16), rgba(180,138,48,.10));
}

html[data-theme="light"] .archive-side .legend-title,
html[data-theme="light"] #casefileStats,
html[data-theme="light"] .archive-card .title,
html[data-theme="light"] .archive-card strong{
  color:#2f2a21 !important;
}

html[data-theme="light"] .archive-side .muted,
html[data-theme="light"] .archive-card .meta,
html[data-theme="light"] .archive-card .muted,
html[data-theme="light"] #casefileStats{
  color:#675f54 !important;
}

html[data-theme="light"] #casefileStats{
  background:rgba(255,255,255,.70);
  border:1px solid rgba(90,76,52,.10);
}

html[data-theme="light"] .archive-card{
  background:linear-gradient(180deg, rgba(255,255,255,.97), rgba(246,242,234,.99)) !important;
  border:1px solid rgba(84,72,56,.14) !important;
  box-shadow:
    0 10px 22px rgba(50,45,38,.09),
    inset 0 1px 0 rgba(255,255,255,.92) !important;
}

html[data-theme="light"] .archive-card::before{
  background:linear-gradient(180deg, rgba(186,154,80,.88), rgba(83,145,185,.52));
}

html[data-theme="light"] .archive-card:hover{
  border-color: rgba(180,138,48,.26) !important;
  box-shadow:
    0 16px 28px rgba(50,45,38,.12),
    0 0 0 1px rgba(180,138,48,.10),
    inset 0 1px 0 rgba(255,255,255,.95) !important;
}

html[data-theme="light"] .archive-card .badge,
html[data-theme="light"] .archive-card .chip,
html[data-theme="light"] .archive-card .pill{
  background:rgba(186,154,80,.10) !important;
  border:1px solid rgba(186,154,80,.18) !important;
  color:#6a5524 !important;
}

html[data-theme="light"] #archiveViewDocs.active,
html[data-theme="light"] #archiveViewQuiet.active,
html[data-theme="light"] #archiveViewQuietToggle[aria-pressed="true"]{
  border-color: rgba(180,138,48,.34) !important;
  box-shadow: 0 0 0 2px rgba(180,138,48,.12), inset 0 1px 0 rgba(255,255,255,.72);
}
/* =========================================================
   ARCHIVE CLASSIFICATION SYSTEM
========================================================= */

.archive-card[data-class]{
  position: relative;
  overflow: hidden;
}

/* classification ribbon */
.archive-card[data-class]::after{
  content: attr(data-class);
  position: absolute;
  top: 10px;
  right: -36px;

  width: 160px;
  padding: 4px 0;

  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;

  font-weight: 900;

  transform: rotate(45deg);

  color: #fff;

  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}

/* =========================================================
   CLASS TYPES
========================================================= */

.archive-card[data-class="CANON"]::after{
  background: linear-gradient(180deg,#caa454,#9a772f);
}

.archive-card[data-class="OBSERVED"]::after{
  background: linear-gradient(180deg,#4d8ac2,#2f5c8a);
}

.archive-card[data-class="CLASSIFIED"]::after{
  background: linear-gradient(180deg,#5b6a7a,#394653);
}

.archive-card[data-class="CORRUPTED"]::after{
  background: linear-gradient(180deg,#7b3232,#4e1f1f);
}

.archive-card[data-class="ENTITY"]::after{
  background: linear-gradient(180deg,#5e3a82,#3c2357);
}

/* =========================================================
   LEFT EDGE CLASS BAR
========================================================= */

.archive-card[data-class]::before{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  bottom:10px;
  width:4px;
  border-radius:999px;
}

.archive-card[data-class="CANON"]::before{
  background:#caa454;
}

.archive-card[data-class="OBSERVED"]::before{
  background:#4d8ac2;
}

.archive-card[data-class="CLASSIFIED"]::before{
  background:#5b6a7a;
}

.archive-card[data-class="CORRUPTED"]::before{
  background:#8b3b3b;
}

.archive-card[data-class="ENTITY"]::before{
  background:#6e4ca1;
}
/* =========================================================
   ARCHIVE TEMPORAL STRIPE
========================================================= */

.archive-card[data-year]{
  position: relative;
}

/* year marker on left edge */
.archive-card[data-year]::before{
  content: attr(data-year);
  position: absolute;

  left: -64px;
  top: 18px;

  width: 56px;
  text-align: right;

  font-size: 11px;
  letter-spacing: .14em;
  font-weight: 800;
  text-transform: uppercase;

  color: rgba(214,170,84,.75);

  opacity: .9;
}

/* timeline rail */
.archive-results{
  position: relative;
}

.archive-results::after{
  content:"";
  position:absolute;

  left:-40px;
  top:0;
  bottom:0;

  width:2px;

  background:linear-gradient(
    180deg,
    rgba(214,170,84,.15),
    rgba(214,170,84,.35),
    rgba(214,170,84,.15)
  );

  opacity:.7;
}
/* =========================================================
   INVESTIGATE MODE — ARCHIVE COMPACT LAYOUT
========================================================= */

body[data-ui-mode="investigate"] .archive{
  min-width: 0;
}

body[data-ui-mode="investigate"] .archive-main{
  grid-template-columns: minmax(0,1fr) 240px !important;
  gap: 10px;
  min-width: 0;
}

body[data-ui-mode="investigate"] .archive-results,
body[data-ui-mode="investigate"] .archive-side{
  width: auto !important;
  min-width: 0;
}

body[data-ui-mode="investigate"] .archive-side{
  max-width: 240px;
}

body[data-ui-mode="investigate"] .archive-filters{
  padding: 10px;
}

body[data-ui-mode="investigate"] .archive-row{
  gap: 8px;
  flex-wrap: wrap;
}

body[data-ui-mode="investigate"] .archive-viewtabs{
  margin-top: 8px;
  gap: 6px;
}

body[data-ui-mode="investigate"] #archiveViewTabs .action,
body[data-ui-mode="investigate"] #archiveViewDocs,
body[data-ui-mode="investigate"] #archiveViewQuiet,
body[data-ui-mode="investigate"] #archiveViewQuietToggle{
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

body[data-ui-mode="investigate"] .archive-card{
  padding: 9px;
  margin-bottom: 8px;
}

body[data-ui-mode="investigate"] .archive-card .title{
  font-size: 14px;
  line-height: 1.2;
}

body[data-ui-mode="investigate"] .archive-card .meta{
  font-size: 11px;
}

body[data-ui-mode="investigate"] .archive-card .badges{
  gap: 6px;
}

body[data-ui-mode="investigate"] .archive-card .actions{
  gap: 6px;
}

/* keep only one tab system visually emphasized */
body[data-ui-mode="investigate"] #archiveViewQuietToggle{
  display: none !important;
}



/* Reduced-FX mode during heavy interaction */
body.sb-lowfx *,
body.sb-lowfx *::before,
body.sb-lowfx *::after{
  transition-duration: 0.001ms !important;
}

body.sb-lowfx .timeline-hud::before,
body.sb-lowfx .mist,
body.sb-lowfx .fog,
body.sb-lowfx .grain,
body.sb-lowfx .corruption,
body.sb-lowfx .cyoa-backdrop,
body.sb-lowfx .caseboard,
body.sb-lowfx .archive,
body.sb-lowfx .sidebar,
body.sb-lowfx .modal,
body.sb-lowfx .glass{
  backdrop-filter: none !important;
  filter: none !important;
  animation-play-state: paused !important;
}
/* =========================
   Design polish pass
   ========================= */
:root{
  --surface-1: rgba(255,255,255,.03);
  --surface-2: rgba(255,255,255,.05);
  --surface-3: rgba(10,10,16,.90);

  --border-soft: rgba(255,255,255,.08);
  --border-mid: rgba(255,255,255,.12);
  --border-strong: rgba(255,255,255,.18);

  --shadow-soft: 0 12px 30px rgba(0,0,0,.22);
  --shadow-mid: 0 18px 55px rgba(0,0,0,.35);
  --shadow-strong: 0 32px 90px rgba(0,0,0,.55);

  --accent-brass: rgba(220,180,120,.95);
  --accent-ink: rgba(150,110,220,.95);
  --accent-water: rgba(95,150,210,.95);
  --accent-code: rgba(90,210,180,.95);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
}

.topbar{
  gap:16px;
  padding:14px 18px;
  background:linear-gradient(180deg, rgba(8,8,14,.92), rgba(8,8,14,.72));
  border-bottom:1px solid var(--border-soft);
  backdrop-filter:blur(12px);
}

.brand{ gap:14px; }
.title{ letter-spacing:.5px; font-weight:800; }
.subtitle{ opacity:.82; }

.controls{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.modebar{
  display:flex;
  gap:6px;
  padding:6px;
  border-radius:16px;
  background:var(--surface-1);
  border:1px solid var(--border-soft);
  backdrop-filter:blur(10px);
}

.modebtn{
  min-height:40px;
  min-width:118px;
  padding:8px 12px;
  border-radius:12px;
}

.modebtn.active{
  background:rgba(220,180,120,.18) !important;
  border-color:rgba(220,180,120,.42) !important;
  box-shadow:0 0 0 1px rgba(220,180,120,.08) inset;
}

.reversal-btn{
  border-radius:999px;
  border:1px solid rgba(220,180,120,.34);
  background:linear-gradient(180deg, rgba(220,180,120,.16), rgba(220,180,120,.06));
  box-shadow:var(--shadow-soft);
  white-space:nowrap;
}
.reversal-btn:hover{
  border-color:rgba(220,180,120,.48);
  background:linear-gradient(180deg, rgba(220,180,120,.22), rgba(220,180,120,.08));
}

.searchwrap{
  position:relative;
  min-width:280px;
  border-radius:16px;
  transition:transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}

.search{
  min-height:40px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  border:1px solid var(--border-soft);
  box-shadow:none;
}

.search:focus{
  outline:none;
  border-color:rgba(220,180,120,.30);
  box-shadow:0 0 0 3px rgba(220,180,120,.10), 0 14px 34px rgba(0,0,0,.24);
}

.search-results{
  top:50px;
  border-radius:18px;
  background:rgba(8,8,12,.96);
  border:1px solid var(--border-mid);
  box-shadow:var(--shadow-strong);
}

.search-item{
  position:relative;
  padding:12px 14px 12px 18px;
}

.search-item::before{
  content:"";
  position:absolute;
  left:0;
  top:8px;
  bottom:8px;
  width:3px;
  border-radius:999px;
  background:rgba(220,180,120,.58);
  opacity:0;
  transition:opacity .18s ease;
}

.search-item:hover::before,
.search-item.active::before{
  opacity:1;
}

.strip{
  padding:12px 16px;
  background:linear-gradient(180deg, rgba(8,8,14,.78), rgba(8,8,14,.56));
  border-bottom:1px solid var(--border-soft);
}

.seg{
  padding:7px 10px;
  border-radius:16px;
  background:var(--surface-1);
  border:1px solid var(--border-soft);
}

.seg:hover{ border-color:rgba(220,180,120,.20); }

.archive-results,
.archive-side,
.archive-card,
.cb-node{
  background:var(--surface-1);
  border:1px solid var(--border-soft);
  box-shadow:var(--shadow-soft);
}


.docbox-view,
.docbox-side,
.lightbox-figure,
.pdf-lightbox__panel{
  background:var(--surface-3);
  border:1px solid var(--border-strong);
  box-shadow:var(--shadow-strong);
}

.cycle-card{
  transition:transform .18s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}
.cycle-card:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 34px rgba(0,0,0,.28);
}
.cycle-card.active{
  border-color:rgba(255,255,255,.20);
  box-shadow:0 0 0 1px rgba(255,255,255,.05) inset, 0 16px 38px rgba(220,180,120,.14);
}

body[data-ui-mode="explore"] .topbar,
body[data-ui-mode="explore"] .strip{
  background:linear-gradient(180deg, rgba(8,8,14,.86), rgba(8,8,14,.60));
}

body[data-ui-mode="search"] .searchwrap{
  outline:2px solid rgba(220,180,120,.22);
}
body[data-ui-mode="search"] #controlStrip .strip-right{
  opacity:.45;
}

body[data-ui-mode="investigate"] .archive,
body[data-ui-mode="investigate"] .caseboard{
  border-color:rgba(220,180,120,.16);
  box-shadow:0 28px 90px rgba(0,0,0,.58);
}

body[data-ui-mode="controls"] #controlStrip{
  box-shadow:0 18px 55px rgba(0,0,0,.45);
}

.controls-section{
  padding:14px;
  border-radius:16px;
  background:var(--surface-1);
  border:1px solid var(--border-soft);
}
.controls-section h3{
  font-size:11px;
  letter-spacing:.16em;
  text-transform:uppercase;
  opacity:.68;
  margin:0 0 10px;
}

@media (max-width: 900px){
  .topbar{
    align-items:flex-start;
    gap:12px;
  }

  .controls{
    width:100%;
    justify-content:flex-start;
  }

  .modebar{
    order:1;
    width:100%;
    overflow:auto;
  }

  .searchwrap{
    order:2;
    width:100%;
    min-width:0;
  }

  .reversal-btn{
    order:3;
    width:100%;
    justify-content:center;
  }
}

/* Registry mode: make registry rail buttons more prominent */
body[data-ui-mode="search"] .strip-right{
  padding: 8px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(16,16,24,.82), rgba(10,10,16,.68));
  border: 1px solid rgba(220,180,120,.16);
  box-shadow: 0 16px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04);
}

body[data-ui-mode="search"] .strip-right > button{
  position: relative;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(245,240,230,.96);
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

body[data-ui-mode="search"] .strip-right > button:hover{
  transform: translateY(-1px);
  border-color: rgba(220,180,120,.34);
  background: rgba(220,180,120,.10);
  box-shadow: 0 10px 24px rgba(0,0,0,.24), 0 0 0 1px rgba(220,180,120,.08) inset;
}

body[data-ui-mode="search"] #toggleCharacters,
body[data-ui-mode="search"] #toggleEntities,
body[data-ui-mode="search"] #toggleManifestations{
  background: linear-gradient(180deg, rgba(220,180,120,.16), rgba(220,180,120,.07));
  border-color: rgba(220,180,120,.34);
  color: rgba(255,245,220,.98);
  box-shadow: 0 10px 28px rgba(0,0,0,.24), 0 0 0 1px rgba(220,180,120,.10) inset;
}

body[data-ui-mode="search"] #toggleCharacters::before,
body[data-ui-mode="search"] #toggleEntities::before,
body[data-ui-mode="search"] #toggleManifestations::before{
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: rgba(220,180,120,.72);
  box-shadow: 0 0 12px rgba(220,180,120,.28);
}

body[data-ui-mode="search"] #toggleCharacters{ padding-left: 16px; }
body[data-ui-mode="search"] #toggleEntities{ padding-left: 16px; }
body[data-ui-mode="search"] #toggleManifestations{ padding-left: 16px; }

body[data-ui-mode="search"] #toggleCaseboard,
body[data-ui-mode="search"] #toggleArchive{
  border-color: rgba(140,170,255,.18);
  background: linear-gradient(180deg, rgba(120,140,220,.12), rgba(120,140,220,.05));
}

body[data-ui-mode="search"] #toggleCaseboard:hover,
body[data-ui-mode="search"] #toggleArchive:hover,
body[data-ui-mode="search"] #toggleCharacters:hover,
body[data-ui-mode="search"] #toggleEntities:hover,
body[data-ui-mode="search"] #toggleManifestations:hover{
  transform: translateY(-1px);
}

@media (max-width: 900px){
  body[data-ui-mode="search"] .strip-right{
    width: 100%;
    gap: 8px;
    padding: 8px;
  }
  body[data-ui-mode="search"] .strip-right > button{
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
}
/* ======================================================
   ST. BRIELLE RAIL PASS — Characters / Entities / Manifestations
   ====================================================== */
:root{
  --rail-brass: rgba(211, 171, 104, .92);
  --rail-brass-soft: rgba(211, 171, 104, .18);
  --rail-ink: rgba(147, 112, 214, .92);
  --rail-ink-soft: rgba(147, 112, 214, .18);
  --rail-water: rgba(105, 167, 220, .92);
  --rail-water-soft: rgba(105, 167, 220, .18);
}

.char-rail{
  width: 248px;
  top: 132px;
  bottom: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(9,10,15,.94), rgba(7,8,12,.88)),
    radial-gradient(130% 80% at 0% 0%, rgba(211,171,104,.08), transparent 52%),
    radial-gradient(120% 70% at 100% 100%, rgba(111,86,175,.07), transparent 56%);
  box-shadow:
    0 24px 60px rgba(0,0,0,.42),
    inset 0 1px 0 rgba(255,255,255,.05),
    inset 0 0 0 1px rgba(255,255,255,.02);
  backdrop-filter: blur(16px) saturate(115%);
  overflow: hidden;
}

.char-rail::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 20%),
    repeating-linear-gradient(180deg, rgba(255,255,255,.018) 0 1px, transparent 1px 28px);
  opacity: .38;
  mix-blend-mode: screen;
}

.char-rail::after{
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  pointer-events: none;
  opacity: .11;
  border: 1px solid rgba(211,171,104,.32);
  box-shadow: inset 0 0 0 7px rgba(211,171,104,.05), inset 0 0 0 16px rgba(211,171,104,.03);
}

#charRail{
  background:
    linear-gradient(180deg, rgba(10,10,16,.95), rgba(7,8,12,.90)),
    radial-gradient(120% 75% at 0% 0%, rgba(211,171,104,.09), transparent 52%);
}
#entityRail{
  background:
    linear-gradient(180deg, rgba(9,9,16,.95), rgba(7,8,12,.90)),
    radial-gradient(120% 75% at 0% 0%, rgba(147,112,214,.10), transparent 52%);
}
#manRail{
  background:
    linear-gradient(180deg, rgba(8,10,17,.95), rgba(6,8,12,.90)),
    radial-gradient(120% 75% at 0% 0%, rgba(105,167,220,.10), transparent 52%);
}

.char-rail-header{
  position: relative;
  padding: 13px 12px 11px;
  border-bottom: 1px solid rgba(255,255,255,.09);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
}

.char-rail-header::after{
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211,171,104,.28), transparent);
}

#entityRail .char-rail-header::after{
  background: linear-gradient(90deg, transparent, rgba(147,112,214,.28), transparent);
}
#manRail .char-rail-header::after{
  background: linear-gradient(90deg, transparent, rgba(105,167,220,.28), transparent);
}

.char-rail-title{
  position: relative;
  padding-left: 14px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(255,248,232,.92);
}

.char-rail-title::before{
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--rail-brass);
  box-shadow: 0 0 0 3px var(--rail-brass-soft), 0 0 14px rgba(211,171,104,.22);
}
#entityRail .char-rail-title::before{
  background: var(--rail-ink);
  box-shadow: 0 0 0 3px var(--rail-ink-soft), 0 0 14px rgba(147,112,214,.22);
}
#manRail .char-rail-title::before{
  background: var(--rail-water);
  box-shadow: 0 0 0 3px var(--rail-water-soft), 0 0 14px rgba(105,167,220,.22);
}

.char-rail-header .btn.ghost{
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.char-rail-header .btn.ghost:hover{
  border-color: rgba(211,171,104,.30);
  background: rgba(211,171,104,.10);
}
#entityRail .char-rail-header .btn.ghost:hover{
  border-color: rgba(147,112,214,.32);
  background: rgba(147,112,214,.12);
}
#manRail .char-rail-header .btn.ghost:hover{
  border-color: rgba(105,167,220,.32);
  background: rgba(105,167,220,.12);
}

.char-rail-list{
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.char-rail-list::-webkit-scrollbar{
  width: 10px;
}
.char-rail-list::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.char-rail-item{
  position: relative;
  margin-bottom: 0;
  padding: 11px 12px 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015)),
    rgba(0,0,0,.24);
  color: rgba(255,250,240,.94);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 8px 22px rgba(0,0,0,.18);
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .20s ease;
}

.char-rail-item::before{
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: rgba(211,171,104,.66);
  opacity: .82;
}

#entityRail .char-rail-item::before{
  background: rgba(147,112,214,.70);
}
#manRail .char-rail-item::before,
.char-rail-item.manifest-glow::before{
  background: rgba(105,167,220,.76);
}

.char-rail-item::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(120px 40px at 18% 50%, rgba(211,171,104,.10), transparent 72%);
  transition: opacity .18s ease;
}
#entityRail .char-rail-item::after{
  background: radial-gradient(120px 40px at 18% 50%, rgba(147,112,214,.12), transparent 72%);
}
#manRail .char-rail-item::after,
.char-rail-item.manifest-glow::after{
  background: radial-gradient(120px 40px at 18% 50%, rgba(105,167,220,.12), transparent 72%);
}

.char-rail-item:hover,
.char-rail-item:focus-visible{
  transform: translateX(2px);
  border-color: rgba(211,171,104,.24);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    rgba(0,0,0,.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 12px 28px rgba(0,0,0,.26);
}
.char-rail-item:hover::after,
.char-rail-item:focus-visible::after{
  opacity: 1;
}
#entityRail .char-rail-item:hover,
#entityRail .char-rail-item:focus-visible{
  border-color: rgba(147,112,214,.26);
}
#manRail .char-rail-item:hover,
#manRail .char-rail-item:focus-visible,
.char-rail-item.manifest-glow:hover,
.char-rail-item.manifest-glow:focus-visible{
  border-color: rgba(105,167,220,.28);
}

/* Give entity / manifestation items a more dossier-like typography when rows are divs */
#entityRail .char-row,
#manRail .char-row{
  position: relative;
  padding: 11px 12px 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015)),
    rgba(0,0,0,.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 8px 22px rgba(0,0,0,.18);
}
#entityRail .char-row::before,
#manRail .char-row::before{
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
}
#entityRail .char-row::before{ background: rgba(147,112,214,.70); }
#manRail .char-row::before{ background: rgba(105,167,220,.76); }

#entityRail .char-row-name,
#manRail .char-row-name{
  font-weight: 700;
  letter-spacing: .02em;
}
#entityRail .char-row-meta,
#manRail .char-row-meta{
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .62;
}

@media (max-width: 900px){
  .char-rail{
    left: 10px;
    right: 10px;
    width: auto;
    top: auto;
    bottom: 84px;
    max-height: 50vh;
    border-radius: 18px;
  }
  .char-rail::after{ width: 42px; height: 42px; }
}
/* St. Brielle rail header subtitles */
.char-rail-header{align-items:flex-start;}
.char-rail-headcopy{display:flex;flex-direction:column;gap:3px;min-width:0;}
.char-rail-title{display:flex;align-items:center;gap:8px;}
.char-rail-title::before{content:"";width:10px;height:10px;border-radius:999px;flex:0 0 10px;box-shadow:0 0 0 1px rgba(255,255,255,.08) inset, 0 0 0 4px rgba(255,255,255,.02);}
#charactersRail .char-rail-title::before{background:linear-gradient(180deg, rgba(220,180,120,.95), rgba(138,96,42,.95));}
#entitiesRail .char-rail-title::before{background:linear-gradient(180deg, rgba(146,110,218,.95), rgba(69,47,115,.95));}
#manifestationsRail .char-rail-title::before{background:linear-gradient(180deg, rgba(114,169,228,.95), rgba(50,88,138,.95));}
.char-rail-subtitle{font-size:10px;line-height:1.2;letter-spacing:.16em;text-transform:uppercase;opacity:.62;white-space:normal;max-width:170px;}
#charactersRail .char-rail-subtitle{color:rgba(220,180,120,.82);}
#entitiesRail .char-rail-subtitle{color:rgba(170,145,230,.82);}
#manifestationsRail .char-rail-subtitle{color:rgba(145,190,236,.82);}
.char-rail-header .close-btn,.char-rail-header .btn,.char-rail-header button{margin-top:2px;}
@media (max-width: 900px){.char-rail-subtitle{max-width:none;font-size:9px;letter-spacing:.14em;}}
/* =========================================================
   CYCLE DECK — ST. BRIELLE REWORK
   Additive override pass
   ========================================================= */

:root{
  --cycle-shell-bg: linear-gradient(180deg, rgba(10,10,16,.86), rgba(8,8,12,.72));
  --cycle-shell-border: rgba(255,255,255,.10);
  --cycle-shell-shadow: 0 14px 34px rgba(0,0,0,.28);
}

.cycle-deck{
  gap: 12px;
  align-items: stretch;
}

.cycle-card{
  position: relative;
  min-width: 184px;
  height: 60px;
  padding: 10px 12px 11px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(120% 140% at 12% 0%, rgba(255,255,255,.10), rgba(255,255,255,.03) 38%, rgba(0,0,0,0) 72%),
    linear-gradient(180deg, rgba(14,14,20,.82), rgba(8,8,12,.74));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 12px 30px rgba(0,0,0,.26);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform .18s ease,
    box-shadow .22s ease,
    border-color .22s ease,
    background .22s ease,
    filter .22s ease;
}

.cycle-card::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 120% at 0% 0%, var(--cycleGlow, rgba(255,255,255,.08)), rgba(0,0,0,0) 58%),
    linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,0) 22%);
  opacity: .72;
  pointer-events: none;
  z-index: 0;
}

.cycle-card::after{
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.04);
  pointer-events: none;
  z-index: 0;
}

.cycle-card > *{
  position: relative;
  z-index: 1;
}

.cycle-card:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.20);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 16px 38px rgba(0,0,0,.32),
    0 0 0 1px rgba(255,255,255,.03);
}

.cycle-card:focus-visible{
  outline: none;
  border-color: rgba(220,180,120,.38);
  box-shadow:
    0 0 0 3px rgba(220,180,120,.12),
    0 18px 42px rgba(0,0,0,.34);
}

.cycle-card.is-active,
.cycle-card.active,
.cycle-card[aria-pressed="true"]{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 18px 42px rgba(0,0,0,.36),
    0 0 0 1px rgba(255,255,255,.04),
    0 0 36px color-mix(in srgb, var(--cycleGlow, rgba(255,255,255,.18)) 55%, transparent);
  filter: saturate(1.08) contrast(1.04);
}

.cycle-card.all{
  min-width: 164px;
}

.cc-top{
  align-items: center;
  gap: 12px;
}

.cc-name{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
}

.cc-name::before{
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,.26), transparent 45%),
    radial-gradient(circle at 60% 60%, var(--cycleGlow, rgba(255,255,255,.18)), transparent 62%),
    rgba(0,0,0,.20);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 0 16px color-mix(in srgb, var(--cycleGlow, rgba(255,255,255,.15)) 50%, transparent);
  flex: 0 0 18px;
}

.cc-years{
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .74;
}

.cc-tag{
  font-size: 11px;
  opacity: .82;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cycle-card[data-cycle="All"]{
  --cycleGlow: rgba(170,210,190,.24);
}
.cycle-card[data-cycle="Ink"]{
  --cycleGlow: rgba(146,94,230,.34);
}
.cycle-card[data-cycle="Brass"]{
  --cycleGlow: rgba(220,180,120,.34);
}
.cycle-card[data-cycle="Water"]{
  --cycleGlow: rgba(92,164,220,.30);
}
.cycle-card[data-cycle="Code"]{
  --cycleGlow: rgba(108,218,196,.28);
}

.cycle-card[data-cycle="Ink"] .cc-name::before{
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 18px rgba(146,94,230,.28);
}
.cycle-card[data-cycle="Brass"] .cc-name::before{
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 18px rgba(220,180,120,.28);
}
.cycle-card[data-cycle="Water"] .cc-name::before{
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 18px rgba(92,164,220,.24);
}
.cycle-card[data-cycle="Code"] .cc-name::before{
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 18px rgba(108,218,196,.22);
}

body.cycle-ink .cycle-card[data-cycle="Ink"],
body.cycle-brass .cycle-card[data-cycle="Brass"],
body.cycle-water .cycle-card[data-cycle="Water"],
body.cycle-code .cycle-card[data-cycle="Code"]{
  border-color: rgba(255,255,255,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 18px 42px rgba(0,0,0,.34),
    0 0 40px color-mix(in srgb, var(--cycleGlow) 60%, transparent);
}

/* ceremonial deck shell when visible */
.strip-left .cycle-deck{
  padding: 6px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

/* registry/investigate get slightly richer deck feel */
body[data-ui-mode="search"] .strip-left .cycle-deck,
body[data-ui-mode="investigate"] .strip-left .cycle-deck{
  border-color: rgba(220,180,120,.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 10px 26px rgba(0,0,0,.18);
}

@media (max-width: 980px){
  .cycle-deck{
    gap: 10px;
  }
  .cycle-card{
    min-width: 156px;
    height: 64px;
    padding: 9px 10px 10px;
  }
  .cc-tag{
    font-size: 10.5px;
  }
}

@media (max-width: 720px){
  .strip-left .cycle-deck{
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    scrollbar-width: thin;
  }
  .cycle-card{
    flex: 0 0 160px;
  }
}
#panelHeaderRail{
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(10,10,16,.96), rgba(7,8,12,.92)),
    radial-gradient(120% 80% at 0% 0%, var(--sb-rail-brass-soft), transparent 54%);
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 32px rgba(0,0,0,.18);
}
#panelHeaderRail .title,
#panelHeaderRail .panel-title,
#panelHeaderRail h2,
#panelHeaderRail h3{
  letter-spacing: .06em;
  color: rgba(255,247,233,.95);
  text-shadow: 0 1px 0 rgba(0,0,0,.22);
}

#panelHeaderRail .subtitle,
#panelHeaderRail .muted,
#panelHeaderRail .note{
  color: rgba(232,223,206,.66);
}
.sb-pill,
.panel-badges .pbadge{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 5px 11px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    rgba(0,0,0,.22);
  color: rgba(255,248,232,.90);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.sb-pill-cycle,
.panel-badges .pbadge.hot{
  border-color: rgba(211,171,104,.28);
  background:
    linear-gradient(180deg, rgba(211,171,104,.10), rgba(211,171,104,.03)),
    rgba(0,0,0,.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 0 0 1px rgba(211,171,104,.05);
}

.sb-pill-obs{
  border-color: rgba(105,167,220,.26);
  background:
    linear-gradient(180deg, rgba(105,167,220,.10), rgba(105,167,220,.03)),
    rgba(0,0,0,.22);
}

#panelActionsRail button,
#panelActionsRail a,
.panel-actions-rail button,
.panel-actions-rail a{
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)),
    rgba(0,0,0,.24);
  color: rgba(255,249,238,.94);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 22px rgba(0,0,0,.18);
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .20s ease;
}

#panelActionsRail button:hover,
#panelActionsRail a:hover,
.panel-actions-rail button:hover,
.panel-actions-rail a:hover{
  transform: translateY(-1px);
  border-color: rgba(211,171,104,.26);
  background:
    linear-gradient(180deg, rgba(211,171,104,.08), rgba(211,171,104,.03)),
    rgba(0,0,0,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 12px 28px rgba(0,0,0,.22);
}
:root{
  --sb-rail-brass: rgba(211,171,104,.92);
  --sb-rail-brass-soft: rgba(211,171,104,.14);
  --sb-rail-brass-wash: rgba(211,171,104,.08);
  --sb-rail-ink: rgba(147,112,214,.92);
  --sb-rail-water: rgba(105,167,220,.92);
}
/* =========================================================
   MOBILE NAVIGATION HOTFIX — unified system
   Goal: one coherent mobile nav model
   ========================================================= */
@media (max-width: 900px){
  html, body{
    height:100%;
    overflow:hidden;
  }

 :root{
    --mobile-topbar-h: 124px;
    --mobile-strip-h: 76px;
  }

  /* Keep one nav position only: top */
  .topbar,
  .top-nav,
  nav.topbar{
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    z-index: 4000 !important;
    width: 100%;
    margin: 0;
    border-radius: 0;
    border-top: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    justify-content: space-between;
    backdrop-filter: blur(12px);
  }

  .topbar{
    padding: 10px 12px calc(8px + env(safe-area-inset-top, 0px));
    align-items: stretch;
    gap: 10px;
  }

  .brand{
    width: 100%;
  }

  .controls{
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    justify-content: stretch !important;
    align-items: stretch;
  }

  .modebar{
    order: 1;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .modebar::-webkit-scrollbar{ display:none; }

  .modebtn{
    flex: 0 0 auto;
    min-width: max-content;
  }

  .searchwrap{
    order: 2;
    width: 100%;
    min-width: 0;
  }

  .search{
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .reversal-btn{
    order: 3;
    width: 100%;
    justify-content: center;
  }

  /* Force key nav toggles to exist on mobile even if hidden in HTML */
  #toggleLegend,
  #toggleSidebar{
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
  }

  #togglePlacement{
    display: none !important;
  }

  /* Keep the strip below the header, horizontally scrollable */
  .strip,
  #controlStrip{
    position: sticky !important;
    top: auto !important;
    bottom: 0 !important;
    z-index: 3900 !important;
    padding:
      8px 10px
      calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 0;
    background: linear-gradient(180deg, rgba(12,12,18,.90), rgba(8,8,14,.97));
    backdrop-filter: blur(12px);
  }

  #controlStrip{
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .strip-left,
  .strip-right{
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .strip-left::-webkit-scrollbar,
  .strip-right::-webkit-scrollbar{ display:none; }

  .strip-right > *,
  .strip-left > *{
    flex: 0 0 auto;
  }

  /* Main layout should account for top bar and bottom strip */
  .layout{
    height: calc(100vh - var(--mobile-topbar-h) - var(--mobile-strip-h));
    grid-template-columns: 1fr;
  }

  #map,
  .map{
    min-height: calc(100vh - var(--mobile-topbar-h) - var(--mobile-strip-h));
    height: 100%;
  }

  /* Sidebar becomes a deliberate bottom sheet */
  .sidebar{
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-strip-h) - 6px);
    top: auto !important;
    height: min(72vh, 640px);
    max-height: calc(100vh - var(--mobile-topbar-h) - 24px);
    border-left: none;
    border-top: 1px solid rgba(255,255,255,.10);
    border-radius: 18px 18px 0 0;
    z-index: 4200;
    overflow: hidden;
    box-shadow: 0 -18px 60px rgba(0,0,0,.65);
    transform: translateY(0);
    transition: transform 220ms ease, opacity 220ms ease;
  }

  .sidebar.hidden{
    display: block !important;
    transform: translateY(calc(100% - 58px));
    opacity: .985;
  }

  .sidebar-inner{
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .sidebar-head{
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(0,0,0,.88);
    backdrop-filter: blur(10px);
  }
  .sidebar-head::before{
    content: "";
    display:block;
    width:56px;
    height:5px;
    margin:0 auto 10px;
    border-radius:999px;
    background:rgba(255,255,255,.18);
    border:1px solid rgba(255,255,255,.10);
  }

  .panel,
  #charactersPanel,
  .archive,
  .caseboard,
  .char-rail{
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: calc(var(--mobile-strip-h) - 6px) !important;
    width: 100% !important;
    height: min(78vh, 700px) !important;
    max-height: calc(100vh - var(--mobile-topbar-h) - 24px);
    border-radius: 18px 18px 0 0;
    transform: none !important;
    box-shadow: 0 -20px 60px rgba(0,0,0,.6);
  }
  .panel,
  #charactersPanel,
  .char-rail{ height: min(78vh, 700px) !important; max-height: calc(100dvh - var(--mobile-topbar-h) - 24px); }
  .archive,
  .caseboard{ height: min(82vh, 760px) !important; max-height: calc(100dvh - var(--mobile-topbar-h) - 24px); }

  .panel-header,
  #charactersPanel .panel-header,
  .archive-header,
  .caseboard-header,
  .char-rail-header{
    position: sticky;
    top: 0;
    z-index: 6;
    background: rgba(0,0,0,.90);
    backdrop-filter: blur(10px);
  }

  .caseboard-body{ grid-template-columns: 1fr; }
  .caseboard-side{ display:none; }
  /* Rails should not trap the viewport */
  .char-rail{
    top: auto !important;
    bottom: calc(var(--mobile-strip-h) - 6px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: min(72vh, 620px) !important;
    border-radius: 18px 18px 0 0;
  }

  /* Make cycle deck actually browsable on phone */
  .cycle-deck{
    display:flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .cycle-deck::-webkit-scrollbar{ display:none; }

  .cycle-card{
    flex: 0 0 min(220px, 72vw);
  }

  button, .btn, .action, .navbtn, .chipbtn, .archive-tabbtn{
    min-height: 44px;
  }

  .search-results{
    max-height: min(44vh, 360px);
    overflow: auto;
  }
}


/* ============================
   St. Brielle Civic Calendar
   ============================ */
.sb-calendar-shell{
  position:relative;
}
.sb-calendar{
  position:relative;
  padding:14px 14px 12px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    radial-gradient(circle at top right, rgba(216,191,138,.12), transparent 38%);
  box-shadow:0 16px 40px rgba(0,0,0,.18);
  overflow:hidden;
}
.sb-calendar::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.04), transparent 24%, transparent 76%, rgba(216,191,138,.04));
  opacity:.9;
}
.sb-calendar-head,
.sb-calendar-grid,
.sb-calendar-detail,
.sb-calendar-today{
  position:relative;
  z-index:1;
}
.sb-calendar-kicker{
  font-size:10px;
  letter-spacing:.22em;
  text-transform:uppercase;
  opacity:.68;
  margin-bottom:6px;
}
.sb-calendar-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.sb-calendar-title{
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.sb-calendar-sub{
  font-size:12px;
  color:rgba(255,255,255,.66);
  margin-top:4px;
}
.sb-calendar-nav{
  display:flex;
  align-items:center;
  gap:8px;
}
.sb-calendar-nav button{
  width:30px;
  height:30px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  color:inherit;
  cursor:pointer;
}
.sb-calendar-nav button:hover{
  border-color:rgba(216,191,138,.45);
  transform:translateY(-1px);
}
.sb-calendar-grid{
  display:grid;
  grid-template-columns:repeat(7, minmax(0,1fr));
  gap:6px;
}
.sb-cal-dow{
  font-size:10px;
  letter-spacing:.14em;
  text-transform:uppercase;
  opacity:.55;
  text-align:center;
  padding-bottom:3px;
}
.sb-cal-date{
  position:relative;
  min-height:39px;
  padding:6px 4px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  color:inherit;
  cursor:pointer;
  transition:transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.sb-cal-date:hover{
  transform:translateY(-1px);
  border-color:rgba(216,191,138,.32);
  background:rgba(255,255,255,.06);
}
.sb-cal-date.is-outside{
  opacity:.35;
}
.sb-cal-date.is-today{
  border-color:rgba(216,191,138,.42);
  box-shadow:0 0 0 1px rgba(216,191,138,.16) inset, 0 10px 22px rgba(0,0,0,.18);
}
.sb-cal-date.is-holiday{
  background:linear-gradient(180deg, rgba(216,191,138,.14), rgba(255,255,255,.04));
  border-color:rgba(216,191,138,.30);
}
.sb-cal-date.is-active-holiday{
  background:linear-gradient(180deg, rgba(216,191,138,.24), rgba(255,255,255,.05));
  border-color:rgba(216,191,138,.52);
  box-shadow:0 0 0 1px rgba(216,191,138,.22) inset, 0 12px 26px rgba(0,0,0,.20);
}
.sb-cal-num{
  display:block;
  font-size:13px;
  font-weight:700;
  text-align:center;
}
.sb-cal-mark{
  position:absolute;
  left:50%;
  bottom:6px;
  width:6px;
  height:6px;
  border-radius:999px;
  background:rgba(216,191,138,.90);
  transform:translateX(-50%);
  box-shadow:0 0 0 3px rgba(216,191,138,.10);
}
.sb-calendar-today{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:rgba(255,255,255,.04);
}
.sb-calendar-today .label{
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  opacity:.62;
}
.sb-calendar-today .value{
  margin-top:5px;
  font-weight:700;
  line-height:1.35;
}
.sb-calendar-today .meta{
  margin-top:4px;
  font-size:12px;
  color:rgba(255,255,255,.7);
}
.sb-calendar-detail{
  margin-top:10px;
  padding:12px 12px 10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
}
.sb-calendar-detail[hidden]{
  display:none !important;
}
.sb-cal-detail-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.sb-cal-detail-title{
  font-weight:800;
  line-height:1.2;
}
.sb-cal-detail-k{
  font-size:10px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(255,255,255,.62);
  margin-bottom:4px;
}
.sb-cal-detail-cycle{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.05);
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.sb-calendar-detail p{
  margin:10px 0 0;
  font-size:13px;
  line-height:1.55;
}
.sb-cal-detail-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:10px;
}
.sb-cal-detail-item{
  padding:8px 9px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.03);
}
.sb-cal-detail-item b{
  display:block;
  font-size:10px;
  letter-spacing:.15em;
  text-transform:uppercase;
  opacity:.62;
  margin-bottom:4px;
}
.sb-cal-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.sb-cal-actions .action{
  padding:8px 10px;
  font-size:12px;
  border-radius:999px;
}
.sb-holiday-banner{
  margin-bottom:12px;
  padding:12px 13px;
  border-radius:16px;
  border:1px solid rgba(216,191,138,.22);
  background:
    linear-gradient(180deg, rgba(216,191,138,.12), rgba(255,255,255,.03)),
    rgba(255,255,255,.03);
  box-shadow:0 12px 26px rgba(0,0,0,.16);
}
.sb-holiday-banner .k{
  font-size:10px;
  letter-spacing:.2em;
  text-transform:uppercase;
  opacity:.65;
  margin-bottom:4px;
}
.sb-holiday-banner .t{
  font-weight:800;
  letter-spacing:.03em;
}
.sb-holiday-banner .m{
  font-size:12px;
  line-height:1.45;
  color:rgba(255,255,255,.72);
  margin-top:5px;
}
body.sb-holiday-active #panelHeaderRail,
body.sb-holiday-active #panelActionsRail{
  border-color:rgba(216,191,138,.22);
  box-shadow:0 10px 24px rgba(0,0,0,.18);
}
body.sb-holiday-active .topbar{
  box-shadow:0 0 0 1px rgba(216,191,138,.06) inset, 0 14px 40px rgba(0,0,0,.18);
}
body.sb-holiday-active .panel::before,
body.sb-holiday-active .sidebar::before{
  opacity:.75;
}
body.sb-holiday-open-eyes::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 20% 12%, rgba(216,191,138,.07), transparent 18%),
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.04), transparent 14%),
    linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.16));
  mix-blend-mode:screen;
  z-index:1;
}
body.sb-holiday-absence::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.28));
  z-index:1;
}
body.sb-holiday-bethany .sb-calendar,
body.sb-holiday-bethany .sb-holiday-banner{
  box-shadow:0 0 0 1px rgba(160,188,208,.10) inset, 0 14px 36px rgba(0,0,0,.20);
}
body.sb-holiday-mercuria .sb-holiday-banner{
  border-color:rgba(151,186,208,.24);
}
body.sb-holiday-verena .sb-calendar{
  box-shadow:0 0 0 1px rgba(71,107,119,.16) inset, 0 16px 40px rgba(0,0,0,.18);
}
body.sb-holiday-brigid .sb-holiday-banner{
  border-color:rgba(151,98,104,.36);
}
#landmarkList .lm-item.is-holiday-linked{
  border-color:rgba(216,191,138,.32) !important;
  background:linear-gradient(90deg, rgba(216,191,138,.12), rgba(255,255,255,.04)) !important;
  box-shadow:0 10px 22px rgba(0,0,0,.14);
}

html[data-theme="light"] .sb-calendar,
html[data-theme="light"] .sb-calendar-today,
html[data-theme="light"] .sb-calendar-detail,
html[data-theme="light"] .sb-holiday-banner{
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,249,253,.94)) !important;
  color:#162031 !important;
  border-color:rgba(52,77,118,.15) !important;
  box-shadow:0 16px 40px rgba(57,83,121,.10) !important;
}
html[data-theme="light"] .sb-calendar-sub,
html[data-theme="light"] .sb-calendar-today .meta,
html[data-theme="light"] .sb-holiday-banner .m,
html[data-theme="light"] .sb-cal-detail-k{
  color:rgba(22,32,49,.68) !important;
}
html[data-theme="light"] .sb-cal-date{
  background:rgba(245,248,252,.92) !important;
  border-color:rgba(52,77,118,.10) !important;
  color:#162031 !important;
}
html[data-theme="light"] .sb-cal-date.is-holiday,
html[data-theme="light"] .sb-cal-date.is-active-holiday{
  background:linear-gradient(180deg, rgba(247,233,187,.34), rgba(255,255,255,.95)) !important;
  border-color:rgba(184,137,24,.28) !important;
}
/* ===== St. Brielle compact civic calendar pass ===== */

.sb-calendar-shell{
  margin: 2px 0 4px;
}

.sb-calendar{
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid rgba(214, 201, 170, 0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015)),
    radial-gradient(circle at top right, rgba(183,146,84,.08), transparent 34%),
    linear-gradient(0deg, rgba(0,0,0,.08), rgba(0,0,0,.08));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 20px rgba(0,0,0,.18);
}

.sb-calendar::before{
  opacity: .55;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 22%, transparent 78%, rgba(183,146,84,.035)),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 17px,
      rgba(255,255,255,.012) 18px
    );
}

.sb-calendar-kicker{
  margin-bottom: 4px;
  font-size: 9px;
  letter-spacing: .24em;
  opacity: .58;
}

.sb-calendar-title-row{
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.sb-calendar-title{
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sb-calendar-sub{
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
  color: rgba(255,255,255,.52);
}

.sb-calendar-nav{
  gap: 6px;
}

.sb-calendar-nav button{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.035);
  font-size: 13px;
}

.sb-calendar-nav button:hover{
  transform: none;
  border-color: rgba(183,146,84,.38);
  background: rgba(255,255,255,.06);
}

.sb-calendar-grid{
  gap: 4px;
}

.sb-cal-dow{
  font-size: 9px;
  letter-spacing: .16em;
  opacity: .42;
  padding-bottom: 2px;
}

.sb-cal-date{
  min-height: 31px;
  padding: 4px 2px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.022);
  transition: border-color .14s ease, background .14s ease, opacity .14s ease;
}

.sb-cal-date:hover{
  transform: none;
  border-color: rgba(183,146,84,.24);
  background: rgba(255,255,255,.045);
}

.sb-cal-date.is-outside{
  opacity: .18;
}

.sb-cal-date.is-today{
  border-color: rgba(183,146,84,.34);
  box-shadow: inset 0 0 0 1px rgba(183,146,84,.12);
}

.sb-cal-date.is-holiday{
  background:
    linear-gradient(180deg, rgba(183,146,84,.10), rgba(255,255,255,.025));
  border-color: rgba(183,146,84,.24);
}

.sb-cal-date.is-active-holiday{
  background:
    linear-gradient(180deg, rgba(183,146,84,.16), rgba(255,255,255,.03));
  border-color: rgba(183,146,84,.42);
  box-shadow:
    inset 0 0 0 1px rgba(183,146,84,.16),
    0 0 0 1px rgba(0,0,0,.08);
}

.sb-cal-num{
  font-size: 12px;
  font-weight: 700;
}

.sb-cal-mark{
  bottom: 4px;
  width: 4px;
  height: 4px;
  box-shadow: 0 0 0 2px rgba(183,146,84,.08);
}

.sb-calendar-today{
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.025);
}

.sb-calendar-today .label{
  font-size: 9px;
  letter-spacing: .2em;
  opacity: .5;
}

.sb-calendar-today .value{
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.25;
}

.sb-calendar-today .meta{
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255,255,255,.58);
}

.sb-calendar-detail{
  margin-top: 8px;
  padding: 9px 9px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.018));
}

.sb-cal-detail-k,
.sb-cal-detail-item b{
  font-size: 9px;
  letter-spacing: .17em;
}

.sb-cal-detail-title{
  font-size: 13px;
  line-height: 1.15;
}

.sb-cal-detail-cycle{
  padding: 4px 7px;
  font-size: 10px;
}

.sb-calendar-detail p{
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.42;
}

.sb-cal-detail-grid{
  gap: 6px;
  margin-top: 8px;
}

.sb-cal-detail-item{
  padding: 7px 8px;
  border-radius: 9px;
}

.sb-cal-actions{
  gap: 6px;
  margin-top: 8px;
}

.sb-cal-actions .btn,
.sb-cal-actions button{
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 11px;
}

/* faint saint-day civic accent */
.sb-calendar-title::after{
  content: " ✶";
  color: rgba(183,146,84,.68);
}

/* mobile: keep it compact and breathable */
@media (max-width: 640px){
  .sb-calendar{
    padding: 9px 9px 8px;
  }

  .sb-calendar-sub{
    display: none;
  }

  .sb-cal-date{
    min-height: 29px;
  }

  .sb-cal-num{
    font-size: 11px;
  }
}

.sb-calendar{
  position: relative;
  overflow: hidden;
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid rgba(214,201,170,.14);
  background:
    radial-gradient(circle at top right, rgba(183,146,84,.08), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015)),
    linear-gradient(180deg, rgba(10,12,16,.94), rgba(8,10,14,.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 20px rgba(0,0,0,.18);
}

.sb-calendar::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.55;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 22%, transparent 78%, rgba(183,146,84,.03)),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 17px,
      rgba(255,255,255,.012) 18px
    );
  mix-blend-mode:screen;
}

.sb-calendar::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  top:0;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(183,146,84,.45), transparent);
  pointer-events:none;
}

.sb-calendar-kicker{
  margin:0 0 4px;
  font-size:9px;
  font-weight:700;
  letter-spacing:.24em;
  text-transform:uppercase;
  color:rgba(226,220,206,.58);
}

.sb-calendar-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}

.sb-calendar-title-wrap{
  min-width:0;
}

.sb-calendar-title{
  margin:0;
  font-size:13px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(245,241,233,.96);
}

.sb-calendar-title::after{
  content:" ✶";
  color:rgba(183,146,84,.68);
}

.sb-calendar-sub{
  margin-top:2px;
  font-size:11px;
  line-height:1.25;
  color:rgba(224,218,205,.52);
}

.sb-calendar-nav{
  display:flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
}

.sb-calendar-nav button{
  width:26px;
  height:26px;
  padding:0;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.035);
  color:rgba(244,240,233,.9);
  font-size:13px;
  line-height:1;
  cursor:pointer;
  transition:border-color .14s ease, background .14s ease, opacity .14s ease;
}

.sb-calendar-nav button:hover{
  transform:none;
  border-color:rgba(183,146,84,.38);
  background:rgba(255,255,255,.06);
}

.sb-calendar-grid{
  display:grid;
  grid-template-columns:repeat(7, minmax(0, 1fr));
  gap:4px;
}

.sb-cal-dow{
  padding:0 0 2px;
  text-align:center;
  font-size:9px;
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(225,219,205,.42);
}

.sb-cal-date{
  position:relative;
  min-height:31px;
  padding:4px 2px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.022);
  color:rgba(245,241,233,.92);
  cursor:pointer;
  transition:border-color .14s ease, background .14s ease, opacity .14s ease;
}

.sb-cal-date:hover{
  transform:none;
  border-color:rgba(183,146,84,.24);
  background:rgba(255,255,255,.045);
}

.sb-cal-date.is-outside{
  opacity:.18;
}

.sb-cal-date.is-today{
  border-color:rgba(183,146,84,.34);
  box-shadow:inset 0 0 0 1px rgba(183,146,84,.12);
}

.sb-cal-date.is-holiday{
  border-color:rgba(183,146,84,.24);
  background:
    linear-gradient(180deg, rgba(183,146,84,.10), rgba(255,255,255,.025));
}

.sb-cal-date.is-active-holiday{
  border-color:rgba(183,146,84,.42);
  background:
    linear-gradient(180deg, rgba(183,146,84,.16), rgba(255,255,255,.03));
  box-shadow:
    inset 0 0 0 1px rgba(183,146,84,.16),
    0 0 0 1px rgba(0,0,0,.08);
}

.sb-cal-num{
  display:block;
  text-align:center;
  font-size:12px;
  font-weight:700;
  line-height:1.1;
}

.sb-cal-mark{
  position:absolute;
  left:50%;
  bottom:4px;
  width:4px;
  height:4px;
  border-radius:999px;
  background:rgba(183,146,84,.88);
  transform:translateX(-50%);
  box-shadow:0 0 0 2px rgba(183,146,84,.08);
}

.sb-calendar-today{
  margin-top:8px;
  padding:8px 9px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.025);
}

.sb-calendar-today .label{
  font-size:9px;
  font-weight:700;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:rgba(225,219,205,.5);
}

.sb-calendar-today .value{
  margin-top:3px;
  font-size:12px;
  font-weight:700;
  line-height:1.25;
  color:rgba(245,241,233,.95);
}

.sb-calendar-today .meta{
  margin-top:2px;
  font-size:11px;
  line-height:1.3;
  color:rgba(223,217,205,.58);
}

.sb-calendar-detail{
  margin-top:8px;
  padding:9px 9px 8px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.06);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.018));
}

.sb-cal-detail-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}

.sb-cal-detail-title{
  margin:0;
  font-size:13px;
  font-weight:800;
  line-height:1.15;
  color:rgba(244,240,232,.95);
}

.sb-cal-detail-cycle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 7px;
  border-radius:999px;
  border:1px solid rgba(183,146,84,.24);
  background:rgba(183,146,84,.08);
  color:rgba(239,228,203,.92);
  font-size:10px;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
  white-space:nowrap;
}

.sb-calendar-detail p{
  margin:8px 0 0;
  font-size:12px;
  line-height:1.42;
  color:rgba(236,232,224,.8);
}

.sb-cal-detail-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin-top:8px;
}

.sb-cal-detail-item{
  padding:7px 8px;
  border-radius:9px;
  border:1px solid rgba(255,255,255,.05);
  background:rgba(255,255,255,.022);
}

.sb-cal-detail-k{
  display:block;
  margin-bottom:4px;
  font-size:9px;
  font-weight:700;
  letter-spacing:.17em;
  text-transform:uppercase;
  color:rgba(225,219,205,.5);
}

.sb-cal-detail-v{
  font-size:11px;
  line-height:1.35;
  color:rgba(242,238,231,.78);
}

.sb-cal-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}

.sb-cal-actions .btn,
.sb-cal-actions button{
  min-height:34px;
  padding:7px 9px;
  border-radius:9px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  color:rgba(245,241,233,.92);
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
}

.sb-cal-actions .btn:hover,
.sb-cal-actions button:hover{
  border-color:rgba(183,146,84,.3);
  background:rgba(255,255,255,.055);
}

.sb-holiday-banner{
  margin:8px 0 0;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(183,146,84,.18);
  background:
    linear-gradient(180deg, rgba(183,146,84,.08), rgba(255,255,255,.02));
  color:rgba(244,239,230,.88);
  font-size:11px;
  line-height:1.35;
}

/* linked landmark emphasis */
.landmark-item.is-holiday-linked,
.landmark.is-holiday-linked,
button.is-holiday-linked{
  border-color:rgba(183,146,84,.28) !important;
  box-shadow:inset 0 0 0 1px rgba(183,146,84,.08);
}

/* holiday atmosphere tuning */
body.sb-holiday-active .sb-calendar{
  border-color:rgba(183,146,84,.2);
}

body.sb-holiday-open-eyes .sb-calendar{
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 10px 28px rgba(0,0,0,.24),
    0 0 28px rgba(183,146,84,.08);
}

body.sb-holiday-absence .sb-calendar{
  background:
    radial-gradient(circle at top right, rgba(120,120,130,.04), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.01)),
    linear-gradient(180deg, rgba(8,9,12,.96), rgba(6,7,10,.98));
}

body.sb-holiday-bethany .sb-calendar,
body.sb-holiday-mercuria .sb-calendar,
body.sb-holiday-verena .sb-calendar,
body.sb-holiday-brigid .sb-calendar{
  border-color:rgba(183,146,84,.18);
}

@media (max-width: 640px){
  .sb-calendar{
    padding:9px 9px 8px;
  }

  .sb-calendar-sub{
    display:none;
  }

  .sb-cal-date{
    min-height:29px;
  }

  .sb-cal-num{
    font-size:11px;
  }

  .sb-cal-detail-grid{
    grid-template-columns:1fr;
  }

  .sb-cal-actions{
    flex-direction:column;
  }

  .sb-cal-actions .btn,
  .sb-cal-actions button{
    width:100%;
  }
}
/* =========================================================
   ST. BRIELLE — COMPACT CIVIC CALENDAR REFINEMENT
   Paste at end of style.css
   ========================================================= */

.sb-calendar-shell{
  position: relative;
  margin: 2px 0 6px;
}

.sb-calendar{
  position: relative;
  overflow: hidden;
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid rgba(214,201,170,.14);
  background:
    radial-gradient(circle at top right, rgba(183,146,84,.08), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015)),
    linear-gradient(180deg, rgba(10,12,16,.94), rgba(8,10,14,.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 20px rgba(0,0,0,.18);
}

.sb-calendar::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.55;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 22%, transparent 78%, rgba(183,146,84,.03)),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 17px,
      rgba(255,255,255,.012) 18px
    );
  mix-blend-mode:screen;
}

.sb-calendar::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  top:0;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(183,146,84,.45), transparent);
  pointer-events:none;
}

.sb-calendar-kicker{
  margin:0 0 4px;
  font-size:9px;
  font-weight:700;
  letter-spacing:.24em;
  text-transform:uppercase;
  color:rgba(226,220,206,.58);
}

.sb-calendar-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}

.sb-calendar-title-wrap{
  min-width:0;
}

.sb-calendar-title{
  margin:0;
  font-size:13px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(245,241,233,.96);
}

.sb-calendar-title::after{
  content:" ✶";
  color:rgba(183,146,84,.68);
}

.sb-calendar-sub{
  margin-top:2px;
  font-size:11px;
  line-height:1.25;
  color:rgba(224,218,205,.52);
}

.sb-calendar-nav{
  display:flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
}

.sb-calendar-nav button{
  width:26px;
  height:26px;
  padding:0;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.035);
  color:rgba(244,240,233,.9);
  font-size:13px;
  line-height:1;
  cursor:pointer;
  transition:border-color .14s ease, background .14s ease, opacity .14s ease;
}

.sb-calendar-nav button:hover{
  transform:none;
  border-color:rgba(183,146,84,.38);
  background:rgba(255,255,255,.06);
}

.sb-calendar-grid{
  display:grid;
  grid-template-columns:repeat(7, minmax(0, 1fr));
  gap:4px;
}

.sb-cal-dow{
  padding:0 0 2px;
  text-align:center;
  font-size:9px;
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(225,219,205,.42);
}

.sb-cal-date{
  position:relative;
  min-height:31px;
  padding:4px 2px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.022);
  color:rgba(245,241,233,.92);
  cursor:pointer;
  transition:border-color .14s ease, background .14s ease, opacity .14s ease;
}

.sb-cal-date:hover{
  transform:none;
  border-color:rgba(183,146,84,.24);
  background:rgba(255,255,255,.045);
}

.sb-cal-date.is-outside{
  opacity:.18;
}

.sb-cal-date.is-today{
  border-color:rgba(183,146,84,.34);
  box-shadow:inset 0 0 0 1px rgba(183,146,84,.12);
}

.sb-cal-date.is-holiday{
  border-color:rgba(183,146,84,.24);
  background:
    linear-gradient(180deg, rgba(183,146,84,.10), rgba(255,255,255,.025));
}

.sb-cal-date.is-active-holiday{
  border-color:rgba(183,146,84,.42);
  background:
    linear-gradient(180deg, rgba(183,146,84,.16), rgba(255,255,255,.03));
  box-shadow:
    inset 0 0 0 1px rgba(183,146,84,.16),
    0 0 0 1px rgba(0,0,0,.08);
}

.sb-cal-num{
  display:block;
  text-align:center;
  font-size:12px;
  font-weight:700;
  line-height:1.1;
}

.sb-cal-mark{
  position:absolute;
  left:50%;
  bottom:4px;
  width:4px;
  height:4px;
  border-radius:999px;
  background:rgba(183,146,84,.88);
  transform:translateX(-50%);
  box-shadow:0 0 0 2px rgba(183,146,84,.08);
}

.sb-calendar-today{
  margin-top:8px;
  padding:8px 9px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.025);
}

.sb-calendar-today .label{
  font-size:9px;
  font-weight:700;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:rgba(225,219,205,.5);
}

.sb-calendar-today .value{
  margin-top:3px;
  font-size:12px;
  font-weight:700;
  line-height:1.25;
  color:rgba(245,241,233,.95);
}

.sb-calendar-today .meta{
  margin-top:2px;
  font-size:11px;
  line-height:1.3;
  color:rgba(223,217,205,.58);
}

.sb-calendar-detail{
  margin-top:8px;
  padding:9px 9px 8px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.06);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.018));
}

.sb-cal-detail-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}

.sb-cal-detail-title{
  margin:0;
  font-size:13px;
  font-weight:800;
  line-height:1.15;
  color:rgba(244,240,232,.95);
}

.sb-cal-detail-cycle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 7px;
  border-radius:999px;
  border:1px solid rgba(183,146,84,.24);
  background:rgba(183,146,84,.08);
  color:rgba(239,228,203,.92);
  font-size:10px;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
  white-space:nowrap;
}

.sb-calendar-detail p{
  margin:8px 0 0;
  font-size:12px;
  line-height:1.42;
  color:rgba(236,232,224,.8);
}

.sb-cal-detail-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin-top:8px;
}

.sb-cal-detail-item{
  padding:7px 8px;
  border-radius:9px;
  border:1px solid rgba(255,255,255,.05);
  background:rgba(255,255,255,.022);
}

.sb-cal-detail-k{
  display:block;
  margin-bottom:4px;
  font-size:9px;
  font-weight:700;
  letter-spacing:.17em;
  text-transform:uppercase;
  color:rgba(225,219,205,.5);
}

.sb-cal-detail-v{
  font-size:11px;
  line-height:1.35;
  color:rgba(242,238,231,.78);
}

.sb-cal-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}

.sb-cal-actions .btn,
.sb-cal-actions button{
  min-height:34px;
  padding:7px 9px;
  border-radius:9px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  color:rgba(245,241,233,.92);
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
}

.sb-cal-actions .btn:hover,
.sb-cal-actions button:hover{
  border-color:rgba(183,146,84,.3);
  background:rgba(255,255,255,.055);
}

.sb-holiday-banner{
  margin:8px 0 0;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(183,146,84,.18);
  background:
    linear-gradient(180deg, rgba(183,146,84,.08), rgba(255,255,255,.02));
  color:rgba(244,239,230,.88);
  font-size:11px;
  line-height:1.35;
}

/* linked landmark emphasis */
.landmark-item.is-holiday-linked,
.landmark.is-holiday-linked,
button.is-holiday-linked{
  border-color:rgba(183,146,84,.28) !important;
  box-shadow:inset 0 0 0 1px rgba(183,146,84,.08);
}

/* holiday atmosphere tuning */
body.sb-holiday-active .sb-calendar{
  border-color:rgba(183,146,84,.2);
}

body.sb-holiday-open-eyes .sb-calendar{
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 10px 28px rgba(0,0,0,.24),
    0 0 28px rgba(183,146,84,.08);
}

body.sb-holiday-absence .sb-calendar{
  background:
    radial-gradient(circle at top right, rgba(120,120,130,.04), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.01)),
    linear-gradient(180deg, rgba(8,9,12,.96), rgba(6,7,10,.98));
}

body.sb-holiday-bethany .sb-calendar,
body.sb-holiday-mercuria .sb-calendar,
body.sb-holiday-verena .sb-calendar,
body.sb-holiday-brigid .sb-calendar{
  border-color:rgba(183,146,84,.18);
}

@media (max-width: 640px){
  .sb-calendar{
    padding:9px 9px 8px;
  }

  .sb-calendar-sub{
    display:none;
  }

  .sb-cal-date{
    min-height:29px;
  }

  .sb-cal-num{
    font-size:11px;
  }

  .sb-cal-detail-grid{
    grid-template-columns:1fr;
  }

  .sb-cal-actions{
    flex-direction:column;
  }

  .sb-cal-actions .btn,
  .sb-cal-actions button{
    width:100%;
  }
}
/* formal civic / archival text treatment */
.city-intro,
#panelBody .city-intro,
#panelBody .intro-copy {
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.025em;
  color: rgba(236, 232, 224, 0.88);
  text-transform: none;
}

.city-intro strong,
.city-intro b,
#panelBody .city-intro strong,
#panelBody .intro-copy strong {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(245, 241, 233, 0.96);
}

.city-intro .city-title,
#panelBody .city-title {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 241, 233, 0.98);
}

.city-intro .city-meta,
#panelBody .city-meta {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: rgba(223, 217, 205, 0.72);
}

.city-intro em,
.city-intro .note,
#panelBody .city-intro em {
  font-style: italic;
  color: rgba(200, 191, 173, 0.72);
}
.city-intro div{
  margin-bottom: 3px;
}

.city-intro div::first-line{
  letter-spacing: 0.035em;
}
/* ==============================
   OBSERVATION PRESSURE (v1)
   ============================== */
.lm-tag--repeat,
.sb-pressure-note,
.sb-unstable-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
  letter-spacing:.02em;
}

.lm-tag--repeat{
  margin-left:6px;
  border:1px solid rgba(220,180,120,.28);
  background:rgba(220,180,120,.10);
  color:rgba(245,225,190,.94);
}

.sb-pressure-note{
  margin-top:10px;
  border:1px solid rgba(220,180,120,.18);
  background:rgba(255,255,255,.04);
  color:rgba(240,240,255,.88);
}
.archive-card.is-unstable{
  border-color:rgba(240,80,90,.34) !important;
  box-shadow:0 0 0 1px rgba(240,80,90,.10), 0 0 22px rgba(240,80,90,.10) !important;
  position:relative;
}
.archive-card.is-unstable::after{
  content:""; position:absolute; inset:-1px; border-radius:inherit; pointer-events:none;
  background:radial-gradient(circle at 85% 18%, rgba(240,80,90,.12), transparent 32%);
}
.sb-unstable-badge{
  border:1px solid rgba(240,80,90,.32);
  background:rgba(80,10,18,.40);
  color:rgba(255,215,220,.94);
}
.sb-bcast.sb-bcast--observed{
  border-color:rgba(240,80,90,.24);
  box-shadow:0 0 0 1px rgba(240,80,90,.08), 0 0 20px rgba(240,80,90,.08);
}
.cb-node.ghost, .cb-node.corrupt-obs{
  border-color:rgba(240,80,90,.42) !important;
  box-shadow:0 0 0 1px rgba(240,80,90,.16), 0 0 30px rgba(240,80,90,.14) !important;
  position:relative;
}
.cb-node.ghost::after, .cb-node.corrupt-obs::after{
  content:""; position:absolute; inset:-2px; border-radius:inherit; pointer-events:none;
  background:radial-gradient(circle at 20% 20%, rgba(240,80,90,.16), transparent 36%);
  mix-blend-mode:screen;
}
html[data-theme="light"] .lm-tag--repeat,
html[data-theme="light"] .sb-pressure-note{
  background:linear-gradient(180deg, rgba(255,248,224,.98), rgba(247,233,187,.96)) !important;
  color:#7a5600 !important; border-color:rgba(184,137,24,.38) !important;
}
html[data-theme="light"] .archive-card.is-unstable{
  border-color:rgba(178,66,78,.30) !important;
  box-shadow:0 0 0 1px rgba(178,66,78,.08), 0 0 24px rgba(178,66,78,.10) !important;
}
html[data-theme="light"] .sb-unstable-badge{
  background:linear-gradient(180deg, rgba(255,238,241,.98), rgba(252,222,228,.96)) !important;
  color:#8a2b38 !important; border-color:rgba(178,66,78,.28) !important;

}
/* Route 47 flagship module */
#route47Panel.route47-flagship{
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.22));
  overflow: hidden;
}
#route47Panel .r47-ops{
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
#route47Panel .r47-ops-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px;
}
#route47Panel .r47-ops-title{font-weight:800; letter-spacing:.04em;}
#route47Panel .r47-ops-sub{font-size:12px; opacity:.72;}
#route47Panel .r47-grid{
  display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:10px; margin-bottom:10px;
}
#route47Panel .r47-card{
  border:1px solid rgba(255,255,255,.1); border-radius:12px; padding:10px; background:rgba(255,255,255,.04);
}
#route47Panel .r47-k{font-size:11px; text-transform:uppercase; letter-spacing:.08em; opacity:.7;}
#route47Panel .r47-v{margin-top:4px; font-size:18px; font-weight:800;}
#route47Panel .r47-actions{display:flex; flex-wrap:wrap; gap:8px;}
#route47Panel .r47-btn-soft{
  border:1px solid rgba(255,255,255,.14); background:rgba(0,0,0,.18); color:inherit; padding:7px 10px; border-radius:12px; cursor:pointer;
}
#route47Panel .r47-btn-soft.active{background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.24);}
#route47Panel .r47-tags{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px;}
#route47Panel .r47-tag{font-size:11px; border:1px solid rgba(255,255,255,.12); border-radius:999px; padding:4px 8px; opacity:.9;}
#route47Panel .r47-route-note{margin-top:10px; font-size:12px; opacity:.78;}

.r47-stop-ops{
  margin-top:12px; border:1px solid rgba(255,255,255,.10); border-radius:14px; padding:10px; background:rgba(255,255,255,.03);
}
.r47-stop-ops .r47-stop-grid{display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; margin-bottom:10px;}
.r47-stop-ops .r47-mini{border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:9px; background:rgba(0,0,0,.16);}
.r47-stop-ops .r47-mini .k{font-size:11px; text-transform:uppercase; letter-spacing:.08em; opacity:.68;}
.r47-stop-ops .r47-mini .v{margin-top:4px; font-weight:800;}
.r47-stop-ops .r47-actions{display:flex; flex-wrap:wrap; gap:8px;}
.r47-stop-ops .r47-chiprow{display:flex; flex-wrap:wrap; gap:6px; margin-top:8px;}
.r47-stop-ops .r47-chip{font-size:11px; border:1px solid rgba(255,255,255,.12); border-radius:999px; padding:4px 8px; opacity:.9;}

html[data-theme="light"] #route47Panel.route47-flagship,
html[data-theme="light"] .r47-stop-ops{
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(246,247,250,.92));
  border-color: rgba(12,20,36,.10);
}
html[data-theme="light"] #route47Panel .r47-card,
html[data-theme="light"] .r47-stop-ops .r47-mini{
  background: rgba(255,255,255,.78);
  border-color: rgba(12,20,36,.08);
}
html[data-theme="light"] #route47Panel .r47-btn-soft{
  background: rgba(255,255,255,.82);
  border-color: rgba(12,20,36,.12);
}
.char-portrait-wrap{
  margin: 0 0 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  max-height: 260px;
}

.char-portrait{
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center top;
}

html[data-theme="light"] .char-portrait-wrap{
  border-color: rgba(148,111,58,.18);
  background: rgba(255,255,255,.72);
}
/* Unified rail row treatment for characters / entities / manifestations */
.char-rail-name{
  display:block;
  font-weight:800;
  letter-spacing:.01em;
  color:rgba(255,249,240,.96);
}
.char-rail-meta{
  margin-top:4px;
  font-size:11px;
  line-height:1.35;
  color:rgba(234,224,210,.66);
}
.char-rail-chips{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.char-rail-chips .pill{
  font-size:10px;
  padding:3px 7px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
}
.char-rail-item.entity-glow::before{
  background: rgba(147,112,214,.70);
}
.char-rail-item.manifest-glow::before{
  background: rgba(105,167,220,.76);
}
.char-rail-item.entity-glow:hover{
  border-color: rgba(147,112,214,.32);
  background:
    linear-gradient(180deg, rgba(147,112,214,.10), rgba(147,112,214,.04)),
    rgba(0,0,0,.28);
}
.char-rail-item.manifest-glow:hover{
  border-color: rgba(105,167,220,.34);
  background:
    linear-gradient(180deg, rgba(105,167,220,.12), rgba(105,167,220,.04)),
    rgba(0,0,0,.28);
}
html[data-theme="light"] .char-rail-meta{
  color:#6d5f53;
}
html[data-theme="light"] .char-rail-chips .pill{
  border-color:rgba(148,111,58,.18);
  background:rgba(255,255,255,.72);
}
/* ===== Shared dossier panels: characters, entities, manifestations ===== */
.sb-dossier{display:grid;gap:14px;margin-top:2px}
.sb-dossier-hero,.sb-dossier-section,.sb-dossier-meta-card{border:1px solid rgba(208,168,104,.14);border-radius:14px;background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));box-shadow:inset 0 1px 0 rgba(255,255,255,.03)}
.sb-dossier-hero{padding:14px 14px 12px;background:linear-gradient(180deg, rgba(24,28,42,.72), rgba(11,14,22,.88));box-shadow:0 18px 48px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.03)}
.sb-dossier-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.sb-dossier-kicker{font-size:10px;letter-spacing:.22em;text-transform:uppercase;color:rgba(220,196,160,.68)}
.sb-dossier-title{margin-top:4px;font-size:21px;font-weight:900;letter-spacing:.02em;color:rgba(248,241,230,.97)}
.sb-dossier-summary{font-size:13px;line-height:1.65;color:rgba(226,230,239,.82)}
.sb-dossier-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.sb-dossier-pill{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid rgba(208,168,104,.18);background:rgba(255,244,214,.04);color:rgba(233,211,178,.85);font-size:11px;white-space:nowrap}
.sb-dossier-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.sb-dossier-meta-card{padding:11px 12px}
.sb-dossier-meta-k,.sb-dossier-section-title{font-size:10px;letter-spacing:.18em;text-transform:uppercase;color:rgba(210,188,157,.62)}
.sb-dossier-meta-v{margin-top:5px;font-size:13px;line-height:1.55;color:rgba(245,241,233,.95)}
.sb-dossier-section{padding:12px}
.sb-dossier-links{display:grid;gap:8px;margin-top:8px}
.sb-dossier-link-card{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 11px;border-radius:12px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.06)}
.sb-dossier-link-copy{min-width:0}
.sb-dossier-link-title{font-size:13px;font-weight:800;color:rgba(247,241,232,.96)}
.sb-dossier-link-meta{margin-top:3px;font-size:12px;line-height:1.45;color:rgba(214,216,225,.68)}
@media (max-width:720px){ .sb-dossier-meta-grid{grid-template-columns:1fr} .sb-dossier-head{flex-direction:column} }
html[data-theme="light"] .sb-dossier-hero{background:linear-gradient(180deg, rgba(255,252,246,.98), rgba(246,239,229,.98));border-color:rgba(148,111,58,.18);box-shadow:0 12px 30px rgba(54,44,28,.10), inset 0 1px 0 rgba(255,255,255,.72)}
html[data-theme="light"] .sb-dossier-title{color:#2c2116}
html[data-theme="light"] .sb-dossier-summary{color:rgba(43,35,26,.8)}
html[data-theme="light"] .sb-dossier-kicker,html[data-theme="light"] .sb-dossier-meta-k,html[data-theme="light"] .sb-dossier-section-title,html[data-theme="light"] .sb-dossier-link-meta{color:rgba(118,83,36,.68)}
html[data-theme="light"] .sb-dossier-meta-card,html[data-theme="light"] .sb-dossier-section{background:linear-gradient(180deg, rgba(255,255,255,.94), rgba(247,241,232,.96));border-color:rgba(148,111,58,.14)}
html[data-theme="light"] .sb-dossier-meta-v,html[data-theme="light"] .sb-dossier-link-title{color:#30251a}
html[data-theme="light"] .sb-dossier-link-card{background:rgba(255,255,255,.72);border-color:rgba(65,51,29,.08)}
html[data-theme="light"] .sb-dossier-pill{color:#73501f;border-color:rgba(148,111,58,.18);background:rgba(161,118,56,.06)}
.sb-dossier-pillrow{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.sb-dossier-portrait-wrap{margin-top:12px}
.sb-dossier-portrait{display:block;width:100%;max-width:320px;height:auto;border-radius:14px;border:1px solid rgba(208,168,104,.14);box-shadow:0 10px 24px rgba(0,0,0,.18)}
.sb-dossier--character .sb-dossier-hero{gap:12px}
html[data-theme="light"] .sb-dossier-portrait{border-color:rgba(148,111,58,.14);box-shadow:0 10px 24px rgba(54,44,28,.10)}
.sb-dossier-pillrow{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.sb-dossier-portrait-wrap{margin-top:12px}
.sb-dossier-portrait{display:block;width:100%;max-width:320px;height:auto;border-radius:14px;border:1px solid rgba(208,168,104,.14);box-shadow:0 10px 24px rgba(0,0,0,.18)}
.sb-dossier--character .sb-dossier-hero{gap:12px}
html[data-theme="light"] .sb-dossier-portrait{border-color:rgba(148,111,58,.14);box-shadow:0 10px 24px rgba(54,44,28,.10)}


.sb-dossier{display:grid;gap:12px;margin-top:2px}
.sb-dossier-hero{display:grid;gap:10px;padding:14px;border:1px solid rgba(208,168,104,.16);border-radius:16px;background:linear-gradient(180deg, rgba(24,28,42,.72), rgba(11,14,22,.88));box-shadow:0 18px 48px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.03)}
.sb-dossier-kicker{font-size:10px;letter-spacing:.22em;text-transform:uppercase;color:rgba(220,196,160,.68)}
.sb-dossier-title{font-size:21px;font-weight:900;letter-spacing:.02em;color:rgba(248,241,230,.97)}
.sb-dossier-summary{font-size:13px;line-height:1.62;color:rgba(226,230,239,.82)}
.sb-dossier-pill{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;border:1px solid rgba(208,168,104,.18);background:rgba(255,245,225,.05);font-size:11px;color:rgba(239,221,190,.9)}
.sb-dossier-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.sb-dossier-meta-card,.sb-dossier-section{padding:12px;border:1px solid rgba(208,168,104,.14);border-radius:14px;background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));box-shadow:inset 0 1px 0 rgba(255,255,255,.03)}
.sb-dossier-meta-k,.sb-dossier-section-title{font-size:10px;letter-spacing:.18em;text-transform:uppercase;color:rgba(210,188,157,.62)}
.sb-dossier-meta-v{margin-top:5px;font-size:13px;line-height:1.55;color:rgba(245,241,233,.95)}
.sb-dossier-copy{font-size:13px;line-height:1.65;color:rgba(234,232,239,.84)}
.sb-dossier-links{display:grid;gap:8px;margin-top:8px}
.sb-dossier-link-card{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 11px;border-radius:12px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.06)}
.sb-dossier-link-copy{min-width:0}
.sb-dossier-link-title{font-size:13px;font-weight:800;color:rgba(247,241,232,.96)}
.sb-dossier-link-meta{margin-top:3px;font-size:12px;line-height:1.45;color:rgba(214,216,225,.68)}
.sb-dossier--landmark #lmModules{display:grid;gap:12px}
@media (max-width:720px){.sb-dossier-meta-grid{grid-template-columns:1fr}}
html[data-theme="light"] .sb-dossier-hero{background:linear-gradient(180deg, rgba(255,252,246,.98), rgba(246,239,229,.98));border-color:rgba(148,111,58,.18);box-shadow:0 12px 30px rgba(54,44,28,.10), inset 0 1px 0 rgba(255,255,255,.72)}
html[data-theme="light"] .sb-dossier-title{color:#2c2116}
html[data-theme="light"] .sb-dossier-summary{color:rgba(43,35,26,.8)}
html[data-theme="light"] .sb-dossier-kicker, html[data-theme="light"] .sb-dossier-meta-k, html[data-theme="light"] .sb-dossier-section-title, html[data-theme="light"] .sb-dossier-link-meta{color:rgba(118,83,36,.68)}
html[data-theme="light"] .sb-dossier-pill{color:#73501f;border-color:rgba(148,111,58,.18);background:rgba(161,118,56,.06)}
html[data-theme="light"] .sb-dossier-meta-card, html[data-theme="light"] .sb-dossier-section{background:linear-gradient(180deg, rgba(255,255,255,.94), rgba(247,241,232,.96));border-color:rgba(148,111,58,.14)}
html[data-theme="light"] .sb-dossier-meta-v, html[data-theme="light"] .sb-dossier-link-title{color:#30251a}
html[data-theme="light"] .sb-dossier-copy{color:rgba(43,35,26,.82)}
html[data-theme="light"] .sb-dossier-link-card{background:rgba(255,255,255,.72);border-color:rgba(65,51,29,.08)}

/* ===== Low Performance Mode ===== */
body.sb-lowperf::before{
  filter:none !important;
}

body.sb-lowperf .map,
body.sb-lowperf.cycle-ink .map,
body.sb-lowperf.cycle-brass .map,
body.sb-lowperf.cycle-water .map,
body.sb-lowperf.cycle-code .map{
  filter:none !important;
}

body.sb-lowperf .map::after,
body.sb-lowperf.cycle-ink .map::after,
body.sb-lowperf.cycle-brass .map::after,
body.sb-lowperf.cycle-water .map::after,
body.sb-lowperf.cycle-code .map::after{
  animation:none !important;
  opacity:.06 !important;
  mix-blend-mode:normal !important;
}

body.sb-lowperf[data-ui-mode="investigate"] .map::before,
body.sb-lowperf.mode-investigate .map::before{
  opacity:.22 !important;
  mix-blend-mode:normal !important;
}

body.sb-lowperf[data-ui-mode="investigate"] .sidebar,
body.sb-lowperf.mode-investigate .sidebar,
body.sb-lowperf .topbar,
body.sb-lowperf .modebar,
body.sb-lowperf .strip,
body.sb-lowperf .search-results,
body.sb-lowperf .explore-chooser-inner,
body.sb-lowperf .tour-overlay,
body.sb-lowperf .controls-panel::before,
body.sb-lowperf .controls-panel-inner,
body.sb-lowperf .archive,
body.sb-lowperf .caseboard,
body.sb-lowperf .lightbox-backdrop,
body.sb-lowperf .docbox-backdrop,
body.sb-lowperf .cyoa-backdrop,
body.sb-lowperf .leaflet-control-layers{
  backdrop-filter:none !important;
}

html[data-theme="light"] body.sb-lowperf body::before,
html[data-theme="light"] body.sb-lowperf::before,
html[data-theme="light"] body.sb-lowperf .topbar,
html[data-theme="light"] body.sb-lowperf .sidebar,
html[data-theme="light"] body.sb-lowperf .panel,
html[data-theme="light"] body.sb-lowperf .controls-panel-inner,
html[data-theme="light"] body.sb-lowperf .archive,
html[data-theme="light"] body.sb-lowperf .caseboard,
html[data-theme="light"] body.sb-lowperf .docbox-side,
html[data-theme="light"] body.sb-lowperf .docbox-view,
html[data-theme="light"] body.sb-lowperf .search-results,
html[data-theme="light"] body.sb-lowperf .lightbox-figure,
html[data-theme="light"] body.sb-lowperf .pdf-lightbox__panel,
html[data-theme="light"] body.sb-lowperf .controls-panel-body,
html[data-theme="light"] body.sb-lowperf .panel-body,
html[data-theme="light"] body.sb-lowperf .archive-body,
html[data-theme="light"] body.sb-lowperf .caseboard-body,
html[data-theme="light"] body.sb-lowperf .legend,
html[data-theme="light"] body.sb-lowperf .strip,
html[data-theme="light"] body.sb-lowperf .modebar,
html[data-theme="light"] body.sb-lowperf .searchwrap,
html[data-theme="light"] body.sb-lowperf .card,
html[data-theme="light"] body.sb-lowperf .module,
html[data-theme="light"] body.sb-lowperf .lm-module,
html[data-theme="light"] body.sb-lowperf .controls-card,
html[data-theme="light"] body.sb-lowperf #panelBody,
html[data-theme="light"] body.sb-lowperf #sidebar,
html[data-theme="light"] body.sb-lowperf #legend,
html[data-theme="light"] body.sb-lowperf #controlStrip,
html[data-theme="light"] body.sb-lowperf .docbox-backdrop,
html[data-theme="light"] body.sb-lowperf .lightbox-backdrop,
html[data-theme="light"] body.sb-lowperf .pdf-lightbox__backdrop,
html[data-theme="light"] body.sb-lowperf .cyoa-backdrop,
html[data-theme="light"] body.sb-lowperf .sv-backdrop{
  backdrop-filter:none !important;
}
/* ==============================
   HOME DOSSIER PANEL
   ============================== */
.home-dossier{
  display:grid;
  gap:12px;
  margin-bottom:2px;
}
.home-dossier-hero{
  display:grid;
  gap:10px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(208,168,104,.16);
  background:linear-gradient(180deg, rgba(24,28,42,.72), rgba(11,14,22,.88));
  box-shadow:0 18px 48px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.03);
}
.home-dossier-kicker{
  font-size:10px;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:rgba(220,196,160,.68);
}
.home-dossier-title{
  font-size:21px;
  font-weight:900;
  letter-spacing:.02em;
  color:rgba(248,241,230,.97);
}
.home-dossier-summary{
  font-size:13px;
  line-height:1.65;
  color:rgba(226,230,239,.82);
}
.home-dossier-promo{
  width:100%;
  justify-self:stretch;
}
.home-dossier-promo img{
  display:block;
  width:100%;
  height:auto;
  border-radius:12px;
}
.home-dossier-meta-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.home-dossier-meta-card{
  padding:11px 12px;
  border:1px solid rgba(208,168,104,.14);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
.home-dossier-meta-k{
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(210,188,157,.62);
}
.home-dossier-meta-v{
  margin-top:5px;
  font-size:13px;
  line-height:1.55;
  color:rgba(245,241,233,.95);
}
.home-dossier-note{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(208,168,104,.12);
  background:rgba(255,255,255,.025);
  color:rgba(214,216,225,.72);
  font-size:12px;
  line-height:1.55;
}
@media (max-width:720px){
  .home-dossier-meta-grid{grid-template-columns:1fr;}
}
html[data-theme="light"] .home-dossier-hero{
  background:linear-gradient(180deg, rgba(255,252,246,.98), rgba(246,239,229,.98));
  border-color:rgba(148,111,58,.18);
  box-shadow:0 12px 30px rgba(54,44,28,.10), inset 0 1px 0 rgba(255,255,255,.72);
}
html[data-theme="light"] .home-dossier-title{color:#2c2116;}
html[data-theme="light"] .home-dossier-summary{color:rgba(43,35,26,.8);}
html[data-theme="light"] .home-dossier-kicker,
html[data-theme="light"] .home-dossier-meta-k{color:rgba(120,84,36,.74);}
html[data-theme="light"] .home-dossier-meta-card,
html[data-theme="light"] .home-dossier-note{
  background:linear-gradient(180deg, rgba(255,255,255,.94), rgba(247,241,232,.96));
  border-color:rgba(148,111,58,.14);
}
html[data-theme="light"] .home-dossier-meta-v,
html[data-theme="light"] .home-dossier-note{color:#30251a;}


/* Landmark dossier annex pass */
.sb-dossier-section--summary{
  position:relative;
  overflow:hidden;
}
.sb-annex-intro{
  margin-top:14px;
  padding:12px 14px;
  border:1px solid rgba(214,190,150,.16);
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.sb-annex-intro-kicker{
  font-size:11px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(225,205,170,.78);
  margin-bottom:6px;
}
.sb-annex-intro-copy{
  font-size:13px;
  line-height:1.55;
  color:rgba(240,240,255,.78);
}
.sb-annex-wrap{
  margin-top:14px;
  padding-top:2px;
}
.sb-annex-stack{ display:grid; gap:12px; }
.sb-program-card{
  position:relative;
  border:1px solid rgba(214,190,150,.14);
  border-radius:18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025) 38%, rgba(0,0,0,.10)),
    linear-gradient(180deg, rgba(19,18,24,.96), rgba(11,11,16,.94));
  box-shadow:0 18px 44px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.04);
  overflow:hidden;
}
.sb-program-card::before{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, rgba(214,190,150,.07), transparent 22%, transparent 78%, rgba(214,190,150,.04));
  pointer-events:none;
}
.sb-program-card + .sb-program-card{ margin-top:0; }
.sb-annex-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:12px 16px 0;
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(215,195,165,.68);
}
.sb-annex-folio{ color:rgba(224,204,173,.86); }
.sb-annex-class{ color:rgba(240,240,255,.44); }
.sb-program-head{
  width:100%;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:10px 16px 14px;
  border:0;
  background:transparent;
  color:inherit;
  text-align:left;
  cursor:pointer;
}
.sb-annex-head::after{
  content:'−';
  flex:0 0 auto;
  width:30px;
  height:30px;
  border-radius:999px;
  display:grid;
  place-items:center;
  border:1px solid rgba(214,190,150,.18);
  background:rgba(255,255,255,.03);
  color:rgba(230,210,184,.88);
  font-size:18px;
  line-height:1;
  margin-top:2px;
}
.sb-annex-head.is-collapsed::after{ content:'+'; }
.sb-annex-heading-wrap{ flex:1 1 auto; min-width:0; }
.sb-program-title{
  font-family: ui-serif, Georgia, 'Times New Roman', serif;
  font-size:18px;
  line-height:1.15;
  letter-spacing:.01em;
  color:rgba(247,243,236,.96);
}
.sb-program-teaser{
  margin-top:6px;
  font-size:13px;
  line-height:1.55;
  color:rgba(240,240,255,.64);
  max-width:64ch;
}
.sb-program-body{
  padding:14px 16px 16px;
  border-top:1px solid rgba(214,190,150,.10);
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.06));
}
.sb-annex-body .sb-program-list{
  display:grid;
  gap:8px;
}
.sb-annex-body .sb-program-list > div,
.sb-annex-body .sb-program-note{
  position:relative;
  padding-left:14px;
}
.sb-annex-body .sb-program-list > div::before,
.sb-annex-body .sb-program-note::before{
  content:'•';
  position:absolute;
  left:0;
  top:0;
  color:rgba(224,204,173,.62);
}
.sb-program-note{
  margin-top:12px;
  font-size:12px;
  line-height:1.5;
  color:rgba(226,209,186,.72);
  font-style:italic;
}
.sb-mini-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
  margin-bottom:12px;
}
.sb-mini-metric{
  padding:12px 12px 10px;
  border-radius:14px;
  border:1px solid rgba(214,190,150,.12);
  background:rgba(255,255,255,.03);
}
.sb-mini-metric .k{
  font-size:10px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(240,240,255,.48);
}
.sb-mini-metric .v{
  margin-top:8px;
  font-family: ui-serif, Georgia, 'Times New Roman', serif;
  font-size:20px;
  color:rgba(247,243,236,.96);
}
.sb-program-card--console{ border-color:rgba(211,188,145,.22); }
.sb-program-card--ledger{ border-color:rgba(180,162,222,.18); }
.sb-program-card--bulletin,.sb-program-card--notice{ border-color:rgba(141,178,217,.16); }
.sb-program-card--restricted,.sb-program-card--evidence{ border-color:rgba(202,132,132,.18); }
.sb-program-card--audio{ border-color:rgba(153,130,215,.18); }
.sb-dossier-links--annexes{ gap:10px; }
.sb-dossier-link-card--annex{
  border-style:dashed;
  border-color:rgba(214,190,150,.16);
  background:linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.016));
}
.sb-dossier-link-eyebrow{
  margin-bottom:5px;
  font-size:10px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(220,199,166,.66);
}
html[data-theme="light"] .sb-annex-intro,
html[data-theme="light"] .sb-program-card,
html[data-theme="light"] .sb-dossier-link-card--annex{
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,247,252,.96)) !important;
  border-color:rgba(106,124,155,.18) !important;
  box-shadow:0 16px 36px rgba(49,72,112,.08), inset 0 1px 0 rgba(255,255,255,.86) !important;
}
html[data-theme="light"] .sb-annex-intro-kicker,
html[data-theme="light"] .sb-annex-folio,
html[data-theme="light"] .sb-dossier-link-eyebrow{
  color:rgba(109,84,32,.74) !important;
}
html[data-theme="light"] .sb-annex-class,
html[data-theme="light"] .sb-program-teaser,
html[data-theme="light"] .sb-annex-intro-copy,
html[data-theme="light"] .sb-program-note,
html[data-theme="light"] .sb-mini-metric .k{
  color:rgba(22,32,49,.68) !important;
}
html[data-theme="light"] .sb-annex-head::after{
  background:rgba(245,248,252,.96) !important;
  border-color:rgba(106,124,155,.18) !important;
  color:#6a5323 !important;
}
@media (max-width: 780px){
  .sb-mini-grid{ grid-template-columns:1fr; }
  .sb-program-title{ font-size:16px; }
}
@media (max-width: 680px){ .sb-mini-grid{ grid-template-columns:1fr; } }

/* St. Brielle dossier annex restyle */
#lmModulesWrap{
  position:relative;
  margin-top:14px;
  padding-top:10px;
  border-top:1px solid rgba(208,168,104,.14);
}
#lmModulesWrap::before{
  content:"Site annexes";
  display:block;
  margin:0 0 10px 1px;
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(210,188,157,.58);
}
.sb-dossier--landmark #lmModules{
  display:grid;
  gap:10px;
}
.sb-dossier--landmark #lmModules > *{
  position:relative;
  border:1px solid rgba(208,168,104,.14) !important;
  border-radius:10px !important;
  background:
    linear-gradient(180deg, rgba(255,248,233,.045), rgba(255,248,233,.018) 34%, rgba(10,10,14,.22) 100%) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03), 0 10px 26px rgba(0,0,0,.14) !important;
  padding:12px 12px 11px !important;
  overflow:hidden;
}
.sb-dossier--landmark #lmModules > *::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:1px;
  background:linear-gradient(90deg, rgba(208,168,104,.34), rgba(208,168,104,.06) 58%, transparent);
  pointer-events:none;
}
.sb-dossier--landmark #lmModules > *::after{
  content:"Annex";
  position:absolute;
  top:10px;
  right:12px;
  font-size:9px;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:rgba(208,188,157,.42);
  pointer-events:none;
}

/* De-widget the common landmark modules */
.sb-bcast,
.brigid-ward,
.voxskin-module,
.culdesac-module,
.sb-module{
  border:none !important;
  background:transparent !important;
  border-radius:0 !important;
  box-shadow:none !important;
  padding:0 !important;
}

.sb-bcast-head,
.brigid-ward-head,
.vox-head{
  align-items:flex-start;
  padding-right:64px;
}
.sb-bcast-head b,
.brigid-ward-title,
.vox-title{
  font-size:14px;
  font-weight:800;
  letter-spacing:.04em;
  color:rgba(245,239,228,.96);
}
.sb-bcast-sub,
.brigid-ward-sub,
.vox-sub{
  font-size:12px;
  line-height:1.5;
  color:rgba(220,220,228,.68);
}
.sb-bcast-live,
.lm-tag,
.vox-tab,
.vox-btn,
.char-btn,
.open-doc,
.brigid-ward-actions .btn,
.sb-bcast-controls .btn{
  border-radius:999px !important;
  border:1px solid rgba(208,168,104,.16) !important;
  background:rgba(255,245,225,.045) !important;
  color:rgba(237,226,204,.92) !important;
  box-shadow:none !important;
}
.sb-bcast-live,
.lm-tag{
  padding:4px 8px !important;
  font-size:10px !important;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.sb-bcast-feed,
.brigid-feed,
.vox-feed{
  margin-top:10px;
  border:1px solid rgba(208,168,104,.10) !important;
  border-radius:8px !important;
  background:linear-gradient(180deg, rgba(11,11,15,.34), rgba(0,0,0,.24)) !important;
  box-shadow:none !important;
}
.sb-bcast-line,
.brigid-line,
.vox-line{
  border-bottom:1px solid rgba(208,168,104,.08) !important;
}
.sb-bcast-controls,
.brigid-ward-actions,
.vox-actions{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(208,168,104,.08);
}
.brigid-ward-grid,
.vox-grid{
  gap:8px;
}
.brigid-metric,
.vox-card{
  border:1px solid rgba(208,168,104,.10) !important;
  border-radius:8px !important;
  background:rgba(255,248,233,.028) !important;
  box-shadow:none !important;
}
.brigid-metric .k,
.vox-k,
.sb-rupture-title{
  color:rgba(208,188,157,.58) !important;
}
.brigid-metric .v,
.vox-v{
  color:rgba(245,239,228,.96) !important;
}
.vox-tabs{
  gap:6px;
  margin-top:10px;
  padding-bottom:8px;
  border-bottom:1px dashed rgba(208,168,104,.10);
}
.vox-tab.is-on{
  background:rgba(208,168,104,.12) !important;
  border-color:rgba(208,168,104,.26) !important;
}

/* Linked record cards should feel from same paperwork family */
.sb-dossier-link-card{
  border-radius:10px;
  background:linear-gradient(180deg, rgba(255,248,233,.04), rgba(255,248,233,.015)) !important;
  border-color:rgba(208,168,104,.10) !important;
}

html[data-theme="light"] #lmModulesWrap{
  border-top-color:rgba(148,111,58,.16);
}
html[data-theme="light"] #lmModulesWrap::before{
  color:rgba(118,83,36,.62);
}
html[data-theme="light"] .sb-dossier--landmark #lmModules > *{
  background:linear-gradient(180deg, rgba(255,255,255,.86), rgba(249,244,236,.96)) !important;
  border-color:rgba(148,111,58,.14) !important;
  box-shadow:0 8px 20px rgba(54,44,28,.06), inset 0 1px 0 rgba(255,255,255,.68) !important;
}
html[data-theme="light"] .sb-dossier--landmark #lmModules > *::after{
  color:rgba(118,83,36,.42);
}
html[data-theme="light"] .sb-bcast-head b,
html[data-theme="light"] .brigid-ward-title,
html[data-theme="light"] .vox-title,
html[data-theme="light"] .brigid-metric .v,
html[data-theme="light"] .vox-v{
  color:#2f2418 !important;
}
html[data-theme="light"] .sb-bcast-sub,
html[data-theme="light"] .brigid-ward-sub,
html[data-theme="light"] .vox-sub,
html[data-theme="light"] .brigid-metric .k,
html[data-theme="light"] .vox-k{
  color:rgba(92,68,39,.68) !important;
}
html[data-theme="light"] .sb-bcast-feed,
html[data-theme="light"] .brigid-feed,
html[data-theme="light"] .vox-feed,
html[data-theme="light"] .brigid-metric,
html[data-theme="light"] .vox-card{
  background:rgba(255,255,255,.55) !important;
  border-color:rgba(148,111,58,.10) !important;
}
html[data-theme="light"] .sb-bcast-live,
html[data-theme="light"] .lm-tag,
html[data-theme="light"] .vox-tab,
html[data-theme="light"] .vox-btn,
html[data-theme="light"] .char-btn,
html[data-theme="light"] .open-doc,
html[data-theme="light"] .brigid-ward-actions .btn,
html[data-theme="light"] .sb-bcast-controls .btn{
  color:#6d4c1f !important;
  border-color:rgba(148,111,58,.16) !important;
  background:rgba(161,118,56,.05) !important;
}
/* Flagship annex accents */
.sb-dossier--landmark[data-landmark-id="b06"] #lmModulesWrap,
.sb-dossier--landmark[data-landmark-id="b06"] #lmModules{
  --annex-accent: rgba(180, 154, 112, .42);
  --annex-accent-soft: rgba(180, 154, 112, .14);
  --annex-ink: rgba(233, 224, 204, .92);
  --annex-kicker: rgba(204, 182, 145, .66);
}
.sb-dossier--landmark[data-landmark-id="b06"] #lmModulesWrap::before{
  content:"Hospital annexes";
}
.sb-dossier--landmark[data-landmark-id="b06"] #lmModules > *{
  background:
    linear-gradient(180deg, rgba(250,244,230,.055), rgba(250,244,230,.02) 32%, rgba(20,18,15,.24) 100%) !important;
  border-color:var(--annex-accent-soft) !important;
}
.sb-dossier--landmark[data-landmark-id="b06"] #lmModules > *::after{
  content:"Clinical annex";
}
.sb-dossier--landmark[data-landmark-id="b06"] .sb-program-title,
.sb-dossier--landmark[data-landmark-id="b06"] .brigid-ward-title,
.sb-dossier--landmark[data-landmark-id="b06"] .sb-bcast-head b,
.sb-dossier--landmark[data-landmark-id="b06"] .vox-title{
  color:var(--annex-ink) !important;
}
.sb-dossier--landmark[data-landmark-id="b06"] .sb-program-note,
.sb-dossier--landmark[data-landmark-id="b06"] .sb-mini-metric .k,
.sb-dossier--landmark[data-landmark-id="b06"] .brigid-metric .k,
.sb-dossier--landmark[data-landmark-id="b06"] .vox-k{
  color:var(--annex-kicker) !important;
}
.sb-dossier--landmark[data-landmark-id="b06"] .sb-mini-metric,
.sb-dossier--landmark[data-landmark-id="b06"] .brigid-metric,
.sb-dossier--landmark[data-landmark-id="b06"] .vox-card{
  background:rgba(251,246,235,.034) !important;
  border-color:rgba(180,154,112,.16) !important;
}

.sb-dossier--landmark[data-landmark-id="b20"] #lmModulesWrap,
.sb-dossier--landmark[data-landmark-id="b20"] #lmModules{
  --annex-accent: rgba(148, 158, 202, .40);
  --annex-accent-soft: rgba(148, 158, 202, .14);
  --annex-ink: rgba(232, 236, 247, .94);
  --annex-kicker: rgba(176, 186, 220, .66);
}
.sb-dossier--landmark[data-landmark-id="b20"] #lmModulesWrap::before{
  content:"Curatorial annexes";
}
.sb-dossier--landmark[data-landmark-id="b20"] #lmModules > *{
  background:
    linear-gradient(180deg, rgba(240,243,255,.05), rgba(240,243,255,.018) 34%, rgba(12,14,20,.24) 100%) !important;
  border-color:var(--annex-accent-soft) !important;
}
.sb-dossier--landmark[data-landmark-id="b20"] #lmModules > *::after{
  content:"Gallery insert";
}
.sb-dossier--landmark[data-landmark-id="b20"] #lmModules > *::before{
  background:linear-gradient(90deg, rgba(148,158,202,.34), rgba(148,158,202,.08) 58%, transparent);
}
.sb-dossier--landmark[data-landmark-id="b20"] .sb-program-title,
.sb-dossier--landmark[data-landmark-id="b20"] .brigid-ward-title,
.sb-dossier--landmark[data-landmark-id="b20"] .sb-bcast-head b,
.sb-dossier--landmark[data-landmark-id="b20"] .vox-title{
  color:var(--annex-ink) !important;
  letter-spacing:.06em;
}
.sb-dossier--landmark[data-landmark-id="b20"] .sb-program-note,
.sb-dossier--landmark[data-landmark-id="b20"] .sb-mini-metric .k,
.sb-dossier--landmark[data-landmark-id="b20"] .brigid-metric .k,
.sb-dossier--landmark[data-landmark-id="b20"] .vox-k{
  color:var(--annex-kicker) !important;
}
.sb-dossier--landmark[data-landmark-id="b20"] .sb-mini-metric,
.sb-dossier--landmark[data-landmark-id="b20"] .brigid-metric,
.sb-dossier--landmark[data-landmark-id="b20"] .vox-card{
  background:rgba(241,244,255,.035) !important;
  border-color:rgba(148,158,202,.16) !important;
}

.sb-dossier--landmark[data-landmark-id="b11"] #lmModulesWrap,
.sb-dossier--landmark[data-landmark-id="b11"] #lmModules{
  --annex-accent: rgba(178, 124, 102, .40);
  --annex-accent-soft: rgba(178, 124, 102, .14);
  --annex-ink: rgba(243, 230, 220, .94);
  --annex-kicker: rgba(208, 171, 150, .66);
}
.sb-dossier--landmark[data-landmark-id="b11"] #lmModulesWrap::before{
  content:"Collection annexes";
}
.sb-dossier--landmark[data-landmark-id="b11"] #lmModules > *{
  background:
    linear-gradient(180deg, rgba(252,242,236,.05), rgba(252,242,236,.018) 32%, rgba(20,12,10,.25) 100%) !important;
  border-color:var(--annex-accent-soft) !important;
}
.sb-dossier--landmark[data-landmark-id="b11"] #lmModules > *::after{
  content:"Collection note";
}
.sb-dossier--landmark[data-landmark-id="b11"] #lmModules > *::before{
  background:linear-gradient(90deg, rgba(178,124,102,.34), rgba(178,124,102,.08) 58%, transparent);
}
.sb-dossier--landmark[data-landmark-id="b11"] .sb-program-title,
.sb-dossier--landmark[data-landmark-id="b11"] .brigid-ward-title,
.sb-dossier--landmark[data-landmark-id="b11"] .sb-bcast-head b,
.sb-dossier--landmark[data-landmark-id="b11"] .vox-title{
  color:var(--annex-ink) !important;
}
.sb-dossier--landmark[data-landmark-id="b11"] .sb-program-note,
.sb-dossier--landmark[data-landmark-id="b11"] .sb-mini-metric .k,
.sb-dossier--landmark[data-landmark-id="b11"] .brigid-metric .k,
.sb-dossier--landmark[data-landmark-id="b11"] .vox-k{
  color:var(--annex-kicker) !important;
}
.sb-dossier--landmark[data-landmark-id="b11"] .sb-mini-metric,
.sb-dossier--landmark[data-landmark-id="b11"] .brigid-metric,
.sb-dossier--landmark[data-landmark-id="b11"] .vox-card{
  background:rgba(252,242,236,.034) !important;
  border-color:rgba(178,124,102,.16) !important;
}

html[data-theme="light"] .sb-dossier--landmark[data-landmark-id="b06"] #lmModulesWrap::before{ color:rgba(118,85,38,.66); }
html[data-theme="light"] .sb-dossier--landmark[data-landmark-id="b20"] #lmModulesWrap::before{ color:rgba(83,93,138,.62); }
html[data-theme="light"] .sb-dossier--landmark[data-landmark-id="b11"] #lmModulesWrap::before{ color:rgba(128,83,59,.62); }
html[data-theme="light"] .sb-dossier--landmark[data-landmark-id="b06"] #lmModules > *{
  background:linear-gradient(180deg, rgba(255,255,255,.9), rgba(248,242,232,.98)) !important;
  border-color:rgba(148,111,58,.16) !important;
}
html[data-theme="light"] .sb-dossier--landmark[data-landmark-id="b20"] #lmModules > *{
  background:linear-gradient(180deg, rgba(255,255,255,.94), rgba(244,245,251,.98)) !important;
  border-color:rgba(103,112,150,.16) !important;
}
html[data-theme="light"] .sb-dossier--landmark[data-landmark-id="b11"] #lmModules > *{
  background:linear-gradient(180deg, rgba(255,255,255,.93), rgba(249,242,237,.98)) !important;
  border-color:rgba(152,104,77,.16) !important;
}

/* Archive escalation controls + status layer */
.archive-filters .archive-row{
  align-items:center;
}
.archive-filters #archiveEra,
.archive-filters #archiveClassification{
  min-width: 170px;
}
.archive-status-badge{
  text-transform: uppercase;
  letter-spacing: .08em;
}
.archive-card[data-status="sealed"] .archive-status-badge{
  border-color: rgba(140,150,170,.35);
}
.archive-card[data-status="revealed"] .archive-status-badge,
.archive-card[data-status="unlocked"] .archive-status-badge{
  border-color: rgba(180,138,48,.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 1px rgba(180,138,48,.08);
}
.archive-card[data-status="generated"] .archive-status-badge{
  border-color: rgba(124,90,164,.34);
}
.archive-card[data-status="contested"] .archive-status-badge{
  border-color: rgba(139,59,59,.4);
}
html[data-theme="light"] .archive-card[data-status="revealed"] .archive-status-badge,
html[data-theme="light"] .archive-card[data-status="unlocked"] .archive-status-badge{
  border-color: rgba(180,138,48,.26);
}
.archive-card .archive-tag{
  background: rgba(214,170,84,.08);
  border: 1px dashed rgba(214,170,84,.30);
  color: rgba(236,210,150,.94);
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
}
.archive-card .archive-tag::before{
  content: "TAG";
  margin-right: 6px;
  opacity: .55;
  font-size: 10px;
}
.archive-type-badge{
  position: relative;
  background:
    linear-gradient(180deg, rgba(92,110,146,.18), rgba(54,66,92,.26));
  border: 1px solid rgba(136,157,201,.26);
  color: rgba(228,236,250,.96);
  border-radius: 6px;
  padding: 5px 10px 5px 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10px;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 1px 10px rgba(0,0,0,.12);
}

.archive-type-badge::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(180deg, rgba(170,192,238,.9), rgba(106,132,190,.8));
}

.archive-type-badge::after{
  content: "FILE TYPE";
  margin-left: 8px;
  opacity: .52;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
}

.archive-classification-badge{
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(255,231,168,.16), transparent 45%),
    linear-gradient(180deg, rgba(121,82,26,.24), rgba(72,47,15,.34));
  border: 1px solid rgba(215,176,92,.34);
  color: rgba(248,231,190,.98);
  border-radius: 999px;
  padding: 5px 12px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 10px;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255,245,210,.08),
    0 0 0 1px rgba(215,176,92,.08);
}

.archive-classification-badge::before{
  content: "◉";
  margin-right: 6px;
  color: rgba(255,219,127,.72);
  font-size: 9px;
  vertical-align: 1px;
}

.archive-classification-badge::after{
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px dashed rgba(255,223,145,.10);
  border-radius: 999px;
  pointer-events: none;
}

html[data-theme="light"] .archive-type-badge{
  background:
    linear-gradient(180deg, rgba(95,115,156,.10), rgba(95,115,156,.16)) !important;
  border: 1px solid rgba(95,115,156,.20) !important;
  color: #42567b !important;
}

html[data-theme="light"] .archive-type-badge::before{
  background: linear-gradient(180deg, rgba(115,142,199,.88), rgba(84,112,175,.78)) !important;
}

html[data-theme="light"] .archive-classification-badge{
  background:
    radial-gradient(circle at top left, rgba(233,197,116,.14), transparent 45%),
    linear-gradient(180deg, rgba(190,157,90,.10), rgba(190,157,90,.18)) !important;
  border: 1px solid rgba(190,157,90,.24) !important;
  color: #6c5621 !important;
}
/* Archive intelligence / strengthened archive */
.archive-filters .archive-row{align-items:center;flex-wrap:wrap;}
.archive-filters #archiveEra,
.archive-filters #archiveClassification{min-width:170px;}
.archive-side{display:flex;flex-direction:column;gap:0;}
.archive-intel-block{display:grid;gap:10px;}
.archive-intel-title{
  font-size:11px;
  letter-spacing:.14em;
  text-transform:uppercase;
  opacity:.82;
  font-weight:800;
}
.archive-inspector-card{display:grid;gap:8px;}
.archive-intel-kicker{font-size:11px;letter-spacing:.12em;text-transform:uppercase;opacity:.72;}
.archive-intel-headline{font-size:15px;font-weight:800;line-height:1.25;}
.archive-intel-meta{font-size:12px;opacity:.72;}
.archive-intel-copy{font-size:13px;line-height:1.5;}
.archive-intel-link{
  display:grid;
  gap:3px;
  width:100%;
  text-align:left;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:10px 12px;
  color:inherit;
  cursor:pointer;
  margin:0 0 8px;
}
.archive-intel-link span{font-size:11px;opacity:.68;letter-spacing:.08em;text-transform:uppercase;}
.archive-card.selected{
  box-shadow:0 0 0 1px rgba(214,170,84,.42), 0 10px 26px rgba(0,0,0,.22);
  transform:translateY(-1px);
}
.archive-status-badge{text-transform:uppercase;letter-spacing:.08em;}
.archive-card[data-status="sealed"] .archive-status-badge{border-color:rgba(140,150,170,.35);}
.archive-card[data-status="revealed"] .archive-status-badge,
.archive-card[data-status="unlocked"] .archive-status-badge{border-color:rgba(180,138,48,.38);}
.archive-card[data-status="generated"] .archive-status-badge{border-color:rgba(124,90,164,.34);}
.archive-card[data-status="contested"] .archive-status-badge{border-color:rgba(139,59,59,.4);}
html[data-theme="light"] .archive-card.selected{
  box-shadow:0 0 0 1px rgba(180,138,48,.28), 0 12px 22px rgba(0,0,0,.08);
}
.sidebar-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.9rem;
  margin: 0 0 1rem;
  border-bottom: 1px solid rgba(201, 167, 92, 0.22);
  background:
    linear-gradient(180deg, rgba(201,167,92,0.08), rgba(201,167,92,0.02)),
    linear-gradient(90deg, rgba(255,255,255,0.02), transparent 70%);
}

.sidebar-head::after {
  content: "";
  position: absolute;
  left: 1rem;
  bottom: -1px;
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, #c9a75c, rgba(201,167,92,0));
}

.sidebar-head .panel-title,
.sidebar-head #panelTitle {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f2eadb;
  line-height: 1.15;
}
.reversal-trigger{
  border-radius:999px;
  letter-spacing:.14em;
  text-transform:uppercase;
}
@media (max-width: 900px){
  .reversal-trigger{ width:100%; justify-content:center; }
}
   /* Landmark list cleanup */
    #landmarkList{
      display:flex;
      flex-direction:column;
      gap:8px;
      margin:0;
      padding:0;
      list-style:none;
    }

    #landmarkList > li{
      list-style:none;
      margin:0;
      padding:0;
    }

    .lm-item{
      width:100%;
      display:grid;
      grid-template-columns:minmax(0,1fr);
      gap:7px;
      align-items:start;
      text-align:left;
      padding:10px 12px;
      box-sizing:border-box;
      overflow:hidden;
    }

    .lm-head{
      display:flex;
      align-items:baseline;
      flex-wrap:wrap;
      gap:6px 8px;
      min-width:0;
    }

    .lm-name{
      flex:1 1 180px;
      min-width:0;
      white-space:normal;
      overflow-wrap:anywhere;
      line-height:1.22;
    }

    .lm-type{
      flex:0 1 auto;
      white-space:nowrap;
      font-size:11px;
      opacity:.72;
    }

    .lm-meta-row{
      display:flex;
      flex-wrap:wrap;
      align-items:center;
      gap:6px;
      min-width:0;
    }

    .lm-tag,
    .lm-live{
      display:inline-flex;
      align-items:center;
      max-width:100%;
      min-width:0;
      white-space:normal;
      overflow-wrap:anywhere;
      line-height:1.15;
      box-sizing:border-box;
    }

    .lm-live{
      padding:4px 8px;
      border-radius:999px;
    }

    .landmark-li{
      display:flex;
      flex-wrap:wrap;
      align-items:center;
      gap:6px 8px;
    }

    .landmark-link{
      min-width:0;
      white-space:normal;
      overflow-wrap:anywhere;
      text-align:left;
    }
    

/* Region dossier launch relocation */
#openShortStoriesBtn,
#restrictedAccessFlyout{
  display:none !important;
}

.sb-region-context-launch{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid rgba(214,190,150,.12);
}
.sb-region-context-launch-k{
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(210,188,157,.62);
  margin-bottom:8px;
}
.sb-region-context-launch-btn{
  width:100%;
  min-height:48px;
  justify-content:flex-start;
  gap:10px;
  border-radius:14px;
  padding:11px 14px;
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border-color:rgba(214,190,150,.18);
  box-shadow:0 14px 32px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.04);
}
.sb-region-context-launch-btn:hover,
.sb-region-context-launch-btn:focus-visible{
  background:linear-gradient(180deg, rgba(220,180,120,.16), rgba(255,255,255,.03));
  border-color:rgba(220,180,120,.34);
}
.sb-region-context-launch-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:999px;
  border:1px solid rgba(220,180,120,.28);
  background:rgba(220,180,120,.08);
  font-size:14px;
  flex:0 0 24px;
}
.sb-region-context-launch-label{
  font-weight:800;
  letter-spacing:.02em;
}
html[data-theme="light"] .sb-region-context-launch{
  border-top-color:rgba(148,111,58,.14);
}
html[data-theme="light"] .sb-region-context-launch-k{
  color:rgba(118,83,36,.68);
}
html[data-theme="light"] .sb-region-context-launch-btn{
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,241,232,.96));
  border-color:rgba(148,111,58,.16);
  box-shadow:0 10px 24px rgba(54,44,28,.08), inset 0 1px 0 rgba(255,255,255,.72);
}
html[data-theme="light"] .sb-region-context-launch-icon{
  border-color:rgba(148,111,58,.24);
  background:rgba(214,190,150,.16);
}


/* ===== REGION DOSSIERS / ANNEX ===== */
.sb-region-dossier{
  --regionGlow: rgba(220,180,120,.22);
  --regionEdge: rgba(220,180,120,.32);
  display:grid;
  gap:12px;
}
.sb-region-hero,
.sb-region-shell,
.sb-region-callout,
.sb-region-meta-card,
.sb-region-module,
.sb-region-module-block,
.sb-region-annex-note{
  position:relative;
  border:1px solid var(--regionEdge);
  border-radius:18px;
  background:linear-gradient(180deg, rgba(12,16,22,.92), rgba(7,10,15,.94));
  box-shadow:0 14px 34px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.02);
  overflow:hidden;
}
.sb-region-hero{ padding:16px 16px 14px; }
.sb-region-shell{ padding:12px; display:grid; gap:12px; }
.sb-region-hero::before,
.sb-region-module::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:radial-gradient(circle at top right, var(--regionGlow), transparent 42%);
  opacity:.9;
}
.sb-region-dossier--ink{ --regionGlow: rgba(196,156,96,.24); --regionEdge: rgba(196,156,96,.34); }
.sb-region-dossier--brass{ --regionGlow: rgba(176,122,224,.22); --regionEdge: rgba(176,122,224,.32); }
.sb-region-dossier--water{ --regionGlow: rgba(96,176,220,.24); --regionEdge: rgba(96,176,220,.34); }
.sb-region-dossier--code{ --regionGlow: rgba(208,222,255,.22); --regionEdge: rgba(208,222,255,.32); }
.sb-region-kicker,
.sb-region-module-kicker,
.sb-region-callout-k,
.sb-region-module-label,
.sb-region-annex-note-k,
.sb-region-meta-k,
.sb-region-access-kicker{
  position:relative;
  z-index:1;
  font-size:10px;
  letter-spacing:.24em;
  text-transform:uppercase;
  color:rgba(230,220,205,.62);
}
.sb-region-head,
.sb-region-module-head{
  position:relative;
  z-index:1;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.sb-region-title,
.sb-region-module-title{
  position:relative;
  z-index:1;
  margin-top:5px;
  font-size:24px;
  line-height:1.05;
  letter-spacing:.02em;
  color:rgba(255,248,240,.98);
}
.sb-region-tagline,
.sb-region-module-sub,
.sb-region-callout-v,
.sb-region-annex-note-v,
.sb-region-feed-copy,
.sb-region-protocol-copy,
.sb-region-metric-note,
.sb-region-note,
.sb-region-meta-v,
.sb-region-access-copy{
  position:relative;
  z-index:1;
  color:rgba(236,229,220,.82);
}
.sb-region-tagline{ margin-top:8px; font-size:13px; }
.sb-region-sigil,
.sb-region-module-sigil{
  position:relative;
  z-index:1;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  font-size:21px;
  color:rgba(255,242,226,.94);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.02), 0 0 22px rgba(255,255,255,.06);
}
.sb-region-pills{ position:relative; z-index:1; display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.sb-region-pill{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  color:rgba(255,244,228,.9);
  font-size:11px;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.sb-region-pill--soft{ opacity:.86; }
.sb-region-note{
  margin-top:12px;
  padding:11px 12px;
  border-radius:14px;
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.06);
  font-size:12.5px;
  line-height:1.55;
}
.sb-region-callout{ padding:11px 12px; }
.sb-region-callout-v{ margin-top:6px; font-size:13px; }
.sb-region-meta-grid,
.sb-region-metrics-grid{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }
.sb-region-meta-card,
.sb-region-metric-card{ padding:10px 11px; background:rgba(255,255,255,.03); }
.sb-region-meta-v,
.sb-region-metric-v{ margin-top:6px; font-size:16px; font-weight:700; color:rgba(255,248,240,.97); }
.sb-region-module{ padding:12px; }
.region-module-mount:empty{ display:none; }
.sb-region-module-block{ padding:11px 12px; background:rgba(0,0,0,.16); }
.sb-region-access{
  border-color:rgba(255,255,255,.08);
  background:
    radial-gradient(circle at right top, rgba(220,180,120,.12), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
}
.sb-region-access-copy{ margin-top:8px; font-size:12.5px; line-height:1.5; }
.sb-region-access-actions{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.sb-region-access-btn{
  min-height:42px;
  justify-content:center;
  font-weight:700;
  letter-spacing:.02em;
}
.sb-region-access-btn--launch{
  border-color:rgba(220,180,120,.3) !important;
  box-shadow:0 0 0 1px rgba(220,180,120,.08) inset, 0 8px 22px rgba(0,0,0,.18);
}
@media (max-width: 720px){
  .sb-region-head,
  .sb-region-module-head{ flex-direction:column; }
  .sb-region-meta-grid,
  .sb-region-metrics-grid,
  .sb-region-access-actions{ grid-template-columns:1fr; }
}
html[data-theme="light"] .sb-region-hero,
html[data-theme="light"] .sb-region-shell,
html[data-theme="light"] .sb-region-callout,
html[data-theme="light"] .sb-region-meta-card,
html[data-theme="light"] .sb-region-module,
html[data-theme="light"] .sb-region-module-block,
html[data-theme="light"] .sb-region-annex-note{
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,244,239,.98));
  box-shadow:0 12px 26px rgba(24,17,8,.08), inset 0 0 0 1px rgba(255,255,255,.45);
}
html[data-theme="light"] .sb-region-title,
html[data-theme="light"] .sb-region-module-title,
html[data-theme="light"] .sb-region-tagline,
html[data-theme="light"] .sb-region-meta-v,
html[data-theme="light"] .sb-region-metric-v,
html[data-theme="light"] .sb-region-sigil,
html[data-theme="light"] .sb-region-module-sigil{
  color:#22170d;
}
html[data-theme="light"] .sb-region-kicker,
html[data-theme="light"] .sb-region-module-kicker,
html[data-theme="light"] .sb-region-callout-k,
html[data-theme="light"] .sb-region-meta-k,
html[data-theme="light"] .sb-region-access-kicker,
html[data-theme="light"] .sb-region-callout-v,
html[data-theme="light"] .sb-region-module-sub,
html[data-theme="light"] .sb-region-access-copy,
html[data-theme="light"] .sb-region-note,
html[data-theme="light"] .sb-region-metric-note{
  color:rgba(51,38,23,.78);
}
html[data-theme="light"] .sb-region-pill,
html[data-theme="light"] .sb-region-sigil,
html[data-theme="light"] .sb-region-module-sigil{
  border-color:rgba(69,48,21,.12);
  background:rgba(84,58,28,.04);
}

/* =========================
   REGION ANNEX MODULE (COMPACT)
========================= */
.region-module-mount{
  margin: 14px 0 0;
}
.sb-region-module{
  position: relative;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(214,170,84,.18);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(214,170,84,.12), transparent 52%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  box-shadow: 0 16px 36px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.03);
  overflow: hidden;
}
.sb-region-module::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: linear-gradient(135deg, rgba(255,255,255,.06), transparent 28%, transparent 72%, rgba(255,255,255,.03));
}
.sb-region-module--ink{ border-color: rgba(120,165,230,.24); }
.sb-region-module--brass{ border-color: rgba(214,170,84,.26); }
.sb-region-module--water{ border-color: rgba(102,170,190,.26); }
.sb-region-module--code{ border-color: rgba(175,135,235,.26); }
.sb-region-module-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
}
.sb-region-module-kicker{
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(214,170,84,.76);
  margin-bottom: 4px;
}
.sb-region-module-title{
  font-size: 22px;
  line-height: 1.05;
  font-weight: 800;
}
.sb-region-module-sub{
  margin-top: 6px;
  color: rgba(235,232,227,.72);
  font-size: 13px;
  line-height: 1.45;
}
.sb-region-module-sigil{
  flex: 0 0 auto;
  min-width: 44px;
  height: 44px;
  display:grid;
  place-items:center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.045);
  font-size: 20px;
  color: rgba(255,244,222,.88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 8px 24px rgba(0,0,0,.18);
}
.sb-region-launcher{
  margin-top: 14px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
}
.sb-region-launcher-k{
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(214,170,84,.76);
}
.sb-region-launcher-copy{
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(238,234,228,.82);
}
.sb-region-launcher .sb-region-launch-btn{
  width: 100%;
  margin-top: 10px;
  justify-content: center;
}

.sb-region-metrics-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 14px;
}
.sb-region-metric-card{
  min-width: 0;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.14);
}
.sb-region-meta-k{
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(214,170,84,.72);
}
.sb-region-metric-v{
  margin-top: 7px;
  font-size: 18px;
  line-height: 1.05;
  font-weight: 800;
}
.sb-region-metric-note{
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(235,232,227,.62);
}
@media (max-width: 860px){
  .sb-region-metrics-grid{ grid-template-columns: 1fr; }
}
/* =========================
   Cycle dossier overhaul + cycle annex modules
   ========================= */
.sb-cycle-dossier{
  display:grid;
  gap:14px;
}
.sb-cycle-hero,
.sb-cycle-shell,
.sb-cycle-callout,
.sb-cycle-module,
.sb-cycle-metric-card,
.sb-cycle-module-block,
.sb-cycle-annex-note{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(0,0,0,.26));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04), 0 18px 48px rgba(0,0,0,.18);
}
.sb-cycle-hero{
  padding:16px 16px 14px;
  background:
    radial-gradient(120% 140% at 8% 0%, var(--cycleGlow, rgba(255,255,255,.10)), transparent 56%),
    radial-gradient(80% 100% at 100% 0%, rgba(255,255,255,.06), transparent 50%),
    linear-gradient(180deg, rgba(18,20,30,.92), rgba(8,10,16,.94));
}
.sb-cycle-hero::before,
.sb-cycle-module::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(120deg, transparent 18%, rgba(255,255,255,.08) 50%, transparent 82%);
  opacity:.28;
}
.sb-cycle-dossier--ink{ --cycleGlow: rgba(196,156,96,.28); --cycleEdge: rgba(196,156,96,.46); }
.sb-cycle-dossier--brass{ --cycleGlow: rgba(176,122,224,.26); --cycleEdge: rgba(176,122,224,.42); }
.sb-cycle-dossier--water{ --cycleGlow: rgba(96,176,220,.28); --cycleEdge: rgba(96,176,220,.44); }
.sb-cycle-dossier--code{ --cycleGlow: rgba(208,222,255,.26); --cycleEdge: rgba(208,222,255,.42); }
.sb-cycle-dossier--ink .sb-cycle-hero,
.sb-cycle-dossier--ink .sb-cycle-shell,
.sb-cycle-dossier--ink .sb-cycle-callout,
.sb-cycle-dossier--ink .sb-cycle-module,
.sb-cycle-dossier--ink .sb-cycle-metric-card,
.sb-cycle-dossier--ink .sb-cycle-module-block,
.sb-cycle-dossier--ink .sb-cycle-annex-note{ border-color: rgba(196,156,96,.20); }
.sb-cycle-dossier--brass .sb-cycle-hero,
.sb-cycle-dossier--brass .sb-cycle-shell,
.sb-cycle-dossier--brass .sb-cycle-callout,
.sb-cycle-dossier--brass .sb-cycle-module,
.sb-cycle-dossier--brass .sb-cycle-metric-card,
.sb-cycle-dossier--brass .sb-cycle-module-block,
.sb-cycle-dossier--brass .sb-cycle-annex-note{ border-color: rgba(176,122,224,.20); }
.sb-cycle-dossier--water .sb-cycle-hero,
.sb-cycle-dossier--water .sb-cycle-shell,
.sb-cycle-dossier--water .sb-cycle-callout,
.sb-cycle-dossier--water .sb-cycle-module,
.sb-cycle-dossier--water .sb-cycle-metric-card,
.sb-cycle-dossier--water .sb-cycle-module-block,
.sb-cycle-dossier--water .sb-cycle-annex-note{ border-color: rgba(96,176,220,.20); }
.sb-cycle-dossier--code .sb-cycle-hero,
.sb-cycle-dossier--code .sb-cycle-shell,
.sb-cycle-dossier--code .sb-cycle-callout,
.sb-cycle-dossier--code .sb-cycle-module,
.sb-cycle-dossier--code .sb-cycle-metric-card,
.sb-cycle-dossier--code .sb-cycle-module-block,
.sb-cycle-dossier--code .sb-cycle-annex-note{ border-color: rgba(208,222,255,.20); }
.sb-cycle-kicker,
.sb-cycle-module-kicker,
.sb-cycle-callout-k,
.sb-cycle-module-label,
.sb-cycle-annex-note-k,
.sb-cycle-metric-k{
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(223,212,193,.62);
}
.sb-cycle-head,
.sb-cycle-module-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.sb-cycle-title,
.sb-cycle-module-title{
  margin-top:4px;
  font-size:24px;
  line-height:1.06;
  font-weight:900;
  color:rgba(247,241,232,.98);
}
.sb-cycle-tagline{
  margin-top:8px;
  font-size:13px;
  line-height:1.4;
  font-weight:800;
  color:rgba(237,228,211,.88);
}
.sb-cycle-summary,
.sb-cycle-callout-v,
.sb-cycle-module-sub,
.sb-cycle-annex-note-v,
.sb-cycle-metric-note,
.sb-cycle-feed-copy,
.sb-cycle-protocol-copy{
  color:rgba(224,226,235,.78);
  line-height:1.6;
}
.sb-cycle-summary{ margin:12px 0 0; font-size:13px; }
.sb-cycle-sigil,
.sb-cycle-module-sigil{
  flex:0 0 auto;
  width:54px;
  height:54px;
  border-radius:999px;
  display:grid;
  place-items:center;
  border:1px solid var(--cycleEdge, rgba(255,255,255,.18));
  background:radial-gradient(circle at 30% 30%, rgba(255,255,255,.14), rgba(0,0,0,.28));
  color:rgba(248,241,232,.96);
  font-size:22px;
  box-shadow:0 0 0 10px color-mix(in srgb, var(--cycleGlow, rgba(255,255,255,.10)) 22%, transparent);
}
.sb-cycle-pills{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}
.sb-cycle-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 11px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.24);
  color:rgba(242,237,228,.90);
  font-size:12px;
}
.sb-cycle-pill b{ color:rgba(255,255,255,.98); }
.sb-cycle-pill--soft{ opacity:.86; }
.sb-cycle-note{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:rgba(225,227,234,.70);
  line-height:1.55;
}
.sb-cycle-shell{
  display:grid;
  gap:12px;
  padding:12px;
}
.sb-cycle-callout{
  padding:12px 13px;
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.16));
}
.sb-cycle-callout-v{ margin-top:6px; font-size:13px; }
.cycle-module-mount:empty{ display:none; }
.sb-cycle-module{ padding:12px; }
.sb-cycle-metrics-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.sb-cycle-metric-card{ padding:10px 11px; background:rgba(255,255,255,.03); }
.sb-cycle-metric-v{
  margin-top:5px;
  font-size:22px;
  line-height:1;
  font-weight:900;
  color:rgba(249,243,236,.98);
}
.sb-cycle-metric-note{ margin-top:7px; font-size:11px; }
.sb-cycle-module-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin-top:12px;
}
.sb-cycle-module-block{ padding:11px 12px; background:rgba(0,0,0,.16); }
.sb-cycle-feed{ display:grid; gap:8px; margin-top:10px; }
.sb-cycle-feed-line{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:10px;
  padding-bottom:8px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.sb-cycle-feed-line:last-child{ padding-bottom:0; border-bottom:none; }
.sb-cycle-feed-stamp{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:11px;
  color:rgba(243,231,205,.66);
}
.sb-cycle-feed-copy{ font-size:12px; }
.sb-cycle-protocol{
  list-style:none;
  margin:10px 0 0;
  padding:0;
  display:grid;
  gap:8px;
}
.sb-cycle-protocol-item{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:10px;
  align-items:start;
}
.sb-cycle-protocol-step{
  width:22px;
  height:22px;
  border-radius:999px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:rgba(248,241,232,.95);
  font-size:11px;
  font-weight:900;
}
.sb-cycle-protocol-copy{ font-size:12px; }
.sb-cycle-module-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.sb-cycle-mod-btn{
  border-color:rgba(255,255,255,.14) !important;
  background:rgba(255,255,255,.05) !important;
}
.sb-cycle-annex-note{
  margin-top:12px;
  padding:11px 12px;
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.18));
}
.sb-cycle-annex-note-v{ margin-top:6px; font-size:12px; }
.hidden{ display:none !important; }
@media (max-width: 760px){
  .sb-cycle-head,
  .sb-cycle-module-head{ flex-direction:column; }
  .sb-cycle-metrics-grid,
  .sb-cycle-module-grid{ grid-template-columns:1fr; }
}
html[data-theme="light"] .sb-cycle-hero,
html[data-theme="light"] .sb-cycle-shell,
html[data-theme="light"] .sb-cycle-callout,
html[data-theme="light"] .sb-cycle-module,
html[data-theme="light"] .sb-cycle-metric-card,
html[data-theme="light"] .sb-cycle-module-block,
html[data-theme="light"] .sb-cycle-annex-note{
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,247,252,.94)) !important;
  border-color:rgba(52,77,118,.14) !important;
  box-shadow:0 18px 44px rgba(57,83,121,.10), inset 0 1px 0 rgba(255,255,255,.84) !important;
}
html[data-theme="light"] .sb-cycle-title,
html[data-theme="light"] .sb-cycle-module-title,
html[data-theme="light"] .sb-cycle-tagline,
html[data-theme="light"] .sb-cycle-pill,
html[data-theme="light"] .sb-cycle-pill b,
html[data-theme="light"] .sb-cycle-sigil,
html[data-theme="light"] .sb-cycle-module-sigil,
html[data-theme="light"] .sb-cycle-metric-v,
html[data-theme="light"] .sb-cycle-feed-stamp,
html[data-theme="light"] .sb-cycle-protocol-step{
  color:#162031 !important;
}
html[data-theme="light"] .sb-cycle-kicker,
html[data-theme="light"] .sb-cycle-module-kicker,
html[data-theme="light"] .sb-cycle-callout-k,
html[data-theme="light"] .sb-cycle-module-label,
html[data-theme="light"] .sb-cycle-annex-note-k,
html[data-theme="light"] .sb-cycle-metric-k,
html[data-theme="light"] .sb-cycle-summary,
html[data-theme="light"] .sb-cycle-callout-v,
html[data-theme="light"] .sb-cycle-module-sub,
html[data-theme="light"] .sb-cycle-annex-note-v,
html[data-theme="light"] .sb-cycle-metric-note,
html[data-theme="light"] .sb-cycle-feed-copy,
html[data-theme="light"] .sb-cycle-protocol-copy,
html[data-theme="light"] .sb-cycle-note{
  color:rgba(22,32,49,.72) !important;
}
html[data-theme="light"] .sb-cycle-pill,
html[data-theme="light"] .sb-cycle-protocol-step,
html[data-theme="light"] .sb-cycle-sigil,
html[data-theme="light"] .sb-cycle-module-sigil{
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(238,243,249,.94)) !important;
  border-color:rgba(52,77,118,.16) !important;
}
