/* governance-mcp Dashboard Stylesheet */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #1a1f35;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── App Layout ── */
.app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar { width: 240px; background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { font-size: 16px; color: var(--primary); }
.version { font-size: 11px; color: var(--text-muted); }
.nav-menu { list-style: none; padding: 10px 0; }
.nav-menu li a { display: block; padding: 10px 20px; color: var(--text-muted); font-size: 14px; transition: all 0.2s; }
.nav-menu li a:hover, .nav-menu li a.active { background: rgba(99,102,241,0.1); color: var(--text); border-left: 3px solid var(--primary); }

/* ── Sidebar Footer / Logout ── */
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 12px 20px; }
.logout-link { display: block; color: var(--danger); font-size: 13px; transition: opacity 0.2s; }
.logout-link:hover { opacity: 0.8; color: var(--danger); }

/* ── Main Content ── */
.main-content { flex: 1; padding: 24px; overflow-y: auto; }
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header h1 { font-size: 24px; }
.badge { background: var(--primary); padding: 4px 12px; border-radius: 12px; font-size: 12px; }
.back-link { color: var(--text-muted); font-size: 14px; }
.back-link:hover { color: var(--primary); }

/* ── Project Grid ── */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: all 0.2s; }
.project-card.score-loading { opacity: 0.85; }
.project-card.score-loading .ring-fill { stroke: var(--border); }
.project-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h3 { font-size: 16px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 8px; }
.tag-warning { background: rgba(234,179,8,0.2); color: var(--warning); }
.card-score { display: flex; justify-content: center; margin-bottom: 16px; }
.score-ring { width: 72px; height: 72px; }
.ring-chart { width: 72px; height: 72px; }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 3; }
.ring-fill { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; }
.ring-text { fill: var(--text); font-size: 8px; text-anchor: middle; font-weight: bold; }
.card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.metric { display: flex; justify-content: space-between; font-size: 12px; }
.metric .label { color: var(--text-muted); }
.metric .value { color: var(--text); font-weight: 500; }
.card-footer { border-top: 1px solid var(--border); padding-top: 12px; }
.instr-badge { font-size: 12px; color: var(--text-muted); }

/* ── Recommendations ── */
.recommendations { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 24px; }
.recommendations h3 { font-size: 14px; margin-bottom: 12px; }
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-item { font-size: 13px; color: var(--text-muted); padding: 8px 12px; background: rgba(99,102,241,0.05); border-radius: 8px; border-left: 3px solid var(--primary); }

/* ── Detail Cards ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.detail-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.detail-card h3 { font-size: 14px; margin-bottom: 16px; }
.blurb-card { border-left: 3px solid var(--primary); }
.blurb-identity { font-size: 15px; line-height: 1.45; margin: 0 0 8px; }
.blurb-focus { margin: 10px 0 8px; }
.blurb-focus ul { margin: 6px 0 0 1.1rem; padding: 0; }
.blurb-focus li { margin: 4px 0; font-size: 13px; line-height: 1.4; }
.blurb-focus-missing { color: var(--text-muted); }
.blurb-focus-missing strong { color: #c9a227; }
.blurb-recent, .blurb-depth { font-size: 13px; margin: 8px 0 0; line-height: 1.4; }

/* ── Radar Chart ── */
.radar-chart { display: flex; flex-direction: column; gap: 12px; }
.radar-item { display: flex; align-items: center; gap: 12px; }
.radar-label { width: 40px; font-size: 12px; color: var(--text-muted); }
.radar-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.radar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #818cf8); border-radius: 4px; transition: width 0.5s; }
.radar-val { width: 36px; font-size: 12px; text-align: right; }
.radar-total { text-align: center; padding-top: 8px; border-top: 1px solid var(--border); font-size: 14px; }

/* ── Preformatted Content ── */
pre { background: rgba(0,0,0,0.3); padding: 16px; border-radius: 8px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; }
.instr-content, .patrol-content { max-height: 400px; overflow-y: auto; }

/* ── Login ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 360px; }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; text-align: center; }
.login-card h1 { color: var(--primary); margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; text-align: left; }
.form-group input { width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; }
.form-group input:focus { outline: none; border-color: var(--primary); }
.token-input-row { display: flex; gap: 8px; }
.token-input-row input { flex: 1; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.token-hint { margin-top: 8px; font-size: 12px; color: var(--text-muted); text-align: left; }
.btn { padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.error-msg { color: var(--danger); font-size: 13px; }
.token-help { margin-top: 20px; text-align: left; font-size: 12px; color: var(--text-muted); }
.token-help summary { cursor: pointer; color: var(--primary); font-size: 13px; list-style: none; }
.token-help summary::-webkit-details-marker { display: none; }
.token-help summary::before { content: "▸ "; }
.token-help[open] summary::before { content: "▾ "; }
.token-help ol { margin: 10px 0 0; padding-left: 18px; line-height: 1.6; }
.token-help code { font-size: 11px; background: var(--bg); padding: 2px 6px; border-radius: 4px; word-break: break-all; }

/* ── Cortex ── */
.search-form { display: flex; gap: 8px; margin-left: auto; }
.search-input { width: 260px; padding: 8px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; }
.search-input:focus { outline: none; border-color: var(--primary); }
.cortex-browse { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cortex-section h3 { font-size: 14px; margin-bottom: 12px; color: var(--primary); }
.doc-list { list-style: none; }
.doc-list li { padding: 6px 0; font-size: 13px; }
.doc-meta { font-size: 11px; color: var(--text-muted); margin-left: 8px; }
.search-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.search-title { font-size: 14px; font-weight: 500; }
.search-meta { font-size: 11px; color: var(--text-muted); margin: 4px 0; }
.search-snippet { font-size: 12px; color: var(--text-muted); }
.doc-reader { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.doc-content pre { max-height: 600px; }

/* ── Factory / Experience ── */
.signals-section { margin-bottom: 24px; }
.signal-item { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.signal-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.exp-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.exp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 8px; }
.exp-tag { font-size: 10px; color: var(--primary); background: rgba(99,102,241,0.15); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.exp-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.exp-metric { font-size: 12px; color: var(--success); margin-bottom: 4px; }
.exp-detail { font-size: 12px; max-height: 120px; overflow-y: auto; }

/* ── Settings ── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-table { width: 100%; font-size: 13px; }
.info-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-table td:first-child { color: var(--text-muted); width: 120px; }
.info-table code { font-size: 12px; background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; }
.warning-card { border-color: var(--warning); }
.warning-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* ── Office Panel (Stage 4) ── */
.badge-muted { background: var(--border); color: var(--text-muted); }
.office-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; }
.stat-card-link { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, transform .1s; }
.stat-card-link:hover { border-color: var(--accent, #4a9); transform: translateY(-1px); }
.stat-card-link.stat-filter-active { outline: 2px solid var(--accent, #4a9); outline-offset: 2px; }
.major-matters-strip { margin-bottom: 20px; }
.major-matters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.major-matter-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.major-matter-card h4 { margin: 0 0 8px; font-size: 0.95rem; }
.major-matter-project-link, .major-matter-doc-link { color: var(--primary, #6366f1); text-decoration: underline; cursor: pointer; }
.major-matter-doc-link { display: inline; word-break: break-word; }
.major-matter-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.badge-warn { background: #5a4a20; color: #ffd; font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.inbox-filter-hint { font-size: 0.85rem; color: var(--text-muted, #888); margin: 0 0 8px; }
.stat-value { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-unread .stat-value { color: var(--warning); }
.stat-seen .stat-value { color: var(--primary); }
.stat-ack .stat-value { color: var(--success); }
.stat-pending-sign { border-color: #f59e0b88; background: rgba(245, 158, 11, 0.08); }
.stat-pending-sign .stat-value { color: #f59e0b; }
.stat-active .stat-value { color: #38bdf8; }
.sign-status-panel { margin-bottom: 16px; border: 1px solid #f59e0b66; background: rgba(245, 158, 11, 0.06); }
.sign-status-panel h3 { margin-top: 0; }
.sign-status-banner { margin: 0 0 10px; font-size: 14px; }
.sign-status-need { color: #fbbf24; }
.sign-status-clear { color: var(--success, #4ade80); }
.ops-gate-panel { margin-bottom: 16px; border: 1px solid #14b8a666; background: rgba(20, 184, 166, 0.07); }
.ops-gate-panel h3 { margin-top: 0; }
.stat-ops-gate { border-color: #14b8a688; background: rgba(20, 184, 166, 0.08); }
.stat-ops-gate .stat-value { color: #2dd4bf; }
.ops-kind-tag { display: inline-block; margin-right: 4px; padding: 1px 6px; border-radius: 4px; background: rgba(20, 184, 166, 0.2); font-size: 11px; }
.ops-kind-inferred { background: rgba(148, 163, 184, 0.25); color: var(--text-muted); }
.brief-stat-ops-gate .brief-stat-val { color: #2dd4bf; }
.pending-ops-gate-item { line-height: 1.45; }
.data-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { color: var(--text-muted); font-weight: 500; }
.theme-cell { color: var(--text-muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-cell { color: var(--text-muted); font-style: italic; }
.meta-line { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.mono { font-family: monospace; font-size: 11px; }
.mono-sm { font-family: monospace; font-size: 12px; color: var(--text-muted); }
.alert-card { border-left: 3px solid var(--warning); padding-left: 12px; }
.presence-unread { color: var(--warning); }
.presence-seen { color: var(--primary); }
.presence-ack { color: var(--success); }
.stage-line { font-size: 12px; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 8px; margin: 12px 0; overflow-x: auto; }
.link-card { display: inline-block; padding: 8px 12px; background: rgba(99,102,241,0.1); border-radius: 8px; }

/* ── Carbon todos (INSTR-049) ── */
.carbon-todos-panel { margin-bottom: 24px; border: 1px solid rgba(99,102,241,0.25); }
.carbon-todos-panel .detail-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.carbon-todos-panel h4 { font-size: 13px; color: var(--text-muted); margin: 0 0 8px; }
.todo-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.todo-list li { padding: 6px 0; border-bottom: 1px solid var(--border); line-height: 1.4; }
.todo-list li:last-child { border-bottom: none; }
.recent-ack-heading { font-size: 12px; color: var(--text-muted); padding-top: 10px !important; border-bottom: none !important; }
.recent-ack-item { font-size: 13px; padding: 8px 0 !important; }
.recent-ack-item a { color: var(--primary); }
.doc-pre { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; background: rgba(0,0,0,0.25); padding: 16px; border-radius: 8px; }
.doc-preview-main { max-width: 960px; margin: 0 auto; padding: 24px 20px; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 16px; }
.doc-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--border, #334155); background: var(--bg-card, #1e293b);
  color: var(--primary, #818cf8); text-decoration: none; cursor: pointer; font: inherit;
}
.doc-nav-btn:hover { border-color: var(--primary, #818cf8); }
.doc-nav-secondary { color: var(--text-muted, #94a3b8); }
.doc-nav-form { display: inline; margin: 0; padding: 0; }
.doc-nav-sidebar-link {
  width: 100%; justify-content: flex-start; background: transparent; border-color: transparent;
  color: inherit; border-radius: 6px; min-height: 32px; padding: 6px 10px;
}
.doc-nav-sidebar-link.active, .doc-nav-sidebar-link.active {
  background: rgba(129,140,248,.15); color: var(--primary, #818cf8);
}
.nav-menu .doc-nav-sidebar-link, .nav-menu .doc-nav-sidebar-link { font-size: 13px; }
.nav-menu li .doc-nav-btn { width: 100%; box-sizing: border-box; }
.doc-path-crumb { color: var(--text-muted); margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50vw; }
.doc-sidebar { width: 260px; max-height: 100vh; position: sticky; top: 0; overflow: hidden; }
.doc-sib-block {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  border-top: 1px solid var(--border); padding: 10px 0 0;
  overflow: hidden;
}
.doc-sib-title { font-size: 12px; color: var(--text); padding: 0 16px 4px; margin: 0; font-weight: 600; }
.doc-sib-hint { font-size: 11px; color: var(--text-muted); padding: 0 16px 8px; margin: 0; }
.doc-sib-list {
  list-style: none; margin: 0; padding: 0 0 12px;
  overflow-y: auto; flex: 1; max-height: calc(100vh - 320px);
}
.doc-sib-list a {
  display: block; padding: 7px 16px; font-size: 12px; color: var(--text-muted);
  border-left: 3px solid transparent; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-sib-list a:hover { color: var(--text); background: rgba(99,102,241,0.08); }
.doc-sib-list a.active {
  color: var(--text); background: rgba(99,102,241,0.12);
  border-left-color: var(--primary);
}
body.doc-preview .sidebar-footer { display: flex; flex-direction: column; gap: 8px; }
.back-link {
  display: inline-flex; align-items: center; min-height: 32px; margin-right: 10px;
  color: var(--primary, #818cf8); text-decoration: none; font-size: 14px;
}
.back-link:hover { text-decoration: underline; }
.gov-nav-flash { outline: 2px solid #f59e0b; outline-offset: 4px; transition: outline-color 0.3s; }
.gov-modal-backdrop { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; background: rgba(2,6,23,.72); padding: 24px; pointer-events: none; }
.gov-modal-backdrop.is-open { display: flex; pointer-events: auto; }
.doc-ack-panel { margin-top: 24px; padding: 16px; border-radius: 12px; border: 1px solid var(--border, #334155); background: var(--surface, #1e293b); }
.doc-ack-panel.doc-ack-done { border-color: #22c55e55; }
.doc-ack-title { font-size: 15px; margin: 0 0 8px; }
.doc-ack-hint { font-size: 12px; color: var(--text-muted, #94a3b8); margin: 0 0 10px; }

/* ── Brief mobile (INSTR-058) ── */
.brief-page { background: var(--bg, #0f172a); color: var(--text, #e2e8f0); min-height: 100vh; font-size: 14px; }
.brief-app { max-width: 480px; margin: 0 auto; padding: 12px 14px 28px; }
.brief-header h1 { font-size: 20px; margin: 0; }
.brief-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
@media (max-width: 420px) {
  .brief-stats { grid-template-columns: repeat(2, 1fr); }
}
.brief-stat { background: var(--bg-card, #1e293b); border: 1px solid var(--border, #334155); border-radius: 12px; padding: 12px 8px; text-align: center; }
.brief-stat-link { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.brief-stat-link:active { transform: scale(0.98); }
.brief-stat-link.brief-stat-active { outline: 2px solid var(--primary, #818cf8); outline-offset: 2px; }
.brief-inbox-item .brief-tag { font-size: 10px; margin-right: 4px; }
.brief-stat-val { display: block; font-size: 22px; font-weight: 700; }
.brief-stat-lbl { font-size: 11px; color: var(--text-muted, #94a3b8); }
.brief-card { background: var(--bg-card, #1e293b); border: 1px solid var(--border, #334155); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.brief-card h2 { font-size: 15px; margin: 0 0 8px; }
.brief-hint { font-size: 12px; color: var(--text-muted, #94a3b8); margin: 0 0 10px; }
.brief-list { list-style: none; margin: 0; padding: 0; }
.brief-item { padding: 10px 0; border-bottom: 1px solid var(--border, #334155); }
.brief-empty, .brief-recent-heading { color: var(--text-muted, #94a3b8); font-size: 13px; }
.brief-recent-item a { color: var(--primary, #818cf8); }
.brief-footer { text-align: center; margin-top: 16px; }
.brief-footer-link { display: block; min-height: 44px; line-height: 44px; color: var(--primary, #818cf8); }

.gov-btn-primary { background: var(--primary, #6366f1); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.gov-btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.gov-btn-danger { background: var(--danger, #ef4444); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; }
.gov-modal { background: var(--bg-card, #1e293b); border: 1px solid var(--border); border-radius: 14px; padding: 20px; max-width: 420px; width: 100%; }
.gov-modal-title { margin: 0 0 10px; font-size: 16px; }
.gov-modal-body { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.gov-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-carbon-ack { cursor: pointer; padding: 6px 12px; border-radius: 6px; border: 0; background: var(--primary, #6366f1); color: #fff; font-size: 12px; }
.office-ack-row, .brief-ack-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.ack-notes { flex: 1; min-width: 120px; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border, #334155); background: var(--surface, #1e293b); color: inherit; font-size: 12px; }
.attention-bar-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.attention-bar-item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border, #334155); background: var(--surface, #1e293b); color: inherit; font-size: 13px; text-decoration: none; }
.attention-bar-item:hover { border-color: var(--primary, #6366f1); }
.attention-bar-item.kind-sign { border-color: #f59e0b55; }
.attention-bar-item.kind-read { border-color: #818cf855; }
.attention-bar-progress { font-size: 11px; opacity: .75; }
.view-toggle { margin-left: auto; display: inline-flex; gap: 4px; }
.view-btn { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border, #334155); background: transparent; color: inherit; cursor: pointer; font-size: 12px; }
.view-btn.active { background: var(--primary, #6366f1); border-color: transparent; color: #fff; }
.overview-bars-section { margin-bottom: 20px; }
.overview-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.overview-toolbar .meta-line { margin: 0; flex: 1; }
.overview-config-btn {
  padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border, #334155);
  background: rgba(99, 102, 241, 0.12); color: inherit; cursor: pointer; font-size: 12px;
}
.overview-config-panel {
  background: var(--bg-card, #1e293b); border: 1px solid var(--border, #334155);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
}
.overview-config-panel.hidden { display: none; }
.overview-config-title { font-size: 11px; color: var(--text-muted, #94a3b8); margin: 10px 0 6px; font-weight: 600; }
.overview-config-title:first-child { margin-top: 0; }
.overview-col-preview { margin: 0 0 4px; font-size: 11px; color: var(--text-muted, #94a3b8); }
.overview-col-drag-hint { margin: 0 0 8px; font-size: 11px; color: var(--text-muted, #64748b); }
.occ-drag-demo { color: var(--primary, #818cf8); letter-spacing: -2px; font-weight: 700; }
.overview-col-config-grid { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.occ-row {
  display: grid;
  grid-template-columns: 22px 28px 56px 48px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 12px;
}
.occ-drag {
  cursor: grab;
  color: var(--text-muted, #64748b);
  text-align: center;
  font-size: 12px;
  line-height: 1;
  letter-spacing: -2px;
  user-select: none;
  touch-action: none;
}
.occ-drag:active { cursor: grabbing; }
.occ-row.occ-dragging { opacity: 0.45; }
.occ-row.occ-drag-over {
  outline: 1px dashed var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.12);
}
.occ-drag-head { width: 22px; }
.occ-row.occ-head {
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  font-size: 11px;
  border-bottom: 1px solid var(--border, #334155);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.occ-row[data-col-key="slug"] { background: rgba(99, 102, 241, 0.06); }
.occ-row[data-col-key="label"] { background: rgba(99, 102, 241, 0.03); }
.occ-order { text-align: center; color: var(--text-muted, #64748b); font-size: 11px; }
.occ-label { font-weight: 600; color: var(--text, #e2e8f0); white-space: nowrap; }
.occ-hint { color: var(--text-muted, #94a3b8); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.occ-switch { display: flex; justify-content: center; position: relative; z-index: 1; }
.overview-col-toggles .gov-switch-wrap { margin: 0 auto; }
.overview-col-config-head.occ-row { margin-bottom: 0; }
.overview-col-toggles, .overview-sort-toggles, .overview-card-toggles {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
}
.overview-col-toggles { display: block; flex-wrap: unset; gap: 0; }
.overview-prefs-reset { margin-top: 12px; font-size: 12px; }
.gov-switch-wrap { display: inline-flex; cursor: pointer; line-height: 0; }
.gov-switch-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 12px; }
.gov-switch-label { min-width: 4.5em; color: var(--text-muted, #cbd5e1); }
.gov-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.gov-switch-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.gov-switch-slider {
  position: absolute; inset: 0; background: #475569; border-radius: 999px; transition: background 0.2s;
  pointer-events: none;
}
.gov-switch-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.2s;
}
.gov-switch-input:checked + .gov-switch-slider { background: var(--primary, #6366f1); }
.gov-switch-input:checked + .gov-switch-slider::before { transform: translateX(18px); }
.gov-switch-input:focus-visible + .gov-switch-slider { outline: 2px solid var(--primary, #6366f1); outline-offset: 2px; }
.overview-bars-table-wrap { overflow-x: auto; }
.overview-bars-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.overview-bars-table thead {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  border-bottom: 1px solid var(--border, #334155);
}
.overview-bars-table th,
.overview-bars-table td {
  padding: 8px 6px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overview-col-head {
  position: relative;
  font-weight: 600;
  white-space: nowrap;
}
.overview-th-label { display: inline-block; max-width: calc(100% - 10px); overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.overview-col-center, .ob-seq, .ob-badge { text-align: center; }
.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
}
.col-resize-handle:hover,
body.col-resizing .col-resize-handle {
  background: rgba(99, 102, 241, 0.45);
}
body.col-resizing {
  cursor: col-resize !important;
  user-select: none;
}
.overview-bar-row { border-bottom: 1px solid var(--border, #334155); }
.ob-cell { min-width: 0; }
.ob-label a, .ob-slug a { color: var(--primary, #818cf8); text-decoration: none; }
.overview-bars-table th[data-col="label"],
.overview-bars-table td[data-col="label"] { text-align: left; }
.overview-bars-table th[data-col="slug"],
.overview-bars-table td[data-col="slug"] { text-align: left; font-size: 12px; }
.overview-bars-table th[data-col="slug"] { color: var(--primary, #a5b4fc); }
.overview-bars-table th[data-col="label"] { color: var(--text-muted, #cbd5e1); }
.ob-label a { font-weight: 500; word-break: break-word; }
.ob-slug a { font-size: 12px; word-break: break-all; }
.ob-id { font-size: 11px; color: var(--text-muted, #cbd5e1); }
.ob-id.muted { opacity: 0.5; }
.ob-seq { color: var(--text-muted, #94a3b8); font-size: 12px; }
.ob-badge { font-size: 12px; }
.ob-bar .overview-bar-track { height: 8px; background: #334155; border-radius: 4px; overflow: hidden; }
.ob-bar .overview-bar-fill { height: 100%; background: var(--primary, #6366f1); border-radius: 4px; }
.tag-id { background: #1e3a5f; color: #93c5fd; font-size: 10px; margin-left: 6px; vertical-align: middle; }
.card-slug { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.col-badge { text-align: center; }
.project-grid.hidden-view { display: none; }
.overview-bars-section.hidden-view { display: none; }
.gir-fab { margin-left: auto; cursor: pointer; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--primary); background: rgba(99,102,241,.15); color: var(--text); font-size: 13px; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gir-drawer-head { position: relative; padding-right: 28px; }
.gir-drawer { position: fixed; top: 0; right: 0; z-index: 9000; width: min(400px, 94vw); height: 100vh; background: var(--bg-card); border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .22s; padding: 16px; display: flex; flex-direction: column; box-sizing: border-box; }
.gir-drawer.open { transform: translateX(0); }
.gir-close { position: absolute; top: 0; right: 0; border: 0; background: transparent; color: var(--text-muted); font-size: 22px; cursor: pointer; }
.gir-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.gir-chip { cursor: pointer; font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: rgba(99,102,241,.08); }
.gir-form { display: flex; gap: 8px; margin-bottom: 12px; }
.gir-form input { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.gir-results { flex: 1; overflow-y: auto; min-height: 120px; }
.gir-card { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.gir-card-title { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.gir-act-link { color: var(--primary); font-size: 13px; display: block; margin: 4px 0; }
.gir-act-hint { font-size: 12px; color: var(--text-muted); }
.gir-cites { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.gir-cite { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(99,102,241,.12); color: var(--text-muted); }
.gcs-attest { font-size: 12px; margin: 8px 0 0; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gcs-attest-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.gcs-attest-none { background: #94a3b8; }
.gcs-attest-ok { background: #22c55e; }
.gcs-block { margin: 10px 0; }
.gcs-h { font-size: 12px; color: var(--text-muted); margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.gcs-row { display: flex; flex-wrap: wrap; gap: 6px; }
.gcs-quick { font-size: 12px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; color: var(--primary); background: rgba(0,0,0,.15); }
.gcs-list { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.gcs-list li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.gcs-list a { color: var(--primary); text-decoration: none; }
.gcs-empty { color: var(--text-muted); font-style: italic; border-bottom: none !important; }
.gcs-pin-add { font-size: 11px; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text-muted); border-radius: 4px; padding: 1px 6px; }
.gcs-unpin { margin-left: 6px; cursor: pointer; border: 0; background: transparent; color: var(--text-muted); font-size: 11px; }
.org-disclaimer { margin-bottom: 12px; }
.org-tree-ascii { font-size: 12px; line-height: 1.45; background: rgba(0,0,0,.25); padding: 14px; border-radius: 8px; overflow-x: auto; }
.org-seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.org-seat-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: rgba(0,0,0,.12); }
.org-seat-attested { border-color: #22c55e88; }
.org-seat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.org-seat-id { font-family: monospace; font-weight: 700; font-size: 14px; color: var(--primary); }
.org-seat-title { margin: 0 0 4px; font-size: 14px; }
.org-seat-alias, .org-seat-line { margin: 0 0 6px; font-size: 12px; color: var(--text-muted); }
.org-seat-actions { margin: 8px 0; }
.org-attest-ok { color: #4ade80; }
.org-attest-none { color: var(--text-muted); }
.badge-ok { background: #166534; color: #bbf7d0; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.muted { opacity: .7; }

/* 侧栏跳转即时反馈：点了就有进度条，避免「按钮动了页面没反应」 */
#govNavProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  z-index: 10000; pointer-events: none;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  opacity: 0; transition: opacity .15s;
}
#govNavProgress.is-active {
  opacity: 1;
  animation: govNavProgressSweep 1.1s ease-in-out infinite;
}
@keyframes govNavProgressSweep {
  0% { width: 0; margin-left: 0; }
  50% { width: 70%; margin-left: 10%; }
  100% { width: 100%; margin-left: 0; }
}
html.gov-navigating { cursor: progress; }
.sidebar a.gov-nav-pending { opacity: .65; }
.gov-nav-flash { outline: 2px solid var(--primary, #818cf8); outline-offset: 4px; transition: outline-color .8s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; }
  .doc-sidebar { position: static; max-height: none; width: 100%; }
  .doc-sib-list { max-height: 220px; }
  .detail-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
}

/* 侧栏跳转即时反馈：点了就有进度条，避免「按钮动了页面没反应」 */
#govNavProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  z-index: 10000; pointer-events: none;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  opacity: 0; transition: opacity .15s;
}
#govNavProgress.is-active {
  opacity: 1;
  animation: govNavProgressSweep 1.1s ease-in-out infinite;
}
@keyframes govNavProgressSweep {
  0% { width: 0; margin-left: 0; }
  50% { width: 70%; margin-left: 10%; }
  100% { width: 100%; margin-left: 0; }
}
html.gov-navigating { cursor: progress; }
.sidebar a.gov-nav-pending { opacity: .65; }
.gov-nav-flash { outline: 2px solid var(--primary, #818cf8); outline-offset: 4px; }

/* 文档页：原生同帧链接（勿再做成 button+JS） */
.doc-nav-link {
  display: block; padding: 10px 20px; color: var(--text-muted, #94a3b8);
  text-decoration: none; font-size: 14px; border: 0; background: transparent; width: 100%;
  box-sizing: border-box; text-align: left; cursor: pointer;
}
.doc-nav-link:hover, .doc-nav-link.active {
  background: rgba(99,102,241,.1); color: var(--text, #e2e8f0);
  border-left: 3px solid var(--primary, #818cf8);
}
.doc-nav-top .doc-nav-btn { display: inline-flex; }
.doc-nav-fallback { margin: 8px 0 16px; line-height: 1.5; }
.doc-nav-fallback code { user-select: all; word-break: break-all; }


.intent-sign-panel { margin-bottom: 16px; border: 1px solid #a78bfa88; background: rgba(167, 139, 250, 0.08); }
.intent-sign-panel h3 { margin-top: 0; }
.stat-intent-sign { border-color: #a78bfa88; background: rgba(167, 139, 250, 0.08); }
.stat-intent-sign .stat-value { color: #c4b5fd; }
.roundtable-panel { margin-bottom: 16px; border: 1px solid #38bdf888; background: rgba(56, 189, 248, 0.07); }
.stat-roundtable { border-color: #38bdf888; background: rgba(56, 189, 248, 0.08); }
.stat-roundtable .stat-value { color: #7dd3fc; }
.carbon-shell-banner { border: 1px solid #94a3b888; background: rgba(148, 163, 184, 0.06); margin-bottom: 16px; }
.brief-stat-intent .brief-stat-val { color: #c4b5fd; }
.btn-intent-reject { margin-left: 6px; opacity: 0.85; }

.comm-plane-panel { margin-bottom: 16px; border: 1px solid #34d39988; background: rgba(52, 211, 153, 0.07); }
.comm-plane-panel .ok { color: #34d399; }
.comm-plane-panel .bad { color: #f87171; }
.rt-speak-box textarea { font-family: inherit; }

.xsys-fabric-panel { margin-bottom: 16px; border: 1px solid #f472b688; background: rgba(244, 114, 182, 0.06); }
.xsys-fabric-panel table.data-table td, .xsys-fabric-panel table.data-table th { padding: 6px 8px; }

/* CURRENT_SEAT soft banner + highlight */
.current-seat-banner { border: 1px solid #38bdf888; background: rgba(56, 189, 248, 0.08); margin-bottom: 16px; }
.current-seat-banner .ok { color: #34d399; }
.seat-row-current { background: rgba(56, 189, 248, 0.14); }
.seat-row-current td:first-child { box-shadow: inset 3px 0 0 #38bdf8; }
.current-seat-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.seat-select, #currentSeatSelect {
  display: inline-block;
  box-sizing: border-box;
  min-width: 18rem;
  width: auto;
  max-width: min(100%, 28rem);
  min-height: 2.5rem;
  padding: 8px 36px 8px 12px;
  border-radius: 8px;
  border: 1px solid #64748b;
  background-color: #0f172a;
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.4;
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.seat-select option, #currentSeatSelect option {
  background: #0f172a;
  color: #e2e8f0;
}
.seat-select:focus, #currentSeatSelect:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}
