:root {
        --color-bg: oklch(0.985 0.006 255);
        --color-panel: oklch(0.998 0.004 255);
        --color-text: oklch(0.17 0.006 255);
        --color-muted: oklch(0.47 0.009 255);
        --color-soft: oklch(0.95 0.006 255);
        --color-input: oklch(0.91 0.007 255);
        --color-rule: oklch(0.17 0.006 255);
        --color-error: oklch(0.52 0.13 28);
        --color-warn: oklch(0.58 0.09 78);
        --color-backdrop: oklch(0.17 0.006 255 / 0.64);
        --border-style: 1px solid var(--color-rule);
        --font-mono: 'Space Mono', monospace;
        --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    }

    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    body {
        background-color: var(--color-bg);
        color: var(--color-text);
        font-family: var(--font-sans);
        font-size: 13px;
        line-height: 1.45;
        -webkit-font-smoothing: antialiased;
        height: 100vh;
        overflow: hidden;
    }

    h1, h2, h3, .mono, button, summary {
        font-family: var(--font-mono);
        text-transform: uppercase;
        font-weight: 400;
    }

    input {
        font-family: var(--font-mono);
        font-weight: 400;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    a:hover,
    a:focus-visible {
        text-decoration: underline;
    }

    :focus-visible {
        outline: 2px solid var(--color-text);
        outline-offset: -2px;
    }

    .app-container {
        display: flex;
        flex-direction: column;
        height: 100vh;
        border-left: var(--border-style);
        border-right: var(--border-style);
        margin: 0 20px;
        overflow: hidden;
    }

    .search-section {
        display: flex;
        border-bottom: var(--border-style);
    }

    .search-input-wrapper {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        border-right: var(--border-style);
    }

    .search-label {
        padding: 16px 12px;
        border-bottom: var(--border-style);
        font-size: 20px;
        line-height: 1;
        background: var(--color-text);
        color: var(--color-bg);
        font-weight: 700;
    }

    .search-input-row {
        display: block;
    }

    .search-input {
        width: 100%;
        border: none;
        padding: 22px 12px;
        font-size: 24px;
        outline: none;
        background: var(--color-input);
        box-shadow: inset 0 0 0 2px var(--color-text);
    }

    .search-input:focus {
        box-shadow: inset 0 0 0 3px var(--color-text);
    }

    .search-input::placeholder {
        color: var(--color-muted);
    }

    .search-button {
        width: 200px;
        background-color: var(--color-bg);
        color: var(--color-text);
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 12px;
        transition: background-color 0.2s, color 0.2s;
    }

    .search-button:hover,
    .search-button:focus-visible {
        background-color: var(--color-text);
        color: var(--color-bg);
    }

    .search-button:disabled {
        cursor: wait;
        color: var(--color-muted);
        background: var(--color-soft);
    }

    .search-button-top {
        text-align: right;
        font-size: 10px;
    }

    .search-button-main {
        font-size: 24px;
        text-align: center;
    }

    .results-area {
        background-color: var(--color-rule);
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        grid-auto-rows: minmax(0, 1fr);
        gap: 1px;
        border-bottom: var(--border-style);
        flex-grow: 1;
        min-height: 0;
        overflow: hidden;
    }

    .provider-card {
        background-color: var(--color-panel);
        display: flex;
        flex-direction: column;
        min-height: 0;
        min-width: 0;
        overflow: hidden;
    }

    .provider-placeholder {
        min-height: 0;
        min-width: 0;
        background:
            repeating-linear-gradient(
                45deg,
                var(--color-panel),
                var(--color-panel) 10px,
                var(--color-soft) 10px,
                var(--color-soft) 20px
            );
        color: var(--color-muted);
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: var(--font-mono);
        font-size: 12px;
        line-height: 1.35;
        text-align: center;
        text-transform: uppercase;
    }

    .card-header {
        border-bottom: var(--border-style);
        padding: 10px 12px;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }

    .provider-name {
        font-size: 19px;
        font-weight: 700;
        line-height: 1;
    }

    .status-error {
        color: var(--color-error);
    }

    .status-skipped {
        color: var(--color-warn);
    }

    .metrics {
        text-align: right;
        flex: 0 0 auto;
    }

    .metric-item {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        font-family: var(--font-mono);
        font-size: 9px;
        text-transform: uppercase;
    }

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

    .card-body {
        padding: 12px;
        flex-grow: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .result-snippet {
        border-bottom: 1px solid var(--color-soft);
    }

    .result-snippet:last-child {
        border-bottom: none;
    }

    .result-row {
        min-height: 44px;
        display: grid;
        grid-template-columns: 44px 1fr;
        align-items: center;
        gap: 0;
        padding: 8px 0;
    }

    .expand-button {
        align-items: center;
        background: transparent;
        border: none;
        color: var(--color-muted);
        cursor: pointer;
        display: flex;
        font-family: var(--font-mono);
        font-size: 13px;
        height: 44px;
        justify-content: center;
        padding: 0;
        width: 44px;
        transition: transform 0.16s ease-out;
    }

    .result-snippet.is-open .expand-button {
        transform: rotate(90deg);
    }

    .result-content {
        display: none;
    }

    .result-snippet.is-open .result-content {
        display: block;
    }

    .result-title {
        color: inherit;
        display: inline-block;
        font-weight: 600;
        font-size: 13.5px;
        line-height: 1.28;
    }

    .result-title:hover,
    .result-title:focus-visible {
        text-decoration: underline;
    }

    .result-meta {
        color: var(--color-muted);
        font-family: var(--font-mono);
        font-size: 10px;
        margin: 0 0 4px 44px;
        overflow-wrap: anywhere;
        text-transform: uppercase;
    }

    .result-text {
        font-size: 12.5px;
        margin-left: 44px;
        padding-bottom: 12px;
    }

    .result-text a {
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .state-message {
        color: var(--color-muted);
        font-family: var(--font-mono);
        font-size: 11px;
        line-height: 1.45;
        text-transform: uppercase;
    }

    .state-message strong {
        color: var(--color-text);
        font-weight: 700;
    }

    .skeleton-line {
        height: 12px;
        background: var(--color-soft);
        margin-bottom: 10px;
        position: relative;
        overflow: hidden;
    }

    .skeleton-line::after {
        content: "";
        position: absolute;
        inset: 0;
        transform: translateX(-100%);
        background: linear-gradient(90deg, transparent, oklch(0.985 0.004 255), transparent);
        animation: shimmer 1.1s infinite;
    }

    .skeleton-line.short {
        width: 55%;
    }

    .skeleton-line.medium {
        width: 78%;
    }

    @keyframes shimmer {
        to {
            transform: translateX(100%);
        }
    }

    .card-footer {
        border-top: var(--border-style);
    }

    .raw-button {
        width: 100%;
        min-height: 44px;
        padding: 10px 12px;
        background: transparent;
        border: none;
        color: var(--color-text);
        cursor: pointer;
        font-family: var(--font-mono);
        font-size: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-transform: uppercase;
    }

    .raw-button::after {
        content: "->";
    }

    .raw-button:hover,
    .raw-button:focus-visible {
        background: var(--color-soft);
    }

    .json-modal[hidden] {
        display: none;
    }

    .json-modal {
        position: fixed;
        inset: 0;
        z-index: 20;
        display: grid;
        place-items: center;
        padding: 20px;
    }

    .json-modal-backdrop {
        position: absolute;
        inset: 0;
        background: var(--color-backdrop);
    }

    .json-modal-panel {
        position: relative;
        z-index: 1;
        width: min(920px, 100%);
        max-height: min(760px, calc(100vh - 40px));
        background: var(--color-bg);
        border: var(--border-style);
        display: flex;
        flex-direction: column;
    }

    .json-modal-header {
        min-height: 48px;
        border-bottom: var(--border-style);
        padding: 10px 12px;
        display: flex;
        justify-content: space-between;
        gap: 16px;
        align-items: center;
        font-family: var(--font-mono);
        text-transform: uppercase;
    }

    .json-modal-close {
        width: 44px;
        height: 44px;
        border: var(--border-style);
        background: transparent;
        cursor: pointer;
        font-family: var(--font-mono);
    }

    .json-modal-close:hover,
    .json-modal-close:focus-visible {
        background: var(--color-text);
        color: var(--color-bg);
    }

    .raw-json {
        flex: 1;
        overflow: auto;
        padding: 12px;
        white-space: pre-wrap;
        word-break: break-word;
        text-transform: none;
        font-size: 10px;
        line-height: 1.45;
    }

    @media (max-width: 720px) {
        .app-container {
            margin: 0;
            border-left: none;
            border-right: none;
        }

        .search-section {
            flex-direction: column;
        }

        .search-input-wrapper {
            border-right: none;
        }

        .search-label {
            font-size: 15px;
        }

        .search-input {
            min-height: 88px;
            font-size: 18px;
        }

        .search-button {
            width: 100%;
            min-height: 76px;
            border-top: var(--border-style);
            flex-direction: row;
            align-items: center;
        }

        .search-button-top,
        .search-button-main {
            text-align: left;
        }

        .results-area {
            grid-template-columns: 1fr;
            grid-auto-rows: minmax(320px, 1fr);
            overflow-y: auto;
        }

        .provider-card {
            min-height: 320px;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            scroll-behavior: auto !important;
            transition-duration: 0.01ms !important;
        }

        .skeleton-line::after {
            display: none;
        }
    }

    @media (min-width: 721px) and (max-width: 1180px) {
        .results-area {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }
