/* SPEC-197 FR-13: the repairs app on the composite app kit. kit.css gives the page, the header, the dialogs and the colour
   tokens (light and dark); this file styles only the app's own content, on the kit's tokens. */
:root { --bg: var(--kit-bg); --card: var(--kit-surface); --ink: var(--kit-text); --muted: var(--kit-muted); --line: var(--kit-line); --accent: var(--kit-accent); --ok: #1a7f37; --bad: #c4321c; --run: #b7791f; --skip: #a0a7b4; }
main, footer { font-size: 14px; }
.repairs-sub { color: var(--kit-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repairs-tag { font-size: 11px; background: #f2b134; color: #12284c; border-radius: 4px; padding: 1px 6px; margin-right: 8px; font-weight: 600; }
main { display: grid; grid-template-columns: minmax(380px, 1fr) 1.5fr; gap: 16px; padding: 16px 24px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.hidden { display: none !important; }
#signin { grid-column: 1 / -1; max-width: 520px; }
#personas button { margin-right: 8px; }
main button { font: inherit; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
main button.secondary, aside button.secondary { background: var(--card); color: var(--accent); }
main button:disabled { opacity: 0.5; cursor: default; }
#conversation { background: var(--card); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; height: calc(100vh - var(--kit-header-height) - 90px); }
#log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 8px 10px; border-radius: 8px; max-width: 95%; white-space: pre-wrap; line-height: 1.35; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.msg.step { background: #f0f7f1; border-left: 3px solid var(--ok); }
.msg.decision { background: #eef2fb; border-left: 3px solid var(--accent); font-size: 13px; }
.msg.refused { background: #fdf0ee; border-left: 3px solid var(--bad); }
.msg.outcome { background: #12284c; color: #fff; font-weight: 600; }
.msg .label { font-weight: 600; margin-right: 6px; }
.msg.question, .msg.confirm { background: #fff8e8; border: 1px solid #f2d48a; }
.msg.question form, .msg.confirm .buttons { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.msg input, .msg select, #ask input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; flex: 1; min-width: 160px; }
.msg dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 13px; }
.msg dt { color: var(--muted); }
#ask { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.examples { padding: 0 12px 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.examples button { background: var(--card); color: var(--accent); font-size: 12px; padding: 3px 8px; }
#backends { display: grid; gap: 8px; }
.backend { background: var(--card); border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: 150px 1fr; overflow: hidden; }
.backend h3 { margin: 0; padding: 10px; background: #f0f2f6; font-size: 13px; border-right: 1px solid var(--line); }
.backend h3 small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.backend .body { padding: 8px 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 12px; padding: 2px 9px; font-size: 12px; color: var(--muted); background: #fff; }
.chip.running { border-color: var(--run); color: var(--run); background: #fff7e6; font-weight: 600; }
.chip.done { border-color: var(--ok); color: var(--ok); background: #effaf1; }
.chip.done::before { content: "✓ "; }
.chip.refused { border-color: var(--bad); color: var(--bad); background: #fdf0ee; }
.chip.skipped { color: var(--skip); text-decoration: line-through; }
.panel { margin-top: 6px; font-size: 12px; color: #344054; }
.panel table { border-collapse: collapse; width: 100%; }
.panel td, .panel th { text-align: left; padding: 2px 6px; border-bottom: 1px solid #f0f2f6; }
.panel th { color: var(--muted); font-weight: 500; }
.panel tr.fresh td { background: #fff7e6; }
footer { padding: 6px 24px 14px; color: var(--muted); font-size: 12px; }

/* SPEC-189 1.1.0 FR-15: a product record, opened from a backend row. */
tr.opens { cursor: pointer; }
tr.opens:hover td { background: #eef3fc; }
.record { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 92vw); background: var(--card); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(18, 40, 76, 0.15); padding: 20px 22px; overflow-y: auto; z-index: 50; }
.record-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.record-head h2 { margin: 0; font-size: 18px; text-transform: capitalize; flex: 1; }
.record-product { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; background: var(--kit-accent); color: #fff; border-radius: 4px; padding: 2px 8px; }
.record-meta { display: flex; gap: 16px; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
.record h3 { font-size: 13px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.record-fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.record-fields dt { color: var(--muted); }
.record-fields dd { margin: 0; word-break: break-word; }
.record-history { list-style: none; padding: 0; margin: 0; }
.record-history li { display: grid; grid-template-columns: 150px 1fr; gap: 2px 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.record-history time { color: var(--muted); font-size: 12px; grid-row: span 2; }
.record-history .by { color: var(--muted); font-size: 12px; }
.msg.trace { background: #f3f0fb; border-left: 3px solid #6b4fbb; font-size: 12px; }
.msg.trace a { color: #4b2fa3; }

/* SPEC-DELTA-189 D-20 (owner, 2026-11-26: "very hard to read"): a light spotlight shade, so the page behind a lesson's
   bubble stays readable. guide.css loads later and sets its own darker shade, in dark mode with :root:not([data-theme=light])
   (two pseudo-classes): the tripled :root outranks both, in light and dark mode. */
:root:root:root { --guide-shade: rgba(18, 40, 76, 0.08); }

/* SPEC-189 1.3.0 FR-22: the Keycloak sign-in link and sign-out. */
a.button { display: inline-block; background: var(--accent); color: #fff; border-radius: 6px; padding: 8px 16px; text-decoration: none; font-weight: 500; }
.signin-failed { color: var(--bad); }

/* SPEC-196 FR-18: the dark theme (<html data-theme="dark">, set by the kit); the kit's tokens give the base colours. */
:root[data-theme="dark"] { --ok: #4cc06a; --bad: #ff7a66; --run: #f0b54a; --skip: #7d8798; }
:root[data-theme="dark"] .msg.step { background: #17301f; }
:root[data-theme="dark"] .msg.decision { background: #1a2742; }
:root[data-theme="dark"] .msg.refused, :root[data-theme="dark"] .chip.refused { background: #3a1d19; }
:root[data-theme="dark"] .msg.question, :root[data-theme="dark"] .msg.confirm { background: #33290f; border-color: #6b5520; }
:root[data-theme="dark"] .msg.outcome { background: #2b4a85; }
:root[data-theme="dark"] .msg.trace { background: #241d3b; }
:root[data-theme="dark"] .msg.trace a { color: #b9a6ff; }
:root[data-theme="dark"] .msg input, :root[data-theme="dark"] .msg select, :root[data-theme="dark"] #ask input { background: #0f1520; color: var(--ink); }
:root[data-theme="dark"] .examples button, :root[data-theme="dark"] button.secondary { background: var(--card); }
:root[data-theme="dark"] .backend h3 { background: #1f2b3d; }
:root[data-theme="dark"] .chip { background: var(--card); }
:root[data-theme="dark"] .chip.running, :root[data-theme="dark"] .panel tr.fresh td { background: #3a2e12; }
:root[data-theme="dark"] .chip.done { background: #17301f; }
:root[data-theme="dark"] .panel { color: var(--ink); }
:root[data-theme="dark"] .panel td, :root[data-theme="dark"] .panel th { border-bottom-color: var(--line); }
:root[data-theme="dark"] tr.opens:hover td { background: #22324a; }

/* SPEC-213 FR-8: the stage's in-memory notice, under the header on every page. */
.demo-notice { margin: 0; padding: 0.4rem 1rem; text-align: center; font-size: 0.85rem; background: var(--kit-surface-2, #fff4d6); color: var(--kit-text, #3a2f00); border-bottom: 1px solid var(--kit-border, #e5d9a8); }
