:root {
  color-scheme: light;
  --page: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --ink: #071226;
  --muted: #5e6878;
  --line: #d9e1ee;
  --field: #fbfcff;
  --blue: #1f5bff;
  --navy: #061333;
  --green: #0c8f62;
  --red: #c2362b;
  --amber: #a66b00;
  --teal: #087b8f;
  --shadow: 0 20px 55px rgba(8, 20, 43, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

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

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.shell,
.site-header-inner,
.site-footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid rgba(217, 225, 238, 0.9);
  background: rgba(255, 255, 255, 0.94);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  padding: 12px 0;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  display: block;
  width: min(260px, 54vw);
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a,
.api-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover,
.api-link:hover {
  border-color: #b7c5d9;
  color: var(--navy);
}

.hero-section {
  padding: 58px 0 52px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f7fc 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.72fr);
  gap: 34px;
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: 0;
}

h1 {
  max-width: 810px;
  font-size: 4.35rem;
}

h2 {
  font-size: 1.65rem;
}

.hero-text {
  max-width: 720px;
  margin: 20px 0 0;
  color: #435166;
  font-size: 1.16rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.hero-actions span,
.company-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  font-weight: 850;
  white-space: nowrap;
}

.lookup-panel,
.result-card,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lookup-panel {
  padding: 26px;
}

.panel-heading,
.result-topline,
.site-footer-inner,
.api-band {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading {
  margin-bottom: 22px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.status-pill.loading .status-dot {
  background: var(--amber);
}

.status-pill.error .status-dot {
  background: var(--red);
}

.lookup-form,
.form-grid,
.input-group {
  display: grid;
}

.form-grid {
  gap: 14px;
}

.input-group {
  gap: 8px;
}

.input-group span {
  color: #394559;
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 91, 255, 0.14);
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.submit-button:hover {
  background: #0c2052;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.submit-button svg,
.api-link svg {
  width: 19px;
  height: 19px;
}

.results-section,
.content-section,
.api-section {
  padding: 44px 0;
}

.results-section {
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 20px;
}

.section-heading p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 44px;
  height: 44px;
  color: var(--teal);
}

.empty-state p {
  margin: 12px 0 0;
}

.result-card {
  padding: 24px;
}

.hidden {
  display: none;
}

.result-topline {
  margin-bottom: 18px;
}

.result-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.found {
  background: #e7f6ee;
  color: var(--green);
}

.badge.manual {
  background: #fff4df;
  color: var(--amber);
}

.badge.not_found,
.badge.error {
  background: #fdeceb;
  color: var(--red);
}

.message {
  margin: 0 0 18px;
  color: #344054;
}

.field-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 0;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.image-card {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.image-card figcaption {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.field {
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.key-field {
  background: #ffffff;
  border-color: #c8d5e8;
}

.field dt {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.field dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 700;
}

.image-link {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100%;
}

.image-preview {
  display: block;
  width: min(100%, 290px);
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.source-row a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.source-row a:hover {
  text-decoration: underline;
}

.timestamp {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.company-grid span {
  min-height: 50px;
  white-space: normal;
  text-align: center;
}

.api-section {
  padding-top: 0;
}

.api-band {
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.api-band .eyebrow {
  color: #78a4ff;
}

.api-band h2 {
  color: #ffffff;
}

.api-link {
  border-color: rgba(255, 255, 255, 0.24);
  background: #ffffff;
  color: var(--navy);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.site-footer-inner {
  align-items: center;
  min-height: 96px;
  padding: 22px 0;
  color: #596171;
  font-size: 0.9rem;
}

.footer-brand img {
  display: block;
  width: 190px;
  height: auto;
}

.footer-copy {
  display: grid;
  gap: 5px;
  text-align: right;
}

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

  h1 {
    font-size: 3.2rem;
  }

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

@media (max-width: 680px) {
  .shell,
  .site-header-inner,
  .site-footer-inner {
    width: min(100% - 22px, 1180px);
  }

  .site-header-inner,
  .site-footer-inner,
  .api-band,
  .result-topline,
  .source-row {
    flex-direction: column;
    align-items: stretch;
  }

  .brand img {
    width: min(230px, 82vw);
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a {
    flex: 1;
  }

  .hero-section {
    padding: 34px 0 36px;
  }

  h1 {
    font-size: 2.45rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .hero-text {
    font-size: 1rem;
  }

  .lookup-panel,
  .result-card,
  .api-band {
    padding: 18px;
  }

  .panel-heading {
    flex-direction: column;
  }

  .company-grid,
  .field-list {
    grid-template-columns: 1fr;
  }

  .footer-copy {
    text-align: left;
  }
}
