/* Components shared by every layout. Class prefix jb- (never "ad-": ad blockers hide those). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--paper); -webkit-text-size-adjust: 100%; }
a { color: var(--maroon-text); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid rgba(101, 11, 9, .35); outline-offset: 2px; }
.jb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* type */
.jb-h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.1; }
.jb-h2 { font-family: var(--caps); font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--maroon-text); }
.jb-eyebrow { font-family: var(--caps); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-text); }
.jb-kind { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.jb-lede { font-family: var(--serif); font-size: 19px; color: #4A4A4A; }
.jb-muted { color: var(--ink-3); font-size: 13px; }
.jb-small { font-size: 13px; }
.jb-serif { font-family: var(--serif); }
.tone-due { color: var(--maroon-text); } .tone-warn { color: var(--amber-ink); } .tone-ok { color: var(--sage-ink); } .tone-muted { color: #5A5A5A; }

/* layout helpers */
.jb-stack { display: flex; flex-direction: column; gap: 22px; }
.jb-stack-sm { display: flex; flex-direction: column; gap: 10px; }
.jb-cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.jb-cols > * { min-width: 0; }
.jb-col-1 { flex: 1 1 280px; } .jb-col-15 { flex: 1.5 1 400px; } .jb-col-2 { flex: 2 1 480px; } .jb-col-3 { flex: 3 1 560px; }
.jb-row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
/* a heading or intro with buttons beside it: long text wraps in its own column instead of pushing the buttons down */
.jb-page-head > :first-child:not(:only-child), .jb-row-between:has(> .jb-btn, > button, > .jb-inline, > a.jb-link) > :first-child { flex: 1 1 280px; min-width: 0; }
.jb-page-head > :not(:first-child), .jb-row-between > :not(:first-child) { flex-shrink: 0; }
.jb-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jb-grow { flex: 1 1 auto; min-width: 0; }
.jb-grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

/* cards */
.jb-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.jb-card > .jb-row-between:first-child { margin-bottom: 8px; }
.jb-card.flush { padding: 0; overflow: hidden; }
.jb-card.sage { background: var(--sage); color: var(--on-sage); border: 0; }
.jb-card.sage .jb-h2 { color: var(--on-sage); }
.jb-card.maroon { background: var(--maroon); color: var(--on-maroon); border: 0; }
.jb-card.maroon .jb-h2 { color: var(--on-maroon); }
.jb-card.wash { background: var(--maroon-wash); border-color: var(--maroon-line); }
.jb-card.mist { background: var(--sage-mist); border-color: var(--sage-line); }
.jb-link { font-size: 14px; font-weight: 600; color: var(--maroon-text); text-decoration: none; }
.jb-link:hover { text-decoration: underline; }
button.jb-link { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.jb-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 22%, transparent); font-size: 14px; }
.jb-card:not(.sage):not(.maroon) .jb-kv { border-bottom-color: var(--line-soft); }
.jb-kv b { white-space: nowrap; }
.jb-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 18px; display: flex; align-items: center; gap: 14px; }
.jb-kpi .v { font-family: var(--caps); font-size: 24px; font-weight: 600; color: var(--maroon-text); min-width: 64px; }
.jb-kpi .l { font-size: 14px; font-weight: 600; }
.jb-kpi.big { flex-direction: column; align-items: flex-start; gap: 2px; }
.jb-kpi.big .v { font-size: 28px; }

/* buttons */
.jb-btn { min-height: 44px; padding: 0 18px; border-radius: var(--r-sm); border: 0; background: var(--maroon); color: var(--on-maroon); font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.jb-btn:hover { background: var(--maroon-ink); }
.jb-btn.outline { background: #fff; color: var(--maroon-text); border: 1px solid #CDB9B8; }
.jb-btn.outline:hover { background: var(--maroon-wash); }
.jb-btn.sage { background: var(--sage); color: var(--on-sage); } .jb-btn.sage:hover { background: var(--sage-ink); }
.jb-btn.ghost { background: transparent; color: var(--ink-3); }
.jb-btn.ghost:hover { background: var(--chip); }
.jb-btn.light { background: var(--paper); color: var(--sage-text); font-weight: 700; }
.jb-btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.jb-btn[disabled] { opacity: .5; cursor: default; }
.jb-btn.block { width: 100%; }
.jb-iconbtn { width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid #DCD6CA; background: #fff; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.jb-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* pills & chips */
.jb-pill { display: inline-block; font-size: 12px; font-weight: 600; line-height: 1; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: var(--sage-tint); color: var(--sage-ink); } .pill-warn { background: var(--amber-tint); color: var(--amber); }
.pill-due { background: var(--maroon-tint); color: var(--maroon-text); } .pill-muted { background: var(--chip); color: #454545; }
.jb-chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; line-height: 1; padding: 4px 8px; border-radius: 4px; }
.jb-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--maroon); color: var(--on-maroon); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.jb-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--chip); gap: 3px; flex-wrap: wrap; }
.jb-seg button { min-height: 34px; padding: 0 14px; border-radius: 8px; border: 0; background: transparent; color: #454545; font-weight: 600; font-size: 13px; cursor: pointer; }
.jb-seg button[aria-pressed="true"] { background: #fff; color: var(--maroon-text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.jb-kids { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.jb-kids button { min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid #DCD6CA; background: #fff; color: #333; font-weight: 600; font-size: 14px; cursor: pointer; }
.jb-kids button[aria-pressed="true"] { border-color: var(--sage); background: var(--sage); color: var(--on-sage); }
.jb-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sage-tint); color: var(--sage-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.jb-avatar.maroon { background: var(--maroon); color: var(--on-maroon); }

/* lists */
.jb-list > * { border-bottom: 1px solid var(--line-soft); }
.jb-list > *:last-child { border-bottom: 0; }
.jb-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; flex-wrap: wrap; }
/* list rows: the text takes the free space and wraps; buttons stay together on the right, on the same line */
.jb-item > .jb-grow { flex: 1 1 0%; min-width: 0; }
.jb-item > .jb-grow ~ * { flex-shrink: 0; }
.jb-item > .jb-grow + * { margin-left: auto; }
@media (max-width: 640px) {
  .jb-item > .jb-grow { flex-basis: 100%; }                         /* phones: text first, actions on their own line */
  .jb-item > :not(.jb-grow) + .jb-grow { flex-basis: calc(100% - 72px); }   /* …beside a leading avatar or chip */
}
.jb-item .t { font-weight: 700; font-size: 15px; }
.jb-item a.t { color: var(--ink); text-decoration: none; }
.jb-item a.t:hover { color: var(--maroon-text); text-decoration: underline; }
.jb-bar-left { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.jb-msg { display: flex; gap: 12px; padding: 11px 0; align-items: flex-start; text-decoration: none; color: inherit; }
.jb-msg:hover .s { text-decoration: underline; }
.jb-msg .s { font-size: 14px; color: #2A2A2A; }
.jb-msg.unread .s { font-weight: 700; }
.jb-empty { padding: 18px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* bars */
.jb-meter { height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.jb-meter > span { display: block; height: 100%; border-radius: 99px; background: var(--sage); }
.jb-meter.thin { height: 4px; }
.jb-meter > span.due { background: var(--maroon); }

/* tables */
.jb-tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.jb-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.jb-tbl th { padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #5A5A5A; text-align: left; white-space: nowrap; }
.jb-tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.jb-tbl td.num, .jb-tbl th.num { text-align: right; white-space: nowrap; }
.jb-tbl tr.click { cursor: pointer; } .jb-tbl tr.click:hover td { background: var(--chip-soft); }
.jb-tbl td.strong { font-weight: 600; }
.jb-tbl .missing { color: var(--maroon-text); font-weight: 700; } .jb-tbl .tograde { color: var(--amber); font-style: italic; }

/* forms */
.jb-field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.jb-field > span { font-weight: 600; }
.jb-input, .jb-field input, .jb-field select, .jb-field textarea { min-height: 44px; padding: 8px 12px; border: 1px solid #D5CFC2; border-radius: var(--r-sm); background: #fff; width: 100%; font-size: 16px; }
.jb-field textarea { min-height: 96px; resize: vertical; }
.jb-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.jb-form .wide { grid-column: 1 / -1; }
.jb-check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.jb-check input { width: 20px; height: 20px; accent-color: var(--sage); margin: 0; }
.jb-search { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border: 1px solid #DCD6CA; border-radius: var(--r-sm); background: #fff; color: var(--ink-3); }
.jb-search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); font-size: 15px; }
.jb-error { color: var(--maroon-text); font-size: 14px; font-weight: 600; }

/* tabs */
.jb-tabs { display: flex; gap: 2px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.jb-tabs a { padding: 10px 0; margin-bottom: -1px; font-weight: 600; font-size: 15px; color: var(--ink-3); text-decoration: none; border-bottom: 2px solid transparent; }
.jb-tabs a[aria-current="page"] { color: var(--maroon-text); border-bottom-color: var(--maroon); }

/* banner */
.jb-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 16px; border-radius: 10px; background: var(--sage-mist); border: 1px solid var(--sage-line); }
.jb-banner b { color: var(--sage-ink); font-size: 14px; white-space: nowrap; }
.jb-banner span { flex: 1 1 300px; font-size: 14px; }
.jb-banner.wash { background: var(--maroon-wash); border-color: var(--maroon-line); border-left: 4px solid var(--maroon); }
.jb-banner.wash b { color: var(--maroon-text); }

/* sheet / modal */
.jb-scrim { position: fixed; inset: 0; background: rgba(27, 20, 15, .38); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.jb-sheet { background: var(--paper); border-radius: var(--r-lg); width: min(640px, 100%); max-height: calc(92vh / var(--zf, 1)); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.jb-sheet.wide { width: min(920px, 100%); }
.jb-sheet header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.jb-sheet .body { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.jb-sheet footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) { .jb-scrim { align-items: flex-end; padding: 0; } .jb-sheet { border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: calc(94vh / var(--zf, 1)); } }
.jb-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 80; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100% - 32px); }
.jb-toast.err { background: var(--maroon); color: var(--on-maroon); }

/* messages */
.jb-thread { display: flex; flex-direction: column; gap: 12px; }
.jb-bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; }
.jb-bubble.mine { align-self: flex-end; background: var(--sage-mist); border-color: var(--sage-line); }
.jb-bubble .meta { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; display: flex; gap: 8px; }

/* calendar */
.jb-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.jb-cal > div { min-height: 96px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; font-size: 12px; background: #fff; overflow: hidden; }
.jb-cal .dow { min-height: 0; background: var(--chip-soft); font-weight: 700; text-align: center; color: var(--ink-3); }
.jb-cal .out { background: var(--chip-soft); color: var(--ink-4); }
.jb-cal .is-today { box-shadow: inset 0 0 0 2px var(--maroon); }
.jb-cal .n { font-weight: 700; display: block; margin-bottom: 3px; }
.jb-cal .ev { display: block; padding: 2px 5px; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--sage-tint); color: var(--sage-ink); }
.jb-cal .ev.due { background: var(--maroon-tint); color: var(--maroon-text); }
.jb-cal .ev.live { background: var(--amber-tint); color: var(--amber); }
@media (max-width: 720px) { .jb-cal > div { min-height: 64px; padding: 3px; } .jb-cal .ev { font-size: 10px; } }

/* gradebook */
.jb-gb td.cell { padding: 0; text-align: center; min-width: 76px; }
.jb-gb td.cell button { width: 100%; min-height: 40px; border: 0; background: transparent; cursor: pointer; font-size: 14px; }
.jb-gb td.cell button:hover { background: var(--chip-soft); }
.jb-gb th { white-space: normal; min-width: 76px; vertical-align: bottom; }
.jb-gb td:first-child, .jb-gb th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 170px; }
.jb-marks { display: flex; gap: 4px; }
.jb-marks button { width: 38px; height: 38px; border-radius: 8px; border: 0; background: #F1F1F3; color: #8A8478; font-weight: 700; cursor: pointer; }
.jb-marks button[aria-pressed="true"].P { background: var(--sage); color: var(--on-sage); }
.jb-marks button[aria-pressed="true"].A { background: var(--maroon); color: var(--on-maroon); }
.jb-marks button[aria-pressed="true"].T { background: var(--amber-ink); color: #fff; }
.jb-marks button[aria-pressed="true"].E { background: #4A5A78; color: #fff; }
.jb-marks button[aria-pressed="true"].D { background: #6B5B95; color: #fff; }

/* admissions board */
.jb-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.jb-lane { background: var(--chip-soft); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.jb-lane h3 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; }
.jb-appcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: inherit; display: block; }
.jb-appcard:hover { border-color: var(--maroon); }

/* lesson player */
.jb-video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); background: #111; color: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.jb-video .cap { position: absolute; top: 16px; left: 20px; font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #9A9A9A; }
.jb-video .ttl { font-weight: 300; font-size: clamp(22px, 4vw, 40px); text-align: center; padding: 0 30px; }
.jb-video .play { position: absolute; left: 50%; top: 68%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; border: 0; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.jb-video .bar { position: absolute; left: 20px; right: 20px; bottom: 16px; display: flex; align-items: center; gap: 12px; color: #CFCFCF; font-size: 13px; }
.jb-video .bar .track { flex: 1; height: 3px; background: rgba(255,255,255,.25); border-radius: 99px; overflow: hidden; }
.jb-video .bar .track span { display: block; height: 100%; background: #fff; }
.jb-step { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.jb-dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #CFCFCF; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.jb-dot.done { background: var(--sage); border-color: var(--sage); color: var(--on-sage); }
.jb-dot.cur { border: 2px solid var(--maroon); }
.jb-outline .lesson { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; }
.jb-outline .lesson:hover { background: var(--chip-soft); }
.jb-outline .lesson.cur { background: var(--sage-mist); font-weight: 600; }
.jb-quiz .q { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.jb-quiz label { display: flex; gap: 10px; align-items: center; padding: 6px 0; cursor: pointer; }
.jb-quiz .right { color: var(--sage-ink); font-weight: 700; } .jb-quiz .wrong { color: var(--maroon-text); font-weight: 700; }

/* print: progress reports, transcripts, receipts */
.jb-paper { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 36px 40px; max-width: 860px; }
.jb-paper h1 { font-family: var(--caps); letter-spacing: .08em; font-size: 22px; color: var(--maroon-text); }
@media print {
  body { background: #fff; }
  .jb-noprint, .jb-rail, .jb-top, .jb-week, .jb-banner { display: none !important; }
  .jb-main { padding: 0 !important; }
  .jb-paper { border: 0; padding: 0; max-width: none; }
}

/* sign-in */
.jb-login { min-height: calc(100vh / var(--zf, 1)); display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--paper); }
.jb-login-card { width: min(460px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px 28px 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.jb-login-logo { width: 240px; max-width: 100%; max-height: 130px; object-fit: contain; align-self: center; }
.jb-demo { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.jb-demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.jb-demo-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; text-align: left; color: var(--ink); }
.jb-demo-btn:hover { border-color: var(--maroon); background: #fff; }
.jb-demo-btn .jb-ico { color: var(--sage-text); margin-bottom: 4px; }
.jb-demo-btn span { font-size: 13px; color: var(--ink-3); }
.jb-video .play .jb-ico { fill: #111; stroke: none; margin-left: 3px; width: 24px; height: 24px; }
.jb-lesson { max-width: 940px; }

/* update notice (pwa-update-notice skill): top centre, never over the phone tab bar */
.update-bar{position:fixed;left:12px;right:12px;margin:0 auto;top:calc(env(safe-area-inset-top,0px) + 12px);z-index:8500;display:flex;align-items:center;gap:12px;width:fit-content;max-width:560px;box-sizing:border-box;padding:8px 8px 8px 16px;border-radius:16px;background:var(--maroon-ink);color:var(--on-maroon-ink);font-family:var(--sans,inherit);font-weight:600;font-size:14.5px;box-shadow:0 14px 34px rgba(0,0,0,.3);animation:upd-in .35s cubic-bezier(.2,.9,.3,1)}
.update-bar button{flex:none;border:0;border-radius:999px;padding:8px 16px;background:#fff;color:var(--maroon-ink);font:inherit;font-weight:700;cursor:pointer}
@keyframes upd-in{from{opacity:0;transform:translateY(-14px)}}
@media (prefers-reduced-motion:reduce){.update-bar{animation:none}}

/* search results (header dropdown and full page) */
.jb-kbd { font: 600 11px var(--sans); color: var(--ink-4); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.jb-sr-pop { position: absolute; left: 0; right: 0; top: 50px; min-width: min(520px, calc(100vw / var(--zf, 1) - 32px)); background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 18px 44px rgba(40,30,20,.18); z-index: 45; max-height: calc(70vh / var(--zf, 1)); overflow: auto; padding: 6px 0; }
.jb-sr-group + .jb-sr-group { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 4px; }
.jb-sr-head { display: flex; justify-content: space-between; padding: 8px 16px 4px; font-family: var(--caps); font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--maroon-text); }
.jb-sr-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 16px; text-decoration: none; color: var(--ink); }
.jb-sr-item:hover, .jb-sr-item.on { background: var(--sage-mist); }
.jb-sr-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--chip-soft); color: var(--sage-text); display: flex; align-items: center; justify-content: center; flex: none; }
.jb-sr-ico .jb-ico { width: 17px; height: 17px; }
.jb-sr-label { display: block; font-weight: 600; font-size: 14.5px; }
.jb-sr-sub { display: block; font-size: 13px; color: var(--ink-3); }
.jb-sr-snip { display: block; font-size: 13px; color: #4A4A4A; margin-top: 2px; }
.jb-sr-item mark, .jb-sr-page mark { background: var(--amber-tint); color: inherit; border-radius: 3px; padding: 0 1px; }
.jb-sr-all { display: block; padding: 10px 16px 8px; border-top: 1px solid var(--line-soft); margin-top: 4px; font-weight: 600; color: var(--maroon-text); text-decoration: none; }
.jb-sr-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.jb-sr-page .jb-sr-group { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 0 10px; margin: 0; }
.jb-sr-page .jb-sr-group + .jb-sr-group { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 0; }
.jb-sr-more { display: inline-block; padding: 6px 16px 0; }

/* calendar items are buttons */
.jb-cal button.ev { width: 100%; border: 0; text-align: left; font: inherit; font-size: 12px; cursor: pointer; }
.jb-cal button.ev:hover { filter: brightness(.94); text-decoration: underline; }
.jb-more-ev { border: 0; background: none; padding: 0 2px; font: inherit; font-size: 12px; color: var(--maroon-text); cursor: pointer; }
.jb-cal-row { width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); background: none; font: inherit; color: inherit; cursor: pointer; }
.jb-cal-row:hover { background: var(--chip-soft); }
@media (max-width: 720px) { .jb-cal button.ev { font-size: 10px; } }

/* every overview card leads somewhere */
a.jb-kpi, button.jb-kpi, a.jb-cardlink, .jb-cardlink[data-href] { position: relative; text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
button.jb-kpi { font: inherit; text-align: left; width: 100%; }
a.jb-kpi:hover, button.jb-kpi:hover, a.jb-cardlink:hover, .jb-cardlink[data-href]:hover { border-color: var(--maroon); box-shadow: var(--shadow); transform: translateY(-1px); }
a.jb-kpi::after, button.jb-kpi::after { content: '›'; position: absolute; top: 10px; right: 14px; font-size: 20px; line-height: 1; color: var(--ink-4); transition: transform .15s, color .15s; }
a.jb-kpi:hover::after, button.jb-kpi:hover::after { color: var(--maroon-text); transform: translateX(2px); }
.jb-card.maroon.jb-cardlink { color: var(--on-maroon); } .jb-card.sage.jb-cardlink { color: var(--on-sage); }   /* beat the card-link color reset */
.jb-card.maroon.jb-cardlink:hover { border-color: transparent; box-shadow: 0 8px 22px rgba(101,11,9,.25); }
a.jb-kpi:focus-visible, button.jb-kpi:focus-visible, a.jb-cardlink:focus-visible { outline: 3px solid rgba(101,11,9,.35); outline-offset: 2px; }
@keyframes jb-flash { 0% { box-shadow: 0 0 0 0 rgba(101,11,9,.0); } 25% { box-shadow: 0 0 0 4px rgba(101,11,9,.28); } 100% { box-shadow: 0 0 0 0 rgba(101,11,9,0); } }
.jb-flash { animation: jb-flash 1.6s ease-out; scroll-margin-top: calc(var(--jb-head, 0px) + 16px); }
@media (prefers-reduced-motion: reduce) { a.jb-kpi, button.jb-kpi, .jb-cardlink { transition: none; } a.jb-kpi:hover, .jb-cardlink:hover { transform: none; } }

/* dashboard widgets and customize mode */
.jb-zone { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.jb-zone > .jb-w > * { width: 100%; }
.jb-bottom .jb-zone { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 22px; }
.jb-bottom .jb-w.wide { flex: 2 1 480px; min-width: 0; }
.jb-bottom .jb-w.narrow { flex: 1 1 280px; min-width: 0; }
.jb-dash.editing .jb-zone { min-height: 120px; padding: 8px; border: 2px dashed var(--sage-line); border-radius: var(--r-lg); background: rgba(238, 241, 234, .5); }
.jb-dash.editing .jb-zone.drop-over { border-color: var(--maroon); background: var(--maroon-wash); }
.jb-w.editing { background: #fff; border-radius: var(--r); box-shadow: 0 0 0 1px var(--line), var(--shadow); cursor: grab; }
.jb-w.editing.dragging { opacity: .45; }
.jb-w.editing.drop-before { box-shadow: 0 -4px 0 0 var(--maroon), 0 0 0 1px var(--line); }
.jb-wbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); background: var(--chip-soft); border-radius: var(--r) var(--r) 0 0; font-size: 13px; }
.jb-wbar .grip { color: var(--ink-4); font-size: 16px; cursor: grab; padding: 0 4px; }
.jb-wbar .jb-iconbtn { width: 32px; height: 32px; font-weight: 700; }
.jb-wbar select { width: auto; min-height: 32px; padding: 2px 6px; font-size: 13px; max-width: 150px; }
.jb-dropzone { border-radius: 10px; padding: 14px; text-align: center; color: var(--ink-4); font-size: 13px; }
.jb-bottom .jb-dropzone { flex: 1 1 200px; }
.jb-editbar { position: sticky; top: calc(var(--jb-head, 0px) + 8px); z-index: 20; box-shadow: var(--shadow); }
.jb-editbar span { flex: 1 1 260px; }
.jb-shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jb-shortcuts a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 600; text-align: center; }
.jb-shortcuts a:hover { border-color: var(--maroon); color: var(--maroon-text); }
.jb-shortcuts .jb-ico { color: var(--sage-text); }
.jb-wbar { flex-wrap: wrap; row-gap: 4px; }
.jb-wbar b { flex: 1 1 calc(100% - 30px); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-wbar .jb-iconbtn:first-of-type { margin-left: auto; }

/* admissions: board, builder, automations */
.jb-kanban { grid-auto-flow: row; overflow-x: auto; }
.jb-kanban .jb-lane { min-width: 210px; }
.jb-lane.drop-over { background: var(--maroon-wash); outline: 2px dashed var(--maroon); }
.jb-lane-drop { display: none; border: 2px dashed var(--line); border-radius: 10px; padding: 10px; text-align: center; color: var(--ink-4); font-size: 12px; }
.jb-lane.drop-over .jb-lane-drop { display: block; }
.jb-appcard[draggable="true"] { cursor: grab; }
.jb-appcard.dragging { opacity: .4; }
.jb-auto-chip { align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--amber-ink); background: var(--amber-tint); border-radius: 99px; padding: 2px 8px; text-decoration: none; }
.jb-stagebar { display: flex; flex-wrap: wrap; gap: 0; }
.jb-stagebar button { position: relative; border: 0; background: var(--chip); color: var(--ink-2); font: 600 13px var(--sans); padding: 9px 16px 9px 22px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); margin-right: -4px; }
.jb-stagebar button:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); padding-left: 14px; border-radius: 6px 0 0 6px; }
.jb-stagebar button:hover { filter: brightness(.95); }
.jb-stagebar button.on { background: var(--c); color: #fff; }
.jb-stagerow { flex-wrap: wrap; }
.jb-stagerow .grip { color: var(--ink-4); cursor: grab; font-size: 16px; }
.jb-stagerow.dragging { opacity: .4; }
.jb-autocard.off { opacity: .6; }
.jb-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.jb-flow > span { font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.jb-flow-when { background: var(--sage-mist); color: var(--sage-ink); font-weight: 600; }
.jb-flow-if { background: var(--amber-tint); color: var(--amber); }
.jb-flow-then { background: var(--chip-soft); border: 1px solid var(--line); }
.jb-flow-then b { color: var(--maroon-text); margin-right: 4px; }
.jb-flow > span + span::before { content: '→'; margin-right: 6px; color: var(--ink-4); }
.jb-flowstep { border-left: 4px solid var(--sage); padding: 4px 0 4px 14px; display: flex; flex-direction: column; gap: 8px; }
.jb-flowstep > b { font-family: var(--caps); letter-spacing: .12em; font-size: 13px; color: var(--sage-ink); }
.jb-flowstep.if { border-color: var(--amber-ink); } .jb-flowstep.if > b { color: var(--amber); }
.jb-flowstep.then { border-color: var(--maroon); } .jb-flowstep.then > b { color: var(--maroon-text); }
.jb-actioncard { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.jb-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.jb-switch input { width: 36px; height: 20px; accent-color: var(--sage); }

/* ---------- analytics (insights) ---------- */
.jb-ins-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.jb-ins-tile { gap: 4px !important; min-height: 118px; }
.jb-ins-tile .l { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5A5A5A; }
.jb-ins-tile .v { font-size: 30px !important; }
.jb-spark { width: 96px; height: 26px; margin-top: auto; }
.jb-delta { font-size: 12.5px; font-weight: 700; white-space: nowrap; padding: 2px 6px; border-radius: 6px; }
.jb-delta.good { color: #1D5C2B; background: #E2F0E1; } .jb-delta.bad { color: var(--maroon-text); background: var(--maroon-tint); } .jb-delta.flat { color: var(--ink-3); background: var(--chip); }
.jb-ins-card { min-width: 0; }
.jb-chart { position: relative; }
.jb-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.jb-chart .grid { stroke: #ECE8E0; stroke-width: 1; }
.jb-chart .ax { font: 11px var(--sans); fill: #6A6A6A; }
.jb-chart .ax.strong { font-weight: 700; fill: var(--ink); }
.jb-chart .lbl { font: 600 11.5px var(--sans); fill: var(--ink-2); }
.jb-chart .xhair { stroke: #8A8478; stroke-width: 1; stroke-dasharray: 3 3; }
.jb-chart .hit { fill: transparent; cursor: crosshair; }
.jb-tip { position: absolute; top: 34px; transform: translateX(12px); background: #1B1B1B; color: #fff; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; pointer-events: none; z-index: 5; min-width: 140px; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.jb-tip.flip { transform: translateX(calc(-100% - 12px)); }
.jb-tip div { display: flex; align-items: center; gap: 6px; justify-content: space-between; } .jb-tip div b { margin-left: auto; }
.jb-tip i, .jb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.jb-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin: 2px 0 6px; }
.jb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.jb-legend i { width: 14px; }
.jb-tableview { margin-top: 6px; font-size: 13px; } .jb-tableview summary { cursor: pointer; color: var(--ink-3); }
.jb-hbars { display: flex; flex-direction: column; gap: 9px; }
.jb-hbars .row { display: grid; grid-template-columns: minmax(82px, 30%) minmax(0, 1fr) auto; grid-template-areas: "lab track val" ". note note"; align-items: center; column-gap: 10px; font-size: 13.5px; }
.jb-hbars .lab { grid-area: lab; } .jb-hbars b { grid-area: val; text-align: right; } .jb-hbars .note { grid-area: note; font-size: 12px; }
.jb-hbars .track { grid-area: track; position: relative; height: 12px; background: #EFEFF2; border-radius: 99px; }
.jb-hbars .track > span { display: block; height: 100%; border-radius: 99px; }
.jb-hbars .track em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #6B6B6B; border-radius: 2px; }
.jb-segbar { display: flex; gap: 2px; height: 16px; border-radius: 99px; overflow: hidden; background: #EFEFF2; }
.jb-segbar span { display: block; height: 100%; }
.jb-act { align-items: flex-start; flex-wrap: nowrap; }
.jb-act-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--chip-soft); color: var(--ink-3); }
.sev-critical .jb-act-ico { background: var(--maroon-tint); color: var(--maroon-text); } .sev-warning .jb-act-ico { background: var(--amber-tint); color: var(--amber); }
.sev-good .jb-act-ico { background: #E2F0E1; color: #1D5C2B; } .sev-info .jb-act-ico { background: #E6EEF8; color: #2F6FB3; }
.jb-act .jb-btn { align-self: center; }
.jb-yoy td.cur, .jb-yoy th.cur { background: #F4F7FB; font-weight: 700; }
@media (max-width: 640px) { .jb-act { flex-wrap: wrap; } .jb-act .jb-btn { margin-left: 48px; } .jb-ins-tile .v { font-size: 24px !important; } }
@media print { .jb-ins-card, .jb-ins-tile { break-inside: avoid; } }

/* slide-out panel from the right (sheet({ side: 'right' })) */
.jb-scrim.right { justify-content: flex-end; align-items: stretch; padding: 0; }
.jb-sheet.jb-drawer { width: min(540px, 100%); max-height: none; height: calc(100vh / var(--zf, 1)); border-radius: 18px 0 0 18px; animation: jb-slide-in .22s cubic-bezier(.2, .9, .3, 1); }
.jb-sheet.jb-drawer .body { flex: 1 1 auto; }
@keyframes jb-slide-in { from { transform: translateX(100%); } }
@media (max-width: 640px) { .jb-sheet.jb-drawer { width: 100%; border-radius: 0; } }
@media (prefers-reduced-motion: reduce) { .jb-sheet.jb-drawer { animation: none; } }

/* visual sequence builder */
.vb { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .vb { grid-template-columns: 1fr; } }
.vb-side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: calc(var(--jb-head, 0px) + 12px); max-height: calc(100vh / var(--zf, 1) - var(--jb-head, 0px) - 24px); overflow-y: auto; padding-right: 4px; }
@media (max-width: 900px) { .vb-side { position: static; max-height: none; } }
.vb-side section { display: flex; flex-direction: column; gap: 8px; }
.vb-stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.vb-stage { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.vb-stage:hover { background: var(--chip-soft); }
.vb-stage.on { background: #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.vb-stage.drop-before { box-shadow: 0 -3px 0 0 var(--maroon); }
.vb-stage.dragging { opacity: .4; }
.vb-stage .grip { color: var(--ink-4); cursor: grab; font-size: 15px; width: 12px; }
.vb-stage b { display: block; font-size: 15px; }
.vb-stage .jb-muted { display: block; font-size: 12px; }
.vb-num { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; border: 2px solid var(--c, var(--sage)); color: var(--c, var(--sage)); background: #fff; position: relative; z-index: 1; }
.vb-stage.on .vb-num { background: var(--c, var(--sage)); color: #fff; }
.vb-num.start { --c: #4A5A78; margin-left: 22px; }
.vb-num.start .jb-ico { width: 16px; height: 16px; }
.vb-stage + .vb-stage::before { content: ''; position: absolute; left: 49px; top: -10px; height: 20px; border-left: 2px solid var(--line); }
.vb-stage:first-child + .vb-stage::before { left: 49px; }
.vb-count { font-size: 11px; font-weight: 700; color: var(--amber-ink); background: var(--amber-tint); border-radius: 99px; padding: 2px 7px; }
.vb-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 6px 0 0; }
.vb-palette, .vb-catalog { display: flex; flex-direction: column; gap: 6px; }
.vb-block { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: grab; text-align: left; font: inherit; color: var(--ink); }
.vb-block:hover { border-color: var(--maroon); }
.vb-block .jb-ico { width: 18px; height: 18px; flex: none; }
.vb-block.trig .jb-ico { color: #4A5A78; }
.vb-block.act .jb-ico { color: var(--maroon-text); }
.vb-block b { font-size: 13.5px; font-weight: 600; display: block; }
.vb-block .jb-muted { font-size: 12px; display: block; }
.vb-catalog .vb-block { cursor: pointer; padding: 12px 14px; }
.vb-canvas { min-width: 0; display: flex; flex-direction: column; gap: 18px; border-radius: var(--r-lg); padding: 4px; transition: background .15s; }
.vb-canvas.over, .vb-canvas.dragging-block { background: var(--sage-mist); outline: 2px dashed var(--sage-line); }
.vb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--c); color: #fff; padding: 14px 20px; border-radius: 12px; }
.vb-head b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.1; }
.vb-head-k { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.vb-head .jb-btn.light { color: var(--ink); }
.vb-auto { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 10px; }
.vb-auto.off { opacity: .6; }
.vb-trigger { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #EEF0F5; cursor: pointer; }
.vb-trigger:hover { box-shadow: 0 0 0 2px #4A5A78; }
.vb-trigger b { display: block; font-size: 16px; }
.vb-k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #4A5A78; }
.vb-if { display: inline-block; margin-top: 4px; font-size: 12.5px; background: var(--amber-tint); color: var(--amber); border-radius: 6px; padding: 2px 8px; }
.vb-name { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.vb-ico { width: 34px; height: 34px; border-radius: 50%; background: #4A5A78; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.vb-ico .jb-ico { width: 17px; height: 17px; }
.vb-steps { list-style: none; margin: 0; padding: 0 0 0 16px; position: relative; }
.vb-steps::before { content: ''; position: absolute; left: 32px; top: 0; bottom: 22px; border-left: 2px solid var(--line); }
.vb-step { position: relative; display: flex; align-items: center; gap: 12px; padding: 3px 0; }
.vb-step.dragging { opacity: .4; }
.vb-dot { width: 14px; height: 14px; margin-left: 10px; border-radius: 50%; border: 2px solid var(--maroon); background: #fff; flex: none; position: relative; z-index: 1; }
.vb-bar { flex: 1; display: flex; align-items: center; gap: 12px; background: var(--maroon); color: var(--on-maroon); border-radius: 10px; padding: 10px 14px; cursor: pointer; min-width: 0; }
.vb-bar:hover, .vb-bar:focus-visible { background: var(--maroon-ink); }
.vb-bar .grip { cursor: grab; opacity: .7; }
.vb-bar .jb-ico { color: var(--on-maroon); opacity: .85; }
.vb-bar b { display: block; font-size: 14.5px; }
.vb-bar span span { display: block; font-size: 13px; color: var(--on-maroon); opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-bar .jb-grow { min-width: 0; }
.vb-n { font-size: 12px; font-weight: 700; opacity: .7; }
.vb-drop { height: 6px; margin: 0 0 0 38px; border-radius: 6px; transition: height .12s, background .12s; }
.vb-canvas.dragging-block .vb-drop, .vb-canvas.dragging-step .vb-drop { height: 16px; background: repeating-linear-gradient(90deg, var(--sage-line) 0 8px, transparent 8px 14px); }
.vb-drop.over { height: 40px !important; background: var(--maroon-wash) !important; outline: 2px dashed var(--maroon); }
.vb-add { display: flex; align-items: center; gap: 10px; padding: 6px 0 0; }
.vb-plus { width: 34px; height: 34px; margin-left: 0; border-radius: 50%; border: 2px dashed var(--ink-4); background: #fff; color: var(--ink-3); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; z-index: 1; }
.vb-plus:hover { border-color: var(--maroon); color: var(--maroon-text); }
.vb-tools { display: flex; justify-content: flex-end; gap: 4px; border-top: 1px solid var(--line-soft); margin-top: 8px; padding-top: 6px; }
.vb-empty { background: #fff; border: 2px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; }
.vb-newauto { display: flex; justify-content: center; }

/* Templates & automations */
.jb-tplcard { cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s; }
.jb-tplcard:hover, .jb-tplcard:focus-visible { border-color: var(--sage-line); box-shadow: 0 2px 10px rgba(62, 91, 61, .10); }
.jb-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; margin: 0; }
.jb-seqcard { display: flex; flex-direction: column; gap: 6px; }
.jb-seqcard.off { opacity: .6; }
.jb-seqmap { display: flex; flex-direction: column; gap: 8px; }
.jb-seqlink { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.jb-seqnode { padding: 8px 12px; border-radius: 10px; background: var(--sage-mist); border: 1px solid var(--sage-line); font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-seqnode.to { background: var(--paper, #fff); }
.jb-seqarrow { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--ink-3); text-align: center; max-width: 200px; }
.jb-seqarrow span:last-child { color: var(--sage-text); font-weight: 600; }
.jb-qrow { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.jb-tplpick select { font-weight: 500; }
.jb-tplpick .jb-ico { width: 15px; height: 15px; vertical-align: -2px; }
@media (max-width: 560px) { .jb-seqlink { grid-template-columns: 1fr; } .jb-seqarrow { flex-direction: row; gap: 6px; max-width: none; } }
/* automation Wait steps: a pause in the flow, not an action */
.vb-step.wait .vb-bar { background: #FBF3E4; color: var(--ink); border: 1.5px dashed #B7791F; }
.vb-step.wait .vb-bar:hover, .vb-step.wait .vb-bar:focus-visible { background: #F6E7CB; }
.vb-step.wait .vb-bar .jb-ico { color: #B7791F; }
.vb-step.wait .vb-bar span span { color: var(--ink-2, #5b554b); }
.vb-step.wait .vb-dot { border-color: #B7791F; border-style: dashed; }
.vb-block.act[data-block="action:wait"] .jb-ico, .vb-block.act[data-pick="wait"] .jb-ico { color: #B7791F; }
.jb-wait-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: #FBF3E4; border: 1px dashed #B7791F; }

/* Custom labels: preview popover */
.lp-btn { white-space: nowrap; }
.lp-btn .jb-ico { width: 16px; height: 16px; }
.lp-pop { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px rgba(40, 30, 20, .2); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; animation: lp-in .14s ease-out; }
@keyframes lp-in { from { opacity: 0; transform: translateY(4px); } }
.lp-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.lp-head b { font-size: 15px; }
.lp-use { display: flex; flex-direction: column; gap: 5px; }
.lp-where { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sage-ink); }
.lp-where .jb-muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.lp-mock { font-size: 14px; }
.lp-mock mark { background: var(--amber-tint); color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 1px rgba(122, 82, 0, .25); }
.lp-menu { align-self: flex-start; background: var(--sage); color: var(--on-sage); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 13px; }
.lp-menu mark { background: #F1F4EE; color: var(--sage-ink); }
.lp-heading { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.15; }
.lp-card { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.lp-button { align-self: flex-start; background: var(--maroon); color: var(--on-maroon); border-radius: 8px; padding: 7px 14px; font-weight: 600; font-size: 13.5px; }
.lp-button mark { background: #fff; color: var(--maroon-text); }
.lp-line, .lp-table { border-bottom: 1px solid var(--line-soft); padding-bottom: 6px; }
.lp-table { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5A5A5A; }
.lp-was { font-size: 12px; color: var(--ink-4); text-decoration: line-through; }
.lp-foot { font-size: 12px; margin: 0; }

/* outside course content inside lessons (web/js/embeds.js) */
.jb-embed { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.jb-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Integrations */
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ig-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card, #fff); color: inherit; font: inherit; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.ig-card:hover, .ig-card:focus-visible { border-color: var(--ink-3, #999); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.ig-card p { margin: 0; }
.ig-cta { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--maroon-text); }
.ig-tile { flex: none; display: inline-grid; place-items: center; border-radius: 10px; background: var(--c); color: #fff; font-weight: 700; letter-spacing: .02em; }
.ig-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ig-flow > div { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); }
.ig-consent { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
@media (max-width: 560px) { .ig-flow { grid-template-columns: 1fr; } }
/* Templates assistant: docked beside the tabs on wide screens, stacked above them on narrow ones */
.jb-tplwrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.jb-tplwrap.ai-open { grid-template-columns: minmax(0, 1fr) 380px; }
.jb-ai { position: sticky; top: calc(var(--jb-head, 0px) + 16px); display: flex; flex-direction: column; gap: 10px; background: var(--paper, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 14px; max-height: calc(100vh / var(--zf, 1) - var(--jb-head, 0px) - 32px); min-height: 420px; box-shadow: 0 2px 14px rgba(40, 30, 20, .06); }
.jb-ai-head { display: flex; align-items: center; gap: 10px; }
.jb-ai-head b { display: inline-flex; align-items: center; gap: 6px; font-family: var(--serif, inherit); font-size: 19px; color: var(--maroon-text); }
.jb-ai-head .jb-small { margin-left: auto; }
.jb-ai-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; min-height: 0; }
.jb-ai-me { align-self: flex-end; max-width: 88%; background: var(--maroon); color: var(--on-maroon); border-radius: 14px 14px 4px 14px; padding: 8px 12px; white-space: pre-wrap; font-size: 14.5px; }
.jb-ai-it { align-self: flex-start; max-width: 100%; background: var(--sage-mist); border: 1px solid var(--sage-line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 14.5px; display: flex; flex-direction: column; gap: 8px; }
.jb-ai-it p { margin: 0; } .jb-ai-it ul, .jb-ai-it ol { margin: 0; padding-left: 20px; }
.jb-ai-it code { font-size: 13px; background: rgba(0, 0, 0, .05); padding: 0 4px; border-radius: 4px; }
.jb-ai-draft { background: var(--paper, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.jb-ai-draft ol, .jb-ai-draft ul { margin: 0; padding-left: 18px; }
.jb-ai-pre { white-space: pre-wrap; margin: 0; max-height: 140px; overflow: auto; }
.jb-ai-hello { display: flex; flex-direction: column; gap: 10px; color: var(--ink-2, #5b554b); font-size: 14.5px; }
.jb-ai-hello p { margin: 0; }
.jb-ai-starters { display: flex; flex-direction: column; gap: 6px; }
.jb-ai-starters .jb-chip { text-align: left; border: 1px solid var(--sage-line); background: var(--sage-mist); cursor: pointer; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; white-space: normal; }
.jb-ai-ask { display: flex; gap: 8px; align-items: flex-end; }
.jb-ai-ask textarea { flex: 1; resize: vertical; min-height: 44px; max-height: 160px; }
.jb-ai-typing { flex-direction: row; gap: 4px; padding: 12px 14px; }
.jb-ai-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); opacity: .4; animation: jb-ai-dot 1.2s infinite; }
.jb-ai-typing span:nth-child(2) { animation-delay: .2s; } .jb-ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes jb-ai-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 1099px) { .jb-tplwrap.ai-open { grid-template-columns: minmax(0, 1fr); } .jb-ai { position: static; order: -1; max-height: calc(70vh / var(--zf, 1)); } }
@media (prefers-reduced-motion: reduce) { .jb-ai-typing span { animation: none; opacity: .7; } }
/* Setup → Branding */
.jb-brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 20px; align-items: start; }
.jb-brand-preview-wrap { position: sticky; top: calc(var(--jb-head, 0px) + 16px); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { .jb-brand-grid { grid-template-columns: 1fr; } .jb-brand-preview-wrap { position: static; } }
.jb-brand-drop { width: 220px; height: 84px; border: 1px dashed var(--line); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; background: var(--paper); overflow: hidden; }
.jb-brand-drop img { max-width: 100%; max-height: 100%; object-fit: contain; }
.jb-brand-icon { width: 72px; height: 72px; border-radius: 18px; display: flex; align-items: center; justify-content: center; color: #fff; font: 600 26px Georgia, serif; overflow: hidden; flex: none; }
.jb-brand-icon img { width: 100%; height: 100%; object-fit: cover; }
.jb-brand-preview { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--paper); box-shadow: var(--shadow); font-family: var(--sans); color: var(--ink); }
.jb-brand-preview .pv-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--card); border-bottom: 3px solid var(--sage); }
.jb-brand-preview .pv-crest, .jb-brand-preview .pv-app { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font: 600 14px Georgia, serif; overflow: hidden; flex: none; }
.jb-brand-preview .pv-crest img, .jb-brand-preview .pv-app img { width: 100%; height: 100%; object-fit: cover; }
.jb-brand-preview .pv-crest { background: var(--crest-bg) !important; }
.jb-brand-preview .pv-crest img, .jb-crestfit .stage img { object-fit: contain; transform: translate(var(--crest-x, 0%), var(--crest-y, 0%)) scale(var(--crest-zoom, .71)); }
.jb-brand-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jb-undo { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--maroon-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; transition: background .15s, opacity .15s; }
.jb-undo:hover:not(:disabled) { background: var(--maroon-wash); }
.jb-undo:disabled { opacity: .35; cursor: default; color: var(--ink-3); }
.jb-brand-swatch { display: flex; align-items: center; gap: 8px; }
.jb-field .jb-brand-swatch input { height: 44px; min-height: 44px; box-sizing: border-box; margin: 0; }
.jb-field .jb-brand-swatch input[type=color] { width: 44px; padding: 3px; border-radius: var(--r-sm); cursor: pointer; flex: none; }
.jb-brand-swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.jb-brand-swatch input[type=color]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.jb-brand-swatch input[type=color]::-moz-color-swatch { border: 0; border-radius: 5px; }
.jb-field .jb-brand-swatch input[data-hex] { width: 110px; font-family: ui-monospace, monospace; }
.jb-brand-status { font-size: 14px; color: var(--ink-3); margin-right: 4px; }
.jb-brand-status.err { color: var(--maroon-text); font-weight: 600; }
.jb-brand-iconwrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.jb-brand-iconwrap .pair { display: flex; gap: 12px; align-items: center; }
.jb-brand-iconwrap button { border: 0; padding: 0; background: none; cursor: pointer; }
.jb-brand-iconwrap .round { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font: 600 26px Georgia, serif; background: var(--crest-bg); box-shadow: 0 0 0 1px var(--line); }
.jb-brand-iconwrap .round img { width: 100%; height: 100%; object-fit: contain; transform: translate(var(--crest-x, 0%), var(--crest-y, 0%)) scale(var(--crest-zoom, .71)); }
.jb-brand-iconwrap button:hover .round, .jb-brand-iconwrap button:focus-visible .round { box-shadow: 0 0 0 3px var(--maroon-line); }
.jb-brand-iconbtns { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.jb-brand-iconbtns .jb-link, .jb-brand-logobtns .jb-link { background: none; border: 0; padding: 0; cursor: pointer; }
.jb-brand-logobtns { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.jb-crestfit { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.jb-crestfit .stage { width: 240px; height: 240px; border-radius: 50%; overflow: hidden; position: relative; background: var(--crest-bg); cursor: grab; touch-action: none; box-shadow: 0 0 0 1px var(--line), 0 6px 24px rgba(0,0,0,.12); user-select: none; }
.jb-crestfit .stage.drag { cursor: grabbing; }
.jb-crestfit .stage img { width: 100%; height: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.jb-crestfit .sizes { display: flex; gap: 18px; align-items: center; }
.jb-crestfit .sizes span { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: var(--crest-bg); display: block; }
.jb-crestfit .sizes span.sm { width: 32px; height: 32px; }
.jb-crestfit .sizes img { width: 100%; height: 100%; display: block; object-fit: contain; transform: translate(var(--crest-x, 0%), var(--crest-y, 0%)) scale(var(--crest-zoom, .71)); }
.jb-crestfit .zoom { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 320px; }
.jb-crestfit .zoom input[type=range] { flex: 1; accent-color: var(--maroon); }
.jb-crestfit .zoom button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink); }
.jb-crestfit .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.jb-brand-preview .pv-logo { height: 36px; max-width: 220px; object-fit: contain; }
.jb-brand-preview .pv-name { font-family: var(--serif); font-size: 20px; color: var(--maroon-text); }
.jb-brand-preview .pv-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.jb-brand-preview .pv-eyebrow { font-family: var(--caps); letter-spacing: .12em; text-transform: uppercase; font-size: 11px; color: var(--sage-text); margin: 0; }
.jb-brand-preview .pv-h { font-family: var(--serif); font-size: 26px; color: var(--maroon-text); margin: 0; font-weight: 600; }
.jb-brand-preview .pv-h2 { font-family: var(--serif); font-size: 18px; }
.jb-brand-preview .pv-p { margin: 0; color: var(--ink-2); }
.jb-brand-preview .pv-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.jb-brand-preview .pv-btn { background: var(--maroon); color: var(--on-maroon); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.jb-brand-preview .pv-ghost { border: 1px solid var(--maroon-line); color: var(--maroon-text); padding: 7px 13px; border-radius: 999px; font-size: 14px; }
.jb-brand-preview .pv-pill { background: var(--sage-tint); color: var(--sage-ink); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.jb-brand-preview .pv-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent, var(--sage)); border-radius: var(--r-sm); padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jb-brand-preview .pv-link { color: var(--maroon-text); font-size: 14px; }
.jb-brand-preview .pv-phone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; background: var(--sage-mist); border-top: 1px solid var(--line-soft); }
.jb-brand-preview .pv-app { width: 56px; height: 56px; border-radius: 14px; font-size: 20px; }

/* Docked assistant (Course builder): the Templates assistant's chat (.jb-ai-*) in a drawer that leaves the page usable */
.jb-aipanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); z-index: 48; background: var(--card); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(40, 30, 20, .08); animation: jb-slide-in .22s cubic-bezier(.2, .9, .3, 1); height: calc(100vh / var(--zf, 1)); }
.jb-aipanel .jb-ai { position: static; height: 100%; max-height: none; min-height: 0; border: 0; border-radius: 0; box-sizing: border-box; }
.jb-ai-draft .jb-row-between { gap: 8px; }
.jb-ico.flip { transform: rotate(180deg); }
body.jb-ai-open .cb-app { right: min(400px, 100%); }
@media (max-width: 900px) { body.jb-ai-open .cb-app { right: 0; } }
/* free media library */
.jb-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.jb-media { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; padding: 0; background: var(--chip-soft); cursor: pointer; aspect-ratio: 4 / 3; display: block; font: inherit; }
.jb-media img { width: 100%; height: 100%; object-fit: cover; display: block; } .jb-media:hover { box-shadow: 0 0 0 2px var(--sage); }
.jb-media-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-media-tag { position: absolute; top: 6px; left: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; display: inline-flex; gap: 3px; align-items: center; } .jb-media-tag .jb-ico { width: 11px; height: 11px; fill: #fff; stroke: none; }
.jb-media-audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; padding: 10px; text-align: center; font-size: 13px; } .jb-media-audio .jb-ico { width: 26px; height: 26px; color: var(--sage-text); }
/* Compendium-wide announcement (platform console → every school) */
.jb-platform-banner { display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--sage-mist); color: var(--ink); border-bottom: 1px solid var(--sage-line); font-size: 14px; line-height: 1.35; }
.jb-platform-banner.warn { background: #FFF4D6; border-color: #E8CF8A; }
.jb-platform-banner .jb-ico { flex: none; width: 18px; height: 18px; }
.jb-platform-banner span { flex: 1; } .jb-platform-banner a { color: inherit; font-weight: 600; }
.jb-platform-banner button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 2px 6px; }
.jb-compendium { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: Cinzel, Georgia, serif; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: #3A3A3A; }
.jb-compendium i { width: 36px; height: 36px; border-radius: 9px; background: #2B2B2B; color: #fff; display: inline-grid; place-items: center; font-style: normal; font-family: 'Crimson Text', Georgia, serif; font-size: 23px; letter-spacing: 0; }

/* every table: sticky header + click-to-sort (web/js/tables.js) */
table.tb-on thead th { position: relative; z-index: 2; background: var(--card, #fff); }
table.tb-on.jb-gb thead th:first-child { z-index: 3; }
table.tb-stuck thead th { box-shadow: 0 1px 0 var(--line), 0 6px 8px -6px rgba(40, 30, 20, .18); }
th.tb-sort { cursor: pointer; user-select: none; }
th.tb-sort:hover { color: var(--ink); }
th.tb-sort:focus-visible { outline: 2px solid var(--sage); outline-offset: -2px; }
th.tb-sort::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0; transition: opacity .15s; }
th.tb-sort:hover::after { opacity: .35; }
th.tb-asc::after { border-top: 0; border-bottom: 5px solid currentColor; opacity: 1; }
th.tb-desc::after { opacity: 1; }
th.tb-asc, th.tb-desc { color: var(--ink); }
@media print { table.tb-on thead th { transform: none !important; box-shadow: none !important; } th.tb-sort::after { display: none; } }

/* In-page side lists (Reports list, section menus) stay in view beside long content; they scroll on their own if taller than the screen */
.jb-cols > nav.jb-card, .jb-sidenav { position: sticky; top: calc(var(--jb-head, 0px) + 16px); max-height: calc(100vh / var(--zf, 1) - var(--jb-head, 0px) - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
@media (max-width: 760px) { .jb-cols > nav.jb-card, .jb-sidenav { position: static; max-height: none; } }

/* generated documents (receipts, invoices, reports…) previewed in a panel; web/js/documents.js */
.jb-docbody { padding: 0 !important; background: #e9e7e2; }
.jb-docframe { width: 100%; border: 0; display: block; background: #e9e7e2; min-height: 420px; }
.jb-emailframe { width: 100%; border: 1px solid var(--line); border-radius: var(--r); display: block; background: #f1eee8; min-height: 420px; }

/* ---------------------------------------------------------------- feature switches (web/js/feature-panel.js) */
.ft { display: flex; flex-direction: column; gap: 18px; }
.ft-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ft-q { flex: 1 1 180px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); }
.ft-count { white-space: nowrap; }
.ft-group { display: flex; flex-direction: column; gap: 2px; }
.ft-group > .jb-small { margin: 0 0 6px; }
.ft-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; border-top: 1px solid var(--line-soft); }
.ft-row.off .ft-name b { color: var(--ink-3); }
.ft-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ft-name { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ft-roles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); }
.ft-roles span { padding: 2px 8px; border-radius: 999px; background: var(--chip-soft); border: 1px solid var(--line-soft); }
.ft-roles em { font-style: normal; color: var(--ink-4); }
.ft-switch { flex: 0 0 auto; width: 44px; height: 26px; border-radius: 999px; border: 0; padding: 3px; background: #CFC9BE; cursor: pointer; position: relative; transition: background .15s; margin-top: 1px; }
.ft-switch i { display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.ft-switch[aria-checked="true"] { background: var(--sage); }
.ft-switch[aria-checked="true"] i { transform: translateX(18px); }
.ft-switch:disabled { opacity: .45; cursor: not-allowed; }
.ft-switch:focus-visible, .ft-i:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
.ft-i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--ink-4); background: transparent; color: var(--ink-3); font: italic 600 12px/1 Georgia, serif; cursor: help; padding: 0; flex: 0 0 auto; }
.ft-i[aria-expanded="true"] { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }
.ft-pop { position: fixed; z-index: 1000; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 14px 16px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.ft-pop b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.ft-pop p { margin: 6px 0 0; }
.ft-pop .k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); }
.ft-pop .r { color: var(--ink-4); font-size: 12px; }
.ft-also ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 600px) { .ft-bar .jb-seg { width: 100%; } }
.ft-roles em.miss { color: var(--amber); font-weight: 600; }
/* Branding → font chooser: each font is listed in its own typeface */
.jb-fontpick { position: relative; }
.jb-fontpick-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #D5CFC2; border-radius: var(--r-sm); background: #fff; color: var(--ink, #1F1A17); font-size: 18px; text-align: left; cursor: pointer; }
.jb-fontpick-btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-fontpick-btn svg { flex: none; opacity: .6; }
.jb-fontpick-btn[aria-expanded=true] { border-color: var(--maroon-text); }
.jb-fontpick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid #D5CFC2; border-radius: var(--r-sm); box-shadow: 0 10px 28px rgba(31,26,23,.16); max-height: min(360px, 60vh); overflow-y: auto; }
.jb-fontpick-list li { padding: 9px 12px 9px 30px; border-radius: 6px; font-size: 19px; line-height: 1.25; color: var(--ink, #1F1A17); cursor: pointer; position: relative; outline: none; }
.jb-fontpick-list li:hover, .jb-fontpick-list li:focus { background: #F2EEE6; }
.jb-fontpick-list li[aria-selected=true]::before { content: '✓'; position: absolute; left: 10px; font-family: system-ui, sans-serif; font-size: 15px; top: 50%; transform: translateY(-50%); color: var(--maroon-text); }
.jb-fontpick-list.up { top: auto; bottom: calc(100% + 4px); }


/* ------------------------------------------------------------------ Messages: an email-style inbox (gm-*) */
.gm { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 18px; align-items: start; }
.gm-side { position: sticky; top: calc(var(--jb-head, 0px) + 12px); display: flex; flex-direction: column; gap: 14px; }
.gm-compose { display: flex; align-items: center; justify-content: center; gap: 10px; align-self: stretch; margin-left: -16px; min-height: 46px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--maroon-tint); color: var(--maroon-ink); font: 600 15px var(--sans); cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); transition: box-shadow .15s; }
.gm-compose:hover { box-shadow: 0 2px 6px rgba(0,0,0,.16); }
.gm-compose .jb-ico { width: 22px; height: 22px; }
.gm-folders { display: flex; flex-direction: column; }
.gm-folders a { display: flex; align-items: center; gap: 14px; min-height: 34px; padding: 0 14px 0 16px; border-radius: 0 999px 999px 0; margin-left: -16px; padding-left: 32px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.gm-folders a:hover { background: var(--chip-soft); }
.gm-folders a[aria-current="page"] { background: var(--maroon-tint); color: var(--maroon-ink); font-weight: 700; }
.gm-folders a span { flex: 1; }
.gm-folders .jb-ico { width: 19px; height: 19px; }
.gm-n { font-size: 12px; font-weight: 700; }
.gm-main { background: #fff; border: 1px solid var(--line); border-radius: 16px; min-height: 420px; overflow: hidden; }
.gm-search { display: flex; align-items: center; gap: 10px; margin: 12px 12px 4px; padding: 0 14px; min-height: 46px; border-radius: 999px; background: var(--chip-soft); }
.gm-search:focus-within { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.gm-search input { flex: 1; border: 0; background: transparent; font: 15px var(--sans); outline: none; min-height: 44px; }
.gm-search .jb-ico { width: 18px; height: 18px; color: var(--ink-3); }
.gm-bar { display: flex; align-items: center; gap: 2px; min-height: 48px; padding: 0 10px; border-bottom: 1px solid var(--line-soft); }
.gm-count { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--ink-3); }
.gm-selnote { font-size: 13px; color: var(--ink-3); margin-left: 8px; }
.gm-ib { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.gm-ib:hover { background: var(--chip); color: var(--ink); }
.gm-ib.off { opacity: .35; pointer-events: none; }
.gm-ib .jb-ico { width: 18px; height: 18px; }
.gm-check { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.gm-check input { width: 16px; height: 16px; accent-color: var(--maroon); cursor: pointer; }
.gm-row { position: relative; display: grid; grid-template-columns: 36px 30px minmax(120px, 210px) minmax(0, 1fr) 84px; grid-template-areas: "check star from text date"; align-items: center; gap: 0 6px; min-height: 42px; padding: 0 12px 0 10px; border-bottom: 1px solid var(--line-soft); background: var(--chip-soft); font-size: 14px; }
.gm-row.unread { background: #fff; }
.gm-row.unread .gm-from, .gm-row.unread .gm-subj, .gm-row.unread .gm-date { font-weight: 700; color: var(--ink); }
.gm-row:hover { box-shadow: inset 1px 0 0 var(--line), inset -1px 0 0 var(--line), 0 1px 3px rgba(40,40,60,.18); z-index: 1; }
.gm-row.sel { background: var(--maroon-wash); }
.gm-link { position: absolute; inset: 0; z-index: 0; }
.gm-link:focus-visible { outline: 2px solid var(--maroon); outline-offset: -2px; }
.gm-row > .gm-check, .gm-row > .gm-star, .gm-row > .gm-hover { position: relative; z-index: 2; }
.gm-row > .gm-check { grid-area: check; } .gm-row > .gm-star { grid-area: star; }
.gm-av { display: none; width: 40px; height: 40px; border-radius: 50%; background: var(--sage-tint); color: var(--sage-ink); align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.gm-av.sm { display: inline-flex; width: 28px; height: 28px; font-size: 11px; }
.gm-av .jb-ico { width: 18px; height: 18px; }
.gm-star { width: 30px; height: 30px; border: 0; background: transparent; color: #B9B9C0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; }
.gm-star:hover { color: var(--ink-3); background: var(--chip); }
.gm-star.on { color: #E3A200; } .gm-star.on .jb-ico { fill: #F6C33B; }
.gm-star .jb-ico { width: 18px; height: 18px; }
.gm-from { grid-area: from; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gm-n2 { color: var(--ink-4); font-weight: 400; font-size: 12px; margin-left: 5px; }
.gm-text { grid-area: text; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gm-subj { color: var(--ink-2); }
.gm-snip { color: var(--ink-3); }
.gm-date { grid-area: date; text-align: right; font-size: 12px; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
.gm-hover { grid-area: date; justify-self: end; display: none; gap: 0; background: inherit; }
.gm-row:hover .gm-hover, .gm-row:focus-within .gm-hover { display: inline-flex; }
.gm-row:hover .gm-date, .gm-row:focus-within .gm-date { visibility: hidden; }
.gm-rows .jb-empty { margin: 40px auto; }

.gm-read { padding: 6px 24px 26px 24px; }
.gm-subjrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0 10px 52px; }
.gm-h2 { font: 400 23px var(--sans); color: var(--ink); }
.gm-tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--chip); color: var(--ink-2); }
.gm-msgs { display: flex; flex-direction: column; }
.gm-m { border-bottom: 1px solid var(--line-soft); }
.gm-mh { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0 10px; cursor: pointer; }
.gm-mh .gm-av { display: inline-flex; }
.gm-mwho { flex: 1; min-width: 0; }
.gm-mwho b { font-size: 14px; }
.gm-me { color: var(--ink-3); font-size: 13px; }
.gm-to { font-size: 12px; color: var(--ink-3); }
.gm-snip1 { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-m.open .gm-snip1 { display: none; } .gm-m:not(.open) .gm-to { display: none; }
.gm-when { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.gm-body { display: none; padding: 2px 0 20px 52px; white-space: pre-wrap; font-size: 15px; line-height: 1.55; color: var(--ink); }
.gm-m.open .gm-body { display: block; }
.gm-more { align-self: flex-start; margin: 6px 0 6px 52px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 14px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.gm-more span { font-weight: 700; }
.gm-receipt { text-align: right; font-size: 12px; color: var(--sage-text); margin-top: 8px; }
.gm-replybtn { margin: 18px 0 0 52px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 22px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font: 600 14px var(--sans); cursor: pointer; }
.gm-replybtn:hover { background: var(--chip-soft); }
.gm-replybtn .jb-ico, .gm-ed-to .jb-ico { width: 16px; height: 16px; }
.gm-editor { margin: 18px 0 0 52px; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.2); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.gm-ed-to { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.gm-editor textarea { border: 0; min-height: 140px; resize: vertical; font: 15px var(--sans); outline: none; padding: 4px 0; }
.gm-ed-foot { display: flex; align-items: center; gap: 12px; }
.gm-ed-foot .gm-ib { margin-left: auto; }

/* compact "start from a template" row inside the compose window, reply box and text composer */
.gm-wform .jb-tplpick .jb-field, .gm-editor .jb-tplpick .jb-field, .tx-compose .jb-tplpick .jb-field { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.gm-wform .jb-tplpick .jb-field > span, .gm-editor .jb-tplpick .jb-field > span, .tx-compose .jb-tplpick .jb-field > span { font-weight: 500; color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.gm-wform .jb-tplpick select, .gm-editor .jb-tplpick select, .tx-compose .jb-tplpick select { width: auto; max-width: 280px; min-height: 32px; font-size: 13px; padding: 2px 28px 2px 10px; }

/* compose: floating window bottom-right */
.gm-win { position: fixed; right: 24px; bottom: 0; z-index: 55; width: min(560px, calc(100vw / var(--zf, 1) - 32px)); max-height: calc(88vh / var(--zf, 1)); display: flex; flex-direction: column; background: #fff; border-radius: 12px 12px 0 0; box-shadow: 0 8px 30px rgba(0,0,0,.28); overflow: hidden; }
.gm-win > header { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 16px; background: var(--chip); }
.gm-win > header b { font-size: 14px; cursor: pointer; flex: 1; }
.gm-wb { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.gm-wb:hover { background: rgba(0,0,0,.07); } .gm-wb .jb-ico { width: 16px; height: 16px; }
.gm-win.min .gm-wform { display: none; }
.gm-wform { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: auto; padding: 0 16px; position: relative; }
.gm-torow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line-soft); padding: 6px 0; min-height: 40px; }
.gm-lab { font-size: 14px; color: var(--ink-3); }
.gm-torow input { flex: 1; min-width: 120px; border: 0; outline: none; font: 14px var(--sans); min-height: 28px; }
.gm-chips { display: contents; }
.gm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--chip); font-size: 13px; }
.gm-chip button { border: 0; background: transparent; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.gm-chip .jb-ico { width: 12px; height: 12px; }
.gm-linkbtn { border: 0; background: none; color: var(--maroon-text); font: 600 13px var(--sans); cursor: pointer; padding: 2px 4px; }
.gm-sug { position: absolute; left: 12px; right: 12px; top: 42px; z-index: 3; background: #fff; border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.2); padding: 4px 0; max-height: 280px; overflow: auto; }
.gm-sug button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 7px 12px; text-align: left; font: 14px var(--sans); cursor: pointer; }
.gm-sug button[aria-selected="true"], .gm-sug button:hover { background: var(--chip-soft); }
.gm-classrow { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.gm-classrow select { flex: 1; min-width: 160px; min-height: 36px; }
.gm-subjin { border: 0; border-bottom: 1px solid var(--line-soft); outline: none; font: 14px var(--sans); min-height: 40px; }
.gm-wform .jb-tplpick { padding-top: 8px; }
.gm-wbody { flex: 1; }
.gm-wbody textarea { border: 0; outline: none; min-height: 220px; resize: none; font: 15px var(--sans); padding: 10px 0; }
.gm-wform footer { position: sticky; bottom: 0; background: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 0 14px; }
.gm-wform footer .gm-ib { margin-left: auto; }

@media (max-width: 760px) {
  .gm { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gm-side { position: static; }
  .gm-compose { position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 25; min-height: 52px; padding: 0 20px 0 16px; margin: 0; border-radius: 16px; box-shadow: 0 3px 10px rgba(0,0,0,.22); }
  .gm.reading .gm-compose { display: none; }
  .gm-folders { flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .gm-folders a { margin: 0; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; flex: none; gap: 8px; }
  .gm-folders a[aria-current="page"] { border-color: transparent; }
  .gm-folders .jb-ico { width: 16px; height: 16px; }
  .gm-main { border: 0; border-radius: 0; margin: 0 -16px; min-height: 0; }
  .gm-search { margin: 4px 12px 6px; }
  .gm-row { grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "av from date" "av text star"; padding: 10px 14px; background: #fff; gap: 2px 8px; align-items: start; }
  .gm-row:hover { box-shadow: none; }
  .gm-row > .gm-check, .gm-hover { display: none !important; }
  .gm-row:hover .gm-date { visibility: visible; }
  .gm-row .gm-av { display: inline-flex; grid-area: av; }
  .gm-from { font-size: 15px; } .gm-row:not(.unread) .gm-from { color: var(--ink-2); }
  .gm-text { display: flex; flex-direction: column; white-space: normal; }
  .gm-text > *, .gm-from { min-width: 0; max-width: 100%; }
  .gm-subj, .gm-snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gm-dash { display: none; }
  .gm-row > .gm-star { justify-self: end; align-self: end; }
  .gm-read { padding: 4px 16px 24px; }
  .gm-subjrow, .gm-body { padding-left: 0; }
  .gm-more, .gm-replybtn, .gm-editor { margin-left: 0; }
  .gm-when .gm-rel { display: none; }
  .gm-win { right: 0; left: 0; top: 0; width: auto; max-height: none; border-radius: 0; }
}

/* ------------------------------------------------------------------ Texts (tx-*) */
.tx-tabs { align-self: flex-start; }
.tx-tabs a { min-height: 34px; padding: 0 14px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; color: #454545; font-weight: 600; font-size: 13px; text-decoration: none; }
.tx-tabs a[aria-pressed="true"] { background: #fff; color: var(--maroon-text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tx-note { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); background: var(--chip-soft); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; }
.tx-note.warn { background: var(--amber-tint); color: var(--amber); border-color: transparent; margin: 12px 0 0; }
.tx-note .jb-ico { width: 18px; height: 18px; flex: none; }
.tx { display: grid; grid-template-columns: 340px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-height: 520px; background: #fff; }
.tx-list { border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; min-width: 0; }
#convs { overflow: auto; flex: 1; max-height: calc(70vh / var(--zf, 1)); }
.tx-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line-soft); }
.tx-row .gm-av { display: inline-flex; }
.tx-row:hover { background: var(--chip-soft); }
.tx-row[aria-current="page"] { background: var(--maroon-wash); }
.tx-rmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tx-rtop { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.tx-rtop .jb-muted { font-size: 12px; white-space: nowrap; }
.tx-rlast { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-row.unread .tx-rlast { color: var(--ink); font-weight: 600; }
.tx-row .gm-n { background: var(--maroon); color: var(--on-maroon); border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.tx-out { align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--amber); background: var(--amber-tint); border-radius: 4px; padding: 0 6px; }
.tx-conv { display: flex; flex-direction: column; min-width: 0; padding: 0 0 14px; }
.tx-conv > .jb-empty { margin: auto; }
.tx-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.tx-head .gm-av { display: inline-flex; }
.tx-head .tx-mail { margin-left: auto; }
.tx-back { display: none; }
.tx-msgs { flex: 1; overflow: auto; max-height: calc(56vh / var(--zf, 1)); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.tx-b { display: flex; flex-direction: column; max-width: 75%; }
.tx-b.out { align-self: flex-end; align-items: flex-end; }
.tx-bubble { padding: 9px 14px; border-radius: 18px; background: var(--chip); white-space: pre-wrap; font-size: 15px; line-height: 1.4; }
.tx-b.out .tx-bubble { background: var(--sage); color: var(--on-sage); border-bottom-right-radius: 6px; }
.tx-b.in .tx-bubble { border-bottom-left-radius: 6px; }
.tx-meta { font-size: 11px; color: var(--ink-4); margin: 3px 6px 0; }
.tx-compose { margin: 0 18px; border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.tx-compose textarea { border: 0; outline: none; resize: vertical; min-height: 54px; font: 15px var(--sans); }
.tx-cfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tx-conv > .tx-note { margin: 12px 18px 0; }
.tx-pick { max-height: 300px; overflow: auto; overscroll-behavior: contain; padding: 6px 12px; flex-shrink: 0; }
.tx-pick .jb-kind { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 2px; }
.tx-pick .jb-check { padding: 4px 0; }
@media (max-width: 760px) {
  .tx { grid-template-columns: 1fr; border: 0; border-radius: 0; margin: 0 -16px; }
  .tx.reading .tx-list, .tx:not(.reading) .tx-conv { display: none; }
  .tx-back { display: inline-flex; }
  .tx-head .tx-mail { display: none; }
  .tx-msgs { max-height: none; }
  #convs { max-height: none; }
}
/* ---------------------------------------------------------------- Media (web/js/pages/media.js) */
.md-tools { flex-wrap: wrap; justify-content: flex-end; }
.md-search { min-width: 240px; }
.md-new { position: relative; }
.md-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; }
.md-menu button { display: grid; grid-template-columns: 24px 1fr; column-gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 10px; cursor: pointer; font: inherit; font-weight: 600; color: var(--ink); }
.md-menu button span { grid-column: 2; font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.md-menu button:hover, .md-menu button:focus-visible { background: var(--chip-soft); outline: none; }
.md-menu .jb-ico { color: var(--maroon-text); }
.md-wrap { flex-wrap: nowrap; }
.md-side { flex: 0 0 250px; padding: 14px 10px; }
.md-main { flex: 1 1 auto; position: relative; min-height: 420px; }
.md-side-h { font-family: var(--caps); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 4px 10px 6px; }
.md-side-h:not(:first-child) { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.md-node { display: flex; align-items: center; padding-left: calc(var(--d) * 14px); }
.md-twist { flex: 0 0 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; border-radius: 4px; color: var(--ink-3); cursor: pointer; }
.md-twist .jb-ico { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform .15s; }
.md-twist[aria-expanded="true"] .jb-ico { transform: none; }
.md-twist:hover { background: var(--chip); }
.md-node a, .md-types button { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.md-types button { width: 100%; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.md-node a .jb-ico, .md-types .jb-ico { width: 17px; height: 17px; flex: 0 0 17px; color: var(--ink-4); }
.md-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-ct { font-size: 12px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.md-node a:hover, .md-types button:hover { background: var(--chip-soft); }
.md-node a[aria-current="page"], .md-types button[aria-pressed="true"] { background: var(--maroon-wash); color: var(--maroon-text); font-weight: 600; }
.md-node a[aria-current="page"] .jb-ico, .md-types button[aria-pressed="true"] .jb-ico { color: var(--maroon-text); }
.md-over { outline: 2px dashed var(--maroon); outline-offset: -2px; background: var(--maroon-wash) !important; }
.md-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.md-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.md-crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.md-crumbs a:hover { background: var(--chip-soft); color: var(--ink); }
.md-crumbs a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.md-crumbs span { color: var(--ink-4); }
.md-crumbs .jb-ico { width: 17px; height: 17px; }
.md-selbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--maroon-wash); }
.md-h { font-size: 13px; font-weight: 700; color: var(--ink-3); margin: 4px 0 10px; }
.md-h + .md-folders, .md-h + .md-grid { margin-bottom: 22px; }
.md-count { margin: 0 0 12px; }
.md-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.md-folder { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--card); transition: border-color .15s, box-shadow .15s; }
.md-folder:hover { border-color: #CDB9B8; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.md-folder b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-folder .jb-muted { font-size: 12.5px; display: block; }
.md-folder .md-aud { display: inline-block; margin-top: 4px; }
.md-typesel { display: none; }
.md-fico { flex: 0 0 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--maroon-wash); color: var(--maroon-text); }
.md-fico .jb-ico { width: 22px; height: 22px; }
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.md-card { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; text-align: left; font: inherit; color: var(--ink); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.md-card:hover { border-color: #CDB9B8; box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.md-card:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
.md-thumb { display: block; aspect-ratio: 4 / 3; background: var(--chip-soft); border-bottom: 1px solid var(--line-soft); overflow: hidden; }
.md-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.md-art { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--k); background: color-mix(in srgb, var(--k) 8%, #fff); }
.md-glyph { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.md-art b { font-size: 11px; letter-spacing: .08em; padding: 3px 7px; border-radius: 4px; background: var(--k); color: #fff; }
.md-play { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--k); color: #fff; display: flex; align-items: center; justify-content: center; }
.md-play .jb-ico { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.md-cap { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; min-width: 0; }
.md-cap b { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.md-cap .jb-muted { font-size: 12px; }
.md-path { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.md-path .jb-ico { width: 13px; height: 13px; flex: 0 0 13px; }
.md-aud { align-self: flex-start; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--chip); color: var(--ink-3); }
.md-tbl .md-name { display: inline-flex; align-items: center; gap: 10px; }
.md-mini { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--k); background: color-mix(in srgb, var(--k) 12%, #fff); }
.md-mini .jb-ico { width: 16px; height: 16px; }
.md-mini-f { --k: var(--maroon); }
.md-mini svg.jb-ico { fill: none; stroke: currentColor; }
.md-tbl .md-ck { width: 36px; }
.md-tbl input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--maroon); }
.md-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 60px 16px; color: var(--ink-3); }
.md-empty .md-glyph { color: var(--ink-4); width: 52px; height: 52px; }
.md-empty b { color: var(--ink); font-size: 16px; }
.md-drop { position: absolute; inset: 0; z-index: 5; border-radius: inherit; background: color-mix(in srgb, var(--maroon) 7%, rgba(255,255,255,.92)); border: 2px dashed var(--maroon); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.md-drop > div { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--maroon-text); }
.md-drop .jb-ico { width: 36px; height: 36px; }
.md-drop b { font-size: 18px; }
.md-uploads { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(340px, calc(100% - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.16); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.md-up { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.md-up .jb-grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-up .jb-meter { flex: 1 0 100%; }
.md-up.ok .md-pct { color: var(--sage-ink); font-weight: 600; } .md-up.bad .md-pct { color: var(--maroon-text); font-weight: 600; }
.md-note { margin: -4px 0 10px; }
.md-danger { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.md-danger p { margin: 4px 0 10px; }
.jb-sheet.md-sheet { width: min(880px, 100%); }
.md-pv { border-radius: 12px; overflow: hidden; background: var(--chip-soft); margin-bottom: 14px; }
.md-pv-img { display: flex; align-items: center; justify-content: center; background: #1b1b1b; max-height: 70vh; }
.md-pv-img img { max-width: 100%; max-height: 70vh; display: block; }
.md-pv-media { width: 100%; max-height: 70vh; display: block; background: #000; }
.md-pv-pdf { width: 100%; height: calc(70vh / var(--zf, 1)); border: 0; display: block; background: #fff; }
.md-pv-none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--k); background: color-mix(in srgb, var(--k) 7%, #fff); }
.md-pv-none .md-glyph { width: 64px; height: 64px; }
.md-pv-none b { font-size: 12px; letter-spacing: .08em; padding: 3px 8px; border-radius: 4px; background: var(--k); color: #fff; }
.md-pv-none span { color: var(--ink-3); max-width: 360px; }
.md-pv-none audio { width: min(420px, 100%); }
.md-pv-text { max-height: 60vh; overflow: auto; background: #fff; padding: 12px; }
.md-pv-text pre { margin: 0; white-space: pre-wrap; font-size: 13px; }
.md-pv .jb-embed { margin: 0; }
.md-pv-acts { flex-wrap: wrap; margin-bottom: 16px; }
.md-desc { margin: 0 0 14px; color: var(--ink-2); }
.md-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.md-dl dt { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.md-dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .md-wrap { flex-wrap: wrap; }
  .md-side { display: none; }
  .md-typesel { display: block; min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; background: #fff; font: inherit; }
  .md-tools { width: 100%; justify-content: flex-start; }
  .md-search { min-width: 0; flex: 1 1 100%; }
  .md-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .md-folders { grid-template-columns: 1fr; }
}

/* resizable columns (web/js/tables.js): a divider at each heading's right edge */
th.tb-rs { position: relative; }
.tb-grip { position: absolute; top: 0; bottom: 0; right: 0; width: 9px; z-index: 3; cursor: col-resize; touch-action: none; }
.tb-grip::after { content: ''; position: absolute; top: 20%; bottom: 20%; right: 0; width: 2px; border-radius: 1px; background: transparent; transition: background .12s; }
th.tb-rs:hover .tb-grip::after { background: var(--line); }
.tb-grip:hover::after, table.tb-dragging .tb-grip:active::after { background: var(--maroon); top: 0; bottom: 0; }
table.tb-sized { table-layout: fixed; max-width: none; }
table.tb-sized th, table.tb-sized td { overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
table.tb-measure th, table.tb-measure td { white-space: nowrap; overflow-wrap: normal; }
table.tb-dragging, table.tb-dragging * { cursor: col-resize !important; user-select: none; }
@media print { .tb-grip { display: none; } }
/* person profile (people split view) */
.jb-profile { display: flex; flex-direction: column; gap: 18px; }
.jb-profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.jb-profile-head .av { width: 64px; height: 64px; border-radius: 50%; background: var(--sage-tint); color: var(--sage-ink); display: grid; place-items: center; font-weight: 700; font-size: 22px; flex: none; letter-spacing: .02em; }
.jb-profile-head .jb-h1 { margin: 0; }
.jb-person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.jb-person:last-child { border-bottom: 0; }
.jb-person .av { width: 38px; height: 38px; border-radius: 50%; background: var(--chip-soft); color: var(--ink-2, #333); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
@media (max-width: 760px) { .jb-profile-head .av { width: 48px; height: 48px; font-size: 17px; } }
.jb-busy > .jb-profile { opacity: .55; transition: opacity .15s .1s; pointer-events: none; }
.jb-person .jb-grow { min-width: 0; } .jb-person .jb-small { overflow-wrap: anywhere; }


/* ------------------------------------------------------------------ formatted-message editor (re-*) */
.re { position: relative; display: flex; flex-direction: column; min-height: 0; }
.re-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.re-b { min-width: 32px; height: 32px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; font: 600 15px var(--sans); }
.re-b:hover, .re-b[aria-expanded="true"] { background: var(--chip); color: var(--ink); }
.re-b .jb-ico { width: 17px; height: 17px; }
.re-serif { font-family: Georgia, serif; }
.re-a { font-weight: 700; border-bottom: 3px solid var(--maroon); line-height: 1; padding: 0 2px; }
.re-design span { font-size: 13px; }
.re-sel { height: 32px; min-height: 32px; width: auto; border: 1px solid transparent; border-radius: 6px; background: transparent; font: 13px var(--sans); color: var(--ink-2); padding: 0 22px 0 6px; cursor: pointer; }
.re-sel:hover { background: var(--chip-soft); }
.re-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.re-pop { position: relative; display: inline-flex; }
.re-menu { position: absolute; top: 36px; left: 0; z-index: 6; background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.2); padding: 10px 12px; min-width: 210px; display: flex; flex-direction: column; gap: 6px; }
.re-menu[hidden] { display: none; }
.re-menu.wide { min-width: 280px; }
.re-menu.right { left: auto; right: 0; }
.re-menu.design { width: 320px; }
.re-menu p { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 4px 0 0; }
.re-menu input[type=url], .re-menu input:not([type]) { min-height: 36px; font-size: 14px; }
.re-menu .jb-btn { min-height: 34px; align-self: flex-start; }
.re-sws { display: flex; flex-wrap: wrap; gap: 6px; }
.re-sw { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.re-sw.none { background: linear-gradient(135deg, #fff 45%, #d33 47%, #d33 53%, #fff 55%) !important; }
.re-sw[aria-pressed="true"] { outline: 2px solid var(--maroon); outline-offset: 2px; }
.re-custom { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.re-custom input[type=color] { width: 34px; height: 24px; border: 0; padding: 0; background: none; }
.re-item { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 7px 4px; border-radius: 6px; font: 14px var(--sans); cursor: pointer; text-align: left; }
.re-item:hover { background: var(--chip-soft); } .re-item .jb-ico { width: 16px; height: 16px; }
.re-layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.re-lay { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px; font: 600 11px var(--sans); color: var(--ink-2); cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.re-lay:hover { border-color: var(--maroon); }
.re-thumb { width: 100%; height: 38px; border-radius: 4px; background: #f4f4f6; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 10px; }
.re-thumb i { display: block; height: 4px; border-radius: 2px; background: #c9c9cf; }
.re-thumb i:nth-child(2) { width: 70%; } .re-thumb i:nth-child(3) { width: 85%; }
.re-lay-plain .re-thumb { background: #fff; border: 1px solid var(--line-soft); }
.re-lay-letter .re-thumb { background: #f7f4ee; box-shadow: inset 0 0 0 5px #f7f4ee, inset 0 0 0 40px #fff; }
.re-lay-announce .re-thumb i:first-child { height: 10px; background: var(--maroon); }
.re-lay-invite .re-thumb { background: linear-gradient(160deg, #f6ead8, #efe0c8); align-items: center; }
.re-lay-invite .re-thumb i:first-child { width: 50%; background: var(--maroon); }
.re-lay-newsletter .re-thumb { background: #edf2f7; } .re-lay-newsletter .re-thumb i:first-child { width: 45%; background: var(--maroon); }
.re-fonts { display: flex; flex-wrap: wrap; gap: 6px; }
.re-fonts button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.re-fonts button[aria-pressed="true"] { border-color: var(--maroon); color: var(--maroon-text); }
.re-page { flex: 1; min-height: 0; overflow: auto; border-radius: 10px; margin-top: 8px; transition: background .2s; }
.re-page.styled { padding: 24px 14px; }
.re-page.drop { outline: 2px dashed var(--maroon); outline-offset: -4px; }
.re-doc { min-height: 220px; outline: none; font: 15px/1.6 var(--sans); color: var(--ink); padding: 4px 2px; overflow-wrap: anywhere; }
.re.compact .re-doc { min-height: 120px; }
.re-doc.carded { max-width: 560px; margin: 0 auto; border-radius: 14px; padding: 30px 26px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.re-doc:empty::before { content: attr(data-ph); color: var(--ink-4); }
.re-doc p { margin: 0 0 10px; } .re-doc h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; } .re-doc h2 { font-size: 22px; margin: 14px 0 8px; } .re-doc h3 { font-size: 18px; margin: 12px 0 6px; }
.re-doc blockquote { border-left: 3px solid var(--line); margin: 8px 0; padding: 2px 14px; color: var(--ink-2); }
.re-doc ul, .re-doc ol { margin: 0 0 10px; padding-left: 24px; }
.re-doc img { max-width: 100%; cursor: pointer; }
.re-doc img.re-on { outline: 3px solid var(--maroon); outline-offset: 2px; }
.re-doc a { color: var(--maroon-text); }
.re-uploading { display: inline-block; padding: 6px 12px; border-radius: 8px; background: var(--chip); color: var(--ink-3); font-size: 13px; }
.re-page.dark .re-doc:not(.carded) { color: #fff; }
.re-imgbar { position: absolute; z-index: 5; display: flex; align-items: center; gap: 2px; background: #1f1f24; border-radius: 8px; padding: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.re-imgbar[hidden] { display: none; }
.re-imgbar button { border: 0; background: transparent; color: #fff; font: 600 12px var(--sans); padding: 6px 9px; border-radius: 5px; cursor: pointer; }
.re-imgbar button:hover { background: rgba(255,255,255,.15); }
.re-imgbar .re-sep { background: rgba(255,255,255,.25); }
.re-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 2px; }
.re-files[hidden] { display: none; }
.re-file { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--chip-soft); font-size: 13px; max-width: 100%; }
.re-file b { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.re-file span { color: var(--ink-3); font-size: 12px; } .re-file.pending { opacity: .65; }
.re-file .jb-ico { width: 14px; height: 14px; }
.re-file button { border: 0; background: transparent; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.re-file button:hover { background: var(--chip); }

/* compose window with the editor; panels it opens (preview, confirmations, picture library) sit above it */
body:has(.gm-win) .jb-scrim { z-index: 60; }
.gm-win { width: min(680px, calc(100vw / var(--zf, 1) - 32px)); }
.gm-win.max { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(1000px, calc(100vw / var(--zf, 1) - 48px)); height: calc(90vh / var(--zf, 1)); max-height: none; border-radius: 12px; }
.gm-win.max .gm-wform { flex: 1; }
.gm-wbody { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.gm-wbody .re-doc { min-height: 240px; }
.gm-tpl .jb-tplpick { padding-top: 8px; }
.gm-chip.group, .gm-chip.class { background: var(--sage-tint); color: var(--sage-ink); }
.gm-chip .jb-ico { width: 14px; height: 14px; }
.gm-chip i { font-style: normal; opacity: .7; }
.gm-chip select { border: 0; background: rgba(255,255,255,.6); border-radius: 999px; font: 12px var(--sans); min-height: 22px; height: 22px; padding: 0 18px 0 6px; width: auto; }
.gm-av.group, .gm-av.class { background: var(--sage-tint); }
.gm-ed-foot .jb-btn.ghost, .gm-wform footer .jb-btn.ghost { min-height: 40px; }
.gm-editor .re-bar { border-top: 1px solid var(--line-soft); }

/* attachments under a message */
.gm-files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; white-space: normal; }
.gm-file { display: flex; flex-direction: column; width: 180px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; background: #fff; }
.gm-file:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.gm-file img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--chip-soft); }
.gm-fico { height: 70px; display: flex; align-items: center; justify-content: center; background: var(--chip-soft); color: var(--ink-3); }
.gm-fico .jb-ico { width: 26px; height: 26px; }
.gm-fname { display: flex; flex-direction: column; padding: 8px 10px; font-size: 13px; }
.gm-fname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; } .gm-fname span { color: var(--ink-3); font-size: 12px; }
.gm-body.rich { white-space: normal; }
.gm-body.rich p { margin: 0 0 10px; } .gm-body.rich img { max-width: 100%; height: auto; }
.gm-body.rich h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; } .gm-body.rich h2 { font-size: 22px; margin: 14px 0 8px; }
.gm-body.rich [data-email] { border-radius: 12px; }
.gm-clip { display: inline-flex; vertical-align: -3px; margin-right: 6px; color: var(--ink-3); } .gm-clip .jb-ico { width: 15px; height: 15px; }

/* groups in the left column */
.gm-groups { display: flex; flex-direction: column; margin-top: 4px; }
.gm-ghead { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 4px 16px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.gm-ib.sm { width: 28px; height: 28px; }
.gm-grp { display: flex; align-items: center; gap: 12px; min-height: 32px; border: 0; background: transparent; padding: 0 14px 0 32px; margin-left: -16px; border-radius: 0 999px 999px 0; color: var(--ink-2); font: 14px var(--sans); cursor: pointer; text-align: left; }
.gm-grp:hover { background: var(--chip-soft); }
.gm-grp span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-grp .jb-ico { width: 17px; height: 17px; flex: none; }
.gm-grp .gm-n { color: var(--ink-4); font-weight: 400; }
.gm-ghint { font-size: 12px; color: var(--ink-3); padding: 0 8px 0 16px; }
/* group editor: the name and options stay put; only the people list scrolls (and never drags the panel with it) */
.jb-sheet .body:has(> .gm-gpick) { overflow: hidden; }
.gm-gpick { flex: 1 1 auto; min-height: 140px; overflow: auto; overscroll-behavior: contain; padding: 6px 12px; }
.gm-gpick .jb-kind { margin: 8px 0 2px; } .gm-gpick .jb-check { padding: 4px 0; }
.gm-gfilter { max-width: 200px; min-height: 34px; }

/* preview */
.gm-pvseg { margin-bottom: 12px; }
.gm-pvwrap { background: var(--chip-soft); border-radius: 12px; padding: 16px; display: flex; justify-content: center; }
.gm-pv { width: 100%; height: calc(62vh / var(--zf, 1)); border: 0; border-radius: 8px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.1); transition: width .2s; }
.gm-pv.phone { width: 390px; }

@media (max-width: 760px) {
  .gm-groups { display: none; }
  .gm-win.max { left: 0; top: 0; transform: none; width: auto; height: auto; border-radius: 0; }
  .re-bar { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .re-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto !important; }
  .gm-sendnote { display: none; }
  .gm-file { width: calc(50% - 5px); }
}

/* ---------------------------------------------------------------- forms from field lists (web/js/fieldkit.js) */
.fk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.fk-grid > .fk-wide, .fk-grid > .fk-head { grid-column: 1 / -1; }
.fk-grid > [hidden] { display: none; }
.fk-head { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line-soft); }
.fk-grid > .fk-head:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.fk-head b { font-family: var(--caps); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--maroon-text); }
.fk-req { font-style: normal; color: var(--maroon-text); }
.jb-field small { font-size: 12.5px; line-height: 1.35; }
.fk-money { position: relative; display: block; }
.fk-money > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.fk-money > input { padding-left: 26px !important; width: 100%; }
@media (max-width: 640px) { .fk-grid { grid-template-columns: minmax(0, 1fr); } }
/* answers read back */
.fk-facts { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.fk-facts h3 { font-family: var(--caps); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--maroon-text); margin: 0 0 10px; }
.fk-facts dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.fk-facts dl > div.wide { grid-column: 1 / -1; }
.fk-facts dt { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.fk-facts dd { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; }
@media (max-width: 640px) { .fk-facts dl { grid-template-columns: minmax(0, 1fr); } }

/* new request: pick a kind */
.rq-kinds { display: grid; gap: 10px; }
.rq-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font: inherit; color: var(--ink); cursor: pointer; }
.rq-kind:hover, .rq-kind:focus-visible { border-color: var(--maroon); background: var(--maroon-wash); outline: none; }
.rq-kind b { font-size: 16px; }

/* approvals: rows open a panel */
.ap-row { cursor: pointer; border-radius: 8px; }
.ap-row:hover { background: var(--chip-soft); box-shadow: -8px 0 0 var(--chip-soft), 8px 0 0 var(--chip-soft); }
.ap-row:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
.ap-chev { display: inline-flex; color: var(--ink-4); }
.ap-chev .jb-ico { width: 16px; height: 16px; transform: rotate(-90deg); }
.jb-sheet.ap-sheet { width: min(760px, 100%); }
.ap-person { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; }
.ap-family { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; }
.ap-family .ap-person { padding: 2px 0; }
.ap-decide { margin-top: 6px; padding: 16px; border-radius: 12px; background: var(--chip-soft); display: flex; flex-direction: column; gap: 10px; }
.ap-decide h3 { margin: 0; font-size: 15px; }
@media (max-width: 640px) { .ap-chev { display: none; } }

/* form responses: families still to respond */
.jb-await { list-style: none; margin: 0; padding: 0; }
.jb-await li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.jb-await li > div { min-width: 0; }
.jb-await a { color: var(--ink); text-decoration: none; } .jb-await a:hover { color: var(--maroon-text); text-decoration: underline; }
.jb-await .jb-small a { color: var(--ink-3); }
.jb-await .jb-btn { flex-shrink: 0; }
.jb-formstate { align-items: center; gap: 12px; }

/* Universal sign-in at app.<domain>: Compendium's own look, not a school's */
.jb-cpd-host, .jb-cpd-host body { background: #f6f7f9; }
.jb-cpd { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: #12151c; }
.jb-cpd-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; font-weight: 700; letter-spacing: .22em; font-size: 15px; }
.jb-cpd-sub { color: #5d6472; margin: 0 0 22px; font-size: 15px; }
.jb-cpd-note { background: #e9ecfd; color: #1f33b3; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 18px; }
.jb-cpd-note a, .jb-cpd-foot a { color: #3047d9; }
.jb-cpd-form { display: grid; gap: 14px; }
.jb-cpd-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #2b303b; }
.jb-cpd-form input { height: 46px; border: 1px solid #d3d7de; border-radius: 10px; padding: 0 14px; font: 15px Inter, system-ui, sans-serif; color: #12151c; background: #fff; }
.jb-cpd-form input:focus { outline: none; border-color: #3047d9; box-shadow: 0 0 0 3px #e9ecfd; }
.jb-cpd-form button { height: 48px; border: 0; border-radius: 999px; background: #12151c; color: #fff; font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; margin-top: 4px; }
.jb-cpd-form button:hover { background: #2b303b; } .jb-cpd-form button:disabled { opacity: .6; cursor: default; }
.jb-cpd-err { color: #b42318; font-size: 14px; margin: 0; }
.jb-cpd-school { display: grid; width: 100%; text-align: left; gap: 2px; border: 1px solid #d3d7de; background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font: 15px Inter, system-ui, sans-serif; color: #12151c; }
.jb-cpd-school:hover { border-color: #3047d9; background: #f5f6fe; } .jb-cpd-school small { color: #5d6472; }
.jb-cpd-foot { text-align: center; font-size: 14px; color: #5d6472; margin: 22px 0 0; }
.jb-cpd-demo { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e6e8ec; }
.jb-cpd-demo p { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: #2b303b; text-align: center; }
a.jb-cpd-school { text-decoration: none; }

/* Full-screen sign-in (every school's own page and the Compendium one): info on the left, sign-in on the right */
.jb-auth { min-height: calc(100vh / var(--zf, 1)); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.jb-auth-info { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(32px, 5vw, 64px); }
.jb-auth-school { background: radial-gradient(120% 90% at 0% 0%, var(--maroon) 0%, var(--maroon-ink) 70%); color: var(--on-maroon, #fff); }
.jb-auth-cpd { background: radial-gradient(110% 80% at 0% 0%, #232a3a 0%, #12151c 65%); color: #e9e6de; }
.jb-auth-info::after { content: ""; position: absolute; right: -18%; bottom: -24%; width: 70%; aspect-ratio: 1; border-radius: 50%; border: 1px solid currentColor; opacity: .08; box-shadow: 0 0 0 60px rgba(255,255,255,.02), 0 0 0 120px rgba(255,255,255,.015); pointer-events: none; }
.jb-auth-logo { display: inline-flex; background: #fff; border-radius: 18px; padding: 16px 22px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.45); }
.jb-auth-logo img { display: block; width: min(260px, 56vw); height: 104px; object-fit: contain; }
.jb-auth-copy { position: relative; max-width: 560px; }
.jb-auth-eyebrow { font-family: var(--caps, inherit); text-transform: uppercase; letter-spacing: .16em; font-size: 13px; font-weight: 600; opacity: .8; margin: 0 0 14px; }
.jb-auth-cpd .jb-auth-eyebrow { color: #e8b04a; opacity: 1; font-family: inherit; }
.jb-auth-info h1 { font-family: var(--serif, inherit); font-size: clamp(32px, 3.6vw, 52px); line-height: 1.08; letter-spacing: -.01em; margin: 0 0 16px; color: inherit; }
.jb-auth-cpd h1 { font-family: inherit; letter-spacing: -.03em; color: #fff; }
.jb-auth-lede { font-size: 17px; line-height: 1.55; opacity: .85; margin: 0 0 28px; max-width: 480px; }
.jb-auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.jb-auth-points li { display: grid; grid-template-columns: 38px 1fr; gap: 14px; align-items: start; }
.jb-auth-points .jb-ico { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: rgba(255,255,255,.12); stroke: currentColor; }
.jb-auth-points b { display: block; font-size: 15px; margin-bottom: 2px; }
.jb-auth-points span { font-size: 14px; opacity: .85; line-height: 1.45; }
.jb-auth-foot { position: relative; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; opacity: .8; }
.jb-auth-foot a { color: inherit; }
.jb-auth-main { display: flex; align-items: center; justify-content: center; padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 56px); overflow-y: auto; }
.jb-auth-form { width: min(440px, 100%); display: flex; flex-direction: column; gap: 16px; }
.jb-auth-form h2 { font-family: var(--serif, inherit); font-size: 32px; margin: 0; color: var(--ink, #12151c); }
.jb-cpd .jb-auth-form h2 { font-family: inherit; letter-spacing: -.02em; font-weight: 700; }
.jb-auth-form > .jb-muted, .jb-auth-form > .jb-cpd-sub { margin: -8px 0 4px; }
@media (max-width: 860px) {
  .jb-auth { grid-template-columns: 1fr; }
  .jb-auth-info { gap: 18px; padding: 28px 20px 26px; }
  .jb-auth-points, .jb-auth-foot, .jb-auth-lede { display: none; }
  .jb-auth-info h1 { font-size: 28px; margin: 0; }
  .jb-auth-logo { padding: 10px 14px; border-radius: 14px; } .jb-auth-logo img { height: 64px; width: min(200px, 56vw); }
  .jb-auth-main { align-items: flex-start; padding: 28px 20px 40px; }
}
/* sign-in panel: logo and welcome centered in the panel, footer pinned to the bottom */
.jb-auth-info { justify-content: flex-start; align-items: center; text-align: center; gap: 32px; }
.jb-auth-top { margin-top: auto; display: flex; justify-content: center; position: relative; }
.jb-auth-copy { margin: 0 auto; }
.jb-auth-lede { margin-left: auto; margin-right: auto; }
.jb-auth-points { display: inline-grid; text-align: left; }
.jb-auth-foot { margin-top: auto; align-self: stretch; }
@media (max-width: 860px) { .jb-auth-info { gap: 16px; } .jb-auth-points { display: none; } }

/* the update notice in each account's own colors: the school's main color, or Compendium's on app.<domain> */
.jb-cpd-host .update-bar { background: #12151c; color: #fff; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
.jb-cpd-host .update-bar button { color: #12151c; }
