:root {
  color-scheme: light;
  --ink: #18201c;
  --muted: #68716c;
  --paper: #f4f3ee;
  --panel: #fffefa;
  --line: #dedfd8;
  --line-strong: #c6cac1;
  --green: #1e5b42;
  --green-soft: #e2eee7;
  --lime: #dff36b;
  --orange: #df6d3f;
  --orange-soft: #f8e8df;
  --red: #a43f32;
  --red-soft: #f6e2df;
  --blue: #385d73;
  --blue-soft: #e2edf2;
  --shadow: 0 18px 45px rgba(35, 43, 38, .08);
  --radius: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(223, 109, 63, .35); outline-offset: 2px; }
.skip-link { position: fixed; left: 16px; top: 12px; transform: translateY(-160%); z-index: 20; background: var(--ink); color: white; padding: 10px 14px; border-radius: var(--radius-sm); transition: transform .2s var(--ease); }
.skip-link:focus { transform: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; display: flex; flex-direction: column; padding: 22px 16px 18px; background: #17211c; color: #f5f7f2; z-index: 10; }
.brand-lockup { display: flex; gap: 12px; align-items: center; padding: 0 10px 22px; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { font-size: 15px; letter-spacing: -.01em; }
.brand-lockup small { color: #96a29b; margin-top: 2px; font-size: 11px; }
.brand-mark { width: 32px; height: 32px; border: 1px solid #415048; border-radius: var(--radius-sm); display: flex; align-items: end; justify-content: center; gap: 3px; padding: 7px; background: #213028; }
.brand-mark i { width: 4px; border-radius: var(--radius-full); background: var(--lime); display: block; }
.brand-mark i:nth-child(1) { height: 8px; opacity: .6; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 12px; opacity: .8; }
.workspace-switcher { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid #35443c; border-radius: var(--radius-md); background: #1d2a23; }
.workspace-switcher strong, .workspace-switcher small { display: block; }
.workspace-switcher strong { font-size: 12px; }
.workspace-switcher small { color: #92a198; font-size: 10px; margin-top: 2px; }
.workspace-avatar { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border-radius: var(--radius-sm); background: var(--lime); color: #233017; font-weight: 800; }
.side-nav { margin-top: 22px; display: grid; gap: 4px; }
.side-nav p { margin: 17px 10px 6px; color: #718078; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.side-nav button { width: 100%; min-height: 42px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 6px; border: 0; border-radius: var(--radius-sm); padding: 0 10px; background: transparent; color: #aeb9b3; text-align: left; cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease); }
.side-nav button:hover { background: #24332b; color: white; transform: translateX(2px); }
.side-nav button.is-active { background: #edf5e8; color: #203023; font-weight: 750; }
.side-nav button > span { font-size: 16px; text-align: center; }
.side-nav button b { min-width: 23px; padding: 3px 6px; border-radius: var(--radius-full); background: #314138; color: #bbc7c0; font-size: 9px; text-align: center; }
.side-nav button.is-active b { background: #d7e5d1; color: #38503d; }
.sidebar-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 13px 10px 2px; border-top: 1px solid #2e3c35; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 11px; }
.sidebar-foot small { color: #7d8d84; font-size: 9px; margin-top: 3px; }
.safety-dot { width: 9px; height: 9px; border-radius: var(--radius-full); background: var(--lime); outline: 4px solid rgba(223, 243, 107, .1); }
.main-column { grid-column: 2; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(244, 243, 238, .93); position: sticky; top: 0; z-index: 8; backdrop-filter: blur(14px); }
.breadcrumb { margin: 0; color: var(--muted); font-size: 12px; }
.breadcrumb span { color: #b4b9b3; margin: 0 6px; }
.breadcrumb b { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.quiet-button { border: 1px solid var(--line-strong); background: var(--panel); border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer; font-size: 11px; font-weight: 750; }
.quiet-button:hover { border-color: var(--ink); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-full); background: var(--ink); color: white; font-size: 10px; font-weight: 800; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }
.demo-banner { margin: 22px 34px 0; min-height: 52px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 10px 14px; border: 1px solid #d7d9c9; border-radius: var(--radius-md); background: #f8f8e9; }
.demo-banner p { margin: 0; color: #60645a; font-size: 11px; line-height: 1.5; }
.demo-banner strong { color: #31372f; }
.demo-banner a { font-size: 10px; font-weight: 800; text-underline-offset: 3px; }
.demo-badge { padding: 5px 7px; border-radius: var(--radius-sm); background: var(--lime); color: #29311e; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.view-root { flex: 1; padding: 28px 34px 48px; }
.loading-state { min-height: 400px; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loading-state span { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: var(--radius-full); animation: spin .8s linear infinite; }
.loading-state p { font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.page-heading p { margin: 0 0 7px; color: var(--orange); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 3.2vw, 46px); font-weight: 500; line-height: .98; letter-spacing: -.035em; }
.page-heading .heading-note { max-width: 390px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.metric-card { min-height: 132px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 17px; background: var(--panel); box-shadow: var(--shadow-sm); }
.metric-card header { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; }
.metric-card header i { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--green); }
.metric-card strong { display: block; margin: 17px 0 6px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); font-size: 9px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .85fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); overflow: hidden; box-shadow: var(--shadow-md); }
.panel-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 12px; }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.text-button { border: 0; background: none; color: var(--green); padding: 6px; font-size: 10px; font-weight: 800; cursor: pointer; }
.pipeline { padding: 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pipeline-step { position: relative; min-height: 120px; padding: 13px; border-radius: var(--radius-md); background: #f1f2ec; }
.pipeline-step::after { content: ""; position: absolute; top: 25px; right: -8px; width: 8px; height: 1px; background: var(--line-strong); }
.pipeline-step:last-child::after { display: none; }
.pipeline-step b { display: block; font-size: 9px; color: var(--muted); }
.pipeline-step strong { display: block; margin: 18px 0 4px; font-size: 22px; }
.pipeline-step span { font-size: 9px; color: var(--muted); }
.pipeline-step.is-current { color: #f8faf7; background: var(--green); }
.pipeline-step.is-current b, .pipeline-step.is-current span { color: #bdd5c7; }
.issue-list, .audit-list, .source-list, .claim-list, .content-list { list-style: none; padding: 0; margin: 0; }
.issue-list li, .audit-list li { display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.issue-list li:last-child, .audit-list li:last-child { border-bottom: 0; }
.issue-icon { width: 28px; height: 28px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); font-weight: 900; }
.issue-list strong, .audit-list strong { display: block; font-size: 10px; line-height: 1.35; }
.issue-list small, .audit-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.approval-card { margin-top: 16px; padding: 18px; border-radius: var(--radius-lg); background: var(--ink); color: white; overflow: hidden; position: relative; }
.approval-card::after { content: ""; position: absolute; width: 130px; height: 130px; border: 26px solid rgba(223,243,107,.13); border-radius: var(--radius-full); right: -60px; bottom: -65px; }
.approval-card p { color: #aeb9b3; font-size: 9px; margin: 0 0 8px; }
.approval-card strong { display: block; max-width: 240px; font-family: Georgia, serif; font-size: 22px; font-weight: 500; line-height: 1.05; }
.approval-card button { position: relative; z-index: 1; margin-top: 19px; border: 0; border-radius: var(--radius-sm); background: var(--lime); color: #243016; padding: 9px 12px; font-size: 10px; font-weight: 850; cursor: pointer; }
.table-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--panel); }
.data-row { display: grid; align-items: center; gap: 14px; padding: 15px 17px; border-bottom: 1px solid var(--line); transition: background .2s var(--ease); }
.data-row:last-child { border-bottom: 0; }
.data-row:hover { background: #fafaf6; }
.source-row { grid-template-columns: minmax(190px, 1.5fr) 110px 95px 90px auto; }
.claim-row { grid-template-columns: minmax(250px, 1.7fr) 100px 100px auto; }
.query-row { grid-template-columns: minmax(250px, 1.6fr) 120px 85px 100px; }
.data-row.header { min-height: 40px; padding-top: 10px; padding-bottom: 10px; background: #eeefe9; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.data-primary strong { display: block; font-size: 11px; }
.data-primary small { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; }
.cell-text { color: #4f5a54; font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; width: fit-content; border-radius: var(--radius-full); padding: 5px 8px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: var(--radius-full); background: currentColor; }
.status-pill.warning, .status-pill.evidence_gap, .status-pill.needs_review, .status-pill.changes_requested { background: var(--orange-soft); color: var(--orange); }
.status-pill.blocked { background: var(--red-soft); color: var(--red); }
.status-pill.in_review { background: var(--blue-soft); color: var(--blue); }
.status-pill.drafted { background: #eee9f5; color: #6a4d81; }
.row-action { border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; padding: 6px 8px; cursor: pointer; font-size: 9px; font-weight: 800; }
.row-action:hover { border-color: var(--ink); }
.source-detail { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(230px, .65fr); gap: 14px; }
.detail-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); padding: 20px; }
.detail-card > p { color: var(--muted); line-height: 1.7; font-size: 11px; }
.detail-card h2 { margin: 0 0 12px; font-family: Georgia, serif; font-weight: 500; font-size: 24px; }
.detail-meta { display: grid; gap: 10px; }
.detail-meta div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 9px; }
.detail-meta span { color: var(--muted); }
.query-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.query-column { min-width: 0; border-radius: var(--radius-lg); background: #e9eae4; padding: 10px; }
.query-column > header { display: flex; justify-content: space-between; padding: 7px 5px 12px; font-size: 10px; font-weight: 850; }
.query-card { margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 13px; }
.query-card:last-child { margin-bottom: 0; }
.query-card p { margin: 0 0 13px; font-size: 11px; font-weight: 700; line-height: 1.45; }
.query-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 8px; }
.priority { width: 7px; height: 7px; display: inline-block; border-radius: var(--radius-full); background: var(--orange); margin-right: 4px; }
.priority.medium { background: #d5ad45; }
.brief-grid, .content-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.brief-card, .content-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); padding: 18px; box-shadow: var(--shadow-sm); }
.brief-card header, .content-card header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.brief-card h2, .content-card h2 { margin: 16px 0 9px; font-family: Georgia, serif; font-size: 23px; font-weight: 500; line-height: 1.08; }
.brief-card p, .content-card p { color: var(--muted); font-size: 10px; line-height: 1.6; }
.brief-card footer, .content-card footer { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mini-stack { display: flex; }
.mini-stack span { width: 25px; height: 25px; display: grid; place-items: center; margin-left: -5px; border: 2px solid var(--panel); border-radius: var(--radius-full); background: #e6e9e2; color: #536057; font-size: 7px; font-weight: 850; }
.mini-stack span:first-child { margin-left: 0; }
.content-card.is-approved { border-color: #a9c5b4; border-top: 3px solid var(--green); }
.risk-list { display: grid; gap: 7px; margin-top: 14px; }
.risk-item { display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center; padding: 8px 9px; border-radius: var(--radius-sm); background: #f2f3ee; font-size: 8px; }
.risk-item i { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--green); }
.risk-item.warning i { background: var(--orange); }
.risk-item.blocked i { background: var(--red); }
.export-group { display: flex; gap: 6px; }
.export-link { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius-sm); padding: 7px 9px; text-decoration: none; font-size: 8px; font-weight: 850; }
.export-link:hover { background: var(--ink); color: white; }
.export-link.is-disabled { border-color: var(--line); color: #9aa19c; pointer-events: none; }
.audit-list li { grid-template-columns: 110px 1fr auto; align-items: center; }
.audit-time { color: var(--muted); font-size: 9px; }
.audit-actor { font-size: 9px; color: var(--muted); }
.empty-error { padding: 50px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.app-footer { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.app-footer nav { display: flex; gap: 14px; }
.app-footer a { text-underline-offset: 3px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 320px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--ink); color: white; box-shadow: var(--shadow-md); font-size: 10px; }
@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .query-board { grid-template-columns: 1fr; }
  .source-row { grid-template-columns: minmax(180px, 1fr) 100px 90px auto; }
  .source-row > :nth-child(4) { display: none; }
  .claim-row { grid-template-columns: minmax(220px, 1fr) 90px 90px auto; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .main-column { min-height: 100vh; }
  .topbar { height: 62px; padding: 0 16px; }
  .mobile-menu { display: inline-block; margin-right: 8px; }
  .demo-banner { margin: 14px 16px 0; grid-template-columns: auto 1fr; }
  .demo-banner a { display: none; }
  .view-root { padding: 22px 16px 36px; }
  .page-heading { align-items: start; flex-direction: column; gap: 10px; }
  .page-heading h1 { font-size: 34px; }
  .metric-grid, .brief-grid, .content-list { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-step { min-height: auto; }
  .pipeline-step::after { display: none; }
  .source-row, .claim-row, .query-row { grid-template-columns: 1fr auto; }
  .data-row.header { display: none; }
  .source-row > :not(.data-primary):not(:last-child), .claim-row > :not(.data-primary):not(:last-child), .query-row > :not(.data-primary):not(:last-child) { display: none; }
  .source-detail { grid-template-columns: 1fr; }
  .audit-list li { grid-template-columns: 1fr; gap: 4px; }
  .app-footer { padding: 18px 16px; flex-direction: column; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.legal-page { min-height: 100vh; padding: 42px 18px 80px; background: var(--paper); }
.policy-shell { width: min(760px, 100%); margin: 0 auto; }
.policy-back { display: inline-flex; margin-bottom: 70px; color: var(--muted); font-size: 11px; font-weight: 750; text-decoration: none; }
.policy-back:hover { color: var(--ink); }
.policy-kicker { color: var(--orange); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.policy-shell > h1 { max-width: 650px; margin: 12px 0 8px; font-family: Georgia, serif; font-size: clamp(42px, 7vw, 72px); font-weight: 500; line-height: .95; letter-spacing: -.045em; }
.policy-date { color: var(--muted); font-size: 10px; }
.policy-shell article { margin-top: 48px; border-top: 1px solid var(--line-strong); }
.policy-shell article h2 { margin: 0; padding-top: 28px; font-size: 13px; }
.policy-shell article p { max-width: 680px; margin: 8px 0 0; color: #505b55; font-family: Georgia, serif; font-size: 17px; line-height: 1.72; }
.policy-shell article a { color: var(--green); text-underline-offset: 3px; }

