/* Launchpad theme on DaisyUI 5: public Mastercard palette (red, orange, yellow, black) on warm neutrals. */
[data-theme="launchpad"] {
  color-scheme: light;
  --color-base-100: #ffffff;
  --color-base-200: #f6f3ef;
  --color-base-300: #e6e0d8;
  --color-base-content: #1f1f1e;
  --color-primary: #EB001B;
  --color-primary-content: #ffffff;
  --color-secondary: #FF5F00;
  --color-secondary-content: #ffffff;
  --color-accent: #F79E1B;
  --color-accent-content: #1f1f1e;
  --color-neutral: #141413;
  --color-neutral-content: #f4f4f4;
  --color-info: #1d4f91;
  --color-info-content: #ffffff;
  --color-success: #1f7a4d;
  --color-success-content: #ffffff;
  --color-warning: #d97a00;
  --color-warning-content: #1f1f1e;
  --color-error: #b3261e;
  --color-error-content: #ffffff;
  --radius-selector: 0.5rem;
  --radius-field: 0.375rem;
  --radius-box: 0.75rem;
  --size-selector: 0.25rem;
  --size-field: 0.25rem;
  --border: 1px;
  --depth: 0;
  --noise: 0;
}
body { font-family: "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif; }

/* Actor chip in the header: who is acting, one click to change or sign out. */
.actor-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--color-neutral-content) 25%, transparent); cursor: pointer; font-size: 13px; }
.actor-chip:hover { background: color-mix(in srgb, var(--color-neutral-content) 10%, transparent); }
.actor-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--color-accent); color: var(--color-accent-content); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
/* Two-circle motif for the header (CSS only, no artwork). */
.mc-mark { position: relative; display: inline-block; width: 34px; height: 22px; }
.mc-mark i { position: absolute; top: 0; width: 22px; height: 22px; border-radius: 50%; }
.mc-mark i.l { left: 0; background: #EB001B; }
.mc-mark i.r { left: 12px; background: #F79E1B; opacity: 0.92; }

/* Version status badges */
.st-ai_draft { background: #fff3e0; color: #8a4b00; }
.st-under_review { background: #e8f0fe; color: #1a4fb8; }
.st-human_amended { background: #eef7ea; color: #2f6b1f; }
.st-approved { background: #dff3e6; color: #135f36; }
.st-rejected { background: #f8e2e0; color: #8f1e17; }
.st-superseded { background: #ececec; color: #666; }
.st-escalated { background: #ffe1d6; color: #9a2f00; }
/* Source status badges */
.src-client_evidence { background: #dff3e6; color: #135f36; }
.src-external_evidence { background: #e6f0fb; color: #1d4f91; }
.src-assumption { background: #fff0cc; color: #7a5200; }
.src-interpretation { background: #efe6f7; color: #4d2a7a; }
.src-recommendation { background: #ffe8d9; color: #8a3a00; }

.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 0.8em; }
pre.raw { background: #faf8f5; border: 1px solid #e6e0d8; padding: 0.75rem; border-radius: 0.5rem; overflow: auto; max-height: 520px; font-size: 0.8rem; }
.kv dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(31,31,30,0.55); }
.kv dd { margin: 0 0 0.4rem; overflow-wrap: anywhere; min-width: 0; }
.kv { min-width: 0; }
.doc-text { white-space: pre-wrap; font-size: 0.9rem; line-height: 1.5; }

/* Room between a field label and its box, so the focus ring never touches the label. */
.form-control > .label-text { display: block; margin-bottom: 0.4rem; }
.input:focus, .input:focus-within, .select:focus, .textarea:focus { outline-offset: 1px; }

/* --- Type scale and page rhythm (one system for every page) --- */
html { font-size: 15.5px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.page-title { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
.page-sub { color: color-mix(in srgb, var(--color-base-content) 62%, transparent); margin: 0.35rem 0 0; max-width: 70ch; line-height: 1.5; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; margin: 0 0 0.75rem; }
.section-head h2 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.section-head p { font-size: 0.86rem; color: color-mix(in srgb, var(--color-base-content) 58%, transparent); margin: 0; }
.eyebrow { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: color-mix(in srgb, var(--color-base-content) 50%, transparent); }
.card-title { letter-spacing: -0.005em; }
.table :where(th) { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: color-mix(in srgb, var(--color-base-content) 60%, transparent); }
.table :where(td) { font-size: 0.9rem; }
.table-xs :where(td), .table-xs :where(th) { font-size: 0.8125rem; }
.table-sm :where(td) { font-size: 0.875rem; }
.mono { font-size: 0.8125rem; }
.badge { font-weight: 600; }
.stat-title { font-size: 0.78rem; }
.stat-desc { font-size: 0.78rem; }

/* Gate cards: a coloured left edge says open or not before any text is read. */
.gate-card { border-left: 4px solid var(--color-base-300); }
.gate-card.gate-open { border-left-color: var(--color-success); }
.gate-card.gate-closed { border-left-color: var(--color-warning); }
.req-list { display: grid; gap: 0.35rem; }
.req-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name count" "bar bar"; align-items: center; column-gap: 0.6rem; row-gap: 0.15rem; font-size: 0.86rem; }
.req-row .req-name { grid-area: name; }
.req-row .req-count { grid-area: count; font-variant-numeric: tabular-nums; font-weight: 600; }
.req-row .req-bar { grid-area: bar; height: 4px; }
.req-row .badge { grid-column: 1 / -1; justify-self: start; }

/* Agent cards: state by edge, like gates. */
.agent-card { border-top: 3px solid var(--color-base-300); }
.agent-card.agent-ready { border-top-color: var(--color-info); }
.agent-card.agent-done { border-top-color: var(--color-success); }
.agent-card.agent-waiting { opacity: 0.85; }
.tick { display: inline-block; vertical-align: -1px; }

/* ---- Wireframes (templates/_wireframe.html): sketch look, one accent for the primary action ---- */
.wf { --wf-ink: #2b2a28; --wf-line: #b9b3aa; --wf-soft: #e8e3dc; --wf-paper: #fbfaf8; --wf-accent: #EB001B;
      margin: 0; font-family: ui-sans-serif, system-ui, sans-serif; color: var(--wf-ink); break-inside: avoid; }
.wf-device { position: relative; background: var(--wf-paper); border: 2px solid var(--wf-ink); box-shadow: 4px 4px 0 var(--wf-soft); overflow: hidden; }
.wf-mobile { width: 250px; border-radius: 26px; padding: 6px 6px 8px; }
.wf-desktop { width: 100%; max-width: 560px; border-radius: 10px; }
.wf-kiosk { width: 100%; max-width: 420px; border-radius: 6px; border-width: 6px; }
.wf-statusbar { display: flex; justify-content: space-between; align-items: center; font-size: 10px; font-weight: 600; padding: 2px 12px 4px; }
.wf-signal { display: inline-flex; gap: 2px; align-items: flex-end; }
.wf-signal i { display: inline-block; width: 3px; background: var(--wf-ink); border-radius: 1px; }
.wf-signal i:nth-child(1) { height: 5px; } .wf-signal i:nth-child(2) { height: 8px; } .wf-signal i:nth-child(3) { height: 11px; }
.wf-chrome { display: flex; align-items: center; gap: 5px; padding: 6px 10px; border-bottom: 2px solid var(--wf-ink); background: #f1ede7; }
.wf-chrome i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--wf-ink); }
.wf-url { flex: 1; margin-left: 8px; font-size: 10px; color: #7a746c; border: 1px solid var(--wf-line); border-radius: 999px; padding: 1px 10px; background: #fff; }
.wf-kioskbar { padding: 8px 12px; border-bottom: 2px solid var(--wf-ink); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.wf-screen { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.wf-mobile .wf-screen { min-height: 360px; }
.wf-desktop .wf-screen { min-height: 300px; padding: 10px 14px; }
.wf-region { border: 1.5px dashed var(--wf-line); border-radius: 6px; padding: 7px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: relative; }
.wf-region::before { content: attr(data-kind); position: absolute; top: -7px; right: 8px; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: #a39c92; background: var(--wf-paper); padding: 0 4px; }
.wf-header { border-style: solid; border-color: var(--wf-ink); border-width: 0 0 2px; border-radius: 0; padding: 4px 6px 8px; flex-wrap: nowrap; }
.wf-header .wf-h { font-size: 13px; flex: 1; margin: 0; }
.wf-header .wf-t { display: none; }
.wf-back { width: 8px; height: 8px; border-left: 2px solid var(--wf-ink); border-bottom: 2px solid var(--wf-ink); transform: rotate(45deg); margin: 0 6px 0 2px; flex: none; }
.wf-hero { flex-direction: column; align-items: stretch; background: #f3efe9; }
.wf-form { flex-direction: column; align-items: stretch; }
.wf-list { flex-direction: column; align-items: stretch; }
.wf-content { flex-direction: column; align-items: stretch; }
.wf-actions { justify-content: center; gap: 8px; border-style: solid; border-color: var(--wf-soft); }
.wf-footer { justify-content: center; border: 0; border-top: 1px solid var(--wf-line); border-radius: 0; font-size: 9px; color: #8b847a; }
.wf-footer .wf-t, .wf-footer .wf-h { font-size: 9px; color: #8b847a; margin: 0; }
.wf-footer .wf-line { display: none; }
.wf-nav { border: 0; border-top: 2px solid var(--wf-ink); border-radius: 0; justify-content: space-around; padding: 6px 2px 2px; margin-top: auto; }
.wf-desktop .wf-nav { border: 0; border-bottom: 1.5px solid var(--wf-line); justify-content: flex-start; gap: 14px; margin: 0; order: -1; }
.wf-tabbar { margin: 4px 2px 0; }
.wf-navitem { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; font-size: 8px; color: #8b847a; }
.wf-navitem i { width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; }
.wf-navitem.on { color: var(--wf-ink); font-weight: 700; }
.wf-desktop .wf-navitem { flex-direction: row; font-size: 10px; }
.wf-home { width: 90px; height: 4px; border-radius: 2px; background: var(--wf-ink); margin: 6px auto 0; }
.wf-h { font-weight: 800; font-size: 14px; line-height: 1.15; width: 100%; letter-spacing: -.01em; }
.wf-t { width: 100%; display: flex; flex-direction: column; gap: 3px; }
.wf-line { display: block; height: 4px; border-radius: 2px; background: var(--wf-soft); width: 100%; }
.wf-line.w-4\/5 { width: 80%; } .wf-line.w-3\/5 { width: 60%; }
.wf-cap { font-size: 10px; color: #5f5951; line-height: 1.25; }
.wf-btn { display: inline-block; font-size: 10px; font-weight: 700; padding: 5px 12px; border: 1.5px solid var(--wf-ink); border-radius: 6px; background: #fff; white-space: nowrap; }
.wf-btn.primary { background: var(--wf-accent); border-color: var(--wf-accent); color: #fff; box-shadow: 2px 2px 0 rgba(0,0,0,.18); }
.wf-actions .wf-btn.primary { flex: 1; text-align: center; }
.wf-link { font-size: 10px; text-decoration: underline; text-decoration-style: dotted; color: #4a443d; }
.wf-link.primary { color: var(--wf-accent); font-weight: 700; }
.wf-input { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.wf-field { display: block; height: 20px; border: 1.5px solid var(--wf-line); border-radius: 4px; background: #fff; }
.wf-img { position: relative; width: 100%; height: 64px; border: 1.5px solid var(--wf-line); border-radius: 4px; background: #fff; display: flex; align-items: flex-end; padding: 4px 6px; }
.wf-img svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke: var(--wf-line); stroke-width: 1; }
.wf-img .wf-cap { position: relative; background: #fff; padding: 0 3px; }
.wf-chart { position: relative; width: 100%; height: 64px; display: flex; align-items: flex-end; gap: 4px; padding: 4px 6px 14px; border: 1.5px solid var(--wf-line); border-radius: 4px; background: #fff; }
.wf-chart i { flex: 1; background: var(--wf-soft); border: 1px solid var(--wf-line); border-bottom: 0; border-radius: 2px 2px 0 0; }
.wf-chart i:nth-child(4) { background: #f7c9cf; border-color: var(--wf-accent); }
.wf-chart .wf-cap { position: absolute; left: 6px; bottom: 2px; }
.wf-status { display: inline-block; font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--wf-ink); background: #fff; }
.wf-card { width: 100%; border: 1.5px solid var(--wf-line); border-radius: 6px; padding: 6px 8px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.wf-list { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.wf-row { display: block; height: 14px; border-bottom: 1px solid var(--wf-soft); position: relative; }
.wf-row::before { content: ""; position: absolute; left: 0; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--wf-line); }
.wf-row::after { content: ""; position: absolute; left: 12px; top: 5px; width: 55%; height: 4px; border-radius: 2px; background: var(--wf-soft); }
.wf figcaption { margin-top: 10px; max-width: 420px; }
.wf-meta { font-size: 11px; color: #8b847a; display: flex; gap: 8px; flex-wrap: wrap; letter-spacing: .02em; }
.wf-scene { font-weight: 700; text-transform: uppercase; font-size: 10px; }
.wf-dev { text-transform: capitalize; }
.wf-primary-note::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--wf-accent); margin-right: 4px; vertical-align: -1px; }
.wf-name { font-weight: 700; font-size: 15px; margin-top: 2px; }
.wf-purpose { font-size: 13px; color: #4a443d; }
.wf-need { font-size: 12px; color: #8b847a; margin-top: 2px; }
/* compact: thumbnails in the flow strip */
.wf-compact .wf-device { transform: scale(.42); transform-origin: top left; pointer-events: none; }
.wf-compact .wf-region::before { display: none; }
.wf-flow { display: flex; align-items: flex-start; gap: 6px; overflow-x: auto; padding: 8px 4px 12px; }
.wf-flow-step { flex: none; text-decoration: none; color: inherit; }
.wf-flow-thumb { width: 112px; height: 170px; overflow: hidden; }
.wf-flow-thumb .wf-desktop, .wf-flow-thumb .wf-kiosk { width: 260px; }
.wf-flow-cap { font-size: 10px; margin-top: 2px; width: 112px; color: #4a443d; }
.wf-flow-cap b { display: inline-block; min-width: 14px; height: 14px; border-radius: 50%; background: #2b2a28; color: #fff; font-size: 9px; text-align: center; line-height: 14px; margin-right: 3px; }
.wf-arrow { align-self: center; color: #b9b3aa; font-size: 18px; margin-top: -30px; flex: none; }
.wf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px 24px; align-items: start; }
.wf-grid > .wf { scroll-margin-top: 80px; }
@media print { .wf-device { box-shadow: none; } .wf-flow { overflow: visible; flex-wrap: wrap; } }

/* ---- Layout safety: nothing may widen the page. Grid and flex children default to min-width:auto,
   which lets a table, a long id or a fixed-width input push the whole column past the viewport. ---- */
.grid > *, .flex > *, .drawer-content, main { min-width: 0; }
.alert { grid-template-columns: minmax(0, 1fr); }
.alert > * { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.mono, .breadcrumbs li { overflow-wrap: anywhere; }
.breadcrumbs { max-width: 100%; }
td, th { overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; max-width: 100%; }
@media (max-width: 640px) {
  .join { flex-wrap: wrap; }
  .join > .join-item, .join > * { flex: 1 1 100%; border-radius: var(--radius-field, 0.5rem) !important; }
  .join .input, .join .btn, .join form { width: 100%; }
  .btn-row { flex-wrap: wrap; }
}
/* Tooltips are absolutely positioned even when invisible and can widen the page on a phone. */
.tooltip:not(:hover):not(:focus-visible)::before, .tooltip:not(:hover):not(:focus-visible)::after { visibility: hidden; }
.tooltip::before { max-width: min(20rem, 80vw); white-space: normal; }
@media (max-width: 1024px) { html, body { overflow-x: hidden; } }
.label-text { white-space: normal; }
.label.cursor-pointer { align-items: flex-start; }
