/* Shared refinements: retain ClearSOC surfaces and palette across every workspace. */
:root { --sidebar-width: 252px; }
html { font-size: 14px; scroll-padding-top: 6rem; }
.app-shell { overflow: clip; }
.app-sidebar__inner { height: calc(100dvh - 1.5rem); min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: 1.1rem; }
.app-brand__eyebrow { font-size: .65rem; }
.app-brand__wordmark { margin: 0; font-size: 1.8rem; font-weight: 750; line-height: 1.15; }
.app-brand__meta { font-size: .72rem; }
.sidebar-nav__link { min-height: 42px; padding: .65rem .8rem; }
.sidebar-subnav__link { min-height: 38px; }
.app-sidebar__footer { margin-top: auto; }
.app-topbar { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 1.4rem; }
.app-topbar .section-label { font-size: .65rem; }
.app-topbar__title { font-size: 1rem; margin: 0; }
.app-help-link { display: inline-flex; align-items: center; gap: .5rem; color: var(--text-muted); white-space: nowrap; text-decoration: none; padding: .5rem; }
.app-help-link:hover { color: var(--text-strong); }
.app-main { padding: 1.4rem; }
.app-main > .container-fluid { padding-inline: 0; }
.app-main .form-control, .app-main .form-select { min-height: 40px; font-size: .95rem; }
.app-main .btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; white-space: normal; }
.app-main label { line-height: 1.45; }
.app-main :is(.cs-filter-field, .ai-efficiency-scope__item) { min-width: 0; }
.cs-filter-actions { flex-wrap: wrap; gap: .65rem; }
.filter-change-status { font-size: .8rem; color: var(--text-muted); flex-basis: 100%; }
.filter-change-status:empty { display: none; }
.app-main .analysis-data-table { min-width: 0; }
.app-main :is(.table-responsive, .cs-table-wrap) { max-width: 100%; overscroll-behavior-x: contain; }
.app-main :is(th, td) { vertical-align: middle; }
.app-main th { white-space: nowrap; }
.app-main :is(.cs-page-header, .ai-page-header, .ai-efficiency-header) { gap: 1rem; flex-wrap: wrap; }
a, button, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--accent-ai, #16b8a7) !important; outline-offset: 3px; }
#main-content:focus { outline: none; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 3000; padding: .85rem 1.2rem; background: var(--surface-primary); color: var(--text-strong); border: 2px solid var(--accent-ai, #16b8a7); border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.sidebar-close { display: none; }
@media (max-width: 1199px) {
  .app-main .cs-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .app-sidebar__inner { height: calc(100dvh - 1rem); min-height: 0; }
  .app-sidebar__top { position: relative; padding-top: 2.7rem; }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; position: absolute; right: 0; top: 0; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.2); border-radius: .6rem; color: #fff; background: transparent; }
  body.sidebar-open { overflow: hidden; }
  .app-topbar { padding: .65rem 1rem; }
  .app-main { padding: 1rem; }
}
@media (max-width: 575px) {
  .app-main .cs-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .app-main .cs-filter-grid > * { grid-column: auto; }
  .app-main .form-control, .app-main .form-select { font-size: 16px; min-height: 44px; }
  .app-main .btn { min-height: 44px; }
  .app-main .cs-filter-actions > .btn { flex: 1; }
  .app-help-link span { display: none; }
  .app-help-link { min-width: 44px; min-height: 44px; justify-content: center; }
  .app-main :is(.pagination, .ai-page-header__actions, .cs-page-header__actions) { flex-wrap: wrap; }
  .app-main :is(.cs-section-card__header, .ai-filter-card__header) { flex-wrap: wrap; gap: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .app-topbar, .skip-link { display: none !important; }
}
/* Reserve the top of each page for its controls and operational context. */
.workspace-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.workspace-meta { color: var(--text-muted); font-size: .85rem; }
.app-main .cs-hero { min-height: 0; padding: .85rem 1rem; background: var(--surface-primary); box-shadow: none; }
.app-main .cs-hero::before, .app-main .cs-hero::after { display: none; }
.app-main .cs-hero__subtitle { margin: 0; font-size: .95rem; }
.app-main .jv-header { margin-bottom: 0; }
.app-main .jv-header-actions { width: 100%; justify-content: space-between; }
.app-main .sa-report-overview { padding: 1.2rem; background: var(--surface-primary); }
.app-main .dg-start-paths > a { padding: 1rem; }
.app-main .jv-core { max-width: 220px; }
.app-main .jv-briefing { padding: 1.4rem; }
.app-main .jv-briefing h2 { font-size: 1.6rem; }
@media (max-width: 575px) {
  .app-main .jv-core { max-width: 180px; }
  .app-main .jv-core-panel { padding: 1rem; }
}
.app-topbar { flex-direction: row; align-items: center; }
.app-topbar__intro { width: auto; justify-content: flex-start; align-items: center; min-width: 0; }
.app-topbar__title { letter-spacing: normal; }
@media (min-width: 992px) {
  .app-main .sa-reader-rail, .app-main .dg-sidebar { top: 5rem; max-height: calc(100dvh - 6rem); }
}
.app-main .dg-chapter, .sa-workspace [id] { scroll-margin-top: 5rem; }
