:root {
  color-scheme: dark;
  --bg: #0b0b0c; --bg-2: #08080a; --bg-1: #101012;
  --panel: #141416; --panel-2: #1b1b1e;
  --line: rgba(255,255,255,.085); --text: #ededef; --ink: #ededef;
  --muted: #8e8e96; --accent: #ededef; --accent-2: #c5c5cb;
  --good: #86cba4; --warn: #d9ba72; --bad: #d78298;
}
html, body { background: var(--bg-2) !important; color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.bg-wallpaper, .bg-wallpaper-overlay { display: none !important; }
.hidden, [hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; }
button, .btn, .tb-btn, input, select, textarea { border-radius: 8px; }
.btn, .tb-btn { box-shadow: none !important; background: var(--panel); border-color: var(--line); color: var(--text); }
.btn.primary { color: #101012 !important; background: #ededef !important; border-color: #ededef !important; box-shadow: none !important; }
.btn.primary:hover { background: #d5d5da !important; }
.card, .profile-card { background: var(--panel); border-color: var(--line); border-radius: 12px; box-shadow: none !important; }
.step-num { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); box-shadow: none !important; }
.saved-prompts, .lb-refs, .lb-refs-panel { background: var(--panel) !important; box-shadow: none !important; }
.step-head h2 { font-size: 15px; font-weight: 600; }
.pill, .badge, .caption, .field > span { font-size: 11px; }
.badge { display: none; }
.topbar { background: var(--bg) !important; border-color: var(--line); box-shadow: none !important; }
.dot { background: var(--text); box-shadow: none; }
body.haunt-shell { margin: 10px 10px 10px 248px !important; padding: 0 !important; width: calc(100% - 258px); min-height: calc(100vh - 20px); height: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--bg) !important; overflow: visible; }
.haunt-shell > .topbar { display: none; }
.haunt-sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 238px; padding: 18px 12px 12px; display: flex; flex-direction: column; background: var(--bg-2); z-index: 100; }
.haunt-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 26px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 15px; }
.haunt-brand svg { width: 19px; height: 19px; }
.haunt-nav { overflow-y: auto; overflow-x: visible; flex: 1; scrollbar-width: thin; scrollbar-gutter: stable; padding-right: 16px; }
.haunt-nav-label { font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; color: #6d6d75; letter-spacing: .05em; margin: 23px 10px 8px; }
.haunt-nav a, .haunt-nav > button, .haunt-nav .tb-btn { display: flex; align-items: center; gap: 10px; width: 100%; height: 31px; text-align: left; padding: 0 12px; border: 0; background: transparent; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 400; cursor: pointer; border-radius: 6px; }
.haunt-nav a:hover, .haunt-nav button:hover { background: var(--panel); color: var(--text); }
.haunt-nav a.active { background: #1b1b1e; color: var(--text); box-shadow: inset 2px 0 var(--text); }
.haunt-nav svg { width: 14px; height: 14px; opacity: .75; flex-shrink: 0; }
.haunt-footer { border-top: 1px solid var(--line); padding: 14px 8px 2px; color: var(--muted); font: 11px ui-monospace, SFMono-Regular, monospace; }
.haunt-footer strong { color: var(--text); font: 600 13px -apple-system, sans-serif; }
.haunt-toolbar { display: flex; justify-content: flex-end; gap: 8px; align-items: center; min-height: 48px; padding: 8px 32px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.haunt-toolbar .pill { background: transparent; border-color: var(--line); }
.haunt-overview { padding: 30px 40px 40px; }
.haunt-pagehead { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 25px; }
.haunt-pagehead h1 { font-size: 27px; letter-spacing: -.04em; margin: 0 0 8px; font-weight: 650; }
.haunt-pagehead p { color: var(--muted); margin: 0; font-size: 13px; }
.haunt-pagehead .btn { padding: 9px 15px; text-decoration: none; white-space: nowrap; }
.haunt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 28px; }
.haunt-stat { padding: 16px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.haunt-stat span { display: block; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; margin-bottom: 9px; }
.haunt-stat strong { font: 24px ui-monospace, SFMono-Regular, Menlo, monospace; }
.haunt-sectionhead { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 14px; }
.haunt-sectionhead h2 { font-size: 15px; margin: 0; font-weight: 600; }
.haunt-sectionhead a { color: var(--muted); font-size: 12px; text-decoration: none; }
.haunt-faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.haunt-face { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s; }
.haunt-face:hover { border-color: #676770; transform: translateY(-2px); }
.haunt-face img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; }
.haunt-face div { padding: 11px 12px; font-size: 12px; }
.haunt-face small { color: var(--muted); display: block; margin-top: 5px; font-size: 10px; }
.haunt-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.haunt-tool { padding: 17px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); }
.haunt-tool:hover { background: var(--panel-2); }
.haunt-tool strong { font-size: 13px; font-weight: 550; }
.haunt-tool p { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 8px 0 0; }
.haunt-note { color: var(--muted); font-size: 12px; padding: 20px 0 0; }
.haunt-empty { color: var(--muted); font-size: 13px; padding: 20px; border: 1px dashed var(--line); border-radius: 12px; }
.haunt-shell .layout { display: block; max-width: 1150px; margin: 0 auto !important; padding: 28px 32px; }
.haunt-shell .content { gap: 16px; }
.haunt-shell .layout .card { padding: 20px; }
.haunt-shell .picker-row > .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.haunt-shell .picker-row > .grid .tile { min-width: 0; }
.haunt-shell .reframe-row, .haunt-shell .enlarge-prompt-row > div { flex-wrap: wrap; }
.haunt-shell .generation-status { flex-wrap: wrap; }
.haunt-shell.overview-mode > .layout { display: none; }
.haunt-shell.workflow-mode .haunt-overview { display: none; }
.haunt-shell .open-tabs-sidebar { position: static !important; width: 100%; padding: 12px 0; border: 0; background: transparent; max-height: none; transform: none !important; opacity: 1 !important; pointer-events: auto; }
.haunt-shell .open-tabs-sidebar.empty, .haunt-shell #open-tabs-handle, .haunt-shell #open-tabs-collapse { display: none !important; }
.haunt-nav .tb-menu { position: fixed; left: 244px !important; top: 72px !important; right: auto !important; max-height: 75vh; overflow: auto; background: var(--panel); border-color: var(--line); box-shadow: 0 15px 60px #0009; z-index: 120; }
.haunt-nav .tb-menu a { height: auto; min-height: 31px; }
.haunt-shell .nbp-bar { background: var(--bg) !important; border-radius: 14px 14px 0 0; padding: 20px 26px; }
.haunt-shell .nbp-frame { width: 100%; height: calc(100vh - 114px); flex: none; background: var(--bg); border-radius: 0 0 14px 14px; }
/* Embedded tool pages reserve the actual header height, including wrapping. */
body.haunt-shell:has(> .nbp-frame) { height: calc(100dvh - 20px); min-height: 0; }
.haunt-shell:has(> .nbp-frame) .nbp-bar { flex-shrink: 0; flex-wrap: wrap; }
.haunt-shell:has(> .nbp-frame) > .nbp-frame { flex: 1; height: auto; min-height: 0; }
.haunt-shell .profiles-page { margin: 28px auto; padding: 0 32px; }
.haunt-mobile-toggle { display: none; }
:focus-visible { outline: 2px solid #8ba4b6; outline-offset: 3px; }
@media (max-width: 1050px) { .haunt-faces { grid-template-columns: repeat(3, 1fr); } .haunt-tools { grid-template-columns: repeat(2, 1fr); } .haunt-overview { padding: 25px; } }
@media (max-width: 760px) {
  body.haunt-shell { margin: 56px 8px 8px !important; width: calc(100% - 16px); min-height: calc(100vh - 64px); }
  body.haunt-shell:has(> .nbp-frame) { height: calc(100dvh - 64px); min-height: 0; }
  .haunt-sidebar { transform: translateX(-100%); transition: transform .2s; border-right: 1px solid var(--line); }
  .haunt-shell.nav-open .haunt-sidebar { transform: none; box-shadow: 50px 0 80px #000a; }
  .haunt-mobile-toggle { display: block; position: fixed; top: 12px; left: 12px; z-index: 110; padding: 8px 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
  .haunt-stats { grid-template-columns: repeat(2, 1fr); } .haunt-faces { grid-template-columns: repeat(2, 1fr); }
  .haunt-tools { grid-template-columns: 1fr; } .haunt-overview, .haunt-shell .layout { padding: 20px; }
  .haunt-pagehead { align-items: flex-start; flex-direction: column; } .haunt-toolbar { padding: 8px 16px; }
  .haunt-shell .layout { padding: 12px; }
  .haunt-shell .layout .card { padding: 14px; }
  .haunt-nav .tb-menu { left: 10px !important; min-width: 280px !important; max-width: calc(100vw - 20px) !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.generation-status { display: flex; align-items: center; gap: 9px; padding: 12px 14px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 9px; background: #18181b; color: var(--muted); font-size: 12px; }
.generation-status .btn { margin-left: auto; }
.generation-status-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--good); }
.generation-status-dot.active { background: var(--text); animation: generation-breathe 1.8s ease-in-out infinite; }
.tile.pending-tile, .tile.pending-tile:hover { background: radial-gradient(ellipse at 50% 35%, #222228, #121214 75%); border: 1px solid #303036; }
.tile.pending-tile .tag { background: #25252b; color: #b0b0ba; }
.tile.pending-tile .pending-body { gap: 13px; color: var(--text); }
.pending-label { font-size: 13px; font-weight: 500; letter-spacing: 0; }
.pending-elapsed { color: var(--muted); font: 11px ui-monospace, SFMono-Regular, monospace; line-height: 1.6; max-width: 100%; min-height: 0; overflow-y: auto; overflow-wrap: anywhere; }
.generation-orbit { width: 42px; height: 42px; flex: none; border: 1px solid #36363e; border-radius: 13px; display: grid; place-items: center; transform: rotate(-8deg); margin-bottom: 8px; }
.generation-orbit span { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #41414a; border-top-color: #e6e6ec; animation: generation-spin 1.3s linear infinite; }
.generation-sweep { height: 2px; width: 80px; overflow: hidden; margin-top: 8px; background: #303036; border-radius: 2px; }
.generation-sweep span { display: block; height: 100%; width: 35%; background: #ccccd5; animation: generation-sweep 1.8s ease-in-out infinite; }
.pending-tile[data-state="failed"] .generation-orbit span, .pending-tile[data-state="cancelled"] .generation-orbit span { animation: none; border-color: var(--bad); }
@keyframes generation-spin { to { transform: rotate(360deg); } }
@keyframes generation-sweep { from { transform: translateX(-110%); } to { transform: translateX(310%); } }
@keyframes generation-breathe { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .generation-orbit span, .generation-sweep span, .generation-status-dot.active { animation: none; } }
