html {
    font-size: 100%;
    font-family: 'Inter', system-ui, sans-serif;
}

body {
    max-width: 850px;
    margin: 0 auto;
    padding: 10px;
    -webkit-text-size-adjust: 100%;
}

body a {
    color: var(--color-accent);
}

body > *,
main > * {
    line-height: 1.1em;
}

h1 {
    margin: 2em 0 16px;
}

/* Section headings: semantically h2 (directly under the page h1), sized like the browser's default h3 */
h2 {
    font-size: 1.17em;
    line-height: 1.3em;
    margin: 1em 0 8px;
}

section {
    margin-bottom: 40px;
}

section:last-child {
    margin-bottom: 0;
}

tr,
p,
li {
    line-height: 1.5em;
}

p,
ul,
ol {
    margin: 0 0 16px;
}

table {
    font-size: 1em;
    border-spacing: 0;
    border-collapse: collapse;
    text-align: left;
    width: 100%;
}

thead {
    background: #e8eaed;
}

tr {
    border-bottom: 1px solid #dadce0;
}

tr:first-child {
    border-top: 1px solid #dadce0;
}

td,
th {
    padding: 8px;
}

td {
    vertical-align: top;
}

td:first-child {
    white-space: nowrap;
}

thead th:last-child {
    min-width: 290px;
}

table p,
table ul {
    margin: 0;
}

table p {
    padding-bottom: 16px;
}

table p:last-child {
    padding-bottom: 0;
}

table ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

table li {
    white-space: nowrap;
}

.overflow-x {
    overflow-x: auto;
}

.page-docs ul {
    list-style: none;
    padding: 0;
}

.page-docs li {
    padding-bottom: 1em;
}

/* ── Notices ── */

.docs-notice {
    background: var(--color-accent-soft-bg);
    border: 1px solid var(--color-accent-soft-border);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 0 24px;
    color: var(--color-text-secondary);
}

/* ── Screenshots ── */

.docs-screenshots {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 16px;
}

.docs-screenshots figure {
    min-width: 0;
    margin: 0;
}

/* Column width is per-platform: screenshot aspect ratio (and therefore the
   width needed to keep UI text legible) differs by device. */
#panel-ios .docs-screenshots figure {
    flex: 0 1 220px;
    max-width: 220px;
}

/* macOS screenshots are square window captures, not tall phone screens —
   220px makes their UI text illegible, so give them more room. */
#panel-macos .docs-screenshots figure {
    flex: 0 1 380px;
    max-width: 380px;
}

#panel-android .docs-screenshots figure {
    flex: 0 1 220px;
    max-width: 220px;
}

.docs-screenshots img {
    display: block;
    width: 100%;
    height: auto;
}

.docs-screenshots figcaption {
    margin-top: 8px;
    font-size: 0.85em;
    color: #5a667f;
    text-align: center;
}

/* ── Page header ── */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #F1F5F9;
    margin-bottom: 4px;
}

.page-home-link {
    font-size: 0.9em;
    color: #5a667f;
    text-decoration: none;
}

.page-home-link:hover {
    text-decoration: underline;
}

.page-select {
    position: relative;
}

.page-select svg {
    position: absolute;
    right: 10px;
    top: calc(50% - 3px);
    width: 10px;
    height: 6px;
    stroke-width: 2px;
    stroke: #9098a9;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.page-select select {
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 25px 8px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px -2px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    transition: all 150ms ease;
}

.page-select select:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.page-sprites {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ── Platform tabs ── */

.platform-tabs {
    display: flex;
    gap: 8px;
    margin: 24px 0;
    border-bottom: 1px solid #dadce0;
}

.platform-tab {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font: inherit;
    font-size: 0.95em;
    font-weight: 500;
    color: #5a667f;
    padding: 8px 4px 10px;
    cursor: pointer;
}

.platform-tab[data-platform="ios"] {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

[data-platform="macos"] .platform-tab[data-platform="ios"] {
    color: #5a667f;
    border-bottom-color: transparent;
}

[data-platform="macos"] .platform-tab[data-platform="macos"] {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

[data-platform="android"] .platform-tab[data-platform="ios"] {
    color: #5a667f;
    border-bottom-color: transparent;
}

[data-platform="android"] .platform-tab[data-platform="android"] {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* ── Platform panels ── */

#panel-ios {
    display: block;
}

#panel-macos,
#panel-android {
    display: none;
}

[data-platform="macos"] #panel-ios {
    display: none;
}

[data-platform="macos"] #panel-macos {
    display: block;
}

[data-platform="android"] #panel-ios {
    display: none;
}

[data-platform="android"] #panel-android {
    display: block;
}

@media (prefers-color-scheme: dark) {
    body {
        color: var(--color-text-primary);
        background: var(--color-bg);
    }

    .page-home-link {
        color: #a9b2c3;
    }

    .page-header {
        border-bottom-color: #2a2a2a;
    }

    .page-select select {
        background: #1e1e1e;
        border-color: #3a3a3a;
        color: #e0e0e0;
    }

    .page-select svg {
        stroke: #6b7280;
    }

    .docs-screenshots figcaption {
        color: #a9b2c3;
    }

    thead {
        background: #343536;
    }

    tr {
        border-bottom: 1px solid #353536;
    }

    tr:first-child {
        border-top: 1px solid #353536;
    }

    .platform-tabs {
        border-bottom-color: #353536;
    }

    .platform-tab {
        color: #a9b2c3;
    }

    [data-platform="macos"] .platform-tab[data-platform="ios"] {
        color: #a9b2c3;
        border-bottom-color: transparent;
    }

    [data-platform="android"] .platform-tab[data-platform="ios"] {
        color: #a9b2c3;
        border-bottom-color: transparent;
    }
}
