:root {
  color-scheme: light;
  --ink: #172b22;
  --muted: #505f56;
  --paper: #f8faf5;
  --white: #fff;
  --line: #dbe5d9;
  --forest: #245d42;
  --green-dark: #194831;
  --soft: #eff5ea;
  --orange: #ae542e;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--font); }
a { color: var(--forest); }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #477f62; outline-offset: 4px; }
.sr-only, .clipboard-fallback { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; z-index: 5; left: 1rem; top: 1rem; padding: .75rem 1rem; background: var(--white); transform: translateY(-180%); }
.skip:focus { transform: none; }
.shell { width: min(1100px, 100% - 3.5rem); margin-inline: auto; }
.narrow { width: min(850px, 100% - 3.5rem); }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner, .footer-inner { min-height: 69px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-size: 1.25rem; line-height: 1; letter-spacing: -.05em; font-weight: 790; text-decoration: none; white-space: nowrap; }
.brand-accent { color: var(--forest); }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; column-gap: 2rem; row-gap: .4rem; justify-content: flex-end; }
.site-header nav a, .site-footer nav a { color: var(--muted); font-size: .9rem; font-weight: 600; text-decoration: none; }
.site-header nav a:hover, .site-footer nav a:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: .25em; }
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; }
.footer-inner { min-height: 82px; }

h1, h2, h3, p { margin: 0; }
h1 { font: 500 clamp(2.75rem, 6vw, 5.05rem)/.97 var(--display); letter-spacing: -.065em; }
h2 { font-size: 1.38rem; line-height: 1.24; letter-spacing: -.035em; }
h3 { font-size: .94rem; }
.hero { min-height: 285px; display: grid; grid-template-columns: 1fr minmax(0, .9fr); gap: .7rem; align-items: center; padding-block: 1.85rem 1.65rem; }
.hero-content { max-width: 640px; }
.hero-content p, .lead { color: var(--muted); margin-top: .95rem; max-width: 56ch; font-size: 1.05rem; line-height: 1.62; }
.breadcrumb, .breadcrumb-current, .breadcrumb-sep { display: inline-block; margin-bottom: 1rem; font-size: .875rem; color: var(--muted); }
.breadcrumb { text-underline-offset: .22em; }
.breadcrumb-sep { margin-inline: .6rem; }
.hero-map { position: relative; min-width: 0; min-height: 216px; display: grid; align-items: center; }
.hero-map::before { content: ""; position: absolute; inset: 2% -2%; background-image: linear-gradient(90deg, #c9dbce75 1px, transparent 1px), linear-gradient(#c9dbce75 1px, transparent 1px); background-size: 27px 27px; mask-image: radial-gradient(ellipse 67% 68%, #000 22%, transparent 76%); }
.map-art { position: relative; width: 100%; aspect-ratio: 960/405; background: center / 100% 100% no-repeat url('./world.png'); }
.map-pin { position: absolute; left: var(--map-x); top: var(--map-y); width: 12px; height: 12px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px #fbf9f3, 0 0 0 7px #b25f342b; }
.map-label { position: absolute; left: clamp(.25rem, calc(var(--map-x) + 12px), calc(100% - 8rem)); top: calc(var(--map-y) + 8px); background: #fffef9; color: #60331f; border: 1px solid #e0d3c1; padding: .23rem .5rem; border-radius: 5px; white-space: nowrap; font: 650 .72rem/1.2 var(--mono); letter-spacing: .035em; }

.workspace { border: 1px solid #d2ded0; border-radius: 17px; background: var(--white); box-shadow: 0 12px 30px #28533b09, 0 2px 5px #29413207; display: grid; grid-template-columns: minmax(255px, .78fr) minmax(0, 1.55fr); overflow: hidden; }
.configuration, .results { padding: clamp(1.15rem, 3vw, 2rem); }
.configuration { border-right: 1px solid var(--line); background: #fcfdfb; }
.configuration h2 { margin-bottom: 1rem; }
.configuration form { display: grid; }
.configuration label { display: block; color: #3f5247; font-size: .875rem; line-height: 1.3; margin: 0 0 .38rem; font-weight: 690; }
.select-shell { position: relative; }
.configuration .select-shell { margin-bottom: .83rem; }
.select-shell::after { content: ""; pointer-events: none; position: absolute; right: 15px; top: 49%; width: 8px; height: 8px; border-right: 1.7px solid #476252; border-bottom: 1.7px solid #476252; transform: translateY(-62%) rotate(45deg); }
.select-shell select { width: 100%; height: 44px; appearance: none; background: var(--white); border: 1px solid #ccdacc; border-radius: 7px; padding: 0 2rem 0 .78rem; cursor: pointer; font-size: .95rem; color: var(--ink); }
.select-shell select:hover { border-color: #809b84; }
.country-select select { padding-left: 2.35rem; font-weight: 630; }
.select-country-icon { position: absolute; pointer-events: none; left: .75rem; top: 50%; transform: translateY(-50%); font-size: 1rem; }
.button { -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: .56rem; padding: .55rem .8rem; min-height: 40px; border: 1px solid transparent; border-radius: 7px; font-weight: 700; font-size: .895rem; line-height: 1.25; text-decoration: none; }
.primary { background: var(--forest); color: var(--white); min-height: 47px; margin-top: .2rem; font-size: 1rem; }
.primary:hover { background: var(--green-dark); }
.secondary { background: #f6f9f4; color: var(--green-dark); border-color: #d5e1d4; }
.secondary:hover, .icon-button:hover { background: #e9f2e6; border-color: #96b29a; }
.text-button { padding-inline: 0; min-height: 33px; background: transparent; color: var(--green-dark); }
.text-button:hover { text-decoration: underline; text-underline-offset: .2em; }
.tool-note { margin-top: .75rem; color: var(--muted); font-size: .87rem; }

.results { min-width: 0; }
.results-head { display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: .85rem; }
.results-head .button { flex-shrink: 0; white-space: nowrap; }
.batch-picker { margin-bottom: .65rem; }
.address-sheet { position: relative; background: var(--soft); padding: .8rem .95rem; border: 1px solid #dcebdd; border-left: 3px solid #689074; border-radius: 6px; }
pre { font: 500 .96rem/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; margin: 0; }
.fields { margin: .65rem 0 0; }
.field-row { display: grid; grid-template-columns: minmax(125px, .44fr) minmax(0, 1fr); gap: .55rem; align-items: center; min-height: 41px; border-bottom: 1px solid #eaf0e9; }
.field-row dt { color: var(--muted); font-size: .845rem; font-weight: 630; }
.field-row dd { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .55rem; margin: 0; font-size: .94rem; font-weight: 670; overflow-wrap: anywhere; }
.icon-button { display: grid; place-items: center; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--forest); width: 32px; height: 32px; }
.result-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: .8rem; margin-top: .45rem; }
.status { color: var(--forest); font-size: .86rem; font-weight: 650; min-height: 1.25rem; margin-left: auto; }

.directory { margin-top: 2.7rem; }
.section-heading p { margin-top: .33rem; color: var(--muted); }
.country-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .72rem; }
.country-card { display: flex; align-items: center; gap: .62rem; min-height: 68px; padding: .65rem .72rem; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.country-card:hover, .country-card[aria-current] { background: var(--soft); border-color: #9bb89e; }
.country-card strong, .country-card small { display: block; }
.country-card strong { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.country-card small { color: var(--muted); font-size: .81rem; margin-top: .18rem; }
.flag-tile { border-radius: 6px; background: #f2f6ef; min-width: 32px; height: 32px; display: grid; place-items: center; }
.country-code { color: var(--muted); font-weight: 640; font-size: .72rem; font-family: var(--mono); margin-left: auto; }
.info-slab { display: flex; justify-content: space-between; align-items: center; gap: 1.4rem; padding: 1.35rem; margin-top: 2.1rem; border-radius: 10px; border: 1px solid var(--line); background: #f0f5ed; }
.info-slab p { color: var(--muted); margin-top: .55rem; max-width: 68ch; }
.info-slab .button { flex-shrink: 0; }
.info-slab pre, .format-card pre { margin-top: .5rem; padding: .7rem; background: var(--white); border-radius: 5px; border: 1px solid var(--line); }
.country-info { align-items: start; }
.country-info > :last-child { flex: 0 1 34%; min-width: min(220px, 100%); }
.format-footnote { font-size: .9rem; }
.document { padding-block: 3.3rem 1rem; }
.document h1 { font-size: clamp(2.7rem, 6vw, 4.45rem); }
.document p { margin-top: 1rem; color: var(--muted); }
.format-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .9rem; margin-top: 1.8rem; }
.format-card { border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: 1.15rem; }
.format-card h2 { font-size: 1.16rem; }
.format-card h2 a { text-decoration-thickness: 1px; text-underline-offset: .2em; }
.format-card p { margin-top: .55rem; }
.format-card pre { background: var(--soft); }

.icon { display: inline-block; flex: 0 0 auto; width: 1rem; height: 1rem; position: relative; }
.icon-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--forest); }
.icon-mark::before { content: ""; position: absolute; top: 6px; left: 9px; width: 12px; height: 15px; border: 1.5px solid #eef8e8; border-radius: 55% 55% 55% 12%; transform: rotate(-45deg); }
.icon-mark::after { content: ""; position: absolute; top: 10px; left: 13px; width: 4px; height: 4px; background: #eef8e8; border-radius: 50%; }
.icon-copy::before, .icon-copy::after { content: ""; position: absolute; width: 10px; height: 11px; border: 1.35px solid currentColor; border-radius: 2px; }
.icon-copy::before { top: 1px; left: 1px; border-right-color: transparent; border-bottom-color: transparent; }
.icon-copy::after { top: 4px; left: 4px; }
.icon-shuffle::before { content: ""; position: absolute; inset: 2px; border: 1.5px solid currentColor; border-right-color: transparent; transform: rotate(16deg); border-radius: 50%; }
.icon-shuffle::after { content: ""; position: absolute; border: solid currentColor; border-width: 0 1.5px 1.5px 0; width: 5px; height: 5px; top: 2px; right: 1px; transform: rotate(9deg); }
.icon-download::before { content: ""; position: absolute; inset: 9px 2px 1px; border: solid currentColor; border-width: 0 1.5px 1.5px; border-radius: 2px; }
.icon-download::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 7px; transform: rotate(42deg); border: solid currentColor; border-width: 0 1.5px 1.5px 0; }

@media (max-width: 820px) {
  .hero { min-height: 270px; grid-template-columns: 1.2fr .8fr; }
  .country-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .field-row { grid-template-columns: minmax(90px, .5fr) minmax(0,1fr); }
}

@media (min-width: 591px) and (max-height: 780px) {
  .hero { min-height: 260px; padding-block: 1.25rem 1rem; }
  .configuration .select-shell { margin-bottom: .65rem; }
}

@media (max-width: 590px) {
  .shell, .narrow { width: calc(100% - 2rem); }
  .header-inner { min-height: 61px; }
  .site-header nav, .site-footer nav { column-gap: .85rem; }
  .site-header nav a, .site-footer nav a { font-size: .82rem; }
  .brand { gap: .42rem; font-size: 1.13rem; }
  .hero { position: relative; display: block; min-height: 0; padding-block: 1.85rem 1.35rem; }
  .hero-content { position: relative; z-index: 1; }
  .hero-content p, .lead { font-size: 1rem; margin-top: .8rem; }
  .hero-map { display: none; }
  h1 { font-size: clamp(2.85rem, 11vw, 4rem); }
  h2 { font-size: 1.24rem; }
  .workspace { grid-template-columns: 1fr; border-radius: 12px; }
  .configuration { border-right: 0; border-bottom: 1px solid var(--line); }
  .results-head .button { font-size: .82rem; padding-inline: .55rem; }
  .select-shell select { font-size: 1rem; }
  .field-row { grid-template-columns: minmax(80px, .58fr) minmax(0,1fr); }
  .country-grid { gap: .5rem; }
  .country-card { padding-inline: .55rem; gap: .43rem; }
  .country-card strong { font-size: .84rem; }
  .country-code { display: none; }
  .country-card small { font-size: .78rem; }
  .directory { margin-top: 2rem; }
  .info-slab { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .format-grid { grid-template-columns: 1fr; }
  .site-footer { margin-top: 2.7rem; }
  .footer-inner { padding-block: 1rem; align-items: flex-start; }
}
