:root {
  color-scheme: light;
  --ink: #18202f;
  --muted: #657184;
  --line: #dfe5ee;
  --paper: #ffffff;
  --wash: #f5f7fb;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #b91c1c;
  --green: #15803d;
  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;
  color: var(--ink);
  background: var(--wash);
}

a { color: inherit; }

button, textarea, input { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 32px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  letter-spacing: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: end;
  padding: 56px 0 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.lede {
  max-width: 780px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.text-cta {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #9bd3cd;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #eefdfa;
  font-weight: 750;
  text-decoration: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.45fr) minmax(240px, 0.58fr);
  gap: 18px;
  align-items: start;
  margin: 18px 0 38px;
}

.workspace > *,
.tool-panel,
.results-panel,
.side-cta {
  min-width: 0;
}

.tool-panel, .results-panel, .context-card, .side-cta, .guide-card, .state-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.tool-panel, .results-panel, .side-cta {
  padding: 18px;
}

.tool-panel, .side-cta {
  align-self: start;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-title h2 {
  margin: 0;
  font-size: 22px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

label {
  color: #30394a;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 220px;
  margin: 8px 0;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  resize: vertical;
  line-height: 1.5;
}

textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.hint {
  min-height: 40px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.hint.error { color: var(--red); }

.record-types {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.record-types label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcff;
  font-size: 14px;
}

.actions, .result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1f2937;
  background: #fff;
  font-weight: 750;
  cursor: pointer;
}

button:hover, .clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.1);
}

button:disabled {
  opacity: 0.58;
  cursor: wait;
}

button.primary {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.history {
  margin-top: 18px;
}

.history h3 {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

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

.history-list button {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  font-size: 13px;
}

.state-box {
  padding: 28px;
  text-align: center;
}

.state-box p {
  margin: 8px auto 0;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.55;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border: 4px solid #dbeafe;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf2f7;
  color: #475569;
  font-weight: 750;
}

.status-pill.success { color: var(--green); background: #ecfdf3; }
.status-pill.partial { color: var(--amber); background: #fff7ed; }
.status-pill.error { color: var(--red); background: #fef2f2; }

.result-actions {
  margin-bottom: 12px;
}

#result-summary {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

td code {
  display: block;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-cta {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.context-card, .side-cta, .guide-card, .article-card {
  display: block;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.context-card,
.guide-card,
.side-cta {
  padding: 0;
  background: transparent;
  border: 0;
}

.card-link {
  display: block;
  width: 100%;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}

.rail-cta {
  margin-top: 16px;
}

.ad-stack {
  display: grid;
  gap: 14px;
}

.ad-card {
  position: relative;
  display: block;
  min-height: 100%;
  padding: 18px;
  border: 1px solid #7dd3c7;
  border-radius: 8px;
  color: inherit;
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.96), rgba(255, 255, 255, 0.98)),
    #fff;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(15, 118, 110, 0.12);
}

.ad-card::after {
  content: "Visit";
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.ad-card:hover,
.article-card:hover {
  border-color: var(--accent);
}

.ad-card:hover .card-title,
.article-card:hover .card-title {
  color: var(--accent-dark);
}

.sponsor-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin-bottom: 10px;
  padding: 0 8px;
  border-radius: 999px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.card-arrow {
  display: inline-block;
  margin-top: 8px;
  margin-bottom: 34px;
  color: var(--accent-dark);
  font-weight: 850;
}

.context-card {
  min-height: 230px;
}

.card-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.card-title {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 850;
}

.card-summary {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.tag-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(250px, 0.7fr);
  gap: 24px;
  margin: 42px 0;
  align-items: start;
}

.content-grid article, .faq, .articles {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.content-grid p, .faq p, .section-heading p {
  color: var(--muted);
  line-height: 1.68;
}

.faq {
  margin-bottom: 34px;
}

details {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

summary {
  font-weight: 800;
  cursor: pointer;
}

.articles {
  margin-bottom: 44px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.article-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.privacy-note {
  margin: 0 0 34px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.privacy-note h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.privacy-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.legal-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.legal-grid h3 {
  margin-bottom: 8px;
}

footer {
  padding: 34px clamp(16px, 4vw, 48px) 22px;
  border-top: 1px solid var(--line);
  background: #111827;
  color: #f8fafc;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 0.7fr));
  gap: 24px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.footer-brand p,
footer p {
  max-width: 460px;
  margin: 8px 0 0;
  color: #cbd5e1;
  line-height: 1.55;
}

footer h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
}

footer a {
  display: block;
  margin: 8px 0;
  color: #dbeafe;
  font-size: 14px;
  text-decoration: none;
}

footer a:hover {
  color: #99f6e4;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, 100%);
  margin: 26px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(226, 232, 240, 0.18);
  color: #cbd5e1;
  font-size: 13px;
}

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

  .side-cta {
    grid-column: 1 / -1;
  }

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

  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .site-header, .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    position: static;
  }

  .site-header nav {
    width: 100%;
  }

  .site-header nav a {
    overflow-wrap: anywhere;
  }

  .hero, .workspace, .content-grid, .card-grid, .footer-grid, .legal-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 34px;
  }

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

  .tool-panel, .results-panel, .content-grid article, .faq, .articles {
    padding: 16px;
  }

  nav {
    gap: 12px;
  }
}
