:root {
  color-scheme: light;
  --background: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef2f5;
  --text: #18212a;
  --muted: #5f6e7c;
  --line: #d9e0e7;
  --green: #16803c;
  --red: #b42318;
  --amber: #f2c94c;
  --accent: #2454a6;
  --shadow: 0 12px 30px rgba(24, 33, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.shell {
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 10px;
}

.title-block {
  min-width: 0;
}

.total-summary {
  display: flex;
  justify-content: end;
  align-items: center;
  flex: 1 1 auto;
  order: 2;
  margin: 20px 0 4px;
}

.total-counter-strip {
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
}

.total-counter-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

:root:not(.show-extra-details) .total-counter-details {
  display: none;
}

.total-counter-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  white-space: nowrap;
}

.total-counter-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.total-counter-item > .summary-count {
  order: 0;
}

.total-counter-item.invalid-domain-item {
  order: 30;
}

.total-counter-item.missing-website-item {
  order: 20;
}

.total-counter-item.is-empty {
  display: none;
}

.total-counter-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
}

.table-search {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex: 1 1 auto;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 14px;
}

.info-column {
  padding: 0;
  background: transparent;
}

.nested-info-dropdown {
  margin: 0 14px 14px;
  box-shadow: none;
}

.table-search input {
  width: min(520px, 100%);
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.table-search input:focus,
.data-download-link:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(36, 84, 166, 0.18);
  outline-offset: 1px;
}

.slider-toggle-group {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  flex: 0 0 auto;
}

.slider-toggle-caption {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.slider-toggle {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 0;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.slider-toggle:hover {
  background: transparent;
}

.slider-toggle:focus-visible {
  outline: none;
}

.slider-toggle:focus-visible .slider-toggle-track {
  outline: 2px solid rgba(36, 84, 166, 0.28);
  outline-offset: 2px;
}

.slider-toggle-track {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border-radius: 999px;
  background: #b8c2cc;
  transition: background 0.16s ease;
}

.slider-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 33, 42, 0.28);
  transition: transform 0.16s ease;
}

.slider-toggle[aria-checked="true"] .slider-toggle-track {
  background: var(--green);
}

.slider-toggle[aria-checked="true"] .slider-toggle-thumb {
  transform: translateX(18px);
}

.data-download-link {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
}

.data-download-link:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
}

.summary-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.table-dropdown summary .summary-text {
  order: 2;
  margin-left: auto;
}

.summary-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.summary-count.available {
  background: var(--green);
}

.summary-count.broken {
  background: var(--amber);
  color: #18212a;
}

.summary-count.unavailable {
  background: var(--red);
}

.summary-count.is-empty {
  visibility: hidden;
}

.summary-count.invalid-domain-count {
  order: 30;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-decoration-line: line-through;
  text-decoration-color: #000;
  text-decoration-thickness: 3px;
  text-decoration-skip-ink: none;
}

:root:not(.show-extra-details) .email-summary-count {
  display: none;
}

:root:not(.show-extra-details) .slow-response,
:root:not(.show-extra-details) .slow-response-count {
  display: none;
}

:root:not(.show-extra-details) .invalid-domain-count {
  display: none;
}

:root:not(.show-extra-details) .total-counter-item.invalid-domain-item {
  display: none;
}

:root:not(.show-extra-details) .current-counter-label {
  display: none;
}

.summary-count.missing-website-count {
  order: 20;
  background: var(--muted);
  color: #fff;
}

.summary-count.slow-response-count {
  order: 35;
  min-width: auto;
  padding: 0 8px;
  background: #fff3c4;
  color: #5c4400;
}

.total-counter-item > .summary-count.missing-website-count {
  order: 0;
}

.table-dropdown .summary-count.invalid-domain-count.is-empty {
  visibility: hidden;
}

.current-counter-label {
  order: -40;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  white-space: nowrap;
}

.counter-row-break {
  display: none;
  order: -11;
}

.email-summary-count {
  order: 40;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.email-summary-count.missing {
  order: 40;
}

.email-summary-count::before {
  content: "✉";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
  opacity: 0.5;
  transform: translateY(-2px);
}

.email-summary-count > span {
  position: relative;
  z-index: 1;
}

.email-summary-count.available::before {
  color: var(--green);
}

.email-summary-count.available > span {
  color: var(--green);
}

.email-summary-count.broken::before {
  color: #b7791f;
}

.email-summary-count.broken > span {
  color: #b7791f;
}

.email-summary-count.unavailable::before {
  color: var(--red);
}

.email-summary-count.unavailable > span {
  color: var(--red);
}

.email-summary-count.missing::before {
  color: #000;
}

.email-summary-count.missing > span {
  color: #000;
}

.email-summary-count.is-empty {
  visibility: hidden;
}

.table-dropdown .summary-count.invalid-domain-count {
  order: -30;
}

.table-dropdown .summary-count.slow-response-count {
  order: -20;
}

.table-dropdown .email-summary-count {
  order: -10;
}

.table-dropdown .email-summary-count.missing {
  order: -10;
}

.table-dropdown {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.table-dropdown + .table-dropdown {
  margin-top: 12px;
}

.info-dropdown {
  order: 1;
}

.info-dropdown > summary {
  justify-content: center;
}

.info-dropdown > summary > .dropdown-title {
  flex: 0 1 auto;
  text-align: center;
}

.table-search {
  order: 2;
}

.early-table-note {
  order: 3;
  margin: 24px 0 12px;
  color: var(--muted);
  font-weight: 700;
}

.executive-power-dropdown {
  order: 4;
}

.public-enterprises-dropdown {
  order: 5;
}

.education-dropdown {
  order: 6;
}

.crawled-dropdown {
  order: 7;
}

.museums-dropdown {
  order: 8;
}

.late-table-note {
  order: 9;
  margin: 24px 0 12px;
  color: var(--muted);
  font-weight: 700;
}

.judicial-power-dropdown {
  order: 10;
}

.legislative-power-dropdown {
  order: 11;
}

.shell > .table-dropdown:not(.info-dropdown) {
  margin-top: 12px;
}

.municipalities-dropdown {
  margin-top: 12px;
}

.nested-table-group {
  padding: 12px 12px 12px 24px;
}

.nested-table-group .table-dropdown {
  box-shadow: none;
}

.nested-table-group .table-dropdown + .table-dropdown {
  margin-top: 12px;
}

.table-dropdown summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.table-dropdown summary::-webkit-details-marker {
  display: none;
}

.table-dropdown summary::before {
  content: "▸";
  display: inline-block;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.table-dropdown[open] summary::before {
  transform: rotate(90deg);
}

.dropdown-title {
  flex: 0 0 auto;
}

.target-domain-label {
  color: var(--muted);
  font-size: 0.92em;
  font-weight: 600;
}

.title-link {
  display: inline;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.title-link:hover {
  color: #1f6bb3;
  text-decoration: underline;
}

.table-dropdown[open] summary {
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow: auto;
  background: var(--surface);
}

.legal-content {
  padding: 14px;
  background: var(--surface);
}

.legal-content p {
  max-width: 900px;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.legal-content h2,
.legal-content h3,
.legal-content h4 {
  max-width: 900px;
  margin: 0 0 12px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
}

.legal-content p + p {
  margin-top: 12px;
}

.legal-content blockquote {
  max-width: 900px;
  margin: 0;
  padding: 10px 14px;
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.legal-content p + blockquote,
.legal-content blockquote + p,
.legal-content blockquote + blockquote {
  margin-top: 12px;
}

.legal-content ol,
.legal-content ul {
  max-width: 900px;
  margin: 8px 0 0;
  padding-left: 22px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.legal-content li + li {
  margin-top: 4px;
}

.legal-content.info-column h2,
.legal-content.info-column h3,
.legal-content.info-column h4 {
  margin: 0;
  line-height: 1.2;
}

.legal-content.info-column h2:not(:first-child),
.legal-content.info-column h3:not(:first-child),
.legal-content.info-column h4:not(:first-child) {
  margin-top: 14px;
}

.legal-content.info-column p,
.legal-content.info-column blockquote,
.legal-content.info-column ol,
.legal-content.info-column ul {
  margin: 0;
  line-height: 1.28;
}

.legal-content.info-column p + blockquote,
.legal-content.info-column blockquote + p,
.legal-content.info-column blockquote + blockquote {
  margin-top: 8px;
}

.legal-content.info-column ol,
.legal-content.info-column ul {
  padding-left: 18px;
}

.legal-content.info-column li + li {
  margin-top: 2px;
}

.legal-content.info-column .tick-list {
  list-style: "✅ ";
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

thead {
  display: none;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f8fbff;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.domain-link {
  overflow-wrap: anywhere;
}

.slow-response {
  flex: 0 0 auto;
  margin-left: 5px;
  font-size: 15px;
  line-height: 1;
}

.status-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.status-icon.available {
  background: var(--green);
}

.status-icon.unavailable {
  background: var(--red);
}

.status-icon.broken {
  background: var(--amber);
  color: #18212a;
}

.status-icon.unknown {
  background: var(--amber);
  color: #18212a;
}

.domain-link.available {
  color: var(--green);
}

.domain-link.available.muted-status {
  color: var(--text);
}

.domain-link.unavailable {
  color: var(--red);
}

.domain-link.broken,
.domain-link.unknown {
  color: #8a6a00;
}

.invalid-domain-suffix {
  color: inherit;
  text-decoration-line: line-through;
  text-decoration-color: #000;
  text-decoration-thickness: 1px;
  text-decoration-skip-ink: none;
}

.email-icon {
  display: inline-grid;
  place-items: center;
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: var(--muted);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}

.email-icon.available {
  color: var(--green);
}

.email-icon.unavailable {
  color: var(--red);
}

.email-icon.missing {
  color: #000;
  cursor: default;
}

.email-icon.missing::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background: #000;
  transform: rotate(-45deg);
}

.email-icon.broken,
.email-icon.unknown {
  color: #8a6a00;
}

.muted-status {
  opacity: 0.5;
}

.metadata-text {
  color: var(--text);
  overflow-wrap: anywhere;
}

.agency-ready {
  color: #0b5d2a;
  font-weight: 700;
}

.agency-broken {
  color: #8a6a00;
  font-weight: 700;
}

#ministryRows .agency-ready,
#ministryRows .agency-broken {
  font-weight: 400;
}

.domain-cell {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: 100%;
}

.column-arrow {
  flex: 0 0 auto;
  margin-right: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.75;
}

.status-tooltip {
  position: fixed;
  z-index: 20;
  max-width: min(320px, calc(100vw - 20px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #18212a;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty {
  padding: 32px 14px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 32px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  color: var(--muted);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    margin: 20px auto;
  }

  .page-header {
    display: grid;
    gap: 14px;
  }

  .total-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .table-search {
    width: 100%;
  }

  .total-summary-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .total-summary-row > :first-child {
    flex-basis: auto;
    text-align: left;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .table-dropdown summary {
    display: flex;
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 12px;
  }

  h1 {
    font-size: 24px;
  }

.dropdown-title {
  min-width: 0;
}

.summary-text {
  flex-wrap: wrap;
  gap: 5px;
}

  .table-dropdown summary .summary-text {
    flex: 0 0 calc(100% - 28px);
    margin-left: 28px;
  }

  .total-counter-strip {
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .total-counter-row {
    justify-content: flex-start;
  }

  .table-search input {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }

  .counter-row-break {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    height: 0;
  }

  .summary-text .status-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    font-size: 12px;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  tbody {
    width: 100%;
  }

  tbody,
  tr,
  td {
    display: block;
  }

  tbody tr {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:hover {
    background: transparent;
  }

  td {
    display: block;
    padding: 5px 12px;
    border-bottom: 0;
    font-size: 14px;
  }

  td::before {
    content: none;
  }

  .empty {
    display: block;
    padding: 28px 12px;
  }

  .empty::before {
    content: none;
  }

  .column-arrow {
    display: none;
  }
}
