:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d9dee7;
  --text: #17202a;
  --muted: #667085;
  --brand: #1f6feb;
  --ok: #137333;
  --warn: #b26a00;
  --danger: #b42318;
  --app-header-height: 60px;
  --chapter-toolbar-height: 40px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.app-content { display: contents; }

html:has(body > .topbar) { height: 100%; overflow: hidden; }
body:has(> .topbar) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body:has(> .topbar) > .topbar { flex-shrink: 0; }
body:has(> .topbar) > .app-content {
  display: block;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}
body:has(> .topbar) > .app-content:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
body:has(> .topbar):has(dialog[open]) > .app-content { overflow: hidden; }

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--app-header-height);
  background: #1d2733;
  color: #fff;
  padding: 8px 20px;
}

.topbar a {
  color: #fff;
  font-weight: 700;
}

.topbar-spacer {
  flex: 1;
}

.topbar-brand, .topbar-divider, .topbar-session, .topbar .user-menu, .topbar-username, .topbar-user-identity { flex-shrink: 0; }
.topbar-brand { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; font-size: 21px; line-height: 1.2; }
.topbar-logo { display: block; flex-shrink: 0; width: 40px; height: 40px; object-fit: contain; border-radius: 7px; }
.topbar-divider { color: #9dacbf; font-size: 22px; line-height: 1; }
.topbar-username, .topbar .user-menu-name { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.administrator-avatar, .government-avatar, .company-avatar { display: block; flex-shrink: 0; width: 36px; height: 36px; object-fit: contain; }
.government-avatar, .company-avatar { border-radius: 4px; }
.topbar-user-identity { display: inline-flex; align-items: center; gap: 7px; }

.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 7px; padding: 6px 0; cursor: pointer; list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:focus-visible { outline: 2px solid #93c5fd; outline-offset: 5px; border-radius: 3px; }
.user-menu-arrow { font-size: 12px; }
.user-menu[open] .user-menu-arrow { transform: rotate(180deg); }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 100; min-width: 190px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.topbar .user-menu-panel a { display: block; padding: 10px 12px; color: var(--text); font-weight: 600; border-radius: 4px; }
.topbar .user-menu-panel a:hover,
.topbar .user-menu-panel a:focus-visible { background: #eef4ff; color: #1755b1; text-decoration: none; }

.logout-form {
  margin: 0;
}

.topbar-session { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 3px; }
.topbar-account-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.topbar-account-actions .user-menu summary { padding: 0; }

.topbar .logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  background: transparent;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 16px;
  line-height: 20px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.topbar .logout-button .logout-icon {
  display: block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.topbar .logout-button:hover,
.topbar .logout-button:focus-visible {
  color: #F28B82;
  border-color: #F28B82;
  background-color: rgba(242, 139, 130, 0.12);
}

.topbar .logout-button:focus-visible {
  outline: 2px solid #F28B82;
  outline-offset: 2px;
}

.page {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.app-navigation { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; }
.app-navigation-items { display: flex; align-items: center; gap: 6px; width: 100%; padding: 3px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-inline: contain; }
.app-navigation-items::-webkit-scrollbar { display: none; }
.topbar .app-navigation .button { flex-shrink: 0; min-height: 34px; padding: 6px 10px; border-color: #8193aa; background: transparent; color: #edf3fc; font-size: 14px; line-height: 20px; white-space: nowrap; }
.topbar .app-navigation .button:hover { border-color: #c1d0e3; background: #314359; text-decoration: none; }
.topbar .app-navigation .button[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.topbar .app-navigation .button:focus-visible, .topbar-brand:focus-visible { outline: 2px solid #c4dcff; outline-offset: 2px; }
@media (max-width: 850px) {
  .topbar { gap: 8px; padding-inline: 10px; }
  .topbar .app-navigation .button { font-size: 13px; padding-inline: 8px; }
  .topbar-username, .topbar .user-menu-name { max-width: 8rem; font-size: 13px; }
}
@media (max-width: 480px) {
  .topbar { gap: 6px; padding-inline: 8px; }
  .topbar-brand { font-size: 18px; }
  .topbar-logo { width: 32px; height: 32px; border-radius: 5px; }
  .topbar-username, .topbar .user-menu-name { max-width: 5rem; }
  .administrator-avatar, .government-avatar, .company-avatar { width: 32px; height: 32px; }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filing-workspace {
  position: sticky;
  top: var(--app-header-height);
  z-index: 30;
  min-width: 0;
  margin: 0 0 18px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.06);
}

body:has(> .topbar) .filing-workspace { top: 0; }

.filing-workspace-header,
.filing-workspace-actions,
.filing-section-heading,
.filing-chapter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.filing-workspace-identity { min-width: 0; }
.filing-workspace-header { margin-bottom: 10px; }
.filing-workspace-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.filing-workspace-identity h1 { font-size: 22px; line-height: 1.2; }
.filing-workspace-identity p { margin: 6px 0 0; font-size: 14px; line-height: 1.4; }
.filing-workspace-identity p span { color: var(--muted); }
.filing-related-navigation { display: flex; min-width: 0; max-width: 100%; }
.filing-related-button.button { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 12px; line-height: 1.3; padding: 6px 10px; background: #f3e8ff; border-color: #c4b5fd; color: #6d28d9; }
.filing-related-button .filing-related-label { font-weight: 400; }
.filing-related-button.button:hover { background: #ede9fe; border-color: #8b5cf6; color: #5b21b6; text-decoration: none; }
.filing-related-button.button:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.filing-workspace-actions { justify-content: flex-end; flex-shrink: 0; }
.filing-workspace-actions .button { font-size: 13px; padding: 8px 10px; white-space: nowrap; }
.filing-workspace-actions .filing-observations-button { align-self: flex-start; }
.filing-observations-button[hidden], #copy-observations[hidden] { display: none; }
.modal.observation-report-modal { width: min(570px, calc(100vw - 32px)); }
.observation-report-modal textarea { min-height: 100px; }
.observation-report-text { white-space: pre; overflow-x: auto; }
.observation-open-filter input[type="checkbox"] { accent-color: #15803d; }

.filing-chapters {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 3px;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.filing-chapter-link {
  position: relative;
  display: grid;
  flex: 1 0 110px;
  grid-template-rows: 14px 28px;
  justify-items: center;
  align-items: center;
  text-align: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 5px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
}

.filing-chapter-number { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; padding-inline: 20px; font-size: 11px; line-height: 14px; font-weight: 800; white-space: nowrap; }
.filing-chapter-editing-icon { display: inline-flex; flex-shrink: 0; color: #92400e; }
.filing-chapter-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; width: 100%; max-height: 28px; overflow: hidden; font-size: 12px; line-height: 14px; font-weight: 600; }
.filing-state-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; color: #667085; background: #eef2f6; font-size: 14px; line-height: 1; font-weight: 800; font-family: "Segoe UI Symbol", Arial, sans-serif; }
.filing-chapter-link > .filing-state-icon { position: absolute; top: 4px; right: 4px; }
.filing-chapter-card { position: relative; display: flex; flex: 1 0 110px; min-width: 0; }
.filing-chapter-card .filing-chapter-link { flex-basis: 0; }
.filing-chapter-menu-trigger {
  position: absolute;
  top: 3px;
  left: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #536780;
  font: bold 18px/1 Arial, sans-serif;
  cursor: pointer;
}
.filing-chapter-menu-trigger:hover,
.filing-chapter-menu-trigger[aria-expanded="true"] { background: #dbeafe; color: #1755b1; }
.filing-chapter-menu-trigger:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.filing-chapter-menu {
  position: fixed;
  z-index: 90;
  width: min(250px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #a7b6cb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(17, 35, 58, .2);
}
.filing-chapter-menu[hidden], .filing-chapter-menu [hidden] { display: none !important; }
.filing-chapter-menu-title { padding: 6px 9px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.filing-chapter-menu form { margin: 0; }
.filing-chapter-menu [role="menuitem"] {
  display: block;
  width: 100%;
  padding: 10px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.filing-chapter-menu [role="menuitem"]:hover,
.filing-chapter-menu [role="menuitem"]:focus-visible { outline: none; background: #e8f0fc; color: #1755b1; }
.filing-state-approved { color: #137333; background: #dcfce7; }
.filing-state-completed, .filing-state-submitted { color: #1d4ed8; background: #dbeafe; }
.filing-state-reviewed, .filing-state-under_review { color: #6d28d9; background: #ede9fe; }
.filing-state-observed { color: #b45309; background: #fef3c7; }
.filing-state-rejected { color: #b42318; background: #fee2e2; }
.filing-chapter-link:hover { background: #eef4ff; border-color: #83adf9; text-decoration: none; }
.filing-chapter-link.is-active { background: #eef4ff; border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); color: #1755b1; }
.filing-chapter-link.is-editing { background: #fffbeb; border-color: #d69a19; box-shadow: inset 0 0 0 1px #d69a19; color: #92400e; }
.filing-chapter-link.is-editing .filing-chapter-number { padding-inline: 18px; }
.filing-chapter-link:focus-visible { outline: 3px solid #83adf9; outline-offset: 2px; }
.filing-section-heading { align-items: flex-start; margin: 0 0 16px; }
.filing-section-heading h2 { font-size: 24px; }
.filing-section-heading form { margin: 0; flex-shrink: 0; }
.filing-summary-heading { align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; }
.filing-summary-heading h2 { margin: 0; line-height: 1.2; }
.filing-summary-heading .history-access { margin: 0 0 0 auto; }
.section-review-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 10px; min-height: var(--chapter-toolbar-height); margin: 16px 0 0; padding-bottom: 4px; }
.section-review-toolbar form { margin: 0; }
.section-review-toolbar .button { min-height: 32px; font-size: 13px; padding: 5px 10px; }
.section-review-toolbar .history-link { font-size: 13px; line-height: 20px; white-space: nowrap; }
.section-table-toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 10px; margin-bottom: 10px; }
.section-table-toolbar:not(:has(> :not(.hidden))) { display: none; }
.section-information { margin: 0 0 10px; min-width: 0; }
.section-table-toolbar > .section-information { flex: 1 1 200px; margin: 0; }
.section-information > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  color: #1755b1;
  font: bold 18px/1 Georgia, serif;
  list-style: none;
  cursor: pointer;
}
.section-information > summary::-webkit-details-marker { display: none; }
.section-information > summary:hover,
.section-information[open] > summary { background: #eff6ff; border-color: var(--brand); }
.section-information > summary:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.section-information-content { margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; font-size: 14px; line-height: 1.45; }
.section-information-content > :first-child { margin-top: 0; }
.section-information-content > :last-child { margin-bottom: 0; }
.filing-section-eyebrow { margin: 0 0 4px; font-size: 12px; }
.filing-chapter-footer { flex-wrap: wrap; margin-top: 24px; }
.readonly-mode .section-state-panel { display: none; }

@media (max-width: 700px) {
  .filing-workspace-header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .filing-workspace-identity h1 { font-size: 19px; }
  .filing-workspace-identity p { font-size: 12px; }
  .filing-workspace-actions { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .filing-workspace-actions .button { font-size: 12px; padding: 6px 8px; }
  .filing-section-heading { flex-direction: column; gap: 8px; }
  .filing-section-heading h2 { font-size: 21px; }
}

.header-date {
  margin: 4px 0 0;
  font-size: 14px;
  white-space: nowrap;
}

h1,
h2,
h3 {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 14px;
}

.filing-summary-grid { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
.filing-summary-grid > .panel { min-width: 0; }
.filing-summary-grid .data-list dd { min-width: 0; overflow-wrap: anywhere; }

.personnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
  margin-top: 14px;
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table th,
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #eef2f7;
  font-size: 13px;
  color: #344054;
}

.filing-list-pair .filing-list-value {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-height: 30px;
  white-space: nowrap;
}

.filing-list-status { display: inline-flex; align-items: center; gap: 6px; }
.filing-observation-icon { flex: none; color: var(--danger); }

.table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.table-sort-link:hover,
.table-sort-link:focus-visible,
.table-sort-link.is-active {
  color: var(--brand);
}

.table-sort-link:hover,
.table-sort-link:focus-visible {
  text-decoration: underline;
}

.table-sort-indicator {
  font-size: 14px;
}

.table.compact th,
.table.compact td {
  padding: 8px;
}

.table input,
.table select,
.table textarea {
  min-width: 86px;
}

.personnel-grid .table input[type="number"] {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  height: 26px;
  padding: 3px 7px;
  line-height: 18px;
}

.personnel-grid .table th,
.personnel-grid .table td {
  white-space: nowrap;
  vertical-align: middle;
}

.personnel-grid .table th {
  padding: 6px 8px;
}

.personnel-grid .table td {
  padding: 5px 8px;
}

.personnel-hours-table {
  table-layout: fixed;
  min-width: 560px;
}

.personnel-hours-month { width: 128px; }
.personnel-hours-value { width: 152px; }

.personnel-hours-table.table th,
.personnel-hours-table.table td {
  padding: 5px 8px;
}

.personnel-hours-table.table input {
  width: 120px;
  max-width: 100%;
  height: 28px;
  padding: 3px 7px;
  line-height: 20px;
}

.personnel-hours-table.table textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  height: 28px;
  padding: 3px 7px;
  font-family: inherit;
  line-height: 20px;
  resize: none;
  overflow: hidden;
}

.personnel-shifts-table { table-layout: fixed; min-width: 1020px; }
.personnel-shifts-table .shift-number-column { width: 68px; }
.personnel-shifts-table .shift-name-column { width: 200px; }
.personnel-shifts-table .shift-type-column { width: 150px; }
.personnel-shifts-table .shift-hours-column { width: 88px; }
.personnel-shifts-table .shift-time-column { width: 112px; }
.personnel-shifts-table .shift-actions-column { width: 100px; }
.personnel-shifts-table.table th,
.personnel-shifts-table.table td { padding: 6px 8px; }
.personnel-shifts-table.table input:not([type="checkbox"]),
.personnel-shifts-table.table select {
  min-width: 0;
  height: 32px;
  padding: 4px 6px;
  line-height: 22px;
}
.personnel-shifts-table .shift-number-cell input:not([type="hidden"]) { width: 52px; }
.personnel-shifts-table .shift-hours-cell input { width: 72px; }
.personnel-shifts-table.table textarea {
  display: block;
  min-width: 0;
  min-height: 32px;
  height: 32px;
  padding: 4px 6px;
  font-family: inherit;
  line-height: 22px;
  resize: none;
  overflow: hidden;
}
.personnel-shifts-table .shift-pending-delete { background: #fff2f0; }
.personnel-shifts-table .shift-delete-note { display: block; margin-top: 4px; white-space: normal; font-size: 11px; color: var(--danger); }
.personnel-shifts-panel > .add-shift-button { margin-top: 10px; }
.personnel-shifts-heading { margin-bottom: 8px; }

.energy-table th,
.energy-table td {
  min-width: 140px;
  white-space: nowrap;
}

.energy-table th:first-child,
.energy-table td:first-child {
  min-width: 88px;
}

.energy-table input[type="number"] {
  min-width: 96px;
  max-width: 110px;
  padding: 6px 7px;
  text-align: right;
}

.energy-table textarea {
  min-width: 220px;
  min-height: 40px;
  padding: 6px 7px;
  font-family: Arial, Helvetica, sans-serif;
}

.energy-table tfoot td {
  text-align: right;
  font-weight: 700;
}

.energy-grid-table th,
.energy-grid-table td {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  vertical-align: middle;
}

.energy-grid-table th:first-child,
.energy-grid-table td:first-child {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.energy-grid-table th:last-child,
.energy-grid-table td:last-child {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.energy-grid-table thead th {
  height: 58px;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.energy-grid-table tbody td,
.energy-grid-table tfoot td,
.energy-grid-table tfoot th {
  white-space: nowrap;
}

.energy-grid-table .numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.energy-grid-table tbody tr {
  height: 44px;
}

.annual-section-body {
  max-width: none;
}

.annual-section-body h3 {
  margin: 8px 0 10px;
  font-size: 18px;
  text-transform: uppercase;
}

.annual-section-text {
  max-width: 920px;
  margin: 8px 0 14px;
  color: #344054;
  line-height: 1.45;
}

.annual-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 10px 18px;
  align-items: center;
  margin: 12px 0 16px;
}

.annual-declared-record + .annual-declared-record { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.declared-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 240px); max-width: 1100px; margin: 12px 0 22px; }
.declared-fields dt, .declared-fields dd { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); line-height: 1.4; }
.declared-fields dt { font-weight: 600; }
.declared-number { text-align: right; font-variant-numeric: tabular-nums; }
.declared-total { background: #eef4ff; font-weight: 700; }
.declared-text-fields { grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); }
.declared-text { overflow-wrap: anywhere; line-height: 1.5; }
.declared-organization-table { min-width: 850px; }
.declared-organization-table .declared-number { text-align: right; }
.declared-organization-table tbody th { min-width: 200px; }
.declared-organization-table tbody th, .declared-quality-table tbody th { background: transparent; font-weight: 600; }
.declared-quality-table { max-width: 900px; }
.administrative-edit-banner { border-left: 4px solid var(--brand); margin-bottom: 18px; }
.administrative-edit-banner h2 { font-size: 20px; }
.administrative-edit-banner textarea { display: block; margin-top: 8px; width: 100%; height: 72px; min-height: 72px; resize: vertical; }
.audit-edit-entry { margin-bottom: 18px; }
.audit-edit-entry summary { cursor: pointer; font-weight: 600; margin: 12px 0; }
.audit-change-value { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 440px; }
.administrative-record-table input, .administrative-record-table select, .administrative-record-table textarea { max-width: 100%; min-width: 110px; }
.administrative-record-table .money-input { text-align: right; }
.administrative-record-table th input, .administrative-record-table th select { display: block; margin-top: 6px; }
.administrative-edit-mode .section-state-panel { display: none; }
@media (max-width: 600px) {
  .declared-fields, .declared-text-fields { grid-template-columns: 1fr; }
  .declared-fields dt { border-bottom: 0; padding-bottom: 3px; }
  .declared-fields dd { padding-top: 3px; }
}

.annual-field-grid label {
  font-weight: 600;
  line-height: 1.35;
}

.annual-field-grid .money-input {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  padding: 6px 7px;
  text-align: right;
  background: #ffffff;
  border: 2px solid #98a2b3;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.08);
}

.annual-field-grid .money-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.annual-field-grid .errorlist {
  margin: 4px 0 0;
}

.annual-subtotal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.annual-subtotal strong {
  text-align: right;
}

.annual-income-table th,
.annual-income-table td {
  vertical-align: middle;
}

.annual-income-table th:first-child,
.annual-income-table td:first-child {
  width: 150px;
  min-width: 150px;
}

.annual-income-table .money-input {
  min-width: 150px;
  max-width: 180px;
  padding: 6px 7px;
  text-align: right;
  background: #ffffff;
  border: 2px solid #98a2b3;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.08);
}

.annual-income-table .money-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.annual-income-table td:last-child,
.annual-income-table .summary-row td {
  font-variant-numeric: tabular-nums;
}

.annual-income-table .summary-row {
  font-weight: 700;
  background: #f8fafc;
}

.annual-income-table .total-row {
  background: #eef2f7;
}

.annual-iva-table {
  max-width: 760px;
}

.annual-vat-gross-table {
  max-width: 980px;
}

.annual-vat-gross-table th,
.annual-vat-gross-table td {
  width: 20%;
}

.annual-iibb-table {
  min-width: 980px;
}

.annual-iibb-table th {
  min-width: 150px;
  text-align: center;
  white-space: normal;
}

.annual-iibb-table th:first-child,
.annual-iibb-table td:first-child {
  min-width: 160px;
  width: 160px;
}

.annual-iibb-table .money-input,
.annual-vat-gross-table .money-input {
  width: 150px;
}

.calculated-money-field {
  display: inline-block;
  width: 150px;
  padding: 6px 7px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.monthly-sales-table {
  max-width: 780px;
}

.monthly-sales-table th,
.monthly-sales-table td {
  width: 25%;
}

.annual-production-form .annual-section-body > h2 {
  margin: 0 0 18px;
  text-align: center;
  text-decoration: underline;
  text-transform: uppercase;
  font-size: 14px;
}

.annual-production-form .annual-section-body h3 {
  margin-top: 0;
  font-size: 15px;
}

.annual-production-form .annual-field-grid label {
  font-weight: 400;
}

.annual-production-form .annual-field-grid .money-input,
.annual-production-form .annual-income-table .money-input {
  border-color: #667085;
}

.annual-production-form .annual-subtotal {
  border-color: #98a2b3;
  border-radius: 0;
  background: #f8fafc;
  text-transform: uppercase;
}

.annual-production-form .annual-subtotal.total-row {
  font-weight: 700;
}

.annual-production-form .annual-income-table th {
  text-align: center;
  color: #000080;
}

.annual-production-form .annual-income-table td {
  border-color: #98a2b3;
}

.annual-production-form .monthly-sales-table {
  margin: 0 auto;
}

.annual-production-form .monthly-sales-table td:nth-child(1),
.annual-production-form .monthly-sales-table td:nth-child(3) {
  color: #000080;
}

.annual-product-production-table {
  min-width: 1040px;
}

.annual-product-production-table th {
  white-space: normal;
  text-align: center;
  line-height: 1.15;
}

.annual-product-production-table .two-line-header span {
  display: block;
}

.annual-product-production-table td {
  vertical-align: middle;
}

.annual-product-production-table .money-input {
  width: 145px;
  min-width: 145px;
  max-width: 145px;
  padding: 6px 7px;
  text-align: right;
  border: 2px solid #667085;
  background: #ffffff;
}

.annual-product-production-table .numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.annual-product-production-table tfoot td {
  font-weight: 700;
  background: #eef2f7;
}

.contracted-services-table th:nth-child(2),
.contracted-services-table td:nth-child(2) {
  width: 130px;
  text-align: center;
}

.contracted-services-table input[type="checkbox"] {
  min-width: 0;
  width: auto;
}

.contracted-services-table .wide-input {
  width: 100%;
  min-width: 320px;
}

@media (max-width: 760px) {
  .annual-field-grid,
  .annual-subtotal {
    grid-template-columns: 1fr;
  }

  .annual-field-grid .money-input {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

.material-purchase-table select,
.company-material-table select,
.input-purchase-table select,
.company-input-table select,
.imported-material-purchase-table select,
.imported-input-purchase-table select,
.company-imported-input-table select,
.product-production-table select,
.company-product-table select,
.domestic-sale-table select,
.export-sale-table select {
  min-width: 170px;
}

.material-purchase-table input[type="number"],
.input-purchase-table input[type="number"],
.imported-material-purchase-table input[type="number"],
.imported-input-purchase-table input[type="number"],
.product-production-table input[type="number"],
.domestic-sale-table input[type="number"],
.export-sale-table input[type="number"] {
  min-width: 96px;
  max-width: 115px;
  padding: 6px 7px;
  text-align: right;
}

.material-purchase-table textarea,
.input-purchase-table textarea,
.imported-material-purchase-table textarea,
.imported-input-purchase-table textarea,
.product-production-table textarea,
.domestic-sale-table textarea,
.export-sale-table textarea {
  min-width: 180px;
  min-height: 38px;
  padding: 6px 7px;
  font-family: Arial, Helvetica, sans-serif;
}

.company-material-table input[type="text"],
.company-input-table input[type="text"],
.company-imported-input-table input[type="text"],
.company-product-table input[type="text"] {
  min-width: 240px;
}

.table textarea {
  min-width: 220px;
  min-height: 84px;
}

.data-grid th,
.data-grid td {
  white-space: nowrap;
}

.data-grid tbody tr {
  cursor: default;
}

.data-grid tbody tr:hover {
  background: #f8fafc;
}

.data-grid .empty-cell {
  color: var(--muted);
  text-align: center;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.filing-list .row-actions { flex-wrap: wrap; }

.tps-import-selection-bar {
  position: sticky;
  top: calc(var(--app-header-height) + 8px);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

body:has(> .topbar) .tps-import-selection-bar { top: 8px; }

.tps-import-errors {
  margin: 16px 0;
  padding: 16px;
  border: 2px solid var(--danger);
  border-radius: 8px;
  background: #fff5f4;
  color: #7a271a;
}

.tps-import-errors h2,
.tps-import-errors h3 {
  color: var(--danger);
}

.tps-company-selection-bar {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.tps-company-bulk-actions,
.tps-excluded-companies {
  margin: 16px 0;
}

.tps-company-selection-table td {
  vertical-align: top;
}

.tps-company-selection-table td:last-child {
  min-width: 280px;
}

.tps-company-selection-table p {
  margin: 0 0 6px;
}

.compact-button {
  min-height: 30px;
  padding: 5px 9px;
}

.machinery-equipment-table,
.machinery-catalog-table {
  table-layout: fixed;
  font-size: 15px;
}

.machinery-equipment-table th,
.machinery-equipment-table td,
.machinery-catalog-table th,
.machinery-catalog-table td {
  padding: 7px 8px;
  white-space: normal;
  line-height: 1.22;
}

.machinery-equipment-table th:nth-child(1),
.machinery-equipment-table td:nth-child(1),
.machinery-catalog-table th:nth-child(1),
.machinery-catalog-table td:nth-child(1) {
  width: 38%;
}

.machinery-equipment-table th:nth-child(2),
.machinery-equipment-table td:nth-child(2),
.machinery-catalog-table th:nth-child(2),
.machinery-catalog-table td:nth-child(2) {
  width: 18%;
}

.machinery-equipment-table th:nth-child(3),
.machinery-equipment-table td:nth-child(3),
.machinery-catalog-table th:nth-child(3),
.machinery-catalog-table td:nth-child(3) {
  width: 13%;
}

.machinery-equipment-table th:nth-child(4),
.machinery-equipment-table td:nth-child(4),
.machinery-catalog-table th:nth-child(4),
.machinery-catalog-table td:nth-child(4) {
  width: 15%;
}

.machinery-equipment-table th:last-child,
.machinery-equipment-table td:last-child,
.machinery-catalog-table th:last-child,
.machinery-catalog-table td:last-child {
  width: 16%;
}

.machinery-equipment-table .actions-cell,
.machinery-catalog-table .actions-cell {
  white-space: nowrap;
}

.machinery-equipment-table .actions-cell .row-actions,
.machinery-catalog-table .actions-cell .row-actions {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.machinery-equipment-table .compact-button,
.machinery-catalog-table .compact-button {
  display: inline-block;
  min-height: 26px;
  padding: 3px 5px;
  font-size: 13px;
}

.machinery-header-cell > span {
  display: block;
}

.machinery-stacked-cell {
  display: table-cell;
}

.machinery-stacked-cell > strong,
.machinery-stacked-cell > span {
  display: block;
}

.machinery-stacked-cell > span {
  color: var(--muted);
}

.marked-delete {
  opacity: 0.48;
  text-decoration: line-through;
}

.formset-table input[type="checkbox"] {
  width: auto;
  min-width: 0;
}

.formset-table input[type="date"] {
  min-width: 140px;
}

.notes-panel {
  margin-bottom: 14px;
}

.notes-panel textarea {
  min-height: 96px;
}

.add-shift-button {
  margin-top: 10px;
}

.calculated-total {
  min-width: 54px;
  text-align: right;
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2f7;
  color: #344054;
}

.status-submitted,
.status-reviewed,
.status-completed {
  background: #dcfce7;
  color: var(--ok);
}

.filing-list .status-submitted {
  background: #ffedd5;
  color: #9a3412;
}

.status-draft {
  background: #fff7ed;
  color: var(--warn);
}

.status-under_review {
  background: #e0f2fe;
  color: #075985;
}

.status-approved {
  background: #dcfce7;
  color: var(--ok);
}

.status-overdue,
.status-observed,
.status-rejected {
  background: #fee4e2;
  color: var(--danger);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.button.button-add { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button-add-icon { width: 1em; height: 1em; flex-shrink: 0; }

.button.secondary {
  background: #fff;
  color: var(--brand);
}

.button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.filter-bar > .button {
  min-height: 40px;
}

.company-dashboard-actions {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(360px, 0.8fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 18px;
}

.company-dashboard-actions .panel {
  margin: 0;
}

.dashboard-create-panel,
.dashboard-catalog-panel {
  display: flex;
  flex-direction: column;
}

.dashboard-create-panel .muted,
.dashboard-catalog-panel .muted {
  margin: 10px 0 0;
}

.dashboard-create-form {
  grid-template-columns: minmax(240px, 1fr) minmax(140px, 220px);
  margin-top: auto;
}

.catalog-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.catalog-link {
  min-height: 48px;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  line-height: 1.15;
}

.catalog-link small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.catalog-link.disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.assignment-subgroup {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.filter-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.company-directory-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "field action";
  gap: 6px 12px;
  margin: 12px 0 22px;
}

.company-directory-search > label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.company-directory-search-field { grid-area: field; min-width: 0; }
.company-directory-search > .button { grid-area: action; align-self: stretch; }

@media (max-width: 600px) {
  .filter-bar > .button {
    min-height: 36px;
  }

  .company-directory-search {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "field" "action";
  }
}

.company-search {
  position: relative;
  min-width: 0;
}

.company-search input {
  padding-right: 58px;
}

.company-search [hidden] {
  display: none !important;
}

.company-search-action {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 27px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.company-search-clear { right: 28px; }
.company-search-toggle { right: 2px; }

.company-search-action:hover,
.company-search-action:focus-visible {
  color: var(--brand);
  background: #eef4ff;
}

.company-search-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 90;
  width: min(32rem, calc(100vw - 40px));
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 6px 18px #18273826;
}

.company-search-option,
.company-search-empty {
  padding: 9px 12px;
  overflow-wrap: anywhere;
}

.company-search-option { cursor: pointer; }
.company-search-option small { display: block; color: var(--muted); margin-top: 3px; }
.company-search-option[aria-selected="true"] { font-weight: 700; }
.company-search-option.is-highlighted { background: #e8f0ff; color: #174a9b; }
.company-search-empty { color: var(--muted); }
.company-search-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #eef2f7;
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tab-button.active {
  background: var(--panel);
  color: var(--brand);
}

.tab-panel {
  border-top-left-radius: 0;
  margin-top: 0;
}

.company-section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 16px;
  min-height: var(--chapter-toolbar-height);
}
.company-section-toolbar .tab-list { min-height: var(--chapter-toolbar-height); margin: 0; border-bottom: 0; }
.company-section-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  padding-bottom: 4px;
  min-height: var(--chapter-toolbar-height);
}
.company-section-actions .button { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.company-section-actions .history-link { font-size: 13px; line-height: 20px; white-space: nowrap; }
.company-declaration-form .tab-panel > .structured-grid,
.company-declaration-form .tab-panel > .readonly-grid { margin-top: 0; }
.company-table-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
@media (max-width: 1100px) {
  .company-section-toolbar .tab-list { flex-basis: 100%; order: 1; }
}

.hidden {
  display: none !important;
}

.readonly-banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #b8c7e6;
  border-radius: 6px;
  background: #eef4ff;
  color: #244a85;
  font-weight: 700;
}

.readonly-mode input:disabled,
.readonly-mode select:disabled,
.readonly-mode textarea:disabled {
  border-color: #9aa8bd;
  background: #f8fafc;
  color: #1f2937;
  opacity: 1;
}

.audit-observation-panel {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.tab-panel > .audit-observation-panel:first-child {
  margin-top: 0;
}

.tab-panel > .audit-observation-panel:last-child {
  margin-bottom: 0;
}

.audit-observation-panel.observation-panel-empty {
  padding: 0;
  border: 0;
  background: transparent;
}

.audit-observation-panel.observation-panel-empty [data-observation-header],
.audit-observation-panel.observation-panel-empty [data-observation-list],
.audit-observation-panel.observation-panel-empty [data-audit-event-log] {
  display: none;
}

.audit-observation-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.audit-observation-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 12px;
}

.audit-observation-item p {
  margin: 8px 0 0;
}

.audit-observation-panel textarea {
  min-height: 92px;
  font-family: Arial, Helvetica, sans-serif;
}

.observation-context-hint {
  margin: 12px 0 4px;
}

.observation-toggle-button {
  margin-top: 10px;
}

.audit-observation-panel.observation-panel-empty .observation-toggle-button {
  margin-top: 0;
}

.section-observation-index {
  display: none;
}

.observation-company-response {
  border-left: 3px solid var(--brand);
  padding-left: 10px;
  color: #244a85;
}

.observation-thread {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.observation-thread-message {
  border-left: 3px solid var(--brand);
  padding: 6px 10px;
  background: #f8fafc;
  color: #244a85;
}

.observation-thread-message-government {
  border-left-color: #b91c1c;
  color: #7f1d1d;
}

.observation-action-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.observation-action-row .button {
  flex: 1 1 0;
}

.observation-filter-control {
  margin: 0 0 12px;
}

.modal.filing-observations-modal { width: min(1000px, calc(100vw - 32px)); }
.observation-history-chapter { margin: 14px 0 22px; }
.observation-history-chapter > h3 { margin: 0 0 10px; color: #203d58; }
.observation-history-thread {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-wrap: anywhere;
}
.observation-history-thread-heading { flex-wrap: wrap; gap: 6px 12px; }
.observation-history-thread-heading h4 { margin: 0; font-size: 1em; }
.observation-history-original { margin: 10px 0; padding: 10px 12px; background: #eef4fa; border-radius: 6px; }
.observation-history-original p, .observation-history-messages li p { margin: 4px 0 0; }
.observation-history-messages h5 { margin: 10px 0 6px; font-size: .92em; }
.observation-history-messages ol { margin: 0 0 10px 8px; padding-left: 28px; border-left: 2px solid var(--line); }
.observation-history-messages li { padding: 4px 0 8px; }
.observation-history-resolution { color: var(--ok); }

.observation-close-form {
  margin-top: 10px;
}

.audit-event-log {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.audit-event-log summary {
  cursor: pointer;
  font-weight: 700;
}

.audit-event-log ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.audit-event-log li {
  margin: 6px 0;
}

.tab-observation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fee4e2;
  color: var(--danger);
  font-size: 12px;
  line-height: 1;
}

.tab-observation-box {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #f3b5b1;
  border-radius: 6px;
  background: #fff6f5;
}

.tab-observation-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.tab-observation-box li {
  margin: 4px 0;
}

.tab-observation-box li.closed {
  color: var(--muted);
  text-decoration: line-through;
}

.readonly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.stack-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.data-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 12px;
  margin: 12px 0 0;
}

.data-list dt {
  color: var(--muted);
  font-weight: 700;
}

.data-list dd {
  margin: 0;
}

.compact-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.company-data-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: start;
}

.company-data-grid .wide-field {
  grid-column: span 2;
}

.company-data-grid .full-field {
  grid-column: 1 / -1;
}

.company-contact-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px minmax(220px, .85fr) minmax(420px, 1.25fr);
  grid-template-areas: "name address address email" "locality postal province phones";
  align-items: start;
  gap: 14px 16px;
}
.company-contact-grid .form-row { min-width: 0; margin-bottom: 0; }
.company-contact-grid .contact-name { grid-area: name; }
.company-contact-grid .contact-address { grid-area: address; }
.company-contact-grid .contact-email { grid-area: email; }
.company-contact-grid .contact-locality { grid-area: locality; }
.company-contact-grid .contact-postal { grid-area: postal; }
.company-contact-grid .contact-province { grid-area: province; }
.company-contact-grid .contact-phone-fields {
  grid-area: phones;
  display: grid;
  grid-template-columns: 120px repeat(2, minmax(0, 150px));
  gap: 8px;
}

.company-address-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(180px, 1fr) 120px minmax(220px, .85fr);
  grid-template-areas: "street locality postal province" "communication communication communication communication";
  align-items: start;
  gap: 14px 16px;
}
.company-address-grid .form-row { min-width: 0; margin-bottom: 0; }
.company-address-grid .address-street { grid-area: street; }
.company-address-grid .address-locality { grid-area: locality; }
.company-address-grid .address-postal { grid-area: postal; }
.company-address-grid .address-province { grid-area: province; }
.company-address-grid .address-communication-fields {
  grid-area: communication;
  display: grid;
  grid-template-columns: minmax(660px, 2.2fr) minmax(220px, 1fr);
  align-items: start;
  gap: 16px;
}
.company-address-grid .address-phone-fields {
  display: grid;
  grid-template-columns: 120px repeat(5, minmax(0, 150px));
  gap: 8px;
}
.company-address-grid + .checkbox-inline { margin-top: 12px; }

@media (max-width: 1100px) {
  .company-contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "name address" "email email" "locality locality" "postal province" "phones phones";
  }
  .company-address-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "street locality" "postal province" "communication communication";
  }
  .company-address-grid .address-communication-fields { grid-template-columns: minmax(0, 1fr); }
  .company-address-grid .address-phone-fields { grid-template-columns: repeat(3, minmax(0, 150px)); }
}
@media (max-width: 600px) {
  .company-contact-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "name" "address" "email" "locality" "postal" "province" "phones";
  }
  .company-contact-grid .contact-phone-fields {
    grid-template-columns: minmax(0, .8fr) repeat(2, minmax(0, 1fr));
  }
  .company-address-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "street" "locality" "postal" "province" "communication";
  }
  .company-address-grid .address-phone-fields { grid-template-columns: repeat(2, minmax(0, 150px)); }
}

.compact-phone-field input,
.company-phone-grid input,
.contact-phone-grid input {
  max-width: 150px;
}

.structured-grid {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.structured-block {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfe;
}

.structured-block h3 {
  margin-bottom: 10px;
  color: #8a1f11;
  font-size: 17px;
  text-decoration: underline;
}

.small-field input {
  max-width: 120px;
}

.phone-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(88px, 150px));
  gap: 8px;
  justify-content: start;
}

.two-phone-grid {
  grid-template-columns: repeat(4, minmax(90px, 1fr));
}

.contact-phone-grid {
  grid-template-columns: repeat(2, minmax(88px, 150px));
}

.phone-grid input {
  padding: 7px;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.checkbox-inline input[type="checkbox"] {
  width: auto;
}

.compact-title-row {
  margin-bottom: 8px;
}

.checkbox-list ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.checkbox-list input[type="checkbox"] {
  width: auto;
}

.material-unit-checks {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.table-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 12px; font-size: 13px; }
.table-pagination.list-pagination { width: 100%; margin-top: 8px; border-top: 1px solid var(--line); }
.table-pagination-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.table-pagination .compact-button { min-height: 32px; font-size: 13px; padding: 5px 10px; }
.table-pagination [data-table-current-page]:focus { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 2px; }
.table-pagination-status { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.table-pagination-status[role="alert"] { color: var(--danger); }

.form-row {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

label {
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
}

textarea {
  min-height: 420px;
  font-family: Consolas, "Courier New", monospace;
}

.stack-form textarea {
  min-height: 86px;
  font-family: Arial, Helvetica, sans-serif;
}

@media (max-width: 760px) {
  .detail-grid,
  .company-dashboard-actions,
  .dashboard-create-form,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .data-list {
    grid-template-columns: 1fr;
  }
}

.toast-stack {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(390px, calc(100vw - 36px));
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  padding: 4px;
  pointer-events: none;
}

.toast {
  --toast-color: #1755b1;
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--toast-color);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.16);
  pointer-events: auto;
}

.toast.success { --toast-color: #137333; }
.toast.warning { --toast-color: #9a5200; }
.toast.error { --toast-color: #b42318; }
.toast-content { flex: 1; min-width: 0; }
.toast-label { display: block; color: var(--toast-color); font-size: 13px; }
.toast-content p { margin: 5px 0 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.toast-close { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #475467; cursor: pointer; font: 24px/1 Arial, sans-serif; }
.toast-close:hover { background: #eef2f7; }
.toast-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.institutional-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.institutional-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 18px; }
.institutional-list-only { grid-template-columns: minmax(0, 1fr); }
.institutional-layout > .panel { min-width: 0; }
.institutional-editor h2 { margin-bottom: 18px; }
.institutional-editor textarea, .institutional-signature textarea, .detail-grid form textarea { min-height: 84px; font-family: inherit; }
.institutional-checkbox { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.institutional-checkbox input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; }
.certificate-configuration-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.certificate-configuration-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.certificate-configuration-fields [hidden] { display: none; }
.certificate-configuration-fields .form-row { min-width: 0; margin: 0; gap: 4px; }
.certificate-configuration-fields textarea { display: block; width: 100%; height: calc(2.7em + 18px); min-height: 0; padding: 8px 10px; font-family: inherit; line-height: 1.35; resize: vertical; }
.certificate-configuration-fields .institutional-checkbox { flex-wrap: wrap; column-gap: 8px; }
.certificate-configuration-fields .institutional-checkbox label { flex: 1; min-width: 0; }
.certificate-configuration-fields .institutional-checkbox small,
.certificate-configuration-fields .institutional-checkbox .errorlist { flex-basis: 100%; }
.packet-preparation-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.packet-document-summary { margin: 6px 0 10px; font-size: 14px; }
.modal.period-certification-modal { width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.period-certification-modal[open] { display: flex; flex-direction: column; }
.period-certification-modal .modal-header { flex-shrink: 0; }
.period-certification-body { min-height: 0; overflow-y: auto; padding: 16px 20px; }
.period-certification-company { margin-top: 0; }
.period-certification-summary { margin: 12px 0; padding: 10px 12px; border: 1px solid #c3cedd; border-radius: 6px; background: #fff; }
.period-certification-modal .modal-actions { position: sticky; bottom: -16px; margin: 16px -20px -16px; }
[data-period-certification-status]:empty { display: none; }
.period-certification-error { padding: 10px 12px; border: 1px solid #d99089; border-radius: 6px; color: var(--danger); background: #fff2f0; }
.institutional-history { margin-top: 22px; }
.numbering-introduction, .company-directory-introduction { margin: 10px 0 0; line-height: 1.2; }
.numbering-table { font-size: 14px; }
.numbering-table small { display: block; margin-top: 3px; }
.numbering-table td { vertical-align: top; }
.numbering-table .numbering-next { white-space: nowrap; font-variant-numeric: tabular-nums; }
.numbering-help { margin-top: 14px; }
.institutional-signature { margin-top: 22px; }
.institutional-signature summary { color: var(--brand); font-weight: 700; cursor: pointer; }
.institutional-signature form > button { margin-top: 12px; }
.document-state-caption { display: block; margin-top: 6px; font-size: 12px; }
.document-workflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0 0 20px; list-style: none; }
.document-workflow li { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); }
.document-workflow li > span { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: #eef2f7; font-weight: 700; }
.document-workflow .active { border-color: var(--brand); color: #1755b1; }
.document-workflow .done { color: var(--ok); }
.document-workflow .done > span { background: #dcfce7; }
.document-delivery-form { max-width: 760px; margin-top: 18px; }
.delivery-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.delivery-wide-field { grid-column: 1 / -1; }
.document-delivery-form textarea { min-height: 84px; font-family: inherit; }
.institutional-checkbox input.document-state-checkbox { appearance: none; width: 22px; height: 22px; margin: 0; padding: 0; border: 2px solid #94a3b8; border-radius: 6px; background: #fff; cursor: pointer; }
.institutional-checkbox input.document-state-checkbox:checked { border-color: #16a34a; background: #dcfce7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m4 10 4 4 8-9' stroke='%2315803d' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }
.institutional-checkbox input.document-state-checkbox:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
@media (max-width: 700px) { .document-workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); } .delivery-fields { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1000px) { .institutional-layout { grid-template-columns: minmax(0, 1fr); } }

.modal {
  --line: #c3cedd;
  --muted: #56677f;
  width: min(720px, calc(100vw - 32px));
  border: 1px solid #8294ac;
  border-radius: 12px;
  padding: 0;
  background: #edf2f8;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(12, 24, 40, 0.3), 0 4px 16px rgba(12, 24, 40, 0.16);
}

.documentation-entry { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.documentation-entry small { font-size: 12px; line-height: 1.2; }
.documentation-modal { width: min(1380px, calc(100vw - 32px)); height: calc(100dvh - 40px); max-height: calc(100dvh - 40px); overflow: hidden; }
.tps-batch-modal { width: min(1600px, calc(100vw - 32px)); }
.documentation-modal[open] { display: flex; flex-direction: column; }
.documentation-modal > .modal-header { flex-shrink: 0; }
.documentation-modal .modal-header h2 { font-size: 22px; }
.documentation-modal iframe { width: 100%; flex: 1; min-height: 0; border: 0; background: #edf2f8; }
.documentation-modal iframe[hidden], .documentation-load[hidden], .documentation-load [hidden] { display: none; }
.documentation-load { padding: 20px; }
html:has(.documentation-modal[open]), body:has(.documentation-modal[open]) { overflow: hidden; }
html:has(> body.documentation-embedded .documentation-workflow) {
  overflow-y: auto;
  scrollbar-gutter: stable;
}
body.documentation-embedded { background: #edf2f8; padding-top: 0; }
body.documentation-embedded main.page { margin: 0; padding: 16px 20px 24px; max-width: none; }
.documentation-workflow [data-document-panel][hidden] { display: none; }
.documentation-identity { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.documentation-identity h1 { font-size: 22px; margin: 0 0 4px; }
.documentation-identity p { margin: 0; font-size: 14px; color: var(--muted); }
.documentation-workflow-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; }
.documentation-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 0; background: #edf2f8; position: sticky; top: 0; z-index: 3; }
.documentation-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.documentation-cancel { margin-inline-start: auto; }
.packet-cancel-modal { width: min(480px, calc(100% - 24px)); }
.packet-cancel-body { padding: 16px; }
.packet-cancel-body > p:first-child { margin-top: 0; }
.packet-cancel-body .form-row:last-child { margin-bottom: 0; }
.documentation-steps a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border: 1px solid #acbcd0; border-radius: 8px; background: white; color: #344962; text-decoration: none; font-weight: 600; }
.documentation-steps a[aria-selected="true"] { background: #206beb; color: white; border-color: #206beb; box-shadow: 0 2px 5px #15396025; }
.documentation-steps a:focus-visible { outline: 3px solid #95b9fa; outline-offset: 2px; }
.documentation-steps a > span { display: grid; place-items: center; width: 23px; height: 23px; flex-shrink: 0; border-radius: 50%; background: #e9eff8; color: #2a4260; font-size: 13px; }
.documentation-steps small { color: #087b35; background: #dcfce7; border-radius: 50%; width: 18px; height: 18px; text-align: center; }
.signed-documents { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.signed-documents-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.signed-documents-heading h3 { margin: 0; font-size: 20px; }
.signed-documents-heading p { margin: 6px 0 0; font-size: 14px; }
.signed-documents-table { min-width: 680px; }
.signed-documents-table th { font-size: 13px; color: var(--muted); background: #f6f8fb; }
.signed-documents-table td { vertical-align: top; padding-block: 14px; }
.signed-documents-table td:first-child { width: 48%; }
.signed-document-period { display: block; margin-top: 5px; font-size: 14px; }
.signed-document-name { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.signed-document-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.signed-document-actions .button { min-height: 36px; white-space: nowrap; font-size: 13px; text-decoration: none; }
.signed-document-actions .button:hover { background: #185ac5; border-color: #185ac5; }
.signed-document-actions .button.secondary:hover { background: #eff6ff; border-color: var(--brand); }
.signed-document-actions .button.scan-replace { background: #fbbf24; border-color: #d97706; color: #713f12; }
.signed-document-actions .button.scan-replace:hover { background: #f59e0b; border-color: #b45309; }
.signed-document-actions .button:focus-visible { outline: 2px solid #011540; outline-offset: 3px; }
.signed-originals { margin-top: 20px; }
.signed-previous summary { font-weight: 600; cursor: pointer; }
.signed-previous li { margin: 10px 0; overflow-wrap: anywhere; }
.scan-correction-page { max-width: 1500px; margin-inline: auto; }
.scan-correction-page > .panel, .scan-comparison { margin-top: 20px; }
.scan-comparison { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.scan-comparison .panel { min-width: 0; }
.scan-comparison iframe { display: block; width: 100%; height: 520px; border: 1px solid var(--line); margin-top: 12px; background: #eef1f5; }
.scan-correction-form { max-width: 850px; }
.scan-correction-form label { font-weight: 600; }
.scan-correction-form select, .scan-correction-form textarea { display: block; width: 100%; margin-top: 8px; }
.scan-correction-form input[type="file"] { display: block; margin-top: 8px; max-width: 100%; }
.scan-correction-cancel { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.scan-version-history { margin-top: 12px; font-size: 12px; }
.scan-version-history summary { cursor: pointer; }
.documentation-steps small.scan-warning { color: var(--danger); background: #fee4e2; }
.documentation-workflow > [data-document-panel].panel { padding: 18px 20px; }
.documentation-workflow h2 { font-size: 22px; margin-top: 0; }
.documentation-secondary { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 18px; }
.documentation-secondary > summary { color: #206beb; cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.documentation-issued { border: 1px solid #bcd8c6; border-radius: 8px; background: #f6fbf8; padding: 14px; }
.documentation-issued h3 { margin-top: 0; }
.documentation-workflow .report-orientation-form fieldset { border: 1px solid #c3cedd; border-radius: 8px; padding: 10px 14px; }
.documentation-workflow .report-orientation-form fieldset > .muted { margin-top: 0; }
.documentation-workflow .packet-delivery-fields { max-width: 900px; }
@media (max-width: 700px) {
  .documentation-modal { width: calc(100vw - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); }
  body.documentation-embedded main.page { padding: 12px; }
  .documentation-steps a { padding: 8px; font-size: 13px; }
}

.modal.wide-modal {
  width: min(1360px, calc(100vw - 32px));
}

.company-editor-modal { width: min(1240px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; }
.company-editor-modal[open] { display: flex; flex-direction: column; }
.company-editor-modal > .modal-header { flex-shrink: 0; }
.company-editor-modal .modal-header h2 { font-size: 22px; }
.company-editor-body { min-height: 0; overflow-y: auto; padding: 18px; }
.company-editor-body .panel { margin-bottom: 14px; }
.company-editor-identification { margin: 0 0 12px; color: #435873; }
.company-editor-notice, .company-editor-error { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #83b593; border-radius: 6px; background: #edf9f0; color: #165d2a; }
.company-editor-notice.error, .company-editor-error { border-color: #d99089; background: #fff2f0; color: var(--danger); }
[data-company-editor-status]:empty { display: none; }
[data-company-editor-status]:not(:empty):not(.company-editor-error) { padding: 0 0 12px; color: var(--muted); }
.company-details-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.company-details-fields .form-row { min-width: 0; }
.company-details-wide { grid-column: 1 / -1; }
.company-details-fields textarea { min-height: 64px; font-family: inherit; }
.activity-picker { min-width: 0; }
.activity-picker-enhanced { display: grid; gap: 6px; }
.activity-picker-enhanced[hidden] { display: none; }
.activity-picker-current { padding: 9px 10px; min-height: 40px; border: 1px solid #8294ac; border-radius: 6px; background: #f8fafc; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.activity-picker-buttons, .activity-picker-pagination { display: flex; align-items: center; gap: 6px; }
.activity-picker-modal { width: min(1120px, calc(100vw - 48px)); height: min(720px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); overflow: hidden; }
.activity-picker-modal[open] { display: flex; flex-direction: column; }
.activity-picker-modal > .modal-header, .activity-picker-modal > .modal-actions { flex-shrink: 0; }
.activity-picker-modal .modal-header h2 { font-size: 20px; }
.activity-picker-body { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 14px; }
.activity-picker-body .form-row { margin-bottom: 8px; }
.activity-picker-count { margin: 0 0 10px; font-size: 13px; }
.activity-picker-results { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.activity-picker-table { table-layout: fixed; min-width: 450px; overflow: visible; }
.activity-picker-code-column { width: 105px; }
.activity-picker-action-column { width: 130px; }
.activity-picker-table th { position: sticky; top: 0; z-index: 1; }
.activity-picker-table td { overflow-wrap: anywhere; }
.activity-picker-table td:first-child { font-weight: 700; }
.activity-picker-selected td { background: #edf8f0; }
.activity-picker-modal .modal-actions { justify-content: space-between; flex-wrap: wrap; }
html:has(.company-editor-modal[open]), body:has(.company-editor-modal[open]) { overflow: hidden; }
@media (max-width: 700px) { .company-details-fields { grid-template-columns: minmax(0, 1fr); } .company-editor-body { padding: 12px; } }

.company-import-history-link, .history-link { color: var(--brand); font-size: 14px; text-align: right; align-self: center; }
.history-access { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 16px; margin: 0 0 10px; }
.company-import-history-modal, .app-history-modal {
  width: min(1500px, calc(100vw - 32px));
  height: min(840px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
.company-import-history-modal[open], .app-history-modal[open] { display: flex; flex-direction: column; }
.company-import-history-modal .modal-header, .app-history-modal .modal-header { flex-shrink: 0; }
.company-import-history-modal .modal-header h2, .app-history-modal .modal-header h2 { font-size: 20px; }
.company-import-history-body, .app-history-body { min-height: 0; overflow: auto; padding: 16px; }
.company-import-history-body .panel { margin-bottom: 14px; }
.company-import-history-body h3 { font-size: 18px; }
.company-import-history-source { max-width: 750px; margin-bottom: 16px; }
.company-import-history-notice { padding: 12px; border: 1px solid var(--ok); border-radius: 6px; color: var(--ok); }
.company-import-history-notice.error { border-color: var(--danger); color: var(--danger); }
html:has(.company-import-history-modal[open]),
body:has(.company-import-history-modal[open]),
html:has(.app-history-modal[open]),
body:has(.app-history-modal[open]) { overflow: hidden; }

.modal::backdrop {
  background: rgba(12, 24, 40, 0.55);
  backdrop-filter: blur(2px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #eef2f7;
}

.modal-header h3 {
  font-size: 18px;
}

.icon-button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 5px 8px;
  cursor: pointer;
}

.legacy-modal-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.legacy-company-line {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 8px 12px;
}

.legacy-company-line span {
  text-align: right;
  color: #003a9b;
}

.legacy-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
}

.legacy-readonly-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 8px 10px;
}

.legacy-readonly-grid span {
  color: #003a9b;
}

.legacy-field-row {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.legacy-field-row label {
  padding-top: 8px;
}

.legacy-field-row input,
.legacy-field-row select {
  max-width: 260px;
}

.legacy-field-row input[type="number"] {
  max-width: 120px;
}

.legacy-field-row input[type="checkbox"] {
  width: auto;
}

.legacy-field-row input[type="date"] {
  max-width: 170px;
}

.legacy-field-row textarea {
  min-height: 68px;
  max-width: 360px;
  font-family: Arial, Helvetica, sans-serif;
}

.lookup-description {
  margin: 6px 0 0;
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

/* Shared modal surfaces and control states; keep each dialog's existing layout. */
.modal .modal-header {
  border-bottom-color: #162c45;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(110deg, #20374f, #2b4869);
  color: #fff;
}

.modal .modal-header :is(h2, h3) {
  margin: 0;
  color: inherit;
  line-height: 1.3;
}

.modal .modal-header :is(.icon-button, .button.secondary) {
  flex-shrink: 0;
  border-color: #94a8c0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.modal .modal-header :is(.icon-button, .button.secondary):hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #fff;
}

.modal .modal-actions {
  border-top-color: #b7c6d9;
  border-radius: 0 0 10px 10px;
  background: #e2eaf5;
}

.modal :is(label, .period-field-label) { color: #243b55; }
.modal :is(.legacy-company-line, .legacy-readonly-grid > div) {
  border-radius: 6px;
  background: #e3ebf6;
}

.modal :is(
  input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="button"], [type="submit"], [type="reset"], [type="range"], [type="color"], [type="image"]),
  select,
  textarea
) {
  border-color: #8294ac;
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(24, 46, 74, 0.06);
}

.modal :is(input, select, textarea):not([type="checkbox"], [type="radio"], [type="hidden"]):is(:disabled, [readonly]) {
  border-color: #b0bdcf;
  background: #e4eaf2;
  color: #526177;
  box-shadow: none;
  opacity: 1;
}

.modal :is(input, select, textarea):not([type="checkbox"], [type="radio"], [type="hidden"])[aria-invalid="true"] {
  border-color: var(--danger);
}

.modal :is(input, select, textarea):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.modal :is(.button, .icon-button, summary):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.modal .modal-header :is(.icon-button, .button.secondary):focus-visible {
  outline-color: #fff;
}

.modal input[type="file"]::file-selector-button {
  border: 1px solid #8fa3bd;
  border-radius: 4px;
  background: #e3ebf6;
  color: #243b55;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.modal .table th {
  background: #dfe8f4;
  color: #243b55;
  border-bottom-color: #b2c2d8;
}

.numbering-editor-modal {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

.template-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.template-toolbar .institutional-tabs { margin: 0; align-items: center; }
.page-help { display: inline-flex; align-items: center; }
.page-title-row { display: flex; align-items: center; gap: 10px; }
.page-title-row h1 { margin: 0; }
.page-help-button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid #94a3b8; border-radius: 50%; background: #fff; color: #1755b1; font: bold 18px/1 Georgia, serif; cursor: pointer; }
.page-help-button:hover, .page-help-button[aria-expanded="true"] { background: #eff6ff; border-color: var(--brand); }
.page-help-button:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.page-help-popup { position: fixed; z-index: 1100; width: min(26rem, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 12px 14px; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: var(--text); font-size: 14px; line-height: 1.5; font-weight: 400; box-shadow: 0 6px 24px rgba(15, 23, 42, 0.18); }
.page-help-popup[hidden] { display: none; }
.template-panel-actions { margin: 0; }
.institutional-config-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.institutional-config-toolbar .institutional-tabs { margin: 0; }
.institutional-term-modal { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; }
.institutional-term-modal > form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); margin: 0; }
.institutional-term-modal .modal-header, .institutional-term-modal .modal-actions { flex-shrink: 0; }
.institutional-term-modal .modal-header h2 { margin: 0; font-size: 22px; }
.institutional-term-body { min-height: 0; overflow-y: auto; padding: 18px; }
.institutional-term-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.institutional-term-fields .form-row { min-width: 0; margin: 0; }
.institutional-term-wide { grid-column: 1 / -1; }
.institutional-term-fields textarea { min-height: 90px; font-family: inherit; resize: vertical; }
.institutional-term-fields .institutional-checkbox { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; }
.institutional-term-fields .institutional-checkbox .errorlist { grid-column: 1 / -1; }
html:has(.institutional-term-modal[open]), body:has(.institutional-term-modal[open]) { overflow: hidden; }
@media (max-width: 600px) {
  .institutional-term-fields { grid-template-columns: minmax(0, 1fr); }
  .institutional-term-modal .modal-header h2 { font-size: 18px; }
  .institutional-term-modal .modal-actions { flex-wrap: wrap; }
}
.template-panel-table .template-row-actions { margin-top: 0; align-items: center; }
.template-panel-table .template-row-actions .button { white-space: nowrap; }
.template-editor-modal { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; }
.template-editor-modal > form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); margin: 0; }
.template-editor-modal .modal-header, .template-editor-modal .modal-actions { flex-shrink: 0; }
.template-editor-modal .modal-header h2 { margin: 0; font-size: 22px; }
.template-editor-body { min-height: 0; overflow-y: auto; padding: 18px; }
.template-editor-body > p { margin: 0 0 14px; }
.template-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.template-editor-fields .form-row { min-width: 0; margin: 0; }
.template-editor-wide { grid-column: 1 / -1; }
.template-editor-fields textarea { min-height: 90px; font-family: inherit; resize: vertical; }
.template-editor-fields .institutional-checkbox { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; }
.template-editor-fields .institutional-checkbox .errorlist { grid-column: 1 / -1; }
html:has(.template-editor-modal[open]), body:has(.template-editor-modal[open]) { overflow: hidden; }
@media (max-width: 600px) {
  .template-editor-fields { grid-template-columns: minmax(0, 1fr); }
  .template-editor-modal .modal-header h2 { font-size: 18px; }
  .template-editor-modal .modal-actions { flex-wrap: wrap; }
}
.numbering-editor-modal > form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); margin: 0; }
.numbering-editor-modal .modal-header, .numbering-editor-modal .modal-actions { flex-shrink: 0; }
.numbering-editor-modal .modal-header h2 { margin: 0; font-size: 22px; }
.numbering-editor-body { min-height: 0; overflow-y: auto; padding: 18px; }
.numbering-editor-body > p { margin: 0 0 14px; }
.numbering-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.numbering-editor-fields .form-row { min-width: 0; margin: 0; }
.numbering-editor-wide { grid-column: 1 / -1; }
.numbering-editor-fields textarea { min-height: 90px; font-family: inherit; resize: vertical; }
.numbering-editor-fields .institutional-checkbox { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; }
.numbering-editor-fields .institutional-checkbox small, .numbering-editor-fields .institutional-checkbox .errorlist { grid-column: 1 / -1; }
html:has(.numbering-editor-modal[open]), body:has(.numbering-editor-modal[open]) { overflow: hidden; }
@media (max-width: 600px) {
  .numbering-editor-fields { grid-template-columns: minmax(0, 1fr); }
  .numbering-editor-modal .modal-header h2 { font-size: 18px; }
}

.period-modal {
  width: min(1560px, calc(100vw - 32px));
  height: min(820px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

html:has(.period-modal[open]),
body:has(.period-modal[open]) {
  overflow: hidden;
}

.period-modal > form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin: 0;
}

.period-modal .modal-header,
.period-modal .modal-actions {
  flex-shrink: 0;
}

.period-modal-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.period-modal-body > .muted,
.period-modal-body > .errorlist {
  flex-shrink: 0;
  margin: 0;
}

.period-modal-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.period-modal-layout h4 {
  margin: 0 0 10px;
}

.period-characteristics {
  min-width: 0;
  overflow-y: auto;
}

.period-characteristics-controls {
  display: grid;
  gap: 16px;
}

.period-controls-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.period-characteristics-controls .form-row {
  min-width: 0;
  margin-bottom: 0;
  align-content: start;
}

.period-characteristics-controls [hidden] { display: none; }

.period-characteristics-controls input {
  min-width: 0;
  min-height: 40px;
  padding: 8px;
}

.period-field-label {
  display: block;
  font-weight: 700;
  margin: 0;
}

.period-toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.period-toggle {
  min-height: 40px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: 600 14px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.period-toggle:hover:not(:disabled) { border-color: var(--brand); }
.period-toggle[aria-pressed="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.period-toggle:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.period-toggle:disabled { opacity: .6; cursor: not-allowed; }

.period-company-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.period-company-section > h4,
.period-company-section > .period-selection-toolbar,
.period-company-section > .period-inheritance-note {
  flex-shrink: 0;
}

.period-company-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}

.period-company-table {
  table-layout: fixed;
  min-width: 560px;
  overflow: visible;
}

.period-company-table th,
.period-company-table td {
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.period-company-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.period-correspondence-column { width: 106px; }
.period-reason-column { width: 260px; }

.period-company-table .period-reason-cell {
  display: table-cell;
  min-width: 0;
}

.period-company-table .period-reason-cell select,
.period-company-table .period-reason-cell input[type="text"] {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.period-company-table .period-reason-cell input[type="text"] {
  margin-top: 6px;
}

.period-status-cell {
  text-align: center;
}

.period-status-cell input.period-status-checkbox,
.period-select-all input.period-status-checkbox {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  flex: 0 0 22px;
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background-color: #fff;
  cursor: pointer;
}

.period-status-cell input.period-status-checkbox:checked,
.period-select-all input.period-status-checkbox:checked {
  border-color: #16a34a;
  background-color: #dcfce7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m4 10 4 4 8-9' stroke='%2315803d' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px;
}

.period-status-cell input.period-status-checkbox:focus-visible,
.period-select-all input.period-status-checkbox:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

.period-status-cell input.period-status-checkbox:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.period-selection-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 8px;
}

.period-select-all { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.period-inheritance-note { font-size: 14px; margin: 0 0 10px; }
.period-select-all input.period-status-checkbox:indeterminate {
  border-color: #16a34a;
  background-color: #dcfce7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='%2315803d' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px;
}

.period-reason-cell {
  display: grid;
  gap: 6px;
  min-width: 230px;
}

.period-reason-cell select,
.period-reason-cell input[type="text"] {
  min-height: 32px;
}

.muted-disabled {
  opacity: 0.55;
}

.inline-form {
  display: inline-flex;
}

.hidden-delete {
  display: none;
}

@media (max-width: 760px) {
  .section-title-row,
  .period-modal-layout,
  .legacy-company-line,
  .legacy-field-row {
    grid-template-columns: 1fr;
  }

  .section-title-row {
    display: grid;
  }

  .period-modal-layout {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
  }

  .period-characteristics { overflow: visible; }
  .period-characteristics-controls { gap: 10px; }

  .company-data-grid,
  .phone-grid,
  .two-phone-grid {
    grid-template-columns: 1fr 1fr;
  }

  .company-data-grid .wide-field,
  .company-data-grid .full-field {
    grid-column: 1 / -1;
  }
}
/* Certificate preparation and retained Word templates. */
.certificate-field-heading { display: flex; align-items: center; gap: .65rem; margin-bottom: .4rem; }
.certificate-field-heading label { margin: 0; }
.certificate-eye { display: inline-flex; align-items: center; justify-content: center; padding: .45rem .65rem; }
.certificate-date-pair, .certificate-issuance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.certificate-inline-form { margin-top: 18px; }
.certificate-issuance-single { grid-template-columns: minmax(0, 1fr); }
.certificate-requirements { padding-left: 22px; color: #92400e; }
.certificate-requirements li { margin-bottom: .45rem; }
.certificate-audit-json { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 65vw; }
#certificate-shifts-preview { display: block; padding: .6rem .8rem; background: #edf4ff; border-radius: 6px; color: #174ea6; }
@media (max-width: 800px) { .certificate-date-pair, .certificate-issuance-grid { grid-template-columns: 1fr; } }

/* Keep certificate preparation controls sized to the information they hold. */
#certificate-preparation-form { padding: 16px; }
#certificate-preparation-form .certificate-preparation-hint { margin: 6px 0 12px; font-size: 14px; }
#certificate-preparation-form .certificate-preparation-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; margin-bottom: 12px; }
#certificate-preparation-form .form-row { min-width: 0; max-width: 100%; gap: 5px; margin: 0; }
#certificate-preparation-form label { font-size: 14px; }
#certificate-preparation-form input { min-width: 0; height: 36px; padding: 7px 9px; font-size: 14px; }
#certificate-preparation-form .certificate-shifts-field { width: 18rem; }
#certificate-preparation-form .certificate-date-field { width: 11rem; }
#certificate-preparation-form .certificate-personnel-field { width: 12rem; }
#certificate-preparation-form .certificate-reference-field { width: 28rem; }
#certificate-preparation-form .certificate-reason-field { width: 36rem; margin: 14px 0 12px; }
.certificate-compact-input { display: flex; align-items: center; gap: 6px; min-width: 0; }
.certificate-compact-input input { flex: 1; width: 0; }
.certificate-compact-input .certificate-eye { flex: 0 0 36px; height: 36px; padding: 6px; }
#certificate-preparation-form #certificate-shifts-preview { max-width: 46rem; margin: 0 0 12px; padding: 6px 9px; font-size: 13px; }
#certificate-preparation-form .certificate-authorization-heading { margin: 12px 0 8px; font-size: 15px; }
.certificate-preparation-page textarea { min-height: 3.8rem; height: auto; max-width: 40rem; font-family: inherit; resize: vertical; }
.certificate-preparation-page .certificate-reason-field { max-width: 36rem; }
.packet-date-field { width: 12rem; max-width: 100%; }
.certificate-validity-summary { font-size: 14px; line-height: 1.5; align-self: center; }
.tps-source-path { max-width: 24rem; overflow-wrap: anywhere; }
.period-validity-settings { border-top: 1px solid #d5deeb; padding-top: 12px; }
.period-validity-settings h4 { margin: 0 0 8px; }
.period-validity-settings .muted { font-size: 13px; margin: 8px 0; }
.packet-delivery-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 18rem)); gap: 10px 16px; }
.packet-delivery-fields .form-row { margin-bottom: 4px; }
@media (max-width: 650px) { .packet-delivery-fields { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  #certificate-preparation-form .certificate-shifts-field,
  #certificate-preparation-form .certificate-reference-field { width: 100%; }
}
.report-orientation-form { margin: 1rem 0; }
.report-orientation-form fieldset { padding: 1rem; }
.report-orientation-choice { display: inline-flex; align-items: center; gap: .45rem; margin: 0 1.25rem .75rem 0; cursor: pointer; }
.report-orientation-choice input { width: auto; margin: 0; }
.form-template-models { margin-top: 12px; }
.form-template-base-options { margin-bottom: 16px; }
.form-template-base-options > summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.form-template-preview-modal { width: min(850px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); padding: 0; }
.form-template-preview-modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.form-template-preview-modal .template-editor-body { overflow-y: auto; padding: 20px; }
.tps-import-list { margin-top: 12px; }
.tps-import-list td:last-child { white-space: nowrap; }
.tps-upload-modal { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; }
.tps-upload-modal > form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); margin: 0; }
.tps-upload-modal .modal-header, .tps-upload-modal .modal-actions { flex-shrink: 0; }
.tps-upload-modal .modal-header h2 { font-size: 22px; }
.tps-upload-body { min-height: 0; overflow-y: auto; padding: 18px; }
.tps-upload-body > p:first-child { margin-top: 0; }
.tps-upload-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.tps-upload-fields .form-row { min-width: 0; margin: 0; }
.tps-upload-wide { grid-column: 1 / -1; }
html:has(.tps-upload-modal[open]), body:has(.tps-upload-modal[open]) { overflow: hidden; }
@media (max-width: 600px) {
  .tps-upload-fields { grid-template-columns: minmax(0, 1fr); }
  .tps-upload-modal .modal-header h2 { font-size: 18px; }
  .tps-upload-modal .modal-actions { flex-wrap: wrap; }
}
