/*
 * Editorial Serif — Munch house theme for the flagship public surfaces
 * (homepage `/` and `/connect`). Direction contract:
 * ~/workspace/munch-prep/homepage-connect/direction-contract.md
 * The quiet letter: warm paper, Georgia display type, hairline rules,
 * no cards, restrained green button, marginalia-style notes.
 * This stylesheet is loaded by public/index.html, public/connect.html,
 * the six public legal/info pages (privacy, terms, tools, help, security,
 * open-source) and public/not-found.html, and — since Amendment F
 * (2026-11-09, every screen carries the house theme) — the OAuth
 * connect/consent surfaces rendered by src/auth/connect-routes.ts
 * (sign-in, email-link, confirm, consent, error). Signed-in surfaces
 * keep public/styles.css.
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --paper: #f6f1e7;
    --paper-card: #fffdf8;
    --ink: #2b2620;
    --ink-soft: #4a4237;
    --ink-mute: #5d5344;
    --hairline: #d8cdb6;
    --rule: #8a7c63;
    --green: #176b3a;
    --green-deep: #0b3d24;
    --green-tint: #eef4ea;
    --danger: #8c2f22;
    --serif: Georgia, "Times New Roman", Times, serif;
    --sans:
        -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --measure: 780px;
}

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-tap-highlight-color: transparent;
}

::selection {
    background: var(--green);
    color: #fff;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--green);
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 2px;
    border-radius: 2px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 50;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--green);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: top 0.15s ease-out;
}

.skip-link:focus-visible {
    top: 12px;
}

.wrap {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header ---------- */

.top {
    border-bottom: 1px solid var(--hairline);
}

.topin {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.mark {
    width: 40px;
    height: 40px;
}

.brandname {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.brandlink {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    text-decoration: none;
    color: var(--ink);
    flex: 0 0 auto;
}

.top nav {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.top nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
}

.top nav a:hover {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.top nav a.nav-cta {
    color: var(--green);
    font-weight: 700;
}

/* ---------- Type ---------- */

h1,
h2,
h3 {
    font-family: var(--serif);
    font-weight: 600;
    color: var(--ink);
}

h1 {
    font-size: 40px;
    line-height: 1.08;
    letter-spacing: -0.015em;
    margin: 10px 0 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hairline);
    text-wrap: balance;
}

h2 {
    font-size: 27px;
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin: 0 0 16px;
    text-wrap: balance;
}

h3 {
    font-size: 19px;
    line-height: 1.3;
    margin: 0 0 8px;
}

p {
    margin: 0 0 12px;
}

.eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--green);
    margin: 0;
}

.lead {
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 62ch;
}

.fine {
    font-size: 13px;
    color: var(--ink-mute);
}

code {
    font-family: var(--serif);
    font-size: 0.95em;
}

/* ---------- Buttons ---------- */

.btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--green-deep);
    text-decoration: none;
}

.btn.big {
    font-size: 17px;
    padding: 14px 26px;
}

.btn.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule);
}

.btn.ghost:hover {
    background: var(--paper-card);
    color: var(--green);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

/* ---------- Hero & paste block ---------- */

.hero {
    padding: 32px 0 4px;
}

.pastebox {
    margin: 24px 0 8px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--paper-card);
}

.pastehead {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--hairline);
    color: var(--ink-mute);
    font-size: 13px;
    font-weight: 700;
}

.pastehead span {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
}

.paste {
    white-space: pre-wrap;
    overflow-wrap: break-word;
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background: var(--paper-card);
    color: var(--ink);
}

.pastefoot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 0 20px 18px;
}

.copy-btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.copy-btn:hover {
    background: var(--green-deep);
}

.copy-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--green);
    margin: 0;
}

.pastenote {
    font-size: 14px;
    font-style: italic;
    color: var(--ink-mute);
    margin: 10px 2px 0;
}

/* ---------- Fact strip ---------- */

.factstrip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 16px;
    margin: 20px 0 4px;
}

.fact {
    border-top: 1px solid var(--hairline);
    padding: 12px 2px;
}

.fact strong {
    display: block;
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.15;
}

.fact span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-mute);
}

/* ---------- Preview (authored demo, labeled) ---------- */

.preview {
    margin: 28px 0 8px;
    padding: 20px 18px 14px;
    position: relative;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    background: var(--paper-card);
}

.prevtag {
    position: absolute;
    top: -13px;
    left: 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 5px 10px;
    background: var(--green);
    color: #fff;
    border-radius: 2px;
}

.chatwho {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.chatwho img {
    width: 28px;
    height: 28px;
}

.chatwho strong {
    font-size: 14px;
}

.chatwho span {
    font-size: 12px;
    color: var(--ink-mute);
    margin-left: auto;
}

.chatbubble {
    max-width: 88%;
    padding: 12px 16px;
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.55;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    background: var(--paper-card);
}

.chatbubble.user {
    margin-left: auto;
    background: var(--green-tint);
}

.chatbubble.short {
    max-width: 34%;
    text-align: center;
}

.nutri {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
    text-align: center;
}

.nutri div {
    padding: 8px 4px;
    border-top: 2px solid var(--green);
    border-bottom: 1px solid var(--hairline);
}

.nutri strong {
    display: block;
    font-size: 19px;
    font-variant-numeric: tabular-nums;
}

.nutri span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-mute);
}

.srcrow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chip {
    font-size: 11px;
    font-weight: 700;
    padding: 5px 9px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    color: var(--ink-soft);
}

.todayrow {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    font-size: 14px;
}

.todayrow div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 6px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Sections ---------- */

.block {
    padding: 32px 0 8px;
}

.grid2,
.grid3,
.grid4 {
    display: grid;
    gap: 4px 28px;
}

.entry {
    border-top: 1px solid var(--hairline);
    padding: 18px 0 10px;
}

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

.entry li {
    margin: 6px 0;
}

.num {
    display: block;
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--green);
    margin-bottom: 4px;
}

.note {
    font-style: italic;
    color: var(--ink-mute);
    font-size: 14px;
}

/* ---------- Pricing ---------- */

.bigprice {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
    margin: 4px 0 10px;
}

.bigprice small {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-mute);
}

.price-featured {
    border-top: 2px solid var(--green);
}

/* ---------- FAQ ---------- */

.faq details {
    border-top: 1px solid var(--hairline);
    padding: 6px 0;
}

.faq summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
}

.faq details p {
    max-width: 62ch;
    color: var(--ink-soft);
}

/* ---------- Boundary ---------- */

.boundary {
    display: grid;
    gap: 4px 28px;
}

/* ---------- Steps & tabs (/connect) ---------- */

.steps {
    margin: 0 0 14px;
    padding-left: 22px;
}

.steps li {
    margin: 8px 0;
}

.fields {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.fields div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid var(--hairline);
    padding-top: 8px;
    font-size: 14px;
}

.fields dt {
    color: var(--ink-mute);
    font-weight: 600;
}

.fields dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

.tabs {
    position: relative;
}

.tabs > input {
    position: absolute;
    width: 48px;
    height: 48px;
    opacity: 0;
    pointer-events: none;
}

.tabbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.tablabel {
    min-height: 48px;
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    white-space: nowrap;
}

.tablabel:hover {
    border-color: var(--green);
    color: var(--green);
}

/* No-JS default: every panel is a stacked section. When JS runs it adds
 * .js-tabs, and the radio inputs take over show/hide. */
.panel {
    border-top: 1px solid var(--hairline);
    padding: 20px 0 8px;
}

.tabs.js-tabs .panel {
    display: none;
}

.tabs.js-tabs:has(input:nth-of-type(1):checked) .panel.c1,
.tabs.js-tabs:has(input:nth-of-type(2):checked) .panel.c2,
.tabs.js-tabs:has(input:nth-of-type(3):checked) .panel.c3,
.tabs.js-tabs:has(input:nth-of-type(4):checked) .panel.c4 {
    display: block;
}

.tabs.js-tabs:has(input:nth-of-type(1):checked) .tablabel[for="t1"],
.tabs.js-tabs:has(input:nth-of-type(2):checked) .tablabel[for="t2"],
.tabs.js-tabs:has(input:nth-of-type(3):checked) .tablabel[for="t3"],
.tabs.js-tabs:has(input:nth-of-type(4):checked) .tablabel[for="t4"] {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.tabs > input:focus-visible ~ .tabbar .tablabel {
    outline: 3px solid var(--green);
    outline-offset: 2px;
}

/* ---------- Closing & footer ---------- */

.cta {
    padding: 36px 0 40px;
    border-top: 1px solid var(--hairline);
    margin-top: 28px;
}

.foot {
    margin-top: 24px;
    padding: 26px 0 20px;
    border-top: 1px solid var(--hairline);
    color: var(--ink-mute);
    font-size: 14px;
}

.footgrid {
    display: grid;
    gap: 18px;
}

.foot strong {
    color: var(--ink);
    font-family: var(--serif);
    font-size: 16px;
}

.foot nav {
    display: grid;
    gap: 2px;
}

.foot nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    text-decoration: none;
}

.foot nav a:hover {
    text-decoration: underline;
}

.tinyline {
    font-size: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--hairline);
    margin-top: 18px;
}

/* ---------- Wider screens ---------- */

@media (min-width: 760px) {
    h1 {
        font-size: 54px;
    }

    h2 {
        font-size: 32px;
    }

    .hero {
        padding-top: 44px;
    }

    .factstrip {
        grid-template-columns: repeat(5, 1fr);
    }

    .grid2,
    .boundary {
        grid-template-columns: 1fr 1fr;
    }

    .grid3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid4 {
        grid-template-columns: 1fr 1fr;
    }

    .todayrow {
        grid-template-columns: repeat(3, 1fr);
    }

    .footgrid {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .tabbar {
        overflow-x: visible;
    }
}

/* ---------- Phone: one-row header, tighter hero ---------- */

@media (max-width: 759px) {
    .topin {
        flex-wrap: nowrap;
        padding-left: 16px;
        padding-right: 8px;
    }

    .top nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin-left: 4px;
        min-width: 0;
    }

    .top nav::-webkit-scrollbar {
        display: none;
    }

    .top nav a {
        white-space: nowrap;
        padding-left: 8px;
        padding-right: 8px;
    }

    .brandname {
        font-size: 20px;
    }

    .mark {
        width: 34px;
        height: 34px;
    }

    .hero {
        padding-top: 22px;
    }

    h1 {
        font-size: 36px;
    }

    .lead {
        font-size: 17px;
    }

    .paste {
        padding: 16px;
    }

    .pastefoot {
        padding: 0 16px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .skip-link {
        transition: none;
    }
}

/* ---------- OAuth connect & consent surfaces (Amendment F) ----------
 * The server-rendered connect flow (src/auth/connect-routes.ts) shares
 * this theme with the homepage and /connect: same paper, Georgia display
 * type, hairline rules, and restrained green. Before Amendment F these
 * screens loaded public/styles.css and were the flagship flow's one
 * unthemed stop. Class names match the shell markup so the flow's
 * structure and behaviour are unchanged — only the theme moved. */

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px 16px;
}

.auth-main {
    width: min(100%, 520px);
}

.auth-card {
    background: var(--paper-card);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: clamp(26px, 6vw, 42px);
}

.auth-card h1 {
    font-size: 32px;
    margin-top: 10px;
}

.auth-card > p:not(.section-kicker) {
    color: var(--ink-soft);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
    color: var(--green);
}

.brand-logo {
    width: 34px;
    height: 34px;
}

.section-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--green);
    margin: 0;
}

.spacer-top {
    margin-top: 22px;
}

.auth-form {
    display: grid;
    gap: 17px;
    margin-top: 24px;
}

.field {
    display: grid;
    gap: 6px;
}

.field > span {
    font-weight: 600;
    color: var(--ink);
}

.field input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    padding: 11px 13px;
    font: inherit;
    font-size: 16px;
}

.field input:focus {
    border-color: var(--green);
    outline: 3px solid var(--green-tint);
    outline-offset: 1px;
}

.button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    background: var(--green);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--green-deep);
    text-decoration: none;
}

.button:disabled,
.button[aria-busy="true"] {
    cursor: progress;
    opacity: 0.6;
}

.button-primary {
    background: var(--green);
    color: #fff;
}

.button-primary:hover {
    background: var(--green-deep);
    color: #fff;
}

.button-quiet {
    background: transparent;
    border-color: var(--rule);
    color: var(--ink);
}

.button-quiet:hover {
    background: var(--paper-card);
    color: var(--green);
}

.auth-footnote {
    margin-top: 20px;
    color: var(--ink-mute);
    font-size: 13px;
}

/* Google sign-in (Amendment G): Google's branding rules set the control
 * itself — white ground, dark text, the multicolour G — while the sizing
 * and radius stay in the auth grammar above. Rendered only when the web
 * OAuth client is configured (src/auth/social-sign-in.ts). */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 0;
    color: var(--ink-mute);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--hairline);
}

.auth-social {
    margin-top: 16px;
}

.button-google {
    width: 100%;
    gap: 10px;
    background: #fff;
    border-color: var(--rule);
    color: var(--ink);
}

.button-google:hover {
    background: var(--paper-card);
    border-color: var(--green);
    color: var(--ink);
}

.button-google svg {
    flex: none;
}

.auth-actions,
.consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    background: var(--green-tint);
    padding: 14px;
    color: var(--green-deep);
}

.consent-account {
    display: grid;
    gap: 4px;
    margin: 20px 0 14px;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    padding: 13px 0;
}

.consent-account span {
    color: var(--ink-mute);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.consent-account strong {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.consent-scope-list {
    display: grid;
    gap: 0;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.consent-scope-list li {
    display: grid;
    gap: 3px;
    border-top: 1px solid var(--hairline);
    padding: 13px 0;
}

.consent-scope-list li:last-child {
    border-bottom: 1px solid var(--hairline);
}

.consent-scope-list span {
    color: var(--ink-soft);
    font-size: 14px;
}

/* ---------- Public info & legal pages ----------
 * The legal/info pages (privacy, terms, tools, help, security,
 * open-source) keep their long-standing class names; this section voices
 * those classes in the same Editorial Serif grammar as the flagship
 * pages above — paper ground, Georgia display type, hairline rules,
 * restrained green — so every public page is one site. */

.container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    border-bottom: 1px solid var(--hairline);
}

.site-header .brand,
.site-footer .brand {
    min-height: 44px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-header .brand-logo,
.site-footer .brand-logo {
    width: 40px;
    height: 40px;
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.nav-links {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.nav-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
}

.nav-links a:hover {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.button-small {
    min-height: 44px;
    padding: 8px 16px;
    font-size: 14px;
}

/* The nav's primary button keeps white text: .nav-links a outranks the
 * shared .button-primary colour on specificity. */
.nav-links a.button-primary {
    color: #fff;
}

.nav-links a.button-primary:hover {
    color: #fff;
    text-decoration: none;
}

.site-footer {
    margin-top: 24px;
    padding: 26px 0 20px;
    border-top: 1px solid var(--hairline);
    color: var(--ink-mute);
    font-size: 14px;
}

.footer-grid {
    display: grid;
    gap: 18px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 2px;
}

.footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    font-weight: 600;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-note {
    margin-top: 10px;
    max-width: 52ch;
}

.legal-hero,
.tools-hero {
    padding: 32px 0 4px;
}

.section-copy {
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 62ch;
}

.tiny {
    font-size: 13px;
    color: var(--ink-mute);
}

.legal-layout {
    display: grid;
    gap: 8px 40px;
    align-items: start;
    padding-top: 28px;
    padding-bottom: 40px;
}

.legal-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
}

.legal-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
    border-top: 1px solid var(--hairline);
}

.legal-nav a:hover {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-content {
    min-width: 0;
}

.legal-content section + section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--hairline);
}

.legal-content p,
.legal-content ul,
.legal-content ol {
    color: var(--ink-soft);
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 12px;
    padding-left: 22px;
}

.legal-content li {
    margin: 6px 0;
}

.notice {
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--green);
    background: var(--paper-card);
    padding: 16px 18px;
    color: var(--ink-soft);
    margin-bottom: 12px;
}

.tool-groups {
    padding-bottom: 40px;
}

.tool-group {
    display: grid;
    gap: 4px 28px;
    border-top: 1px solid var(--hairline);
    padding: 24px 0 8px;
}

.tool-list {
    display: grid;
}

.tool-item {
    display: grid;
    gap: 2px;
    padding: 12px 0;
    border-top: 1px solid var(--hairline);
}

.tool-item:first-child {
    border-top: 0;
    padding-top: 4px;
}

.tool-item code {
    font-size: 15px;
    color: var(--ink);
}

.tool-item span {
    font-size: 14px;
    color: var(--ink-mute);
}

.section {
    padding: 32px 0 8px;
}

.capability-grid {
    display: grid;
    gap: 4px 28px;
    padding-bottom: 32px;
}

.capability-card {
    border-top: 1px solid var(--hairline);
    padding: 18px 0 10px;
}

.capability-icon {
    display: block;
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--green);
    margin-bottom: 4px;
}

.text-link {
    font-weight: 600;
}

@media (min-width: 760px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr;
    }

    .legal-layout {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .legal-nav {
        grid-template-columns: 1fr;
        position: sticky;
        top: 16px;
    }

    .tool-group {
        grid-template-columns: 1fr 2fr;
    }

    .capability-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 759px) {
    .nav-inner {
        flex-wrap: nowrap;
        padding-left: 16px;
        padding-right: 8px;
    }

    .nav-links {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin-left: 4px;
        min-width: 0;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        white-space: nowrap;
        padding-left: 8px;
        padding-right: 8px;
    }

    .site-header .brand,
    .site-footer .brand {
        font-size: 20px;
    }

    .site-header .brand-logo,
    .site-footer .brand-logo {
        width: 34px;
        height: 34px;
    }

    .legal-hero,
    .tools-hero {
        padding-top: 22px;
    }

    .section-copy {
        font-size: 17px;
    }
}
