/*
 * Shared visual baseline for Portal pages that have not yet moved to
 * portal/base.html. Keep this layer small: page-specific layouts stay in their
 * own stylesheet, while this file owns only canvas, type, surfaces, and focus.
 */
:root {
  --portal-canvas: #eef2f6;
  --portal-surface: #ffffff;
  --portal-surface-subtle: #f7f9fc;
  --portal-ink: #17212b;
  --portal-muted: #5b6875;
  --portal-border: #d7e0e8;
  --portal-blue: #2563eb;
  --portal-green: #15803d;
  --portal-gold: #b7791f;
  --portal-red: #c2414c;
  --portal-violet: #6d5bd0;
  --portal-focus: #2563eb;
  --portal-font: Inter, "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

html[data-theme="light"] {
  background: var(--portal-canvas);
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] {
  min-width: 320px;
  --accent: var(--portal-blue);
  --fg: var(--portal-ink);
  --muted: var(--portal-muted);
  --line: var(--portal-border);
  --good: var(--portal-green);
  --tone-sky: var(--portal-blue);
  background: var(--portal-canvas);
  color: var(--portal-ink);
  font-family: var(--portal-font);
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] .bg-orb,
body.with-sidebar.portal-shell-legacy[data-theme="light"] .bg-orb-a,
body.with-sidebar.portal-shell-legacy[data-theme="light"] .bg-orb-b,
body.with-sidebar.portal-shell-legacy[data-theme="light"] .bg-grid {
  display: none;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] .shell {
  color: var(--portal-ink);
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  .panel,
  .status,
  .metric,
  .account-directory-panel,
  .account-analytics-panel,
  .account-form-panel,
  .account-workflow-strip article,
  .suite-dashboard,
  .suite-control-card,
  .ops-dashboard,
  .ops-kpi,
  .ops-graph-card,
  .workflow-map,
  .workflow-lane-card,
  .card-form,
  .collapsible-card,
  .floating-panel,
  .prospect-panel,
  .prospect-card,
  .prospect-toolbar,
  .remediation-table-panel,
  .command-panel,
  .result-ring-card,
  .issue-expander,
  .root-cause-drawer
) {
  border-color: var(--portal-border);
  background: var(--portal-surface);
  color: var(--portal-ink);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 20px rgb(15 23 42 / 0.05);
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  .subhead,
  .muted,
  .eyebrow,
  small,
  .account-chart-stamp,
  .status-note
) {
  color: var(--portal-muted);
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  input,
  select,
  textarea
) {
  border-color: var(--portal-border);
  background: var(--portal-surface);
  color: var(--portal-ink);
  font: inherit;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  a,
  button,
  input,
  select,
  textarea,
  summary
):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--portal-focus) 32%, transparent);
  outline-offset: 2px;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] .btn:not(.ghost):not(.secondary) {
  border-color: var(--portal-blue) !important;
  background: var(--portal-blue) !important;
  color: #ffffff !important;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] .btn.secondary,
body.with-sidebar.portal-shell-legacy[data-theme="light"] .btn.ghost {
  border-color: var(--portal-border) !important;
  background: var(--portal-surface) !important;
  color: #1f4fb5 !important;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] .btn.secondary:hover,
body.with-sidebar.portal-shell-legacy[data-theme="light"] .btn.ghost:hover {
  border-color: #9db8ef;
  background: #edf4ff;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  .prospect-button,
  .prospect-link
) {
  border-color: var(--portal-border);
  background: var(--portal-surface);
  color: #1f4fb5;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] .prospect-button.primary {
  border-color: var(--portal-blue);
  background: var(--portal-blue);
  color: #ffffff;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  .prospect-button,
  .prospect-link
):hover {
  border-color: #9db8ef;
  background: #edf4ff;
}

/*
 * Growth tools retained their own dark-first page styles before the shared
 * legacy shell existed. These are intentionally narrow adapters: they keep
 * the scan/recon layouts and status colors while restoring the Portal's day
 * canvas, white working surfaces, and readable form controls.
 */
body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  .prospect-command-hero,
  .prospect-command-notes,
  .prospect-run-panel,
  .prospect-result-focus,
  .prospect-history-row,
  .prospect-context-section,
  .prospect-choice-group,
  .prospect-applicability-body,
  .prospect-supporting-research,
  .prospect-requirements-calculation,
  .prospect-card,
  .prospect-card-left,
  .prospect-card-findings,
  .prospect-finding,
  .prospect-stat,
  .prospect-batch,
  .prospect-table,
  .prospect-message,
  .system-message-card,
  .empty-state
) {
  border-color: var(--portal-border) !important;
  background: var(--portal-surface) !important;
  color: var(--portal-ink) !important;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 20px rgb(15 23 42 / 0.05);
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  .prospect-command-hero,
  .prospect-command-notes,
  .prospect-run-panel,
  .prospect-result-focus,
  .prospect-history-row,
  .prospect-context-section,
  .prospect-choice-group,
  .prospect-applicability-body,
  .prospect-supporting-research,
  .prospect-requirements-calculation,
  .prospect-card,
  .prospect-card-left,
  .prospect-card-findings,
  .prospect-finding,
  .prospect-panel,
  .prospect-stat,
  .prospect-batch,
  .prospect-table,
  .prospect-message,
  .system-message-card,
  .empty-state
) :is(h1, h2, h3, strong, summary, label, p, span, small, li, td, th) {
  color: var(--portal-ink);
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  .prospect-command-hero,
  .prospect-command-notes,
  .prospect-run-panel,
  .prospect-result-focus,
  .prospect-history-row,
  .prospect-context-section,
  .prospect-choice-group,
  .prospect-applicability-body,
  .prospect-supporting-research,
  .prospect-requirements-calculation,
  .prospect-card,
  .prospect-panel,
  .prospect-message,
  .system-message-card,
  .empty-state
) :is(p, small, .prospect-muted, .prospect-scan-detail, .prospect-field small) {
  color: var(--portal-muted);
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  .accessibility-prospect-runs,
  .prospect-shell
) :is(input, select, textarea) {
  border-color: var(--portal-border) !important;
  background: var(--portal-surface) !important;
  color: var(--portal-ink) !important;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] .accessibility-prospect-runs :is(
  .prospect-context-note,
  .prospect-inline-progress,
  .prospect-applicability-grid,
  .prospect-choice-group label
) {
  border-color: var(--portal-border) !important;
  background: var(--portal-surface-subtle) !important;
  color: var(--portal-ink) !important;
}

body.with-sidebar.portal-shell-legacy[data-theme="light"] :is(
  .accessibility-prospect-runs,
  .prospect-shell
) :is(a:not(.btn):not(.prospect-button):not(.prospect-link), .prospect-finding a) {
  color: #1f4fb5;
}

@media (max-width: 980px) {
  body.with-sidebar.portal-shell-legacy[data-theme="light"] .shell {
    min-width: 0;
  }
}
