:root {
  color-scheme: light;
  --ink: #0d1b2a;
  --muted: #5a6b80;
  --line: #d9e5f2;
  --soft: #f5f9fd;
  --blue: #0f6bff;
  --blue-dark: #074ab3;
  --teal: #0d9488;
  --white: #ffffff;
  --shadow: 0 18px 55px rgba(13, 27, 42, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--white);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 0 max(18px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar.compact {
  min-height: 62px;
}

.brand,
.navlinks,
.navcluster,
.top-search,
.actions,
.section-heading,
.filterbar,
.inline-form,
.quick-jump {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.site-brand {
  gap: 12px;
}

.brand-name {
  font-size: 20px;
  line-height: 1;
}

.brand-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 107, 255, 0.18);
}

.mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border-radius: 8px;
  font-size: 13px;
}

.navlinks {
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}

.nav-soon-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.nav-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #075b51;
  background: #dff8f4;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.navcluster {
  gap: 22px;
}

.top-search {
  flex-direction: row;
  justify-content: flex-end;
  gap: 8px;
  min-width: 40px;
}

.search-details {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
}

.search-details .search-input {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  opacity: 0;
  pointer-events: none;
  outline: 0;
  transition: flex-basis 180ms ease, width 180ms ease, padding 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.search-details[open] .search-input {
  flex-basis: 260px;
  width: 260px;
  padding: 0 12px;
  border-color: var(--line);
  opacity: 1;
  pointer-events: auto;
}

.search-toggle {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  flex: 0 0 40px;
  list-style: none;
}

.search-toggle::-webkit-details-marker {
  display: none;
}

.search-toggle span {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.search-toggle span::after {
  position: absolute;
  right: -7px;
  bottom: -5px;
  width: 8px;
  height: 2px;
  background: var(--blue);
  border-radius: 999px;
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.navlinks a,
.text-link {
  text-decoration: none;
}

.navlinks a:hover,
.text-link:hover {
  color: var(--blue);
}

.is-hidden {
  display: none !important;
}

.anchor-target {
  display: block;
  scroll-margin-top: 88px;
}

.hero {
  padding: 66px 0 42px;
}

.hero h1,
.page-title h1,
.detail h1,
.narrow h1 {
  margin: 0;
  color: var(--ink);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 820px;
  font-size: clamp(42px, 7vw, 78px);
}

.hero p,
.page-title p,
.detail p,
.narrow p {
  color: var(--muted);
  line-height: 1.65;
}

.hero p {
  max-width: 720px;
  font-size: 18px;
}

.hero-title {
  max-width: 980px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 5.4vw, 72px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.searchbar {
  display: flex;
  width: min(720px, 100%);
  min-height: 58px;
  margin-top: 28px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.searchbar input,
.filterbar input,
.filterbar select,
.field input,
.field select,
.field textarea,
.inline-form input,
td input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

.searchbar input {
  border: 0;
  padding: 0 16px;
  outline: 0;
}

.searchbar button,
.button,
.small-button {
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: var(--white);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.searchbar button {
  min-width: 116px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

.button:hover,
.searchbar button:hover,
.small-button:hover {
  background: var(--blue-dark);
}

.button.ghost {
  color: var(--blue);
  background: #eaf3ff;
}

.button.danger,
.small-button.danger {
  background: #c2410c;
}

.section-heading {
  justify-content: space-between;
  gap: 18px;
  margin: 30px 0 16px;
}

.section-heading.lead {
  margin-top: 44px;
}

.section-heading h2,
.region-strip h3,
.news-box h2,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.section-heading span,
.muted,
.news-box li span {
  color: var(--muted);
}

.category-panel,
.provider-home,
.panel,
.news-box,
.narrow,
.page-title {
  padding: 26px 0;
}

.policy-layout {
  display: grid;
  grid-template-columns: minmax(0, 820px);
  gap: 22px;
  padding: 4px 0 34px;
}

.policy-copy {
  display: grid;
  gap: 16px;
  color: #25364a;
  font-size: 16px;
  line-height: 1.7;
}

.policy-copy h2 {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.policy-copy p {
  margin: 0;
}

.policy-copy a:not(.button) {
  color: var(--blue);
  font-weight: 700;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover,
.tool-card:focus-within {
  border-color: var(--blue-dark);
  box-shadow: 0 14px 36px rgba(7, 74, 179, 0.12);
}

.tool-card h3 {
  margin: 14px 0 8px;
  font-size: 18px;
}

.logo-link {
  display: inline-flex;
  text-decoration: none;
}

.tool-card h3 a {
  text-decoration: none;
}

.tool-card p,
.description-link {
  display: block;
  min-height: 78px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-decoration: none;
}

.description-link:hover {
  color: var(--blue);
}

.logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.visit-link {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.logo.tiny {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.logo.large {
  width: 100px;
  height: 100px;
  border-radius: 12px;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.region-strip {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.mini-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.provider-mini {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.provider-mini span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-mini em,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #075b51;
  background: #dff8f4;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.page-title {
  max-width: 780px;
}

.page-title h1,
.detail h1,
.narrow h1 {
  font-size: clamp(34px, 5vw, 54px);
}

.filterbar {
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filterbar input,
.filterbar select {
  min-height: 42px;
  padding: 0 12px;
}

.admin-filterbar {
  align-items: stretch;
}

.admin-filterbar input {
  min-width: 240px;
}

.admin-filterbar .button {
  min-height: 42px;
}

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

.compact-table {
  margin-top: 16px;
}

.compact-table table {
  min-width: 920px;
}

.compact-table th,
.compact-table td {
  padding: 10px;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: var(--white);
}

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

th {
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
}

td {
  color: #25364a;
  font-size: 14px;
  line-height: 1.45;
}

.detail {
  display: grid;
  grid-template-columns: 120px minmax(0, 760px);
  gap: 26px;
  align-items: start;
  padding: 58px 0 24px;
}

.actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.brand-img {
  width: 100%;
  max-height: 340px;
  margin: 18px 0;
  object-fit: cover;
  border-radius: 8px;
}

.news-box ul {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.news-box li {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.news-title {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.news-title:hover {
  color: var(--blue);
}

.news-box li p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.inline-form input,
td input {
  min-height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 130px;
  padding: 12px;
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 6px;
  justify-items: stretch;
  align-items: start;
}

.check.option {
  min-height: 28px;
  justify-content: flex-start;
  gap: 7px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
}

.check.option input[type="checkbox"] {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  margin: 0;
}

.check.option span {
  min-width: 0;
}

.field small {
  color: var(--muted);
  font-weight: 500;
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  max-width: 360px;
  padding: 14px 16px;
  color: var(--white);
  background: #0f766e;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 750;
}

.auth-box {
  display: grid;
  gap: 16px;
  max-width: 420px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.success {
  border-top: 4px solid var(--teal);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.metric {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.metric strong {
  display: block;
  color: var(--blue);
  font-size: 36px;
}

.quick-jump {
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0 30px;
}

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

.row-actions {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.ok {
  color: #075b51;
  background: #dff8f4;
}

.status-pill.bad {
  color: #9a3412;
  background: #ffedd5;
}

.drag-handle {
  display: grid;
  gap: 3px;
  width: 34px;
  height: 34px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.drag-handle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
}

.drag-handle:active {
  cursor: grabbing;
}

.category-sort-table tr.is-dragging {
  opacity: 0.55;
  background: #eaf3ff;
}

.is-sorting-categories {
  cursor: grabbing;
  user-select: none;
}

.inline-form {
  gap: 10px;
  margin-bottom: 18px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
}

.danger-form {
  margin: 18px 0 40px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  padding: 44px 18px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .hero,
  .region-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  .hero {
    padding-top: 42px;
  }
}

@media (max-width: 720px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  .topbar,
  .navcluster,
  .navlinks,
  .filterbar,
  .detail,
  .form-grid,
  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    gap: 12px;
    justify-items: start;
    padding: 14px 12px;
  }

  .navlinks {
    gap: 10px;
  }

  .top-search {
    width: 100%;
  }

  .search-details[open] .search-input {
    flex-basis: 100%;
    width: 100%;
  }

  .hero h1 {
    font-size: 42px;
  }

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

}
