:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e0e7;
  --primary: #1769aa;
  --primary-dark: #0e4f86;
  --accent: #2f8f6b;
  --warning: #9a6b10;
  --shadow: 0 14px 40px rgba(22, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

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

.brand,
.nav a {
  color: var(--text);
  text-decoration: none;
}

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

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 0.94rem;
}

.hero {
  padding: 56px max(20px, calc((100vw - 1120px) / 2)) 26px;
}

.hero__content {
  max-width: 760px;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.16rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero__text {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: min(960px, calc(100% - 40px));
  margin: 18px auto 0;
}

.generator-panel,
.results-panel,
.info-section,
.ad {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.generator-panel,
.results-panel {
  padding: 20px;
}

.generator-panel {
  grid-column: 1 / -1;
}

.results-panel {
  grid-column: 1 / -1;
}

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

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(120px, 0.6fr) minmax(190px, 0.8fr);
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

select,
input[type="number"] {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

select:focus,
input:focus,
button:focus-visible {
  outline: 3px solid rgba(23, 105, 170, 0.22);
  outline-offset: 2px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  height: 44px;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

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

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.ghost-button {
  min-height: 36px;
}

.helper-text {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.result-count {
  min-width: 54px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

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

.address-card {
  display: grid;
  gap: 10px;
  min-height: 162px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.address-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.address-card__top strong {
  font-size: 0.92rem;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.84rem;
}

.address-lines {
  margin: 0;
  color: var(--text);
  font-style: normal;
  line-height: 1.7;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.info-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  width: min(1120px, calc(100% - 40px));
  margin: 18px auto 40px;
  padding: 22px;
}

.info-section p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.text-link {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  color: var(--primary-dark);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 34px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer span:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.content-page {
  width: min(880px, calc(100% - 40px));
  margin: 28px auto 48px;
}

.content-page--wide {
  width: min(1040px, calc(100% - 40px));
}

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

.content-card h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.content-card h2 {
  margin-top: 28px;
  margin-bottom: 10px;
}

.content-card p,
.content-card li {
  color: var(--muted);
  line-height: 1.75;
}

.content-card ul {
  padding-left: 22px;
}

.content-card a {
  color: var(--primary);
}

.guide-hub {
  padding: 0;
  overflow: hidden;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: 34px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff 0%, #eef3f7 100%);
}

.guide-hero h1 {
  margin-bottom: 12px;
}

.guide-hero p {
  max-width: 700px;
  margin-bottom: 0;
}

.guide-hero__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.guide-hero__action:hover {
  background: var(--primary-dark);
  color: #fff;
}

.guide-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 14px;
  padding: 22px 34px 8px;
}

.guide-feature a {
  color: var(--text);
  text-decoration: none;
}

.guide-feature__main,
.guide-feature__side a,
.guide-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.guide-feature__main:hover,
.guide-feature__side a:hover,
.guide-link:hover {
  border-color: rgba(23, 105, 170, 0.45);
  box-shadow: 0 12px 28px rgba(22, 32, 42, 0.08);
  transform: translateY(-1px);
}

.guide-feature__main {
  display: grid;
  gap: 12px;
  min-height: 210px;
  padding: 22px;
  align-content: end;
  background: #f9fbfc;
}

.guide-feature__main strong {
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.28;
}

.guide-feature__main span:last-child {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.65;
}

.guide-feature__side {
  display: grid;
  gap: 14px;
}

.guide-feature__side a {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.guide-feature__side strong {
  color: var(--text);
  line-height: 1.35;
}

.guide-feature__side span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.guide-tag,
.guide-link__label {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: rgba(47, 143, 107, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.guide-tag {
  padding: 7px 9px;
}

.guide-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 34px 0;
}

.guide-section-head h2 {
  margin: 0;
}

.guide-section-head p {
  max-width: 420px;
  margin: 0;
  text-align: right;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 34px 34px;
  margin-top: 0;
}

.guide-link {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  min-height: 174px;
  padding: 18px;
  text-decoration: none;
}

.guide-link strong {
  color: var(--text);
  line-height: 1.35;
}

.guide-link span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.guide-link__label {
  padding: 6px 8px;
}

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

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

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

th {
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.9rem;
}

td {
  color: var(--muted);
}

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

.notice {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

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

  .controls,
  .address-list,
  .info-section,
  .guide-feature,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .guide-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .guide-hero__action {
    width: fit-content;
  }

  .guide-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .guide-section-head p {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .hero {
    padding-top: 36px;
  }

  .layout,
  .info-section,
  .site-footer,
  .content-page {
    width: min(100% - 24px, 1120px);
  }

  .generator-panel,
  .results-panel,
  .info-section,
  .content-card {
    padding: 16px;
  }

  .guide-hub {
    padding: 0;
  }

  .guide-hero,
  .guide-feature,
  .guide-section-head,
  .guide-grid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .guide-hero {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .guide-grid {
    padding-bottom: 16px;
  }

  .panel-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }
}
