:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #182230;
  --muted: #667085;
  --line: #dfe3e8;
  --line-strong: #c9d0d9;
  --accent: #1769e0;
  --accent-soft: #edf4ff;
  --success: #16834a;
  --success-soft: #eaf8f0;
  --warning: #9a6700;
  --warning-soft: #fff6dd;
  --danger: #bd2c2c;
  --danger-soft: #fff0f0;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "Noto Sans TC", "Noto Sans Hebrew", "Noto Sans", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

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

.app-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--text);
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

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

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions,
.bulk-actions,
.results-heading > div,
.panel-heading > div {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 16px;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.text-button,
.icon-button,
.secondary-button,
.copy-field-button,
.map-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.text-button {
  min-width: 42px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 700;
}

.hero {
  padding: 70px 0 40px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.hero-copy {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.generator-panel,
.result-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.generator-panel {
  padding: 26px;
  border-radius: 16px;
}

.panel-heading,
.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.panel-heading h2,
.results-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.step-label {
  margin-right: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.field-group {
  min-width: 0;
}

.field-label {
  display: block;
  margin-bottom: 9px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.country-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.country-option {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.country-option:hover {
  border-color: var(--line-strong);
  background: #fafbfc;
}

.country-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.flag {
  width: 34px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  color: #475467;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.country-option strong,
.country-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-option strong {
  font-size: 14px;
}

.country-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.check {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: transparent;
  font-size: 11px;
}

.country-option.active .check {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr 0.62fr 1fr;
  align-items: end;
  gap: 18px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.segmented,
.quantity-control {
  height: 44px;
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f8fa;
}

.select-control {
  height: 44px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.select-control select {
  width: 100%;
  height: 100%;
  padding: 0 34px 0 12px;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.select-control span {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-55%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.select-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.14);
}

.segment {
  flex: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.segment.active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

.quantity-control {
  width: 154px;
  background: white;
}

.quantity-control button {
  width: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.quantity-control input {
  width: 66px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  font-weight: 750;
  appearance: textfield;
}

.quantity-control input::-webkit-inner-spin-button,
.quantity-control input::-webkit-outer-spin-button {
  appearance: none;
}

.primary-button {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid #0f5ecf;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  font-weight: 750;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.primary-button:hover {
  background: #0f5ecf;
}

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

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary-button svg,
.secondary-button svg,
.validation-notice svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

kbd {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 10px;
}

.results-section {
  padding: 48px 0 28px;
}

.results-heading {
  margin-bottom: 16px;
}

.result-count {
  margin-left: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e9edf2;
  color: #475467;
  font-size: 11px;
  font-weight: 750;
}

.bulk-actions {
  gap: 8px;
}

.secondary-button,
.icon-button {
  height: 38px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
}

.secondary-button:hover,
.icon-button:hover,
.copy-field-button:hover,
.map-button:hover {
  border-color: var(--line-strong);
  background: #f8fafc;
}

.secondary-button:disabled,
.map-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary-button svg {
  width: 16px;
  height: 16px;
}

.icon-button {
  min-width: 48px;
  padding: 0 9px;
}

.validation-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #d8e6fa;
  border-radius: 9px;
  background: #f5f9ff;
  color: #44546a;
  font-size: 12px;
}

.validation-notice svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--accent);
}

.validation-notice p {
  margin: 0;
}

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

.empty-state {
  padding: 52px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  margin-bottom: 5px;
  color: var(--text);
}

.result-card {
  overflow: hidden;
  border-radius: var(--radius);
}

.result-card-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.result-card-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.record-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.country-tag {
  padding: 3px 8px;
  border-radius: 5px;
  background: #eef1f5;
  color: #344054;
  font-size: 11px;
  font-weight: 750;
}

.verification-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.verification-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.verification-status.checking {
  background: var(--accent-soft);
  color: var(--accent);
}

.verification-status.verified {
  background: var(--success-soft);
  color: var(--success);
}

.verification-status.partial {
  background: var(--warning-soft);
  color: var(--warning);
}

.verification-status.failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.result-card-body {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
}

.address-block {
  padding: 20px;
  border-right: 1px solid var(--line);
}

.identity-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.data-field {
  min-width: 0;
  position: relative;
  padding: 15px 46px 15px 17px;
  border-bottom: 1px solid var(--line);
}

.data-field:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.data-field:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.data-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.address-value {
  min-height: 58px;
  margin-bottom: 14px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
}

.address-details {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.address-detail {
  min-width: 0;
  padding: 9px 11px;
  border-right: 1px solid var(--line);
}

.address-detail:last-child {
  border-right: 0;
}

.address-detail span,
.address-detail strong {
  display: block;
}

.address-detail span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.address-detail strong {
  overflow: hidden;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-field-button {
  width: 28px;
  height: 28px;
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 6px;
}

.copy-field-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

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

.card-actions-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-button {
  height: 34px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.map-link {
  display: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.map-link.visible {
  display: inline;
}

.map-link:hover {
  text-decoration: underline;
}

.verification-detail {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-tag {
  flex: 0 0 auto;
  color: #98a2b3;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

footer p {
  margin: 0;
}

footer a {
  color: inherit;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: min(440px, calc(100% - 32px));
  padding: 10px 14px;
  transform: translate(-50%, 20px);
  border: 1px solid #27364a;
  border-radius: 8px;
  background: #17202e;
  color: white;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 850px) {
  .country-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-row {
    grid-template-columns: 1fr 1fr;
  }

  .primary-button {
    grid-column: 1 / -1;
  }

  .result-card-body {
    grid-template-columns: 1fr;
  }

  .address-block {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 580px) {
  .app-shell {
    width: min(100% - 24px, 1120px);
  }

  .site-header {
    min-height: 66px;
  }

  .local-badge {
    display: none;
  }

  .hero {
    padding: 46px 0 30px;
  }

  h1 {
    font-size: 36px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .generator-panel {
    padding: 18px;
  }

  .panel-heading p {
    display: none;
  }

  .country-options {
    grid-template-columns: 1fr 1fr;
  }

  .country-option {
    min-height: 65px;
    grid-template-columns: auto 1fr;
  }

  .country-option .check {
    display: none;
  }

  .settings-row {
    grid-template-columns: 1fr;
  }

  .quantity-control {
    width: 100%;
  }

  .quantity-control input {
    flex: 1;
  }

  .primary-button {
    grid-column: auto;
  }

  .results-heading {
    align-items: flex-start;
    gap: 14px;
  }

  .bulk-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .identity-block {
    grid-template-columns: 1fr;
  }

  .address-details {
    grid-template-columns: 1fr 1fr;
  }

  .address-detail:first-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .address-detail:nth-child(2) {
    border-right: 1px solid var(--line);
  }

  .data-field,
  .data-field:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .data-field:last-child {
    border-bottom: 0;
  }

  .card-actions {
    align-items: flex-start;
  }

  .card-actions-left {
    flex-wrap: wrap;
  }

  .verification-detail {
    width: 100%;
    white-space: normal;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
