:root {
    --snow: #f5f5f7;
    --paper: #ffffff;
    --ink: #1d1d1f;
    --graphite: #6e6e73;
    --line: #d2d2d7;
    --noon: #feee00;
    --action: #0071e3;
    --danger: #c9342f;
    --success: #1c7c3e;
    --pending: #996800;
    --display: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    --body: "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
    --utility: "SFMono-Regular", Consolas, monospace;
}

html {
    scroll-behavior: smooth;
}

body.order-search-page {
    margin: 0;
    color: var(--ink);
    background: var(--snow);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

.order-search-page *,
.order-search-page *::before,
.order-search-page *::after {
    box-sizing: border-box;
    letter-spacing: 0;
}

.order-search-page a {
    color: inherit;
    text-decoration: none;
}

.order-search-page img {
    display: block;
    max-width: 100%;
}

.order-search-page button,
.order-search-page input {
    font: inherit;
}

.order-search-page :focus-visible {
    outline: 3px solid var(--action);
    outline-offset: 3px;
}

.search-shell {
    width: min(1100px, calc(100% - 48px));
    margin: 0 auto;
}

.search-skip {
    position: fixed;
    top: 8px;
    left: 16px;
    z-index: 1000;
    padding: 10px 14px;
    color: var(--paper) !important;
    background: var(--ink);
    border-radius: 6px;
    transform: translateY(-160%);
}

.search-skip:focus-visible {
    transform: translateY(0);
}

.search-nav {
    position: sticky;
    top: 0;
    z-index: 80;
    height: 56px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(250, 250, 252, 0.88);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.search-nav__inner,
.search-brand,
.search-nav__links {
    display: flex;
    align-items: center;
}

.search-nav__inner {
    justify-content: space-between;
    height: 100%;
}

.search-brand {
    gap: 10px;
    font-family: var(--display);
    font-weight: 650;
}

.search-brand img {
    border-radius: 7px;
}

.search-nav__links {
    gap: 28px;
    color: var(--graphite);
    font-size: 13px;
}

.search-nav__links a:hover {
    color: var(--action);
}

.search-nav__current {
    color: var(--action);
    font-weight: 650;
}

.search-eyebrow {
    margin: 0 0 11px;
    color: #806c00;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.search-hero {
    padding: 82px 0 70px;
    background: var(--paper);
}

.search-hero h1 {
    max-width: 700px;
    margin: 0;
    font-family: var(--display);
    font-size: 56px;
    line-height: 1.1;
    font-weight: 700;
}

.search-hero__lead {
    max-width: 610px;
    margin: 20px 0 0;
    color: var(--graphite);
    font-size: 19px;
    line-height: 1.65;
}

.search-workspace {
    padding-top: 42px;
    padding-bottom: 100px;
}

.search-panel {
    padding: 28px;
    background: var(--paper);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.04);
}

.search-panel__heading,
.results-heading,
.search-form,
.search-input-wrap,
.search-footer__inner {
    display: flex;
    align-items: center;
}

.search-panel__heading,
.results-heading {
    justify-content: space-between;
    gap: 20px;
}

.search-panel__heading h2,
.results-heading h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 25px;
    line-height: 1.2;
}

.search-panel__secure {
    color: var(--graphite);
    font-size: 12px;
}

.search-form {
    gap: 12px;
    margin-top: 25px;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-input-icon {
    position: absolute;
    left: 16px;
    color: var(--graphite);
    font-size: 25px;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-1px);
}

#order-query {
    width: 100%;
    min-height: 52px;
    padding: 0 48px 0 48px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #b8b8bd;
    border-radius: 7px;
    outline: 0;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

#order-query::placeholder {
    color: #98989d;
}

#order-query:focus {
    border-color: var(--action);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

#order-query[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(201, 52, 47, 0.12);
}

.search-clear {
    position: absolute;
    right: 8px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--graphite);
    background: #ededf0;
    border: 0;
    border-radius: 6px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.search-clear[hidden] {
    display: none;
}

.search-submit {
    min-width: 130px;
    min-height: 52px;
    padding: 0 21px;
    color: var(--paper);
    background: var(--action);
    border: 0;
    border-radius: 7px;
    font-weight: 650;
    cursor: pointer;
    transition: background-color 160ms ease;
}

.search-submit:hover {
    background: #0077ed;
}

.search-submit:disabled {
    color: #86868b;
    background: #e8e8ed;
    cursor: default;
}

.search-submit__loading {
    display: none;
}

.search-submit.is-loading .search-submit__label {
    display: none;
}

.search-submit.is-loading .search-submit__loading {
    display: inline;
}

.search-help,
.search-error {
    margin: 10px 0 0;
    font-size: 12px;
}

.search-help {
    color: var(--graphite);
}

.search-error {
    color: var(--danger);
}

.search-error[hidden] {
    display: none;
}

.search-results {
    padding-top: 68px;
}

.results-heading {
    margin-bottom: 18px;
}

.results-heading h2 {
    font-size: 32px;
}

.results-count {
    color: var(--graphite);
    font-family: var(--utility);
    font-size: 13px;
}

#results-content {
    display: grid;
    gap: 12px;
}

.order-record {
    padding: 24px 26px;
    background: var(--paper);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 8px;
}

.order-record__header,
.order-record__identity,
.order-record__footer {
    display: flex;
    align-items: center;
}

.order-record__header,
.order-record__footer {
    justify-content: space-between;
    gap: 20px;
}

.order-record__identity {
    gap: 15px;
    min-width: 0;
}

.order-record__identity strong {
    overflow: hidden;
    font-family: var(--utility);
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-record__identity small {
    color: var(--graphite);
    font-size: 12px;
}

.order-status {
    flex: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 650;
}

.order-status.is-success {
    color: var(--success);
    background: #e8f5ec;
}

.order-status.is-pending {
    color: var(--pending);
    background: #fff5d6;
}

.order-status.is-danger {
    color: var(--danger);
    background: #ffebea;
}

.order-record__facts {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 22px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.order-fact {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.order-fact small {
    color: var(--graphite);
    font-size: 12px;
}

.order-fact > span {
    overflow: hidden;
    font-size: 15px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-record__footer {
    padding-top: 18px;
}

.order-record__footer > span {
    color: var(--graphite);
    font-size: 12px;
}

.order-record__action {
    color: var(--action) !important;
    font-size: 14px;
    font-weight: 650;
}

.order-record__action:hover {
    text-decoration: underline;
}

.search-state {
    display: grid;
    place-items: center;
    min-height: 310px;
    padding: 40px 20px;
    text-align: center;
    background: var(--paper);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 8px;
}

.search-state img {
    width: 118px;
    margin-bottom: 18px;
    opacity: 0.78;
}

.search-state h3 {
    margin: 0;
    font-family: var(--display);
    font-size: 22px;
}

.search-state p {
    max-width: 380px;
    margin: 9px 0 0;
    color: var(--graphite);
    font-size: 14px;
}

.search-state--error strong {
    color: var(--danger);
    font-family: var(--display);
    font-size: 22px;
}

.search-retry {
    min-height: 44px;
    margin-top: 18px;
    padding: 10px 18px;
    color: var(--action);
    background: var(--paper);
    border: 1px solid var(--action);
    border-radius: 7px;
    cursor: pointer;
}

.search-skeleton {
    display: grid;
    gap: 12px;
}

.search-skeleton i {
    display: block;
    height: 142px;
    background: #e9e9ed;
    border-radius: 8px;
    animation: search-pulse 1.3s ease-in-out infinite alternate;
}

.search-skeleton i:nth-child(2) {
    animation-delay: 160ms;
}

.search-skeleton i:nth-child(3) {
    animation-delay: 320ms;
}

@keyframes search-pulse {
    from { opacity: 0.42; }
    to { opacity: 0.9; }
}

.search-footer {
    padding: 28px 0;
    color: #77777c;
    background: var(--paper);
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.search-footer__inner {
    justify-content: space-between;
    gap: 20px;
}

.search-footer a:hover {
    color: var(--action);
}

.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;
}

@media (max-width: 720px) {
    .search-shell {
        width: min(100% - 28px, 620px);
    }

    .search-nav {
        height: 52px;
    }

    .search-brand {
        font-size: 14px;
    }

    .search-brand img {
        width: 27px;
        height: 27px;
    }

    .search-nav__links {
        font-size: 12px;
    }

    .search-hero {
        padding: 52px 0 42px;
    }

    .search-hero h1 {
        font-size: 38px;
        overflow-wrap: anywhere;
    }

    .search-hero__lead {
        margin-top: 14px;
        font-size: 16px;
    }

    .search-workspace {
        padding-top: 18px;
        padding-bottom: 70px;
    }

    .search-panel {
        padding: 20px 16px;
    }

    .search-panel__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .search-panel__heading h2 {
        font-size: 22px;
    }

    .search-form {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .search-submit {
        width: 100%;
    }

    .search-results {
        padding-top: 48px;
    }

    .results-heading h2 {
        font-size: 28px;
    }

    .order-record {
        padding: 20px 16px;
    }

    .order-record__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .order-record__identity {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .order-record__identity strong {
        max-width: 100%;
    }

    .order-record__facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
    }

    .order-record__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .order-record__action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 46px;
        background: #eaf3ff;
        border-radius: 7px;
    }

    .search-state {
        min-height: 280px;
    }

    .search-footer__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .search-submit,
    .search-skeleton i {
        animation: none;
        transition: none;
    }
}
