/* Parcels — Legion palette: near-black + cream + gold. Mobile-first. */
:root {
  --bg: #0d0d0d;
  --panel: #171614;
  --panel-2: #1d1b18;
  --line: #2b2824;
  --cream: #ece9e2;
  --muted: #a8a59d;
  --gold: #c8a25c;
  --gold-bright: #d8b06a;
  --gold-dim: #8f7440;
  --red: #e0342a;
  --ok: #6fb56f;
  --air: #5e8eea;
  --sea: #2fb4c4;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Neue Haas Grotesk Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--cream); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
.app { display: flex; flex-direction: column; min-height: 100dvh; max-width: 760px; margin: 0 auto; background: radial-gradient(140% 60% at 50% -10%, #1a1814 0%, var(--bg) 55%); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); background: rgba(13,13,13,0.9); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 30px; height: 30px; color: var(--gold); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 600; font-size: 18px; letter-spacing: 5px; color: var(--gold); text-transform: uppercase; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 3px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* Main */
.main { flex: 1; padding: 18px 16px 8px; }
.intro { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0 0 16px; }
.intro strong { color: var(--cream); font-weight: 600; }

/* Gate */
.gate { display: flex; flex-direction: column; gap: 10px; padding: 24px 0; }
.gate-input { width: 100%; padding: 13px 14px; font-size: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--cream); }
.gate-input:focus { outline: none; border-color: var(--gold-dim); }
.gate-msg { font-size: 13px; color: var(--red); min-height: 18px; }

/* Screenshot thumbnails */
.shots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.shot { position: relative; }
.shot img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--line); display: block; }
.shot-x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; border: none; font-size: 15px; line-height: 1; cursor: pointer; }

/* Actions */
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.primary-btn { flex: 1; min-width: 150px; padding: 14px 18px; background: var(--gold); color: #16130d; border: none; font-weight: 600; font-size: 14px; letter-spacing: 0.5px; text-transform: uppercase; cursor: pointer; }
.primary-btn:active { background: var(--gold-bright); }
.primary-btn:disabled { opacity: 0.5; cursor: default; }
.ghost-btn { display: inline-flex; align-items: center; gap: 7px; padding: 14px 16px; background: transparent; color: var(--cream); border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.ghost-btn svg { width: 18px; height: 18px; }
.ghost-btn:active { border-color: var(--gold-dim); }

/* Results */
.results { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }

/* Summary bar */
.summary { font-size: 13px; line-height: 1.5; color: var(--muted); padding: 11px 13px; background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--gold); }
.summary .total { color: var(--cream); font-weight: 600; }
.summary .s-transit { color: var(--gold); font-weight: 600; }
.summary .s-ofd { color: var(--gold-bright); font-weight: 600; }
.summary .s-done { color: var(--ok); font-weight: 600; }
.summary .warn { color: var(--red); font-weight: 600; }

/* Group divider (e.g. Delivered) */
.group-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 4px 2px -4px; }

.pcard { background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--gold); padding: 16px; }
.pcard.air { border-top-color: var(--air); }
.pcard.sea { border-top-color: var(--sea); }
.pcard.done { border-top-color: var(--ok); opacity: 0.82; }
.pcard.alert { border-top-color: var(--red); }
.alert-line { font-size: 13.5px; font-weight: 600; color: var(--red); margin-bottom: 12px; }
.pcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pcard-label { font-family: var(--serif); font-size: 18px; line-height: 1.3; color: var(--cream); }
.pcard-tags { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.pcard-carrier { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); border: 1px solid var(--line); padding: 3px 7px; white-space: nowrap; }
.mode { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 3px 7px; border: 1px solid currentColor; white-space: nowrap; }
.mode svg { width: 12px; height: 12px; }
.mode.air { background: var(--air); color: #0d0d0d; border-color: var(--air); font-weight: 700; }
.mode.sea { background: var(--sea); color: #0d0d0d; border-color: var(--sea); font-weight: 700; }
.pcard-track { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

/* Legend explaining the bar */
.legend { border: 1px solid var(--line); background: var(--panel); }
.legend summary { cursor: pointer; list-style: none; padding: 11px 13px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; justify-content: space-between; }
.legend summary::-webkit-details-marker { display: none; }
.legend summary::after { content: "+"; color: var(--muted); font-size: 17px; line-height: 1; }
.legend[open] summary::after { content: "\2013"; }
.legend ol { margin: 0; padding: 2px 16px 14px 34px; }
.legend li { font-size: 13px; color: var(--cream); line-height: 1.75; }
.legend li span { color: var(--muted); }

/* Stage bar */
.bar-caption { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.bar { display: flex; gap: 3px; margin-bottom: 6px; }
.bar-ends { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: 0.5px; text-transform: uppercase; color: #6d6a63; margin-bottom: 11px; }
.stage-next { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.seg { flex: 1; height: 8px; background: var(--panel-2); border-radius: 2px; }
.seg.fill { background: var(--gold); }
.seg.fill.air { background: var(--air); }
.seg.fill.sea { background: var(--sea); }
.seg.fill.done { background: var(--ok); }
.seg.cur { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--gold-bright); }
.seg.cur.air { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--air); }
.seg.cur.sea { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--sea); }
.seg.cur.done { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ok); }

.stage-now { font-size: 15px; font-weight: 600; color: var(--cream); margin-bottom: 3px; }
.stage-now .n { color: var(--gold); font-weight: 700; }
.pcard.air .stage-now .n { color: var(--air); }
.pcard.sea .stage-now .n { color: var(--sea); }
.pcard.done .stage-now .n { color: var(--ok); }
.status-en { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.meta { font-size: 12px; color: #6d6a63; margin-top: 8px; }

/* Status / spinner */
.status { text-align: center; color: var(--muted); font-size: 13px; padding: 16px; }
.status.err { color: var(--red); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; font-size: 11px; color: #6d6a63; padding: 16px; line-height: 1.5; }
