/* B&C EdgePro: usability fixes layered over the Figma CSS (figma-app.css itself is left untouched). */

/* Small labels stay readable on phones and tablets: only the smallest text size is raised
   (the page, header and logo keep the exact Figma sizes). Nothing can push the page wider than the screen. */
:root { --text-xs: max(11.5px, .75rem); }
html { overflow-x: clip; }
.text-\[10px\] { font-size: max(11px, .7rem); }
/* Root cause of that overflow: the hero image block had a negative side margin inside a grid that has no side padding. */
.relative.order-1.\-mx-4 { margin-left: 0; margin-right: 0; }

/* Brand logo (horizontal kit). Header: 30px tall on phones, 36px on larger screens, a little smaller between 1024 and 1279px
   where the full menu has to share the bar. Footer: up to 220px wide, never wider than its column. */
.bcf-logo { display: block; height: 30px; width: auto; max-width: none; }
@media (min-width: 640px) { .bcf-logo { height: 36px; } }
@media (min-width: 1024px) and (max-width: 1279px) { .bcf-logo { height: 30px; } }
.bcf-logo-footer { display: block; width: min(100%, 220px); height: auto; }

/* Headings break evenly instead of leaving a single word alone on the last line. */
h1, h2, h3 { text-wrap: balance; }

/* Jump links (e.g. "Learn More" on Immigrant Tax) stop below the fixed header instead of under it. */
[id] { scroll-margin-top: 88px; }

/* A clear focus ring for form fields (the design only changed the border colour). */
input:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 3px rgba(26, 86, 219, .25); }

/* Contrast: very faint text on dark backgrounds raised to a readable level (WCAG AA, 4.5:1). */
.text-white\/25, .text-white\/30, .text-white\/40 { color: rgb(255 255 255 / .55); }
[class~="bg-[#1a56db]"] [class*="text-white/"] { color: rgb(255 255 255 / .88); }
[class~="bg-[#142233]"] .text-\[\#3b82f6\] { color: #4d8df7; }
[class~="bg-[#f4f6f9]"] .text-\[\#60a5fa\] { color: #2563eb; }

/* Transparent header over the home / immigrant hero photo: a soft dark fade so white menu text stays readable on the light parts of the photo. */
header.bg-transparent { background: linear-gradient(to bottom, rgb(7 21 38 / .78) 0%, rgb(7 21 38 / .6) 55%, rgb(7 21 38 / 0) 100%); }

/* Email and phone links: a quiet underline so it is clear they can be tapped. */
a[href^="mailto:"], a[href^="tel:"] { text-decoration: underline; text-decoration-color: rgb(255 255 255 / .3); text-underline-offset: 4px; }
main .bg-white a[href^="mailto:"], main .bg-white a[href^="tel:"] { text-decoration-color: currentColor; }

/* "Skip to content" link: only visible when a keyboard user tabs to it. */
.bcf-skip {
  position: fixed; left: 12px; top: -64px; z-index: 10001;
  background: #1a56db; color: #fff; padding: 10px 16px;
  font: 600 14px/1.2 Inter, Arial, sans-serif; text-decoration: none; transition: top .15s;
}
.bcf-skip:focus { top: 12px; }

/* Touch screens: bigger tap targets, and form text at 16px so iPhones don't zoom in when a field is tapped. */
@media (pointer: coarse) {
  header button[aria-label="Toggle menu"] { min-width: 44px; min-height: 44px; }
  header button[aria-label="Toggle language"] { min-width: 48px; min-height: 40px; }
  footer a { display: inline-block; padding-block: .6rem; }
  main button.border { min-height: 40px; }
  main a.border-b { padding-block: .55rem; }
  main a.inline-flex[class*=" text-[#1a56db] "] { padding-block: .6rem; }
  main a[href^="mailto:"], main a[href^="tel:"] { display: inline-block; padding-block: .6rem; }
  input, textarea, select { font-size: 16px; }
}

/* ---------- Price estimator (Pricing page) ---------- */
.bcfe-section { background: #ffffff; border-bottom: 1px solid #e5e7eb; }
.bcfe-wrap { max-width: 1800px; margin: 0 auto; padding: 3rem 1rem; color: #1e2d45; }
@media (min-width: 640px) { .bcfe-wrap { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .bcfe-wrap { padding: 4.5rem 2rem; } }
.bcfe-head { max-width: 46rem; margin-bottom: 2rem; }
.bcfe-eyebrow { color: #1a56db; font-size: var(--text-xs, .75rem); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 .6rem; }
.bcfe-title { font-family: 'Raleway', 'Noto Sans SC', sans-serif; font-weight: 800; color: #071526; font-size: clamp(1.5rem, 2.4vw, 2.25rem); line-height: 1.15; margin: 0 0 .6rem; text-wrap: balance; }
.bcfe-sub { color: #5a6b85; margin: 0; line-height: 1.6; }
.bcfe-grid { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1024px) { .bcfe-grid { grid-template-columns: minmax(0, 1fr) 22rem; gap: 2rem; } }
.bcfe-form { display: grid; gap: 1rem; min-width: 0; }
@media (min-width: 768px) { .bcfe-form { grid-template-columns: 1fr 1fr; } .bcfe-group.bcfe-radio:first-child { grid-column: 1 / -1; } }
.bcfe-group { margin: 0; padding: 1.1rem 1.1rem 1.2rem; border: 1px solid #e5e7eb; background: #f4f6f9; min-width: 0; }
/* group titles sit inside their box (a plain fieldset legend would sit on the border line) */
.bcfe-legend { float: left; width: 100%; display: flex; align-items: center; gap: .5rem; margin: 0 0 .85rem; padding: 0; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; line-height: 1.3; color: #071526; }
.bcfe-legend::before { content: ""; flex: none; width: 4px; height: 1.05em; background: #1a56db; }
.bcfe-legend + * { clear: both; }
html[lang^="zh"] .bcfe-legend { font-size: .92rem; letter-spacing: .02em; }
.bcfe-items { display: grid; gap: .5rem; margin-top: 0; }
.bcfe-group.bcfe-radio:first-child .bcfe-items { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.bcfe-option { display: flex; align-items: flex-start; gap: .65rem; padding: .7rem .8rem; background: #ffffff; border: 1px solid #e5e7eb; cursor: pointer; transition: border-color .15s, background .15s; }
.bcfe-option:hover { border-color: #93b4f0; }
.bcfe-option:has(input:checked) { border-color: #1a56db; background: #eef3fd; }
.bcfe-option input { margin: .2rem 0 0; accent-color: #1a56db; width: 1rem; height: 1rem; flex: none; }
.bcfe-option-text { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.bcfe-option-name { font-size: .9rem; font-weight: 600; color: #071526; line-height: 1.35; }
.bcfe-option-sub { font-size: .8rem; color: #5a6b85; line-height: 1.45; }
.bcfe-price { font-size: .85rem; font-weight: 700; color: #1a56db; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bcfe-qty-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .8rem; background: #ffffff; border: 1px solid #e5e7eb; }
.bcfe-stepper { display: flex; align-items: center; flex: none; border: 1px solid #cbd5e1; }
.bcfe-step { width: 2.25rem; height: 2.25rem; border: 0; background: #ffffff; color: #142233; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.bcfe-step:hover { background: #eef3fd; color: #1a56db; }
.bcfe-stepper input { width: 2.75rem; height: 2.25rem; border: 0; border-left: 1px solid #cbd5e1; border-right: 1px solid #cbd5e1; text-align: center; font: inherit; font-weight: 700; color: #071526; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.bcfe-stepper input::-webkit-outer-spin-button, .bcfe-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bcfe-summary { background: #142233; color: #ffffff; padding: 1.5rem; min-width: 0; scroll-margin-top: 88px; }
@media (min-width: 1024px) { .bcfe-summary { position: sticky; top: 88px; } }
.bcfe-summary-title { font-family: 'Raleway', 'Noto Sans SC', sans-serif; font-weight: 800; font-size: 1.15rem; margin: 0 0 1rem; color: #ffffff; }
.bcfe-lines { list-style: none; margin: 0 0 1rem; padding: 0 0 1rem; border-bottom: 1px solid rgb(255 255 255 / .15); display: grid; gap: .55rem; font-size: .85rem; }
.bcfe-lines li { display: flex; justify-content: space-between; gap: 1rem; color: rgb(255 255 255 / .8); }
.bcfe-lines li span:last-child { color: #ffffff; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bcfe-lines .bcfe-empty { color: rgb(255 255 255 / .6); }
.bcfe-total { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.bcfe-total span { font-size: .85rem; color: rgb(255 255 255 / .75); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.bcfe-total strong { font-family: 'Raleway', sans-serif; font-weight: 900; font-size: 2.4rem; line-height: 1; color: #ffffff; font-variant-numeric: tabular-nums; }
.bcfe-note { font-size: .8rem; line-height: 1.55; color: rgb(255 255 255 / .7); margin: 0 0 1.2rem; }
.bcfe-cta { display: block; text-align: center; background: #1a56db; color: #ffffff; font-weight: 700; font-size: .9rem; padding: .95rem 1rem; text-decoration: none; transition: background .15s; }
.bcfe-cta:hover { background: #1648c0; }
.bcfe-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: .9rem; }
.bcfe-textbtn { background: none; border: 0; padding: .35rem 0; color: rgb(255 255 255 / .8); font: inherit; font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bcfe-textbtn:hover { color: #ffffff; }
.bcfe-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem -1rem -3rem; padding: .75rem max(1rem, env(safe-area-inset-right, 0px)) calc(.75rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px)); background: #142233; color: #ffffff; font-size: .9rem; }
.bcfe-bar strong { font-family: 'Raleway', sans-serif; font-weight: 900; font-size: 1.2rem; margin-left: .35rem; font-variant-numeric: tabular-nums; }
.bcfe-bar-btn { background: #1a56db; color: #ffffff; border: 0; font: inherit; font-weight: 700; font-size: .85rem; padding: .6rem .9rem; cursor: pointer; }
@media (min-width: 640px) { .bcfe-bar { margin-left: -1.5rem; margin-right: -1.5rem; } }
@media (min-width: 1024px) { .bcfe-bar { display: none; } }
.bcfe-step:focus-visible, .bcfe-cta:focus-visible, .bcfe-textbtn:focus-visible, .bcfe-bar-btn:focus-visible, .bcfe-option:has(input:focus-visible) { outline: 2px solid #1a56db; outline-offset: 2px; }
@media (pointer: coarse) { .bcfe-step { width: 2.75rem; height: 2.75rem; } .bcfe-stepper input { height: 2.75rem; font-size: 16px; } }

/* ---------- Blog: article list (Blog page) and article page (/blog/name) ---------- */
.bcf-posts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.bcf-post-card { display: flex; flex-direction: column; gap: .55rem; padding: 1.4rem 1.4rem 1.3rem; background: #f4f6f9; border: 1px solid #e5e7eb; color: #1e2d45; text-decoration: none; transition: border-color .15s, background .15s; }
.bcf-post-card:hover { border-color: #93b4f0; background: #eef3fd; }
.bcf-post-card:focus-visible { outline: 2px solid #1a56db; outline-offset: 2px; }
.bcf-post-meta { margin: 0; font-size: var(--text-xs, .75rem); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #1a56db; }
.bcf-post-title { margin: 0; font-family: 'Raleway', 'Noto Sans SC', sans-serif; font-weight: 800; color: #071526; font-size: 1.2rem; line-height: 1.3; text-wrap: balance; }
.bcf-post-excerpt { margin: 0; color: #5a6b85; font-size: .92rem; line-height: 1.6; flex: 1; }
.bcf-post-more { margin-top: .35rem; font-size: .88rem; font-weight: 700; color: #1a56db; }
.bcf-post-note { margin: 0 0 1.25rem; padding: .7rem .9rem; background: #eef3fd; border-left: 3px solid #1a56db; color: #1e2d45; font-size: .9rem; }
.bcf-article-head { max-width: 52rem; }
.bcf-post-back { display: inline-block; margin-bottom: 1.4rem; padding: .35rem 0; color: rgb(255 255 255 / .75); font-size: .9rem; font-weight: 600; text-decoration: none; }
.bcf-post-back:hover { color: #ffffff; text-decoration: underline; text-underline-offset: 4px; }
.bcf-post-h1 { margin: 0; color: #ffffff; font-size: clamp(1.9rem, 4.2vw, 3.4rem); line-height: 1.1; text-wrap: balance; }
.bcf-article { max-width: 46rem; }
.bcf-prose { color: #1e2d45; font-size: 1.05rem; line-height: 1.75; }
.bcf-prose > :first-child { margin-top: 0; }
.bcf-prose h2 { font-family: 'Raleway', 'Noto Sans SC', sans-serif; font-weight: 800; color: #071526; font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.25; margin: 2.4rem 0 .8rem; text-wrap: balance; }
.bcf-prose h3 { font-family: 'Raleway', 'Noto Sans SC', sans-serif; font-weight: 800; color: #071526; font-size: 1.1rem; line-height: 1.35; margin: 1.6rem 0 .4rem; }
.bcf-prose p { margin: 0 0 1rem; }
.bcf-prose ul, .bcf-prose ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.bcf-prose ul { list-style: disc; } .bcf-prose ol { list-style: decimal; }
.bcf-prose li { margin: .3rem 0; }
.bcf-prose strong { color: #071526; font-weight: 700; }
.bcf-prose a { color: #1a56db; text-decoration: underline; text-underline-offset: 3px; }
.bcf-post-cta { margin: 2.5rem 0 0; padding: 1.5rem; background: #142233; color: #ffffff; }
.bcf-post-cta-title { margin: 0 0 1rem; font-family: 'Raleway', 'Noto Sans SC', sans-serif; font-weight: 800; font-size: 1.2rem; }
.bcf-post-cta-btns { display: flex; flex-wrap: wrap; gap: .75rem; }
.bcf-btn { display: inline-flex; justify-content: center; padding: .85rem 1.5rem; font-weight: 700; font-size: .9rem; text-decoration: none; border: 1px solid rgb(255 255 255 / .35); color: #ffffff; transition: background .15s, border-color .15s; }
.bcf-btn:hover { border-color: #ffffff; }
.bcf-btn-primary { background: #1a56db; border-color: #1a56db; }
.bcf-btn-primary:hover { background: #1648c0; border-color: #1648c0; }
.bcf-btn:focus-visible, .bcf-post-back:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.bcf-post-related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #e5e7eb; }
.bcf-post-related-title { margin: 0 0 1rem; font-family: 'Raleway', 'Noto Sans SC', sans-serif; font-weight: 800; color: #071526; font-size: 1.3rem; }
.bcf-post-related .bcf-posts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.bcf-post-related .bcf-post-title { font-size: 1rem; }

/* ---------- Main call to action: gold "Instant Estimate" button (fixes2.js 10c) ---------- */
.bcf-est-cta { background: #f5b942; color: #0b1626 !important; box-shadow: 0 6px 18px rgb(245 185 66 / .38); transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.bcf-est-cta:hover { background: #ffc857; transform: translateY(-1px); box-shadow: 0 10px 24px rgb(245 185 66 / .5); }
.bcf-est-cta:active { transform: none; }
.bcf-est-cta svg { flex: none; }
.bcf-est-cta:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; box-shadow: 0 0 0 4px #1a56db; }
@media (prefers-reduced-motion: reduce) { .bcf-est-cta { transition: none; } .bcf-est-cta:hover { transform: none; } }
/* compact version in the phone/tablet top bar */
.bcf-est-mini { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; margin-right: .5rem; padding: .45rem .65rem; font-size: .75rem; font-weight: 800; line-height: 1; white-space: nowrap; box-shadow: 0 4px 12px rgb(245 185 66 / .35); }
@media (max-width: 379px) { .bcf-est-mini { padding: .45rem .5rem; } .bcf-est-mini-label { display: none; } }
@media (min-width: 1024px) { .bcf-est-mini { display: none; } }

/* ---------- Pricing page: full-width "Instant estimate" banner above the plan cards (fixes2.js 10c) ---------- */
.bcf-est-promo-wrap { position: relative; z-index: 1; background: #f4f6f9; padding-top: 2.5rem; }
@media (min-width: 768px) { .bcf-est-promo-wrap { padding-top: 3.5rem; } }
.bcf-est-promo-wrap + section { padding-top: 1.75rem !important; }
.bcf-est-promo { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem 1.75rem; background: #142233; color: #ffffff; text-decoration: none; border-left: 6px solid #f5b942; box-shadow: 0 12px 32px rgb(7 21 38 / .16); transition: transform .15s ease, box-shadow .15s ease; }
.bcf-est-promo:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgb(7 21 38 / .24); }
.bcf-est-promo:focus-visible { outline: 3px solid #f5b942; outline-offset: 3px; }
.bcf-est-promo-icon { flex: none; width: 64px; height: 64px; display: grid; place-items: center; background: #f5b942; color: #0b1626; }
.bcf-est-promo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.bcf-est-promo-eyebrow { font-size: var(--text-xs, .75rem); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #f5b942; }
.bcf-est-promo-title { margin: 0; font-family: 'Raleway', 'Noto Sans SC', sans-serif; font-weight: 900; font-size: clamp(1.3rem, 2.3vw, 1.85rem); line-height: 1.2; color: #ffffff; text-wrap: balance; }
.bcf-est-promo-sub { margin: 0; color: rgb(255 255 255 / .72); font-size: .97rem; line-height: 1.55; }
.bcf-est-promo-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: 1rem 1.6rem; background: #f5b942; color: #0b1626; font-weight: 800; font-size: 1rem; white-space: nowrap; box-shadow: 0 6px 18px rgb(245 185 66 / .35); transition: background-color .15s ease; }
.bcf-est-promo:hover .bcf-est-promo-btn { background: #ffc857; }
@media (prefers-reduced-motion: no-preference) { .bcf-est-promo:hover .bcf-est-promo-btn svg { animation: bcf-est-nudge .9s ease-in-out infinite; } }
@keyframes bcf-est-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(3px); } }
@media (max-width: 767px) {
  .bcf-est-promo { flex-direction: column; align-items: stretch; gap: 1rem; padding: 1.25rem; border-left-width: 0; border-top: 5px solid #f5b942; }
  .bcf-est-promo-icon { width: 48px; height: 48px; }
  .bcf-est-promo-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .bcf-est-promo { transition: none; } .bcf-est-promo:hover { transform: none; } }

/* ---------- AI assistant (bcf-assistant.js; on/off in wp-admin > Settings > AI Assistant) ---------- */
.bcf-ai-launch, .bcf-ai-panel { --ai-blue: #1a56db; --ai-blue-d: #1648c0; --ai-navy: #142233; --ai-ink: #071526; --ai-text: #1e2d45; --ai-muted: #5a6b85; --ai-line: #e3e8f0; --ai-bg: #f4f6f9; --ai-gold: #c9a35e; font-family: Inter, 'Noto Sans SC', system-ui, sans-serif; }
.bcf-ai-launch { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.bcf-ai-open .bcf-ai-launch { display: none; }
@media (max-width: 1023px) { body:has(.bcfe-bar) .bcf-ai-launch { bottom: 80px; } }

/* launcher: the gold B&C mark + "Ask AI" */
.bcf-ai-btn { display: inline-flex; align-items: center; gap: .7rem; height: 58px; padding: 0 1.3rem 0 .5rem; border: 0; background: var(--ai-blue); color: #ffffff; font-size: .95rem; font-weight: 700; letter-spacing: .01em; cursor: pointer; box-shadow: 0 12px 32px rgb(26 86 219 / .34), 0 2px 6px rgb(7 21 38 / .18); transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
.bcf-ai-btn:hover { background: var(--ai-blue-d); transform: translateY(-2px); box-shadow: 0 16px 38px rgb(26 86 219 / .42), 0 3px 8px rgb(7 21 38 / .2); }
.bcf-ai-avatar { position: relative; flex: none; display: block; width: 28px; height: 28px; }
.bcf-ai-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.bcf-ai-avatar-btn { width: 42px; height: 42px; }
.bcf-ai-avatar-btn img { box-shadow: 0 0 0 2px rgb(255 255 255 / .9); }
.bcf-ai-dot { position: absolute; right: -3px; top: -3px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px var(--ai-blue); }
.bcf-ai-avatar-head .bcf-ai-dot { box-shadow: 0 0 0 2px var(--ai-navy); }
@media (prefers-reduced-motion: no-preference) {
  .bcf-ai-avatar-btn .bcf-ai-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #22c55e; animation: bcf-ai-ping 2.4s cubic-bezier(0, 0, .2, 1) infinite; }
}
@keyframes bcf-ai-ping { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(2.4); opacity: 0; } }

/* one-time hint above the launcher */
.bcf-ai-teaser { position: relative; display: flex; align-items: flex-start; gap: .4rem; max-width: 260px; padding: .85rem .6rem .85rem 1rem; background: #ffffff; color: var(--ai-text); border-left: 3px solid var(--ai-blue); box-shadow: 0 12px 32px rgb(7 21 38 / .16); opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.bcf-ai-teaser.bcf-ai-in { opacity: 1; transform: none; }
.bcf-ai-teaser[hidden] { display: none; }
.bcf-ai-teaser::after { content: ''; position: absolute; right: 26px; bottom: -7px; width: 14px; height: 14px; background: #ffffff; transform: rotate(45deg); box-shadow: 4px 4px 8px rgb(7 21 38 / .06); }
.bcf-ai-teaser p { margin: 0; font-size: .85rem; line-height: 1.5; cursor: pointer; }
.bcf-ai-teaser-x { flex: none; width: 28px; height: 28px; margin-top: -4px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ai-muted); cursor: pointer; }
.bcf-ai-teaser-x:hover { color: var(--ai-ink); background: var(--ai-bg); }
.bcf-ai-teaser-x svg { width: 15px; height: 15px; }

/* panel */
.bcf-ai-panel { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 1001; width: min(400px, calc(100vw - 40px)); height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: #ffffff; color: var(--ai-text); box-shadow: 0 24px 64px rgb(7 21 38 / .3), 0 2px 8px rgb(7 21 38 / .12); opacity: 0; transform: translateY(16px) scale(.985); transform-origin: bottom right; transition: opacity .18s ease, transform .18s ease; }
.bcf-ai-panel.bcf-ai-in { opacity: 1; transform: none; }
.bcf-ai-panel[hidden] { display: none; }
.bcf-ai-head { display: flex; align-items: center; gap: .75rem; padding: .85rem .6rem .85rem 1rem; background: var(--ai-navy); color: #ffffff; border-top: 3px solid var(--ai-gold); }
.bcf-ai-avatar-head { width: 40px; height: 40px; }
.bcf-ai-head-text { flex: 1; min-width: 0; }
.bcf-ai-title { margin: 0; font-family: Raleway, 'Noto Sans SC', sans-serif; font-weight: 800; font-size: 1.02rem; line-height: 1.2; }
.bcf-ai-status { margin: .2rem 0 0; font-size: .74rem; color: rgb(255 255 255 / .66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcf-ai-icon-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: rgb(255 255 255 / .85); cursor: pointer; text-decoration: none; transition: background-color .15s, color .15s; }
.bcf-ai-icon-btn:hover { background: rgb(255 255 255 / .1); color: #ffffff; }

/* conversation */
.bcf-ai-list { flex: 1; overflow-y: auto; padding: 1.1rem 1rem .6rem; display: flex; flex-direction: column; gap: .75rem; background: var(--ai-bg); overscroll-behavior: contain; scroll-behavior: smooth; }
.bcf-ai-row { display: flex; align-items: flex-end; gap: .5rem; }
.bcf-ai-row-user { justify-content: flex-end; }
.bcf-ai-avatar-msg { margin-bottom: 2px; }
.bcf-ai-msg { max-width: 84%; padding: .7rem .85rem; font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere; }
.bcf-ai-assistant { background: #ffffff; border: 1px solid var(--ai-line); box-shadow: 0 1px 2px rgb(7 21 38 / .04); }
.bcf-ai-user { background: var(--ai-blue); color: #ffffff; white-space: pre-wrap; }
.bcf-ai-msg p { margin: 0; }
.bcf-ai-msg p + p, .bcf-ai-msg p + ul, .bcf-ai-msg ul + p { margin-top: .55rem; }
.bcf-ai-msg ul { margin: .35rem 0 0; padding-left: 1.1rem; list-style: disc; }
.bcf-ai-msg li { margin: .2rem 0; }
.bcf-ai-msg li::marker { color: var(--ai-blue); }
.bcf-ai-msg strong { color: var(--ai-ink); font-weight: 700; }
.bcf-ai-msg a { color: var(--ai-blue); text-decoration: underline; text-underline-offset: 2px; }
.bcf-ai-msg a.bcf-ai-link { display: inline-flex; align-items: center; gap: .2rem; margin: .1rem 0; padding: .05rem .5rem; background: #eef3fd; color: var(--ai-blue); font-weight: 600; font-size: .86rem; text-decoration: none; white-space: nowrap; transition: background-color .15s; }
.bcf-ai-msg a.bcf-ai-link::after { content: '→'; }
.bcf-ai-msg a.bcf-ai-link:hover { background: #dbe6fc; }
.bcf-ai-typing { display: inline-flex; gap: 5px; padding: .95rem 1rem; }
.bcf-ai-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aaac2; }
@media (prefers-reduced-motion: no-preference) {
  .bcf-ai-typing span { animation: bcf-ai-bounce 1.2s infinite ease-in-out; }
  .bcf-ai-typing span:nth-child(2) { animation-delay: .15s; }
  .bcf-ai-typing span:nth-child(3) { animation-delay: .3s; }
}
@keyframes bcf-ai-bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* popular questions */
.bcf-ai-chips { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; margin-left: calc(28px + .5rem); }
.bcf-ai-chips-label { margin: .2rem 0 .1rem; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ai-muted); }
.bcf-ai-chip { padding: .55rem .8rem; border: 1px solid #c7d7f8; background: #ffffff; color: var(--ai-blue); font-family: inherit; font-size: .84rem; font-weight: 600; line-height: 1.35; text-align: left; cursor: pointer; transition: background-color .15s, border-color .15s; }
.bcf-ai-chip:hover { background: #eef3fd; border-color: var(--ai-blue); }

/* composer */
.bcf-ai-form { display: flex; gap: .5rem; align-items: flex-end; padding: .75rem 1rem; border-top: 1px solid var(--ai-line); background: #ffffff; }
.bcf-ai-input { flex: 1; resize: none; min-height: 44px; max-height: 120px; padding: .65rem .8rem; border: 1px solid #cbd5e1; background: #ffffff; color: var(--ai-ink); font-family: inherit; font-size: 16px; line-height: 1.4; transition: border-color .15s, box-shadow .15s; }
.bcf-ai-input::placeholder { color: #8a97ab; }
.bcf-ai-input:focus { outline: none; border-color: var(--ai-blue); box-shadow: 0 0 0 3px rgb(26 86 219 / .15); }
.bcf-ai-send { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: var(--ai-blue); color: #ffffff; cursor: pointer; transition: background-color .15s; }
.bcf-ai-send:hover:not(:disabled) { background: var(--ai-blue-d); }
.bcf-ai-send:disabled { background: #c7cfdb; cursor: default; }
.bcf-ai-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 0 1rem .8rem; background: #ffffff; }
.bcf-ai-note { margin: 0; font-size: .68rem; line-height: 1.45; color: var(--ai-muted); }
.bcf-ai-human { flex: none; display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .6rem; border: 1px solid var(--ai-line); color: var(--ai-blue); font-size: .76rem; font-weight: 700; text-decoration: none; white-space: nowrap; transition: border-color .15s, background-color .15s; }
.bcf-ai-human:hover { border-color: var(--ai-blue); background: #eef3fd; }

.bcf-ai-btn:focus-visible, .bcf-ai-icon-btn:focus-visible, .bcf-ai-send:focus-visible, .bcf-ai-chip:focus-visible, .bcf-ai-human:focus-visible, .bcf-ai-teaser-x:focus-visible, .bcf-ai-msg a:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* phones: icon-only launcher, full-screen chat */
@media (max-width: 480px) {
  .bcf-ai-btn { width: 58px; padding: 0; justify-content: center; }
  .bcf-ai-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bcf-ai-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; transform-origin: bottom center; }
  .bcf-ai-head { padding-top: max(.85rem, env(safe-area-inset-top, 0px)); }
  .bcf-ai-foot { padding-bottom: max(.8rem, env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .bcf-ai-panel, .bcf-ai-teaser, .bcf-ai-btn { transition: none; } }
