:root {
  --primary: #3E5C50;
  --primary-dark: #2C4339;
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --user-bubble: #E2EAE5;
  --bot-bubble: #FFFFFF;
  --text: #2C3A33;
  --muted: #8C9A92;
  --accent: #C49A6C;
}

/* Tester package: member release home, owner editor and sharing chooser. */
.tp-home { max-width: 920px; margin: 0 auto; padding-bottom: 48px; }
/* The testers home keeps its full column (main#629): with auto margins in the
   #app flex column it otherwise shrinks to its content, and with no release
   notes on it the stacked Feedback fields were a narrow strip at ~1000px. */
.tp-home:not(.ideas-home) { width: 100%; box-sizing: border-box; }
.tp-check-build { padding: 12px 16px; border-radius: 10px; background: var(--user-bubble); font-weight: 600; }
.tp-release, .tp-history, .tp-home > .pay-panel { margin: 16px 0; }
.tp-release-meta { color: var(--muted); margin-bottom: 16px; }
.tp-notes { display: grid; gap: 10px; }
.tp-notes section, .tp-step, .release-go-tally { padding: 12px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 10px; margin: 10px 0; }
.tp-notes h3, .tp-step p { margin: 6px 0; }
.tp-notes ul { padding-left: 22px; }
.tp-step-head, .tp-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tp-actions .active { background: var(--primary); color: white; }
.tp-older { padding: 12px; border-bottom: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); }
.tp-older summary, .release-published summary { cursor: pointer; }
.release-editor { margin: 16px 0; }
.release-editor fieldset, .release-share-choice { margin: 12px 0; padding: 12px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 8px; }
.release-edit-step { margin: 14px 0; padding: 12px; background: color-mix(in srgb, var(--surface) 92%, var(--primary)); border-radius: 10px; }
.release-share-testers { display: grid; gap: 8px; margin: 12px 0; }
.release-remark { padding-left: 12px; border-left: 3px solid var(--accent); }

/* Tester ideas (main#571): the member's list, propose form and own ideas. */
.idea-list { display: grid; gap: 10px; }
.idea-card { padding: 12px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 10px; }
.idea-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.idea-title { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.idea-desc { margin: 6px 0; overflow-wrap: anywhere; }
.idea-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.idea-votes { color: var(--muted); font-size: 14px; }
.idea-status, .idea-state { font-size: 12px; border-radius: 6px; padding: 1px 6px; white-space: nowrap; background: var(--bg); color: var(--muted); }
.idea-status.status-planned { background: #E6DFF3; color: #5B4B8A; }
.idea-status.status-shipped { background: #E2EAE5; color: var(--primary-dark); }
.idea-state.state-approved { background: #E2EAE5; color: var(--primary-dark); }
/* The Ideas form's pattern, also on the testers home's Feedback form (main#629):
   each label above its own full-width field. Both screens are .tp-home. */
.tp-home .fb-form label { display: block; margin: 8px 0; }
.tp-home .fb-form input, .tp-home .fb-form textarea { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 15px; margin-top: 4px; }
.fb-idea { margin: 8px 0; }
.fb-idea summary { cursor: pointer; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app { height: 100%; display: flex; flex-direction: column; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}
.screen.center { align-items: center; justify-content: center; text-align: center; gap: 18px; }

.muted { color: var(--muted); }

/* --- login --- */
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.brand-mark {
  font-size: 56px; line-height: 1; color: var(--primary);
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: 0 6px 24px rgba(0,0,0,.08); margin-bottom: 8px;
}
.brand h1 { margin: 8px 0 0; font-size: 26px; font-weight: 650; }
.tagline { margin: 0; color: var(--muted); }

/* --- buttons --- */
.btn-primary {
  border: none; background: var(--primary); color: #fff;
  font-size: 16px; font-weight: 600; padding: 14px 32px; border-radius: 999px;
  cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
/* secondary landing CTA (e.g. "Request access" on faculty portals) */
.btn-outline {
  border: 2px solid var(--primary); background: transparent; color: var(--primary);
  font-size: 16px; font-weight: 600; padding: 12px 32px; border-radius: 999px;
  cursor: pointer; transition: background .15s, color .15s; margin-top: 10px;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* --- native in-app login form (EU backend) ------------------------------- */
.auth-brand { margin-bottom: 4px; }
.auth-form {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 320px;
}
.auth-form input {
  width: 100%; box-sizing: border-box;
  padding: 13px 16px; font-size: 16px;
  border: 1px solid #d8d2c8; border-radius: 12px;
  background: var(--surface); color: var(--text);
}
.auth-form input:focus { outline: none; border-color: var(--primary); }
.auth-form .btn-primary { width: 100%; margin-top: 2px; }
.auth-note { margin: 0 0 2px; color: var(--muted); font-size: 14px; text-align: left; }
.auth-error { margin: 2px 0 0; color: #c0392b; font-size: 14px; }
.auth-link {
  border: none; background: transparent; color: var(--primary);
  font-size: 14px; cursor: pointer; padding: 4px;
}
.auth-link:hover { text-decoration: underline; }
.landing-first { display: block; margin: 10px auto 0; }
.auth-cancel { color: var(--muted); margin-top: 4px; }
.btn-ghost {
  border: none; background: transparent; color: var(--primary);
  font-size: 15px; padding: 6px 10px; cursor: pointer; border-radius: 8px;
}
.btn-ghost:hover { background: rgba(0,0,0,.04); }

/* --- top bar --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--surface);
  border-bottom: 1px solid rgba(0,0,0,.06); flex: 0 0 auto;
}
.topbar-title { font-weight: 650; font-size: 17px; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }

/* --- modal (account / change password) --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.42);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 14px; padding: 22px;
  width: 100%; max-width: 360px; box-shadow: 0 14px 44px rgba(0,0,0,.28);
  /* The account modal grew taller than a laptop viewport (name + email +
     phone + data export + password): cap it and scroll inside, so the top
     and bottom are always reachable. */
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.modal h2 { margin: 0 0 16px; font-size: 18px; color: var(--text); }
.modal label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; color: var(--muted); margin-bottom: 12px;
}
.modal input, .modal select, .modal textarea {
  padding: 10px 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 9px;
  font-size: 15px; color: var(--text); background: var(--bg);
  /* Selects and textareas were browser-default inside a modal of rounded
     inputs; and a select carrying 400 timezone ids must be allowed to shrink
     to its column rather than set the column's width. */
  font-family: inherit; max-width: 100%; min-width: 0;
}
.modal textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.modal input:focus, .modal select:focus, .modal textarea:focus {
  outline: none; border-color: var(--primary);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal-msg { min-height: 18px; font-size: 13px; margin: 2px 0 8px; }
.modal-msg.error { color: #C0392B; }
.modal-msg.ok { color: #2E7D32; }
/* Member channels in Account (main#477): checkbox beside its label, not
   stacked like the text fields; a disabled row reads as not available. */
.modal label.channel-row { flex-direction: row; align-items: flex-start; gap: 10px; }
.modal label.channel-row input { width: auto; margin: 2px 0 0; padding: 0; }
.modal label.channel-row strong { color: var(--text); font-weight: 600; }
.modal label.channel-row input:disabled + span { opacity: .6; }
.manual-details { margin-bottom: 16px; font-size: 14px; }
.manual-details summary { cursor: pointer; font-weight: 600; color: var(--text); }
.manual-details p, .manual-details ul { margin: 8px 0; color: var(--muted); }
.manual-details li { margin-left: 18px; }

/* --- persona picker --- */
.picker-hint { color: var(--muted); margin: 8px 0 18px; }
.persona-grid { display: flex; flex-direction: column; gap: 14px; max-width: 480px; width: 100%; margin: 0 auto; }
.persona-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  border: 1px solid rgba(0,0,0,.08); border-left: 5px solid var(--card-accent, var(--primary));
  background: var(--surface); border-radius: 16px; padding: 18px 20px;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.persona-card:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.persona-name { font-size: 18px; font-weight: 650; }
.persona-tagline { color: var(--muted); font-size: 14px; }
.signed-as { color: var(--muted); font-size: 13px; text-align: center; margin-top: 24px; }

/* --- chat --- */
.messages {
  flex: 1; overflow-y: auto; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.bubble {
  max-width: 80%; padding: 10px 14px; border-radius: 18px;
  font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,.05);
  user-select: text; -webkit-user-select: text; -webkit-touch-callout: default;
}
.bubble.user { align-self: flex-end; background: var(--user-bubble); border-bottom-right-radius: 5px; }
.bubble.bot { align-self: flex-start; background: var(--bot-bubble); border-bottom-left-radius: 5px; }
.bubble.bot a { color: var(--primary); text-decoration: underline; overflow-wrap: anywhere; }
.bubble .md-p, .bubble .md-list, .bubble .md-pre, .bubble .md-h { margin: 0; }
.bubble .md-p + *, .bubble .md-list + *, .bubble .md-pre + *, .bubble .md-h + * { margin-top: 6px; }
.bubble .md-list { padding-left: 1.4em; }
/* Nested lists keep the outer markers and sit tight under their item. */
.bubble ul.md-list { list-style-type: disc; }
.bubble ol.md-list { list-style-type: decimal; }
.bubble li > .md-list { margin-top: 0; }
/* A heading looks exactly like the bold line it replaced: its words carry
   the bold, the element only gives it its place in the outline. */
.bubble .md-h { font: inherit; color: inherit; }
.bubble .md-code, .bubble .md-pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(0,0,0,.06); border-radius: 4px;
}
.bubble .md-code { padding: 1px 3px; }
.bubble .md-pre { padding: 6px; white-space: pre-wrap; overflow-x: auto; }

/* Image bubble (e.g. the first-contact welcome infographic) — let the picture
   fill the bubble edge-to-edge rather than sit in text padding. */
/* A booking message the server wrote into the conversation (main#410): the
   text with its links, and an Add to calendar button under it. */
.bubble.booking-msg a { overflow-wrap: anywhere; }
.bubble.booking-msg .bk-ics { display: block; margin-top: 8px; white-space: normal; }

.bubble.has-image { padding: 4px; max-width: 85%; }
.bubble-image { display: block; width: 100%; height: auto; border-radius: 14px; }

.bubble.typing { display: flex; gap: 4px; align-items: center; }
.bubble.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: blink 1.2s infinite both;
}
.bubble.typing span:nth-child(2) { animation-delay: .2s; }
.bubble.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.system-line { align-self: center; color: var(--muted); font-size: 13px; text-align: center; max-width: 90%; padding: 4px 0; }
.system-line.error { color: #C0392B; }
.error-msg { color: #C0392B; max-width: 420px; }

/* --- composer --- */
.composer {
  flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid rgba(0,0,0,.06);
}
.composer textarea {
  flex: 1; resize: none; border: 1px solid rgba(0,0,0,.12); border-radius: 20px;
  padding: 10px 14px; font-size: 15px; font-family: inherit; line-height: 1.35;
  max-height: 140px; outline: none; background: var(--bg); color: var(--text);
}
.composer textarea:focus { border-color: var(--primary); }
.btn-send {
  flex: 0 0 auto; width: 40px; height: 40px; border: none; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 18px; cursor: pointer;
}
.btn-send:disabled { opacity: .5; cursor: default; }
.btn-attach {
  flex: 0 0 auto; width: 40px; height: 40px; border: none; border-radius: 50%;
  background: var(--bg); color: var(--muted); font-size: 17px; cursor: pointer;
  line-height: 1;
}
.btn-attach:hover { color: var(--primary); }

/* --- pending image attachment (sits above the composer) --- */
.attach-strip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--surface); color: var(--muted);
  border-top: 1px solid rgba(0,0,0,.06); font-size: 13px;
}
.attach-thumb {
  width: 44px; height: 44px; object-fit: cover; border-radius: 8px;
  flex: 0 0 auto;
}
.attach-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}
.attach-remove {
  flex: 0 0 auto; width: 26px; height: 26px; border: none; border-radius: 50%;
  background: var(--bg); color: var(--muted); font-size: 16px; cursor: pointer;
  line-height: 1;
}
.attach-remove:hover { color: var(--text); }

/* --- spinner --- */
.spinner {
  width: 38px; height: 38px; border: 3px solid rgba(0,0,0,.1);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- persona-site landing (branded single-persona front door) --- */
.landing {
  flex: 1; display: flex; flex-direction: column;
  align-items: center;
  padding: 32px 24px; overflow-y: auto; position: relative; width: 100%;
}
.landing-inner {
  max-width: 380px; width: 100%; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  /* Vertical centering via auto margins, NOT justify-content:center on the
     parent — flex centering in a scroll container makes overflowing content
     unreachable above the scroll origin (the top of the page gets cut off).
     Auto margins center when there is room and collapse to 0 when there is
     not, so tall content starts at the top and scrolls normally. */
  margin-top: auto; margin-bottom: auto;
}
.landing-copy, .landing-bullets { width: 100%; overflow-wrap: break-word; }
.landing .brand h1 { font-size: 34px; }
.landing-copy { color: var(--text); line-height: 1.55; }
.landing-copy p { margin: 0 0 12px; }
.landing-bullets {
  list-style: none; padding: 0; margin: 0; text-align: left;
  display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 360px;
}
.landing-bullets li { position: relative; padding-left: 22px; color: var(--text); }
.landing-bullets li::before {
  content: "◐"; position: absolute; left: 0; top: 0; color: var(--primary);
}
.flash {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: 90%; padding: 12px 18px; border-radius: 10px; z-index: 1000;
  font-size: 14px; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.2); cursor: pointer;
}
.flash-ok { background: #2e7d5b; }
.flash-warn { background: #b5562e; }
.landing-infographic-link { width: 100%; display: block; }
.landing-infographic {
  width: 100%; height: auto; display: block; border-radius: 12px;
  border: 1px solid var(--border, rgba(0,0,0,.08));
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.landing-footer { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
/* The public trust page and the links to it (steward#628). */
a.trust-link { color: inherit; text-decoration: underline; }
.trust-page { max-width: 520px; }
.trust-copy { text-align: left; }
.trust-copy .trust-h { font-size: 17px; margin: 18px 0 8px; color: var(--text); }
.trust-copy .trust-h:first-child { margin-top: 0; }
.trust-copy .trust-list { max-width: none; margin-bottom: 4px; }
a.trust-home { display: inline-block; text-decoration: none; text-align: center; }
/* Owner requests on Settings (steward#628). */
.owner-req { border-top: 1px solid var(--border, rgba(0,0,0,.08)); padding-top: 10px; margin-top: 10px; }
.owner-req-h { margin: 0 0 6px; font-size: 15px; }
.owner-req-value { display: flex; align-items: center; gap: 6px; }
.owner-req-value input { flex: 1; min-width: 0; }
/* The circle invite landing (main#431): links styled as the landing's buttons. */
a.circle-btn { display: inline-block; text-decoration: none; text-align: center; }
.circle-btn { max-width: 100%; box-sizing: border-box; }
.circle-invite .brand h1 { font-size: 28px; }
.circle-install h2 { font-size: 17px; margin: 8px 0 6px; }
.circle-stores { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lang-toggle {
  position: absolute; top: 16px; right: 16px; display: flex; gap: 2px;
  background: var(--surface); border-radius: 999px; padding: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.lang-opt {
  border: none; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.lang-opt.active { background: var(--primary); color: #fff; }
.landing-org {
  margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding-top: 18px; border-top: 1px solid rgba(0,0,0,.08); width: 100%;
}
.landing-logo { height: 52px; width: auto; opacity: .92; }
.landing-org-caption { margin: 0; font-size: 12px; color: var(--muted); }

/* --- course content -------------------------------------------------------
   Was a logged-in hub between sign-in and the chat; since 2026-08-11 the same
   pieces render on the public landing (intro videos + curriculum) and inside
   the chat's first-run welcome card. The blocks below are shared by both. */
.course-video {
  border-radius: 14px; overflow: hidden; background: #000;
  box-shadow: 0 8px 28px rgba(0,0,0,.12); margin: 0 0 16px;
}
.course-video.portrait { max-width: 360px; margin-left: auto; margin-right: auto; }
.course-video video { display: block; width: 100%; height: auto; background: #000; }
.course-video-label {
  margin: 0; padding: 10px 14px; font-size: 13px; color: var(--muted);
  background: var(--surface);
}
.course-modules-h { font-size: 16px; font-weight: 650; color: var(--text); margin: 28px 0 12px; }
.course-modules { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.course-module {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid rgba(0,0,0,.07); border-radius: 12px;
  padding: 12px 14px;
}
.cm-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg); color: var(--primary); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.cm-title { flex: 1; font-size: 14px; color: var(--text); line-height: 1.35; }
.cm-soon { flex: 0 0 auto; font-size: 11px; color: var(--muted); font-style: italic; }

/* Course content ON the public landing. The landing column is sized for a
   sign-in screen (380px); a course front page carries videos and ten module
   titles, so it widens — while the copy above it stays a comfortable measure. */
.landing-inner.wide { max-width: 640px; }
.landing-inner.wide .landing-copy,
.landing-inner.wide .landing-bullets { max-width: 460px; }
.landing-videos, .landing-course { width: 100%; text-align: left; }
.landing-videos .course-video:last-child { margin-bottom: 0; }
.landing-course .course-modules-h { margin-top: 8px; }
.landing-cta-top { margin: 4px 0 20px; }
/* The repeat CTA under the curriculum: matched to the primary button above it,
   not competing with it. */
.landing-cta2 { width: 100%; max-width: 320px; }

/* The welcome video inside a chat card. The label keeps its own light background
   — it sits inside the clip's black frame, so a transparent one would put muted
   grey text on black.
   Height, not width, is the constraint that matters here: a portrait clip capped
   only at 360px wide still runs ~640px tall and swallows the whole chat. Cap the
   height against the viewport and let the width follow the aspect ratio, with
   the frame shrinking to the video so there are no black bars beside it. */
.course-welcome .course-video {
  margin-bottom: 0; box-shadow: none;
  width: max-content; max-width: 100%; margin-left: auto; margin-right: auto;
}
.course-welcome .course-video video { max-height: 48vh; width: auto; max-width: 100%; }

/* --- access flow (register / pending / approved) + admin panel ----------- */
.screen.access { align-items: center; }
.access-card {
  width: 100%; max-width: 440px; background: var(--surface);
  border-radius: 14px; padding: 24px 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.access-card h2 { margin: 0 0 12px; font-size: 20px; color: var(--text); }
.access-intro { color: var(--text); line-height: 1.55; margin: 0 0 18px; font-size: 14px; }
.access-card form { display: flex; flex-direction: column; gap: 14px; }
.access-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--muted);
}
.access-card input, .access-card textarea {
  padding: 10px 12px; border: 1px solid #d9d2c7; border-radius: 9px;
  font: inherit; color: var(--text); background: var(--bg); resize: vertical;
}
.access-card input:focus, .access-card textarea:focus {
  outline: none; border-color: var(--primary); background: var(--surface);
}
.access-card .btn-primary { margin-top: 4px; }
/* main#934: a creator's companions, each a way out of the portal */
.access-card a.created-go {
  display: block; text-align: center; text-decoration: none; margin-bottom: 10px;
}
.access-card .created-another { margin: 8px 0 0; color: var(--muted); }
.access-card #enter-still { margin: 0 0 14px; }
.program-join {
  margin: 0 0 20px; padding: 14px; border: 1px solid rgba(0,0,0,.10);
  border-radius: 10px; background: var(--bg);
}
.program-join h3 { margin: 0 0 12px; font-size: 16px; color: var(--text); }

/* structured access form (channels.web.access_form — faculty portals) */
.access-card select {
  padding: 10px 12px; border: 1px solid #d9d2c7; border-radius: 9px;
  font: inherit; color: var(--text); background: var(--bg);
}
.access-card select:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.af-note { font-size: 12px; color: var(--muted); font-style: italic; }
.af-other.af-hidden { display: none; }
.af-group { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.af-group-label { margin-bottom: 2px; }
.af-radio, .af-check {
  display: flex; flex-direction: row; align-items: flex-start; gap: 8px;
  font-size: 14px; color: var(--text); cursor: pointer;
}
.af-radio input, .af-check input { margin-top: 3px; flex: none; width: auto; }

/* structured answers in the admin requests queue */
.admin-answers {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg); border-radius: 9px; padding: 10px 12px; font-size: 13px;
}
.admin-answer { display: flex; gap: 8px; line-height: 1.4; }
.admin-answer span:first-child { color: var(--muted); flex: 0 0 44%; }

/* trial expiry badge on member rows */
.member-expiry {
  font-size: 12px; color: var(--muted); background: var(--bg);
  border-radius: 6px; padding: 1px 6px; white-space: nowrap;
}
.member-expired { color: #b3402a; font-weight: 600; }

/* Subscription state (ADR-0016) — same chip shape as expiry/role badges. */
.member-sub {
  font-size: 12px; border-radius: 6px; padding: 1px 6px; white-space: nowrap;
  background: var(--bg); color: var(--muted);
}
.member-sub.sub-active { background: #E2EAE5; color: var(--primary-dark); }
.member-sub.sub-trialing { background: #E6DFF3; color: #5B4B8A; }
.member-sub.sub-past_due { background: #F6E3DC; color: #b3402a; }
.member-sub.sub-lapsed { color: #b3402a; }
.member-sub.sub-comped { background: var(--accent); color: #fff; }

/* Release ring (main#394): a chip for readers, a select for the owner. */
.member-ring-chip {
  font-size: 12px; border-radius: 6px; padding: 1px 6px; white-space: nowrap;
  background: var(--bg); color: var(--muted);
}
.member-ring-chip.ring-inner { background: #E6DFF3; color: #5B4B8A; }
.member-ring-chip.ring-trusted { background: #E2EAE5; color: var(--primary-dark); }
.member-ring-warn { font-size: 12px; color: #b3402a; font-weight: 600; white-space: nowrap; }
/* Circle host toggle (main#421). */
.member-host { font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.circles .roster-table-wrap { margin: 8px 0; }
/* Voice minutes (main#400): used of allowance this month, for a member on the cloned voice. */
.member-voice {
  font-size: 12px; border-radius: 6px; padding: 1px 6px; white-space: nowrap;
  background: var(--bg); color: var(--muted);
}
/* main#617: where a member's voice minutes come from; the fallback is a warning. */
.member-voice-src { font-size: 12px; color: var(--muted); }
.member-voice-src.member-voice-fallback { color: #b3402a; font-weight: 600; }

/* Feedback page (main#395): the member's form and the owner's inner list. */
.modal.fb-form textarea { font-family: inherit; font-size: 15px; resize: vertical; }
.fb-due {
  width: 100%; max-width: 560px; margin: 0 auto 14px; padding: 12px 14px;
  background: var(--surface); border-radius: 10px; box-sizing: border-box;
}
.fb-due h3 { margin: 0 0 8px; font-size: 15px; }
.fb-due-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fb-due-row { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; }
.fb-due-name { font-weight: 600; }
.fb-due-when, .fb-due-last { color: var(--muted); }
.fb-due-row.overdue .fb-due-when { color: #b3402a; font-weight: 600; }

/* Release gate (main#408): the inner tester's GO / NOT YET and the owner's tally. */
.rg { margin: 4px 0 14px; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.rg h3 { margin: 0 0 6px; font-size: 15px; }
.rg-build, .rg-owner-build {
  margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.rg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.rg-tag {
  font-size: 12px; border-radius: 6px; padding: 1px 6px; white-space: nowrap;
  background: var(--surface); color: var(--muted);
}
.rg-tag.rg-ok, .rg-state.rg-ok { color: var(--primary-dark); }
.rg-state.rg-fail { color: #b3402a; }
.rg-choice { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 6px; }
.rg-choice label { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.rg-remark { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px; resize: vertical; }
.rg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.rg-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 14px; }
.rg-add input { width: 9em; }

.admin-scroll { overflow-y: auto; padding: 16px; }
.admin-list { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.admin-item {
  background: var(--surface); border-radius: 12px; padding: 16px 16px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); display: flex; flex-direction: column; gap: 8px;
}
.admin-who { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.admin-name { font-weight: 600; color: var(--text); }
.admin-persona { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.admin-meta { font-size: 13px; color: var(--muted); }
.admin-why { font-size: 13px; color: var(--text); line-height: 1.5; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.admin-phone-l { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.admin-phone { padding: 8px 10px; border: 1px solid #d9d2c7; border-radius: 8px; font: inherit; color: var(--text); background: var(--bg); }
.admin-phone:focus { outline: none; border-color: var(--primary); }
.admin-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; align-items: center; }
.admin-done { color: #2E7D32; font-size: 14px; text-align: center; padding: 6px 0; }

/* --- admin hub: tabs + persona switcher --- */
/* Two layers: a row of group pills, and under it the open group's tabs on
   a lighter band, smaller, so the second line reads as the sub-menu. Each
   row scrolls sideways on a narrow screen instead of wrapping. */
.admin-tabs { display: flex; flex-direction: column; padding: 8px 16px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.book-panel {
  margin: 12px 16px 0; padding: 12px 14px; border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px; background: var(--surface); color: var(--text);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
}
.book-panel p { margin: 0; font-size: 14px; }
.starter-note {
  margin: 12px 16px 0; padding: 12px 14px; border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px; background: var(--surface); color: var(--text);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  min-width: 0;
}
.starter-note[hidden] { display: none; }
.starter-note p { margin: 0; font-size: 14px; line-height: 1.45; min-width: 0; flex: 1 1 230px; overflow-wrap: anywhere; }
.starter-note button { max-width: 100%; white-space: normal; }
.admin-groups, .admin-subtabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.admin-groups::-webkit-scrollbar, .admin-subtabs::-webkit-scrollbar { display: none; }
.admin-groups { padding-bottom: 8px; }
.admin-group {
  border: none; background: transparent; color: var(--text); font: inherit; font-size: 15px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.admin-group:hover { background: rgba(0,0,0,.05); }
.admin-group.active { color: #fff; background: var(--primary); }
.admin-groups + .admin-subtabs {
  margin: 0 -16px; padding: 0 16px 0 28px; gap: 2px;
  background: rgba(0,0,0,.035); border-top: 1px solid rgba(0,0,0,.05);
}
.admin-groups + .admin-subtabs .admin-tab { font-size: 13px; padding: 7px 10px; }
.admin-tab {
  border: none; background: transparent; color: var(--muted); font: inherit; font-size: 14px;
  padding: 7px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; flex-shrink: 0;
}
.admin-tab[hidden] { display: none; }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.admin-persona-sel {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text);
  border: none; background: transparent; max-width: 60vw;
}
.center-p { text-align: center; padding: 24px 0; }

/* --- members --- */
/* Member rows: stacked cards on mobile; single-line grid + wider container on
   desktop (the admin hub is a management view, not the phone-width chat). */
/* main#634: one compact row (who · badges · activity · Manage) and a drawer
   under it with every control. Phone: who and Manage share the first line,
   badges and activity follow. Every cell may shrink (min-width: 0) and wraps
   inside itself, so nothing is drawn outside the card at any width. */
.member-item {
  width: 100%; max-width: 560px; margin: 0 auto; background: var(--surface);
  border: 1px solid rgba(0,0,0,.08); border-radius: 12px; padding: 12px 14px;
  box-sizing: border-box; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "who manage" "badges badges" "activity activity" "drawer drawer" "msg msg";
  align-items: center; column-gap: 12px; row-gap: 4px;
}
.member-item.removed { opacity: .55; }
.member-who { grid-area: who; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.member-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.member-contact { display: flex; flex-wrap: wrap; gap: 0 10px; min-width: 0; }
.member-badges { grid-area: badges; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.member-badges:empty { display: none; }
.member-activity { grid-area: activity; display: flex; flex-wrap: wrap; gap: 0 10px; min-width: 0; }
.member-manage {
  grid-area: manage; justify-self: end; align-self: start;
  font-size: 14px; white-space: nowrap; border: 1px solid rgba(0,0,0,.12);
}
.member-manage[aria-expanded="true"] { background: var(--bg); }
.member-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.member-email { font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.member-email-none { color: var(--muted); font-style: italic; }
.member-phone { font-size: 13px; color: var(--muted); white-space: nowrap; }
.member-last { font-size: 13px; color: var(--muted); white-space: nowrap; }
.member-msgs { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
/* The drawer: settings, voice minutes, plain actions, then the destructive
   ones apart under a rule. */
.member-drawer {
  grid-area: drawer; min-width: 0; margin-top: 8px; padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 12px;
}
.member-drawer[hidden] { display: none; }
.member-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; min-width: 0; }
.member-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 100%; }
.member-field-label { font-size: 12px; color: var(--muted); }
.member-field select, .member-drawer select {
  font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid #d9d2c7;
  border-radius: 8px; background: var(--bg); color: var(--text); max-width: 100%;
}
.member-drawer-voice {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 10px 12px; background: var(--bg); border-radius: 10px;
}
.member-drawer-voice select { background: var(--surface); }
.member-drawer-h { font-size: 12px; font-weight: 650; color: var(--text); }
.member-voice-line { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.member-logins {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 10px 12px; background: var(--bg); border-radius: 10px;
}
.member-login-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.member-login-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.member-login-email { flex: 1 1 100%; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.member-login-note, .member-login-empty { font-size: 12px; color: var(--muted); }
.member-login-empty { margin: 0; line-height: 1.45; }
.member-login-reinvite { font-size: 12px; white-space: nowrap; }
.member-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.member-actions .btn-ghost { font-size: 14px; white-space: nowrap; border: 1px solid rgba(0,0,0,.10); }
.member-danger { padding-top: 10px; border-top: 1px dashed rgba(0,0,0,.10); }
.member-danger .btn-ghost { color: #b3402a; border-color: rgba(179,64,42,.25); }
.member-danger .btn-ghost:hover { background: #F6E3DC; }
.member-msg { grid-area: msg; overflow-wrap: anywhere; }
.member-msg:empty { display: none; }
.member-section {
  max-width: 560px; margin: 20px auto 8px; font-size: 14px; font-weight: 650; color: var(--text);
}
.member-count { color: var(--muted); font-weight: 400; }
.member-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.member-tier { display: inline-flex; align-items: center; gap: 4px; }
.role-badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; background: var(--bg); color: var(--muted);
}
.role-badge.role-admin { background: #E2EAE5; color: var(--primary-dark); }
.role-badge.role-superadmin { background: var(--accent); color: #fff; }
.role-badge.role-circle_host { background: #E6DFF3; color: #5B4B8A; }
.member-reset-ok { color: var(--text); }
.member-temp {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: var(--bg); border: 1px solid rgba(0,0,0,.12); border-radius: 6px;
  padding: 1px 6px; user-select: all;
}
.member-temp-copy { font-size: 12px; padding: 2px 8px; }
.member-fixed { font-size: 10px; color: var(--muted); font-style: italic; }
.member-role { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid #d9d2c7;
  border-radius: 8px; background: var(--bg); color: var(--text); }

/* Add-member panel (Members tab). Sticky so it stays reachable above a long
   member list (admin-body is the scroll container) — without this it scrolls
   out of view for personas with many members. */
.add-member {
  position: sticky; top: -16px; z-index: 2;
  flex: none;  /* admin-body is a flex column with bounded height; without this
                  the closed <details> gets shrunk to ~0 when the member list
                  overflows (it has the least intrinsic content). */
  max-width: 560px; margin: 0 auto 18px; border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px; background: var(--card, #fff); overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.add-member-summary {
  list-style: none; cursor: pointer; padding: 12px 16px;
  font-size: 14px; font-weight: 650; color: var(--primary-dark);
}
.add-member-summary::-webkit-details-marker { display: none; }
.add-member[open] .add-member-summary { border-bottom: 1px solid rgba(0,0,0,.08); }
.add-member-form { padding: 14px 16px 16px; }
.add-member-form label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; color: var(--muted); margin-bottom: 12px;
}
.add-member-form input {
  padding: 10px 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 9px;
  font-size: 15px; color: var(--text); background: var(--bg);
}
.add-member-form input:focus { outline: none; border-color: var(--primary); }
/* "optional" rides on the label line, lighter than the field name itself, so
   the eye reads the requirement without the label growing into a sentence. */
.am-optional { font-weight: 400; opacity: .75; }
/* The hint sits under the email field it explains, tucked up against it
   rather than floating between two fields. */
.am-email-hint { margin: -6px 0 14px; line-height: 1.45; }
.add-member-actions { display: flex; justify-content: flex-end; }
.add-member-result { margin-top: 8px; }
.am-ok {
  border: 1px solid #cfe3d6; background: #f0f7f2; border-radius: 10px;
  padding: 12px 14px; font-size: 14px; color: var(--text);
}
.am-ok p { margin: 0 0 6px; }
.am-wa { font-size: 13px; }
.am-copy { margin-top: 6px; }
/* Circle host: seat counter + the backend-rendered share message block. */
.circle-seats {
  max-width: 560px; margin: 16px auto 4px; font-size: 14px; color: var(--text);
}
.circle-seats-n { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.add-member-full { margin: 0 0 12px; color: var(--accent); }
.am-share {
  margin: 8px 0; padding: 10px 12px; background: var(--bg);
  border: 1px solid rgba(0,0,0,.10); border-radius: 9px;
}
.am-share-label { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.am-share-text { font-size: 13px; color: var(--text); white-space: pre-wrap; margin: 0; }
/* Forget me / delete account (#648): the danger list in the account modal. */
.danger-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; font-size: 14px; color: var(--text);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.danger-btn { color: #C0392B; }
.danger-btn:disabled { color: var(--muted); }

/* Roster upload (#646): parsed-CSV preview + per-row results. */
.roster-table-wrap { overflow-x: auto; margin: 4px 0 12px; }
.roster-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.roster-table th, .roster-table td {
  padding: 6px 10px; text-align: left; border-bottom: 1px solid rgba(0,0,0,.08);
  white-space: nowrap;
}
.roster-table th { font-size: 12px; color: var(--muted); font-weight: 650; }
tr.roster-bad td { color: #a33; background: #fbf1f1; }
.roster-results { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; }
.roster-results li { margin: 2px 0; }
.roster-results li.roster-bad { color: #a33; }

@media (min-width: 768px) {
  .add-member { max-width: 1080px; }
}

@media (min-width: 768px) {
  /* Widen the whole admin hub on a real screen. */
  .admin-list, .member-section { max-width: 1080px; }
  /* One line per member: who | badges | activity | Manage. The drawer and
     the status line take the full width under it. */
  .member-item {
    max-width: 1080px;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto;
    grid-template-areas: "who badges activity manage" "drawer drawer drawer drawer" "msg msg msg msg";
    column-gap: 18px; row-gap: 2px; padding: 10px 18px;
  }
  .member-badges:empty { display: flex; }
  .member-activity { flex-direction: column; align-items: flex-start; }
  .member-manage { align-self: center; }
  .member-email, .member-phone, .member-last, .member-msgs { font-size: 14px; }
}

/* --- usage dashboard --- */
.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 560px; margin: 0 auto 8px; }
.tile { background: var(--surface); border: 1px solid rgba(0,0,0,.08); border-radius: 12px; padding: 14px; text-align: center; }
.tile-val { font-size: 24px; font-weight: 700; color: var(--primary); }
.tile-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.usage-h { max-width: 560px; margin: 18px auto 6px; font-size: 14px; color: var(--text); }
.barchart { width: 100%; max-width: 560px; display: block; margin: 0 auto; height: 90px; }
.barchart .bar { fill: var(--primary); }
.channel-mix { max-width: 560px; margin: 0 auto; }
.splitbar { height: 14px; border-radius: 7px; overflow: hidden; background: var(--accent); display: flex; }
.splitbar .seg { display: block; height: 100%; }
.splitbar .seg-web { background: var(--primary); }
.splitbar .seg-ios { background: rgba(120, 140, 200, 0.85); background: color-mix(in srgb, var(--primary) 65%, white); }
.splitbar .seg-android { background: rgba(170, 185, 225, 0.85); background: color-mix(in srgb, var(--primary) 35%, white); }
.channel-legend { font-size: 13px; color: var(--muted); margin-top: 8px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 3px; }
.dot-ok { background: #3c9a5f; }
.dot-alarm { background: #c0392b; }
.dot-unknown { background: #999; }
.member-never-started td { color: #888; font-style: italic; }
.dot-web { background: var(--primary); }
.dot-ios { background: rgba(120, 140, 200, 0.85); background: color-mix(in srgb, var(--primary) 65%, white); }
.dot-android { background: rgba(170, 185, 225, 0.85); background: color-mix(in srgb, var(--primary) 35%, white); }
.dot-wa { background: var(--accent); }
/* Status card (main#102): the endpoint's items, labelled; never stale-as-current */
.status-card { max-width: 560px; margin: 0 auto; }
.status-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.status-card-head .usage-h { margin-left: 0; margin-right: 0; }
.status-overall, .status-platform { font-size: 13px; color: var(--text); margin: 6px 0; line-height: 1.5; }
.status-platform-label { font-weight: 600; }
.status-notice { border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 13px; line-height: 1.5; }
.status-notice p { margin: 4px 0; }
.status-notice-down { background: rgba(192, 57, 43, .08); border: 1px solid rgba(192, 57, 43, .35); }
.status-notice-stale { background: rgba(196, 154, 108, .12); border: 1px solid rgba(196, 154, 108, .5); }
.status-items { margin: 8px 0 16px; }
.status-item { background: var(--surface); border: 1px solid rgba(0,0,0,.08); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; font-size: 13px; }
.status-item-alarm { border-color: rgba(192, 57, 43, .55); }
.status-item-stale { opacity: .6; }
.status-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.status-state { font-size: 12px; color: var(--muted); }
.status-meta { margin: 2px 0 0; font-size: 12px; word-break: break-all; }
.status-fields { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; margin: 6px 0 0; }
.status-fields dt { color: var(--muted); }
.status-fields dd { margin: 0; color: var(--text); }
@media (max-width: 420px) { .status-fields { grid-template-columns: 1fr; } .status-fields dd { margin-bottom: 4px; } }
.status-group { margin: 6px 0; }
.status-group summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }
.usage-note { max-width: 560px; margin: 16px auto 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* --- create-a-class wizard ------------------------------------------------- */
.cc-scroll { overflow-y: auto; padding: 16px; }
.cc-steps {
  display: flex; flex-wrap: wrap; gap: 6px; max-width: 560px;
  margin: 0 auto 18px; justify-content: center;
}
.cc-dot {
  font-size: 11px; padding: 4px 9px; border-radius: 999px;
  background: rgba(0,0,0,.05); color: var(--muted); white-space: nowrap;
}
.cc-dot.active { background: var(--primary); color: #fff; }
.cc-dot.done { background: rgba(0,0,0,.10); color: var(--text); }
.cc-body { max-width: 560px; margin: 0 auto; }
.cc-template { border: 0; padding: 0; margin: 0; }
.cc-template legend { color: var(--text); font-weight: 600; margin-bottom: 10px; }
.cc-body .cc-template-choice {
  display: flex; flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px;
  border: 1px solid rgba(0,0,0,.10); border-radius: 10px; color: var(--text); cursor: pointer;
}
.cc-template-choice span { display: flex; flex-direction: column; gap: 3px; }
.cc-template-choice small { color: var(--muted); font-size: 12px; }
.cc-body label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; color: var(--muted); margin-bottom: 14px;
}
.cc-body input[type="text"], .cc-body input[type="email"], .cc-body input[type="tel"],
.cc-body textarea {
  padding: 10px 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 9px;
  font-size: 15px; color: var(--text); background: var(--bg);
  font-family: inherit; width: 100%; box-sizing: border-box;
}
.cc-body input:focus, .cc-body textarea:focus { outline: none; border-color: var(--primary); }
.cc-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.cc-host { font-size: 13px; min-height: 18px; margin: -8px 0 12px; }
.cc-host.ok { color: #2E7D32; }
.cc-host.err { color: #C0392B; }
.cc-color-row { display: flex; align-items: center; gap: 10px; }
.cc-color-row input[type="color"] {
  width: 44px; height: 32px; padding: 0; border: 1px solid rgba(0,0,0,.14);
  border-radius: 8px; background: none; cursor: pointer;
}
.cc-color-hex { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.cc-cover-preview { display: block; max-width: 120px; max-height: 160px; border-radius: 8px; margin: -4px 0 14px; }
.cc-filebtn { cursor: pointer; }
.cc-filebtn .btn-ghost { display: inline-block; }
.cc-files { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.cc-files li { padding: 4px 0; color: var(--text); }
.cc-rev {
  display: flex; justify-content: space-between; gap: 16px; padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.06); font-size: 14px;
}
.cc-rev span { color: var(--muted); }
.cc-rev strong { color: var(--text); text-align: right; word-break: break-word; }
.cc-progress { margin-top: 16px; font-size: 13px; color: var(--text); }
.cc-progress div { padding: 3px 0; }
.cc-progress .cc-open, .cc-progress .cc-done { margin-top: 12px; margin-right: 8px; }

/* Owner program assembler: compact enough for the console's narrow mobile
   viewport, while keeping long source/layer text readable and inert. */
.program-editor, .program-codes { max-width: 760px; margin: 16px auto; }
.program-locales { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.program-locales fieldset, .program-item { border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 8px; padding: 10px; }
.program-item { margin: 10px 0; display: grid; gap: 8px; }
.program-item-head, .program-add, .program-upload, .program-code-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.program-item-head strong { flex: 1; }
.program-source-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 999px; padding: 2px 7px; margin: 2px; }
.program-source-chip button { border: 0; background: transparent; cursor: pointer; }
.program-layer { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 6px; padding: 8px; }
.program-code-once { border: 2px solid var(--accent); border-radius: 8px; padding: 10px; margin: 10px 0; }
.program-code-once pre { white-space: pre-wrap; user-select: all; }
.poll-run, .poll-guests {
  max-width: 760px; margin: 14px auto; padding: 14px; box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--muted) 28%, transparent);
  border-radius: 10px; background: var(--surface); color: var(--text);
}
.poll-run h4, .poll-guests h4 { margin: 0 0 10px; color: var(--primary); }
.poll-run-open {
  display: grid; gap: 6px; min-width: 0; padding: 12px;
  border: 2px solid var(--accent); border-radius: 8px; overflow-wrap: anywhere;
}
.poll-run-open strong {
  justify-self: start; padding: 3px 8px; border-radius: 999px;
  background: var(--accent); color: var(--surface); font-size: 13px; text-transform: uppercase;
}
.poll-run-open span { font-size: 1.15rem; font-weight: 600; }
.poll-run-open a { color: var(--primary); }
.poll-run-empty, .poll-run-next { overflow-wrap: anywhere; }
.poll-run-empty, .poll-guests .muted { color: var(--muted); }
.poll-run-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.poll-guests-switch { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; }
.poll-guest-link { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 8px; }
.poll-guest-link button { min-width: 0; white-space: normal; }
.poll-guest-link label, .poll-guests-form label { display: grid; gap: 4px; min-width: 0; }
.poll-guest-link input, .poll-guests-form input, .poll-guests-form textarea {
  width: 100%; min-width: 0; box-sizing: border-box; color: var(--text); background: var(--surface);
}
.poll-guests-form { display: grid; gap: 10px; margin-top: 14px; }
.poll-guests-form .poll-guests-switch { display: flex; }
.poll-guests-form .poll-guests-switch input { width: auto; min-width: auto; }
.poll-guests-form textarea { min-height: 90px; resize: vertical; }
.poll-guest-qr-image { display: block; max-width: min(100%, 320px); height: auto; margin: 12px auto; }
.poll-guest-qr-image[hidden] { display: none; }
@media (max-width: 600px) {
  .poll-run, .poll-guests { width: 100%; padding: 12px; }
  .poll-run-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .poll-run-actions button { min-width: 0; min-height: 56px; font-size: 18px; white-space: normal; }
  #prg-poll-run-end { grid-column: 1 / -1; }
  .poll-guest-link { grid-template-columns: minmax(0, 1fr) 1fr; }
  .poll-guest-link label { grid-column: 1 / -1; }
}
.cc-nav {
  display: flex; justify-content: space-between; gap: 12px;
  max-width: 560px; margin: 18px auto 0;
}

@media (min-width: 768px) {
  .cc-steps, .cc-body, .cc-nav { max-width: 680px; }
}

/* Documents (corpus admin) tab */
.docs-head, .docs-upload { max-width: 560px; margin: 0 auto; }
.docs-summary { font-size: 13px; color: var(--text); margin: 8px 0; }
.docs-state { margin-left: 6px; font-size: 12px; color: var(--muted); }
.docs-state.docs-failed { color: #b00; }
.docs-state.docs-running, .docs-state.docs-queued { color: var(--primary); }
.docs-list { list-style: none; margin: 8px auto 16px; padding: 0; max-width: 560px; }
.docs-item {
  padding: 6px 10px; border: 1px solid rgba(0,0,0,.08); border-radius: 6px;
  margin-bottom: 4px; font-size: 13px; word-break: break-all;
}
.docs-upload { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 12px; }
.docs-input { display: none; }
.docs-pick { display: inline-block; cursor: pointer; }
.docs-chosen { font-size: 12px; word-break: break-all; }
.docs-hint { font-size: 12px; margin: 2px 0; }
#docs-progress { white-space: pre-line; align-self: stretch; }
.cc-prompt-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.cc-reset { font-size: 12px; padding: 4px 8px; flex: none; }

/* Prompt editor (admin hub) */
.prompt-editor { display: flex; flex-direction: column; gap: 8px; max-width: 820px; }
.prompt-editor .prompt-text { width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.4; padding: 10px; }
.prompt-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }
.prompt-section-l { margin: 10px 0 2px; }
.prompt-actions { margin-top: 4px; }
.prompt-history { margin-top: 8px; }
.prompt-vers { list-style: none; padding: 0; margin: 6px 0 0; }
.prompt-ver { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; }
.prompt-ver-meta { font-size: 12px; color: var(--muted); }

/* ---- booking ------------------------------------------------------------ */
.booking-card { max-width: 440px; position: relative; }
.bk-close {
  position: absolute; top: 12px; right: 14px; border: none; background: none;
  font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer;
}
.bk-person { margin-bottom: 18px; }
.bk-person h3 { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.bk-muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.bk-service {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  padding: 10px 12px; margin-bottom: 8px; border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px; background: var(--bg); cursor: pointer;
}
.bk-service:hover:not(:disabled) { border-color: var(--primary); }
.bk-service:disabled { opacity: .5; cursor: default; }
.bk-svc-title { font-size: 15px; color: var(--text); font-weight: 600; }
.bk-svc-meta { font-size: 13px; color: var(--muted); }
.bk-svc-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.bk-crumb { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.bk-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-slot {
  padding: 8px 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 9px;
  background: var(--bg); font-size: 14px; color: var(--text); cursor: pointer;
}
.bk-slot:hover { border-color: var(--primary); background: var(--user-bubble); }
.bk-tz { font-size: 12px; color: var(--muted); margin-top: 10px; }
.bk-when { font-size: 15px; color: var(--text); font-weight: 600; margin: 4px 0 12px; }
.bk-pay-note { font-size: 13px; color: var(--text); background: var(--user-bubble);
  padding: 8px 10px; border-radius: 8px; }
.bk-done { text-align: center; padding: 8px 0 4px; }
.bk-done-head { font-size: 17px; font-weight: 600; color: var(--text); margin: 0 0 8px; }
.bk-mine-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.08);
}
.bk-mine-link { margin-top: 14px; text-align: center; }

/* ---- bookable console --------------------------------------------------- */
/* Paired fields. A flex row could not shrink number inputs below their
   intrinsic width (~20 characters), so the third field in a row hung off the
   edge of the modal on a narrow window — the whole "Slot step" control was
   unreachable. Grid columns with a 0 floor can shrink, and auto-fit drops to
   one per row when even that will not fit. */
.cn-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; align-items: end;
}
.cn-row label { min-width: 0; }
.cn-row input, .cn-row select { width: 100%; min-width: 0; }
.cn-check { flex-direction: row !important; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.cn-check input { width: auto; }
#cn-hours { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
#cn-preview-out { margin-top: 12px; }

/* --- Talks catalog tab --------------------------------------------------- */
.cat-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cat-tools { display: flex; align-items: center; gap: 6px; }
.cat-search { padding: 6px 10px; border: 1px solid rgba(0,0,0,.14); border-radius: 8px; font-size: 13px; min-width: 180px; }
.cat-wrap { overflow-x: auto; border: 1px solid rgba(0,0,0,.08); border-radius: 10px; }
.cat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cat-table th, .cat-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,.05); vertical-align: top; }
.cat-table thead th { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-weight: 600; white-space: nowrap; z-index: 1; }
.cat-th[data-sort] { cursor: pointer; user-select: none; }
.cat-th[data-sort]:hover { color: var(--primary); }
.cat-table tbody tr:hover { background: rgba(0,0,0,.02); }
.cat-title { max-width: 380px; color: var(--text); }
.cat-c { white-space: nowrap; text-align: center; }

/* --- Fleet tab (platform owner, main#443) -------------------------------- */
.fleet-card { max-width: 980px; margin: 0 auto; }
.fleet-days { padding: 5px 8px; border: 1px solid rgba(0,0,0,.14); border-radius: 8px; font-size: 13px; background: var(--surface); color: var(--text); }
.fleet-table td { white-space: nowrap; }
.fleet-table .fleet-num { text-align: right; font-variant-numeric: tabular-nums; }
.fleet-key { font-size: 11px; }
.fleet-sub { font-size: 11px; }
.fleet-sub.fleet-warn { color: var(--accent); font-weight: 600; }
.fleet-chip { display: inline-block; padding: 1px 7px; margin: 1px 0; border-radius: 999px; font-size: 11px; border: 1px solid rgba(0,0,0,.12); color: var(--text); }
.fleet-chip[data-ch="whatsapp"] { border-color: var(--accent); }
.fleet-chip[data-ch="app"], .fleet-chip[data-ch="web"] { border-color: var(--primary); }
.fleet-tick.fleet-on { color: var(--primary); font-weight: 600; }
.fleet-table tfoot td { font-weight: 600; border-top: 2px solid rgba(0,0,0,.12); border-bottom: none; }

/* --- App builds tab (platform owner) ------------------------------------- */
.builds-page { max-width: 980px; margin: 0 auto; }
.build-card-list { display: grid; gap: 12px; }
.build-card { background: var(--surface); border: 1px solid rgba(0,0,0,.08); border-radius: 10px; padding: 12px 14px; }
.build-card .usage-h { margin-top: 0; }
.build-key { font-size: 11px; }
.build-controls { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: start; }
.build-check { flex-direction: row; align-items: center; gap: 7px; margin: 0; }
.build-check input, .build-targets input { width: auto; }
.build-targets { display: flex; flex-wrap: wrap; gap: 8px 14px; border: 0; padding: 0; margin: 0; min-width: 0; }
.build-targets legend { color: var(--muted); font-size: 12px; padding: 0; width: 100%; }
.build-live-refused { flex-basis: 100%; font-size: 12px; }
.build-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; margin-top: 12px; }
.build-dates h4 { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.build-dates p { margin: 0; font-size: 13px; }
.build-release-meta { line-height: 1.5; }
.build-results { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12px; }
.build-results li { display: flex; justify-content: space-between; gap: 12px; margin: 2px 0; }
.build-results span { color: var(--muted); }
.build-results strong { text-align: right; }
.build-now { border-top: 1px solid rgba(0,0,0,.07); margin-top: 12px; padding-top: 10px; }
.build-request { margin-left: 8px; font-size: 13px; }
.build-now p { margin: 5px 0 0; font-size: 12px; }
.builds-msg:empty { display: none; }
.build-unavailable { margin: 4px 0; }
.cat-c a { text-decoration: none; color: var(--primary); font-size: 15px; }
.cat-foot { margin-top: 8px; font-size: 12px; }

/* --- Material, Bookings, Classes tabs (main#267) ------------------------- */
.mat-section { margin: 0 0 18px; }
.mat-section > summary { font-size: 14px; color: var(--primary); cursor: pointer; margin: 0 0 8px; font-weight: 600; }
.mat-excluded { margin-top: 10px; }
.mat-excluded summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.mat-th[data-sort] { cursor: pointer; user-select: none; }
.mat-th[data-sort]:hover { color: var(--primary); }
.bkl-past { opacity: .6; }
.bkl-note { font-size: 12px; margin-top: 2px; }
.bkv { margin-top: 18px; }
.bkv > summary { font-size: 14px; color: var(--primary); cursor: pointer; margin: 0 0 8px; font-weight: 600; }
.bkv-help { font-size: 12px; margin: 0 0 8px; }
.bkv-who { font-size: 13px; margin: 12px 0 4px; }
.bkv-row { padding: 8px 0; border-top: 1px solid rgba(0,0,0,.06); }
.bkv-title { font-size: 14px; }
.bkv-now { font-size: 12px; }
.bkv-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.bkv-edit [hidden] { display: none; }
.bkv-ring { font-size: 13px; white-space: nowrap; }
.bkv-allow { flex: 1 1 220px; min-width: 0; max-width: 100%; font: inherit; font-size: 13px; }
.bkv-msg { font-size: 12px; }
.cn-badge-off { background: rgba(0,0,0,.07); color: var(--muted); }
.cn-badge-alarm { background: rgba(192,57,43,.12); color: #C0392B; }
.cat-table tr[hidden] { display: none; }
/* An owner's version list under a Material row (main#1039): stays at the
   left edge of the scrolling table, readable at phone width. */
.mat-versions-row td { white-space: normal; }
.mat-versions-row .docs-item { word-break: normal; overflow-wrap: break-word; }
.mat-versions-row .docs-list { margin: 4px 0 8px; max-width: min(520px, calc(100vw - 64px));
  position: sticky; left: 10px; }
.mat-versions-row p { position: sticky; left: 10px; max-width: min(520px, calc(100vw - 64px)); }

/* --- Events (public schedule) -------------------------------------------- */
.landing-events { margin: 18px 0 6px; text-align: left; }
.ev-h { font-size: 15px; color: var(--primary); margin: 0 0 10px; }
.ev-list { display: flex; flex-direction: column; gap: 10px; }
.ev-card { background: var(--surface); border: 1px solid rgba(0,0,0,.08); border-radius: 12px; padding: 12px 14px; }
.ev-title { font-weight: 600; color: var(--text); font-size: 14px; }
.ev-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.ev-link { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--primary); text-decoration: none; }
.ev-link:hover { text-decoration: underline; }
.ev-synced { margin-top: 10px; font-size: 12px; text-align: center; }

/* --- Bookable console: upcoming sessions --------------------------------- */
#cn-sessions { margin: 10px 0 16px; }
.cn-sess-h { font-size: 14px; color: var(--primary); margin: 0 0 8px; }
.cn-sess-list { display: flex; flex-direction: column; gap: 8px; }
.cn-sess { background: var(--surface); border: 1px solid rgba(0,0,0,.08); border-radius: 10px; padding: 10px 12px; }
.cn-sess-prov { opacity: .65; border-style: dashed; }
.cn-sess-when { font-weight: 600; font-size: 13.5px; color: var(--text); }
.cn-sess-who { font-size: 13px; color: var(--text); margin-top: 2px; }
.cn-sess-svc { color: var(--muted); }
.cn-sess-badge { margin-left: 6px; font-size: 11px; background: rgba(0,0,0,.07); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.cn-sess-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-style: italic; }
.cn-sess-none, .cn-sess-tz { font-size: 12px; }
/* Schedule tab / console in reading order (main#138): sessions, preview, rules. */
.cn-h { font-size: 14px; color: var(--primary); margin: 0 0 8px; }
.cn-section { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid rgba(0,0,0,.06); }
.cn-section:last-child { border-bottom: 0; }
.cn-tab { max-width: 560px; margin: 0 auto; }
.cn-sess-await { border-color: var(--primary); border-width: 1.5px; }
.cn-badge-await { background: var(--primary); color: #fff; }
.cn-badge-ok { background: rgba(46,125,50,.12); color: #2E7D32; }
.cn-sess-dur { font-weight: 400; color: var(--muted); }
.cn-sess-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cn-sess-actions .btn-primary, .cn-sess-actions .btn-ghost { padding: 6px 12px; font-size: 13px; }
.cn-sess-deadline { font-size: 12px; }
.cn-pending-note { font-size: 13px; color: var(--primary); margin: 0 0 8px; }
.cn-past { margin-top: 10px; }
.cn-past summary { font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 8px; }
.cn-preview-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cn-svc { flex: 1; min-width: 0; }

/* --- Mailing-list signup + subscribers ------------------------------------ */
.ml-box { margin-top: 14px; text-align: left; }
.ml-lead { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }
.ml-form { display: flex; gap: 8px; }
.ml-form input[type="email"] { flex: 1; padding: 8px 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 8px; font-size: 14px; }
.ml-msg { font-size: 13px; color: var(--primary); margin: 6px 0 0; }
.ml-unsub { opacity: .5; }
/* main#816: the box after a sign-up, and the page the mail's link opens */
.ml-sent { background: var(--surface); border: 1px solid rgba(0,0,0,.08); border-radius: 14px; padding: 16px; display: grid; gap: 6px; color: var(--text); }
.ml-sent b { font-size: 17px; }
.ml-sent p { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.ml-sent .ml-lead { margin-top: 4px; }
.ml-linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }
.nl-page { margin-top: 0; gap: 16px; padding-top: 10px; }
.nl-mark { margin: 0; font-size: 15px; font-weight: 700; color: var(--primary); }
.nl-h { margin: 18px 0 0; font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--text); }
.nl-p { margin: 0; font-size: 15.5px; color: var(--text); overflow-wrap: anywhere; }
.nl-quiet { margin: 0; font-size: 14px; color: var(--muted); }
.nl-cta { display: block; width: 100%; box-sizing: border-box; text-align: center; text-decoration: none; }
.nl-form { width: 100%; display: grid; gap: 16px; }
.nl-email { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 8px; font-size: 15px; background: #fff; color: var(--text); }
.nl-msg { margin: 0; font-size: 13px; color: var(--primary); }

/* --- first-run getting-started card (app.js _addGettingStarted) -------------
   Sits in the message stream as a card rather than a bubble: it is the platform
   speaking, not the companion, and it must not read as something the persona
   said. Collapses to a single summary line once seen, so it stays reachable
   without ever being in the way again. */
.gs-card {
  align-self: stretch;
  max-width: 100%;
  margin: 6px 0 2px;
  background: var(--surface);
  border: 1px solid var(--user-bubble);
  border-radius: 14px;
  overflow: hidden;
  /* .messages is a column flex container, so its children shrink by default.
     A card taller than the remaining space was being squeezed, and `overflow:
     hidden` turned that into silently truncated text — the closing footers just
     stopped mid-sentence. Never shrink; let the thread scroll instead. */
  flex-shrink: 0;
}
.gs-summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.gs-summary::-webkit-details-marker { display: none; }
.gs-summary::before {
  content: "›";
  color: var(--primary);
  font-size: 18px;
  line-height: 1;
  transition: transform .15s ease;
}
.gs-card[open] .gs-summary::before { transform: rotate(90deg); }
.gs-body { padding: 0 16px 14px; }
.gs-intro { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.gs-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.gs-step { display: flex; gap: 12px; align-items: flex-start; }
.gs-num {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.gs-step-title { margin: 0 0 2px; font-weight: 600; color: var(--text); font-size: 14px; }
.gs-step-body  { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.gs-footer { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.gs-footer + .gs-footer { margin-top: 8px; }

/* Worked example inside the getting-started card. Labelled quotes, not bubbles:
   a bubble here would read as something the companion had just said, and the
   first screen is the worst place to make someone work out which messages are
   real. */
.gs-ex {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 2px solid var(--primary);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
}
.gs-ex-title {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}
.gs-ex-turn { margin: 0 0 7px; font-size: 14px; line-height: 1.5; color: var(--text); }
.gs-ex-turn:last-of-type { margin-bottom: 0; }
.gs-ex-turn.it { color: var(--muted); }
.gs-ex-who {
  display: inline-block;
  min-width: 74px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: none;
}
.gs-ex-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); font-style: italic; }

/* --- toolkits ------------------------------------------------------------
   Dr Vos's three surfaces, in his vocabulary: the toolkits, and the meaning
   dashboard. Deliberately a full page rather than a modal — the self-reflection
   battery is twenty-one items, and a modal that scrolls inside a scrolling page
   is the worst place to answer them. */
.tk-owner { font-size: 13px; color: var(--muted); }
.tk-tabs {
  display: flex; gap: 4px; padding: 8px 16px 0;
  background: var(--surface); border-bottom: 1px solid rgba(0,0,0,.08);
}
.tk-tab {
  border: 0; background: none; padding: 8px 12px 10px; cursor: pointer;
  font-size: 14px; color: var(--muted); font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tk-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tk-screen { padding: 18px 16px 40px; gap: 0; max-width: 720px; width: 100%; margin: 0 auto; }

.tk-sec { margin-bottom: 26px; }
.tk-sec h3 { font-size: 15px; color: var(--primary); margin: 0 0 4px; }
.tk-sub { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.tk-start { background: var(--user-bubble); border-radius: 14px; padding: 16px; }
.tk-grid { display: flex; flex-direction: column; gap: 8px; }

.tk-card {
  display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid rgba(0,0,0,.10); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; font-family: inherit;
}
.tk-card:hover { border-color: var(--primary); }
.tk-card.rec { border-left: 3px solid var(--accent); }
.tk-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tk-card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.tk-card-intent { font-size: 13px; color: var(--text); opacity: .82; }
.tk-card-meta { font-size: 12px; color: var(--muted); }
.tk-state { font-size: 11px; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.tk-state-completed { background: #E2EFE4; color: #2E7D32; }
.tk-state-in_progress { background: #F1E7D8; color: #8A6A34; }

.tk-why { margin-bottom: 10px; }
.tk-why-reason { font-size: 14px; color: var(--text); margin: 0 0 4px; }
.tk-grounds summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.tk-grounds p { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.tk-gap {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  border-top: 1px solid rgba(0,0,0,.08); padding-top: 12px; margin-top: 4px;
}

/* --- one toolkit, as a form --- */
.tk-crumb { align-self: flex-start; padding-left: 0; margin-bottom: 6px; }
.tk-title { font-size: 19px; color: var(--text); margin: 0 0 4px; }
.tk-meta { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.tk-intent { font-size: 14px; color: var(--text); margin: 0 0 14px; line-height: 1.55; }
.tk-note {
  font-size: 13px; color: var(--text); background: var(--user-bubble);
  border-radius: 10px; padding: 10px 12px; margin: 0 0 18px; line-height: 1.5;
}
.tk-part { margin-bottom: 24px; }
.tk-part h3 { font-size: 15px; color: var(--primary); margin: 0 0 10px; }
/* Authored line breaks are structure, not stray whitespace: step bodies carry
   multi-paragraph instructions, and s1b of the Serenity Prayer exercise IS
   Niebuhr's prayer set as verse. Collapsing those into one run-on line
   would flatten the author's work, which is the whole thing the protocol
   format exists to preserve. */
.tk-instruction { font-size: 14px; color: var(--text); line-height: 1.6;
  margin: 0 0 14px; white-space: pre-wrap; }
.tk-legend {
  display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted);
  margin-bottom: 14px;
}
.tk-item { margin-bottom: 18px; }
/* The author's own heading, the first line of a step body. Subordinate to the
   part heading (.tk-part h3) — it labels one item, not a section. */
.tk-lead { font-size: 14px; font-weight: 600; color: var(--text);
  margin: 0 0 6px; line-height: 1.4; white-space: pre-wrap;
  word-wrap: break-word; }
.tk-q { font-size: 14px; color: var(--text); margin: 0 0 8px; line-height: 1.5;
  white-space: pre-wrap; }
.tk-scale { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-radio { cursor: pointer; }
.tk-radio input { position: absolute; opacity: 0; pointer-events: none; }
.tk-radio span {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.14); background: var(--surface);
  font-size: 14px; color: var(--muted);
}
.tk-radio input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.tk-radio input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.tk-choices { display: flex; flex-direction: column; gap: 6px; }
.tk-choice { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.tk-text {
  width: 100%; padding: 10px 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 9px;
  font-family: inherit; font-size: 15px; color: var(--text); background: var(--bg); resize: vertical;
}
.tk-text:focus { outline: none; border-color: var(--primary); }
.tk-actions { position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); }
.tk-actions .btn-primary { width: 100%; }
.tk-err { color: #C0392B; font-size: 14px; }

/* --- scores + dashboard --- */
.tk-scores { width: 100%; border-collapse: collapse; font-size: 14px; }
.tk-scores td { padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.06); vertical-align: baseline; }
.tk-num { font-weight: 600; text-align: right; width: 60px; padding-right: 10px !important; }
.tk-muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.tk-tiles { display: flex; gap: 10px; margin-bottom: 20px; }
.tk-tile {
  flex: 1; background: var(--surface); border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px; padding: 14px 10px; text-align: center;
}
.tk-tile-n { display: block; font-size: 20px; font-weight: 650; color: var(--primary); }
.tk-tile-l { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.tk-prog {
  background: var(--surface); border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 8px;
}
.tk-prog summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  cursor: pointer; list-style: none;
}
.tk-prog summary::-webkit-details-marker { display: none; }
.tk-prog-body { padding-top: 10px; }
.tk-ans { margin-bottom: 12px; }
.tk-a { font-size: 14px; color: var(--text); margin: 0; padding-left: 10px;
  border-left: 2px solid var(--user-bubble); white-space: pre-wrap; }

/* The author's own words back, on the result screen. Set apart from the
   platform's own text: this is Dr Vos talking to the person, not the app. */
.tk-said { background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0; padding: 14px 16px; }
.tk-said-line { font-size: 15px; color: var(--text); line-height: 1.6;
  margin: 0 0 8px; white-space: pre-wrap; }
.tk-said-line:last-child { margin-bottom: 0; }

/* --- member programs ---------------------------------------------------- */
.pr-screen { display: block; }
.pr-card { margin-bottom: 8px; }
.pr-empty { color: var(--muted); font-size: 14px; }
.pr-code {
  margin-top: 22px; padding: 16px; border-radius: 12px; background: var(--surface);
  border: 1px solid rgba(0,0,0,.08);
}
.pr-code label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.pr-code-row { display: flex; gap: 8px; }
.pr-code-row input {
  min-width: 0; flex: 1; padding: 10px 12px; border: 1px solid rgba(0,0,0,.14);
  border-radius: 9px; background: var(--bg); color: var(--text); font: inherit;
  text-transform: uppercase;
}
.pr-items { display: flex; flex-direction: column; gap: 8px; }
.pr-item {
  background: var(--surface); border: 1px solid rgba(0,0,0,.10); border-radius: 12px;
  overflow: hidden;
}
.pr-item.open { border-color: var(--primary); }
.pr-item-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; }
.pr-item-open {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  cursor: pointer; font: inherit; font-size: 15px; font-weight: 600; text-align: left;
  padding: 2px;
}
.pr-state-none { color: var(--muted); }
.pr-state-opened { background: #F1E7D8; color: #8A6A34; }
.pr-state-done { background: #E2EFE4; color: #2E7D32; }
.pr-item-content {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 4px 14px 16px; font-size: 14px; line-height: 1.55;
}
.pr-item-content video, .pr-item-content iframe { display: block; width: 100%; max-width: 100%; border: 0; }
.pr-youtube { width: 100%; aspect-ratio: 16 / 9; }
.pr-youtube iframe { height: 100%; }
.pr-pdf { height: min(65vh, 620px); border: 1px solid rgba(0,0,0,.10) !important; }
.pr-text { width: 100%; }
.pr-text p { margin: 0 0 10px; }
.pr-text ul { margin: 0 0 10px; padding-left: 22px; }
.pr-external { color: var(--primary); overflow-wrap: anywhere; }
.pr-chat-note { margin: 0; color: var(--muted); font-size: 13px; }
.pr-chat-strip {
  align-self: stretch; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
  padding: 9px 12px; border-radius: 10px; background: var(--surface);
  border: 1px solid rgba(0,0,0,.08); font-size: 13px;
}
.pr-chat-strip strong { margin-right: auto; }
@media (max-width: 420px) {
  .pr-code-row { flex-direction: column; }
  .pr-code-row .btn-primary { width: 100%; }
}

/* --- add to home screen --------------------------------------------------
   Offered rather than explained. One bundle serves every front door, so before
   the per-persona manifests an installed icon said "WaP" on Android and
   "MindfulnessInc" on iOS whatever door it came from. */
#install-slot:empty { display: none; }
.install-hint {
  display: block; margin: 10px auto 0; font-size: 13px; color: var(--muted);
  line-height: 1.5; max-width: 320px; position: relative;
}
button.install-hint { border: 1px dashed rgba(0,0,0,.18); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; font-family: inherit; }
button.install-hint:hover { border-color: var(--primary); color: var(--text); }
.install-x {
  border: 0; background: none; color: var(--muted); font-size: 16px;
  line-height: 1; padding: 0 4px; cursor: pointer; font-family: inherit;
}

/* --- persona screens and flows (main#709): the persona-ui/v1 renderer --- */
.pui-root { padding: 0; }
.pui-screen { max-width: 640px; width: 100%; margin: 0 auto; padding: 20px 16px 28px; box-sizing: border-box; flex: 1; }
.pui-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pui-title { font-size: 24px; font-weight: 650; line-height: 1.25; margin: 6px 0 14px; }
.pui-title:focus { outline: none; }
.pui-title label { font: inherit; }
.pui-text { margin: 0 0 12px; line-height: 1.5; }
h2.pui-text, .pui-section-title { font-size: 18px; font-weight: 650; margin: 18px 0 10px; }
.pui-caption { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.pui-markdown p { margin: 0 0 12px; line-height: 1.5; }
.pui-markdown a { color: var(--primary); }
.pui-image { display: block; max-width: 100%; height: auto; border-radius: 12px; margin: 0 0 14px; }
.pui-tiles { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.pui-tile {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px; border-radius: 14px; border: 1px solid rgba(0,0,0,.08);
  border-left: 5px solid var(--primary); background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.pui-tile:hover { background: color-mix(in srgb, var(--surface) 92%, var(--primary)); }
.pui-tile:focus-visible, .pui-tab:focus-visible, .pui-choice-input:focus-visible + label, .pui-input:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.pui-icon { font-size: 22px; line-height: 1; width: 28px; text-align: center; flex: 0 0 auto; }
.pui-tile-text { display: flex; flex-direction: column; gap: 2px; }
.pui-tile-title { font-weight: 650; font-size: 16px; }
.pui-tile-sub { color: var(--muted); font-size: 14px; }
/* Pictures of parts and chapters (main#895): the picture above the same words.
   A list with pictures becomes a grid of cards on a wide screen. */
.pui-tile-pic {
  flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden;
  border-left-width: 1px;
}
.pui-tile-pic .pui-tile-text { padding: 12px 16px 16px; }
.pui-tile-img {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  background: color-mix(in srgb, var(--surface) 85%, var(--primary));
}
.pui-tiles:has(.pui-tile-pic) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.pui-banner { width: 100%; max-height: 50vh; object-fit: cover; }
/* Share cards (main#1239): a small Share pill on a part's tile, a "Send this
   card" row at the end of a chapter, and a bottom sheet with the card and the
   owner's lines. */
.pui-tile-share { position: relative; }
.pui-tile-share > .pui-tile:not(.pui-tile-pic) { padding-right: 104px; }
.pui-tile-share > .pui-tile-pic .pui-tile-text { padding-right: 104px; }
.pui-share-pill {
  position: absolute; right: 12px; bottom: 14px; min-height: 36px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--primary); background: var(--surface);
  color: var(--primary); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.pui-tile-share > .pui-tile:not(.pui-tile-pic) + .pui-share-pill { top: 50%; bottom: auto; transform: translateY(-50%); }
.pui-share-pill:focus-visible, .pui-share-row:focus-visible, .pui-share-line:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.pui-share-row-wrap { margin: 18px 0 4px; }
.pui-share-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left;
  border: 1px solid rgba(0,0,0,.08); border-radius: 12px; background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.pui-share-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.pui-sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 24, 40, .45);
}
.pui-sheet {
  width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: var(--surface);
  color: var(--text); border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.pui-share-card {
  display: block; width: min(100%, 280px); height: auto; margin: 0 auto 12px; border-radius: 10px;
}
.pui-sheet-title { font-size: 18px; margin: 0 0 2px; }
.pui-share-lines { display: grid; gap: 8px; margin: 12px 0 4px; }
.pui-share-line { width: 100%; min-height: 48px; }
.pui-share-status:empty { display: none; }
.pui-sheet-cancel { width: 100%; margin-top: 8px; min-height: 44px; }
.pui-btn { margin: 4px 8px 12px 0; }
.pui-tabs {
  display: flex; justify-content: space-around; gap: 4px; flex: 0 0 auto;
  border-top: 1px solid rgba(0,0,0,.06); background: var(--surface);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  position: sticky; bottom: 0;
}
.pui-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: transparent; color: var(--muted); font: inherit; font-size: 13px;
  padding: 6px 4px; border-radius: 10px; cursor: pointer; min-height: 44px;
}
.pui-tab[aria-current="page"] { color: var(--primary); font-weight: 650; }
.pui-facts-link { margin-top: 22px; }
.pui-back { padding-left: 0; margin-bottom: 4px; }
.pui-leave { display: block; margin-top: 18px; color: var(--muted); }
.pui-question { border: 0; padding: 0; margin: 0; min-width: 0; }
.pui-question legend { padding: 0; }
.pui-hint { color: var(--muted); margin: -6px 0 12px; }
.pui-optional { color: var(--muted); font-weight: 400; font-size: .8em; }
.pui-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 2px solid #c9c2b6; border-radius: 10px; background: var(--surface); color: var(--text);
}
textarea.pui-input { resize: vertical; min-height: 120px; }
.pui-input[aria-invalid="true"] { border-color: #b42318; }
.pui-field { margin: 0 0 14px; }
.pui-field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.pui-choices { display: grid; gap: 8px; }
.pui-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.pui-choice-input { width: 22px; height: 22px; margin: 0; accent-color: var(--primary); flex: 0 0 auto; }
.pui-choice label { flex: 1; padding: 8px 0; cursor: pointer; }
.pui-scale { grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); }
.pui-scale .pui-choice { flex-direction: column; gap: 2px; }
.pui-scale-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.pui-other { margin: 4px 0 0 32px; padding-left: 12px; border-left: 4px solid #c9c2b6; }
.pui-other label { display: block; margin-bottom: 6px; }
.pui-error { color: #b42318; font-weight: 600; margin: 0 0 8px; }
.pui-error-summary {
  border: 3px solid #b42318; border-radius: 10px; padding: 10px 14px; margin: 0 0 16px;
  background: var(--surface);
}
.pui-error-summary h2 { font-size: 17px; margin: 0 0 6px; }
.pui-error-summary p { margin: 0; }
.pui-error-summary a { color: #b42318; font-weight: 600; }
.pui-error-summary:focus { outline: 3px solid var(--accent); }
.pui-consent { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.pui-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
/* A step in two sizes (main#885): the Quick / In depth choice above the step. */
.pui-sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pui-sizes .pui-size { flex: 1 1 auto; min-height: 44px; }
/* A background quest (main#886): the panel on its step, and the home screen's quest bar. */
.pui-quest-panel { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin: 16px 0 0; }
.pui-quest-badge { font-weight: 600; margin: 0 0 4px; }
.pui-quest-bar { margin: 0 0 20px; }
.pui-quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pui-quest { border: 1px solid rgba(0,0,0,.1); border-radius: 12px; padding: 12px 14px; }
.pui-quest-title { font-size: 17px; margin: 0 0 2px; }
.pui-quest-progress { width: 100%; height: 8px; margin: 6px 0 4px; accent-color: var(--accent); }
.pui-quest-checkin { margin-top: 8px; }
/* Then vs now (main#887): an assessment's takes side by side, and the retake offer. */
.pui-tvn { margin: 16px 0; }
.pui-tvn-scroll { overflow-x: auto; max-width: 100%; }
.pui-tvn-table { border-collapse: collapse; width: 100%; font-size: 15px; }
.pui-tvn-table th, .pui-tvn-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(0,0,0,.1); vertical-align: top; }
.pui-tvn-table thead th { font-weight: 600; }
.pui-tvn-total th, .pui-tvn-total td { font-weight: 600; }
.pui-tvn-bar { display: block; width: 100%; min-width: 48px; height: 6px; margin-top: 4px; accent-color: var(--accent); }
/* A score (main#960, option A): the total of the real maximum, the band strip
   with the reader's band marked, the band's words; on a finished chapter, a card. */
.pui-score { margin: 4px 0 0; }
.pui-score-total { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 14px; }
.pui-score-n { font-size: 56px; line-height: 1; font-weight: 650; color: var(--primary); font-variant-numeric: tabular-nums; }
.pui-score-of { font-size: 17px; color: var(--muted); }
.pui-score-strip { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.pui-score-band { display: grid; gap: 6px; font-size: 13px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pui-score-band::before { content: ""; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--muted) 30%, transparent); }
.pui-score-here { color: var(--text); font-weight: 650; }
.pui-score-here::before { background: var(--primary); }
.pui-score-open { margin: 8px 0 0; }
.pui-score-box { background: var(--surface); border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent); border-radius: 12px; padding: 14px 16px; margin: 12px 0 4px; }
.pui-score-label { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.pui-score-card .pui-score-n { font-size: 40px; }
.pui-score-card .pui-score-total, .pui-score-card .pui-score-strip { margin-bottom: 12px; }
.pui-score-lead { margin: 0; font-weight: 600; }
.pui-retake { border: 1px solid rgba(0,0,0,.1); border-left: 3px solid var(--accent); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.pui-retake-text { margin: 0 0 8px; }
/* Reader paths (main#889): the member's path on home, its options, and an author's note. */
.pui-path { border: 1px solid rgba(0,0,0,.1); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.pui-path .pui-section-title { margin-top: 0; }
.pui-path-progress { width: 100%; height: 8px; margin: 6px 0 4px; accent-color: var(--accent); }
.pui-path-pace { margin: 6px 0 8px; }
.pui-path-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pui-path-option { border-top: 1px solid rgba(0,0,0,.08); padding-top: 10px; }
.pui-path-option-title { font-size: 17px; margin: 0 0 2px; }
.pui-path-note { border-left: 3px solid var(--accent); padding: 6px 12px; margin: 8px 0 12px; background: rgba(0,0,0,.03); border-radius: 0 8px 8px 0; }
.pui-path-note-title { font-size: 16px; margin: 0 0 4px; }
.pui-quest-checked { margin: 8px 0 0; }
/* Safety rail (main#890): the pause on a step, the pause screen, and the help link. */
.pui-rail-bar { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.pui-rail-pause { font-size: 15px; }
.pui-rail { text-align: center; }
.pui-rail-breathe { font-size: 18px; line-height: 1.5; margin: 12px auto 20px; max-width: 32em; }
.pui-breathe { width: 96px; height: 96px; margin: 16px auto 8px; border-radius: 50%; background: var(--accent); opacity: .25; animation: pui-breathe 10s ease-in-out infinite; }
@keyframes pui-breathe { 0%, 100% { transform: scale(.6); } 50% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pui-breathe { animation: none; transform: scale(.8); } }
.pui-rail-help { border: 1px solid rgba(0,0,0,.12); border-radius: 12px; padding: 14px 16px; margin: 0 auto 16px; max-width: 32em; }
.pui-rail-help p { margin: 0 0 10px; }
.pui-rail-link { display: inline-block; text-decoration: none; }
.pui-rail-status { min-height: 1.4em; }
.pui-rail .pui-actions { justify-content: center; flex-wrap: wrap; }
.pui-cya dl { margin: 0; }
.pui-cya-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.pui-cya-row dt { font-weight: 600; grid-column: 1 / -1; }
.pui-cya-row dd { margin: 0; }
.pui-cya-change { text-align: right; }
.pui-status { color: var(--primary-dark); font-weight: 600; }
.pui-alert { color: #b42318; font-weight: 600; }
.pui-fact-list { list-style: none; padding: 0; margin: 0; }
.pui-fact { padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.pui-fact-label { font-size: 16px; margin: 0 0 4px; }
.pui-fact-text { margin: 0 0 4px; white-space: pre-wrap; }
.pui-fact-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* What we keep about you (main#891). */
.pui-kept-group, .pui-kept-actions, .pui-kept-all, .pui-kept-account { margin-top: 22px; }
.pui-kept-prompt { margin-top: 14px; }
.pui-kept-prompt-pick { flex-wrap: wrap; }
.pui-kept-prompt-text { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px;
  padding: 8px; border-radius: 8px; border: 1px solid rgba(0,0,0,.2); }
.pui-danger { color: #b42318; }
.pui-danger-btn { background: #b42318; }
.pui-preview-note { margin: 14px 16px; padding: 10px 12px; border-radius: 10px; background: var(--user-bubble); }

/* --- owner console: Screens & flows (main#710), persona-ui-editor.js --- */
.pue { max-width: 1180px; margin: 0 auto; }
.pue-h { font-size: 20px; margin: 0 0 6px; }
.pue-h3 { font-size: 16px; margin: 0 0 8px; }
.pue-h4 { font-size: 14px; margin: 10px 0 6px; }
.pue-small { font-size: 13px; }
.pue-state { margin: 8px 0; }
.pue-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pue-msg { min-height: 1.2em; margin: 6px 0; }
.pue-msg.error { color: #C0392B; font-weight: 600; }
.pue-summary { border: 2px solid #C0392B; border-radius: 10px; padding: 10px 14px; margin: 8px 0 12px; }
.pue-summary ul { margin: 0; padding-left: 18px; }
.pue-summary li { margin: 4px 0; }
.pue-goto { padding: 2px 8px; margin-left: 6px; }
.pue-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) {
  .pue-cols { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
  .pue-preview { position: sticky; top: 8px; }
}
.pue-details { border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; background: var(--surface); }
.pue-details > summary { cursor: pointer; font-weight: 650; padding: 4px 0; }
.pue-details .pue-details { margin: 8px 0; }
.pue-item { border-left: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); padding: 6px 0 6px 10px; margin: 8px 0; }
.pue-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.pue-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0; }
.pue-tools .btn-ghost { padding: 4px 8px; }
.pue-remove { color: #C0392B; }
.pue-field, .pue-locale, .pue-check, .pue-adder, .pue-action, .pue-cond, .pue-store, .pue-group { margin: 8px 0; }
.pue-locale { border: 0; padding: 0; min-width: 0; }
.pue-locale legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.pue-field label, .pue-adder label { display: block; font-weight: 600; margin-bottom: 4px; }
.pue-row { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 6px; align-items: start; margin: 4px 0; }
/* One language: the label is screen-reader only and takes no grid cell, so
   the input gets the full width instead of the 80px label column (steward#678). */
.pue-row-one { grid-template-columns: minmax(0, 1fr); }
.pue-lang { font-size: 13px; color: var(--muted); padding-top: 8px; }
.pue-input { width: 100%; box-sizing: border-box; padding: 8px 10px; font: inherit; border: 1px solid #c9c2b6; border-radius: 8px; background: var(--surface); color: var(--text); }
textarea.pue-input { resize: vertical; }
.pue-json { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.pue-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pue-check .pue-small { flex-basis: 100%; margin: 0; }
.pue-adder { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; }
.pue-adder label { grid-column: 1 / -1; margin-bottom: 0; }
.pue-add { margin: 4px 6px 4px 0; }
.pue-cond-values { border: 0; padding: 0 0 0 12px; margin: 4px 0; }
.pue-newfact { border: 1px dashed color-mix(in srgb, var(--primary) 50%, transparent); border-radius: 8px; padding: 8px 12px; }
.pue-problem { margin: 4px 0 0; font-size: 14px; }
.pue-warning { color: #8a5a00; }
.pue-picture-img { display: block; max-width: 240px; width: 100%; height: auto; border-radius: 10px; margin: 6px 0; }
.pue-file { display: inline-block; position: relative; overflow: hidden; cursor: pointer; }
.pue-file.pue-busy { opacity: .6; cursor: progress; }
[data-path][aria-invalid="true"] > .pue-input, [data-path][aria-invalid="true"] .pue-input { border-color: #C0392B; }
.pue-diff { padding-left: 18px; }
.pue-diff li { margin: 4px 0; }
.pue-diff-added strong { color: #1e7b45; }
.pue-diff-removed strong { color: #C0392B; }
.pue-versions { padding-left: 18px; }
/* Statistics (main#730): counts the server already aggregated and suppressed. */
.pue-stats-flow { border-left: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); padding: 6px 0 6px 10px; margin: 10px 0; }
.pue-table-wrap { overflow-x: auto; max-width: 100%; }
.pue-stats-table { border-collapse: collapse; margin: 6px 0 10px; font-size: 14px; }
.pue-stats-table caption { text-align: left; font-weight: 600; padding: 4px 0; }
.pue-stats-table th, .pue-stats-table td { border-bottom: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); padding: 4px 10px 4px 0; text-align: left; vertical-align: top; }
.pue-stats-table .pue-count { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pue-suppressed { color: var(--muted); font-style: italic; }
.pue-cross-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pue-cross-pick .pue-field { flex: 1 1 160px; margin: 0; }
.pue-h5 { font-size: 14px; margin: 10px 0 4px; }
.pue-preview-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.pue-preview-controls .pue-field { margin: 0; flex: 1 1 140px; }
.pue-phone {
  width: 100%; max-width: 380px; height: 680px; margin: 10px auto 6px; border: 10px solid #222;
  border-radius: 36px; overflow: hidden; background: var(--bg, #F7F4EE); box-sizing: border-box;
}
.pue-phone-screen { height: 100%; overflow-y: auto; display: flex; flex-direction: column; padding: 0; }
.pue-phone-screen .pui-screen { padding: 16px 14px 20px; }
.pue-summary-soft { border-color: #d9a441; }
/* Orientation (main#850): how the page works, where a block sits, the part
   of the preview being edited, a screen nothing opens, what was just drafted. */
.pue-how { border-left: 3px solid var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); border-radius: 0 10px 10px 0; padding: 8px 14px; margin: 8px 0 12px; }
.pue-how ul { margin: 0; padding-left: 18px; }
.pue-how li { margin: 2px 0; }
.pue-crumb { min-width: 0; overflow-wrap: anywhere; }
.pue-unreached { border: 1px dashed #d9a441; border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.pue-unreached p { margin: 0 0 6px; }
.pue-fresh { font-weight: 600; color: #1e7b45; margin: 0 0 6px; }
.pue-phone-screen .pue-spot { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* "Describe it" (main#714): the owner's words, drafted by the model. */
.pue-describe { border: 1px solid var(--border, #d8d8d8); border-radius: 10px; padding: 10px 14px; margin: 8px 0 12px; }
.pue-describe label { display: block; font-weight: 600; margin: 6px 0 4px; }
.pue-describe-text { width: 100%; box-sizing: border-box; font: inherit; }
.pue-describe-msg { min-height: 1.2em; margin: 6px 0; }
.pue-describe-problems { margin: 0; padding-left: 18px; }
.pue-describe-problems li { margin: 4px 0; }

/* --- owner console: Cabinet drawer pages (main#868) --- */
.dpe { max-width: 1120px; margin: 0 auto; padding: 0 0 48px; overflow-wrap: anywhere; }
.dpe-head h2 { font-size: 22px; margin: 0 0 6px; }
.dpe-status { line-height: 1.45; margin: 10px 0 6px; }
.dpe-message { min-height: 1.3em; margin: 6px 0; }
.dpe-message.error { color: #b42318; font-weight: 600; }
.dpe-actions, .dpe-switches, .dpe-question-tools {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.dpe-actions { margin: 10px 0 4px; }
.dpe-switches { margin: 12px 0; max-width: 100%; }
.dpe-switch {
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; padding: 7px 12px; cursor: pointer;
}
.dpe-switch.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.dpe-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
@media (min-width: 900px) {
  .dpe-columns { grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); align-items: start; }
  .dpe-preview { position: sticky; top: 8px; }
}
.dpe-form, .dpe-preview, .dpe-section, .dpe-questions { min-width: 0; }
.dpe-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .dpe-photos { grid-template-columns: minmax(0, 1fr); } }
.dpe-photo, .dpe-section, .dpe-questions, .dpe-preview {
  border: 1px solid color-mix(in srgb, var(--muted) 28%, transparent); border-radius: 12px;
  background: var(--surface); padding: 12px; box-sizing: border-box;
}
.dpe-photo h4, .dpe-section h3, .dpe-questions h3, .dpe-preview h3 { margin: 0 0 10px; font-size: 16px; }
.dpe-photo-image, .dpe-preview-image { display: block; width: 100%; height: auto; object-fit: cover; border-radius: 8px; }
.dpe-photo-image { aspect-ratio: 4 / 3; margin-bottom: 10px; }
.dpe-photo-fallback, .dpe-preview-fallback {
  display: grid; place-items: center; min-height: 120px; padding: 12px; box-sizing: border-box;
  border-radius: 8px; background: color-mix(in srgb, var(--muted) 14%, var(--surface)); color: var(--muted);
  text-align: center;
}
.dpe-photo-fallback { margin-bottom: 10px; }
.dpe-file { display: inline-block; position: relative; overflow: hidden; cursor: pointer; }
.dpe-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dpe-section, .dpe-questions { margin-top: 14px; }
.dpe-field { margin: 0 0 12px; }
.dpe-field > label, .dpe-question > label { display: block; font-weight: 600; margin: 0 0 5px; }
.dpe-help { font-size: 13px; line-height: 1.4; margin: -6px 0 12px; }
.dpe-question { border-top: 1px solid color-mix(in srgb, var(--muted) 22%, transparent); padding: 10px 0; }
.dpe-question-tools { margin-top: 5px; }
.dpe-question-tools .btn-ghost { padding: 5px 8px; }
.dpe-remove { color: #b42318; }
.dpe-preview { background: var(--bg, #f7f4ee); }
.dpe-preview-body { min-width: 0; }
.dpe-preview-image, .dpe-preview-fallback { margin-bottom: 14px; max-height: 480px; }
.dpe-preview-passage { white-space: pre-wrap; line-height: 1.55; }
.dpe-preview-line { font-size: 18px; font-weight: 650; line-height: 1.4; }
.dpe-preview-questions { padding-left: 22px; }
.dpe-preview-questions li { margin: 0 0 8px; line-height: 1.45; }
.dpe-problems { border: 2px solid #b42318; border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.dpe-problems p { font-weight: 650; margin: 0 0 5px; }
.dpe-problems ul { margin: 0; padding-left: 20px; }
.dpe-small { font-size: 13px; }

/* The library's statistics page (main#751). */
.ls-page { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; color: var(--text); overflow-y: auto; height: 100%; box-sizing: border-box; }
.ls-title { font-size: 26px; margin: 0 0 6px; color: var(--primary-dark); }
.ls-note { color: var(--muted); margin: 6px 0; font-size: 14px; line-height: 1.5; }
.ls-muted { color: var(--muted); }
.ls-range { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.ls-range-btn { padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.ls-range-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ls-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0; }
.ls-tile { background: var(--surface); border-radius: 10px; padding: 14px; border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent); }
.ls-tile-label { font-size: 13px; color: var(--muted); }
.ls-tile-value { font-size: 26px; font-weight: 650; margin: 4px 0; color: var(--primary-dark); }
.ls-tile-note { font-size: 13px; color: var(--muted); line-height: 1.4; }
.ls-section { margin: 28px 0 8px; }
.ls-h { font-size: 18px; margin: 0 0 6px; color: var(--primary-dark); }
.ls-chart { background: var(--surface); border-radius: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent); }
.ls-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 2px; height: 120px; border-bottom: 1px solid color-mix(in srgb, var(--muted) 40%, transparent); }
.ls-bar { flex: 1 1 0; min-width: 1px; max-width: 28px; height: 100%; display: flex; align-items: flex-end; }
.ls-bar:hover { background: color-mix(in srgb, var(--muted) 12%, transparent); }
.ls-bar-fill { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; }
.ls-bar-none { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 35%, transparent) 0 2px, transparent 2px 5px) bottom / 100% 8px no-repeat; }
.ls-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.ls-table-wrap { margin: 12px 0; font-size: 14px; }
.ls-table-wrap summary { cursor: pointer; color: var(--muted); }
.ls-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.ls-table th, .ls-table td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--muted) 20%, transparent); }
.ls-ranked { list-style: none; margin: 8px 0 0; padding: 0; }
.ls-rank { margin: 0 0 10px; }
.ls-rank-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.ls-rank-name { overflow-wrap: anywhere; }
.ls-rank-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.ls-rank-bar { height: 4px; border-radius: 2px; background: var(--primary); margin-top: 3px; }
.ls-theme { border-bottom: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); padding: 8px 0; }
.ls-theme-head { cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.ls-questions { margin: 8px 0 4px; padding: 0 0 0 18px; }
.ls-question { margin: 0 0 8px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.ls-question-meta { display: block; font-size: 12px; color: var(--muted); }

/* ---- The free book companion door (main#670): /boek, option B ----------------
   The persona's own tokens only (docs/ui-principles.md §4). One column, the
   width of a phone; on a wide screen it stays a readable column. */
.bd-page { flex: 1; display: flex; flex-direction: column; min-height: 100%; background: var(--bg); color: var(--text); max-width: 640px; width: 100%; margin: 0 auto; font-size: 15px; line-height: 1.45; padding-top: env(safe-area-inset-top, 0px); box-sizing: border-box; }
.bd-page button { font: inherit; cursor: pointer; }
.bd-closed { padding: 40px 16px; color: var(--muted); text-align: center; }
.bd-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); }
.bd-back { border: 0; background: none; padding: 6px 0; color: var(--primary); font-weight: 600; text-decoration: none; white-space: nowrap; }
.bd-head-t { flex: 1; min-width: 0; }
.bd-head-t b { display: block; font-size: 15px; }
.bd-head-t i { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.bd-pad { flex: 1; display: grid; gap: 14px; align-content: start; padding: 18px 16px 24px; }
.bd-intro { display: grid; gap: 2px; }
.bd-title { margin: 0; font-size: 21px; line-height: 1.2; color: var(--primary-dark, var(--text)); text-wrap: balance; }
.bd-small { margin: 0; color: var(--muted); font-size: 14px; }
.bd-starters { display: grid; gap: 8px; }
.bd-starter { display: block; width: 100%; text-align: left; border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent); background: var(--surface); color: var(--text); border-radius: 12px; padding: 11px 13px; font-size: 15px; }
.bd-composer { position: sticky; bottom: 0; display: grid; gap: 6px; padding: 8px 14px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); }
.bd-ask { display: flex; gap: 8px; align-items: center; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); background: var(--surface); border-radius: 22px; padding: 5px 5px 5px 14px; }
.bd-ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 6px 0; }
.bd-send { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; }
.bd-send:disabled, .bd-ask input:disabled { opacity: .45; }
.bd-send svg { width: 16px; height: 16px; }
.bd-honest { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.bd-chat { flex: 1; display: grid; gap: 12px; align-content: start; padding: 16px 16px 8px; }
.bd-me { justify-self: end; max-width: 82%; background: var(--user-bubble, var(--surface)); color: var(--text); border-radius: 16px 16px 4px 16px; padding: 9px 13px; overflow-wrap: anywhere; }
.bd-it { max-width: 92%; background: var(--bot-bubble, var(--surface)); border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent); border-radius: 16px 16px 16px 4px; padding: 11px 13px; display: grid; gap: 8px; }
.bd-it p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.bd-src { justify-self: start; font-size: 12.5px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); border-radius: 8px; padding: 4px 9px; }
.bd-follow { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-follow button { border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 14px; text-align: left; }
.bd-slowed { justify-self: center; text-align: center; font-size: 13px; color: var(--muted); max-width: 88%; display: grid; gap: 6px; justify-items: center; }
.bd-dots { display: inline-flex; gap: 4px; }
.bd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .6; }
.bd-invite, .bd-rest { border-radius: 16px; padding: 14px 16px; display: grid; gap: 10px; }
.bd-invite { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); }
.bd-rest { background: var(--surface); border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); }
.bd-invite b, .bd-rest b { font-size: 16px; }
.bd-invite p, .bd-rest p { margin: 0; color: var(--muted); font-size: 14.5px; }
.bd-primary { display: block; width: 100%; text-align: center; border: 0; background: var(--primary); color: #fff; border-radius: 12px; padding: 14px; font-weight: 600; font-size: 16px; }
.bd-error { justify-self: center; margin: 0; font-size: 13.5px; color: var(--muted); }
.bd-carry { background: var(--surface); border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; font-size: 14px; }
.bd-carry span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-right: 8px; vertical-align: 1px; }
.bd-carry i { font-style: normal; }
.bd-rows { display: grid; background: var(--surface); border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 14px; overflow: hidden; }
.bd-rows a { display: flex; justify-content: space-between; padding: 13px 14px; color: var(--text); text-decoration: none; font-size: 15px; }
.bd-rows a + a { border-top: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); }
.bd-rows a i { font-style: normal; color: var(--muted); }
.bd-page :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* The author's page (main#1040), option B: the group headings as one list,
   one group open at a time; each question a chip. Colours are the persona's. */
.bd-lead { margin: 6px 0 0; color: var(--text); font-size: 15px; }
.bd-groups { background: var(--surface); border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 14px; overflow: hidden; }
.bd-group + .bd-group { border-top: 1px solid color-mix(in srgb, var(--muted) 25%, transparent); }
.bd-gh { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 14px; border: 0; background: none; color: inherit; text-align: left; }
.bd-gh b { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 600; color: var(--primary-dark, var(--text)); overflow-wrap: anywhere; }
.bd-gh i { font-style: normal; font-size: 13px; color: var(--muted); white-space: nowrap; }
.bd-gh svg { width: 14px; height: 14px; color: var(--muted); flex: none; transition: transform .15s ease; }
.bd-open .bd-gh svg { transform: rotate(180deg); }
.bd-gh-one { margin: 0; padding: 12px 14px 8px; font-size: 15.5px; font-weight: 600; color: var(--primary-dark, var(--text)); }
.bd-chips { display: none; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.bd-open .bd-chips, .bd-one .bd-chips { display: flex; }
.bd-q { border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent); background: var(--bg); color: var(--text); border-radius: 18px; padding: 7px 12px; font-size: 14.5px; line-height: 1.3; text-align: left; overflow-wrap: anywhere; }
.bd-follow-l { width: 100%; font-size: 12.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .bd-gh svg { transition: none; } }


/* Member habits (persona-platform main#892): the choice under a reply, the
   replies under a waiting question, and "Your habits" in Account. Calm, the
   persona's own tokens, no counts or badges anywhere. */
.habit-offer { align-self: flex-start; max-width: 85%; display: flex; flex-direction: column; gap: 8px; }
.habit-text {
  margin: 0; padding: 8px 12px; border-left: 3px solid var(--primary);
  background: var(--bot-bubble); border-radius: 6px; color: var(--text);
  overflow-wrap: anywhere;
}
.habit-chips { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; }
.habit-chip {
  padding: 8px 14px; border: 1px solid rgba(0,0,0,.14); border-radius: 18px;
  background: var(--bg); font-size: 14px; color: var(--text); cursor: pointer;
  white-space: normal;
}
.habit-chip:hover { border-color: var(--primary); background: var(--user-bubble); }
.habit-chip:disabled { opacity: .6; cursor: default; }
.habit-note { margin: 0; }
.habit-row { margin: 10px 0 14px; }
.habit-row .habit-text { margin-bottom: 4px; }
.habit-row .auth-note { margin: 2px 0 6px; }
.habit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }

/* Open sign-up on the web (main#897): the screen's own heading inside the
   auth card, and the 18+ tick, which must not take the text inputs' width. */
.auth-heading { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); text-align: left; }
.auth-form .auth-check {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--text); text-align: left; cursor: pointer;
}
.auth-form .auth-check input { width: 20px; height: 20px; padding: 0; margin: 0; flex: none; accent-color: var(--primary); }

/* The owner console's Book door panel (main#1040, book-door-editor.js). */
.bde { max-width: 720px; margin: 0 auto; padding: 0 0 48px; overflow-wrap: anywhere; }
.bde-title { margin: 0 0 4px; }
.bde-status p { margin: 6px 0; }
.bde fieldset { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.bde legend { font-weight: 650; font-size: 17px; padding: 0; margin: 0 0 8px; }
.bde-field { display: block; margin: 0 0 12px; }
.bde-label { display: block; font-weight: 600; margin: 0 0 5px; }
.bde input[type="text"], .bde textarea { width: 100%; box-sizing: border-box; font: inherit; }
.bde-group { border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent); border-radius: 12px; padding: 12px; margin: 0 0 12px; background: var(--surface); }
.bde-group-top { display: flex; gap: 8px; align-items: flex-end; }
.bde-group-top .bde-field { flex: 1; min-width: 0; }
.bde-moves { display: flex; gap: 4px; margin-bottom: 12px; }
.bde-moves .btn-ghost, .bde-qdel { min-width: 40px; padding: 6px 10px; }
.bde-questions { display: grid; gap: 6px; }
.bde-qrow { display: flex; gap: 6px; align-items: center; }
.bde-qrow input { flex: 1; min-width: 0; }
.bde-group-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 10px; }
.bde-gdel { color: #b42318; }
.bde-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.bde-open { margin-left: auto; }
.bde-msg { min-height: 1.4em; margin: 10px 0 0; }
