/* =========================================================
   OPTOPUS AI — Workspace
   A dedicated stylesheet for the immersive AI environment only
   (loaded on /ai alone) so it never competes with, or bloats, the
   marketing site's shared styles.css. Uses the same design tokens
   defined there (--black, --platinum, --cyan, --ease-soft, etc.).
   ========================================================= */

body.is-ai-workspace {
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}
body.is-ai-workspace .site-header { background: transparent; }
body.is-ai-workspace .site-header:not(.is-menu-open)::before { display: none; }

.aiw {
  position: relative;
  height: 100vh;
  height: 100svh;
  padding-top: var(--header-h);
  display: flex;
  overflow: hidden;
  isolation: isolate;
}

/* ---------------- Cinematic background ---------------- */
.aiw__bg { position: absolute; inset: 0; z-index: 0; }
.aiw__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  filter: saturate(1.05);
}
.aiw__bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6,6,8,0.72) 0%, rgba(6,6,8,0.25) 22%, rgba(6,6,8,0.22) 55%, rgba(6,6,8,0.6) 100%),
    linear-gradient(90deg, rgba(6,6,8,0.55) 0%, rgba(6,6,8,0.08) 26%, rgba(6,6,8,0.08) 74%, rgba(6,6,8,0.4) 100%);
  transition: background 0.5s var(--ease-soft);
}
/* Conversation active: same cinematic background, just a touch more
   readability behind the conversation column — never a flat dark panel. */
[data-ai-conversation] .aiw__bg-veil {
  background:
    linear-gradient(180deg, rgba(6,6,8,0.8) 0%, rgba(6,6,8,0.42) 26%, rgba(6,6,8,0.52) 62%, rgba(6,6,8,0.74) 100%),
    linear-gradient(90deg, rgba(6,6,8,0.55) 0%, rgba(6,6,8,0.12) 26%, rgba(6,6,8,0.12) 74%, rgba(6,6,8,0.4) 100%);
}

.aiw__scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(4,4,6,0.55);
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-soft);
}

/* ---------------- Sidebar ---------------- */
.aiw__sidebar {
  position: relative;
  z-index: 20;
  width: 272px;
  flex: 0 0 272px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  background: rgba(17,17,20,0.5);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-right: 1px solid rgba(255,255,255,0.08);
  /* Safety net for short viewports: New Chat + Recents + the capability
     nav + Projects + Settings/user together can exceed a short window's
     height, and their individual flex-shrink math can squeeze one
     section down to ~0 and visually overlap the next (observed: the
     Projects "+" button hidden behind the Settings/user block). Letting
     the whole sidebar scroll guarantees every control stays reachable
     regardless of viewport height, rather than fighting over fixed space. */
  overflow-y: auto;
}
.aiw__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 16px;
}
.aiw__brand-mark { width: 26px; height: 27px; object-fit: contain; }
.aiw__brand-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--white);
}
.aiw__brand-name em { font-style: normal; color: var(--cyan); }
.aiw__sidebar-close { display: none; margin-left: auto; background: none; border: 0; color: var(--platinum); font-size: 1rem; cursor: pointer; padding: 4px; }

.aiw__new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: var(--white);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s var(--ease-soft), border-color 0.25s var(--ease-soft);
}
.aiw__new-chat span[aria-hidden] { color: var(--cyan); font-size: 1.05rem; line-height: 1; }
.aiw__new-chat:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); }

.aiw__nav { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.aiw__nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--platinum);
  font-size: 0.83rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s var(--ease-soft), color 0.2s var(--ease-soft);
}
.aiw__nav-item[hidden] { display: none; }
.aiw__nav-item:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.aiw__nav-item.is-active { background: rgba(87,230,224,0.1); color: var(--white); }
.aiw__nav-item.is-active::before { content: ""; }

/* Image Generator / Video — temporarily inactive (not removed, not an
   error state): a touch dimmer, a normal cursor since the click still
   does something (shows a notice), never the active-mode highlight. */
.aiw__nav-item--disabled { opacity: 0.55; cursor: default; }
.aiw__nav-item--disabled:hover { background: rgba(255,255,255,0.03); color: var(--platinum); }
.aiw__nav-item--disabled.is-active { background: transparent; color: var(--platinum); }
.aiw__nav-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aiw__nav-badge {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(217,218,222,0.45);
}

.aiw__disabled-notice {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 8px);
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(12,12,14,0.92);
  backdrop-filter: blur(8px);
  color: var(--platinum);
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: pre-line;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-soft), transform 0.25s var(--ease-soft);
  z-index: 20;
}
.aiw__disabled-notice.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Recents — standalone conversations (New Chat), visually identical to
   the Projects list below but a distinct section, since the two are a
   distinct concept: a Recents chat is never tied to a project. */
/* Shares shrink/scroll behavior with .aiw__projects below (flex:1 1
   auto + min-height:0) rather than being exempt from shrinking — an
   earlier flex-shrink:0 here starved .aiw__projects down to ~0 height
   on a short viewport, since Recents refused to give back any space
   while Projects (the only other min-height:0 sibling) absorbed the
   entire deficit alone. Both now shrink together and scroll
   independently when the sidebar is short. max-height keeps Recents
   from dominating when there's plenty of room and little in Projects. */
/* Recents rail — moved out of the sidebar into the main stage per the
   "final home layout" pass: a small, discrete floating panel on the
   right (desktop), collapsible from the topbar toggle (mobile). Real
   conversations only (ConversationStore) — never projects. */
.aiw__recents-toggle { display: none; }
.aiw__recents-rail {
  position: absolute;
  top: 56px;
  right: clamp(16px, 3vw, 32px);
  width: 208px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  z-index: 6;
  background: rgba(19,19,22,0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 12px;
}
.aiw__recents-label { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(217,218,222,0.5); margin: 4px 12px 6px; }
.aiw__recent-list { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }
.aiw__recent-list::-webkit-scrollbar { width: 6px; }
.aiw__recent-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.aiw__recents-empty { font-size: 0.78rem; color: rgba(217,218,222,0.45); margin: 4px 12px; }
.aiw__recent-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border-radius: 9px; }
.aiw__recent-item:hover { background: rgba(255,255,255,0.05); }
.aiw__recent-item.is-active { background: rgba(255,255,255,0.08); }
.aiw__recent-item-main { all: unset; display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; cursor: pointer; padding: 8px 12px; color: var(--platinum); font-size: 0.82rem; }
.aiw__recent-item.is-active .aiw__recent-item-main { color: var(--white); }
.aiw__recent-item-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiw__recent-item-actions { display: flex; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); gap: 4px; opacity: 0.55; transition: opacity 0.2s var(--ease-soft); }
.aiw__recent-item:hover .aiw__recent-item-actions,
.aiw__recent-item:focus-within .aiw__recent-item-actions,
.aiw__recent-item-actions:hover { opacity: 1; }
.aiw__recent-item-action { font-size: 0.68rem; padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.16); background: rgba(8,8,10,0.85); color: rgba(217,218,222,0.8); cursor: pointer; }
.aiw__recent-item-action:hover { color: var(--white); border-color: rgba(255,255,255,0.35); }
.aiw__recent-item-main { padding-right: 52px; }

.aiw__projects { flex: 1 1 auto; min-height: 70px; display: flex; flex-direction: column; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.07); }
.aiw__projects[hidden] { display: none; }
.aiw__projects-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 12px 6px; }
.aiw__projects-label { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(217,218,222,0.5); margin: 0; }
.aiw__projects-add {
  width: 20px; height: 20px; line-height: 1; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.16); background: transparent;
  color: rgba(217,218,222,0.6); cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s var(--ease-soft), border-color 0.2s var(--ease-soft);
}
.aiw__projects-add:hover { color: var(--white); border-color: rgba(255,255,255,0.35); }
.aiw__project-list { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }
.aiw__project-list::-webkit-scrollbar { width: 6px; }
.aiw__project-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.aiw__project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--platinum);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s var(--ease-soft), color 0.2s var(--ease-soft);
}
.aiw__project-item:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.aiw__project-item.is-active { background: rgba(255,255,255,0.08); color: var(--white); }
.aiw__project-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiw__project-item small { color: rgba(217,218,222,0.45); font-size: 0.72rem; flex: 0 0 auto; }

.aiw__sidebar-foot { padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.07); display: flex; flex-direction: column; gap: 2px; }
.aiw__user { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.aiw__user-avatar { color: var(--cyan); font-size: 0.6rem; }
.aiw__user-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1 1 auto; }
.aiw__user-name { font-size: 0.82rem; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiw__user-logout {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer;
  font-size: 0.68rem; letter-spacing: 0.04em; color: rgba(217,218,222,0.55);
  padding: 4px 6px; border-radius: 6px; transition: color 0.2s var(--ease-soft), background 0.2s var(--ease-soft);
}
.aiw__user-logout:hover { color: var(--white); background: rgba(255,255,255,0.06); }

/* ---------------- Auth gate ----------------
   Anonymous visitors explore everything read-only; this overlay only
   appears when a real action is attempted. Visual language matches the
   site's existing .project-modal (styles.css): blurred backdrop,
   charcoal card, same modalIn entrance — no new design language. */
.aiw__gate { position: absolute; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px; }
.aiw__gate[hidden] { display: none; }
.aiw__gate-backdrop { position: absolute; inset: 0; background: rgba(6,6,8,0.72); backdrop-filter: blur(6px); border: 0; padding: 0; cursor: pointer; }
.aiw__gate-panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(88vh, 640px);
  overflow-y: auto;
  background: var(--charcoal);
  border: 1px solid rgba(247,247,245,0.1);
  border-radius: 24px;
  padding: clamp(28px, 5vw, 40px);
  text-align: center;
  animation: aiwGateIn 0.4s var(--ease-out);
}
@keyframes aiwGateIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.aiw__gate-wordmark { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 12px; }
.aiw__gate-subtitle { font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--champagne); margin: 0 0 28px; }
.aiw__gate-actions { display: flex; flex-direction: column; gap: 12px; }
.aiw__gate-actions .btn { width: 100%; }
.aiw__gate-dismiss {
  display: block; margin: 20px auto 0; background: none; border: 0; cursor: pointer;
  font-size: 0.78rem; color: rgba(217,218,222,0.55); text-decoration: underline;
  text-underline-offset: 3px; transition: color 0.2s var(--ease-soft);
}
.aiw__gate-dismiss:hover { color: var(--white); }

.aiw__gate-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.aiw__gate-form[hidden] { display: none; }
.aiw__gate-form-title { font-size: 1.3rem; font-weight: 600; color: var(--white); text-align: center; margin: 0 0 6px; }
.aiw__gate-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; color: rgba(217,218,222,0.75); }
.aiw__gate-field input {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(247,247,245,0.16);
  border-radius: 10px; padding: 11px 13px; color: var(--white); font-size: 0.92rem;
  transition: border-color 0.25s var(--ease-soft), background 0.25s var(--ease-soft);
}
.aiw__gate-field input:focus { border-color: rgba(232,210,164,0.6); background: rgba(255,255,255,0.06); outline: none; }
.aiw__gate-form .btn { width: 100%; margin-top: 4px; }
.aiw__gate-switch, .aiw__gate-back {
  background: none; border: 0; cursor: pointer; text-align: center;
  font-size: 0.78rem; color: rgba(217,218,222,0.6); transition: color 0.2s var(--ease-soft);
}
.aiw__gate-switch:hover, .aiw__gate-back:hover { color: var(--white); }
.aiw__gate-note { font-size: 0.82rem; line-height: 1.5; color: rgba(217,218,222,0.82); margin: 0 0 18px; text-align: center; }
.aiw__gate-form .aiw__gate-note { text-align: left; margin: 0; }
.aiw__gate-note--small { font-size: 0.74rem; color: rgba(217,218,222,0.62); }
.aiw__gate-note a, .aiw__privacy-body a { color: var(--champagne-bright); text-decoration: underline; text-underline-offset: 3px; }
.aiw__gate-check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.78rem; line-height: 1.45; color: rgba(217,218,222,0.85); cursor: pointer; }
.aiw__gate-check input { flex: 0 0 auto; margin-top: 2px; width: 16px; height: 16px; accent-color: var(--champagne); cursor: pointer; }
.aiw__gate-check[hidden] { display: none; }
.aiw__gate-danger { background: #ff8a8a; color: #1a0808; }
.aiw__gate-danger:hover { background: #ffb0b0; }
.aiw__privacy { margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(217,218,222,0.12); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.aiw__privacy-title { font-size: 1rem; font-weight: 600; margin: 0; color: var(--white); }
.aiw__privacy-body { font-size: 0.85rem; line-height: 1.55; color: rgba(217,218,222,0.75); margin: 0; }
.aiw__gate-error { color: #ff8a8a; font-size: 0.8rem; text-align: center; margin: 0; min-height: 1.2em; }

/* ---------------- Main column ---------------- */
.aiw__main { position: relative; z-index: 10; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; height: 100%; }

.aiw__topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px 6px; min-height: 34px; }
.aiw__sidebar-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 30px; height: 30px; background: none; border: 0; cursor: pointer; padding: 0; }
.aiw__sidebar-toggle span { display: block; width: 100%; height: 1.5px; background: var(--white); border-radius: 1px; }
.aiw__topbar-project { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.aiw__topbar-project-name { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(247,247,245,0.75); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiw__topbar-project-meta { font-size: 0.68rem; letter-spacing: 0.02em; color: rgba(217,218,222,0.45); flex: 0 0 auto; }

/* justify-content: flex-end is "unsafe" alignment — once the
   conversation grows taller than the stage, content pushed past the
   start edge becomes unreachable by scrolling. `safe` falls back to
   start-alignment only in that overflow case, so the oldest message
   in a turn (e.g. the user's own bubble) never gets clipped off-screen. */
.aiw__stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: safe flex-end; overflow-y: auto; padding: 0 clamp(20px, 4vw, 56px); }
.aiw__stage::-webkit-scrollbar { width: 8px; }
.aiw__stage::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

/* Empty-state hero */
.aiw__hero { margin: auto 0; text-align: center; padding: 40px 0; }
.aiw__hero-logo {
  width: clamp(56px, 8vw, 84px);
  height: auto;
  margin: 0 auto 22px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.45));
}
.aiw__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: 0.01em;
  color: var(--white);
  margin: 0 0 10px;
}
.aiw__wordmark em { font-style: normal; color: var(--cyan); }
.aiw__tagline {
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--champagne);
  margin: 0 0 20px;
}
.aiw__question { font-size: clamp(1.05rem, 2vw, 1.35rem); color: rgba(247,247,245,0.88); margin: 0; }
[data-ai-workspace][data-ai-conversation] .aiw__hero { display: none; }

/* Library / Settings panels */
.aiw__library, .aiw__settings, .aiw__files, .aiw__explore { margin: auto 0; padding: 24px 0 40px; max-width: 720px; width: 100%; margin-left: auto; margin-right: auto; }
.aiw__panel-title { font-family: var(--font-display); font-size: 1.7rem; color: var(--white); margin: 0 0 6px; }
.aiw__panel-sub { font-size: 0.88rem; color: var(--platinum); margin: 0 0 22px; }
.aiw__library-section { margin-bottom: 26px; }
.aiw__library-section:last-child { margin-bottom: 0; }
.aiw__library-section-title { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(217,218,222,0.5); margin: 0 0 10px; }
.aiw__library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-items: start; }
.aiw__library-empty { color: rgba(217,218,222,0.6); font-size: 0.88rem; padding: 20px 0; }

/* ---------------- Conversation feed ---------------- */
/* No bubbles, no cards — text floats directly in the space over the
   background, exactly the "AI inside a creative space" brief. The
   user's own turn is differentiated only by right alignment, weight
   and a muted tone; OPTOPUS's own response is the visual protagonist:
   full-width, brighter, larger reading measure. */
.aiw__feed { display: flex; flex-direction: column-reverse; gap: 26px; padding: 24px 0; }
.aiw__feed[hidden] { display: none; }
.aiw__understanding { color: rgba(217,218,222,0.5); font-size: 0.82rem; font-style: italic; }
.aiw__response { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; width: 100%; max-width: min(100%, 680px); }
.aiw__plan-intro { color: rgba(247,247,245,0.6); font-size: 0.82rem; margin: 0; }
.aiw__demo-note { color: rgba(217,218,222,0.45); font-size: 0.76rem; margin: 0; }
.aiw__ready { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.aiw__ready p { margin: 0; font-size: 0.85rem; color: var(--platinum); }

/* User message — plain text, right-aligned, no bubble. This alignment
   + weight difference is the ONLY distinction from OPTOPUS's response. */
.aiw__msg--user {
  align-self: flex-end;
  max-width: min(80%, 640px);
  color: rgba(247,247,245,0.68);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.55;
  text-align: right;
}

/* AI-answers-only chat view: the user's own message is still created and
   appended to the feed by workspace-ui.js (handleGoal/handleFile/
   replayMessagesInto all still run exactly as before, so Gemini's
   server-side history, project/conversation persistence, memory and
   Recents are all untouched) — only the visual row is suppressed here.
   Remove this rule to bring user bubbles back. */
.aiw__msg--user { display: none; }

.aiw__history { display: flex; flex-direction: column; gap: 18px; }
/* The "Earlier in this project" label is exactly the kind of internal/
   technical framing the "final home layout" pass removes — past
   artifacts still replay as plain content (see section 7's "only show
   OPTOPUS AI's responses"), just without a header announcing them as
   a separate history section from the rest of the conversation. */
.aiw__history-label { display: none; }

/* ---------------- Progress indicator — small and elegant, no card ---------------- */
/* Replaces the old "working" card: a soft pulsing dot plus the step
   labels as plain inline text (current bright, done checked, pending
   dim) — floats above the composer with no background/border/blur. */
.aiw__command { display: flex; align-items: center; gap: 10px; padding: 4px 2px; margin-bottom: 4px; background: none; border: none; border-radius: 0; backdrop-filter: none; flex-wrap: wrap; }
.aiw__command[hidden] { display: none; }
.aiw__progress-pulse {
  flex: 0 0 auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: aiwPulse 1.3s ease-in-out infinite;
}
.aiw__progress-steps { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.78rem; }
.aiw__progress-step { color: rgba(217,218,222,0.38); transition: color 0.25s var(--ease-soft); }
.aiw__progress-step.is-active { color: var(--white); font-weight: 600; }
.aiw__progress-step.is-done { color: rgba(217,218,222,0.55); }
.aiw__progress-step.is-done::before { content: "✓ "; }
.aiw__progress-step.is-error { color: #ff9b9b; }
@keyframes aiwPulse { 0%, 100% { opacity: 0.4; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }

/* ---------------- Library artifact cards ---------------- */
/* Only the Library panel's browsing grid uses this card treatment now
   (see artifactCardLibrary() in workspace-ui.js) — the live
   conversation itself uses the bubble-less .aiw__turn styles further
   below. A collapsed, single-line summary row by default. */
.aiw__artifact {
  width: 100%;
  border-radius: 14px;
  background: rgba(19,19,22,0.5);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid rgba(255,255,255,0.09);
  overflow: hidden;
}
.aiw__artifact--primary { border-color: rgba(255,255,255,0.14); background: rgba(19,19,22,0.6); }

.aiw__artifact-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.aiw__artifact--primary .aiw__artifact-summary { padding: 16px 20px 12px; }

.aiw__artifact-icon {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: rgba(255,255,255,0.06);
  color: var(--cyan);
  font-size: 0.82rem;
}
.aiw__artifact--primary .aiw__artifact-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 1rem; }

.aiw__artifact-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aiw__artifact-title { font-size: 0.86rem; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiw__artifact--primary .aiw__artifact-title { font-size: 1.02rem; white-space: normal; }
.aiw__artifact-sub { display: flex; align-items: center; gap: 4px; font-size: 0.68rem; color: rgba(217,218,222,0.48); }
.aiw__artifact-cat { text-transform: uppercase; letter-spacing: 0.07em; }
.aiw__artifact-cat--marketing { color: var(--champagne); }
.aiw__artifact-cat--design { color: #c7b3ff; }
.aiw__artifact-cat--ai { color: var(--cyan); }

.aiw__artifact-badge { flex: 0 0 auto; font-size: 0.6rem; letter-spacing: 0.09em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.aiw__artifact-badge--demo { background: rgba(217,218,222,0.1); color: var(--platinum); border: 1px solid rgba(217,218,222,0.2); }
.aiw__artifact-badge--live { background: rgba(87,230,224,0.14); color: var(--cyan); border: 1px solid rgba(87,230,224,0.32); }

.aiw__artifact-chevron { flex: 0 0 auto; color: rgba(217,218,222,0.45); font-size: 0.72rem; transition: transform 0.2s var(--ease-soft); }
.aiw__artifact.is-expanded .aiw__artifact-chevron { transform: rotate(180deg); }

.aiw__artifact-body { padding: 0 20px 16px 52px; color: rgba(247,247,245,0.86); font-size: 0.88rem; line-height: 1.62; margin: 0; white-space: pre-wrap; }
.aiw__artifact-body[hidden] { display: none; }
.aiw__artifact:not(.aiw__artifact--primary) .aiw__artifact-body { padding: 0 14px 12px 46px; font-size: 0.84rem; }

/* Related outputs from the same compound response — a plain vertical
   sequence with a hairline divider between them, never a grid of tiles. */
.aiw__artifact-group { display: flex; flex-direction: column; gap: 18px; width: 100%; }
.aiw__artifact-group .aiw__turn { padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.06); }

.aiw__workflow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.aiw__workflow-node { padding: 7px 13px; border-radius: 999px; font-size: 0.78rem; border: 1px solid rgba(255,255,255,0.14); color: var(--white); background: rgba(255,255,255,0.04); }
.aiw__workflow-node--trigger { border-color: rgba(87,230,224,0.4); color: var(--cyan); }
.aiw__workflow-node--condition { border-color: rgba(232,210,164,0.4); color: var(--champagne); }
.aiw__workflow-node--schedule { border-color: rgba(155,107,255,0.4); color: #c7b3ff; }
.aiw__workflow-node--status { border-color: rgba(127,232,89,0.4); color: #9be87f; }

/* =========================================================
   THE CONVERSATION — bubble-less turns (brief: "menos UI, menos
   cajas... más tipografía, más espacio, más conversación"). No
   background, no border, no card — text floats directly over the
   scene. OPTOPUS's own response is the visual protagonist: brighter,
   full reading measure, generous line-height; the user's turn (see
   .aiw__msg--user above) is only right-aligned and a touch muted.
   ========================================================= */
.aiw__turn { width: 100%; }
.aiw__turn--secondary .aiw__turn-body { font-size: 0.92rem; color: rgba(247,247,245,0.78); }

.aiw__turn-body { color: rgba(247,247,245,0.94); font-size: 1rem; line-height: 1.72; }
.aiw__turn-p { margin: 0 0 16px; }
.aiw__turn-p:last-child { margin-bottom: 0; }
.aiw__turn-list { margin: 0 0 16px; padding-left: 1.3em; display: grid; gap: 6px; }
.aiw__turn-list:last-child { margin-bottom: 0; }
.aiw__turn-list li { line-height: 1.6; }
.aiw__turn-body code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  background: rgba(255,255,255,0.08);
  padding: 0.1em 0.4em;
  border-radius: 5px;
}
.aiw__turn-code {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(6,6,8,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
  max-width: 100%;
}
.aiw__turn-code code { background: none; padding: 0; font-size: 0.84rem; line-height: 1.55; color: rgba(247,247,245,0.9); }
.aiw__turn-body a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(87,230,224,0.4); text-underline-offset: 2px; }
.aiw__turn-body a:hover { text-decoration-color: currentColor; }
.aiw__turn-body strong { font-weight: 700; color: var(--white); }

/* Progressive reveal — a purely cosmetic stagger on an already-
   complete response (see appendContentBlocks() in workspace-ui.js);
   nothing about fetching/streaming changes. */
@keyframes aiwTurnIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.aiw__turn-in { animation: aiwTurnIn 0.4s var(--ease-soft) both; }
@media (prefers-reduced-motion: reduce) { .aiw__turn-in { animation: none; } }

/* Small, elegant LIVE/DEMO indicator — text + a dot, never a boxed
   badge — and the two controls the brief keeps: Copy, Download.
   Both stay low-opacity until the turn is hovered/focused so they
   read as discreet, not as a toolbar; always visible on touch, since
   hover doesn't exist there. */
.aiw__turn-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; opacity: 0.5; transition: opacity 0.25s var(--ease-soft); }
.aiw__turn:hover .aiw__turn-foot, .aiw__turn:focus-within .aiw__turn-foot { opacity: 1; }
@media (hover: none) { .aiw__turn-foot { opacity: 0.75; } }

.aiw__mode { display: inline-flex; align-items: center; gap: 6px; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(217,218,222,0.5); }
.aiw__mode-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.aiw__mode--live { color: var(--cyan); }
.aiw__mode--demo { color: rgba(217,218,222,0.45); }

.aiw__turn-actions { display: flex; gap: 12px; }
.aiw__turn-action { background: none; border: none; padding: 0; font-size: 0.72rem; color: rgba(217,218,222,0.6); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; transition: color 0.2s var(--ease-soft), text-decoration-color 0.2s var(--ease-soft); }
.aiw__turn-action:hover { color: var(--white); text-decoration-color: rgba(255,255,255,0.35); }

/* ---------------- Artifact visual result (Image/Video demo) ---------------- */
.aiw__artifact-visual { display: block; width: 100%; max-width: 420px; border-radius: 12px; margin: 0 0 10px; border: 1px solid rgba(255,255,255,0.1); }
.aiw__artifact-actions { display: flex; gap: 6px 10px; flex-wrap: wrap; margin: 10px 20px 4px 52px; }
.aiw__artifact:not(.aiw__artifact--primary) .aiw__artifact-actions { margin-left: 46px; }
.aiw__artifact-action {
  font-size: 0.72rem;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  color: rgba(247,247,245,0.75);
  cursor: pointer;
  transition: background 0.2s var(--ease-soft), color 0.2s var(--ease-soft);
}
.aiw__artifact-action:hover { background: rgba(255,255,255,0.09); color: var(--white); }
.aiw__artifact-action--danger:hover { color: #ff9b9b; border-color: rgba(255,155,155,0.4); }

/* ---------------- Code-site artifact (file tree / viewer / preview) ---------------- */
.aiw__code { width: 100%; }
.aiw__code-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.aiw__code-tab {
  font-size: 0.76rem;
  padding: 6px 12px;
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom: none;
  background: rgba(255,255,255,0.03);
  color: rgba(247,247,245,0.7);
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
}
.aiw__code-tab.is-active { background: rgba(255,255,255,0.09); color: var(--white); }
.aiw__code-view {
  background: rgba(6,6,8,0.55);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0 10px 10px 10px;
  padding: 14px 16px;
  max-height: 260px;
  overflow: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(247,247,245,0.88);
  white-space: pre;
}
.aiw__code-view[hidden] { display: none; }
.aiw__code-preview-toggle { margin-top: 10px; }
.aiw__code-preview-frame {
  width: 100%;
  height: 340px;
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: #fff;
}
.aiw__code-preview-frame[hidden] { display: none; }

/* ---------------- Error row ---------------- */
.aiw__error { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: rgba(255,90,90,0.08); border: 1px solid rgba(255,120,120,0.25); max-width: min(100%, 760px); }
.aiw__error-title { margin: 0; font-size: 0.88rem; font-weight: 600; color: #ffb4b4; }
.aiw__error-body { margin: 0; font-size: 0.82rem; color: rgba(247,247,245,0.75); }

/* ---------------- Cancel control ---------------- */
.aiw__cancel { flex: 0 0 auto; font-size: 0.76rem; padding: 0; border: none; background: none; color: rgba(217,218,222,0.5); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; transition: color 0.2s var(--ease-soft), text-decoration-color 0.2s var(--ease-soft); }
.aiw__cancel:hover { color: var(--white); text-decoration-color: rgba(255,255,255,0.35); }

/* ---------------- Panels: Files / Memory / Explore (reuse Library's shell) ---------------- */
.aiw__panel-empty { color: rgba(217,218,222,0.5); font-size: 0.88rem; }
.aiw__files-list { display: grid; gap: 10px; max-width: 640px; }
.aiw__files-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: rgba(19,19,22,0.5); border: 1px solid rgba(255,255,255,0.08); }
.aiw__files-name { flex: 1 1 auto; font-size: 0.86rem; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aiw__files-meta { font-size: 0.72rem; color: rgba(217,218,222,0.5); flex: 0 0 auto; }

.aiw__memory-section { margin-top: 24px; max-width: 640px; }
.aiw__memory-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(19,19,22,0.45); border: 1px solid rgba(255,255,255,0.08); margin-bottom: 8px; }
.aiw__memory-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(217,218,222,0.5); flex: 0 0 90px; }
.aiw__memory-value { flex: 1 1 auto; font-size: 0.86rem; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.aiw__explore-group { margin-bottom: 26px; }
.aiw__explore-group-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(217,218,222,0.5); margin-bottom: 10px; }
.aiw__explore-prompts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------- Project row actions (rename/delete) ---------------- */
.aiw__project-item { position: relative; }
.aiw__project-item-main { all: unset; display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.aiw__project-item-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Always present and always clickable — a hover-only reveal here was
   unreliable (the actions could fail to appear/hit-test correctly
   depending on exactly how the pointer arrived), which read as "I
   click X and nothing happens." Low opacity by default, full on
   hover/focus of the row or the buttons themselves, so it never
   depends on hover timing to actually be clickable. */
.aiw__project-item-actions { display: flex; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); gap: 4px; opacity: 0.55; transition: opacity 0.2s var(--ease-soft); }
.aiw__project-item:hover .aiw__project-item-actions,
.aiw__project-item:focus-within .aiw__project-item-actions,
.aiw__project-item-actions:hover { opacity: 1; }
.aiw__project-item-action { font-size: 0.68rem; padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.16); background: rgba(8,8,10,0.85); color: rgba(217,218,222,0.8); cursor: pointer; }
.aiw__project-item-action:hover { color: var(--white); border-color: rgba(255,255,255,0.35); }
/* The main row button's own padding/width made room for these two
   icons before they were always visible — nothing to adjust there,
   but keep the label from ever running underneath them. */
.aiw__project-item-main { padding-right: 52px; }

/* ---------------- Composer ---------------- */
.aiw__composer { position: relative; z-index: 10; padding: 10px clamp(20px, 4vw, 56px) 22px; display: flex; flex-direction: column; gap: 10px; }

.aiw__quickstarts { display: flex; flex-wrap: wrap; gap: 8px; }
.aiw__quickstarts[hidden] { display: none; }
.aiw__quickstarts .ai-option {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(247,247,245,0.85);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s var(--ease-soft), border-color 0.2s var(--ease-soft);
}
.aiw__quickstarts .ai-option:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.26); }

/* Once a conversation is active, quick actions become a secondary,
   contextual strip — a single scrollable row instead of a full grid,
   so the composer and conversation stay the primary focus. */
[data-ai-conversation] .aiw__quickstarts { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
[data-ai-conversation] .aiw__quickstarts .ai-option { flex: 0 0 auto; padding: 5px 12px; font-size: 0.74rem; }
[data-ai-conversation] .aiw__quickstarts::-webkit-scrollbar { height: 4px; }
[data-ai-conversation] .aiw__quickstarts::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.aiw__form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 8px;
  border-radius: 20px;
  background: rgba(19,19,22,0.62);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  transition: border-color 0.25s var(--ease-soft);
}
.aiw__form:focus-within { border-color: rgba(87,230,224,0.45); }
.aiw__attach-wrap { position: relative; flex: 0 0 auto; }
.aiw__attach {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s var(--ease-soft);
}
.aiw__attach:hover { background: rgba(255,255,255,0.1); }

/* Floating "+" menu — small, anchored to the button, never a fixed
   panel below the composer. Same visual language as the rest of
   OPTOPUS AI's floating surfaces (.aiw__disabled-notice): dark
   translucent card, subtle border, light blur, soft shadow. */
.aiw__attach-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  max-width: min(240px, calc(100vw - 40px));
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(20,20,24,0.85);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  animation: aiwAttachMenuIn 0.16s var(--ease-out);
}
.aiw__attach-menu[hidden] { display: none; }
@keyframes aiwAttachMenuIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.aiw__attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--platinum);
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease-soft), color 0.15s var(--ease-soft);
}
.aiw__attach-item:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.aiw__attach-icon { font-size: 1rem; line-height: 1; flex: 0 0 auto; }
.aiw__attach-badge {
  margin-left: auto;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(217,218,222,0.5);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 2px 7px;
  flex: 0 0 auto;
}

/* Pending attachment — a small removable chip shown above the input
   once a file/image/document/video is selected, cleared on send or on
   explicit removal. Never a fixed panel, never full-width. */
.aiw__attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.aiw__attachments[hidden] { display: none; }
.aiw__attachment-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  font-size: 0.78rem;
  color: var(--platinum);
}
.aiw__attachment-thumb { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; flex: 0 0 auto; }
.aiw__attachment-icon { font-size: 0.95rem; flex: 0 0 auto; }
.aiw__attachment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.aiw__attachment-badge {
  flex: 0 0 auto;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(217,218,222,0.5);
}
.aiw__attachment-remove {
  flex: 0 0 auto;
  background: none;
  border: 0;
  color: rgba(217,218,222,0.6);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px;
  line-height: 1;
  transition: color 0.15s var(--ease-soft);
}
.aiw__attachment-remove:hover { color: var(--white); }

.aiw__form input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--white);
  font-size: 0.98rem;
  padding: 10px 4px;
}
.aiw__form input::placeholder { color: rgba(217,218,222,0.55); }
.aiw__send {
  flex: 0 0 auto;
  padding: 11px 22px;
  border-radius: 14px;
  border: 0;
  background: var(--white);
  color: var(--black);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease-soft), transform 0.2s var(--ease-soft);
}
.aiw__send:hover { background: var(--cyan); }
.aiw__send:active { transform: scale(0.97); }

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .aiw *, .aiw *::before, .aiw *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .aiw__sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 40;
    padding-top: calc(var(--header-h) + 10px);
    transform: translateX(-100%);
    transition: transform 0.32s var(--ease-out);
    box-shadow: 30px 0 60px rgba(0,0,0,0.4);
  }
  .aiw__sidebar.is-open { transform: translateX(0); }
  .aiw__sidebar-close { display: block; }
  .aiw__scrim.is-visible { opacity: 1; pointer-events: auto; }
  .aiw__sidebar-toggle { display: flex; }
  .aiw__topbar { padding: 10px 16px 4px; }
  .aiw__stage { padding: 0 16px; }
  .aiw__composer { padding: 8px 12px 16px; }
  .aiw__library-grid { grid-template-columns: 1fr; }
  .aiw__bg-img { object-position: 62% 30%; }

  /* Recents becomes a small collapsible section on mobile, opened via
     the topbar's "Recents" toggle (data-ai-recents-toggle), instead of
     the always-visible floating rail desktop gets. */
  .aiw__recents-toggle {
    display: block;
    all: unset;
    cursor: pointer;
    margin-left: auto;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(217,218,222,0.6);
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
  }
  .aiw__recents-toggle[aria-expanded="true"] { color: var(--white); border-color: rgba(255,255,255,0.35); }
  .aiw__recents-rail {
    position: static;
    width: auto;
    max-height: 0;
    overflow: hidden;
    margin: 0 0 0;
    padding: 0 12px;
    border-width: 0;
    opacity: 0;
    transition: max-height 0.3s var(--ease-soft), opacity 0.25s var(--ease-soft), padding 0.3s var(--ease-soft), margin 0.3s var(--ease-soft);
  }
  .aiw__recents-rail.is-open {
    max-height: 260px;
    opacity: 1;
    padding: 12px;
    margin: 0 16px 8px;
    border-width: 1px;
  }
}

@media (max-width: 520px) {
  .aiw__wordmark { font-size: 2.3rem; }
  .aiw__question { font-size: 1rem; }
  .aiw__form input { font-size: 0.92rem; }
  .aiw__send { padding: 10px 16px; }
  .aiw__turn-body { font-size: 0.95rem; line-height: 1.66; }
  .aiw__msg--user { max-width: 88%; font-size: 0.9rem; }
  .aiw__response, .aiw__error { max-width: 100%; }
}
