/* Final application chrome overrides. Printed legal documents are untouched. */
@media screen {
  body[data-ui-page]:not([data-ui-page="launcher"]):not([data-ui-page="brief-builder"]) { padding-left: 248px; transition: padding-left .18s ease; }
  body.app-nav-collapsed { padding-left: 80px !important; }
  .app-navigation { position: fixed; z-index: 1000; inset: 0 auto 0 0; display: flex; width: 248px; padding: 16px 12px; flex-direction: column; color: #e2e8f0; background: #14243b; border-right: 1px solid rgba(255,255,255,.08); transition: width .18s ease, transform .18s ease; }
  .app-navigation__brand { display: flex; min-height: 64px; padding: 4px 8px 16px; gap: 12px; align-items: center; color: #fff; text-decoration: none; }
  .app-navigation__brand img { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; }
  .app-navigation__brand span { display: grid; min-width: 0; }
  .app-navigation__brand strong { font-size: 14px; }
  .app-navigation__brand small { color: #94a3b8; font-size: 11px; }
  .app-navigation nav { display: grid; gap: 4px; }
  .app-navigation nav a, .app-navigation__collapse { display: flex; min-height: 44px; padding: 10px 12px; gap: 12px; align-items: center; color: #cbd5e1; background: transparent; border: 0; border-radius: 12px; font: 600 13px/1.2 Inter,Geist,"Segoe UI",sans-serif; text-decoration: none; cursor: pointer; }
  .app-navigation nav a:hover, .app-navigation__collapse:hover { color: #fff; background: rgba(255,255,255,.08); }
  .app-navigation nav a.active { color: #fff; background: #2563eb; }
  .app-navigation svg, .app-mobile-header svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .app-navigation__footer { display: grid; margin-top: auto; padding: 14px 12px; gap: 4px; color: #cbd5e1; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; }
  .app-navigation__footer span { display: flex; gap: 8px; align-items: center; font-weight: 600; }
  .app-navigation__footer i { width: 8px; height: 8px; background: #34d399; border-radius: 50%; }
  .app-navigation__footer small { color: #94a3b8; }
  .app-navigation__collapse { width: 100%; margin-top: 4px; }
  .app-mobile-header { display: none; }
  .app-nav-collapsed .app-navigation { width: 80px; }
  .app-nav-collapsed .app-navigation :is(.app-navigation__brand span, nav a span, .app-navigation__footer, .app-navigation__collapse span) { display: none; }
  .app-nav-collapsed .app-navigation :is(nav a,.app-navigation__collapse) { justify-content: center; }
}
@media screen {
  body[data-ui-page] { color: #14243b; background: #f6f8fc; font-family: Inter, Geist, "Segoe UI", Arial, sans-serif; }
  body[data-ui-page] :is(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
  body[data-ui-page] :is(button, input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select) { min-height: 44px; }
  body[data-ui-page] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea) { border: 1px solid #cbd5e1; border-radius: 12px; box-shadow: 0 1px 2px rgba(20,36,59,.05); }
  body[data-ui-page] :is(input, select, textarea):focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
  body[data-ui-page] :is(button, .primary-action, .secondary-action, .btn, .print-button, .save-brief-button) { border-radius: 12px; font-size: 14px; font-weight: 600; }
  body[data-ui-page] :is(.primary-action, .btn-primary, .print-button) { color: #fff; background: #2563eb; border-color: #2563eb; box-shadow: 0 1px 2px rgba(20,36,59,.05); }
  body[data-ui-page] :is(.primary-action, .btn-primary, .print-button):hover { background: #1d4ed8; border-color: #1d4ed8; }
  body[data-ui-page] :is(.workspace-card, .utility-card, .matter-card, .form-section, .brief-progress, .statement-form-section, .redaction-panel, .plate-controls, .plate-preview-card) { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 1px 2px rgba(20,36,59,.05); }
  body[data-ui-page] dialog { border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 20px 48px rgba(20,36,59,.14); }
  body[data-ui-page] dialog::backdrop { background: rgba(20,36,59,.58); backdrop-filter: blur(3px); }
}

body[data-ui-page="launcher"] .command-sidebar { width: 248px; padding: 16px 12px; background: #14243b; border-right: 1px solid rgba(255,255,255,.08); box-shadow: none; }
body[data-ui-page="launcher"] .command-brand { min-height: 64px; padding: 4px 8px 16px; }
body[data-ui-page="launcher"] .command-brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: none; }
body[data-ui-page="launcher"] .command-sidebar nav a { min-height: 44px; padding: 10px 12px; font-size: 13px; font-weight: 600; border-radius: 12px; }
body[data-ui-page="launcher"] .command-sidebar nav a.active { color: #fff; background: #2563eb; box-shadow: 0 8px 18px rgba(0,0,0,.16); }
body[data-ui-page="launcher"] .command-shell { margin-left: 248px; }
body[data-ui-page="launcher"] .command-topbar { min-height: 64px; padding: 10px 24px; background: rgba(246,248,252,.92); border-bottom-color: #e2e8f0; box-shadow: none; }
body[data-ui-page="launcher"] .command-content { display: flex; width: min(1200px, calc(100% - 48px)); flex-direction: column; padding-top: 24px; }
body[data-ui-page="launcher"] .command-hero { order: 1; min-height: 264px; }
body[data-ui-page="launcher"] .recent-section { order: 2; margin-top: 8px; }
body[data-ui-page="launcher"] .workspace-cards { order: 3; margin-top: 24px; }
body[data-ui-page="launcher"] .secure-banner { order: 4; }
body[data-ui-page="launcher"] .utilities-section { order: 5; }
body[data-ui-page="launcher"] .command-footer { order: 6; }
body[data-ui-page="launcher"] :is(.hero-copy,.hero-panel,.recent-table-wrap,.secure-banner,.utility-card) { border-radius: 16px; box-shadow: 0 1px 2px rgba(20,36,59,.05); }
body[data-ui-page="launcher"] .hero-copy { padding: 32px; background: linear-gradient(135deg,#14243b,#203653); }
body[data-ui-page="launcher"] .hero-copy h1 { max-width: 620px; font-size: clamp(30px,3.2vw,42px); letter-spacing: -.035em; }
body[data-ui-page="launcher"] .matter-card { color: #14243b; background: #f8fafc; }
body[data-ui-page="launcher"] .matter-card .matter-label { color: #1d4ed8; background: #eff6ff; }
body[data-ui-page="launcher"] .matter-card strong { color: #14243b; }
body[data-ui-page="launcher"] .matter-card p { color: #64748b; }
body[data-ui-page="launcher"] .workspace-card { min-height: 224px; border-radius: 16px; }
body[data-ui-page="launcher"] .workspace-card:hover { border-color: #bfdbfe; box-shadow: 0 12px 28px rgba(20,36,59,.09); transform: translateY(-2px); }
body[data-ui-page="launcher"] :is(.workspace-icon.teal,.workspace-icon.gold) { color: #2563eb; background: #eff6ff; }
body[data-ui-page="launcher"] .recent-empty { min-height: 164px; place-content: center; font-size: 13px; }

body[data-ui-page="brief-builder"] .sidebar { width: 248px; color: #e2e8f0; background: #14243b; border-right: 1px solid rgba(255,255,255,.08); box-shadow: none; }
body[data-ui-page="brief-builder"] .sidebar .brand img { border-radius: 12px; box-shadow: none; }
body[data-ui-page="brief-builder"] :is(.workflow-nav a,.new-brief-button,.sidebar-toggle) { min-height: 44px; border-radius: 12px; }
body[data-ui-page="brief-builder"] .workflow-nav a.active { background: #2563eb; border-color: rgba(147,197,253,.42); }
body[data-ui-page="brief-builder"] .builder { min-width: 0; padding: 24px; background: #f6f8fc; }
body[data-ui-page="brief-builder"] .panel-head { margin-bottom: 16px; }
body[data-ui-page="brief-builder"] .panel-head h2 { color: #14243b; font-size: clamp(26px,2.3vw,34px); letter-spacing: -.035em; }
body[data-ui-page="brief-builder"] .panel-head-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; background: transparent; border: 0; box-shadow: none; }
body[data-ui-page="brief-builder"] .panel-head-actions > button { min-height: 44px; border-radius: 12px; }
body[data-ui-page="brief-builder"] .panel-head-actions .save-brief-button { color: #14243b; background: #fff; border-color: #cbd5e1; }
body[data-ui-page="brief-builder"] :is(.form-section,.brief-progress) { border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 1px 2px rgba(20,36,59,.05); }
body[data-ui-page="brief-builder"] .form-section label { color: #334155; font-size: 13px; font-weight: 600; }
body[data-ui-page="brief-builder"] .form-section :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { min-height: 44px; margin-top: 6px; border-radius: 12px; }
body[data-ui-page="brief-builder"] .section-jumpbar { position: sticky; z-index: 12; bottom: 16px; border: 1px solid #dbe3ee; border-radius: 16px; box-shadow: 0 12px 32px rgba(20,36,59,.12); }
body[data-ui-page="brief-builder"] .section-jump-button { min-width: 96px; min-height: 44px; border-radius: 12px; }
body[data-ui-page="brief-builder"] .section-jump-button.next { color: #fff; background: #2563eb; border-color: #2563eb; }
body[data-ui-page="brief-builder"] .preview { min-width: 0; padding: 24px 18px 48px; background: #edf2f8; }
body[data-ui-page="brief-builder"] .toolbar { width: min(100%,780px); min-height: 56px; border: 1px solid #dbe3ee; border-radius: 16px; box-shadow: 0 8px 24px rgba(20,36,59,.09); }
body[data-ui-page="brief-builder"] :is(.zoom-controls,.zoom-controls button,.toolbar .hide-preview-button,.toolbar .preview-close-button,.toolbar .print-button) { min-height: 44px; }
body[data-ui-page="brief-builder"] .toolbar .print-button { padding-inline: 16px; }

@media screen and (min-width:901px) {
  body[data-ui-page="brief-builder"] main { grid-template-columns: minmax(440px,1fr) minmax(460px,1fr); margin-left: 248px; }
  body[data-ui-page="brief-builder"].sidebar-collapsed main { grid-template-columns: minmax(440px,1fr) minmax(460px,1fr); margin-left: 80px; }
}
@media screen and (max-width:1180px) and (min-width:901px) {
  body[data-ui-page="brief-builder"] main,
  body[data-ui-page="brief-builder"].sidebar-collapsed main { grid-template-columns: minmax(400px,.95fr) minmax(420px,1.05fr); }
  body[data-ui-page="brief-builder"] .builder { padding: 20px; }
  body[data-ui-page="brief-builder"] .panel-head { grid-template-columns: 1fr; }
  body[data-ui-page="brief-builder"] .panel-head-actions { justify-self: start; }
}
@media screen and (max-width:900px) {
  body[data-ui-page]:not([data-ui-page="launcher"]):not([data-ui-page="brief-builder"]), body.app-nav-collapsed { padding-top: 64px; padding-left: 0 !important; }
  .app-navigation, .app-nav-collapsed .app-navigation { width: min(296px,calc(100vw - 48px)); transform: translateX(-105%); box-shadow: 20px 0 48px rgba(20,36,59,.24); }
  .app-menu-open .app-navigation { transform: translateX(0); }
  .app-menu-open::after { content: ""; position: fixed; z-index: 999; inset: 0; background: rgba(20,36,59,.5); }
  .app-mobile-header { position: fixed; z-index: 998; inset: 0 0 auto; display: flex; height: 64px; padding: 10px 16px; align-items: center; justify-content: space-between; background: #14243b; border-bottom: 1px solid rgba(255,255,255,.08); }
  .app-mobile-header a { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; }
  .app-mobile-header img { width: 36px; height: 36px; border-radius: 10px; }
  .app-mobile-header button { display: grid; width: 44px; min-height: 44px; padding: 0; place-items: center; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; }
  .app-nav-collapsed .app-navigation :is(.app-navigation__brand span, nav a span, .app-navigation__footer, .app-navigation__collapse span) { display: initial; }
  .app-nav-collapsed .app-navigation :is(nav a,.app-navigation__collapse) { justify-content: flex-start; }
  body[data-ui-page="launcher"] .command-shell { margin-left: 0; }
  body[data-ui-page="launcher"] .command-content { width: min(100% - 32px,760px); }
  body[data-ui-page="brief-builder"] .builder { padding: 20px 16px 96px; }
  body[data-ui-page="brief-builder"] .mobile-brand { min-height: 44px; align-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .app-navigation, .app-mobile-header { display: none !important; }
  body[data-ui-page] { padding: 0 !important; }
}
@media screen and (max-width:620px) {
  body[data-ui-page="launcher"] .command-content { width: min(100% - 24px,640px); padding-top: 16px; }
  body[data-ui-page="launcher"] .hero-copy { padding: 24px; }
  body[data-ui-page="brief-builder"] .builder { padding-inline: 12px; }
  body[data-ui-page="brief-builder"] .panel-head-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  body[data-ui-page="brief-builder"] .panel-head-actions > button { width: 100%; }
  body[data-ui-page="brief-builder"] .section-jump-button { min-width: 72px; }
  body[data-ui-page="brief-builder"] .toolbar .print-button { grid-column: 1 / -1; }
}
