/* Optional, browser-local Halloween palette. Status and risk colors keep their meaning. */
.halloween-season { display: none; }
.halloween-icon, .sidebar .nav-icon .halloween-icon { display: none; }
body[data-theme="halloween"] .halloween-icon { display: inline-block; width: 24px; height: 24px; flex: 0 0 auto; }
body[data-theme="halloween"] .sidebar .nav-icon:has(.halloween-icon) > svg:not(.halloween-icon) { display: none; }
body[data-theme="halloween"] .sidebar .nav-icon .halloween-icon { display: block; width: 21px; height: 21px; }
body[data-theme="halloween"] .halloween-icon-pumpkin,
body[data-theme="halloween"] .halloween-icon-candle { color: #ffb46c; }
body[data-theme="halloween"] .halloween-icon-ghost,
body[data-theme="halloween"] .halloween-icon-eye { color: #d5b3ed; }
body[data-theme="halloween"] .halloween-icon-moon { color: #ffd49a; }
body[data-theme="halloween"] .halloween-icon-bat { color: #dda6c6; }
body[data-theme="halloween"] .halloween-icon-sparkles,
body[data-theme="halloween"] .halloween-icon-wand { color: #c6cfa0; }
body[data-theme="halloween"] .nav-icon > svg { transition: transform .18s ease; }
body[data-theme="halloween"] .nav a:hover .nav-icon > svg { transform: translateY(-1px) rotate(-7deg); }
body[data-theme="halloween"] .empty > .halloween-icon { width: 38px; height: 38px; margin-bottom: 4px; opacity: .8; }
.halloween-choice-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.halloween-choice-icons, .halloween-charms { display: flex; align-items: center; gap: 12px; }
.halloween-choice-icons .halloween-icon { display: block; width: 18px; height: 18px; color: #ffbd6d; }
.halloween-choice-icons .halloween-icon-ghost { color: #d5b3ed; }
.halloween-choice-icons .halloween-icon-moon { color: #ffd49a; }
.halloween-charms { margin-left: auto; }
body[data-theme="halloween"] .halloween-season {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 16px;
  border: 1px solid #602749;
  border-radius: 14px;
  background: linear-gradient(100deg, #3e1c33, #211020 65%);
  pointer-events: none;
}
.halloween-season > img { flex: 0 0 auto; }
.halloween-season > span { display: grid; gap: 3px; }
.halloween-season strong { color: #ffd49a; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.halloween-season small { color: #dbc9d6; font-size: 12px; }
.halloween-season .halloween-bats { margin-left: 12px; width: 180px; height: 52px; }
.halloween-brand-icon, .brand .halloween-brand-label { display: none; }
body[data-theme="halloween"] .sidebar .sidebar-brand-row {
  padding: 2px 2px 14px;
  gap: 8px;
  border-bottom: 1px solid #4b2a426b;
}
body[data-theme="halloween"] .sidebar .brand {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
}
body[data-theme="halloween"] .sidebar .brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid #9b5b3e;
  border-radius: 14px;
  background: linear-gradient(145deg, #4b2736, #261326);
  box-shadow: inset 0 1px 0 #ffce8b15;
}
body[data-theme="halloween"] .brand-icon { display: none; }
body[data-theme="halloween"] .halloween-brand-icon { display: block; width: 38px; height: 38px; }
body[data-theme="halloween"] .sidebar .brand-copy strong { color: #fff5ec; font-size: 19px; line-height: 1.2; letter-spacing: -.6px; }
body[data-theme="halloween"] .brand-copy strong > span { color: #ffbd6d; }
body[data-theme="halloween"] .brand-copy > small:not(.halloween-brand-label) { display: none; }
body[data-theme="halloween"] .sidebar .halloween-brand-label { display: block; margin-top: 5px; color: #c99bb9; font-size: 8px; font-weight: 650; line-height: 1.2; letter-spacing: .1em; text-transform: uppercase; }
body[data-theme="halloween"] .sidebar .sidebar-collapse-btn {
  width: 26px;
  height: 30px;
  border: 1px solid #69415c;
  border-radius: 9px;
  background: transparent;
  color: #d5b3ed;
}
body[data-theme="halloween"] .sidebar .sidebar-collapse-btn:hover { border-color: #f6921d; background: #3e1c33; color: #ffd49a; }
@media (min-width: 1121px) {
  body[data-theme="halloween"] .app.sidebar-collapsed .sidebar-brand-row { padding: 0 0 12px; }
  body[data-theme="halloween"] .app.sidebar-collapsed .brand { display: flex; }
  body[data-theme="halloween"] .app.sidebar-collapsed .brand-mark { width: 40px; height: 40px; }
}
@media (max-width: 760px) {
  body[data-theme="halloween"] .sidebar .sidebar-brand-row { padding: 0; border-bottom: 0; }
  body[data-theme="halloween"] .sidebar .brand { grid-template-columns: 38px minmax(0, 1fr); gap: 9px; }
  body[data-theme="halloween"] .sidebar .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  body[data-theme="halloween"] .halloween-brand-icon { width: 32px; height: 32px; }
  body[data-theme="halloween"] .sidebar .brand-copy strong { font-size: 17px; }
  body[data-theme="halloween"] .sidebar .halloween-brand-label { font-size: 7px; letter-spacing: .04em; }
}
@media (max-width: 600px) {
  body[data-theme="halloween"] .halloween-season { padding: 10px 12px; gap: 9px; }
  .halloween-season .halloween-bats { display: none; }
  .halloween-charms { gap: 8px; }
  body[data-theme="halloween"] .halloween-charms .halloween-icon { width: 20px; height: 20px; }
  body[data-theme="halloween"] .halloween-charms .halloween-icon-sparkles { display: none; }
  .halloween-season strong { font-size: 10px; letter-spacing: .04em; }
  .halloween-season small { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme="halloween"] .nav-icon > svg { transition: none; }
  body[data-theme="halloween"] .nav a:hover .nav-icon > svg { transform: none; }
}
.theme-settings .section-head { margin-bottom: 0; }
.theme-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-choice { display: grid; gap: 5px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-3); color: var(--text); text-align: left; }
.theme-choice[aria-pressed="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.theme-choice:focus-visible { outline: 2px solid #f6921d; outline-offset: 3px; }
.theme-choice strong { font-size: 14px; }
.theme-choice small { color: var(--muted); }
.theme-swatches { display: flex; height: 22px; overflow: hidden; border: 1px solid #ffffff38; border-radius: 6px; }
.theme-swatches i { flex: 1; }
.theme-swatches-default i:nth-child(1) { background: #121212; }
.theme-swatches-default i:nth-child(2) { background: #191919; }
.theme-swatches-default i:nth-child(3) { background: #323232; }
.theme-swatches-default i:nth-child(4) { background: #b73b2f; }
.theme-swatches-default i:nth-child(5) { background: #d85b4f; }
.theme-swatches-halloween i:nth-child(1) { background: #130912; }
.theme-swatches-halloween i:nth-child(2) { background: #3e1c33; }
.theme-swatches-halloween i:nth-child(3) { background: #602749; }
.theme-swatches-halloween i:nth-child(4) { background: #b14623; }
.theme-swatches-halloween i:nth-child(5) { background: #f6921d; }
@media (max-width: 600px) { .theme-choices { grid-template-columns: 1fr; } }

body[data-theme="halloween"] {
  --bg: #130912;
  --panel: #211020;
  --panel-2: #b14623;
  --panel-3: #2b1529;
  --surface-1: #2b1529;
  --surface-2: #1c0d1b;
  --surface-3: #3e1c33;
  --surface-4: #602749;
  --line: #69415c;
  --soft-line: #4b2a42;
  --text: #fff5ec;
  --muted: #dbc9d6;
  --faint: #b79aa9;
  --cyan: #f6921d;
  --orange: #f6921d;
  --red: #f6921d;
  --shadow: 0 10px 28px #0d040c70;
  background: radial-gradient(circle at 90% 0%, #60274955, transparent 36%), #130912;
}
body[data-theme="halloween"] .sidebar { border-color: #602749; background: #1b0d1a; }
body[data-theme="halloween"] .brand,
body[data-theme="halloween"] .access-card,
body[data-theme="halloween"] .sidebar-collapse-btn,
body[data-theme="halloween"] .nav-icon { border-color: #4b2a42; background: #2b1529; }
body[data-theme="halloween"] .nav-section-label { color: #c99bb9; }
body[data-theme="halloween"] .nav a:hover { border-color: #602749; background: #3e1c33; }
body[data-theme="halloween"] .nav a.active { border-color: #b14623; background: #3e1c33; color: #fff5ec; }
body[data-theme="halloween"] .nav a.active .nav-icon { border-color: #f6921d; background: #602749; color: #ffd49a; }
body[data-theme="halloween"] .nav a.active::before { background: #f6921d; }
body[data-theme="halloween"] .nav-unread-count { background: #b14623; }
body[data-theme="halloween"] .site-announcement-banner { border-color: #b14623; border-left-color: #f6921d; background: #35192b; }
body[data-theme="halloween"] .detail,
body[data-theme="halloween"] .check-row,
body[data-theme="halloween"] .item,
body[data-theme="halloween"] .info-strip,
body[data-theme="halloween"] .table-wrap { border-color: #4b2a42; background: #2b1529; }
body[data-theme="halloween"] .tabs button { border-color: #69415c; background: #3e1c33; color: #fff5ec; }
body[data-theme="halloween"] .tabs button.active { border-color: #f6921d; background: #b14623; color: #fff8f0; }
body[data-theme="halloween"] .btn { border-color: #b14623; background: #b14623; color: #fff8f0; }
body[data-theme="halloween"] .btn-secondary { border-color: #69415c; background: #3e1c33; color: #fff5ec; }
body[data-theme="halloween"] .btn-ghost { border-color: #69415c; color: #fff5ec; }
body[data-theme="halloween"] .btn:hover,
body[data-theme="halloween"] .btn-secondary:hover { border-color: #f6921d; }
body[data-theme="halloween"] input:not([type="checkbox"]):not([type="radio"]),
body[data-theme="halloween"] select,
body[data-theme="halloween"] textarea { border-color: #69415c; background: #190c18; color: #fff5ec; }
body[data-theme="halloween"] input:focus-visible,
body[data-theme="halloween"] select:focus-visible,
body[data-theme="halloween"] textarea:focus-visible,
body[data-theme="halloween"] button:focus-visible,
body[data-theme="halloween"] a:focus-visible { outline-color: #f6921d; }
body[data-theme="halloween"] input[type="checkbox"],
body[data-theme="halloween"] input[type="radio"],
body[data-theme="halloween"] input[type="range"] { accent-color: #f6921d; }
body[data-theme="halloween"] .case-cockpit-hero { border-color: #602749; background: linear-gradient(115deg, #3e1c33, #211020 58%, #b1462333); }
body[data-theme="halloween"] .case-cockpit,
body[data-theme="halloween"] .case-cockpit-workspace { border-color: #602749; background: #211020; }
body[data-theme="halloween"] .case-cockpit-scope,
body[data-theme="halloween"] .case-record-summary { border-color: #4b2a42; background: #1b0d1a; }
body[data-theme="halloween"] .case-record-summary-item,
body[data-theme="halloween"] .case-cockpit-nav-item,
body[data-theme="halloween"] .case-cockpit-context-card { border-color: #4b2a42; background: #2b1529; }
body[data-theme="halloween"] .case-cockpit-nav-item.active,
body[data-theme="halloween"] .case-cockpit-menu-item.active { border-color: #b14623; background: #602749; }
body[data-theme="halloween"] .case-cockpit-nav-code { background: #3e1c33; color: #dbc9d6; }
body[data-theme="halloween"] .case-cockpit-nav-item.active .case-cockpit-nav-code { background: #b14623; color: #fff8f0; }
body[data-theme="halloween"] .case-cockpit-navigation,
body[data-theme="halloween"] .case-cockpit-context,
body[data-theme="halloween"] .case-cockpit-mobile-switcher { background: #1b0d1a; }
body[data-theme="halloween"] .case-record-next { border-color: #b14623; background: #3e1c33; }
body[data-theme="halloween"] .case-record-next > strong { color: #ffcc88; }
body[data-theme="halloween"] .case-view-options button[aria-pressed="true"] { background: #b14623; color: #fff8f0; }
body[data-theme="halloween"] .video-extractor-surface,
body[data-theme="halloween"] .video-frame-card,
body[data-theme="halloween"] .registry-video-promo { border-color: #602749; background: #2b1529; }

/* Case queues have legacy fixed colors that otherwise clash with the optional theme. */
body[data-theme="halloween"] .research-tools { border-color: #69415c; background: #2b1529; }
body[data-theme="halloween"] .research-tools p { color: #dbc9d6; }
body[data-theme="halloween"] .toolbar-command { border-color: #69415c; background: #2b1529; }
body[data-theme="halloween"] .info-strip-command { border-color: #69415c; background: #3e1c33; }
body[data-theme="halloween"] .simple-stat { border-color: #4b2a42; background: #211020; }
body[data-theme="halloween"] .casework-panel { border-color: #4b2a42; background: #211020; }
body[data-theme="halloween"] .queue-tabs button { border-color: #69415c; background: #2b1529; color: #dbc9d6; }
body[data-theme="halloween"] .queue-tabs button span { color: #b79aa9; }
body[data-theme="halloween"] .queue-tabs button.active { border-color: #b14623; background: #602749; color: #fff5ec; }
body[data-theme="halloween"] .queue-tabs button.active span { color: #ffd49a; }
body[data-theme="halloween"] .empty { border-color: #69415c; background: #1b0d1a; }

/* Tables and mobile case cards should not fall back to the classic gray surfaces. */
body[data-theme="halloween"] .table-wrap { border-color: #69415c; background: #211020; }
body[data-theme="halloween"] .table-wrap thead { background: #3e1c33; }
body[data-theme="halloween"] .table-wrap th { color: #ffd49a; }
body[data-theme="halloween"] .table-wrap th,
body[data-theme="halloween"] .table-wrap td { border-bottom-color: #4b2a42; }
body[data-theme="halloween"] .table-wrap tbody tr { background: #241223; }
body[data-theme="halloween"] .table-wrap tbody tr:nth-child(even) { background: #2d172b; }
body[data-theme="halloween"] .table-wrap tbody tr:hover { background: #3e1c33; }
body[data-theme="halloween"] .archive-case-table { border-top-color: #b14623; }
body[data-theme="halloween"] .archive-case-table tbody td:first-child { box-shadow: inset 3px 0 #b14623; }
body[data-theme="halloween"] .archive-case-table tbody td:first-child strong { color: #ffbd6d; }
body[data-theme="halloween"] .mobile-queue-card { border-color: #69415c; background: #241223; }
body[data-theme="halloween"] .mobile-queue-fact,
body[data-theme="halloween"] .case-row-meta span { border-color: #4b2a42; background: #3e1c33; }
