:root {
  color-scheme: light;
  --ink: #142b2f;
  --muted: #64777a;
  --surface: #ffffff;
  --canvas: #f4f7f4;
  --brand: #0d3b42;
  --brand-soft: #dceae7;
  --accent: #df6c3f;
  --accent-dark: #bd4e25;
  --border: #d9e2df;
  --success: #16705f;
  --success-bg: #e2f3ed;
  --danger: #a13e35;
  --danger-bg: #fbe9e6;
  --shadow: 0 18px 50px rgba(13, 59, 66, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(77, 143, 132, 0.12), transparent 25rem),
    var(--canvas);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--brand);
  border-radius: 0.5rem;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  color: white;
  background: var(--brand);
  border-radius: 0.8rem 0.8rem 0.8rem 0.25rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.api-link {
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
  text-underline-offset: 0.22rem;
}

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

.hero {
  padding: clamp(2.7rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(2.35rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.hero-description {
  margin: 1.25rem 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  line-height: 1.65;
}

.search-shell {
  position: relative;
  z-index: 10;
  max-width: 860px;
  margin-top: clamp(2rem, 5vw, 3.2rem);
}

.search-form {
  position: relative;
}

.search-form > label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  font-weight: 750;
}

.search-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-control:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(13, 59, 66, 0.12), var(--shadow);
}

.search-control svg,
.welcome-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-control svg {
  color: var(--muted);
}

.search-control input {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1.05rem;
}

.search-control input::placeholder {
  color: #8b9b9d;
}

.search-control button {
  min-height: 3.05rem;
  padding: 0 1.4rem;
  color: white;
  background: var(--accent);
  border: 0;
  border-radius: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.search-control button:hover {
  background: var(--accent-dark);
}

.search-control button:active {
  transform: translateY(1px);
}

.suggestions {
  position: absolute;
  top: calc(100% - 1.2rem);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 22rem;
  overflow-y: auto;
  padding: 1.55rem 0.5rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 20px 40px rgba(13, 59, 66, 0.13);
}

.suggestion {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  padding: 0.82rem 0.9rem;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0.65rem;
  cursor: pointer;
}

.suggestion:hover,
.suggestion[aria-selected="true"] {
  background: var(--brand-soft);
}

.suggestion-name {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-code {
  color: var(--brand);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.suggestion-address {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-hint {
  min-height: 1.3rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.content-area {
  padding-bottom: 5rem;
}

.welcome-state,
.error-state,
.loading-state {
  padding: clamp(2rem, 5vw, 4rem);
  background: rgba(255, 255, 255, 0.66);
  border: 1px dashed #bdcdca;
  border-radius: 1.25rem;
  text-align: center;
}

.welcome-state {
  max-width: 780px;
  margin: 0 auto;
}

.welcome-icon {
  width: 3.8rem;
  height: 3.8rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
}

.welcome-state h2,
.error-state strong {
  margin: 0;
  font-size: 1.25rem;
}

.welcome-state p,
.error-state p {
  margin: 0.55rem auto 0;
  max-width: 570px;
  color: var(--muted);
  line-height: 1.6;
}

.error-state {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #edc7c1;
}

.loading-state {
  text-align: left;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #e1e8e6;
  border-radius: 0.55rem;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.25s infinite;
}

.skeleton-title {
  width: 60%;
  height: 2.4rem;
}

.skeleton-line {
  width: 38%;
  height: 1rem;
  margin-top: 1rem;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.skeleton-card {
  height: 10rem;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.company-profile {
  display: grid;
  gap: 1.1rem;
  min-width: 0;
}

.profile-header {
  min-width: 0;
  padding: clamp(1.4rem, 4vw, 2.25rem);
  color: white;
  background: var(--brand);
  border-radius: 1.35rem;
  box-shadow: var(--shadow);
}

.profile-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.profile-kicker {
  margin: 0 0 0.5rem;
  color: #a8cbc5;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-header h2 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(1.55rem, 4vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.status-pill {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  color: #c9f4e8;
  background: rgba(58, 197, 155, 0.15);
  border: 1px solid rgba(137, 234, 205, 0.28);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.inactive {
  color: #ffd4cd;
  background: rgba(223, 108, 63, 0.16);
  border-color: rgba(255, 185, 162, 0.3);
}

.profile-meta {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.5rem;
  color: #d7e8e5;
  font-size: 0.9rem;
}

.profile-meta strong {
  color: white;
}

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

.summary-card,
.detail-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  box-shadow: 0 8px 30px rgba(13, 59, 66, 0.045);
}

.summary-card {
  min-height: 9.5rem;
  padding: 1.15rem;
}

.card-label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-value {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  font-weight: 780;
  line-height: 1.35;
}

.card-note {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.detail-card {
  padding: clamp(1.2rem, 3vw, 1.65rem);
}

.detail-card.full-width {
  grid-column: 1 / -1;
}

.detail-card h3 {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
}

.definition-list {
  display: grid;
  grid-template-columns: minmax(8rem, 0.7fr) minmax(0, 1.3fr);
  gap: 0;
  margin: 0;
}

.definition-list dt,
.definition-list dd {
  margin: 0;
  padding: 0.67rem 0;
  border-bottom: 1px solid #edf1ef;
  font-size: 0.9rem;
}

.definition-list dt {
  padding-right: 1rem;
  color: var(--muted);
}

.definition-list dd {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.definition-list dt:last-of-type,
.definition-list dd:last-of-type {
  border-bottom: 0;
}

.empty-value {
  color: #8b999b;
  font-weight: 500;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  padding: 0.38rem 0.62rem;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
}

.tag.muted {
  color: var(--muted);
  background: #edf1ef;
}

.data-table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #edf1ef;
}

.data-table th {
  color: var(--muted);
  background: #f7f9f8;
  font-size: 0.73rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.section-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  footer {
    width: min(100% - 1.25rem, 1180px);
  }

  .site-header {
    padding: 0.85rem 0;
  }

  .brand small,
  .api-link {
    display: none;
  }

  .hero {
    padding-top: 2.6rem;
  }

  h1 {
    max-width: 95%;
  }

  .search-control {
    grid-template-columns: auto minmax(0, 1fr);
    padding-right: 0.6rem;
  }

  .search-control button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .suggestions {
    top: calc(100% - 1.1rem);
  }

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

  .suggestion-code,
  .suggestion-address {
    grid-column: 1;
  }

  .profile-heading-row {
    display: grid;
  }

  .status-pill {
    justify-self: start;
  }

  .summary-grid,
  .details-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .detail-card.full-width {
    grid-column: auto;
  }

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

  .definition-list dt {
    padding-bottom: 0.15rem;
    border-bottom: 0;
  }

  .definition-list dd {
    padding-top: 0.15rem;
  }

  footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
