:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #1b1b1b;
  --panel-2: #242424;
  --line: #3a3a3a;
  --text: #f2f2f2;
  --muted: #aeaeae;
  --accent: #ff995e;
  --accent-2: #e0e0e0;
  --danger: #ff995e;
  accent-color: var(--accent);
  --chat-dock-width: 360px;
  --chat-mobile-height: 248px;
  --chat-lines: calc(7 * 1.45em);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: #161616;
}

.eyebrow,
.result-count,
.query-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  margin: 2px 0 0;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: 0;
}

.stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.stat {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  color: var(--text);
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(330px, 0.95fr) minmax(390px, 1.2fr);
  height: calc(100vh - 92px);
}

.filters,
.results-panel,
.detail-panel,
.chat-panel {
  min-height: 0;
  overflow: auto;
}

.filters {
  border-right: 1px solid var(--line);
  padding: 20px;
  background: #171717;
}

.search-label,
.filter-group span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

input,
select {
  min-width: 0;
  width: 100%;
  color: var(--text);
  background: #111111;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
}

button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-2);
  border-radius: 6px;
  padding: 9px 11px;
}

button:hover {
  border-color: #5e5e5e;
}

.filter-group {
  display: block;
  margin-top: 22px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.segmented button.active {
  color: #0f0f0f;
  border-color: var(--accent);
  background: var(--accent);
}

.issues {
  margin-top: 24px;
}

.issues button {
  width: 100%;
}

#issues {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.results-panel {
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.results-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.97);
}

.pager {
  display: flex;
  gap: 8px;
}

.pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.results {
  padding: 12px;
}

.record-card {
  width: 100%;
  display: block;
  text-align: left;
  margin: 0 0 10px;
  padding: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.record-card.active {
  border-color: var(--accent);
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.record-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kind {
  color: #0f0f0f;
  background: var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
}

.kind.video {
  background: var(--accent-2);
}

.kind.image {
  background: #bdbdbd;
}

.new-flag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid #686868;
  border-radius: 4px;
  background: #242424;
  color: #ff995e;
  font-size: 11px;
  font-weight: 800;
}

.meta {
  color: var(--muted);
  font-size: 12px;
}

.record-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.snippet,
.blurb {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

mark {
  color: #111111;
  background: var(--accent-2);
  padding: 0 2px;
}

.detail-panel {
  background: #141414;
}

.chat-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: var(--chat-dock-width);
  max-height: calc(100vh - 92px);
  display: grid;
  grid-template-rows: auto auto auto;
  background: #171717;
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 28px rgba(0, 0, 0, 0.28);
}

.chat-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-head h2 {
  margin: 2px 0 0;
  font-size: 16px;
  letter-spacing: 0;
}

.chat-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.chat-status.ready {
  color: #0f0f0f;
  border-color: var(--accent);
  background: var(--accent);
}

.chat-status.missing {
  color: #0e0e0e;
  border-color: var(--danger);
  background: var(--danger);
}

.chat-collapse {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: #0f0f0f;
  border-color: var(--accent);
  background: var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

.chat-panel.collapsed {
  width: 68px;
  height: 68px;
  min-height: 68px;
  max-height: 68px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-panel.collapsed .chat-head {
  width: 68px;
  height: 68px;
  min-height: 68px;
  padding: 0;
  border: 0;
  background: transparent;
}

.chat-panel.collapsed .chat-head > div:first-child,
.chat-panel.collapsed .chat-status,
.chat-panel.collapsed .chat-messages,
.chat-panel.collapsed .chat-form {
  display: none;
}

.chat-panel.collapsed .chat-head-actions {
  width: 100%;
  height: 100%;
}

.chat-panel.collapsed .chat-collapse {
  width: 58px;
  height: 58px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
}

.chat-messages {
  min-height: 0;
  max-height: calc(var(--chat-lines) + 28px);
  overflow: auto;
  padding: 10px;
  overscroll-behavior: contain;
}

.chat-message {
  margin: 0 0 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-message.user {
  margin-left: 16px;
  border-color: #4e4e4e;
  background: #212121;
}

.chat-message.assistant {
  margin-right: 16px;
}

.chat-message.error {
  color: #dfdfdf;
  border-color: var(--danger);
}

.chat-sources {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chat-sources a {
  color: var(--accent);
  text-decoration: none;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
  height: 54px;
  max-height: 92px;
  color: var(--text);
  background: #111111;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  outline: none;
}

.chat-form textarea:focus {
  border-color: var(--accent);
}

.chat-form button {
  align-self: end;
  min-width: 72px;
  min-height: 44px;
}

.empty-detail {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.detail {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(280px, 48vh) auto;
}

.detail-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 8px 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.detail-actions a,
.detail-actions button {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 6px;
  padding: 9px 11px;
}

.detail-actions button {
  min-height: 0;
}

.detail-actions button:first-of-type {
  color: #0f0f0f;
  border-color: var(--accent);
  background: var(--accent);
}

.viewer {
  min-height: 280px;
  border-bottom: 1px solid var(--line);
  background: #0a0a0a;
}

.viewer iframe,
.viewer video,
.viewer img {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: contain;
}

.detail-text {
  padding: 18px 20px 28px;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.detail-text h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 15px;
}

.content-summary {
  padding: 18px 20px 32px;
  border-top: 1px solid var(--line);
  background: #171717;
}

.summary-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 14px;
}

.summary-head h3 {
  margin: 3px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.summary-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.summary-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.summary-meta div {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 9px 10px;
}

.summary-meta dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.summary-meta dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.summary-block {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 14px;
}

.summary-block h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
}

.summary-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.summary-search-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.ocr-block {
  padding: 0;
  overflow: hidden;
}

.ocr-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #1e1e1e;
}

.ocr-head h4 {
  margin: 0;
}

.ocr-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ocr-block .summary-search-note {
  padding: 10px 14px 0;
}

.ocr-text {
  max-height: 72vh;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #dddddd;
  background: #0f0f0f;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

.ocr-text mark {
  color: #111111;
  background: #ff995e;
  border-radius: 3px;
  padding: 0 2px;
}

.ocr-text .ocr-hit {
  outline: 2px solid var(--accent);
}

.error {
  margin: 14px;
  color: var(--danger);
}

.view-toggle {
  display: flex;
  gap: 8px;
  align-self: center;
}

.view-toggle button.active,
.graph-filters button.active {
  color: #0f0f0f;
  border-color: var(--accent);
  background: var(--accent);
}

.graph-shell {
  --graph-bg: #0d0d0d;
  --graph-panel: #181818;
  --graph-panel-2: #1f1f1f;
  --graph-line: rgba(174, 174, 174, 0.2);
  --graph-line-strong: rgba(192, 192, 192, 0.34);
  --graph-text: #f0f0f0;
  --graph-muted: #a5a5a5;
  --graph-accent: #cccccc;
  --graph-accent-soft: rgba(192, 192, 192, 0.14);
  --graph-signal: #ff995e;
  --graph-signal-soft: rgba(255, 153, 94, 0.14);
  --graph-dossier: #d0d0d0;
  display: grid;
  grid-template-columns: 282px minmax(560px, 1fr) 392px;
  height: calc(100vh - 92px);
  min-height: 0;
  background:
    radial-gradient(circle at top left, rgba(192, 192, 192, 0.06), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 153, 94, 0.05), transparent 24%),
    #0c0c0c;
}

.studio-shell {
  display: grid;
  grid-template-columns: 330px minmax(560px, 1fr);
  height: calc(100vh - 92px);
  min-height: 0;
}

.studio-sidebar,
.studio-main {
  min-height: 0;
  overflow: auto;
}

.studio-sidebar {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #171717;
}

.studio-main {
  background: #111111;
}

.studio-panel,
.studio-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.studio-panel {
  margin-bottom: 14px;
  padding: 14px;
}

.studio-panel h2,
.studio-panel h3,
.studio-section h3,
.studio-toolbar h2 {
  margin: 3px 0 0;
  letter-spacing: 0;
}

.studio-panel h2 {
  font-size: 19px;
}

.studio-panel h3,
.studio-section h3 {
  font-size: 16px;
}

.studio-muted {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.studio-panel-head,
.studio-section-head,
.studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.studio-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.97);
}

.studio-toolbar h2 {
  font-size: 22px;
}

.milestone-strip {
  display: grid;
  grid-template-columns: repeat(9, minmax(80px, 1fr));
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #141414;
}

.milestone {
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #1a1a1a;
  font-size: 12px;
}

.milestone.approved {
  color: #0f0f0f;
  border-color: var(--accent);
  background: var(--accent);
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 20px 28px;
}

.studio-section {
  min-width: 0;
  overflow: hidden;
}

.studio-section.wide {
  grid-column: 1 / -1;
}

.studio-section-head {
  min-height: 62px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #1e1e1e;
}

.studio-section-head .pager {
  flex-wrap: wrap;
  justify-content: end;
}

.studio-section-head button,
.studio-toolbar button,
.studio-panel button {
  min-height: 36px;
}

.episode-list,
.studio-cards,
.studio-output {
  padding: 12px;
}

.episode-card,
.story-card,
.asset-card {
  width: 100%;
  display: block;
  margin: 0 0 10px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #181818;
}

.episode-card.active,
.story-card.active {
  border-color: var(--accent);
}

.story-card h4,
.asset-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.story-card p,
.asset-card p,
.studio-output p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.studio-output pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #dddddd;
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.provider-status {
  margin: 0;
}

.provider-status div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.provider-status dt,
.provider-status dd {
  margin: 0;
  font-size: 13px;
}

.provider-status dt {
  color: var(--muted);
}

.provider-status dd.ready {
  color: var(--accent);
}

.provider-status dd.missing {
  color: var(--danger);
}

.studio-media {
  width: 100%;
  max-height: 220px;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #090909;
}

.graph-controls,
.graph-stage,
.graph-drawer {
  min-height: 0;
  overflow: auto;
}

.graph-controls {
  padding: 18px;
  border-right: 1px solid var(--graph-line);
  background:
    linear-gradient(180deg, rgba(17, 17, 17, 0.98), rgba(14, 14, 14, 0.96)),
    var(--graph-panel);
}

.graph-card {
  position: relative;
  border: 1px solid var(--graph-line);
  border-radius: 12px;
  padding: 15px 15px 16px;
  background:
    linear-gradient(180deg, rgba(30, 30, 30, 0.98), rgba(18, 18, 18, 0.98)),
    var(--graph-panel-2);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.graph-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px;
  opacity: 0.12;
  pointer-events: none;
}

.graph-card h2,
.graph-detail h2 {
  margin: 4px 0 10px;
  font-size: 22px;
  line-height: 1.2;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--graph-text);
}

.graph-card-note {
  margin: 0 0 12px;
  color: var(--graph-text);
  font-size: 14px;
  line-height: 1.48;
}

.board-disclaimer {
  margin: 0;
  color: var(--graph-signal);
  font-size: 13px;
  line-height: 1.45;
}

.graph-controls .filter-group span,
.graph-controls .search-label,
.graph-detail .eyebrow {
  color: var(--graph-muted);
}

.graph-controls input {
  color: var(--graph-text);
  background: rgba(12, 12, 12, 0.94);
  border-color: var(--graph-line);
}

.graph-controls input:focus {
  border-color: var(--graph-accent);
  box-shadow: 0 0 0 1px rgba(192, 192, 192, 0.22);
}

.graph-filters {
  display: grid;
  gap: 8px;
}

.graph-filters button {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  border-color: var(--graph-line);
  background:
    linear-gradient(180deg, rgba(28, 28, 28, 0.96), rgba(18, 18, 18, 0.96)),
    var(--graph-panel-2);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.graph-filters button:hover,
.graph-actions a:hover,
.graph-actions button:hover,
.connection-row:hover {
  transform: translateY(-1px);
  border-color: var(--graph-line-strong);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.graph-filters button.active {
  color: #0e0e0e;
  border-color: var(--graph-accent);
  background:
    linear-gradient(180deg, rgba(214, 214, 214, 0.98), rgba(182, 182, 182, 0.98)),
    var(--graph-accent);
}

.graph-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0 0;
}

.graph-stats div {
  border: 1px solid var(--graph-line);
  border-radius: 10px;
  padding: 11px 10px;
  background:
    linear-gradient(180deg, rgba(26, 26, 26, 0.96), rgba(15, 15, 15, 0.98)),
    var(--graph-panel);
}

.graph-stats dt {
  margin: 0 0 4px;
  color: var(--graph-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.graph-stats dd {
  margin: 0;
  font-size: 20px;
  font-weight: 760;
  color: var(--graph-text);
}

.graph-stage {
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at top, rgba(192, 192, 192, 0.04), transparent 24%),
    #0f0f0f;
}

.graph-toolbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--graph-line);
  background:
    linear-gradient(180deg, rgba(19, 19, 19, 0.98), rgba(14, 14, 14, 0.96)),
    var(--graph-panel);
  backdrop-filter: blur(8px);
}

.graph-toolbar button.active {
  color: #0f0f0f;
  border-color: var(--graph-signal);
  background: var(--graph-signal);
}

.graph-toolbar-copy {
  min-width: 0;
}

.graph-mode-label {
  margin: 0 0 2px;
  color: var(--graph-signal);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.graph-focus-title {
  margin: 0;
  color: var(--graph-text);
  font-size: 29px;
  line-height: 1;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.graph-toolbar .query-hint,
.graph-toolbar .result-count {
  color: var(--graph-muted);
}

.graph-toolbar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.graph-viewport {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(192, 192, 192, 0.05), transparent 34%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    #0c0c0c;
  background-size: auto, 44px 44px, 44px 44px;
}

.graph-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 55%, rgba(5, 5, 5, 0.44) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 20%, transparent 80%, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.graph-ambient {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 18px;
  max-width: 310px;
  padding: 13px 14px;
  border: 1px solid rgba(192, 192, 192, 0.16);
  border-radius: 12px;
  background: rgba(12, 12, 12, 0.72);
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.graph-ambient-copy {
  display: grid;
  gap: 4px;
}

.graph-ambient strong,
.graph-ambient span {
  display: block;
}

.graph-ambient strong {
  color: var(--graph-text);
  font-size: 20px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.graph-ambient span {
  color: var(--graph-muted);
  font-size: 13px;
  line-height: 1.45;
}

.graph-canvas {
  width: 100%;
  height: 100%;
  min-height: 460px;
  display: block;
  touch-action: none;
  cursor: grab;
}

.graph-canvas:active {
  cursor: grabbing;
}

.graph-tooltip {
  position: absolute;
  z-index: 3;
  max-width: min(320px, 80%);
  padding: 9px 10px;
  border: 1px solid rgba(192, 192, 192, 0.18);
  border-radius: 10px;
  background: rgba(14, 14, 14, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.graph-tooltip strong,
.graph-tooltip span {
  display: block;
}

.graph-tooltip strong {
  font-size: 13px;
  line-height: 1.25;
}

.graph-tooltip span {
  margin-top: 4px;
  color: var(--graph-muted);
  font-size: 12px;
}

.graph-svg {
  width: 100%;
  height: 100%;
  min-height: 460px;
  display: block;
  touch-action: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #101010;
  background-size: 44px 44px;
}

.graph-edge {
  stroke: rgba(164, 164, 164, 0.34);
  stroke-linecap: round;
  transition: stroke 180ms ease, stroke-width 180ms ease, opacity 180ms ease;
}

.edge-claim-match,
.edge-skeptical-context {
  stroke: rgba(255, 153, 94, 0.56);
}

.edge-mentions {
  stroke: rgba(192, 192, 192, 0.42);
}

.graph-edge.edge-focused {
  stroke: rgba(255, 153, 94, 0.94);
  opacity: 1;
}

.graph-node {
  cursor: pointer;
}

.graph-node circle {
  fill: #bdbdbd;
  stroke: #e4e4e4;
  stroke-width: 1.3;
  transition: stroke-width 180ms ease, filter 180ms ease, transform 180ms ease;
  filter: drop-shadow(0 0 0 rgba(192, 192, 192, 0));
}

.graph-node text {
  fill: var(--graph-text);
  font-size: 13px;
  paint-order: stroke;
  stroke: rgba(16, 16, 16, 0.82);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.node-claim circle {
  fill: var(--accent);
  stroke: #ffb385;
}

.node-topic circle {
  fill: #d7d7d7;
  stroke: #e8e8e8;
}

.node-record circle {
  fill: #bdbdbd;
}

.node-agency circle,
.node-release circle,
.node-source circle {
  fill: #939393;
  stroke: #d9d9d9;
}

.node-location circle,
.node-date circle {
  fill: #808080;
  stroke: #dddddd;
}

.graph-node:hover circle {
  stroke-width: 2.6;
  filter: drop-shadow(0 0 16px rgba(192, 192, 192, 0.28));
}

.graph-node.selected circle {
  stroke: #ff995e;
  stroke-width: 4.2;
  filter: drop-shadow(0 0 20px rgba(255, 153, 94, 0.4));
}

.globe-shell {
  --graph-bg: #0a0a0a;
  --graph-panel: #161616;
  --graph-panel-2: #1f1f1f;
  --graph-line: rgba(192, 192, 192, 0.22);
  --graph-accent: #cccccc;
  --graph-signal: #ff995e;
}

.globe-stage {
  background:
    radial-gradient(circle at 55% 42%, rgba(192, 192, 192, 0.08), transparent 26%),
    radial-gradient(circle at 65% 58%, rgba(255, 153, 94, 0.05), transparent 24%),
    #0a0a0a;
}

.globe-viewport {
  background:
    radial-gradient(circle at center, rgba(192, 192, 192, 0.08), transparent 31%),
    radial-gradient(circle at 65% 55%, rgba(255, 153, 94, 0.04), transparent 28%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #080808;
  background-size: auto, auto, 54px 54px, 54px 54px;
}

.globe-viewport::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(192, 192, 192, 0.1);
  border-radius: 999px;
  pointer-events: none;
}

.globe-canvas {
  min-height: 520px;
}

.globe-detail header p {
  margin: 10px 0 0;
  font-size: 13px;
}

.globe-controls select {
  color: var(--graph-text);
  background: rgba(12, 12, 12, 0.94);
  border-color: var(--graph-line);
}

.globe-controls select:focus {
  border-color: var(--graph-accent);
}

.graph-drawer {
  border-left: 1px solid var(--graph-line);
  background:
    linear-gradient(180deg, rgba(22, 22, 22, 0.99), rgba(16, 16, 16, 0.98)),
    var(--graph-panel);
}

.graph-detail {
  padding: 20px;
}

.graph-detail header {
  border-bottom: 1px solid var(--graph-line);
  padding-bottom: 16px;
}

.graph-detail header p,
.drawer-section p {
  color: var(--graph-muted);
  line-height: 1.5;
}

.drawer-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0;
  color: var(--graph-muted);
  font-size: 12px;
}

.evidence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #0f0f0f;
  background: var(--graph-signal);
  font-weight: 800;
  text-transform: uppercase;
}

.drawer-section {
  border-bottom: 1px solid var(--graph-line);
  padding: 15px 0;
}

.drawer-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--graph-dossier);
  letter-spacing: 0.08em;
}

.drawer-section blockquote {
  margin: 0 0 10px;
  padding: 12px 13px;
  border-left: 3px solid var(--graph-accent);
  border-radius: 0 10px 10px 0;
  background:
    linear-gradient(180deg, rgba(29, 29, 29, 0.96), rgba(19, 19, 19, 0.98)),
    var(--graph-panel-2);
  color: var(--graph-text);
  line-height: 1.55;
  font-size: 13px;
}

.connection-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
  text-align: left;
  border-radius: 10px;
  border-color: var(--graph-line);
  background:
    linear-gradient(180deg, rgba(26, 26, 26, 0.96), rgba(15, 15, 15, 0.98)),
    var(--graph-panel);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.connection-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-row small {
  color: var(--graph-muted);
}

.connection-row.compact {
  grid-template-columns: minmax(0, 1fr) 58px;
}

.connection-row-detailed {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.connection-row-detailed em {
  grid-column: 1 / -1;
  color: var(--graph-muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.38;
  white-space: normal;
}

.connection-row-detailed .connection-title {
  font-weight: 720;
}

.rationale {
  margin: 0 0 9px;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 280px 1fr;
    height: auto;
  }

  .graph-shell {
    grid-template-columns: 280px minmax(360px, 1fr);
    height: auto;
  }

  .detail-panel {
    grid-column: 1 / -1;
    min-height: 70vh;
    border-top: 1px solid var(--line);
  }

  .graph-drawer {
    grid-column: 1 / -1;
    min-height: 54vh;
    border-top: 1px solid var(--graph-line);
    border-left: 0;
  }

  .chat-panel {
    max-height: calc(100vh - 92px);
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 14px;
  }

  .view-toggle {
    width: 100%;
  }

  .view-toggle button {
    flex: 1;
  }

  h1 {
    font-size: 24px;
  }

  .stats {
    justify-content: start;
  }

  .stat {
    padding: 6px 8px;
  }

  .shell {
    display: block;
    padding-right: 0;
    padding-bottom: 18px;
    height: auto;
  }

  .graph-shell {
    display: block;
    height: auto;
  }

  .filters,
  .results-panel,
  .detail-panel,
  .graph-controls,
  .graph-stage,
  .graph-drawer {
    max-height: none;
    border-right: 0;
  }

  .filters,
  .graph-controls {
    padding: 14px;
  }

  .graph-stage {
    border-bottom: 1px solid var(--graph-line);
  }

  .graph-drawer {
    border-left: 0;
  }

  .graph-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .graph-toolbar-actions {
    width: 100%;
    align-items: flex-start;
  }

  .graph-ambient {
    right: 12px;
    max-width: none;
  }

  .graph-svg {
    height: 62vh;
    min-height: 430px;
  }

  .graph-viewport,
  .graph-canvas {
    height: 62vh;
    min-height: 430px;
  }

  .results-head {
    min-height: 58px;
    padding: 10px 12px;
  }

  .results {
    padding: 10px;
  }

  .record-card {
    padding: 12px;
  }

  button,
  input,
  select {
    min-height: 44px;
  }

  .detail {
    grid-template-rows: auto minmax(220px, 42vh) auto;
  }

  .detail-header,
  .detail-text,
  .content-summary {
    padding: 14px;
  }

  .detail-header h2 {
    font-size: 19px;
  }

  .summary-head {
    display: block;
  }

  .summary-head span {
    display: block;
    margin-top: 6px;
    white-space: normal;
  }

  .summary-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ocr-head {
    display: block;
  }

  .ocr-head span {
    display: block;
    margin-top: 5px;
    white-space: normal;
  }

  .ocr-text {
    max-height: 58vh;
    font-size: 12px;
  }

  .chat-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: calc(var(--chat-mobile-height) + env(safe-area-inset-bottom));
    max-height: calc(56vh + env(safe-area-inset-bottom));
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -14px 28px rgba(0, 0, 0, 0.34);
  }

  .chat-panel.collapsed {
    left: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: 64px;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    padding-bottom: 0;
  }

  body:has(.chat-panel.collapsed) {
    padding-bottom: 0;
  }

  .chat-head {
    min-height: 44px;
    padding: 7px 10px;
  }

  .chat-panel.collapsed .chat-head {
    width: 64px;
    height: 64px;
    min-height: 64px;
  }

  .chat-panel.collapsed .chat-collapse {
    width: 56px;
    height: 56px;
  }

  .chat-head .eyebrow {
    display: none;
  }

  .chat-head h2 {
    margin: 0;
    font-size: 15px;
  }

  .chat-status {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-messages {
    max-height: calc(7 * 1.35em + 20px);
    padding: 8px 10px;
    font-size: 14px;
  }

  .chat-message {
    padding: 8px 9px;
    line-height: 1.35;
  }

  .chat-message.user,
  .chat-message.assistant {
    margin-left: 0;
    margin-right: 0;
  }

  .chat-form {
    padding: 8px 10px;
  }

  .chat-form textarea {
    height: 48px;
    padding: 8px 9px;
    resize: none;
  }
}

.atlas-return, .cia-index-link { color: #ff995e; font: 12px/1.4 ui-monospace, monospace; text-decoration: none; }
.atlas-return:hover, .cia-index-link:hover { text-decoration: underline; }
.cia-index-link { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; }

.atlas-return{display:inline-flex;align-items:center;min-height:28px}.atlas-return img{display:block;width:132px;height:auto}

/* The file workspace uses the same materials as the observatory. */
.file-workspace {
  --bg: var(--sw-bg, #090909);
  --panel: var(--sw-panel, #151515);
  --panel-2: #1f1f1f;
  --line: var(--sw-line, #3b3b3b);
  --text: var(--sw-ink, #f1f1f1);
  --muted: var(--sw-muted, #b0b0b0);
  --accent: var(--sw-amber, #ff995e);
  --accent-2: #cacaca;
  font-family: var(--sw-font, "Instrument Sans", system-ui, sans-serif);
  background: var(--bg);
  color: var(--text);
}
.file-workspace :is(a, button, input, select, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.file-workspace :is(.shell, .graph-shell, .studio-shell, .filters, .results-panel, .detail-panel, .graph-stage, .graph-controls, .graph-drawer) { min-width: 0; }
.file-workspace .topbar { min-height: 94px; align-items: center; padding: 18px clamp(20px, 3.8vw, 64px); gap: 22px; background: var(--bg); }
.topbar h1 { margin: 0; font: 500 clamp(32px, 3.1vw, 53px)/1 var(--sw-font, system-ui, sans-serif); letter-spacing: -.055em; }
.file-workspace .view-toggle { align-items: center; gap: 4px; border: 1px solid var(--line); padding: 3px; border-radius: 30px; }
.file-workspace .view-toggle button { background: transparent; color: var(--muted); border: 0; border-radius: 22px; min-height: 38px; padding: 8px 16px; font-size: 13px; white-space: nowrap; }
.file-workspace .view-toggle button.active { color: var(--text); background: #2b2b2b; }
.file-workspace .view-toggle button:hover { color: var(--text); }
.file-workspace :is(.filters, .graph-controls) { background: var(--bg); padding: clamp(18px, 1.8vw, 32px); }
.file-workspace :is(.results-panel, .detail-panel, .content-summary, .graph-drawer, .studio-sidebar, .studio-main, .studio-toolbar, .milestone-strip) { background: var(--bg); }
.file-workspace :is(.search-label, .filter-group > span, .kind, .new-flag, .file-number, .eyebrow, .graph-mode-label, .plate-credit, .graph-stats dt, .summary-meta dt) { font: 500 10px/1.4 var(--sw-mono, ui-monospace, monospace); letter-spacing: .1em; text-transform: uppercase; }
.file-workspace :is(.search-label, .filter-group > span) { color: var(--muted); }
.file-workspace :is(input, select, textarea) { border-radius: 3px; border-color: var(--line); background: #131313; color: var(--text); }
.file-workspace :is(input, select) { min-height: 43px; font-size: 14px; }
.file-workspace :is(button, .detail-actions a, .graph-actions a, .graph-actions button) { border-radius: 3px; }
.file-workspace :is(.search-row button, .detail-actions .brief-link) { color: #181818; background: var(--accent); border-color: var(--accent); }
.file-workspace .search-help { margin-top: 10px; line-height: 1.5; }
.page-search { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); min-height: 40px; text-decoration: none; font-size: 13px; }
.page-search:hover { text-decoration: underline; }
.file-workspace .filter-group { margin-top: 21px; }
.file-workspace .segmented { gap: 5px; }
.file-workspace :is(.segmented button, .pager button, .issues button) { min-height: 40px; background: transparent; font-size: 13px; }
.file-workspace .segmented button.active { color: var(--text); border-color: var(--accent); background: #222222; }
.file-workspace .stats { display: grid; gap: 0; justify-content: stretch; margin-top: 28px; }
.file-workspace .stat { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; border: 0; border-top: 1px solid var(--line); background: transparent; border-radius: 0; padding: 8px 0; color: var(--muted); }
.file-workspace .stat strong { font: 400 13px var(--sw-mono, monospace); }
.file-workspace .results-head { background: #101010; min-height: 62px; padding: 10px 19px; }
.file-workspace .results-head .result-count { color: var(--text); font-size: 13px; }
.file-workspace .results-head .query-hint:not(:empty) { margin-top: 4px; }
.file-workspace .results { padding: 0; }
.file-workspace .record-card { position: relative; margin: 0; padding: 18px 19px 20px; border: 0; border-bottom: 1px solid #2e2e2e; border-radius: 0; color: var(--text); background: var(--bg); }
.file-workspace .record-card:hover, .file-workspace .record-card:focus-visible { background: var(--panel); }
.file-workspace .record-card.active { background: #1d1d1d; box-shadow: inset 2px 0 var(--accent); }
.file-workspace .record-title { font-size: clamp(16px, 1.31vw, 21px); font-weight: 480; line-height: 1.18; letter-spacing: -.026em; margin: 7px 0 5px; overflow-wrap: anywhere; }
.file-workspace .record-top { margin: 0; }
.file-workspace .kind { padding: 0; color: #c1c1c1; background: transparent; }
.file-workspace .kind.image { color: #c1c1c1; }
.file-workspace .kind.video { color: #c4c4c4; }
.file-workspace .new-flag { border: 0; padding: 0; color: var(--accent); background: transparent; }
.file-workspace .record-top > .meta, .file-number, .plate-credit { color: var(--muted); font: 10px/1.5 var(--sw-mono, monospace); }
.file-workspace .record-card :is(.snippet, .blurb) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 7px; font-size: 12px; }
.file-workspace .record-cover { float: right; width: clamp(68px, 6vw, 86px); aspect-ratio: 3 / 2; margin: 4px 0 7px 13px; position: relative; overflow: hidden; background: var(--panel); }
.record-cover img { display: block; width: 100%; height: 100%; object-fit: contain; filter: grayscale(1); }
.record-cover::after { content: 'COVER'; position: absolute; bottom: 0; right: 0; padding: 1px 3px; color: #f1f1f1; background: #111c; font: 8px/1.3 var(--sw-mono, monospace); }
.no-records { padding: 14px 20px; color: var(--muted); }
.file-workspace .archive-plate { min-height: 100%; margin: 0; isolation: isolate; position: relative; overflow: hidden; display: flex; align-items: flex-end; background: #181818; }
.archive-plate > img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 43% center; filter: grayscale(1); }
.archive-plate::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, rgba(11, 11, 11, .96), rgba(11, 11, 11, .68) 17%, transparent 57%); }
.archive-plate figcaption { width: 100%; padding: clamp(22px, 3vw, 54px); }
.file-workspace .plate-credit { color: #dedede; }
.archive-plate h2 { margin: 9px 0 12px; font: 460 clamp(36px, 3.6vw, 62px)/1 var(--sw-font, system-ui, sans-serif); letter-spacing: -.065em; }
.file-workspace .archive-plate button { min-height: 44px; border: 0; padding: 0; background: transparent; color: var(--accent); font-size: 15px; }
.archive-plate button span { padding-left: 7px; }
.file-workspace .detail-header, .file-workspace .content-summary { padding: clamp(20px, 2.4vw, 35px); }
.file-workspace .detail-header h2 { font-weight: 480; font-size: clamp(25px, 2.5vw, 40px); line-height: 1.06; letter-spacing: -.046em; overflow-wrap: anywhere; }
.file-workspace .detail-actions :is(a, button) { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 11px; color: var(--text); background: transparent; border-color: var(--line); font-size: 13px; }
.file-workspace .detail-actions .brief-link { color: #1b1b1b; background: var(--accent); }
.file-workspace :is(.summary-block, .summary-meta > div, .ocr-head, .episode-card, .story-card, .asset-card, .studio-section-head) { background: var(--panel); border-radius: 3px; }
.file-workspace .summary-block > h4, .file-workspace .summary-head > span { color: var(--muted); }
.file-workspace .file-number { padding-right: 8px; border-right: 1px solid var(--line); }
.file-workspace .back-to-results, .filter-reveal { display: none; }
.file-workspace :is(.graph-shell, .globe-shell) {
  --graph-bg: var(--bg); --graph-panel: var(--panel); --graph-panel-2: var(--panel-2);
  --graph-text: var(--text); --graph-muted: var(--muted); --graph-accent: var(--accent);
  --graph-line: var(--line); --graph-line-strong: #696969; --graph-signal: var(--accent);
  --graph-signal-soft: #272727; --graph-accent-soft: #272727; background: var(--bg);
}
.file-workspace :is(.graph-card, .graph-stats div, .graph-toolbar, .graph-stage, .connection-row, .graph-filters button) { background: var(--bg); border-radius: 0; box-shadow: none; }
.file-workspace .graph-card { padding: 0 0 19px; border: 0; border-bottom: 1px solid var(--line); }
.file-workspace .graph-card::after, .file-workspace .globe-viewport::before { content: none; }
.file-workspace :is(.graph-card h2, .graph-detail h2, .graph-focus-title, .graph-ambient strong) { font-family: var(--sw-font, system-ui, sans-serif); font-weight: 500; letter-spacing: -.035em; }
.file-workspace .graph-card h2 { margin-top: 0; }
.file-workspace .board-disclaimer { color: var(--muted); font-size: 12px; }
.file-workspace .board-disclaimer::before { content: ''; display: inline-block; width: 9px; height: 11px; margin-right: 5px; background: url('/static/atlas-assets/signal-star.svg') center / contain no-repeat; }
.file-workspace .graph-filters { gap: 0; }
.file-workspace .graph-filters button, .file-workspace .connection-row { border: 0; border-bottom: 1px solid var(--line); padding: 10px 6px; color: var(--muted); font-size: 13px; }
.file-workspace .graph-filters button.active { background: #1c1c1c; color: var(--accent); border-color: var(--line); box-shadow: inset 2px 0 var(--accent); padding-left: 12px; }
.file-workspace .graph-stats div { border: 0; border-top: 1px solid var(--line); padding: 9px 0; }
.file-workspace .graph-toolbar { align-items: flex-start; flex-wrap: wrap; }
.file-workspace .graph-focus-title { margin: 4px 0; font-size: clamp(21px, 1.9vw, 32px); }
.file-workspace .graph-toolbar-actions { align-items: flex-start; gap: 6px; }
.file-workspace .graph-toolbar .pager { flex-wrap: wrap; gap: 4px; }
.file-workspace .graph-ambient { pointer-events: none; border: 0; border-left: 1px solid var(--accent); border-radius: 0; top: 14px; left: 14px; padding: 6px 10px; max-width: 58%; background: #0f0f0fd6; box-shadow: none; }
.file-workspace .graph-ambient strong { font-size: 15px; }
.file-workspace .graph-ambient span { font-size: 11px; }
.file-workspace .evidence-pill { color: var(--accent); background: #212121; border-radius: 2px; }
.file-workspace .drawer-section h3 { font-size: 13px; text-transform: none; }
.file-workspace .map-refine summary { display: none; }
@media (min-width: 760px) {
  .file-workspace { height: 100vh; height: 100dvh; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
  .file-workspace :is(.shell, .graph-shell, .studio-shell) { height: 100%; overflow: hidden; }
  .file-workspace .shell { grid-template-columns: minmax(205px, .52fr) minmax(270px, .82fr) minmax(320px, 1.18fr); }
  .file-workspace .graph-shell { grid-template-columns: minmax(200px, .51fr) minmax(380px, 1.35fr) minmax(235px, .65fr); }
  .file-workspace :is(.detail-panel, .graph-drawer) { grid-column: auto; min-height: 0; border-top: 0; }
  .file-workspace .graph-controls, .file-workspace .graph-drawer { overflow-y: auto; }
  .file-workspace .graph-stage { min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .file-workspace :is(.graph-canvas, .graph-viewport, .graph-svg) { min-height: 0; height: 100%; }
}
@media (min-width: 760px) and (max-width: 1099px) {
  .file-workspace .shell { grid-template-columns: minmax(260px, .81fr) minmax(340px, 1.19fr); grid-template-rows: auto minmax(0, 1fr); }
  .file-workspace .filters { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 8px 18px; overflow: visible; position: relative; z-index: 4; }
  .filters :is(.search-help, .stats) { display: none; }
  .file-workspace .filters .stats { display: none; }
  .file-workspace .filters .search-label { margin: 0; }
  .file-workspace .filter-reveal { margin-left: auto; }
  .file-workspace #archiveRefine { position: absolute; right: 12px; top: 100%; padding: 0 18px 16px; background: #171717; border: 1px solid var(--line); box-shadow: 0 12px 34px #0007; width: 265px; }
  .file-workspace .graph-shell { grid-template-columns: minmax(185px, .48fr) minmax(310px, 1fr) minmax(200px,.55fr); }
  .file-workspace .graph-controls, .file-workspace .graph-detail { padding: 14px; }
}
@media (max-width: 1099px) {
  .file-workspace .filter-reveal { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 12px; font-size: 13px; background: transparent; }
  .filter-reveal[aria-expanded="false"] + #archiveRefine { display: none; }
}
@media (max-width: 759px) {
  .file-workspace .topbar { min-height: 0; align-items: flex-start; flex-direction: column; padding: 18px 16px 13px; gap: 14px; }
  .file-workspace .view-toggle { width: auto; max-width: 100%; align-self: flex-start; }
  .file-workspace .view-toggle button { min-height: 40px; padding: 8px 11px; }
  .file-workspace :is(.shell, .graph-shell) { display: block; height: auto; }
  .file-workspace .filters { padding: 15px 16px; border-bottom: 1px solid var(--line); }
  .file-workspace .filters .stats, .file-workspace .search-help { display: none; }
  .file-workspace .filter-reveal { margin-left: 12px; min-height: 40px; }
  .file-workspace .results-panel { border-right: none; }
  .file-workspace .results { max-height: min(58vh, 550px); overflow-y: auto; overscroll-behavior-y: auto; }
  .file-workspace .results-head { position: static; }
  .file-workspace .detail-panel { min-height: 0; }
  .file-workspace .archive-plate { min-height: 330px; }
  .file-workspace .back-to-results { display: block; margin: -5px 0 14px; padding: 7px 0; background: transparent; color: var(--accent); border: 0; min-height: 44px; }
  .file-workspace .detail { min-height: 0; }
  .file-workspace .graph-card { padding: 0; border: 0; }
  .file-workspace .map-refine summary { display: list-item; cursor: pointer; color: var(--accent); font-size: 14px; min-height: 44px; padding-block: 12px; }
  .file-workspace .graph-controls { padding-bottom: 0; }
  .file-workspace .graph-ambient { max-width: 62%; }
  .file-workspace .graph-stage { min-height: 0; }
  .file-workspace .graph-toolbar { padding: 10px 16px; }
  .file-workspace .studio-shell { display: block; height: auto; }
  .file-workspace .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .file-workspace .milestone-strip { overflow-x: auto; }
}

.file-workspace .catalog-title { margin: 5px 0 8px; font-size: 12px; line-height: 1.4; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.file-workspace .detail-header .catalog-title { font-size: 15px; margin: 8px 0 12px; }

.file-workspace .detail-synopsis { max-width:78ch; margin:15px 0 10px; font-size:15px; line-height:1.48; }
.file-workspace .graph-record-lead:empty { display:none; }
.file-workspace .legacy-summary summary, .file-workspace .legacy-excerpts summary { min-height:44px; padding:12px 0; cursor:pointer; font-size:13px; color:var(--muted); }
.file-workspace .legacy-summary, .file-workspace .legacy-excerpts { color:var(--muted); }
.file-workspace .board-brief { text-decoration:none; color:var(--sw-ink); }
.file-workspace .board-brief:hover span { color:var(--sw-amber); }
