:root {
    --bg: #f3f5f4;
    --panel: #ffffff;
    --ink: #1c2b27;
    --muted: #6a7a75;
    --line: #dde5e1;
    --accent: #f4b400;
    --accent-dark: #8a6400;
    --accent-soft: #fff5cc;
    --amber: #9a6a12;
    --amber-soft: #fdf6e7;
    --red: #b42318;
    --red-soft: #fdecea;
    --shadow: 0 12px 30px rgba(24, 46, 39, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 0%, rgba(244, 180, 0, 0.12), transparent 42%),
        var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

.page {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 0 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hero {
    padding: 64px 0 8px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.subtitle {
    max-width: 540px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: 15px;
}

.track-form {
    max-width: 620px;
    margin: 28px auto 0;
    padding: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.search {
    display: flex;
    gap: 8px;
}

.search input {
    flex: 1;
    min-width: 0;
    padding: 13px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    outline: none;
}

.search input::placeholder {
    color: #9aa8a3;
}

.search input:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(244, 180, 0, 0.35);
}

.search button {
    flex-shrink: 0;
    padding: 0 24px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #3a2c00;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search button:hover {
    background: var(--accent-dark);
    color: #fff;
}

.search button:focus-visible {
    outline: 3px solid rgba(244, 180, 0, 0.4);
    outline-offset: 2px;
}

.notice {
    max-width: 640px;
    margin: 18px auto 0;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13.5px;
    text-align: left;
}

.notice-info {
    background: var(--accent-soft);
    border-color: #f0dfa0;
    color: var(--accent-dark);
}

.notice-warning {
    background: var(--amber-soft);
    border-color: #f0dfb8;
    color: var(--amber);
}

.notice-error {
    background: var(--red-soft);
    border-color: #f5c9c4;
    color: var(--red);
}

.notice code {
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 12.5px;
}

.notice p {
    margin: 0;
}

.notice .btn {
    margin-top: 10px;
}

.api-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 640px;
    margin: 18px auto 0;
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: left;
}

.api-indicator {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.status-dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 50%;
    background: #9aa8a3;
}

.status-ok {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(244, 180, 0, 0.22);
}

.status-error {
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.status-demo {
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(154, 106, 18, 0.15);
}

.api-indicator-text {
    min-width: 0;
}

.api-indicator-text strong {
    font-size: 14px;
}

.api-indicator-text p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    word-break: break-word;
}

.api-indicator-text .api-synced {
    font-size: 11.5px;
}

.api-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-refresh {
    background: var(--accent);
    color: #3a2c00;
}

.btn-refresh:hover {
    background: var(--accent-dark);
    color: #fff;
}

.btn-contact {
    background: var(--accent);
    color: #3a2c00;
    text-align: center;
    white-space: normal;
    line-height: 1.35;
}

.btn-contact:hover {
    background: var(--accent-dark);
    color: #fff;
}

.btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

.btn-ghost:hover {
    background: #fffaf0;
    border-color: #d9cfa6;
}

.all-data {
    margin-top: 34px;
}

.all-data-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.all-data-head h2 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.all-data-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.all-data-meta {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12.5px;
}

.table-wrap {
    margin-top: 14px;
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #fbf8f0;
    color: var(--muted);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: #fffdf5;
}

.data-table code {
    color: var(--muted);
    font-size: 12px;
    word-break: break-all;
}

.cell-name {
    min-width: 180px;
    font-weight: 600;
}

.tag-done {
    background: #ffe9a8;
    color: #7a5a00;
}

.tag-active {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.results {
    margin-top: 34px;
}

.results-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.results-head h2 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.results-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.results-head .synced {
    flex-shrink: 0;
    font-size: 12px;
}

.limit-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.order {
    margin-top: 16px;
    padding: 22px 24px 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.order.is-complete {
    border-color: #f0dfa0;
}

.order-photo {
    display: grid;
    gap: 8px;
    flex-basis: 100%;
    min-width: 0;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
}

.photo-open {
    display: block;
    width: min(100%, 420px);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.order-photo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.photo-preview {
    width: min(94vw, 1100px);
    max-height: 94vh;
    padding: 12px;
    border: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .3);
}

.photo-preview::backdrop {
    background: rgba(0, 0, 0, .78);
}

.photo-preview img {
    display: block;
    max-width: 100%;
    max-height: calc(94vh - 24px);
    margin: auto;
    object-fit: contain;
}

.photo-preview-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.step-skipped .dot,
.step-skipped .step-tag,
.step-unknown .dot,
.step-unknown .step-tag {
    color: var(--muted);
    background: #f4f1e8;
}

.order-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.order-title h3 {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.order-meta {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12.5px;
}

.badge {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-active {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.badge-done {
    background: #ffe9a8;
    color: #7a5a00;
}

.tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.tag-muted {
    background: #f4f1e8;
    color: var(--muted);
}

.stage-now {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 18px 0 4px;
    padding: 12px 14px;
    background: var(--accent-soft);
    border-radius: 12px;
    font-size: 13.5px;
}

.order-details {
    display: grid;
    gap: 20px;
}

@media (min-width: 700px) {
    .order-details {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    .order-details .stage-now,
    .order-details .timeline {
        margin-top: 18px;
    }
}

.stage-now-label {
    color: var(--muted);
}

.stage-now strong {
    color: var(--accent-dark);
    font-size: 1rem;
    line-height: 1.3;
}

.timeline {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 20px 40px;
    font-size: 14px;
}

.step::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--line);
}

.step:last-child {
    padding-bottom: 0;
}

.step:last-child::before {
    display: none;
}

.dot {
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--panel);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
}

.step-done .dot {
    border-color: var(--accent);
    background: var(--accent);
    color: #3a2c00;
}

.step-done::before {
    background: var(--accent);
}

.step-done .step-name {
    color: var(--ink);
}

.step-current .dot {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
    box-shadow: 0 0 0 4px rgba(244, 180, 0, 0.2);
}

.step-current .step-name {
    font-weight: 700;
}

.step-upcoming .step-name {
    color: var(--muted);
}

.step-tag {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.step-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.step-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.step-sub {
    color: var(--muted);
    font-size: 11.5px;
}

.step-time {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.step-current .step-time {
    color: var(--accent-dark);
    font-weight: 600;
}

.tag-sample {
    background: var(--amber-soft);
    color: var(--amber);
}

.progress {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12.5px;
}

.progress-head strong {
    color: var(--ink);
    font-size: 13px;
}

.progress-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #f4f1e8;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.empty {
    margin-top: 16px;
    padding: 36px 24px;
    border: 1px dashed #cfdad5;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.empty h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.empty p {
    max-width: 440px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 14px;
}

.hint {
    max-width: 820px;
    margin: 34px auto 0;
    padding: 24px 26px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.hint h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.hint ol {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 14px;
}

.hint li {
    margin-bottom: 4px;
}

.hint p {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12.5px;
}

.footer {
    margin: 44px 0 26px;
    text-align: center;
}

.footer p {
    margin: 0;
    color: #8c9a95;
    font-size: 12px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 28, 24, 0.6);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 28px;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 22px;
    box-shadow: 0 28px 70px rgba(16, 28, 24, 0.28);
    animation: modal-in 0.18s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.modal-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 22px;
    font-weight: 800;
}

.modal-head h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.modal-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.modal-error {
    margin: 14px 0 0;
    padding: 10px 12px;
    background: var(--red-soft);
    border: 1px solid #f3c3bd;
    border-radius: 10px;
    color: var(--red);
    font-size: 13.5px;
}

.captcha-challenge {
    margin: 24px 0 20px;
    padding: 18px 20px;
    border: 1px solid #f0e1aa;
    border-radius: 16px;
    background: linear-gradient(135deg, #fffaf0, #fffdf8);
}

.captcha-question {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.captcha-equation {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 27px;
    font-weight: 750;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.captcha-unknown {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    background: #fff;
    border: 1px dashed #dbbb55;
    color: var(--accent-dark);
}

.captcha-answer-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

#captcha {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#captcha::placeholder {
    color: #98a6a1;
}

#captcha:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(244, 180, 0, 0.2);
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.modal-actions .btn {
    min-height: 45px;
    padding: 11px 18px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .modal {
        padding: 14px;
    }

    .modal-card {
        padding: 22px;
    }

    .modal-actions .btn {
        flex: 1 1 auto;
    }
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 560px) {
    .hero {
        padding-top: 44px;
    }

    .search {
        flex-direction: column;
    }

    .search button {
        padding: 12px 20px;
    }

    .results-head,
    .order-head,
    .all-data-head,
    .api-status {
        flex-direction: column;
        align-items: flex-start;
    }

    .badge {
        align-self: flex-start;
    }

    .order {
        padding: 20px;
    }
}
