/* ==========================================================================
   MorrowTab — notepin.cloud / prettify.cloud house style, MorrowTab palette.

   Structure follows the sibling sites: @font-face → :root dark → :root light
   → reset → header → typography → hero → sections → cards → screenshots →
   cross-promo → footer → lightbox → responsive → manual subsystem →
   reduced-motion → forced-colors → print.

   Dark is the base theme. Light is a token-only prefers-color-scheme
   override. There is no theme toggle and no JS involved in theming.

   ACCESSIBILITY RULE INHERITED FROM THE FAMILY: fill and border tokens are
   never used as text colours. Text uses --primary-text / --accent-text,
   which are the variants measured to clear 4.5:1 on --bg, --surface and
   --surface-light in BOTH themes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts — self-hosted, latin + latin-ext split on the unicode-range Google
   serves, so latin-ext downloads only for pages containing those characters.
   Only the latin subsets are preloaded in <head>.
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Metric-matched fallbacks so the pre-swap frame lays out at the final size.
   Order matters: the Arial / Courier New arms claim the whole weight range for
   non-Windows, the Segoe UI / Consolas arms come after and win on Windows. */
@font-face {
    font-family: 'Inter Fallback';
    font-weight: 400 800;
    src: local('Arial');
    size-adjust: 107.12%;
    ascent-override: 90.44%;
    descent-override: 22.52%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Inter Fallback';
    font-weight: 400;
    src: local('Segoe UI');
    size-adjust: 111.16%;
    ascent-override: 87.15%;
    descent-override: 21.70%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Inter Fallback';
    font-weight: 500;
    src: local('Segoe UI Semilight');
    size-adjust: 110.20%;
    ascent-override: 87.91%;
    descent-override: 21.89%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Inter Fallback';
    font-weight: 600;
    src: local('Segoe UI Semibold');
    size-adjust: 107.45%;
    ascent-override: 90.16%;
    descent-override: 22.45%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Inter Fallback';
    font-weight: 700;
    src: local('Segoe UI Bold');
    size-adjust: 106.30%;
    ascent-override: 91.13%;
    descent-override: 22.69%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Inter Fallback';
    font-weight: 800;
    src: local('Segoe UI Black');
    size-adjust: 105.80%;
    ascent-override: 91.56%;
    descent-override: 22.80%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'JetBrains Mono Fallback';
    font-weight: 400 500;
    src: local('Courier New');
    size-adjust: 133.72%;
    ascent-override: 76.13%;
    descent-override: 22.16%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'JetBrains Mono Fallback';
    font-weight: 400 500;
    src: local('Consolas');
    size-adjust: 108.79%;
    ascent-override: 93.57%;
    descent-override: 27.24%;
    line-gap-override: 0%;
}

/* --------------------------------------------------------------------------
   CSS Variables — Dark (default)

   Palette comes from the MorrowTab app icon: the indigo card (#6574F7), the
   teal card (#15C7BD) and the sunrise (#FFD166). Measured contrast:
     --text        #e4e5ec   15.6 : bg   13.8 : surface   11.3 : surface-light
     --text-muted  #a8acbe    8.7 : bg    7.7 : surface    6.3 : surface-light
     --primary-text #a5adff   9.4 : bg    8.3 : surface    6.8 : surface-light
     --accent-text  #5ee9e0  11.9 : bg   10.5 : surface    9.6 : surface-light
     --btn-primary-ink on the darkest end of the button gradient  5.0
   -------------------------------------------------------------------------- */
:root {
    --primary: #8f99ff;
    --primary-light: #a5adff;
    --primary-dark: #6574f7;
    --primary-rgb: 143, 153, 255;
    --accent: #3ee0d6;
    --accent-rgb: 62, 224, 214;
    --sunrise: #ffd166;

    --bg: #0a0b12;
    --bg-gradient: linear-gradient(135deg, #0a0b12 0%, #12141f 50%, #0a0b12 100%);
    --text: #e4e5ec;
    --text-muted: #a8acbe;
    --heading: #fff;
    --surface: #181a24;
    --surface-light: #262a3b;
    --border: #3a4059;
    /* Interactive outlines need 3:1 against their own fill; --border is a
       decorative divider and deliberately softer. */
    --border-strong: #6a7294;
    --overlay: rgba(4, 5, 10, 0.88);
    --shadow-strength: 0.4;

    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;

    /* Primary button. White on the brand indigo is only 3.9:1, so the dark
       theme puts near-black ink on a bright indigo gradient instead. Kept as
       tokens so each theme picks what actually reads on its own gradient. */
    --btn-primary-from: var(--primary);
    --btn-primary-to: var(--primary-dark);
    --btn-primary-ink: #0b0d1c;
    --btn-primary-glow: rgba(101, 116, 247, 0.35);

    /* Fill colours are not text colours. These are the text-safe variants. */
    --primary-text: #a5adff;
    --accent-text: #5ee9e0;
    --success-text: #4ade80;

    --page-max-width: 1200px;
    --page-shell-width: calc(100% - 48px);
    --anchor-offset: 96px;
}

/* --------------------------------------------------------------------------
   CSS Variables — Light
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: light) {
    :root {
        --primary: #4d5ae0;
        --primary-light: #4351d8;
        --primary-dark: #3a46bd;
        --primary-rgb: 77, 90, 224;
        --accent: #0d7c76;
        --accent-rgb: 13, 124, 118;

        --bg: #f8f9fa;
        --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #eceef4 50%, #f8f9fa 100%);
        --text: #1f2937;
        --text-muted: #565d6e;
        --heading: #111827;
        --surface: #ffffff;
        --surface-light: #f2f3f8;
        --border: #d5d9e6;
        --border-strong: #6f7689;
        --overlay: rgba(17, 24, 39, 0.62);
        --shadow-strength: 0.12;

        --success: #16a34a;
        --warning: #9a5b04;
        --error: #dc2626;

        /* The light theme's indigo is already dark, so white ink wins here.
           Starting at the deeper indigo takes white from 3.9:1 to 6.2:1. */
        --btn-primary-from: #4351d8;
        --btn-primary-to: #3a46bd;
        --btn-primary-ink: #ffffff;
        --btn-primary-glow: rgba(67, 81, 216, 0.3);

        --primary-text: #3f4dd2;
        --accent-text: #0b6a65;
        --success-text: #166534;
    }
}

/* --------------------------------------------------------------------------
   Reset and page shell
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-padding-top: var(--anchor-offset);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container,
.header-inner,
.content {
    width: min(var(--page-max-width), var(--page-shell-width));
    margin: 0 auto;
}

.content {
    max-width: 860px;
}

img,
picture,
svg,
video {
    max-width: 100%;
}

img,
video {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

/* Decorative background wash — the house signature. Fixed, behind everything,
   never intercepts pointer events. */
.bg-glow {
    position: fixed;
    inset: 0 0 auto;
    height: 100vh;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(var(--primary-rgb), 0.16) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 82% 58%, rgba(var(--accent-rgb), 0.07) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Screen-reader-only text — carries the "(opens in a new tab)" hints on
   every external link. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -80px;
    left: 16px;
    z-index: 200;
    padding: 12px 20px;
    border-radius: 8px;
    background: var(--btn-primary-to);
    color: var(--btn-primary-ink);
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 16px;
    color: var(--btn-primary-ink);
}

/* One global focus ring. Two layers so it stays visible on both the page and
   on the coloured buttons. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--accent-text);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Header and navigation
   -------------------------------------------------------------------------- */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(20px);
}

.header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.logo-icon {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.logo-text span {
    color: var(--primary-text);
}

/* Scoped to the site nav by id: a bare `nav` selector also matches the manual's
   table-of-contents <nav>, which turned it into a flex row. */
#site-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

#site-nav a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

#site-nav a:hover {
    color: var(--heading);
}

#site-nav a.active {
    color: var(--primary-text);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface);
    color: var(--heading);
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.header-inner[data-nav-open="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header-inner[data-nav-open="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.header-inner[data-nav-open="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
    margin: 0 0 16px;
    color: var(--heading);
    line-height: 1.2;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.045em;
}

h2 {
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* No page needs an h4 today; this keeps one sane if a section ever nests
   deeply enough to want it. */
h4 {
    font-size: 1rem;
    font-weight: 700;
}

p {
    margin: 0 0 16px;
    color: var(--text-muted);
}

ul,
ol {
    color: var(--text-muted);
}

/* Prose links keep a permanent underline; navigation, buttons, cards and the
   table of contents opt out explicitly. */
a {
    color: var(--primary-text);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 0.08em;
}

a:hover {
    color: var(--heading);
}

code,
kbd,
samp,
pre {
    font-family: 'JetBrains Mono', 'JetBrains Mono Fallback', ui-monospace, monospace;
}

code {
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--surface-light);
    color: var(--accent-text);
    font-size: 0.85rem;
}

kbd {
    display: inline-block;
    padding: 2px 9px;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--text);
    font-family: 'JetBrains Mono', 'JetBrains Mono Fallback', ui-monospace, monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    white-space: nowrap;
}


/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--btn-primary-from) 0%, var(--btn-primary-to) 100%);
    color: var(--btn-primary-ink);
    box-shadow: 0 4px 20px var(--btn-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    color: var(--btn-primary-ink);
    box-shadow: 0 8px 30px var(--btn-primary-glow);
    text-decoration: none;
}

.btn-secondary {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--surface-light);
    color: var(--heading);
    text-decoration: none;
}

/* Browser-store icons inside the install buttons. */
.btn svg,
.btn .btn-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Pending store listings are visibly muted as well as labelled in the text. */
.btn[aria-disabled="true"] {
    cursor: default;
    border-color: var(--border);
    background: color-mix(in srgb, var(--surface) 88%, var(--text-muted) 12%);
    color: var(--text-muted);
    box-shadow: none;
    pointer-events: none;
}

.btn[aria-disabled="true"] .btn-icon {
    filter: grayscale(1);
    opacity: 0.68;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.cta-buttons .btn {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.cta-note {
    margin: 0 auto 32px;
    max-width: 640px;
    font-size: 0.92rem;
}

/* Availability strip under the hero CTA. */
.browser-support {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.browser-support li {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.browser-support img {
    display: block;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    padding: 90px 0 60px;
    text-align: center;
}

.hero h1 {
    margin-bottom: 24px;
}

.subtitle {
    max-width: 760px;
    margin: 0 auto 36px;
    font-size: 1.14rem;
    line-height: 1.75;
}

.hero .cta-buttons {
    scroll-margin-top: 112px;
}

.supported-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1080px;
    margin: 40px auto 0;
}

.supported-box {
    padding: 24px 28px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    text-align: left;
    box-shadow: 0 18px 40px rgba(0, 0, 0, calc(var(--shadow-strength) * 0.45));
}

.supported-box h2 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0;
}

.supported-copy {
    margin-bottom: 18px;
    font-size: 0.98rem;
    line-height: 1.65;
}

.format-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.format-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border: 1px solid rgba(var(--primary-rgb), 0.34);
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-text);
    font-size: 0.92rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
section {
    padding: 100px 0;
}

.section-header {
    margin-bottom: 60px;
    text-align: center;
}

.section-badge {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--primary-text);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* The sibling sites make this badge a link back to a hub page. MorrowTab has
   no hub, so it is plain text here — the rule keeps the option open. */
.section-badge a {
    color: inherit;
}

.section-desc {
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.08rem;
}

/* Centered section headers belong to the landing page, whose hero is centered
   too. A page that opens with the left-aligned .page-hero has to keep that
   alignment all the way down, or its body reads as centered under a
   left-aligned heading. */
main:has(> .page-hero) .section-header {
    text-align: left;
}

main:has(> .page-hero) .section-desc {
    margin-inline: 0;
}

/* --------------------------------------------------------------------------
   Feature cards
   -------------------------------------------------------------------------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, var(--shadow-strength));
}

.feature-card h3 {
    margin-bottom: 10px;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    border-radius: 12px;
    font-size: 24px;
    line-height: 1;
}

.feature-icon.boards { background: rgba(101, 116, 247, 0.16); }
.feature-icon.search { background: rgba(21, 199, 189, 0.16); }
.feature-icon.quote { background: rgba(255, 209, 102, 0.16); }
.feature-icon.sync { background: rgba(34, 197, 94, 0.15); }
.feature-icon.appearance { background: rgba(168, 85, 247, 0.16); }
.feature-icon.keyboard { background: rgba(239, 68, 68, 0.15); }

.feature-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    color: var(--text-muted);
}

.feature-list li {
    position: relative;
    padding-left: 22px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.feature-list li + li {
    margin-top: 8px;
}

.feature-list li::before {
    content: "";
    position: absolute;
    top: 0.62em;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--primary);
}

.feature-card p:last-child,
.feature-list li:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Note box
   -------------------------------------------------------------------------- */
.note-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 60px;
    padding: 24px 32px;
    border: 1px solid rgba(var(--primary-rgb), 0.32);
    border-radius: 12px;
    background: rgba(var(--primary-rgb), 0.1);
}

.note-box .icon {
    flex-shrink: 0;
    font-size: 22px;
    /* Match the heading's line box so the glyph sits on its first line. */
    line-height: 1.25;
}

.note-box h3,
.note-box h4 {
    /* The generic .content / .manual-topic h3 top margin would push this
       heading below the icon it is meant to sit beside. */
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--primary-text);
    font-size: 1rem;
}

.note-box p {
    margin: 0 0 8px;
    font-size: 0.93rem;
}

.note-box p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Screenshot showcase — tabs, panels, variants, lightbox
   -------------------------------------------------------------------------- */
.screenshot-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.screenshot-tab {
    padding: 10px 26px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.screenshot-tab:hover {
    border-color: var(--primary);
    color: var(--text);
}

.screenshot-tab[aria-selected="true"] {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.14);
    color: var(--primary-text);
}

.screenshot-note {
    margin-bottom: 28px;
    font-size: 0.92rem;
    text-align: center;
}

.screenshot-showcase {
    max-width: 1100px;
    margin: 0 auto;
}

.screenshot-panel[hidden] {
    display: none;
}

.screenshot-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.screenshot-card {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: inherit;
    text-align: left;
    cursor: zoom-in;
    box-shadow: 0 20px 60px rgba(0, 0, 0, var(--shadow-strength));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.screenshot-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 80px rgba(0, 0, 0, calc(var(--shadow-strength) + 0.1));
}

.screenshot-card img {
    display: block;
    width: 100%;
    height: auto;
    background: var(--surface-light);
    object-fit: contain;
}

/* The popup is a 4:7 portrait capture, not a full-width desktop screenshot.
   Limiting its width to 40svh also keeps its height below 70% of the viewport. */
.screenshot-card--popup {
    max-width: min(360px, 40svh);
    margin-inline: auto;
}

/* Bottom-left, not top-left: the product's own board picker sits in the top-left
   corner of every capture and a chip there would cover it. */
.screenshot-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(10, 11, 18, 0.78);
    backdrop-filter: blur(8px);
    color: #eceef6;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
}

.screenshot-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(10, 11, 18, 0.78);
    color: #eceef6;
    font-size: 0.78rem;
    font-weight: 600;
    pointer-events: none;
}

.screenshot-variants {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.screenshot-variant {
    min-width: 124px;
    padding: 11px 18px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.screenshot-variant[aria-pressed="true"] {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-text);
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--overlay);
    backdrop-filter: blur(8px);
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 92vw;
    max-height: 86vh;
    border-radius: 12px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    cursor: zoom-out;
    animation: lightbox-in 0.2s ease;
}

@keyframes lightbox-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Spec table — the honest limits table
   -------------------------------------------------------------------------- */
.table-wrap code {
    overflow-wrap: anywhere;
}

/* Without this the URL column's long <code> tokens dictate the layout and
   squeeze the prose column to a third of the width it needs. The first column
   is sized to hold the longest hostname whole. */
.table-wrap-requests thead th:nth-child(1) { width: 24%; }
.table-wrap-requests thead th:nth-child(2) { width: 28%; }
.table-wrap-requests thead th:nth-child(3) { width: 48%; }

/* A row label is an identifier — a hostname, a permission, a match pattern —
   and breaking one across two lines makes it unreadable. Keeping it whole also
   lets the auto table layout reserve the width it actually needs, instead of
   the long prose URLs in the last column dictating every column. */
.table-wrap tbody th code {
    white-space: nowrap;
    overflow-wrap: normal;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

caption {
    padding: 16px 20px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: left;
}

th,
td {
    padding: 13px 20px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

thead th {
    color: var(--heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

tbody th {
    color: var(--text);
    font-weight: 600;
}

td {
    color: var(--text-muted);
}

tbody tr:last-child th,
tbody tr:last-child td {
    border-bottom: 0;
}

/* --------------------------------------------------------------------------
   Cross-promotion
   -------------------------------------------------------------------------- */
#more-extensions {
    padding: 80px 0 40px;
}

.extensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.extension-card {
    display: block;
    padding: 32px 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    text-align: center;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.extension-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    color: var(--text);
    text-decoration: none;
}

.extension-card h3 {
    margin-bottom: 8px;
}

.extension-card p {
    margin: 0;
    font-size: 0.92rem;
}

.extension-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.extension-logo {
    display: block;
    width: 48px;
    height: 48px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
    padding: 60px 0 40px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 40px;
}

.footer-column h2 {
    margin-bottom: 14px;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.footer-column ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-column li + li {
    margin-top: 9px;
}

.footer-column a {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-decoration: none;
}

.footer-column a:hover {
    color: var(--primary-text);
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

/* --------------------------------------------------------------------------
   Sub-page hero and long-form content
   -------------------------------------------------------------------------- */
.page-hero {
    padding: 70px 0 30px;
}

.page-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.page-hero .subtitle {
    margin-inline: 0;
    text-align: left;
}

/* On a page whose body is the narrow .content measure, the hero has to share
   that measure — otherwise the h1 sits at the 1200px shell edge while every
   paragraph below it starts 170px further in, and the page reads as though the
   content were centered under a left-aligned heading. The manual is excluded
   because its body is the full-width .manual-layout grid. */
main:has(> .content) > .page-hero > .container {
    max-width: 860px;
}

.page-hero .section-badge {
    margin-bottom: 12px;
}

/* Sub-page heroes are left-aligned, so their buttons should be too — the
   centred default belongs to the landing page and the 404. */
.page-hero .cta-buttons {
    justify-content: flex-start;
}

.content section {
    padding: 0 0 44px;
    scroll-margin-top: var(--anchor-offset);
}

.content h2 {
    font-size: clamp(1.45rem, 3vw, 1.85rem);
}

.content :where(h3) {
    margin-top: 28px;
}

.content ul,
.content ol {
    padding-left: 22px;
}

.content li {
    margin-bottom: 8px;
}

.highlight {
    margin-bottom: 44px;
    padding: 24px 28px;
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    border-radius: 14px;
    background: rgba(var(--accent-rgb), 0.09);
}

.highlight h2 {
    margin-bottom: 10px;
    color: var(--accent-text);
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.highlight ul {
    margin: 0;
    padding-left: 20px;
}

.highlight li:last-child {
    margin-bottom: 0;
}

.updated {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Manual / guide layout */
.manual-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
    padding-bottom: 90px;
}

/* The aside is the sticky element, not the nav inside it: .manual-layout uses
   align-items: start, so the aside is only as tall as its content and a sticky
   child would have no room to travel. */
.manual-layout > aside {
    position: sticky;
    top: calc(var(--anchor-offset) + 8px);
    align-self: start;
}

.manual-toc {
    max-height: calc(100vh - var(--anchor-offset) - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px 14px 22px 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
    scrollbar-gutter: stable;
}

.manual-toc::-webkit-scrollbar {
    width: 8px;
}

.manual-toc::-webkit-scrollbar-track {
    background: transparent;
}

.manual-toc::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--border-strong);
    background-clip: content-box;
}

.manual-toc::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
    background-clip: content-box;
}

/* A capped list that is cut off mid-item reads as a bug rather than as
   something you can scroll. Fade the bottom edge, and let the fade retract as
   the end comes into view. Browsers without scroll-driven animations simply get
   no fade, which is the behaviour this replaces. */
@supports (animation-timeline: scroll()) {
    .manual-toc {
        --toc-fade: 26px;
        mask-image: linear-gradient(to bottom, #000 calc(100% - var(--toc-fade)), transparent 100%);
        animation: toc-fade-out linear both;
        animation-timeline: scroll(self block);
        animation-range: contain 100% contain 100%;
    }

    @keyframes toc-fade-out {
        to {
            --toc-fade: 0px;
        }
    }

    @property --toc-fade {
        syntax: "<length>";
        inherits: false;
        initial-value: 0px;
    }
}

.manual-toc > p {
    margin: 0 0 12px;
    color: var(--primary-text);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.manual-toc ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.manual-toc li + li {
    margin-top: 6px;
}

.manual-toc a {
    color: var(--text-muted);
    text-decoration: none;
}

.manual-toc a:hover,
.manual-toc a.is-current {
    color: var(--primary-text);
}

/* The inner .manual-toc-toggle-state span is a text target for manual.js
   ("Show sections" / "Hide sections") and intentionally carries no styling. */
.manual-toc-toggle {
    display: none;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

/* A .manual-topic is a <section>, so it inherits the landing page's
   `section { padding: 100px 0 }`. Only padding-bottom was being overridden,
   which left the first topic with 100px of dead space above its heading while
   `.manual-topic + .manual-topic` hid the problem on every later one. Set both
   sides explicitly. */
.manual-topic {
    padding: 0 0 52px;
    scroll-margin-top: var(--anchor-offset);
}

.manual-topic + .manual-topic {
    padding-top: 52px;
    border-top: 1px solid var(--border);
}

.manual-topic h2 {
    margin-bottom: 14px;
}

.manual-topic :where(h3) {
    margin-top: 34px;
}

.manual-topic > *:first-child {
    margin-top: 0;
}

/* .note-box's 60px top margin is section-scale spacing; inside a topic it is
   just a callout between paragraphs. */
.manual-topic .note-box,
.content .note-box {
    margin-top: 28px;
}

.manual-topic ul,
.manual-topic ol {
    padding-left: 22px;
}

.manual-topic li {
    margin-bottom: 8px;
}

.manual-figure {
    margin: 24px 0 0;
}

.manual-figure img {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-light);
}

/* Inside a lightbox button the button already draws the frame. */
.manual-figure .screenshot-card img {
    border: 0;
    border-radius: 0;
}

.manual-figure .screenshot-card {
    box-shadow: none;
}

.manual-figure .screenshot-card--popup {
    max-width: min(320px, 40svh);
}

.manual-figure .screenshot-card:hover {
    transform: none;
    box-shadow: 0 18px 40px rgba(0, 0, 0, calc(var(--shadow-strength) * 0.6));
}

.manual-figure figcaption {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Changelog */
.version-card {
    margin-bottom: 24px;
    padding: 28px 32px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.version-card h2 {
    margin-bottom: 4px;
    font-size: 1.4rem;
}

.version-date {
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.version-card h3 {
    margin-top: 20px;
    color: var(--primary-text);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.version-card h3:first-of-type {
    margin-top: 0;
}

/* 404 */
.not-found {
    padding: 120px 0;
    text-align: center;
}

.not-found .cta-buttons {
    margin-top: 32px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
    .manual-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .manual-layout > aside {
        position: static;
    }

    .manual-toc {
        max-height: none;
        overflow-y: visible;
    }

    /* The inner .manual-toc-toggle-state span is a text target for manual.js
   ("Show sections" / "Hide sections") and intentionally carries no styling. */
.manual-toc-toggle {
        display: block;
        margin-bottom: 12px;
    }
}

@media (max-width: 768px) {
    :root {
        --page-shell-width: calc(100% - 32px);
    }

    body {
        font-size: 16px;
    }

    body.nav-open {
        overflow: hidden;
    }

    section {
        padding: 60px 0;
    }

    .hero {
        padding: 56px 0 40px;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .nav-toggle {
        display: inline-flex;
    }

    #site-nav {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 12px;
        border: 1px solid var(--border-strong);
        border-radius: 18px;
        background: var(--surface);
        box-shadow: 0 24px 54px rgba(0, 0, 0, calc(var(--shadow-strength) + 0.2));
    }

    .header-inner[data-nav-open="true"] #site-nav {
        display: flex;
    }

    #site-nav a {
        display: block;
        padding: 11px 14px;
        border-radius: 12px;
        color: var(--text);
        font-size: 1rem;
    }

    #site-nav a:hover,
    #site-nav a.active {
        background: rgba(var(--primary-rgb), 0.12);
        color: var(--heading);
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 100%;
        max-width: 320px;
    }

    .feature-card,
    .supported-box {
        padding: 24px;
    }

    .note-box {
        padding: 20px 22px;
    }

    .version-card {
        padding: 22px 24px;
    }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

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

    .btn:hover,
    .feature-card:hover,
    .extension-card:hover,
    .screenshot-card:hover {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Forced colors
   -------------------------------------------------------------------------- */
@media (forced-colors: active) {
    .bg-glow {
        display: none;
    }

    .btn,
    .feature-card,
    .supported-box,
    .note-box,
    .extension-card,
    .version-card,
    .screenshot-card,
    .screenshot-tab,
    .screenshot-variant,
    .nav-toggle,
    .table-wrap,
    .highlight,
    .manual-toc {
        border: 1px solid CanvasText;
    }

    .screenshot-tab[aria-selected="true"],
    .screenshot-variant[aria-pressed="true"] {
        border-color: Highlight;
        color: Highlight;
        forced-color-adjust: none;
    }

    :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
        outline: 3px solid Highlight;
    }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
    header,
    footer,
    .bg-glow,
    .skip-link,
    .nav-toggle,
    .cta-buttons,
    .screenshot-tabs,
    .screenshot-variants,
    .lightbox-overlay,
    #more-extensions,
    .manual-toc,
    /* The inner .manual-toc-toggle-state span is a text target for manual.js
   ("Show sections" / "Hide sections") and intentionally carries no styling. */
.manual-toc-toggle {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    h1,
    h2,
    h3,
    h4 {
        color: #000;
        break-after: avoid;
    }

    p,
    li {
        color: #1a1a1a;
    }

    section,
    .content section,
    .manual-topic {
        padding: 12pt 0;
        break-inside: avoid;
    }

    .manual-layout {
        display: block;
    }

    a::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        word-break: break-all;
    }

    a[href^="#"]::after {
        content: "";
    }
}

/* --------------------------------------------------------------------------
   Disclosure lists (FAQ, troubleshooting)
   -------------------------------------------------------------------------- */
.faq-list {
    max-width: 860px;
    margin: 0 auto;
}

details {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

details[open] {
    border-color: rgba(var(--primary-rgb), 0.4);
}

summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    color: var(--heading);
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "+";
    flex-shrink: 0;
    color: var(--primary-text);
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1;
}

details[open] summary::after {
    content: "\2212";
}

details > *:not(summary) {
    margin-inline: 24px;
}

details > *:last-child {
    margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   Shortcut list
   -------------------------------------------------------------------------- */
.shortcut-note {
    margin-top: 20px;
    font-size: 0.92rem;
}
