/* ============================================================================
   RoundUp Knowledge Base — support.roundupece.com surface
   ----------------------------------------------------------------------------
   Not _shared.css: the marketing pages are display-typed because they are
   selling; the knowledge base is a utility the reader arrives at mid-problem,
   so it reads as documentation: a persistent sidebar, a denser type scale and
   quiet structure. Since 2026-10-15 it wears the same Friendship Bracelet look
   as the rest of RoundUp (the director and family portals and _shared.css):
   cream paper, sheets pinned with a misregistered second print, pill buttons,
   beads on a string by the brand mark and a cream hero card where a page
   opens. Track colours stay as the accent that says who a page is for.

   Load AFTER the Sora webfont; this file assumes it. The brand accents
   between the paper:roundup-kit markers and RoundUp's paper set between the
   paper:roundup-paper markers are generated from shared/tokens/paper.ts
   (`npm run tokens:build`); change them there. The --bk-* tokens and bk-
   pieces below are kept in step with _shared.css.
   ========================================================================= */
:root {
  /* Brand accents */
  /* paper:roundup-kit — generated by scripts/build-web-tokens.mjs from shared/tokens/paper.ts; do not edit */
  --yellow: #ffc857;
  --rose: #e8586d;
  --lavender: #b499d4;
  --teal: #a7e4e4;
  --pink: #f498b5;
  --ink: #2a1633;
  --cream: #faf4e8;
  /* /paper:roundup-kit */
  /* paper:roundup-paper — generated by scripts/build-web-tokens.mjs from shared/tokens/paper.ts; do not edit */
  --paper-paper: #faf4e8;
  --paper-sheet: #fffcf5;
  --paper-sheet-edge: #ebddc4;
  --paper-ink: #2a1633;
  --paper-sub: #7a6478;
  --paper-faint: #8a7488;
  --paper-primary: #c54a5c;
  --paper-primary-deep: #a63c4c;
  --paper-primary-fill: #a63c4c;
  --paper-second-ink: #ffc857;
  --paper-primary-wash: #f9e0e2;
  --paper-leaf: #5e8f66;
  --paper-amber: #e8a030;
  --paper-confetti-1: #ffc857;
  --paper-confetti-2: #e8586d;
  --paper-confetti-3: #b499d4;
  --paper-confetti-4: #a7e4e4;
  --paper-confetti-5: #f498b5;
  --paper-shadow: #2a1633;
  /* /paper:roundup-paper */

  /* KB neutrals, on the cream paper. Every text shade here is at least 4.5:1
     on --kb-bg, --kb-card and --kb-sunken. */
  --kb-bg:        var(--paper-paper);
  --kb-sunken:    #f4ecdc;
  --kb-card:      var(--paper-sheet);
  --kb-text:      var(--paper-ink);
  --kb-muted:     #66586a;
  --kb-faint:     #6f6070;
  --kb-line:      var(--paper-sheet-edge);
  --kb-line-soft: #f1e7d5;

  /* Track accent — overridden per audience on <body data-track> */
  --track:        var(--lavender);
  --track-ink:    #5B4A7A;
  --track-wash:   #F4F0FA;

  --radius:    14px;
  --radius-sm: 10px;
  --maxw:      1240px;

  /* Friendship Bracelet (see _shared.css) */
  --bk-b1: var(--paper-confetti-5);
  --bk-b2: var(--paper-confetti-4);
  --bk-b3: var(--paper-confetti-3);
  --bk-b4: var(--paper-confetti-2);
  --bk-b5: var(--paper-confetti-1);
  --bk-b5-edge: #e0a93a;
  --bk-string: color-mix(in srgb, var(--paper-sub) 30%, var(--paper-sheet-edge));
  --bk-pin: color-mix(in srgb, var(--paper-primary) 18%, transparent);
  --bk-hero-bg: #faf4e8;
  --bk-hero-ink: #2a1633;
  --bk-hero-sub: #6a5468;
  --bk-hero-shadow: #ffc857;
  --bk-cta: var(--paper-primary-fill);
  --bk-cta-hover: color-mix(in srgb, var(--paper-primary-fill) 85%, var(--paper-ink));
  --bk-link: var(--paper-primary-deep);
  --bk-beads:
    radial-gradient(circle closest-side, var(--bk-b1) 88%, transparent 100%) 2px 50% / 10px 10px no-repeat,
    radial-gradient(circle closest-side, var(--bk-b2) 88%, transparent 100%) 17px 50% / 10px 10px no-repeat,
    radial-gradient(circle closest-side, var(--bk-b3) 88%, transparent 100%) 32px 50% / 10px 10px no-repeat,
    radial-gradient(circle closest-side, var(--bk-b4) 88%, transparent 100%) 47px 50% / 10px 10px no-repeat,
    radial-gradient(circle closest-side, var(--bk-b5) 70%, var(--bk-b5-edge) 76% 88%, transparent 100%) 62px 50% / 10px 10px no-repeat,
    linear-gradient(var(--bk-string), var(--bk-string)) 0 50% / 100% 1.5px no-repeat;
}
body[data-track="families"] {
  --track:      var(--rose);
  --track-ink:  #A83349;
  --track-wash: #FDF0F2;
}
body[data-track="teachers"] {
  --track:      var(--yellow);
  --track-ink:  #7A5200;
  --track-wash: #FFF6E0;
}
body[data-track="directors"] {
  --track:      var(--lavender);
  --track-ink:  #5B4A7A;
  --track-wash: #F4F0FA;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--kb-bg);
  color: var(--kb-text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--track-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--paper-primary); outline-offset: 2px; }

/* ---------- Skip link (a11y: the sidebar is long) ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 0 0 12px 0;
  font-weight: 600; font-size: 14px;
}
.skip:focus { left: 0; text-decoration: none; }

/* ---------- Top bar: a sheet with the pin under it, beads by the mark ---------- */
.kb-top {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,252,245,.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--kb-line);
  box-shadow: 0 3px 0 var(--bk-pin);
}
.kb-top .row {
  max-width: var(--maxw); margin: 0 auto; padding: 8px 32px;
  display: flex; align-items: center; gap: 20px;
}
.kb-top .brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; min-height: 44px; border-radius: 12px; }
.kb-top .brand:hover { text-decoration: none; }
.kb-top .brand img { height: 30px; display: block; }
.bk-beads,
.kb-top .brand::after {
  content: ""; display: block; flex: none;
  width: 74px; height: 10px;
  background: var(--bk-beads);
}
.kb-top .brand::after { order: 1; }
.kb-top .brand .kb-label {
  order: 2;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--kb-faint); padding-left: 14px; border-left: 1px solid var(--kb-line);
}
.kb-top .spacer { flex: 1; }
.kb-top .top-links { display: flex; gap: 4px; align-items: center; }
.kb-top .top-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px;
  color: var(--kb-muted); font-size: 14px; font-weight: 600;
}
.kb-top .top-links a:hover { color: var(--kb-text); background: var(--paper-primary-wash); text-decoration: none; }
.kb-top .top-links a[aria-current="page"] { color: var(--kb-text); }
@media (max-width: 860px) {
  .kb-top .row { padding: 8px 16px; gap: 8px; }
  .kb-top .top-links a { display: none; }
  .kb-top .top-links a.keep { display: inline-flex; }
}
/* On a phone the beads drop under the mark, and the section label goes. */
@media (max-width: 560px) {
  .kb-top .brand { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
  .kb-top .brand img { height: 26px; }
  .kb-top .brand .kb-label { display: none; }
  .kb-top .top-links a { padding: 0 10px; }
}

/* ---------- Layout: sidebar + content ---------- */
.kb-shell {
  max-width: var(--maxw); margin: 0 auto; padding: 0 32px;
  display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 56px;
  align-items: start;
}
.kb-shell.no-side { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 940px) {
  .kb-shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 16px; }
  .kb-side { display: none; }
}

.kb-side {
  position: sticky; top: 76px; padding: 40px 0 60px;
  max-height: calc(100vh - 76px); overflow-y: auto;
  scrollbar-width: thin;
}
.kb-side::-webkit-scrollbar { width: 6px; }
.kb-side::-webkit-scrollbar-thumb { background: var(--kb-line); border-radius: 3px; }
.kb-side .group + .group { margin-top: 26px; }
.kb-side a + .group-h, .kb-side .soon + .group-h { margin-top: 26px; }
.kb-side .group-h {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--kb-faint); margin: 0 0 10px; padding: 0 12px;
}
.kb-side a {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  color: var(--kb-muted); font-size: 14.5px; font-weight: 500; line-height: 1.4;
}
.kb-side a:hover { background: var(--kb-sunken); color: var(--kb-text); text-decoration: none; }
.kb-side a[aria-current="page"] {
  background: var(--track-wash); color: var(--track-ink); font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--track);
}
.kb-side a[aria-current="page"]::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--track); flex: none;
}
.kb-side .soon { display: block; padding: 7px 12px; font-size: 14.5px; color: var(--kb-faint); }
.kb-side .soon::after {
  content: "soon"; margin-left: 8px; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--kb-faint);
  border: 1px solid var(--kb-line); border-radius: 999px; padding: 1px 6px;
}

.kb-main { padding: 40px 0 96px; min-width: 0; }

/* ---------- Breadcrumb ---------- */
.crumb { font-size: 13px; color: var(--kb-faint); margin: 0 0 18px; }
.crumb a { color: var(--kb-muted); }
.crumb .sep { padding: 0 7px; }

/* ---------- Hero card: cream, plum ink, the kit yellow behind the h1 ---------- */
.bk-hero {
  display: flex; flex-wrap: wrap; align-items: center;
  background: var(--bk-hero-bg); color: var(--bk-hero-ink);
  border: 1px solid var(--kb-line); border-radius: 24px;
  box-shadow: 3px 3px 0 var(--bk-pin);
  overflow: hidden;
}
.bk-hero__text {
  flex: 1 1 320px; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
  padding: 32px 8px 32px 36px;
}
.bk-hero__art {
  flex: 0 1 440px; min-width: 0; max-width: 100%;
  width: 440px; height: auto; display: block; margin-left: auto; align-self: flex-end;
}
.bk-hero h1, .bk-h1 {
  margin: 0; color: var(--bk-hero-ink);
  font-size: 40px; line-height: 1.1; letter-spacing: -.02em; font-weight: 600;
  text-shadow: 2px 2px 0 var(--bk-hero-shadow); text-wrap: balance;
}
.bk-hero .lede, .bk-lede { margin: 0; font-size: 17.5px; color: var(--bk-hero-sub); max-width: 620px; }
@media (max-width: 860px) {
  .bk-hero h1, .bk-h1 { font-size: 30px; }
  .bk-hero__text { padding: 24px 20px 8px; }
  .bk-hero__art { width: 100%; flex-basis: 100%; }
}

/* ---------- Hero (KB home): the card, inside the page's width ---------- */
.kb-hero .inner { max-width: var(--maxw); margin: 0 auto; padding: 32px 32px 8px; }
/* Lined up with the page's content column (--maxw less the 32px gutters). */
.kb-hero .inner.bk-hero {
  max-width: none; margin: 32px max(32px, calc((100% - var(--maxw)) / 2 + 32px)) 8px; padding: 0;
}
@media (max-width: 860px) { .kb-hero .inner.bk-hero { margin: 20px 16px 4px; } }
.kb-hero h1 { margin: 0 0 6px; max-width: 660px; }
.kb-hero p.lede { margin: 0; }
/* A track page opens with the card too, at the top of its column. */
.kb-track-hero { margin: 0 0 36px; }
.kb-track-hero h1 { margin-bottom: 4px; }
.bk-hero .lede--small { font-size: 15px; margin-top: 6px; }
.bk-hero .kb-search { margin-top: 20px; }

/* ---------- Search / filter ---------- */
.kb-search { margin: 26px 0 0; max-width: 560px; position: relative; }
.kb-search input {
  width: 100%; height: 50px; padding: 0 18px 0 46px;
  border: 1.5px solid #cdbba2; border-radius: 999px;
  background: var(--kb-card); color: var(--kb-text);
  font-family: inherit; font-size: 16px;
}
.kb-search input:focus { outline: none; border-color: var(--paper-primary); }
.kb-search input:focus-visible { outline: 3px solid color-mix(in srgb, var(--paper-primary) 35%, transparent); outline-offset: 1px; }
.kb-search svg { position: absolute; left: 18px; top: 16px; pointer-events: none; }
.kb-search .hint { font-size: 13px; color: var(--kb-faint); margin: 8px 4px 0; }
.no-results {
  display: none; padding: 28px 4px; color: var(--kb-muted); font-size: 15px;
}
.no-results.show { display: block; }

/* ---------- Track cards (the three audiences): pinned sheets ---------- */
.tracks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0 0 56px; }
@media (max-width: 1040px) { .tracks { grid-template-columns: minmax(0, 1fr); } }
.track-card {
  display: block; padding: 28px; border: 1px solid var(--kb-line);
  border-radius: 16px; background: var(--kb-card); color: inherit;
  box-shadow: 3px 3px 0 var(--bk-pin);
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.track-card:hover {
  text-decoration: none; transform: translateY(-2px);
  border-color: var(--c); box-shadow: 5px 5px 0 var(--bk-pin);
}
.track-card .pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--kb-text); background: var(--kb-bg);
  border: 1px solid var(--kb-line);
  padding: 4px 12px 4px 9px; border-radius: 999px; margin-bottom: 14px;
}
.track-card .pill::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.track-card h2 { font-size: 22px; font-weight: 600; letter-spacing: -.012em; margin: 0 0 8px; }
.track-card p { margin: 0 0 16px; color: var(--kb-muted); font-size: 15px; }
.track-card .go { font-size: 14px; font-weight: 600; color: var(--kb-text); text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Article list ---------- */
.sec-h {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--kb-faint); margin: 0 0 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--kb-line);
}
.art-list { display: grid; gap: 10px; margin: 0 0 48px; }
.art {
  display: flex; align-items: baseline; gap: 14px;
  padding: 15px 18px; border: 1px solid var(--kb-line); border-radius: var(--radius);
  background: var(--kb-card); color: inherit;
  box-shadow: 3px 3px 0 var(--bk-pin);
  transition: border-color .14s ease, background .14s ease;
}
a.art:hover { text-decoration: none; border-color: var(--track); background: var(--track-wash); }
.art .t { font-weight: 600; font-size: 15.5px; flex-shrink: 0; }
.art .d { color: var(--kb-muted); font-size: 14px; min-width: 0; }
@media (max-width: 640px) { .art { flex-direction: column; gap: 4px; } }
.art.disabled { opacity: .55; }
.art.disabled .t::after {
  content: "soon"; margin-left: 9px; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--kb-faint);
  border: 1px solid var(--kb-line); border-radius: 999px; padding: 1px 6px;
}

/* ---------- Article body ---------- */
.article { max-width: 760px; overflow-wrap: break-word; }
.article h1 {
  font-size: 36px; line-height: 1.15; letter-spacing: -.02em; font-weight: 600;
  margin: 0 0 12px; text-shadow: 2px 2px 0 var(--bk-hero-shadow); text-wrap: balance;
}
@media (max-width: 860px) { .article h1 { font-size: 28px; } }
.article .sub { font-size: 17.5px; color: var(--kb-muted); margin: 0 0 10px; }
.article .meta {
  font-size: 13px; color: var(--kb-faint); margin: 0 0 34px;
  padding-bottom: 20px; border-bottom: 1px solid var(--kb-line);
}
.article h2 {
  font-size: 22px; font-weight: 600; letter-spacing: -.012em;
  margin: 46px 0 14px; scroll-margin-top: 90px;
}
.article h3 { font-size: 17px; font-weight: 600; margin: 30px 0 10px; scroll-margin-top: 90px; }
.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }
.article li { margin-bottom: 9px; }
.article li > ul, .article li > ol { margin-top: 9px; }
.article strong { font-weight: 600; }
.article hr { border: 0; border-top: 1px solid var(--kb-line); margin: 44px 0; }
.article a, .post a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
.article a:hover, .post a:hover { text-decoration-color: currentColor; }

/* Steps — numbered beads on a string, for setup walkthroughs */
ol.steps { list-style: none; padding: 0; counter-reset: step; margin: 0 0 24px; }
ol.steps > li {
  position: relative; padding: 0 0 22px 46px; counter-increment: step;
  border-left: 1.5px solid var(--bk-string); margin-left: 15px;
}
ol.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: -16px; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--track-wash); color: var(--track-ink);
  border: 1.5px solid var(--track);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
ol.steps > li > .st { font-weight: 600; display: block; margin-bottom: 4px; }

/* Callouts */
.note {
  border: 1px solid var(--kb-line); border-left: 4px solid var(--track);
  background: var(--kb-card); border-radius: 12px;
  padding: 16px 20px; margin: 0 0 22px; font-size: 15px;
}
.note .lbl {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--track-ink); margin-bottom: 6px;
}
.note p:last-child { margin-bottom: 0; }
.note.warn { border-left-color: var(--rose); background: #FDF0F2; }
.note.warn .lbl { color: #A83349; }

/* Code + config values */
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em; background: var(--kb-sunken); border: 1px solid var(--kb-line-soft);
  border-radius: 5px; padding: 1.5px 5px; word-break: break-word;
}
pre {
  background: #1E1726; color: #EDE8F2; border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; margin: 0 0 22px;
  font-size: 13.5px; line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* Field tables — the shape IdP setup docs need. Quiet sentence-case headers, as in the portals. */
.article table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 14.5px; }
.article th, .article td {
  text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--kb-line);
  vertical-align: top;
}
.article th {
  font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--kb-muted); border-bottom-color: var(--kb-line);
}
.article td code { white-space: nowrap; }
.tbl-scroll { overflow-x: auto; margin: 0 0 24px; }
.tbl-scroll table { margin: 0; }

/* ---------- Footer ---------- */
.kb-foot {
  border-top: 1px solid var(--kb-line); background: transparent;
  padding: 40px 0 36px; margin-top: 40px;
}
.kb-foot .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 32px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
}
@media (max-width: 860px) { .kb-foot .inner { padding: 0 16px; } }
.kb-foot .who { display: flex; align-items: center; gap: 11px; }
.kb-foot .who img { height: 24px; }
.kb-foot .who span { font-size: 13px; color: var(--kb-muted); }
.kb-foot .links { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.kb-foot .links a { font-size: 13px; color: var(--kb-muted); font-weight: 500; display: inline-flex; align-items: center; min-height: 32px; }
.kb-foot .links a:hover { color: var(--bk-link); }
.kb-foot .lang-switch { font-size: 13px; color: var(--kb-muted); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Still stuck / contact: a pinned sheet ---------- */
.stuck {
  border: 1px solid var(--kb-line); border-radius: 16px;
  background: var(--kb-card); padding: 26px 28px; margin: 48px 0 0;
  box-shadow: 3px 3px 0 var(--bk-pin);
}
.stuck h2 { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.stuck p { margin: 0 0 14px; color: var(--kb-muted); font-size: 15px; }
.stuck .btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%;
  background: var(--bk-cta); color: #fff !important; font-weight: 600; font-size: 14px;
  padding: 0 20px; border-radius: 999px; overflow-wrap: anywhere;
}
.stuck .btn:hover { text-decoration: none; background: var(--bk-cta-hover); }

/* ---------- Motion: things arrive, nothing performs ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes bk-thread {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
  }
  @keyframes bk-art-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  .kb-top .brand::after, .bk-beads { animation: bk-thread 520ms cubic-bezier(0.3, 1.1, 0.5, 1) 120ms backwards; }
  .bk-hero__art { animation: bk-art-in 480ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms backwards; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0s !important; transition-duration: 0.01ms !important;
  }
}
