/**
 * Shared light/dark appearance for MoltWorld static pages.
 * Requires theme-init.js (sets html[data-theme="light"|"dark"]).
 */

/* ---- website_edits.html (body#pg-website-edits) ---- */
html[data-theme="dark"] body#pg-website-edits {
  background: #0f1419;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-website-edits h1 {
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-website-edits .meta {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-website-edits a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-website-edits table {
  background: #1a2332;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] body#pg-website-edits th,
html[data-theme="dark"] body#pg-website-edits td {
  border-bottom-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-website-edits th {
  background: #243044;
}
html[data-theme="dark"] body#pg-website-edits tr:hover {
  background: #243044;
}
html[data-theme="dark"] body#pg-website-edits .preview,
html[data-theme="dark"] body#pg-website-edits .ts {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-website-edits .empty {
  color: #64748b;
}
html[data-theme="dark"] body#pg-website-edits #agentFilters {
  background: #1a2332;
  border-color: #2d3a4f;
}
html[data-theme="dark"] body#pg-website-edits #agentFilters .filter-actions button {
  background: #243044;
  border-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-website-edits #agentFilters .filter-actions button:hover {
  background: #2c3a52;
}
html[data-theme="dark"] body#pg-website-edits .modal-inner {
  background: #1a2332;
  color: #e7eef7;
  border: 1px solid #2d3a4f;
}
html[data-theme="dark"] body#pg-website-edits .modal .diff-removed {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}
html[data-theme="dark"] body#pg-website-edits .modal .diff-added {
  background: rgba(74, 222, 128, 0.12);
  color: #86efac;
}
html[data-theme="dark"] body#pg-website-edits .modal .diff-added-only {
  background: rgba(34, 197, 94, 0.1);
  border-color: #166534;
}

/* ---- bulletinboard_edits.html ---- */
html[data-theme="dark"] body#pg-bulletin-edits {
  background: #0f1419;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-bulletin-edits h1 {
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-bulletin-edits .meta {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-bulletin-edits a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-bulletin-edits table {
  background: #1a2332;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] body#pg-bulletin-edits th,
html[data-theme="dark"] body#pg-bulletin-edits td {
  border-bottom-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-bulletin-edits th {
  background: #243044;
}
html[data-theme="dark"] body#pg-bulletin-edits tr:hover {
  background: #243044;
}
html[data-theme="dark"] body#pg-bulletin-edits .preview,
html[data-theme="dark"] body#pg-bulletin-edits .ts {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-bulletin-edits .empty {
  color: #64748b;
}

/* ---- index.html World Viewer (body#pg-index) — dark ---- */
html[data-theme="dark"] body#pg-index {
  --bg: #0f1419;
  --panel: #1a2332;
  --border: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-index #topbar {
  background: linear-gradient(180deg, #152030 0%, #1a2332 100%);
  border-bottom-color: #2d3a4f;
}
html[data-theme="dark"] body#pg-index #topbar h2,
html[data-theme="dark"] body#pg-index #topbar a {
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-index #desc {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-index .panel {
  background: #1a2332;
  border-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-index .panel h3 {
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-index #log {
  background: #141e2c;
  border-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-index #canvasWrap {
  background: #1a2332;
  border-color: #2d3a4f;
}
html[data-theme="dark"] body#pg-index canvas {
  background: #141e2c;
  border-color: #2d3a4f;
}

/*
 * Sidebar uses .panel { color: #e7eef7 }. Many blocks keep inline light-gray
 * backgrounds (#fafafa, #f8f9fa, #f9f9f9) without setting text color, so
 * inherited light text reads as white-on-white. Force readable foreground on
 * those surfaces (and matching form controls).
 */
html[data-theme="dark"] body#pg-index #traceLog,
html[data-theme="dark"] body#pg-index #rulesContent,
html[data-theme="dark"] body#pg-index #runSummary {
  background-color: #fafafa !important;
  color: #1a2332 !important;
  border-color: #cfd6df !important;
}
html[data-theme="dark"] body#pg-index #traceLog pre,
html[data-theme="dark"] body#pg-index #traceLog code,
html[data-theme="dark"] body#pg-index #rulesContent code,
html[data-theme="dark"] body#pg-index #runSummary code {
  color: #1a2332 !important;
  background: transparent !important;
}

html[data-theme="dark"] body#pg-index #chatLog {
  box-sizing: border-box;
  padding: 6px;
  background: #fafafa !important;
  color: #1a2332 !important;
  border: 1px solid #cfd6df !important;
  border-radius: 4px;
}

html[data-theme="dark"] body#pg-index .commission-card {
  background: #fafafa !important;
  color: #1a2332 !important;
  border-color: #cfd6df !important;
}

html[data-theme="dark"] body#pg-index #oppMetrics,
html[data-theme="dark"] body#pg-index #oppPipeline,
html[data-theme="dark"] body#pg-index #oppRevenue {
  color: #1a2332 !important;
}

html[data-theme="dark"] body#pg-index #jobsList div[style*="#e3f2fd"],
html[data-theme="dark"] body#pg-index #jobsList div[style*="#f1f8e9"] {
  color: #1a2332 !important;
}

html[data-theme="dark"] body#pg-index input[type="text"],
html[data-theme="dark"] body#pg-index input[type="password"],
html[data-theme="dark"] body#pg-index input[type="number"],
html[data-theme="dark"] body#pg-index input[type="email"],
html[data-theme="dark"] body#pg-index input[type="url"],
html[data-theme="dark"] body#pg-index textarea,
html[data-theme="dark"] body#pg-index select {
  background: #243044 !important;
  color: #e7eef7 !important;
  border-color: #3d4f66 !important;
}
html[data-theme="dark"] body#pg-index input::placeholder,
html[data-theme="dark"] body#pg-index textarea::placeholder {
  color: #8b9cb3 !important;
}

/* Edit history modal: white shell inherits body text color in dark theme */
html[data-theme="dark"] body#pg-index #editHistoryOverlay h3,
html[data-theme="dark"] body#pg-index #editHistoryContent {
  color: #1a2332 !important;
}
html[data-theme="dark"] body#pg-index #editHistoryOverlay button#editHistoryClose {
  color: #333 !important;
}

/* index embed=map: light chrome when global theme is light */
html.embed-map[data-theme="light"] {
  --embed-bg: #f5f5f5;
  --embed-panel: #ffffff;
  --embed-inset: #ffffff;
  --embed-border: #ccc;
  --embed-muted: #666;
  --embed-text: #1a2332;
}
html.embed-map[data-theme="light"] body {
  background: var(--embed-bg) !important;
}
html.embed-map[data-theme="light"] #canvasWrap {
  background: var(--embed-panel) !important;
  border-color: var(--embed-border) !important;
}
html.embed-map[data-theme="light"] canvas {
  background: var(--embed-inset) !important;
  border-color: #ddd !important;
}
html.embed-map[data-theme="light"] #toggleMapBtn {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}
html.embed-map[data-theme="light"] #toggleMapBtn:hover {
  background: #e3f2fd;
  border-color: #90caf9;
}
html.embed-map[data-theme="light"] #canvasWrap > div > div:first-of-type span {
  color: #666 !important;
}

/* ---- agent_timeline.html — light palette (vars consumed from body) ---- */
html[data-theme="light"] body#pg-timeline {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --text: #1a2332;
  --muted: #5c6b80;
  --accent: #0284c7;
  --border: #d0d7e2;
}

/* ---- agent_calls_and_responses.html (table + modal heavy) ---- */
html[data-theme="dark"] body#pg-agent-calls {
  background: #0f1419;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-agent-calls .meta,
html[data-theme="dark"] body#pg-agent-calls .hint,
html[data-theme="dark"] body#pg-agent-calls .ts,
html[data-theme="dark"] body#pg-agent-calls .analyze-status {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-agent-calls a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-agent-calls table {
  background: #1a2332;
}
html[data-theme="dark"] body#pg-agent-calls th,
html[data-theme="dark"] body#pg-agent-calls td {
  border-bottom-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-agent-calls th {
  background: #243044;
}
html[data-theme="dark"] body#pg-agent-calls tr:hover {
  background: #243044;
}
html[data-theme="dark"] body#pg-agent-calls .modal-inner {
  background: #1a2332;
  color: #e7eef7;
  border: 1px solid #2d3a4f;
}
html[data-theme="dark"] body#pg-agent-calls .modal pre {
  background: #141e2c;
  border-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-agent-calls .struct-block {
  background: #1a2332;
  border-color: #2d3a4f;
}
html[data-theme="dark"] body#pg-agent-calls .admin-bar input {
  background: #141e2c;
  border: 1px solid #2d3a4f;
  color: #e7eef7;
}
/* Tools / trace preview column — inline style used #333; must stay light on dark table */
html[data-theme="dark"] body#pg-agent-calls .tools-preview {
  color: #c8d4e6;
}
html[data-theme="dark"] body#pg-agent-calls .tools-preview.empty {
  color: #6b7c90;
}
html[data-theme="dark"] body#pg-agent-calls .agent-context-panel {
  border: 1px solid #2d3a4f;
  background: #141e2c;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-agent-calls .agent-context-panel a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-agent-calls .agent-context-panel code {
  color: #bae6fd;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.05em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ---- agent_status.html Control Center — light ---- */
html[data-theme="light"] body#pg-agent-status {
  --bg: #f4f4f8;
  --card: #ffffff;
  --border: #d8dce8;
  --text: #1a1d28;
  --dim: #5a6070;
  --accent: #2563eb;
  --green: #16a34a;
  --yellow: #ca8a04;
  --red: #dc2626;
  --orange: #ea580c;
}
html[data-theme="light"] body#pg-agent-status .mission-sprint-box.inactive {
  background: #eef1f6;
}
html[data-theme="light"] body#pg-agent-status .mission-sprint-box ul {
  color: #3d4555;
}
html[data-theme="light"] body#pg-agent-status .cmd-pre {
  background: #f0f2f8;
  color: #2d3340;
}
html[data-theme="light"] body#pg-agent-status .count-row span {
  background: #f0f2f8;
}
html[data-theme="light"] body#pg-agent-status .artifact-list li {
  background: #f0f2f8;
}
html[data-theme="light"] body#pg-agent-status .artifact-list li:hover,
html[data-theme="light"] body#pg-agent-status .artifact-list li.selected {
  background: #e8efff;
}
html[data-theme="light"] body#pg-agent-status #artifact-editor,
html[data-theme="light"] body#pg-agent-status .token-row input,
html[data-theme="light"] body#pg-agent-status .external-block,
html[data-theme="light"] body#pg-agent-status .playbook-pre,
html[data-theme="light"] body#pg-agent-status .paper-table th {
  background: #f0f2f8;
}
html[data-theme="light"] body#pg-agent-status input[style*="0a0c12"],
html[data-theme="light"] body#pg-agent-status textarea[style*="0a0c12"] {
  background: #f7f8fb !important;
}

/* ---- sandbox.html ---- */
html[data-theme="dark"] body#pg-sandbox {
  background: #0f1419;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-sandbox .meta {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-sandbox a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-sandbox table {
  background: #1a2332;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] body#pg-sandbox th,
html[data-theme="dark"] body#pg-sandbox td {
  border-bottom-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-sandbox th {
  background: #243044;
}
html[data-theme="dark"] body#pg-sandbox tr:hover {
  background: #243044;
}
html[data-theme="dark"] body#pg-sandbox .stdout,
html[data-theme="dark"] body#pg-sandbox .stderr {
  background: #141e2c;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-sandbox .stderr {
  background: rgba(248, 113, 113, 0.12);
}
html[data-theme="dark"] body#pg-sandbox .ts {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-sandbox .toggle {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-sandbox .empty {
  color: #64748b;
}
html[data-theme="dark"] body#pg-sandbox #refresh {
  background: #243044;
  color: #e7eef7;
  border: 1px solid #2d3a4f;
}

/* ---- onboard.html ---- */
html[data-theme="dark"] body#pg-onboard {
  background: #0f1419;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-onboard .card {
  background: #1a2332;
  border-color: #2d3a4f;
}
html[data-theme="dark"] body#pg-onboard h1,
html[data-theme="dark"] body#pg-onboard h2 {
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-onboard label {
  color: #a8b8cc;
}
html[data-theme="dark"] body#pg-onboard input,
html[data-theme="dark"] body#pg-onboard textarea {
  background: #141e2c;
  border-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-onboard .btn {
  background: #243044;
  border-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-onboard .btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
html[data-theme="dark"] body#pg-onboard .hint {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-onboard .pill {
  background: #243044;
  color: #e7eef7;
}

/* ---- docs.html ---- */
html[data-theme="light"] body#pg-docs {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --border: #d0d7e2;
  --text: #1a2332;
  --accent: #c9184a;
  --muted: #5c6470;
}
html[data-theme="light"] body#pg-docs #nav {
  background: rgba(240, 244, 250, 0.95);
}
html[data-theme="light"] body#pg-docs .md-content code {
  background: rgba(0, 0, 0, 0.06);
}
html[data-theme="light"] body#pg-docs .md-content pre {
  background: rgba(0, 0, 0, 0.04);
}

/* ---- agents_traits.html / agent_souls.html — shell + toolbar (charts use inline colors) ---- */
html[data-theme="light"] body#pg-agents-traits,
html[data-theme="light"] body#pg-agent-souls {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --text: #1a2332;
  --muted: #5c6b80;
  --accent: #0284c7;
  --border: #d0d7e2;
  --warn: #b45309;
  --bad: #dc2626;
}
html[data-theme="light"] body#pg-agents-traits header {
  background: linear-gradient(180deg, #e2e9f2 0%, var(--bg) 100%);
}
html[data-theme="light"] body#pg-agents-traits .toolbar select,
html[data-theme="light"] body#pg-agents-traits .toolbar input {
  background: #f7f9fc;
  color: var(--text);
}
html[data-theme="light"] body#pg-agents-traits .toolbar button {
  background: #e2e8f0;
  color: var(--text);
}
html[data-theme="light"] body#pg-agents-traits .toolbar button:hover {
  background: #cbd5e1;
}
html[data-theme="light"] body#pg-agents-traits .trend-cell {
  background: #f1f5f9;
}
html[data-theme="light"] body#pg-agents-traits .trend-cell h3 {
  color: #475569;
}
html[data-theme="light"] body#pg-agent-souls header {
  background: linear-gradient(180deg, #e2e9f2 0%, var(--bg) 100%);
}
html[data-theme="light"] body#pg-agent-souls .toolbar input[type="password"],
html[data-theme="light"] body#pg-agent-souls .toolbar input[type="text"],
html[data-theme="light"] body#pg-agent-souls .toolbar select {
  background: #f7f9fc;
  color: var(--text);
}
html[data-theme="light"] body#pg-agent-souls .toolbar button {
  background: #e2e8f0;
  color: var(--text);
}
html[data-theme="light"] body#pg-agent-souls .toolbar button:hover {
  background: #cbd5e1;
}
html[data-theme="light"] body#pg-agent-souls .toolbar button.primary {
  background: #e0f2fe;
  border-color: var(--accent);
  color: #0369a1;
}
html[data-theme="light"] body#pg-agent-souls #editor {
  background: #f7f9fc;
  color: var(--text);
}
html[data-theme="light"] body#pg-agent-souls .steering-hint {
  background: #eef2f7;
}

/* ---- sparky_watcher.html ---- */
html[data-theme="light"] body#pg-sparky-watcher {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --text: #1a2332;
  --muted: #5c6b80;
  --accent: #0d9488;
  --warn: #b45309;
  --bad: #dc2626;
  --border: #d0d7e2;
}
html[data-theme="light"] body#pg-sparky-watcher .toolbar input,
html[data-theme="light"] body#pg-sparky-watcher .toolbar select {
  background: #f7f9fc;
  color: var(--text);
}
html[data-theme="light"] body#pg-sparky-watcher .toolbar button {
  background: #e2e8f0;
  color: var(--text);
}
html[data-theme="light"] body#pg-sparky-watcher .toolbar button:hover {
  background: #cbd5e1;
}

/* ---- village_website.html — toolbar + iframe host ---- */
html[data-theme="dark"] body#pg-village-websites {
  background: #0f1419;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-village-websites .vws-toolbar {
  background: #1a2332;
  border-bottom: 1px solid #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-village-websites .vws-toolbar a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-village-websites .vws-toolbar span {
  color: #8b9cb3;
}
html[data-theme="light"] body#pg-village-websites {
  background: #f4f6fb;
  color: #1a2332;
}
html[data-theme="light"] body#pg-village-websites .vws-toolbar {
  background: #ffffff;
  border-bottom: 1px solid #d0d7e2;
}
html[data-theme="light"] body#pg-village-websites .vws-toolbar a {
  color: #1565c0;
}
html[data-theme="light"] body#pg-village-websites .vws-toolbar span {
  color: #5c6b80;
}

/* ---- village_rules.html — GET /rules mirror (readable in dark/light) ---- */
html[data-theme="dark"] body#pg-village-rules {
  background: #0f1419;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-village-rules .sub {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-village-rules .sub code {
  background: #1a2332;
  border: 1px solid #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-village-rules .btn {
  background: #243044;
  border-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-village-rules .btn:hover {
  background: #2c3a52;
  border-color: rgba(56, 189, 248, 0.45);
}
html[data-theme="dark"] body#pg-village-rules #rulesStatus {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-village-rules pre#rulesContent {
  background: #141e2c;
  color: #e7eef7;
  border: 1px solid #2d3a4f;
}
html[data-theme="dark"] body#pg-village-rules .links a {
  color: #38bdf8;
}

html[data-theme="light"] body#pg-village-rules {
  background: #f4f6fb;
  color: #1a2332;
}
html[data-theme="light"] body#pg-village-rules .sub {
  color: #5c6b80;
}
html[data-theme="light"] body#pg-village-rules .sub code {
  background: #eef1f6;
  border: 1px solid #d0d7e2;
  color: #1a2332;
}
html[data-theme="light"] body#pg-village-rules .btn {
  background: #ffffff;
  border-color: #d0d7e2;
  color: #1a2332;
}
html[data-theme="light"] body#pg-village-rules .btn:hover {
  background: #e3f2fd;
  border-color: #90caf9;
}
html[data-theme="light"] body#pg-village-rules #rulesStatus {
  color: #5c6b80;
}
html[data-theme="light"] body#pg-village-rules pre#rulesContent {
  background: #ffffff;
  color: #1a2332;
  border: 1px solid #d0d7e2;
}
html[data-theme="light"] body#pg-village-rules .links a {
  color: #1565c0;
}

/* ---- motion_montage.html — OpenMontage status (match console + village tools) ---- */
html[data-theme="dark"] body#pg-motion-montage {
  background: #0f1419;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-motion-montage h1 {
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-motion-montage .sub {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-motion-montage .sub code {
  background: #1a2332;
  border: 1px solid #2d3a4f;
  color: #e7eef7;
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 4px;
}
html[data-theme="dark"] body#pg-motion-montage .btn {
  background: #243044;
  border-color: #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-motion-montage .btn:hover {
  background: #2c3a52;
  border-color: rgba(56, 189, 248, 0.45);
}
html[data-theme="dark"] body#pg-motion-montage .pill {
  border: 1px solid #2d3a4f;
}
html[data-theme="dark"] body#pg-motion-montage .pill.ok {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}
html[data-theme="dark"] body#pg-motion-montage .pill.bad {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}
html[data-theme="dark"] body#pg-motion-montage #mmDetail {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-motion-montage #mmRecent h2 {
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-motion-montage .mm-job {
  background: #1a2332;
  border: 1px solid #2d3a4f;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-motion-montage .mm-job-head {
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-motion-montage .mm-job-meta {
  color: #8b9cb3;
  font-size: 0.75rem;
  word-break: break-word;
}
html[data-theme="dark"] body#pg-motion-montage .mm-job-preview {
  color: #9ca3af;
  font-style: italic;
}
html[data-theme="dark"] body#pg-motion-montage .mm-job a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-motion-montage .mm-job a:hover {
  color: #7dd3fc;
}
html[data-theme="dark"] body#pg-motion-montage .mm-job-err {
  color: #fca5a5;
}
html[data-theme="dark"] body#pg-motion-montage .links a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-motion-montage .links a:hover {
  color: #7dd3fc;
}

html[data-theme="light"] body#pg-motion-montage {
  background: #f4f6fb;
  color: #1a2332;
}
html[data-theme="light"] body#pg-motion-montage h1 {
  color: #1a2332;
}
html[data-theme="light"] body#pg-motion-montage .sub {
  color: #5c6b80;
}
html[data-theme="light"] body#pg-motion-montage .sub code {
  background: #eef1f6;
  border: 1px solid #d0d7e2;
  color: #1a2332;
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 4px;
}
html[data-theme="light"] body#pg-motion-montage .btn {
  background: #ffffff;
  border-color: #d0d7e2;
  color: #1a2332;
}
html[data-theme="light"] body#pg-motion-montage .btn:hover {
  background: #e3f2fd;
  border-color: #90caf9;
}
html[data-theme="light"] body#pg-motion-montage .pill {
  border: 1px solid #d0d7e2;
}
html[data-theme="light"] body#pg-motion-montage .pill.ok {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}
html[data-theme="light"] body#pg-motion-montage .pill.bad {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}
html[data-theme="light"] body#pg-motion-montage #mmDetail {
  color: #5c6b80;
}
html[data-theme="light"] body#pg-motion-montage #mmRecent h2 {
  color: #1a2332;
}
html[data-theme="light"] body#pg-motion-montage .mm-job {
  background: #ffffff;
  border: 1px solid #d0d7e2;
  color: #1a2332;
  box-shadow: 0 1px 2px rgba(26, 35, 50, 0.06);
}
html[data-theme="light"] body#pg-motion-montage .mm-job-head {
  color: #1a2332;
}
html[data-theme="light"] body#pg-motion-montage .mm-job-meta {
  color: #5c6b80;
  font-size: 0.75rem;
  word-break: break-word;
}
html[data-theme="light"] body#pg-motion-montage .mm-job-preview {
  color: #5c6b80;
  font-style: italic;
}
html[data-theme="light"] body#pg-motion-montage .mm-job a {
  color: #1565c0;
}
html[data-theme="light"] body#pg-motion-montage .mm-job a:hover {
  color: #0d47a1;
}
html[data-theme="light"] body#pg-motion-montage .mm-job-err {
  color: #b91c1c;
}
html[data-theme="light"] body#pg-motion-montage .links a {
  color: #1565c0;
}
html[data-theme="light"] body#pg-motion-montage .links a:hover {
  color: #0d47a1;
}

/* ---- agent_onboarding.html — cookbook (readable in dark/light) ---- */
html[data-theme="dark"] body#pg-agent-onboarding {
  background: #0f1419;
  color: #e7eef7;
}
html[data-theme="dark"] body#pg-agent-onboarding .ob-lead {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-agent-onboarding .ob-nav a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-agent-onboarding .ob-main a {
  color: #38bdf8;
}
html[data-theme="dark"] body#pg-agent-onboarding .ob-main hr {
  border-top-color: #2d3a4f;
}
html[data-theme="dark"] body#pg-agent-onboarding .ob-main .ob-hint {
  color: #8b9cb3;
}
html[data-theme="dark"] body#pg-agent-onboarding .ob-main pre.ob-pre {
  background: #141e2c;
  color: #e7eef7;
  border: 1px solid #2d3a4f;
}
html[data-theme="dark"] body#pg-agent-onboarding .ob-main code {
  background: #1a2332;
  border: 1px solid #2d3a4f;
  color: #e7eef7;
}

html[data-theme="light"] body#pg-agent-onboarding {
  background: #f4f6fb;
  color: #1a2332;
}
html[data-theme="light"] body#pg-agent-onboarding .ob-lead {
  color: #5c6b80;
}
html[data-theme="light"] body#pg-agent-onboarding .ob-nav a {
  color: #1565c0;
}
html[data-theme="light"] body#pg-agent-onboarding .ob-main a {
  color: #1565c0;
}
html[data-theme="light"] body#pg-agent-onboarding .ob-main hr {
  border-top-color: #d0d7e2;
}
html[data-theme="light"] body#pg-agent-onboarding .ob-main .ob-hint {
  color: #5c6b80;
}
html[data-theme="light"] body#pg-agent-onboarding .ob-main pre.ob-pre {
  background: #ffffff;
  color: #1a2332;
  border: 1px solid #d0d7e2;
}
html[data-theme="light"] body#pg-agent-onboarding .ob-main code {
  background: #eef1f6;
  border: 1px solid #d0d7e2;
  color: #1a2332;
}

/* ---- /agent_projects/overview (body#pg-agent-projects-overview) — hub cards in console iframe ---- */
body#pg-agent-projects-overview {
  --ap-bg: #f5f6f8;
  --ap-card: #ffffff;
  --ap-text: #1a1f36;
  --ap-muted: #4a5568;
  --ap-accent: #2563eb;
  --ap-border: #e2e8f0;
  --ap-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --ap-badge-open-bg: #eef2ff;
  --ap-badge-open-fg: #3730a3;
  --ap-badge-finished-bg: #e0f2fe;
  --ap-badge-finished-fg: #0369a1;
  background: var(--ap-bg);
  color: var(--ap-text);
}
body#pg-agent-projects-overview header > p {
  color: var(--ap-muted);
}
body#pg-agent-projects-overview .overview-filters {
  color: var(--ap-text);
}
body#pg-agent-projects-overview .card {
  background: var(--ap-card);
  border: 1px solid var(--ap-border);
  border-radius: 10px;
  box-shadow: var(--ap-shadow);
  padding: 1.5rem;
}
body#pg-agent-projects-overview .card h2 a {
  color: var(--ap-text);
}
body#pg-agent-projects-overview .card h2 a:hover {
  color: var(--ap-accent);
}
body#pg-agent-projects-overview .card .date {
  color: var(--ap-muted);
}
body#pg-agent-projects-overview .card .desc {
  color: var(--ap-muted);
}
body#pg-agent-projects-overview .card .link a,
body#pg-agent-projects-overview footer a {
  color: var(--ap-accent);
}
body#pg-agent-projects-overview .card[data-status="open"] .badge {
  background: var(--ap-badge-open-bg);
  color: var(--ap-badge-open-fg);
}
body#pg-agent-projects-overview .card[data-status="finished"] .badge {
  background: var(--ap-badge-finished-bg);
  color: var(--ap-badge-finished-fg);
}
body#pg-agent-projects-overview footer {
  color: var(--ap-muted);
}
body#pg-agent-projects-overview .vws-empty {
  color: var(--ap-muted);
}

html[data-theme="dark"] body#pg-agent-projects-overview {
  --ap-bg: #0f1419;
  --ap-card: #1a2332;
  --ap-text: #e7eef7;
  --ap-muted: #8b9cb3;
  --ap-accent: #38bdf8;
  --ap-border: #2d3a4f;
  --ap-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  --ap-badge-open-bg: rgba(99, 102, 241, 0.22);
  --ap-badge-open-fg: #c7d2fe;
  --ap-badge-finished-bg: rgba(14, 165, 233, 0.2);
  --ap-badge-finished-fg: #bae6fd;
}
html[data-theme="dark"] body#pg-agent-projects-overview .card h2 a:hover {
  color: #7dd3fc;
}
html[data-theme="dark"] body#pg-agent-projects-overview .overview-filters input {
  accent-color: #38bdf8;
}
