:root {
  --brand: #1a3a5c;
  --brand-2: #255c91;
  --brand-soft: #dce8f5;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --border: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --shadow: 0 10px 18px -16px #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #8bb8e8;
  outline-offset: 2px;
}

#app {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.login-page {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.login-card,
.panel,
.test-card,
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.login-card {
  width: 100%;
  max-width: 520px;
  padding: 18px 24px 28px;
  border: 0;
  box-shadow: none;
  text-align: center;
}

.login-logo {
  width: min(340px, 82vw);
  height: 220px;
  object-fit: contain;
  object-position: center;
  margin: -8px auto 2px;
  display: block;
}

.app-title {
  margin: 0 0 24px;
  color: var(--brand);
  text-align: center;
  font-size: 24px;
  line-height: 1.2;
}

.login-heading {
  margin: 0 0 30px;
  color: var(--brand);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 800;
}

.login-card .field {
  max-width: 270px;
  margin: 0 auto 28px;
}

.auth-form {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.auth-form .field {
  max-width: none;
  margin-bottom: 14px;
}

.auth-form .field span {
  text-align: left;
}

.auth-copy,
.auth-message {
  max-width: 340px;
  margin: 0 auto 16px;
  text-align: center;
}

.auth-message {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.auth-message-error {
  color: #8b1e27;
  background: #fff0f1;
  border: 1px solid #f1bdc3;
}

.auth-message-success {
  color: #17663c;
  background: #edf9f1;
  border: 1px solid #b8e2c7;
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px auto 0;
}

.link-button {
  border: 0;
  padding: 0;
  color: var(--brand);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.development-link {
  display: inline-block;
  margin-top: 10px;
}

.account-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.account-summary-card strong,
.account-summary-card span {
  display: block;
}

.account-summary-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.account-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-summary-actions .secondary,
.verification-card .secondary {
  width: auto;
  min-height: 40px;
}

.account-company-logo {
  width: 72px;
  height: 40px;
  object-fit: contain;
  background: #fff;
}

.verification-card p {
  margin-top: 0;
}

.account-panel {
  max-width: 620px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.login-card .field span {
  color: var(--brand);
  font-size: 16px;
  text-align: center;
}

.login-card .input {
  border: 2px solid var(--brand);
  border-radius: 0;
}

.login-card .primary {
  max-width: 215px;
  min-height: 36px;
  margin: 0 auto;
  border-radius: 5px;
  padding: 8px 14px;
  display: block;
}

.subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field span,
.field label {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.input,
.select {
  min-height: 44px;
  padding: 10px 12px;
}

.textarea {
  min-height: 74px;
  padding: 10px 12px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand-2);
}

.primary,
.secondary,
.ghost,
.status-btn,
.verdict-btn {
  border: 0;
  border-radius: 8px;
  font-weight: 700;
}

.primary {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  background: var(--brand);
  color: #fff;
}

.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--brand-soft);
  background: var(--brand-soft);
  color: var(--brand);
}

.danger-action {
  border-color: var(--bad-bg);
  background: var(--bad-bg);
  color: var(--bad);
}

.ghost {
  min-width: 40px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--brand);
}

.topbar {
  position: static;
  padding: 14px 12px 0;
  background: var(--brand);
  border-bottom: 0;
}

.nav {
  min-height: 76px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3px 48px 3px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  background: #fff;
  color: var(--brand);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 7px;
  box-shadow: 0 5px 14px rgba(8, 29, 53, .16);
}

.nav-title {
  display: none;
}

.shell-logo {
  width: clamp(210px, 22vw, 320px);
  height: 70px;
  object-fit: contain;
  object-position: center;
  flex: 0 0 auto;
}

.shell-logo.company-shell-logo {
  width: clamp(170px, 22vw, 300px);
}

.shell-copy {
  display: grid;
  flex: 1;
  gap: 8px;
  color: var(--brand);
  text-align: center;
}

.shell-copy strong {
  font-size: clamp(12px, 1.75vw, 17px);
  line-height: 1.2;
}

.shell-copy span {
  font-size: clamp(10px, 1.4vw, 14px);
  line-height: 1.2;
  font-weight: 800;
}

.nav .ghost {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
}

.nav #backBtn {
  left: 8px;
}

.nav #homeBtn {
  right: 8px;
}

.meta {
  display: none;
  padding: 8px 14px;
  gap: 10px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.meta strong {
  color: var(--brand);
}

.page {
  padding: 24px 16px 16px;
  display: grid;
  gap: 16px;
}

.topbar + .page {
  background: var(--brand);
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

.modality-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.clinic-action-card {
  width: 100%;
  max-width: none;
  margin: 0;
}

.service-entry-card {
  width: 100%;
  max-width: none;
  margin: 0;
}

.service-entry-card .panel-title,
.clinic-action-card .panel-title {
  text-align: center;
}

.page > form,
.clinic-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  min-width: 0;
}

.page > form > .panel,
.page > form > .summary-card,
.clinic-form > .panel,
.clinic-form > .summary-card {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

#clinicForm {
  grid-column: 1 / -1;
}

.clinic-grid,
.year-grid {
  grid-column: 1 / -1;
  display: grid;
  gap: 24px;
  width: 100%;
  max-width: none;
  margin: 0;
}

.clinic-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.clinic-card,
.year-card {
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-weight: 800;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 12px;
  min-width: 0;
}

.clinic-card {
  min-height: 88px;
  grid-template-rows: 54px auto;
  gap: 6px;
  padding: 10px 14px;
}

.clinic-card-no-logo {
  grid-template-rows: 1fr;
  align-content: center;
}

.year-card {
  min-height: 68px;
}

.clinic-logo {
  width: 100%;
  height: 54px;
  display: grid;
  place-items: center;
}

.clinic-logo img {
  max-width: 100%;
  max-height: 54px;
  object-fit: contain;
  background: transparent;
}

.clinic-logo-editor img {
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
  background: transparent;
}

.clinic-card strong {
  width: 100%;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clinic-logo-placeholder {
  width: 100%;
  min-height: 36px;
  border: 1px solid #111827;
  display: grid;
  place-items: center;
  background: transparent;
  color: #111827;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  text-align: center;
}

.clinic-logo-editor .clinic-logo-placeholder {
  width: 150px;
  min-height: 42px;
  border: 0;
  color: var(--muted);
  font-size: 13px;
}

.clinic-logo-empty {
  display: block;
  width: 150px;
  min-height: 42px;
}

.clinic-portal-hero {
  grid-column: 1 / -1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(120px, 240px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 10px 18px;
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
}

.clinic-portal-logo {
  min-width: 0;
  display: grid;
  place-items: center;
}

.clinic-portal-logo img {
  max-width: 180px;
  max-height: 72px;
  object-fit: contain;
}

.clinic-portal-logo strong {
  font-size: 16px;
  line-height: 1.15;
  text-align: center;
}

.clinic-portal-heading {
  min-width: 0;
  display: grid;
  gap: 14px;
  text-align: center;
  font-weight: 900;
  color: var(--brand);
  text-transform: none;
}

.clinic-portal-heading strong,
.clinic-portal-heading span {
  display: block;
  overflow-wrap: anywhere;
}

.clinic-portal-logout {
  color: var(--brand);
}

.clinic-portal-year-grid,
.clinic-portal-report-grid {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px 28px;
  width: 100%;
}

.clinic-portal-main-actions,
.clinic-portal-equipment-grid,
.clinic-portal-category-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
}

.clinic-portal-year-grid {
  grid-template-columns: repeat(6, minmax(110px, 1fr));
}

.clinic-portal-report-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clinic-portal-year-card,
.clinic-portal-report-card,
.clinic-portal-action-card,
.clinic-portal-equipment-card,
.clinic-portal-category-card {
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 900;
  text-align: center;
  box-shadow: none;
}

.clinic-portal-year-card {
  min-height: 72px;
  padding: 12px;
  font-size: 16px;
}

.clinic-portal-report-card {
  min-height: 74px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.25;
  text-transform: uppercase;
}

.clinic-portal-action-card {
  min-height: 66px;
  padding: 14px 18px;
  font-size: 15px;
}

.clinic-portal-equipment-card {
  min-height: 74px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.25;
  text-transform: uppercase;
}

.clinic-portal-category-card {
  min-height: 74px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.25;
}

.clinic-portal-equipment-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
}

.clinic-portal-alert {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 900;
  letter-spacing: .02em;
  text-align: center;
  text-transform: uppercase;
}

.clinic-portal-alert.expired {
  border: 2px solid #b91c1c;
}

.clinic-portal-empty {
  grid-column: 1 / -1;
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.clinic-portal-empty.muted-empty {
  color: var(--muted);
}

.portal-indicator-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
  width: 100%;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
}

.portal-indicator-panel h2,
.portal-chart-card h3 {
  margin: 0;
  color: var(--brand);
  text-align: center;
}

.portal-chart-card {
  display: grid;
  gap: 8px;
  width: min(100%, 640px);
  margin: 0 auto;
  min-width: 0;
}

.portal-chart {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--border);
  background: #fff;
}

.portal-chart-grid {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.portal-chart-axis {
  stroke: #111827;
  stroke-width: 1.2;
}

.portal-chart-line {
  fill: none;
  stroke-width: 2.5;
}

.portal-chart-title {
  fill: #111827;
  font-size: 15px;
  font-weight: 800;
  text-anchor: middle;
}

.portal-chart-tick,
.portal-chart-x,
.portal-chart-axis-label {
  fill: #374151;
  font-size: 11px;
}

.portal-chart-axis-label {
  text-anchor: middle;
}

.portal-chart-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #374151;
  font-size: 12px;
}

.portal-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.portal-chart-legend-item i {
  width: 12px;
  height: 3px;
  border-radius: 999px;
}

.portal-indicator-table-wrap {
  overflow-x: auto;
}

.portal-indicator-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}

.portal-indicator-table th,
.portal-indicator-table td {
  border: 1px solid #111827;
  padding: 6px 8px;
  text-align: center;
}

.portal-indicator-table th {
  background: #d1d5db;
  font-weight: 900;
}

.clinic-field-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
  width: 100%;
  min-width: 0;
}

.clinic-extra-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 220px;
  gap: 18px;
  align-items: end;
}

.clinic-logo-editor {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.clinic-title-card h2 {
  margin: 0;
  text-align: center;
  font-size: 17px;
  line-height: 1.25;
}

.clinic-title-with-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 190px;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
}

.clinic-title-with-actions h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.clinic-dashboard-actions-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 4vw, 52px);
  width: 100%;
  padding: 12px 20px;
}

.clinic-dashboard-actions-card .primary {
  width: 100%;
  min-height: 50px;
}

.compact-title-action,
.compact-danger-action {
  justify-self: stretch;
  min-height: 34px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  font-size: 12px;
}

.compact-title-action {
  background: #dceaf8;
  color: var(--brand);
}

.compact-danger-action {
  background: var(--bad-bg);
  color: var(--bad);
}

.year-create-card {
  background: var(--brand);
  color: #fff;
  border: 6px solid #fff;
}

.clinic-option-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 18px;
  width: 100%;
}

.clinic-option-row {
  min-height: 50px;
  padding: 5px 10px 6px;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.clinic-option-row:has(input:checked) {
  outline: 4px solid var(--brand-soft);
}

.clinic-option-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.clinic-option-row .modality-image {
  width: 48px;
  height: 40px;
}

.clinic-option-row .modality-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.clinic-option-copy,
.clinic-option-copy strong,
.clinic-option-copy small {
  display: block;
  min-width: 0;
  text-align: center;
  line-height: 1.15;
}

.clinic-option-copy strong {
  font-size: 11px;
}

.clinic-option-copy small {
  margin-top: 2px;
  color: #111827;
  font-size: 10px;
  font-weight: 800;
}

.clinic-modality-grid {
  max-width: 1220px;
}

.modality-grid.clinic-modality-grid .equipment-card span:last-child::after,
.modality-grid.clinic-modality-grid .equipment-card:nth-child(n) span:last-child::after {
  content: none;
}

.modality-grid .equipment-card {
  grid-column: span 2;
  min-height: 176px;
  padding: 0 28px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: #111827;
  display: grid;
  grid-template-columns: 44% 1fr;
  grid-template-rows: none;
  place-items: stretch;
  align-items: center;
  gap: 16px;
  box-shadow: none;
}

.modality-grid .equipment-card:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.modality-grid .equipment-card.active {
  background: #fff;
  color: #111827;
  border: 0;
}

.modality-grid .equipment-card span:last-child {
  color: #111827;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.modality-grid .equipment-card span:last-child::after {
  content: "";
  display: block;
  margin-top: 2px;
}

.modality-grid .equipment-card:nth-child(1) span:last-child::after { content: "IN 90"; }
.modality-grid .equipment-card:nth-child(2) span:last-child::after { content: "IN 91"; }
.modality-grid .equipment-card:nth-child(3) span:last-child::after { content: "IN 92"; }
.modality-grid .equipment-card:nth-child(4) span:last-child::after { content: "IN 93"; }
.modality-grid .equipment-card:nth-child(5) span:last-child::after { content: "IN 94"; }
.modality-grid .equipment-card:nth-child(6) span:last-child::after { content: "IN 95"; }
.modality-grid .equipment-card:nth-child(7) span:last-child::after { content: "IN 96"; }
.modality-grid .equipment-card:nth-child(8) span:last-child::after { content: "IN 97"; }

.modality-grid .equipment-card:nth-child(7),
.modality-grid .equipment-card:nth-child(8),
.modality-grid .equipment-card:nth-child(9) {
  grid-column: span 2;
}

.modality-grid .equipment-card:nth-child(10) {
  grid-column: 3 / span 2;
}

.shielding-warning {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #c98a16;
  border-radius: 8px;
  background: #fff7df;
  color: #624000;
  line-height: 1.4;
}

.shielding-steps {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.shielding-content {
  grid-column: 1 / -1;
  width: 100%;
}

.shielding-content .panel {
  display: block;
  width: 100%;
}

.shielding-content .panel > h2,
.shielding-content .panel > .fields-row,
.shielding-content .panel > .data-quadrant,
.shielding-content .panel > .qc-table-wrap,
.shielding-content .panel > .limit-info,
.shielding-content .panel > p,
.shielding-content .panel > button {
  margin-bottom: 14px;
}

.shielding-steps button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

.shielding-steps button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.shielding-reference-list {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
}

.modality-grid .modality-image {
  width: 100%;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modality-grid .modality-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.equipment-card {
  width: 100%;
  min-height: 128px;
  padding: 18px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  font-weight: 700;
  grid-template-rows: 56px auto;
}

.equipment-save-card {
  display: grid;
  gap: 8px;
}

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

.saved-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, auto);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.saved-item-finalized {
  grid-template-columns: minmax(180px, 1fr) repeat(4, auto);
}

.saved-finalized-label {
  min-width: 0;
  overflow: hidden;
  color: var(--brand);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-load,
.saved-delete,
.small-action {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-weight: 700;
  padding: 7px 9px;
}

.saved-load {
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-delete {
  color: var(--bad);
}

.saved-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.save-panel {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--brand-soft);
}

.equipment-card.active {
  background: #eef4fb;
  color: var(--brand);
  border-color: var(--brand-2);
}

.xray-icon {
  width: 56px;
  height: 56px;
  border: 3px solid currentColor;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.xray-icon::before {
  content: "";
  width: 28px;
  height: 28px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.panel {
  padding: 14px;
}

.panel-fields {
  display: grid;
  gap: 0 14px;
}

.panel-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.analysis-list {
  display: grid;
  gap: 10px;
}

.selection-count {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.test-select-row {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 20px 28px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
}

.test-select-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.analysis-row {
  width: 100%;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.test-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.test-card > *,
.panel > *,
.summary-card > * {
  min-width: 0;
  max-width: 100%;
}

.test-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.test-tab { flex: 0 0 auto; min-height: 36px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--brand); font-size: 12px; font-weight: 700; }
.test-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.test-actions { padding-top: 12px; border-top: 1px solid var(--border); }

.checklist-actions-card .test-actions {
  padding-top: 0;
  border-top: 0;
  flex-wrap: wrap;
}

.report-generation-options {
  display: grid;
  gap: 10px;
}

.report-option-group {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.report-option-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.report-option-row input {
  margin-top: 2px;
  accent-color: var(--brand);
}

.summary-card + .test-actions {
  grid-column: span 12;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  flex-wrap: wrap;
}

.test-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.test-name {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.remove-test-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.tolerance {
  padding: 8px 10px;
  border-left: 3px solid var(--brand-soft);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
}


.multimeter-site-sheet {
  margin-top: 12px;
}

.multimeter-site-sheet-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.multimeter-site-sheet-heading h3 {
  margin-bottom: 2px;
}

.multimeter-site-sheet-wrap {
  max-height: 62vh;
  border: 1px solid var(--border);
}

.multimeter-site-sheet-table {
  width: max-content;
  min-width: 100%;
}

.multimeter-site-sheet-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.multimeter-site-sheet-table th {
  min-width: 96px;
  white-space: nowrap;
}

.multimeter-site-sheet-table .multimeter-row-number {
  min-width: 42px;
  width: 42px;
}

.multimeter-site-sheet-table td {
  padding: 0;
  background: #fff;
}

.multimeter-sheet-cell {
  width: 96px;
  min-width: 96px;
  height: 34px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent;
  text-align: center;
  outline: none;
}

.multimeter-sheet-cell:focus {
  background: #dff2e8;
  box-shadow: inset 0 0 0 2px var(--brand);
}

.multimeter-delete-row {
  min-width: 34px;
  min-height: 30px;
  padding: 4px 8px;
}

.restriction {
  margin-top: 2px;
  color: var(--warn);
}

.fields-row,
.status-row,
.actions-row {
  display: flex;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.fields-row {
  flex-wrap: wrap;
}

.mini-field {
  flex: 1;
  min-width: min(180px, 100%);
  display: grid;
  gap: 4px;
}

.full-field {
  width: 100%;
}

.mini-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.mini-field .input {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14px;
}

.readonly-input {
  background: var(--bg);
  color: var(--brand);
  font-weight: 800;
}

.data-quadrant {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
}

.data-quadrant h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.limit-info {
  padding: 10px 12px;
  border: 1px solid #cbd7e6;
  border-left: 3px solid var(--brand-2);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--text);
}

.limit-info strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.result-info {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.result-info > strong {
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.result-row {
  padding: 8px;
  border-radius: 8px;
  background: var(--bg);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.result-row b {
  font-variant-numeric: tabular-nums;
}

.conclusion {
  min-width: 112px;
  padding: 4px 8px;
  border-radius: 999px;
  text-align: center;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.conclusion.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.conclusion.nok {
  background: var(--warn-bg);
  color: var(--warn);
}

.conclusion.restricted {
  background: var(--bad-bg);
  color: var(--bad);
}

.conclusion.pending,
.conclusion.baseline {
  background: var(--bg);
  color: var(--muted);
}

.cassette-list {
  display: grid;
  gap: 10px;
}

.attachment-field {
  margin-top: 12px;
}

.equipment-eligibility-card {
  margin-bottom: 18px;
}

.equipment-eligibility-reference {
  margin: -4px 0 14px;
  color: var(--muted);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  text-align: center;
}

.equipment-eligibility-table td:first-child {
  min-width: 420px;
  text-align: left;
}

.equipment-eligibility-table td:last-child {
  min-width: 170px;
}

.report-references-selector {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.report-references-selector legend {
  padding: 0 6px;
  color: var(--brand);
  font-weight: 800;
}

.report-references-selector p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.report-reference-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 2px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.report-reference-option input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.attachment-preview {
  display: block;
  width: min(100%, 520px);
  max-height: 280px;
  margin: 10px auto 0;
  border: 1px solid var(--border);
  object-fit: contain;
  background: #fff;
}

.plate-image-upload {
  display: block;
  margin-top: 8px;
}

.cassette-row .plate-image-upload {
  grid-column: 2 / -1;
}

.cassette-row .cassette-status-field,
.cassette-row .cassette-artifact-field {
  grid-column: 2;
}

.plate-attachment-preview {
  display: inline-block;
  width: 72px;
  height: 54px;
  margin: 6px 4px 0 0;
  border: 1px solid var(--border);
  object-fit: cover;
  background: #fff;
}

.cassette-row {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  display: grid;
  grid-template-columns: 34px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.cassette-row .mini-field {
  grid-column: auto;
  min-width: 0;
}

.cassette-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 800;
  grid-column: 1;
  grid-row: 1 / span 10;
  margin-top: 2px;
}

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

.qc-table.dose-table {
  width: 100%;
  min-width: 820px;
  table-layout: fixed;
}

.dose-col-structure {
  width: 15%;
}

.dose-col-incidence {
  width: 9%;
}

.dose-col-param {
  width: 11%;
}

.dose-col-factor,
.dose-col-result {
  width: 8%;
}

.qc-table.dose-table th,
.qc-table.dose-table td {
  padding: 7px 6px;
  vertical-align: middle;
}

.dose-structure {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dose-incidence {
  font-weight: 700;
}

.dose-field {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  outline: none;
}

.dose-field:focus {
  background: #eef4fb;
}

.calculated-cell {
  background: #f8fbff;
  font-weight: 800;
}

.nested-fieldset {
  flex: 1;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.nested-fieldset strong,
.qc-table-title {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.qc-table-block {
  display: grid;
  gap: 6px;
}

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

.qc-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 12px;
}

.qc-table th,
.qc-table td {
  border: 1px solid var(--border);
  padding: 6px;
  text-align: center;
}

.qc-table th {
  background: #eef4fb;
  color: var(--brand);
  font-weight: 800;
}

.qc-input {
  width: 100%;
  min-width: 64px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  outline: none;
}

.qc-input:focus {
  background: #eef4fb;
}

.qc-input[readonly] {
  color: var(--muted);
}

.qc-table input,
.qc-table select {
  min-height: 24px;
  padding: 2px 4px;
  border: 1px solid #9ca3af;
  border-radius: 2px;
  font-size: 12px;
}

.qc-table .mammography-dgm-field,
.qc-table .mammography-image-quality-field,
.qc-table .mammography-max-time-field {
  width: 72px;
  max-width: 72px;
}

.qc-table select.mammography-dgm-field,
.qc-table select.mammography-image-quality-field,
.qc-table select.mammography-max-time-field {
  width: 86px;
  max-width: 86px;
}

.qc-table .mammography-max-time-field[data-key="bucky"] {
  width: 110px;
  max-width: 110px;
}

.qc-table .mammography-max-time-field[data-key="pmma"],
.qc-table .mammography-max-time-field[data-key="time"],
.qc-table .mammography-max-time-field[data-key="fc"] {
  width: 58px;
  max-width: 58px;
}

.qc-table .mammography-dgm-field[data-key="observation"] {
  width: 110px;
  max-width: 110px;
}

.qc-table .mammography-dgm-field[data-key="pmma"],
.qc-table .mammography-dgm-field[data-key="kermaFc"],
.qc-table .mammography-dgm-field[data-key="csrFc"] {
  width: 58px;
  max-width: 58px;
}

.unit-cell {
  min-width: 120px;
  display: grid;
  grid-template-columns: minmax(48px, 1fr) minmax(64px, auto);
  align-items: center;
  gap: 4px;
}

.unit-cell .qc-input {
  min-width: 0;
}

.detector-dose-table {
  min-width: 1080px;
}

.distortion-block {
  margin-top: 8px;
}

.distortion-table {
  min-width: 620px;
}

.erase-param-grid {
  display: grid;
  gap: 10px;
}

.erase-cycle-table {
  min-width: 980px;
}

.status-btn,
.verdict-btn {
  flex: 1;
  min-height: 40px;
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.status-btn.ok.selected,
.verdict-btn.approved.selected {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.status-btn.nok.selected,
.verdict-btn.rejected.selected {
  border-color: var(--bad);
  background: var(--bad-bg);
  color: var(--bad);
}

.verdict-btn.restricted.selected,
.badge.restricted {
  border-color: var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
}

.badge {
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.nok {
  background: var(--bad-bg);
  color: var(--bad);
}

.summary-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.checklist-test-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 2px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  scrollbar-color: var(--border) transparent;
}

.checklist-test-tabs::before,
.checklist-test-tabs::after {
  content: "";
  flex: 0 0 var(--checklist-tabs-start-space, 0px);
}

.checklist-test-tabs::after {
  flex-basis: var(--checklist-tabs-end-space, 0px);
}

.checklist-test-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.checklist-test-tab:hover {
  border-color: var(--brand);
}

.checklist-test-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.checklist-test-tab-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dce9f7;
  color: var(--brand);
  font-size: 12px;
}

.checklist-test-tab.active .checklist-test-tab-number {
  background: #fff;
  color: var(--brand);
}

.offline-status-indicator {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 24px));
  padding: 8px 12px;
  border: 1px solid #a7c7ad;
  border-radius: 999px;
  background: #edf8ef;
  color: #246133;
  box-shadow: 0 6px 20px rgb(15 39 71 / 14%);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}

.offline-status-indicator.is-offline {
  border-color: #e3b35b;
  background: #fff7df;
  color: #805400;
}

.offline-status-indicator.is-syncing {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.offline-status-indicator.is-error {
  border-color: #d98282;
  background: #fff0f0;
  color: #8a1f1f;
}

.verdict-row {
  display: grid;
  gap: 8px;
}

.hidden {
  display: none;
}

@media (min-width: 900px) {
  body {
    background: var(--brand);
  }

  #app {
    width: min(100%, 1380px);
    background: transparent;
  }

  .topbar {
    border: 0;
    border-radius: 0;
    overflow: visible;
    padding: 10px 22px 0;
  }

  .nav {
    max-width: none;
    min-height: 72px;
    height: auto;
    padding: 3px 58px 3px 22px;
  }

  .shell-logo {
    width: clamp(260px, 24vw, 380px);
    height: 72px;
  }

  .shell-logo.company-shell-logo {
    width: clamp(220px, 20vw, 340px);
  }

  .shell-copy {
    gap: 6px;
  }

  .shell-copy strong {
    font-size: clamp(15px, 1.45vw, 20px);
  }

  .shell-copy span {
    font-size: clamp(12px, 1.2vw, 16px);
  }

  .meta {
    padding: 10px 20px;
    font-size: 13px;
  }

  .page {
    padding: 22px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
  }

  .panel,
  .summary-card,
  .test-card,
  .test-selection-list {
    grid-column: span 12;
  }

  .panel {
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
  }

  .page > form,
  .clinic-form,
  #clinicForm {
    grid-column: 1 / -1;
  }

  .page > form > .panel,
  .page > form > .summary-card,
  .clinic-form > .panel,
  .clinic-form > .summary-card {
    grid-column: 1 / -1;
  }

  #clinicForm > .clinic-extra-panel,
  .clinic-form > .clinic-extra-panel {
    grid-template-columns: minmax(0, 1fr) 180px 220px;
    gap: 18px;
    align-items: end;
  }

  .panel-title,
  .analysis-list,
  .selection-count,
  .panel > .actions-row {
    grid-column: 1 / -1;
  }

  .panel .field {
    margin-bottom: 12px;
  }

  .analysis-list,
  .equipment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / -1;
  }

  .modality-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-column: 1 / -1;
    max-width: none;
    margin: 0;
    gap: 14px 18px;
  }

  .modality-grid .equipment-card {
    grid-column: span 2;
    min-height: 118px;
    padding: 0 10px;
    grid-template-columns: 52% 1fr;
    gap: 4px;
    border-radius: 14px;
  }

  .modality-grid .equipment-card span:last-child {
    font-size: 14px;
    line-height: 1.2;
  }

  .modality-grid .modality-image {
    height: 108px;
  }

  .modality-grid .equipment-card:nth-child(7) {
    grid-column: span 2;
  }

  .modality-grid .equipment-card:nth-child(8) {
    grid-column: span 2;
  }

  .modality-grid .equipment-card:nth-child(9) {
    grid-column: span 2;
  }

  .modality-grid .equipment-card:nth-child(10) {
    grid-column: span 2;
  }

  .test-selection-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-card {
    padding: 18px;
  }

  .test-name {
    font-size: 15px;
  }

  .fields-row {
    gap: 12px;
  }

  .data-quadrant {
    padding: 14px;
  }

  .erase-param-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cassette-row {
    grid-template-columns: 34px repeat(3, minmax(0, 1fr));
    align-items: end;
  }

  .cassette-row .mini-field {
    grid-column: auto;
  }

  .cassette-row .plate-image-upload {
    grid-column: 2 / -1;
  }

  .cassette-row .cassette-status-field,
  .cassette-row .cassette-artifact-field {
    grid-column: 2;
  }

  .cassette-number {
    grid-column: 1;
    grid-row: 1 / span 10;
    align-self: start;
  }

  .qc-table.dose-table {
    min-width: 760px;
  }

  .dose-field {
    min-width: 0;
  }

  .verdict-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .actions-row {
    justify-content: flex-end;
  }

  .actions-row .primary,
  .actions-row .secondary {
    width: auto;
    min-width: 180px;
  }
}

@media (min-width: 1100px) {
  .test-card {
    grid-column: span 12;
  }

  .test-card:has(.dose-table-wrap),
  .test-card:has(.cassette-list),
  .summary-card {
    grid-column: span 12;
  }
}

@media (max-width: 900px) {
  .clinic-portal-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .clinic-portal-year-grid,
  .clinic-portal-report-grid,
  .clinic-portal-main-actions,
  .clinic-portal-equipment-grid,
  .clinic-portal-category-grid {
    grid-template-columns: 1fr;
  }

  .saved-item,
  .saved-item-finalized {
    grid-template-columns: 1fr;
  }

  .clinic-title-with-actions {
    grid-template-columns: 1fr;
  }

  .clinic-title-with-actions > span {
    display: none;
  }

  .compact-title-action,
  .compact-danger-action {
    justify-self: stretch;
  }

  .clinic-dashboard-actions-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .clinic-grid,
  .year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clinic-option-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .fields-row,
  .status-row,
  .actions-row {
    flex-direction: column;
  }

  .result-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .conclusion {
    width: fit-content;
  }
}

@media (max-width: 600px) {
  .shell-logo {
    width: clamp(128px, 38vw, 180px);
    height: 56px;
  }

  .shell-logo.company-shell-logo {
    width: clamp(150px, 42vw, 210px);
  }

  .clinic-grid,
  .year-grid,
  .clinic-field-grid,
  .clinic-extra-panel {
    grid-template-columns: 1fr;
  }

  .clinic-option-list {
    grid-template-columns: 1fr;
  }

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

  .modality-grid .equipment-card,
  .modality-grid .equipment-card:nth-child(7),
  .modality-grid .equipment-card:nth-child(8),
  .modality-grid .equipment-card:nth-child(9),
  .modality-grid .equipment-card:nth-child(10) {
    grid-column: 1;
  }
}

.save-success-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  padding: 12px 16px;
  border-radius: 8px;
  background: #087c3e;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}

.save-error-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 8px;
  background: #b42318;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}

.correction-factor-summary,
.correction-factor-group {
  grid-column: 1 / -1;
}

.home-correction-factor-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
}

.home-correction-factor-card .panel-title {
  grid-column: 1 / -1;
  margin: 0;
}

.home-correction-factor-card .primary {
  min-width: min(260px, 100%);
}

.home-configuration-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.correction-factor-intro,
.correction-factor-help {
  color: var(--report-muted, #4d5d70);
  margin: 4px 0 16px;
  line-height: 1.45;
}

.correction-factor-devices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  grid-column: 1 / -1;
}

.correction-factor-device {
  display: grid;
  gap: 14px;
}

.correction-factor-table {
  border: 1px solid var(--report-border, #b8c5d4);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.correction-factor-table legend {
  padding: 0 6px;
  font-weight: 700;
  color: var(--report-heading, #12385e);
}

.correction-factor-test-selector {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--report-primary, #1a3a5c);
  background: var(--report-soft, #e8eef5);
  border-radius: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.correction-factor-test-selector .field {
  margin-bottom: 4px;
  min-width: 0;
  max-width: 100%;
}

.correction-factor-test-selector .input,
.correction-factor-test-selector select {
  min-width: 0;
  max-width: 100%;
}

.maintenance-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 27, 45, .68);
}

.maintenance-report-dialog {
  width: min(720px, 100%);
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.maintenance-report-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.maintenance-report-heading h2,
.maintenance-report-heading p {
  margin: 0;
}

.maintenance-report-heading p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}

.maintenance-report-close {
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.maintenance-report-selection-actions,
.maintenance-report-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.maintenance-report-dialog-actions {
  justify-content: flex-end;
}

.maintenance-report-test-list {
  min-height: 90px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.maintenance-report-test-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.maintenance-report-test-option:last-child {
  border-bottom: 0;
}

.maintenance-report-test-option:hover {
  background: #f4f7fa;
}

.maintenance-report-test-name {
  min-width: 0;
  font-weight: 700;
}

.maintenance-report-test-status {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8eef5;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.maintenance-report-test-status.ok {
  background: #dcfce7;
  color: #166534;
}

.maintenance-report-test-status.nok {
  background: #ffedd5;
  color: #9a3412;
}

.maintenance-report-test-status.restricted {
  background: #fee2e2;
  color: #991b1b;
}

.maintenance-report-selection-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: #b42318;
  font-weight: 700;
}

@media (max-width: 600px) {
  .maintenance-report-overlay {
    padding: 10px;
  }

  .maintenance-report-dialog {
    max-height: 92vh;
    padding: 16px;
  }

  .maintenance-report-test-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .maintenance-report-test-status {
    grid-column: 2;
    justify-self: start;
  }
}
