/* Shared finishing layer for the workspace and its public preview. */
.ide-page {
  --ink: #17263b;
  --muted: #647184;
  --line: #e4e8ee;
  --blue: #0966b7;
  --ui-canvas: #ffffff;
  --ui-rail: #f8f9fb;
  --ui-surface: #ffffff;
  --ui-soft: #f3f5f8;
  --ui-hover: #edf1f6;
  --ui-selected: #eaf2fc;
  --ui-body: #46556a;
  --ui-border-strong: #ccd5e1;
  --ui-shadow: 0 4px 24px #17263b08;
  --desk-surface: var(--ui-surface);
  --desk-soft: var(--ui-soft);
  --workflow-input-bg: var(--ui-surface);
  padding: 0;
  background: var(--ui-canvas);
  color: var(--ink);
}
.ide-page[data-theme=dark] {
  --ink: #eeeff2;
  --muted: #9b9fa9;
  --line: #27292e;
  --blue: #89bfff;
  --ui-canvas: #080809;
  --ui-rail: #101012;
  --ui-surface: #121214;
  --ui-soft: #17171a;
  --ui-hover: #1e1e22;
  --ui-selected: #152231;
  --ui-body: #c2c5cd;
  --ui-border-strong: #393b43;
  --ui-shadow: 0 4px 28px #0003;
}
.ide-page .workspace { border: 0; border-radius: 0; background: var(--ui-canvas); }
.ide-page .app-topbar { background: var(--ui-canvas); border-color: var(--line); box-shadow: none; }
.ide-page .app-wordmark { color: var(--ink); font-size: .875rem; letter-spacing: .12em; }
.ide-page .app-divider { color: var(--ui-border-strong); }
.ide-page .ide-team-shortcut { display: inline-flex; border-color: transparent; background: transparent; color: var(--muted); border-radius: 7px; letter-spacing: 0; font-size: .875rem; box-shadow: none; }
.ide-page .ide-team-shortcut:hover { background: var(--ui-soft); color: var(--ink); }
.ide-page .ide-team-shortcut[aria-current=page] { color: var(--blue); background: var(--ui-selected); }
.ide-page .module-nav { gap: 0; }
.ide-page .module-nav > button { color: var(--muted); font-size: .875rem; padding-inline: 11px; }
.ide-page .module-nav > button:hover { background: var(--ui-soft); color: var(--ink); }
.ide-page .module-nav > button[aria-current=page] { color: var(--blue); border-bottom-color: var(--blue); background: transparent; }
.ide-page .module-nav > button > span { background: transparent; color: var(--muted); font-size: .75rem; padding: 0; font-variant-numeric: tabular-nums; }
.ide-page .module-nav > button > span:empty { display: none; }
.ide-page .module-nav > button > span.attention { background: var(--ui-soft); color: var(--desk-warning,#926b31); padding-inline: 4px; }
.ide-page .workspace-controls { border-color: var(--line); padding-left: 14px; }
.ide-page .toolbar-button { border-color: var(--line); background: var(--ui-canvas); color: var(--muted); border-radius: 7px; font-size: .875rem; gap: 8px; }
.ide-page .toolbar-button:hover { border-color: var(--ui-border-strong); color: var(--ink); }
.ide-page .toolbar-button.active { border-color: var(--ui-border-strong); color: var(--ink); background: var(--ui-soft); }
.ide-page #source-count { color: var(--muted); font-size: .75rem; }
.ide-page .app-body, .ide-page .analysis-pane, .ide-page .module-pane { background: var(--ui-canvas); }
.ide-page .app-sidebar { background: var(--ui-rail); border-color: var(--line); padding: 24px 14px 16px; }
.ide-page .sidebar-section-heading { margin-bottom: 12px; padding-inline: 10px; }
.ide-page .sidebar-section-heading h2 { color: var(--muted); font-size: .875rem; font-weight: 500; }
.ide-page .text-button { color: var(--muted); font-size: .875rem; }
.ide-page .text-button:hover { color: var(--blue); text-decoration: none; }
.ide-page #new-project { font-size: .75rem; }
.ide-page .project-item, .ide-page .task-item { color: var(--ui-body); padding: 11px 10px; border-radius: 7px; font-size: .875rem; gap: 10px; }
.ide-page .project-item:hover, .ide-page .task-item:hover { background: var(--ui-hover); color: var(--ink); }
.ide-page .project-item.active { background: var(--ui-selected); color: var(--blue); box-shadow: none; }
.ide-page .task-item.active { color: var(--ink); background: var(--ui-surface); box-shadow: inset 2px 0 var(--blue), 0 1px 4px #17263b06; }
.ide-page .project-count, .ide-page .task-count { color: var(--muted); font-size: .75rem; }
.ide-page .task-section { border-color: var(--line); padding-top: 22px; margin-top: 20px; }
.ide-page .task-project-label { color: var(--muted); font-size: .75rem; margin-bottom: 14px; }
.ide-page .project-home-link { color: var(--muted); margin-top: 8px; padding: 10px; border-radius: 7px; }
.ide-page .project-home-link:hover, .ide-page .project-home-link[aria-current=page] { background: var(--ui-hover); color: var(--ink); }
.ide-page .new-task { color: var(--ink); background: var(--ui-surface); border-color: var(--ui-border-strong); border-radius: 7px; min-height: 42px; margin-bottom: 12px; }
.ide-page .new-task:hover { border-color: var(--blue); background: var(--ui-surface); }
.ide-page .start-workflow { font-size: .8125rem; margin-bottom: 16px; }
.ide-page .draft-badge { font-size: .75rem; background: var(--ui-soft); color: var(--muted); padding: 1px 5px; }
.ide-page .sidebar-footer { padding-top: 8px; }
.ide-page .appearance-settings > summary, .ide-page .sidebar-team { background: transparent; border-color: transparent; color: var(--muted); border-radius: 7px; font-size: .875rem; padding: 8px 10px; }
.ide-page .appearance-settings > summary:hover, .ide-page .sidebar-team:hover { background: var(--ui-hover); border-color: transparent; color: var(--ink); }
.ide-page .sidebar-team[aria-current=page] { color: var(--blue); background: var(--ui-selected); }
.ide-page .settings-symbol { background: transparent; color: inherit; width: 18px; height: 18px; }
.ide-page .settings-symbol svg { width: 16px; height: 16px; }
.ide-page .sidebar-team .team-count { font-size: .75rem; background: var(--ui-soft); color: var(--muted); }
.ide-page .sidebar-preview, .ide-page .sidebar-preview span { color: var(--muted); font-size: .75rem; line-height: 1.6; }
.ide-page .appearance-menu { width: min(220px,100%); background: var(--ui-surface); border-color: var(--line); }
.ide-page .appearance-menu > p { font-size: .75rem; }
.ide-page .appearance-menu label { color: var(--ui-body); font-size: .875rem; }
.ide-page .appearance-menu label:hover { color: var(--ink); background: var(--ui-soft); }
.ide-page .task-content { padding: 28px 32px 24px; scrollbar-color: var(--ui-border-strong) transparent; }
.ide-page .task-heading { margin-bottom: 20px; align-items: center; }
.ide-page .task-project { color: var(--muted); font-size: .8125rem; margin-bottom: 6px; }
.ide-page .task-heading h1 { color: var(--ink); font-size: 2.125rem; line-height: 1.15; letter-spacing: -.025em; font-weight: 600; }
.ide-page .task-status { margin-top: 20px; padding: 3px 8px; font-size: .75rem; border-color: var(--line); color: var(--muted); background: transparent; border-radius: 5px; }
.ide-page .workflow-bar { gap: 12px; margin-bottom: 12px; }
.ide-page .workflow-steps { font-size: .8125rem; }
.ide-page .workflow-steps li { gap: 6px; }
.ide-page .workflow-steps li + li:before { width: 15px; margin-inline: 8px; }
.ide-page .workflow-status { padding: 5px 9px; font-size: .8125rem; border-radius: 6px; }
.ide-page .workflow-status:hover { background: var(--ui-soft); border-color: var(--ui-border-strong); }
.ide-page .workflow-scope { padding: 12px 0; gap: 12px 22px; }
.ide-page .workflow-fact { min-width: 90px; gap: 3px; }
.ide-page .workflow-details { margin-bottom: 16px; padding-block: 9px; }
.ide-page .workflow-details > summary { font-size: .8125rem; }
.ide-page .context-placeholder { gap: 12px; font-size: .8125rem; }
.ide-page .question-block { padding: 16px 18px; margin-bottom: 26px; background: var(--ui-soft); border: 0; border-radius: 9px; }
.ide-page .question-label { color: var(--muted); font-size: .75rem; font-weight: 500; letter-spacing: .02em; margin-bottom: 5px; }
.ide-page .question-block h2 { color: var(--ui-body); font-size: 1rem; line-height: 1.65; }
.ide-page .section-label { color: var(--muted); font-size: .75rem; margin-bottom: 14px; }
.ide-page .answer { color: var(--ui-body); font-size: 1rem; line-height: 1.8; }
.ide-page .determination-meta { color: var(--muted); gap: 8px 14px; font-size: .75rem; margin-bottom: 16px; }
.ide-page .result-badge { background: var(--ui-selected); color: var(--blue); border-color: transparent; border-radius: 5px; padding: 4px 9px; }
.ide-page .answer-conclusion { color: var(--ink); font-size: clamp(2rem,2.35vw,2.5rem); line-height: 1.17; letter-spacing: -.025em; margin-bottom: 26px; max-width: 25em; }
.ide-page .answer-subheading { color: var(--ink); font-size: .875rem; font-weight: 500; margin-bottom: 10px; }
.ide-page #demo-answer > p { max-width: 72ch; margin-bottom: 20px; }
.ide-page .answer-scope { border-color: var(--ui-border-strong); margin-top: 26px; padding-left: 16px; }
.ide-page .answer-scope p { color: var(--muted); font-size: .875rem; }
.ide-page .citation { min-width: 25px; min-height: 25px; border-color: transparent; border-radius: 5px; background: var(--ui-selected); color: var(--blue); font-size: .75rem; margin-left: 5px; }
.ide-page .citation:hover, .ide-page .citation.selected { border-color: var(--blue); }
.ide-page .further-explanation { background: var(--ui-soft); border-color: var(--line); border-radius: 9px; }
.ide-page .analysis-note, .ide-page .review-note { color: var(--muted); font-size: .75rem; }
.ide-page .answer-authorities { border-color: var(--line); padding-top: 22px; margin-top: 30px; }
.ide-page .output-section-heading h3 { color: var(--ink); font-size: 1.5rem; }
.ide-page .output-section-heading > span { font-size: .75rem; color: var(--muted); }
.ide-page .answer-source { background: transparent; border-color: var(--line); border-radius: 8px; padding: 14px 16px; }
.ide-page .authority-number { color: var(--blue); background: var(--ui-selected); border-radius: 5px; }
.ide-page .authority-card-heading h4 { color: var(--ink); }
.ide-page .authority-summary { color: var(--ui-body); font-size: .875rem; }
.ide-page .authority-identifier, .ide-page .authority-relevance, .ide-page .source-kind { color: var(--muted); font-size: .75rem; }
.ide-page .output-actions { gap: 8px; }
.ide-page .output-actions .button, .ide-page .output-actions .secondary-button { padding-inline: 13px; font-size: .875rem; }
.ide-page #task-composer { background: var(--ui-canvas); padding: 10px 32px max(10px,env(safe-area-inset-bottom)); }
.ide-page .composer-box { background: var(--ui-surface); border-color: var(--ui-border-strong); border-radius: 16px; padding: 14px 14px 10px; box-shadow: var(--ui-shadow); }
.ide-page .composer-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue) 8%,transparent); }
.ide-page #task-composer textarea { color: var(--ink); font-size: 1rem; line-height: 1.6; padding: 2px 4px 10px; }
.ide-page #task-composer textarea::placeholder { color: var(--muted); }
.ide-page .add-context { color: var(--muted); border-radius: 7px; }
.ide-page .add-context:hover { background: var(--ui-soft); color: var(--ink); }
.ide-page .composer-send { width: 36px; height: 36px; min-width: 36px; min-height: 36px; background: #0966b7; color: #fff; border-radius: 11px; box-shadow: none; }
.ide-page .composer-send:hover { background: #07549a; }
.ide-page .preview-notice { margin: 6px 0 0; font-size: .75rem; color: var(--muted); }
.ide-page .authority-pane { background: var(--ui-rail); border-color: var(--line); padding: 28px 22px 24px; scrollbar-width: thin; scrollbar-color: var(--ui-border-strong) transparent; }
.ide-page .authority-heading { background: var(--ui-rail); align-items: center; }
.ide-page .authority-heading h2 { color: var(--ink); font-size: 1.875rem; letter-spacing: -.02em; }
.ide-page .panel-close { width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 6px; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.ide-page .panel-close span { display: none; }
.ide-page .panel-close:hover { color: var(--ink); background: var(--ui-hover); }
.ide-page .source-context { color: var(--muted); margin: 8px 0 18px; font-size: .8125rem; }
.ide-page .source-filter-row { margin-bottom: 14px; }
.ide-page .source-filter-row select { background: var(--ui-surface); color: var(--muted); border-color: var(--line); border-radius: 6px; font-size: .8125rem; }
.ide-page .source-cards { gap: 12px; }
.ide-page .source-card { background: var(--ui-surface); border-color: var(--line); padding: 17px 15px; border-radius: 9px; box-shadow: none; }
.ide-page .source-card.selected { border-color: var(--ui-border-strong); }
.ide-page .source-card.inspected { background: var(--ui-surface); border-color: var(--blue); box-shadow: inset 2px 0 var(--blue); }
.ide-page .source-card-heading { gap: 8px 10px; grid-template-columns: 26px minmax(0,1fr); }
.ide-page .source-number { min-width: 26px; min-height: 27px; background: var(--ui-selected); color: var(--blue); border-radius: 5px; font-size: 1.25rem; }
.ide-page .source-title { color: var(--ink); font-size: 1.3125rem; line-height: 1.2; }
.ide-page .source-link { font-size: .8125rem; color: var(--blue); }
.ide-page .source-summary, .ide-page .source-meta, .ide-page .source-detail { margin-left: 36px; }
.ide-page .source-summary { font-size: .875rem; line-height: 1.65; color: var(--ui-body); margin-top: 12px; }
.ide-page .source-meta { font-size: .75rem; color: var(--muted); }
.ide-page .source-detail { border-color: var(--line); padding-top: 14px; }
.ide-page .source-detail p { color: var(--ui-body); font-family: var(--sans); font-size: .9375rem; line-height: 1.8; }
.ide-page .detail-label { color: var(--muted); font-size: .75rem; letter-spacing: .02em; }
.ide-page .authority-note { color: var(--muted); font-size: .75rem; line-height: 1.65; }
.ide-page .module-pane { color: var(--ui-body); padding: 32px 40px; }
.ide-page .module-heading { margin-bottom: 28px; }
.ide-page .module-project { font-size: .8125rem; color: var(--muted); }
.ide-page .module-heading h1 { color: var(--ink); font-size: 2.5rem; letter-spacing: -.025em; }
.ide-page #module-description { color: var(--muted); font-size: 1rem; line-height: 1.65; }
.ide-page .module-preview { color: var(--muted); background: transparent; border-color: var(--line); font-size: .75rem; border-radius: 5px; }
.ide-page .module-metrics { background: var(--ui-rail); border-color: var(--line); border-radius: 9px; }
.ide-page .module-metric { border-color: var(--line); padding: 18px 22px; }
.ide-page .module-metric strong { color: var(--ink); }
.ide-page .module-metric span { color: var(--muted); font-size: .8125rem; }
.ide-page .module-search, .ide-page .module-select, .ide-page .as-of input { background: var(--ui-surface); color: var(--ink); border-color: var(--line); border-radius: 7px; font-size: .875rem; min-height: 40px; }
.ide-page .module-toolbar .button, .ide-page .module-toolbar .secondary-button { font-size: .875rem; }
.ide-page .module-note, .ide-page .row-meta, .ide-page .corpus-identifier, .ide-page .entity-relationship, .ide-page .entity-jurisdiction { font-size: .8125rem; color: var(--muted); }
.ide-page .row-note, .ide-page .policy-clause { font-size: .875rem; color: var(--ui-body); }
.ide-page .obligation-row, .ide-page .entity-card, .ide-page .corpus-card, .ide-page .ledger-card { background: var(--ui-canvas); border-color: var(--line); border-radius: 9px; }
.ide-page .obligation-main h2, .ide-page .entity-heading h2, .ide-page .corpus-card h2, .ide-page .ledger-card h2 { color: var(--ink); }
.ide-page .corpus-actions .text-button, .ide-page .corpus-actions a, .ide-page .ledger-actions .text-button, .ide-page .obligation-actions .text-button { font-size: .875rem; }
.ide-page .workspace-badge { font-size: .75rem; border-radius: 5px; }
.ide-page .fund-profile { background: var(--ui-rail); border-radius: 9px; }
.ide-page .project-desk-intro { padding-bottom: 24px; margin-bottom: 24px; }
.ide-page .desk-stats { padding: 0 0 24px; margin: 0; gap: 24px; border-bottom: 1px solid var(--line); }
.ide-page .desk-stat { padding: 0 12px 0 0; }
.ide-page .desk-stat > strong { font-size: 2.75rem; font-variant-numeric: lining-nums tabular-nums; }
.ide-page .desk-section-heading { margin: 24px 0 16px; }
.ide-page .desk-task-row { padding: 22px 12px; margin-inline: -12px; border-radius: 7px; gap: 24px; transition: background .15s; }
.ide-page .desk-task-row:hover { background: var(--ui-rail); }
.ide-page .desk-task-title { font-size: 1.5rem; }
.ide-page .desk-task-meta { margin-top: 8px; gap: 6px 14px; font-size: .875rem; }
.ide-page .desk-task-excerpt { margin-top: 8px; }
.ide-page .desk-task-actions { gap: 8px; }
.ide-page .desk-task-actions .text-button { font-size: .8125rem; }
.ide-page .desk-lower { margin-top: 24px; gap: 32px; }
.ide-page .desk-starters { padding-left: 32px; }
.ide-page .workspace-connection-card { border-radius: 9px; padding: 22px; }
.ide-page .workspace-connection-title h2 { font-size: 1.5rem; }
.ide-page .workspace-connection-title p, .ide-page .workspace-connection-aliases { font-size: .8125rem; }
.ide-page .workspace-connection-preview { font-size: .9375rem; }
.ide-page .workspace-connection-actions .button, .ide-page .workspace-connection-actions .secondary-button { font-size: .875rem; }
.ide-page .button { border-radius: 7px; background: #0966b7; color: #fff; border-color: #0966b7; box-shadow: none; }
.ide-page .button:not(:disabled):hover { background: #07549a; transform: none; }
.ide-page .secondary-button { color: var(--ui-body); background: var(--ui-surface); border-color: var(--ui-border-strong); border-radius: 7px; }
.ide-page .secondary-button:hover { background: var(--ui-soft); color: var(--ink); }
.ide-page dialog { border-color: var(--line); border-radius: 14px; background: var(--ui-surface); color: var(--ink); }
.ide-page dialog::backdrop { background: #0b15295c; backdrop-filter: blur(5px); }
.ide-page[data-theme=dark] dialog::backdrop { background: #0009; }
.ide-page .template-option { border-radius: 9px; }
.ide-page .template-option:hover { background: var(--ui-soft); }
.ide-page .context-section-title, .ide-page dialog label { color: var(--ui-body); }
.ide-page .context-file-name { color: var(--ink); font-size: .875rem; }
.ide-page .context-file-meta, .ide-page .context-feedback, .ide-page #context-form > .dialog-note { font-size: .75rem; color: var(--muted); }
.ide-page #context-form label, .ide-page #workspace-fields label { font-size: .875rem; }
.ide-page #context-form input, .ide-page #context-form textarea, .ide-page #workspace-fields input, .ide-page #workspace-fields select, .ide-page #workspace-fields textarea { font-size: 1rem; }
.ide-page :is(button,a,select,input,textarea,summary):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.ide-page * { scrollbar-width: thin; scrollbar-color: var(--ui-border-strong) transparent; }

/* Retain the desktop viewport on phones and the separate scrolling work panes. */
@media (min-width: 901px) {
  .ide-page .app-body { grid-template-columns: 228px minmax(0,1fr) clamp(320px,25vw,380px); }
  .ide-page .app-body.sources-hidden { grid-template-columns: 228px minmax(0,1fr); }
  .ide-page .app-sidebar { overflow: hidden; }
  .ide-page #project-list { max-height: 28%; overflow-y: auto; flex-shrink: 1; min-height: 44px; }
  .ide-page .app-sidebar > .task-section { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 140px; overflow: hidden; }
  .ide-page .task-section > * { flex-shrink: 0; }
  .ide-page #task-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .ide-page .sources-hidden .task-content, .ide-page .sources-hidden #task-composer { padding-inline: max(36px,calc((100% - 900px)/2)); }
}
@media (min-width: 1051px) {
  .ide-page .app-topbar { padding-inline: 22px; gap: 16px; }
}
@media (min-width: 1500px) {
  .ide-page .app-body { grid-template-columns: 240px minmax(0,1fr) 380px; }
  .ide-page .app-body.sources-hidden { grid-template-columns: 240px minmax(0,1fr); }
  .ide-page .task-content, .ide-page #task-composer { padding-inline: max(40px,calc((100% - 860px)/2)); }
  .ide-page .module-pane { padding: 36px 48px; }
}
@media (min-width: 1051px) and (max-width: 1280px) {
  .ide-page .app-topbar { gap: 10px; padding-inline: 16px; }
  .ide-page .app-identity { gap: 8px; }
  .ide-page .app-wordmark { font-size: .8125rem; letter-spacing: .09em; gap: 8px; }
  .ide-page .ide-team-shortcut { padding-inline: 7px; }
  .ide-page .module-nav > button { padding-inline: 8px; }
  .ide-page .workspace-controls { padding-left: 10px; }
}
@media (max-height: 680px) and (min-width: 901px) {
  .ide-page .app-sidebar { padding-top: 18px; overflow-y: auto; }
  .ide-page .app-sidebar > .task-section { flex: 0 0 auto; min-height: 0; overflow: visible; }
  .ide-page #project-list { max-height: 128px; flex-shrink: 0; }
  .ide-page #task-list { flex: 0 0 auto; max-height: 220px; }
  .ide-page .task-section { margin-top: 14px; padding-top: 14px; }
  .ide-page .sidebar-footer { padding-top: 8px; }
  .ide-page .task-content { padding-top: 22px; }
  .ide-page .task-heading { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ide-page *, .ide-page *::before, .ide-page *::after { scroll-behavior: auto; transition: none; }
}
