/* Profile canvas (canvas.js): a blank dot grid. 24 columns across, one row is
   24px. Places come from --x --y --w --h set through the style object (the CSP
   blocks style attributes in markup, not custom properties set from script). */
.cv-page { display: flex; flex-direction: column; flex: 1; width: 100%; min-width: 0; min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px); }
/* The canvas tab only: the stage is a column, main grows, the footer sits at the bottom edge. */
.stage:has(> main.main-canvas) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.stage > main.main-canvas { display: flex; flex-direction: column; flex: 1; width: 100%; max-width: none; margin: 0; box-sizing: border-box; }
.stage:has(> main.main-canvas) > footer { width: 100%; max-width: none; margin: 0; box-sizing: border-box; }
.cv-grid { --dot: color-mix(in srgb, var(--ink, #1c2430) 22%, transparent); position: relative; flex: 1; width: 100%; box-sizing: border-box; min-height: calc(var(--rows, 24) * 24px); border-radius: 14px;
  background-color: var(--paper, transparent); background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.4px); background-size: calc(100% / 24) 24px; background-position: 0 0; }
.cv-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 92%); text-align: center; display: grid; gap: 14px; }
.cv-empty h3 { margin: 0; font: 600 20px var(--tight, var(--sans)); letter-spacing: -0.015em; color: var(--ink); }
.cv-starters { display: grid; gap: 8px; justify-items: center; }
.cv-starter { max-width: 100%; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card, #fff); color: var(--ink); font: 500 13.5px var(--sans); cursor: pointer; }
.cv-starter[data-copied] { border-color: var(--ink); }
.cv-w { position: absolute; left: calc(var(--x) * 100% / 24); top: calc(var(--y) * 24px); width: calc(var(--w) * 100% / 24); height: calc(var(--h) * 24px); box-sizing: border-box;
  display: flex; flex-direction: column; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card, #fff); color: var(--ink); overflow: hidden; }
.cv-hd { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px 0 12px; min-width: 0; }
.cv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13px var(--sans); }
.cv-k-profile .cv-hd .cv-name:empty { display: none; }
.cv-body { flex: 1; min-height: 0; padding: 4px 12px 10px; overflow: auto; font: 400 13.5px/1.45 var(--sans); overflow-wrap: anywhere; }
.cv-d-compact .cv-body { font-size: 12.5px; line-height: 1.3; padding-top: 0; }
.cv-text, .cv-md p { margin: 0 0 8px; white-space: pre-wrap; }
.cv-md h4 { margin: 0 0 6px; font: 600 15px var(--tight, var(--sans)); }
.cv-md ul, .cv-md ol, .cv-list { margin: 0; padding-left: 18px; }
.cv-list { list-style: none; padding: 0; }
.cv-list li { padding: 5px 0; border-top: 1px solid var(--line); }
.cv-list li:first-child { border-top: 0; }
.cv-list small, .cv-none { color: var(--soft, var(--muted)); }
.cv-stat { margin: 0; font: 600 40px/1 var(--tight, var(--sans)); letter-spacing: -0.03em; }
.cv-c-sand { background: #f4eee3; } .cv-c-sage { background: #e8efe6; } .cv-c-sky { background: #e6eff7; } .cv-c-rose { background: #f7e9ea; }
.cv-c-ink { background: #1f2630; color: #f3f1ec; } .cv-c-ink .cv-list small, .cv-c-ink .cv-none { color: #c9c6bf; }
.cv-a-sky { border-top: 3px solid #6aa6d8; } .cv-a-sage { border-top: 3px solid #7fae83; } .cv-a-sand { border-top: 3px solid #cdb78d; }
.cv-a-rose { border-top: 3px solid #d98b92; } .cv-a-ink { border-top: 3px solid #1f2630; }
html.dark .cv-c-paper { background: var(--card, #1c2026); }

/* Custom widgets (round 2). The frame lives in a clipped cell: it can't paint
   outside its box, and its title and the "Custom widget" badge are the
   parent's, outside the frame, so it can't pass as Nimbus. */
.cv-badge { flex: none; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; font: 600 11px var(--sans); color: var(--soft, var(--muted)); white-space: nowrap; }
.cv-custom .cv-hd { gap: 8px; }
.cv-body-custom { padding: 0; overflow: hidden; display: flex; }
.cv-frame-cell { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; contain: strict; isolation: isolate; }
.cv-frame-cell iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: normal; }
.cv-dragging iframe, .cv-dragging .cv-frame-cell { pointer-events: none; }
.cv-dragging { user-select: none; }
.cv-park { position: fixed; left: 0; top: 0; width: 0; height: 0; overflow: hidden; }
.cv-approve, .cv-err { flex: 1; padding: 6px 12px 10px; overflow: auto; font: 400 13px/1.45 var(--sans); }
.cv-approve p, .cv-err p { margin: 0 0 6px; }
.cv-approve-lead { font-weight: 600; }
.cv-approve { display: flex; flex-direction: column; justify-content: flex-end; }
.cv-approve-bar { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.cv-approve-bar span { flex: 1; min-width: 0; }
.cv-approve-go { flex: none; padding: 5px 14px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--card, #fff); font: 600 13px var(--sans); cursor: pointer; }
.cv-err { color: var(--ink); }
.cv-locked { padding: 6px 12px; }
@media (max-width: 640px) { .cv-page { min-height: calc(100vh - 120px); min-height: calc(100dvh - 120px); max-width: 100%; overflow-x: hidden; } .stage > main.main-canvas { padding-left: 14px; padding-right: 14px; } }

/* Profile's own cards as widgets (2026-11-12): one frame, the widget's. */
.cv-w.cv-k-profile .cv-body > .td-card-s, .cv-w.cv-k-profile .cv-body > section, .cv-w.cv-k-profile .cv-body > .cr-side-card { margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; }
.cv-home { margin-top: 12px; }
/* Profile's canvas home fills the window down to its bottom edge (Conner,
   2026-11-12). dash.css zeroes .td-home's min-height, so the height comes
   from the page column instead: the canvas takes what the greeting leaves. */
.tl-shell .td-home-canvas > .cv-home { flex: 1 0 auto; display: flex; flex-direction: column; }
.tl-shell .td-home-canvas > .cv-home > .cv-page { flex: 1 0 auto; padding-bottom: 0; }

/* Edit mode (Conner, 2026-11-12, docs/mockups/widget-run-gate.png): an Edit
   button above the canvas; in Edit the whole widget drags, any corner resizes,
   × removes. Outside Edit nothing on a widget moves or shows on hover. */
.cv-editbar { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.cv-edit { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: 500 13px var(--sans); cursor: pointer; }
.cv-edit.on { background: var(--ink); border-color: var(--ink); color: var(--card, #fff); }
.cv-w { overflow: visible; }
.cv-w > .cv-body { overflow: auto; border-radius: 0 0 12px 12px; }
.cv-w > .cv-body-custom { overflow: hidden; }
.cv-w-edit { cursor: grab; touch-action: none; user-select: none; outline: 1.5px dashed #2E90FA; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(46, 144, 250, 0.12); }
.cv-w-edit:focus-visible { outline-style: solid; }
.cv-dragging .cv-w-edit { cursor: grabbing; }
.cv-editing .cv-body { pointer-events: none; }
.cv-editing iframe, .cv-editing .cv-frame-cell { pointer-events: none; }
.cv-corner { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #2E90FA; box-sizing: border-box; touch-action: none; z-index: 2; }
.cv-corner-nw { left: -9px; top: -9px; cursor: nwse-resize; } .cv-corner-se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.cv-corner-ne { right: -9px; top: -9px; cursor: nesw-resize; } .cv-corner-sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.cv-rm { position: absolute; top: -11px; right: 14px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: var(--card, #fff); font: 600 13px/22px var(--sans); cursor: pointer; z-index: 3; }
@media (max-width: 640px) { .cv-corner { width: 20px; height: 20px; } }
