/* Shipment card — official carrier-style layout (used on the tracking page and the admin preview).
   Colors come from --tk-* tokens so the card reads the same wherever it is placed. */
.tk-card {
  --tk-ink: #101828; --tk-muted: #5B6576; --tk-line: #DCE2EA; --tk-soft: #F5F7FA; --tk-surface: #FFFFFF;
  --tk-brand: #0E2A47; --tk-accent: #0B5CAD; --tk-accent-soft: #E8F1FB;
  --tk-ok: #1E7B46; --tk-ok-soft: #E6F4EC; --tk-bad: #B42318; --tk-bad-soft: #FDECEA; --tk-wait: #8A6100; --tk-wait-soft: #FFF6DB;
  background: var(--tk-surface); color: var(--tk-ink);
  border: 1px solid var(--tk-line); border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 2px rgb(16 24 40 / .05), 0 8px 24px rgb(16 24 40 / .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.5; text-align: left;
}
.tk-card * { box-sizing: border-box; }
.tk-k { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tk-muted); }

.tk-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  padding: 16px 22px; background: var(--tk-soft); border-bottom: 1px solid var(--tk-line); }
.tk-id { min-width: 0; }
.tk-code { font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace; font-size: 19px; font-weight: 600; letter-spacing: .05em; word-break: break-all; }
.tk-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tk-badge i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tk-badge--move { background: var(--tk-accent-soft); color: var(--tk-accent); }
.tk-badge--done { background: var(--tk-ok-soft); color: var(--tk-ok); }
.tk-badge--issue { background: var(--tk-bad-soft); color: var(--tk-bad); }
.tk-badge--wait { background: var(--tk-wait-soft); color: var(--tk-wait); }

.tk-status { padding: 20px 22px 6px; }
.tk-title { font-size: clamp(22px, 4.2vw, 28px); font-weight: 700; line-height: 1.2; margin-top: 4px; letter-spacing: -.01em; text-wrap: balance; }
.tk-status.is-done .tk-title { color: var(--tk-ok); }
.tk-status.is-issue .tk-title { color: var(--tk-bad); }
.tk-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; color: var(--tk-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tk-meta span::before { content: "•"; margin-right: 14px; color: var(--tk-line); }

.tk-progress { list-style: none; margin: 0; padding: 18px 22px 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--tk-line); }
.tk-progress li { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 13px; color: var(--tk-muted); padding: 0 4px; }
.tk-progress li::before { content: ""; position: absolute; top: 8px; right: 50%; width: 100%; height: 3px; background: var(--tk-line); }
.tk-progress li:first-child::before { display: none; }
.tk-dot { position: relative; z-index: 1; width: 19px; height: 19px; border-radius: 50%; background: var(--tk-surface); border: 3px solid var(--tk-line); }
.tk-progress li.is-past::before, .tk-progress li.is-now::before { background: var(--tk-accent); }
.tk-progress li.is-past .tk-dot { background: var(--tk-accent); border-color: var(--tk-accent); }
.tk-progress li.is-now .tk-dot { border-color: var(--tk-accent); box-shadow: 0 0 0 4px var(--tk-accent-soft); }
.tk-progress li.is-now { color: var(--tk-ink); font-weight: 600; }
.tk-progress li.is-done .tk-dot { background: var(--tk-ok); border-color: var(--tk-ok); box-shadow: 0 0 0 4px var(--tk-ok-soft); }
.tk-progress li.is-done::before { background: var(--tk-ok); }

.tk-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 680px) { .tk-body { grid-template-columns: minmax(0, 1fr); } }
.tk-body h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.tk-history { padding: 20px 22px; min-width: 0; }
.tk-history ol { list-style: none; margin: 0; padding: 0; }
.tk-history li { display: grid; grid-template-columns: 96px 16px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 18px; }
.tk-history li:last-child { padding-bottom: 0; }
.tk-history time { display: grid; font-size: 13px; color: var(--tk-muted); text-align: right; font-variant-numeric: tabular-nums; line-height: 1.35; }
.tk-pin { width: 11px; height: 11px; border-radius: 50%; background: var(--tk-line); margin: 4px auto 0; position: relative; z-index: 1; }
.tk-history li:not(:last-child)::after { content: ""; position: absolute; left: calc(96px + 12px + 7px); top: 16px; bottom: 2px; width: 2px; background: var(--tk-line); transform: translateX(-50%); }
.tk-history li.is-latest .tk-pin { background: var(--tk-accent); box-shadow: 0 0 0 4px var(--tk-accent-soft); }
.tk-history li.is-latest.is-done .tk-pin { background: var(--tk-ok); box-shadow: 0 0 0 4px var(--tk-ok-soft); }
.tk-history li.is-issue .tk-pin { background: var(--tk-bad); }
.tk-ev { min-width: 0; }
.tk-ev-title { font-weight: 600; }
.tk-history li:not(.is-latest) .tk-ev-title { font-weight: 500; }
.tk-ev-loc { color: var(--tk-muted); font-size: 14px; }
.tk-ev-note { font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.tk-del { border: 0; background: none; color: var(--tk-muted); cursor: pointer; font-size: 12.5px; padding: 2px 0; text-decoration: underline; }
.tk-del.armed { color: var(--tk-bad); font-weight: 600; }

.tk-details { padding: 20px 22px; background: var(--tk-soft); border-left: 1px solid var(--tk-line); min-width: 0; }
@media (max-width: 680px) { .tk-details { border-left: 0; border-top: 1px solid var(--tk-line); } }
.tk-details dl { margin: 0; display: grid; gap: 12px; }
.tk-details dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tk-items { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--tk-line); }
.tk-items ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.tk-items li { overflow-wrap: anywhere; }

@media (max-width: 440px) {
  .tk-head, .tk-status, .tk-progress, .tk-history, .tk-details { padding-left: 16px; padding-right: 16px; }
  .tk-progress { padding-left: 4px; padding-right: 4px; }
  .tk-progress li { font-size: 11.5px; }
  .tk-history li { grid-template-columns: 82px 14px minmax(0, 1fr); gap: 10px; }
  .tk-history li:not(:last-child)::after { left: calc(82px + 10px + 7px); }
  .tk-history time { font-size: 12px; }
  .tk-code { font-size: 16px; }
}
