:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #eef3f7;
  --text: #1b1f23;
  --muted: #67717d;
  --line: #d8dee6;
  --accent: #176b87;
  --accent-strong: #0f4f64;
  --ok: #1d7a46;
  --warn: #9b6200;
  --error: #b42318;
  --info: #2f5fb3;
  --missing: #8c9199;
  --sidebar-width: 340px;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

button,
input,
select {
  font: inherit;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

button,
select,
input[type="text"],
input[type="number"],
input[type="search"],
input[type="file"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

button {
  cursor: pointer;
  padding: 0 10px;
  background: var(--surface-alt);
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #e5e7eb;
  color: #8c9199;
}

button:disabled:hover {
  border-color: var(--line);
  background: #e5e7eb;
  color: #8c9199;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:disabled {
  background: #d1d5db;
  border-color: #d1d5db;
  color: #7c8794;
}

button.danger {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

a {
  color: var(--accent);
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  width: fit-content;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.admin-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.admin-link.is-active {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 4px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 8px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 32px minmax(0, 1fr);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 12px 16px;
  overflow: auto;
  min-width: 0;
}

.sidebar-overlay {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar {
  visibility: hidden;
  overflow: hidden;
  padding: 0;
  border-right: 0;
}

.sidebar-resizer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #edf1f4;
  cursor: col-resize;
}

.sidebar-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #cbd3dc;
}

.sidebar-resizer:hover,
body.is-resizing .sidebar-resizer {
  background: #e0e7ed;
}

.sidebar-toggle {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-height: 46px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.12);
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.mobile-sidebar-button {
  display: none;
}

.mobile-sidebar-close {
  display: none;
}

.brand-row {
  position: relative;
}

.brand-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-row h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  max-width: 180px;
}

.brand-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.brand-session {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  min-width: 0;
}

.brand-session-text {
  flex: 1 1 auto;
  min-width: 0;
}

.session-line {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.auth-avatar {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: #d8e0e7;
}

.session-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-menu-wrap {
  position: relative;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 6px;
  font-size: 19px;
  line-height: 1;
}

.brand-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 160px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}

.brand-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.brand-menu a:hover {
  background: var(--surface-alt);
}

.auth-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgb(23 107 135 / 0.08), transparent 46%),
    var(--bg);
}

.auth-page {
  width: min(100%, 430px);
}

.auth-card {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgb(27 31 35 / 0.1);
}

.auth-brand {
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
}

.maintenance-badge {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgb(155 98 0 / 0.35);
  border-radius: 6px;
  background: rgb(155 98 0 / 0.1);
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
}

.auth-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
}

.auth-copy,
.auth-placeholder p,
.auth-local p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.auth-current,
.auth-placeholder,
.auth-local {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.auth-current {
  color: var(--text);
  font-size: 14px;
}

.auth-session-user {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-session-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.auth-session-primary,
.auth-session-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.auth-session-primary {
  padding: 0 12px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.auth-session-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
  text-decoration: none;
}

.auth-session-secondary {
  width: auto;
  min-width: 94px;
  padding: 0 12px;
  border-color: #cbd3dc;
  background: #fff;
  color: var(--muted);
}

.auth-session-secondary:hover {
  border-color: var(--accent);
  background: var(--surface-alt);
  color: var(--accent-strong);
}

.auth-action-list {
  display: grid;
  gap: 8px;
}

.auth-google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.auth-google-button:hover {
  background: var(--accent-strong);
  color: #fff;
  text-decoration: none;
}

.auth-google-button.is-disabled {
  pointer-events: none;
  border-color: #d1d5db;
  background: #d1d5db;
  color: #7c8794;
}

.auth-hint {
  font-size: 13px;
}

.auth-actions-inline {
  display: flex;
  align-items: center;
}

.dataset-picker {
  position: relative;
}

.dataset-field-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dataset-readonly {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.dataset-readonly-text {
  overflow-wrap: anywhere;
}

.dataset-change-button {
  display: inline;
  width: auto;
  min-height: 0;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dataset-change-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

.dataset-star-button {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.dataset-star-button.is-favorite {
  color: var(--warn);
}

.dataset-star-button {
  min-height: 34px;
  border: 0;
  background: transparent;
}

.dataset-star-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  padding: 0;
}

.dataset-star-button:hover {
  background: rgb(155 98 0 / 0.1);
}

.panel {
  display: grid;
  gap: 7px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.panel:first-of-type {
  margin-top: 8px;
}

.section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.button-row,
.toolbar-actions,
.mini-actions,
.dialog-actions {
  display: flex;
  gap: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.multi-section {
  display: grid;
  gap: 8px;
}

.multi-section.has-top-divider {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.multi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-link-button {
  display: inline;
  width: auto;
  min-height: 0;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.section-link-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

.multi-controls {
  display: grid;
  gap: 8px;
}

.multi-search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.mini-actions {
  justify-content: flex-start;
}

.mini-actions button {
  width: auto;
  min-width: 44px;
  min-height: 30px;
  padding: 0 8px;
}

.multi-search-row input {
  min-width: 0;
}

.check-list {
  display: grid;
  gap: 4px;
  max-height: 230px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.check-list label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 28px;
  color: var(--text);
  font-size: 13px;
}

.check-list input {
  margin-top: 2px;
}

.status-line {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.admin-page {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
}

.admin-page-wide {
  max-width: 1480px;
}

.admin-header {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
}

.admin-header > div:first-child {
  min-width: 0;
}

.admin-header h1 {
  margin: 0;
  font-size: 28px;
}

.admin-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: flex-end;
  min-width: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.admin-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.backup-group-list {
  display: grid;
  gap: 6px;
}

.backup-restore-mode {
  display: grid;
  gap: 8px;
}

.restore-controls {
  display: grid;
  gap: 12px;
}

.backup-mode-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.backup-mode-option input {
  width: 16px;
  min-height: 16px;
  margin: 2px 0 0;
}

.backup-mode-option span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.backup-mode-option strong {
  color: var(--text);
}

.backup-group-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.backup-group-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.backup-group-text {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-group-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.backup-result {
  color: var(--muted);
  font-size: 13px;
}

.backup-result ul {
  margin: 0;
  padding-left: 18px;
}

.admin-records-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.admin-records-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 10px;
}

.admin-record-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-record-tab {
  width: auto;
  min-width: 116px;
}

.admin-record-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.admin-record-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 18px 12px;
}

.admin-record-filters label[hidden] {
  display: none;
}

.admin-records-card > .status-line {
  padding: 0 18px 10px;
}

.admin-records-table-wrap {
  max-height: calc(100vh - 250px);
  overflow: auto;
  border-top: 1px solid var(--line);
}

.admin-records-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.admin-records-table th,
.admin-records-table td {
  max-width: 420px;
  min-width: 130px;
  padding: 7px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.admin-records-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
  text-align: left;
}

.admin-records-table tr:hover td {
  background: #f8fafc;
}

.admin-record-description,
.admin-record-message {
  min-width: 280px;
  white-space: normal;
}

.admin-records-table .admin-record-col-db-id {
  min-width: 58px;
  max-width: 68px;
  text-align: right;
}

.admin-records-table .admin-record-col-time {
  min-width: 112px;
  max-width: 118px;
}

.admin-records-table .admin-record-col-result {
  min-width: 72px;
  max-width: 84px;
}

.admin-records-table .admin-record-col-role {
  min-width: 64px;
  max-width: 76px;
}

.admin-records-table .admin-record-col-ip {
  min-width: 82px;
  max-width: 96px;
}

.admin-records-table details {
  max-width: 360px;
}

.admin-records-table summary {
  cursor: pointer;
  color: var(--accent-strong);
}

.admin-records-table pre {
  max-height: 260px;
  margin: 8px 0 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.admin-record-empty {
  padding: 28px !important;
  color: var(--muted) !important;
  text-align: center;
}

.catalog-overview-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.catalog-overview-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 10px;
}

.catalog-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(170px, 0.7fr) minmax(240px, 1.2fr);
  gap: 10px;
  padding: 0 18px 12px;
}

.catalog-overview-card > .status-line {
  padding: 0 18px 10px;
}

.catalog-groups {
  display: grid;
  gap: 18px;
  padding: 0 18px 18px;
}

.catalog-group {
  display: grid;
  gap: 8px;
}

.catalog-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.catalog-group-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.catalog-group-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.catalog-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.catalog-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.catalog-table-reports {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.catalog-table-statistics {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.catalog-table th,
.catalog-table td {
  min-width: 120px;
  max-width: 380px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  vertical-align: top;
}

.catalog-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
}

.catalog-table tr:hover td {
  background: #f8fafc;
}

.catalog-table th:last-child,
.catalog-table td:last-child {
  border-right: 0;
}

.catalog-table tbody tr:last-child td {
  border-bottom: 0;
}

.catalog-name-cell {
  min-width: 260px;
  max-width: 520px;
  white-space: normal;
}

.catalog-name-cell > strong,
.catalog-name-cell > span,
.catalog-name-cell > small {
  display: block;
}

.catalog-name-cell > span {
  margin-top: 3px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.catalog-name-cell small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.catalog-item-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  row-gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.catalog-item-meta-entry {
  display: contents;
}

.catalog-item-meta-label {
  color: var(--muted);
  font-weight: 700;
}

.catalog-item-meta-value {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.catalog-description-cell {
  min-width: 320px;
  max-width: 540px;
  white-space: normal;
}

.catalog-source-cell {
  width: 160px;
  min-width: 128px !important;
  max-width: 190px !important;
}

.catalog-source-cell.is-empty {
  color: var(--muted);
}

.catalog-source-cell .calculation-step-label,
.catalog-source-cell .calculation-step-meta {
  overflow-wrap: anywhere;
}

.catalog-source-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.catalog-source-layout[data-column-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-source-column {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}

.catalog-source-column-title {
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.catalog-source-column .calculation-panel {
  min-width: 0;
}

.catalog-source-column .calculation-panel + .calculation-panel {
  margin-top: 0;
}

.catalog-source-group + .catalog-source-group {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.catalog-source-type {
  margin-bottom: 3px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.catalog-source-line {
  display: grid;
  grid-template-columns: 9ch minmax(0, 1fr);
  column-gap: 8px;
  margin-left: 14px;
  line-height: 1.35;
}

.catalog-source-line + .catalog-source-line {
  margin-top: 3px;
}

.catalog-source-period {
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.catalog-source-text {
  overflow-wrap: anywhere;
}

.catalog-table-reports .catalog-name-cell,
.catalog-table-statistics .catalog-name-cell {
  min-width: 0 !important;
}

.catalog-table-reports .catalog-name-cell {
  width: 30%;
}

.catalog-table-statistics .catalog-name-cell {
  width: 24%;
}

.catalog-table-reports .catalog-source-cell {
  width: 70%;
  min-width: 0 !important;
  max-width: none !important;
}

.catalog-table-statistics .catalog-source-cell {
  width: 76%;
  min-width: 0 !important;
  max-width: none !important;
}

.catalog-guidance-block {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.catalog-guidance-heading {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.catalog-guidance-block ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.catalog-guidance-section + .catalog-guidance-section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.catalog-guidance-title {
  margin-bottom: 3px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.catalog-guidance-content {
  margin-left: 14px;
}

.catalog-guidance-text {
  overflow-wrap: anywhere;
}

.catalog-group-badge,
.catalog-accounting-badge,
.catalog-status {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.catalog-group-badge {
  background: #eef1f4;
  color: #334155;
}

.catalog-accounting-badge {
  background: #e6f0f5;
  color: #164e63;
}

.catalog-severity {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.catalog-status.is-approved {
  background: #dff4e8;
  color: #166534;
}

.catalog-status.is-wip {
  background: #fff2cc;
  color: #7c4a18;
}

.catalog-severity.is-warning {
  background: #fff2cc;
  color: #7c4a18;
}

.catalog-severity.is-error {
  background: #fde2df;
  color: #8f1d16;
}

.catalog-severity.is-info {
  background: #e8eef5;
  color: #33516f;
}

.catalog-severity.is-ok {
  background: #dff4e8;
  color: #166534;
}

.catalog-severity.is-empty {
  background: #eef1f4;
  color: var(--muted);
}

.catalog-empty {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.admin-units-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.admin-units-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 10px;
}

.admin-units-card > .status-line {
  padding: 0 18px 10px;
}

.admin-units-table-wrap {
  max-height: calc(100vh - 190px);
  overflow: auto;
  border-top: 1px solid var(--line);
}

.admin-units-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.admin-units-table .admin-unit-id-col {
  width: 82px;
}

.admin-units-table .admin-unit-region-col {
  width: 190px;
}

.admin-units-table .admin-unit-area-col {
  width: 220px;
}

.admin-units-table .admin-unit-center-col {
  width: 300px;
}

.admin-units-table .admin-unit-ico-col {
  width: 100px;
}

.admin-units-table .admin-unit-parent-col {
  width: 300px;
}

.admin-units-table th,
.admin-units-table td {
  max-width: 360px;
  min-width: 140px;
  padding: 7px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-units-table .is-area-start > td {
  border-top: 2px solid #9aa8b6;
}

.admin-units-table .is-area-end > td {
  border-bottom-color: #9aa8b6;
}

.admin-units-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef3f7;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.admin-units-table .admin-unit-filter-row th {
  top: 31px;
  padding: 5px 7px;
  background: #f8fafc;
}

.admin-unit-filter-row input {
  width: 100%;
  min-height: 28px;
  padding: 0 7px;
  font-size: 12px;
}

.admin-unit-area-input,
.admin-unit-parent-select {
  min-height: 28px;
  padding: 0 7px;
  font-size: 12px;
}

.admin-unit-area-cell {
  min-width: 190px;
}

.admin-unit-area-read,
.admin-unit-cell-read {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.admin-unit-area-read span,
.admin-unit-cell-read span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-unit-empty-value {
  color: var(--muted);
  font-style: italic;
}

.admin-unit-edit-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  min-height: 22px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.admin-unit-edit-button:hover,
.admin-unit-edit-button:focus-visible {
  background: #eef3f7;
  color: var(--accent-strong);
}

.admin-unit-edit-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-unit-area-input {
  min-width: 180px;
}

.admin-unit-parent-select {
  min-width: 260px;
}

.admin-units-table .admin-unit-label {
  min-width: 300px;
  font-weight: 700;
}

.admin-unit-row:hover td {
  background: #f8fafc;
}

.admin-unit-id {
  min-width: 76px;
  max-width: 92px;
  color: var(--muted);
  font-weight: 700;
}

.admin-unit-ico {
  min-width: 86px;
  max-width: 110px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.admin-unit-parent {
  min-width: 260px;
}

.dataset-list {
  display: grid;
  gap: 8px;
}

.dataset-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.dataset-title {
  font-weight: 700;
}

.dataset-meta {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.dataset-manage-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.dataset-label-field {
  color: var(--muted);
}

.dataset-actions {
  display: flex;
  gap: 8px;
}

.dataset-actions button {
  width: auto;
  min-width: 104px;
}

.toolbar {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.toolbar-main {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.table-title,
.dataset-meta-top,
.table-description,
.report-guidance {
  transform: translateX(0);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.toolbar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.toolbar-nav-row {
  display: contents;
}

.mode-switch-link {
  display: none;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.mode-switch-link:hover {
  text-decoration: underline;
}

.mode-switch-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.toolbar-actions {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
}

.toolbar-actions button {
  width: auto;
  min-width: 92px;
}

.item-pager {
  display: grid;
  grid-template-columns: auto minmax(240px, 520px) auto;
  gap: 8px;
  align-items: center;
  width: min(100%, 760px);
  max-width: 760px;
  min-width: 0;
}

.item-pager button {
  width: auto;
  min-width: 96px;
}

.item-pager select {
  width: 100%;
  min-width: 0;
}

.mobile-pager-button,
.mobile-pager-menu {
  display: none;
}

.table-title {
  font-size: 20px;
  font-weight: 700;
}

.wip-badge {
  color: var(--error);
  font-weight: 700;
  white-space: nowrap;
}

.dataset-meta-top {
  max-width: min(520px, 48vw);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.print-dataset-meta {
  display: none;
}

.table-description {
  max-width: 980px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.report-guidance {
  width: 100%;
}

.report-guidance-block {
  display: grid;
  gap: 6px;
  width: 100%;
}

.report-guidance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  border: 1px solid #2f475f;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.report-guidance-item + .report-guidance-item {
  border-left: 1px solid #2f475f;
}

.report-guidance-title {
  padding: 4px 8px;
  background: #ffd400;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.report-guidance-text {
  min-height: 24px;
  padding: 4px 8px;
  color: #111827;
  font-size: 12px;
  line-height: 1.25;
}

.report-guidance-item-ok .report-guidance-text {
  background: #9be6a6;
}

.report-guidance-item-error .report-guidance-text {
  background: #f3a6b8;
}

.issues-list {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  padding: 0 0 28px;
}

.issues-year {
  display: grid;
  gap: 12px;
}

.issues-year-title {
  margin: 0;
  padding-bottom: 5px;
  border-bottom: 2px solid #cbd5e1;
  color: #16324f;
  font-size: 18px;
  line-height: 1.2;
}

.issues-group {
  display: grid;
  gap: 8px;
  margin-left: 12px;
  padding-left: 14px;
  border-left: 2px solid #d7dee7;
}

.issues-group-title {
  margin: 0;
  color: #394554;
  font-size: 14px;
  line-height: 1.25;
}

.issue-item {
  display: grid;
  gap: 6px;
  margin-left: 12px;
  padding: 7px 0 9px 12px;
  border-left: 3px solid #94a3b8;
  border-bottom: 1px solid #e2e8f0;
}

.issue-item-error {
  border-left-color: #b91c1c;
}

.issue-item-info {
  border-left-color: #b45309;
}

.issue-item-missing {
  border-left-color: #2563eb;
}

.issue-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.issue-status {
  font-weight: 400;
}

.issue-status-error {
  color: #b91c1c;
}

.issue-status-info {
  color: var(--text);
}

.issue-status-missing {
  color: var(--text);
}

.issue-title {
  margin: 0;
  color: #7c4a18;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.issue-current-value,
.issue-message,
.issue-description,
.issue-guidance-text {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.issue-current-value,
.issue-current-value .issue-status {
  color: #000;
}

.issue-field-label {
  font-weight: 700;
}

.issue-description {
  color: var(--text);
}

.issue-guidance {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.issue-guidance-item {
  display: block;
}

.issue-guidance-title {
  display: inline;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.issue-guidance-text {
  display: inline;
}

.table-region {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.empty-state {
  padding: 32px;
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
}

table.matrix {
  --matrix-hover-border: rgb(37 99 235 / 0.85);
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.matrix th,
.matrix td {
  max-width: 220px;
  min-width: 82px;
  height: 24px;
  padding: 3px 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.1;
}

.matrix tbody tr:hover > td,
.matrix tfoot tr:hover > td {
  box-shadow:
    inset 0 1px var(--matrix-hover-border),
    inset 0 -1px var(--matrix-hover-border);
}

.matrix .is-hover-col {
  box-shadow:
    inset 1px 0 var(--matrix-hover-border),
    inset -1px 0 var(--matrix-hover-border);
}

.matrix tbody tr:hover > td.is-hover-col,
.matrix tfoot tr:hover > td.is-hover-col {
  box-shadow:
    inset 0 1px var(--matrix-hover-border),
    inset 0 -1px var(--matrix-hover-border),
    inset 1px 0 var(--matrix-hover-border),
    inset -1px 0 var(--matrix-hover-border);
}

.matrix th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef3f7;
  font-weight: 700;
}

.matrix .sticky-col {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 280px;
  max-width: 380px;
  background: #fff;
}

.matrix .sticky-col.matrix-unit-label {
  padding-left: calc(7px + var(--matrix-unit-indent, 0px));
}

.matrix tbody tr.matrix-unit-group-start > td {
  border-top: 2px solid #9aa8b6;
}

.matrix tbody tr.matrix-item-group-row > td {
  height: 24px;
  border-top: 2px solid #c0cad5;
  background: #f5f7fa;
  color: #394554;
  font-weight: 700;
}

.matrix tbody tr.matrix-item-group-row .matrix-group-cell {
  background: #f5f7fa;
}

.matrix tbody tr.matrix-item-group-row .matrix-group-spacer {
  background: #f5f7fa;
}

.matrix .sticky-col.matrix-item-label {
  padding-left: 16px;
}

.matrix th.sticky-col {
  z-index: 3;
  background: #eef3f7;
}

.matrix-first-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  min-width: 0;
}

.matrix.matrix-compact-unit-labels .matrix-first-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: stretch;
}

.matrix.matrix-compact-unit-labels .matrix-unit-label-toggle {
  justify-self: center;
}

.matrix-first-head-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-unit-label-toggle {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  min-height: 20px;
  padding: 0;
  border-color: #cbd3dc;
  background: #fff;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.matrix.matrix-compact-unit-labels .sticky-col {
  min-width: 86px;
  max-width: 90px;
}

.matrix.matrix-compact-unit-labels .matrix-unit-label {
  padding-left: calc(7px + var(--matrix-unit-indent, 0px));
  text-align: left;
}

.matrix.matrix-compact-unit-labels .matrix-unit-label .row-label-content {
  justify-content: flex-start;
}

.row-label-content {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  line-height: 1.1;
}

.row-label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-label-content .wip-badge {
  flex: 0 0 auto;
  font-size: 11px;
}

.row-info-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #2f475f;
  cursor: pointer;
}

.row-info-button svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row-info-button svg circle:last-child {
  fill: currentColor;
  stroke: none;
}

.row-info-button:hover,
.row-info-button:focus-visible {
  background: #eef3f7;
  color: #16324f;
}

.row-info-button.is-wip-info {
  color: var(--error);
}

.row-info-button.is-wip-info:hover,
.row-info-button.is-wip-info:focus-visible {
  background: #fff0f0;
  color: #9f1d1d;
}

.matrix td.data-cell {
  position: relative;
  color: var(--text);
  font-weight: 400;
  text-align: center;
}

.matrix td.clickable {
  cursor: pointer;
}

.matrix td.cell-number {
  text-align: right;
}

.matrix-statistics td.cell-marker-info-yes {
  color: #047857;
  font-weight: 700;
}

.cell-ok,
.cell-text-ok,
.cell-text-yes,
.cell-text-pu {
  color: inherit;
  font-weight: inherit;
}

.cell-chyba,
.cell-error {
  color: inherit;
  font-weight: inherit;
}

.cell-info {
  color: inherit;
  font-weight: inherit;
}

.matrix-reports td.cell-ok {
  background: #9be6a6;
  color: #111827;
}

.matrix-reports td.cell-info {
  background: #f59e0b;
  color: #111827;
}

.matrix-reports td.cell-chyba,
.matrix-reports td.cell-error {
  background: #f3a6b8;
  color: #111827;
}

.cell-ju,
.cell-marker-ju,
.cell-text-ju {
  background: #fff2cc;
  color: inherit;
  font-weight: inherit;
}

.cell-text-no {
  color: inherit;
}

.cell-text-warning {
  color: inherit;
  font-weight: inherit;
}

.matrix td.cell-text-minus {
  color: var(--error);
  font-weight: 700;
}

.matrix tbody .cell-marker-halere::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 7px;
  background: #dcb991;
  pointer-events: none;
}

.matrix tbody .cell-marker-scale-corrected::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 7px;
  background: #9575cd;
  pointer-events: none;
}

.matrix tbody .cell-marker-halere.cell-marker-scale-corrected::after {
  left: 7px;
}

.cell-missing,
.cell-empty,
.cell-text-dash {
  background: #add8e6;
  color: inherit;
  font-weight: inherit;
}

.cell-marker-ju-context {
  background: #fff2cc;
  color: inherit;
  font-weight: inherit;
}

.matrix td.cell-marker-negative {
  color: #c00000;
}

.matrix td.cell-marker-positive-result {
  color: #008000;
  font-weight: inherit;
}

.matrix tfoot td {
  border-top: 2px solid #b8c4d0;
  background: #fff;
  font-weight: 700;
}

.matrix tfoot td.data-cell {
  font-weight: 700;
}

.matrix tfoot .sticky-col {
  background: #fff;
}

.matrix tfoot .cell-summary_text {
  height: auto;
  padding-top: 4px;
  padding-bottom: 4px;
  white-space: normal;
  text-align: center;
}

.matrix-legend {
  position: sticky;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  width: max-content;
  max-width: calc(100vw - 48px);
  margin-top: 8px;
  padding: 8px 10px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  background: #fff;
}

.matrix-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.matrix-legend-term-minus {
  color: var(--error);
  font-weight: 700;
}

.matrix-legend-swatch {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid #7c8794;
}

.matrix-legend-swatch-ju {
  background: #fff2cc;
}

.matrix-legend-swatch-missing {
  background: #add8e6;
}

.matrix-legend-swatch-ok {
  background: #9be6a6;
}

.matrix-legend-swatch-info {
  background: #f59e0b;
}

.matrix-legend-swatch-error {
  background: #f3a6b8;
}

.matrix-legend-swatch-minus {
  display: none;
}

.matrix-legend-swatch-halere {
  background: #fff;
}

.matrix-legend-swatch-halere::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  background: #dcb991;
}

.matrix-legend-swatch-scale-corrected {
  background: #fff;
}

.matrix-legend-swatch-scale-corrected::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  background: #9575cd;
}

.summary-part {
  display: block;
  line-height: 1.25;
}

.summary-part + .summary-part {
  margin-top: 2px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-head > div {
  min-width: 0;
}

.detail-head h2 {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dataset-info-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dataset-info-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
}

.dataset-info-title-row h2 {
  min-width: 0;
  margin-top: 0;
}

.dataset-info-pager {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-height: 30px;
}

.dataset-info-pager-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.dataset-info-pager-button:disabled {
  color: var(--muted);
  opacity: 0.45;
}

.dataset-info-pager-text {
  min-width: 44px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.dataset-info-favorite-button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.detail-head button {
  width: auto;
}

.detail-head .dataset-info-pager-button,
.detail-head .dataset-info-favorite-button {
  width: 30px;
}

.detail-head .detail-close-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.detail-body {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  font-size: 14px;
}

.detail-block {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-block:last-child {
  border-bottom: 0;
}

.detail-block-scale-corrected {
  padding-left: 10px;
  border-left: 4px solid #9575cd;
}

.detail-block-scale-corrected .section-title {
  color: #6f4db5;
}

.scale-correction-table-wrap {
  display: grid;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
}

.scale-correction-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.35;
  table-layout: fixed;
}

.scale-correction-table th:first-child,
.scale-correction-table td:first-child {
  width: 46%;
}

.scale-correction-table th:nth-child(2),
.scale-correction-table td:nth-child(2) {
  width: 24%;
}

.scale-correction-table th:nth-child(3),
.scale-correction-table td:nth-child(3) {
  width: 30%;
}

.scale-correction-table th,
.scale-correction-table td {
  padding: 7px 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.scale-correction-table th:nth-child(2),
.scale-correction-table th:nth-child(3),
.scale-correction-table td:nth-child(2),
.scale-correction-table td:nth-child(3) {
  text-align: right;
}

.scale-correction-table thead th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.scale-correction-table tbody td {
  background: #fff;
}

.scale-correction-meta {
  display: grid;
  gap: 4px;
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.35;
}

.scale-correction-meta > div {
  display: grid;
  grid-template-columns: minmax(90px, max-content) 1fr;
  gap: 10px;
  padding: 6px 8px;
  background: #fbf9ff;
}

.scale-correction-meta dt {
  color: #6f4db5;
  font-weight: 700;
}

.scale-correction-meta dd {
  margin: 0;
}

.scale-correction-main-row td:nth-child(2),
.scale-correction-main-row td:nth-child(3) {
  white-space: nowrap;
}

.detail-kind-wip {
  color: var(--error);
  text-transform: none;
}

.source-formula-description {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.source-formula-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 10px;
  align-items: start;
}

.source-formula-column {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}

.source-formula-column .calculation-panel + .calculation-panel {
  margin-top: 0;
}

.calculation-panel {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.calculation-panel + .calculation-panel {
  margin-top: 6px;
}

.calculation-panel-title {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.calculation-steps {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.calculation-step {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border-left: 3px solid var(--accent);
  background: #fff;
}

.calculation-step-parent,
.calculation-step-compare-side {
  border-left-color: var(--accent-strong);
  background: #f9fcfd;
}

.calculation-step-child,
.calculation-step-compare-term {
  margin-left: 14px;
  border-left-color: #7fb1c4;
}

.calculation-step-compound-condition {
  border-left-color: var(--accent-strong);
  background: #f9fcfd;
}

.calculation-step-compound-term {
  margin-left: 14px;
  border-left-color: #7fb1c4;
}

.calculation-step-total {
  margin-top: 2px;
  border-left-color: var(--accent-strong);
  border-top: 1px solid var(--line);
}

.calculation-step-evaluation {
  border-left-color: var(--warn);
  background: #fffaf0;
}

.calculation-step-evaluation .calculation-step-meta {
  white-space: pre-line;
}

.calculation-step-meta-evaluation-grid {
  display: inline-flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
  white-space: normal;
}

.calculation-evaluation-lines {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 0 1 auto;
}

.calculation-evaluation-line {
  overflow-wrap: anywhere;
}

.calculation-evaluation-result {
  flex: 0 0 auto;
  white-space: nowrap;
}

.calculation-evaluation-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2em;
  margin: 0 2px;
  font-size: 1.25em;
  line-height: 1;
  vertical-align: -0.08em;
}

.calculation-step-result {
  border-left-color: var(--accent-strong);
}

.calculation-step-reason {
  border-left-color: var(--muted);
}

.calculation-step-source-status {
  border-left-color: var(--accent-strong);
}

.calculation-step-label {
  font-weight: 700;
}

.calculation-step-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.calculation-meta-negative {
  color: var(--error);
}

.calculation-meta-minus {
  color: var(--error);
  font-weight: 700;
}

.calculation-meta-status {
  font-weight: 700;
}

.calculation-meta-status-ok {
  color: var(--ok);
}

.calculation-meta-status-info {
  color: var(--warn);
}

.calculation-meta-status-chyba {
  color: var(--error);
}

.calculation-meta-status-note {
  color: var(--text);
}

.kv {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.kv dd.is-wip-status {
  color: var(--error);
  font-weight: 700;
}

.detail-json-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.detail-json-toggle {
  flex: 0 0 auto;
}

.detail-json-block pre[hidden] {
  display: none;
}

pre {
  max-width: 100%;
  overflow: auto;
  padding: 10px;
  border-radius: 6px;
  background: #f0f2f4;
}

dialog {
  width: min(760px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.34);
}

.logout-confirm-dialog {
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
}

.logout-confirm-dialog h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.logout-confirm-actions {
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
}

.logout-confirm-actions button {
  width: auto;
  min-width: 82px;
}

.dialog-copy {
  color: var(--muted);
}

.dialog-progress {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.dialog-progress-label {
  color: var(--muted);
  font-size: 13px;
}

.dialog-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebf0;
}

.dialog-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: var(--accent);
  animation: dialog-progress-slide 1s ease-in-out infinite;
}

@keyframes dialog-progress-slide {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(270%);
  }
}

.detail-dialog {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 18px;
  overflow: hidden;
  overscroll-behavior: contain;
}

.detail-dialog .detail-body {
  max-height: calc(100vh - 170px);
  overflow: auto;
  overscroll-behavior: contain;
}

.detail-dialog pre {
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
}

.dataset-info-dialog .kv {
  grid-template-columns: 140px minmax(0, 1fr);
}

.dataset-info-dialog .detail-head,
.dataset-info-dialog .detail-body {
  touch-action: pan-y;
}

.dataset-info-dialog.dataset-info-swipe-active #datasetInfoTitle,
.dataset-info-dialog.dataset-info-swipe-active #datasetInfoBody {
  transform: translateX(var(--dataset-info-swipe-offset, 0));
  user-select: none;
  will-change: transform;
}

.dataset-info-dialog.dataset-info-swipe-return #datasetInfoTitle,
.dataset-info-dialog.dataset-info-swipe-return #datasetInfoBody {
  transition: transform 160ms ease;
}

.conflict-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.conflict-table th,
.conflict-table td {
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
}

.conflict-diff-cell {
  line-height: 1.6;
}

.conflict-diff {
  display: inline;
  padding: 1px 3px;
  border-radius: 4px;
  font-weight: 700;
}

.conflict-diff-old {
  background: #fde2df;
  color: #8f1d16;
}

.conflict-diff-new {
  background: #dff4e8;
  color: #166534;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) 8px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 0 32px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body.mobile-sidebar-open {
    overflow: hidden;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(88vw, 360px);
    height: 100dvh;
    max-height: 100dvh;
    padding: 14px 16px 24px;
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 42px rgb(27 31 35 / 0.18);
    transform: translateX(-104%);
    visibility: hidden;
    transition:
      transform 180ms ease,
      visibility 180ms ease;
    overscroll-behavior: contain;
  }

  .app-shell.mobile-sidebar-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .calculation-step-meta-evaluation-grid {
    row-gap: 4px;
  }

  .calculation-evaluation-result {
    margin-left: 0;
  }

  .sidebar-overlay:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    width: 100%;
    min-height: 100dvh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgb(15 23 42 / 0.36);
    cursor: default;
  }

  .sidebar-resizer {
    display: none;
  }

  .admin-page {
    padding: 18px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-header {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    justify-content: flex-start;
  }

  .dataset-info-dialog .detail-head > div {
    flex: 1 1 auto;
  }

  .dataset-info-title-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "pager pager"
      "favorite title";
    width: 100%;
    gap: 8px;
  }

  .dataset-info-title-actions {
    display: contents;
  }

  .dataset-info-pager {
    grid-area: pager;
    justify-self: center;
  }

  .dataset-info-favorite-button {
    grid-area: favorite;
    align-self: center;
  }

  .dataset-info-title-row h2 {
    grid-area: title;
    align-self: center;
  }

  .detail-head .dataset-info-pager-button,
  .detail-head .dataset-info-favorite-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  .catalog-filters,
  .admin-record-filters {
    grid-template-columns: 1fr;
  }

  .catalog-groups {
    padding: 0 12px 14px;
  }

  .catalog-overview-toolbar,
  .catalog-filters,
  .catalog-overview-card > .status-line {
    padding-left: 12px;
    padding-right: 12px;
  }

  .catalog-table th,
  .catalog-table td {
    max-width: 320px;
  }

  .catalog-overview-toolbar {
    display: grid;
    gap: 8px;
  }

  .catalog-group-head {
    align-items: flex-start;
  }

  .catalog-group-head span {
    padding-top: 3px;
  }

  .catalog-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .catalog-table,
  .catalog-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .catalog-table colgroup,
  .catalog-table thead {
    display: none;
  }

  .catalog-table tr {
    display: grid;
    gap: 8px;
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .catalog-table tr:last-child {
    margin-bottom: 0;
  }

  .catalog-table th,
  .catalog-table td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 8px;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0;
    border: 0;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .catalog-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    text-transform: uppercase;
  }

  .catalog-table .catalog-name-cell {
    display: block;
    order: -1;
  }

  .catalog-table .catalog-name-cell::before {
    content: none;
  }

  .catalog-table .catalog-name-cell > span,
  .catalog-table .catalog-name-cell > small {
    overflow-wrap: anywhere;
  }

  .catalog-table .catalog-group-badge,
  .catalog-table .catalog-accounting-badge,
  .catalog-table .catalog-status,
  .catalog-table .catalog-severity {
    width: fit-content;
    max-width: 100%;
  }

  .catalog-table .catalog-source-cell {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    align-items: stretch;
  }

  .catalog-table .catalog-source-cell::before {
    display: block;
  }

  .catalog-table .catalog-source-layout,
  .catalog-table .catalog-source-layout[data-column-count="2"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-table .catalog-source-column-title {
    padding-bottom: 2px;
  }

  .catalog-table .catalog-source-cell .calculation-panel,
  .catalog-table .catalog-source-cell .calculation-steps,
  .catalog-table .catalog-source-cell .calculation-step {
    min-width: 0;
  }

  .catalog-table .catalog-guidance-block,
  .catalog-table .catalog-guidance-section,
  .catalog-table .catalog-guidance-content,
  .catalog-table .catalog-guidance-text {
    min-width: 0;
  }

  .catalog-table .catalog-guidance-section + .catalog-guidance-section {
    margin-top: 0;
  }

  .catalog-table .catalog-guidance-content {
    margin-left: 0;
  }

  .catalog-table .catalog-guidance-block ul {
    padding-left: 16px;
  }

  .mobile-sidebar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-height: 36px;
    padding: 0 12px;
    border-color: #cbd3dc;
    background: #fff;
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-sidebar-close {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    min-height: 34px;
    margin-left: auto;
    padding: 0;
    border-color: #cbd3dc;
    background: #fff;
    color: var(--accent-strong);
    font-size: 22px;
    line-height: 1;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-top {
    width: 100%;
    flex-direction: column;
    gap: 6px;
  }

  .toolbar-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-width: 0;
  }

  .mode-switch-link:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 36px;
    margin-left: auto;
  }

  .toolbar-main.pager-swipe-active > .toolbar-top .table-title,
  .toolbar-main.pager-swipe-active > .toolbar-top .dataset-meta-top,
  .toolbar-main.pager-swipe-active > .table-description,
  .toolbar-main.pager-swipe-active > .report-guidance {
    transform: translateX(var(--pager-swipe-offset, 0));
    will-change: transform;
  }

  .toolbar-main > .toolbar-top,
  .toolbar-main > .table-description,
  .toolbar-main > .report-guidance {
    touch-action: pan-y;
    user-select: none;
  }

  .toolbar-main.pager-swipe-return > .toolbar-top .table-title,
  .toolbar-main.pager-swipe-return > .toolbar-top .dataset-meta-top,
  .toolbar-main.pager-swipe-return > .table-description,
  .toolbar-main.pager-swipe-return > .report-guidance {
    transition: transform 160ms ease;
  }

  .dataset-meta-top {
    max-width: 100%;
    text-align: left;
  }

  .toolbar-controls {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    margin-left: 0;
  }

  #copyTableBtn {
    display: none;
  }

  .toolbar-actions button {
    width: 100%;
  }

  .item-pager {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
  }

  .item-pager select {
    display: none;
  }

  .mobile-pager-button {
    display: block;
    grid-column: 1 / -1;
    order: -1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-right: 30px;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
  }

  .mobile-pager-button::after {
    content: "▾";
    position: absolute;
    right: 10px;
    color: var(--muted);
  }

  .mobile-pager-menu:not([hidden]) {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 92px;
    z-index: 60;
    display: grid;
    max-height: min(70dvh, 520px);
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 16px 42px rgb(27 31 35 / 0.18);
  }

  .mobile-pager-option {
    display: block;
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-pager-option:hover,
  .mobile-pager-option.is-active {
    background: var(--surface-alt);
  }

  .mobile-select-menu {
    position: fixed;
    z-index: 90;
    display: grid;
    max-height: min(54dvh, 320px);
    overflow: auto;
    padding: 4px;
    border: 1px solid #9aa8b6;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 34px rgb(27 31 35 / 0.18);
  }

  .mobile-select-menu[hidden] {
    display: none;
  }

  .mobile-select-option {
    display: block;
    width: 100%;
    min-height: 32px;
    padding: 5px 8px;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
    color: var(--text);
    font: inherit;
    line-height: 1.25;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-select-option:hover,
  .mobile-select-option:focus-visible {
    background: #eef3f7;
    outline: 0;
  }

  .mobile-select-option.is-selected {
    background: #1f6fd1;
    color: #fff;
  }

  .mobile-select-option:disabled {
    color: var(--muted);
  }

  .report-guidance-grid {
    grid-template-columns: 1fr;
  }

  .report-guidance-item + .report-guidance-item {
    border-left: 0;
    border-top: 1px solid #2f475f;
  }

  .issue-guidance {
    grid-template-columns: 1fr;
  }

  .matrix .sticky-col {
    min-width: 220px;
  }

  .matrix .sticky-col.matrix-item-label {
    width: 142px;
    min-width: 142px;
    max-width: 142px;
    padding-left: 7px;
    padding-right: 5px;
  }

  .matrix tbody tr.matrix-item-group-row .matrix-group-cell {
    width: 142px;
    min-width: 142px;
    max-width: 142px;
  }

  .matrix .matrix-item-label .row-label-content {
    gap: 4px;
    overflow: hidden;
  }

  .matrix .matrix-item-label .row-label-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .matrix .matrix-item-label .row-info-button {
    order: -1;
  }

}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  @page revizak-issues-portrait {
    size: A4 portrait;
    margin: 6mm;
  }

  body.print-issues-portrait,
  body.print-issues-portrait .app-shell,
  body.print-issues-portrait .workspace,
  body.print-issues-portrait .table-region,
  body.print-issues-portrait .table-wrap {
    page: revizak-issues-portrait;
  }

  * {
    box-shadow: none !important;
  }

  html,
  body {
    width: auto;
    min-width: 0;
    height: auto;
    margin: 0;
    overflow: visible;
    background: #fff;
    color: #000;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar,
  .sidebar-resizer,
  .sidebar-overlay,
  .brand-menu,
  .mobile-sidebar-button,
  .mobile-sidebar-close,
  .mode-switch-link,
  .toolbar-controls,
  .toolbar-actions,
  .item-pager,
  .mobile-pager-menu,
  #copyTableBtn,
  #fullPager,
  #detailDialog,
  .matrix-unit-label-toggle,
  .row-info-button {
    display: none !important;
  }

  .matrix.matrix-compact-unit-labels .sticky-col {
    min-width: 280px;
    max-width: 380px;
  }

  .matrix.matrix-compact-unit-labels .matrix-unit-label .row-label-text {
    font-size: 0;
  }

  .matrix.matrix-compact-unit-labels .matrix-unit-label .row-label-text::after {
    content: attr(data-full-label);
    font-size: 10px;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    display: block;
    min-height: 0;
  }

  .workspace,
  .toolbar,
  .table-region,
  .table-wrap {
    display: block;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    overflow: visible;
    background: #fff;
  }

  .workspace {
    padding: 0;
  }

  .toolbar {
    padding: 0 0 6mm;
    border: 0;
    break-after: avoid;
  }

  .toolbar-main,
  .toolbar-top {
    display: block;
  }

  .table-title {
    margin: 0 0 2mm;
    color: #000;
    font-size: 16pt;
    line-height: 1.2;
  }

  .dataset-meta-top {
    max-width: none;
    margin-bottom: 2mm;
    color: #333;
    font-size: 8.5pt;
    text-align: left;
  }

  .table-description {
    max-width: none;
    margin-bottom: 3mm;
    color: #111;
    font-size: 9pt;
    line-height: 1.3;
  }

  .report-guidance {
    margin: 0 0 3mm;
    break-inside: avoid;
  }

  .report-guidance-grid {
    border-color: #000;
    border-radius: 0;
  }

  .report-guidance-item + .report-guidance-item {
    border-left-color: #000;
  }

  .report-guidance-title,
  .report-guidance-text {
    padding: 2mm;
    font-size: 8pt;
  }

  .empty-state {
    padding: 0;
    color: #333;
  }

  table.matrix {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    page-break-inside: auto;
  }

  .matrix thead {
    display: table-header-group;
  }

  .matrix tfoot {
    display: table-row-group;
  }

  .matrix tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .matrix th,
  .matrix td {
    position: relative !important;
    min-width: 0;
    max-width: none;
    height: auto;
    padding: 1.3mm 1.8mm;
    border: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    color: #000;
    font-size: 7.5pt;
    line-height: 1.15;
  }

  .matrix th::after,
  .matrix td::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border-right: 0.25mm solid #4b5563;
    border-bottom: 0.25mm solid #4b5563;
    pointer-events: none;
  }

  .matrix tr > :first-child::after {
    border-left: 0.25mm solid #4b5563;
  }

  .matrix thead tr:first-child > th::after {
    border-top: 0.25mm solid #4b5563;
  }

  .matrix th {
    background: #244f8f !important;
    color: #fff !important;
  }

  .matrix .sticky-col {
    min-width: 42mm;
    max-width: 62mm;
    background: #fff;
  }

  .matrix th.sticky-col {
    background: #244f8f !important;
  }

  .matrix td.data-cell,
  .matrix tbody .cell-marker-halere {
    position: relative !important;
  }

  .matrix tbody tr:hover > td,
  .matrix tfoot tr:hover > td,
  .matrix .is-hover-col,
  .matrix tbody tr:hover > td.is-hover-col,
  .matrix tfoot tr:hover > td.is-hover-col {
    box-shadow: none !important;
  }

  .matrix td.clickable {
    cursor: default;
  }

  .row-label-content {
    display: block;
  }

  .row-label-text {
    white-space: normal;
  }

  .matrix-legend {
    position: static;
    width: auto;
    max-width: none;
    margin-top: 3mm;
    padding: 0;
    color: #111;
    font-size: 8pt;
    background: #fff;
    break-inside: avoid;
  }

  .matrix-legend-item {
    white-space: normal;
  }

  .catalog-page {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    color: #000;
    background: #fff;
  }

  .catalog-page .admin-header {
    display: block;
    padding: 0 0 4mm;
  }

  .catalog-page .admin-header h1 {
    margin: 0 0 1mm;
    color: #000;
    font-size: 14pt;
    line-height: 1.15;
  }

  .catalog-page .print-dataset-meta,
  .admin-units-page .print-dataset-meta {
    display: block;
    max-width: none;
    margin: 0 0 2mm;
    color: #333;
    font-size: 8.5pt;
    line-height: 1.25;
    text-align: left;
  }

  .catalog-page .admin-header p,
  .catalog-page .admin-nav,
  .catalog-page .catalog-overview-toolbar,
  .catalog-page .catalog-filters,
  .catalog-page #catalogMessage {
    display: none !important;
  }

  .catalog-page .catalog-overview-card {
    display: block;
    padding: 0;
    border: 0;
    background: #fff;
    overflow: visible;
  }

  .catalog-page .catalog-groups {
    display: block;
    padding: 0;
  }

  .catalog-page .catalog-group {
    display: block;
    margin: 0 0 5mm;
    break-inside: auto;
    page-break-inside: auto;
  }

  .catalog-page .catalog-group-head {
    display: flex;
    align-items: baseline;
    gap: 4mm;
    margin: 0 0 1.5mm;
    break-after: avoid;
  }

  .catalog-page .catalog-group-head h2 {
    color: #000;
    font-size: 11pt;
    line-height: 1.15;
  }

  .catalog-page .catalog-group-head span {
    color: #333;
    font-size: 7pt;
  }

  .catalog-page .catalog-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .catalog-page .catalog-table {
    display: table;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    page-break-inside: auto;
  }

  .catalog-page .catalog-table tbody {
    display: table-row-group;
  }

  .catalog-page .catalog-table thead {
    display: table-header-group;
  }

  .catalog-page .catalog-table tr {
    display: table-row;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    break-inside: auto;
    page-break-inside: auto;
  }

  .catalog-page .catalog-table th,
  .catalog-page .catalog-table td {
    display: table-cell;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 1.2mm 1.4mm;
    border: 0.25mm solid #4b5563;
    overflow: visible;
    color: #000;
    font-size: 6.8pt;
    line-height: 1.12;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .catalog-page .catalog-table td::before {
    content: none;
  }

  .catalog-page .catalog-table th {
    position: static;
    top: auto;
    z-index: auto;
    background: #244f8f !important;
    color: #fff !important;
  }

  .catalog-page .catalog-table tbody tr:last-child td {
    border-bottom: 0.25mm solid #4b5563 !important;
  }

  .catalog-page .catalog-source-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1mm;
    align-items: start;
  }

  .catalog-page .catalog-source-layout[data-column-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-page .catalog-source-column {
    display: grid;
    gap: 0.8mm;
    min-width: 0;
    align-content: start;
  }

  .catalog-page .catalog-source-column-title {
    padding-bottom: 0.5mm;
    border-bottom: 0.2mm solid #cbd5e1;
    color: #000;
    font-size: 6.4pt;
    line-height: 1.1;
  }

  .catalog-page .catalog-source-cell .calculation-panel {
    display: block;
    gap: 0;
    padding: 0.8mm;
    border: 0.25mm solid #cbd5e1;
    border-radius: 0;
    background: #fff;
    break-inside: auto;
    page-break-inside: auto;
  }

  .catalog-page .catalog-source-cell .calculation-panel + .calculation-panel {
    margin-top: 0.8mm;
  }

  .catalog-page .catalog-source-cell .calculation-panel-title {
    margin: 0 0 0.6mm;
    color: #000;
    font-size: 6.4pt;
    line-height: 1.1;
  }

  .catalog-page .catalog-source-cell .calculation-steps {
    display: block;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .catalog-page .catalog-source-cell .calculation-step {
    display: block;
    gap: 0;
    margin: 0 0 0.5mm;
    padding: 0.3mm 0 0.3mm 1.2mm;
    border-left-width: 0.35mm;
    background: #fff;
    break-inside: auto;
    page-break-inside: auto;
  }

  .catalog-page .catalog-source-cell .calculation-step:last-child {
    margin-bottom: 0;
  }

  .catalog-page .catalog-source-cell .calculation-step-child,
  .catalog-page .catalog-source-cell .calculation-step-compare-term,
  .catalog-page .catalog-source-cell .calculation-step-compound-term {
    margin-left: 2mm;
  }

  .catalog-page .catalog-source-cell .calculation-step-label {
    color: #000;
    font-size: 6.2pt;
    line-height: 1.1;
  }

  .catalog-page .catalog-source-cell .calculation-step-meta {
    color: #333;
    font-size: 5.8pt;
    line-height: 1.1;
  }

  .catalog-page .catalog-name-cell > strong,
  .catalog-page .catalog-name-cell > span,
  .catalog-page .catalog-name-cell > small {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .catalog-page .catalog-name-cell > span,
  .catalog-page .catalog-name-cell > small {
    margin-top: 0.8mm;
    color: #333;
    font-size: 6.2pt;
    line-height: 1.1;
  }

  .catalog-page .catalog-item-meta {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 0.8mm;
    row-gap: 0.6mm;
    margin-top: 1mm;
    font-size: 5.9pt;
    line-height: 1.1;
  }

  .catalog-page .catalog-item-meta-entry {
    display: contents;
  }

  .catalog-page .catalog-item-meta-label,
  .catalog-page .catalog-item-meta-value {
    color: #333;
  }

  .catalog-page .catalog-group-badge,
  .catalog-page .catalog-accounting-badge,
  .catalog-page .catalog-status,
  .catalog-page .catalog-severity {
    min-height: 0;
    padding: 0.2mm 0.9mm;
    border-radius: 2mm;
    font-size: 6pt;
    line-height: 1.1;
    white-space: normal;
  }

  .catalog-page .catalog-guidance-block {
    gap: 0.8mm;
    margin-top: 1.2mm;
    padding-top: 1mm;
    border-top: 0.2mm solid #cbd5e1;
  }

  .catalog-page .catalog-guidance-heading {
    color: #333;
    font-size: 5.9pt;
    line-height: 1.1;
  }

  .catalog-page .catalog-guidance-block ul {
    gap: 0;
    margin: 0;
    padding-left: 3mm;
  }

  .catalog-page .catalog-table-reports .catalog-name-cell {
    width: 30% !important;
  }

  .catalog-page .catalog-table-statistics .catalog-name-cell {
    width: 24% !important;
  }

  .catalog-page .catalog-table-reports .catalog-source-cell {
    width: 70% !important;
  }

  .catalog-page .catalog-table-statistics .catalog-source-cell {
    width: 76% !important;
  }

  .admin-units-page {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    color: #000;
    background: #fff;
  }

  .admin-units-page .admin-header {
    display: block;
    padding: 0 0 4mm;
  }

  .admin-units-page .admin-header h1 {
    margin: 0 0 1mm;
    color: #000;
    font-size: 14pt;
    line-height: 1.15;
  }

  .admin-units-page .admin-header p,
  .admin-units-page .admin-nav,
  .admin-units-page .button-row,
  .admin-units-page #unitStatus,
  .admin-units-page .admin-unit-filter-row,
  .admin-units-page .admin-unit-edit-button {
    display: none !important;
  }

  .admin-units-page .admin-units-card {
    display: block;
    padding: 0;
    border: 0;
    background: #fff;
    overflow: visible;
  }

  .admin-units-page .admin-units-toolbar {
    display: block;
    padding: 0 0 2mm;
  }

  .admin-units-page .section-title {
    color: #000;
    font-size: 9pt;
  }

  .admin-units-page #unitCount {
    min-height: 0;
    color: #333;
    font-size: 7.5pt;
  }

  .admin-units-page .admin-units-table-wrap {
    max-height: none;
    overflow: visible;
    border: 0;
  }

  .admin-units-page .admin-units-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    page-break-inside: auto;
  }

  .admin-units-page .admin-units-table thead {
    display: table-header-group;
  }

  .admin-units-page .admin-units-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .admin-units-page .admin-units-table th,
  .admin-units-page .admin-units-table td {
    min-width: 0 !important;
    max-width: none !important;
    padding: 1.1mm 1.3mm;
    border: 0.25mm solid #4b5563;
    overflow: visible;
    color: #000;
    font-size: 6.8pt;
    line-height: 1.12;
    text-align: left;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .admin-units-page .admin-units-table th {
    position: static;
    top: auto;
    z-index: auto;
    background: #244f8f !important;
    color: #fff !important;
  }

  .admin-units-page .admin-units-table tbody tr:last-child td {
    border-bottom: 0.25mm solid #4b5563 !important;
  }

  .admin-units-page .admin-units-table .is-area-start > td,
  .admin-units-page .admin-units-table .is-area-end > td {
    border-color: #4b5563;
  }

  .admin-units-page .admin-unit-area-read,
  .admin-units-page .admin-unit-cell-read {
    display: block;
  }

  .admin-units-page .admin-unit-id-col {
    width: 9%;
  }

  .admin-units-page .admin-unit-region-col {
    width: 15%;
  }

  .admin-units-page .admin-unit-area-col {
    width: 19%;
  }

  .admin-units-page .admin-unit-center-col {
    width: 25%;
  }

  .admin-units-page .admin-unit-ico-col {
    width: 10%;
  }

  .admin-units-page .admin-unit-parent-col {
    width: 22%;
  }

  .issues-list {
    display: block;
    max-width: none;
    padding: 0;
  }

  .issues-year {
    display: block;
    margin-bottom: 5mm;
  }

  .issues-year-title {
    margin: 0 0 2mm;
    padding-bottom: 1mm;
    color: #000;
    font-size: 13pt;
  }

  .issues-group {
    display: block;
    margin-left: 4mm;
    padding-left: 4mm;
    border-left-color: #777;
  }

  .issues-group-title {
    margin: 0 0 1.5mm;
    color: #000;
    font-size: 10pt;
  }

  .issue-item {
    display: block;
    margin: 0 0 2.5mm 4mm;
    padding: 1.5mm 0 2mm 3mm;
    border-bottom-color: #bbb;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .issue-head {
    display: flex;
  }

  .issue-title {
    font-size: 9pt;
    line-height: 1.25;
  }

  .issue-current-value,
  .issue-message,
  .issue-description,
  .issue-guidance-title,
  .issue-guidance-text {
    font-size: 8pt;
  }

  .issue-guidance {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3mm;
    margin-top: 1mm;
  }

  body.print-issues-portrait .toolbar {
    padding-bottom: 2mm;
  }

  body.print-issues-portrait .table-title {
    margin-bottom: 1mm;
    font-size: 12pt;
    line-height: 1.12;
  }

  body.print-issues-portrait .dataset-meta-top {
    margin-bottom: 1mm;
    font-size: 7pt;
    line-height: 1.15;
  }

  body.print-issues-portrait .table-description {
    display: none;
  }

  body.print-issues-portrait .issues-list {
    display: block;
  }

  body.print-issues-portrait .issues-year {
    margin-bottom: 2mm;
  }

  body.print-issues-portrait .issues-year-title {
    margin: 0 0 1mm;
    padding-bottom: 0.5mm;
    font-size: 10pt;
    line-height: 1.1;
  }

  body.print-issues-portrait .issues-group {
    margin-left: 1.5mm;
    padding-left: 2mm;
    border-left-width: 0.4mm;
  }

  body.print-issues-portrait .issues-group-title {
    margin: 0 0 0.8mm;
    font-size: 8.5pt;
    line-height: 1.1;
  }

  body.print-issues-portrait .issue-item {
    margin: 0 0 1mm 1.5mm;
    padding: 0.8mm 0 0.8mm 2mm;
    border-left-width: 0.5mm;
    border-bottom-width: 0.2mm;
    break-inside: auto;
    page-break-inside: auto;
  }

  body.print-issues-portrait .issue-title {
    font-size: 8pt;
    line-height: 1.12;
  }

  body.print-issues-portrait .issue-current-value,
  body.print-issues-portrait .issue-message,
  body.print-issues-portrait .issue-description,
  body.print-issues-portrait .issue-guidance-title,
  body.print-issues-portrait .issue-guidance-text {
    font-size: 7pt;
    line-height: 1.12;
  }

  body.print-issues-portrait .issue-current-value,
  body.print-issues-portrait .issue-message,
  body.print-issues-portrait .issue-description {
    margin: 0;
  }

  body.print-issues-portrait .issue-guidance {
    display: block;
    gap: 0;
    margin: 0;
    padding: 0;
    font-size: 7pt;
    line-height: 1.08;
  }

  body.print-issues-portrait .issue-guidance-item {
    display: block;
    margin: 0;
    padding: 0;
    font-size: 7pt;
    line-height: 1.08;
  }

  body.print-issues-portrait .issue-guidance-title,
  body.print-issues-portrait .issue-guidance-text {
    display: inline;
    margin: 0;
    padding: 0;
    line-height: 1.08;
  }
}
