/* ===========================================================================
   Tableau MCP hands-on — visual language borrowed from the Lodge hub
   (system fonts, warm off-white canvas, navy headings, one accent per surface,
   derived tints via color-mix, hairline borders, 16px radius, minimal motion).
   This surface's accent is the GDA purple.
   =========================================================================== */
:root {
  --bw-bg: #fafaf9;
  --bw-bg-surface: #ffffff;
  --bw-text: #181818;
  --bw-text-secondary: #444444;
  --bw-text-muted: #706e6b;
  --bw-text-faint: #939393;
  --bw-border: #e5e5e5;
  --bw-border-light: #f0f0f0;

  --sf-navy: #032d60;

  --c-purple: #9467bd;
  --accent: var(--c-purple);
  --accent-bg: color-mix(in srgb, var(--c-purple) 9%, #fff);
  --accent-border: color-mix(in srgb, var(--c-purple) 26%, #fff);
  --accent-strong: color-mix(in srgb, var(--c-purple) 78%, #000);

  --good: #0a7d55;
  --good-bg: #eaf7f1;

  /* Tableau / Salesforce brand palette — grounds the loud rainbow in the real brand. */
  --sf-cloud: #00a1e0;      /* Salesforce cloud blue */
  --tab-blue: #0d6ce4;      /* Tableau/SLDS action blue */
  --tab-orange: #e8762d;    /* Tableau plus-mark orange */
  --tab-teal: #59a3c4;

  /* BLENDer personality: a rainbow sweep, layered over the calm Lodge palette on hero surfaces. */
  --rainbow: linear-gradient(90deg, #ff5e5e, #ffb020, #3ec46d, #3a8dde, #9467bd);
  --rainbow-135: linear-gradient(135deg, #ff5e5e, #ffb020, #3ec46d, #3a8dde, #9467bd);

  /* Brand mesh: soft Tableau-blue wash with a purple whisper — the hero canvas. */
  --brand-mesh:
    radial-gradient(1100px 540px at 12% -10%, color-mix(in srgb, var(--sf-cloud) 24%, transparent), transparent 60%),
    radial-gradient(920px 540px at 90% -4%, color-mix(in srgb, var(--tab-blue) 22%, transparent), transparent 58%),
    radial-gradient(780px 620px at 50% 120%, color-mix(in srgb, var(--c-purple) 22%, transparent), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);

  --radius: 16px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* Bare [hidden] loses to class selectors like .gate-screen{display:flex};
   force it so exactly one top-level screen is ever laid out. */
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bw-bg);
  color: var(--bw-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* The app is a fixed-viewport shell; scrolling belongs to inner panes, not the page. */
  overflow: hidden;
}

.eyebrow {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--accent); margin: 0 0 10px;
}
.hl { color: var(--accent-strong); }

.card {
  background: var(--bw-bg-surface);
  border: 1px solid var(--bw-border);
  border-radius: var(--radius);
  padding: 34px 36px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-ui); font-size: 14px; font-weight: 700;
  color: #fff; background: var(--accent); border: 0; border-radius: 10px;
  padding: 12px 22px; cursor: pointer; white-space: nowrap;
  transition: filter 0.14s ease;
}
.btn:hover { filter: brightness(0.93); }
.btn:disabled { background: var(--bw-text-faint); cursor: not-allowed; filter: none; }

/* Rainbow "loud" button — the primary call to action on hero surfaces (the gate). */
.btn.rainbow {
  background: var(--rainbow); background-size: 220% 100%; background-position: 0% 50%;
  color: #fff; text-shadow: 0 1px 2px rgba(3, 45, 96, 0.28);
  transition: background-position 0.5s ease, filter 0.14s ease, transform 0.05s ease;
}
.btn.rainbow:hover { background-position: 100% 50%; filter: none; }
.btn.rainbow:active { transform: translateY(1px); }

/* ============ BLENDer butterfly (the real Solve mark) + Tableau lockup ============ */
.bfly-hero, .bfly-nav, .bfly-mini { display: block; }
.bfly-hero {
  width: 108px; height: 108px; margin: 2px auto 10px;
  transform-origin: 50% 62%;
  animation: bflyFloat 4.6s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(3, 45, 96, 0.18));
}
.bfly-mini {
  width: 62px; height: 62px; margin: 0 auto 8px;
  transform-origin: 50% 62%;
  animation: bflyFloat 5.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(3, 45, 96, 0.16));
}
.bfly-nav { width: 26px; height: 26px; flex: 0 0 auto; animation: bflyFloat 5s ease-in-out infinite; }
@keyframes bflyFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-7px) rotate(3deg); }
}

/* Official "Tableau, from Salesforce" lockup, small, crowning the gate card. */
.brand-lockup { display: block; height: 30px; width: auto; margin: 0 auto 18px; opacity: 0.96; }

/* The BLENDer wordmark: rides the rainbow sheen wherever it appears (gate + env). */
.wordmark {
  display: inline-block;
  background: var(--rainbow-135); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.wordmark .hl { -webkit-text-fill-color: transparent; }

/* A rainbow hairline crowning a hero card. */
.rainbow-top { position: relative; overflow: hidden; }
.rainbow-top::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: var(--rainbow);
}

@media (prefers-reduced-motion: reduce) {
  .bfly-hero, .bfly-nav, .bfly-mini { animation: none; }
  .btn.rainbow { transition: filter 0.14s ease; }
}

/* ============================ Gate ============================ */
.gate-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--brand-mesh);
}
.gate-hero { width: min(600px, 100%); text-align: center; }
.gate-card {
  text-align: center;
  padding: 40px 44px 34px;
  box-shadow: 0 24px 60px -22px rgba(3, 45, 96, 0.28);
}
.gate-card h1 {
  font-size: 54px; font-weight: 800; color: var(--sf-navy);
  letter-spacing: -0.03em; line-height: 1.02; margin: 0 0 14px;
}
.lead {
  font-size: 16.5px; color: var(--bw-text-secondary);
  max-width: 460px; margin: 0 auto 22px;
}
.lead strong { color: var(--sf-navy); }

/* Three-up capability strip — fills the hero and says what actually happens. */
.feature-strip {
  list-style: none; margin: 0 0 26px; padding: 18px 6px; display: flex; gap: 10px;
  border-top: 1px solid var(--bw-border-light); border-bottom: 1px solid var(--bw-border-light);
}
.feature-strip li {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0 4px;
}
.feature-strip .fs-ico { font-size: 22px; line-height: 1.2; }
.feature-strip .fs-t { font-size: 13px; font-weight: 700; color: var(--sf-navy); }
.feature-strip .fs-d { font-size: 11.5px; color: var(--bw-text-faint); line-height: 1.35; }

/* Q Branch signature — so the people who built it get the credit, not just the presenters. */
.qbrand {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--bw-text-muted); margin-top: 12px;
  letter-spacing: 0.01em;
}
.qbrand strong { color: var(--sf-navy); font-weight: 800; letter-spacing: 0.02em; }
.qbrand-dot {
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto;
  background: var(--rainbow-135); box-shadow: 0 1px 3px rgba(3, 45, 96, 0.25);
}
.gate-card label {
  display: block; font-size: 13px; font-weight: 700; color: var(--bw-text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px;
}
.gate-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.gate-row input {
  font-family: var(--font-ui); font-size: 16px; padding: 12px 16px; min-width: 240px;
  border: 1px solid var(--bw-border); border-radius: 10px;
  letter-spacing: 0.08em; text-align: center; text-transform: uppercase;
  color: var(--bw-text); background: #fff;
}
.gate-row input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.gate-error { color: #b3261e; font-size: 14px; margin-top: 12px; min-height: 18px; }
.gate-foot { font-size: 13px; color: var(--bw-text-faint); margin-top: 20px; }

/* ============================ App shell ============================ */
.app { display: flex; flex-direction: column; height: 100vh; }

.global-nav {
  height: 3rem; background: var(--bw-bg-surface);
  border-bottom: 1px solid var(--bw-border);
  display: flex; align-items: center; gap: 9px; padding: 0 18px;
  flex: 0 0 auto; position: relative;
}
/* Rainbow hairline under the nav — the personality thread that ties the app to the gate. */
.global-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--rainbow);
}
.nav-product { font-weight: 700; color: var(--sf-navy); font-size: 15px; letter-spacing: -0.01em; }
.nav-tagline {
  font-weight: 500; color: var(--bw-text-muted); font-size: 12px; font-style: italic;
  border-left: 1px solid var(--bw-border); padding-left: 10px; margin-left: 2px;
}
.nav-spacer { flex: 1; }
/* Live context: which Tableau site / data source the session is bound to. */
.nav-context { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.nav-context:empty { display: none; }
.ctx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--bw-text-secondary);
  background: var(--bw-bg); border: 1px solid var(--bw-border);
  padding: 4px 10px; border-radius: 100px; max-width: 220px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctx-chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--good); flex: 0 0 auto;
}
.ctx-chip .ctx-k { color: var(--bw-text-faint); font-weight: 500; }
/* Q Branch tag in the app nav — quiet credit that rides every session. */
.nav-qbrand {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sf-navy); margin-right: 4px; padding-left: 12px;
  border-left: 1px solid var(--bw-border); position: relative;
}
.nav-qbrand::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--rainbow-135); margin-right: 6px; vertical-align: middle;
}
@media (max-width: 860px) { .nav-qbrand { display: none; } }
.nav-pill {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-bg);
  border: 1px solid var(--accent-border); padding: 4px 11px; border-radius: 100px;
}
.nav-pill.busy::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; vertical-align: middle;
  animation: pulse 1.1s ease-in-out infinite;
}

/* Environment badge: which Tableau backend this session is bound to. */
.nav-env {
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--sf-navy); background: color-mix(in srgb, var(--sf-navy) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--sf-navy) 22%, #fff);
  padding: 4px 11px; border-radius: 100px; margin-left: 10px;
}
.nav-env::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sf-navy); margin-right: 6px; vertical-align: middle;
}
.nav-env.cloud {
  color: var(--accent-strong); background: var(--accent-bg); border-color: var(--accent-border);
}
.nav-env.cloud::before { background: var(--accent); }

/* ==================== Environment selection screen ==================== */
.env-card {
  text-align: center; padding: 34px 40px 32px;
  box-shadow: 0 24px 60px -22px rgba(3, 45, 96, 0.28);
}
.env-card h1 {
  font-size: 38px; font-weight: 800; color: var(--sf-navy); margin: 0 0 12px;
  letter-spacing: -0.025em;
}
.env-options {
  display: flex; gap: 16px; margin-top: 22px; text-align: left;
}
@media (max-width: 640px) { .env-options { flex-direction: column; } }
.env-option {
  flex: 1 1 0; display: flex; flex-direction: column; gap: 6px;
  background: var(--bw-bg-surface); border: 1px solid var(--bw-border);
  border-radius: var(--radius); padding: 20px 18px; cursor: pointer;
  font-family: var(--font-ui); text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.env-option:hover {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg);
}
.env-option:active { transform: translateY(1px); }
.env-option.choosing { opacity: 0.6; pointer-events: none; }
.env-badge {
  align-self: flex-start; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); background: var(--accent-bg);
  border: 1px solid var(--accent-border); padding: 3px 9px; border-radius: 100px;
}
.env-name { font-size: 19px; font-weight: 700; color: var(--sf-navy); }
.env-site { font-size: 12px; font-weight: 600; color: var(--bw-text-faint); font-family: var(--font-mono); }
.env-site:empty { display: none; }
.env-blurb { font-size: 13.5px; color: var(--bw-text-secondary); line-height: 1.5; margin-top: 2px; }

/* ============================ Workspace split ============================ */
.workspace { flex: 1; display: flex; min-height: 0; }
.conversation {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--bw-border);
}
.workspace.solo .conversation { border-right: 0; }

.messages {
  flex: 1; overflow-y: auto; padding: 26px;
  display: flex; flex-direction: column; gap: 16px;
  width: 100%; max-width: 820px; margin: 0 auto;
}

.msg { border-radius: 14px; padding: 13px 16px; line-height: 1.5; }
.msg p { margin: 0 0 8px; }
.msg p:last-child { margin-bottom: 0; }
.msg.user {
  align-self: flex-end; max-width: 78%;
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 5px;
}
.msg.assistant {
  align-self: flex-start; max-width: 92%;
  background: var(--bw-bg-surface); border: 1px solid var(--bw-border);
  color: var(--bw-text); white-space: pre-wrap;
}
.msg.assistant.welcome { color: var(--bw-text-secondary); }
.msg.assistant.welcome ul { margin: 4px 0 0; padding-left: 18px; }
.msg.assistant.welcome li { margin: 4px 0; }
.msg.error {
  align-self: flex-start; background: #fdeceb; border: 1px solid #f4c7c3; color: #b3261e;
  font-size: 14px;
}

/* Markdown-ish rendering inside assistant bubbles */
.msg.assistant table { border-collapse: collapse; margin: 6px 0; font-size: 13.5px; }
.msg.assistant th, .msg.assistant td { border: 1px solid var(--bw-border); padding: 5px 10px; text-align: left; }
.msg.assistant th { background: var(--bw-bg); font-weight: 700; color: var(--sf-navy); }
.msg.assistant code {
  font-family: var(--font-mono); font-size: 0.9em;
  background: var(--bw-bg); border: 1px solid var(--bw-border-light);
  border-radius: 5px; padding: 1px 5px;
}
.msg.assistant strong { color: var(--sf-navy); }

/* ---- Activity breadcrumbs (the "what the agent is doing" stream) ---- */
.activity {
  align-self: flex-start; max-width: 92%;
  display: flex; flex-direction: column; gap: 3px;
  padding: 4px 2px;
}
.act-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--bw-text-muted);
}
.act-line .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--bw-text-faint);
  flex: 0 0 auto;
}
.act-line.active { color: var(--accent-strong); font-weight: 600; }
.act-line.active .dot { background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.act-line.done .dot { background: var(--good); }
.act-line.ready { color: var(--good); font-weight: 600; }
.act-line.ready .dot { background: var(--good); }

@keyframes pulse { 0%,100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }

/* ---- Thinking indicator (shown until the first event of a turn lands) ---- */
.msg.thinking {
  align-self: flex-start; background: transparent; padding: 6px 4px;
}
.dots { display: inline-flex; gap: 5px; }
.dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  opacity: 0.35; animation: bounce 1.2s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: 0.18s; }
.dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes bounce { 0%,80%,100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* ============================ Suggestion chips ============================ */
.suggestions {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 20px 2px; width: 100%; max-width: 820px; margin: 0 auto;
}
.suggestions:empty { display: none; }
.sug-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--bw-text-faint); margin-right: 2px;
}
.chip-suggest {
  font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--accent-strong);
  background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 100px;
  padding: 7px 14px; cursor: pointer; text-align: left; line-height: 1.3;
  transition: background 0.14s ease, transform 0.14s ease;
}
.chip-suggest:hover { background: color-mix(in srgb, var(--c-purple) 16%, #fff); transform: translateY(-1px); }

/* ============================ Composer ============================ */
.composer {
  flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--bw-border);
  background: var(--bw-bg-surface);
  width: 100%; max-width: 820px; margin: 0 auto;
}
.composer-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--bw-border); background: #fff; cursor: pointer;
  font-size: 17px; line-height: 1; color: var(--bw-text-muted);
  transition: border-color 0.14s ease, background 0.14s ease;
}
.composer-icon:hover { border-color: var(--accent); background: var(--accent-bg); }
.composer-icon.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-strong); }

/* ---- Attached visual-reference theme chip ---- */
.attach-row {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 10px 20px 0; width: 100%; max-width: 820px; margin: 0 auto;
}
.theme-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  border-radius: 100px; padding: 5px 9px 5px 6px; max-width: 100%;
}
.theme-chip img {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--accent-border); flex: 0 0 auto;
}
.theme-chip .theme-name {
  font-size: 12.5px; font-weight: 600; color: var(--accent-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.theme-chip .theme-x {
  border: 0; background: none; cursor: pointer; color: var(--accent);
  font-size: 14px; line-height: 1; padding: 2px 4px; flex: 0 0 auto;
}
.theme-chip .theme-x:hover { color: var(--accent-strong); }

/* ---- Skill library / slash palette ---- */
.skill-menu {
  flex: 0 0 auto; width: 100%; max-width: 820px; margin: 0 auto;
  padding: 6px 20px 0;
}
.skill-menu-inner {
  border: 1px solid var(--bw-border); border-radius: 12px; overflow: hidden;
  background: var(--bw-bg-surface); box-shadow: 0 6px 20px rgba(3, 45, 96, 0.08);
}
.skill-item {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: none; padding: 11px 14px; border-bottom: 1px solid var(--bw-border-light);
  font-family: var(--font-ui); transition: background 0.12s ease;
}
.skill-item:last-child { border-bottom: 0; }
.skill-item:hover, .skill-item.active { background: var(--accent-bg); }
.skill-item .skill-cmd {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--accent-strong);
}
.skill-item .skill-desc {
  display: block; font-size: 12.5px; color: var(--bw-text-muted); margin-top: 2px; line-height: 1.4;
}
#input {
  flex: 1; resize: none; font-family: var(--font-ui); font-size: 15px; line-height: 1.45;
  padding: 11px 14px; border: 1px solid var(--bw-border); border-radius: 10px;
  color: var(--bw-text); background: #fff; max-height: 160px;
}
#input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
#input:disabled { background: var(--bw-bg); color: var(--bw-text-muted); cursor: not-allowed; }
.composer .btn { padding: 11px 18px; }

/* ---- Drag handle between conversation and artifact (desktop only) ---- */
.resizer {
  flex: 0 0 auto; width: 7px; cursor: col-resize; position: relative;
  background: transparent; margin: 0 -3px; z-index: 2;
}
.resizer::before {
  content: ""; position: absolute; inset: 0 3px; background: var(--bw-border);
  transition: background 0.14s ease;
}
.resizer:hover::before, .resizer.dragging::before { background: var(--accent-border); }
.workspace.solo .resizer { display: none; }

/* ============================ Artifact panel ============================ */
.artifact {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  background: var(--bw-bg);
  animation: artifactIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes artifactIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}
.artifact-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--bw-border);
  background: var(--bw-bg-surface); position: relative;
}
/* A little rainbow crown on the preview — a small flourish when a chart appears. */
.artifact-head::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--rainbow);
}
.artifact-titles { display: flex; align-items: center; gap: 12px; min-width: 0; }
.artifact-title {
  font-weight: 800; color: var(--sf-navy); font-size: 15px; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 9px; border-radius: 100px; white-space: nowrap;
}
.chip.local { color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-border); }
.chip.published { color: var(--good); background: var(--good-bg); border: 1px solid color-mix(in srgb, var(--good) 30%, #fff); }
.artifact-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.linklike { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.linklike:hover { text-decoration: underline; }
.iconbtn {
  border: 1px solid var(--bw-border); background: #fff; color: var(--bw-text-muted);
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer; font-size: 13px; line-height: 1;
}
.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
.artifact-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---- Version timeline: the analytical artifact's evolution, rewindable ---- */
.versions {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-bottom: 1px solid var(--bw-border);
  background: var(--bw-bg-surface); overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.ver-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--bw-text-faint); flex: 0 0 auto;
}
.ver-chip {
  flex: 0 0 auto; font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  color: var(--bw-text-secondary); background: var(--bw-bg);
  border: 1px solid var(--bw-border); border-radius: 8px; padding: 4px 10px;
  cursor: pointer; white-space: nowrap; transition: all 0.14s ease;
}
.ver-chip:hover { border-color: var(--accent-border); color: var(--accent-strong); }
.ver-chip.active {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
.ver-hint {
  margin-left: auto; flex: 0 0 auto; font-size: 12px; color: var(--bw-text-muted);
  background: none; border: 0; cursor: pointer; font-family: var(--font-ui); font-weight: 600;
}
.ver-hint:hover { color: var(--accent); text-decoration: underline; }

/* ============================ Responsive ============================ */
@media (max-width: 860px) {
  /* Stack conversation over artifact; when a preview exists give it real height. */
  .workspace { flex-direction: column; }
  .conversation { border-right: 0; }
  .workspace:not(.solo) .conversation { border-bottom: 1px solid var(--bw-border); flex: 1 1 55%; }
  .artifact { min-height: 42vh; flex: 1 1 45%; }
  .messages, .composer, .suggestions { max-width: 100%; }
  .messages { padding: 18px; }
  .nav-tagline { display: none; }
  .gate-card { padding: 26px 22px; }
  .gate-card h1 { font-size: 34px; }
  /* Keep suggestion chips on one swipeable row rather than wrapping tall. */
  .suggestions { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
  .chip-suggest { white-space: nowrap; }
}
