/* track-parcel — one box, sixteen couriers */

:root {
  --bg: #faf9f6;
  --fg: #17171a;
  --muted: #6d6d68;
  --soft: #4a4a44;
  --line: #e3e1db;
  --card: #ffffff;
  --hover: #f1efe9;
  --accent: #1d1d1b;
  --on-accent: #faf9f6;
  --wait: #7a6a3f;
  --wait-bg: #f6f0dd;
  --move: #1f5f8b;
  --move-bg: #e4eff7;
  --done: #22633c;
  --done-bg: #e2f1e6;
  --stop: #8a2f2a;
  --stop-bg: #f8e5e3;
  --shadow: 0 1px 2px rgba(23, 23, 26, .05), 0 18px 40px -28px rgba(23, 23, 26, .4);
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html.dark {
  --bg: #12120f;
  --fg: #f2f1ec;
  --muted: #96968e;
  --soft: #b9b9ad;
  --line: #2a2a26;
  --card: #191916;
  --hover: #232320;
  --accent: #f2f1ec;
  --on-accent: #12120f;
  --wait: #d8c68d;
  --wait-bg: #2b2617;
  --move: #8fc2e4;
  --move-bg: #16232c;
  --done: #93d2a8;
  --done-bg: #16261b;
  --stop: #e9a6a0;
  --stop-bg: #2b1917;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 20px 44px -28px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 50;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  max-width: 1080px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  background: var(--accent);
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1.8px solid var(--bg);
  border-bottom-color: transparent;
  border-right-color: transparent;
  transform: rotate(-45deg);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 8px;
}
.topnav a:hover { color: var(--fg); background: var(--hover); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.icon-btn:hover { color: var(--fg); border-color: var(--soft); }

/* ---------- layout ---------- */

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 22px 64px;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 18px 0 12px;
  font-weight: 640;
}

h2 {
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
  margin: 0 0 6px;
  font-weight: 620;
}

h3 { font-size: 0.9375rem; margin: 0 0 4px; font-weight: 620; }

.lead {
  color: var(--muted);
  margin: 0 0 26px;
  max-width: 60ch;
}

.hint {
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 6px 0 0;
}
.hint.is-note {
  color: var(--soft);
  background: var(--wait-bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  margin: 12px 0 0;
  font-size: 0.8125rem;
}

.banner {
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--done-bg);
  color: var(--done);
  font-size: 0.875rem;
}
.banner.is-bad { background: var(--stop-bg); color: var(--stop); }

/* ---------- form ---------- */

.tracker {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.track-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px auto;
  gap: 10px;
  align-items: end;
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.field input,
.field select {
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 0.9375rem;
  width: 100%;
}
.field input:focus,
.field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.field-number input {
  font-family: var(--mono);
  letter-spacing: 0.02em;
  font-size: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn-primary:hover { opacity: .9; background: var(--accent); }
.btn-primary[disabled] { opacity: .55; cursor: progress; }

.btn-quiet { color: var(--muted); font-weight: 500; }

/* ---------- result ---------- */

.result { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.result-id { min-width: 0; }

.eyebrow {
  margin: 0 0 2px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.result-id h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.0625rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 620;
  white-space: nowrap;
  background: var(--wait-bg);
  color: var(--wait);
}
.pill-move { background: var(--move-bg); color: var(--move); }
.pill-done { background: var(--done-bg); color: var(--done); }
.pill-stop { background: var(--stop-bg); color: var(--stop); }

.result-text { margin: 10px 0 0; color: var(--soft); font-size: 0.9375rem; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.stamp { color: var(--muted); font-size: 0.75rem; margin-left: auto; }

.candidate { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}
.chip:hover { background: var(--hover); }

.timeline {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-left: 2px solid var(--line);
  margin-left: 5px;
}

.timeline li {
  position: relative;
  padding: 0 0 16px 18px;
}
.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  border: 2px solid var(--card);
}
.timeline li:first-child::before { background: var(--fg); }

.tl-label { display: block; font-size: 0.875rem; }
.tl-meta { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 1px; }
.timeline li.is-new .tl-label { font-weight: 600; }

/* ---------- alerts ---------- */

.alerts {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.alerts h3 { margin-bottom: 4px; }

.tabs {
  display: inline-flex;
  gap: 3px;
  margin: 12px 0 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
}
.tab.is-on { background: var(--accent); color: var(--on-accent); }

.watch-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px auto;
  gap: 10px;
  align-items: end;
}

.watch-form .field input,
.watch-form .field select { height: 42px; background: var(--card); }
.watch-form .btn { height: 42px; }

.watch-msg { margin: 10px 0 0; font-size: 0.8125rem; color: var(--soft); }
.watch-msg.is-bad { color: var(--stop); }
.watch-msg.is-ok { color: var(--done); }
.watch-msg .btn { height: 40px; }

/* ---------- mine ---------- */

.mine, .couriers, .how, .faq { margin-top: 40px; }

.mine-list { list-style: none; margin: 12px 0 0; padding: 0; }

.mine-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.mine-row:last-child { border-bottom: 0; }

.mine-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}
.mine-number { font-family: var(--mono); font-size: 0.875rem; overflow-wrap: anywhere; }
.mine-courier { color: var(--muted); font-size: 0.75rem; }
.mine-when { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }

/* ---------- courier grid ---------- */

.courier-grid {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 8px;
}

.courier {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.courier:hover { background: var(--hover); border-color: var(--soft); }
.courier-name { font-size: 0.875rem; font-weight: 600; }
.courier-meta { color: var(--muted); font-size: 0.75rem; line-height: 1.35; }

/* ---------- how / faq ---------- */

.steps {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.steps li {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  counter-increment: step;
}
.steps { counter-reset: step; }
.steps li h3::before {
  content: counter(step) ". ";
  color: var(--muted);
  font-weight: 500;
}
.steps p { margin: 0; color: var(--muted); font-size: 0.8125rem; }

code {
  font-family: var(--mono);
  font-size: 0.8125em;
  background: var(--hover);
  padding: 1px 5px;
  border-radius: 5px;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--line); }

.faq summary {
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }

.faq details p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 68ch;
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--fg); }
.dot { opacity: .5; }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .track-form,
  .watch-form { grid-template-columns: 1fr; }
  .track-form .btn,
  .watch-form .btn { width: 100%; }
  .wrap { padding: 12px 16px 48px; }
  .tracker { padding: 14px; border-radius: 14px; }
  .result-head { flex-direction: column; }
  .stamp { margin-left: 0; }
  .topnav a { padding: 6px 7px; }
  .courier-grid { grid-template-columns: 1fr 1fr; }
}

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

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