*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto;
  background:var(--bg);
  color:var(--text);
}

body,
input,
button{
  -webkit-tap-highlight-color:transparent;
}

.mobile-shell{
  width:100%;
  max-width:480px;
  min-height:100svh;
  margin:0 auto;
  padding-bottom:24px;
  background:#ffffff;
}

/* ===== HEADER ===== */
.header{
  background:#ffffff;
  padding:16px clamp(12px,4vw,20px) 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-bottom:1px solid #eef2f7;
}
.header-visual{
  width:min(100%, 400px);
  display:flex;
  align-items:center;
  justify-content:center;
}
.header img{
  width:100%;
  max-width:100%;
  height:auto;
  display:block;
  object-fit:contain;
}

/* ===== CARD ===== */
.card{
  background:var(--surface);
  margin:16px 14px 0;
  padding:18px 16px 20px;
  border-radius:20px;
  border:1px solid #edf2f7;
  box-shadow:0 10px 24px rgba(15,23,42,.05);
}

.card h1{
  font-size:clamp(24px, 5vw, 28px);
  line-height:1.15;
  margin:0 0 8px;
  color:var(--brand);
}

.subtitle{
  margin:0 0 18px;
  font-size:14px;
  line-height:1.5;
  color:var(--muted);
}

/* ===== INPUT ===== */
input{
  width:100%;
  min-height:52px;
  padding:14px 16px;
  font-size:16px;
  border:1px solid var(--border);
  border-radius:14px;
  margin-bottom:12px;
  outline:none;
}

input:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(212,5,17,.12);
}

.action-group{
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* ===== BUTTON ===== */
button{
  width:100%;
  min-height:52px;
  margin:0;
  display:block;
  padding:14px 16px;
  font-size:16px;
  border:none;
  border-radius:14px;
  background:var(--brand);
  color:#fff;
  font-weight:700;
  cursor:pointer;
}
button:active{opacity:.85}
button:disabled{
  opacity:.65;
}

#backBtn{
  background:#991b1b;
}

/* ===== RESULT ===== */
#trackingResult{
  margin-top:18px;
}

.info{
  margin-top:0;
  padding:14px;
  background:#fffafb;
  border:1px solid #ffd5d8;
  border-left:4px solid var(--brand);
  border-radius:14px;
  font-size:14px;
  line-height:1.6;
  overflow-wrap:anywhere;
}

.person-name{
  font-weight:800;
  color:var(--text);
}

.progress-container{
  height:20px;
  background:#eef2f7;
  border-radius:20px;
  margin:16px 0 10px;
  overflow:hidden;
}
.progress-bar{
  height:100%;
  width:0%;
  background:var(--brand);
  border-radius:20px;
  font-size:11px;
  font-weight:700;
  line-height:20px;
  color:#fff;
  text-align:center;
}

.status{
  text-align:center;
  font-weight:700;
  font-size:15px;
  line-height:1.5;
  color:#b45309;
}
.status.blink{animation:blink 1.5s infinite}
@keyframes blink{50%{opacity:.4}}

#countdown{
  text-align:center;
  font-size:13px;
  color:var(--muted);
  margin-top:6px;
}

#timelineV{
  margin-top:16px;
}

.timeline-step{
  position:relative;
  background:var(--surface);
  padding:14px 14px 14px 34px;
  margin:12px 0;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:0 4px 14px rgba(15,23,42,.04);
}
.timeline-step.active{
  border-color:#fda4af;
}
.timeline-step strong{
  display:block;
  font-size:14px;
  line-height:1.5;
}

.timeline-step::before{
  content:"";
  position:absolute;
  left:14px;
  top:18px;
  width:11px;
  height:11px;
  background:#d1d9e6;
  border-radius:50%;
  box-shadow:0 0 0 4px rgba(209,217,230,.35);
}

.timeline-step.active::before{
  background:var(--brand);
  box-shadow:0 0 0 4px rgba(212,5,17,.12);
}

.timeline-content{
  font-size:13px;
  line-height:1.6;
  color:var(--muted);
  overflow-wrap:anywhere;
}

/* ===== HIGHLIGHT STATUS TERBARU (LATEST ACTIVE) ===== */
.timeline-step.latest-active{
  background:#fff5f5;
  border-color:#fb7185;
  box-shadow:0 4px 12px rgba(212,5,17,.18);
  position:relative;
}

.timeline-step.latest-active::after{
  content:"UPDATE TERBARU";
  position:absolute;
  top:-10px;
  right:12px;
  font-size:10px;
  font-weight:bold;
  color:#fff;
  background:var(--brand);
  padding:2px 6px;
  border-radius:4px;
}
/* =========================
   DARK MODE DEFAULT ON
========================= */

body.dark {
  background:#0f172a;
  color:#e5e7eb;
}

body.dark .card {
  background:#020617;
  box-shadow:0 6px 20px rgba(0,0,0,.6);
}

body.dark input {
  background:#020617;
  border:1px solid #334155;
  color:#e5e7eb;
}

body.dark input:focus {
  border-color:#dc2626;
  box-shadow:0 0 0 3px rgba(220,38,38,.18);
}

body.dark input::placeholder {
  color:#94a3b8;
}

body.dark button {
  background:#dc2626;
}

body.dark #backBtn {
  background:#7f1d1d;
}

body.dark .info {
  background:#1f2933;
  border-color:#7f1d1d;
  border-left-color:#dc2626;
}

body.dark .progress-container {
  background:#1e293b;
}

body.dark .timeline-step {
  background:#020617;
  border:1px solid #334155;
}

.timeline-content strong,
body.dark .timeline-content{
  color:inherit;
}

body.dark .timeline-step::before {
  background:#475569;
  box-shadow:0 0 0 4px rgba(71,85,105,.24);
}

body.dark .timeline-step.active::before {
  background:#dc2626;
}

body.dark .timeline-step.latest-active {
  background:#1f2933;
  box-shadow:0 6px 18px rgba(220,38,38,.25);
}

body.dark .status {
  color:#facc15;
}

body.dark #countdown,
body.dark .subtitle {
  color:#94a3b8;
}

body.dark .header {
  background:#020617;
}

@media (max-width:360px){
  .header{
    padding:14px 10px 8px;
  }

  .header-visual{
    width:100%;
  }

  .card{
    margin:12px 10px 0;
    padding:16px 14px 18px;
  }

  .timeline-step{
    padding:13px 12px 13px 32px;
  }
}