/* Design tokens lifted directly from Ownwork's own client/look.css, not a
   separate invented palette — same canvas/surface/accent/glow values. */
:root {
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --wordmark: "Unbounded", "Segoe UI", sans-serif;
  --canvas: #04030d;
  --surface: #0d0a2a;
  --surface-soft: #110e30;
  --ink: #ecebff;
  --muted: #a5a0c8;
  --line: #2a2550;
  --accent: #8b5cf6;
  --accent-light: #1a1545;
  --zx-cyan: #22d3ee;
  --zx-pink: #e879f9;
  --zx-honey: #fbbf24;
  --danger: #fb7185;
  --danger-bg: #2a1020;
  --warning: #fbbf24;
  --warning-bg: #2a2110;
  --good: #34d399;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1100px 550px at 50% -10%, var(--accent-light) 0%, var(--canvas) 60%);
  color: var(--ink);
  font: 15px/1.6 "DM Sans", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}
h1, h2, h3, h4, h5 { font-family: var(--display); }

.wrap { max-width: 740px; margin: 0 auto; padding: 32px 20px 80px; }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 13px; color: var(--muted); }
.top-bar b { color: var(--ink); }
.link-btn { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }

.hero { text-align: center; margin-bottom: 28px; }
.hero h1 {
  font-size: 32px; margin: 0 0 8px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--zx-pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin: 0; }

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 18px 50px -24px #8b5cf655, inset 0 1px 0 #ffffff0c;
}

.capabilities .cap-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; color: var(--muted); font-family: var(--display); }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.cap-card { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.cap-card .cap-emoji { font-size: 20px; }
.cap-card b { font-size: 13px; }
.cap-card span:last-child { font-size: 12px; color: var(--muted); }

.step { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-soft); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-label { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; font-family: var(--display); }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="url"], textarea, input[type="password"] {
  width: 100%; background: var(--surface-soft); border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 11px 13px; font-size: 15px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px #8b5cf633; }
textarea { resize: vertical; min-height: 90px; font-family: ui-monospace, monospace; font-size: 13px; }

.row { display: flex; gap: 10px; align-items: stretch; }
.row input { flex: 1; }

/* Matches Ownwork's actual rendered .button (client/polish.css), not just its
   plainer look.css base — the real buttons are a 4-stop animated gradient at
   12px radius, not a flat pill. */
button {
  background-image: linear-gradient(110deg, #7c3aed, #a855f7 40%, #e879f9 75%, #22d3ee);
  background-size: 220% 100%;
  color: white; border: 1px solid #ffffff22; border-radius: 12px; padding: 11px 22px;
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
  box-shadow: 0 8px 22px -8px #8b5cf6aa;
  transition: transform .22s ease, box-shadow .25s, background-position .4s, border-color .2s;
  position: relative; overflow: hidden;
}
button:hover:not(:disabled) { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 12px 28px -8px #e879f9aa; }
button.secondary { background-image: none; background: var(--surface-soft); border: 1px solid var(--line); color: var(--ink); box-shadow: none; }
button.secondary:hover:not(:disabled) { background: var(--accent-light); transform: none; box-shadow: none; }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
button.full { width: 100%; }

.collapsible summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 0; list-style: none; }
.collapsible summary::before { content: '▸ '; }
.collapsible[open] summary::before { content: '▾ '; }
.collapsible .content { padding-top: 12px; }

.connect-hint { color: var(--muted); font-size: 12px; margin: 4px 0 12px; }
.required-badge { font-size: 10px; font-weight: 700; background: var(--accent); color: white; border-radius: 999px; padding: 2px 9px; }
.connectors { display: flex; gap: 10px; flex-wrap: wrap; }
.connector-card { flex: 1; min-width: 220px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px; transition: border-color 0.3s, box-shadow 0.3s; }
.connector-card.connected { border-color: var(--good); box-shadow: 0 0 0 1px #34d39933, 0 0 18px #34d39922; }
.connector-card h4 { margin: 0 0 8px; font-size: 14px; font-family: var(--display); }
.connector-status { font-size: 12px; color: var(--muted); margin-top: 6px; }
.connector-status.connected { color: var(--good); }
.auth-link { display: block; word-break: break-all; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.device-code { margin-top: 10px; font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: 2px; text-align: center; background: var(--surface); border: 1px dashed var(--accent); border-radius: 10px; padding: 10px; }

.bot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.bot-card { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; transition: border-color 0.4s, box-shadow 0.4s; }
.bot-card.running { border-color: var(--accent); box-shadow: 0 0 0 1px #8b5cf633, 0 0 18px #8b5cf422; animation: bot-pulse 2.6s ease-in-out infinite; }
@keyframes bot-pulse { 0%, 100% { box-shadow: 0 0 0 1px #8b5cf633, 0 0 12px #8b5cf418; } 50% { box-shadow: 0 0 0 1px #8b5cf655, 0 0 20px #e879f940; } }
.bot-card.done { border-color: var(--good); }
.bot-card.skipped { opacity: 0.5; }
.bot-card .emoji { font-size: 26px; }
.bot-card h5 { margin: 6px 0 2px; font-size: 13px; font-family: var(--display); }
.bot-card .role { font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.bot-card .activity { font-size: 11px; color: var(--muted); min-height: 28px; }
.bot-card .status-pill { font-size: 10px; font-weight: 700; border-radius: 999px; padding: 2px 10px; display: inline-block; margin-top: 4px; }
.status-pill.idle { background: var(--accent-light); color: var(--muted); }
.status-pill.running { background: var(--accent); color: white; }
.status-pill.done { background: #0f3d2c; color: var(--good); }
.status-pill.skipped { background: var(--accent-light); color: var(--muted); }
.status-pill.failed { background: var(--danger-bg); color: var(--danger); }

.test-log-box { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface-soft); }
.test-log-box summary { font-size: 12px; font-weight: 600; color: var(--muted); }
.test-log-fail-row { font-size: 12px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--line); word-break: break-all; }
.test-log-fail-row:last-child { border-bottom: none; }
.test-log-fail-row b { color: var(--danger); }

.comms-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.2px; line-height: 1.5; }

/* One single group chat — bot step-by-step narration, phase handoffs, and the
   user's own messages all land here in order. No per-bot tabs, no separate
   empty chat boxes: this is the only place anything gets typed or shown. */
.group-chat { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; height: 320px; overflow-y: auto; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.gc-msg { display: flex; flex-direction: column; max-width: 88%; }
.gc-msg .who { font-weight: 700; font-size: 11px; margin-bottom: 2px; display: flex; align-items: center; gap: 5px; }
.gc-msg .bubble { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 7px 11px; color: var(--text); }
.gc-msg.step { opacity: 0.72; }
.gc-msg.step .bubble { background: transparent; border: none; padding: 1px 0; font-size: 12px; font-style: italic; }
.gc-msg.step .who { font-size: 10px; opacity: 0.9; }
.gc-msg.you { align-self: flex-end; max-width: 88%; }
.gc-msg.you .who { justify-content: flex-end; color: var(--accent); }
.gc-msg.you .bubble { background: var(--accent); color: white; border: none; }
.gc-msg.pending .bubble { opacity: 0.6; }
.gc-msg.failure .bubble { border-color: var(--danger); }

/* Zet's bee avatar — same artwork as Ownwork's ZetBee mascot, with a calmer
   halo glow (Ownwork's own .zet-bee-halo pattern) instead of a plain CSS orb. */
.zet-bee-wrap { position: relative; width: 72px; height: 72px; margin: 0 auto 14px; }
.zet-bee-wrap.hero-bee { width: 56px; height: 56px; margin-bottom: 10px; }
.zet-bee-wrap.call-bee { width: 88px; height: 88px; }
.zet-bee-halo { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, #8b5cf65a 0%, #22d3ee22 45%, transparent 68%); animation: zet-halo 4s ease-in-out infinite; pointer-events: none; }
@keyframes zet-halo { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.zet-bee-img { position: relative; width: 100%; height: 100%; object-fit: contain; animation: zet-bob 3.2s ease-in-out infinite; filter: drop-shadow(0 6px 14px #00000055); }
@keyframes zet-bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-4px) rotate(-2deg); } }
.caption { text-align: center; color: var(--muted); min-height: 20px; font-size: 14px; margin-bottom: 14px; }
.call-controls { display: flex; justify-content: center; gap: 10px; }

.progress { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.progress-bar { height: 6px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; margin-bottom: 14px; }
.progress-bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--zx-pink)); width: 0%; transition: width 0.5s ease; }

.report-links { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.report-links a { color: var(--accent); text-decoration: none; font-weight: 600; }

.hidden { display: none !important; }
.error-box { background: var(--danger-bg); border: 1px solid var(--danger); color: #ffd4da; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; }

footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 40px; }

/* Auth screen */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { max-width: 420px; width: 100%; }
.auth-title {
  font-size: 28px; margin: 0 0 10px; text-align: center; font-weight: 700; font-family: var(--wordmark);
  background: linear-gradient(135deg, var(--accent), var(--zx-pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-pitch { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 20px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--surface-soft); border-radius: 999px; padding: 4px; }
.auth-tabs button { flex: 1; background: transparent; color: var(--muted); border-radius: 999px; font-size: 13px; padding: 8px; box-shadow: none; }
.auth-tabs button:hover { transform: none; box-shadow: none; }
.auth-tabs button.active { background: var(--accent); color: white; }
