/* BARQLO integrated UX / real DOM migration v4 — presentation-only.
 * Stage-only: all existing IDs, forms, bindings, auth and RPC remain unchanged.
 * Source direction: BARQLO_Integrated_UX_Prototype_20261121 (reviewed prototype).
 * This file does not activate mock behavior or change owner/tenant data. */
:root{
 --bq-bg:#f5f7f2;--bq-card:#fffefa;--bq-ink:#142b28;
 --bq-muted:#64776f;--bq-line:#dbe5de;--bq-accent:#116e55;
 --bq-strong:#0e4032;--bq-pale:#e7f3e9;--bq-dark:#102921;
 --bq-shadow:0 13px 34px rgba(9,41,29,.065);
 --bq-raised:#f5f8f5;--bq-round:19px;
}
:root[data-theme=dark]{
 --bq-bg:#0d1719;--bq-card:#152225;--bq-ink:#f1f7f4;
 --bq-muted:#abbcb4;--bq-line:#334c44;--bq-accent:#72d6b1;
 --bq-strong:#8ee1c1;--bq-pale:#203930;--bq-dark:#102921;
 --bq-shadow:0 18px 45px rgba(0,0,0,.19);--bq-raised:#1d3030;
}
html{scroll-padding-top:86px}
body{background:var(--bq-bg);color:var(--bq-ink)}
body:has(.hero.wrap),body:has(.editorial),body:has(.portal-shell){
 background:var(--bq-bg);
 color:var(--bq-ink);
}
:root{--cream:var(--bq-bg);--paper:var(--bq-card);--line:var(--bq-line);
 --ink:var(--bq-ink);--muted:var(--bq-muted);--forest:var(--bq-accent)}
:root[data-theme=light]{--surface:var(--bq-card);--surface-2:var(--bq-raised);--text:var(--bq-ink);
 --soft:var(--bq-muted);--stroke:var(--bq-line);--accent:var(--bq-accent);--glow:rgba(17,110,85,.09)}
:root[data-theme=dark]{--surface:var(--bq-card);--surface-2:var(--bq-raised);--text:var(--bq-ink);
 --soft:var(--bq-muted);--stroke:var(--bq-line);--accent:var(--bq-accent);--glow:rgba(96,209,167,.1)}
*:focus-visible{outline:3px solid #4cac87!important;outline-offset:3px}
:is(.button,button,input,select,textarea){font-family:inherit}
.button{min-height:44px;border-radius:12px;box-shadow:none;line-height:1.5}
.button:not(.ghost):not(.light):not(.danger){background:#116e55;border-color:#116e55;color:#fff}
.button.ghost{color:var(--bq-accent);border-color:var(--bq-line);background:var(--bq-card)}
.button:hover:not(:disabled){filter:brightness(.97)}
.button:disabled{opacity:.55;cursor:not-allowed}
:is(.card,.panel,.editorial-panel){min-width:0;border:1px solid var(--bq-line);
 border-radius:var(--bq-round);background:var(--bq-card);box-shadow:var(--bq-shadow)}
:is(.card,.panel,.editorial-panel) :is(p,small,strong,h2,h3){overflow-wrap:anywhere}
:is(input,select,textarea){max-width:100%}
:where(a,button,summary,input,select,textarea){touch-action:manipulation}
:where(h1,h2,h3,p){overflow-wrap:break-word}
:where(.wrap){max-width:100%}
/* --- Public site: same hierarchy and surfaces as the approved prototype.
   Each market page is generated from this template, keeping its own source copy. --- */
body:has(.hero.wrap) .nav.wrap{
 width:min(1380px,calc(100% - 48px));max-width:1380px;
 background:transparent!important;min-height:77px;border-color:var(--bq-line)!important;
 backdrop-filter:none;box-shadow:none;gap:14px;
}
body:has(.hero.wrap) .nav a{font-weight:700}
body:has(.hero.wrap) .nav nav{gap:clamp(9px,2vw,24px)}
body:has(.hero.wrap) .nav-tools{min-width:0}
body:has(.hero.wrap) .country-label select{background:var(--bq-card);border:1px solid var(--bq-line)}
body:has(.hero.wrap) main{background:transparent!important}
body:has(.hero.wrap) .hero.wrap{
 width:min(1330px,calc(100% - 48px));max-width:1330px;
 display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);
 align-items:center;gap:clamp(22px,4vw,65px);
 min-height:auto;padding:clamp(42px,6vw,78px) 0 58px;
 background:none!important;overflow:visible;isolation:isolate;
}
body:has(.hero.wrap) .hero.wrap:before{
 width:min(340px,65%);height:320px;right:auto;left:0;top:5%;opacity:.45;
}
body:has(.hero.wrap) .hero.wrap>*{min-width:0}
body:has(.hero.wrap) .hero .hero-copy{max-width:none;min-width:0;align-items:stretch}
body:has(.hero.wrap) .hero .eyebrow{font-size:12px;letter-spacing:0;color:var(--bq-accent)}
body:has(.hero.wrap) .hero h1{
 font-size:clamp(38px,4.8vw,68px);line-height:1.25;letter-spacing:-.048em;
 color:var(--bq-ink);max-width:720px;margin:14px 0 18px;text-wrap:balance;
}
body:has(.hero.wrap) .hero h1 em{color:var(--bq-accent);font:inherit;display:inline}
body:has(.hero.wrap) .brand-promise{color:var(--bq-strong);font-size:15px}
body:has(.hero.wrap) .hero .lead{font-size:clamp(14px,1.5vw,17px);line-height:1.95;
 color:var(--bq-muted);max-width:620px}
body:has(.hero.wrap) .hero .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
 width:min(100%,480px);max-width:480px;gap:10px;margin:27px 0 0}
body:has(.hero.wrap) .hero .actions .button{min-width:0;max-width:100%;font-size:14px;
 border-radius:12px;min-height:49px;white-space:normal}
body:has(.hero.wrap) .hero .actions .button.ghost{
 color:var(--bq-strong);background:var(--bq-card);border:1px solid var(--bq-line)}
body:has(.hero.wrap) .hero-disclaimer{color:var(--bq-muted);font-size:12px}
body:has(.hero.wrap) .hero-scene{
 max-width:100%;width:100%;min-width:0;min-height:350px;overflow:hidden;
 padding:clamp(16px,2.1vw,25px);border:1px solid #265647;border-radius:23px;
 background:#112b25!important;color:#eaf4ee;box-shadow:0 27px 80px #17382b33;
 align-self:center;
}
body:has(.hero.wrap) .hero-scene :is(.glimpse-top,.glimpse-inquiry,.glimpse-reply,.glimpse-footer){min-width:0}
body:has(.hero.wrap) .hero-scene .glimpse-top{border-bottom:1px solid #55746650;color:#c5d6cd}
body:has(.hero.wrap) .hero-scene .glimpse-inquiry{background:#27463a;color:#f5faf7;
 border-color:#52706160}
body:has(.hero.wrap) .hero-scene .glimpse-reply{background:#fffefa;color:#17392e;
 border-color:#e1e8df}
body:has(.hero.wrap) .hero-scene .glimpse-reply :is(span,p,small){color:#17392e}
body:has(.hero.wrap) .hero-scene .glimpse-footer{border-color:#496c5b50;color:#c4d9cd}
body:has(.hero.wrap) .hero-scene :is(p,span,small){overflow-wrap:anywhere}
body:has(.hero.wrap) .proof-band .proof{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
body:has(.hero.wrap) .proof-band .proof span{border:1px solid var(--bq-line);
 background:var(--bq-card);padding:7px 12px;border-radius:50px;color:var(--bq-muted)}
body:has(.hero.wrap) .section{padding-block:clamp(46px,6.5vw,92px)}
body:has(.hero.wrap) .section-head{max-width:820px}
body:has(.hero.wrap) .section-head h2{color:var(--bq-ink);font-size:clamp(28px,3.4vw,43px)}
body:has(.hero.wrap) .section-head p{color:var(--bq-muted)}
body:has(.hero.wrap) .demo-section{background:var(--bq-pale)!important}
body:has(.hero.wrap) .demo-section .section-head{max-width:880px}
body:has(.hero.wrap) .demo-grid{min-width:0;gap:20px}
body:has(.hero.wrap) .demo-grid>*{min-width:0}
body:has(.hero.wrap) .demo-controls,
body:has(.hero.wrap) .conversation-canvas .chat,
body:has(.hero.wrap) .team-screen{border:1px solid var(--bq-line);border-radius:19px;
 background:var(--bq-card)!important;color:var(--bq-ink);box-shadow:var(--bq-shadow)}
body:has(.hero.wrap) .conversation-canvas .chat-body{background:var(--bq-card)!important}
body:has(.hero.wrap) .conversation-canvas .chat-top{background:var(--bq-raised)!important}
body:has(.hero.wrap) .conversation-canvas .bubble.customer{background:var(--bq-pale)!important;color:var(--bq-ink)!important}
body:has(.hero.wrap) .conversation-canvas .bubble.agent{background:#116e55!important;color:#fff!important}
body:has(.hero.wrap) :is(.feature-disclosure,.sector-card,.plan){border:1px solid var(--bq-line);
 border-radius:19px;background:var(--bq-card);box-shadow:var(--bq-shadow)}
body:has(.hero.wrap) :is(.disclosure-intro strong,.feature-disclosure h3,.sector-card h3){color:var(--bq-ink)}
body:has(.hero.wrap) .footer{border-color:var(--bq-line)}
/* --- Owner and staff: real dashboard cards, task-first, no data substitution. --- */
.portal-header{background:var(--bq-card);border-bottom:1px solid var(--bq-line)}
.portal-header .brand{font-weight:900;color:var(--bq-ink)}
.portal-header>span{color:var(--bq-muted)}
.portal-shell{width:min(1450px,calc(100% - 48px));max-width:1450px;margin:30px auto 100px}
#portal .portal-top{min-height:130px;margin-bottom:18px;padding:24px 30px;
 background:var(--bq-card);border:1px solid var(--bq-line);
 border-radius:21px;box-shadow:var(--bq-shadow)}
#portal .portal-top:after{display:none}
#portal .portal-top .eyebrow{color:var(--bq-accent)}
#portal .portal-top h1{color:var(--bq-ink);font-size:clamp(25px,2.8vw,35px)}
#portal .portal-top .field{min-width:0;max-width:340px}
#portal .portal-top :is(select,input){color:var(--bq-ink);
 border:1px solid var(--bq-line);background:var(--bq-raised)}
#portal .portal-layout{display:grid;grid-template-columns:minmax(0,242px) minmax(0,1fr);
 gap:18px;align-items:start}
#portal .portal-nav{background:var(--bq-card);border:1px solid var(--bq-line);
 border-radius:20px;padding:13px 9px;box-shadow:var(--bq-shadow);max-height:calc(100dvh - 30px)}
#portal .portal-nav .nav-group{font-size:10px;letter-spacing:0;color:var(--bq-muted)}
#portal .portal-nav button{color:var(--bq-muted);font-size:12px;border-radius:11px;
 min-height:44px;line-height:1.5;transition:background-color .16s,border-color .16s}
#portal .portal-nav button:hover{color:var(--bq-ink);background:var(--bq-raised)}
#portal .portal-nav button.active{background:var(--bq-pale);border-color:var(--bq-line);
 color:var(--bq-strong);font-weight:800}
#portal .portal-nav .nav-glyph{color:var(--bq-accent)}
#portal .portal-view{min-width:0;min-height:500px;padding:clamp(16px,2vw,28px);
 border:1px solid var(--bq-line);border-radius:21px;background:var(--bq-card);
 color:var(--bq-ink);box-shadow:var(--bq-shadow)}
#portal .portal-view :is(.panel,.tile,.command-kpi,.catalog-item,.order-card,.inbox-thread,.queue-card){
 background:var(--bq-card);color:var(--bq-ink);border-color:var(--bq-line);
 border-radius:16px;box-shadow:none;min-width:0}
#portal .portal-view .panel{background:var(--bq-raised)}
#portal .portal-view :is(.section-heading h3,.workspace-head h2,.panel h3,.tile strong){color:var(--bq-ink)}
#portal .portal-view :is(.muted,.small,.tile small,.section-heading p){color:var(--bq-muted)}
#portal .portal-view :is(input,select,textarea){background:var(--bq-card);color:var(--bq-ink);
 border:1px solid var(--bq-line)}
#portal .portal-view :is(.tiles,.command-kpis,.form-grid,.catalog-grid,.order-grid){min-width:0}
#portal .portal-view .row{border-color:var(--bq-line)}
#portal .portal-view .workspace-shortcuts button{background:var(--bq-pale);
 color:var(--bq-strong);border-color:var(--bq-line);border-radius:11px}
#portal .portal-view .command-kpi{box-shadow:0 5px 18px rgba(9,41,29,.05)}
#portal .portal-view .command-kpi .kpi-ring{opacity:.32;pointer-events:none}
#portal .portal-view .command-kpi strong{font-variant-numeric:tabular-nums}
#portal .portal-view .badge{background:var(--bq-pale);color:var(--bq-strong)}
#portal .mobile-nav{border-color:var(--bq-line);background:var(--bq-card)}
/* --- Auth/onboarding uses exactly existing forms and handlers. --- */
#auth.auth-card,#onboarding.auth-card{border-radius:24px;box-shadow:var(--bq-shadow)}
#auth .auth-panel{background:var(--bq-card);color:var(--bq-ink)}
#auth .auth-intro{background:radial-gradient(circle at 80% 10%,#255d4b,transparent 52%),#102b25;
 color:#fff}
#auth .auth-intro h1{color:#fff}
#auth .auth-mark{background:#e7f3e9;color:#102b25}
#auth .auth-google{background:var(--bq-card);color:var(--bq-ink);border-color:var(--bq-line)}
#auth .auth-panel :is(h2,label){color:var(--bq-ink)}
#onboarding.auth-card{width:min(1100px,100%);max-width:1100px;
 background:var(--bq-card);border:1px solid var(--bq-line);padding:clamp(18px,3vw,36px)}
#onboarding .brand-tier-card span{background:var(--bq-card);border-color:var(--bq-line)}
#onboarding .brand-tier-card input:checked+span{background:var(--bq-pale);
 border-color:var(--bq-accent);color:var(--bq-ink)}
/* --- Partners / legal: same public visual language, text untouched. --- */
body:has(.editorial) .nav.wrap{width:min(1200px,calc(100% - 40px));min-height:74px;
 border-bottom:1px solid var(--bq-line);gap:16px}
body:has(.editorial) .nav nav{gap:clamp(10px,2vw,23px)}
.editorial{width:min(1050px,calc(100% - 40px));margin-inline:auto;padding-block:clamp(43px,7vw,86px)}
.editorial h1{font-size:clamp(34px,4.8vw,59px);line-height:1.25;
 color:var(--bq-ink);max-width:780px;letter-spacing:-.035em}
.editorial .lead{font-size:clamp(15px,1.6vw,19px);color:var(--bq-muted);
 max-width:800px;line-height:2}
.editorial .eyebrow{color:var(--bq-accent)}
.editorial-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
 gap:15px;margin:32px 0}
.editorial-grid .card{padding:clamp(16px,3vw,28px);
 background:var(--bq-card);border:1px solid var(--bq-line);box-shadow:var(--bq-shadow)}
.editorial-grid h2{font-size:clamp(27px,3vw,42px);margin:0;color:var(--bq-strong)}
.editorial-grid p{color:var(--bq-muted)}
.editorial-panel{padding:clamp(20px,3vw,34px);margin:18px 0;
 border:1px solid var(--bq-line);background:var(--bq-card);box-shadow:var(--bq-shadow)}
.editorial-panel h2{font-size:clamp(21px,2.3vw,30px);margin-block:10px 14px;color:var(--bq-ink)}
.editorial-panel :is(input,select){background:var(--bq-card);border:1px solid var(--bq-line);color:var(--bq-ink)}
.editorial-panel .estimate{font-variant-numeric:tabular-nums;unicode-bidi:plaintext;
 color:var(--bq-strong);overflow-wrap:anywhere}
.footer{max-width:100%;border-color:var(--bq-line)}
/* --- Explicit layout transitions: no clipping global overflow and no hidden CTAs. --- */
@media(max-width:1050px){
 body:has(.hero.wrap) .hero.wrap{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #portal .portal-layout{grid-template-columns:minmax(0,205px) minmax(0,1fr)}
}
@media(max-width:800px){
 body:has(.hero.wrap) .nav.wrap{width:calc(100% - 32px);display:flex;flex-wrap:wrap}
 body:has(.hero.wrap) .nav-tools{min-width:0;width:100%;justify-content:space-between;flex-wrap:wrap}
 body:has(.hero.wrap) .hero.wrap{width:calc(100% - 36px);max-width:calc(100% - 36px);
 display:flex;flex-direction:column;align-items:stretch;gap:28px;padding:48px 0 50px}
 body:has(.hero.wrap) .hero .hero-copy{width:100%;max-width:100%}
 body:has(.hero.wrap) .hero-scene{width:100%;max-width:100%;min-height:0}
 body:has(.hero.wrap) .demo-grid{grid-template-columns:minmax(0,1fr)}
 #portal .portal-layout{grid-template-columns:minmax(0,1fr)}
 #portal .portal-nav{position:static;max-height:none;overflow-x:auto;display:flex;flex-direction:row}
 #portal .portal-nav .nav-group{display:none}
 #portal .portal-nav button{white-space:nowrap;width:auto;flex:none}
 #portal .portal-top{flex-wrap:wrap;align-items:start;gap:15px}
 #portal .portal-top .field{max-width:100%;width:min(100%,360px)}
 .editorial-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:530px){
 .portal-shell{width:calc(100% - 22px);margin-top:16px}
 #portal .portal-view{padding:13px;border-radius:16px}
 #portal .portal-top{padding:16px;min-height:0}
 #portal .portal-top .field{width:100%}
 #portal .portal-view :is(.tiles,.command-kpis){grid-template-columns:repeat(2,minmax(0,1fr))}
 #portal .portal-view .tile{padding:11px}
 #portal .portal-view .row{align-items:flex-start;flex-wrap:wrap}
 .editorial{width:calc(100% - 24px)}
 .editorial-panel{padding:16px}
 body:has(.hero.wrap) .hero.wrap{width:calc(100% - 28px);max-width:calc(100% - 28px)}
 body:has(.hero.wrap) .hero h1{font-size:clamp(34px,10vw,43px);line-height:1.28}
 body:has(.hero.wrap) .hero .lead{font-size:14px}
 body:has(.hero.wrap) .hero .actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 body:has(.hero.wrap) .hero .actions .button{font-size:12px;min-height:48px;padding:8px}
 body:has(.hero.wrap) .hero-scene{padding:13px}
 body:has(.hero.wrap) .hero-scene .glimpse-top{flex-wrap:wrap;gap:8px}
 body:has(.hero.wrap) .proof-band .proof{gap:7px}
 body:has(.hero.wrap) .proof-band .proof span{font-size:10px}
}
@media(max-width:360px){
 body:has(.hero.wrap) .hero .actions{grid-template-columns:minmax(0,1fr)}
 body:has(.hero.wrap) .hero .actions .button{font-size:13px;width:100%}
 body:has(.hero.wrap) .nav.wrap{gap:7px}
 body:has(.hero.wrap) .nav-tools{justify-content:space-between}
 #portal .portal-view :is(.tiles,.command-kpis){grid-template-columns:minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){.portal-view,.hero-scene,.hero h1,
 .hero .actions,.feature-disclosure,.auth-intro{animation:none!important}}
