/* Doctor Discovery — categorized results accordion (DOCTOR_DISCOVERY_PLAN §5F).
   Scoped under #kaiPanel1Discovery so it never leaks into the rest of the
   Kai shell. Light theme to match the current onboarding. */

#kaiPanel1Discovery .disc-wrap,
#kaiConfirmDiscovery .disc-wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  text-align: left;
}

/* #1: embedded under the profile on the confirm screen — give it breathing
   room + a divider so it reads as its own section. */
.kai-discovery-embed {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ob-rule);
}

/* Live search progress (shown while extractors run) */
.disc-progress { margin: 1rem 0 0; }
.disc-progress-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .2rem; font-size: .95rem; color: var(--tw-slate-600);
}
.disc-progress-row .disc-pr-state { width: 1.4rem; text-align: center; }
.disc-progress-row.is-done { color: var(--tw-slate-900); }
.disc-progress-row.is-error { color: var(--tw-red-700); }

/* Total banner */
.disc-total-banner {
  background: linear-gradient(135deg, var(--tw-blue-50b), var(--ob-blue-wash));
  border: 1px solid var(--ob-blue-rule); border-radius: 12px;
  padding: 16px 20px; margin: .4rem 0 1rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.disc-total-count { font-size: 1.25rem; font-weight: 800; color: var(--ob-ink); }
.disc-total-sub { font-size: .85rem; color: var(--ob-ink-2); }

/* LF-6: standing "double-check your sources" note above the groups */
.disc-verify-note {
  background: var(--color-warning-light); border: 1px solid var(--tw-amber-200); border-radius: 10px;
  padding: 10px 14px; margin: 0 0 12px;
  font-size: .85rem; line-height: 1.45; color: var(--tw-amber-800);
}

/* Accordion */
.disc-accordion {
  border: 1px solid var(--ob-rule); border-radius: 10px;
  margin-bottom: 12px; overflow: hidden; background: var(--color-white);
}
.disc-accordion-header {
  display: flex; align-items: center; gap: .6rem;
  padding: 13px 16px; cursor: pointer; user-select: none;
  background: var(--ob-paper); transition: background .15s;
}
.disc-accordion-header:hover { background: var(--tw-slate-100); }
.disc-cat-icon { display: inline-flex; align-items: center; color: var(--tw-slate-600); }
.disc-cat-icon svg { display: block; }
.disc-accordion-titlewrap {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.disc-accordion-title { font-weight: 700; color: var(--tw-slate-800); }
/* LF-6: mostly-uncertain groups are a question, not a claim */
.disc-accordion-sub { font-size: .8rem; font-weight: 600; color: var(--ob-amber-ink); }
.disc-count-badge {
  background: var(--tw-blue-600); color: var(--color-white); border-radius: 999px;
  padding: 2px 10px; font-size: .8rem; font-weight: 700;
}
.disc-chevron { transition: transform .25s ease; color: var(--tw-slate-400); font-size: .9rem; }
.disc-accordion.is-open .disc-chevron { transform: rotate(90deg); }
.disc-selectall {
  background: none; border: 1px solid var(--tw-slate-300); border-radius: 7px;
  padding: 3px 10px; font-size: .8rem; color: var(--tw-slate-700); cursor: pointer;
}
.disc-selectall:hover { background: var(--ob-wash); }

.disc-accordion-body { max-height: 0; overflow: hidden; transition: max-height .28s ease-out; }
.disc-accordion.is-open .disc-accordion-body { max-height: 60vh; overflow-y: auto; }

/* Resource card */
.disc-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 16px; border-top: 1px solid var(--tw-slate-100); transition: background .12s;
}
.disc-card:hover { background: var(--tw-slate-50); }
.disc-card.is-selected { background: var(--ob-blue-wash-2); }
.disc-card-cb { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--tw-blue-600); cursor: pointer; }
.disc-card-thumb {
  flex-shrink: 0; width: 92px; height: 56px; border-radius: 6px;
  object-fit: cover; background: var(--tw-slate-200);
}
.disc-card-main { min-width: 0; flex: 1; }
.disc-card-title { font-weight: 600; color: var(--tw-slate-900); line-height: 1.3; }
.disc-card-meta { font-size: .8rem; color: var(--tw-slate-500); margin-top: 3px; }
.disc-card-low { color: var(--ob-amber-ink); }      /* low-confidence "verify" hint */
.disc-card-view {
  font-size: .8rem; color: var(--tw-blue-600); text-decoration: none; white-space: nowrap;
}
.disc-card-view:hover { text-decoration: underline; }

/* Summary / action bar */
.disc-summary-bar {
  position: sticky; bottom: 0; background: var(--color-white);
  border-top: 1px solid var(--ob-rule); padding: 12px 4px; margin-top: .5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.disc-selected-count { font-weight: 600; color: var(--tw-slate-700); }
.disc-warn { font-size: .8rem; color: var(--tw-slate-400); margin-top: .6rem; }

.disc-empty { text-align: center; color: var(--tw-slate-500); padding: 2rem 1rem; }

/* Import progress bar (chunked import) */
/* #5: import progress is a centered modal with a dimmed backdrop so it's
   impossible to miss even with a long picked list. */
.disc-import-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.disc-import-modal[hidden] { display: none; }
.disc-import-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
}
.disc-import-dialog {
  position: relative; z-index: 1; width: min(420px, 92vw);
  background: var(--color-white); border-radius: 16px; padding: 1.3rem 1.4rem;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
  text-align: center; animation: kai-draft-in .2s ease;
}
.disc-import-title { font-weight: 800; color: var(--tw-slate-900); margin: 0 0 .8rem; }
.disc-import-bar {
  height: 10px; border-radius: 999px; background: var(--ob-track); overflow: hidden;
}
.disc-import-fill {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--tw-blue-600), var(--ob-sky-400)); transition: width .3s ease;
}
.disc-import-label { font-size: .88rem; color: var(--tw-slate-600); margin: .7rem 0 0; }
.disc-import-actions {
  margin-top: 1rem; display: flex; gap: .6rem; justify-content: center;
  align-items: center; flex-wrap: wrap;
}
.disc-import-actions[hidden] { display: none; }
.disc-import-dismiss {
  padding: .5rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--tw-slate-300); background: var(--color-white); color: var(--tw-slate-900);
  font-weight: 600; cursor: pointer;
}
.disc-import-dismiss:hover { background: var(--tw-slate-100); }

/* Failed imports list */
.disc-failures {
  margin: .75rem 0 0; padding: .75rem .9rem; border-radius: 10px;
  background: var(--color-error-light); border: 1px solid var(--ob-red-rule);
}
.disc-failures-head { margin: 0 0 .4rem; font-weight: 700; color: var(--tw-red-700); font-size: .9rem; }
.disc-failures-list { margin: 0; padding-left: 1.1rem; }
.disc-failures-list li { font-size: .85rem; color: var(--ob-red-ink); margin: .15rem 0; }
.disc-fail-title { font-weight: 600; }
.disc-fail-why { color: var(--ob-amber-ink); }

/* #2 incr.2 — in-shell organize: drafted playbook cards + nested nodes */
.kai-organize-item {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .7rem; border: 1px solid var(--ob-wash); border-radius: 8px;
  background: var(--color-white); margin: .35rem 0;
}
.kai-organize-item-title { color: var(--tw-slate-900); font-size: .92rem; }
.kai-organize-item-type {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--tw-slate-500); background: var(--tw-slate-100); border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.kai-organize-pb {
  border: 1px solid var(--ob-blue-rule); border-radius: 12px;
  margin: .9rem 0; background: linear-gradient(135deg, var(--ob-blue-paper), var(--ob-blue-paper-4)); overflow: hidden;
}
/* #2 incr.3: collapsible header */
.kai-organize-pb-header {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: 13px 16px; background: none; border: none; cursor: pointer; text-align: left;
}
.kai-organize-pb-chev {
  color: var(--tw-blue-600); font-size: .8rem; transition: transform .2s ease; flex-shrink: 0;
}
.kai-organize-pb:not(.is-collapsed) .kai-organize-pb-chev { transform: rotate(90deg); }
.kai-organize-pb-title { font-weight: 800; color: var(--ob-ink); font-size: 1.05rem; flex: 1; }
.kai-organize-pb-badge {
  background: var(--tw-blue-600); color: var(--color-white); border-radius: 999px;
  padding: 2px 10px; font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.kai-organize-pb-body { padding: 0 16px 14px; }
.kai-organize-pb.is-collapsed .kai-organize-pb-body { display: none; }
.kai-organize-pb-desc { font-size: .85rem; color: var(--ob-ink-2); margin: 0 0 .3rem; }
/* #2 (Ramy 2026-06-23): borrowed-playbook originator credit in the organizer. */
.kai-organize-pb-credit {
  display: inline-block; font-size: .78rem; font-weight: 600;
  color: var(--tw-violet-700); background: var(--ob-violet-50); border: 1px solid var(--ob-violet-rule);
  padding: 3px 10px; border-radius: 999px; margin: 0 0 .5rem;
}

/* G3 (social plan): the "what should lead?" question, asked separately from
   "where does this go?". Deliberately a plain always-visible checkbox, not a
   hover affordance — the whole point is that featuring is a distinct decision
   the doctor is prompted to make, not one they have to discover. */
.kai-organize-pb-feature {
  display: grid; grid-template-columns: auto 1fr; gap: .1rem .55rem;
  align-items: center; margin: .1rem 0 .75rem; cursor: pointer;
  padding: .55rem .7rem; border: 1px solid var(--ob-rule); border-radius: 10px;
  background: var(--ob-paper); transition: background .12s, border-color .12s;
}
.kai-organize-pb-feature:hover { background: var(--ob-paper-2); }
.kai-organize-pb-feature.is-on { background: var(--color-warning-light); border-color: var(--tw-amber-200); }
.kai-organize-pb-feature input { width: 16px; height: 16px; cursor: pointer; }
.kai-organize-pb-feature-text { font-size: .9rem; font-weight: 600; color: var(--tw-slate-800); }
.kai-organize-pb-feature.is-on .kai-organize-pb-feature-text { color: var(--tw-amber-800); }
.kai-organize-pb-feature-hint {
  grid-column: 2; font-size: .78rem; color: var(--ob-ink-2); line-height: 1.35;
}
.kai-organize-side-item.is-featured .kai-organize-side-label { color: var(--tw-amber-800); }

/* #2 incr.4: two-pane organize — playbook list left, detail right */
.kai-organize-2pane {
  display: flex; gap: 1rem; align-items: flex-start;
  border: 1px solid var(--ob-rule); border-radius: 12px; overflow: hidden; background: var(--color-white);
}
.kai-organize-sidebar {
  flex: 0 0 220px; max-width: 240px; border-right: 1px solid var(--ob-wash);
  background: var(--ob-paper); padding: .5rem; display: flex; flex-direction: column; gap: .25rem;
  max-height: 60vh; overflow-y: auto;
}
.kai-organize-side-item {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  padding: .6rem .7rem; border: none; border-radius: 8px; background: none;
  cursor: pointer; text-align: left; transition: background .12s;
}
.kai-organize-side-item:hover { background: var(--ob-wash); }
.kai-organize-side-item.is-active { background: var(--ob-blue-wash); }
.kai-organize-side-label { flex: 1; font-weight: 600; color: var(--tw-slate-800); font-size: .92rem; }
.kai-organize-side-item.is-active .kai-organize-side-label { color: var(--ob-ink); }
.kai-organize-side-badge {
  background: var(--tw-blue-600); color: var(--color-white); border-radius: 999px;
  padding: 1px 9px; font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.kai-organize-detail { flex: 1; min-width: 0; padding: 1rem 1.1rem; max-height: 60vh; overflow-y: auto; }

/* #2 incr.5: drag-drop + editing */
.kai-organize-draggable { cursor: grab; }
.kai-organize-draggable:active { cursor: grabbing; }
.kai-organize-draggable.is-dragging { opacity: .45; }
.kai-organize-grip { color: var(--tw-slate-400); font-size: .9rem; flex-shrink: 0; cursor: grab; }
.kai-organize-side-item.is-drop-hover,
.kai-organize-node.is-drop-hover,
.kai-organize-detail.is-drop-hover {
  outline: 2px dashed var(--tw-blue-600); outline-offset: -2px; background: var(--ob-blue-wash-3); border-radius: 8px;
}
.kai-organize-node {
  border: 1px solid transparent; border-radius: 8px; padding: .3rem .4rem; margin-top: .5rem;
}
.kai-editable { border-bottom: 1px dashed transparent; cursor: text; }
.kai-editable:hover { border-bottom-color: var(--tw-slate-400); }
.kai-editable[contenteditable="true"] { outline: none; border-bottom-color: var(--tw-blue-600); background: var(--ob-blue-paper-2); }
.kai-organize-addpb {
  margin-top: .4rem; width: 100%; padding: .55rem; border: 1px dashed var(--tw-slate-300); border-radius: 8px;
  background: none; color: var(--tw-blue-600); font-weight: 600; cursor: pointer; font-size: .88rem;
}
.kai-organize-addpb:hover { background: var(--ob-wash); }
.kai-organize-addcat {
  margin-top: .6rem; padding: .4rem .8rem; border: 1px dashed var(--tw-slate-300); border-radius: 8px;
  background: none; color: var(--tw-blue-600); font-weight: 600; cursor: pointer; font-size: .85rem;
}
.kai-organize-addcat:hover { background: var(--ob-wash); }
/* #4: nested "+ Add subcategory" sits indented under its category. */
.kai-organize-addsub { margin-left: .2rem; font-size: .8rem; padding: .3rem .7rem; }

/* #3 (Ramy 2026-06-23): keep the organize container a stable width. The
   parent .kai-explain-stack is a centered flex column, so a non-full-width
   child shrinks to its content — which made the editor jump narrower when a
   playbook was added. Pin both the work area and the 2-pane to 100%. */
.kai-organize-work { width: 100%; }
.kai-organize-2pane { width: 100%; }

/* Reflow (Ramy 2026-06-24): content rows inside categories — styled to match
   the public playbook (a clean list of items under each category). */
.kai-organize-node-name {
  font-weight: 700; color: var(--tw-slate-700); font-size: .92rem; margin: .45rem 0 .2rem;
}
.kai-organize-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .6rem; margin-top: .3rem;
  border: 1px solid var(--ob-wash); border-radius: 8px; background: var(--color-white);
}
.kai-organize-item:hover { border-color: var(--ob-rule-2); background: var(--ob-paper); }
.kai-organize-item-type {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--tw-slate-500); background: var(--tw-slate-100); border-radius: 5px; padding: 1px 7px; flex-shrink: 0;
}

/* #5: preview link on each content row (opens the detail page in a new tab). */
.kai-organize-item-title {
  flex: 1; min-width: 0; font-size: .9rem; color: var(--tw-slate-800);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kai-organize-item-preview {
  flex-shrink: 0; font-size: .78rem; font-weight: 600; color: var(--tw-blue-600);
  text-decoration: none; white-space: nowrap;
  /* Reflow (Ramy 2026-06-24): now a <button> opening the in-app preview. */
  background: none; border: 0; padding: 2px 6px; cursor: pointer;
  border-radius: 6px; font-family: inherit;
}
.kai-organize-item-preview:hover { text-decoration: underline; background: var(--ob-blue-wash-3); }

/* #1: explicit remove (×) — pulls an item out of its playbook back to
   "Not placed" without dragging. */
.kai-organize-item-remove {
  flex-shrink: 0; border: none; background: none; cursor: pointer;
  color: var(--tw-slate-400); font-size: 1.15rem; line-height: 1; padding: 0 .15rem;
  border-radius: 6px; transition: color .12s, background .12s;
}
.kai-organize-item-remove:hover { color: var(--tw-red-600); background: var(--color-error-light); }
@media (max-width: 640px) {
  .kai-organize-2pane { flex-direction: column; }
  .kai-organize-sidebar {
    flex-basis: auto; max-width: none; width: 100%; flex-direction: row;
    overflow-x: auto; max-height: none; border-right: none; border-bottom: 1px solid var(--ob-wash);
  }
  .kai-organize-side-item { width: auto; white-space: nowrap; }
}

/* #2 incr.3: auto/manual choice cards */
.kai-organize-choice {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
  max-width: 720px; margin: 1rem auto 0;
}
/* Reflow (Ramy 2026-06-24): `display:flex` above was overriding the `hidden`
   attribute, so the choice cards never hid after a choice was made (and on
   re-entry). Honor [hidden]. */
.kai-organize-choice[hidden] { display: none; }
.kai-organize-choice-card {
  flex: 1 1 280px; display: flex; flex-direction: column; gap: .4rem;
  padding: 1.4rem 1.25rem; border: 1.5px solid var(--ob-blue-rule); border-radius: 14px;
  background: var(--color-white); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.kai-organize-choice-card:hover {
  border-color: var(--tw-blue-600); box-shadow: 0 6px 22px rgba(37,99,235,.14); transform: translateY(-2px);
}
.kai-organize-choice-emoji { font-size: 1.6rem; }
.kai-organize-choice-title { font-weight: 800; color: var(--ob-ink); font-size: 1.05rem; }
.kai-organize-choice-sub { font-size: .85rem; color: var(--ob-ink-2); line-height: 1.4; }
.kai-organize-node { margin-top: .6rem; }
.kai-organize-node-name { font-weight: 700; color: var(--tw-slate-800); font-size: .9rem; margin: .3rem 0 .15rem; }
.kai-organize-node-d2 { margin-left: .85rem; }
.kai-organize-node-d3 { margin-left: 1.7rem; }
.kai-organize-node-d2 .kai-organize-node-name { font-weight: 600; color: var(--tw-slate-700); }
.kai-organize-node-d3 .kai-organize-node-name { font-weight: 600; color: var(--tw-slate-600); font-size: .85rem; }

/* ── Phase 4: owner notification FAB + review modal ─────────────── */
.kdf-fab { position: fixed; bottom: 24px; right: 24px; z-index: 1000; }
.kdf-fab-btn {
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--color-white); box-shadow: 0 4px 16px rgba(0,0,0,.18); position: relative;
  padding: 0; overflow: visible; transition: transform .15s;
}
.kdf-fab-btn:hover { transform: scale(1.06); }
.kdf-fab-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; display: block; }
.kdf-fab-badge {
  position: absolute; top: -4px; right: -4px; background: var(--ob-red-vivid); color: var(--color-white);
  border-radius: 11px; min-width: 22px; height: 22px; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 6px;
}
.kdf-fab.has-suggestions .kdf-fab-btn { animation: kdf-pulse 2.2s ease-in-out infinite; }
@keyframes kdf-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,.18); }
  50% { box-shadow: 0 4px 24px rgba(37,99,235,.45); }
}
.kdf-popup {
  position: absolute; bottom: 72px; right: 0; width: 300px; background: var(--color-white);
  border: 1px solid var(--ob-rule); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.14);
  padding: 14px 16px;
}
.kdf-popup-head { font-weight: 700; color: var(--tw-slate-900); margin-bottom: .4rem; }
.kdf-popup-body { font-size: .9rem; color: var(--tw-slate-600); }
.kdf-cat-list { margin: .4rem 0 0; padding-left: 1.1rem; }
.kdf-cat-list li { margin: .1rem 0; }
.kdf-popup-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .8rem; }

.kdf-modal {
  position: fixed; inset: 0; z-index: 1001; background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
/* The `hidden` attribute must beat the display:flex above, or the modal
   shows empty on every owner page load and the close button looks dead. */
.kdf-modal[hidden] { display: none; }
.kdf-modal-card {
  background: var(--color-white); border-radius: 14px; width: 100%; max-width: 760px;
  max-height: 86vh; overflow-y: auto; padding: 0 20px 16px;
}
.kdf-modal-head {
  position: sticky; top: 0; background: var(--color-white); display: flex; justify-content: space-between;
  align-items: center; padding: 16px 0 12px; font-weight: 800; color: var(--tw-slate-900);
  border-bottom: 1px solid var(--ob-wash); margin-bottom: .6rem;
}
.kdf-modal-close { background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--tw-slate-400); cursor: pointer; }

/* #4: "Your links" section — profiles + social, saved to the profile (not content) */
.disc-links-section {
  border: 1px solid var(--tw-slate-200); border-radius: 12px; background: var(--ob-blue-paper-3);
  padding: .8rem .9rem; margin-bottom: 1rem;
}
.disc-links-head { margin-bottom: .55rem; }
.disc-links-title { font-weight: 800; color: var(--tw-slate-900); }
.disc-links-sub { font-size: .8rem; color: var(--tw-slate-500); margin-top: 2px; }
.disc-link-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .15rem; border-top: 1px solid var(--ob-wash);
}
.disc-link-row:first-of-type { border-top: none; }
.disc-link-cb { flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--tw-blue-600); cursor: pointer; }
.disc-link-icon { flex-shrink: 0; color: var(--tw-slate-600); display: inline-flex; }
.disc-link-main { flex: 1; min-width: 0; }
.disc-link-label { font-weight: 600; color: var(--tw-slate-900); line-height: 1.3; }
.disc-link-url {
  font-size: .8rem; color: var(--tw-slate-500); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.disc-link-row.is-selected { background: var(--ob-blue-wash-2); border-radius: 8px; }

/* #2 incr.7: live streaming draft progress (playbook + category names) */
.kai-organize-draftprog { padding: .4rem 0; }
.kai-organize-draftlist { margin-top: .5rem; }
.kai-draft-pb {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; color: var(--tw-slate-900); padding: .35rem 0 .15rem;
  animation: kai-draft-in .25s ease;
}
.kai-draft-cat {
  display: flex; align-items: center; gap: .5rem;
  color: var(--tw-slate-600); font-size: .9rem; padding: .12rem 0 .12rem 1.6rem;
  animation: kai-draft-in .25s ease;
}
/* #4: colored (non-emoji) markers for the streaming draft list */
.kai-draft-ico { display: inline-flex; color: var(--tw-blue-600); flex-shrink: 0; }
.kai-draft-ico-sm { display: inline-flex; color: var(--tw-slate-400); flex-shrink: 0; }
@keyframes kai-draft-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* PLAN-ONBOARDING-RESTYLE-2026-10 §3.5 — source tabs across the top of
   Step 1 (Todd: "these should be at the very top across here. 1, 2, 3, 4"). */
.disc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 .9rem;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: .4rem 0;
  background: var(--kai-bg-deep, var(--color-white));
}
.disc-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  padding: .4rem .8rem;
  border: 1px solid var(--ob-rule);
  border-radius: var(--radius-full);
  background: var(--color-white);
  color: var(--ob-ink);
  cursor: pointer;
}
.disc-tab:hover { border-color: var(--kai-border-active, var(--ob-blue-rule)); }
.disc-tab-count { font-size: .78rem; font-weight: 700; color: var(--ob-ink-2); }

/* ── Reading Room, site-wide (PLAN-DESIGN-ROLLOUT-2026-09 Layer 2) — the
   discovery results and the organizer inside the Kai onboarding shell, and
   the owner's suggestion FAB on the space page. Every rule starts with
   html.rr-theme. The colours above already follow the theme through their
   names (tokens/tailwind-legacy.css), and each gradient's two stops flip to
   the same value, so what is left is the shape: hairlines for shadows, the
   three radii, serif titles, a flat accent bar, no pulsing glow. ── */
html.rr-theme .disc-total-banner,
html.rr-theme .disc-verify-note,
html.rr-theme .disc-accordion,
html.rr-theme .disc-failures,
html.rr-theme .disc-links-section,
html.rr-theme .kai-organize-pb,
html.rr-theme .kai-organize-2pane,
html.rr-theme .kai-organize-choice-card,
html.rr-theme .disc-import-dialog,
html.rr-theme .kdf-popup,
html.rr-theme .kdf-modal-card { border-radius: var(--rr-radius-card); }
html.rr-theme .disc-card-thumb,
html.rr-theme .kai-organize-item,
html.rr-theme .kai-organize-side-item,
html.rr-theme .kai-organize-pb-feature,
html.rr-theme .kai-organize-addpb,
html.rr-theme .kai-organize-addcat { border-radius: var(--rr-radius-media); }
html.rr-theme .disc-selectall,
html.rr-theme .kai-organize-item-type,
html.rr-theme .kai-organize-item-preview,
html.rr-theme .kai-organize-item-remove,
html.rr-theme .kdf-fab-badge { border-radius: var(--rr-radius-pill); }
html.rr-theme .disc-total-banner,
html.rr-theme .kai-organize-pb { background: var(--rr-paper-raised); border-color: var(--rr-rule); }
html.rr-theme .kai-organize-choice-card { border: 1px solid var(--rr-rule); }
html.rr-theme .kai-organize-choice-card:hover { border-color: var(--rr-accent); box-shadow: none; transform: none; }
html.rr-theme .disc-total-count,
html.rr-theme .disc-import-title,
html.rr-theme .disc-links-title,
html.rr-theme .kai-organize-pb-title,
html.rr-theme .kai-organize-choice-title { font-family: var(--rr-font-display); font-weight: 500; }
html.rr-theme .disc-import-fill { background: var(--rr-accent); }
html.rr-theme .disc-import-dialog,
html.rr-theme .kdf-popup,
html.rr-theme .kdf-fab-btn { box-shadow: 0 0 0 1px var(--rr-rule); }
html.rr-theme .kdf-fab.has-suggestions .kdf-fab-btn { animation: none; }

/* PLAN-ONBOARDING-RESTYLE-2026-10 — plain steps, Reading Room */
html.rr-theme .disc-tabs { background: var(--rr-paper); }
html.rr-theme .disc-tab {
  background: var(--rr-paper-raised); border-color: var(--rr-rule-strong); color: var(--rr-ink);
  border-radius: var(--rr-radius-pill);
}
html.rr-theme .disc-tab:hover { border-color: var(--rr-accent); }
html.rr-theme .disc-tab-count { font-family: var(--rr-font-mono); color: var(--rr-ink-3); }
