/* ==========================================================================
   Control Loop Board — faux-Notion board in Field Notebook skin
   Loaded after workbench.css (which loads colors.css + styles.css).
   ========================================================================== */

/* --- Faux-Notion page chrome (decorative, inside the stage) ------------- */

.clb-page {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 600px;
  background: var(--ll-paper);
  border-radius: 2px 14px 4px 12px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Left rail — decorative Notion-style sidebar. NON-FUNCTIONAL. */
.clb-rail {
  padding: 1rem 0.75rem;
  border-right: 1.5px solid rgba(23, 71, 209, 0.16);
  background: rgba(255, 253, 246, 0.5);
  font-size: 0.8rem;
}

.clb-rail__header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ll-cobalt);
  letter-spacing: -0.02em;
}

.clb-rail__icon {
  font-size: 1rem;
  line-height: 1;
}

.clb-rail__section {
  margin-bottom: 0.75rem;
}

.clb-rail__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ll-pencil);
  margin-bottom: 0.35rem;
  padding-left: 0.25rem;
}

.clb-rail__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px 8px 5px 7px;
  color: var(--ll-graphite);
  font-size: 0.8rem;
  line-height: 1.3;
}

.clb-rail__item--active {
  background: rgba(23, 71, 209, 0.08);
  color: var(--ll-cobalt);
  font-weight: 600;
}

.clb-rail__item--static {
  opacity: 0.45;
  cursor: default;
}

.clb-rail__demo-badge {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ll-pencil);
  background: rgba(23, 71, 209, 0.06);
  border: 1px solid rgba(23, 71, 209, 0.1);
  border-radius: 3px;
}

.clb-rail__item-icon {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Main content area */
.clb-content {
  padding: 1rem 1.25rem 1.5rem;
  min-width: 0;
}

/* Page header — icon + title + view tabs */
.clb-header {
  margin-bottom: 1.25rem;
}

.clb-header__icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.clb-header__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--ll-cobalt);
  text-wrap: balance;
}

.clb-header__desc {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--ll-ink-muted);
  max-width: 42rem;
  text-wrap: pretty;
}

.clb-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1.5px solid rgba(23, 71, 209, 0.16);
  padding-bottom: 0;
}

.clb-tab {
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ll-ink-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.clb-tab:hover,
.clb-tab:focus-visible {
  color: var(--ll-cobalt);
}

.clb-tab--active {
  color: var(--ll-cobalt);
  border-bottom-color: var(--ll-cobalt);
}

/* --- Board (Kanban) ------------------------------------------------------ */

.clb-board-wrap {
  position: relative;
}

.clb-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
}

/* Fade edges to signal horizontal scroll */
.clb-board-wrap::before,
.clb-board-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.clb-board-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--ll-paper), transparent);
}

.clb-board-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--ll-paper), transparent);
}

.clb-board-wrap--scroll-right::after {
  opacity: 1;
}

.clb-board-wrap--scroll-left::before {
  opacity: 1;
}

/* Scroll arrows — appear on hover or when scrollable in that direction */
.clb-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ll-cobalt);
  background: var(--ll-paper);
  border: 1.5px solid var(--ll-cobalt);
  border-radius: 50%;
  cursor: pointer;
  z-index: 7;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.15s ease, transform 0.1s ease;
}

.clb-scroll-arrow::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
}

.clb-scroll-arrow--left {
  left: 0.25rem;
}

.clb-scroll-arrow--right {
  right: 0.25rem;
}

.clb-scroll-arrow--visible {
  opacity: 1;
  pointer-events: auto;
}

.clb-scroll-arrow:hover,
.clb-scroll-arrow:focus-visible {
  background: var(--ll-yellow);
  outline: 2px solid var(--ll-yellow);
  outline-offset: 2px;
}

.clb-scroll-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

/* Scroll indicator: progress bar + column pips */
.clb-scroll-indicator {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0 0.25rem;
}

.clb-scroll-indicator__track {
  height: 3px;
  background: rgba(23, 71, 209, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.clb-scroll-indicator__fill {
  height: 100%;
  background: var(--ll-cobalt);
  border-radius: 999px;
  transition: width 0.1s ease-out;
  width: 0%;
}

.clb-scroll-indicator__pips {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.clb-scroll-indicator__pip {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ll-pencil);
  padding: 0.1rem 0.35rem;
  border-radius: 3px 7px 4px 6px;
  background: rgba(23, 71, 209, 0.03);
  border: 1px solid rgba(23, 71, 209, 0.06);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.clb-scroll-indicator__pip--active {
  color: var(--ll-cobalt);
  background: rgba(23, 71, 209, 0.1);
  border-color: rgba(23, 71, 209, 0.25);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.clb-column {
  flex: 0 0 min(260px, 85vw);
  display: flex;
  flex-direction: column;
  min-height: 120px;
  scroll-snap-align: start;
}

.clb-column__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.5rem;
  border-radius: 6px 12px 5px 10px;
  background: rgba(23, 71, 209, 0.06);
  border: 1.5px solid rgba(23, 71, 209, 0.12);
}

.clb-column__name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ll-cobalt);
  white-space: nowrap;
}

.clb-column__count {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ll-graphite);
  background: var(--ll-white);
  border: 1px solid rgba(23, 71, 209, 0.15);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.clb-column__count--capped {
  color: var(--ll-cobalt);
  border-color: var(--ll-cobalt);
}

/* When a column is at/over its WIP cap, show coral friction */
.clb-column--breached .clb-column__count {
  color: var(--ll-coral);
  border-color: var(--ll-coral);
  background: rgba(255, 107, 74, 0.08);
}

.clb-column--breached .clb-column__header {
  border-color: var(--ll-coral);
  background: rgba(255, 107, 74, 0.05);
}

.clb-column__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem;
  min-height: 80px;
  border-radius: 4px 10px 5px 9px;
  transition: background-color 0.15s ease, outline 0.15s ease;
}

/* Drag-over highlight */
.clb-column__body--drag-over {
  background: rgba(255, 212, 0, 0.1);
  outline: 2px dashed var(--ll-cobalt);
  outline-offset: -2px;
}

/* Drop blocked (WIP cap would be breached) */
.clb-column__body--drag-blocked {
  background: rgba(255, 107, 74, 0.08);
  outline: 2px dashed var(--ll-coral);
  outline-offset: -2px;
}

/* --- Cards (Notion-style database cards in brand skin) ------------------ */

.clb-card {
  position: relative;
  padding: 0.65rem 0.75rem;
  background: var(--ll-white);
  border: 1.5px solid var(--ll-cobalt);
  border-radius: 4px 12px 5px 10px;
  box-shadow: 2px 2px 0 rgba(23, 71, 209, 0.08);
  cursor: grab;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.clb-card:nth-child(odd) {
  transform: rotate(-0.3deg);
}

.clb-card:nth-child(even) {
  transform: rotate(0.15deg);
}

.clb-card:hover {
  box-shadow: 3px 3px 0 rgba(23, 71, 209, 0.12);
}

.clb-card--dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg) scale(1.02);
  box-shadow: 5px 5px 0 rgba(23, 71, 209, 0.2);
}

.clb-card--moved {
  animation: clb-card-pulse 0.4s ease;
}

@keyframes clb-card-pulse {
  0% { box-shadow: 2px 2px 0 rgba(23, 71, 209, 0.08); }
  50% { box-shadow: 3px 3px 0 rgba(45, 186, 124, 0.3); }
  100% { box-shadow: 2px 2px 0 rgba(23, 71, 209, 0.08); }
}

@media (prefers-reduced-motion: reduce) {
  .clb-card--moved {
    animation: none;
  }
  .clb-card {
    transition: none;
  }
}

.clb-card__title {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ll-graphite);
}

.clb-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.clb-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--ll-cobalt);
  color: var(--ll-cobalt);
  background: transparent;
  white-space: nowrap;
}

/* Depth pills: deep vs shallow */
.clb-pill--deep {
  background: var(--ll-yellow);
  border-color: var(--ll-cobalt);
  color: var(--ll-cobalt);
}

.clb-pill--shallow {
  background: transparent;
  border-color: rgba(23, 71, 209, 0.3);
  color: var(--ll-ink-muted);
}

/* Outcome/area pills */
.clb-pill--area {
  background: rgba(23, 71, 209, 0.06);
  border-color: rgba(23, 71, 209, 0.2);
  color: var(--ll-cobalt);
}

/* Drag handle (visible on hover, like Notion) */
.clb-card__handle {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  font-size: 0.7rem;
  color: var(--ll-pencil);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.clb-card:hover .clb-card__handle,
.clb-card:focus-visible .clb-card__handle {
  opacity: 0.6;
}

/* Card keyboard controls */
.clb-card__controls {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.4rem;
  font-size: 0.65rem;
}

.clb-card__btn {
  padding: 0.15rem 0.4rem;
  min-height: 28px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--ll-cobalt);
  background: transparent;
  border: 1px solid rgba(23, 71, 209, 0.2);
  border-radius: 4px 8px 5px 7px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.clb-card__btn:hover,
.clb-card__btn:focus-visible {
  background: rgba(23, 71, 209, 0.08);
  color: var(--ll-cobalt);
}

.clb-card__btn:active {
  transform: scale(0.96);
}

.clb-card__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Empty column placeholder */
.clb-column__empty {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ll-pencil);
  border: 1.5px dashed rgba(23, 71, 209, 0.12);
  border-radius: 4px 10px 5px 9px;
}

/* --- Friction / trade-off prompt ---------------------------------------- */

.clb-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 100;
  max-width: min(90vw, 32rem);
  padding: 0.85rem 1.25rem;
  background: var(--ll-white);
  border: 2px solid var(--ll-coral);
  border-radius: 6px 14px 5px 12px;
  box-shadow: 4px 4px 0 rgba(255, 107, 74, 0.2);
  font-size: 0.85rem;
  color: var(--ll-graphite);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.clb-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.clb-toast--success {
  border-color: var(--ll-green);
  box-shadow: 4px 4px 0 rgba(45, 186, 124, 0.2);
}

.clb-toast__title {
  font-weight: 700;
  color: var(--ll-coral);
  margin-bottom: 0.2rem;
}

.clb-toast--success .clb-toast__title {
  color: var(--ll-green);
}

.clb-toast__body {
  flex: 1;
}

.clb-toast__undo {
  flex-shrink: 0;
  margin-left: 0.75rem;
  padding: 0.2rem 0.6rem;
  min-height: 28px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ll-cobalt);
  background: var(--ll-yellow);
  border: 1px solid var(--ll-cobalt);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.clb-toast__undo:hover,
.clb-toast__undo:focus-visible {
  background: var(--ll-yellow-soft);
}

.clb-toast__undo:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .clb-toast {
    transition: opacity 0.01s;
    transform: translateX(-50%);
  }
  .clb-toast--visible {
    transform: translateX(-50%);
  }
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 768px) {
  .clb-page {
    grid-template-columns: 1fr;
  }

  .clb-rail {
    display: none;
  }

  .clb-content {
    padding: 0.75rem;
  }
}

/* --- Notes page (shared by Capture Buffer + This Week surfaces) --------- */

.clb-notes {
  max-width: 42rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ll-graphite);
}

.clb-notes__header {
  margin-bottom: 1.25rem;
}

.clb-notes__title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ll-cobalt);
  text-wrap: balance;
}

.clb-notes__meta {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--ll-pencil);
  letter-spacing: 0.02em;
}

.clb-notes__intro {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ll-ink-muted);
  border-left: 2px solid rgba(23, 71, 209, 0.15);
  padding-left: 0.75rem;
  text-wrap: pretty;
}

.clb-notes__intro strong {
  font-style: normal;
  color: var(--ll-cobalt);
}

/* Dated section */
.clb-notes__date {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ll-pencil);
  margin: 1.25rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(23, 71, 209, 0.08);
}

/* Bullet entry */
.clb-notes__entry {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.clb-notes__bullet {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.55rem;
  border-radius: 50%;
  background: var(--ll-cobalt);
  opacity: 0.4;
}

.clb-notes__entry-text {
  flex: 1;
  min-width: 0;
  color: var(--ll-graphite);
}

.clb-notes__entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.clb-notes__action {
  padding: 0.2rem 0.5rem;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ll-cobalt);
  background: transparent;
  border: 1px solid rgba(23, 71, 209, 0.2);
  border-radius: 4px 8px 5px 7px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.clb-notes__action:hover,
.clb-notes__action:focus-visible {
  background: rgba(23, 71, 209, 0.08);
}

.clb-notes__action--promote {
  border-color: var(--ll-cobalt);
  background: rgba(255, 212, 0, 0.1);
}

.clb-notes__action--promote:hover,
.clb-notes__action--promote:focus-visible {
  background: var(--ll-yellow);
}

.clb-notes__action--drop {
  color: var(--ll-coral);
  border-color: rgba(255, 107, 74, 0.3);
}

.clb-notes__action--drop:hover,
.clb-notes__action--drop:focus-visible {
  background: rgba(255, 107, 74, 0.08);
}

.clb-notes__action:active {
  transform: scale(0.96);
}

/* Capture input — minimal, inline with notes */
.clb-notes__capture-input {
  display: flex;
  gap: 0.4rem;
  margin: 0.75rem 0 0.5rem;
}

.clb-notes__capture-input input {
  flex: 1;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ll-graphite);
  background: var(--ll-white);
  border: 1px dashed rgba(23, 71, 209, 0.25);
  border-radius: 4px 10px 5px 9px;
}

.clb-notes__capture-input input:focus-visible {
  outline: 2px solid var(--ll-yellow);
  outline-offset: 1px;
  border-style: solid;
}

.clb-notes__capture-input input::placeholder {
  color: var(--ll-pencil);
}

.clb-notes__capture-btn {
  padding: 0.35rem 0.75rem;
  min-height: 32px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ll-cobalt);
  background: var(--ll-yellow);
  border: 1px solid var(--ll-cobalt);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}

.clb-notes__capture-btn:hover,
.clb-notes__capture-btn:focus-visible {
  background: var(--ll-yellow-soft);
}

.clb-notes__capture-btn:active {
  transform: scale(0.96);
}

/* Collapsible processed section */
.clb-notes__collapse {
  margin-top: 1.5rem;
}

.clb-notes__collapse-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ll-ink-muted);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(23, 71, 209, 0.08);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: color 0.15s ease;
}

.clb-notes__collapse-toggle:hover {
  color: var(--ll-cobalt);
}

.clb-notes__collapse-arrow {
  display: inline-block;
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.clb-notes__collapse--open .clb-notes__collapse-arrow {
  transform: rotate(90deg);
}

.clb-notes__collapse-body {
  display: none;
  padding-top: 0.5rem;
}

.clb-notes__collapse--open .clb-notes__collapse-body {
  display: block;
}

/* Processed entry */
.clb-notes__processed {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  color: var(--ll-ink-muted);
}

.clb-notes__processed-text {
  flex: 1;
  min-width: 0;
  text-decoration: line-through;
  text-decoration-color: rgba(23, 71, 209, 0.2);
  text-decoration-thickness: 1px;
}

.clb-notes__processed-tag {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 3px 7px 4px 6px;
  white-space: nowrap;
}

.clb-notes__processed-tag--promoted {
  color: var(--ll-cobalt);
  background: rgba(23, 71, 209, 0.08);
}

.clb-notes__processed-tag--note {
  color: var(--ll-graphite);
  background: rgba(23, 71, 209, 0.04);
}

.clb-notes__processed-tag--dropped {
  color: var(--ll-coral);
  background: rgba(255, 107, 74, 0.08);
}

.clb-notes__processed-date {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--ll-pencil);
  white-space: nowrap;
}

.clb-notes__empty {
  padding: 1rem 0;
  font-size: 0.82rem;
  color: var(--ll-pencil);
  font-style: italic;
}

/* Inline link for pull-into-today etc. */
.clb-notes__link {
  display: inline;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ll-cobalt);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(23, 71, 209, 0.3);
  text-underline-offset: 2px;
}

.clb-notes__link:hover {
  text-decoration-color: var(--ll-cobalt);
}

.clb-notes__link:not(:disabled):active {
  transform: scale(0.96);
}

.clb-notes__link:disabled {
  color: var(--ll-pencil);
  text-decoration: line-through;
  cursor: not-allowed;
  text-decoration-color: rgba(0, 0, 0, 0.1);
}

/* Inline pill in notes */
.clb-notes__pill {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.05rem 0.3rem;
  border-radius: 3px 7px 4px 6px;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.clb-notes__pill--deep {
  color: var(--ll-cobalt);
  background: rgba(23, 71, 209, 0.1);
}

.clb-notes__pill--shallow {
  color: var(--ll-graphite);
  background: rgba(23, 71, 209, 0.05);
}

/* --- Tour bar (guided experience stepper) -------------------------------- */

.clb-tourbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.85rem;
  margin-bottom: 1rem;
  background: rgba(23, 71, 209, 0.04);
  border: 1.5px solid rgba(23, 71, 209, 0.12);
  border-radius: 6px 14px 5px 12px;
}

.clb-tourbar__steps {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.clb-tourbar__step {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  min-height: 32px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ll-ink-muted);
  background: transparent;
  border: 1px solid rgba(23, 71, 209, 0.12);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.clb-tourbar__step--active {
  color: var(--ll-cobalt);
  background: var(--ll-yellow);
  border-color: var(--ll-cobalt);
}

.clb-tourbar__step--done {
  color: var(--ll-green);
  border-color: rgba(46, 125, 50, 0.3);
}

.clb-tourbar__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 0.6rem;
  border-radius: 50%;
  border: 1px solid currentColor;
}

.clb-tourbar__step--done .clb-tourbar__step-num {
  background: rgba(46, 125, 50, 0.1);
}

.clb-tourbar__step--active .clb-tourbar__step-num {
  background: var(--ll-cobalt);
  color: var(--ll-white);
  border-color: var(--ll-cobalt);
}

.clb-tourbar__divider {
  width: 1rem;
  height: 1px;
  background: rgba(23, 71, 209, 0.15);
  flex-shrink: 0;
}

.clb-tourbar__actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.clb-tourbar__btn {
  padding: 0.25rem 0.65rem;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ll-cobalt);
  background: transparent;
  border: 1px solid rgba(23, 71, 209, 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.clb-tourbar__btn:hover,
.clb-tourbar__btn:focus-visible {
  background: rgba(23, 71, 209, 0.08);
}

.clb-tourbar__btn--primary {
  color: var(--ll-cobalt);
  background: var(--ll-yellow);
  border-color: var(--ll-cobalt);
}

.clb-tourbar__btn--primary:hover,
.clb-tourbar__btn--primary:focus-visible {
  background: var(--ll-yellow-soft);
}

.clb-tourbar__btn:active {
  transform: scale(0.96);
}

/* --- Tab badges + pulse ------------------------------------------------- */

.clb-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 0.3rem;
  margin-left: 0.3rem;
  font-size: 0.58rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ll-cobalt);
  background: rgba(23, 71, 209, 0.1);
  border-radius: 999px;
  line-height: 1;
}

.clb-tab--active .clb-tab__badge {
  background: var(--ll-yellow);
}

@keyframes clb-tab-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 212, 0, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(255, 212, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 212, 0, 0); }
}

.clb-tab--pulse {
  animation: clb-tab-pulse 1.5s ease-out 2;
}

@media (prefers-reduced-motion: reduce) {
  .clb-tab--pulse { animation: none; }
}

/* --- Surface wrapper ---------------------------------------------------- */

.clb-surface {
  animation: clb-surface-in 0.3s ease;
}

@keyframes clb-surface-in {
  from { opacity: 0; transform: translateY(0.4rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .clb-surface { animation: none; }
}

/* Highlight pulse for elements the agent draws attention to */
@keyframes clb-highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 212, 0, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 212, 0, 0.4); }
}

.clb-highlight {
  animation: clb-highlight-pulse 1.2s ease-in-out 2;
}

@media (prefers-reduced-motion: reduce) {
  .clb-highlight { animation: none; }
}

/* --- This Week surface (uses shared .clb-notes styles) ------------------- */
/* No additional styles needed — This Week reuses .clb-notes classes. */

/* --- Floating agent chat panel ------------------------------------------ */

.clb-chat {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 150;
  width: min(90vw, 380px);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--ll-white);
  border: 2px solid var(--ll-cobalt);
  border-radius: 8px 20px 6px 18px;
  box-shadow: 5px 5px 0 rgba(23, 71, 209, 0.15);
  transform: rotate(-0.3deg);
  overflow: hidden;
}

/* Chat header — clickable to collapse/expand */
.clb-chat__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(23, 71, 209, 0.06);
  border-bottom: 1.5px solid rgba(23, 71, 209, 0.12);
  cursor: pointer;
  user-select: none;
}

.clb-chat__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  background: var(--ll-yellow);
  border: 1.5px solid var(--ll-cobalt);
  border-radius: 6px 12px 5px 10px;
  flex-shrink: 0;
}

.clb-chat__title {
  flex: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ll-cobalt);
}

.clb-chat__status {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ll-green);
}

.clb-chat__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
  color: var(--ll-cobalt);
  background: transparent;
  border: 1px solid rgba(23, 71, 209, 0.2);
  border-radius: 4px 8px 5px 7px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
  position: relative;
}

.clb-chat__toggle::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
}

.clb-chat__toggle:hover {
  background: rgba(23, 71, 209, 0.08);
}

.clb-chat__toggle:active {
  transform: scale(0.96);
}

/* Chat body — scrollable message area */
.clb-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 200px;
}

/* Collapsed state */
.clb-chat--collapsed {
  width: auto;
  max-height: none;
  transform: rotate(0deg);
  border-radius: 999px;
}

.clb-chat--collapsed .clb-chat__body,
.clb-chat--collapsed .clb-chat__replies {
  display: none;
}

.clb-chat--collapsed .clb-chat__dock {
  display: flex;
  border-top: none;
  padding: 0 0.5rem 0.4rem;
  gap: 0.25rem;
}

.clb-chat--collapsed .clb-chat__dock-chip {
  padding: 0.2rem 0.5rem;
  min-height: 28px;
  font-size: 0.6rem;
  animation: none;
}

.clb-chat--collapsed .clb-chat__dock-chip-label {
  display: none;
}

.clb-chat--collapsed .clb-chat__dock-chip-icon {
  font-size: 0.85rem;
}

.clb-chat--collapsed .clb-chat__dock-chip--reset {
  margin-left: auto;
}

.clb-chat--collapsed .clb-chat__header {
  border-bottom: none;
}

.clb-chat--collapsed .clb-chat__status {
  display: none;
}

/* Chat messages */
.clb-chat__msg {
  max-width: 88%;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  border-radius: 4px 14px 5px 12px;
  animation: clb-msg-in 0.3s ease;
}

@keyframes clb-msg-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .clb-chat__msg { animation: none; }
}

/* Agent messages — left aligned, tinted */
.clb-chat__msg--agent {
  align-self: flex-start;
  background: rgba(23, 71, 209, 0.06);
  border-left: 3px solid var(--ll-cobalt);
  border-radius: 0 12px 5px 0;
  color: var(--ll-graphite);
}

.clb-chat__msg--agent strong {
  color: var(--ll-cobalt);
}

/* User messages — right aligned, yellow tint */
.clb-chat__msg--user {
  align-self: flex-end;
  background: rgba(255, 212, 0, 0.12);
  border: 1.5px solid rgba(23, 71, 209, 0.15);
  color: var(--ll-graphite);
}

/* System/info messages — centered, muted */
.clb-chat__msg--system {
  align-self: center;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--ll-ink-muted);
  background: transparent;
  border: none;
  padding: 0.25rem 0;
  max-width: 100%;
}

/* Quick-reply chips */
.clb-chat__replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.75rem 0.6rem;
}

.clb-chat__reply {
  padding: 0.35rem 0.75rem;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ll-cobalt);
  background: var(--ll-yellow);
  border: 1.5px solid var(--ll-cobalt);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.clb-chat__reply:hover,
.clb-chat__reply:focus-visible {
  background: var(--ll-yellow-soft);
}

.clb-chat__reply--secondary {
  background: transparent;
  border-color: rgba(23, 71, 209, 0.3);
}

.clb-chat__reply--secondary:hover,
.clb-chat__reply--secondary:focus-visible {
  background: rgba(23, 71, 209, 0.05);
}

.clb-chat__reply:active {
  transform: scale(0.96);
}

/* Inline action buttons within messages */
.clb-chat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.clb-chat__action {
  padding: 0.2rem 0.55rem;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ll-cobalt);
  background: transparent;
  border: 1px solid rgba(23, 71, 209, 0.2);
  border-radius: 4px 8px 5px 7px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.clb-chat__action:hover,
.clb-chat__action:focus-visible {
  background: rgba(23, 71, 209, 0.08);
}

.clb-chat__action--selected {
  background: var(--ll-yellow);
  border-color: var(--ll-cobalt);
}

.clb-chat__action--promote {
  color: var(--ll-cobalt);
  border-color: var(--ll-cobalt);
  background: rgba(255, 212, 0, 0.15);
}

.clb-chat__action--promote:hover {
  background: var(--ll-yellow);
}

.clb-chat__action--drop {
  color: var(--ll-coral);
  border-color: rgba(255, 107, 74, 0.3);
}

.clb-chat__action--drop:hover {
  background: rgba(255, 107, 74, 0.08);
}

.clb-chat__action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.clb-chat__action:not(:disabled):active {
  transform: scale(0.96);
}

/* Inline card selection chips */
.clb-chat__cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.clb-chat__card-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  background: var(--ll-white);
  border: 1.5px solid rgba(23, 71, 209, 0.2);
  border-radius: 4px 10px 5px 9px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-align: left;
  width: 100%;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ll-graphite);
}

.clb-chat__card-chip:hover,
.clb-chat__card-chip:focus-visible {
  border-color: var(--ll-cobalt);
  background: rgba(255, 212, 0, 0.05);
}

.clb-chat__card-chip--selected {
  border-color: var(--ll-cobalt);
  background: rgba(255, 212, 0, 0.12);
  box-shadow: 2px 2px 0 rgba(23, 71, 209, 0.08);
}

.clb-chat__card-chip--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.clb-chat__card-chip--disabled:hover,
.clb-chat__card-chip--disabled:focus-visible {
  border-color: rgba(23, 71, 209, 0.1);
  background: var(--ll-white);
}

.clb-chat__card-chip-title {
  flex: 1;
  font-size: 0.8rem;
}

.clb-chat__card-chip-pills {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* Inline textarea (restart note) */
.clb-chat__textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ll-graphite);
  background: var(--ll-white);
  border: 1.5px solid var(--ll-cobalt);
  border-radius: 6px 10px 7px 9px;
  margin-top: 0.5rem;
}

.clb-chat__textarea:focus-visible {
  outline: 3px solid var(--ll-yellow);
  outline-offset: 2px;
}

/* Chat action dock — persistent scenario chips */
.clb-chat__dock {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border-top: 1.5px solid rgba(23, 71, 209, 0.12);
}

.clb-chat__dock-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.55rem;
  min-height: 32px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ll-cobalt);
  background: transparent;
  border: 1px solid rgba(23, 71, 209, 0.2);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.2s ease, transform 0.1s ease;
  animation: clb-dock-in 0.3s ease-out both;
}

.clb-chat__dock-chip:nth-child(1) { animation-delay: 0.05s; }
.clb-chat__dock-chip:nth-child(2) { animation-delay: 0.1s; }
.clb-chat__dock-chip:nth-child(3) { animation-delay: 0.15s; }
.clb-chat__dock-chip:nth-child(4) { animation-delay: 0.2s; }

@keyframes clb-dock-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.clb-chat__dock-chip:hover,
.clb-chat__dock-chip:focus-visible {
  background: rgba(23, 71, 209, 0.06);
  border-color: var(--ll-cobalt);
  outline: none;
}

.clb-chat__dock-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.clb-chat__dock-chip--reset {
  color: var(--ll-ink-muted);
  border-color: rgba(23, 71, 209, 0.1);
  margin-left: auto;
}

.clb-chat__dock-chip--reset:hover,
.clb-chat__dock-chip--reset:focus-visible {
  color: var(--ll-cobalt);
  border-color: rgba(23, 71, 209, 0.25);
}

.clb-chat__dock-chip:not(:disabled):active {
  transform: scale(0.96);
}

.clb-chat__dock-chip-icon {
  font-size: 0.75rem;
  line-height: 1;
}

.clb-chat__dock--running .clb-chat__dock-chip {
  opacity: 0.35;
}

@media (prefers-reduced-motion: reduce) {
  .clb-chat__dock-chip { animation: none; }
}

/* Typing indicator */
.clb-chat__typing {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  align-self: flex-start;
  background: rgba(23, 71, 209, 0.06);
  border-left: 3px solid var(--ll-cobalt);
  border-radius: 0 12px 5px 0;
}

.clb-chat__typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ll-cobalt);
  opacity: 0.4;
  animation: clb-typing 1.4s infinite ease-in-out;
}

.clb-chat__typing-dot:nth-child(2) { animation-delay: 0.2s; }
.clb-chat__typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes clb-typing {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .clb-chat__typing-dot { animation: none; opacity: 0.5; }
}

/* Responsive */
@media (max-width: 600px) {
  .clb-capture__input-row {
    flex-direction: column;
  }

  .clb-capture__add {
    width: 100%;
  }

  .clb-chat {
    bottom: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
}
