:root {
  --color-primary: #117894;
  --color-primary-strong: #0f6c85;
  --color-dark: #3b414e;
  --color-hover: #bfced5;
  --color-bg: #f4f1ef;
  --color-surface: #ffffff;
  --color-border: #dcdfe3;
  --color-border-strong: #c3c9d0;
  --color-text: #3b414e;
  --color-muted: #6b7280;
  --color-text-inverse: #ffffff;
  --color-ok: #0f6c85;
  --color-warn: #8a5d00;
  --color-error: #8d2f2f;

  --font-sans: Arial, "Helvetica Neue", Helvetica, sans-serif;

  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;

  --radius-card: 8px;
  --radius-control: 5px;
  --radius-badge: 3px;

  --container-max: 1680px;
  --sidebar-w: 300px;

  --shadow-card: 0 1px 2px rgba(59, 65, 78, 0.06);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }
html.i18n-pending body { visibility: hidden; }

body {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-bg);
}

.page-shell { padding: var(--space-16); }

.app-shell {
  width: min(var(--container-max), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--space-16);
  align-items: start;
}

.sidebar, .workspace { min-width: 0; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  position: sticky;
  top: var(--space-16);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding-right: 2px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.inline-banner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-12) var(--space-16);
}

.inline-banner strong,
.inline-banner p {
  display: block;
}

.inline-banner p {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 12px;
}

.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.inline-banner-warn {
  border-left-color: var(--color-warn);
}

.inline-banner-error {
  border-left-color: var(--color-error);
}

.brand-card, .card, .hero, .panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-16);
  min-width: 0;
}

.brand-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.brand-logo {
  display: block;
  width: min(210px, 100%);
  height: auto;
}

.hero {
  padding: var(--space-12) var(--space-16);
  border-left: 3px solid var(--color-primary);
}

.eyebrow, .section-kicker {
  margin: 0 0 var(--space-4);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-primary);
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  color: var(--color-dark);
}

h1 { font-size: 19px; line-height: 1.2; margin-bottom: var(--space-4); }
h2 { font-size: 16px; line-height: 1.25; margin-bottom: var(--space-4); }
h3 { font-size: 14px; line-height: 1.3; }
h4 { font-size: 13px; line-height: 1.3; }

.lede, .hero-copy, .section-header p, .status-card p,
.checkbox-line, .muted-note, .subsection-header p, .inline-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-muted);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-12);
}

.panel.wide,
.grid > .panel {
  grid-column: 1 / -1;
}

.grid > .panel.half { grid-column: auto; }

.section-header,
.subsection-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-12);
  align-items: baseline;
}

.card-heading-row,
.heading-with-help,
.field-label-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
}

.card-heading-row {
  justify-content: space-between;
  width: 100%;
}

.summary-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  min-width: 0;
}

.section-header {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.subsection-header {
  margin: var(--space-12) 0 var(--space-8);
}

.top-separated {
  margin-top: var(--space-16);
  padding-top: var(--space-12);
  border-top: 1px solid var(--color-border);
}

.section-header p { max-width: 70ch; }

.field-grid,
.inline-field-grid,
.team-detail-grid,
.ancillary-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-8) var(--space-12);
}

.commercial-first-grid .ready-field {
  align-self: stretch;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.field.full { margin-top: var(--space-8); grid-column: 1 / -1; }
.field.is-hidden, .is-hidden { display: none !important; }

.field span {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--color-muted);
  text-transform: uppercase;
}

.compact-field {
  justify-content: end;
}

.compact-field input[type="checkbox"] {
  margin-top: 6px;
}

.field-note { font-size: 11px; line-height: 1.4; color: var(--color-muted); }
.field-note-warn { color: var(--color-warn); font-weight: 700; }

.ready-field { grid-column: span 2; }

.help-trigger,
.help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-primary-strong);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.help-trigger:hover,
.help-tooltip:hover,
.help-trigger:focus-visible,
.help-tooltip:focus-visible {
  border-color: var(--color-primary);
  outline: none;
}

.section-help-popover {
  margin: 0 0 var(--space-12);
  padding: var(--space-8) var(--space-12);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--color-surface) 94%, var(--color-primary) 6%);
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.5;
}

.guide-link,
.mini-btn-link {
  text-decoration: none;
}

.guide-link {
  margin-top: var(--space-12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 var(--space-12);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  color: var(--color-primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.guide-link:hover,
.mini-btn-link:hover {
  background: #f3f8fa;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  font-size: 12px;
}

.commercial-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  margin-bottom: var(--space-12);
  background: #fafafa;
}

.commercial-group:last-child {
  margin-bottom: 0;
}

.commercial-group > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-12);
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-weight: 700;
}

.commercial-group > summary .summary-actions,
.panel-group > summary .summary-actions {
  margin-left: auto;
}

.commercial-group > summary::-webkit-details-marker {
  display: none;
}

.commercial-group > summary small {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-muted);
  text-align: right;
}

.commercial-group[open] > summary {
  border-bottom: 1px solid var(--color-border);
  background: rgba(17, 120, 148, 0.04);
}

.commercial-group > :not(summary) {
  padding: 12px;
}

.panel-group {
  margin: -4px 0;
}

.panel-group > summary {
  cursor: pointer;
  list-style: none;
}

.panel-group > summary::-webkit-details-marker {
  display: none;
}

.panel-group > summary small {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-muted);
  text-align: right;
}

.panel-group > .panel-group-body {
  padding-top: var(--space-12);
}

input, select, textarea, button { font: inherit; }

input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input::placeholder, textarea::placeholder {
  color: #9aa2ab;
  opacity: 1;
  font-style: italic;
}

textarea { resize: vertical; min-height: 68px; line-height: 1.45; overflow-y: hidden; }
.cell-textarea { min-height: 34px; resize: vertical; overflow-y: hidden; }

input:hover, select:hover, textarea:hover { border-color: var(--color-primary); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(17, 120, 148, 0.18);
}

input[readonly], select[readonly], textarea[readonly] {
  background: #f2f4f6;
  border-style: dashed;
  color: var(--color-muted);
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--color-primary);
}

input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }

.action-stack { display: flex; flex-direction: column; gap: var(--space-6); }

.action-btn-danger {
  background: #fff6f6;
  border-color: #d8b1b1;
  color: var(--color-error);
}

.action-btn-danger:hover:not(:disabled) {
  background: #fbeaea;
}

.action-btn, .mini-btn, .row-action {
  border: 0;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.action-btn, .mini-btn {
  border-radius: var(--radius-control);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
}

.clear-btn:disabled,
.action-btn:disabled,
.mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.confirm-strip {
  display: grid;
  gap: var(--space-8);
  margin: 0 0 var(--space-12);
  padding: var(--space-12);
  border: 1px solid #e6d3a0;
  background: #fff9ea;
  border-radius: var(--radius-control);
}

.confirm-strip p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text);
}

.confirm-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.action-btn { background: var(--color-dark); color: var(--color-text-inverse); }
.action-btn.primary { background: var(--color-primary); }
.action-btn:hover { background: #2c313b; }
.action-btn.primary:hover { background: var(--color-primary-strong); }

.mini-btn { background: var(--color-hover); color: var(--color-dark); }
.mini-btn:hover { background: #a9bcc5; }

.table-toggle-btn {
  padding: 5px 8px;
  white-space: nowrap;
}

.action-btn:focus-visible, .mini-btn:focus-visible, .row-action:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.action-btn:disabled, .mini-btn:disabled, .row-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-card {
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-control);
  background: rgba(17, 120, 148, 0.07);
  border-left: 3px solid var(--color-primary);
  font-size: 12px;
}

.status-card.status-warn {
  background: rgba(138, 93, 0, 0.08);
  border-left-color: var(--color-warn);
}

.status-card.status-error {
  background: rgba(141, 47, 47, 0.08);
  border-left-color: var(--color-error);
}

.status-card strong { display: block; margin-bottom: 2px; color: var(--color-dark); }

.blocking-banner {
  padding: 12px 14px;
  border: 1px solid rgba(141, 47, 47, 0.3);
  border-left: 4px solid var(--color-error);
  border-radius: var(--radius-card);
  background: rgba(141, 47, 47, 0.08);
  box-shadow: var(--shadow-card);
}

.blocking-banner strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-error);
}

.blocking-banner.banner-warn {
  border-color: rgba(138, 93, 0, 0.3);
  border-left-color: var(--color-warn);
  background: rgba(138, 93, 0, 0.08);
}

.blocking-banner.banner-warn strong {
  color: #7a4e00;
}

.blocking-banner p {
  margin: 0 0 8px;
  color: var(--color-text);
}

.blocking-banner ul {
  margin: 0;
  padding-left: 18px;
}

.blocking-banner li + li {
  margin-top: 4px;
}

.summary-list { display: grid; gap: 0; margin: 0; }

.summary-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 5px 0;
  border-bottom: 1px solid #eef0f2;
}

.summary-list div:last-child { border-bottom: 0; }

.summary-list dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.summary-list dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-dark);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  min-width: 0;
}

.summary-note {
  margin: var(--space-10) 0 0;
  padding-top: var(--space-10);
  border-top: 1px solid var(--color-border);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--color-muted);
}

.approval-flag, .negative-flag, .below-minimum {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-badge);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.approval-flag, .below-minimum {
  background: rgba(138, 93, 0, 0.16);
  color: var(--color-warn);
}

.negative-flag {
  background: rgba(141, 47, 47, 0.16);
  color: var(--color-error);
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-8);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
}

@media (min-width: 1181px) {
  .ancillary-table-wrap {
    overflow-x: clip;
  }
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  font-size: 12.5px;
}

.data-table thead { background: var(--color-dark); }

.data-table th, .data-table td {
  padding: 5px 7px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-dark);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  color: var(--color-text-inverse);
  white-space: nowrap;
}

.data-table th.numeric-header,
.data-table td.numeric-cell,
.data-table td.numeric-cell input,
.data-table td.numeric-cell select {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(191, 206, 213, 0.16); }
.data-table tbody tr:nth-child(even) { background: rgba(244, 241, 239, 0.6); }
.data-table tbody tr:nth-child(even):hover { background: rgba(191, 206, 213, 0.16); }

.data-table td input,
.data-table td select,
.data-table td textarea {
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 4px;
}

.team-cost-table {
  table-layout: fixed;
}

.ancillary-table {
  table-layout: fixed;
  font-size: 11.5px;
}

.team-cost-table th,
.team-cost-table td,
.ancillary-table th,
.ancillary-table td {
  vertical-align: middle;
}

.team-cost-table th,
.team-cost-table td {
  padding: 4px;
}

.team-cost-table td input,
.team-cost-table td select,
.team-cost-table td textarea,
.ancillary-table td input,
.ancillary-table td select,
.ancillary-table td textarea {
  padding: 2px 3px;
  font-size: 10.5px;
}

.ancillary-table th,
.ancillary-table td {
  padding: 4px 5px;
}

.ancillary-table td input,
.ancillary-table td select,
.ancillary-table td textarea {
  width: 100%;
  min-width: 0;
  font-size: 9.5px;
}

.team-cost-table th {
  white-space: nowrap;
  line-height: 1.2;
}

.team-col-index { width: 40px; }
.team-col-role { width: 82px; }
.team-col-seniority { width: 74px; }
.team-col-dates { width: 118px; }
.team-col-months { width: 102px; }
.team-col-salary { width: 86px; }
.team-col-gm { width: 64px; }
.team-col-markup { width: 70px; }
.team-col-cost { width: 112px; }
.team-col-price { width: 112px; }
.team-col-detail { width: 72px; }
.team-col-actions { width: 48px; }

.team-cost-table th:nth-child(1),
.team-cost-table td:nth-child(1) { width: 40px; }
.team-cost-table th:nth-child(2),
.team-cost-table td:nth-child(2) { width: 82px; }
.team-cost-table th:nth-child(3),
.team-cost-table td:nth-child(3) { width: 74px; }
.team-cost-table th:nth-child(4),
.team-cost-table td:nth-child(4) { width: 118px; }
.team-cost-table th:nth-child(5),
.team-cost-table td:nth-child(5) { width: 102px; }
.team-cost-table th:nth-child(6),
.team-cost-table td:nth-child(6) { width: 86px; }
.team-cost-table th:nth-child(7),
.team-cost-table td:nth-child(7) { width: 64px; }
.team-cost-table th:nth-child(8),
.team-cost-table td:nth-child(8) { width: 70px; }
.team-cost-table th:nth-child(9),
.team-cost-table td:nth-child(9) { width: 112px; }
.team-cost-table th:nth-child(10),
.team-cost-table td:nth-child(10) { width: 112px; }
.team-cost-table th:nth-child(11),
.team-cost-table td:nth-child(11) { width: 72px; }
.team-cost-table th:nth-child(12),
.team-cost-table td:nth-child(12) { width: 48px; }

.team-cost-table td select[data-field="seniority"] {
  font-size: 9.5px;
}

.team-col-role textarea,
.ancillary-table td:nth-child(3) input,
.data-table td input[type="text"] {
  min-width: 72px;
}

.team-dates-stack,
.team-months-stack,
.team-gm-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.team-dates-stack small,
.team-months-stack small {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}

.team-col-markup.team-derived-cell {
  color: var(--color-muted);
}

.team-detail-topline {
  display: flex;
  justify-content: space-between;
  gap: var(--space-12);
  align-items: center;
  margin-bottom: var(--space-12);
  flex-wrap: wrap;
}

.team-period-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-badge);
  background: rgba(17, 120, 148, 0.09);
  font-weight: 700;
}

.team-detail-summary {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.team-row-flag {
  color: var(--color-warn);
  font-weight: 700;
}

.team-cost-table .table-toggle-btn {
  width: 100%;
  padding: 4px 6px;
  font-size: 11px;
}

.ancillary-table th,
.ancillary-table td {
  white-space: nowrap;
}

.ancillary-table th {
  white-space: normal;
  line-height: 1.15;
}

.ancillary-table th:nth-child(1),
.ancillary-table td:nth-child(1) { width: 30px; }
.ancillary-table th:nth-child(2),
.ancillary-table td:nth-child(2) { width: 84px; }
.ancillary-table th:nth-child(3),
.ancillary-table td:nth-child(3) { width: 110px; white-space: normal; }
.ancillary-table th:nth-child(4),
.ancillary-table td:nth-child(4) { width: 68px; }
.ancillary-table th:nth-child(5),
.ancillary-table td:nth-child(5) { width: 70px; white-space: normal; }
.ancillary-table th:nth-child(6),
.ancillary-table td:nth-child(6) { width: 46px; }
.ancillary-table th:nth-child(7),
.ancillary-table td:nth-child(7) { width: 62px; }
.ancillary-table th:nth-child(8),
.ancillary-table td:nth-child(8) { width: 150px; white-space: normal; }
.ancillary-table th:nth-child(9),
.ancillary-table td:nth-child(9) { width: 96px; }
.ancillary-table th:nth-child(10),
.ancillary-table td:nth-child(10) { width: 56px; }
.ancillary-table th:nth-child(11),
.ancillary-table td:nth-child(11) { width: 56px; }
.ancillary-table th:nth-child(12),
.ancillary-table td:nth-child(12) { width: 96px; }
.ancillary-table th:nth-child(13),
.ancillary-table td:nth-child(13) { width: 34px; }

.data-table td.readonly-cell {
  white-space: nowrap;
  font-weight: 700;
  text-align: right;
  color: var(--color-dark);
  font-variant-numeric: tabular-nums;
}

.data-table td.flag-cell { white-space: nowrap; }

.team-actions-cell {
  vertical-align: middle;
  white-space: nowrap;
  text-align: right;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.row-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-height: 100%;
}

.row-action {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(141, 47, 47, 0.1);
  color: var(--color-error);
  font-size: 12px;
  line-height: 1;
  padding: 0;
}

.row-action-neutral {
  background: rgba(17, 120, 148, 0.12);
  color: var(--color-primary-strong);
}

.row-action:hover { background: rgba(141, 47, 47, 0.2); }
.row-action-neutral:hover { background: rgba(17, 120, 148, 0.2); }

.team-detail-row td,
.ancillary-meta-row td {
  background: #fbfcfd;
}

.team-detail-grid {
  margin-bottom: var(--space-12);
}

.inline-meta {
  display: block;
}

.ancillary-meta-grid {
  align-items: end;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ancillary-detail-toggle {
  margin-right: 6px;
}

.ancillary-table .row-actions-group {
  gap: 1px;
}

.ancillary-table .row-action {
  width: 16px;
  height: 16px;
  font-size: 11px;
}

.ancillary-table .ancillary-detail-toggle {
  margin-right: 0;
}

.team-detail-topline-muted {
  margin-bottom: 0;
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.assigned-summary-cell strong,
.assigned-summary-cell small {
  display: block;
}

.assigned-summary-cell strong {
  font-size: 11px;
}

.assigned-summary-cell {
  line-height: 1.25;
}

.ancillary-table td[data-output="months"] {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.ancillary-table td.readonly-cell {
  font-size: 10.5px;
}

.ancillary-table td[data-output="totalCost"],
.ancillary-table td[data-output="sellPrice"] {
  white-space: nowrap;
  font-size: 9.5px;
  letter-spacing: -0.01em;
}

.ancillary-warning {
  color: var(--color-warn);
  font-weight: 700;
}

.ancillary-assignment-field {
  grid-column: 1 / -1;
}

.ancillary-assignee-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 6px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: rgba(17, 120, 148, 0.04);
}

.stacked-margin { margin-top: var(--space-12); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .grid { grid-template-columns: 1fr; }
  .team-cost-table,
  .team-cost-table thead,
  .team-cost-table tbody,
  .team-cost-table tr,
  .team-cost-table td {
    display: block;
    width: 100% !important;
  }
  .team-cost-table thead {
    position: absolute;
    width: 1px !important;
    height: 1px;
    margin: -1px;
    left: 0;
    top: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
  }
  .team-main-row {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    margin-bottom: var(--space-8);
    overflow: hidden;
    background: var(--color-surface);
  }
  .team-main-row td {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-8);
    white-space: normal;
  }
  .team-main-row td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
  }
  .team-main-row td:first-child::before {
    content: attr(data-label);
  }
  .team-main-row td:first-child {
    background: rgba(17, 120, 148, 0.04);
    font-weight: 700;
  }
  .team-main-row .team-actions-cell {
    grid-template-columns: 132px auto;
  }
  .panel-group > summary small {
    text-align: left;
  }
  .team-detail-row td {
    display: block;
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  .page-shell { padding: var(--space-8); }
  .brand-card, .card, .hero, .panel { padding: var(--space-12); border-radius: 6px; }
  h1 { font-size: 17px; }
  h2 { font-size: 15px; }
  .field-grid, .inline-field-grid, .team-detail-grid, .ancillary-meta-grid { grid-template-columns: 1fr; }
  .ready-field { grid-column: auto; }
  .action-btn, .mini-btn { width: 100%; }
  .section-header, .subsection-header, .commercial-group > summary { flex-direction: column; align-items: flex-start; }
  .team-main-row td {
    grid-template-columns: 1fr;
  }
  .team-main-row td::before {
    margin-bottom: 2px;
  }
  .team-actions-cell {
    display: flex !important;
    gap: var(--space-8);
    align-items: center;
  }
}

@media print {
  .sidebar, .table-toolbar, .action-stack { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .panel, .card { break-inside: avoid; box-shadow: none; }
}
