:root {
  --navy: #0b2341;
  --navy-mid: #14365c;
  --navy-soft: #2c5278;
  --navy-fog: #d7e2ee;
  --manila: #f4e3b6;
  --manila-deep: #e4cf94;
  --slip: #fbf6e6;
  --paper: #fffdf7;
  --red: #b42334;
  --red-soft: #d36a72;
  --ink: #161c28;
  --muted: #5c6574;
  --line: #d3c49a;
  --header-h: 78px;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 18px 40px rgba(11, 35, 65, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(244, 227, 182, 0.08), transparent 28%),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(255, 255, 255, 0.03) 46px 47px),
    var(--navy);
}
body.menu-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
h1, h2, h3 {
  font-family: var(--cond);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.12;
  margin: 0;
}
h1 { font-size: clamp(1.85rem, 4.6vw, 3.35rem); max-width: min(20ch, 100%); overflow-wrap: anywhere; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.55rem); max-width: 22ch; }
h3 { font-size: 1.2rem; }
p, ul, ol { margin: 0; }
p, li, dd, address { overflow-wrap: anywhere; }
address { font-style: normal; }
::selection { background: var(--navy); color: var(--manila); }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  background: var(--manila);
  color: var(--navy);
  padding: 8px 12px;
  font-weight: 600;
}
.skip:focus { top: 12px; }

.postal-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: var(--header-h);
  padding: 10px clamp(16px, 4vw, 40px);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  background:
    linear-gradient(90deg, #08182e, var(--navy) 38%, #102c4e);
  color: #f4efe3;
  border-bottom: 4px solid var(--manila);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}
.brand b {
  display: block;
  font-family: var(--cond);
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  line-height: 1;
}
.brand small {
  display: block;
  color: #c9d6e6;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.postmark {
  width: 54px;
  height: 54px;
  border: 2px solid #d7c48a;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.15;
  box-shadow: inset 0 0 0 3px rgba(215, 196, 138, 0.35);
  flex: none;
}
.postmark.sm { width: 48px; height: 48px; }

.nav {
  display: none;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.nav a {
  color: #d5e0ec;
  text-decoration: none;
  font-family: var(--cond);
  font-size: 0.98rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover,
.nav a.active {
  color: var(--manila);
  border-bottom-color: var(--red);
}
.nav.open {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 45;
  background: #08182e;
  flex-direction: column;
  padding: 12px 20px 20px;
  gap: 0;
  border-bottom: 4px solid var(--manila);
}
.nav.open a {
  padding: 12px 0;
  border-bottom: 1px solid rgba(244, 227, 182, 0.15);
}
.bar-end { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.langs {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid rgba(244, 227, 182, 0.35);
}
.lang-btn {
  background: transparent;
  color: #d5e0ec;
  border: 0;
  flex: 0 0 auto;
  min-width: 42px;
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.lang-btn:not(.is-active) {
  background: rgba(244, 227, 182, 0.08);
  color: var(--manila);
}
.lang-btn.is-active {
  background: var(--manila);
  color: var(--navy);
}
.menu {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  background: var(--manila);
  border: 1px solid var(--manila);
  padding: 10px 9px;
}
.menu span {
  display: block;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
}

main {
  width: min(1180px, calc(100% - 24px));
  max-width: 100%;
  margin: 22px auto 48px;
  background: var(--slip);
  color: var(--ink);
  box-shadow: var(--shadow);
  min-width: 0;
}

.hero {
  padding: 0;
  background: var(--slip);
}
.waybill-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  position: relative;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(11, 35, 65, 0.04), transparent 90px),
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(11, 35, 65, 0.035) 27px 28px),
    var(--slip);
}
.airmail {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 10px solid transparent;
  border-image: repeating-linear-gradient(
    135deg,
    var(--red) 0 10px,
    #fff 10px 16px,
    var(--navy) 16px 26px,
    #fff 26px 32px
  ) 10;
  z-index: 2;
}
.waybill-main {
  padding: clamp(28px, 5vw, 56px) clamp(28px, 5vw, 52px) 40px;
  min-width: 0;
}
.kicker-row,
.track-row,
.hero-actions,
.hero-meta,
.consign-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}
.kicker-row {
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-soft);
  margin-bottom: 10px;
}
.ink-stamp {
  font-style: normal;
  color: var(--red);
  border: 2px solid var(--red);
  padding: 4px 10px;
  transform: rotate(-8deg);
  font-family: var(--cond);
  letter-spacing: 0.14em;
  font-weight: 700;
}
.track-row {
  margin-bottom: 18px;
  font-family: var(--mono);
}
.track-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.track-row b { font-size: 1.05rem; letter-spacing: 0.08em; }
.barcode {
  display: block;
  width: min(220px, 100%);
  height: 42px;
  background: repeating-linear-gradient(
    90deg,
    #12161f 0 2px,
    transparent 2px 4px,
    #12161f 4px 5px,
    transparent 5px 8px,
    #12161f 8px 12px,
    transparent 12px 14px,
    #12161f 14px 15px,
    transparent 15px 18px,
    #12161f 18px 22px,
    transparent 22px 24px
  );
}
.barcode-sm { width: 92px; height: 28px; margin: 10px 0; }
.lede {
  max-width: 62ch;
  margin: 16px 0 22px;
  color: #2a3342;
}
.consign-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--navy-mid);
  margin-bottom: 22px;
  background: var(--paper);
}
.consign-grid div {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}
.consign-grid div:last-child { border-right: 0; }
.consign-grid dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 4px;
}
.consign-grid dd { margin: 0; font-size: 0.95rem; }
.consign-grid a { color: var(--navy); font-weight: 600; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  text-decoration: none;
  font-family: var(--cond);
  font-size: 1.12rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--navy);
}
.btn.navy { background: var(--navy); color: var(--manila); }
.btn.ghost { background: var(--paper); color: var(--navy); }
.btn:hover { filter: brightness(1.08); }
.hero-meta {
  margin-top: 22px;
  gap: 0;
  border-top: 1px dashed var(--navy-soft);
  padding-top: 14px;
}
.hero-meta div {
  min-width: 120px;
  padding-right: 24px;
}
.hero-meta dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-meta dd {
  margin: 0;
  font-family: var(--cond);
  font-size: 1.25rem;
}

.tear-stub {
  display: grid;
  grid-template-columns: 18px 1fr;
  background: var(--manila);
  border-left: 0;
  position: relative;
}
.perf-col {
  background:
    radial-gradient(circle at 9px 10px, var(--navy) 3px, transparent 3.4px) 0 0 / 18px 18px,
    linear-gradient(90deg, transparent 7px, rgba(11, 35, 65, 0.18) 7px 8px, transparent 8px);
}
.stub-body {
  padding: 28px 12px 20px 8px;
  text-align: center;
  font-family: var(--mono);
}
.stub-kicker {
  font-family: var(--cond);
  letter-spacing: 0.08em;
  font-size: 1rem;
  white-space: nowrap;
}
.stub-copy, .stub-note { font-size: 0.68rem; color: var(--navy-soft); }
.stub-ref { font-weight: 600; margin: 6px 0 12px; letter-spacing: 0.06em; }
.stub-body ul {
  list-style: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--navy);
}
.stub-body li { padding: 3px 0; border-bottom: 1px dotted rgba(11, 35, 65, 0.28); }

section {
  padding: clamp(28px, 5vw, 56px) clamp(22px, 4vw, 48px);
  border-top: 1px dashed var(--navy-soft);
  position: relative;
}
.section-head { margin-bottom: 22px; }
.field-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  background: var(--navy);
  color: var(--manila);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.kicker {
  margin: 10px 0 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}
.wide-lead, .section-head p:last-child {
  max-width: 64ch;
  color: #334054;
}

.profile-grid,
.place-grid,
.contact-grid,
.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.9fr);
  gap: 22px;
  align-items: start;
}
.copy-block { display: grid; gap: 14px; }
.notice {
  background: var(--manila);
  border-left: 4px solid var(--red);
  padding: 12px 14px;
}
.slip-card {
  background: var(--manila);
  border: 1px solid var(--navy-mid);
  padding: 16px 18px;
  box-shadow: 6px 6px 0 rgba(11, 35, 65, 0.12);
}
.slip-card div {
  padding: 8px 0;
  border-bottom: 1px dotted rgba(11, 35, 65, 0.28);
}
.slip-card dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-soft);
}
.slip-card dd { margin: 2px 0 0; }
.slip-card a { color: var(--navy); font-weight: 600; }

.code-table { border: 1px solid var(--navy-mid); background: var(--paper); }
.code-head, .code-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  align-items: start;
}
.code-head {
  background: var(--navy);
  color: var(--manila);
  font-family: var(--cond);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.95rem;
}
.code-row { border-top: 1px solid var(--line); }
.code-row b {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--navy);
}
.code-row h3 { font-size: 1.08rem; max-width: none; }
.primary-row { background: rgba(244, 227, 182, 0.45); }
.tag {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}

.fact-grid, .field-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin-top: 18px;
}
.fact-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fact-grid li, .field-cards li, .people-grid article {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 16px;
}
.field-cards { counter-reset: none; }
.field-cards li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: start;
}
.field-cards span, .route-track li::before {
  font-family: var(--mono);
  color: var(--red);
  font-weight: 600;
}
.field-cards h3, .field-cards p { grid-column: 2; }

.numbered-slip {
  margin: 16px 0 0;
  padding: 0 0 0 1.2rem;
  display: grid;
  gap: 10px;
}
.numbered-slip li::marker { color: var(--red); font-family: var(--mono); font-weight: 600; }

.route-track {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 8px;
  background: var(--paper);
  border: 1px solid var(--navy-mid);
}
.route-track li {
  padding: 16px;
  border-right: 1px dashed var(--navy-soft);
  position: relative;
}
.route-track li:last-child { border-right: 0; }
.route-track li::before {
  content: "";
  display: block;
  width: 100%;
  height: 6px;
  margin-bottom: 12px;
  background: repeating-linear-gradient(90deg, var(--navy) 0 8px, transparent 8px 14px);
}

.limit-list {
  columns: 2;
  gap: 22px;
  padding-left: 1.1rem;
}
.limit-list li { margin-bottom: 10px; break-inside: avoid; }
.limit-list li::marker { color: var(--red); }

.waybill-form, #contactForm {
  display: grid;
  gap: 14px;
}
.waybill-form label, #contactForm label { display: grid; gap: 6px; }
.waybill-form span, #contactForm span {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-soft);
}
input, select, textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--navy-mid);
  padding: 10px 12px;
  border-radius: 0;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}
.waybill-form .btn,
#contactForm .btn {
  justify-self: start;
  width: max-content;
}
.summary-panel {
  background: var(--navy);
  color: #eef3f8;
  padding: 18px;
  box-shadow: 8px 8px 0 var(--manila-deep);
}
.summary-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.no-price {
  color: var(--manila);
  border: 1px solid var(--manila);
  padding: 2px 8px;
}
#waybillOutput,
#requestOutput {
  min-height: 240px;
  margin: 0 0 14px;
  padding: 12px;
  background: #08182e;
  color: #f3ead0;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: auto;
}
.summary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-panel .btn.navy { background: var(--manila); color: var(--navy); border-color: var(--manila); }
.summary-panel .btn.ghost { background: transparent; color: var(--manila); border-color: var(--manila); }
.form-hint { color: var(--muted); font-size: 0.92rem; }
.summary-panel .form-hint { color: #c9d6e6; margin-top: 12px; }

.reg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--navy-mid);
  background: var(--paper);
}
.reg-grid div {
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.reg-grid dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}
.reg-grid dd { margin: 6px 0 0; }

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  border: 1px solid var(--navy);
  padding: 2px 8px;
  margin-bottom: 8px;
}
.person {
  font-family: var(--cond);
  font-size: 1.25rem;
  margin: 6px 0 8px;
}

.place-grid .slip-card {
  display: grid;
  justify-items: start;
  gap: 10px;
  white-space: pre-line;
}
.contact-place {
  margin-top: 22px;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
}
.contact-reg {
  min-width: 0;
}
.contact-reg a { color: var(--navy); font-weight: 600; }

.faq-list {
  display: grid;
  gap: 8px;
}
.faq-list details {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 4px 14px 10px;
}
.faq-list summary {
  cursor: pointer;
  font-family: var(--cond);
  font-size: 1.2rem;
  padding: 10px 0;
}
.faq-list p { color: #334054; padding-bottom: 8px; }

.contact-aside { display: grid; gap: 10px; }
.form-status {
  min-height: 1.4em;
  color: var(--navy);
  font-weight: 600;
}

.site-footer {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--manila);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.site-footer a { color: var(--manila); }

@media (max-width: 980px) {
  .waybill-sheet,
  .profile-grid,
  .place-grid,
  .contact-grid,
  .builder-grid,
  .consign-grid,
  .code-head,
  .code-row,
  .fact-grid,
  .fact-grid.three,
  .field-cards,
  .route-track,
  .reg-grid,
  .people-grid {
    grid-template-columns: 1fr;
  }
  .tear-stub {
    grid-template-columns: 1fr;
    border-top: 0;
  }
  .perf-col {
    height: 16px;
    background:
      radial-gradient(circle at 10px 8px, var(--navy) 3px, transparent 3.4px) 0 0 / 18px 16px;
  }
  .stub-body {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px 16px;
    align-items: center;
    text-align: left;
    padding: 12px 16px 18px;
  }
  .stub-body ul { display: flex; flex-wrap: wrap; gap: 8px 12px; }
  .stub-body li { border: 0; }
  .code-head { display: none; }
  .limit-list { columns: 1; }
  .route-track li { border-right: 0; border-bottom: 1px dashed var(--navy-soft); }
}

@media (min-width: 861px) {
  .nav,
  .nav.open {
    display: flex;
    position: static;
    flex-direction: row;
    background: transparent;
    padding: 0;
    border: 0;
    gap: 4px 12px;
  }
  .nav a,
  .nav.open a {
    padding: 6px 0;
    border-bottom: 2px solid transparent;
  }
  .menu { display: none; }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .nav a {
    font-size: 0.86rem;
    letter-spacing: 0.04em;
  }
}

@media (max-width: 860px) {
  .postal-bar {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
  }
  .brand { gap: 8px; min-width: 0; }
  .brand b { font-size: 1.4rem; letter-spacing: 0.08em; }
  .bar-end {
    position: fixed;
    top: 8px;
    right: 8px;
    z-index: 80;
    background: #08182e;
    padding: 4px;
  }
  main { width: calc(100% - 12px); margin-top: 12px; }
  .airmail { border-width: 7px; }
  h1 { max-width: none; }
}

@media (max-width: 560px) {
  .hero-actions, .summary-actions { display: grid; }
  .btn, .waybill-form .btn { width: 100%; justify-self: stretch; }
  .stub-body { grid-template-columns: 1fr; }
  .consign-grid div { border-right: 0; border-bottom: 1px solid var(--line); }
  .brand small { display: none; }
  .postmark { width: 44px; height: 44px; font-size: 0.56rem; }
  .lang-btn { min-width: 36px; padding: 6px 8px; }
  .kicker-row { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
  .ink-stamp { font-size: 0.8rem; padding: 3px 7px; align-self: flex-start; transform: rotate(-4deg); }
}
