:root {
    --bg-top: #edf6ff;
    --bg-bottom: #f7f8fc;
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: #ffffff;
    --panel-contrast: #0f1b32;
    --panel-contrast-soft: #162746;
    --ink: #16233f;
    --muted: #64748b;
    --line: rgba(22, 35, 63, 0.08);
    --line-strong: rgba(15, 23, 42, 0.12);
    --teal: #0d8f84;
    --teal-deep: #0a6e66;
    --mint: #dff8f2;
    --shadow: 0 24px 60px rgba(24, 39, 75, 0.12);
    --shadow-tight: 0 10px 30px rgba(24, 39, 75, 0.09);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --font-sans: "Avenir Next", "Segoe UI Variable", "Helvetica Neue", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(103, 232, 249, 0.25), transparent 28%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 24%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)),
        radial-gradient(circle at center, rgba(13, 143, 132, 0.06), transparent 45%);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-shell {
    position: relative;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
}

.topbar,
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-icon {
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, #0f1b32, #182949);
    box-shadow: 0 18px 28px rgba(15, 27, 50, 0.18);
}

.brand-logo {
    display: block;
    width: clamp(132px, 18vw, 18px);
    height: auto;
    flex: 0 0 auto;
}

.hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 22px;
    border-radius: 22px;
}

.hero-icon svg,
.input-shell svg,
.identity-chip svg,
.metadata-note svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--muted);
}

.topbar h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
}

.portal-pill,
.loading-badge,
.verified-badge,
.summary-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-pill,
.loading-badge,
.verified-badge {
    color: var(--teal-deep);
    background: rgba(13, 143, 132, 0.1);
    border: 1px solid rgba(13, 143, 132, 0.15);
}

.portal-pill {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(13, 143, 132, 0.1);
    box-shadow: var(--shadow-tight);
}

.verified-mark {
    display: block;
    width: clamp(108px, 14vw, 150px);
    height: auto;
}

.summary-pill {
    color: #3b4b6b;
    background: rgba(59, 75, 107, 0.08);
}

.app-stage {
    flex: 1;
    display: grid;
    align-items: center;
    padding: 36px 0;
}

.view {
    display: none;
}

body[data-view="search"] .view-search,
body[data-view="loading"] .view-loading,
body[data-view="result"] .view-result {
    display: block;
}

.view-search {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.hero-copy h2 {
    margin: 0;
    font-size: clamp(2.35rem, 5vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.hero-subtitle,
.loading-copy {
    max-width: 560px;
    margin: 20px auto 0;
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--muted);
}

.panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.lookup-card {
    margin-top: 34px;
    padding: 28px;
    text-align: left;
}

.lookup-form label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #56647f;
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.input-shell span {
    color: #8a98ae;
}

.input-shell input {
    width: 100%;
    border: 0;
    padding: 18px 0;
    font-size: 1.08rem;
    color: var(--ink);
    background: transparent;
    outline: none;
}

.input-shell input::placeholder {
    color: #b1b8c7;
}

.primary-button,
.secondary-button {
    width: 100%;
    border: 0;
    border-radius: 16px;
    padding: 18px 20px;
    font-size: 1rem;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
    margin-top: 18px;
    color: white;
    background: linear-gradient(90deg, var(--teal), #10213c);
    box-shadow: 0 18px 30px rgba(14, 25, 46, 0.18);
}

.secondary-button {
    color: var(--ink);
    background: rgba(22, 35, 63, 0.06);
}

.primary-button:hover,
.secondary-button:hover,
.action-row button:hover,
.footer-link:hover {
    transform: translateY(-1px);
}

.form-feedback {
    min-height: 1.4rem;
    margin: 14px 0 0;
    color: #c2410c;
    font-size: 0.92rem;
}

.lookup-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.lookup-meta article {
    padding: 18px;
    border-radius: 18px;
    background: rgba(244, 248, 252, 0.95);
}

.lookup-meta h3,
.side-card h3,
.timeline-card h3 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.lookup-meta p,
.side-card p,
.result-summary p,
.timeline-event p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.view-loading {
    max-width: 700px;
    margin: 0 auto;
    padding: 34px 28px 28px;
    text-align: center;
    position: relative;
}

.loading-orb {
    width: 150px;
    height: 150px;
    margin: 28px auto 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle, rgba(13, 143, 132, 0.18), rgba(13, 143, 132, 0) 55%),
        #f8fbff;
    border: 2px solid rgba(13, 143, 132, 0.08);
    animation: pulse 1.8s ease-in-out infinite;
}

.loading-orb-core {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: white;
    color: var(--teal);
    box-shadow: var(--shadow-tight);
}

.view-loading h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.04em;
}

.loading-steps {
    list-style: none;
    margin: 32px auto 0;
    padding: 0;
    max-width: 420px;
    text-align: left;
}

.loading-steps li {
    position: relative;
    padding: 0 0 16px 28px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a2aabc;
}

.loading-steps li::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d2d8e3;
}

.loading-steps li.is-active,
.loading-steps li.is-complete {
    color: var(--teal-deep);
}

.loading-steps li.is-active::before,
.loading-steps li.is-complete::before {
    background: var(--teal);
}

.loading-steps li.is-active::after {
    content: "";
    position: absolute;
    top: 0;
    left: -3px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(13, 143, 132, 0.22);
    border-radius: 50%;
}

.loading-footer {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.result-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
    gap: 24px;
}

.result-main,
.result-side {
    display: grid;
    gap: 24px;
}

.identity-card,
.timeline-card,
.side-card,
.error-card {
    background: var(--panel);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
}

.identity-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 22px;
    padding: 28px;
}

.avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0f1b32, #0d8f84);
    box-shadow: var(--shadow-tight);
}

.identity-copy h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.75rem);
    letter-spacing: -0.04em;
}

.identity-row,
.summary-row,
.metadata-grid,
.action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.identity-row {
    margin-top: 10px;
}

.identity-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #4a5976;
    background: rgba(74, 89, 118, 0.08);
    font-size: 0.88rem;
    font-weight: 700;
}

.identity-chip svg {
    width: 16px;
    height: 16px;
}

.result-summary {
    margin-top: 16px;
}

.summary-row {
    margin-top: 18px;
}

.timeline-card,
.side-card,
.error-card {
    padding: 24px;
}

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

.timeline-event {
    position: relative;
    padding: 0 0 24px 24px;
    border-left: 2px solid rgba(13, 143, 132, 0.14);
}

.timeline-event:last-child {
    padding-bottom: 0;
}

.timeline-event::before {
    content: "";
    position: absolute;
    top: 3px;
    left: -7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 6px rgba(13, 143, 132, 0.09);
}

.timeline-date {
    margin-bottom: 6px;
    color: var(--teal-deep);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.timeline-event h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.timeline-details {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-details span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(22, 35, 63, 0.05);
    color: #50607b;
    font-size: 0.82rem;
    font-weight: 700;
}

.side-card.is-contrast {
    background: linear-gradient(145deg, var(--panel-contrast), var(--panel-contrast-soft));
    color: white;
}

.side-card.is-contrast p,
.side-card.is-contrast .metadata-grid strong {
    color: rgba(255, 255, 255, 0.74);
}

.side-card.is-contrast .primary-button {
    background: linear-gradient(90deg, var(--teal), #0f8d82);
}

.metric {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.metric strong {
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.metadata-grid {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.metadata-grid div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.metadata-grid div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.metadata-grid span {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.metadata-grid strong {
    text-align: right;
    word-break: break-word;
}

.metadata-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(13, 143, 132, 0.08);
    color: #3f5572;
}

.metadata-note code {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-weight: 700;
}

.metadata-note svg {
    color: var(--teal);
    flex: 0 0 auto;
}

.action-row {
    margin-top: 18px;
}

.result-top-actions {
    margin-top: 0;
    margin-bottom: 18px;
}

.result-top-actions .secondary-button {
    width: auto;
    min-width: 180px;
}

.action-row button {
    flex: 1;
    min-width: 160px;
    border: 0;
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 700;
    transition: transform 180ms ease;
}

.action-row .secondary-button {
    width: auto;
}

.error-card {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 28px;
}

.error-card h2 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.04em;
}

.error-card p {
    margin: 0 auto;
    max-width: 520px;
    color: var(--muted);
    line-height: 1.7;
}

.footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(22, 35, 63, 0.08);
    color: #7e8aa0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    font-size: inherit;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }
}

@media (max-width: 980px) {
    .result-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-shell {
        padding: 18px 16px 18px;
    }

    .topbar,
    .footer,
    .brand,
    .lookup-meta,
    .identity-card {
        display: block;
    }

    .portal-pill {
        margin-top: 14px;
        width: fit-content;
    }

    .brand-logo {
        width: min(180px, 100%);
    }

    .verified-mark {
        width: min(140px, 100%);
    }

    .lookup-card,
    .view-loading,
    .timeline-card,
    .side-card,
    .identity-card,
    .error-card {
        padding: 20px;
    }

    .hero-copy h2,
    .view-loading h2,
    .identity-copy h2,
    .error-card h2 {
        line-height: 1.05;
    }

    .lookup-meta article + article,
    .footer-links,
    .brand div {
        margin-top: 14px;
    }

    .avatar {
        margin-bottom: 18px;
    }

    .metadata-grid div {
        display: block;
    }

    .metadata-grid strong {
        display: block;
        margin-top: 6px;
        text-align: left;
    }

    .footer {
        display: block;
    }
}
