
.brand img{height:30px;width:auto;display:block}html[data-theme="dark"] .brand img{filter:invert(1)}

  :root {
    --bg: #fbfbfd;
    --bg-elev: #ffffff;
    --bg-soft: #f4f5f7;
    --ink: #0a0a0f;
    --ink-2: #1d1d24;
    --muted: #6e6e76;
    --muted-2: #8a8a93;
    --line: rgba(10,10,15,0.08);
    --line-soft: rgba(10,10,15,0.05);
    --accent: #11B5B0;
    --accent-soft: #e0f7f6;
    --accent-ink: #0A8F8B;
    --success: oklch(0.58 0.13 155);
    --warn: oklch(0.72 0.13 80);
    --shadow-sm: 0 1px 2px rgba(15,17,23,0.04), 0 1px 1px rgba(15,17,23,0.03);
    --shadow-md: 0 1px 2px rgba(15,17,23,0.04), 0 8px 24px -8px rgba(15,17,23,0.08);
    --shadow-lg: 0 1px 2px rgba(15,17,23,0.04), 0 24px 60px -20px rgba(15,17,23,0.14);
    --r-sm: 12px;
    --r-md: 18px;
    --r-lg: 24px;
    --r-xl: 32px;
    --font-display: "SF Pro Text", "SF Pro TH", "SFProThai", system-ui, sans-serif;
    --font-thai: "SF Pro TH", "SF Pro Text", "SFProThai", system-ui, sans-serif;
    --font-mono: "SF Pro Text", ui-monospace, monospace;
  }

  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
  }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

  .container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 28px; }

  /* NAV */
  .nav {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    background: rgba(251,251,253,0.75);
    border-bottom: 1px solid var(--line-soft);
  }
  .nav-inner { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
  .brand-mark {
    width: 30px; height: 30px; border-radius: 9px;
    background: linear-gradient(135deg, var(--ink) 0%, #2a2a35 100%);
    display: grid; place-items: center; color: white; font-weight: 700; font-size: 15px; letter-spacing: -0.04em;
  }
  .nav-back {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border-radius: 999px;
    background: var(--bg-soft); color: var(--ink-2);
    font-size: 14px; font-weight: 500;
    transition: background .2s;
  }
  .nav-back:hover { background: oklch(0.93 0.005 240); }

  /* PAGE HEAD */
  .pagehead {
    padding: 56px 0 28px;
  }
  .pagehead-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-ink);
    font-weight: 500;
    margin-bottom: 14px;
  }
  .pagehead h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 4.4vw, 52px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }
  .pagehead h1 .accent {
    background: linear-gradient(135deg, var(--accent-ink), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .pagehead p {
    margin: 0; color: var(--muted); font-size: 16.5px; line-height: 1.6;
  }

  /* SEARCH FORM */
  .search-card {
    margin: 24px 0 80px;
    padding: 36px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
  }
  .search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
  }
  .field { display: flex; flex-direction: column; gap: 8px; }
  .field label {
    font-size: 13.5px; font-weight: 600; color: var(--ink-2);
    display: flex; align-items: center; gap: 8px;
  }
  .field label svg { color: var(--muted); }
  .field input {
    font: inherit;
    width: 100%;
    padding: 16px 18px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 15.5px;
    color: var(--ink);
    letter-spacing: 0.01em;
    transition: all .15s ease;
  }
  .field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
  }
  .field input::placeholder {
    color: var(--muted-2);
    font-size: 14px;
    opacity: 0.65;
  }
  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 16px 24px; border-radius: 14px;
    font-weight: 600; font-size: 15px;
    transition: all .2s ease;
    white-space: nowrap;
  }
  .btn-primary { background: var(--ink); color: white; }
  .btn-primary:hover { background: #2a2a35; transform: translateY(-1px); box-shadow: var(--shadow-md); }
  .btn-ghost { color: var(--muted); }
  .btn-ghost:hover { color: var(--ink); }
  .btn-soft { background: var(--bg-soft); color: var(--ink); padding: 12px 18px; border-radius: 999px; font-size: 14px; }
  .btn-soft:hover { background: oklch(0.93 0.005 240); }

  .search-help {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
    color: var(--muted);
    display: flex; gap: 14px; flex-wrap: wrap;
  }
  .search-help strong { color: var(--ink-2); font-weight: 600; }
  .help-chip {
    padding: 4px 10px;
    background: var(--bg-soft);
    border-radius: 6px;
    font-size: 12px;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .15s;
  }
  .help-chip:hover { background: oklch(0.93 0.005 240); }

  .error-row {
    margin-top: 14px;
    padding: 12px 16px;
    background: oklch(0.96 0.04 25);
    border: 1px solid oklch(0.85 0.08 25);
    border-radius: 12px;
    color: oklch(0.45 0.16 25);
    font-size: 13.5px;
    display: none;
  }
  .error-row.show { display: block; }

  /* RESULT */
  .result {
    display: none;
    padding-bottom: 80px;
  }
  .result.show { display: block; }

  .result-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
  }

  /* Order detail card */
  .order-card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 92px;
  }
  .order-head {
    padding: 24px;
    background: linear-gradient(180deg, var(--ink) 0%, #2a2a38 100%);
    color: white;
    position: relative;
    overflow: hidden;
  }
  .order-head::after {
    content: "";
    position: absolute;
    right: -60px; top: -80px; width: 220px; height: 220px;
    background: radial-gradient(circle, oklch(0.65 0.13 240 / 0.35) 0%, transparent 60%);
    pointer-events: none;
  }
  .order-head .lbl {
    font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.1em;
    opacity: 0.6; margin-bottom: 6px;
  }
  .order-head .ref {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
  }
  .order-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
  }
  .order-status-badge .dot {
    width: 8px; height: 8px; border-radius: 999px;
    background: var(--status-color, var(--warn));
    box-shadow: 0 0 0 0 var(--status-ring, rgba(245, 158, 11, 0.6));
    animation: pulse 1.8s infinite;
  }
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--status-ring, rgba(245, 158, 11, 0.6)); }
    100% { box-shadow: 0 0 0 8px transparent; }
  }

  .order-status-badge.status-warning {
    --status-color: #f59e0b;
    --status-ring: rgba(245, 158, 11, 0.6);
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
  }
  .order-status-badge.status-info {
    --status-color: #38bdf8;
    --status-ring: rgba(56, 189, 248, 0.6);
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.35);
    color: #7dd3fc;
  }
  .order-status-badge.status-progress {
    --status-color: #2dd4bf;
    --status-ring: rgba(45, 212, 191, 0.6);
    background: rgba(20, 184, 166, 0.15);
    border-color: rgba(20, 184, 166, 0.35);
    color: #5eead4;
  }
  .order-status-badge.status-success {
    --status-color: #4ade80;
    --status-ring: rgba(74, 222, 128, 0.6);
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
  }
  .order-status-badge.status-danger {
    --status-color: #f87171;
    --status-ring: rgba(248, 113, 113, 0.6);
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
  }

  .order-body {
    padding: 22px 24px 8px;
  }
  .order-body h3 {
    margin: 0 0 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 500;
  }
  .order-rows { display: flex; flex-direction: column; }
  .order-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
    display: flex; flex-direction: column; gap: 4px;
  }
  .order-row:last-child { border-bottom: 0; }
  .order-row .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
  .order-row .v { font-size: 14.5px; font-weight: 500; color: var(--ink); line-height: 1.5; }
  .order-row .v.device { font-size: 16px; font-weight: 600; }
  .order-row .v.device small { display:block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-top: 2px; }
  .symptom-badges { display: flex; flex-wrap: wrap; gap: 6px; }
  .symptom-badge {
    padding: 4px 10px;
    background: var(--accent-soft); color: var(--accent-ink);
    border-radius: 999px; font-size: 12.5px; font-weight: 500;
  }
  .order-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--line-soft);
    background: var(--bg-soft);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
  }
  .order-foot a { color: var(--accent-ink); font-weight: 600; }

  /* Timeline card */
  .timeline-card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }
  .timeline-head {
    padding: 24px 28px;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
  }
  .timeline-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .timeline-head h2 small {
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .progress-meta {
    text-align: right;
  }
  .progress-meta .pct {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1;
  }
  .progress-meta .pct small { font-size: 14px; font-weight: 500; color: var(--muted); }
  .progress-meta .pct-label { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

  .progress-bar {
    height: 4px;
    background: var(--bg-soft);
    position: relative;
  }
  .progress-bar-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, var(--ink) 0%, var(--accent-ink) 100%);
    transition: width 1s cubic-bezier(.2,.7,.2,1);
  }

  /* Timeline */
  .timeline {
    padding: 28px 28px 24px;
    position: relative;
  }
  .timeline::before {
    content: "";
    position: absolute;
    left: 47px;
    top: 28px;
    bottom: 28px;
    width: 2px;
    background: var(--line);
  }
  .tl-item {
    position: relative;
    padding-left: 56px;
    padding-bottom: 22px;
    min-height: 50px;
  }
  .tl-item:last-child { padding-bottom: 0; }
  .tl-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--bg-elev);
    border: 2px solid var(--line);
    display: grid; place-items: center;
    color: var(--muted-2);
    z-index: 1;
    transition: all .3s ease;
  }
  .tl-marker svg { width: 18px; height: 18px; stroke-width: 2; }
  .tl-marker .step-num {
    font-size: 12px;
    font-weight: 600;
  }

  .tl-item.done .tl-marker {
    background: var(--ink);
    border-color: var(--ink);
    color: white;
  }
  .tl-item.current .tl-marker {
    background: var(--bg-elev);
    border-color: var(--tl-status-color, var(--warn));
    color: var(--tl-status-color, var(--warn));
    box-shadow: 0 0 0 6px var(--tl-status-bg, oklch(0.96 0.05 80));
    animation: ringPulse 1.8s infinite;
  }
  @keyframes ringPulse {
    0%   { box-shadow: 0 0 0 0 var(--tl-status-ring, rgba(245, 158, 11, 0.5)); }
    100% { box-shadow: 0 0 0 14px transparent; }
  }
  .tl-item.current .tl-marker::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 999px;
    border: 2px solid var(--tl-status-color, var(--warn));
    opacity: 0.4;
  }

  .tl-item.current.status-warning {
    --tl-status-color: #d97706;
    --tl-status-bg: rgba(245, 158, 11, 0.12);
    --tl-status-ring: rgba(245, 158, 11, 0.45);
  }
  .tl-item.current.status-info {
    --tl-status-color: #0284c7;
    --tl-status-bg: rgba(2, 132, 199, 0.12);
    --tl-status-ring: rgba(2, 132, 199, 0.45);
  }
  .tl-item.current.status-progress {
    --tl-status-color: #0d9488;
    --tl-status-bg: rgba(13, 148, 136, 0.12);
    --tl-status-ring: rgba(13, 148, 136, 0.45);
  }
  .tl-item.current.status-success {
    --tl-status-color: #16a34a;
    --tl-status-bg: rgba(22, 163, 74, 0.12);
    --tl-status-ring: rgba(22, 163, 74, 0.45);
  }
  .tl-item.current.status-danger {
    --tl-status-color: #dc2626;
    --tl-status-bg: rgba(220, 38, 38, 0.12);
    --tl-status-ring: rgba(220, 38, 38, 0.45);
  }

  .tl-body { padding-top: 8px; min-width: 0; overflow-wrap: anywhere; }
  .tl-title {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 4px;
    letter-spacing: -0.005em;
  }
  .tl-item:not(.done):not(.current) .tl-title { color: var(--muted); font-weight: 500; }

  .tl-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
  }
  .tl-meta .tl-time {
    font-size: 12.5px;
  }
  .tl-meta .tl-tag {
    padding: 2px 8px;
    background: var(--bg-soft);
    border-radius: 999px;
    font-size: 11.5px;
    color: var(--ink-2);
    font-weight: 500;
  }
  .tl-item.current .tl-tag {
    background: oklch(0.96 0.05 80);
    color: oklch(0.45 0.13 80);
  }
  .tl-item.done .tl-tag {
    background: oklch(0.94 0.05 155);
    color: oklch(0.42 0.15 155);
  }
  .tl-detail {
    margin-top: 8px;
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.6;
    max-width: 540px;
  }
  .tl-item.current .tl-detail { color: var(--ink-2); }

  /* Empty state */
  .empty-state {
    text-align: center;
    padding: 60px 24px;
    background: var(--bg-elev);
    border: 1px dashed var(--line);
    border-radius: var(--r-lg);
    color: var(--muted);
    margin: 24px 0 80px;
  }
  .empty-state svg { width: 40px; height: 40px; opacity: 0.4; margin-bottom: 14px; }
  .empty-state h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--ink-2); }
  .empty-state p { margin: 0; font-size: 14px; }

  /* FOOTER */
  footer {
    padding: 32px 0;
    border-top: 1px solid var(--line-soft);
    font-size: 13px; color: var(--muted);
  }
  .footer-inner {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  }

  /* RESPONSIVE */
  @media (max-width: 980px) {
    .result-grid { grid-template-columns: 1fr; gap: 18px; }
    .order-card { position: static; }
    .search-form { grid-template-columns: 1fr; }
    .search-card { padding: 28px 24px; }
  }
  @media (max-width: 560px) {
    .container { padding: 0 18px; }
    .pagehead { padding: 36px 0 16px; }
    .pagehead h1 { font-size: 26px; }
    .pagehead p { font-size: 14.5px; }
    .nav-back span { display: none; }
    .search-card { padding: 20px 16px; margin: 16px 0 36px; border-radius: 18px; }
    .field input { padding: 14px 16px; font-size: 15px; border-radius: 12px; }
    .btn { width: 100%; justify-content: center; padding: 14px 20px; border-radius: 12px; font-size: 14.5px; }
    .timeline { padding: 22px 18px; }
    .timeline::before { left: 35px; }
    .tl-item { padding-left: 52px; }
    .tl-marker { width: 36px; height: 36px; }
  }

  /* ============ DARK MODE ============ */
  html[data-theme="dark"]{
    --bg:#0b0b0e; --bg-elev:#161619; --bg-soft:#1e1e22;
    --ink:#f4f4f7; --ink-2:#d6d6db; --muted:#9b9ba3; --muted-2:#74747c;
    --line:rgba(255,255,255,0.11); --line-soft:rgba(255,255,255,0.06);
    --accent-soft:oklch(0.32 0.07 240); --accent-ink:oklch(0.80 0.10 240);
  }
  html[data-theme="dark"] .nav{ background:rgba(11,11,14,0.72); }
  html[data-theme="dark"] .brand-mark{ background:linear-gradient(135deg,#f4f4f7,#c6c6ce); color:#0b0b0e; }
  /* solid controls: bg auto-lightens via --ink, flip text dark + fix hardcoded dark hovers */
  html[data-theme="dark"] .btn-primary{ color:#0b0b0e; }
  html[data-theme="dark"] .btn-primary:hover, html[data-theme="dark"] .btn-primary:hover:not(:disabled){ background:#ffffff; }
  html[data-theme="dark"] .chip.active{ color:#0b0b0e; }
  html[data-theme="dark"] .seg-item.active{ color:#0b0b0e; }
  html[data-theme="dark"] .form-section-num{ color:#0b0b0e; }
  html[data-theme="dark"] .meta-chip.years{ color:#0b0b0e; }
  html[data-theme="dark"] .checker-step label .num{ color:#0b0b0e; }
  html[data-theme="dark"] .faq-item.open .faq-q .icon{ color:#0b0b0e; }
  html[data-theme="dark"] .step-num{ color:#0b0b0e; }
  html[data-theme="dark"] .tl-item.done .tl-marker{ color:#0b0b0e; }
  html[data-theme="dark"] .confirm-check{ color:#0b0b0e; }
  html[data-theme="dark"] .consent-item input[type="checkbox"]:checked{ background:var(--ink); border-color:var(--ink); }
  html[data-theme="dark"] .consent-item input[type="checkbox"]:checked::after{ border-color:#0b0b0e; }
  /* hover backgrounds that hardcode light oklch */
  html[data-theme="dark"] .nav-back:hover,
  html[data-theme="dark"] .btn-soft:hover,
  html[data-theme="dark"] .chip:hover,
  html[data-theme="dark"] .consent-item:hover,
  html[data-theme="dark"] .help-chip:hover,
  html[data-theme="dark"] .theme-toggle:hover{ background:rgba(255,255,255,0.08); }
  /* feature panels: pin dark so white text reads */
  html[data-theme="dark"] .summary-head,
  html[data-theme="dark"] .order-head,
  html[data-theme="dark"] .sla-card,
  html[data-theme="dark"] .bento-card.dark{ background:linear-gradient(135deg,#17171c 0%,#26262e 100%); }
  html[data-theme="dark"] .bento-card.dark{ border-color:rgba(255,255,255,0.1); }
  /* light gradient surfaces */
  html[data-theme="dark"] .hero::before{ background:radial-gradient(ellipse 900px 400px at 50% -10%,oklch(0.30 0.06 240) 0%,transparent 60%); }
  html[data-theme="dark"] .applecare-art{ background:radial-gradient(circle at 30% 25%,oklch(0.32 0.06 240) 0%,transparent 50%),radial-gradient(circle at 75% 80%,oklch(0.30 0.06 220) 0%,transparent 55%),linear-gradient(140deg,var(--bg-elev) 0%,oklch(0.20 0.01 240) 100%); }
  html[data-theme="dark"] .dev-visual{ background:radial-gradient(circle at 30% 25%,oklch(0.30 0.05 240) 0%,transparent 55%),linear-gradient(160deg,var(--bg-elev) 0%,oklch(0.20 0.01 240) 100%); }
  html[data-theme="dark"] .dev-visual::before{ background:repeating-linear-gradient(135deg,transparent 0px,transparent 24px,rgba(255,255,255,0.05) 24px,rgba(255,255,255,0.05) 25px); }
  html[data-theme="dark"] .dev-silhouette svg{ color:var(--ink); }
  /* theme toggle button */
  .theme-toggle{ width:40px; height:40px; border-radius:999px; background:var(--bg-soft); display:grid; place-items:center; color:var(--ink-2); transition:all .2s ease; flex-shrink:0; }
  .theme-toggle:hover{ background:oklch(0.93 0.005 240); }
  .theme-toggle svg{ width:18px; height:18px; }
  .theme-toggle .sun{ display:none; }
  html[data-theme="dark"] .theme-toggle .moon{ display:none; }
  html[data-theme="dark"] .theme-toggle .sun{ display:block; }
