/*
 * Unified Cockpit · shared application shell and work-surface foundation.
 *
 * This file is deliberately scoped to body.unified-cockpit. It is loaded after
 * the legacy page styles so every real control remains in the document while
 * the suite gains one coherent visual language across Campo and Vista completa.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/inter-400.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/inter-600.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/inter-700.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/fraunces-600.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/fraunces-700.woff2") format("woff2");
}

:root {
  --cockpit-night: #151c2c;
  --cockpit-night-hover: #242d40;
  --cockpit-night-active: #2c3344;
  --cockpit-night-rule: #323a4d;
  --cockpit-night-text: #e8eaf0;
  --cockpit-night-muted: #a6afc2;
  --cockpit-night-soft: #c7ccda;
  --cockpit-wine: #511b2a;
  --cockpit-wine-deep: #3f1420;
  --cockpit-paper: #f5f2eb;
  --cockpit-paper-soft: #f8f6ef;
  --cockpit-paper-wash: #fdfcf8;
  --cockpit-surface: #fffefb;
  --cockpit-surface-solid: #ffffff;
  --cockpit-ink: #202635;
  --cockpit-muted: #626975;
  --cockpit-muted-strong: #505764;
  --cockpit-line: #e5e0d5;
  --cockpit-line-strong: #d4caba;
  --cockpit-line-soft: #eeebe4;
  --cockpit-gold: #dfb45b;
  --cockpit-gold-deep: #b17d23;
  --cockpit-gold-ink: #32230d;
  --cockpit-gold-soft: #fbf2df;
  --cockpit-green: #24624e;
  --cockpit-green-deep: #174c3b;
  --cockpit-green-soft: #e9f0e9;
  --cockpit-blue: #586a83;
  --cockpit-blue-soft: #edf1f6;
  --cockpit-amber: #8d6529;
  --cockpit-amber-soft: #fbf2df;
  --cockpit-danger: #8e2637;
  --cockpit-danger-deep: #741c2b;
  --cockpit-danger-soft: #f8e8eb;
  --cockpit-disabled: #626975;
  --cockpit-overlay: #151c2c88;
  --cockpit-selection: #eddbaf;
  --cockpit-shadow-card: 0 8px 30px #3027160d;
  --cockpit-shadow-float: 0 24px 70px #151c2c33;
  --cockpit-shadow-press: 0 2px 3px #151c2c15;
  --cockpit-shadow-dock: 0 -3px 20px #151c2c13;
  --cockpit-serif: "Fraunces", Georgia, serif;
  --cockpit-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cockpit-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --cockpit-rail: 248px;
  --cockpit-dock: 92px;
  --cockpit-radius: 16px;
  --cockpit-radius-control: 8px;
  --cockpit-page-max: 1900px;
  --cockpit-focus: var(--cockpit-gold-deep);

  /* Existing Mesa components can inherit the cockpit without a second palette. */
  --x-wine: var(--cockpit-wine);
  --x-wine-mid: var(--cockpit-wine);
  --x-cream: var(--cockpit-surface);
  --x-gold: var(--cockpit-gold);
  --x-gold-ink: var(--cockpit-gold-ink);
  --x-gold-wash: var(--cockpit-gold-soft);
  --x-paper: var(--cockpit-paper);
  --x-paper-2: var(--cockpit-paper-soft);
  --x-paper-3: var(--cockpit-paper-wash);
  --x-card: var(--cockpit-surface-solid);
  --x-ink: var(--cockpit-ink);
  --x-muted: var(--cockpit-muted);
  --x-line: var(--cockpit-line);
  --x-green: var(--cockpit-green);
  --x-green-deep: var(--cockpit-green-deep);
  --x-green-soft: var(--cockpit-green-soft);
  --x-night: var(--cockpit-night);
  --x-rail: var(--cockpit-night);
  --x-rail-active: var(--cockpit-night-active);
  --x-serif: var(--cockpit-serif);
  --x-sans: var(--cockpit-sans);
  --x-mono: var(--cockpit-mono);
}

body.unified-cockpit,
body.unified-cockpit * {
  box-sizing: border-box;
}

body.unified-cockpit {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: var(--cockpit-paper);
  color: var(--cockpit-ink);
  font: 400 14px/1.5 var(--cockpit-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.unified-cockpit ::selection {
  background: var(--cockpit-selection);
  color: var(--cockpit-ink);
}

body.unified-cockpit :where(button, input, select, textarea) {
  font: inherit;
}

body.unified-cockpit :where(button, a, input, select, textarea, summary) {
  -webkit-tap-highlight-color: transparent;
}

body.unified-cockpit :where(button, a, summary) {
  touch-action: manipulation;
}

body.unified-cockpit :where(a) {
  color: var(--cockpit-wine);
  text-underline-offset: 0.16em;
}

body.unified-cockpit :where(button, [role="button"], summary) {
  cursor: pointer;
}

body.unified-cockpit :where(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--cockpit-focus);
  outline-offset: 3px;
}

body.unified-cockpit .cockpit-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.unified-cockpit :where(button, a) > .cockpit-icon {
  pointer-events: none;
}

body.unified-cockpit .cockpit-skip-link {
  position: fixed;
  top: -6rem;
  left: calc(var(--cockpit-rail) + 1rem);
  z-index: 1000;
  padding: 0.75rem 1rem;
  border-radius: var(--cockpit-radius-control);
  background: var(--cockpit-surface-solid);
  color: var(--cockpit-wine);
  font-weight: 700;
  box-shadow: var(--cockpit-shadow-float);
}

body.unified-cockpit .cockpit-skip-link:focus {
  top: 1rem;
}

/* --- One application spine ------------------------------------------------ */

body.unified-cockpit .cockpit-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  width: var(--cockpit-rail);
  min-height: 100dvh;
  flex-direction: column;
  padding: 28px 18px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--cockpit-night-rule) transparent;
  background: var(--cockpit-night);
  color: var(--cockpit-night-text);
}

body.unified-cockpit .cockpit-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 10px;
  color: var(--cockpit-night-text);
  text-decoration: none;
}

body.unified-cockpit .cockpit-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--cockpit-gold);
  border-radius: 50%;
  color: var(--cockpit-gold);
}

body.unified-cockpit .cockpit-brand strong {
  display: block;
  font: 600 21px/1.2 var(--cockpit-serif);
  letter-spacing: -0.025em;
}

body.unified-cockpit .cockpit-brand small {
  display: block;
  margin-top: 4px;
  color: var(--cockpit-night-muted);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.unified-cockpit .cockpit-nav {
  display: grid;
  gap: 3px;
  margin-top: 20px;
  padding-bottom: 14px;
}

body.unified-cockpit .cockpit-nav-link,
body.unified-cockpit .cockpit-utility-link {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--cockpit-radius-control);
  background: transparent;
  color: var(--cockpit-night-soft);
  font-size: 12px;
  text-align: left;
  text-decoration: none;
}

body.unified-cockpit :where(.cockpit-nav-link, .cockpit-utility-link):hover {
  background: var(--cockpit-night-hover);
  color: var(--cockpit-night-text);
}

body.unified-cockpit .cockpit-nav-link:is([aria-current="page"], .is-active) {
  background: var(--cockpit-night-active);
  color: var(--cockpit-surface-solid);
  box-shadow: inset 3px 0 var(--cockpit-gold);
}

body.unified-cockpit .cockpit-nav-link:is([aria-current="page"], .is-active) .cockpit-icon {
  color: var(--cockpit-gold);
}

body.unified-cockpit .cockpit-nav-caption {
  margin-left: auto;
  color: var(--cockpit-night-muted);
  font-size: 10px;
}

body.unified-cockpit .cockpit-project {
  padding: 17px 12px 18px;
  border-top: 1px solid var(--cockpit-night-rule);
  border-bottom: 1px solid var(--cockpit-night-rule);
}

body.unified-cockpit .cockpit-project-label,
body.unified-cockpit .cockpit-sidebar-label {
  color: var(--cockpit-night-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.unified-cockpit .cockpit-project strong {
  display: block;
  margin-top: 8px;
  color: var(--cockpit-night-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

body.unified-cockpit .cockpit-project small {
  display: inline-block;
  margin-top: 6px;
  color: var(--cockpit-gold);
  font-size: 10px;
}

body.unified-cockpit .cockpit-project-code {
  float: right;
  color: var(--cockpit-night-muted);
  font-weight: 400;
}

body.unified-cockpit .cockpit-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 12px 8px;
}

body.unified-cockpit .cockpit-section-head span:last-child {
  color: var(--cockpit-gold);
  font-size: 9px;
}

body.unified-cockpit .cockpit-section-list {
  min-height: 80px;
  flex: 1;
  margin: 0;
  padding: 0 3px 0 0;
  overflow-y: auto;
  list-style: none;
}

body.unified-cockpit .cockpit-section-link {
  display: flex;
  min-height: 48px;
  align-items: flex-start;
  gap: 11px;
  margin: 1px 0;
  padding: 10px;
  border-radius: 7px;
  color: var(--cockpit-night-soft);
  font-size: 11px;
  text-decoration: none;
}

body.unified-cockpit .cockpit-section-link:hover {
  background: var(--cockpit-night-hover);
  color: var(--cockpit-surface-solid);
}

body.unified-cockpit .cockpit-section-link :where(.cockpit-section-number, .section-no) {
  min-width: 24px;
  color: var(--cockpit-night-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.8;
}

body.unified-cockpit .cockpit-section-link :where(b, .cockpit-section-title) {
  font-weight: 400;
  line-height: 1.6;
}

body.unified-cockpit .cockpit-section-link:is(.is-active, [aria-current="true"], [aria-current="step"]) {
  background: var(--cockpit-gold-ink);
  color: var(--cockpit-selection);
}

body.unified-cockpit .cockpit-section-link:is(.is-active, [aria-current="true"], [aria-current="step"]) :where(.cockpit-section-number, .section-no) {
  color: var(--cockpit-gold);
}

body.unified-cockpit .cockpit-section-link:is(.is-active, [aria-current="true"], [aria-current="step"]) :where(b, .cockpit-section-title) {
  font-weight: 600;
}

body.unified-cockpit .cockpit-sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 16px 10px 0;
  border-top: 1px solid var(--cockpit-night-rule);
}

body.unified-cockpit .cockpit-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--cockpit-night-active);
  color: var(--cockpit-gold);
  font-size: 11px;
  font-weight: 700;
}

body.unified-cockpit .cockpit-sidebar-foot strong,
body.unified-cockpit .cockpit-sidebar-foot small {
  display: block;
}

body.unified-cockpit .cockpit-sidebar-foot strong {
  font-size: 11px;
}

body.unified-cockpit .cockpit-sidebar-foot small {
  color: var(--cockpit-night-muted);
  font-size: 9px;
}

/* --- Work area ------------------------------------------------------------ */

body.unified-cockpit .cockpit-workspace {
  width: auto;
  max-width: var(--cockpit-page-max);
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--cockpit-rail);
  padding: 38px 46px calc(var(--cockpit-dock) + 30px);
}

body.unified-cockpit .cockpit-mobile-identity {
  display: none;
}

body.unified-cockpit .cockpit-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 26px;
}

body.unified-cockpit .cockpit-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cockpit-wine);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

body.unified-cockpit .cockpit-kicker::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

body.unified-cockpit .cockpit-page-head h1 {
  max-width: 19ch;
  margin: 14px 0 12px;
  color: var(--cockpit-wine);
  font: 600 clamp(36px, 3.2vw, 52px)/1.06 var(--cockpit-serif);
  letter-spacing: -0.032em;
  overflow-wrap: anywhere;
}

body.unified-cockpit .cockpit-page-head p {
  margin: 0;
  color: var(--cockpit-muted);
  font-size: 12px;
}

body.unified-cockpit .cockpit-page-position {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 26px;
  white-space: nowrap;
}

body.unified-cockpit .cockpit-page-position > strong {
  color: var(--cockpit-line-strong);
  font: 600 48px/1 var(--cockpit-serif);
}

body.unified-cockpit .cockpit-page-position > span {
  color: var(--cockpit-muted);
  font-size: 10px;
  line-height: 1.6;
}

body.unified-cockpit .cockpit-page-position b {
  display: block;
  color: var(--cockpit-ink);
  font-size: 12px;
}

body.unified-cockpit .cockpit-sheet,
body.unified-cockpit :where(.form-panel, .panel, .card, .full-section) {
  border: 1px solid var(--cockpit-line);
  border-radius: var(--cockpit-radius);
  background: var(--cockpit-surface);
  box-shadow: var(--cockpit-shadow-card);
}

body.unified-cockpit .cockpit-sheet {
  overflow: clip;
}

body.unified-cockpit .cockpit-sheet-head,
body.unified-cockpit :where(.form-panel, .panel, .card) > :where(.panel-head, .card-head, header):first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 27px;
  border-bottom: 1px solid var(--cockpit-line);
}

body.unified-cockpit .cockpit-sheet-head h2 {
  margin: 0;
  color: var(--cockpit-ink);
  font-size: 13px;
  font-weight: 700;
}

body.unified-cockpit .cockpit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 28px;
  min-width: 0;
  padding: 24px 28px;
}

body.unified-cockpit .cockpit-fields > :where(.wide, .full, .field-wide) {
  grid-column: 1 / -1;
}

body.unified-cockpit .cockpit-field-group {
  min-width: 0;
}

body.unified-cockpit .cockpit-field-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--cockpit-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

body.unified-cockpit .cockpit-field-group-title .cockpit-icon {
  color: var(--cockpit-wine);
}

body.unified-cockpit .cockpit-field-row {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--cockpit-line-soft);
}

body.unified-cockpit .cockpit-field-row:last-child {
  border-bottom: 0;
}

body.unified-cockpit .cockpit-field-row > :where(label, .cockpit-field-label) {
  font-size: 12px;
  font-weight: 700;
}

body.unified-cockpit :where(.form-panel, .cockpit-sheet, .full-section, form) :where(label, legend) {
  color: var(--cockpit-ink);
  font-weight: 600;
}

body.unified-cockpit :where(.form-panel, .cockpit-sheet, .full-section, form) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 7px;
  background: var(--cockpit-surface-solid);
  color: var(--cockpit-ink);
  font-size: 13px;
  line-height: 1.4;
}

body.unified-cockpit :where(.form-panel, .cockpit-sheet, .full-section, form) textarea {
  min-height: 96px;
  resize: vertical;
}

body.unified-cockpit :where(.form-panel, .cockpit-sheet, .full-section, form) :where(input, select, textarea)::placeholder {
  color: var(--cockpit-disabled);
  opacity: 1;
}

body.unified-cockpit :where(.form-panel, .cockpit-sheet, .full-section, form) :where(input, select, textarea):disabled {
  background: var(--cockpit-paper-soft);
  color: var(--cockpit-muted-strong);
  cursor: not-allowed;
}

body.unified-cockpit input[type="checkbox"],
body.unified-cockpit input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--cockpit-wine);
}

body.unified-cockpit input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: 12px;
  padding: 0 16px;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: var(--cockpit-radius-control);
  background: var(--cockpit-surface);
  color: var(--cockpit-wine);
  font-weight: 700;
  cursor: pointer;
}

body.unified-cockpit .cockpit-segmented {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: var(--cockpit-radius-control);
  background: var(--cockpit-paper-soft);
}

body.unified-cockpit .cockpit-segmented :where(button, label) {
  display: grid;
  min-width: 52px;
  min-height: 48px;
  place-items: center;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--cockpit-muted-strong);
  font-size: 11px;
  font-weight: 500;
}

body.unified-cockpit .cockpit-segmented :where(button[aria-pressed="true"], label:has(input:checked)) {
  background: var(--cockpit-night);
  color: var(--cockpit-surface-solid);
  box-shadow: var(--cockpit-shadow-press);
}

body.unified-cockpit .cockpit-segmented label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body.unified-cockpit .cockpit-capture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  min-width: 0;
}

body.unified-cockpit .cockpit-capture-layout > .cockpit-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.unified-cockpit .cockpit-evidence-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 26px 23px;
  border-left: 1px solid var(--cockpit-line);
  background: var(--cockpit-paper-soft);
}

body.unified-cockpit .cockpit-evidence-panel .cockpit-kicker {
  color: var(--cockpit-muted-strong);
  font-size: 9px;
  letter-spacing: 0.12em;
}

body.unified-cockpit .cockpit-evidence-panel .cockpit-kicker::before {
  display: none;
}

body.unified-cockpit .cockpit-evidence-panel h3 {
  margin: 11px 0 7px;
  color: var(--cockpit-wine);
  font: 600 23px/1.15 var(--cockpit-serif);
  letter-spacing: -0.015em;
}

body.unified-cockpit .cockpit-evidence-panel p {
  margin: 0;
  color: var(--cockpit-muted);
  font-size: 11px;
  line-height: 1.7;
}

body.unified-cockpit .cockpit-evidence-empty {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  margin: 21px 0 16px;
  padding: 22px 16px;
  border: 1px dashed var(--cockpit-line-strong);
  border-radius: 11px;
  background: var(--cockpit-surface);
  color: var(--cockpit-muted-strong);
  text-align: center;
}

body.unified-cockpit .cockpit-evidence-empty .cockpit-icon {
  width: 32px;
  height: 32px;
  color: var(--cockpit-amber);
  stroke-width: 1.3;
}

body.unified-cockpit .cockpit-evidence-note {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--cockpit-line);
  color: var(--cockpit-muted);
  font-size: 10px;
  line-height: 1.75;
}

body.unified-cockpit .cockpit-sheet-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 27px;
  border-top: 1px solid var(--cockpit-line);
  background: var(--cockpit-paper-wash);
  color: var(--cockpit-muted);
  font-size: 10px;
}

body.unified-cockpit .cockpit-sheet-footer strong,
body.unified-cockpit .cockpit-sheet-footer .cockpit-icon {
  color: var(--cockpit-green);
}

/* --- Real application controls and data surfaces ------------------------- */

body.unified-cockpit :where(.button, .btn, button.button, input[type="submit"], input[type="button"]) {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: var(--cockpit-radius-control);
  background: var(--cockpit-gold);
  color: var(--cockpit-gold-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: filter 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

body.unified-cockpit :where(.button, .btn, button.button, input[type="submit"], input[type="button"]):hover {
  color: var(--cockpit-gold-ink);
  filter: brightness(0.97);
}

body.unified-cockpit :where(.button, .btn, button.button, input[type="submit"], input[type="button"]):active {
  transform: scale(0.98);
}

body.unified-cockpit :where(.button.primary, .btn-primary, .btn-gold) {
  background: var(--cockpit-gold);
  color: var(--cockpit-gold-ink);
}

body.unified-cockpit :where(.button.secondary, .btn-secondary, .button.ghost, .btn-ghost) {
  border-color: var(--cockpit-line-strong);
  background: var(--cockpit-surface);
  color: var(--cockpit-wine);
}

body.unified-cockpit :where(.button.danger, .btn-danger) {
  background: var(--cockpit-danger);
  color: var(--cockpit-surface-solid);
}

body.unified-cockpit :where(.button.danger, .btn-danger):hover {
  background: var(--cockpit-danger-deep);
  color: var(--cockpit-surface-solid);
}

body.unified-cockpit :where(.button, .btn, button.button, input[type="submit"], input[type="button"]):disabled,
body.unified-cockpit :where(.button, .btn)[aria-disabled="true"] {
  background: var(--cockpit-line);
  color: var(--cockpit-muted-strong);
  cursor: not-allowed;
  filter: none;
  transform: none;
}

body.unified-cockpit :where(.grid, .cards, .card-grid) {
  gap: 18px;
}

body.unified-cockpit :where(.form-panel, .panel, .card, .full-section) {
  color: var(--cockpit-ink);
}

body.unified-cockpit :where(.form-panel, .panel, .card, .full-section) :where(h1, h2, h3) {
  color: var(--cockpit-wine);
  font-family: var(--cockpit-serif);
  letter-spacing: -0.015em;
}

body.unified-cockpit :where(.form-panel, .panel, .card, .full-section) > :where(h2, h3):first-child {
  margin-top: 0;
}

body.unified-cockpit :where(.table-scroll, .table-box, .table-wrap, .responsive-table) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--cockpit-line);
  border-radius: 12px;
  background: var(--cockpit-surface-solid);
}

body.unified-cockpit :where(table, .data-table, .registry) {
  width: 100%;
  border-collapse: collapse;
  color: var(--cockpit-ink);
  font-size: 13px;
}

body.unified-cockpit :where(table, .data-table, .registry) th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--cockpit-line-strong);
  background: var(--cockpit-paper-soft);
  color: var(--cockpit-muted-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
}

body.unified-cockpit :where(table, .data-table, .registry) td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--cockpit-line-soft);
  vertical-align: top;
}

body.unified-cockpit :where(table, .data-table, .registry) tbody tr:last-child td {
  border-bottom: 0;
}

body.unified-cockpit :where(table, .data-table, .registry) tbody tr:hover td {
  background: var(--cockpit-paper-wash);
}

body.unified-cockpit :where(.badge, .status, .chip, .pill) {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cockpit-blue-soft);
  color: var(--cockpit-blue);
  font-size: 11px;
  font-weight: 700;
}

body.unified-cockpit :where(.badge, .status, .chip, .pill).ok,
body.unified-cockpit :where(.badge, .status, .chip, .pill).success {
  background: var(--cockpit-green-soft);
  color: var(--cockpit-green-deep);
}

body.unified-cockpit :where(.badge, .status, .chip, .pill).warn {
  background: var(--cockpit-amber-soft);
  color: var(--cockpit-amber);
}

body.unified-cockpit :where(.badge, .status, .chip, .pill).danger,
body.unified-cockpit :where(.badge, .status, .chip, .pill).error {
  background: var(--cockpit-danger-soft);
  color: var(--cockpit-danger-deep);
}

body.unified-cockpit :where(.empty, .empty-state) {
  padding: 24px;
  border: 1px dashed var(--cockpit-line-strong);
  border-radius: 10px;
  background: var(--cockpit-paper-wash);
  color: var(--cockpit-muted-strong);
  text-align: center;
}

body.unified-cockpit details > summary {
  min-height: 48px;
  color: var(--cockpit-wine);
  font-weight: 700;
}

body.unified-cockpit :where(.flash, .alert, .notice) {
  padding: 14px 16px;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 10px;
  background: var(--cockpit-gold-soft);
  color: var(--cockpit-gold-ink);
}

body.unified-cockpit :where(.flash.success, .alert.success, .notice.success, .alert.is-ok) {
  border-color: var(--cockpit-green);
  background: var(--cockpit-green-soft);
  color: var(--cockpit-green-deep);
}

body.unified-cockpit :where(.flash.error, .alert.error, .notice.error) {
  border-color: var(--cockpit-danger);
  background: var(--cockpit-danger-soft);
  color: var(--cockpit-danger-deep);
}

/* --- Persistent action dock and mobile menu ------------------------------- */

body.unified-cockpit .cockpit-action-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: var(--cockpit-rail);
  z-index: 55;
  display: flex;
  min-height: var(--cockpit-dock);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 46px;
  border-top: 1px solid var(--cockpit-line);
  background: var(--cockpit-surface);
  box-shadow: var(--cockpit-shadow-dock);
}

@supports (backdrop-filter: blur(12px)) {
  body.unified-cockpit .cockpit-action-dock {
    backdrop-filter: blur(12px);
  }
}

body.unified-cockpit .cockpit-save-receipt {
  display: flex;
  align-items: center;
  gap: 11px;
}

body.unified-cockpit .cockpit-receipt-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--cockpit-green-soft);
  color: var(--cockpit-green);
}

body.unified-cockpit .cockpit-save-receipt strong,
body.unified-cockpit .cockpit-save-receipt small {
  display: block;
}

body.unified-cockpit .cockpit-save-receipt strong {
  font-size: 11px;
}

body.unified-cockpit .cockpit-save-receipt small {
  margin-top: 2px;
  color: var(--cockpit-muted);
  font-size: 9px;
}

body.unified-cockpit .cockpit-dock-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.unified-cockpit .cockpit-dock-actions :where(.button, .btn) {
  min-width: 164px;
}

body.unified-cockpit .cockpit-mobile-dock {
  display: none;
}

body.unified-cockpit .cockpit-menu {
  width: min(600px, calc(100vw - 32px));
  max-height: 85dvh;
  margin: auto;
  padding: 0;
  overflow: clip;
  border: 1px solid var(--cockpit-line);
  border-radius: var(--cockpit-radius);
  background: var(--cockpit-surface);
  color: var(--cockpit-ink);
  box-shadow: var(--cockpit-shadow-float);
}

body.unified-cockpit .cockpit-menu::backdrop {
  background: var(--cockpit-overlay);
  backdrop-filter: blur(3px);
}

body.unified-cockpit .cockpit-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 25px;
  border-bottom: 1px solid var(--cockpit-line);
}

body.unified-cockpit .cockpit-menu-head h2 {
  margin: 0;
  color: var(--cockpit-wine);
  font: 600 25px/1.2 var(--cockpit-serif);
}

body.unified-cockpit .cockpit-menu-close {
  display: grid;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  border: 0;
  border-radius: var(--cockpit-radius-control);
  background: var(--cockpit-paper);
  color: var(--cockpit-wine);
}

body.unified-cockpit .cockpit-menu-body {
  max-height: calc(85dvh - 94px);
  padding: 14px 18px;
  overflow-y: auto;
}

body.unified-cockpit .cockpit-menu-item {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--cockpit-line);
  background: transparent;
  color: var(--cockpit-ink);
  font-size: 12px;
  text-align: left;
  text-decoration: none;
}

body.unified-cockpit .cockpit-menu-item:hover {
  background: var(--cockpit-paper-soft);
}

body.unified-cockpit .cockpit-menu-item:is(.is-active, [aria-current="true"], [aria-current="page"]) {
  background: var(--cockpit-gold-soft);
  color: var(--cockpit-wine);
  font-weight: 700;
}

/* --- Responsive contract -------------------------------------------------- */

@media (min-width: 1500px) {
  body.unified-cockpit .cockpit-workspace {
    padding-right: 64px;
    padding-left: 64px;
  }

  body.unified-cockpit .cockpit-action-dock {
    padding-right: 64px;
    padding-left: 64px;
  }

  body.unified-cockpit .cockpit-capture-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 1150px) and (min-width: 961px) {
  body.unified-cockpit .cockpit-workspace {
    padding: 30px 26px calc(var(--cockpit-dock) + 28px);
  }

  body.unified-cockpit .cockpit-page-position {
    display: none;
  }

  body.unified-cockpit .cockpit-capture-layout {
    grid-template-columns: minmax(0, 1fr) 248px;
  }

  body.unified-cockpit .cockpit-fields {
    padding: 22px;
  }

  body.unified-cockpit .cockpit-action-dock {
    padding-right: 26px;
    padding-left: 26px;
  }
}

@media (max-width: 960px) {
  body.unified-cockpit {
    --cockpit-rail: 0px;
    --cockpit-dock: 88px;
    padding-bottom: calc(var(--cockpit-dock) + env(safe-area-inset-bottom));
  }

  body.unified-cockpit .cockpit-sidebar {
    display: none;
  }

  body.unified-cockpit .cockpit-workspace {
    max-width: none;
    margin-left: 0;
    padding: 24px 18px 28px;
  }

  body.unified-cockpit .cockpit-mobile-identity {
    display: flex;
    min-height: 28px;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--cockpit-wine);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
  }

  body.unified-cockpit .cockpit-mobile-identity span:last-child {
    margin-left: auto;
    color: var(--cockpit-muted);
    letter-spacing: 0.04em;
  }

  body.unified-cockpit .cockpit-page-head {
    display: block;
    padding-bottom: 20px;
  }

  body.unified-cockpit .cockpit-kicker {
    gap: 8px;
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  body.unified-cockpit .cockpit-page-head h1 {
    max-width: 15ch;
    margin: 10px 0 9px;
    font-size: clamp(34px, 10.5vw, 44px);
    line-height: 1.06;
    letter-spacing: -0.028em;
  }

  body.unified-cockpit .cockpit-page-head p {
    font-size: 11px;
    line-height: 1.7;
  }

  body.unified-cockpit .cockpit-page-position {
    display: none;
  }

  body.unified-cockpit .cockpit-sheet,
  body.unified-cockpit :where(.form-panel, .panel, .card, .full-section) {
    border-radius: 12px;
  }

  body.unified-cockpit .cockpit-sheet-head {
    padding: 15px 16px;
  }

  body.unified-cockpit .cockpit-capture-layout {
    display: flex;
    flex-direction: column;
  }

  body.unified-cockpit .cockpit-capture-layout > .cockpit-fields {
    order: 2;
  }

  body.unified-cockpit .cockpit-fields,
  body.unified-cockpit .cockpit-capture-layout > .cockpit-fields {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 16px;
  }

  body.unified-cockpit .cockpit-fields > :where(.wide, .full, .field-wide) {
    grid-column: 1;
  }

  body.unified-cockpit .cockpit-field-row {
    min-height: 65px;
    gap: 8px;
  }

  body.unified-cockpit .cockpit-segmented {
    gap: 2px;
    padding: 2px;
  }

  body.unified-cockpit .cockpit-segmented :where(button, label) {
    min-width: 48px;
    min-height: 48px;
    padding: 0 10px;
  }

  body.unified-cockpit .cockpit-evidence-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    order: 1;
    align-items: center;
    gap: 3px 12px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--cockpit-line);
    border-left: 0;
  }

  body.unified-cockpit .cockpit-evidence-panel .cockpit-kicker,
  body.unified-cockpit .cockpit-evidence-empty,
  body.unified-cockpit .cockpit-evidence-note {
    display: none;
  }

  body.unified-cockpit .cockpit-evidence-panel h3 {
    margin: 0;
    font: 700 12px/1.3 var(--cockpit-sans);
  }

  body.unified-cockpit .cockpit-evidence-panel > p {
    grid-column: 1;
    font-size: 10px;
  }

  body.unified-cockpit .cockpit-evidence-panel > :where(.button, .btn) {
    grid-row: 1 / 3;
    grid-column: 2;
    width: 48px;
    min-width: 48px;
    height: 48px;
    padding: 0;
    overflow: hidden;
    border-color: var(--cockpit-line-strong);
    background: var(--cockpit-surface);
    color: var(--cockpit-wine);
    font-size: 0;
  }

  body.unified-cockpit .cockpit-evidence-panel > :where(.button, .btn) .cockpit-icon {
    width: 22px;
    height: 22px;
  }

  body.unified-cockpit .cockpit-sheet-footer {
    padding: 11px 16px;
    font-size: 9px;
  }

  body.unified-cockpit .cockpit-action-dock {
    display: none;
  }

  body.unified-cockpit .cockpit-mobile-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: 52px 52px minmax(0, 1fr);
    min-height: var(--cockpit-dock);
    align-items: center;
    gap: 8px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--cockpit-night);
    color: var(--cockpit-night-text);
    box-shadow: var(--cockpit-shadow-dock);
  }

  body.unified-cockpit .cockpit-mobile-action {
    display: flex;
    min-width: 48px;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 0 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--cockpit-night-text);
    font-size: 8px;
    font-weight: 500;
    text-decoration: none;
  }

  body.unified-cockpit .cockpit-mobile-action:hover {
    background: var(--cockpit-night-hover);
    color: var(--cockpit-surface-solid);
  }

  body.unified-cockpit .cockpit-mobile-primary {
    display: flex;
    min-width: 0;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--cockpit-gold);
    color: var(--cockpit-gold-ink);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
  }

  body.unified-cockpit .cockpit-menu {
    width: 100%;
    max-width: 100%;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  body.unified-cockpit .cockpit-menu-head {
    padding: 18px;
  }

  body.unified-cockpit .cockpit-menu-body {
    max-height: calc(88dvh - 85px);
    padding: 10px 15px;
  }

  body.unified-cockpit .cockpit-menu-item {
    min-height: 56px;
  }

  body.unified-cockpit :where(.table-scroll, .table-box, .table-wrap, .responsive-table) {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  body.unified-cockpit :where(.form-panel, .cockpit-sheet, .full-section, form) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea) {
    min-height: 49px;
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  body.unified-cockpit .cockpit-workspace {
    padding-right: 18px;
    padding-left: 18px;
  }

  body.unified-cockpit .cockpit-mobile-dock {
    grid-template-columns: 48px 48px minmax(0, 1fr);
    padding-right: 10px;
    padding-left: 10px;
  }

  body.unified-cockpit .cockpit-mobile-primary {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.unified-cockpit {
    scroll-behavior: auto;
  }

  body.unified-cockpit *,
  body.unified-cockpit *::before,
  body.unified-cockpit *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}

@media print {
  body.unified-cockpit {
    background: var(--cockpit-surface-solid);
  }

  body.unified-cockpit :where(.cockpit-sidebar, .cockpit-mobile-dock, .cockpit-action-dock, .cockpit-menu) {
    display: none;
  }

  body.unified-cockpit .cockpit-workspace {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.unified-cockpit :where(.cockpit-sheet, .form-panel, .panel, .card, .full-section) {
    break-inside: avoid;
    box-shadow: none;
  }
}
