/* public/css/composer-shared.css — Phase 2 of the refactor (REFACTOR_PLAN.md §7).
   Copied verbatim from public/dashboard-v2.css lines 5623..5841.
   Loaded by BOTH dashboard-v2.html (home empty-state) AND
   dashboard-v2-page.html (builder). Per CLAUDE.md's
   "two-pages-one-stylesheet" rule, builder-specific overrides nest
   under .builder-shell--centered and home-only overrides nest under
   body.is-empty-dash — both patterns are already inline in the block
   below. */

/* ============================================================================
   SHARED CHAT-COMPOSER CLASSES — read before editing.

   The classes below (.builder-input-box, .builder-input-textarea,
   .builder-input-bar, .builder-input-action, .builder-input-send,
   .builder-input-mic, .builder-input-more, .builder-input-map,
   .builder-suggestion-row, .builder-suggestion-chip) are used on TWO
   different pages:

     Home  — /dashboard-v2.html, body.is-empty-dash (empty-state hero)
     Builder — /dashboard-v2-page.html, body.is-builder-chat,
                rendered inside .builder-shell--centered

   Convention to prevent home <-> builder bleed:
     - Base rules in this section = HOME PAGE defaults.
     - Builder-only overrides MUST nest under .builder-shell--centered,
       e.g. `.builder-shell--centered .builder-input-box { ... }`.
     - Home-only overrides MUST nest under body.is-empty-dash, e.g.
       `body.is-empty-dash .builder-input-textarea { ... }`.
     - NEVER add an unscoped rule that changes colour, border, or
       padding for builder-specific reasons — it WILL break the home
       composer too (it has happened many times: topbar bleed, chat-box
       white-vs-cream-2 bleed, hairline border drop, etc.).

   When in doubt, check both pages before pushing.
   ============================================================================ */
.builder-input-box {
  /* Base = white (var(--paper)) — that's the home-page chat composer's
     original colour. AI-builder override below (.builder-shell--centered
     .builder-input-box) bumps it to var(--topband) + border: 0 to match
     the sidebar inside the builder context only.
     Founder 2026-05-22: home composer needs its original hairline border
     back — without it the white-on-cream box has no defined edge. */
  background: var(--paper);
  border: 1px solid rgba(31, 22, 17, 0.14);
  border-radius: 24px;
  padding: 18px 16px 12px;
  box-shadow: 0 2px 8px -4px rgba(31, 22, 17, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}
/* Hard-locked widths — the dashboard's flex column ancestors keep
   collapsing the chat surface to its content otherwise. */
.builder-shell--centered .builder-input-box,
.builder-shell--centered .builder-chat-body {
  width: 100% !important;
  /* Widen the chat surface so messages reach closer to the screen edges
     (Lovable's pattern — founder reference 2026-05-22). Was 820px which
     left a lot of cream gutter on mobile + desktop. */
  max-width: 980px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}
/* Input box: hard-fixed width so it doesn't track the chat-body's
   content width (which can swell when a form-card or build message
   lands, making the bar visibly widen and contract as messages
   arrive). align-self: center pins it to the column centre. */
.builder-shell--centered .builder-input-box {
  flex-shrink: 0 !important;
  align-self: center !important;
  width: min(720px, 100%) !important;
  /* Founder 2026-05-30: visual styling moved to builder-mobile.css
     so there's ONE source of truth for the composer's cream
     surface + 28px radius + no-shadow. This rule only carries the
     layout properties. */
}
.builder-shell--centered .builder-chat-body {
  align-self: stretch !important;
  flex-shrink: 1 !important;
  min-height: 0 !important;
}
.builder-input-textarea {
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  /* 2026-05-29 founder: was 0.75rem (12px) — too small for the
     placeholder to read as a premium composer (Lovable's sits at ~16px).
     Mobile overrides to 16px @ line 11186; this is the desktop/fallback. */
  font-size: 1rem;
  line-height: 1.45;
  resize: none;
  min-height: 32px;
  max-height: 240px;
  color: var(--ink);
  padding: 4px 4px 4px;
  width: 100%;
  overflow-y: auto;
  -webkit-appearance: none;
  appearance: none;
}
.builder-input-textarea::-webkit-scrollbar { width: 4px; }
.builder-input-textarea::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 2px; }
.builder-input-textarea::placeholder { color: var(--ink-faint); }
/* 2026-05-22: Lovable-style chat bar — symmetric icon row split into
   left (+ ...) and right (map mic send) clusters. All ghost buttons
   share one 34px squircle treatment so the row reads as one band; the
   send button stays a filled ink disc as the primary action signal. */
.builder-input-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 0;
  gap: 8px;
}
.builder-input-bar__left,
.builder-input-bar__right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* 3D-gradient squircle — shared style for +, ..., map, mic.
   Founder 2026-05-30: keep 34px square dims + 10px radius, but
   apply the 3D gradient pattern from /sandbox (white→cream gradient
   + inset highlight + soft drop shadow) so the buttons feel
   tactile instead of flat ghost outlines. */
.builder-input-action,
.builder-input-more,
.builder-input-map,
.builder-input-mic {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
  border: 1px solid rgba(31, 22, 17, 0.10);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(31, 22, 17, 0.04),
    0 1px 2px rgba(31, 22, 17, 0.06),
    0 2px 6px -2px rgba(31, 22, 17, 0.08);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.builder-input-action:hover:not(:disabled),
.builder-input-more:hover:not(:disabled),
.builder-input-map:hover:not(:disabled),
.builder-input-mic:hover:not(:disabled) {
  background: linear-gradient(180deg, #FFFFFF 0%, #EAEAEA 100%);
  border-color: rgba(31, 22, 17, 0.18);
  transform: translateY(-1px);
}
.builder-input-action:disabled,
.builder-input-more:disabled,
.builder-input-map:disabled,
.builder-input-mic:disabled { opacity: 0.55; cursor: not-allowed; }
/* Primary send — dark filled disc, sits in the right cluster. */
.builder-input-send {
  background: linear-gradient(180deg, #2A211B 0%, #1F1611 100%);
  color: var(--cream, #FAFAFA);
  border: 1px solid rgba(0, 0, 0, 0.55);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 2px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    0 4px 10px -2px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
}
.builder-input-send:hover:not(:disabled) {
  background: linear-gradient(180deg, #332923 0%, #241B16 100%);
  transform: translateY(-1px);
}
.builder-input-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* === Suggestion chip row (Claude's "Code / Learn / Strategize" pattern) === */
.builder-suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 18px auto 0;
  max-width: 720px;
}
.builder-suggestion-chip {
  background: var(--paper, #fff);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  /* 2026-05-29 founder: was 0.85rem (~13.6px); bumped to 0.92rem (~14.7px)
     so the in-chat suggestion chips read as primary affordances and stop
     feeling like footnotes vs the AI's own reply text. */
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: 1;
  appearance: none;
  -webkit-appearance: none;
  transition: opacity 0.32s ease, background 0.18s, border-color 0.18s, transform 0.15s;
}
.builder-suggestion-chip:hover {
  background: var(--cream-2);
  border-color: var(--ink-mute);
}
.builder-suggestion-chip:active { transform: translateY(0.5px); }
.builder-suggestion-chip:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.builder-suggestion-chip svg { color: var(--ink-mute); flex-shrink: 0; }
