/* Tightknit — order tracking page
   Brand rules honoured deliberately:
     · #ffcff9 is the only pink, and is used as a FILL only — never as text or as
       an icon on white, where it drops below readable contrast.
     · Only weight 400 of PP Neue Gstaad is loaded, so --font never goes above 400.
       Every bold in this file is Figtree (--font-display), which is variable 300–900.
*/

:root {
  --ink: #282828;
  --ink-soft: #4a4541;
  --mute: #6f6a63;
  --pink: #ffcff9;
  --pill-fill: rgba(255, 207, 249, 0.22);
  --cream: #f8f1de;
  --bg: #f2eada;
  --line: rgba(28, 28, 28, 0.16);
  --line-soft: rgba(28, 28, 28, 0.08);
  --alert: #9a3412;

  --font: "PP Neue Gstaad", system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Figtree", system-ui, sans-serif;
  --font-italic: "ABC Laica", Georgia, serif;
}

* { box-sizing: border-box; }

/* The `hidden` attribute only sets display:none in the UA stylesheet, so ANY
   explicit display rule silently beats it. `.tkt-form { display:grid }` did
   exactly that and rendered both lookup panels stacked on top of each other.
   This guard has to come before anything that sets display. */
[hidden] { display: none !important; }

.tk-track-body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── Masthead ─────────────────────────────────────────────────────────────── */
.tkt-masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.tkt-masthead__logo {
  font-family: var(--font-display); font-weight: 800;
  font-size: 18px; letter-spacing: .01em;
  color: var(--ink); text-decoration: none;
}
.tkt-masthead__help { font-size: 13px; color: var(--mute); text-decoration: none; }
.tkt-masthead__help:hover { color: var(--ink); text-decoration: underline; }

.tkt { max-width: 640px; margin: 0 auto; padding: 40px 16px 64px; }

.tkt-h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--mute); margin: 0 0 14px;
}

/* ── Lookup ───────────────────────────────────────────────────────────────── */
.tkt-lookup__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 34px; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 10px;
}
.tkt-lookup__sub { color: var(--mute); margin: 0 0 28px; max-width: 46ch; }

.tkt-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; margin-bottom: 24px;
}
.tkt-tab {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--mute);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  padding: 8px 18px; border-radius: 999px;
  transition: background .18s, color .18s;
}
.tkt-tab.is-active { background: var(--pill-fill); color: var(--ink); }

.tkt-form { display: grid; gap: 14px; max-width: 420px; }
.tkt-field { display: grid; gap: 6px; }
.tkt-field__label {
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--mute);
}
.tkt-field input {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 15px; width: 100%;
  transition: border-color .18s, box-shadow .18s;
}
.tkt-field input:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--pill-fill);
}

.tkt-btn {
  appearance: none; cursor: pointer; border: 0;
  background: var(--ink); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  padding: 14px 22px; border-radius: 10px; margin-top: 4px;
  transition: opacity .18s;
}
.tkt-btn:hover { opacity: .88; }

.tkt-error {
  margin-top: 18px; padding: 12px 14px;
  background: var(--cream); border-left: 3px solid var(--alert);
  border-radius: 6px; font-size: 14px; color: var(--ink);
}

/* ── Loading ──────────────────────────────────────────────────────────────── */
.tkt-loading { text-align: center; padding: 64px 0; color: var(--mute); }
.tkt-spinner {
  display: inline-block; width: 26px; height: 26px; margin-bottom: 14px;
  border: 2px solid var(--line); border-top-color: var(--ink);
  border-radius: 50%; animation: tkt-spin .7s linear infinite;
}
@keyframes tkt-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tkt-spinner { animation-duration: 2.4s; } }

/* ── Result header ────────────────────────────────────────────────────────── */
.tkt-head { margin-bottom: 40px; }
.tkt-head__order {
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin: 0 0 8px;
}
.tkt-head__status {
  font-family: var(--font-display); font-weight: 800;
  font-size: 38px; line-height: 1.08; letter-spacing: -.025em; margin: 0;
}
.tkt-head__status.is-alert { color: var(--alert); }
.tkt-head__eta { margin: 12px 0 0; color: var(--mute); }
.tkt-head__eta strong { font-family: var(--font-display); font-weight: 700; color: var(--ink); }

/* ── Progress rail ────────────────────────────────────────────────────────── */
.tkt-rail {
  list-style: none; margin: 0 0 36px; padding: 0;
  display: grid; gap: 0;
}
.tkt-rail__step {
  position: relative; display: grid;
  grid-template-columns: 26px 1fr auto; align-items: center;
  gap: 14px; padding: 12px 0;
}
/* vertical connector (mobile) */
.tkt-rail__step::before {
  content: ""; position: absolute; left: 12px; top: 50%; bottom: -50%;
  width: 2px; background: var(--line);
}
.tkt-rail__step:last-child::before { display: none; }
.tkt-rail__step.is-done::before { background: var(--ink); }

.tkt-rail__dot {
  width: 12px; height: 12px; border-radius: 50%; margin-left: 7px;
  background: #fff; border: 2px solid var(--line); position: relative; z-index: 1;
}
.tkt-rail__step.is-done .tkt-rail__dot { background: var(--ink); border-color: var(--ink); }
.tkt-rail__step.is-current .tkt-rail__dot {
  background: var(--ink); border-color: var(--ink);
  box-shadow: 0 0 0 5px var(--pink);
}
.tkt-rail__label {
  font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--mute);
}
.tkt-rail__step.is-done .tkt-rail__label,
.tkt-rail__step.is-current .tkt-rail__label { color: var(--ink); }
.tkt-rail__step.is-current .tkt-rail__label { font-weight: 800; }
.tkt-rail__date { font-size: 13px; color: var(--mute); }

/* horizontal rail from 560px */
@media (min-width: 560px) {
  .tkt-rail { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .tkt-rail__step {
    grid-template-columns: 1fr; justify-items: center;
    text-align: center; gap: 8px; padding: 0;
  }
  .tkt-rail__step::before {
    left: 50%; right: -50%; top: 5px; bottom: auto;
    width: auto; height: 2px;
  }
  .tkt-rail__dot { margin-left: 0; }
  .tkt-rail__label { font-size: 13px; }
  .tkt-rail__date { font-size: 12px; }
}

/* ── Carrier ──────────────────────────────────────────────────────────────── */
.tkt-carrier {
  background: var(--pill-fill); border-radius: 14px;
  padding: 20px 22px; margin-bottom: 28px;
}
.tkt-carrier__row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; padding: 6px 0;
}
.tkt-carrier__label { font-size: 13px; color: var(--mute); }
.tkt-carrier__name { font-family: var(--font-display); font-weight: 700; }
.tkt-carrier__num { font-variant-numeric: tabular-nums; word-break: break-all; text-align: right; }
.tkt-carrier__link {
  display: inline-block; margin-top: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}

/* ── Map ──────────────────────────────────────────────────────────────────── */
.tkt-map { margin-bottom: 28px; }
.tkt-map iframe {
  width: 100%; height: 220px; border: 1px solid var(--line);
  border-radius: 14px; display: block; filter: saturate(.75);
}
.tkt-map__cap { margin: 10px 0 0; font-size: 13px; color: var(--mute); text-align: center; }

/* Shown instead of the map when WebGL is unavailable */
.tkt-place {
  display: grid; gap: 4px; justify-items: center; text-align: center;
  background: var(--pill-fill); border-radius: 14px; padding: 22px; margin-bottom: 28px;
}
.tkt-place__label {
  font-family: var(--font-display); font-weight: 600; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--mute);
}
.tkt-place__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; }

/* ── Items ────────────────────────────────────────────────────────────────── */
.tkt-items { margin-bottom: 28px; }
.tkt-item {
  display: grid; grid-template-columns: 56px 1fr auto;
  align-items: center; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--line-soft);
}
.tkt-item img, .tkt-items__ph {
  width: 56px; height: 68px; object-fit: cover;
  border-radius: 8px; background: var(--cream); display: block;
}
.tkt-item__name { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.tkt-item__var { margin: 2px 0 0; font-size: 13px; color: var(--mute); }
.tkt-item__qty { font-size: 14px; color: var(--mute); font-variant-numeric: tabular-nums; }

/* ── History ──────────────────────────────────────────────────────────────── */
.tkt-hist { border-top: 1px solid var(--line-soft); padding-top: 18px; }
.tkt-hist summary {
  cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--mute);
}
.tkt-hist summary::-webkit-details-marker { display: none; }
.tkt-hist summary::after { content: " +"; }
.tkt-hist[open] summary::after { content: " –"; }
.tkt-hist summary:hover { color: var(--ink); }
.tkt-hist ul { list-style: none; margin: 16px 0 0; padding: 0; }
.tkt-hist li {
  display: grid; grid-template-columns: 76px 1fr;
  gap: 12px; padding: 7px 0; font-size: 14px;
}
.tkt-hist__d { color: var(--mute); font-size: 13px; }

.tkt-foot-note { margin-top: 32px; font-size: 14px; color: var(--mute); }
.tkt-foot-note a { color: var(--ink); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.tkt-footer {
  border-top: 1px solid var(--line-soft);
  padding: 24px 16px 48px; text-align: center;
  font-size: 13px; color: var(--mute);
}
.tkt-footer a { color: var(--mute); text-decoration: none; }
.tkt-footer a:hover { color: var(--ink); text-decoration: underline; }
.tkt-footer span { margin: 0 8px; }

/* ── Multi-parcel switcher ────────────────────────────────────────────────── */
.tkt-ships { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:24px; }
.tkt-ship {
  appearance:none; cursor:pointer; background:#fff; color:var(--mute);
  border:1px solid var(--line); border-radius:999px;
  font-family:var(--font-display); font-weight:600; font-size:13px; padding:7px 16px;
  transition:background .18s, color .18s, border-color .18s;
}
.tkt-ship:hover { color:var(--ink); }
.tkt-ship.is-active { background:var(--pill-fill); border-color:var(--pink); color:var(--ink); }

/* ── No-JS fallback ───────────────────────────────────────────────────────── */
.tkt-noscript { padding:8px 0 32px; }
.tkt-noscript p { color:var(--mute); max-width:52ch; }

/* Focus ring for the programmatic focus move after a lookup */
.tkt-head__status:focus { outline:none; }
.tkt-head__status:focus-visible { outline:2px solid var(--ink); outline-offset:6px; border-radius:4px; }

/* Focus is moved to the headline after a lookup for screen readers; it is not
   an interactive control, so no visible ring. */
.tkt-head__status:focus { outline: none; }
