/* ParcelTracker.co.za — waybill-label design system */
:root {
  --paper: #f1f5ef;
  --card: #ffffff;
  --ink: #14231a;
  --ink-2: #4b5c51;
  --green: #0b6b34;
  --green-deep: #08502a;
  --mist: #e2ede4;
  --line: #c9d6cc;
  --tape: #ffd23f;
  --alert: #a4231b;
  --radius: 10px;
  --wide: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--wide);
  font-stretch: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--green-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); border-radius: 4px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--mist); padding: .08em .35em; border-radius: 4px; }

h1, h2, h3 { font-family: var(--wide); font-stretch: 125%; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem); font-weight: 850; }
h2 { font-size: clamp(1.35rem, 1.1rem + .9vw, 1.75rem); font-weight: 800; margin-top: 1.6em; }
h3 { font-size: 1.08rem; font-weight: 750; font-stretch: 112%; margin-top: 1.3em; }
p { margin: 0 0 1em; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 56ch; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--tape); color: var(--ink); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Masthead ---------- */
.masthead { background: var(--green); color: #fff; border-bottom: 4px solid var(--ink); }
.masthead__inner { display: flex; align-items: center; gap: 24px; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-stretch: 125%; font-weight: 850; font-size: 1.25rem; letter-spacing: -.02em; }
.brand:hover { color: inherit; }
.brand__tld { font-weight: 500; opacity: .75; margin-left: -8px; }
.menu-btn { display: none; margin-left: auto; font: 700 .95rem var(--wide); background: transparent; color: #fff; border: 2px solid #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.nav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.masthead nav { margin-left: auto; }
.nav a { display: block; color: #fff; text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 6px; }
.nav a:hover { background: var(--green-deep); }
.nav a[aria-current="page"] { background: var(--tape); color: var(--ink); }
@media (max-width: 860px) {
  .masthead__inner { gap: 12px; }
  .menu-btn { display: block; }
  .masthead nav { flex-basis: 100%; display: none; padding-bottom: 12px; }
  .masthead.is-open nav { display: block; }
  .nav { flex-direction: column; }
}

/* ---------- Page frame ---------- */
.frame { padding: 28px 0 40px; }
.frame--rail { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.frame--rail main { grid-column: 2; grid-row: 1; }
.rail { grid-column: 1; grid-row: 1; position: sticky; top: 16px; font-size: .92rem; }
.rail h3 { font-size: .9rem; margin: 0 0 6px; font-stretch: 100%; color: var(--ink-2); }
.rail ul { list-style: none; margin: 0 0 18px; padding: 0; border-left: 2px solid var(--line); }
.rail li a { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 3px 10px; color: var(--ink); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.rail li a:hover { border-left-color: var(--green); color: var(--green); }
.rail li a[aria-current="page"] { border-left-color: var(--ink); font-weight: 700; background: var(--card); }
.rail__key { font-size: .8rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.rail__ad { margin-top: 8px; }
.rail .box { margin-bottom: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #1fa34a; box-shadow: 0 0 0 2px #c7ebd2; flex: none; }
@media (max-width: 960px) {
  .frame--rail { display: block; }
  .rail { position: static; margin-top: 40px; border-top: 2px solid var(--ink); padding-top: 20px; }
  .rail ul { columns: 2; column-gap: 16px; }
  .rail__ad { display: none; }
}

/* ---------- Crumbs ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 0; font-size: .88rem; color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--line); }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 750 1rem var(--wide); font-stretch: 110%; color: var(--ink); background: var(--tape); border: 2px solid var(--ink); border-radius: 8px; padding: 12px 22px; cursor: pointer; text-decoration: none; box-shadow: 0 3px 0 var(--ink); }
.btn:hover { color: var(--ink); background: #ffdf6e; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn--line { background: var(--card); box-shadow: none; }
.btn--line:hover { background: var(--mist); }
.btn--sm { padding: 7px 14px; font-size: .9rem; box-shadow: 0 2px 0 var(--ink); }
.btn--line.btn--sm { box-shadow: none; }
.input { width: 100%; font: 500 1rem var(--wide); color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: 8px; padding: 10px 12px; }
.input:focus { outline: none; box-shadow: 0 0 0 4px var(--tape); }
.lbl { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 4px; }

/* ---------- The waybill label (track form) ---------- */
.waybill { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--ink); margin: 8px 0 32px; }
.waybill__stub { border-right: 2px dashed var(--ink); background: var(--tape); border-radius: 7px 0 0 7px; display: flex; align-items: center; justify-content: center; }
.waybill__stub span { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; font-stretch: 125%; font-size: .85rem; letter-spacing: .04em; white-space: nowrap; }
.waybill__body { min-width: 0; }
.waybill__row { padding: 14px 20px; border-bottom: 2px solid var(--ink); }
.waybill__row:last-child { border-bottom: 0; }
.waybill__split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; padding: 0; }
.waybill__split > * { padding: 14px 20px; }
.waybill__split > * + * { border-left: 2px solid var(--ink); display: flex; align-items: end; }
.waybill .lbl { font-size: .82rem; color: var(--ink-2); }
.waybill__num { width: 100%; font: 700 clamp(1.3rem, 1rem + 1.6vw, 2rem)/1.2 var(--mono); letter-spacing: .04em; color: var(--ink); background: transparent; border: 0; border-bottom: 2px dotted var(--line); padding: 4px 0; text-transform: uppercase; }
.waybill__num:focus { outline: none; border-bottom-color: var(--green); }
.waybill__num::placeholder { color: #a9b6ac; }
.waybill select { border: 0; padding: 4px 0; font-weight: 700; font-size: 1.05rem; background: transparent; border-radius: 0; border-bottom: 2px dotted var(--line); }
.waybill select:focus { box-shadow: none; border-bottom-color: var(--green); }
.waybill__code { display: flex; align-items: center; gap: 20px; }
.barcode { height: 54px; flex: 1; min-width: 0; color: var(--ink); }
.barcode svg { width: 100%; height: 100%; display: block; }
.detect { margin: 6px 0 0; font-size: .92rem; color: var(--ink-2); min-height: 1.4em; }
.detect b { color: var(--ink); }
@media (max-width: 640px) {
  .waybill { grid-template-columns: 30px minmax(0, 1fr); box-shadow: 5px 5px 0 var(--ink); }
  .waybill__stub span { font-size: .7rem; }
  .waybill__split { grid-template-columns: 1fr; }
  .waybill__split > * + * { border-left: 0; border-top: 2px solid var(--ink); }
  .waybill__row, .waybill__split > * { padding: 12px 14px; }
  .waybill__code { flex-direction: column; align-items: stretch; gap: 12px; }
  .waybill__code .btn, .waybill__split .btn { width: 100%; }
  .waybill__split > * + * { display: block; }
  .barcode { height: 40px; }
}
.waybill--compact { box-shadow: 5px 5px 0 var(--ink); }

/* ---------- Home hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 16px 0 8px; }
.hero h1 { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.8rem); }
.hero__photo { border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden; transform: rotate(1.5deg); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero__photo { display: none; } }

/* ---------- Status board ---------- */
.board { width: 100%; border-collapse: collapse; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; font-size: .96rem; }
.board th { text-align: left; font-size: .82rem; color: var(--ink-2); font-weight: 700; padding: 10px 14px; background: var(--mist); border-bottom: 2px solid var(--ink); }
.board td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board tr:last-child td { border-bottom: 0; }
.board tbody tr:hover { background: #f8fbf7; }
.board a { font-weight: 700; color: var(--ink); text-decoration: none; }
.board a:hover { color: var(--green); text-decoration: underline; }
.board .tel { font-family: var(--mono); font-size: .88rem; white-space: nowrap; }
.method { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; white-space: nowrap; }
.method--link::before { content: ""; width: 8px; height: 8px; border: 2px solid var(--ink-2); border-radius: 50%; }
@media (max-width: 640px) { .board .hide-sm { display: none; } .board td, .board th { padding: 9px 10px; } }

/* ---------- Generic blocks ---------- */
.box { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px 20px; }
.box > :last-child { margin-bottom: 0; }
.box h3:first-child, .box h2:first-child { margin-top: 0; }
.notice { background: #fff8d9; border: 2px solid var(--ink); border-left-width: 8px; border-radius: 8px; padding: 12px 16px; margin: 0 0 20px; }
.notice > :last-child { margin-bottom: 0; }
.section { margin-top: 48px; }
.prose { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose figure { margin: 0 0 24px; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.pagehead { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: end; margin-bottom: 24px; }
.pagehead__img { border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; }
.pagehead__img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .pagehead { grid-template-columns: 1fr; } .pagehead__img { display: none; } }

.faq { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 28px 12px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 8px; font-size: 1.4rem; font-weight: 400; }
.faq[open] summary::after { content: "–"; }
.faq p { margin: 0 0 14px; color: var(--ink-2); }

/* Row lists (tools, guides, ways to track) */
.rows { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.rows > li { border-bottom: 1px solid var(--line); }
.rows a.row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: center; padding: 16px 0; color: var(--ink); text-decoration: none; }
.rows a.row:hover h3 { color: var(--green); text-decoration: underline; }
.rows .row img { border: 2px solid var(--ink); border-radius: 8px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.rows h3 { margin: 0 0 4px; font-size: 1.15rem; }
.rows p { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) { .rows a.row { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; } .rows h3 { font-size: 1rem; } .rows p { font-size: .9rem; } }

/* Steps (genuine sequence) */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); }
.steps li { counter-increment: s; padding: 18px 20px; }
.steps li + li { border-left: 2px dashed var(--ink); }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--tape); font-weight: 800; margin-bottom: 8px; }
.steps strong { display: block; font-stretch: 112%; }
.steps p { margin: 4px 0 0; color: var(--ink-2); font-size: .95rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } .steps li + li { border-left: 0; border-top: 2px dashed var(--ink); } }

/* ---------- Track results ---------- */
.result { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 20px; margin-bottom: 28px; }
.result__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: start; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 16px; }
.result__head h2 { margin: 0; }
.stamp { display: inline-block; font-weight: 800; font-stretch: 115%; border: 3px solid var(--green); color: var(--green); border-radius: 6px; padding: 4px 12px; transform: rotate(-2deg); }
.stamp--done { background: var(--green); color: #fff; }
.scanlog { list-style: none; margin: 0; padding: 0; }
.scanlog li { position: relative; padding: 0 0 16px 26px; border-left: 2px solid var(--line); margin-left: 6px; }
.scanlog li:last-child { border-left-color: transparent; }
.scanlog li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; background: var(--card); border: 2px solid var(--ink); }
.scanlog li:first-child::before { background: var(--tape); }
.scanlog li:first-child .desc { font-weight: 700; }
.scanlog time { display: block; font-family: var(--mono); font-size: .8rem; color: var(--ink-2); }
.scanlog .loc { font-size: .88rem; color: var(--ink-2); }
.options { display: grid; gap: 0; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); }
.option { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; flex-wrap: wrap; }
.option + .option { border-top: 1px solid var(--line); }
.option p { margin: 2px 0 0; color: var(--ink-2); font-size: .93rem; }
.option .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1.5px solid var(--ink-2); color: var(--ink-2); vertical-align: middle; }
.tag--live { border-color: #1fa34a; color: #12722f; background: #e3f5e8; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.facts dt { font-weight: 700; color: var(--ink-2); font-size: .88rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Calculators ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 24px; align-items: start; margin-bottom: 32px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.fields .span { grid-column: 1 / -1; }
.field small { display: block; color: var(--ink-2); font-size: .8rem; margin-top: 3px; }
.readout { background: var(--ink); color: #e9f3ec; border-radius: var(--radius); padding: 20px; position: sticky; top: 16px; box-shadow: 6px 6px 0 var(--green); }
.readout__label { font-size: .88rem; color: #a9c0b0; }
.readout__big { font: 700 clamp(2rem, 1.4rem + 2vw, 2.8rem)/1.1 var(--mono); color: var(--tape); margin: 2px 0 12px; overflow-wrap: anywhere; }
.readout dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; border-top: 1px solid #3a4d40; padding-top: 12px; font-size: .92rem; }
.readout dt { color: #a9c0b0; }
.readout dd { margin: 0; font-family: var(--mono); text-align: right; }
.readout p { font-size: .9rem; margin: 12px 0 0; }
.readout a { color: var(--tape); }
.verdict { display: inline-block; font-weight: 800; padding: 2px 10px; border-radius: 6px; background: var(--tape); color: var(--ink); }
.verdict--bad { background: #ff8a7a; }
.verdict--ok { background: #8fe0a6; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } .readout { position: static; } }

.fit { width: 100%; border-collapse: collapse; font-size: .94rem; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.fit th, .fit td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.fit th { background: var(--mist); font-size: .82rem; color: var(--ink-2); }
.fit tr.is-best td { background: #fff3c0; font-weight: 700; }
.fit .no { color: var(--alert); }
.fit .yes { color: #12722f; }
.cargo { display: grid; gap: 10px; }
.cargo__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.cargo__row .input { padding: 8px 10px; }
@media (max-width: 640px) { .cargo__row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sorted { margin-top: 20px; }
.sorted h3 { display: flex; align-items: center; gap: 10px; }
.sorted ul { list-style: none; padding: 0; margin: 0 0 16px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); }
.sorted li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; flex-wrap: wrap; align-items: center; }
.sorted li + li { border-top: 1px solid var(--line); }
.sorted code { background: none; padding: 0; font-weight: 700; }
textarea.input { font-family: var(--mono); min-height: 160px; resize: vertical; }

/* ---------- Ads ---------- */
.ad { margin: 28px 0; text-align: center; min-height: 120px; }
.ad__label { display: block; font-size: .72rem; color: var(--ink-2); margin-bottom: 4px; }
.ad--rail { margin: 0; min-height: 620px; text-align: left; }
.ad--footer { margin: 8px 0 32px; }
.ad--results { min-height: 100px; }

/* ---------- Footer ---------- */
.foot { background: var(--ink); color: #cfdcd3; padding: 40px 0 20px; margin-top: 20px; font-size: .94rem; }
.foot__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; }
.foot h2 { color: #fff; font-size: 1rem; margin: 0 0 10px; font-stretch: 110%; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 6px; }
.foot a { color: #cfdcd3; }
.foot a:hover { color: var(--tape); }
.brand--foot { color: #fff; font-size: 1.05rem; margin-bottom: 10px; }
.foot__legal { border-top: 1px solid #33473a; margin-top: 28px; padding-top: 16px; font-size: .82rem; color: #93a89a; }
@media (max-width: 760px) { .foot__grid { grid-template-columns: 1fr 1fr; } .foot__about { grid-column: 1 / -1; } }

@media (max-width: 420px) { .brand { font-size: 1.05rem; gap: 8px; } .brand svg { width: 28px; height: 28px; } .brand__tld { margin-left: -6px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
