/* ================================================================
 * Reset & Base
 * ================================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-body);
    color: var(--text-body);
    min-height: 100vh;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6, p, ul, ol {
    margin: 0;
    padding: 0;
}

button {
    font-family: inherit;
}

/* ================================================================
 * Scrollbars
 * ================================================================ */
.os-scrollbar.os-theme-app {
    box-sizing: border-box;
    --os-size: var(--scrollbar-size, 10px);
    --os-padding-perpendicular: 2px;
    --os-padding-axis: 2px;
    --os-track-bg: transparent;
    --os-track-bg-hover: transparent;
    --os-track-bg-active: transparent;
    --os-handle-interactive-area-offset: 4px;
    --os-handle-border-radius: 999px;
    --os-handle-bg: var(--scrollbar-thumb);
    --os-handle-bg-hover: var(--text-muted);
    --os-handle-bg-active: var(--text-muted);
    --os-handle-min-size: 33px;
}

* {
    scrollbar-width: var(--scrollbar-native-width, thin);
    scrollbar-color: var(--scrollbar-thumb) transparent;
}



/* ================================================================
 * Theme
 * ================================================================ */

:root {
    --accent: #01875f;
    --accent-light: #01875f22;

    /*
     * The product's own accent, as opposed to a store's. Used where the page is
     * about the service rather than about one store's app — the landing and the
     * API reference — so neither claims one of the three stores it covers.
     * Mirrored by LANDING_ACCENT in constants/landing.ts.
     */
    --brand-accent: #5b6570;
    --brand-accent-light: #5b657022;

    --gray-50: #f8f9fb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --star-on: #f59e0b;
    --star-off: #d1d5db;
    --error-bg: #fef2f2;
    --error-text: #dc2626;

    --bg-body: var(--gray-50);
    --bg-panel: #ffffff;
    --bg-elev: var(--gray-50);
    --bg-elev-hover: var(--gray-100);
    --border-subtle: var(--gray-200);
    --border-muted: var(--gray-100);

    --text-strong: var(--gray-900);
    --text-body: #4b5563;
    --text-muted: var(--gray-500);
    --text-faint: var(--gray-400);

    --shadow-panel: 0 1px 12px rgba(0, 0, 0, 0.06);
    --shadow-tab: 0 -2px 8px rgba(0, 0, 0, 0.06);
    --shadow-logo: 0 4px 16px rgba(0, 0, 0, 0.18);
    --shadow-media: 0 1px 6px rgba(0, 0, 0, 0.1);

    --overlay-banner: linear-gradient(45deg, rgba(32, 33, 36, 1) 0%, rgba(32, 33, 36, 1) 30%, rgba(0, 0, 0, 0) 100%);
    --scrollbar-thumb: var(--gray-300);

    color-scheme: light;
}

:root[data-theme="dark"] {
    --gray-50: #15181f;
    --gray-100: #1c2028;
    --gray-200: #2a2f3a;
    --gray-300: #3a4050;
    --gray-400: #7a8294;
    --gray-500: #9ba3b3;
    --gray-700: #c9cdd6;
    --gray-800: #e1e4ea;
    --gray-900: #f1f3f7;

    --star-on: #fbbf24;
    --star-off: #3a4050;
    --error-bg: #3f1a1a;
    --error-text: #fca5a5;

    --bg-body: #0b0d12;
    --bg-panel: #12151c;
    --bg-elev: #232834;
    --bg-elev-hover: #222734;
    --border-subtle: #262c38;
    --border-muted: #1e232d;

    --text-strong: #f1f3f7;
    --text-body: #c0c6d2;
    --text-muted: #8e96a8;
    --text-faint: #6b7486;

    --shadow-panel: 0 1px 16px rgba(0, 0, 0, 0.45);
    --shadow-tab: 0 -2px 8px rgba(0, 0, 0, 0.35);
    --shadow-logo: 0 4px 20px rgba(0, 0, 0, 0.55);
    --shadow-media: 0 1px 6px rgba(0, 0, 0, 0.4);

    --overlay-banner: linear-gradient(45deg, rgba(10, 12, 16, 0.95) 0%, rgba(10, 12, 16, 0.85) 30%, rgba(10, 12, 16, 0) 100%);
    --scrollbar-thumb: #3a4050;

    color-scheme: dark;
}

/* ================================================================
 * Layout
 * ================================================================ */

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}

.container.embed {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
}

.panel {
    background: var(--bg-panel);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-panel);
    padding: 1.5rem;
    min-height: 25rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.embed .panel {
    border-radius: 0;
    min-height: 100vh;
    height: 100%;
}

/* ================================================================
 * Tabs
 * ================================================================ */

.tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
}

.tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem 0.75rem 0 0;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    position: relative;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab.active {
    background: var(--bg-panel);
    box-shadow: var(--shadow-tab);
}

.tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.tab-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tab-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    display: none;
}

.tab.active .tab-bar {
    display: block;
}

/* ================================================================
 * Mode switcher
 * ================================================================ */

.mode-switcher-wrap {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 3px;
    margin-bottom: 1rem;
    width: fit-content;
}

.mode-btn {
    padding: 0.375rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.2s;
}

.mode-btn.active {
    color: #fff;
}

/* ================================================================
 * Embed back button
 * ================================================================ */

.embed-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.embed-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem;
    margin: -0.625rem 0 0 -0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    background: none;
    color: #fff;
    transition: opacity 0.2s;
}

.embed-back-btn:hover {
    opacity: 0.85;
}

.embed-back-btn svg {
    width: 1rem;
    height: 1rem;
    display: block;
    flex-shrink: 0;
}

/* ================================================================
 * Form area
 * ================================================================ */

.form-area {
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

:root[data-theme="dark"] .form-area {
    background: var(--bg-elev) !important;
}

.form-row {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-field {
    flex: 1;
    min-width: 8.75rem;
    font-size: 0.75rem;
    color: var(--text-body);
    font-weight: 500;
}

.form-field--small {
    flex: 0 0 3.75rem;
    min-width: 3.75rem;
}

.form-field label {
    display: block;
    margin-bottom: 4px;
    text-align: left;
}

.form-field input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-panel);
    color: var(--text-strong);
    font-family: inherit;
}

.form-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.fetch-button {
    width: 7.5rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    color: #fff;
    height: 2.375rem;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.fetch-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.action-button {
    border: 1px solid var(--accent);
    background: none;
    padding: .375rem 1.125rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    color: var(--text-strong);
    white-space: nowrap;
    transition: opacity 0.2s;
}

@media (max-width: 750px) {
    .form-field {
        flex: 1 1 100%;
        min-width: 0;
    }

    .form-field--small {
        flex: 1 1 calc(20% - 5px);
        min-width: 0;
    }

    .fetch-button {
        width: 100%;
    }
}

/* ================================================================
 * States
 * ================================================================ */

.error-box {
    padding: 1rem;
    background: var(--error-bg);
    color: var(--error-text);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    text-align: left;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.75rem;
    color: var(--text-faint);
}

.empty-state-text {
    font-size: 0.875rem;
}

.no-reviews {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-faint);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-subtle);
}

.no-reviews:nth-last-child(1) {
    border-bottom: none;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    gap: 0.75rem;
}

.review-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.25rem;
}

.review-spinner-container.last {
    border-bottom: none;
    margin-bottom: 0;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-subtle);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================================================
 * App Header
 * ================================================================ */

.app-header-wrap {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.app-header-banner {
    position: absolute;
    inset: 0;
    z-index: 0;
    /* The children compose their own layers, which the parent's overflow does
       not always clip cleanly at the rounded corners. */
    border-radius: inherit;
    overflow: hidden;
}

.app-header-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.app-header-banner--blur {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(100px) saturate(1.5);
    -webkit-backdrop-filter: blur(100px) saturate(1.5);
    border-radius: inherit;
}

.app-header-banner-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-banner);
    border-radius: inherit;
}

.app-header {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1.25rem;
    padding: 1.75rem 1.5rem;
    text-align: left;
}

.app-header--has-banner .app-title {
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.app-header--has-banner .app-developer {
    text-decoration: underline;
    color: rgba(255, 255, 255, 0.9);
}

.app-header--has-banner .app-rating .rating-score {
    color: #fff;
}

.app-header--has-banner .rating-count {
    color: rgba(255, 255, 255, 0.8);
}

.app-header--has-banner .version-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.app-header--has-banner .price-tag {
    color: #fff;
}

.app-logo {
    width: 6.25rem;
    height: 6.25rem;
    object-fit: cover;
    box-shadow: var(--shadow-logo);
    flex-shrink: 0;
}

.app-logo--play {
    border-radius: 1.25rem;
}

.app-logo--apple {
    border-radius: 1.375rem;
}

.app-logo--ms {
    border-radius: 0.5rem;
}

.app-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.app-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.15;
}

.app-developer {
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 2px;
}

.app-meta {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.app-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rating-score {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-strong);
    padding-right: 4px;
}

.rating-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-left: 3px;
}

.version-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--gray-100);
    padding: 2px 0.625rem;
    border-radius: 0.75rem;
}

.price-tag {
    font-size: 0.8125rem;
    font-weight: 600;
}

.price-original {
    font-size: 0.75rem;
    color: var(--text-faint);
    text-decoration: line-through;
    margin-right: 4px;
}

.stars {
    position: relative;
    display: inline-block;
    line-height: 1;
    letter-spacing: 1px;
    white-space: nowrap;
    vertical-align: middle;
}

.stars__background {
    color: var(--star-off);
    display: inline-block;
}

.stars__foreground {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    color: var(--star-on);
    pointer-events: none;
}

.stars__foreground-inner {
    display: inline-block;
    white-space: nowrap;
}

.app-short-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
    line-height: 1.4;
}

.app-header--has-banner .app-short-description {
    color: rgba(255, 255, 255, 0.85);
}

/* ================================================================
 * Media section
 * ================================================================ */

.media-section {
    padding: 1.25rem 0;
}

.media-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.75rem;
}

.media-scroll {
    display: flex;
    gap: 0.625rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
}

.media-scroll::-webkit-scrollbar {
    height: 6px;
}

.media-scroll::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.media-scroll img {
    height: 13.75rem;
    border-radius: 0.75rem;
    scroll-snap-align: start;
    flex-shrink: 0;
    box-shadow: var(--shadow-media);
}

.video-card {
    position: relative;
    flex-shrink: 0;
    scroll-snap-align: start;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-media);
    cursor: pointer;
    height: 13.75rem;
}

.video-card iframe,
.video-card video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.video-poster-image {
    height: 100%;
    width: 100%;
    display: block;
    object-fit: cover;
}

.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    transition: background 0.2s;
}

.video-card:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.video-play-circle {
    width: 3.25rem;
    height: 3.25rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-play-circle::after {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
    margin-left: 3px;
}

/* ================================================================
 * Info sections
 * ================================================================ */

.info-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}

.info-section:nth-last-child(1) {
    border-bottom: none;
}

.info-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.75rem;
}

.info-description {
    font-size: 0.8125rem;
    color: var(--text-body);
    line-height: 1.5;
    overflow-wrap: anywhere;
    margin: 0;
}

.expand-button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 4px 0;
    font-weight: 500;
}

.info-dates {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.release-notes {
    margin-top: 1rem;
}

.release-notes-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-body);
    margin-bottom: 4px;
}

.release-notes-body {
    font-size: 0.75rem;
    color: var(--text-body);
    line-height: 1.4;
    overflow-wrap: anywhere;
    margin: 0;
}

/* ================================================================
 * Reviews
 * ================================================================ */

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-top: 1.25rem;
}

.reviews-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin: 0;
}

.sort-group {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 3px;
}

.sort-button {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.2s;
}

.review-card {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-muted);
    text-align: left;
}

.review-stars-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.review-version-label {
    font-size: 0.625rem;
    color: var(--text-faint);
    padding-left: 2px;
}

.review-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 2px;
}

.review-content {
    font-size: 0.75rem;
    color: var(--text-body);
    line-height: 1.4;
    overflow-wrap: anywhere;
    margin: 0;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    color: var(--text-faint);
}

.review-meta .profile-image {
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 50%;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

.review-helpful {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.review-helpful svg {
    width: 0.8125rem;
    height: 0.8125rem;
    display: block;
    flex-shrink: 0;
}

.reviews-end {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-faint);
    font-size: 0.75rem;
}

.load-more {
    width: 100%;
    height: 7rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.25rem;
}

.load-more.last {
    border-bottom: none;
    margin-bottom: 0;
}

/* ================================================================
 * Histogram
 * ================================================================ */

.histogram {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.histogram-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.75rem;
}

.histogram-label {
    width: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: right;
}

.histogram-track {
    flex: 1;
    height: 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.histogram-fill {
    height: 100%;
    background: var(--star-on);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.histogram-count {
    width: 3.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    text-align: left;
}

/* ================================================================
 * Chips
 * ================================================================ */

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.chip-row a {
    text-decoration: underline;
    text-decoration-color: var(--text-body);
}

.chip {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-body);
    background: var(--gray-200);
    padding: 4px 0.625rem;
    border-radius: 0.75rem;
}

.chip--accent {
    color: var(--accent);
    background: var(--accent-light);
}

/* ================================================================
 * Detail grid
 * ================================================================ */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.25rem, 1fr));
    gap: 0.625rem;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-elev);
    border-radius: 0.625rem;
    transition: background 0.15s;
    text-align: left;
}

.detail-item:hover {
    background: var(--bg-elev-hover);
}

.detail-item-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--text-faint);
    margin-top: 1px;
}

.detail-item-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.detail-item-body {
    flex: 1;
    min-width: 0;
}

.detail-label {
    font-size: 0.625rem;
    color: var(--text-faint);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.detail-value {
    font-size: 0.6875rem;
    color: var(--text-strong);
    font-weight: 500;
    word-break: break-word;
    line-height: 1.35;
}

.detail-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.detail-chip {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-body);
    background: var(--gray-200);
    padding: 2px 0.5rem;
    border-radius: 4px;
    line-height: 1.5;
    white-space: nowrap;
}

.detail-chip--more {
    cursor: pointer;
    background: var(--bg-elev);
    border: 1px dashed var(--border-subtle);
    color: var(--text-muted);
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.detail-chip--more:hover {
    background: var(--bg-elev-hover);
    color: var(--text-body);
}

.detail-chip--more:active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.chips-popover {
    z-index: 9999;
    max-width: 17.5rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 0.625rem;
    box-shadow: var(--shadow-panel);
    padding: 0.625rem;
}

.chips-popover__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    max-height: 12.5rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

.chips-popover__inner.single {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-body);
    padding: 2px 0.5rem;
    border-radius: 4px;
    line-height: 1.5;
    white-space: nowrap;
}

.chips-popover__inner::-webkit-scrollbar {
    width: 4px;
}

.chips-popover__inner::-webkit-scrollbar-track {
    background: transparent;
}

.chips-popover__inner::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 99px;
}

/* ================================================================
 * Similar section
 * ================================================================ */

.similar-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.similar-scroll {
    display: grid;
    gap: 1.875rem;
    overflow-x: auto;
    padding-bottom: 1.25rem;
    scroll-snap-type: x mandatory;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}

.similar-scroll::-webkit-scrollbar {
    height: 6px;
}

.similar-scroll::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.similar-result-card {
    align-items: center;
    width: 12.5rem;
    gap: 0.875rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
    text-align: left;
    scroll-snap-align: start;
    display: flex;
}

.similar-result-logo {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.similar-result-body {
    flex: 1;
    min-width: 0;
}

.similar-result-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.similar-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.similar-result-price {
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ================================================================
 * Developer links
 * ================================================================ */

.dev-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.dev-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 5px 0.625rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    transition: all 0.15s;
}

.dev-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ================================================================
 * Search results
 * ================================================================ */

.search-result-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-title {
    font-size: 1.0625rem;
    font-weight: 500;
    padding: 0 0 0.6875rem 0;
}

.search-result-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--bg-elev);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
    text-align: left;
}

.search-result-card:hover {
    background: var(--bg-elev-hover);
    border-color: var(--border-subtle);
}

.search-result-logo {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.search-result-logo--play {
    border-radius: 0.75rem;
}

.search-result-logo--apple {
    border-radius: 0.875rem;
}

.search-result-logo--ms {
    border-radius: 0.375rem;
}

.search-result-body {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-result-price {
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.search-empty-state {
    text-align: center;
    padding: 3.75rem 1.25rem;
    color: var(--text-faint);
    font-size: 0.875rem;
}

/* ================================================================
 * Speed dial
 * ================================================================ */

.speed-dial {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    z-index: 200;
}

@media (max-width: 720px) {
    .speed-dial {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

.speed-dial-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.speed-dial-list.expanded {
    opacity: 1;
    pointer-events: auto;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.88);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.speed-dial-slot {
    animation: fadeUp 0.22s ease both;
}

.speed-dial-fab {
    width: 2.875rem;
    height: 2.875rem;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-logo);
}

.speed-dial-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

.speed-dial-fab:active {
    transform: scale(0.96);
}

.speed-dial-fab-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.speed-dial-fab-icon.plus {
    opacity: 1;
    transform: rotate(0deg);
}

.speed-dial-fab-icon.plus.active {
    opacity: 0;
    transform: rotate(45deg);
}

.speed-dial-fab-icon.close {
    opacity: 0;
    transform: rotate(-45deg);
}

.speed-dial-fab-icon.close.active {
    opacity: 1;
    transform: rotate(0deg);
}

.speed-dial-btn-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.speed-dial-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
    box-shadow: var(--shadow-panel);
}

.speed-dial-btn svg {
    width: 100%;
    height: 100%;
}

.speed-dial-btn:hover {
    background: var(--bg-elev-hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
}

.speed-dial-btn:active {
    transform: scale(0.94);
}

.speed-dial-tooltip {
    position: absolute;
    right: calc(100% + 0.5rem);
    white-space: nowrap;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    color: var(--text-strong);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: var(--shadow-panel);
}

.speed-dial-btn-wrap:hover .speed-dial-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ================================================================
 * Modal
 * ================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Column layout so .modal-body is the only scroller and the footer stays put. */
.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-panel);
    width: 100%;
    max-width: 30rem;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.18s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(0.75rem) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 1px solid var(--border-muted);
    flex-shrink: 0;
}

.modal-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-strong);
}

.modal-close {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
    background: var(--bg-elev-hover);
    color: var(--text-strong);
}

.modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-muted);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.modal-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modal-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.375rem;
    background: var(--bg-elev);
    color: var(--text-strong);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: var(--accent);
}

.modal-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.375rem;
    background: var(--bg-elev);
    color: var(--text-strong);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.modal-select:focus {
    border-color: var(--accent);
}

/* ================================================================
 * Embed Modal
 * ================================================================ */

.embed-code-wrap {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.embed-iframe-wrap {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.embed-footer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.embed-footer-actions {
    display: flex;
    gap: 0.25rem;
}

.embed-code-wrap {
    border: 0;
}

.embed-iframe-wrap {
    height: 280px;
}

/* The panes swap in place, so the hidden one must not reserve space. */
.embed-code-wrap[hidden],
.embed-iframe-wrap[hidden] {
    display: none;
}

/* Matches the preview iframe so swapping does not resize the modal. */
.modal-footer .embed-code-wrap {
    height: 280px;
}

.embed-code-wrap pre {
    height: 280px;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.6;
    overflow-x: auto;
    background: var(--gray-100) !important;
}

.embed-code-wrap code {
    height: 100%;
    background: transparent !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

.embed-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.embed-url-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.375rem;
    background: var(--bg-elev);
}

.embed-url-text {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-body);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* ================================================================
 * Section chips
 * ================================================================ */

.section-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    min-height: 2rem;
}

.section-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem 0.25rem 0.625rem;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 500;
    height: 1.5rem;
}

.section-chip-label {
    line-height: 1;
}

.section-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.section-chip-remove:hover {
    background: var(--accent);
    color: #fff;
}

.section-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.section-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elev);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    height: 1.5rem;
}

.section-preset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.option-toggle input {
    width: 0.875rem;
    height: 0.875rem;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.option-toggle-text {
    font-size: 0.8125rem;
    color: var(--text-body);
}

/* ================================================================
 * Embed playground — a live frame beside its message traffic
 * ================================================================ */

.pg-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 1rem; }

.pg-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    border-radius: 0.4rem;
    background: var(--bg-panel);
    color: var(--text-body);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.pg-btn:hover { border-color: var(--accent); color: var(--accent); }

.pg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }

.pg-pane { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.pg-pane-head { display: flex; align-items: center; justify-content: space-between; }

.pg-pane-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.pg-clear {
    font-size: 0.68rem;
    border: none;
    background: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 0;
}

.pg-clear:hover { color: var(--accent); }

/* The frame sizes itself from its own messages; this only draws the edge. */
.pg-frame-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    overflow: hidden;
}

.pg-frame { display: block; width: 100%; height: 12rem; border: 0; transition: height 0.3s ease; }

.pg-log {
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    background: var(--bg-elev);
    height: 26.25rem;
    overflow: auto;
    font-size: 0.72rem;
}

.pg-empty { color: var(--text-faint); padding: 0.4rem; }

.pg-entry {
    display: grid;
    grid-template-columns: 0.9rem 4.2rem auto;
    gap: 0.3rem;
    align-items: baseline;
    padding: 0.28rem 0.3rem;
    border-bottom: 1px solid var(--border-muted);
}

.pg-entry:last-child { border-bottom: none; }
.pg-dir { color: var(--text-faint); }
.pg-entry.out .pg-dir { color: var(--accent); }
.pg-at { color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-type { font-weight: 700; color: var(--text-strong); }

.pg-body {
    grid-column: 1 / -1;
    color: var(--text-muted);
    word-break: break-all;
    font-size: 0.68rem;
}

@media (max-width: 60rem) {
    .pg-grid { grid-template-columns: minmax(0, 1fr); }
    .pg-log { height: 16rem; }
}

/* Collapsible group of embed options. */
.option-group {
    border-top: 1px solid var(--border-muted);
    padding-top: 0.75rem;
}

.option-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.option-group-head::-webkit-details-marker { display: none; }
.option-group-head .modal-label { cursor: pointer; }
.option-group-mark { color: var(--text-faint); transition: transform 0.15s ease; flex-shrink: 0; }
.option-group[open] .option-group-mark { transform: rotate(90deg); }

.option-group-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.6rem;
}

/* One analytics block's charts and window, inside the embed form. */
.analytics-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
}

.analytics-block-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.analytics-block-id { width: 8rem; flex: none; font-size: 0.72rem; padding: 0.2rem 0.4rem; }

.analytics-block-title {
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: 0.7rem;
    color: var(--text-faint);
}

.analytics-window { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.analytics-window .modal-select { width: auto; }
.analytics-window .modal-input { width: auto; min-width: 0; flex: 1 1 7rem; }
.analytics-range-sep { color: var(--text-faint); }

/* A chart the block draws, as opposed to one it could add. */
.section-preset-btn.on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* What the selected option does, under the control that chose it. */
.option-hint {
    font-size: 0.6875rem;
    color: var(--text-faint);
    line-height: 1.5;
    margin-top: -0.15rem;
}

/* Disabled controls should read as unavailable, not merely unstyled. */
.modal-select:disabled,
.option-toggle input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.option-toggle:has(input:disabled) {
    cursor: not-allowed;
}

.option-toggle:has(input:disabled) .option-toggle-text {
    opacity: 0.45;
}

/* Result cards that cannot open another app should not look clickable. */
.result-card--static,
.result-card--static:hover {
    cursor: default;
    /*background: var(--bg-elev);*/
    border-color: transparent;
}

/* ================================================================
 * Color picker
 * ================================================================ */

.color-picker-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.375rem;
    background: var(--bg-elev);
    color: var(--text-strong);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.color-picker-trigger:hover,
.color-picker-trigger:focus-visible {
    border-color: var(--accent);
    outline: none;
}

.color-picker-value {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.8125rem;
}

/* Checkerboard shows through wherever --swatch is translucent. */
.color-swatch {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.18);
    background-image: linear-gradient(var(--swatch), var(--swatch)),
    conic-gradient(#d0d0d0 0 25%, #fff 0 50%, #d0d0d0 0 75%, #fff 0);
    background-size: auto, 8px 8px;
}

/* Keeps .chips-popover's z-index so it clears the modal overlay. */
.color-picker-popover {
    padding: 0.75rem;
    width: 17rem;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.color-area {
    position: relative;
    width: 100%;
    height: 8.5rem;
    border-radius: 0.375rem;
    cursor: crosshair;
    touch-action: none;
    overflow: hidden;
}

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

.color-area-saturation,
.color-area-value {
    position: absolute;
    inset: 0;
}

.color-area-saturation {
    background: linear-gradient(to right, #fff, transparent);
}

.color-area-value {
    background: linear-gradient(to top, #000, transparent);
}

.color-marker {
    position: absolute;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-sliders {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-slider {
    position: relative;
    height: 0.625rem;
    border-radius: 999px;
    cursor: pointer;
    touch-action: none;
}

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

.color-slider--hue {
    background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

/* Only the alpha track needs the checkerboard behind its gradient. */
.color-slider--alpha {
    background-image: conic-gradient(#d0d0d0 0 25%, #fff 0 50%, #d0d0d0 0 75%, #fff 0);
    background-size: 8px 8px;
}

.color-slider-track {
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.color-slider-thumb {
    position: absolute;
    top: 50%;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.color-format-btn,
.color-reset-btn {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.3rem;
    background: var(--bg-elev);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}

.color-format-btn {
    text-transform: uppercase;
    width: 2.5rem;
    text-align: center;
}

.color-format-btn:hover,
.color-reset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.color-input {
    flex: 1;
    min-width: 0;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.3rem;
    background: var(--bg-elev);
    color: var(--text-strong);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.75rem;
    outline: none;
    transition: border-color 0.15s;
}

.color-input:focus {
    border-color: var(--accent);
}

.color-input.invalid {
    border-color: #dc2626;
}

.color-swatches {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
}

.color-swatch--btn {
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    border: none;
    padding: 0;
    cursor: pointer;
}

.color-swatch--btn.selected {
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.18), 0 0 0 2px var(--accent);
}

.color-swatch--btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* ================================================================
 * Snapshot Charts
 * ================================================================ */

.snapshot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.snapshot-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin: 0;
}

.chart-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    height: 140px;
    background: var(--bg-elev);
    border-radius: 0.625rem;
    transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.chart-container {
    display: grid;
    flex-direction: row;
    gap: 0.625rem;
    padding-bottom: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(11.25rem, 1fr));
}

.chart-container::-webkit-scrollbar {
    height: 6px;
}

.chart-container::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.chart-floating {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: .25em;
    top: 12px;
    left: 0;
    padding: 12px 12px 0;
    transition: left 0.3s linear;
    font-size: 15px;
}

.chart-floating .title {
    font-size: 0.675em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0275em;
}

.chart-floating .value {
    display: flex;
    align-items: flex-end;
    gap: .5em;
}

.chart-floating .value .absolute {
    font-size: 1.375em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0275em;
}

.chart {
    position: relative;
    height: 80px;
    padding: 0 0 10px;
}

.chart-container:has(.expand) {
    display: block;
}

.chart-container:has(.expand) .chart-card:not(.expand) {
    display: none;
}

.chart-card.expand {
    width: 100%;
    height: 240px;
    justify-content: center;
}

.expand .chart-floating {
    display: none;
}

.expand .chart {
    height: 200px;
    padding: 0 12px;
}

.chart-hover-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    padding: 0.4rem 0.65rem;
    box-shadow: var(--shadow-panel);
    white-space: nowrap;
    transition: opacity 0.1s ease;
}

.chart-hover-sections {
    margin-bottom: 0.3rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-muted);
}

.chart-hover-sections:nth-last-child(1) {
    margin-bottom: 0;
    border-bottom: none;
}

.chart-hover-header {
    display: flex;
    flex-direction: column;
    gap: .05rem;
}

.chart-hover-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chart-hover-title {
    font-size: 0.675em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0275em;
}

.chart-hover-value-container {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
}

.chart-hover-star-container {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: .75rem 2rem;
    justify-items: start;
}

.chart-hover-star-item {
    display: flex;
    gap: 2rem;
}

.chart-hover-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
    position: relative;
    display: flex;
    align-items: center;
    gap: .2rem;
}

.chart-hover-value::before {
    content: ' ';
    width: .5rem;
    height: .5rem;
    border-radius: .25rem;
    background-color: var(--color);
    display: var(--color, none);
}

.type-1 .chart-hover-sub-value {
    font-size: 0.5875rem;
    font-weight: 500;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.chart-hover-sub-value {
    font-weight: 500;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.chart-hover-sub-value.type-1 {
    font-size: 0.5875rem;
}

.chart-hover-sub-value.type-2 {
    font-size: 0.725rem;
}

.chart-hover-sub-value.type-3 {
    font-weight: 700;
    color: var(--text-strong);
    font-size: 0.725rem;
}

.chart-hover-sub-value.positive {
    color: #34c759;
}

.chart-hover-sub-value.negative {
    color: #ff3b2f;
}

.chart-floating .value .relative {
    font-size: 0.875em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0275em;
    height: 1em;
    overflow: hidden;
    line-height: 1;
    position: relative;
    top: -.2rem;
}

.chart-floating .value .relative.positive {
    color: #34c759;
}

.chart-floating .value .relative.negative {
    color: #ff3b2f;
}

.chart-floating .value .relative-roll {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
}

.chart-floating .value .relative-roll.rolling {
    transform: translateY(-1em);
    transition: transform 0.75s cubic-bezier(0.25, 1, 0.5, 1);
}

.chart-floating .value .relative-item {
    height: 1em;
    line-height: 1;
    display: flex;
    align-items: center;
}

.request-observe-container {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-body);
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

.collecting-app-icon {
    width: 1.5rem;
    height: 1.5rem;
    animation: spin 5s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ================================================================
 * News section
 * ================================================================ */

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.news-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin: 0;
}

.news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.news-list-item {
    background: var(--bg-elev);
    border: 1px solid transparent;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: background 0.15s, border-color 0.15s;
}

.news-list-item:hover {
    background: var(--bg-elev-hover);
    border-color: var(--border-subtle);
}

.news-link {
    display: flex;
    align-items: stretch;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: inherit;
}

.news-thumbnail,
.news-thumbnail-placeholder {
    flex: 0 0 auto;
    width: 7.5rem;
    height: 5rem;
    border-radius: 0.5rem;
    object-fit: cover;
    background: var(--gray-100);
    box-shadow: var(--shadow-media);
}

.news-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-thumbnail-fallback-icon {
    width: 1.75rem;
    height: 1.75rem;
    opacity: 0.4;
    border-radius: 4px;
}

.news-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.375rem;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: var(--text-faint);
    min-height: 1rem;
}

.news-source-icon {
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.news-source {
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 12.5rem;
}

.news-meta-divider {
    color: var(--text-faint);
    flex-shrink: 0;
}

.news-date {
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.news-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-strong);

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
}

.no-news {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-faint);
    font-size: 0.75rem;
}

@media (max-width: 600px) {
    .news-link {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .news-thumbnail,
    .news-thumbnail-placeholder {
        width: 5.5rem;
        height: 4rem;
    }

    .news-card-title {
        -webkit-line-clamp: 3;
    }
}
.review-reply {
    margin-top: 10px;
    margin-left: 12px;
    padding: 10px 12px;
    border-left: 2px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    border-radius: 0 8px 8px 0;
}

.review-reply-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.review-reply-author {
    font-weight: 600;
    opacity: 1;
}

.review-reply-content {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.similar-section-title--plain {
    cursor: default;
}

/* Zero specificity, so a class passed alongside it (.news-link, .dev-link)
   keeps its own display and padding whatever the source order. */
:where(.external-link) {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    text-align: inherit;
    cursor: pointer;
}

.external-link-popover {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 22rem;
}

.external-link-url {
    flex: 1 1 auto;
    user-select: all;
    -webkit-user-select: all;
    min-width: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
}

.external-link-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 0.25rem;
}

.external-link-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 0.375rem;
    cursor: pointer;
}

.external-link-action:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.external-link-action svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ================================================================
 * API documentation
 * ================================================================ */

.docs-page {
    --accent: var(--brand-accent);
    --accent-light: var(--brand-accent-light);
    max-width: 68rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

.docs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.docs-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem 0.375rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-panel);
    color: var(--text-body);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.docs-back:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.docs-back svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.docs-lang-switch {
    display: flex;
    gap: 3px;
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 3px;
}

.docs-lang-btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.docs-lang-btn:hover {
    color: var(--text-strong);
}

.docs-lang-btn.active {
    background: var(--accent);
    color: #fff;
}

/* Which of the two references is open, at the top of the sidebar. */
.docs-tabs {
    display: flex;
    gap: 3px;
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 3px;
    margin-bottom: 1.25rem;
}

.docs-tab {
    flex: 1;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.docs-tab:hover { color: var(--text-strong); }
.docs-tab.active { background: var(--accent); color: #fff; }

.embed-docs-link { color: var(--accent); font-weight: 600; white-space: nowrap; }

.docs-body {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.docs-toc {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.docs-toc-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.4rem;
}

.docs-toc-group {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0.75rem 0 0.25rem;
}

.docs-toc a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-body);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.docs-toc a:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.docs-toc-sub {
    padding-left: 0.25rem !important;
}

.docs-main {
    min-width: 0;
}

.docs-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 0.35rem;
}

.docs-subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.docs-h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-strong);
    margin: 2.5rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
    scroll-margin-top: 1.5rem;
}

.docs-subhead {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 1.25rem 0 0.5rem;
}

.docs-text {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-body);
    margin-bottom: 0.75rem;
}

.docs-text--muted {
    color: var(--text-muted);
}

.docs-endpoint {
    padding: 1.25rem;
    margin-top: 1.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    background: var(--bg-panel);
    scroll-margin-top: 1.5rem;
}

.docs-endpoint-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.docs-method {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    color: #fff;
    flex-shrink: 0;
}

.docs-method--get {
    background: #2563eb;
}

.docs-method--post {
    background: #059669;
}

.docs-method--delete {
    background: #dc2626;
}

.docs-path {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-strong);
}

.docs-endpoint-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.4rem;
}

.docs-schema {
    padding: 1.25rem;
    margin-top: 1.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    background: var(--bg-panel);
}

.docs-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.docs-table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 0.55rem 0.75rem;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.docs-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-muted);
    color: var(--text-body);
    line-height: 1.6;
    vertical-align: top;
}

.docs-table tr:last-child td {
    border-bottom: none;
}

.docs-table code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-strong);
    background: var(--bg-elev);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.docs-type {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.docs-required {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--error-text);
}

.docs-dash {
    color: var(--text-faint);
}

.docs-code {
    position: relative;
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    overflow: hidden;
}

.docs-code pre {
    margin: 0;
    /* Right padding keeps the first line clear of the copy button. */
    padding: 0.9rem 3rem 0.9rem 1rem;
    overflow-x: auto;
    background: var(--gray-100) !important;
    font-size: 0.75rem;
    line-height: 1.65;
}

.docs-code code {
    background: transparent !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    user-select: text;
}

.docs-code-copy {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: var(--bg-panel);
    z-index: 1;
}

.docs-notes {
    list-style: none;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.docs-notes li {
    position: relative;
    padding-left: 0.9rem;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.docs-notes li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

@media (max-width: 900px) {
    .docs-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .docs-toc {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--border-subtle);
        padding-bottom: 1rem;
    }
}

.docs-code-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 3px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 0.5rem;
}

.docs-code-tab {
    padding: 0.3rem 0.7rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.docs-code-tab:hover {
    color: var(--text-strong);
}

.docs-code-tab.active {
    background: var(--accent);
    color: #fff;
}

.docs-extends {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-faint);
}

.docs-toc-schema {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.75rem !important;
}

.docs-schema-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0;
    margin: 0 0 0.4rem -0.25rem;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.docs-schema-head .docs-endpoint-title {
    margin: 0;
}

.docs-schema-head:hover .docs-endpoint-title code {
    color: var(--accent);
}

.docs-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--text-faint);
    transition: transform 0.15s ease, color 0.15s;
}

.docs-chevron svg {
    width: 0.875rem;
    height: 0.875rem;
}

.docs-chevron.open {
    transform: rotate(90deg);
    color: var(--accent);
}

.docs-schema-summary {
    margin-bottom: 0;
}

.docs-schema-body[hidden] {
    display: none;
}

.docs-schema-body {
    margin-top: 0.9rem;
}

.docs-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--accent);
    text-decoration: none;
    vertical-align: baseline;
}

.docs-inline-link code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.75rem;
    background: var(--accent-light);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.docs-inline-link svg {
    width: 0.7rem;
    height: 0.7rem;
    flex-shrink: 0;
}

.docs-inline-link:hover code {
    background: var(--accent);
    color: #fff;
}

.docs-toc-row {
    display: flex;
    align-items: center;
}

.docs-toc-row a {
    flex: 1;
    min-width: 0;
}

.docs-toc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 0.375rem;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}

.docs-toc-toggle:hover {
    background: var(--accent-light);
}

/* ================================================================
 * API docs — try it
 * ================================================================ */

.try-it {
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    padding: 0.9rem;
    background: var(--bg-elev);
}

.try-it-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.6rem;
}

.try-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.try-field--wide {
    margin-top: 0.6rem;
}

.try-field-label {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.try-input {
    width: 100%;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.375rem;
    background: var(--bg-panel);
    color: var(--text-strong);
    font-size: 0.8125rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    user-select: text;
}

.try-input:focus {
    border-color: var(--accent);
}

.try-textarea {
    resize: vertical;
    line-height: 1.5;
}

.try-it-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.try-url {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--border-muted);
    border-radius: 0.375rem;
    background: var(--bg-panel);
    color: var(--text-muted);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.6875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: text;
}

.try-send {
    padding: 0.45rem 1.1rem;
    border: none;
    border-radius: 0.375rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.try-send:hover:not(:disabled) {
    opacity: 0.88;
}

.try-send:disabled {
    opacity: 0.55;
    cursor: default;
}

.try-hint {
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-faint);
    line-height: 1.6;
}

.try-result {
    margin-top: 0.75rem;
}

.try-result-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.try-status {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    background: #059669;
    color: #fff;
}

.try-status.failed {
    background: var(--error-text);
}

.try-elapsed {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.try-response {
    max-height: 22rem;
    overflow: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 0.375rem;
    background: var(--bg-panel);
}

/* ================================================================
 * JSON tree viewer
 * ================================================================ */

.json-view {
    padding: 0.7rem 1.25rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.6875rem;
    line-height: 1.75;
    user-select: text;
}

.json-view--raw {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-body);
}

.json-row {
    white-space: nowrap;
}

.json-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
    color: inherit;
}

.json-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.7rem;
    height: 0.7rem;
    margin-left: -0.75rem;
    color: var(--text-faint);
    transition: transform 0.12s ease;
}

.json-chevron svg {
    width: 0.6rem;
    height: 0.6rem;
}

.json-chevron.open {
    transform: rotate(90deg);
}

.json-toggle:hover .json-chevron {
    color: var(--accent);
}

.json-key {
    color: var(--text-strong);
    font-weight: 600;
}

.json-colon,
.json-comma,
.json-brace {
    color: var(--text-faint);
}

.json-count {
    margin: 0 0.25rem;
    padding: 0 0.3rem;
    border-radius: 0.2rem;
    background: var(--bg-elev-hover);
    color: var(--text-muted);
}

.json-string {
    color: #059669;
    word-break: break-all;
}

.json-number {
    color: #2563eb;
}

.json-boolean {
    color: #9333ea;
}

.json-null {
    color: var(--text-faint);
}

.json-clip {
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}

/* An expanded value wraps instead of stretching the pane sideways. */
.json-clip.expanded {
    white-space: pre-wrap;
}

:root[data-theme="dark"] .json-string {
    color: #34d399;
}

:root[data-theme="dark"] .json-number {
    color: #60a5fa;
}

:root[data-theme="dark"] .json-boolean {
    color: #c084fc;
}

.embed-param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.6rem;
}

.embed-param {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.embed-param-label {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.embed-param .modal-input,
.embed-param .modal-select {
    padding: 0.4rem 0.55rem;
    font-size: 0.8125rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

.embed-param .modal-input {
    user-select: text;
}

/* ================================================================
 * Landing
 *
 * Left-aligned throughout with a persistent index rail: the three stores are
 * the product's structure, not decoration, so they stay on screen as a list.
 * ================================================================ */

.lp {
    --lp-ground: #0a0b0d;
    --lp-ink: #edf0f1;
    --lp-dim: #8c959c;
    --lp-line: #1e2226;
    --lp-accent: var(--brand-accent);

    background: var(--lp-ground);
    color: var(--lp-ink);
}

/*
 * Korean breaks on syllables by default, which splits words mid-token. Scoped to
 * Korean on purpose: `keep-all` also forbids breaks between Han characters, so
 * applying it page-wide would run every Chinese paragraph off the edge.
 */
.lp:lang(ko) { word-break: keep-all; }

/* Set on the root while the landing is mounted: the page scrollbar is painted
   there, above `.lp`, so it would otherwise carry the light theme's thumb. */
.lp-root {
    --scrollbar-thumb: #2f353b;
    color-scheme: dark;
}

.lp a { color: inherit; text-decoration: none; }
.lp code { font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace; font-size: .92em; color: var(--lp-ink); }

/* ---------------- nav ---------------- */

/*
 * Fixed, not sticky: in the flow it pushes the first sticky stage down by its
 * own height, and the stage then snaps that distance back up on the first pixel
 * of scroll — a visible lurch at the very top of the page.
 */
.lp-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.6rem;
    padding: .75rem clamp(1rem, 4vw, 2.5rem);
    background: rgb(10 11 13 / .82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--lp-line);
}

.lp-brand {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: -.02em;
}

.lp-brand i { color: var(--lp-accent); font-style: normal; }

/* Ink, not the accent: the mark is the wordmark's first letter in weight, and a
   tinted one would read as a separate object sitting beside the name. */
.lp-brand .lp-mark { flex: none; width: 1.2rem; height: 1.2rem; }
.lp-mark svg { display: block; width: 100%; height: 100%; }

.lp-nav-links { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.7rem); font-size: .81rem; color: var(--lp-dim); }
.lp-nav-links a:not(.lp-btn):hover { color: var(--lp-ink); }

.lp-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity .15s, color .15s;
}

/*
 * Ink on ground rather than a tinted fill: a grey button reads as disabled.
 * Two classes because `.lp a { color: inherit }` is a class-and-type selector and
 * would otherwise win, leaving the nav's dim grey on top of a near-white fill.
 */
.lp .lp-btn--solid { background: var(--lp-ink); color: var(--lp-ground); padding: .55rem 1.1rem; border-radius: 4px; }
.lp-btn--solid:hover { opacity: .88; }
.lp-btn--sm { padding: .38rem .8rem; font-size: .78rem; }
.lp-btn--plain { color: var(--lp-dim); }
.lp-btn--plain:hover { color: var(--lp-ink); }

/* ---------------- shared ---------------- */

.lp-stage { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; overflow: hidden; }

.lp-h1 {
    font-size: clamp(1.9rem, 4.4vw, 3rem);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.14;
    margin: 0 0 .9rem;
}

.lp-h2 {
    font-size: clamp(1.5rem, 3.2vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.18;
    margin: 0 0 .7rem;
}

.lp-sub { color: var(--lp-dim); font-size: clamp(.86rem, 1.4vw, .96rem); line-height: 1.7; margin: 0; max-width: 34ch; }

.lp-kicker {
    display: inline-block;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: .64rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--lp-dim);
    margin-bottom: .8rem;
}

.lp-cta { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.6rem; }

/* The embed is shown at reduced scale so a whole store page fits at once. */
.lp-viewport {
    position: relative;
    width: 100%;
    height: min(30rem, 62vh);
    overflow: hidden;
    border: 1px solid var(--lp-line);
    border-radius: 6px;
    background: #fff;
}

.lp-viewport--tall { height: min(34rem, 70vh); }

/* Shown at true size, for embeds whose content is already legible. */
.lp-viewport--flat .lp-frame { width: 100%; height: 100%; transform: none; }

/*
 * Height comes from the embed itself at runtime — the frame fills its box, so a
 * fixed one leaves dead space under whatever the embed actually drew. The value
 * here only covers the moment before the measurement lands.
 */
.lp-viewport--fit { height: min(20rem, 42vh); transition: height .45s cubic-bezier(.22, 1, .36, 1); }

/*
 * Dissolves the frame into the section behind it. A bordered box on a contrasting
 * ground announces every pixel of a height change; with the same ground and no
 * edge, only the cards inside appear to arrive. Pairs with `appearance=dark` on
 * the embed and the transparent document the host stylesheet injects.
 */
.lp-viewport--blend,
.lp-viewport--blend .lp-frame { background: var(--lp-ground); }
.lp-viewport--blend { border: 0; border-radius: 0; }

/*
 * Dissolves the top and bottom edges of the frame, so a section the frame cuts
 * off ends in the embed's own ground rather than on a hard line. `--fade` is set
 * by the host, which is the only side that knows which theme the embed resolved
 * to; the frame's own background follows it so the two never disagree.
 */
.lp-viewport--fade { background: var(--fade); }

.lp-viewport--fade::before,
.lp-viewport--fade::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    /* The iframe is positioned too, so only an explicit index lifts these above
       it — tree order alone would leave `::before` underneath. */
    z-index: 2;
    pointer-events: none;
}

/* Shallower at the top: a section too tall to centre is aligned to the top edge,
   and a deep fade there would wash out its heading. Content arrives from below,
   which is where the cut needs softening. */
.lp-viewport--fade::before { top: 0; height: 2.25rem; background: linear-gradient(var(--fade), transparent); }
.lp-viewport--fade::after { bottom: 0; height: 5rem; background: linear-gradient(transparent, var(--fade)); }

.lp-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 117.7%;
    height: 117.7%;
    border: 0;
    transform: scale(.85);
    transform-origin: 0 0;
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
    /* Same ground the embed paints, so an overscroll bounce reveals nothing. */
    background: var(--bg-body);
}

.lp-frame.on { opacity: 1; pointer-events: auto; }

/* ---------------- hero ---------------- */

.lp-hero { position: relative; height: 800vh; }
.lp-hero .lp-stage { background: var(--lp-ground); }

/*
 * The panel throws the colour of whichever store it is showing. Cast upward, so
 * it reads as light off the panel rather than a drop shadow under it, and eased
 * to cross-fade with the frames it belongs to.
 */
.lp-hero .lp-viewport {
    box-shadow: 0 -10px 60px -12px var(--glow);
    transition: box-shadow .5s ease;
}

.lp-hero-grid {
    width: min(72rem, 92vw);
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr) minmax(0, 1.15fr);
    gap: clamp(1.5rem, 3.5vw, 3rem);
    align-items: center;
}

.lp-index { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; align-self: start; padding-top: .5rem; }

.lp-index li { display: grid; gap: .4rem; opacity: .4; transition: opacity .35s ease; }
.lp-index li.on { opacity: 1; }

.lp-index-bar { display: block; height: 2px; background: var(--lp-line); overflow: hidden; }
.lp-index-bar i { display: block; height: 100%; background: var(--c); transform-origin: 0 50%; transition: transform .12s linear; }

.lp-index-name {
    display: flex;
    align-items: center;
    gap: .38rem;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: .64rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--lp-dim);
}

.lp-index li.on .lp-index-name { color: var(--lp-ink); }

.lp-index-icon { flex: none; width: .85rem; height: .85rem; }
.lp-index-icon svg { display: block; }

/*
 * The store logos ship their brand colours, which would fight the theme colour
 * already carrying the bar underneath. Flattened to the label's own ink so the
 * mark and the name read as one item; the knock-out keeps glyphs legible on
 * logos drawn as light-on-dark.
 */
.lp-index-icon svg * { fill: currentColor; }
.lp-index-icon svg [fill="#fff"], .lp-index-icon svg [fill="#ffffff"] { fill: var(--lp-ground); }

/* ---------------- assembly ---------------- */

.lp-assembly { position: relative; height: 1100vh; }
.lp-assembly .lp-stage { background: #f7f8f7; color: #121512; }
.lp-assembly .lp-sub { color: #5b6560; }
/* This section runs on a light ground, so the page-wide code ink is invisible here. */
.lp-assembly code { color: #121512; }
.lp-assembly .lp-kicker { color: #5b6560; }
.lp-assembly .lp-viewport { border-color: #dfe4e1; }

.lp-assembly-grid {
    width: min(74rem, 92vw);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
}

.lp-snippet {
    position: relative;
    margin-top: 1.6rem;
    padding: .9rem 1rem;
    background: #0d1117;
    border-radius: 5px;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: clamp(.66rem, 1vw, .76rem);
    line-height: 1.9;
    color: #c9d3de;
    overflow-x: auto;
    white-space: nowrap;
}

.c-att { color: #c4b5fd; }
.c-str { color: #86efac; }

/* Zero width until revealed, so the closing quote is pushed along rather
   than jumping to a new position. */
.lp-token {
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    vertical-align: bottom;
    color: #86efac;
    transition: max-width .5s cubic-bezier(.22, 1, .36, 1);
}

.lp-token.on { max-width: 12ch; }
.lp-token-inner { display: inline-block; white-space: pre; }

.lp-copy {
    position: absolute;
    top: .55rem;
    right: .55rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-family: inherit;
    font-size: .66rem;
    font-weight: 600;
    color: #9fb3c8;
    background: rgb(255 255 255 / .07);
    border: 1px solid rgb(255 255 255 / .12);
    border-radius: 4px;
    padding: .25rem .55rem;
    cursor: pointer;
}

.lp-copy:hover { color: #fff; }
.lp-copy svg { width: .75rem; height: .75rem; }

.lp-legend { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: 0; }

.lp-legend li {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 1rem;
    padding: .5rem 0;
    border-top: 1px solid #e3e7e4;
    font-size: .8rem;
    color: #98a29c;
    opacity: .45;
    transition: opacity .35s ease, color .35s ease;
}

.lp-legend li.on { opacity: 1; color: #5b6560; }
.lp-legend b { font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace; font-size: .74rem; font-weight: 500; color: #121512; }

/* ---------------- depth ---------------- */

/* Five cards to reveal, so it needs the same runway as the assembly. */
.lp-depth { position: relative; height: 1100vh; }
.lp-depth .lp-stage { background: var(--lp-ground); }

.lp-depth-grid {
    width: min(72rem, 92vw);
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
}

.lp-steps { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 0; counter-reset: step; }

.lp-steps li {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1rem;
    padding: .6rem 0;
    border-top: 1px solid var(--lp-line);
    font-size: .82rem;
    color: var(--lp-dim);
    opacity: .4;
    transition: opacity .35s ease;
}

.lp-steps li.on { opacity: 1; }
.lp-steps b { font-weight: 600; color: var(--lp-ink); }

/* ---------------- plans ---------------- */

.lp-plans { background: var(--lp-ground); padding: clamp(4rem, 11vh, 6.5rem) clamp(1rem, 4vw, 2.5rem); border-top: 1px solid var(--lp-line); }
.lp-plans-inner { max-width: 60rem; margin: 0 auto; }
/* The nav floats over the page, so the anchor has to clear it. */
.lp-plans { scroll-margin-top: 3.5rem; }

.lp-plan-rows { margin-top: 2.4rem; border-top: 1px solid var(--lp-line); }

.lp-plan {
    display: grid;
    grid-template-columns: minmax(9rem, .8fr) minmax(0, 1.6fr) auto;
    gap: clamp(1rem, 3vw, 2.5rem);
    align-items: center;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--lp-line);
}

.lp-plan-head { display: grid; gap: .3rem; }

.lp-plan-name {
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--lp-dim);
}

.lp-plan-price { font-size: 1.45rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.lp-plan-price em { font-size: .74rem; font-weight: 500; font-style: normal; color: var(--lp-dim); letter-spacing: 0; }

.lp-plan-points { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; font-size: .82rem; color: var(--lp-dim); }

/* ---------------- footer ---------------- */

.lp-foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.8rem clamp(1rem, 4vw, 2.5rem) 3rem;
    border-top: 1px solid var(--lp-line);
    font-size: .77rem;
    color: #626b71;
    background: var(--lp-ground);
}

.lp-foot a:hover { color: var(--lp-ink); }
.lp-foot-end { display: flex; align-items: center; gap: 1.2rem; }

/* The switch is shared with the docs, whose header is light; this ground is not. */
.lp .docs-lang-switch { background: #14171a; }
.lp .docs-lang-btn { color: var(--lp-dim); }
.lp .docs-lang-btn:hover { color: var(--lp-ink); }
.lp .docs-lang-btn.active {
    background: #fff;
    color: #000;
}

@media (max-width: 62rem) {
    .lp-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .lp-index { grid-auto-flow: column; grid-auto-columns: 1fr; gap: .6rem; }
    .lp-assembly-grid, .lp-depth-grid { grid-template-columns: minmax(0, 1fr); }
    .lp-plan { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .lp-frame, .lp-token, .lp-legend li, .lp-steps li, .lp-index li, .lp-index-bar i,
    .lp-viewport--fit { transition: none !important; }
}

/* ================= auth ================= */

.auth {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-main {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 6rem clamp(1rem, 4vw, 2.5rem) 3rem;
}

.auth-card {
    width: 100%;
    max-width: 23rem;
    display: flex;
    flex-direction: column;
}

.auth-title {
    margin: 0;
    font-size: clamp(1.5rem, 3.4vw, 1.85rem);
    font-weight: 600;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.auth-body {
    margin: .6rem 0 0;
    font-size: .85rem;
    line-height: 1.65;
    color: var(--lp-dim);
}

.auth-error {
    margin: 1.1rem 0 0;
    padding: .6rem .75rem;
    border: 1px solid #47242a;
    border-left-width: 2px;
    border-radius: 4px;
    background: #1b1214;
    font-size: .8rem;
    line-height: 1.5;
    color: #e79aa2;
}

.auth-providers {
    display: grid;
    gap: .5rem;
    margin-top: 1.7rem;
}

.auth-provider {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .9rem;
    border: 1px solid var(--lp-line);
    border-radius: 5px;
    background: #101315;
    font-size: .85rem;
    font-weight: 500;
    transition: border-color .15s, background .15s;
}

.auth-provider:hover {
    border-color: #333a41;
    background: #141719;
}

/* Sized here rather than per icon, since each one ships its own viewBox. */
.auth-provider-mark {
    flex: none;
    width: 1.05rem;
    height: 1.05rem;
}

.auth-provider-mark svg { display: block; }

/* Sits at the end of the row, so the label stays where the eye already is. */
.auth-recent {
    margin-left: auto;
    padding: .1rem .4rem;
    border: 1px solid #2c3a45;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 500;
    color: #8fa9b8;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 1.5rem 0;
    font-size: .74rem;
    color: #626b71;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--lp-line);
}

.auth-form { display: grid; gap: 1rem; }

.auth-field { display: grid; gap: .4rem; }

.auth-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .8rem;
    font-size: .77rem;
    font-weight: 500;
    color: var(--lp-dim);
}

.auth-forgot { font-weight: 400; color: #626b71; }
.auth-forgot:hover { color: var(--lp-ink); }

.auth-secret { position: relative; display: block; }

.auth-input {
    width: 100%;
    padding: .65rem .8rem;
    border: 1px solid var(--lp-line);
    border-radius: 5px;
    background: #0e1113;
    color: var(--lp-ink);
    font-family: inherit;
    font-size: .88rem;
    transition: border-color .15s;
}

.auth-secret .auth-input { padding-right: 2.8rem; }

.auth-input:focus {
    outline: none;
    border-color: #465059;
}

.auth-reveal {
    position: absolute;
    top: 50%;
    right: .5rem;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: none;
    color: #626b71;
    cursor: pointer;
}

.auth-reveal:hover { color: var(--lp-ink); }
.auth-reveal svg { width: 1rem; height: 1rem; display: block; }

.auth-hint { font-size: .72rem; color: #626b71; }
.auth-hint--bad { color: #e79aa2; }

.auth-input--bad,
.auth-input--bad:focus { border-color: #6d3239; }

.auth-agreements {
    display: grid;
    gap: .55rem;
    padding: .85rem 0 .1rem;
}

.auth-agreement {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .8rem;
    color: var(--lp-dim);
    cursor: pointer;
}

.auth-check:hover { color: var(--lp-ink); }

.auth-check input {
    flex: none;
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: #e7eaec;
    cursor: pointer;
}

.auth-read {
    flex: none;
    font-size: .74rem;
    color: #626b71;
    border-bottom: 1px solid #2a3036;
}

.auth-read:hover { color: var(--lp-ink); }

.auth-submit {
    margin-top: .3rem;
    padding: .72rem 1rem;
    border: 0;
    border-radius: 5px;
    background: var(--lp-ink);
    color: var(--lp-ground);
    font-family: inherit;
    font-size: .87rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}

.auth-submit:hover:not(:disabled) { opacity: .88; }

.auth-submit:disabled {
    background: #22272b;
    color: #6c757c;
    cursor: default;
}

.auth-swap {
    margin: 1.4rem 0 0;
    font-size: .8rem;
    color: var(--lp-dim);
}

.auth-swap a {
    font-weight: 600;
    color: var(--lp-ink);
    border-bottom: 1px solid #333a41;
}

.auth-terms {
    margin: 1.5rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--lp-line);
    font-size: .72rem;
    line-height: 1.6;
    color: #626b71;
}

.auth .lp-foot { justify-content: space-between; }

/* ================= account ================= */

.acct { min-height: 100vh; display: flex; flex-direction: column; }

.acct-main {
    flex: 1;
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
    padding: 6rem clamp(1rem, 4vw, 2.5rem) 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.acct-title {
    margin: 0 0 .6rem;
    font-size: clamp(1.5rem, 3.4vw, 1.85rem);
    font-weight: 600;
    letter-spacing: -.035em;
}

.acct-card {
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--lp-line);
    border-radius: 7px;
    background: #101315;
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.acct-heading {
    margin: 0;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lp-dim);
}

.acct-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    flex-wrap: wrap;
}

.acct-label { flex: none; font-size: .77rem; font-weight: 500; color: var(--lp-dim); }
.acct-value { flex: 1; display: flex; align-items: center; gap: .5rem; font-size: .88rem; min-width: 0; }
.acct-quiet { margin: 0; font-size: .74rem; line-height: 1.6; color: #626b71; }
.acct-bad { color: #e79aa2; }

.acct-spacer { flex: 1; }
.acct-plan { flex: 1; font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; }

.acct-pill {
    flex: none;
    padding: .12rem .45rem;
    border: 1px solid var(--lp-line);
    border-radius: 999px;
    font-size: .68rem;
    color: #626b71;
}

.acct-pill.on { border-color: #2c4a3a; color: #7fcaa2; }

.acct-note {
    margin: 0;
    padding: .6rem .75rem;
    border: 1px solid #2c3a45;
    border-left-width: 2px;
    border-radius: 4px;
    background: #101820;
    font-size: .78rem;
    line-height: 1.55;
    color: #9db6c6;
}

.acct-input {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--lp-line);
    border-radius: 5px;
    background: #0e1113;
    color: var(--lp-ink);
    font-family: inherit;
    font-size: .86rem;
}

.acct-input:focus { outline: none; border-color: #465059; }
.acct-input:disabled { color: #7b848b; cursor: not-allowed; }

.acct-form { display: grid; gap: .8rem; padding-top: .3rem; }
.acct-field { display: grid; gap: .35rem; }
.acct-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.acct-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    padding: .42rem .8rem;
    border: 1px solid var(--lp-line);
    border-radius: 5px;
    background: none;
    color: var(--lp-ink);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, background .15s, opacity .15s;
}

.acct-btn:hover:not(:disabled) { border-color: #333a41; background: #141719; }
/* The card is a column, so a button on its own would stretch across it. */
.acct-btn--own { align-self: flex-start; }

/* Same mark as the row it would add, so the two read as the same thing. */
.acct-btn--mark { gap: .45rem; }
.acct-btn--mark .acct-store { width: .95rem; height: .95rem; }
.acct-btn:disabled { color: #6c757c; cursor: default; }

.acct .acct-btn--solid { background: var(--lp-ink); border-color: var(--lp-ink); color: var(--lp-ground); }
.acct-btn--solid:hover:not(:disabled) { opacity: .88; }
.acct-btn--solid:disabled { background: #22272b; border-color: #22272b; }
.acct-btn--bad { border-color: #47242a; color: #e79aa2; }
.acct-btn--bad:hover:not(:disabled) { border-color: #6d3239; background: #1b1214; }

/* Matches the nav links beside it, which are anchors. */
.acct-linkish {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.acct-linkish:hover { color: var(--lp-ink); }

.acct-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }

.acct-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 0;
    border-bottom: 1px solid #171b1e;
}

.acct-item:last-child { border-bottom: 0; }

.acct-store { flex: none; width: 1.1rem; height: 1.1rem; color: var(--lp-dim); }
.acct-store svg { display: block; width: 100%; height: 100%; }

.acct-item-main {
    flex: 1;
    display: grid;
    gap: .15rem;
    min-width: 0;
    font-size: .84rem;
}

.acct-item-main b { font-weight: 500; overflow-wrap: anywhere; }

@media (max-width: 34rem) {
    .acct-row { align-items: flex-start; }
    .acct-value { width: 100%; }
}

/* The account page while its answer is in flight. Same cards in the same order,
   so nothing moves when the real content replaces them. */
.acct-skeleton { display: flex; flex-direction: column; gap: 1rem; }

.acct-bone {
    display: block;
    height: .78rem;
    border-radius: 4px;
    background: #1a1e22;
    animation: acct-pulse 1.4s ease-in-out infinite;
}

.acct-bone--head { width: 5.5rem; height: .62rem; margin-bottom: .35rem; }

/* Each row a beat behind the one above, so the card reads as one object rather
   than a row of independently blinking bars. */
.acct-bone:nth-child(2) { animation-delay: .08s; }
.acct-bone:nth-child(3) { animation-delay: .16s; }
.acct-bone:nth-child(4) { animation-delay: .24s; }

@keyframes acct-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

@media (prefers-reduced-motion: reduce) {
    .acct-bone { animation: none; }
}
