/* Shared styles for the conversational portfolio ------------------------------ */

/* The Tailwind Play CDN emits utility classes as normal author CSS, so a
   display-setting utility (flex, inline-flex, block…) on the SAME element beats
   the browser's built-in `[hidden]{display:none}` rule on a specificity tie —
   author styles always outrank user-agent styles. Force it so `el.hidden = true`
   (used to gate the onboarding screen / chat, and the role-option badges) is
   reliable everywhere, regardless of what other classes an element carries. */
[hidden] {
  display: none !important;
}

/* Tooltips — [data-tooltip] on any icon-only button/link shows its label on
   hover/focus. Default placement is above, centered; [data-tooltip-side]
   overrides to "right" (the collapsed sidebar rail, where the icon sits at
   the left edge and a right-flyout is the only side with room) or "bottom"
   (elements near the top of the viewport, e.g. the mobile drawer's close X).
   [data-tooltip-gated] additionally hides the tooltip while the sidebar is
   expanded, since the row already shows a text label then. */
/* :not(.absolute) — some tooltip hosts (index.html's mic/send buttons,
   the mobile menu's close X) are already Tailwind `.absolute`, positioned
   via inset-y/top/right utilities against an ancestor. Forcing `relative`
   here has equal specificity to `.absolute` and, now that tailwind.css
   loads before this file, wins the cascade tie — knocking them out of
   absolute positioning entirely. `absolute` already establishes its own
   positioning context for the tooltip's `::after`, so it doesn't need this. */
[data-tooltip]:not(.absolute) {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  white-space: nowrap;
  background: #1a1a2e;
  color: #fff;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  padding: 5px 9px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 70;
}
[data-tooltip][data-tooltip-side="right"]::after {
  left: calc(100% + 10px);
  bottom: auto;
  top: 50%;
  transform: translate(-4px, -50%);
}
[data-tooltip][data-tooltip-side="bottom"]::after {
  left: 50%;
  bottom: auto;
  top: calc(100% + 8px);
  transform: translate(-50%, -4px);
}
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 0.35s; /* a brief pause before showing; hiding stays instant */
}
[data-tooltip][data-tooltip-side="right"]:focus-visible::after {
  transform: translate(0, -50%);
}
/* Hover tooltips only where hover is real. On touch screens :hover sticks to
   the last-tapped element until something else is tapped — tapping the mobile
   drawer's X left its "Close menu" tooltip showing, and once the drawer slid
   off-screen the tooltip's edge poked back in as a dark sliver at the left. */
@media (hover: hover) {
  [data-tooltip]:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
    transition-delay: 0.35s;
  }
  [data-tooltip][data-tooltip-side="right"]:hover::after {
    transform: translate(0, -50%);
  }
}
/* Rows that already show a text label once the sidebar is expanded —
   suppress the (redundant) tooltip until it collapses back to icons only. */
html:not([data-sidebar="collapsed"]) [data-tooltip-gated]::after {
  content: none;
}

body {
  background-color: #f9f9ff;
  color: #151c27;
}

/* Home's body is h-screen (100vh) with the chat scrolling inside it. On iOS
   Safari 100vh is the height *with the toolbar hidden*, so the chat area ran
   ~90px under Safari's bottom bar while the fixed input bar sits at the visible
   bottom — short conversations ended up with zero scroll range and the latest
   chips stuck behind the input. dvh tracks the visible area; vh stays as the
   fallback for browsers without dvh. */
body[data-page="home"] {
  height: 100vh;
  height: 100dvh;
}

/* Scrollable chat canvas -------------------------------------------------------*/
.chat-container {
  scroll-behavior: smooth;
}
.chat-container::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

/* Glassmorphic surface -------------------------------------------------------- */
.glass-panel {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Typing indicator ---------------------------------------------------------- */
.typing-indicator span {
  animation: blink 1.4s infinite both;
  height: 6px;
  width: 6px;
  background-color: #444748;
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%   { opacity: 0.2; transform: scale(0.8); }
  20%  { opacity: 1;   transform: scale(1); }
  100% { opacity: 0.2; transform: scale(0.8); }
}

/* Message entrance --------------------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-in { animation: fadeInUp 0.45s ease-out forwards; }

/* Keep a scrolled-to message clear of any fixed top bar */
#chat-canvas > * { scroll-margin-top: 5rem; }

/* Prose defaults inside assistant bubbles -------------------------------- */
/* A bubble is a flex item: without min-width:0 a long unbreakable string (a
   URL, an email) stretches it past the others and off the right edge on a phone. */
.bubble-prose { min-width: 0; }
.bubble-prose a { overflow-wrap: anywhere; }
.bubble-prose p { margin-bottom: 0.75rem; }
.bubble-prose p:last-child { margin-bottom: 0; }
.bubble-prose strong { font-weight: 600; color: #151c27; }
.bubble-prose ul { margin: 0.25rem 0 0.75rem; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.bubble-prose li { position: relative; padding-left: 1.1rem; }
.bubble-prose li::before {
  content: "";
  position: absolute; left: 0; top: 0.55em;
  width: 5px; height: 5px; border-radius: 9999px;
  background-color: #4648d4;
}
/* Numbered lists: same rhythm as the dotted ones, with the dot swapped for
   the step number. */
.bubble-prose ol { margin: 0.25rem 0 0.75rem; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; counter-reset: bubble-step; }
.bubble-prose ol > li { padding-left: 1.5rem; counter-increment: bubble-step; }
.bubble-prose ol > li::before {
  content: counter(bubble-step) ".";
  top: 0; width: auto; height: auto; border-radius: 0;
  background-color: transparent;
  color: #4648d4; font-weight: 600;
}
.bubble-prose .callout {
  border-left: 3px solid #4648d4;
  background: #f0f3ff;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  font-style: italic;
  color: #2f2ebe;
  margin: 0.25rem 0 0.75rem;
}

/* Quick-reply pill spent state ----------------------------------------------- */
.quick-reply-btn.is-spent {
  opacity: 0.4;
  pointer-events: none;
}

.pb-safe { padding-bottom: env(safe-area-inset-bottom, 1rem); }

/* Horizontal carousel — hide the scrollbar, keep the scroll */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Horizontal carousel — thin, always-visible scrollbar (Maria's Persona /
   TIM Prototypes) so it reads as scrollable instead of hiding the affordance. */
.carousel-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 99, 238, 0.4) transparent;
}
.carousel-scrollbar::-webkit-scrollbar { height: 6px; }
.carousel-scrollbar::-webkit-scrollbar-track { background: transparent; }
.carousel-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(96, 99, 238, 0.4);
  border-radius: 9999px;
}
.carousel-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(96, 99, 238, 0.6);
}

/* Previous / next arrows on the Home project carousel (assets/home.js).
   Shown on hover with a mouse; hidden on touch screens, where swiping works. */
.carousel-arrow {
  position: absolute;
  top: calc(50% - 26px);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #4648d4;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.carousel-arrow--prev { left: 0.5rem; }
.carousel-arrow--next { right: 0.5rem; }
.carousel-arrow[hidden] { display: none; }
[data-carousel]:hover .carousel-arrow,
.carousel-arrow:focus-visible { opacity: 1; }
.carousel-arrow:hover { transform: scale(1.06); }
@media (hover: none) {
  .carousel-arrow { display: none; }
}

/* Inline quick-reply cluster sits under the last assistant message */
#inline-chips { scroll-margin-bottom: 1rem; }

/* Voice dictation — active listening state on the mic button */
#mic-btn.is-listening { color: #ba1a1a; animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Sidebar active item — driven by <body data-page>, no JS, no navigation flash */
body[data-page="home"]   [data-nav="home"],
body[data-page="raizen"] [data-nav="raizen"],
body[data-page="tim"]    [data-nav="tim"],
body[data-page="kyc"]    [data-nav="kyc"],
body[data-page="about"]  [data-nav="about"] {
  background-color: #6063ee;   /* secondary-container */
  color: #fffbff;              /* on-secondary-container */
  font-weight: 500;
}
body[data-page="home"]   [data-nav="home"]   .material-symbols-outlined,
body[data-page="raizen"] [data-nav="raizen"] .material-symbols-outlined,
body[data-page="tim"]    [data-nav="tim"]    .material-symbols-outlined,
body[data-page="kyc"]    [data-nav="kyc"]    .material-symbols-outlined,
body[data-page="about"]  [data-nav="about"]  .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* Dark-mode switch in the aside */
[data-theme-toggle] {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #c4c7c7;
  transition: background 0.2s ease;
}
[data-theme-toggle]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s ease;
}
[data-theme-toggle][aria-checked="true"] {
  background: #6063ee;
}
[data-theme-toggle][aria-checked="true"]::after {
  transform: translateX(18px);
}

/* Dark theme — aside + page chrome */
html.dark {
  color-scheme: dark;
}
html.dark body {
  background-color: #151a24;
  color: #ebf1ff;
}
html.dark aside[data-sidebar-panel] {
  background-color: #1c2330;
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark aside[data-sidebar-panel] h2,
html.dark aside[data-sidebar-panel] .text-primary,
html.dark aside[data-sidebar-panel] .text-on-surface {
  color: #ebf1ff;
}
html.dark aside[data-sidebar-panel] .text-on-surface-variant {
  color: #b8bec9;
}
html.dark aside[data-sidebar-panel] .hover\:bg-surface-variant:hover {
  background-color: rgba(255, 255, 255, 0.06);
}
html.dark aside[data-new-chat] {
  background-color: #ebf1ff;
  color: #151c27;
}
html.dark aside[data-new-chat]:hover {
  background-color: #ffffff;
}
html.dark aside .bg-surface-container-lowest {
  background-color: #151a24;
}
html.dark aside .border-outline-variant\/40,
html.dark aside .border-outline-variant\/20 {
  border-color: rgba(255, 255, 255, 0.12);
}
html.dark main,
html.dark .bg-surface-container-lowest,
html.dark .bg-background {
  background-color: #151a24;
}
html.dark .bg-surface,
html.dark .bg-surface-container-low {
  background-color: #1c2330;
  color: #ebf1ff;
}
html.dark .text-on-surface,
html.dark .text-on-background {
  color: #ebf1ff;
}
html.dark .text-on-surface-variant,
html.dark .text-outline {
  color: #b8bec9;
}
html.dark header {
  background-color: rgba(21, 26, 36, 0.9);
}

/* Dark theme — user message bubbles (bg-surface-variant + rounded-tr-sm is unique to them) */
html.dark .bg-surface-variant.rounded-tr-sm {
  background-color: #6063EE;
  border-color: #6063EE;
  color: #FFFFFF;
}

/* Dark theme — assistant message bubbles stay white/light (unlike the rest
   of the dark surface), matching how they already look on the page background.
   Covers both bubble variants used across the site: the JS-rendered ones
   (bg-surface) and the Home Chat static greeting (bg-surface-container-low). */
html.dark .bg-surface.rounded-tl-sm,
html.dark .bg-surface-container-low.rounded-tl-sm {
  background-color: #ffffff;
  color: #151c27;
  border-color: rgba(0, 0, 0, 0.08);
}
/* Some bubbles (e.g. the onboarding Executive Summary card) nest their own
   text-on-surface/-variant elements, which are styled light-on-dark by the
   rules above for the rest of the app. Re-darken them specifically inside a
   white bubble so they don't wash out against it. */
html.dark .bg-surface.rounded-tl-sm .text-on-surface,
html.dark .bg-surface-container-low.rounded-tl-sm .text-on-surface {
  color: #151c27;
}
html.dark .bg-surface.rounded-tl-sm .text-on-surface-variant,
html.dark .bg-surface-container-low.rounded-tl-sm .text-on-surface-variant {
  color: #444748;
}

/* Dark theme — the case-study hero card's info panel (title/blurb/meta under
   the ad image, Raízen + TIM) stays on a white panel like the rest of the
   hero card, instead of the shared dark-surface tone. */
html.dark [data-hero-panel] {
  background-color: #ffffff;
}

/* Dark theme — the TIM Prototypes carousel cards stay white too, so their
   (already-darkened, since they sit inside a white bubble) title/description
   text doesn't go dark-on-dark against the shared dark-surface card color. */
html.dark [data-proto-card] {
  background-color: #ffffff;
}

/* Dark theme — Raízen's Maria's Persona carousel cards stay white too, for
   the same reason as the Prototypes cards above. */
html.dark [data-persona-card] {
  background-color: #ffffff;
}

/* Dark theme — any other card nested in a white bubble (the About role cards,
   and whatever comes next) stays white as well, so its already-darkened text
   never lands on the shared dark-surface colour. */
html.dark .bg-surface.rounded-tl-sm .bg-surface-container-lowest,
html.dark .bg-surface-container-low.rounded-tl-sm .bg-surface-container-lowest {
  background-color: #ffffff;
}

/* Dark theme — stat tiles (Results response, etc.) inside a white bubble
   keep their light-mode lavender tone instead of the shared dark-surface
   color, so their (already-darkened) numbers/labels stay legible. */
html.dark .bg-surface.rounded-tl-sm .bg-surface-container-low {
  background-color: #f0f3ff;
}

/* Dark theme — the "Show me your chatbot designs" project cards (Raízen /
   TIM carousel) stay on a white card too; their title/description need dark
   text to stay readable against it instead of the shared light-on-dark tone. */
html.dark [data-project-card] {
  background-color: #ffffff;
}
html.dark [data-project-card] h3 {
  color: #151c27;
}
html.dark [data-project-card] p {
  color: #444748;
}

/* Dark theme — floating input footer bar, scroll-fade gradient, and the input pill */
html.dark .bg-surface\/90,
html.dark .bg-surface\/95 {
  background-color: rgba(21, 26, 36, 0.92);
}
/* #chat-fade (bottom) and #chat-fade-top share the same Tailwind gradient
   classes but face opposite directions — scoped by id so this override
   doesn't flip #chat-fade-top's direction too. */
html.dark #chat-fade.from-surface-container-lowest.to-transparent {
  background-image: linear-gradient(to top, #151a24 0%, rgba(21, 26, 36, 0.85) 42%, transparent 100%);
}
html.dark #chat-fade-top.from-surface-container-lowest.to-transparent {
  background-image: linear-gradient(to bottom, #151a24 0%, rgba(21, 26, 36, 0.85) 42%, transparent 100%);
}
html.dark .border-surface-variant {
  border-color: rgba(255, 255, 255, 0.1);
}
html.dark #chat-input {
  border-color: rgba(255, 255, 255, 0.14);
}
html.dark #chat-input::placeholder {
  color: rgba(235, 241, 255, 0.45);
}

/* Dark theme — quick-reply chips stay white (indigo text/border, like light mode) */
html.dark button.quick-reply-btn {
  background-color: #FFFFFF;
}

/* Navigation Menu dropdown items — drop native button chrome so background renders */
[data-menu-item] {
  -webkit-appearance: none;
  appearance: none;
}
/* Dark theme — only the hovered item takes the user-bubble colour */
html.dark div[data-menu-dropdown] button[data-menu-item]:hover {
  background-color: #6063EE;
  color: #FFFFFF;
}

/* Onboarding — role-tailoring option rows (index.html #onboarding) */
.role-option {
  transition: border-color 0.15s ease, background-color 0.15s ease;
  background-color: transparent;
}
.role-option:not(.is-selected):hover {
  border-color: rgba(96, 99, 238, 0.5);
  background-color: rgba(96, 99, 238, 0.05);
}
.role-option.is-selected {
  border-color: #6063EE;
  background-color: rgba(96, 99, 238, 0.08);
}
html.dark .role-option.is-selected {
  background-color: rgba(96, 99, 238, 0.18);
}

/* Onboarding — the chat starts only after the privacy box is ticked. */
#role-cta[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
#role-cta[aria-disabled="true"]:active { transform: none; }
.consent-row { padding: 6px 8px; margin: -6px -8px; transition: background-color 0.2s ease; }
.consent-row.consent-nudge {
  background-color: rgba(186, 26, 26, 0.08);
  animation: consent-shake 0.4s ease;
}
html.dark .consent-row.consent-nudge { background-color: rgba(255, 180, 171, 0.12); }
.consent-hint { color: #ba1a1a; margin-top: -4px; }
html.dark .consent-hint { color: #ffb4ab; }
@keyframes consent-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .consent-row.consent-nudge { animation: none; }
}

/* Onboarding — sidebar reveal (index.html only). The sidebar starts hidden
   (baked into the static markup as .sidebar-hidden, so there's no flash of it
   before onboarding.js runs), then slides in from the left and fades to 100%
   once the visitor picks a role; the main column's margin animates in step so
   it looks like the sidebar pushes the content over as it opens. */
aside[data-sidebar-panel] {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease,
    width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
aside[data-sidebar-panel].sidebar-hidden {
  opacity: 0 !important;
  transform: translateX(-100%) !important;
  pointer-events: none !important;
}
main {
  transition: margin-left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
main.onboarding-active {
  margin-left: 0 !important;
  /* pt-16 clears the fixed mobile header, but that header stays display:none
     until the chat actually starts (revealSidebar() in onboarding.js) — during
     onboarding it's dead space with nothing to clear, pushing the role-picker
     down for no reason. */
  padding-top: 0 !important;
}

/* Sidebar collapse (all pages) — icon-only rail vs. full width. Driven by
   html[data-sidebar="collapsed"], set early in <head> from localStorage so
   there's no flash of the wrong width on load, and kept in sync by
   sidebar.js on click. */
html[data-sidebar="collapsed"] aside[data-sidebar-panel] {
  width: 4.5rem !important;
}
/* The p-gutter padding (1.5rem/side) is sized for the 256px expanded rail —
   at 4.5rem collapsed it leaves almost no content width, which squeezes
   every row's box down to a sliver and distorts the avatar/icons into thin
   rectangles instead of the square/circle they're meant to be. Shrink it
   here so collapsed rows have real room to size correctly. */
html[data-sidebar="collapsed"] aside[data-sidebar-panel] > div {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}
html[data-sidebar="collapsed"] aside[data-sidebar-panel] .sidebar-label {
  display: none !important;
}
/* Every icon row (avatar, nav links, theme row, about/download/linkedin,
   Upwork) becomes a uniform fixed-size box so its icon renders at its real
   aspect ratio instead of being squeezed by leftover flex/auto sizing. */
html[data-sidebar="collapsed"] aside[data-sidebar-panel] .sidebar-row {
  justify-content: center;
  align-items: center;
  align-self: center;
  width: 2.75rem !important;
  height: 2.75rem !important;
  padding: 0 !important;
}
/* Collapsed Upwork card — keep just the avatar/badge as an icon, drop the
   card chrome (border/background/shadow) so it reads as a plain rail icon. */
html[data-sidebar="collapsed"] aside[data-sidebar-panel] .sidebar-extra a {
  border-color: transparent;
  background-color: transparent;
  box-shadow: none;
}
html[data-sidebar="collapsed"] aside[data-sidebar-panel] .sidebar-extra a:hover {
  border-color: transparent;
  box-shadow: none;
}
html[data-sidebar="collapsed"] aside[data-sidebar-panel] [data-new-chat] {
  width: 2.75rem;
  padding-left: 0;
  padding-right: 0;
  align-self: center;
}

/* Mobile off-canvas menu — the header hamburger (data-menu-toggle) slides
   this same <aside> in/out instead of the old instant hidden/flex swap, so
   the open/close actually animates. Forces display:flex under the md
   breakpoint (overriding the "hidden" half of the "hidden md:flex" utility
   pair) and drives visibility purely via transform + the .mobile-open
   class, the same technique the onboarding reveal above already uses. */
@media (max-width: 767px) {
  aside[data-sidebar-panel] {
    display: flex !important;
    width: 82%;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  }
  aside[data-sidebar-panel].mobile-open {
    transform: translateX(0);
  }
  /* The icon-only collapsed rail is a desktop-only affordance — on mobile
     the drawer is already an overlay, so always show it at full width with
     labels, regardless of the saved desktop collapse preference. */
  html[data-sidebar="collapsed"] aside[data-sidebar-panel] {
    width: 82% !important;
    max-width: 300px;
  }
  html[data-sidebar="collapsed"] aside[data-sidebar-panel] .sidebar-label,
  html[data-sidebar="collapsed"] aside[data-sidebar-panel] .sidebar-extra {
    display: block !important;
  }
  html[data-sidebar="collapsed"] aside[data-sidebar-panel] .sidebar-row {
    justify-content: flex-start !important;
    width: auto !important;
    height: auto !important;
  }
  html[data-sidebar="collapsed"] aside[data-sidebar-panel] [data-new-chat] {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  [data-sidebar-toggle] {
    display: none !important;
  }
}

/* Backdrop behind the mobile drawer — faded in/out in lockstep with it. */
[data-menu-backdrop] {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}
[data-menu-backdrop].mobile-open {
  opacity: 1;
  pointer-events: auto;
}
html[data-sidebar="collapsed"] aside[data-sidebar-panel] [data-sidebar-toggle] {
  align-self: center;
}
/* Never let a saved "collapsed" preference fight the onboarding full-width
   state (index.html) — onboarding's own margin rule always wins while active. */
@media (min-width: 768px) {
  html[data-sidebar="collapsed"] main:not(.onboarding-active) {
    margin-left: 4.5rem !important;
  }
  /* The floating chat-input footer (and, on Home, its scroll-fade gradient)
     are fixed elements outside <main>, so the rule above never reaches them —
     they kept the full 256px offset even once the sidebar collapsed to a
     72px rail, leaving a gap between the rail and the input. */
  html[data-sidebar="collapsed"] [data-chat-footer] {
    left: 4.5rem !important;
  }
  html[data-sidebar="collapsed"] #chat-fade {
    margin-left: 4.5rem !important;
  }
  html[data-sidebar="collapsed"] #chat-footer {
    width: calc(100% - 4.5rem) !important;
  }
}

/* Password-gate attention pulse (TIM + Vendas). Draws the eye to the input
   while it's waiting for the access password; sidebar.js/tim-gate.js removes
   this class the moment the visitor starts typing. */
@keyframes gate-pulse {
  0%, 100% {
    border-color: rgba(96, 99, 238, 0.7);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05), 0 0 0 0 rgba(96, 99, 238, 0.6), 0 0 14px 2px rgba(96, 99, 238, 0.4);
  }
  50% {
    border-color: rgba(96, 99, 238, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05), 0 0 0 10px rgba(96, 99, 238, 0), 0 0 26px 6px rgba(96, 99, 238, 0.65);
  }
}
[data-input-pill].gate-attention {
  animation: gate-pulse 1.8s ease-in-out infinite;
}

/* Typewriter effect — blinking caret while a bot answer types (app.js typewrite()) */
.tw-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: #4648d4;
  animation: tw-blink 0.9s steps(1) infinite;
}
@keyframes tw-blink {
  50% { opacity: 0; }
}

/* The "Navigation Menu" chip's icon is meant to be 16px (text-[16px]), but
   Google's Material Symbols stylesheet loads after tailwind.css and resets
   every icon to 24px, which made this chip 8px taller than its neighbours. */
[data-menu-toggle-chip] .material-symbols-outlined {
  font-size: 16px;
}
