/* Tanuki Sensei — public site styles (piece 18).

   SCOPE: the marketing + legal pages. The learning app keeps tanuki.css + app.css.

   This is the design (_design/website/Tanuki Sensei Website.dc.html) translated from its inline styles into
   real classes. Two rules held while translating:
     1. Never restate a colour tanuki.css already owns — the design reuses our token set verbatim, and every
        literal below that is not a token is documented as a deliberate site-only addition.
     2. The design's `style-hover="…"` attributes are canvas-only; they become real :hover rules here.

   Layout system taken from the design: 1120px container · 84px section rhythm · alternating cream /
   cream-2 / indigo-soft bands with hairline rules · 999px pill buttons · 14px cards. */

/* ── tokens: site-only additions ─────────────────────────────────────────── */

:root {
    --ts-site-max: 1120px;
    --ts-site-pad: 24px;
    --ts-site-section: 84px;

    /* The one colour pair the design introduces beyond tanuki.css: the destructive button
       ("Delete my account"). Light values are the design's; the dark pair is derived — a lighter red that
       clears AA on the warm-dark surface, since the design does not specify one. */
    --ts-site-danger: #9B2C2C;
    --ts-site-danger-line: #E8CFCB;

    /* One extra type step above H1 (44px), for hero display type only. */
    --ts-site-display: clamp(32px, 4.6vw, 56px);
}

:root[data-theme="dark"], [data-theme="dark"] {
    --ts-site-danger: #F1958F;
    --ts-site-danger-line: #5C3330;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ts-site-danger: #F1958F;
        --ts-site-danger-line: #5C3330;
    }
}

/* ── base ────────────────────────────────────────────────────────────────── */

body {
    margin: 0;
    background: var(--ts-cream);
    color: var(--ts-ink);
    font-family: var(--ts-ui);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.ms-shell { display: flex; flex-direction: column; min-height: 100vh; }
.ms-main { flex: 1 0 auto; }

h1, h2, h3 { font-family: var(--ts-title); font-weight: 600; line-height: 1.2; }

.ms-wrap {
    max-width: var(--ts-site-max);
    margin: 0 auto;
    padding: 0 var(--ts-site-pad);
    box-sizing: border-box;
}

/* Alternating bands. Sections carry the vertical rhythm; the wrap inside carries the width. */
.ms-band { padding: var(--ts-site-section) 0; }
.ms-band-1 { background: var(--ts-cream); border-top: 1px solid var(--ts-line); border-bottom: 1px solid var(--ts-line); }
.ms-band-2 { background: var(--ts-cream-2); border-top: 1px solid var(--ts-line); border-bottom: 1px solid var(--ts-line); }
.ms-band-accent { background: var(--ts-indigo-soft); border-top: 1px solid var(--ts-line); border-bottom: 1px solid var(--ts-line); }

.ms-eyebrow {
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ts-muted);
    font-weight: 600;
    margin: 0 0 10px;
}

.ms-h2 { font-size: clamp(27px, 3.4vw, 36px); margin: 0 0 14px; }
.ms-h3 { font-size: 20px; margin: 0 0 6px; }
.ms-lede { font-size: 19px; color: var(--ts-muted); max-width: 68ch; margin: 0 0 8px; }
.ms-prose { max-width: 68ch; }
.ms-prose p { margin: 0 0 16px; }
.ms-small { font-size: 14px; color: var(--ts-muted); }

/* ── buttons + links ─────────────────────────────────────────────────────── */

.ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ts-accent);
    color: #FCFBF7;
    border: none;
    border-radius: 999px;
    padding: 13px 24px;
    min-height: 46px;
    box-sizing: border-box;
    font: 600 16px/1 var(--ts-ui);
    text-decoration: none;
    cursor: pointer;
}
.ms-btn:hover { opacity: .92; }
.ms-btn:active { transform: translateY(1px); }
.ms-btn-lg { font-size: 18px; padding: 16px 32px; min-height: 54px; }

.ms-btn-secondary {
    background: transparent;
    color: var(--ts-accent);
    border: 1.5px solid var(--ts-accent);
}
.ms-btn-secondary:hover { background: var(--ts-accent-soft); opacity: 1; }

.ms-btn-danger {
    background: transparent;
    color: var(--ts-site-danger);
    border: 1.5px solid var(--ts-site-danger-line);
}

/* "Coming soon" — a real disabled control, not a link dressed as one. */
.ms-btn[disabled], .ms-btn-disabled {
    background: var(--ts-cream-2);
    color: var(--ts-muted);
    border: 1.5px solid var(--ts-line);
    cursor: not-allowed;
    pointer-events: none;
}

.ms-link { color: var(--ts-accent); text-decoration: none; font-weight: 600; }
.ms-link:hover { text-decoration: underline; }

:where(a, button, input, textarea, select, summary):focus-visible {
    outline: 2.5px solid var(--ts-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.ms-cta-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 28px 0 0; }

/* ── header ──────────────────────────────────────────────────────────────── */

.ms-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--ts-cream) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ts-line);
}
.ms-header-inner {
    max-width: var(--ts-site-max);
    margin: 0 auto;
    padding: 10px var(--ts-site-pad);
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 10px 16px;
    box-sizing: border-box;
}

.ms-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ts-ink); }
.ms-brand-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.ms-brand-name { font: 600 20px/1 var(--ts-title); letter-spacing: .01em; }

.ms-nav { display: flex; flex-wrap: nowrap; gap: 2px; margin-left: 6px; flex: 1 1 auto; min-width: 0; }
.ms-nav a {
    padding: 9px 13px;
    border-radius: 999px;
    color: var(--ts-ink);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.ms-nav a:hover { background: var(--ts-cream-2); }

.ms-header-cta { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; white-space: nowrap; }
.ms-header-cta .ms-login { font-size: 15px; font-weight: 500; color: var(--ts-muted); text-decoration: none; padding: 9px 6px; }
.ms-header-cta .ms-login:hover { color: var(--ts-ink); }
.ms-header-cta .ms-btn { padding: 11px 20px; min-height: 44px; font-size: 15px; }

.ms-burger {
    display: none;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    background: transparent;
    border: 1.5px solid var(--ts-line);
    border-radius: 12px;
    color: var(--ts-ink);
    cursor: pointer;
    flex: none;
}

/* ── cards, badges, fields ───────────────────────────────────────────────── */

.ms-card {
    background: var(--ts-cream);
    border: 1px solid var(--ts-line);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--ts-shadow);
}
.ms-card-flat { box-shadow: none; }

.ms-grid { display: grid; gap: 20px; }
.ms-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ms-grid-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }

.ms-badge {
    display: inline-block;
    font: 600 12px/1 var(--ts-ui);
    letter-spacing: .04em;
    border-radius: 999px;
    padding: 5px 11px;
    white-space: nowrap;
}
.ms-badge-free { background: var(--ts-accent); color: #FCFBF7; }
.ms-badge-included { background: var(--ts-accent-soft); color: var(--ts-accent); }
.ms-badge-soon { background: var(--ts-cream-2); color: var(--ts-muted); border: 1px solid var(--ts-line); }
.ms-badge-best { background: var(--ts-amber-soft); color: var(--ts-amber); }

.ms-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ms-field label { font-weight: 600; font-size: 15px; }
.ms-field input, .ms-field textarea, .ms-field select {
    font: 400 16px/1.5 var(--ts-ui);
    color: var(--ts-ink);
    background: var(--ts-cream);
    border: 1.5px solid var(--ts-line);
    border-radius: 12px;
    padding: 12px 14px;
    min-height: 46px;
    box-sizing: border-box;
    width: 100%;
}
.ms-field input:focus, .ms-field textarea:focus, .ms-field select:focus { border-color: var(--ts-accent); }
.ms-field .ms-hint { font-size: 14px; color: var(--ts-muted); }

.ms-note {
    display: flex;
    gap: 12px;
    background: var(--ts-amber-soft);
    color: var(--ts-ink);
    border-radius: 14px;
    padding: 14px 18px;
}
.ms-note-ok { background: var(--ts-indigo-soft); }
.ms-note-error { background: color-mix(in srgb, var(--ts-site-danger) 12%, transparent); }

/* ── art + screenshot frames ─────────────────────────────────────────────── */

.ms-shot {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--ts-line);
    box-shadow: var(--ts-shadow);
    display: block;
    height: auto;
    background: var(--ts-cream);
}
.ms-art {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--ts-radius);
    border: 1px solid var(--ts-line);
    display: block;
}
.ms-avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--ts-line);
    flex: none;
}
figure { margin: 0; }
figcaption { font-size: 14px; color: var(--ts-muted); margin-top: 8px; }

/* ── hero ────────────────────────────────────────────────────────────────── */

.ms-hero { padding: 64px 0 72px; }
.ms-hero h1 { font-size: var(--ts-site-display); margin: 0 0 18px; max-width: 20ch; }
.ms-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 40px; align-items: center; }
.ms-hero-note { margin-top: 14px; font-size: 14px; color: var(--ts-muted); }

/* Japanese sample pairing — the app's own colour language, reused verbatim. */
.ms-jp { font-family: var(--ts-jp); color: var(--ts-kana); font-size: 26px; line-height: 1.5; }
.ms-romaji { color: var(--ts-romaji); font-size: 15px; }
.ms-gloss { color: var(--ts-muted); font-size: 15px; font-style: italic; }

/* ── how a lesson works ──────────────────────────────────────────────────── */

.ms-steps { display: grid; gap: 28px; }
.ms-step { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; align-items: center; }
.ms-step-label { font: 600 13px/1 var(--ts-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ts-accent); margin-bottom: 10px; }

/* A heading with its status badge beside it. Shared by /download, /subscribe, /account, the admin pages
   and the offline section on /learn — it long predates the chapter map that used to define it, so it lives
   on its own now. */
.ms-path-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.ms-path-head h2, .ms-path-head h3 { margin: 0; }

/* ── the website chapter map (W18.33) ────────────────────────────────────

   Echoes the in-app map so the two read as one product: a thick coloured rail,
   chunky ringed nodes with a Japanese glyph, hexagons for exams, grey for
   anything not open yet. Values follow UiKit/Pages/ChaptersPage.razor.css.
   --track is set per section from the path's colour.                        */

.ms-map { display: grid; gap: 40px; }

.ms-track-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.ms-track-head h3 { margin: 0; }
.ms-track-covers { margin: 0 0 20px; color: var(--ts-muted); max-width: 68ch; }
/* No rail follows a not-yet-written track, so it does not need the gap before one. */
.ms-track-covers.brief { margin-bottom: 0; }

/* The rail scrolls inside itself; the page never scrolls sideways. */
.ms-rail-scroll { overflow-x: auto; overflow-y: hidden; padding: 6px 0 4px; }

.ms-rail {
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: 34px;
    margin: 0;
    padding: 0 4px 8px;
    position: relative;
    width: max-content;
    min-width: 100%;
    box-sizing: border-box;
}

/* The connecting rail, drawn behind the nodes at their centre line. */
.ms-rail::before {
    content: "";
    position: absolute;
    left: 34px;
    right: 34px;
    top: 33px;
    height: 10px;
    border-radius: 999px;
    background: var(--track);
    opacity: .35;
}

.ms-stop {
    position: relative;
    display: block;
    width: 108px;
    flex: none;
    text-align: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.ms-stop:hover .ms-stop-shape { transform: translateY(-2px); }
.ms-stop:hover .ms-stop-label { color: var(--track); }
.ms-stop-shape { transition: transform .12s ease; }

.ms-stop-shape {
    width: 68px; height: 68px;
    margin: 0 auto 10px;
    border-radius: 50%;
    border: 4px solid var(--track);
    background: var(--ts-cream);
    color: var(--track);
    display: grid;
    place-items: center;
    font: 600 26px/1 var(--ts-jp);
    box-shadow: 0 4px 0 rgba(58, 50, 46, .18);
    box-sizing: border-box;
}

/* Exams are hexagons in the app; same clip-path here. */
.ms-stop.exam .ms-stop-shape {
    border-radius: 0;
    border: none;
    background: var(--track);
    color: #FCFBF7;
    clip-path: polygon(50% 5%, 92.3% 29.5%, 92.3% 70.5%, 50% 94.9%, 7.7% 70.5%, 7.7% 29.5%);
    box-shadow: none;
}

.ms-stop-label {
    display: block;
    font: 600 13px/1.3 var(--ts-ui);
    color: var(--ts-ink);
}

/* Not open yet: grey rail and grey nodes, exactly as a locked chapter reads in the app. Colour is not the
   only signal — the track also carries a "Coming soon" badge. */
.ms-track.soon .ms-rail::before { background: var(--ts-line); opacity: 1; }
.ms-track.soon .ms-stop-shape {
    border-color: var(--ts-line);
    background: var(--ts-cream-2);
    color: var(--ts-muted);
    box-shadow: none;
}
.ms-track.soon .ms-stop.exam .ms-stop-shape { background: var(--ts-line); color: var(--ts-muted); }
.ms-track.soon .ms-stop-label { color: var(--ts-muted); }

@media (max-width: 720px) {
    .ms-rail { gap: 24px; }
    .ms-stop { width: 92px; }
    .ms-stop-shape { width: 58px; height: 58px; font-size: 22px; }
    .ms-rail::before { top: 28px; left: 29px; right: 29px; }
}


/* ── chapter popup ───────────────────────────────────────────────────────

   Same shape as the app's chapter modal (coloured hero, kanji, title, then the
   detail) minus its footer buttons — there is nothing to launch from here.
   Opened by :target, so it works with no JavaScript at all.                 */

.ms-chapter-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ms-chapter-modal:target { display: flex; }

.ms-modal-scrim { position: absolute; inset: 0; background: rgba(26, 23, 20, .55); }

.ms-modal-panel {
    position: relative;
    width: min(560px, 100%);
    max-height: 86vh;
    overflow-y: auto;
    background: var(--ts-cream);
    border-radius: var(--ts-radius);
    box-shadow: 0 24px 60px rgba(26, 23, 20, .35);
}
.ms-modal-panel:focus { outline: none; }

.ms-modal-hero {
    background: var(--track);
    color: #FCFBF7;
    padding: 22px 24px 20px;
    border-radius: var(--ts-radius) var(--ts-radius) 0 0;
    position: relative;
}
.ms-modal-crumb { font: 600 12px/1 var(--ts-ui); letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.ms-modal-glyph { font: 600 46px/1 var(--ts-jp); margin: 14px 0 8px; }
.ms-modal-title { font: 600 26px/1.2 var(--ts-title); }
.ms-modal-chip {
    display: inline-block; margin-top: 10px;
    background: rgba(252, 251, 247, .22);
    border-radius: 999px; padding: 4px 12px;
    font: 600 12px/1 var(--ts-ui);
}
.ms-modal-x {
    position: absolute; top: 16px; inset-inline-end: 16px;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    color: #FCFBF7; text-decoration: none;
    background: rgba(252, 251, 247, .18);
}
.ms-modal-x:hover { background: rgba(252, 251, 247, .32); }

.ms-modal-body { padding: 20px 24px 26px; }
.ms-modal-body section + section { margin-top: 18px; }
.ms-modal-body h4 {
    margin: 0 0 6px;
    font: 600 12px/1 var(--ts-ui);
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--ts-muted);
}
.ms-modal-body p { margin: 0; }

@media (max-width: 720px) {
    .ms-modal-glyph { font-size: 38px; }
    .ms-modal-title { font-size: 22px; }
}

/* ── shared list + empty-state primitives ───────────────────────────────

   Used well beyond the news feed — the community board and thread, the admin
   pages, the FAQ. They lived in the old news block; they are their own thing
   now so a redesign of one feature cannot quietly take them away.            */

.ms-news { display: grid; gap: 16px; }
.ms-news-item { border-left: 3px solid var(--ts-accent); padding-left: 18px; }
.ms-news-item h3 { margin: 2px 0 6px; }
/* The community board also labels items with a date; plain, not the feed's right-aligned one. */
.ms-news-date { font-size: 14px; color: var(--ts-muted); }

.ms-empty {
    color: var(--ts-muted);
    border: 1px dashed var(--ts-line);
    border-radius: 14px;
    padding: 22px;
}

/* ── news feed ───────────────────────────────────────────────────────────

   The approved news-feed design, translated to this site's tokens. The design
   file ships the older XAML-port palette (--brand-primary, --surface-*); the
   layout and card anatomy are its, the colours are ours.                     */

.ms-news-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--ts-line);
    padding-bottom: 20px;
    margin-bottom: 40px;
}
.ms-news-eyebrow {
    display: block;
    font: 500 14px/1 var(--ts-jp);
    letter-spacing: .18em;
    color: var(--ts-romaji);      /* the design's sakura accent, mapped to our warm accent */
    margin-bottom: 8px;
}
.ms-news-h { font: 600 clamp(28px, 4vw, 40px)/1 var(--ts-title); margin: 0; letter-spacing: -.01em; }
.ms-news-lede { margin: 0; max-width: 340px; font-size: 15px; line-height: 1.55; color: var(--ts-muted); }

.ms-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.ms-news-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--ts-cream);
    border: 1px solid var(--ts-line);
    border-radius: 14px;
    padding: 22px;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    color: var(--tone, var(--ts-ink));
}
.ms-news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(58, 50, 46, .12);
    border-color: color-mix(in srgb, var(--ts-ink) 16%, transparent);
}

/* The accent stripe along the top of each card, coloured by category. */
.ms-news-accent { position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tone, var(--ts-line)); }

/* Optional news picture: bleeds to the card's edges (negative margins cancel the 22px padding; the card's
   overflow:hidden clips it to the rounded corners). Fixed height so cards line up whatever the image ratio. */
.ms-news-media {
    display: block;
    width: calc(100% + 44px);
    height: 150px;
    margin: -22px -22px 18px;
    object-fit: cover;
    background: var(--ts-cream-2);
}

.ms-news-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ms-news-card .ms-news-date { margin-left: auto; font-size: 12px; letter-spacing: .04em; color: inherit; white-space: nowrap; }

.ms-news-title { font: 700 21px/1.25 var(--ts-title); margin: 14px 0 8px; letter-spacing: -.01em; color: var(--tone, var(--ts-ink)); }
.ms-news-body { margin: 0; font-size: 15px; line-height: 1.6; color: inherit; }

/* Pinned to the bottom so bylines line up across cards of different lengths. */
.ms-news-by { margin-top: auto; padding-top: 18px; display: flex; align-items: center; gap: 10px; }
.ms-news-face { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--ts-line); }
.ms-news-author { font-size: 13px; font-weight: 600; }
.ms-news-sep { font-size: 13px; color: inherit; }
.ms-news-role { font-size: 13px; color: inherit; }

/* Category chip. --tone/--tone-soft come from the ms-tone-* class on the CARD, so the stripe, the chip
   and the title all carry the same category colour. */
.ms-chip {
    display: inline-block;
    font: 600 12px/1 var(--ts-ui);
    letter-spacing: .03em;
    border-radius: 999px;
    padding: 5px 11px;
    color: var(--tone);
    background: var(--tone-soft);
}
.ms-tone-accent  { --tone: var(--ts-accent); --tone-soft: var(--ts-accent-soft); }
.ms-tone-violet  { --tone: var(--ts-violet);  --tone-soft: var(--ts-violet-soft); }
.ms-tone-amber   { --tone: var(--ts-amber);   --tone-soft: var(--ts-amber-soft); }
.ms-tone-muted   { --tone: var(--ts-muted);   --tone-soft: var(--ts-cream-2); }
.ms-tone-teal    { --tone: var(--ts-teal);    --tone-soft: var(--ts-teal-soft); }

@media (max-width: 720px) {
    .ms-news-head { margin-bottom: 28px; }
    .ms-news-lede { max-width: none; }
    .ms-news-grid { grid-template-columns: 1fr; }
}

/* ── plans ───────────────────────────────────────────────────────────────── */

.ms-plan { display: flex; flex-direction: column; gap: 6px; }
.ms-plan-price { font: 600 40px/1 var(--ts-title); }
.ms-plan-per { color: var(--ts-muted); font-size: 15px; }
.ms-plan .ms-btn { margin-top: 14px; }

/* ── accordion (FAQ) ─────────────────────────────────────────────────────── */

.ms-accordion { border-top: 1px solid var(--ts-line); }
.ms-accordion details { border-bottom: 1px solid var(--ts-line); }
.ms-accordion summary {
    cursor: pointer;
    padding: 18px 0;
    font-weight: 600;
    font-size: 17px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.ms-accordion summary::-webkit-details-marker { display: none; }
.ms-accordion summary::after { content: "+"; color: var(--ts-accent); font-size: 22px; line-height: 1; }
.ms-accordion details[open] summary::after { content: "−"; }
.ms-accordion .ms-answer { padding: 0 0 18px; color: var(--ts-ink); max-width: 68ch; }

/* ── legal long-form ─────────────────────────────────────────────────────── */

.ms-legal { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.ms-toc { position: sticky; top: 90px; font-size: 15px; }
.ms-toc h2 { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--ts-muted); font-family: var(--ts-ui); }
.ms-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ms-toc a { color: var(--ts-ink); text-decoration: none; }
.ms-toc a:hover { color: var(--ts-accent); }
.ms-legal-body { max-width: 72ch; }
.ms-legal-body h2 { font-size: 24px; margin: 36px 0 12px; scroll-margin-top: 90px; }
.ms-legal-body h3 { font-size: 19px; margin: 24px 0 8px; }
.ms-legal-body ul, .ms-legal-body ol { padding-left: 22px; }
.ms-legal-body li { margin-bottom: 8px; }
.ms-legal-meta { color: var(--ts-muted); font-size: 15px; border-bottom: 1px solid var(--ts-line); padding-bottom: 16px; }

/* ── footer ──────────────────────────────────────────────────────────────── */

.ms-footer { border-top: 1px solid var(--ts-line); background: var(--ts-cream-2); padding: 48px 0 32px; }
.ms-footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.ms-footer-cols > div { display: flex; flex-direction: column; gap: 8px; }
.ms-footer-cols h2 {
    font: 600 13px/1 var(--ts-ui);
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--ts-muted);
    margin: 0 0 4px;
}
.ms-footer-cols a { color: var(--ts-ink); text-decoration: none; }
.ms-footer-cols a:hover { color: var(--ts-accent); }
.ms-footer-note { color: var(--ts-muted); font-size: 14px; margin: 28px 0 0; }

/* ── responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
    :root { --ts-site-section: 56px; }
    .ms-legal { grid-template-columns: 1fr; gap: 24px; }
    .ms-toc { position: static; }
}

/* Below this width the full inline nav + the (wider, when logged-in) CTA no longer fit on one row,
   so collapse the nav into the burger drawer. The header wraps so the drawer sits on its own row. */
@media (max-width: 1024px) {
    .ms-header-inner { flex-wrap: wrap; }
    .ms-burger { display: inline-flex; }
    .ms-nav { display: none; order: 3; width: 100%; flex-direction: column; flex-wrap: nowrap; gap: 0; margin: 8px 0 4px; }
    .ms-nav.ms-open { display: flex; }
    .ms-nav a { padding: 12px 8px; border-radius: 12px; }
    .ms-header-cta .ms-login { display: none; }
}

@media (max-width: 720px) {
    .ms-hero { padding: 40px 0 48px; }
    body { font-size: 16px; }
}

/* Wide content must scroll inside itself, never the page. */
.ms-scroll-x { overflow-x: auto; }

/* ── community ───────────────────────────────────────────────────────────── */

.ms-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid var(--ts-line);
    border-radius: 999px;
    padding: 7px 15px;
    min-height: 38px;
    font: 600 14px/1 var(--ts-ui);
    color: var(--ts-muted);
    cursor: pointer;
}
.ms-like:hover { border-color: var(--ts-accent); color: var(--ts-accent); }
/* Liked state carries colour AND a filled border, so it does not rely on hue alone. */
.ms-like.on { color: var(--ts-accent); border-color: var(--ts-accent); background: var(--ts-accent-soft); }
span.ms-like { cursor: default; }
span.ms-like:hover { border-color: var(--ts-line); color: var(--ts-muted); }

/* Page title with an action beside it (the community composer's Post button). */
.ms-title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ms-title-row h1 { margin: 0; }

/* Author faces on the community board. */
.ms-face {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    border: 1px solid var(--ts-line);
    background: var(--ts-cream-2);
}
.ms-face.sm { width: 34px; height: 34px; }

/* The avatar picker (account page). Selection is shown by a ring AND a checkmark, never colour alone. */
.ms-avatars { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 0; }
.ms-avatar-pick {
    position: relative;
    background: none;
    border: 3px solid transparent;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}
.ms-avatar-pick img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.ms-avatar-pick:hover { border-color: var(--ts-line); }
.ms-avatar-pick.on { border-color: var(--ts-accent); }
.ms-avatar-pick.on::after {
    content: "✓";
    position: absolute; right: -2px; bottom: -2px;
    background: var(--ts-accent); color: #FCFBF7;
    width: 24px; height: 24px; border-radius: 50%;
    font-size: 14px; line-height: 24px; text-align: center;
}

/* Community filter bar. */
.ms-filters {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
    padding: 0 0 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--ts-line);
}
.ms-filters fieldset { border: none; padding: 0; margin: 0; }
.ms-filters legend { padding: 0 0 6px; }
.ms-filter-kinds { display: flex; flex-wrap: wrap; }
.ms-filter-kinds .ms-check { margin-right: 18px; }
.ms-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 34px; }
.ms-check input { width: 18px; height: 18px; accent-color: var(--ts-accent); cursor: pointer; }
.ms-filter-sort { display: flex; flex-direction: column; gap: 6px; }
.ms-filter-sort select {
    font: 400 15px/1 var(--ts-ui);
    color: var(--ts-ink);
    background: var(--ts-cream);
    border: 1.5px solid var(--ts-line);
    border-radius: 999px;
    padding: 10px 14px;
    min-height: 40px;
    cursor: pointer;
}
@media (max-width: 720px) {
    .ms-filters { gap: 14px; }
    .ms-filter-kinds { width: 100%; }
}
