/* AI components demos (cp/ai.js). The components bring their own base styles; here the site looks. */

.cp-ai {
  --ai-fg: var(--text);
  --ai-muted: var(--muted);
  --ai-surface: var(--surface);
  --ai-surface-2: var(--raised);
  --ai-line: var(--line-2);
  --ai-accent: var(--accent);
  --ai-success: #30D158;
  --ai-danger: #FF453A;
  --ai-primary: var(--text);
  --ai-primary-fg: var(--bg);
  --dissolve-foreground: var(--ai-fg);
  --dissolve-muted: var(--ai-muted);
  --dissolve-surface-2: var(--ai-surface-2);
  --dissolve-border: var(--ai-line);
  --dissolve-accent: var(--ai-accent);
  --dissolve-success: var(--ai-success);
  --dissolve-danger: var(--ai-danger);
  --dissolve-primary: var(--ai-primary);
  --dissolve-primary-foreground: var(--ai-primary-fg);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  color: var(--ai-fg); user-select: none; -webkit-user-select: none;
}
[data-theme='light'] .cp-ai { --ai-success: #34C759; --ai-danger: #FF3B30; --ai-surface-2: var(--surface-2); }

.cp-ai-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 3px; border-radius: var(--pill); background: var(--wash); }
/* Six options in a gallery card: two even rows of three instead of a lone chip on the second line. */
.cp-panel-body .cp-ai-chips-6, .cp-mode-tile .cp-ai-chips-6 { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 18px; }
.cp-ai-chip {
  height: 26px; padding: 0 11px; border-radius: var(--pill); font: 500 12px/1 var(--sans); color: var(--muted);
  transition: color .2s, background .2s; -webkit-tap-highlight-color: transparent;
}
.cp-ai-chip:hover { color: var(--text); }
.cp-ai-chip.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 0 0 1px var(--line); }
.cp-ai-chip:active { transform: scale(0.96); }
.cp-ai-chip:focus-visible, .cp-ai [tabindex]:focus-visible, .cp-up-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- ThinkingOrb ---------- */
.cp-orb-cv { display: block; cursor: pointer; touch-action: pan-y; border-radius: 50%; -webkit-tap-highlight-color: transparent; }

/* ---------- ImageReveal ---------- */
.cp-rv-frame {
  position: relative; border-radius: 20px; cursor: pointer; isolation: isolate;
  background: var(--ai-surface-2); box-shadow: inset 0 0 0 1px var(--line); -webkit-tap-highlight-color: transparent;
}
.cp-mode-tile .cp-rv-frame { border-radius: 16px; }
.cp-rv-img { position: absolute; inset: 0; border-radius: inherit; transition: opacity .15s; }
.cp-rv-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 12.5px; font-weight: 500; transition: opacity .2s;
}

/* ---------- SweepTransition ---------- */
.cp-sw-view {
  position: relative; border-radius: 20px; overflow: hidden; cursor: pointer; isolation: isolate;
  background: var(--ai-surface-2); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.cp-mode-tile .cp-sw-view { border-radius: 16px; }
.cp-sw-content { position: absolute; inset: 0; display: block; }

/* ---------- UploadTile ---------- */
.cp-up { gap: 12px; }
/* The add button keeps the gap before the first tile; the tray gives back the gap after the last one. */
.cp-up-tray { display: flex; align-items: center; justify-content: center; min-height: 84px; margin-right: -6px; }
.cp-up-add {
  flex: none; width: 84px; height: 84px; padding: 6px; margin-right: 6px; display: grid; -webkit-tap-highlight-color: transparent;
}
.cp-up-add > span {
  border-radius: 16px; display: grid; place-items: center; color: var(--muted);
  border: 1.5px dashed var(--line-2); transition: color .2s, background .2s;
}
.cp-up-add:hover > span { color: var(--text); background: var(--wash); }
.cp-up-add:active { opacity: .6; }
.cp-up-add:disabled { opacity: .35; pointer-events: none; }
.cp-up-cap { margin: 0; font-size: 12px; color: var(--muted); }

/* ---------- TaskCheck ---------- */
.cp-tc { width: 100%; max-width: 320px; align-items: stretch; gap: 4px; }
.cp-tc .cp-ai-chips { align-self: center; margin-top: 12px; }
.cp-tc-head { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 10px 4px 6px; }
.cp-tc-head:first-child { padding-top: 0; }
.cp-tc-head[hidden] { display: none; }
.cp-tc-list { display: flex; flex-direction: column; }
.cp-tc-row { min-height: 40px; padding: 8px 4px; border-radius: 10px; }
.cp-tc-row:hover { background: var(--wash); }
.cp-tc-row:hover .dissolve-task-box { box-shadow: inset 0 0 0 1.5px var(--faint); }
.cp-tc-text { font-size: 14.5px; line-height: 1.35; letter-spacing: normal; }
.cp-tc-empty { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 4px; font-size: 14px; color: var(--muted); }
.cp-tc.compact .cp-tc-row { min-height: 34px; padding: 5px 4px; }
.cp-tc.compact .cp-tc-text { font-size: 13px; }
