/* Tracking page. System fonts only; --brand / --on-brand are set from config.js. Mobile first. */
:root {
  --brand: #0f5fa8;
  --on-brand: #ffffff;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #16202a;
  --muted: #55606b;
  --line: #d5dbe1;
  --ok: #17663a;
  --warn: #9a3412;
  --error: #b42318;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
html[lang="ur"] body { font-family: var(--font-ur); line-height: 1.9; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--card); color: var(--text); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

.top { background: var(--brand); color: var(--on-brand); }
.top-inner { max-width: 640px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { height: 36px; width: auto; max-width: 140px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.company { font-weight: 700; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang { font: inherit; font-size: .95rem; color: var(--on-brand); background: transparent; border: 1px solid currentColor; border-radius: 999px; padding: 4px 14px; min-height: 36px; cursor: pointer; }
.lang:focus-visible, .go:focus-visible, input:focus-visible, a:focus-visible, .result-status:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.top .lang:focus-visible { outline-color: var(--on-brand); }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
main:focus { outline: none; }
h1 { font-size: 1.5rem; line-height: 1.3; margin: 8px 0 4px; }
.intro { margin: 0 0 16px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

.field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input { font: inherit; font-size: 1.1rem; width: 100%; padding: 10px 12px; min-height: 48px; border: 1px solid #8a96a3; border-radius: 8px; background: #fff; color: var(--text); letter-spacing: .02em; }
input.short { max-width: 9rem; letter-spacing: .3em; }
input[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.hint { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.err { margin: 6px 0 0; font-size: .95rem; color: var(--error); font-weight: 600; }
.go { font: inherit; font-weight: 700; font-size: 1.05rem; width: 100%; min-height: 48px; border: 0; border-radius: 8px; background: var(--brand); color: var(--on-brand); cursor: pointer; }
.go[disabled] { opacity: .7; cursor: progress; }

.status { margin: 16px 0 0; min-height: 1.5em; }
.status.is-error { color: var(--error); font-weight: 600; background: #fdecea; border: 1px solid #f5c2bd; border-radius: 8px; padding: 12px; }
.status:empty { display: none; }

.result { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.result-head { padding: 16px; border-bottom: 1px solid var(--line); border-inline-start: 6px solid var(--brand); }
.result-head.tone-ok { border-inline-start-color: var(--ok); }
.result-head.tone-warn { border-inline-start-color: var(--warn); }
.result-status { margin: 0; font-size: 1.4rem; line-height: 1.3; }
.tone-ok .result-status { color: var(--ok); }
.tone-warn .result-status { color: var(--warn); }
.result-when { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

.facts { margin: 0; padding: 8px 16px; display: grid; gap: 0; }
.fact { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact dt { color: var(--muted); }
.fact dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.history-title { font-size: 1.05rem; margin: 8px 16px 4px; }
.muted { color: var(--muted); margin: 0 16px 16px; }
.timeline { list-style: none; margin: 0; padding: 8px 16px 16px; }
.tl { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; inset-inline-start: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl-dot { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 4px; border-radius: 50%; background: #fff; border: 3px solid #8a96a3; }
.tl.current .tl-dot { border-color: var(--brand); background: var(--brand); }
.tl.tone-ok.current .tl-dot { border-color: var(--ok); background: var(--ok); }
.tl.tone-warn .tl-dot { border-color: var(--warn); }
.tl.tone-warn.current .tl-dot { background: var(--warn); }
.tl-body { min-width: 0; }
.tl-label { margin: 0; font-weight: 600; }
.tl.current .tl-label { font-weight: 700; }
.tl-when { display: block; color: var(--muted); font-size: .9rem; }
.tl-reason { margin: 2px 0 0; font-size: .95rem; overflow-wrap: anywhere; }

.foot { border-top: 1px solid var(--line); margin-top: 24px; }
.support-label { margin: 0 0 4px; font-weight: 600; }
.support { margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.support a { color: var(--text); font-weight: 600; text-decoration: underline; min-height: 44px; display: inline-flex; align-items: center; }

@media (min-width: 600px) {
  h1 { font-size: 1.75rem; }
  .card { padding: 24px; }
  .go { width: auto; padding: 0 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .top, .foot, form, .lang { display: none !important; } .result { border: 0; } }
