/* peek.css — the hovercard (specs/143 §2). One floating card on <body>, the
   fragment inside it wears .cl-peek__card. Type stays ≥ 12px: a card is read,
   not squinted at. */
.cl-peek { position: fixed; z-index: 120; width: 344px; max-width: calc(100vw - 16px); pointer-events: auto; }
.cl-peek[hidden] { display: none; }
.cl-peek__card { position: relative; border: 1px solid var(--border-default); border-radius: 14px; background: var(--bg-surface); box-shadow: 0 18px 44px -18px rgb(0 0 0 / .45), 0 2px 8px -4px rgb(0 0 0 / .25); padding: 12px 14px 12px; color: var(--text-primary); font-size: 12.5px; line-height: 1.45; animation: cl-peek-in .16s ease-out; }
.cl-peek[data-side="above"] .cl-peek__card { animation-name: cl-peek-in-up; }
.cl-peek__card::before { content: ""; position: absolute; left: var(--cl-peek-caret, 20px); width: 10px; height: 10px; background: var(--bg-surface); border-left: 1px solid var(--border-default); border-top: 1px solid var(--border-default); transform: translateX(-50%) rotate(45deg); top: -6px; }
.cl-peek[data-side="above"] .cl-peek__card::before { top: auto; bottom: -6px; transform: translateX(-50%) rotate(225deg); }
.cl-peek__card::after { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--sc, var(--accent-brief)); opacity: .9; }
@keyframes cl-peek-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes cl-peek-in-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cl-peek__card { animation: none; } }
.cl-peek__head { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 8px; }
.cl-peek__kind { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sc, var(--accent-brief)); background: color-mix(in srgb, var(--sc, var(--accent-brief)) 12%, var(--bg-surface)); }
.cl-peek__kind > i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cl-peek__title { min-width: 0; font: 600 14px/1.3 var(--font-serif, Georgia, serif); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-peek__id { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-right: 6px; }
.cl-peek__facts { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.cl-peek__pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-surface-2); font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.cl-peek__pill > b { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cl-peek__pill > i { width: 7px; height: 7px; border-radius: 50%; background: var(--sc, var(--text-faint)); }
.cl-peek__pill[data-tone="ok"] > i { background: var(--status-verified); }
.cl-peek__pill[data-tone="warn"] > i { background: var(--status-warning); }
.cl-peek__pill[data-tone="bad"] > i { background: var(--status-error); }
.cl-peek__pill[data-tone="quiet"] > i { background: var(--text-faint); }
.cl-peek__rows { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0 0 8px; }
.cl-peek__rows > dt { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); align-self: center; }
.cl-peek__rows > dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12.5px; color: var(--text-primary); }
.cl-peek__code { font-family: var(--font-mono); font-size: 11.5px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--text-secondary); }
.cl-peek__list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
.cl-peek__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: 12.5px; }
@media (hover: hover) {
  .cl-peek__row:hover { background: var(--bg-surface-2); }
}
.cl-peek__row > a, .cl-peek__row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); text-decoration: none; }
.cl-peek__row > a code { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-right: 5px; }
.cl-peek__row > small { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.cl-peek__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border-default); }
.cl-peek__door { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-surface); color: var(--text-primary); font-size: 12.5px; font-weight: 500; text-decoration: none; transition: background .12s ease, border-color .12s ease; }
@media (hover: hover) {
  .cl-peek__door:hover { background: var(--bg-surface-2); border-color: var(--border-strong); }
}
.cl-peek__door svg { width: 12px; height: 12px; color: var(--text-muted); }
.cl-peek__note { font-size: 11.5px; color: var(--text-muted); }
.cl-peek__empty { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.cl-peek__card--loading { min-height: 64px; display: grid; gap: 8px; align-content: center; }
.cl-peek__bone { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-surface-2), color-mix(in srgb, var(--text-primary) 6%, var(--bg-surface-2)), var(--bg-surface-2)); background-size: 200% 100%; animation: cl-peek-shimmer 1.1s linear infinite; }
@keyframes cl-peek-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
[data-cl-peek] { cursor: pointer; }
[data-cl-peek][data-peek-open="1"] { outline: 2px solid color-mix(in srgb, var(--sc, var(--accent-brief)) 35%, transparent); outline-offset: 2px; border-radius: 999px; }

/* The lifecycle stepper (specs/143 §3): six numbered steps on one rail, each a door with its
   live count. Its OWN class family, `cl-lc-*` (2026-09-23): it once shared `.cl-step` with the
   delivery ticket's rows in delivery-ticket.css, which loads on the Rooms page and won — the
   dialog's six steps stacked into one 100px column. A component's classes are never a prefix
   another component also uses; the render sweep's LC01 opens the dialog on every host page. */
.cl-lc-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; position: relative; }
.cl-lc-steps::before { content: ""; position: absolute; left: calc(100% / 12); right: calc(100% / 12); top: 15px; height: 2px; background: var(--border-default); }
.cl-lc-step { position: relative; display: grid; justify-items: center; gap: 6px; padding: 0 6px; text-align: center; min-width: 0; }
.cl-lc-step__door { display: grid; justify-items: center; gap: 6px; color: inherit; text-decoration: none; min-width: 0; width: 100%; border-radius: 10px; padding: 0 2px 6px; }
@media (hover: hover) {
  .cl-lc-step__door:hover { background: var(--bg-surface-2); }
}
.cl-lc-step__dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--sc, var(--border-strong)); background: var(--bg-surface); color: var(--sc, var(--text-secondary)); font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; box-shadow: 0 0 0 4px var(--bg-surface); position: relative; z-index: 1; }
.cl-lc-step[data-live="1"] .cl-lc-step__dot { background: var(--sc, var(--accent-brief)); color: #fff; }
.cl-lc-step__n { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1; }
.cl-lc-step__label { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.cl-lc-step__sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.3; }
.cl-lc-steps--strip { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-lc-steps--strip::before { display: none; }
@media (max-width: 700px) { .cl-lc-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; } .cl-lc-steps::before { display: none; } }

/* The lifecycle dialog + the doors that open it (specs/143 §3) */
.cl-lifecycle__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--border-default); }
.cl-lifecycle__eyebrow { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.cl-lifecycle__h2 { margin: 0; font: 500 22px/1.2 var(--font-serif, Georgia, serif); letter-spacing: -.015em; color: var(--text-primary); }
.cl-lifecycle__close { width: 30px; height: 30px; border-radius: 999px; font-size: 18px; line-height: 1; }
.cl-lifecycle__body { padding: 22px 20px 18px; overflow: auto; }
.cl-lifecycle__laws { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border-default); }
/* The four laws are PILLS on every host page (2026-09-23: they borrowed `.pl-repo-pill`, which only
   the Pipeline page's stylesheet defines — on Case rooms and All cases they fell to plain text). */
.cl-lc-law { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 9px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-surface-2); font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.cl-lc-law > i { width: 7px; height: 7px; border-radius: 50%; background: var(--status-verified); }
.rw-lifecycle-door { margin-left: auto; }
.case-meta-code { display: inline-flex; align-items: center; }
.case-meta-code > code { font-family: var(--font-mono); font-size: 11.5px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--text-secondary); }

/* The frame-global ghost door (the pipeline's .pl-door, for every page): an icon before the word, quiet until hovered. */
.cl-door { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-surface); color: var(--text-primary); font-size: 12.5px; font-weight: 500; line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s ease, border-color .12s ease; }
@media (hover: hover) {
  .cl-door:hover { background: var(--bg-surface-2); border-color: var(--border-strong); }
}
.cl-door:focus-visible { outline: 2px solid var(--accent-brief); outline-offset: 2px; }
.cl-door svg { width: 11px; height: 11px; color: var(--text-muted); flex: none; }
.cl-door--sm { height: 24px; font-size: 12px; padding: 0 9px 0 8px; }
.rw-lifecycle-door { margin-left: auto; margin-right: 10px; align-self: center; }

/* KSF's first-right answer (specs/143 §5): the pill and the block, frame-global */
.cl-ksf { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 7px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-surface-2); font-size: 11px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.cl-ksf > i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.cl-ksf--keep { border-color: color-mix(in srgb, var(--status-warning) 45%, var(--border-default)); color: var(--text-primary); }
.cl-ksf--keep > i { background: var(--status-warning); }
.cl-ksf--release, .cl-ksf--accepted { border-color: color-mix(in srgb, var(--status-verified) 40%, var(--border-default)); color: var(--text-primary); }
.cl-ksf--release > i, .cl-ksf--accepted > i { background: var(--status-verified); }
.cl-ksf--taken { border-color: color-mix(in srgb, var(--accent-brief) 40%, var(--border-default)); color: var(--text-primary); }
.cl-ksf--taken > i { background: var(--accent-brief); }
.cl-ksf--none { border-style: dashed; }
.cl-ksf-block { display: block; }
.cl-ksf-block__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cl-ksf-block__q { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); cursor: help; }
.cl-ksf-block__withdraw { color: var(--text-muted); }
.cl-ksf-block__error { margin: 6px 0 0; font-size: 12px; color: var(--status-error); }
/* The deliver dialog's buttons wait visibly for KSF's answer (INV-1276) */
#deliver-dialog [data-test-id="deliver-submit"][disabled], #deliver-dialog [data-test-id="deliver-anyway"][disabled] { opacity: .45; cursor: not-allowed; }


/* CLICK TO COPY — the house control (`_copy_value.html`, INV-1331, 2026-09-23). The whole value is the click
   target; hover deepens the field; the glyph at the end becomes a check and "Copied" appears for 1.6 s (frame.js
   toggles .cl-copied and the tooltip). Sizes: default (a link row) · --code (a referral code, large mono). */
.cl-copyval { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; height: 30px; padding: 0 8px 0 10px; border: 1px solid var(--border-default); border-radius: 8px; background: color-mix(in srgb, var(--text-primary) 3%, transparent); color: var(--text-secondary); font: inherit; text-align: left; cursor: pointer; transition: background .12s ease, border-color .12s ease, color .12s ease; }
.cl-copyval:focus-visible { background: color-mix(in srgb, var(--text-primary) 7%, transparent); border-color: var(--border-strong); color: var(--text-primary); }
@media (hover: hover) {
  .cl-copyval:hover { background: color-mix(in srgb, var(--text-primary) 7%, transparent); border-color: var(--border-strong); color: var(--text-primary); }
}
.cl-copyval:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cl-copyval__kind { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }
.cl-copyval__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 12px; letter-spacing: .01em; user-select: text; }
.cl-copyval__icon { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; color: var(--text-faint); transition: color .12s ease, background .12s ease; }
@media (hover: hover) {
  .cl-copyval:hover .cl-copyval__icon { color: var(--text-primary); background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
}
.cl-copyval__icon > svg:nth-of-type(2), .cl-copyval__done { display: none; }
.cl-copyval__done { flex: none; font-size: 11px; font-weight: 600; color: var(--status-verified); }
.cl-copyval.cl-copied { border-color: color-mix(in srgb, var(--status-verified) 55%, var(--border-default)); background: color-mix(in srgb, var(--status-verified) 10%, transparent); }
.cl-copyval.cl-copied .cl-copyval__icon { color: var(--status-verified); background: transparent; }
.cl-copyval.cl-copied .cl-copyval__icon > svg:nth-of-type(1) { display: none; }
.cl-copyval.cl-copied .cl-copyval__icon > svg:nth-of-type(2), .cl-copyval.cl-copied .cl-copyval__done { display: inline-flex; }
/* the referral code: the code is the field — large mono, tracked, tabular */
.cl-copyval--code { height: auto; padding: 4px 10px 4px 12px; gap: 10px; }
.cl-copyval--code .cl-copyval__value { font-size: 22px; font-weight: 600; letter-spacing: .12em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dt-stub--compact .cl-copyval--code .cl-copyval__value { font-size: 14px; letter-spacing: .08em; }
.cl-copyval--code .cl-copyval__icon { width: 24px; height: 24px; }
@media (max-width: 700px) { .cl-copyval--code .cl-copyval__value { font-size: 18px; letter-spacing: .08em; } }


/* THE TONED BADGE GRAMMAR (INV-1336, 2026-09-23 — Bennett on the editor's citation cards: "it should be light red
   badge at rest and thicker darker on hover … i think other places in kaices have this backwards, like some
   lead cards on pipeline"). After the editor's `.ed2-sec__state`: at rest the tone's text on a 14% tint with a
   40% border; when the badge is a door (a link or a button) hover deepens it — 24% tint, 70% border, the tone's
   text — never a flat surface, never nothing. Applies to every toned pill family the Django side renders. */
.cl-pillar--met, .cl-pill--verified, .cl-pillar--met.cl-pillar { --tone: var(--status-verified); }
.cl-pillar--hedge, .cl-pill--warning { --tone: var(--status-warning); }
.cl-pillar--failed, .cl-pill--error { --tone: var(--status-error); }
.cl-pill--info, .cl-pill--brief { --tone: var(--accent-brief); }
.cl-pillar--met, .cl-pillar--hedge, .cl-pillar--failed,
.cl-pill--verified, .cl-pill--warning, .cl-pill--error, .cl-pill--info, .cl-pill--brief {
  color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); border-color: color-mix(in srgb, var(--tone) 40%, transparent);
}
a.cl-pillar--met:focus-visible,
a.cl-pillar--hedge:focus-visible,
a.cl-pillar--failed:focus-visible {
  color: var(--tone); background: color-mix(in srgb, var(--tone) 24%, transparent); border-color: color-mix(in srgb, var(--tone) 70%, transparent);
}
@media (hover: hover) {
  a.cl-pillar--met:hover,
  a.cl-pillar--hedge:hover,
  a.cl-pillar--failed:hover,
  button.cl-pillar--met:hover,
  button.cl-pillar--hedge:hover,
  button.cl-pillar--failed:hover,
  a.cl-pill--verified:hover,
  a.cl-pill--warning:hover,
  a.cl-pill--error:hover,
  a.cl-pill--info:hover,
  a.cl-pill--brief:hover,
  button.cl-pill--verified:hover,
  button.cl-pill--warning:hover,
  button.cl-pill--error:hover,
  button.cl-pill--info:hover,
  button.cl-pill--brief:hover {
    color: var(--tone); background: color-mix(in srgb, var(--tone) 24%, transparent); border-color: color-mix(in srgb, var(--tone) 70%, transparent);
  }
}
/* the room-page firm badges follow the same rule in their own tone (the pipeline status pill is fixed in pipeline-workspace.css) */
@media (hover: hover) {
  .rw-page a.rw-firm:hover { background: color-mix(in srgb, var(--accent-brief) 16%, var(--bg-surface)); border-color: color-mix(in srgb, var(--accent-brief) 55%, var(--border-default)); }
  .rw-page a.rw-firm.rw-accepted:hover { background: color-mix(in srgb, var(--status-verified) 16%, var(--bg-surface)); border-color: color-mix(in srgb, var(--status-verified) 55%, var(--border-default)); }
  .rw-page a.rw-firm.rw-declined:hover { background: color-mix(in srgb, var(--status-warning) 14%, var(--bg-surface)); border-color: color-mix(in srgb, var(--status-warning) 60%, var(--border-default)); }
}

/* ── The screen preview (specs/174 §3, INV-2744) — the REAL destination
   page, scaled, inside a sandboxed frame. Clicking it goes where the
   door goes. ───────────────────────────────────────────────────────────────── */
.cl-peek__card--screenview { padding: 0; overflow: hidden; position: relative; }
.cl-peek[data-side="beside"] .cl-peek__card::before { display: none; }
.cl-peek__card--screenview.cl-peek__card--loading { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0 16px; }
.cl-peek--screens { pointer-events: none; }
.cl-peek__screenframe {
  display: block; border: 0; transform-origin: top left; pointer-events: none;
  background: var(--bg-surface);
}
.cl-peek__screenframe[hidden] { display: none; }
.cl-peek__screenskel {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: center; gap: 8px; padding: 0 16px; background: var(--bg-surface);
}
.cl-peek__screenskel[hidden] { display: none; }
