/**
 * Swimlane Editor Styles
 * Shared by tasks.html and journey.html via swimlane.js.
 * The Swimlane class adds .swimlane-host to its container on init.
 * board-closed state is toggled on .swimlane-host (not body) to avoid page-level side-effects.
 * All rules (except :root, @keyframes, and body.is-*) are scoped under .swimlane-host.
 */

/* ── Box sizing (scoped to component) ─────────────────── */
.swimlane-host *, .swimlane-host *::before, .swimlane-host *::after { box-sizing: border-box; }

/* ── Graph Node Colors ─────────────────────────────────── */
:root {
  --node-fear-fill: #eeee99;       --node-fear-stroke: #222216;
  --node-pain-fill: #ee9a9a;       --node-pain-stroke: #221616;
  --node-confidence-fill: #9aeee4; --node-confidence-stroke: #162221;
  --node-task-fill: #343434;       --node-task-stroke: #000000;
  --node-subtask-fill: #505050;    --node-subtask-stroke: #343434;
  --node-content-fill: #beebee;   --node-content-stroke: #1b2222;
  --node-persona-fill: #0f62fe;    --node-persona-stroke: #0f62fe;
  --node-team-fill: #198038;       --node-team-stroke: #198038;
  --node-skill-fill: #8a3ffc;      --node-skill-stroke: #8a3ffc;
  --node-tool-fill: #fa4d56;       --node-tool-stroke: #fa4d56;
  --node-scope-fill: #ff832b;      --node-scope-stroke: #ff832b;
}

/* ── Body cursor states (set by swimlane.js on body) ────── */
body.is-resizing { cursor: ew-resize !important; user-select: none; }
body.is-panning, body.is-panning * { cursor: grabbing !important; user-select: none; }

/* ── Animations ────────────────────────────────────────── */
@keyframes step-move-pulse { 0% { background: #24a148; } 100% { background: var(--cds-layer-01, #f4f4f4); } }

/* ── Actor Palette ──────────────────────────────────────── */
.swimlane-host .palette-header { padding: 12px 12px 8px; border-bottom: 1px solid var(--cds-border-subtle, #e0e0e0); display: flex; align-items: center; justify-content: space-between; }
.swimlane-host .palette-header h3 { margin: 0; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--cds-text-secondary, #525252); }
.swimlane-host #swimlane-presence { font-size: 0.7rem; color: #24a148; font-weight: 600; }
.swimlane-host #swimlane-actor-list { flex: 1; overflow-y: auto; padding: 8px; }
.swimlane-host .actor-card { padding: 9px 9px 9px 14px; margin-bottom: 6px; border-radius: 4px; background: var(--cds-layer-01, #f4f4f4); border: 1px solid var(--cds-border-subtle, #e0e0e0); cursor: pointer; position: relative; transition: box-shadow 0.15s; }
.swimlane-host .actor-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.swimlane-host .actor-card.is-me { outline: 2px solid var(--cds-interactive, #0f62fe); }
.swimlane-host .actor-color-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px; }
.swimlane-host .actor-card .actor-name { font-size: 0.8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swimlane-host .actor-card .actor-role { font-size: 0.7rem; color: var(--cds-text-secondary, #525252); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swimlane-host .actor-you { font-size: 0.65rem; color: var(--cds-interactive, #0f62fe); font-weight: 700; margin-top: 2px; }
.swimlane-host .actor-edit-btn { position: absolute; top: 5px; right: 5px; background: none; border: none; color: #c6c6c6; cursor: pointer; font-size: 13px; padding: 2px 3px; }
.swimlane-host .actor-edit-btn:hover { color: var(--cds-text-secondary, #525252); }
.swimlane-host .palette-add-btn { background: none; border: none; color: var(--cds-text-secondary, #525252); cursor: pointer; font-size: 1.1rem; padding: 0 2px; line-height: 1; font-weight: 400; }
.swimlane-host .palette-add-btn:hover { color: var(--cds-interactive, #0f62fe); }

/* ── Swimlane grid ──────────────────────────────────────── */
.swimlane-host #swimlane-grid { display: grid; min-width: max-content; border-bottom: 2px solid #000; align-items: stretch; }

.swimlane-host .grid-corner {
  background: var(--cds-layer-02, #e8e8e8);
  border-right: 2px solid var(--cds-border-strong-01, #161616);
  border-bottom: 1px solid var(--cds-border-subtle, #c6c6c6);
  position: sticky; top: 0; left: 0; z-index: 15;
  min-height: 110px; height: 110px;
  display: flex; align-items: center; justify-content: center;
  padding: 8px; text-align: center; box-sizing: border-box;
}
.swimlane-host .corner-deadline .label { display: block; font-size: 0.65rem; font-weight: 700; color: #da1e28; text-transform: uppercase; letter-spacing: 0.5px; }
.swimlane-host .corner-deadline .time  { display: block; font-size: 0.75rem; font-weight: 700; color: #da1e28; margin-top: 3px; line-height: 1.4; }

/* ── Board-closed state ─────────────────────────────────── */
.swimlane-host.board-closed .step-cell  { pointer-events: none; cursor: default; }
.swimlane-host.board-closed .sticky     { pointer-events: none; }
.swimlane-host.board-closed .palette-btn,
.swimlane-host.board-closed .lane-ctrl-btn,
.swimlane-host.board-closed .add-step-btn,
.swimlane-host.board-closed .lane-gap-label { display: none; }

/* ── Step (phase) headers ───────────────────────────────── */
.swimlane-host .step-header {
  background: var(--cds-layer-01, #f4f4f4);
  border-right: 1px solid var(--cds-border-subtle, #c6c6c6);
  border-bottom: 1px solid var(--cds-border-subtle, #c6c6c6);
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; z-index: 8;
  min-width: 0; min-height: 110px; height: 110px;
  overflow: visible; box-sizing: border-box;
}
.swimlane-host .step-header.moved { animation: step-move-pulse 0.75s ease-out forwards; }
.swimlane-host .step-header-actions { display: flex; gap: 2px; align-items: center; justify-content: flex-end; margin-bottom: 2px; }
.swimlane-host .step-header-top { display: flex; align-items: center; gap: 6px; overflow: visible; min-width: 0; }
.swimlane-host .step-number { font-size: 0.75rem; font-weight: 700; color: var(--cds-interactive, #0f62fe); white-space: nowrap; }
.swimlane-host .step-title-input { flex: 1; border: none; background: transparent; font-weight: 600; font-size: 0.875rem; font-family: inherit; color: var(--cds-text-primary, #161616); min-width: 0; overflow: visible; text-overflow: clip; white-space: nowrap; }
.swimlane-host .step-title-input:focus { outline: 1px solid var(--cds-interactive, #0f62fe); border-radius: 1px; }
.swimlane-host .step-move-btn { background: none; border: none; color: #da1e28; cursor: pointer; font-size: 10px; padding: 0 2px; line-height: 1; flex-shrink: 0; }
.swimlane-host .step-move-btn:hover:not(:disabled) { color: #9f1a20; }
.swimlane-host .step-move-btn:disabled { color: #c6c6c6; cursor: default; }
.swimlane-host .step-remove-btn { background: none; border: none; color: #da1e28; cursor: pointer; font-size: 16px; padding: 0 2px; line-height: 1; flex-shrink: 0; }
.swimlane-host .step-remove-btn:hover { color: #9f1a20; }
.swimlane-host .step-fields { display: flex; gap: 8px; margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--cds-border-subtle, #c6c6c6); height: 60px; }
.swimlane-host .step-field { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.swimlane-host .step-field-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--cds-text-helper, #6f6f6f); margin-bottom: 2px; flex-shrink: 0; }
.swimlane-host .step-field textarea { flex: 1; width: 100%; height: 0; border: none; background: transparent; font-family: inherit; font-size: 0.7rem; color: var(--cds-text-secondary, #525252); resize: none; padding: 2px; line-height: 1.35; overflow: hidden; }
.swimlane-host .step-field textarea:focus { outline: 1px solid var(--cds-interactive, #0f62fe); background: var(--cds-highlight, #d0e2ff); border-radius: 1px; }
[data-theme="dark"] .swimlane-host .step-field-label { color: var(--cds-text-secondary, #c6c6c6); }
[data-theme="dark"] .swimlane-host .step-field textarea { color: var(--cds-text-primary, #f4f4f4); }
[data-theme="dark"] .swimlane-host .step-field textarea:focus { background: rgba(255,255,255,0.08); outline-color: var(--cds-interactive, #4589ff); }

.swimlane-host .add-step-cell {
  background: var(--cds-layer-01, #f4f4f4);
  border-bottom: 1px solid var(--cds-border-subtle, #c6c6c6);
  border-right: 1px solid var(--cds-border-subtle, #c6c6c6);
  display: flex; align-items: center; justify-content: center;
  position: sticky; top: 0; z-index: 8;
  min-width: 80px; min-height: 110px; height: 110px;
  padding: 8px; box-sizing: border-box;
}
.swimlane-host .add-step-btn { background: none; border: 1px dashed var(--cds-border-subtle, #a8a8a8); color: var(--cds-text-secondary, #525252); cursor: pointer; font-size: 0.75rem; font-family: inherit; padding: 4px 10px; border-radius: 2px; white-space: nowrap; }
.swimlane-host .add-step-btn:hover { border-color: var(--cds-interactive, #0f62fe); color: var(--cds-interactive, #0f62fe); }

.swimlane-host .step-header-hidden {
  background: var(--cds-layer-01, #f4f4f4);
  border-right: 7px solid var(--cds-border-subtle, #c6c6c6); border-bottom: 1px solid var(--cds-border-subtle, #c6c6c6);
  position: sticky; top: 0; z-index: 8;
  width: 14px; min-width: 14px; cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.swimlane-host .step-header-hidden:hover { border-right-color: var(--cds-interactive, #0f62fe); }
.swimlane-host .step-cell-hidden {
  width: 14px; min-width: 14px;
  border-right: 7px solid var(--cds-border-subtle, #c6c6c6); border-bottom: 1px solid var(--cds-border-subtle, #c6c6c6);
  background: var(--cds-layer-01, #f4f4f4);
}
.swimlane-host #swimlane-phase-drag-bar { display: none; pointer-events: none; position: fixed; width: 3px; background: #505458; border-radius: 2px; z-index: 63; top: 0; }

/* ── Lane label column ──────────────────────────────────── */
.swimlane-host .lane-label-cell {
  background: var(--cds-layer-01, #f4f4f4);
  border-right: 2px solid var(--cds-border-strong-01, #161616);
  border-bottom: 1px solid var(--cds-border-subtle, #c6c6c6);
  padding: 8px 8px 8px 14px;
  position: sticky; left: 0; z-index: 6;
  min-height: 108px; min-width: 200px;
  display: flex; flex-direction: column;
}
.swimlane-host .lane-top-row { display: flex; align-items: flex-start; gap: 4px; }
.swimlane-host .lane-drag-handle { cursor: grab; color: var(--cds-icon-secondary, #c6c6c6); font-size: 14px; padding: 2px 4px 0 0; flex-shrink: 0; user-select: none; }
.swimlane-host .lane-drag-handle:hover { color: var(--cds-text-secondary, #525252); }
.swimlane-host .lane-name { font-size: 0.8125rem; font-weight: 600; word-break: break-word; flex: 1; }
.swimlane-host .lane-ctrl-btns { display: flex; gap: 2px; flex-shrink: 0; }
.swimlane-host .lane-ctrl-btn { background: none; border: none; color: var(--cds-icon-secondary, #c6c6c6); cursor: pointer; font-size: 13px; padding: 1px 4px; line-height: 1; border-radius: 2px; }
.swimlane-host .lane-ctrl-btn:hover { background: var(--cds-layer-hover-01, #e0e0e0); color: var(--cds-text-primary, #161616); }
.swimlane-host .lane-ctrl-btn.danger:hover { color: #da1e28; background: var(--cds-layer-01, #f4f4f4); }
.swimlane-host .lane-actors { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.swimlane-host .lane-tag { font-size: 0.65rem; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.swimlane-host .lane-tag-split { cursor: pointer; transition: filter 0.12s; }
.swimlane-host .lane-tag-split:hover { filter: brightness(0.75); box-shadow: 0 0 0 1px currentColor; }
.swimlane-host .lane-add-btn { margin-top: auto; background: none; border: none; color: var(--cds-text-helper, #6f6f6f); cursor: pointer; font-size: 0.7rem; font-family: inherit; text-align: left; padding: 4px 0 0 0; }
.swimlane-host .lane-add-btn:hover { color: var(--cds-interactive, #0f62fe); }

/* ── Gap zones ──────────────────────────────────────────── */
.swimlane-host .insert-lane-row { background: var(--cds-border-subtle, #c6c6c6); height: 9px; min-height: 9px; border-right: 1px solid var(--cds-border-subtle, #c6c6c6); }
.swimlane-host .insert-lane-row.lane-gap-col1 { background: transparent; position: relative; display: flex; align-items: center; justify-content: center; }
.swimlane-host .lane-gap-label { font-size: 0.65rem; color: var(--cds-text-helper, #6f6f6f); cursor: pointer; padding: 2px 6px; border-radius: 2px; transition: all 0.15s; user-select: none; }
.swimlane-host .lane-gap-label:hover { background: var(--cds-layer-01, #f4f4f4); color: var(--cds-interactive, #0f62fe); }

/* ── Step cells ─────────────────────────────────────────── */
.swimlane-host .step-cell {
  background: var(--cds-layer-01, #fff);
  border-right: 1px solid var(--cds-border-subtle, #c6c6c6);
  border-bottom: 1px solid var(--cds-border-subtle, #c6c6c6);
  min-height: 108px; height: 100%; min-width: 0;
  cursor: default; display: flex; flex-direction: row;
  align-items: flex-start; padding: 6px 11px; gap: 11px; overflow: hidden;
}
.swimlane-host .sub-slot { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.swimlane-host .sub-slot.empty { width: 116px; }

/* ── Stickies ───────────────────────────────────────────── */
.swimlane-host .sticky {
  width: 116px; min-height: 88px; border-radius: 2px;
  padding: 8px 10px 16px; flex-shrink: 0; cursor: pointer; position: relative;
  border: 1px solid transparent;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.18), 1px 1px 3px rgba(0,0,0,0.10);
  transition: box-shadow 0.15s, border-color 0.12s;
}
.swimlane-host .sticky:hover { box-shadow: 4px 8px 16px rgba(0,0,0,0.22); z-index: 2; }
.swimlane-host .sticky.is-selected { border-color: #525252; border-width: 2px; }
.swimlane-host .sticky.is-multi-selected { border-color: #da1e28; border-width: 2px; }
.swimlane-host .sticky::after { content: ''; position: absolute; bottom: 0; right: 0; border-style: solid; border-width: 0 0 12px 12px; border-color: transparent transparent rgba(0,0,0,0.12) transparent; }
.swimlane-host .sticky-title { font-size: 0.75rem; font-weight: 600; color: #161616; margin-bottom: 4px; line-height: 1.3; word-break: break-word; }
.swimlane-host .sticky-goal { font-size: 0.6875rem; color: #393939; line-height: 1.35; word-break: break-word; }

.swimlane-host .attitude-indicators { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 2; pointer-events: auto; }
.swimlane-host .attitude-circle { width: 10px; height: 10px; stroke-width: 1px; cursor: help; pointer-events: auto; }
.swimlane-host .attitude-circle.fear       { fill: var(--node-fear-fill);       stroke: var(--node-fear-stroke); }
.swimlane-host .attitude-circle.confidence { fill: var(--node-confidence-fill); stroke: var(--node-confidence-stroke); }
.swimlane-host .attitude-circle.pain       { fill: var(--node-pain-fill);       stroke: var(--node-pain-stroke); }
.swimlane-host .attitude-circle.content-source { fill: white; stroke: #000; }
.swimlane-host .attitude-circle.content-source.full,
.swimlane-host .attitude-circle.content-source.partial { fill: #f5deb3; }

.swimlane-host .hover-help { display: none; position: fixed; background: var(--cds-layer-02, #eeeecc); border: 2px solid #2c2c2c; border-radius: 4px; padding: 8px; color: #2c2c2c; z-index: 1000; max-width: 300px; font-size: 1rem; line-height: 1.4; pointer-events: none; box-shadow: 2px 2px 8px rgba(0,0,0,0.2); }
.swimlane-host .hover-help.visible { display: block; }
.swimlane-host .hover-help-actor { font-weight: 700; margin-bottom: 4px; }
.swimlane-host .hover-help-content { white-space: pre-wrap; word-break: break-word; }
.swimlane-host .hover-help-divider { width: 75%; height: 1px; background: #2c2c2c; margin: 6px auto; }

.swimlane-host .sticky-resize-handle-left,
.swimlane-host .sticky-resize-handle { position: absolute; top: 0; bottom: 14px; width: 8px; cursor: ew-resize; z-index: 3; }
.swimlane-host .sticky-resize-handle-left { left: 0;  border-left:  3px solid transparent; transition: border-color 0.1s; }
.swimlane-host .sticky-resize-handle      { right: 0; border-right: 3px solid transparent; transition: border-color 0.1s; }
.swimlane-host .sticky:hover .sticky-resize-handle-left { border-left-color:  rgba(0,0,0,0.18); }
.swimlane-host .sticky:hover .sticky-resize-handle      { border-right-color: rgba(0,0,0,0.18); }
.swimlane-host .sticky-resize-handle-left:hover { border-left-color:  var(--cds-interactive, #0f62fe) !important; }
.swimlane-host .sticky-resize-handle:hover      { border-right-color: var(--cds-interactive, #0f62fe) !important; }

.swimlane-host .drag-ghost { position: fixed; pointer-events: none; z-index: 900; border-radius: 2px; border: 2px dashed rgba(0,0,0,0.25); box-shadow: 4px 8px 20px rgba(0,0,0,0.28); opacity: 0.75; }
.swimlane-host #swimlane-drag-seq-bar { display: none; pointer-events: auto; position: fixed; width: 3px; background: #fff; mix-blend-mode: difference; z-index: 62; cursor: pointer; }
.swimlane-host #swimlane-drag-con-bar { display: none; pointer-events: auto; position: fixed; width: 3px; background: transparent; border-left: 3px dashed #fff; mix-blend-mode: difference; box-sizing: border-box; z-index: 62; cursor: pointer; }

/* ── Detail panel ───────────────────────────────────────── */
.swimlane-host #swimlane-detail-panel { position: fixed; right: -430px; top: 0; bottom: 0; width: 410px; background: var(--cds-layer-01, #f4f4f4); box-shadow: -2px 0 0 #000, -6px 0 24px rgba(0,0,0,0.12); transition: right 0.22s cubic-bezier(.4,0,.2,1); z-index: 200; display: flex; flex-direction: column; }
.swimlane-host #swimlane-detail-panel.open { right: 0; }
.swimlane-host .panel-header { background: var(--cds-interactive, #0f62fe); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.swimlane-host .panel-header-title { font-size: 0.875rem; font-weight: 600; }
.swimlane-host .panel-close { background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer; font-size: 20px; padding: 0 4px; line-height: 1; }
.swimlane-host .panel-close:hover { color: #fff; }
.swimlane-host .panel-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--cds-layer-01, #f4f4f4); }
.swimlane-host .form-group { margin-bottom: 14px; position: relative; overflow: visible; }
.swimlane-host .form-group label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--cds-text-secondary, #525252); margin-bottom: 4px; }
.swimlane-host .label-hint { font-weight: 400; color: var(--cds-text-helper, #6f6f6f); }
.swimlane-host .panel-input, .swimlane-host .panel-textarea { width: 100%; padding: 7px 10px; border: 1px solid var(--cds-border-subtle, #e0e0e0); border-radius: 2px; font-family: inherit; font-size: 0.8125rem; color: var(--cds-text-primary, #161616); background: var(--cds-field-01, #f4f4f4); }
.swimlane-host .panel-textarea { resize: vertical; min-height: 72px; }
.swimlane-host .panel-input:focus, .swimlane-host .panel-textarea:focus { outline: 2px solid var(--cds-interactive, #0f62fe); outline-offset: -1px; }
.swimlane-host .span-controls { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.swimlane-host .span-btn { width: 34px; height: 30px; border: 1px solid var(--cds-border-subtle, #e0e0e0); background: var(--cds-layer-02, #f4f4f4); border-radius: 2px; cursor: pointer; font-size: 0.8125rem; font-weight: 600; font-family: inherit; color: var(--cds-text-primary, #161616); }
.swimlane-host .span-btn:hover { background: var(--cds-layer-hover-02, #e0e0e0); }
.swimlane-host .span-btn.active { background: var(--cds-interactive, #0f62fe); color: #fff; border-color: var(--cds-interactive, #0f62fe); }
.swimlane-host .section-divider { border: none; border-top: 1px solid var(--cds-border-subtle, #e0e0e0); margin: 18px 0 14px; }
.swimlane-host .section-label { font-size: 0.75rem; font-weight: 600; color: var(--cds-text-secondary, #525252); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.swimlane-host .tab-bar { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 2px solid var(--cds-border-subtle, #e0e0e0); margin-bottom: 14px; }
.swimlane-host .tab-btn { padding: 7px 14px; border: none; background: transparent; cursor: pointer; font-size: 0.75rem; font-family: inherit; color: var(--cds-text-secondary, #525252); border-bottom: 2px solid transparent; margin-bottom: -2px; display: flex; align-items: center; gap: 5px; }
.swimlane-host .tab-btn.active { color: var(--cds-text-primary, #161616); font-weight: 600; }
.swimlane-host .tab-content { display: none; }
.swimlane-host .tab-content.active { display: block; }
.swimlane-host .checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.8125rem; margin-top: 12px; color: var(--cds-text-primary, #161616); }
.swimlane-host .checkbox-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--cds-interactive, #0f62fe); }
.swimlane-host #swimlane-detail-panel-content { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 0; }
.swimlane-host .panel-footer { padding: 14px 16px; border-top: 1px solid var(--cds-border-subtle, #e0e0e0); flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ── Detail panel dark mode ─────────────────────────────── */
[data-theme="dark"] .swimlane-host #swimlane-detail-panel,
[data-theme="dark"] .swimlane-host .panel-body { background: #262626; }
[data-theme="dark"] .swimlane-host .panel-input,
[data-theme="dark"] .swimlane-host .panel-textarea { background: #393939; color: #f4f4f4; border-color: #525252; }
[data-theme="dark"] .swimlane-host .form-group label { color: #c6c6c6; }
[data-theme="dark"] .swimlane-host .label-hint { color: #8d8d8d; }
[data-theme="dark"] .swimlane-host .span-btn { background: #393939; color: #f4f4f4; border-color: #525252; }
[data-theme="dark"] .swimlane-host .span-btn:hover { background: #525252; }
[data-theme="dark"] .swimlane-host .section-divider { border-color: #393939; }
[data-theme="dark"] .swimlane-host .tab-bar { border-color: #525252; }
[data-theme="dark"] .swimlane-host .tab-btn { color: #c6c6c6; }
[data-theme="dark"] .swimlane-host .tab-btn.active { color: #f4f4f4; }
[data-theme="dark"] .swimlane-host .checkbox-row { color: #f4f4f4; }
[data-theme="dark"] .swimlane-host .panel-footer { border-color: #393939; background: #262626; }
[data-theme="dark"] .swimlane-host .btn-secondary { border-color: #6f6f6f; color: #f4f4f4; }
[data-theme="dark"] .swimlane-host .btn-secondary:hover { background: #393939; }
[data-theme="dark"] .swimlane-host .combobox-listbox { background: #262626; border-color: #525252; }
[data-theme="dark"] .swimlane-host .combobox-category { border-color: #525252; }
[data-theme="dark"] .swimlane-host .combobox-category-header { background: #393939; color: #f4f4f4; }
[data-theme="dark"] .swimlane-host .combobox-category-header:hover { background: #525252; }
[data-theme="dark"] .swimlane-host .combobox-item { color: #f4f4f4; }
[data-theme="dark"] .swimlane-host .combobox-item:hover { background: #353535; border-left-color: #4589ff; }
[data-theme="dark"] .swimlane-host .combobox-item.selected { background: #353535; border-left-color: #4589ff; }
[data-theme="dark"] .swimlane-host .combobox-item.focused { background: #4589ff; }
[data-theme="dark"] .swimlane-host .combobox-lozenge { background: #525252; color: #f4f4f4; }
[data-theme="dark"] .swimlane-host .combobox-empty { color: #8d8d8d; }

/* ── Buttons ────────────────────────────────────────────── */
.swimlane-host .btn-primary { background: var(--cds-interactive, #0f62fe); border: none; color: #fff; padding: 8px 16px; border-radius: 2px; cursor: pointer; font-size: 0.8125rem; font-family: inherit; }
.swimlane-host .btn-primary:hover { background: #0353e9; }
.swimlane-host .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.swimlane-host .btn-secondary { background: none; border: 1px solid var(--cds-border-subtle, #8d8d8d); color: var(--cds-text-primary, #161616); padding: 8px 16px; border-radius: 2px; cursor: pointer; font-size: 0.8125rem; font-family: inherit; }
.swimlane-host .btn-secondary:hover { background: var(--cds-layer-hover-01, #f4f4f4); }
.swimlane-host .btn-danger { background: none; border: 1px solid #da1e28; color: #da1e28; padding: 8px 16px; border-radius: 2px; cursor: pointer; font-size: 0.8125rem; font-family: inherit; }
.swimlane-host .btn-danger:hover { background: #fff1f1; }
.swimlane-host .btn-sm { padding: 5px 12px; font-size: 0.75rem; }

/* ── Content source list (selected sources in actor tab) ── */
.swimlane-host .cs-list { margin: 6px 0 2px; }
.swimlane-host .cs-list-item { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.swimlane-host .cs-list-name { flex: 1; font-size: 0.75rem; color: var(--cds-text-primary, #161616); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: default; }
.swimlane-host .cs-list-remove { display: none; background: none; border: none; color: #da1e28; font-size: 1rem; line-height: 1; padding: 0 2px; cursor: pointer; flex-shrink: 0; }
.swimlane-host .selected-summary.cs-delete-mode .cs-list-remove { display: block; }
.swimlane-host .cs-trash-btn { background: none; border: none; color: var(--cds-text-helper, #6f6f6f); cursor: pointer; padding: 2px 0; display: flex; align-items: center; margin-top: 2px; transition: color 0.1s; }
.swimlane-host .cs-trash-btn:hover { color: var(--cds-text-primary, #161616); }
.swimlane-host .selected-summary.cs-delete-mode .cs-trash-btn { color: #da1e28; }
[data-theme="dark"] .swimlane-host .cs-list-name { color: #f4f4f4; }
[data-theme="dark"] .swimlane-host .cs-trash-btn { color: #8d8d8d; }
[data-theme="dark"] .swimlane-host .cs-trash-btn:hover { color: #f4f4f4; }

/* ── ContentSourceForm ──────────────────────────────────── */
.swimlane-host .cs-new-btn { background: none; border: none; padding: 4px 0; margin-top: 6px; color: var(--cds-interactive, #0f62fe); font-size: 0.75rem; font-family: inherit; cursor: pointer; display: block; }
.swimlane-host .cs-new-btn:hover { text-decoration: underline; }
.swimlane-host .cs-new-form { margin-top: 10px; padding: 12px; background: var(--cds-layer-02, #f4f4f4); border: 1px solid var(--cds-border-subtle, #e0e0e0); border-radius: 2px; }
.swimlane-host .cs-new-form .form-group { margin-bottom: 10px; }
.swimlane-host .cs-new-form .form-group:last-of-type { margin-bottom: 0; }
.swimlane-host .panel-select { width: 100%; padding: 7px 8px; border: 1px solid var(--cds-border-strong, #8d8d8d); background: var(--cds-field-01, #fff); color: var(--cds-text-primary, #161616); font-size: 0.8125rem; font-family: inherit; border-radius: 2px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23161616' d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.swimlane-host .panel-select:focus { outline: 2px solid var(--cds-focus, #0f62fe); outline-offset: -2px; }
.swimlane-host .required-mark { color: #da1e28; }
.swimlane-host .input-error { border-color: #da1e28 !important; outline: none; }
.swimlane-host .cs-new-error { font-size: 0.75rem; color: #da1e28; margin: 6px 0 0; }
.swimlane-host .cs-new-actions { display: flex; gap: 8px; margin-top: 12px; }

[data-theme="dark"] .swimlane-host .cs-new-form { background: #393939; border-color: #525252; }
[data-theme="dark"] .swimlane-host .panel-select { background-color: #393939; color: #f4f4f4; border-color: #6f6f6f; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23f4f4f4' d='M8 11L3 6h10z'/%3E%3C/svg%3E"); }

/* ── Modals ─────────────────────────────────────────────── */
.swimlane-host .overlay-bg { position: fixed; inset: 0; background: rgba(22,22,22,0.7); z-index: 300; display: none; align-items: center; justify-content: center; }
.swimlane-host .overlay-bg.open { display: flex; }
.swimlane-host .modal { background: var(--cds-layer-01, #f4f4f4); color: var(--cds-text-primary, #161616); padding: 24px; width: 500px; max-width: 94vw; border-top: 4px solid var(--cds-interactive, #0f62fe); box-shadow: 0 8px 32px rgba(0,0,0,0.24); overflow: visible; }
.swimlane-host .modal h3 { margin: 0 0 18px; font-size: 1rem; color: var(--cds-text-primary, #161616); }
.swimlane-host .modal-input { width: 100%; padding: 8px 10px; border: 1px solid var(--cds-border-subtle, #e0e0e0); background: var(--cds-field-01, #f4f4f4); color: var(--cds-text-primary, #161616); font-family: inherit; font-size: 0.8125rem; }
.swimlane-host .modal-input:focus { outline: 2px solid var(--cds-interactive, #0f62fe); outline-offset: -1px; }
.swimlane-host .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.swimlane-host .color-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.swimlane-host .color-swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: transform 0.1s; }
.swimlane-host .color-swatch.selected { border-color: #161616; }
.swimlane-host .color-swatch:hover { transform: scale(1.15); }
.swimlane-host .actor-color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }

/* ── Combobox ───────────────────────────────────────────── */
.swimlane-host .combobox-container { position: relative; width: 100%; overflow: visible; z-index: 1; }
.swimlane-host .combobox-input { width: 100%; padding-right: 16px; }
.swimlane-host .combobox-listbox { position: absolute; top: 100%; left: 0; right: 0; width: auto; min-width: 100%; max-width: none; max-height: 400px; overflow-y: auto; overflow-x: visible; background: var(--cds-ui-01, #f4f4f4); border: 1px solid var(--cds-border-subtle, #e0e0e0); border-top: none; z-index: 1300; box-shadow: 0 4px 8px rgba(0,0,0,0.1); margin-top: -1px; }
.swimlane-host .combobox-category { border-bottom: 1px solid var(--cds-border-subtle, #e0e0e0); }
.swimlane-host .combobox-category:last-child { border-bottom: none; }
.swimlane-host .combobox-category-header { display: flex; align-items: center; padding: 12px 16px; background: var(--cds-layer-02, #f4f4f4); cursor: pointer; font-weight: 600; user-select: none; font-size: 13px; }
.swimlane-host .combobox-category-header:hover { background: var(--cds-layer-hover-02, #e0e0e0); }
.swimlane-host .combobox-category-toggle { margin-right: 12px; font-size: 10px; transition: transform 0.2s; display: inline-block; width: 12px; }
.swimlane-host .combobox-category.collapsed .combobox-category-toggle { transform: rotate(-90deg); }
.swimlane-host .combobox-items { display: block; }
.swimlane-host .combobox-category.collapsed .combobox-items { display: none; }
.swimlane-host .combobox-item { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 32px !important; cursor: pointer; user-select: none; font-size: 13px; border-left: 3px solid transparent; }
.swimlane-host .combobox-item:hover { background: var(--cds-layer-hover-01, #e8f1ff); border-left-color: var(--cds-interactive, #0f62fe); }
.swimlane-host .combobox-item.selected { background: var(--cds-selected-ui, #e8f1ff); border-left-color: var(--cds-interactive, #0f62fe); font-weight: 600; }
.swimlane-host .combobox-item.focused { background: var(--cds-interactive, #0f62fe); color: #ffffff; border-left-color: transparent; outline: none; }
.swimlane-host .combobox-item-checkbox { pointer-events: none; margin: 0; flex-shrink: 0; }
.swimlane-host .combobox-item-label { flex: 1; min-width: 0; }
.swimlane-host .combobox-empty { padding: 20px; text-align: center; color: var(--cds-text-secondary, #525252); font-size: 13px; font-style: italic; }
.swimlane-host .selected-summary { margin-top: 6px; min-height: 28px; }
.swimlane-host .combobox-lozenge-list { display: flex; flex-wrap: wrap; gap: 8px; }
.swimlane-host .combobox-lozenge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 999px; background: var(--cds-tag-background-gray, #e0e0e0); color: var(--cds-text-primary, #161616); font-size: 0.8125rem; line-height: 1.2; }
.swimlane-host .combobox-lozenge-label { min-width: 0; word-break: break-word; }
.swimlane-host .combobox-lozenge-remove { border: none; background: transparent; color: inherit; cursor: pointer; padding: 0; font-size: 0.95rem; line-height: 1; }
.swimlane-host .combobox-lozenge-remove:hover { color: var(--cds-interactive, #0f62fe); }

/* ── Identity picker ────────────────────────────────────── */
.swimlane-host #identity-overlay { position: fixed; inset: 0; background: rgba(22,22,22,0.85); z-index: 400; display: none; align-items: center; justify-content: center; }
.swimlane-host #identity-overlay.open { display: flex; }
.swimlane-host .identity-modal { background: var(--cds-layer-01, #f4f4f4); color: var(--cds-text-primary, #161616); padding: 32px; width: 480px; max-width: 94vw; border-top: 4px solid var(--cds-interactive, #0f62fe); box-shadow: 0 8px 40px rgba(0,0,0,0.3); }
.swimlane-host .identity-modal h2 { margin: 0 0 6px; font-size: 1.25rem; color: var(--cds-text-primary, #161616); }
.swimlane-host .identity-modal p { margin: 0 0 20px; color: var(--cds-text-secondary, #525252); font-size: 0.875rem; }
.swimlane-host .identity-actors { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.swimlane-host .identity-card { padding: 14px 14px 14px 18px; background: var(--cds-layer-02, #e8e8e8); border: 1px solid var(--cds-border-subtle, #e0e0e0); cursor: pointer; transition: background 0.12s; }
.swimlane-host .identity-card:hover { background: var(--cds-layer-hover-02, #e5e5e5); }
.swimlane-host .identity-name { font-size: 0.9375rem; font-weight: 600; }
.swimlane-host .identity-role { font-size: 0.8125rem; color: var(--cds-text-secondary, #525252); margin-top: 2px; }
.swimlane-host .identity-footer { margin-top: 16px; display: flex; justify-content: flex-end; }
