/* AI chat — "Website preview" card (src/components/ai/AiWebPreview.tsx). Uses the chat's --cg-* colours. */
.wp-card { margin: 14px 0 6px; border: 1px solid var(--cg-line, #383838); border-radius: 16px; background: var(--cg-raised, #2f2f2f); overflow: hidden; color: var(--cg-text, #ececec); }
.wp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--cg-line, #383838); }
.wp-closed .wp-head { border-bottom: 0; }
.wp-title { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; min-width: 0; flex: 1 1 200px; }
.wp-logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #06b6d4); color: #fff; flex-shrink: 0; }
.wp-name { display: flex; flex-direction: column; min-width: 0; }
.wp-name b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-name small { font-size: .76rem; color: var(--cg-muted, #b4b4b4); }
.wp-caret { color: var(--cg-faint, #8f8f8f); font-size: .75rem; margin-left: 4px; }
.wp-tabs { display: inline-flex; background: var(--cg-bg, #212121); border-radius: 10px; padding: 3px; }
.wp-tabs button { border: 0; background: none; cursor: pointer; padding: 6px 12px; border-radius: 8px; font-size: .82rem; font-weight: 600; color: var(--cg-muted, #b4b4b4); display: inline-flex; gap: 6px; align-items: center; }
.wp-tabs button.on { background: var(--cg-raised, #2f2f2f); color: var(--cg-text, #ececec); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.wp-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.wp-devices { display: inline-flex; background: var(--cg-bg, #212121); border-radius: 10px; padding: 3px; }
.wp-devices button, .wp-icon { width: 32px; height: 30px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--cg-muted, #b4b4b4); display: inline-grid; place-items: center; }
.wp-devices button.on { background: var(--cg-raised, #2f2f2f); color: var(--cg-text, #ececec); }
.wp-devices button:hover, .wp-icon:hover { color: var(--cg-text, #ececec); background: var(--cg-hover, #2a2a2a); }
.wp-zip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: #ececec; color: #111 !important; font-weight: 700; font-size: .82rem; cursor: pointer; }
.wp-zip:hover { background: #fff; }
.wp-zip:disabled { opacity: .7; cursor: progress; }
.wp-pages { display: flex; gap: 4px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: thin; }
.wp-pages button { border: 1px solid var(--cg-line, #383838); background: none; color: var(--cg-muted, #b4b4b4); border-radius: 8px; padding: 4px 10px; font-size: .78rem; cursor: pointer; white-space: nowrap; }
.wp-pages button.on { color: var(--cg-text, #ececec); border-color: var(--cg-accent, #48aaff); }
.wp-stage { padding: 12px; background: repeating-conic-gradient(rgba(255,255,255,.025) 0 25%, transparent 0 50%) 0 0 / 16px 16px; display: flex; justify-content: center; }
.wp-browser { max-width: 100%; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.35); transition: width .25s ease; display: flex; flex-direction: column; }
.wp-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; background: #e5e7eb; }
.wp-bar span { width: 10px; height: 10px; border-radius: 50%; background: #f87171; }
.wp-bar span:nth-child(2) { background: #fbbf24; }
.wp-bar span:nth-child(3) { background: #34d399; }
.wp-bar em { flex: 1; margin-left: 8px; font-style: normal; font-size: .72rem; color: #4b5563; background: #fff; border-radius: 6px; padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-viewport { position: relative; overflow: hidden; background: #fff; }
.wp-viewport iframe { display: block; border: 0; background: #fff; transform-origin: 0 0; position: absolute; top: 0; left: 0; }
.wp-bar b { font-size: .68rem; font-weight: 600; color: #6b7280; white-space: nowrap; }
.wp-notice { margin: 0; padding: 8px 14px; font-size: .82rem; color: #bae6fd; background: rgba(14,165,233,.12); border-top: 1px solid var(--cg-line, #383838); }
.wp-errors { border-top: 1px solid rgba(248,113,113,.35); background: rgba(127,29,29,.25); padding: 10px 14px; font-size: .84rem; }
.wp-errors-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #fecaca; }
.wp-errors-head i { color: #f87171; }
.wp-errors-head button { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; border: 0; border-radius: 8px; padding: 6px 12px; background: #f87171; color: #111 !important; font-weight: 700; font-size: .8rem; cursor: pointer; }
.wp-errors ul { margin: 8px 0 0; padding-left: 18px; color: #fecaca; }
.wp-errors code { font-size: .78rem; white-space: pre-wrap; word-break: break-word; }
.wp-code { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 300px; max-height: 70vh; }
.wp-files { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-right: 1px solid var(--cg-line, #383838); overflow: auto; }
.wp-files button { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: none; color: var(--cg-muted, #b4b4b4); border-radius: 8px; padding: 7px 9px; font-size: .8rem; cursor: pointer; word-break: break-all; }
.wp-files button.on { background: var(--cg-hover, #2a2a2a); color: var(--cg-text, #ececec); }
.wp-files .fa-html5 { color: #f97316; } .wp-files .fa-css3-alt { color: #3b82f6; } .wp-files .fa-js { color: #facc15; }
.wp-src { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.wp-src-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; font-size: .78rem; color: var(--cg-muted, #b4b4b4); border-bottom: 1px solid var(--cg-line, #383838); }
.wp-src-head button { border: 1px solid var(--cg-line, #383838); background: none; border-radius: 8px; padding: 4px 10px; font-size: .78rem; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.wp-src pre { margin: 0; padding: 10px 0; overflow: auto; flex: 1; background: #171717; font: .8rem/1.6 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; color: #e5e7eb; tab-size: 2; }
.wp-src .ln { display: block; padding-right: 16px; white-space: pre; }
.wp-src .ln i { display: inline-block; width: 46px; padding-right: 14px; text-align: right; color: #6b7280; font-style: normal; user-select: none; }
/* full screen */
.wp-full { position: fixed; inset: 12px; z-index: 100000; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --cg-bg: #212121; --cg-raised: #2f2f2f; --cg-hover: #2a2a2a; --cg-line: #383838; --cg-text: #ececec; --cg-muted: #b4b4b4; --cg-faint: #8f8f8f; --cg-accent: #48aaff; margin: 0; display: flex; flex-direction: column; box-shadow: 0 0 0 100vmax rgba(0,0,0,.65); }
.wp-full .wp-stage { flex: 1; min-height: 0; }
.wp-full .wp-stage { align-items: flex-start; }
.wp-full .wp-code { flex: 1; max-height: none; }
@media (max-width: 640px) {
  .wp-actions { width: 100%; margin-left: 0; justify-content: flex-end; }
  .wp-zip span { display: none; }
  .wp-code { grid-template-columns: 1fr; }
  .wp-files { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--cg-line, #383838); }
  .wp-files button { white-space: nowrap; word-break: normal; }
  .wp-stage { padding: 6px; }
  .wp-full { inset: 0; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .wp-browser { transition: none; } }

.wp-full button { font: inherit; color: inherit; }

/* project kinds */
.wp-logo--react { background: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.wp-logo--server { background: linear-gradient(135deg, #ef4444, #f97316); }
.wp-run { padding: 14px 16px 16px; font-size: .9rem; }
.wp-run-note { margin: 0 0 10px; color: var(--cg-muted, #b4b4b4); line-height: 1.55; }
.wp-run-note i { color: var(--cg-accent, #48aaff); margin-right: 4px; }
.wp-run ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.wp-run code { background: #171717; border: 1px solid var(--cg-line, #383838); border-radius: 6px; padding: 3px 8px; font-size: .82rem; color: #e5e7eb; overflow-wrap: anywhere; }
.wp-run details { margin-top: 14px; }
.wp-run summary { cursor: pointer; color: var(--cg-accent, #48aaff); font-weight: 600; }
.wp-run pre { margin: 8px 0 0; max-height: 320px; overflow: auto; background: #171717; border-radius: 8px; padding: 12px; font-size: .8rem; white-space: pre-wrap; }
