:root {
      --navy-950: #0a1628; --navy-900: #10233f; --navy-800: #183866;
      --navy-700: #1d4d83; --navy-600: #2563a8;
      --gold-500: #c99a2e; --gold-400: #dab44a; --gold-100: #fff8e1;
      --ink: #172033; --muted: #5f6c80; --subtle: #8a96a8;
      --line: #dbe3ee; --line-light: #edf1f7;
      --surface: #ffffff; --surface-soft: #f6f8fb; --surface-dim: #eef2f7;
      --success: #059669; --success-light: #d1fae5;
      --danger: #dc2626; --danger-light: #fee2e2;
      --warning: #d97706; --warning-light: #fef3c7;
      --radius: 10px; --radius-lg: 16px;
      --shadow: 0 8px 32px rgba(16,35,63,.1);
      --shadow-lg: 0 20px 50px rgba(16,35,63,.15);
      --font: "Noto Sans Lao", system-ui, sans-serif;
      --transition: 220ms cubic-bezier(.4,0,.2,1);
    }
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body {
      font-family: var(--font); color: var(--ink);
      background: var(--surface-soft); line-height: 1.65;
      min-height: 100vh;
    }
    img { display: block; max-width: 100%; }
    a { color: inherit; text-decoration: none; }
    button, input { font: inherit; }
    ::selection { background: var(--navy-600); color: #fff; }

    .container { width: min(720px, calc(100% - 32px)); margin: 0 auto; }

    /* ─── TOPBAR ─── */
    .topbar {
      position: sticky; top: 0; z-index: 50;
      border-bottom: 1px solid rgba(219,227,238,.7);
      background: rgba(255,255,255,.88);
      backdrop-filter: blur(20px);
    }
    .nav {
      display: flex; align-items: center; justify-content: space-between;
      min-height: 68px; gap: 16px;
    }
    .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--navy-950); font-size: .95rem; }
    .brand-mark {
      display: grid; place-items: center;
      width: 40px; height: 40px; border-radius: var(--radius);
      background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
      color: #fff; box-shadow: inset 0 -2px 0 var(--gold-500);
    }
    .nav-right a {
      padding: 9px 16px; border-radius: var(--radius);
      color: var(--muted); font-weight: 700; font-size: .9rem;
      transition: var(--transition);
    }
    .nav-right a:hover { background: var(--surface-soft); color: var(--navy-800); }

    /* ─── HERO ─── */
    .page-hero {
      background: linear-gradient(135deg, var(--navy-900), var(--navy-950));
      color: #fff; padding: 56px 0 64px; text-align: center;
      position: relative; overflow: hidden;
    }
    .page-hero::after {
      content: ""; position: absolute; inset: auto 0 0;
      height: 5px; background: linear-gradient(90deg, var(--gold-500), var(--gold-400), var(--navy-600));
    }
    .page-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 10px; }
    .page-hero p { color: rgba(255,255,255,.75); max-width: 500px; margin: 0 auto; font-size: .95rem; }

    /* ─── SEARCH BOX ─── */
    .search-box {
      background: var(--surface); border: 1px solid var(--line);
      border-radius: var(--radius-lg); padding: 32px;
      margin: -36px auto 28px; position: relative; z-index: 10;
      box-shadow: var(--shadow-lg);
    }
    .search-box h2 { font-size: 1.15rem; color: var(--navy-950); margin-bottom: 6px; }
    .search-box > p { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }
    .search-row {
      display: flex; gap: 10px;
    }
    .search-input {
      flex: 1; padding: 14px 16px; border: 1.5px solid var(--line);
      border-radius: var(--radius); color: var(--ink); background: var(--surface-soft);
      font-size: 1rem; transition: var(--transition);
    }
    .search-input:focus { border-color: var(--navy-600); outline: none; box-shadow: 0 0 0 4px rgba(37,99,168,.12); }
    .search-input::placeholder { color: var(--subtle); }
    .search-btn {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 14px 24px; border: 0; border-radius: var(--radius);
      background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
      color: #fff; font-weight: 800; cursor: pointer;
      transition: var(--transition); white-space: nowrap;
    }
    .search-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(29,77,131,.3); }
    .search-btn:disabled { opacity: .6; cursor: wait; transform: none !important; }

    /* ─── RESULTS ─── */
    .results-area { margin-bottom: 40px; }
    .result-empty {
      text-align: center; padding: 48px 24px;
      color: var(--muted); font-size: .95rem;
    }
    .result-empty .empty-icon {
      width: 64px; height: 64px; margin: 0 auto 16px;
      border-radius: 50%; background: var(--surface-dim);
      display: grid; place-items: center; color: var(--subtle);
    }

    /* Single Result Card */
    .track-card {
      background: var(--surface); border: 1px solid var(--line);
      border-radius: var(--radius-lg); overflow: hidden;
      box-shadow: var(--shadow); margin-bottom: 18px;
      animation: fadeUp .5s ease both;
    }
    @keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

    .track-card-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 20px 24px; background: var(--surface-soft);
      border-bottom: 1px solid var(--line-light);
    }
    .track-card-header .tc-title { font-weight: 800; color: var(--navy-950); }
    .track-card-header .tc-id { font-family: monospace; font-size: .82rem; color: var(--muted); }

    .track-card-body { padding: 24px; }

    /* Status Timeline */
    .timeline {
      display: flex; justify-content: space-between; position: relative;
      margin-bottom: 28px; padding: 0 12px;
    }
    .timeline::before {
      content: ""; position: absolute;
      top: 18px; left: 48px; right: 48px;
      height: 3px; background: var(--line);
      border-radius: 2px;
    }
    .tl-step {
      display: flex; flex-direction: column; align-items: center;
      gap: 8px; position: relative; z-index: 1; text-align: center;
      flex: 1;
    }
    .tl-dot {
      width: 38px; height: 38px; border-radius: 50%;
      display: grid; place-items: center;
      background: var(--surface); border: 3px solid var(--line);
      color: var(--subtle); transition: var(--transition);
    }
    .tl-step.active .tl-dot {
      border-color: var(--navy-600); background: var(--navy-600); color: #fff;
      box-shadow: 0 0 0 6px rgba(37,99,168,.15);
    }
    .tl-step.done .tl-dot {
      border-color: var(--success); background: var(--success); color: #fff;
    }
    .tl-step.fail .tl-dot {
      border-color: var(--danger); background: var(--danger); color: #fff;
    }
    .tl-label {
      font-size: .78rem; font-weight: 700; color: var(--muted);
      max-width: 80px;
    }
    .tl-step.active .tl-label { color: var(--navy-800); font-weight: 800; }
    .tl-step.done .tl-label { color: var(--success); }

    /* Info Grid */
    .info-grid {
      display: grid; grid-template-columns: repeat(2, 1fr);
      gap: 12px; margin-bottom: 20px;
    }
    .info-item {
      padding: 14px; border-radius: var(--radius);
      background: var(--surface-soft); border: 1px solid var(--line-light);
    }
    .info-item .lbl { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
    .info-item .val { color: var(--navy-950); font-weight: 700; margin-top: 3px; overflow-wrap: anywhere; }

    /* Award banner */
    .award-banner {
      display: flex; align-items: center; gap: 14px;
      padding: 18px 24px; border-radius: var(--radius);
      background: linear-gradient(135deg, var(--gold-100), #fef3c7);
      border: 1.5px solid rgba(201,154,46,.3);
      margin-top: 16px;
    }
    .award-icon {
      width: 48px; height: 48px; border-radius: 50%;
      background: rgba(201,154,46,.2); color: var(--gold-500);
      display: grid; place-items: center; flex-shrink: 0;
    }
    .award-text strong { display: block; color: var(--navy-950); font-size: 1.05rem; }
    .award-text span { color: var(--muted); font-size: .88rem; }

    /* Image preview */
    .track-img {
      width: 100%; max-height: 320px; object-fit: contain;
      border-radius: var(--radius); background: var(--surface-dim);
      margin-bottom: 18px;
    }

    /* Comment box */
    .judge-comment {
      padding: 16px; border-radius: var(--radius);
      background: var(--surface-dim); border-left: 4px solid var(--navy-600);
      margin-top: 16px;
    }
    .judge-comment .jc-label { font-size: .78rem; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
    .judge-comment p { color: var(--ink); font-size: .92rem; }

    /* ─── FOOTER ─── */
    .footer {
      padding: 28px 0; text-align: center;
      color: var(--muted); font-size: .85rem;
      border-top: 1px solid var(--line);
      margin-top: 40px;
    }
    .footer a { color: var(--navy-600); font-weight: 700; }

    /* Responsive */
    @media (max-width: 600px) {
      .container { width: min(100% - 20px, 720px); }
      .search-row { flex-direction: column; }
      .search-btn { width: 100%; justify-content: center; }
      .info-grid { grid-template-columns: 1fr; }
      .timeline { gap: 4px; }
      .tl-label { font-size: .7rem; max-width: 60px; }
    }

    /* Skeleton Loading */
    .skeleton-card {
      background: var(--surface); border: 1px solid var(--line);
      border-radius: var(--radius-lg); padding: 24px;
      margin-bottom: 18px;
    }
    .skeleton-title {
      width: 40%; height: 24px; background: var(--line); border-radius: 4px; margin-bottom: 24px;
      animation: pulse 1.5s infinite;
    }
    .skeleton-timeline {
      width: 100%; height: 40px; background: var(--line); border-radius: 20px; margin-bottom: 24px;
      animation: pulse 1.5s infinite;
    }
    .skeleton-img {
      width: 100%; height: 200px; background: var(--line); border-radius: var(--radius); margin-bottom: 24px;
      animation: pulse 1.5s infinite;
    }
    .skeleton-text {
      width: 100%; height: 16px; background: var(--line); border-radius: 4px; margin-bottom: 12px;
      animation: pulse 1.5s infinite;
    }
    .skeleton-text.short { width: 60%; }
    @keyframes pulse {
      0% { opacity: 0.6; }
      50% { opacity: 0.3; }
      100% { opacity: 0.6; }
    }
    .spin { animation: spin 1s linear infinite; }
    @keyframes spin { 100% { transform: rotate(360deg); } }
