/* Platform reference skin — LOCAL CANDIDATE, colors/materials only.
 * Activated ONLY by html[data-account-palette=reference]; other presets/custom untouched.
 * MUST load AFTER theme.css, boards.css and account-theme.css (equal specificity vs
 * account-theme's `html[data-account-theme=on] #platformApp .sidebar`; source order wins).
 * No display/visibility/position/width/auth/permission/navigation-state overrides.
 * Wallpaper path is relative to this file's deployed location (root /aiva/reference-skin.css):
 *   assets/reference-skin/wallpaper.jpg  ->  /aiva/assets/reference-skin/wallpaper.jpg
 */

/* ---------- Brand tokens within reference scope ---------- */
html[data-account-palette=reference] #platformApp{
  --brand:#e60a27;--brand-2:#c40820;--brand-strong:#b40920;
  --brand-grad:linear-gradient(90deg,#e60a27,#c40820);
  --brand-soft:#fff1f3;--brand-softer:#fdf8f9;--brand-tint:#e60a2714;
  --ink:#191415;--text:#191415;--muted:#64748b;--line:#eee9ea;
  color:#191415;
}

/* ---------- Main surfaces: silicon white ---------- */
html[data-account-palette=reference] #platformApp .main,
html[data-account-palette=reference] #platformApp .topbar{
  background:#f8f7f7!important;color:#191415!important;
}
html[data-account-palette=reference] #platformApp .topbar h2{color:#191415!important}
html[data-account-palette=reference] #platformApp .topbar p,
html[data-account-palette=reference] #platformApp .connection-bar{color:#64748b!important}
html[data-account-palette=reference] #platformApp .connection-bar a{color:#b40920!important}

/* ---------- Sidebar: original fluid wallpaper + three-stop overlay ---------- */
html[data-account-palette=reference] #platformApp .sidebar{
  background:
    linear-gradient(180deg,rgba(18,15,16,.58) 0%,rgba(22,18,19,.50) 50%,rgba(18,15,16,.64) 100%),
    url("assets/reference-skin/wallpaper.jpg") center top / cover no-repeat!important;
  background-attachment:scroll!important;
  color:#fff!important;
}
/* Bottom cool-blue glow echoing the fluid material (reference detail, keep). */
html[data-account-palette=reference] #platformApp .sidebar::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:42%;
  background:linear-gradient(0deg,rgba(46,126,191,.16),rgba(46,126,191,0));
  pointer-events:none;z-index:0;
}
html[data-account-palette=reference] #platformApp .sidebar > *{position:relative;z-index:1}

/* Logo: transparent, soft drop shadow embeds it into the wallpaper. */
html[data-account-palette=reference] #platformApp .brand-logo-img{
  background:transparent!important;padding:0!important;border-radius:0!important;
  box-shadow:none!important;filter:drop-shadow(0 2px 10px rgba(0,0,0,.55));
}

/* ---------- Navigation: translucent dark glass + shadowed white text ---------- */
html[data-account-palette=reference] #platformApp #nav button,
html[data-account-palette=reference] #platformApp .v17-navgroup-head{
  background:rgba(18,16,18,.40)!important;border-radius:12px;
  backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);
  color:#fff!important;text-shadow:0 1px 3px rgba(0,0,0,.7)!important;
}
html[data-account-palette=reference] #platformApp #nav .v17-navgroup-body button{
  background:rgba(18,16,18,.28)!important;
}
html[data-account-palette=reference] #platformApp #nav button:hover,
html[data-account-palette=reference] #platformApp .v17-navgroup-head:hover{
  background:rgba(18,16,18,.56)!important;
}
html[data-account-palette=reference] #platformApp .sidebar :is(span,.ng-txt),
html[data-account-palette=reference] #platformApp #nav button *{
  color:#fff!important;text-shadow:0 1px 3px rgba(0,0,0,.7)!important;
}
/* Active nav item: Saidou-red highlight. */
html[data-account-palette=reference] #platformApp #nav button.active{
  background:linear-gradient(90deg,rgba(230,10,39,.92),rgba(197,7,31,.92))!important;
  color:#fff!important;box-shadow:none!important;
}
/* Account stylesheet paints active descendants too; keep them transparent to avoid red blocks. */
html[data-account-palette=reference] #platformApp #nav button.active *{
  background:transparent!important;color:#fff!important;box-shadow:none!important;
}

/* ---------- Board hero: real production header only (no prototype Agent nodes) ---------- */
html[data-account-palette=reference] #platformApp .ab-hero{
  background:linear-gradient(135deg,#5b0b16,#e60a27)!important;
  color:#fff!important;border-radius:16px;box-shadow:0 8px 24px rgba(231,14,43,.25);
}
html[data-account-palette=reference] #platformApp .ab-hero :is(h2,h3,p,span,.ab-summary){color:#fff!important}
html[data-account-palette=reference] #platformApp .ab-hero .ab-status{
  background:rgba(255,255,255,.12)!important;border-color:rgba(255,255,255,.25)!important;color:#fff!important;
}

/* ---------- Cards / panels ---------- */
html[data-account-palette=reference] #platformApp :is(.card,.ab-panel,.ab-capability){
  background:#fff!important;color:#191415!important;border-color:#f0eded!important;
  box-shadow:0 2px 12px rgba(25,20,21,.025);
}
html[data-account-palette=reference] #platformApp :is(.card,.ab-panel,.ab-kpi,.kpi) :is(h2,h3,td){color:#191415!important}

/* KPI cards: neutral tint, deep-red numbers. */
html[data-account-palette=reference] #platformApp :is(.ab-kpi,.kpi){
  background:#f9f9f9!important;color:#191415!important;border-color:#f5f5f5!important;
  box-shadow:0 2px 10px rgba(25,20,21,.02);
}
html[data-account-palette=reference] #platformApp :is(.ab-kpi,.kpi) :is(strong,b){color:#d9072a!important}
html[data-account-palette=reference] #platformApp :is(.ab-kpi,.kpi) :is(span,small),
html[data-account-palette=reference] #platformApp :is(.ab-note,.ab-summary,.muted,.help){color:#64748b!important}
/* Hero summary sits on red, unlike the normal grey summary. */
html[data-account-palette=reference] #platformApp .ab-hero .ab-summary{color:#fff!important}

/* ---------- Toolbar / inputs ---------- */
html[data-account-palette=reference] #platformApp .ab-toolbar{
  background:#f8f8f8!important;color:#191415!important;border-color:#f5f5f5!important;
}
html[data-account-palette=reference] #platformApp .ab-toolbar label{color:#191415!important}
html[data-account-palette=reference] #platformApp :is(input,select,textarea,.ms-toggle,.ms-pop,.table-scroll table,.table-scroll td){
  background:#fff!important;color:#191415!important;border-color:#e8e3e4!important;
}
html[data-account-palette=reference] #platformApp :is(.ab-empty,table th,.ms-tools){
  background:#f8f8f8!important;color:#64748b!important;border-color:#e8e3e4!important;
}
html[data-account-palette=reference] #platformApp :is(input,select,textarea,.ms-toggle):focus{
  border-color:#e60a27!important;box-shadow:0 0 0 3px #e60a271a!important;
}

/* ---------- Buttons ---------- */
html[data-account-palette=reference] #platformApp #pageRoot button:not(.secondary):not(.ms-toggle):not(.ms-all):not(.ms-none):not([data-close]),
html[data-account-palette=reference] #platformApp .top-actions button{
  background:linear-gradient(135deg,#f6233f,#e30a27)!important;
  color:#fff!important;border-color:#e60a27!important;
}
html[data-account-palette=reference] #platformApp #pageRoot .secondary,
html[data-account-palette=reference] #platformApp .top-actions button.secondary,
html[data-account-palette=reference] #platformApp .ms-tools button{
  background:#f8f8f8!important;color:#b40920!important;border-color:#eee9ea!important;
}

/* ---------- Progress bars (default) ---------- */
html[data-account-palette=reference] #platformApp :is(.ab-track,.bar-track){background:#f8edef!important}
html[data-account-palette=reference] #platformApp :is(.ab-track i,.ab-track b,.bar-fill){
  background:linear-gradient(90deg,#e60a27,#f6334d)!important;
}

/* ---------- Order stage colors (semantic date fields, NOT nth-child) ----------
   boards.js emits data-ab-stage on order-node bars only; groups stay untagged.
   Exact values from the offline reference OD_FLOW. */
html[data-account-palette=reference] #platformApp [data-ab-stage="blind_date"] .ab-track i{background:#fb8d99!important}
html[data-account-palette=reference] #platformApp [data-ab-stage="small_date"] .ab-track i{background:#f5556b!important}
html[data-account-palette=reference] #platformApp [data-ab-stage="order_date"] .ab-track i{background:#e22038!important}
html[data-account-palette=reference] #platformApp [data-ab-stage="lock_date"]  .ab-track i{background:#b00b20!important}

/* ---------- Preserve semantic notices; do not recolor every state to primary red ---------- */
html[data-account-palette=reference] #platformApp :is(.error,.card.error){color:#b42318!important;border-color:#f4a9ad!important}
html[data-account-palette=reference] #platformApp .status-note{background:#fff8e7!important;color:#7a5a12!important;border-color:#f4dda4!important}

/* Mobile reference skin, LOCAL CANDIDATE, colors/materials only.
 * Load AFTER account-theme.css and the inline #aiva-reference-palette tail patch.
 * Activated only by the account theme controller's explicit reference marker.
 * No auth, visibility, geometry, safe-area, touch or business behavior overrides.
 * Sources: snapshot/index.html (phone-shell CSS) + reference/手机端离线版.html.
 * Every rule is scoped html[data-account-palette=reference] body.aiva-standalone,
 * which outranks account-theme.css (html[data-account-theme=on] ...) and the tail
 * #aiva-reference-palette patch (body.aiva-standalone ...) by specificity + order.
 */

/* Neutral app screen; do not touch the login page. */
html[data-account-palette=reference] body.aiva-standalone .c-mobile-screen,
html[data-account-palette=reference] body.aiva-standalone .c-mobile-body {
  background: #f2f3f5 !important;
  color: #191415 !important;
}

/* App bar: reference red gradient with white text (overrides tail white-header patch). */
html[data-account-palette=reference] body.aiva-standalone .c-mobile-appbar {
  background: linear-gradient(135deg,#f6233f,#e30a27) !important;
  color: #fff !important;
  border-color: transparent !important;
}
html[data-account-palette=reference] body.aiva-standalone .c-mobile-appbar b {
  color: #fff !important;
}
html[data-account-palette=reference] body.aiva-standalone .c-mobile-appbar .cm-iconbtn {
  background: rgba(255,255,255,.2) !important;
  color: #fff !important;
  border-color: transparent !important;
}
html[data-account-palette=reference] body.aiva-standalone .c-mobile-appbar .cm-iconbtn:hover {
  background: rgba(255,255,255,.34) !important;
}

/* Welcome / profile / detail heroes are branded gradients, never plain surface cards. */
html[data-account-palette=reference] body.aiva-standalone .cm-hello,
html[data-account-palette=reference] body.aiva-standalone .cm-profile-hero,
html[data-account-palette=reference] body.aiva-standalone .cm-detail-hero {
  background: linear-gradient(135deg,#241c1d,#c70a23) !important;
  color: #fff !important;
  border-color: transparent !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello :is(b,h3),
html[data-account-palette=reference] body.aiva-standalone .cm-profile-hero :is(b,h3),
html[data-account-palette=reference] body.aiva-standalone .cm-detail-hero :is(b,h3,strong) {
  color: #fff !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello p,
html[data-account-palette=reference] body.aiva-standalone .cm-profile-hero p,
html[data-account-palette=reference] body.aiva-standalone .cm-detail-hero p {
  color: #f3dee1 !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello-stats .cm-hs {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
  border-color: transparent !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello-stats .cm-hs:hover {
  background: rgba(255,255,255,.2) !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello-stats .cm-hs b {
  color: #fff !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello-stats .cm-hs span {
  color: #f6dfe2 !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello-foot .cm-hf {
  background: rgba(255,255,255,.1) !important;
  color: #fff !important;
  border-color: transparent !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello-foot .cm-hf:hover {
  background: rgba(255,255,255,.18) !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello-foot .cm-hf b {
  color: #ffd9de !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-hello-foot .cm-hf-rank {
  background: rgba(255,255,255,.16) !important;
  color: #fff !important;
}

/* Menu / task / lead / form surfaces: white cards, dark text, muted secondary text. */
html[data-account-palette=reference] body.aiva-standalone :is(.cm-menu,.cm-task,.cm-lead-card,.cm-lp-body,.cm-lp-foot,.cm-form,.cm-sheet,.cm-loginput-box,.cm-meta-grid,.cm-bizcard,.cm-log-card,.cm-subpage) {
  background: #fff !important;
  color: #191415 !important;
  border-color: #f2edee !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-menu {
  box-shadow: 0 5px 14px rgba(26,21,22,.06) !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-menu button {
  background: transparent !important;
  color: #26201f !important;
  border-color: #f3f1f1 !important;
}
html[data-account-palette=reference] body.aiva-standalone :is(.cm-menu,.cm-task,.cm-lead-card) :is(b,h3) {
  color: #191415 !important;
}
html[data-account-palette=reference] body.aiva-standalone :is(.cm-menu small,.cm-meta,.cm-form-tip,.cm-sec-title) {
  color: #64748b !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-lead-card {
  box-shadow: 0 4px 12px rgba(26,21,22,.05) !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-lead-card:hover {
  border-color: #f6b3bc !important;
  box-shadow: 0 8px 18px rgba(245,10,41,.1) !important;
}
html[data-account-palette=reference] body.aiva-standalone :is(.cm-task-num,.cm-score,.cm-lc-score) {
  color: #e60a27 !important;
}

/* Detail-page header and sheets; existing open/close transforms unchanged. */
html[data-account-palette=reference] body.aiva-standalone .cm-lp-head {
  background: linear-gradient(135deg,#e60a27,#f6314b) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(230,10,39,.22) !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-lp-head :is(h3,b,button) {
  color: #fff !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-sheet-mask {
  background: rgba(10,7,8,.45) !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-sheet :is(h3,.cm-rep-row) {
  color: #191415 !important;
  border-color: #f3f1f1 !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-sheet .cm-sheet-sub,
html[data-account-palette=reference] body.aiva-standalone .cm-sheet .cm-rep-row span {
  color: #64748b !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-sheet .cm-rep-row b {
  color: #e60a27 !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-sheet .cm-sheet-btns .pri,
html[data-account-palette=reference] body.aiva-standalone .cm-form-submit,
html[data-account-palette=reference] body.aiva-standalone .cm-li-save,
html[data-account-palette=reference] body.aiva-standalone .cm-addlog-btn {
  background: linear-gradient(135deg,#f6233f,#e30a27) !important;
  color: #fff !important;
  border-color: transparent !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-sheet .cm-sheet-btns .sec,
html[data-account-palette=reference] body.aiva-standalone .cm-li-cancel {
  background: #f5f3f3 !important;
  color: #e60a27 !important;
  border-color: #ece9e9 !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-form :is(input,select,textarea) {
  background: #fff !important;
  color: #191415 !important;
  border-color: #e6e2e3 !important;
}
html[data-account-palette=reference] body.aiva-standalone .cm-form :is(input,select,textarea):focus {
  border-color: #e60a27 !important;
  box-shadow: 0 0 0 2px #fff1f3 !important;
}

/* Bottom navigation is white, selected tab red. Safe-area dimensions preserved. */
html[data-account-palette=reference] body.aiva-standalone .c-mobile-tabbar {
  background: #fff !important;
  color: #64748b !important;
  border-color: #eee !important;
}
html[data-account-palette=reference] body.aiva-standalone .c-mobile-tabbar button {
  background: transparent !important;
  color: #64748b !important;
}
html[data-account-palette=reference] body.aiva-standalone .c-mobile-tabbar button.on,
html[data-account-palette=reference] body.aiva-standalone .c-mobile-tabbar button.active {
  color: #e60a27 !important;
}

/* Seven-stage funnel bars: RESTORE PRODUCTION baseline gradients that account-theme.css
 * flattens to a single accent via `.cm-hfn-bar{background:var(--acct-primary)}`. These are
 * the production values (they contain blue) — NOT an exact offline-reference mapping. */
html[data-account-palette=reference] body.aiva-standalone .cm-hfn-bar.cm-hfn-b0 { background: linear-gradient(180deg,#a9baff,#7d93ff) !important; }
html[data-account-palette=reference] body.aiva-standalone .cm-hfn-bar.cm-hfn-b1 { background: linear-gradient(180deg,#8ea5ff,#f6334d) !important; }
html[data-account-palette=reference] body.aiva-standalone .cm-hfn-bar.cm-hfn-b2 { background: linear-gradient(180deg,#7d93ff,#5b78ff) !important; }
html[data-account-palette=reference] body.aiva-standalone .cm-hfn-bar.cm-hfn-b3 { background: linear-gradient(180deg,#f6334d,#e60a27) !important; }
html[data-account-palette=reference] body.aiva-standalone .cm-hfn-bar.cm-hfn-b4 { background: linear-gradient(180deg,#5b78ff,#4058d8) !important; }
html[data-account-palette=reference] body.aiva-standalone .cm-hfn-bar.cm-hfn-b5 { background: linear-gradient(180deg,#e60a27,#3a53d6) !important; }
html[data-account-palette=reference] body.aiva-standalone .cm-hfn-bar.cm-hfn-b6 { background: linear-gradient(180deg,#4058d8,#2e42b8) !important; }

/* Horizontal funnel: fixed ordered silhouette, NOT a claim of monotonic conversion. */
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-hfunnel .cm-hfunnel-body{align-items:center;gap:2px;padding:10px 2px 6px;overflow-x:auto;overscroll-behavior-x:contain}
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-hfn-col{min-width:44px;gap:4px;flex:1 0 44px}
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-hfn-bar-wrap{height:72px;width:100%;align-items:center}
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-hfn-bar{width:100%;height:100%;min-height:0;border-radius:0;box-shadow:none;transition:none}
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-hfn-name{font-size:11px;white-space:normal;min-height:27px;line-height:1.25}
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-hfn-cnt{font-size:14px}
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-hfn-tip{color:var(--acct-muted,#64748b);font-size:10px;line-height:1.4}
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-hfn-col:focus-visible{outline:2px solid var(--acct-primary,#e60a27);outline-offset:2px}

/* Detail hero rename: readable on every account theme; no business/event changes. */
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-detail-hero .cm-name-edit{
 color:#fff!important;background:#32151e!important;border:1px solid #e8cdd4!important;
 font-size:12px!important;font-weight:600!important;font-style:normal!important;
 text-shadow:none!important;opacity:1!important;
}
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-detail-hero .cm-name-edit:hover,
html[data-aiva-product="mobile-crm"] body.aiva-standalone .cm-detail-hero .cm-name-edit:active{
 background:#4a2030!important;color:#fff!important;
}
