/* ─── SchoolBreeze · Breeze skin ───────────────────────────────────────────────
   One drop-in file. Load it after the app's own CSS and the whole app takes the Breeze look:

     <link rel="stylesheet" href="/skins/breeze.css">

   Remove the link and the app is back to its original look. It needs no extra class names or
   attributes: it styles the markup the app already has (design variables, Tailwind classes and
   element structure). Rules are deliberately unlayered, so they outrank Tailwind's utility layer
   without !important (except where the app sets inline styles).

   Contents
     1. Fonts and design tokens (colours, corners, shadows, fonts): most of the look comes from here
     2. Sidebar → Breeze-blue icon rail that opens on hover and pushes the page over
     3. Page titles, cards, tabs, the one coral action
     4. Schedule: solid teacher-coloured lessons
     5. App-wide patterns: buttons, fields, tables, badges, dialogs, toasts
     6. Communications Hub (demo screen; uses that screen's own sb-* hooks)

   Brand images (logo, app icon) load from /brand/ beside /skins/; favicons and the touch icon are
   <head> tags, which CSS can't set (see docs/BREEZE-HANDOFF.md).

   Rules and rationale: docs/BREEZE-HANDOFF.md. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap");

/* ── 1. Tokens ─────────────────────────────────────────────────────────────── */
/* :root:root outranks the app's own :root, whichever file loads last. */
:root:root {
  --bz-navy: #0B2A6B;
  --bz-blue: #1554C0;
  --bz-sky: #3BA3F5;
  --bz-coral: #FF6B5A;

  /* Surfaces: pale blue-grey page, white cards */
  --background: #F4F7FB;
  --surface: #F4F7FB;
  --card: #FFFFFF;
  --popover: #FFFFFF;
  --muted: #EEF3F9;
  --secondary: #EEF3F9;

  /* Text: deep navy, blue-grey secondary */
  --foreground: #0B1B3A;
  --card-foreground: #0B1B3A;
  --popover-foreground: #0B1B3A;
  --secondary-foreground: #0B1B3A;
  --muted-foreground: #5B6B85;

  /* Accent: Breeze blue */
  --primary: var(--bz-blue);
  --primary-foreground: #FFFFFF;
  --ring: color-mix(in oklab, var(--bz-blue) 45%, transparent);
  --brand: var(--bz-blue);
  --brand-deep: var(--bz-navy);
  --brand-light: #E6EFFC;
  --accent: #E6EFFC;
  --accent-foreground: var(--bz-blue);
  --destructive: #E5484D;
  --border: #E2E8F2;
  --input: #D7DFEC;

  /* Gradients and soft blue-tinted depth */
  --gradient-breeze: linear-gradient(135deg, var(--bz-blue), var(--bz-sky));
  --gradient-breeze-deep: linear-gradient(165deg, var(--bz-navy), var(--bz-blue) 58%, var(--bz-sky));
  --gradient-sky: none;
  --gradient-dawn: none;
  --shadow-soft: 0 1px 2px rgb(11 42 107 / 0.06), 0 8px 24px -14px rgb(11 42 107 / 0.22);
  --shadow-float: 0 16px 40px -12px rgb(11 42 107 / 0.28), 0 2px 6px rgb(11 42 107 / 0.08);
  --shadow-glow: none;

  /* Friendly corners. --radius drives every rounded-* class on the live site; --r-* is the demo's. */
  --radius: 10px;
  --r-xs: 6px; --r-sm: 8px; --r-md: 9px; --r-lg: 10px; --r-xl: 12px; --r-2xl: 14px; --r-3xl: 16px; --r-4xl: 20px;
  --r-input: 10px;

  /* Type: Inter for text, Outfit for titles and big numbers. --font-sans (live) and --font-app (demo). */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-app: var(--font-sans);
  --font-display: "Outfit", "Inter", sans-serif;
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.006em;
}
:is(h1, h2, h3) {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
/* Flat page, no colour washes */
.bg-ambient { background: var(--background); }

/* ── 2. Sidebar: the Breeze-blue icon rail ─────────────────────────────────── */
/* The sidebar is the <aside> that holds the main <nav>. */
aside:has(> nav) {
  background: linear-gradient(165deg, var(--bz-navy) 0%, var(--bz-blue) 58%, var(--bz-sky) 100%);
  border-right: 0;
  color: #fff;
  backdrop-filter: none;
  padding-top: 14px;
  padding-bottom: 14px;
}
/* Logo: the brand wordmark (white "school", blue "breeze") replaces the app's own logo image.
   The closed rail shows the app icon instead (section below). Images come from /brand/, next to /skins/. */
aside:has(> nav) > div:first-child { padding: 0 0 12px; }
aside:has(> nav) > div:first-child img { display: none; }
/* Open: the wordmark's visible left edge lines up with the nav icons (12px into the header).
   The PNG has ~1.8px of transparent padding at this size, so the box starts 10.2px in. */
aside:has(> nav) > div:first-child::before {
  content: "";
  display: block;
  width: 180px;
  height: 44px;
  margin-left: 10.2px;
  background: url("../brand/schoolbreeze-wordmark-white-blue.png") left center / contain no-repeat;
}
aside:has(> nav) :is(.text-foreground, .text-muted-foreground) { color: #fff; }
aside:has(> nav) .text-muted-foreground { opacity: 0.7; }

aside:has(> nav) > nav { display: flex; flex-direction: column; gap: 0; }
aside:has(> nav) > nav > * { margin-top: 0; }
aside:has(> nav) > nav > a {
  position: relative;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  color: rgb(255 255 255 / 0.84);
  background: transparent;
}
aside:has(> nav) > nav > a svg { color: rgb(255 255 255 / 0.84); width: 17px; height: 17px; }
aside:has(> nav) > nav > a:hover { background: rgb(255 255 255 / 0.1); }
/* The active page (the app marks it text-primary) */
aside:has(> nav) > nav > a.text-primary {
  background: rgb(255 255 255 / 0.18);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}
aside:has(> nav) > nav > a.text-primary svg { color: #fff; }
/* Counts */
aside:has(> nav) > nav > a > span.grid { border-radius: 999px; }
aside:has(> nav) > nav > a > span.grid.text-primary { background: rgb(255 255 255 / 0.22); color: #fff; }

/* Buttons and cards at the bottom of the rail (Ask AI, mobile-app card) */
aside:has(> nav) button { color: #fff; }
aside:has(> nav) .sb-account-initials { background: rgb(255 255 255 / 0.2); color: #fff; }
aside:has(> nav) button:hover { background-color: rgb(255 255 255 / 0.1); }
aside:has(> nav) .bg-card {
  background: rgb(255 255 255 / 0.12);
  border-color: rgb(255 255 255 / 0.18);
  box-shadow: none;
}
/* Ask Breeze AI: the brand "b" mark on a light ice-blue tile replaces the sparkle icon. */
aside:has(> nav) button > span.bg-gradient-to-br {
  background: #F0F8FE url("../brand/schoolbreeze-b-mark.png") center / 72% no-repeat;
}
aside:has(> nav) button > span.bg-gradient-to-br > svg { display: none; }

/* Mobile-app card: two equal-width white store pills with navy text and Breeze-blue icons. */
aside:has(> nav) .bg-card .store-pill {
  background: #fff;
  color: var(--bz-navy);
  box-shadow: 0 2px 6px rgb(4 22 63 / 0.18);
}
aside:has(> nav) .bg-card .store-pill svg { color: var(--bz-blue); }
aside:has(> nav) .bg-card button,
aside:has(> nav) .bg-white { background: rgb(255 255 255 / 0.9); color: var(--bz-navy); }

/* Desktop: pinned to the left as a 68px rail that opens to 260px on hover or keyboard focus,
   pushing the page over (not covering it). */
@media (min-width: 768px) {
  div:has(> aside > nav) {
    max-width: none;
    padding-left: 68px;
    transition: padding-left 220ms cubic-bezier(0.32, 0.72, 0, 1);
  }
  div:has(> aside:is(:hover, :focus-within) > nav) { padding-left: 260px; }
  aside:has(> nav) {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 68px;
    height: 100vh;
    padding-left: 12px;
    padding-right: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    transition: width 220ms cubic-bezier(0.32, 0.72, 0, 1);
  }
  aside:has(> nav)::-webkit-scrollbar { display: none; }
  aside:has(> nav):is(:hover, :focus-within) { width: 260px; }
  /* Content keeps its open width, so nothing reflows while the rail opens; the rail just clips it. */
  aside:has(> nav) > * { min-width: 236px; }

  /* Closed: a 32px app-icon tile in the same 44px slot (nav doesn't shift), centred on the
     nav icons at 32.5px from the rail edge: 12 padding + 4.5 margin + 16 half-tile. */
  aside:has(> nav):not(:hover):not(:focus-within) > div:first-child::before {
    width: 32px;
    height: 32px;
    margin: 6px 0 6px 4.5px;
    border-radius: 8px;
    background: url("../brand/apple-touch-icon.png") center / cover no-repeat;
    box-shadow: 0 2px 6px rgb(4 22 63 / 0.3);
  }
  /* Closed: hide the footer cards completely so nothing in them is visible or reachable. */
  aside:has(> nav):not(:hover):not(:focus-within) .bg-card { visibility: hidden; }

  /* Closed: icons only. */
  aside:has(> nav):not(:hover):not(:focus-within) :is(
    nav > a > span:not(.grid),
    button > span:not(:first-child)
  ) { visibility: hidden; }
  aside:has(> nav):not(:hover):not(:focus-within) > :last-child,
  aside:has(> nav):not(:hover):not(:focus-within) .bg-card { opacity: 0; }
  /* Closed: a count shrinks to a small bubble on its icon. */
  aside:has(> nav):not(:hover):not(:focus-within) > nav > a > span.grid {
    position: absolute;
    left: 24px;
    top: 2px;
    height: 16px;
    min-width: 16px;
    padding: 0 4px;
    font-size: 9.5px;
  }
}

/* ── 3. Page titles, cards, tabs, the one coral action ─────────────────────── */
header:has(> div > h1) h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Cards: white, soft blue shadow, no hairline */
.rounded-3xl.bg-card.shadow-soft {
  border-radius: 16px;
  border-color: transparent;
  box-shadow: var(--shadow-soft);
}
/* Big numbers and card titles in the display font */
:is(.text-\[30px\].font-semibold, h4, .text-\[15px\].font-semibold, .text-\[16px\].font-semibold) {
  font-family: var(--font-display);
}

/* Page tabs (a row of buttons with an underline on the active one) → light-blue segmented control */
div.border-b:has(> button > span.-bottom-px) {
  display: inline-flex;
  max-width: 100%;
  gap: 0;
  padding: 3px;
  border: 0;
  border-radius: 12px;
  background: #E6EDF7;
}
div.border-b:has(> button > span.-bottom-px) > button {
  padding: 6px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: #42526E;
}
div.border-b:has(> button > span.-bottom-px) > button:has(> span.-bottom-px) {
  background: #fff;
  color: var(--bz-blue);
  font-weight: 600;
  box-shadow: 0 1px 3px rgb(11 42 107 / 0.14);
}
div.border-b > button > span.-bottom-px { display: none; }

/* One warm accent: the primary button in a page's header is that page's main action. */
header:has(> div > h1) :is(button, a):is(.bg-primary, .bg-foreground) {
  background: var(--bz-coral);
  border-color: var(--bz-coral);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  box-shadow: 0 6px 16px -8px color-mix(in oklab, var(--bz-coral) 80%, transparent);
}
header:has(> div > h1) :is(button, a):is(.bg-primary, .bg-foreground):hover { filter: brightness(1.05); }

/* ── 4. Schedule: solid teacher-coloured lessons ───────────────────────────── */
/* A lesson block is a positioned button whose first child is the thin teacher-colour bar. Breeze
   stretches that bar behind the whole block, so the block fills with the teacher's colour.
   Cancelled (slate), completed (emerald) and conflicting (rose) lessons stay pale. */
button.absolute:has(> span.w-1.shrink-0:first-child):not(.bg-slate-50, .bg-emerald-50, .bg-rose-50) {
  border-color: transparent;
  border-radius: 9px !important; /* the app sets corners inline */
  box-shadow: 0 2px 6px -2px rgb(11 42 107 / 0.35);
}
button.absolute:has(> span.w-1.shrink-0:first-child):not(.bg-slate-50, .bg-emerald-50, .bg-rose-50) > span:first-child {
  position: absolute;
  inset: 0;
  width: auto;
  filter: brightness(0.9);
  opacity: 1;
}
button.absolute:has(> span.w-1.shrink-0:first-child):not(.bg-slate-50, .bg-emerald-50, .bg-rose-50) > div {
  position: relative;
}
button.absolute:has(> span.w-1.shrink-0:first-child):not(.bg-slate-50, .bg-emerald-50, .bg-rose-50) > div,
button.absolute:has(> span.w-1.shrink-0:first-child):not(.bg-slate-50, .bg-emerald-50, .bg-rose-50) > div * {
  color: #fff;
}
/* Corner badges (recurring, online) become frosted chips on the colour. */
button.absolute:has(> span.w-1.shrink-0:first-child):not(.bg-slate-50, .bg-emerald-50, .bg-rose-50) span.border {
  background: rgb(255 255 255 / 0.22);
  border-color: transparent;
}

/* ── 5. App-wide patterns ──────────────────────────────────────────────────── */
/* Dark "primary" buttons and selected segments (bg-foreground) become Breeze blue.
   Communications Hub pieces are left out: section 6 colours them. */
.bg-foreground.text-background:not(header *):not(:is(.sb-bubble, .sb-send, .sb-chan, .sb-filter, .sb-unread)) {
  background-color: var(--bz-blue);
  color: #fff;
}
/* Ad-hoc sky/blue action buttons become Breeze blue (teacher colour dots are spans and stay). */
:is(button, a):is(.bg-sky-500, .bg-sky-600, .bg-blue-500, .bg-blue-600) {
  background-color: var(--bz-blue);
  color: #fff;
}
/* Primary buttons get a soft blue lift; secondary buttons sit white on the page. */
:is(button, a).bg-primary { box-shadow: 0 4px 12px -6px color-mix(in oklab, var(--bz-blue) 70%, transparent); }
:is(button, a).bg-background { background-color: #fff; }

/* Form controls: white fields; Breeze-blue checks, radios and sliders. */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea) {
  background-color: #fff;
}
:is(input[type="checkbox"], input[type="radio"], input[type="range"], progress) { accent-color: var(--bz-blue); }

/* Toggle switches (Radix: button[role="switch"] with a thumb span): a pill track and a round white thumb. */
button[role="switch"] { border-radius: 999px; }
button[role="switch"] > span {
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(11 42 107 / 0.3);
}

/* Tables: light header band, quiet row hover. */
thead { background: #F7F9FD; }
thead th { color: #5B6B85; font-weight: 600; }
tbody tr:hover { background-color: #F8FAFE; }

/* Small tinted badges become full pills. */
span.rounded-md:is([class*="bg-"][class*="/10"], [class*="bg-"][class*="/15"], [class*="bg-"][class*="-100"], [class*="bg-"][class*="-50 "]) {
  border-radius: 999px;
}

/* Dialogs round and floating; side sheets stay square to the screen edge. Menus and popovers float. */
[role="dialog"]:not([class*="inset-y-0"]):not([class*="inset-x-0"]) {
  border-radius: 18px;
  box-shadow: var(--shadow-float);
}
[role="dialog"]:is([class*="inset-y-0"], [class*="inset-x-0"]) { box-shadow: var(--shadow-float); }
[role="menu"],
[role="listbox"],
[data-radix-popper-content-wrapper] > [data-state] {
  border-radius: 12px;
  box-shadow: var(--shadow-float);
}

/* Toasts: rounded, floating. */
[data-sonner-toast] {
  border-radius: 14px !important;
  box-shadow: var(--shadow-float) !important;
  font-family: var(--font-sans) !important;
}

/* Calm motion */
:where(button, a, [role="tab"]) {
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ── 6. Communications Hub ─────────────────────────────────────────────────── */
/* This screen exists in the demo only (the live site uses a message drawer), so it ships with its
   own sb-* hooks. Design rules: docs/MESSAGES-BREEZE.md. */
:root:root {
  --ch-in-app: var(--bz-blue);
  --ch-in-app-tint: #E6EFFC;
  --ch-in-app-ink: #1554C0;
  --ch-sms: #0E9F8E;
  --ch-sms-tint: #DDF5F1;
  --ch-sms-ink: #0A7A6D;
  --ch-email: #6D5BD0;
  --ch-email-tint: #ECE9FB;
  --ch-email-ink: #5443B8;
  --bubble-radius: 20px;
  --bubble-tuck: 6px;
  --bubble-out-in-app: linear-gradient(135deg, var(--bz-blue) 0%, #2B7BE4 60%, var(--bz-sky) 100%);
  --bubble-out-sms: linear-gradient(135deg, #0A8C7E 0%, #14B8A6 100%);
  --bubble-shadow: 0 1px 2px rgb(11 42 107 / 0.06), 0 6px 16px -10px rgb(11 42 107 / 0.30);
}

/* ── Family avatars: six friendly gradients, picked from the family's name ── */
.sb-avatar > div { background: var(--av) !important; }
.sb-avatar[data-hue="0"] { --av: linear-gradient(135deg, #1554C0, #3BA3F5); }
.sb-avatar[data-hue="1"] { --av: linear-gradient(135deg, #0A8C7E, #2DD4BF); }
.sb-avatar[data-hue="2"] { --av: linear-gradient(135deg, #5B47C9, #9B8AFB); }
.sb-avatar[data-hue="3"] { --av: linear-gradient(135deg, #E8503F, #FF9A7A); }
.sb-avatar[data-hue="4"] { --av: linear-gradient(135deg, #D97706, #FBBF24); }
.sb-avatar[data-hue="5"] { --av: linear-gradient(135deg, #0B2A6B, #4F7BD8); }

/* ── Inbox column ── */
.sb-hub { box-shadow: var(--shadow-soft); border-radius: 20px; }
.sb-hub-search {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.sb-hub-search:focus-within {
  border-color: var(--bz-sky);
  box-shadow: 0 0 0 3px rgb(59 163 245 / 0.18);
}

.sb-filter { border-radius: 999px !important; padding-inline: 12px; }
.sb-filter[data-active] {
  background: var(--bz-blue) !important;
  color: #fff !important;
  box-shadow: 0 4px 10px -4px rgb(21 84 192 / 0.55);
}

.sb-thread {
  position: relative;
  border-bottom-color: transparent !important;
  margin: 2px 8px;
  width: calc(100% - 16px);
  border-radius: 14px;
  transition: background-color 0.15s, transform 0.15s;
}
.sb-thread:hover { background: #F4F8FE !important; }
.sb-thread[data-active] {
  background: var(--ch-in-app-tint) !important;
  box-shadow: inset 3px 0 0 var(--bz-blue);
}
/* Unread: bold name and a coral dot next to it */
.sb-thread[data-unread] .sb-thread-name { font-weight: 800; }
.sb-thread[data-unread] .sb-thread-name::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--bz-coral);
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgb(255 107 90 / 0.18);
}
.sb-unread {
  background: var(--bz-coral) !important;
  color: #fff !important;
  border-radius: 999px !important;
  min-width: 18px;
  text-align: center;
}

/* Chips: channel colours, and who replies (teacher violet, school blue) */
.sb-chip {
  border-radius: 999px !important;
  padding: 2px 8px !important;
  box-shadow: none !important;
  border: 0 !important;
}
.sb-chip[data-channel="in_app"] { background: var(--ch-in-app-tint) !important; color: var(--ch-in-app-ink) !important; }
.sb-chip[data-channel="sms"] { background: var(--ch-sms-tint) !important; color: var(--ch-sms-ink) !important; }
.sb-chip[data-channel="email"] { background: var(--ch-email-tint) !important; color: var(--ch-email-ink) !important; }
.sb-chip[data-route="teacher"] { background: #F1ECFE !important; color: #6B3FD4 !important; }
.sb-chip[data-route="school"] { background: #EEF3F9 !important; color: #33476B !important; }

/* ── Conversation ── */
.sb-thread-head { background: linear-gradient(180deg, #fff, #FAFCFF); }

.sb-timeline {
  /* Pale sky with a faint dot grid */
  background:
    radial-gradient(circle at 1px 1px, rgb(21 84 192 / 0.07) 1px, transparent 0) 0 0 / 20px 20px,
    linear-gradient(180deg, #F7FAFF 0%, #EEF5FE 100%);
}
.sb-timeline > * + * { margin-top: 4px !important; }
.sb-msg-row[data-first] { margin-top: 10px; }

/* Day divider pill */
.sb-day {
  display: flex !important;
  justify-content: center;
  margin: 14px 0 8px;
}
.sb-day > span {
  padding: 3px 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.85);
  box-shadow: 0 1px 2px rgb(11 42 107 / 0.08);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
}

/* Bubbles */
.sb-bubble {
  display: flex;
  flex-direction: column-reverse; /* time under the text, like a chat app */
  gap: 3px;
  padding: 9px 14px 7px !important;
  border-radius: var(--bubble-radius) !important;
  font-size: 14.5px;
  line-height: 1.45;
  box-shadow: var(--bubble-shadow);
  --tw-ring-shadow: 0 0 #0000 !important;
  animation: bz-bubble-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
.sb-bubble-meta {
  margin: 0 !important;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.75;
}
/* Your messages: solid, in the channel's colour */
.sb-bubble[data-dir="out"] {
  background: var(--bubble-out-in-app) !important;
  color: #fff !important;
  transform-origin: bottom right;
}
.sb-bubble[data-dir="out"][data-channel="sms"] { background: var(--bubble-out-sms) !important; }
.sb-bubble[data-dir="out"] .sb-bubble-meta { justify-content: flex-end; }
/* Emails read as a letter, not a chat bubble: white card with a violet top edge */
.sb-bubble[data-channel="email"] {
  background: #fff !important;
  color: var(--foreground) !important;
  border-radius: 14px !important;
  box-shadow: inset 0 3px 0 var(--ch-email), var(--bubble-shadow);
  padding-top: 12px !important;
}
.sb-bubble[data-channel="email"] .sb-bubble-meta { color: var(--ch-email-ink); opacity: 1; }
/* The family's messages: white with a soft shadow */
.sb-bubble[data-dir="in"] {
  background: #fff !important;
  color: var(--foreground) !important;
  transform-origin: bottom left;
}

/* Grouping: tuck the corners on the speaker's side; only the last bubble in a group has a tail */
.sb-msg-row[data-dir="out"]:not([data-first]) .sb-bubble { border-top-right-radius: var(--bubble-tuck) !important; }
.sb-msg-row[data-dir="out"]:not([data-last]) .sb-bubble { border-bottom-right-radius: var(--bubble-tuck) !important; }
.sb-msg-row[data-dir="in"]:not([data-first]) .sb-bubble { border-top-left-radius: var(--bubble-tuck) !important; }
.sb-msg-row[data-dir="in"]:not([data-last]) .sb-bubble { border-bottom-left-radius: var(--bubble-tuck) !important; }
.sb-msg-row[data-last] .sb-bubble:not([data-channel="email"]) { position: relative; }
.sb-msg-row[data-dir="out"][data-last] .sb-bubble:not([data-channel="email"]) { border-bottom-right-radius: 4px !important; }
.sb-msg-row[data-dir="in"][data-last] .sb-bubble:not([data-channel="email"]) { border-bottom-left-radius: 4px !important; }

@keyframes bz-bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* ── Composer ── */
.sb-composer { background: #fff; }
.sb-chan {
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  color: var(--muted-foreground) !important;
  transition: background-color 0.15s, color 0.15s, transform 0.15s;
}
.sb-chan:hover { transform: translateY(-1px); }
.sb-chan[data-active] { border-color: transparent !important; color: #fff !important; }
.sb-chan[data-active][data-channel="in_app"] { background: var(--ch-in-app) !important; }
.sb-chan[data-active][data-channel="sms"] { background: var(--ch-sms) !important; }
.sb-chan[data-active][data-channel="email"] { background: var(--ch-email) !important; }

.sb-compose-box {
  border-radius: 999px !important;
  background: #F7FAFF !important;
  padding: 5px 5px 5px 8px !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sb-compose-box:focus-within {
  background: #fff !important;
  border-color: var(--bz-sky) !important;
  box-shadow: 0 0 0 3px rgb(59 163 245 / 0.18);
}

/* Send: the screen's one coral action. The plane lifts off on hover. */
.sb-send {
  border-radius: 999px !important;
  padding-inline: 16px !important;
  background: linear-gradient(135deg, #FF7A5C, var(--bz-coral)) !important;
  color: #fff !important;
  box-shadow: 0 6px 14px -6px rgb(255 107 90 / 0.7);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.sb-send svg { transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.sb-send:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 18px -8px rgb(255 107 90 / 0.8); }
.sb-send:not(:disabled):hover svg { transform: translate(2px, -2px) rotate(-10deg); }
.sb-send:disabled { opacity: 0.45 !important; box-shadow: none; }

/* ── Family panel ── */
.sb-family {
  background: linear-gradient(180deg, #F3F8FF 0, #fff 140px);
}
.sb-family-row { border-bottom-style: dashed !important; padding-block: 6px; }

/* ── Motion off for people who ask for less ── */
@media (prefers-reduced-motion: reduce) {
  :is(.sb-bubble, .sb-send, .sb-send svg, .sb-chan, .sb-thread) {
    animation: none !important;
    transition: none !important;
  }
}
