/* =====================================================================
   Tuck Me In — parent dashboard · Quizzes / Videos / Chat
   Uses the design tokens defined in dashboard/index.html (:root):
   paper / ink / brass, --f-display / --f-body / --f-mono, --radius*.
   Prefixes: qc- shared · qz- quizzes · ct- chat.
   ===================================================================== */

/* Toasts must float above modal overlays (overlay z = 1100). */
.toast { z-index: 1300; }

/* ---------- shared bits ---------- */
.qc-mono { font-family: var(--f-mono); letter-spacing: 0.02em; }
.qc-lc { text-transform: none; letter-spacing: 0; font-family: var(--f-body); color: var(--muted); }
.qc-empty {
  padding: 16px; border: 1px dashed var(--rule); border-radius: var(--radius-sm);
  color: var(--ink-soft); font-size: 13.5px; background: rgba(0, 0, 0, 0.012);
}
.qc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qc-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 720px) { .qc-grid-2, .qc-grid-3 { grid-template-columns: 1fr; } }

textarea {
  width: 100%; background: var(--paper-warm); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: 10px; padding: 10px 13px;
  font-family: var(--f-body); font-size: 14.5px; line-height: 1.45; resize: vertical;
  transition: border-color 160ms ease, background 160ms ease;
}
textarea:focus { outline: none; border-color: var(--ink); background: var(--paper-2); }
textarea::placeholder { color: var(--muted); }

button.xs { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
button.ghost.qc-danger { color: var(--bad); border-color: rgba(139, 45, 45, 0.45); }
button.ghost.qc-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }

.qc-check {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin: 8px 0 0;
  font-family: var(--f-body); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink-soft);
}
.qc-check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
.qc-switch {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; margin: 0;
  font-family: var(--f-body); font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--ink-soft);
}
.qc-switch input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }

/* Segmented control */
.qc-seg {
  display: inline-flex; flex-wrap: wrap; gap: 0; padding: 3px;
  border: 1px solid var(--rule-strong); border-radius: 11px; background: var(--paper-warm);
}
.qc-seg button {
  background: transparent; color: var(--ink-soft); border: 0; border-radius: 8px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 600;
}
.qc-seg button:hover { background: rgba(14, 21, 48, 0.06); color: var(--ink); transform: none; }
.qc-seg button.on { background: var(--ink); color: var(--paper); }

.qc-trigger .qc-seg { margin-bottom: 10px; }
.qc-trig-pane { margin-top: 2px; }
.qc-days { display: flex; gap: 4px; }
.qc-days button {
  width: 38px; height: 40px; padding: 0; justify-content: center;
  background: var(--paper-warm); color: var(--muted); border: 1px solid var(--rule-strong);
  font-family: var(--f-mono); font-size: 12px;
}
.qc-days button:hover { background: var(--paper-deep); color: var(--ink); transform: none; }
.qc-days button.on { background: var(--brass); border-color: var(--brass); color: #fff; }

/* Progress bar */
.qc-bar { height: 6px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; flex: 1; min-width: 60px; }
.qc-bar > span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width 200ms ease; }
.qc-bar.is-ok > span { background: var(--ok); }
.qc-bar.is-warn > span { background: var(--warn); }

/* Live indicators */
.qc-livedot {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ok);
}
.qc-livedot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  animation: qc-pulse 1.6s ease-in-out infinite;
}
.qc-live { color: var(--warn); font-weight: 600; font-size: 12.5px; }
.qc-pulse { animation: qc-pulse 1.6s ease-in-out infinite; }
@keyframes qc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.qc-filter {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px;
  padding: 8px 12px; margin-bottom: 10px; border-radius: var(--radius-sm);
  background: var(--paper-warm); border: 1px solid var(--rule);
}
.qc-modal-body { margin-top: 8px; }

/* ---------- Quizzes tab: assignments ---------- */
.qz-asg {
  display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
  padding: 14px 4px; border-top: 1px solid var(--rule);
}
.qz-asg:first-child { border-top: 0; }
.qz-asg.is-off .qz-asg-main { opacity: 0.6; }
.qz-asg-main { min-width: 0; flex: 1; }
.qz-asg-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.qz-asg-title > span:first-child { font-family: var(--f-display); font-weight: 500; font-size: 1.05rem; }
.qz-asg-trig { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.qz-asg-last { margin-top: 7px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.qz-asg-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex: none; }
@media (max-width: 720px) {
  .qz-asg { flex-direction: column; }
  .qz-asg-actions { align-items: flex-start; }
}

/* ---------- attempts ---------- */
.qz-att { border-top: 1px solid var(--rule); }
.qz-att:first-child { border-top: 0; }
.qz-att-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; cursor: pointer; border-radius: 8px; }
.qz-att-row:hover { background: var(--paper); }
.qz-att-row:focus-visible { outline: 1.5px solid var(--brass); }
.qz-att-caret { width: 14px; color: var(--muted); font-size: 12px; }
.qz-att-main { flex: 1; min-width: 0; }
.qz-att-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.qz-att-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; }
.qz-att-when { white-space: nowrap; }
.qz-att.is-live .qz-att-row { background: var(--warn-bg); }
.qz-att-detail { padding: 2px 4px 14px 30px; }

.qz-path { list-style: none; margin: 4px 0 8px; padding: 0; counter-reset: none; }
.qz-path > li { position: relative; padding: 9px 0 9px 16px; border-left: 2px solid var(--rule); }
.qz-path > li::before {
  content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--paper-2); border: 2px solid var(--rule-strong);
}
.qz-path > li.is-live::before { border-color: var(--warn); background: var(--warn); animation: qc-pulse 1.6s infinite; }
.qz-path-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.qz-path-n { color: var(--muted); font-size: 11px; }
.qz-path-ans { margin-top: 3px; font-size: 13.5px; color: var(--ink); }
.qz-path-text {
  margin: 6px 0 0; padding: 7px 12px; border-left: 3px solid var(--brass-soft);
  background: var(--paper-warm); border-radius: 0 8px 8px 0; font-style: italic; color: var(--ink-2); font-size: 13.5px;
}
.qz-verdict { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }
.qz-verdict.ok { color: var(--ok); }
.qz-verdict.bad { color: var(--bad); }
.qz-vids { margin-top: 8px; display: grid; gap: 8px; max-width: 520px; }
.qz-vid { display: grid; gap: 5px; }
.qz-vid-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- library ---------- */
.qz-lib-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--rule); }
.qz-lib-row:first-child { border-top: 0; }
.qz-lib-row .grow { flex: 1; min-width: 0; }
.qz-lib-title { font-family: var(--f-display); font-size: 1.05rem; font-weight: 500; }
@media (max-width: 720px) { .qz-lib-row { flex-direction: column; align-items: flex-start; } }

/* ---------- uploads ---------- */
.qz-upload { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qz-drop {
  display: flex; align-items: center; justify-content: center; min-height: 64px; cursor: pointer;
  border: 1.5px dashed var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper-warm);
  font-family: var(--f-body); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink-soft);
  transition: border-color 160ms ease, background 160ms ease;
}
.qz-drop:hover { border-color: var(--ink); background: var(--paper-2); color: var(--ink); }
.qz-sv-preview { width: 100%; max-height: 240px; margin-top: 10px; border-radius: var(--radius-sm); background: var(--night); }

/* ---------- editor overlay ---------- */
.qz-ed-overlay { padding: 14px; align-items: stretch; }
.qz-ed-overlay > .overlay-card { max-width: 1180px !important; max-height: none; height: calc(100vh - 28px); display: flex; flex-direction: column; }
.qz-ed-overlay .qc-modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.qz-ed { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.qz-ed-meta { margin-bottom: 10px; }
.qz-ed-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.qz-ed-bar .grow { flex: 1; }
.qz-ed-bar select.qz-addkind { width: auto; padding: 8px 12px; font-size: 13px; }
.qz-ed-issues:not(:empty) { margin-top: 10px; }
.qz-issues { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warn-bg); border: 1px solid rgba(181, 126, 42, 0.32); font-size: 13px; }
.qz-issues.is-err { background: var(--bad-bg); border-color: rgba(139, 45, 45, 0.3); }
.qz-issues ul { margin: 4px 0 0; padding-left: 18px; }
.qz-issues a { text-decoration: underline; text-decoration-color: var(--rule-strong); }
.qz-issues a:hover { color: var(--brass); }
.qz-ed-list { flex: 1; overflow: auto; padding: 12px 2px 20px; }
.qz-ed-canvas { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 380px; gap: 12px; margin-top: 10px; }
@media (max-width: 960px) { .qz-ed-canvas { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } }

/* list-view node cards */
.qz-ncard {
  position: relative; background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 14px 16px 16px 52px; margin-bottom: 10px;
}
.qz-ncard.is-start { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.qz-ncard.is-trap { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.qz-ncard-num { position: absolute; left: 16px; top: 16px; font-family: var(--f-display); font-style: italic; font-size: 1.1rem; color: var(--brass); }
.qz-list-add { padding: 4px 0 10px; }
.qz-flash { animation: qz-flash 1.6s ease; }
@keyframes qz-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--brass-glow); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* node editor component */
.qz-ne > * + * { margin-top: 10px; }
.qz-ne-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.qz-ne-head .grow { flex: 1; }
.qz-kind {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: var(--ink); color: var(--paper);
}
.qz-kind.k-info { background: var(--brass); }
.qz-kind.k-end { background: var(--ok); }
.qz-media { display: flex; flex-wrap: wrap; gap: 8px; }
.qz-media-tile {
  position: relative; width: 132px; height: 92px; border-radius: 10px; overflow: hidden;
  background: var(--night); border: 1px solid var(--rule);
}
.qz-media-tile img, .qz-media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qz-media-ph { display: grid; place-items: center; height: 100%; font-size: 26px; color: var(--paper); }
.qz-media-kind {
  position: absolute; left: 6px; top: 6px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.1em;
  text-transform: uppercase; background: rgba(11, 18, 40, 0.7); color: var(--paper); padding: 2px 6px; border-radius: 5px; pointer-events: none;
}
button.qz-media-x {
  position: absolute; right: 5px; top: 5px; width: 22px; height: 22px; padding: 0; justify-content: center;
  border-radius: 50%; background: rgba(11, 18, 40, 0.75); border: 0; color: #fff; font-size: 14px;
}
button.qz-media-x:hover { background: var(--bad); }
.qz-media-add {
  width: 132px; height: 92px; display: grid; place-items: center; cursor: pointer; margin: 0;
  border: 1.5px dashed var(--rule-strong); border-radius: 10px; background: var(--paper-warm);
  font-family: var(--f-body); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink-soft);
}
.qz-media-add:hover { border-color: var(--ink); color: var(--ink); }
.qz-opts { display: grid; gap: 6px; }
.qz-opt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qz-opt > input[data-f="opt-label"], .qz-opt > input[data-opt] { flex: 1 1 160px; width: auto; padding: 8px 11px; }
.qz-opt select { width: auto; flex: 0 1 220px; padding: 8px 10px; font-size: 13px; }
.qz-then { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.qz-opt-correct { margin: 0; cursor: pointer; display: inline-flex; letter-spacing: 0; }
.qz-opt-correct input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qz-opt-correct span {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 14px;
  border: 1px solid var(--rule-strong); color: var(--rule-strong); background: var(--paper-warm);
}
.qz-opt-correct input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.qz-opt-correct input:focus-visible + span { outline: 1.5px solid var(--brass); outline-offset: 2px; }
.qz-ne select, .qz-ne input:not([type]), .qz-ne input[type="number"] { padding: 9px 11px; font-size: 14px; }

/* ---------- canvas ---------- */
.qz-cv {
  position: relative; overflow: hidden; min-height: 360px; border: 1px solid var(--rule); border-radius: var(--radius);
  background-color: var(--paper);
  background-image: radial-gradient(circle, rgba(140, 132, 112, 0.35) 1px, transparent 1.2px);
  background-size: 22px 22px; cursor: grab; touch-action: none; user-select: none; outline: none;
}
.qz-cv.is-panning { cursor: grabbing; }
.qz-cv.is-linking, .qz-cv.is-linking * { cursor: crosshair !important; }
.qz-cv-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.qz-cv-svg { position: absolute; left: -5000px; top: -5000px; overflow: visible; pointer-events: none; }
.qz-edge-line { fill: none; stroke: var(--ink-soft); stroke-width: 1.8; }
.qz-edge.is-trap .qz-edge-line { stroke: var(--bad); stroke-dasharray: 5 4; }
.qz-edge-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.qz-edge:hover .qz-edge-line { stroke: var(--bad); stroke-width: 2.4; }
.qz-edge-label {
  font-family: var(--f-mono); font-size: 11px; fill: var(--ink-2);
  paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; pointer-events: none;
}
.qz-arrowhead { fill: var(--ink-soft); }
.qz-edge-temp { fill: none; stroke: var(--brass); stroke-width: 2; stroke-dasharray: 6 4; }

.qz-cn {
  position: absolute; background: var(--paper-2); border: 1.3px solid var(--rule-strong); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(14, 21, 48, 0.08); cursor: move; font-size: 13px;
}
.qz-cn.is-start { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg), 0 6px 18px rgba(14, 21, 48, 0.08); }
.qz-cn.is-trap { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.qz-cn.is-selected { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(199, 160, 116, 0.45), 0 10px 24px rgba(14, 21, 48, 0.14); }
.qz-cn.is-drop { border-color: var(--brass); background: var(--paper-warm); }
.qz-cn.is-dragging { box-shadow: 0 18px 40px rgba(14, 21, 48, 0.22); z-index: 2; }
.qz-cn-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px 0; }
.qz-cn-head code { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.qz-cn-start { color: var(--ok); font-size: 14px; }
.qz-cn-trap {
  margin-left: auto; background: var(--bad); color: #fff; border-radius: 6px; padding: 0 6px; font-size: 12px; line-height: 18px;
}
.qz-cn-pts { margin-left: auto; font-family: var(--f-mono); font-size: 10.5px; color: var(--brass); }
.qz-cn-trap + .qz-cn-pts { margin-left: 4px; }
.qz-cn-title { padding: 5px 10px 8px; font-family: var(--f-display); font-size: 14.5px; line-height: 1.3; word-break: break-word; }
.qz-cn-media { padding: 0 10px 8px; font-size: 12px; color: var(--ink-soft); }
.qz-cn-row {
  position: relative; display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 22px 5px 10px;
  border-top: 1px solid var(--rule); font-size: 12.5px;
}
.qz-cn-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-ok { color: var(--ok); font-weight: 700; }
.qz-cn-endtag { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.qz-cn-finish { color: var(--ok); font-weight: 600; padding-right: 10px; }
.qz-port, .qz-port-demo {
  position: absolute; right: -7px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%;
  background: var(--brass); border: 2px solid var(--paper-2); box-shadow: 0 0 0 1px var(--brass); cursor: crosshair;
  transition: transform 120ms ease;
}
.qz-port:hover { transform: scale(1.35); }
.qz-port-demo { position: relative; display: inline-block; right: auto; top: auto; margin: 0 2px -2px; width: 10px; height: 10px; }
.qz-cv-tools {
  position: absolute; right: 10px; top: 10px; display: flex; align-items: center; gap: 4px; padding: 4px;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 10px; cursor: default;
}
.qz-cv-zoom { font-size: 11px; min-width: 42px; text-align: center; }
.qz-cv-hint {
  position: absolute; left: 10px; bottom: 8px; max-width: calc(100% - 20px); pointer-events: none;
  font-size: 11px; color: var(--muted); background: rgba(244, 239, 230, 0.88);
  padding: 3px 8px; border-radius: 6px;
}
.qz-cv-side {
  overflow: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px;
}
.qz-side-head { margin-bottom: 10px; }
.qz-side-empty { padding: 6px 2px; }

/* ---------- preview ---------- */
.qz-pv-step { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.qz-pv-title { font-family: var(--f-display); font-weight: 450; font-size: 1.45rem; margin: 6px 0 4px; }
.qz-pv-body { margin: 0 0 8px; color: var(--ink-soft); white-space: pre-wrap; }
.qz-pv-media { display: grid; gap: 8px; margin: 10px 0; }
.qz-pv-media img, .qz-pv-media video { width: 100%; max-height: 300px; object-fit: contain; border-radius: 12px; background: var(--night); }
.qz-pv-watch { color: var(--warn); }
.qz-pv-ctrl { margin-top: 12px; display: grid; gap: 8px; }
button.qz-pv-opt { justify-content: flex-start; padding: 13px 16px; font-size: 14.5px; }
.qz-pv-multi { margin: 0; }
.qz-pv-score { font-family: var(--f-display); font-size: 2.6rem; line-height: 1.1; margin: 8px 0 4px; }
.qz-pv-score span { font-size: 1.2rem; color: var(--brass); font-style: italic; }

/* ---------- chat ---------- */
.ct-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; align-items: start; }
@media (max-width: 960px) { .ct-grid { grid-template-columns: 1fr; } }
.ct-grid .panel { margin: 0; }
.ct-main { display: flex; flex-direction: column; min-height: 520px; }
#ct-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ct-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.ct-head .grow { flex: 1; min-width: 160px; }
.ct-head h2 .qc-livedot { margin-left: 8px; }
.ct-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 10px 0 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--paper-warm); border: 1px solid var(--rule-strong); font-size: 13.5px;
}
.ct-banner.warn { background: var(--warn-bg); border-color: rgba(181, 126, 42, 0.32); margin: 0 0 12px; }
.ct-log {
  flex: 1; min-height: 300px; max-height: 58vh; overflow-y: auto; padding: 14px 4px;
  display: flex; flex-direction: column; gap: 6px;
}
.ct-empty { margin: auto; text-align: center; }
.ct-day { text-align: center; margin: 8px 0 4px; }
.ct-day span {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); background: var(--paper-warm); padding: 3px 10px; border-radius: 99px;
}
.ct-msg { display: flex; flex-direction: column; max-width: 74%; }
.ct-msg.is-parent { align-self: flex-end; align-items: flex-end; }
.ct-msg.is-child { align-self: flex-start; align-items: flex-start; }
.ct-bubble {
  padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.4;
}
.ct-msg.is-parent .ct-bubble { background: var(--ink); color: var(--paper); border-bottom-right-radius: 5px; }
.ct-msg.is-child .ct-bubble { background: var(--paper-warm); color: var(--ink); border: 1px solid var(--rule); border-bottom-left-radius: 5px; }
.ct-meta { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); margin: 3px 4px 0; }
.ct-tick { letter-spacing: -0.15em; margin-left: 2px; }
.ct-tick.is-read { color: var(--brass); font-weight: 700; }
.ct-compose { display: flex; gap: 8px; align-items: flex-end; padding-top: 10px; border-top: 1px solid var(--rule); }
.ct-compose textarea { resize: none; min-height: 44px; max-height: 140px; }
.ct-compose button { height: 44px; }
.ct-hist {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; text-align: left;
  background: transparent; color: var(--ink); border: 0; border-top: 1px solid var(--rule);
  border-radius: 0; padding: 10px 6px; font-weight: 500; line-height: 1.35;
}
.ct-hist:first-child { border-top: 0; }
.ct-hist:hover { background: var(--paper); transform: none; color: var(--ink); }
.ct-hist.is-on { background: var(--paper-warm); box-shadow: inset 3px 0 0 var(--brass); }
.ct-hist-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ct-hist-when { font-family: var(--f-mono); font-size: 11px; color: var(--ink-soft); margin-right: auto; }
.ct-hist-prev { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; display: inline-grid; place-items: center;
  background: var(--bad); color: #fff; font-family: var(--f-mono); font-size: 10px; font-weight: 600;
}

/* =====================================================================
   §9 categories
   ===================================================================== */
.qc-cat {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 99px;
  font-family: var(--f-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); line-height: 1.6; white-space: nowrap;
  vertical-align: middle;
}
.qc-cat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.qz-lib-title .qc-cat { margin-left: 6px; }
.qc-catfilter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.qc-catf {
  background: transparent; color: var(--ink-soft); border: 1px solid var(--rule-strong);
  padding: 6px 11px; font-size: 12px; border-radius: 99px;
}
.qc-catf[style]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.qc-catf:hover { background: var(--paper-warm); color: var(--ink); transform: none; border-color: var(--rule-strong); }
.qc-catf.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.qc-catf[style].on { background: var(--c); border-color: var(--c); color: #fff; }
.qc-catf[style].on::before { background: #fff; }
.qz-ed-meta { display: grid; grid-template-columns: 1.4fr 0.7fr 1.4fr; gap: 10px; }
@media (max-width: 860px) { .qz-ed-meta { grid-template-columns: 1fr; } }
select.qz-catsel { border-left: 6px solid var(--c, var(--rule-strong)); }

/* label styled as a button (file pickers) */
label.btn { margin: 0; text-transform: none; letter-spacing: 0; font-family: var(--f-body); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.xs { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

/* =====================================================================
   §10 wallpapers (same table as the agent + Flutter)
   ===================================================================== */
.qc-wp-urgent {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 24px, transparent 24px 48px),
    linear-gradient(to bottom, #E53935, #8E0000) !important;
}
.qc-wp-emergency { position: relative; isolation: isolate; }
.qc-wp-emergency::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(to bottom, transparent 10%, #B71C1C);
  animation: qc-emergency 2.8s ease-in-out infinite;
}
@keyframes qc-emergency { 0%, 100% { opacity: 0; } 50% { opacity: 0.85; } }

/* picker */
.qc-wps { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.qc-wp {
  position: relative; height: 62px; padding: 6px 8px; border-radius: 10px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: flex-start; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(14, 21, 48, 0.12); color: #0E1530;
  font-family: var(--f-body); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none;
  line-height: 1.15; margin: 0;
}
.qc-wp.is-dark { color: #fff; }
.qc-wp:hover { transform: translateY(-1px); border-color: var(--rule-strong); }
.qc-wp.on { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(199, 160, 116, 0.45); }
.qc-wp.on::after {
  content: "✓"; position: absolute; top: 4px; right: 6px; font-size: 12px; font-weight: 700;
}
.qc-wp span { position: relative; z-index: 1; text-align: left; }
.qc-wp-none, .qc-wp-upload {
  background: var(--paper-warm); color: var(--ink-soft); border: 1.5px dashed var(--rule-strong); box-shadow: none;
  align-items: center; justify-content: center;
}
.qc-wp-none span, .qc-wp-upload span { text-align: center; }
.qc-wp-upload:hover, .qc-wp-none:hover { border-color: var(--ink); color: var(--ink); }

/* avatars */
.qc-ava {
  flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden;
  background: var(--acc, #5B6CFF); color: #fff; line-height: 1; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.qc-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qc-ava.ct-me { background: var(--ink); color: var(--paper); font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.04em; }

/* =====================================================================
   §10 chat stage, persona bubbles, urgency
   ===================================================================== */
.ct-stage {
  flex: 1; display: flex; flex-direction: column; min-height: 300px; margin-top: 10px;
  border-radius: var(--radius-sm); overflow: hidden; transition: background 400ms ease;
}
.ct-stage .ct-log { flex: 1; padding: 14px 12px; position: relative; z-index: 1; }
.ct-stage.is-dark .ct-day span { background: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.85); }
.ct-stage.is-dark .ct-meta, .ct-stage.is-dark .ct-empty { color: rgba(255, 255, 255, 0.78); }
.ct-stage.is-dark .ct-tick.is-read { color: #FFE082; }
.ct-stage.is-dark .ct-msg.is-parent:not(.has-ava) .ct-bubble { background: #fff; color: var(--ink); }
.ct-stage .ct-msg.is-child .ct-bubble { background: #fff; border-color: rgba(14, 21, 48, 0.08); }
.ct-empty { color: var(--muted); }
.ct-msg-row { display: flex; align-items: flex-end; gap: 7px; }
.ct-msg.is-parent .ct-msg-row { flex-direction: row; }
.ct-msg.has-ava .ct-meta { margin-right: 40px; }
.ct-urgency {
  margin-top: 10px; padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13px;
  letter-spacing: 0.06em; display: flex; align-items: center; gap: 8px;
}
.ct-urgency.is-important { background: #FFF3D6; color: #8A5A00; border: 1px solid #FFB300; }
.ct-urgency.is-important::before { content: "!"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #FFB300; color: #fff; }
.ct-urgency.is-urgent { background: #E53935; color: #fff; letter-spacing: 0.2em; }
.ct-urgency.is-urgent::before { content: "⚠"; animation: qc-pulse 1.2s infinite; }
.ct-head-id { display: flex; align-items: center; gap: 12px; }
.ct-preview { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 0 10px 10px; background: var(--paper); }
.ct-preview .ct-stage { min-height: 0; }
.ct-log-preview { max-height: none; min-height: 0; overflow: visible; }

/* persona picker chips */
.ct-ppick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct-pchip {
  background: var(--paper-warm); color: var(--ink); border: 1px solid var(--rule-strong);
  padding: 4px 12px 4px 4px; border-radius: 99px; font-size: 13px; gap: 7px;
}
.ct-pchip:hover { background: var(--paper-deep); color: var(--ink); transform: none; border-color: var(--rule-strong); }
.ct-pchip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* personas manager */
.ct-prow { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--rule); }
.ct-prow:first-child { border-top: 0; }
.ct-prow .grow { flex: 1; min-width: 0; }
.ct-prow-name { font-family: var(--f-display); font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.ct-swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px rgba(14, 21, 48, 0.15); }
.ct-pform { margin-top: 14px; padding: 16px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); }
.ct-pform-top { display: flex; gap: 16px; align-items: flex-start; }
.ct-pform-top .grow { flex: 1; min-width: 0; }
.ct-pform-ava { padding-top: 20px; }
.ct-emojis { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ct-emoji {
  width: 38px; height: 38px; padding: 0; justify-content: center; font-size: 19px;
  background: var(--paper-warm); border: 1px solid var(--rule); color: inherit;
}
.ct-emoji:hover { background: var(--paper-deep); transform: none; border-color: var(--rule-strong); }
.ct-emoji.on { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(199, 160, 116, 0.5); background: var(--paper-2); }
input.ct-emoji-in { width: 70px; padding: 8px; text-align: center; font-size: 18px; }
.ct-accents { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct-accent { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--paper-2); box-shadow: 0 0 0 1px rgba(14, 21, 48, 0.2); }
.ct-accent:hover { transform: scale(1.08); }
.ct-accent.on { box-shadow: 0 0 0 2px var(--ink); }
.ct-accents input[type="color"] { width: 44px; height: 32px; padding: 2px; border-radius: 8px; cursor: pointer; }

/* =====================================================================
   §11/§12 Rainbow AI section
   ===================================================================== */
.ai-head { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.ai-title { font-family: var(--f-display); font-weight: 450; font-size: 1.45rem; margin: 0; letter-spacing: -0.01em; }
.ai-title em {
  font-style: italic; font-weight: 450;
  background: linear-gradient(90deg, #E53935, #F9A825, #43A047, #1E88E5, #7C4DFF);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ai-subtabs {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; margin: 0 0 14px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--paper-warm);
}
.ai-subtabs button {
  background: transparent; color: var(--ink-soft); border: 0; border-radius: 9px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 600;
}
.ai-subtabs button:hover { background: rgba(14, 21, 48, 0.06); color: var(--ink); transform: none; }
.ai-subtabs button.is-active { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 0 var(--rule-strong), 0 0 0 1px var(--rule); }
.ai-subtabs .badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--bad-bg); color: var(--bad); border: 1px solid rgba(139, 45, 45, 0.3);
  font-family: var(--f-mono); font-size: 10px; font-weight: 600;
}
.ai-subtabs .badge:empty { display: none; }
.qc-hint {
  margin: 6px 0 10px; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; color: #4B2FA8;
  background: rgba(124, 77, 255, 0.08); border: 1px solid rgba(124, 77, 255, 0.22); display: inline-block;
}
.qz-pv-ai {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 0 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.qz-pv-ai .mute { flex-basis: 100%; }

/* =====================================================================
   §14 trimmer + video tile trim button
   ===================================================================== */
.qz-media-tile.is-video { width: 180px; height: 128px; }
button.qz-media-trim {
  position: absolute; left: 6px; bottom: 24px; padding: 4px 8px; font-size: 11px; border-radius: 7px;
  background: rgba(11, 18, 40, 0.78); border: 0; color: #fff;
}
button.qz-media-trim:hover { background: var(--ink); transform: none; }
.qz-media-trimtxt {
  position: absolute; left: 6px; bottom: 6px; right: 6px; font-family: var(--f-mono); font-size: 9.5px;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qz-sv-trim { display: flex; align-items: center; gap: 10px; margin-top: 8px; }

.tr-stage { position: relative; background: var(--night); border-radius: 12px; overflow: hidden; display: grid; place-items: center; min-height: 200px; }
.tr-video { width: 100%; max-height: 340px; display: block; background: #000; cursor: pointer; }
.tr-loading { position: absolute; color: rgba(255, 255, 255, 0.8); }
.tr-strip-wrap { position: relative; height: 60px; margin: 14px 0 6px; }
.tr-strip { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 8px; background: var(--paper-deep); cursor: pointer; }
.tr-strip.is-empty { background: repeating-linear-gradient(45deg, var(--paper-warm) 0 10px, var(--paper-deep) 10px 20px); }
.tr-sel {
  position: absolute; top: -3px; bottom: -3px; border: 3px solid var(--brass); border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(244, 239, 230, 0.62);
}
.tr-strip-wrap { overflow: hidden; padding: 0; border-radius: 8px; }
.tr-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--bad); pointer-events: none; }
input.tr-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; background: transparent; border: 0;
  -webkit-appearance: none; appearance: none; pointer-events: none;
}
input.tr-range:focus { background: transparent; }
input.tr-range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
input.tr-range::-moz-range-track { height: 100%; background: transparent; }
input.tr-range::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 14px; height: 60px; border-radius: 6px; cursor: ew-resize;
  background: var(--brass); border: 2px solid var(--paper-2); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
input.tr-range::-moz-range-thumb {
  pointer-events: auto; width: 14px; height: 60px; border-radius: 6px; cursor: ew-resize;
  background: var(--brass); border: 2px solid var(--paper-2);
}
.tr-times { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 4px; }
.tr-times strong { font-size: 15px; }
.tr-len { text-align: center; }
.tr-ctrls { justify-content: space-between; margin-top: 10px; }
.tr-now { color: var(--muted); }
.tr-vol { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
input.tr-volume { padding: 0; height: 28px; background: transparent; border: 0; accent-color: var(--ink); }
.tr-vol.is-muted input.tr-volume { opacity: 0.35; filter: grayscale(1); }
.tr-vol.is-muted label:first-child { color: var(--rule-strong); }

/* §16 view once */
.rb-video.is-once video { cursor: pointer; }
button.qz-once-btn { position: absolute; left: 10px; bottom: 10px; padding: 7px 12px; font-size: 12.5px; background: rgba(11, 18, 40, 0.8); border-color: transparent; }
.qz-once-tag {
  position: absolute; right: 10px; top: 10px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: #fff; background: rgba(11, 18, 40, 0.7); padding: 3px 8px; border-radius: 6px; pointer-events: none;
}
.qz-gone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 160px;
  border: 1.5px dashed var(--rule-strong); border-radius: 12px; background: var(--paper-warm);
  font-family: var(--f-display); font-size: 1.1rem; color: var(--ink-soft); animation: rb-fade-in 300ms ease both;
}
.qz-gone-ghost { font-size: 2.2rem; line-height: 1; }

/* =====================================================================
   §17 photos & videos in chat
   ===================================================================== */
.ct-clip {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; margin: 0; cursor: pointer;
  border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--paper-warm);
  font-size: 19px; letter-spacing: 0; text-transform: none;
}
.ct-clip:hover { background: var(--paper-deep); }
.ct-attach { padding-top: 10px; }
.ct-chip {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px;
  background: var(--paper-warm); border: 1px solid var(--rule-strong);
}
.ct-chip.is-once { border-color: #7C4DFF; box-shadow: 0 0 0 2px rgba(124, 77, 255, 0.15); }
.ct-chip-thumb { width: 64px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--night); flex: none; }
.ct-chip-thumb img, .ct-chip-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-chip-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ct-chip-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-chip-err { color: var(--bad); }
.ct-chip-x { flex: none; }

.ct-bubble.has-media { padding: 4px; }
.ct-bubble.has-media .ct-text { padding: 6px 9px 4px; }
.ct-media { position: relative; border-radius: 12px; overflow: hidden; max-width: 260px; background: rgba(0, 0, 0, 0.15); }
.ct-media img, .ct-media video { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.ct-media-gone {
  display: flex; align-items: center; gap: 8px; padding: 14px 16px; min-width: 180px;
  background: rgba(255, 255, 255, 0.16); font-weight: 600; font-size: 13px;
}
.ct-media-gone span:first-child { font-size: 20px; }
.ct-media.is-once img, .ct-media.is-once video { filter: blur(18px) saturate(1.2); transform: scale(1.15); min-height: 150px; min-width: 200px; transition: filter 200ms ease; }
.ct-once-card {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #fff; font-weight: 700; font-size: 13px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.ct-once-icon { font-size: 26px; }
.ct-once-badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 99px;
  background: #7C4DFF; color: #fff; font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; text-shadow: none;
}
button.ct-once-peek {
  position: absolute; right: 6px; top: 6px; padding: 3px 8px; font-size: 11px; border-radius: 7px;
  background: rgba(11, 18, 40, 0.7); border: 0; color: #fff;
}
.ct-media.is-once.is-revealed img, .ct-media.is-once.is-revealed video { filter: none; transform: none; }
.ct-media.is-once.is-revealed .ct-once-card { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; justify-content: flex-end; padding-bottom: 8px; }
.ct-media.is-once.is-revealed .ct-once-icon { display: none; }
.ct-mstatus { font-size: 11.5px; color: var(--ink-soft); margin: 3px 40px 0 4px; display: flex; align-items: center; gap: 6px; }
.ct-mstatus.is-gone { color: var(--muted); }
.ct-stage.is-dark .ct-mstatus { color: rgba(255, 255, 255, 0.82); }

/* =====================================================================
   Child-preview typography — mirrors the child's phone (Patrick Hand,
   larger sizes). Scoped to the mirrors only; the dashboard keeps its own
   faces everywhere else.
   ===================================================================== */
:root { --f-child: "Patrick Hand", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif; }

/* live chat stage + start-chat preview */
.ct-stage { font-family: var(--f-child); }
.ct-stage .ct-bubble { font-size: 19px; line-height: 1.35; padding: 10px 15px; border-radius: 18px; }
.ct-stage .ct-bubble.has-media { padding: 5px; }
.ct-stage .ct-bubble.has-media .ct-text { padding: 7px 10px 5px; }
.ct-stage .ct-meta { font-family: var(--f-child); font-size: 14px; letter-spacing: 0.01em; }
.ct-stage .ct-day span { font-family: var(--f-child); font-size: 14px; letter-spacing: 0.04em; text-transform: none; padding: 3px 12px; }
.ct-stage .ct-empty { font-size: 19px; }
.ct-stage .ct-mstatus { font-size: 14.5px; }
.ct-stage .ct-once-card { font-size: 17px; font-weight: 400; }
.ct-stage .ct-once-badge { font-family: var(--f-child); font-size: 13px; }
.ct-stage .ct-media-gone { font-size: 17px; font-weight: 400; }
.ct-stage .ct-msg { gap: 2px; }
.ct-stage .ct-log { gap: 9px; }
.ct-urgency { font-family: var(--f-child); font-size: 17px; }

/* Try it */
.qz-pv { font-family: var(--f-child); font-size: 19px; line-height: 1.4; }
.qz-pv .qz-pv-ai { font-family: var(--f-child); font-size: 19px; }
.qz-pv .qz-pv-ai .mute { font-family: var(--f-body); font-size: 12px; }       /* parent-only hint */
.qz-pv .qz-pv-step { font-family: var(--f-child); font-size: 15px; letter-spacing: 0.06em; text-transform: none; }
.qz-pv .qz-pv-title { font-family: var(--f-child); font-size: 26px; font-weight: 400; line-height: 1.2; margin: 8px 0 6px; }
.qz-pv .qz-pv-body { font-size: 19px; color: var(--ink-2); }
.qz-pv .qz-pv-watch { font-family: var(--f-child); font-size: 16px; }
.qz-pv button { font-family: var(--f-child); font-size: 19px; font-weight: 400; padding: 12px 20px; border-radius: 14px; }
.qz-pv button.qz-pv-opt { padding: 15px 18px; font-size: 20px; }
.qz-pv button.qz-once-btn { font-size: 15px; padding: 7px 12px; }
.qz-pv .qz-pv-multi { font-family: var(--f-child); font-size: 19px; color: var(--ink); gap: 12px; }
.qz-pv .qz-pv-multi input { width: 22px; height: 22px; }
.qz-pv textarea { font-family: var(--f-child); font-size: 19px; }
.qz-pv .qz-pv-score { font-family: var(--f-child); font-size: 3rem; }
.qz-pv .qz-pv-score span { font-style: normal; }
.qz-pv .qz-path { font-size: 17px; }
.qz-pv .qz-path .mute.small { font-family: var(--f-child); font-size: 14px; }
.qz-pv .almanac { font-family: var(--f-child); font-size: 15px; letter-spacing: 0.04em; text-transform: none; }
.qz-pv .pill { font-family: var(--f-child); font-size: 13px; letter-spacing: 0.02em; text-transform: none; }

/* disappeared / opened cards */
.qz-gone { font-family: var(--f-child); font-size: 22px; }
.qz-gone-ghost { font-size: 2.6rem; }
.ct-media-gone, .ct-once-card { font-family: var(--f-child); }

/* =====================================================================
   §18 Cartoons sub-tab
   ===================================================================== */
.cn-preview { width: 100%; max-height: 240px; margin-top: 10px; border-radius: var(--radius-sm); background: var(--night); }
.cn-note { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--paper-warm); border: 1px dashed var(--rule-strong); }
.cn-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 4px; border-top: 1px solid var(--rule); }
.cn-row:first-child { border-top: 0; }
.cn-row.is-off .cn-main { opacity: 0.6; }
.cn-main { flex: 1; min-width: 0; display: grid; gap: 5px; }
.cn-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cn-title > span:first-child { font-family: var(--f-display); font-weight: 500; font-size: 1.05rem; }
.cn-status { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.cn-status.is-ok { color: var(--ok); }
.cn-status.is-warn { color: var(--warn); }
.cn-status.is-bad { color: var(--bad); }
.cn-bar { display: flex; align-items: center; gap: 10px; max-width: 520px; }
.cn-actions { flex: none; }

/* =====================================================================
   §19 Rainbow AI invite-only beta
   ===================================================================== */
.qc-beta {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 6px; border-radius: 6px;
  font-family: var(--f-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.12em; line-height: 1.5;
  color: var(--ai-accent, #7C4DFF); background: color-mix(in srgb, var(--ai-accent, #7C4DFF) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ai-accent, #7C4DFF) 40%, transparent);
  vertical-align: middle; -webkit-text-fill-color: currentColor;
}
.ai-title .qc-beta { font-size: 10.5px; vertical-align: 6px; }
.tab-panel[data-tab="ai"].ai-is-locked .ai-subtabs,
.tab-panel[data-tab="ai"].ai-is-locked .ai-sub { display: none !important; }
.ai-lock { max-width: 760px; }
.ai-lock-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.ai-lock-emoji { font-size: 40px; line-height: 1; }
.ai-lock-ok {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--ok-bg); border: 1px solid rgba(79, 107, 79, 0.3); color: var(--ok); font-size: 14px;
}
.ai-lock-note {
  padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius-sm);
  background: var(--warn-bg); border: 1px solid rgba(181, 126, 42, 0.32); font-size: 13.5px;
}
.ai-lock-edit { margin-top: 10px; }
.ai-lock-edit summary { cursor: pointer; }
.ai-lock-edit .ai-lock-form { margin-top: 10px; }
