/* Theme B · 温暖品牌。调色板 hex 只写在本文件（对齐 docs/prd/references/tokens-b.reference.css）。
   无构建步骤。app/index.html 依次加载 styles.css、formal-closeout.css、本文件。
   本文件只通过入口 link 加载一次；调色板集中维护，主题覆盖规则最后生效。 */
:root{
  color-scheme:light;
  --font-sans:"PingFang SC","Microsoft YaHei","Noto Sans SC","Noto Sans CJK SC","Source Han Sans SC",system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-num:"SF Pro Text","Segoe UI","Roboto","Helvetica Neue",var(--font-sans);
  --fs-xs:12px;--fs-sm:13px;--fs-md:14px;--fs-base:15px;--fs-lg:16px;--fs-xl:20px;--fs-2xl:26px;--fs-kpi:30px;
  --lh-body:1.6;--lh-compact:1.35;--weight-title:700;--title-tracking:.01em;
  --sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;--sp-5:20px;--sp-6:24px;--sp-8:32px;
  --content-px:var(--sp-8);--content-py:28px;--content-max:1440px;--section-gap:var(--sp-5);--grid-gap:18px;--card-p:var(--sp-5);
  --sidebar-width:240px;--aside-width:316px;--topbar-h:60px;--nav-h:42px;--control-h:40px;--control-h-sm:34px;--control-h-touch:44px;
  --icon-size:18px;--icon-stroke:1.75;--kpi-icon:34px;
  --th-py:10px;--td-py:13px;--cell-px:var(--sp-4);--list-py:var(--sp-3);--badge-h:24px;--badge-px:9px;--badge-dot:block;
  /* Phase 3b: desktop list density; consumed only by scoped rules. */
  --dense-font:var(--fs-sm);--dense-lh:1.45;--dense-row-py:var(--sp-2);--dense-card-p:var(--sp-3);--dense-row-min-h:48px;
  --radius-sm:6px;--radius-md:8px;--radius-control:var(--radius-md);--radius-card:12px;--radius-badge:var(--radius-pill);--radius-pill:999px;
  --shadow-card:0 1px 2px rgba(60,40,20,.05),0 2px 8px rgba(60,40,20,.04);--btn-primary-shadow:0 1px 2px rgba(20,70,50,.25);
  --bg-page:#f6f2ec;--bg-surface:#fffdfa;--bg-subtle:#faf6f0;--bg-hover:#f7f1e8;--bg-input:#fffdfa;
  --text:#2a2520;--text-muted:#5a5046;--text-faint:#675c51;--text-disabled:#776b5f;
  --border:#e8dfd3;--border-strong:#d6cabb;--border-control:#9d8d7c;--card-border:#ebe3d8;--row-border:#f0e9df;--row-stripe:transparent;
  --primary:#1f6b4f;--primary-hover:#185a42;--primary-contrast:#ffffff;--link:#1b6448;--focus:#1f6b4f;--eyebrow:#b0385e;
  --brand-mark-bg:linear-gradient(135deg,#e46f8f,#b8395f);--brand-mark-text:#fff;
  --sidebar-bg:#efe8dd;--sidebar-text:#3a322a;--sidebar-muted:#6e6255;--sidebar-border:#e2d8ca;--sidebar-hover-bg:#e8dfd2;
  --sidebar-active-bg:#fffdfa;--sidebar-active-text:#1b5a42;--sidebar-active-icon:#1f6b4f;--sidebar-active-shadow:0 1px 3px rgba(60,40,20,.1);
  --nav-count-bg:#b8395f;--nav-count-text:#fff;--avatar-bg:#f6dce4;--avatar-text:#8e2a4a;
  --topbar-bg:rgba(246,242,236,.9);--topbar-solid:#f6f2ec;--topbar-border:#e8dfd3;
  --th-bg:#faf6f0;--th-text:#675c51;
  --tabs-bg:#f3ece2;--tabs-pad:3px;--tab-gap:2px;--tab-active-bg:#fffdfa;--tab-active-text:#1b5a42;--tab-active-shadow:0 1px 2px rgba(60,40,20,.12);
  --kpi-icon-bg:#e3f0e9;--kpi-icon-fg:#1f6b4f;
  --attention-bg:#fdf6e7;
  --st-warning-bg:#fbefd3;--st-warning-fg:#82480a;--st-warning-bd:#efd59b;--st-warning-dot:#c7780e;
  --b4-attention:#8a6514;
  --st-success-bg:#e3f0e9;--st-success-fg:#1b5e43;--st-success-bd:#b9d9c8;
  --st-danger-bg:#fbe7e5;--st-danger-fg:#a52a22;--st-danger-bd:#f0c0ba;--danger-dot:#c8382e;
  --st-info-bg:#e7eef4;--st-info-fg:#2f5671;--st-info-bd:#c4d4e1;
  --st-neutral-bg:#efe9e1;--st-neutral-fg:#5c5147;--st-neutral-bd:#ddd2c4;
  --st-progress-bg:#e3f0e9;--st-progress-fg:#1b5e43;--st-progress-bd:#b9d9c8;
  /* Neutral document paper and emphasized danger actions. */
  --preview-paper:#fff;--danger-strong:#7e3029;
  /* Category labels retain their palette, independently of status tokens. */
  --kind-expense-bg:#edf4ef;--kind-expense-fg:#41675d;
  --kind-expense-source-bg:#eef0fb;--kind-expense-source-fg:#4f5684;
  --kind-labor-bg:#e8f2ef;--kind-labor-fg:#245d50;
  --kind-site-bg:#e7eef4;--kind-site-fg:#315b76;
  --kind-project-bg:#eeeaf7;--kind-project-fg:#5d4d81;
  --kind-finance-bg:#edf0f8;--kind-finance-fg:#4d5f8b;
  --kind-cost-bg:#f5eee2;--kind-cost-fg:#795c2d;
  --kind-collection-bg:#f3eee7;--kind-collection-fg:#725b3e;
  --kind-labor-review-bg:#edf6f1;--kind-labor-review-fg:#39705b;
  --kind-opportunity-bg:#f3eefa;--kind-opportunity-fg:#604785;
  /* 既有壳层变量改读 Theme B，避免逐页改选择器。 */
  --page:var(--bg-page);
  --surface:var(--bg-surface);
  --surface-subtle:var(--bg-subtle);
  --surface-soft:var(--bg-subtle);
  --text-soft:var(--text-muted);
  --line:var(--border);
  --line-strong:var(--border-strong);
  --primary-active:var(--primary-hover);
  --primary-soft:var(--kpi-icon-bg);
  --success:var(--st-success-fg);
  --success-soft:var(--st-success-bg);
  --accent:var(--primary);
  --accent-hover:var(--primary-hover);
  --accent-soft:var(--kpi-icon-bg);
  --warning:var(--st-warning-fg);
  --warning-soft:var(--st-warning-bg);
  --warning-line:var(--st-warning-bd);
  --danger:var(--st-danger-fg);
  --danger-soft:var(--st-danger-bg);
  --neutral:var(--st-neutral-fg);
  --neutral-soft:var(--st-neutral-bg);
  --info:var(--st-info-fg);
  --info-strong:var(--st-info-fg);
  --info-soft:var(--st-info-bg);
  --shadow:var(--shadow-card);
  --focus-ring:rgba(31,107,79,.45);
  --focus-ring-strong:var(--focus);
  --ui-green:var(--primary);
  font-family:var(--font-sans);
}

body{font-family:var(--font-sans);background:var(--bg-page);color:var(--text)}

/* 主按钮是实心荷叶绿；已支付/进行中是浅绿标签，两者必须能分开。 */
.button--primary{border-color:var(--primary);background:var(--primary);color:var(--primary-contrast);box-shadow:var(--btn-primary-shadow)}
.button--primary:hover:not(:disabled){border-color:var(--primary-hover);background:var(--primary-hover)}
.brand__mark{border-radius:var(--radius-md);background:var(--brand-mark-bg);color:var(--brand-mark-text)}
.theme-icon{flex:none;width:var(--icon-size);height:var(--icon-size);stroke-width:var(--icon-stroke)}

.status-badge{display:inline-flex;align-items:center;gap:var(--space-1);min-height:var(--badge-h);padding:0 var(--badge-px);border:1px solid transparent;border-radius:var(--radius-badge);font-size:var(--fs-xs);font-weight:600;line-height:1.4}
.status-badge::before{content:"";width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:currentColor;display:var(--badge-dot)}
.status-badge--warning{background:var(--st-warning-bg);color:var(--st-warning-fg);border-color:var(--st-warning-bd)}
.status-badge--success{background:var(--st-success-bg);color:var(--st-success-fg);border-color:var(--st-success-bd)}
.status-badge--danger{background:var(--st-danger-bg);color:var(--st-danger-fg);border-color:var(--st-danger-bd)}
.status-badge--neutral{background:var(--st-neutral-bg);color:var(--st-neutral-fg);border-color:var(--st-neutral-bd)}
.status-badge--progress{background:var(--st-progress-bg);color:var(--st-progress-fg);border-color:var(--st-progress-bd)}
.formal-shell:has(.role-workspace, .formal-business-tabs) .formal-workspace__heading > .status-badge::before{content:none}

.app-bar{border-bottom:1px solid var(--topbar-border);background:var(--topbar-bg);backdrop-filter:saturate(1.4) blur(8px)}
.formal-shell,.formal-shell__main{background:var(--bg-page)}
.formal-shell__sidebar{width:var(--sidebar-width);border-right:1px solid var(--sidebar-border);background:var(--sidebar-bg);color:var(--sidebar-text)}
.formal-shell__main{margin-left:var(--sidebar-width)}
.formal-shell__sidebar .formal-auth-brand{border-bottom-color:var(--sidebar-border)}
.formal-shell__sidebar .formal-auth-brand small,.formal-shell__label{color:var(--sidebar-muted)}
.formal-mobile-header{background:var(--topbar-solid);border-bottom-color:var(--topbar-border)}
.formal-topbar,.formal-shell .formal-topbar{background:var(--topbar-bg);border-bottom-color:var(--topbar-border)}

#formalShell[data-ui-navigation]{--ui-green:var(--primary);background:var(--bg-page)}
#formalShell[data-ui-navigation] .formal-shell__sidebar{width:var(--sidebar-width);background:var(--sidebar-bg);color:var(--sidebar-text);border-right:1px solid var(--sidebar-border)}
#formalShell[data-ui-navigation] .formal-shell__main{margin-left:var(--sidebar-width);background:var(--bg-page)}
#formalShell[data-ui-navigation] .formal-business-navigation button{display:flex;align-items:center;gap:var(--sp-3);color:var(--sidebar-text);border-radius:var(--radius-md)}
#formalShell[data-ui-navigation] .formal-business-navigation button:hover{background:var(--sidebar-hover-bg)}
#formalShell[data-ui-navigation] .formal-business-navigation .theme-icon{color:var(--sidebar-muted)}
#formalShell[data-ui-navigation] .formal-business-navigation button.is-active{background:var(--sidebar-active-bg);color:var(--sidebar-active-text);box-shadow:var(--sidebar-active-shadow)}
#formalShell[data-ui-navigation] .formal-business-navigation button.is-active .theme-icon{color:var(--sidebar-active-icon)}
#formalShell[data-ui-navigation] .formal-shell__logout{border-top:1px solid var(--sidebar-border);border-radius:0;color:var(--sidebar-muted);background:transparent}
#formalShell[data-ui-navigation] .formal-topbar{background:var(--topbar-bg);border-bottom:1px solid var(--topbar-border);backdrop-filter:saturate(1.4) blur(8px)}
#formalShell[data-ui-navigation] #formalLocationLabel{color:var(--text-muted);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#formalShell[data-ui-navigation] #formalRoleMenu summary{background:var(--bg-surface);border-color:var(--border-control);border-radius:var(--radius-control)}
#formalShell[data-ui-navigation] #formalRoleMenu summary::before{content:"当前岗位";margin-right:var(--space-2);color:var(--text-muted);font-weight:500}
#formalShell[data-ui-navigation] #formalRoleNavigation{background:var(--bg-surface);border-color:var(--border)}
#formalShell[data-ui-navigation] .formal-workspace__heading h1{font-size:var(--fs-2xl);font-weight:800;letter-spacing:var(--title-tracking)}
#formalShell[data-ui-role="boss"]:is([data-ui-destination="workbench"],[data-ui-destination="overview"]) .formal-workspace__heading h1::before{content:"经营总览 · 只读";display:block;margin-bottom:var(--sp-1);color:var(--eyebrow);font-size:var(--fs-xs);font-weight:600;letter-spacing:.04em}
#formalShell[data-ui-navigation] .formal-workbench-panel,
#formalShell[data-ui-navigation] .formal-home-shortcuts,
#formalShell[data-ui-navigation] #projectView .project-identity{background:var(--bg-surface);border-color:var(--card-border);box-shadow:var(--shadow-card)}
#formalShell[data-ui-navigation] .formal-workbench-panel .batch-row,
#formalShell[data-ui-navigation] .formal-workbench-search input{background:var(--bg-surface)}
#formalShell[data-ui-navigation] .batch-workbench-tabs button[aria-pressed=true],
#formalShell[data-ui-navigation] .formal-project-groups button.is-active{color:var(--primary);border-bottom-color:var(--primary)}
#formalShell[data-ui-navigation] #projectView #projectSectionNavigationList [aria-current=location]{background:var(--sidebar-active-bg);color:var(--sidebar-active-text)}
#formalShell[data-ui-navigation] #projectView .project-shell-tools{background:var(--bg-page)}
#formalShell[data-ui-navigation] :is(button,summary,a,select,input,textarea):focus-visible{outline:2px solid var(--focus);outline-offset:3px}

@media (min-width:1021px){
  .order-workspace-sidebar{width:var(--sidebar-width);border-right:1px solid var(--sidebar-border);background:var(--sidebar-bg);color:var(--sidebar-text)}
  .order-workspace-sidebar__navigation button{color:var(--sidebar-text)}
  .order-workspace-sidebar__navigation button:hover{background:var(--sidebar-hover-bg);color:var(--sidebar-text)}
  .order-workspace-sidebar__navigation button.is-active{background:var(--sidebar-active-bg);color:var(--sidebar-active-text);box-shadow:var(--sidebar-active-shadow)}
  .order-workspace-sidebar__navigation button.is-active::before{border-color:var(--sidebar-active-icon);background:var(--sidebar-active-icon)}
  body:is([data-desktop-shell-role="order"],[data-desktop-shell-role="boss"],[data-desktop-shell-role="finance"],[data-desktop-shell-role="site"],[data-desktop-shell-role="employee"]) .app-bar{margin-left:var(--sidebar-width);background:var(--topbar-bg);backdrop-filter:saturate(1.4) blur(8px)}
}

@media (max-width:1023px){
  .formal-shell__sidebar,.formal-shell__main{width:auto;margin-left:0}
  #formalShell[data-ui-navigation] .formal-shell__sidebar{width:min(280px,calc(100% - 64px))}
  #formalShell[data-ui-navigation] .formal-shell__main{margin-left:0}
  :is(.formal-shell,.page-shell,.app-bar) .button--primary{min-height:44px}
  #formalShell[data-ui-navigation] .formal-mobile-header .button,
  #formalMobileMenuButton{min-height:44px}
}

/* 经营负责人工作台：暖底卡片、关注条、KPI。不改金额文本。 */
.boss-overview{gap:var(--section-gap)}
.boss-overview .boss-attention{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--sp-3) var(--sp-5);margin:0;padding:var(--sp-3) var(--sp-4);border:1px solid var(--st-warning-bd);border-radius:var(--radius-card);background:var(--attention-bg)}
.boss-overview .boss-attention__head{display:flex;align-items:center;gap:var(--sp-2);flex:none;color:var(--st-warning-fg)}
.boss-overview .boss-attention__head h2{margin:0;color:var(--st-warning-fg);font-size:var(--fs-md);font-weight:700}
.boss-overview .boss-attention__count{padding:0 var(--space-2);border-radius:var(--radius-pill);background:var(--st-warning-bg);color:var(--st-warning-fg);font-size:var(--fs-xs);font-weight:600;line-height:20px}
.boss-overview .boss-attention ul{display:flex;flex:1;flex-wrap:wrap;gap:var(--sp-2) var(--sp-5);margin:0;padding:0;list-style:none}
.boss-overview .boss-attention li{position:relative;display:flex;flex-wrap:wrap;gap:0 var(--sp-2);align-items:baseline;padding-left:var(--sp-4)}
.boss-overview .boss-attention li::before{content:"";position:absolute;left:0;top:.55em;width:6px;height:6px;border-radius:50%;background:var(--st-warning-dot)}
.boss-overview .boss-attention li strong{color:var(--text);font-size:var(--fs-sm);font-weight:600}
.boss-overview .boss-attention li span,.boss-overview .boss-attention .role-workspace-note{color:var(--text-muted);font-size:var(--fs-sm)}
.boss-overview .boss-metrics{border:0;padding:0;background:transparent}
.boss-overview .boss-metrics dl{gap:var(--grid-gap)}
.boss-overview .boss-metrics dl > div{display:flex;flex-direction:column;gap:var(--sp-2);min-width:0;padding:var(--card-p);border:1px solid var(--card-border);border-radius:var(--radius-card);background:var(--bg-surface);box-shadow:var(--shadow-card)}
.boss-overview .boss-metric__top{display:flex;align-items:center;gap:var(--sp-2);min-width:0}
.boss-overview .boss-metric__icon{display:grid;place-items:center;width:var(--kpi-icon);height:var(--kpi-icon);flex:none;border-radius:var(--radius-md);background:var(--kpi-icon-bg);color:var(--kpi-icon-fg)}
.boss-overview .boss-metric--warning .boss-metric__icon{background:var(--st-warning-bg);color:var(--st-warning-fg)}
.boss-overview .boss-metric__icon .theme-icon{width:18px;height:18px}
.boss-overview .boss-metrics dt{color:var(--text-muted);font-size:var(--fs-sm);font-weight:500}
.boss-overview .boss-metrics dd{margin:0;font-family:var(--font-num);font-size:var(--fs-kpi);font-weight:700;letter-spacing:-.01em;line-height:1.15}
.boss-overview .boss-metrics .boss-metric-money{font-size:var(--fs-2xl)}
.boss-overview .boss-metrics small{color:var(--text-muted)}
.boss-overview .formal-reimbursement-section{border:1px solid var(--card-border);border-radius:var(--radius-card);background:var(--bg-surface);box-shadow:var(--shadow-card)}
.boss-overview .boss-project-row,.boss-overview .boss-payment-row{border-bottom-color:var(--row-border)}
.boss-overview .boss-paid-amount{color:var(--st-success-fg);font-variant-numeric:tabular-nums}
.boss-overview .button--secondary{background:var(--bg-surface);border-color:var(--border-control)}

@media (max-width:1199px){
  .boss-overview .boss-metrics dl{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:600px){
  .boss-overview .boss-attention{flex-direction:column;align-items:stretch}
  .boss-overview .boss-attention ul{flex-direction:column}
  .boss-overview .boss-attention li{display:flex;flex-direction:column;gap:0}
  .boss-overview .boss-metrics{padding:0}
  .boss-overview .boss-metrics dl{gap:var(--sp-3)}
  .boss-overview .boss-metrics dl > div{padding:var(--sp-3) var(--sp-4)}
  .boss-overview .boss-metrics dd,
  .boss-overview .boss-metrics .boss-metric-money{font-size:var(--fs-xl)}
  .boss-overview .button{min-height:44px}
}

/* UI framework phase 1: menu group label, single-column home, deep-link highlight */
#formalShell[data-ui-navigation] .formal-business-navigation .formal-nav-group{margin:var(--sp-4) 0 var(--sp-1);padding:0 var(--sp-4);font-size:var(--fs-sm);color:var(--sidebar-muted, var(--text-faint));}
#formalShell[data-ui-navigation] #formalHomeLayout.formal-home-layout--single{grid-template-columns:minmax(0,1fr);}
.formal-deep-link-target{outline:2px solid var(--primary);outline-offset:4px;border-radius:var(--radius-md);scroll-margin-top:88px;transition:outline-color .6s ease;}
.formal-deep-link-target:focus{outline:2px solid var(--primary);}

/* 手机底部标签栏 + 岗位面板（Phase 2）。只在 1023px 以下出现；桌面不变。 */
.formal-tab-bar,.formal-role-sheet-button{display:none}
.formal-role-sheet{width:min(420px,100%);max-width:100%;max-height:calc(100dvh - 48px);margin:auto auto 0;padding:var(--sp-4) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom,0px));border:0;border-radius:16px 16px 0 0;background:var(--bg-surface);color:var(--text);box-shadow:0 -4px 24px rgba(40,30,20,.18);overflow:auto}
.formal-role-sheet::backdrop{background:#122b2350}
.formal-role-sheet__head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--sp-3);margin-bottom:var(--sp-3)}
.formal-role-sheet__head h2{margin:0;font-size:var(--fs-lg)}
.formal-role-sheet__head p{margin:var(--sp-1) 0 0;color:var(--text-muted);font-size:var(--fs-sm)}
.formal-role-sheet__head .button{min-height:44px}
.formal-role-sheet__roles{display:grid;gap:var(--sp-2)}
.formal-role-sheet__role{display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);min-height:48px;padding:0 var(--sp-4);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-surface);color:var(--text);font:inherit;font-size:var(--fs-base);text-align:left;cursor:pointer}
.formal-role-sheet__role.is-active{border-color:var(--primary);background:var(--sidebar-active-bg);color:var(--sidebar-active-text);font-weight:600}
.formal-role-sheet__role small{color:var(--primary);font-size:var(--fs-xs);font-weight:600}
.formal-role-sheet__account{display:grid;gap:var(--sp-2);margin-top:var(--sp-4);padding-top:var(--sp-4);border-top:1px solid var(--border)}
.formal-role-sheet__account .button{min-height:44px;width:100%}
.formal-role-sheet__logout{color:var(--danger,#a33a2a)}
.formal-role-sheet :is(button):focus-visible{outline:2px solid var(--focus);outline-offset:2px}

@media (max-width:1023px){
  #formalShell[data-ui-navigation]{--tab-bar-height:60px}
  #formalShell[data-ui-navigation] .formal-role-sheet-button{display:inline-flex;align-items:center;gap:var(--sp-1);min-height:44px;min-width:0;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  #formalShell[data-ui-navigation] .formal-role-sheet-button [data-role-sheet-label]{min-width:0;overflow:hidden;text-overflow:ellipsis}
  /* 退出登录 / 修改密码 只在岗位面板里（一处）。 */
  #formalShell[data-ui-navigation] :is(#formalMobilePassword,#formalLogout){display:none}
  #formalShell[data-ui-navigation][data-tab-bar] #formalMobileMenuButton{display:none}
  #formalShell[data-ui-navigation][data-tab-bar] .formal-tab-bar:not([hidden]){position:fixed;z-index:30;left:0;right:0;bottom:0;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);min-height:var(--tab-bar-height);padding:0 env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);border-top:1px solid var(--topbar-border,var(--border));background:var(--topbar-solid,var(--bg-surface));box-shadow:0 -1px 6px rgba(40,30,20,.06)}
  #formalShell[data-ui-navigation][data-typing] .formal-tab-bar{display:none!important}
  .formal-tab-bar__item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:var(--tab-bar-height,60px);padding:6px 2px;border:0;background:transparent;color:var(--text-muted);font:inherit;font-size:var(--fs-xs);line-height:1.2;cursor:pointer}
  .formal-tab-bar__item span{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  .formal-tab-bar__icon{width:24px;height:24px;padding:2px 14px;box-sizing:content-box;border-radius:14px}
  .formal-tab-bar__item.is-active{color:var(--sidebar-active-text,var(--primary));font-weight:600}
  .formal-tab-bar__item.is-active .formal-tab-bar__icon{background:var(--primary-soft,#e6f0ea);color:var(--primary)}
  .formal-tab-bar__item:focus-visible{outline:2px solid var(--focus);outline-offset:-4px;border-radius:12px}
  /* 页面最下面的提交按钮、分页不被底栏挡住。 */
  #formalShell[data-ui-navigation][data-tab-bar] :is(.formal-workspace,.formal-shell__main > #projectView[data-formal-project-detail=true]){padding-bottom:calc(var(--tab-bar-height) + var(--sp-6,24px) + env(safe-area-inset-bottom,0px))}
  #formalShell[data-ui-navigation][data-tab-bar] .formal-action-target,#formalShell[data-ui-navigation][data-tab-bar] .formal-deep-link-target{scroll-margin-bottom:calc(var(--tab-bar-height) + 16px)}
  body:has(#formalShell[data-tab-bar]:not([hidden]):not([data-typing])) .toast[data-formal-feedback]{bottom:calc(var(--tab-bar-height,60px) + 12px + env(safe-area-inset-bottom,0px))}
  /* cb3-r1 C：底栏上面还有「提交」条时，提示条再抬高一条的高度，不压住提交按钮。 */
  body:has(#formalShell[data-tab-bar]:not([hidden]):not([data-typing])):has(.formal-organizer-submit) .toast[data-formal-feedback]{bottom:calc(var(--tab-bar-height,60px) + 96px + env(safe-area-inset-bottom,0px))}
}
@media (max-width:599px){
  #formalShell #formalRoleSheetButton{grid-column:2;grid-row:1;justify-self:start}
  #formalShell[data-ui-navigation][data-tab-bar] .formal-mobile-header{grid-template-columns:minmax(0,1fr) auto}
  #formalShell[data-ui-navigation][data-tab-bar] #formalRoleSheetButton{grid-column:1}
  #formalShell[data-ui-navigation][data-tab-bar] .formal-mobile-header [data-assistant-toggle]{grid-column:2}
}
/* UI 框架第 3 期：项目页 4 个标签 + 小节折叠 + 手机去掉第二层下拉 */
#projectView .ui-section-toggle{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:32px;margin:0 var(--space-1) 0 calc(-1 * var(--space-1));padding:0;border:0;border-radius:var(--radius-small);background:transparent;color:var(--text-soft);cursor:pointer;vertical-align:middle;flex:none}
#projectView .ui-section-toggle::before{content:"";width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-top:-4px;transition:transform .15s}
#projectView .ui-section-toggle[aria-expanded=false]::before{transform:rotate(-45deg);margin-top:0;margin-left:-3px}
#projectView .ui-section-toggle:hover{background:var(--primary-soft);color:var(--primary)}
#projectView .ui-section-toggle:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
#projectView h2.ui-section-title{display:inline;cursor:pointer;vertical-align:middle}
#projectView .ui-section-toggle + h2.ui-section-title + p{margin-top:var(--space-1)}
#projectView .ui-section-collapsed:has(.ui-section-toggle) > :not(:has(.ui-section-toggle),.ui-section-toggle,.ui-section-title),
#projectView .ui-section-collapsed :has(> .ui-section-toggle) > :not(.ui-section-toggle,.ui-section-title),
#projectView .ui-section-collapsed :has(.ui-section-toggle) > :not(:has(.ui-section-toggle),.ui-section-toggle,.ui-section-title){display:none!important}
#projectView .ui-section-collapsed{padding-top:var(--space-3);padding-bottom:var(--space-3)}
#projectView .ui-section-collapsed .panel-heading{margin-bottom:0}
@media (max-width:1023.98px){
  #formalShell[data-ui-navigation] #projectView #projectSectionNavigation{display:none!important}
  #formalShell[data-ui-navigation] #projectView > .project-shell-tools{display:flex!important;flex-wrap:wrap;gap:var(--space-2)}
  #formalShell[data-ui-navigation] #projectView .formal-project-groups{overflow-x:visible;gap:0}
  #formalShell[data-ui-navigation] #projectView .formal-project-groups button{flex:1 1 0;min-width:0;padding:var(--space-2) 2px;white-space:nowrap;font-size:var(--fs-sm)}
  #formalShell[data-ui-navigation] #projectView .project-back-button{max-width:100%}
}
#projectView .panel-heading:has(> .ui-section-toggle){justify-content:flex-start}
#projectView .panel-heading > .ui-section-toggle + h2 + *{margin-left:auto}

/* 报销第 5 批（V0.2-35）：财务审核每行标签、有标记排前、没标记一键通过、退回常用原因 */
.formal-review-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.formal-review-tag { font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: #eef6ee; color: #2f6b34; border: 1px solid #b9dcbc; }
.formal-review-tag.is-flag { background: #fff4e5; color: #8a4b00; border-color: #f0c48a; }
.formal-finance-item.is-flagged { border-left: 3px solid #f0a73a; }
.formal-clean-approve { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.formal-clean-approve .button, .formal-return-presets .button { min-height: var(--control-h-touch, 44px); }
.formal-return-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.formal-return-presets[hidden] { display: none; }
/* 我的报销两层（V0.2-36）：① 传照片（九宫格 + 第N张 + 每张状态）→ ② 看一遍（一次一件事）。 */
.formal-two-level .formal-claim-steps{margin:0;color:var(--text-muted,#646a73);font-size:13px}
.formal-two-level .formal-claim-steps b{color:var(--primary,#1664ff)}
.formal-upload-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:var(--space-3,12px) 0}
@media (min-width:720px){.formal-upload-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
.formal-tile{position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;background:var(--surface-muted,#eef0f3);min-width:0}
.formal-tile__body{display:block;position:relative;width:100%;height:100%;padding:0;border:0;background:none;cursor:default;font:inherit;color:inherit}
.formal-tile__body img,.formal-tile__body .formal-voucher-thumbnail,.formal-tile__body .formal-voucher-thumbnail img{width:100%;height:100%;object-fit:cover;display:block;margin:0;border-radius:0}
.formal-tile__icon{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:14px;color:var(--text-muted,#646a73)}
.formal-tile__no{position:absolute;left:4px;top:4px;padding:0 6px;border-radius:6px;background:rgba(0,0,0,.6);color:#fff;font-size:12px;line-height:20px}
.formal-tile__st{position:absolute;left:0;right:0;bottom:0;padding:3px 2px;background:rgba(0,0,0,.55);color:#fff;font-size:12px;text-align:center;line-height:16px}
.formal-tile.is-ok .formal-tile__st{background:rgba(46,125,50,.88)}
.formal-tile.is-unread .formal-tile__st{background:rgba(176,96,0,.9)}
.formal-tile.is-failed{outline:3px solid #e53935;outline-offset:-3px}
.formal-tile.is-failed .formal-tile__body{cursor:pointer}
.formal-tile.is-failed .formal-tile__st{background:#e53935}
.formal-tile__bar{position:absolute;left:0;bottom:0;height:4px;background:var(--primary,#1664ff)}
.formal-tile__del{position:absolute;right:0;top:0;width:44px;height:44px;border:0;background:none;color:#fff;font-size:20px;line-height:1;cursor:pointer;text-shadow:0 0 3px #000}
.formal-tile [data-voucher-delete]{background:rgb(0 0 0 / 70%);border-radius:0 0 0 12px;text-shadow:none}
.formal-tile__no,.formal-tile__st{pointer-events:none}
.formal-voucher-snackbar{position:fixed;z-index:1200;left:50%;bottom:calc(88px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);display:flex;align-items:center;justify-content:space-between;gap:16px;width:max-content;max-width:calc(100vw - 24px);padding:6px 8px 6px 16px;border-radius:12px;background:var(--text,#202824);color:var(--surface,#fff);box-shadow:0 4px 16px rgb(0 0 0 / 18%)}
.formal-voucher-snackbar button{min-width:60px;min-height:44px;border:0;border-radius:8px;background:transparent;color:inherit;font:inherit;text-decoration:underline;cursor:pointer}
.formal-voucher-snackbar button:focus-visible,.formal-tile__del:focus-visible{outline:2px solid currentColor;outline-offset:-4px}
.formal-private-preview.formal-voucher-sheet{position:fixed;inset:auto 0 0;margin:0 auto;width:min(720px,100%);max-width:100%;max-height:90dvh;border-radius:16px 16px 0 0;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));overflow:auto}
.formal-voucher-sheet > img,.formal-voucher-sheet > iframe{height:48dvh}
.formal-voucher-sheet .formal-private-preview__heading{display:flex;align-items:center;justify-content:space-between}
.formal-voucher-sheet__facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.formal-voucher-sheet__facts div{min-width:0;overflow-wrap:anywhere}
.formal-voucher-sheet__facts dt{color:var(--text-soft)}
.formal-voucher-sheet__facts dd{margin:4px 0 12px}
.formal-voucher-sheet button{min-height:44px}
.eac-batch-confirm{padding-block:16px;margin-block:8px 16px;border-block:1px solid var(--border);overflow-wrap:anywhere}
.eac-batch-confirm .button{margin:4px 8px 4px 0;white-space:normal}
.formal-tile__why{position:absolute;left:0;right:0;bottom:22px;padding:2px 4px;background:rgba(255,255,255,.92);color:#c62828;font-size:11px;line-height:14px;text-align:center}
.formal-tile--add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:2px dashed var(--border,#c9cdd4);background:var(--surface,#fff);color:var(--text-muted,#646a73);font-size:14px;cursor:pointer}
.formal-tile--add span{font-size:28px;line-height:1}
.formal-tile--add input{display:none}
.formal-upload-banner{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:var(--space-3,12px);padding:10px 12px;border-radius:10px;background:#e8f0fe;color:#1a4fd6}
.formal-upload-banner small{display:block;margin-top:2px;font-size:13px}
.formal-upload-banner.is-failed{background:#fff1f0;color:#b71c1c}
.formal-upload-banner.is-ok{background:#e8f5e9;color:#2e7d32}
.formal-upload-banner .button{flex:none;min-height:44px}
.formal-voucher-details{margin-top:var(--space-2,8px)}
.formal-voucher-details>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;cursor:pointer;color:var(--text-muted,#646a73)}
.formal-upload-foot{position:sticky;bottom:0;z-index:15;display:grid;gap:6px;margin:var(--space-3,12px) calc(-1 * var(--space-3,12px)) 0;padding:var(--space-2,8px) var(--space-3,12px) calc(var(--space-2,8px) + env(safe-area-inset-bottom,0px));background:var(--surface,#fff);border-top:1px solid var(--border,#e5e6eb)}
.formal-upload-foot small{text-align:center;color:var(--text-muted,#646a73)}
.formal-upload-foot .button{width:100%;min-height:48px}
#formalShell[data-ui-navigation][data-tab-bar]:not([data-typing]) .formal-upload-foot{bottom:calc(var(--tab-bar-height,60px) + env(safe-area-inset-bottom,0px));padding-bottom:var(--space-2,8px)}
.formal-review-head h2{margin:2px 0;font-size:20px}
.formal-review-prog{display:flex;gap:4px;margin:var(--space-2,8px) 0}
.formal-review-prog i{flex:1;height:4px;border-radius:2px;background:var(--border,#e5e6eb)}
.formal-review-prog i.is-current{background:var(--primary,#1664ff)}
.formal-review-card{margin:var(--space-3,12px) 0;padding:14px;border-radius:12px;background:var(--surface,#fff);border:1px solid var(--border,#e5e6eb);box-shadow:0 1px 3px rgba(0,0,0,.06)}
.formal-review-pos{color:var(--text-muted,#646a73)}
.formal-review-prob{display:flex;gap:12px;margin-top:8px}
.formal-review-prob p{margin:0 0 4px;font-size:16px;font-weight:600}
.formal-review-prob small{color:var(--text-muted,#646a73)}
.formal-review-thumb{position:relative;flex:none;width:72px;height:72px;border-radius:8px;overflow:hidden;background:var(--surface-muted,#eef0f3)}
.formal-review-thumb .formal-voucher-thumbnail,.formal-review-thumb img{width:100%;height:100%;object-fit:cover;margin:0}
.formal-review-no{position:absolute;left:2px;top:2px;padding:0 4px;border-radius:4px;background:rgba(0,0,0,.6);color:#fff;font-size:11px;line-height:16px}
.formal-review-acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.formal-review-acts>*{flex:1 1 140px;min-height:44px}
.formal-review-skip{text-align:right;margin-top:4px}
.formal-review-card .formal-expense-form{margin-top:12px}
.formal-review-done{margin:var(--space-3,12px) 0;padding:10px 12px;border-radius:10px;background:#e8f5e9;color:#2e7d32}
.formal-review-list{margin-top:var(--space-3,12px)}
.formal-review-list__title{margin:0 0 4px;color:var(--text-muted,#646a73);font-size:13px}
.formal-review-row>summary{cursor:pointer}
.formal-row-differs{grid-column:1/-1}
.formal-row-differs>summary{min-height:44px;display:flex;align-items:center;color:var(--primary,#1664ff);cursor:pointer}
.formal-review-more{margin-top:var(--space-3,12px)}
.formal-review-more>summary{min-height:44px;display:flex;align-items:center;color:var(--text-muted,#646a73);cursor:pointer}
.formal-review-manual{display:grid;gap:8px;margin-top:var(--space-2,8px)}
.formal-organizer-submit [data-formal-stage]{flex-basis:100%;text-align:center}
/* 两层：「分天算」勾选框在手机上不被通用输入框样式撑大 */
.formal-claim-perday{min-height:44px;white-space:nowrap}
.formal-claim-perday input[type=checkbox]{width:20px;height:20px;min-height:0;margin:0;flex:none}
