/* AURA Kit · the live Card and its ⋮ panel (D-CBO-324, D-CBO-325). Tokens only; light and dark from tokens.css.
   The Card follows CHART_SPEC.md: 24 px padding (16 on a phone), serif title 22/28, Subtitle 14 ink-2, foot 12 ink-3. */

/* ---------- the live Card ---------- */
.ckc { position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; min-height: 100%; box-sizing: border-box; padding: 24px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-rest); color: var(--ink); }
.ckc.st-flat { background: transparent; box-shadow: none; padding-left: 0; padding-right: 0; }
.ckc.st-tinted, .ckc.bg-tint { background: var(--surface-2); box-shadow: none; }
.ckc.bg-picture { background: var(--surface-2); background-image: linear-gradient(var(--surface-2), var(--surface-2)); }
.ckc.d-compact { padding: 16px; }
.ckc.h-S .ckc-body { min-height: 150px; } .ckc.h-M .ckc-body { min-height: 200px; } .ckc.h-L .ckc-body { min-height: 320px; }
.ckc-head { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px; }
.ckc-head > div { flex: 1; min-width: 0; }
.ckc-title { margin: 0; font: 400 22px/28px var(--font-serif); color: var(--ink); overflow-wrap: anywhere; }
.ckc-head.ed .ckc-title { font-size: 30px; line-height: 36px; }
.ckc-kick { margin: 0 0 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }
.ckc-sub { margin: 4px 0 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); }
.ckc-menu { flex: none; margin: -4px -8px 0 0; }
.ckc.nohead .ckc-menu { position: absolute; top: 12px; right: 12px; z-index: 2; }
.ckc-body { position: relative; flex: 1; min-height: 150px; min-width: 0; }
.ckc-body.chart { overflow: hidden; }
.ckc-svg { position: absolute; inset: 0; display: block; }
.ckc-empty { margin: 0; color: var(--ink-3); font-size: var(--fs-sm); }
.ckc-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: var(--fs-xs); color: var(--ink-3); }
.ckc-foot > span:first-child { flex: 1; min-width: 0; }
.ckc-lab .icon { font-size: 14px; }

/* the Table */
.ckc-tablebox { overflow: auto; border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
.ckc-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.ckc-table th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 500; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ckc-table th .icon { vertical-align: -3px; margin-right: 6px; color: var(--ink-3); }
.ckc-table td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; background: var(--surface); }
.ckc-table td + td, .ckc-table th + th { border-left: 1px solid var(--hairline); }
.ckc-table.wrap td { white-space: normal; }
.ckc-table.rh-compact td { padding: 4px 12px; } .ckc-table.rh-tall td { padding: 16px 12px; }
.ckc-table.freeze th:first-child, .ckc-table.freeze td:first-child { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line); }
.ckc-table.freeze th:first-child { z-index: 3; }
.ckc-table .rn { width: 32px; color: var(--ink-3); text-align: right; }
.ckc-table.freeze .rn + td, .ckc-table.freeze .rn + th { position: static; box-shadow: none; }
.ckc-table td.r { text-align: right; }
.ckc-table tfoot td { font-weight: 600; background: var(--surface-2); border-bottom: 0; }
.ckc-num { font-variant-numeric: tabular-nums; }
.ckc-choice { display: inline-block; padding: 0 8px; border-radius: 4px; background: var(--surface-2); line-height: 22px; font-size: var(--fs-xs); }
.ckc-link { display: inline-flex; align-items: center; gap: 2px; text-decoration: underline; text-decoration-color: var(--line-strong); }
.ckc-tcount { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--ink-3); }

/* the Board */
.ckc-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.ckc-bcol { flex: 1 0 168px; min-width: 168px; padding: 8px; border-radius: 8px; background: var(--surface-2); }
.ckc-bh { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.ckc-bh b { font-weight: 500; color: var(--ink-3); }
.ckc-bcard { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; padding: 10px; border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-rest); border-left: 3px solid transparent; font-size: var(--fs-sm); }
.ckc-bcard b { font-weight: 500; }
.ckc-bcard.tone1 { border-left-color: var(--chart-1); } .ckc-bcard.tone2 { border-left-color: var(--chart-2); } .ckc-bcard.tone3 { border-left-color: var(--chart-3); } .ckc-bcard.tone4 { border-left-color: var(--chart-4); }
.ckc-bf { display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--ink-3); }
.ckc-bempty { margin: 8px 0; font-size: var(--fs-xs); color: var(--ink-3); text-align: center; }

/* the Tree */
.ckc-tree { overflow: auto; padding: 4px; }
.ckc-tree.down .ckc-tn { display: flex; flex-direction: column; align-items: center; }
.ckc-tree.down .ckc-tkids { display: flex; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-strong); position: relative; }
.ckc-tree.down .ckc-tkids > .ckc-tn { position: relative; }
.ckc-tree.down .ckc-tkids > .ckc-tn::before { content: ""; position: absolute; top: -16px; left: 50%; height: 16px; border-left: 1px solid var(--line-strong); }
.ckc-tree.across .ckc-tn { display: flex; align-items: flex-start; gap: 24px; }
.ckc-tree.across .ckc-tkids { display: flex; flex-direction: column; gap: 8px; padding-left: 16px; border-left: 1px solid var(--line-strong); }
.ckc-tbox { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 120px; max-width: 200px; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-rest); font-size: var(--fs-sm); }
.ckc-tbox.root { border-color: var(--accent); background: var(--accent-soft); }
.ckc-tbox b { font-weight: 500; line-height: 1.3; }
.ckc-tv { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ckc-tc { position: absolute; top: -8px; right: -8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 18px; text-align: center; }
.ckc-tbox .k-chip { align-self: flex-start; }
.ckc-tmore { margin-top: 8px; display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 8px; border: 1px dashed var(--line-strong); border-radius: 6px; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-xs); }

/* ---------- the panel ---------- */
.ckp { position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: 400px; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-drop); color: var(--ink); font-size: var(--fs-sm); }
.ckp.inline { position: relative; top: auto; right: auto; bottom: auto; height: 640px; width: 100%; border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-raised); overflow: hidden; }
.ckp-head { flex: none; padding: 12px 16px 12px; border-bottom: 1px solid var(--hairline); }
.ckp-top { display: flex; align-items: center; justify-content: space-between; }
.ckp-kind { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-3); }
.ckp-name { display: block; margin: 2px 0 10px; font: 400 20px/28px var(--font-serif); overflow-wrap: anywhere; }
.ckp-search { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid transparent; }
.ckp-search:focus-within { border-color: var(--accent); background: var(--surface); }
.ckp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.ckp-vp { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.ckp-page { padding: 4px 0 16px; }
.ckp-sec { border-bottom: 1px solid var(--hairline); }
.ckp-sech { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.ckp-sech .icon { color: var(--ink-3); transition: transform .16s; transform: rotate(-90deg); }
.ckp-sec.open .ckp-sech .icon { transform: none; }
.ckp-secb { padding: 0 8px 8px; }
.ckp-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 4px 8px; box-sizing: border-box; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
button.ckp-row:hover, label.ckp-row:hover { background: var(--surface-2); }
.ckp-row > .icon:first-child { color: var(--ink-3); flex: none; }
.ckp-row.on { background: var(--accent-soft); }
.ckp-row:disabled { opacity: .45; cursor: not-allowed; }
.ckp-l { flex: 1; min-width: 0; }
.ckp-l small { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.ckp-v { flex: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); color: var(--ink-3); }
.ckp-v .k-chip { vertical-align: middle; }
.ckp-row select, .ckp-change select { max-width: 160px; height: 28px; padding: 0 28px 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-xs); }
.ckp-in input { width: 150px; height: 28px; padding: 0 8px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-xs); }
.ckp-in input:focus, .ckp-row select:focus { outline: 0; border-color: var(--accent); }
.ckp-segrow { flex-wrap: wrap; }
.ckp-seg { display: inline-flex; flex-wrap: wrap; padding: 2px; border-radius: 6px; background: var(--surface-2); }
.ckp-seg button { height: 24px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.ckp-seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-rest); font-weight: 500; }
.ckp-sw { appearance: none; flex: none; width: 32px; height: 18px; margin: 0; border-radius: 10px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .12s; }
.ckp-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .12s; }
.ckp-sw:checked { background: var(--accent); }
.ckp-sw:checked::after { transform: translateX(14px); }
.ckp-sw:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.ckp-lock { cursor: default; align-items: flex-start; }
.ckp-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.ckp-chips .k-chip { opacity: .7; }
.ckp-chips .icon { font-size: 14px; }
.ckp-row.flash { animation: ckp-flash 1.2s ease-out; }
@keyframes ckp-flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.ckp-hit mark { background: var(--accent-soft); color: inherit; border-radius: 2px; }
.ckp-subhead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 8px; background: var(--surface); border-bottom: 1px solid var(--hairline); }
.ckp-subhead b { font-weight: 600; }
.ckp-subb { padding: 8px; }
.ckp-help { margin: 4px 8px 10px; font-size: var(--fs-xs); line-height: 1.5; color: var(--ink-3); }
.ckp-sub { margin: 14px 8px 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.ckp-step { display: flex; align-items: center; gap: 8px; margin: 4px 8px 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }
.ckp-link { margin: 8px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.ckp-radio .icon:first-child { color: var(--accent); }
.ckp-tabs { display: flex; gap: 4px; margin: 0 4px 8px; border-bottom: 1px solid var(--hairline); }
.ckp-tabs button { height: 32px; padding: 0 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.ckp-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.ckp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 4px 12px; }
.ckp-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.ckp-tile .icon { color: var(--accent); }
.ckp-tile.on { border-color: var(--accent); background: var(--accent-soft); }
.ckp-tile.dim .icon { color: var(--ink-3); }
.ckp-proof { list-style: none; margin: 0 8px; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.ckp-proof li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.ckp-proof li .k-chip { align-self: flex-start; }
.ckp-proof small { color: var(--ink-3); font-size: var(--fs-xs); }
.ckp-about { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; margin: 8px; font-size: var(--fs-sm); }
.ckp-about dt { color: var(--ink-3); } .ckp-about dd { margin: 0; }
.ckp-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 8px; padding: 28px 16px; border: 2px dashed var(--line-strong); border-radius: 10px; text-align: center; color: var(--ink-2); }
.ckp-drop > .icon { font-size: 32px; color: var(--accent); }
.ckp-drop span { font-size: var(--fs-xs); color: var(--ink-3); }
.ckp-pasted { margin: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ckp-pasteh { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 10px; background: var(--surface-2); font-size: var(--fs-xs); font-weight: 600; }
.ckp-raw { overflow-x: auto; font: 12px/1.6 ui-monospace, Menlo, monospace; }
.ckp-raw div { display: flex; white-space: nowrap; border-top: 1px solid var(--hairline); }
.ckp-raw div.h { font-weight: 600; background: var(--surface-2); }
.ckp-raw span { flex: none; width: 120px; padding: 2px 8px; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--hairline); }
.ckp-wide { display: flex; justify-content: center; gap: 6px; width: calc(100% - 16px); margin: 12px 8px 4px; }
.ckp-guess { cursor: default; }
.ckp-change { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ckp-ch { font-size: 12px; color: var(--accent); }
.ckp-sim .icon { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ckp-done { display: flex; gap: 10px; margin: 8px; padding: 12px; border-radius: 8px; background: var(--accent-soft); }
.ckp-done > .icon { color: var(--accent); }
.ckp-done b { display: block; font-weight: 600; } .ckp-done span { font-size: var(--fs-xs); color: var(--ink-2); }
.ckp-foot { flex: none; display: flex; align-items: center; gap: 2px; padding: 8px; border-top: 1px solid var(--line); background: var(--surface); }
.ckp-foot button { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.ckp-foot button:hover { background: var(--surface-2); color: var(--ink); }
.ckp-foot .danger { margin-left: auto; color: var(--danger); }
.ckp-sheetwrap { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; background: var(--scrim); }
.ckp-sheet { width: 100%; padding: 16px; border-radius: 12px 12px 0 0; background: var(--surface); box-shadow: var(--shadow-drop); }
.ckp-sheeth { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-md); }
.ckp-field { display: flex; flex-direction: column; gap: 4px; margin: 0 8px 12px; font-size: var(--fs-xs); color: var(--ink-2); }
.ckp-field input, .ckp-field select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); }
.ckp-sheetf { display: flex; justify-content: flex-end; gap: 8px; margin: 12px 8px 0; }

/* the viewer's menu and the sheets */
.ckv { position: fixed; z-index: 65; width: 240px; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-drop); }
.ckv-i { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
.ckv-i span:not(.icon) { flex: 1; text-align: left; } .ckv-i .icon { color: var(--ink-3); }
.ckv-i:hover { background: var(--surface-2); }
.ckv-note { display: flex; gap: 6px; margin: 6px 4px 2px; padding: 8px 6px 2px; border-top: 1px solid var(--hairline); font-size: var(--fs-xs); color: var(--ink-3); }
.ckp-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 32px; background: var(--scrim); }
.ckp-ovbox { width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-drop); overflow: hidden; }
.ckp-ovbox.data { width: min(760px, 100%); }
.ckp-ovh { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--hairline); background: var(--surface); }
.ckp-ovb { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; }
.ckp-ovbox.full .ckp-ovb { min-height: 560px; }

/* the Kit's own frame for the piece */
.ckp-demo { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.ckp-demo-card { display: flex; min-height: 420px; }
@media (max-width: 767px) {
  .ckp:not(.inline) { top: 0; width: 100%; border-left: 0; z-index: 85; }
  .ckp-demo { grid-template-columns: 1fr; }
  .ckc { padding: 16px; }
  .ckp-overlay { padding: 0; }
  .ckp-ovbox { border-radius: 0; height: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ckp-sech .icon, .ckp-sw, .ckp-sw::after { transition: none; } .ckp-row.flash { animation: none; } }
.ckp-l small.ckp-match { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--accent); font-weight: 500; }
.ckp-match .icon { font-size: 14px; }
.ckp-guess .ckp-change select { max-width: 156px; }
.ckp-sw:disabled { opacity: .55; cursor: not-allowed; }
