/* ════════════════════════════════════════════════════════════════════════
   Movemate PTL Tracking — aesthetic per DESIGN.md
   Tech-first logistics, made calm. Light canvas, one pop of brand yellow.
   ════════════════════════════════════════════════════════════════════════ */

:root{
  /* Brand / palette (DESIGN.md §3) */
  --yellow:      #f7c911;
  --yellow-deep: #e3b200;
  --yellow-soft: #fef4cf;
  --ink:         #2c2824;
  --sub:         #6c655e;
  --faint:       #a39c93;
  --green:       #1aa860;
  --amber:       #e0a000;   /* attention: delayed / on-hold */
  --alert:       #d8643c;   /* undelivered / return — restrained warm */
  --bg:          #f4f5f7;
  --card:        #ffffff;
  --border:      #ecebe7;
  --charcoal:    #272320;   /* the one dark moment */

  --shadow-card:  0 1px 2px rgba(44,40,36,.04), 0 6px 20px rgba(44,40,36,.05);
  --shadow-float: 0 10px 40px rgba(44,40,36,.12);

  --r-pill: 99px;
  --r-card: 14px;
  --r-glass: 20px;
  --r-tile: 10px;

  --pad: 20px;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background:var(--bg);
  color:var(--ink);
  font-size:15px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
.mono{ font-family:'Space Grotesk', 'Plus Jakarta Sans', monospace; }

a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }

/* Mobile-first single column; framed on wider viewports */
.shell{
  max-width:430px;
  margin:0 auto;
  min-height:100vh;
  background:var(--bg);
}
@media (min-width:560px){
  body{ padding:28px 16px; }
  .shell{
    border-radius:28px;
    box-shadow:var(--shadow-float);
    overflow:hidden;
    min-height:auto;
    background:var(--bg);
  }
}

/* ── NAV ─────────────────────────────────────────────────────────────────── */
nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px var(--pad);
  background:var(--card);
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:20;
}
.nav-logo-svg{ height:24px; width:auto; display:block; }
/* recolour the brand mark to the light-theme palette */
.nav-logo-svg path[fill="#FFFFFF"]{ fill:var(--ink); }
.nav-logo-svg path[fill="#FF6B2B"]{ fill:var(--yellow-deep); }
.nav-links{ display:none; }
.nav-cta{
  background:var(--yellow); color:var(--ink);
  border:none; border-radius:var(--r-pill);
  font-weight:700; font-size:13px; padding:9px 16px;
  transition:transform .15s ease, box-shadow .15s ease;
}
.nav-cta:hover{ transform:translateY(-1px); box-shadow:0 6px 16px rgba(247,201,17,.4); }

/* ── HERO SEARCH ─────────────────────────────────────────────────────────── */
.hero{
  padding:30px var(--pad) 24px;
  background:var(--card);
  border-bottom:1px solid var(--border);
}
.hero-eyebrow{
  font-size:11px; font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  color:var(--yellow-deep);
}
.hero-title{
  font-size:27px; font-weight:800; letter-spacing:-.02em;
  margin:6px 0 6px; line-height:1.15;
}
.hero-sub{ color:var(--sub); margin:0 0 20px; font-size:14px; }

.search-box{
  display:flex; align-items:center; gap:8px;
  background:var(--bg);
  border:1.5px solid var(--border);
  border-radius:var(--r-pill);
  padding:6px 6px 6px 16px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.search-box:focus-within{
  border-color:var(--yellow);
  box-shadow:0 0 0 4px var(--yellow-soft);
}
.search-icon{ flex:0 0 auto; color:var(--faint); display:flex; }
.search-box input{
  flex:1 1 auto; border:none; background:transparent; outline:none;
  font-family:inherit; font-size:15px; color:var(--ink); padding:8px 0; min-width:0;
}
.search-box input::placeholder{ color:var(--faint); }
.search-btn{
  flex:0 0 auto;
  background:var(--yellow); color:var(--ink);
  border:none; border-radius:var(--r-pill);
  font-weight:700; font-size:14px; padding:11px 20px;
  transition:transform .15s ease, box-shadow .15s ease, opacity .15s;
}
.search-btn:hover{ transform:translateY(-1px); box-shadow:0 6px 16px rgba(247,201,17,.45); }
.search-btn:disabled{ opacity:.6; cursor:default; transform:none; box-shadow:none; }
.search-hint{ font-size:12px; color:var(--faint); margin:10px 2px 0; }

/* ── MAIN ────────────────────────────────────────────────────────────────── */
.main{ padding:var(--pad); }

/* Empty state */
.empty-state{ text-align:center; padding:48px 16px; }
.empty-mark{
  width:64px; height:64px; border-radius:18px; margin:0 auto 16px;
  background:var(--yellow-soft); display:flex; align-items:center; justify-content:center;
  color:var(--yellow-deep);
}
.empty-title{ font-weight:700; font-size:17px; }
.empty-sub{ color:var(--sub); font-size:14px; margin-top:4px; }

/* Generic card */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--r-card);
  box-shadow:var(--shadow-card);
}

/* ── STATUS PILL ─────────────────────────────────────────────────────────── */
.pill{
  display:inline-flex; align-items:center; gap:7px;
  border-radius:var(--r-pill); font-weight:700; font-size:12.5px;
  padding:6px 13px; white-space:nowrap;
}
.pill .dot{ width:7px; height:7px; border-radius:50%; background:currentColor; }
.pill.is-live .dot{ animation:pulse 1.6s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ box-shadow:0 0 0 0 currentColor; opacity:1 } 50%{ box-shadow:0 0 0 5px transparent; opacity:.55 } }

.pill.s-delivered { background:rgba(26,168,96,.12);  color:var(--green); }
.pill.s-transit   { background:var(--yellow-soft);   color:var(--yellow-deep); }
.pill.s-ofd       { background:var(--yellow-soft);   color:var(--yellow-deep); }
.pill.s-onhold    { background:rgba(224,160,0,.14);  color:var(--amber); }
.pill.s-undelivered,
.pill.s-rto       { background:rgba(216,100,60,.14); color:var(--alert); }
.pill.s-booked    { background:#eef0f2;              color:var(--sub); }

/* ── DETAIL: status header ───────────────────────────────────────────────── */
.detail{ display:flex; flex-direction:column; gap:14px; }
.detail-col{ display:flex; flex-direction:column; gap:14px; min-width:0; }

.status-head{ padding:18px; }
.status-head .row1{ display:flex; align-items:center; justify-content:space-between; gap:10px 12px; flex-wrap:wrap; }
.status-head .row1 > div:first-child{ min-width:0; }
.pill{ max-width:100%; overflow:hidden; }
.cn-label{ font-size:10.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--faint); }
.cn-value{ font-size:21px; font-weight:700; letter-spacing:.01em; }
.status-answer{ margin-top:14px; }
.answer-label{ font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--faint); }
.delayed-tag{ display:inline-block; margin-left:8px; padding:2px 8px; border-radius:999px;
  font-size:11px; font-weight:700; letter-spacing:.02em; text-transform:none;
  color:var(--alert); background:#fdece5; vertical-align:middle; }
.answer-value{ font-size:26px; font-weight:800; letter-spacing:-.01em; line-height:1.1; margin-top:2px; }
.answer-sub{ color:var(--sub); font-size:13.5px; margin-top:4px; }

/* ── ROUTE + PROGRESS ────────────────────────────────────────────────────── */
.route{ padding:20px 18px; }
.route-ends{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:14px; }
.route-city{ font-size:16px; font-weight:700; max-width:45%; }
.route-city.dest{ text-align:right; }
.route-role{ font-size:10.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--faint); margin-top:2px; }
.route-city.dest .route-role{ text-align:right; }

.track-line{ position:relative; height:6px; border-radius:99px; background:var(--border); }
.track-fill{
  position:absolute; left:0; top:0; height:100%; border-radius:99px;
  background:linear-gradient(90deg, var(--yellow), var(--yellow-deep));
  width:0; transition:width .8s cubic-bezier(.4,0,.1,1);
}
.track-fill.is-green{ background:linear-gradient(90deg,#37c47e,var(--green)); }
.track-fill.is-amber{ background:linear-gradient(90deg,#f0bf52,var(--amber)); }
.track-fill.is-alert{ background:linear-gradient(90deg,#e8895f,var(--alert)); }
.track-knob{
  position:absolute; top:50%; transform:translate(-50%,-50%);
  width:16px; height:16px; border-radius:50%; background:var(--card);
  border:3px solid var(--yellow-deep);
  box-shadow:0 2px 6px rgba(44,40,36,.18);
  left:0; transition:left .8s cubic-bezier(.4,0,.1,1);
}
.track-knob.is-green{ border-color:var(--green); }
.track-knob.is-amber{ border-color:var(--amber); }
.track-knob.is-alert{ border-color:var(--alert); }

/* ── META GRID ───────────────────────────────────────────────────────────── */
.meta-grid{ display:grid; grid-template-columns:1fr 1fr; }
.meta-cell{ padding:14px 18px; border-top:1px solid var(--border); }
.meta-cell:nth-child(odd){ border-right:1px solid var(--border); }
.meta-label{ font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--faint); }
.meta-val{ font-size:14.5px; font-weight:600; margin-top:3px; word-break:break-word; }

/* ── DELIVERY ATTEMPTS (Table2) ──────────────────────────────────────────── */
.attempts{ padding:18px; }
.section-title{ font-size:11px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; color:var(--faint); margin-bottom:12px; }
.attempt{
  border-left:3px solid var(--alert);
  background:rgba(216,100,60,.05);
  border-radius:0 10px 10px 0;
  padding:10px 14px; margin-bottom:10px;
}
.attempt:last-child{ margin-bottom:0; }
.attempt-top{ display:flex; justify-content:space-between; gap:10px; align-items:baseline; }
.attempt-status{ font-weight:700; font-size:14px; color:var(--alert); }
.attempt-date{ font-size:12px; color:var(--sub); }
.attempt-meta{ font-size:13px; color:var(--ink); margin-top:3px; }
.attempt-meta b{ color:var(--sub); font-weight:600; }
.attempt-action{
  display:inline-block; margin-top:6px; font-size:11.5px; font-weight:700;
  background:var(--alert); color:#fff; border-radius:99px; padding:2px 10px;
}

/* ── TIMELINE (movementDetail) ───────────────────────────────────────────── */
.timeline{ padding:18px; }
.tl-item{ display:flex; gap:14px; position:relative; padding-bottom:18px; }
.tl-item:last-child{ padding-bottom:0; }
.tl-rail{ flex:0 0 auto; display:flex; flex-direction:column; align-items:center; }
.tl-dot{ width:13px; height:13px; border-radius:50%; background:var(--border); margin-top:3px; z-index:1; }
.tl-dot.done{ background:var(--yellow-deep); }
.tl-dot.active{ background:var(--yellow); box-shadow:0 0 0 4px var(--yellow-soft); }
.tl-dot.delivered{ background:var(--green); box-shadow:0 0 0 4px rgba(26,168,96,.16); }
.tl-line{ flex:1 1 auto; width:2px; background:var(--border); margin:3px 0 -18px; }
.tl-item:last-child .tl-line{ display:none; }
.tl-body{ flex:1 1 auto; padding-bottom:2px; }
.tl-title{ font-weight:700; font-size:14.5px; }
.tl-title.muted{ color:var(--faint); font-weight:600; }
.tl-loc{ font-size:13px; color:var(--sub); margin-top:1px; }
.tl-time{ font-size:12px; color:var(--faint); margin-top:2px; }
.tl-tag{
  display:inline-block; margin-top:6px; font-size:11px; font-weight:700;
  background:var(--bg); border:1px solid var(--border); color:var(--sub);
  border-radius:99px; padding:2px 10px;
}

/* ── MULTI-LR SUMMARY ────────────────────────────────────────────────────── */
.summary-head{ font-size:13px; color:var(--sub); margin-bottom:12px; }
.summary-head b{ color:var(--ink); }
.sum-list{ display:flex; flex-direction:column; gap:10px; }
.sum-row{ background:var(--card); border:1px solid var(--border); border-radius:var(--r-card); box-shadow:var(--shadow-card); overflow:hidden; }
.sum-trigger{
  width:100%; text-align:left; background:none; border:none;
  display:flex; flex-direction:column; gap:7px; padding:14px 16px;
}
.sum-cn-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.sum-cn{ font-weight:700; font-size:15px; font-family:'Space Grotesk', monospace; }
.sum-line2{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.sum-route{ font-size:12.5px; color:var(--sub); min-width:0; flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sum-pill{ flex:0 0 auto; }
.sum-chevron{ color:var(--faint); transition:transform .25s ease; display:flex; flex:0 0 auto; }
.sum-row.open .sum-chevron{ transform:rotate(180deg); }
.sum-detail{ display:none; padding:0 16px 16px; border-top:1px solid var(--border); }
.sum-row.open .sum-detail{ display:block; }
.sum-detail .detail{ margin-top:14px; }
.sum-detail .card{ box-shadow:none; }
.sum-loading,.sum-error{ font-size:12.5px; color:var(--faint); }
.sum-error{ color:var(--alert); }

/* ── CLOSING MARKETING CARD (the one dark moment) ────────────────────────── */
.brand-card{
  margin:6px var(--pad) 0;
  background:var(--charcoal);
  border-radius:18px;
  padding:28px 22px;
  position:relative; overflow:hidden;
  text-align:center;
}
.brand-card::before{
  content:""; position:absolute; top:-40%; left:50%; transform:translateX(-50%);
  width:280px; height:280px; border-radius:50%;
  background:radial-gradient(circle, rgba(247,201,17,.35), transparent 65%);
  pointer-events:none;
}
.brand-card h3{ color:#fff; font-size:20px; font-weight:800; margin:0 0 6px; position:relative; }
.brand-card p{ color:#c9c2b8; font-size:13.5px; margin:0 0 18px; position:relative; }
.brand-cta{
  position:relative; display:block; width:100%;
  background:var(--yellow); color:var(--ink);
  border:none; border-radius:var(--r-pill);
  font-weight:800; font-size:15px; padding:14px;
}
.brand-contacts{ position:relative; margin-top:14px; display:flex; gap:18px; justify-content:center; }
.brand-contacts a{ color:var(--yellow); font-size:13px; font-weight:700; }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
footer{
  padding:22px var(--pad) 28px; text-align:center;
  color:var(--faint); font-size:12px; line-height:1.7;
}
footer a{ color:var(--sub); font-weight:600; }

/* ── TOAST ───────────────────────────────────────────────────────────────── */
.toast{
  position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(20px);
  background:var(--charcoal); color:#fff; font-size:13.5px; font-weight:600;
  padding:12px 18px; border-radius:var(--r-pill);
  box-shadow:var(--shadow-float); opacity:0; pointer-events:none;
  transition:opacity .25s ease, transform .25s ease; z-index:50; max-width:90%;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* spinner */
.spinner{
  width:15px; height:15px; border-radius:50%;
  border:2px solid var(--border); border-top-color:var(--yellow-deep);
  display:inline-block; animation:spin .7s linear infinite; vertical-align:-2px;
}
@keyframes spin{ to{ transform:rotate(360deg) } }

/* local-review banner */
.mock-banner{ background:var(--charcoal); color:var(--yellow); font-size:12px; text-align:center; padding:7px 14px; }
.mock-banner code{ background:rgba(255,255,255,.1); color:#fff; padding:1px 6px; border-radius:5px; cursor:pointer; margin:0 1px; }

/* ── DESKTOP / RESPONSIVE (≥1024px) ──────────────────────────────────────────
   Mobile-first layout above stays untouched; on wide viewports the shell grows,
   the nav gains links, the hero centres, and the detail view goes two-column. */
.nav-links a{ font-size:14px; font-weight:600; color:var(--sub); transition:color .15s ease; }
.nav-links a:hover{ color:var(--ink); }
.nav-links a.active{ color:var(--ink); }

@media (min-width:900px){
  body{ padding:40px 24px; }
  .shell{ max-width:1080px; border-radius:28px; }

  nav{ padding:18px 36px; }
  .nav-links{ display:flex; gap:30px; margin-left:auto; margin-right:32px; align-items:center; }

  /* Hero: centred, search constrained to a comfortable width */
  .hero{ padding:52px 36px 40px; text-align:center; }
  .hero-title{ font-size:36px; }
  .hero-sub{ font-size:15.5px; }
  .search-box{ max-width:640px; margin:0 auto; padding:8px 8px 8px 18px; }
  .search-box input{ font-size:16px; }
  .search-hint{ text-align:center; }

  .main{ padding:32px 36px; }
  .empty-state{ padding:80px 16px; }

  /* Detail: two columns side-by-side (info | history) */
  .detail{
    display:grid;
    grid-template-columns:minmax(0,0.92fr) minmax(0,1.08fr);
    gap:22px;
    align-items:start;
  }
  .answer-value{ font-size:30px; }

  /* Multi-LR summary: keep readable width, centred; expanded detail stays 1-col */
  .sum-list{ max-width:900px; margin:0 auto; }
  .summary-head{ max-width:900px; margin-left:auto; margin-right:auto; }
  .sum-detail .detail{ grid-template-columns:1fr; }

  .brand-card{ margin:10px 36px 0; padding:40px 36px; }
  .brand-card::before{ width:420px; height:420px; }
  .brand-cta{ max-width:360px; margin:0 auto; }
  footer{ padding:28px 36px 36px; }
}

/* Tablet: a touch wider than phone, still single column */
@media (min-width:640px) and (max-width:899px){
  .shell{ max-width:560px; }
}
