:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: #101115;
  --panel-2: #15161a;
  --line: #2a2c32;
  --line-soft: #202126;
  --text: #f7f7f8;
  --muted: #a2a5ad;
  --red: #ed1b2f;
  --red-dark: #a90f20;
  --green: #3fd18a;
  --page: min(1760px, calc(100vw - 64px));
  font-family: Inter, Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    var(--bg);
  background-size: 72px 72px;
}

button, input, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; overflow: hidden; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 82px;
  padding: 14px max(32px, calc((100vw - 1760px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, .96);
  backdrop-filter: blur(14px);
}

.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-lockup img { width: 52px; height: 52px; object-fit: contain; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 24px; letter-spacing: 0; }
.brand-copy small { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.system-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.system-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(63,209,138,.1); }
.catalog-link, .notification-actions a, .review-box a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-weight: 750;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.catalog-link:hover, .notification-actions a:hover, .review-box a:hover { border-color: var(--red); background: rgba(237,27,47,.08); transform: translateY(-1px); }

main { min-height: calc(100vh - 82px); }
.hero {
  width: var(--page);
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: 56px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(430px, .95fr);
  align-items: stretch;
  gap: 24px;
}

.lookup-panel, .route-visual {
  position: relative;
  min-height: 610px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.lookup-panel {
  padding: clamp(38px, 5vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(13,14,17,.96);
}
.lookup-panel::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--red); }
.eyebrow, .section-label, .route-topline > span, .route-caption > span, .error-code {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.hero-heading h1 { max-width: 760px; margin: 18px 0 16px; font-size: clamp(54px, 6vw, 104px); line-height: .9; letter-spacing: 0; }
.hero-subtitle { margin: 0; color: var(--muted); font-size: clamp(18px, 2vw, 24px); line-height: 1.45; }
.search-form { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.field { display: grid; gap: 9px; min-width: 0; }
.field span { color: #c8cad0; font-size: 13px; font-weight: 750; }
.field input {
  width: 100%; min-height: 58px; padding: 0 17px;
  border: 1px solid #393b43; border-radius: 4px; outline: 0;
  color: var(--text); background: #090a0d;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(237,27,47,.12); }
.field input::placeholder { color: #686b74; }
.primary-button {
  min-width: 178px; min-height: 58px; padding: 0 20px;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 24px;
  border: 0; border-radius: 4px; cursor: pointer; color: white; background: var(--red); font-weight: 850;
  transition: background .2s ease, transform .2s ease;
}
.primary-button:hover { background: #ff2439; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.primary-button b { font-size: 21px; }
.form-hint { margin: 14px 0 0; color: #777a83; font-size: 13px; }

.route-visual {
  padding: clamp(30px, 4vw, 58px);
  display: flex; flex-direction: column; justify-content: space-between;
  background: #121318;
}
.route-visual::after { content: "GR"; position: absolute; right: -18px; bottom: -50px; color: rgba(255,255,255,.025); font-size: 260px; font-weight: 900; pointer-events: none; }
.route-topline, .route-caption { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.route-topline strong { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.route-topline strong i { width: 54px; height: 1px; background: #535660; }
.route-journey {
  --route-position: 0px;
  --route-marker-x: 17px;
  --route-first: 0px;
  --route-height: 100%;
  --route-progress: 0px;
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  margin: 24px 0;
  display: grid;
  flex: 1;
  align-content: center;
}
.route-rail { position: absolute; top: var(--route-first); left: var(--route-marker-x); width: 2px; height: var(--route-height); background: #34363e; transform: translateX(-50%); }
.route-rail::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: var(--route-progress); background: var(--red); transition: height .78s cubic-bezier(.22,.8,.24,1); }
.route-stage { position: relative; min-height: 49px; padding: 5px 0 5px 52px; display: flex; align-items: center; color: #747780; transition: color .3s ease, transform .3s ease; }
.route-stage > i {
  position: absolute; left: 2px; top: 50%; width: 30px; height: 30px;
  display: grid; place-items: center;
  transform: translateY(-50%);
  border: 3px solid #121318; border-radius: 9px;
  background: #25272e; box-shadow: 0 0 0 1px #4b4e57;
  color: #a7aab2; font-size: 10px; line-height: 1; font-style: normal; font-weight: 900;
  transition: color .3s ease, background .3s ease, box-shadow .3s ease, transform .3s ease;
}
.route-stage > i.route-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.route-stage[data-motion="truck"] > i.route-icon svg,
.route-stage[data-motion="flight"] > i.route-icon svg { width: 18px; height: 18px; }
.route-stage[data-motion="warehouse"] > i.route-icon svg,
.route-stage[data-motion="hub"] > i.route-icon svg { width: 16px; height: 16px; }
.route-stage > span { display: grid; gap: 2px; min-width: 0; }
.route-stage b { color: inherit; font-size: 13px; line-height: 1.2; }
.route-stage small { color: #62656d; font-size: 10px; line-height: 1.25; transition: color .3s ease; }
.route-stage.done { color: #c7c9ce; }
.route-stage.done > i { color: white; background: var(--red-dark); box-shadow: 0 0 0 1px var(--red-dark); }
.route-stage.current { color: white; }
.route-stage.current > span { animation: stageTextIn .45s ease both; }
.route-stage.current > i { color: #111217; background: white; box-shadow: 0 0 0 7px rgba(237,27,47,.17); transform: translateY(-50%) scale(1.08); }
.route-stage.current > i::after { content: ""; position: absolute; inset: -8px; border: 1px solid rgba(237,27,47,.7); border-radius: 12px; animation: stageHalo .9s ease-out both; }
.route-stage.current small { color: #b7bac2; }
.route-stage.current[data-motion="payment"] > i { animation: coinTurn .85s ease both; }
.route-stage.current[data-motion="purchase"] > i { animation: purchaseDrop .8s cubic-bezier(.2,.8,.2,1) both; }
.route-stage.current[data-motion="truck"] > i { animation: truckDrive .9s ease both; }
.route-stage.current[data-motion="warehouse"] > i { animation: warehouseScan .9s ease both; }
.route-stage.current[data-motion="package"] > i { animation: packageClose .85s ease both; }
.route-stage.current[data-motion="flight"] > i { animation: planeFly .95s ease both; }
.route-stage.current[data-motion="hub"] > i { animation: hubArrival .85s ease both; }
.route-stage.current[data-motion="handoff"] > i { animation: handoffBounce .85s ease both; }
.route-stage.current[data-motion="received"] > i { animation: checkPop .75s cubic-bezier(.2,1.4,.3,1) both; }
.route-marker {
  position: absolute;
  z-index: 5;
  top: var(--route-position);
  left: var(--route-marker-x);
  width: 13px;
  height: 13px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(237,27,47,.18), 0 0 24px rgba(237,27,47,.7);
  transform: translate(-50%, -50%);
  opacity: 1;
  transition: top .78s cubic-bezier(.22,.8,.24,1), left .25s ease, opacity .2s ease;
}
.route-marker::after { content: ""; position: absolute; inset: -11px; border: 1px solid rgba(237,27,47,.5); border-radius: 50%; animation: markerPing 1.5s ease-out infinite; }
.route-journey.is-arrived .route-marker { opacity: 0; }
.route-journey.is-resetting .route-marker { opacity: 0; transition: none; }
.route-journey.is-resetting .route-rail::before { transition: none; }
.route-caption { min-height: 74px; padding-top: 22px; border-top: 1px solid var(--line); }
.route-caption strong { max-width: 70%; font-size: clamp(20px, 2vw, 30px); line-height: 1.12; text-align: right; }

.workspace { width: var(--page); min-height: 330px; margin: 0 auto 44px; }
.empty-state, .not-found {
  min-height: 280px; padding: 42px;
  display: flex; align-items: center; gap: 30px;
  border: 1px solid var(--line); background: rgba(12,13,16,.95);
}
.empty-index { color: var(--red); font-size: 62px; line-height: 1; font-weight: 900; }
.empty-state h2, .not-found h2 { margin: 0 0 10px; font-size: clamp(28px, 3vw, 46px); }
.empty-state p, .not-found p { max-width: 760px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.5; }
.not-found { display: block; border-left: 5px solid var(--red); animation: reveal .35s ease both; }
.not-found .error-code { display: block; margin-bottom: 20px; }

.parcel-card { border: 1px solid var(--line); background: var(--panel); animation: reveal .45s ease both; }
.parcel-head { min-height: 122px; padding: 28px 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.parcel-head h2 { margin: 7px 0 0; font-size: clamp(30px, 4vw, 58px); }
.status-pill { max-width: 430px; padding: 12px 16px; border: 1px solid rgba(237,27,47,.45); border-radius: 4px; color: #ff7a88; background: rgba(237,27,47,.08); font-weight: 800; text-align: center; }
.timeline-section, .order-summary, .contents-box, .notification-box, .review-box { padding: 34px; }
.timeline-section { border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading h3, .contents-box h3, .notification-box h3, .review-box h3 { margin: 7px 0 0; font-size: clamp(24px, 2.5vw, 36px); }
.route-count { color: var(--muted); font-size: 14px; }
.progress { display: grid; grid-template-columns: repeat(9, minmax(112px, 1fr)); overflow-x: auto; padding-bottom: 8px; scrollbar-color: var(--red) #18191d; }
.step { position: relative; min-height: 142px; padding: 24px 14px 18px; border-top: 3px solid #33353d; color: #6f727b; opacity: 0; animation: stepIn .35s ease forwards; animation-delay: var(--delay); }
.step::before { content: ""; position: absolute; top: -9px; left: 14px; width: 15px; height: 15px; border: 3px solid var(--panel); border-radius: 50%; background: #464951; }
.step span { display: block; margin-bottom: 14px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.step strong { display: block; max-width: 150px; font-size: 14px; line-height: 1.35; }
.step.done { border-color: var(--red-dark); color: #bbbcc2; }
.step.done::before { background: var(--red-dark); }
.step.current { border-color: var(--red); color: white; background: linear-gradient(180deg, rgba(237,27,47,.13), transparent); }
.step.current::before { background: white; box-shadow: 0 0 0 7px rgba(237,27,47,.16); animation: activePulse 1.8s ease-in-out infinite; }

.order-grid { display: grid; grid-template-columns: 1.1fr .9fr; border-bottom: 1px solid var(--line); }
.order-summary { border-right: 1px solid var(--line); }
.compact-heading { margin-bottom: 20px; }
.details { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.details div { padding: 20px; min-width: 0; }
.details div + div { border-left: 1px solid var(--line); }
.details dt, .note-box span { color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 800; }
.details dd { margin: 8px 0 0; font-size: 18px; font-weight: 750; overflow-wrap: anywhere; }
.note-box { margin-top: 14px; padding: 20px; border: 1px solid var(--line); background: #0c0d10; }
.note-box p { margin: 9px 0 0; color: #d6d7db; line-height: 1.55; }
.contents-box { background: #0d0e11; }
.contents-box p { margin: 18px 0 0; color: #d9dade; font-size: 20px; line-height: 1.55; white-space: pre-line; }
.notification-box, .review-box { display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.notification-actions { display: flex; gap: 10px; }
.review-box { border-top: 1px solid var(--line); background: #0d0e11; }
.stars { color: var(--red); letter-spacing: 2px; }
.review-box p { margin: 8px 0 0; color: var(--muted); }

.footer { width: var(--page); min-height: 92px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.footer nav { display: flex; gap: 22px; }
.footer a:hover { color: white; }

.stage-toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; width: min(420px, calc(100vw - 48px)); padding: 18px 20px; border: 1px solid var(--red); border-left-width: 5px; background: #121318; box-shadow: 0 20px 70px rgba(0,0,0,.55); animation: toastIn .4s ease both; }
.stage-toast span { display: block; margin-bottom: 7px; color: var(--red); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.stage-toast strong { display: block; line-height: 1.4; }
.celebration-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 8px; height: 18px; background: var(--particle); left: var(--x); animation: confettiFall var(--duration) linear var(--delay) forwards; }

@keyframes stageHalo { from { opacity: .9; transform: scale(.72); } to { opacity: 0; transform: scale(1.35); } }
@keyframes coinTurn { 0% { transform: translateY(-50%) rotateY(0) scale(.82); } 55% { transform: translateY(-50%) rotateY(180deg) scale(1.16); } 100% { transform: translateY(-50%) rotateY(360deg) scale(1.08); } }
@keyframes purchaseDrop { 0% { transform: translateY(-50%) rotate(-12deg) scale(.72); opacity: .25; } 65% { transform: translateY(-50%) rotate(6deg) scale(1.15); } 100% { transform: translateY(-50%) rotate(0) scale(1.08); opacity: 1; } }
@keyframes truckDrive { 0% { transform: translateY(-50%) rotate(-8deg) scale(.82); opacity: .2; } 65% { transform: translateY(-50%) rotate(5deg) scale(1.15); } 100% { transform: translateY(-50%) rotate(0) scale(1.08); opacity: 1; } }
@keyframes warehouseScan { 0%,100% { transform: translateY(-50%) scale(1.08); } 35% { transform: translateY(-50%) scale(.92); } 70% { transform: translateY(-50%) scale(1.17); } }
@keyframes packageClose { 0% { transform: translateY(-50%) rotate(-12deg) scale(.75); } 55% { transform: translateY(-50%) rotate(7deg) scale(1.18); } 100% { transform: translateY(-50%) rotate(0) scale(1.08); } }
@keyframes planeFly { 0% { transform: translateY(-50%) rotate(-18deg) scale(.72); opacity: .15; } 60% { transform: translateY(-50%) rotate(9deg) scale(1.18); } 100% { transform: translateY(-50%) rotate(0) scale(1.08); opacity: 1; } }
@keyframes hubArrival { 0% { letter-spacing: 5px; transform: translateY(-50%) scale(.8); opacity: .3; } 100% { letter-spacing: 0; transform: translateY(-50%) scale(1.08); opacity: 1; } }
@keyframes handoffBounce { 0%,100% { transform: translateY(-50%) rotate(0) scale(1.08); } 40% { transform: translateY(-50%) rotate(-12deg) scale(.92); } 70% { transform: translateY(-50%) rotate(8deg) scale(1.18); } }
@keyframes checkPop { 0% { transform: translateY(-50%) scale(.25) rotate(-25deg); opacity: 0; } 70% { transform: translateY(-50%) scale(1.25) rotate(4deg); } 100% { transform: translateY(-50%) scale(1.08); opacity: 1; } }
@keyframes stageTextIn { 0% { opacity: .52; transform: translateX(-5px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes markerPing { from { opacity: .8; transform: scale(.55); } to { opacity: 0; transform: scale(1.2); } }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes activePulse { 50% { box-shadow: 0 0 0 12px rgba(237,27,47,0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes confettiFall { to { transform: translate3d(var(--drift), 110vh, 0) rotate(620deg); opacity: .2; } }

@media (max-width: 1180px) {
  :root { --page: calc(100vw - 36px); }
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .lookup-panel, .route-visual { min-height: 500px; }
  .search-form { grid-template-columns: 1fr 1fr; }
  .primary-button { grid-column: 1 / -1; justify-content: center; }
  .progress { grid-template-columns: repeat(3, minmax(180px, 1fr)); overflow: visible; }
  .step { min-height: 112px; }
}

@media (max-width: 820px) {
  :root { --page: calc(100vw - 24px); }
  .topbar { min-height: 70px; padding: 10px 12px; }
  .brand-lockup img { width: 44px; height: 44px; }
  .brand-copy strong { font-size: 20px; }
  .system-state { display: none; }
  .catalog-link { min-height: 42px; padding: 0 12px; font-size: 13px; }
  .hero { padding: 12px 0 22px; gap: 12px; }
  .lookup-panel, .route-visual { min-height: auto; }
  .lookup-panel { padding: 34px 24px 30px; }
  .hero-heading h1 { font-size: 52px; }
  .hero-subtitle { font-size: 17px; }
  .search-form { margin-top: 32px; grid-template-columns: 1fr; }
  .primary-button { grid-column: auto; }
  .route-visual { padding: 26px 22px; }
  .route-journey { min-height: 440px; margin: 20px 0; }
  .route-caption { margin-top: 26px; align-items: end; }
  .route-caption strong { font-size: 24px; }
  .empty-state, .not-found { min-height: 230px; padding: 28px 22px; }
  .empty-index { display: none; }
  .parcel-head { padding: 22px; align-items: flex-start; flex-direction: column; }
  .status-pill { max-width: 100%; text-align: left; }
  .timeline-section, .order-summary, .contents-box, .notification-box, .review-box { padding: 24px 20px; }
  .progress { display: block; padding-left: 14px; }
  .step { min-height: 82px; padding: 12px 12px 18px 30px; border-top: 0; border-left: 3px solid #33353d; }
  .step::before { top: 11px; left: -9px; }
  .step.done { border-left-color: var(--red-dark); }
  .step.current { border-left-color: var(--red); }
  .step span { margin-bottom: 6px; }
  .step strong { max-width: none; }
  .order-grid { grid-template-columns: 1fr; }
  .order-summary { border-right: 0; border-bottom: 1px solid var(--line); }
  .details { grid-template-columns: 1fr; }
  .details div + div { border-left: 0; border-top: 1px solid var(--line); }
  .notification-box, .review-box { align-items: stretch; flex-direction: column; }
  .notification-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .footer { padding: 22px 0; }
}

@media (max-width: 480px) {
  .brand-copy small { display: none; }
  .catalog-link span { display: none; }
  .hero-heading h1 { font-size: 44px; }
  .route-visual { display: flex; }
  .route-stage { min-height: 47px; }
  .route-caption { align-items: flex-start; flex-direction: column; }
  .route-caption strong { max-width: 100%; text-align: left; }
  .notification-actions { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
