/* Season 2 — Courtroom Classic. Application chrome only; court document
   pages, signatures, report output, and role visibility retain their rules. */
:root {
  --color-background: #081321;
  --color-surface: #0d1c2e;
  --color-surface-raised: #122338;
  --color-surface-hover: #192d43;
  --color-surface-active: #20334a;
  --color-border: #2a3b50;
  --color-border-light: #3d5068;
  --color-primary: #dfb86d;
  --color-primary-hover: #f0cf91;
  --color-primary-muted: rgba(223,184,109,.13);
  --color-text: #f3f0e9;
  --color-text-secondary: #bdc6d2;
  --color-text-muted: #97a7bb;
  --s2-sidebar-width: 232px;
}

body:not(.is-dry-run) .app-shell,body.is-dry-run .app-shell {
  grid-template-columns: var(--s2-sidebar-width) minmax(0,1fr);
  grid-template-rows: auto auto minmax(0,1fr) 32px;
  grid-template-areas: "header header" "navigation training" "navigation workspace" "footer footer";
  height: 100dvh;
  background: var(--color-background);
}
body.is-dry-run .app-shell { grid-template-rows: auto auto minmax(0,1fr) 32px; }
.app-shell > .app-header {
  display: grid;
  grid-area: header;
  min-height: 96px;
  padding: 14px 24px;
  grid-template-columns: minmax(330px,1fr) minmax(170px,.7fr) auto;
  gap: 20px;
  background: #0c1b2d;
  border-top: 3px solid var(--color-primary);
  border-bottom-color: #344459;
  box-shadow: none;
}
.app-shell > .app-header .brand-area { gap: 14px; }
.app-shell > .app-header .brand-mark {
  width: 64px; height: 64px; border: 0; border-radius: 0;
  background: none; box-shadow: none;
}
.app-shell > .app-header .brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.app-shell > .app-header .brand-title-row { flex-wrap: wrap; gap: 7px 12px; }
.app-shell > .app-header .brand-copy h1 {
  font-family: Georgia,"Times New Roman",serif;
  font-size: clamp(1.15rem,1.45vw,1.55rem);
  font-weight: 600; letter-spacing: .015em; margin: 0;
  white-space: normal; overflow: visible;
}
.app-shell > .app-header .brand-copy p {
  display: block; margin-top: 7px; font-size: .63rem;
  letter-spacing: .16em; color: var(--color-text-secondary);
}
.season-badge {
  display: inline-flex; align-items: center; flex: none;
  padding: 5px 10px; border: 1px solid #e0bd7e; border-radius: 3px;
  background: var(--color-primary); color: #172334;
  font: 700 .64rem/1.2 var(--font-family); letter-spacing: .13em; text-transform: uppercase;
}
.app-shell > .app-header .header-actions { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.app-shell > .app-header .workspace-role-toggle { border-color: var(--color-border-light); background: #081525; }
.app-shell > .app-header .workspace-role-toggle .button { padding: 5px 9px; font-size: .72rem; }
.app-shell > .app-header .staff-account-actions .button { min-width: 0; min-height: 34px; padding: 6px 11px; }
.app-shell > .app-header .case-indicator strong { font-size: .8rem; }
.app-shell > .app-header .case-workspace-actions { margin-top: 5px; gap: 5px; }
.app-shell > .app-header .case-workspace-actions .button { min-height: 26px; padding: 4px 7px; font-size: .65rem; }
.training-toolbar { grid-area: training; min-width: 0; }

.app-shell > .primary-navigation,
html[data-workspace-role="judge"] .app-shell > .primary-navigation {
  grid-area: navigation;
  display: flex; flex-direction: column; align-items: stretch;
  width: auto; height: auto; min-height: 0; gap: 0;
  padding: 23px 12px 14px;
  overflow: auto;
  background: #0b1a2b;
  border: 0; border-right: 1px solid var(--color-border);
  z-index: 9;
}
.navigation-label {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 10px 17px; color: var(--color-text-muted);
  font-size: .65rem; font-weight: 600; letter-spacing: .17em; text-transform: uppercase;
}
.navigation-label span { color: var(--color-primary); letter-spacing: .08em; }
.primary-navigation .navigation-tabs,
html[data-workspace-role="judge"] .primary-navigation .navigation-tabs {
  display: flex; flex-direction: column; flex-wrap: nowrap;
  flex: 0 0 auto; width: 100%; gap: 5px; min-height: 0;
  overflow: visible; border: 0;
}
.primary-navigation .navigation-tabs .nav-tab,
html[data-workspace-role="judge"] .primary-navigation .navigation-tabs .nav-tab {
  flex: none; width: 100%; min-width: 0; min-height: 46px;
  padding: 12px 16px; border: 0; border-radius: 5px;
  color: var(--color-text-secondary); font-size: .83rem; font-weight: 500;
  line-height: 1.4; text-align: left; justify-content: flex-start; white-space: normal;
}
.primary-navigation .nav-tab::after {
  top: 8px; bottom: 8px; left: 0; right: auto; width: 3px; height: auto;
  border-radius: 2px; transform: none;
}
.primary-navigation .nav-tab.is-active { color: var(--color-primary); background: var(--color-primary-muted); }
.primary-navigation .nav-tab:hover { background: #17293c; color: var(--color-text); }
.primary-navigation .navigation-quick-actions,
html[data-workspace-role="judge"] .primary-navigation .navigation-quick-actions {
  flex-direction: column; flex-wrap: nowrap; align-items: stretch;
  justify-content: flex-start; width: 100%; gap: 9px;
  margin-top: 24px; padding: 18px 4px 0; border-top: 1px solid var(--color-border);
}
.primary-navigation .navigation-quick-actions > .button,
html[data-workspace-role="judge"] .primary-navigation .navigation-quick-actions > .button {
  width: 100%; min-height: 38px; padding: 9px 12px;
  font-size: .75rem; white-space: normal; line-height: 1.4;
}
.primary-navigation .judge-module-menu { align-self: stretch; }
.primary-navigation .judge-module-menu summary { min-height: 38px; font-size: .75rem; }
.primary-navigation .judge-module-options {
  position: static; width: 100%; min-width: 0; margin-top: 5px;
  border-radius: 6px; box-shadow: none; background: #112337;
}
.primary-navigation .judge-module-options button { white-space: normal; font-size: .78rem; }
.app-shell > .app-workspace {
  grid-area: workspace; min-width: 0; min-height: 0;
  padding: 22px clamp(18px,2.1vw,40px);
  background: var(--color-background);
}
.app-workspace .view-heading { margin-bottom: 22px; align-items: center; gap: 16px; }
.app-workspace .view-heading > div > h2 {
  font-family: Georgia,"Times New Roman",serif; font-size: clamp(1.65rem,2.4vw,2.25rem);
  font-weight: 500; letter-spacing: -.025em;
}
.app-workspace .view-heading .eyebrow { color: var(--color-primary); letter-spacing: .15em; }
.app-workspace .panel { box-shadow: none; }
.app-workspace .panel-header { border-bottom-color: var(--color-border); }
.button-primary { background: var(--color-primary); color: #142236; border-color: var(--color-primary); box-shadow: none; }
.button-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.app-shell > .app-footer { grid-area: footer; padding: 0 22px; background: #0b192a; border-top-color: var(--color-border); }
.footer-season { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--color-border-light); color: var(--color-primary); letter-spacing: .1em; text-transform: uppercase; }
.footer-version { margin-left: 10px; }

/* Document navigation and empty libraries share the same quiet civic style. */
.document-landing { padding: 26px 10px; margin: 0 auto; }
.document-landing h3 { font-family: Georgia,"Times New Roman",serif; font-size: 1.8rem; font-weight: 500; }
.document-paths { gap: 18px; margin-top: 26px; }
.document-path { padding: 25px; border-radius: 8px; background: #0e1e31; }
.document-path-icon { width: 44px; height: 44px; display: grid; place-items: center; border-bottom: 1px solid #756240; }
.document-origin-inspector { background: #122237; border-color: var(--color-border); color: var(--color-text-secondary); }
.document-origin-inspector summary { font-size: .78rem; }
.s2-empty-library {
  grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; min-height: 290px; padding: 36px 24px;
  text-align: center; background: #0d1d30; border: 1px solid var(--color-border); border-radius: 8px;
}
.s2-empty-library img { width: 82px; height: 82px; object-fit: contain; border-radius: 50%; opacity: .85; }
.s2-empty-library h3 { margin: 0; font-family: Georgia,"Times New Roman",serif; font-size: 1.8rem; font-weight: 500; color: var(--color-text); }
.s2-empty-library p { margin: 0; color: var(--color-text-secondary); }
.s2-empty-library .eyebrow { color: var(--color-primary); font-size: .66rem; letter-spacing: .16em; }
#view-document-creator[data-document-route="stored"] .document-library-content { gap: 18px; }
#view-document-creator[data-document-route="stored"] .document-library-content > #document-admin-note { font-size: .72rem; }
#document-training-start { align-self: flex-start; min-height: 32px; padding: 7px 12px; font-size: .72rem; }
#view-document-creator[data-document-route="stored"] :is(.document-editor-panel,.document-editor-body,#document-storage-tools,.document-storage-content,#document-library) {
  background: transparent; border: 0; box-shadow: none;
}
#view-document-creator[data-document-route="stored"] :is(.document-editor-body,.document-storage-content) { padding: 0; }
#view-document-creator[data-document-route="stored"] #document-library > summary { padding: 12px 0; }
.document-workflow-tabs > .button { flex: none; }

@media (max-width: 1180px) {
  :root { --s2-sidebar-width: 210px; }
  .app-shell > .app-header { grid-template-columns: minmax(300px,1fr) auto; gap: 12px 20px; }
  .app-shell > .app-header .header-center { grid-column: 1/-1; grid-row: 2; justify-content: stretch; }
  .app-shell > .app-header .case-indicator { flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: flex-start; gap: 12px; width: 100%; }
  .app-shell > .app-header .case-workspace-actions { margin: 0 0 0 auto; }
  .app-shell > .app-header .indicator-label { font-size: .62rem; }
  .app-shell > .app-header .header-actions { max-width: 430px; }
  .app-shell > .app-header .brand-copy h1 { font-size: 1.25rem; }
  .document-paths { grid-template-columns: 1fr; gap: 12px; }
  .document-path { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 8px 16px; padding: 20px; }
  .document-path-icon { grid-row: 1/4; }
  .document-path > :not(.document-path-icon) { grid-column: 2; }
}
@media (max-width: 760px) {
  html,body { min-width: 0; }
  body { overflow: auto; }
  body:not(.is-dry-run) .app-shell,body.is-dry-run .app-shell {
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto auto auto minmax(0,1fr) auto;
    grid-template-areas: "header" "navigation" "training" "workspace" "footer";
    height: auto; min-height: 100dvh; overflow: visible;
  }
  .app-shell > .app-header { grid-template-columns: minmax(0,1fr); padding: 14px 16px; gap: 14px; }
  .app-shell > .app-header .header-actions { grid-row: 2; justify-content: flex-start; max-width: none; }
  .app-shell > .app-header .header-center { display: flex; grid-column: 1; grid-row: 3; }
  .app-shell > .app-header .brand-mark { width: 54px; height: 54px; }
  .app-shell > .app-header .brand-copy h1 { font-size: 1.2rem; }
  .app-shell > .app-header .brand-copy p { font-size: .58rem; }
  .app-shell > .app-header .case-indicator { gap: 7px 12px; }
  .app-shell > .app-header .case-workspace-actions { margin-left: 0; }
  .app-shell > .primary-navigation,
  html[data-workspace-role="judge"] .app-shell > .primary-navigation {
    padding: 12px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--color-border);
  }
  .navigation-label { margin-bottom: 10px; }
  .primary-navigation .navigation-tabs,
  html[data-workspace-role="judge"] .primary-navigation .navigation-tabs {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px;
  }
  .primary-navigation .navigation-tabs .nav-tab,
  html[data-workspace-role="judge"] .primary-navigation .navigation-tabs .nav-tab { min-height: 42px; padding: 9px 12px; font-size: .76rem; }
  .primary-navigation .navigation-quick-actions,
  html[data-workspace-role="judge"] .primary-navigation .navigation-quick-actions { flex-direction: row; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; gap: 7px; }
  .primary-navigation .navigation-quick-actions > .button,
  html[data-workspace-role="judge"] .primary-navigation .navigation-quick-actions > .button { width: auto; flex: 1 1 140px; }
  .primary-navigation .judge-module-menu { flex: 1 1 100%; }
  .app-shell > .app-workspace { min-height: 520px; overflow: visible; padding: 20px 14px; }
  .app-workspace .view-heading { flex-wrap: wrap; }
  .app-shell > .app-footer { gap: 12px; flex-wrap: wrap; min-height: 38px; padding: 10px 14px; }
  .footer-build { flex-wrap: wrap; gap: 7px; }
  .footer-version { display: none; }
  .s2-empty-library { min-height: 260px; padding: 30px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell .button,.app-shell .nav-tab,.document-path { transition: none; }
}
