:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #14b8a6;
  --primary-strong: #0f766e;
  --accent: #2563eb;
  --success: #1f7a4c;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 30px rgba(20, 184, 166, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.14), transparent 28rem),
    radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.10), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

html {
  scroll-padding-top: 82px;
}

button,
select,
input {
  font: inherit;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  display: block;
}

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

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 650;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-links a:hover {
  color: var(--primary);
  background: rgba(15, 23, 42, 0.04);
}

.language-menu {
  position: relative;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
  transition: background-color 160ms ease, color 160ms ease;
}

.language-trigger:hover,
.language-menu.open .language-trigger {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text);
}

.language-code {
  font-size: 0.82rem;
}

.language-chevron {
  color: #94a3b8;
  transition: transform 160ms ease;
}

.language-menu.open .language-chevron {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: 148px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 5px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96) translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.language-menu.open .language-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.language-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.language-option:hover {
  background: var(--surface-soft);
}

.language-option.active {
  background: rgba(20, 184, 166, 0.12);
  color: var(--primary-strong);
  font-weight: 800;
}

.language-check {
  margin-left: auto;
  color: var(--primary-strong);
  opacity: 0;
}

.language-option.active .language-check {
  opacity: 1;
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 20px 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 28px;
  align-items: start;
}

.hero-copy {
  padding-top: 14px;
}

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

h1 {
  margin: 10px 0 14px;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.quick-actions {
  margin-top: 18px;
  margin-bottom: 18px;
}

.button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 15px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}

.button:hover {
  filter: brightness(0.96);
}

.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.button.secondary:hover {
  background: var(--surface-soft);
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  scroll-margin-top: 92px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  margin-bottom: 16px;
}

.field label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.field select,
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  min-height: 44px;
}

.native-select-hidden {
  display: none;
}

.searchable-select {
  position: relative;
}

.select-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  font-size: 0.95rem;
}

.searchable-select.open .select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.20);
}

.select-value {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-icon {
  color: #94a3b8;
  transition: transform 160ms ease;
}

.searchable-select.open .select-icon {
  transform: rotate(180deg);
}

.select-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 25;
  overflow: hidden;
  min-width: 200px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.searchable-select.open .select-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.select-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 12px;
}

.select-search-icon {
  color: #94a3b8;
}

.select-search-input {
  min-height: 28px;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  padding: 0;
}

.select-options {
  max-height: 320px;
  overflow-y: auto;
  padding: 5px;
}

.select-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #374151;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.92rem;
  text-align: left;
  transition: background-color 150ms ease, color 150ms ease;
}

.select-option:hover,
.select-option.focused {
  background: #f9fafb;
}

.select-option.selected {
  background: rgba(20, 184, 166, 0.12);
  color: var(--primary-strong);
  font-weight: 800;
}

.select-empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  overflow: hidden;
}

.result-main {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.result-main .address {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.result-main .meta {
  color: var(--muted);
  margin: 0;
}

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

.result-item {
  padding: 13px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-item:nth-child(2n) {
  border-right: 0;
}

.result-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.result-item strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.result-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}

.result-value strong {
  min-width: 0;
}

.main-address-value {
  align-items: flex-start;
  margin-top: 0;
  margin-bottom: 6px;
}

.main-address-value .address {
  min-width: 0;
}

.copy-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.copy-icon:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: rgba(20, 184, 166, 0.08);
}

.batch {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.batch-row {
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.content-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px;
}

.section-heading {
  margin: 0 0 14px;
  font-size: 1.55rem;
}

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

.states-search {
  margin: 16px 0 14px;
  max-width: 420px;
}

.states-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
}

.state-link.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.state-link,
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.state-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
}

.state-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.feature p,
.content-section p {
  color: var(--muted);
}

.faq-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.faq-card .faq-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.faq-card .faq-item + .faq-item {
  margin-top: 12px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 8px 0 0;
}

.disclaimer {
  background: #fff8ed;
  border: 1px solid #f0d1a5;
  border-radius: 14px;
  padding: 16px;
}

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 44px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--primary-strong);
  font-weight: 750;
  text-decoration: none;
}

.policy-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 20px 64px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.history-actions {
  margin: 18px 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.history-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.history-address {
  margin: 0;
  font-weight: 800;
}

.history-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-empty {
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 34px 18px;
}

.policy-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.policy-section + .policy-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--text);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 28px;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .language-dropdown {
    left: 0;
    right: auto;
  }

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

}

@media (max-width: 560px) {
  .controls,
  .result-grid,
  .state-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .result-item {
    border-right: 0;
  }
}
