/* PHASE 9 / C2 · responsive scale (single source of truth): 640 / 900 / 1200.
   Tiers: <=640 phone | 641-900 tablet | 901-1200 desktop | >=1201 wide.
   min-width rules use tier+1px (641 / 901 / 1201) so tiers never overlap.
   Legacy values are pinned in build_v9.py::pin_tier; NEW breakpoints must use
   one of the six values above. CSS custom properties are not valid inside
   @media conditions, so this comment is the canonical spec. */
/* ==================================================================
   YouYuan Unified UI  /  phase 1  /  2026-11-09
   One shared overlay for portal, reconciliation and contract screens.
   Baseline: #115846 forest / #BD8F5E amber / #607068 slate.
   Rules below are additive: original layout rules are preserved.
   ================================================================== */
:root{
  --yy-brand:#115846;
  --yy-brand-deep:#0C4335;
  --yy-amber:#BD8F5E;
  --yy-amber-ink:#8A6238;
  --yy-slate:#607068;
  --yy-soft:#E8F0EE;
  --yy-paper:#F6F8F7;
  --yy-line:#DCE6E1;
  --yy-ink:#20352D;
  --yy-success:#20704A;
  --yy-warn:#B07A22;
  --yy-danger:#B34642;
  --yy-r-sm:8px;
  --yy-r-md:12px;
  --yy-r-lg:16px;
  --yy-t:150ms ease;
  --yy-sh:0 1px 2px rgba(17,88,70,.06),0 4px 16px rgba(17,88,70,.06);
  --yy-sh-md:0 8px 24px rgba(17,88,70,.10);
}

/* Workbench palette shared by the portal and business screens. */
:root {
  --work-ink: #20352D;
  --work-muted: var(--yy-slate);
  --work-green: var(--yy-brand);
  --work-sidebar: var(--yy-brand-deep);
  --work-selected: var(--yy-soft);
  --work-line: var(--yy-line);
  --work-paper: var(--yy-paper);
}
a.work-entry { color: var(--work-green); font-weight: 650; }
.work-hub .work-layout { display: grid; grid-template-columns: clamp(224px, 17vw, 256px) minmax(0, 1fr); min-height: 100vh; }
.work-hub .work-sidebar { background: var(--work-sidebar); color: #EDF5F1; padding: 30px 18px; }
.work-hub .work-sidebar strong { display: block; font-size: 21px; }
.work-hub .work-sidebar small { color: #A8C4B6; }
.work-hub .work-sidebar nav { display: grid; gap: 8px; margin-top: 26px; }
.work-hub .work-sidebar nav a { padding: 12px 14px; border-radius: 10px; color: #EDF5F1; text-decoration: none; }
.work-hub .work-sidebar nav a[aria-current] { background: var(--work-selected); color: var(--work-sidebar); font-weight: 650; }
.work-hub .work-main { min-width: 0; }
.work-hub header { min-height: 70px; }
.work-hub .work-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.work-hub .work-grid .card { margin: 0; border-radius: 14px; }
.work-hub .work-grid .card:hover { border-color: var(--work-green); background: #f7fbf8; }
.work-hub .work-grid .card p { margin-bottom: 0; }
.work-hub #message:empty { display: none; }
.work-hub .work-password summary { font-weight: 650; cursor: pointer; }
.work-hub .work-password form { margin-top: 16px; }
@media(max-width: 1200px) { .work-hub .work-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 640px) {
  .work-hub .work-layout { display: block; }
  .work-hub .work-sidebar { padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  .work-hub .work-sidebar nav { margin: 0; }
  .work-hub .work-grid { grid-template-columns: 1fr; }
}
body.work-contract { --primary:var(--work-green); --primary-dark:var(--work-sidebar); --primary-soft:var(--work-selected); --bg:var(--work-paper); --text:var(--work-ink); --muted:var(--work-muted); --border:var(--work-line); font-size:16px; }
.work-contract .topbar { min-height:64px; height:auto; background:var(--work-sidebar); color:#EDF5F1; padding-block:8px; gap:8px; flex-wrap:wrap; }
.work-contract .topbar .brand,.work-contract .topbar .brand-sub,.work-contract .topbar a { color:#EDF5F1!important; }
.work-contract .topbar .brand-mark { background:var(--work-selected); color:var(--work-sidebar); }
.pdd-app .pdd-module-nav { background:var(--work-sidebar); color:#EDF5F1; border-color:var(--work-sidebar); }
.pdd-app .pdd-module-nav span { color:#C6DCD1; }
.pdd-app .pdd-module-nav button { border-radius:10px; }
.pdd-app .pdd-module-nav button[aria-current] { background:var(--work-selected); color:var(--work-sidebar); }
.pdd-app .pdd-header-account a { color:var(--work-green); }
.pdd-app .pdd-module-nav { padding: 6px 12px; border-radius: 12px; }
.pdd-app .pdd-module-nav button:not([aria-current]) { color: #EDF5F1; }
.pdd-app .pdd-module-nav button:not([aria-current]):hover { background: #1B5A48; color: white; }
/* Shared workspace navigation, headings, and account actions. */
.pdd-app > .pdd-module-nav {
  gap: 6px;
  padding: 10px;
}
.pdd-app > .pdd-module-nav > span { margin: 0; padding: 4px 8px; }
.pdd-app > .pdd-module-nav > button { text-align: left; }
@media (min-width: 1201px) {
  .pdd-app.yy-has-module-nav {
    --work-rail-width: clamp(164px, 15vw, 224px);
    position: relative;
    padding-inline-start: calc(var(--work-rail-width) + 20px);
  }
  .pdd-app > .pdd-module-nav {
    position: absolute;
    inset: 0 auto auto 0;
    width: var(--work-rail-width);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px 12px;
  }
  .pdd-app > .pdd-module-nav > button { min-height: 44px; }
}
.pdd-app .pdd-header-title h2 { font-size: clamp(21px, 2vw, 29px); line-height: 1.35; }
.pdd-app .work-account-menu { position: relative; margin: 0; padding: 0; }
.pdd-app .work-account-menu > summary { cursor: pointer; padding: 5px 8px; }
.pdd-app .work-account-actions {
  display: grid; gap: 6px; position: absolute; z-index: 30; right: 0; top: 100%;
  width: max-content; max-width: calc(100vw - 32px); padding: 10px;
  background: white; border: 1px solid var(--work-line); border-radius: 10px;
  box-shadow: 0 4px 16px #0C433518;
}
.pdd-app .work-account-actions > a { display: block; padding: 6px 8px; }
.pdd-app .work-quick-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pdd-app .work-quick-actions button { min-height: 36px; color: var(--work-green); font-weight: 600; }
.work-contract .nav { background: var(--work-sidebar); padding: 14px 12px; }
.work-contract .nav-btn { color: #EDF5F1; }
.work-contract .nav-btn:hover { background: #1B5A48; }
.work-contract .nav-btn.active { color: var(--work-sidebar); background: var(--work-selected); }
.work-contract .page-head h2 { font-size: clamp(21px,2vw,29px); }
@media(min-width: 901px) {
  .work-contract .nav { top: 64px; width: 224px; overflow-y: auto; }
  .work-contract main { margin-left: 224px; }
}
/* Align the hosted finance chrome with the workspace column. */
html.yy-data-app:root {
  --data-app-safe-chrome-width: min(1440px, calc(100% - 32px));
  --data-app-safe-chrome-margin: auto;
  --data-app-safe-chrome-inset-start: 0px;
  --data-app-safe-chrome-inset-end: 0px;
}
.pdd-archive-costs .archive-cost-batch {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}
.pdd-archive-costs .archive-cost-batch > input {
  width: clamp(148px, 14vw, 205px);
}
.pdd-app .pdd-archive-costs .archive-cost-only-blank {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  padding-inline: 5px;
  cursor: pointer;
}
.pdd-app .pdd-archive-costs input[type="checkbox"] {
  appearance: auto;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  padding: 0;
  margin: 0;
  vertical-align: middle;
  accent-color: var(--work-green);
}
.pdd-app .pdd-archive-costs .pdd-table th:first-child,
.pdd-app .pdd-archive-costs .archive-cost-select {
  width: 54px;
  text-align: center;
  padding-inline: 8px;
}
@media(max-width:640px) {
  .pdd-archive-costs .archive-cost-batch > input { flex: 1 1 135px; min-width: 0; }
  .pdd-app .pdd-archive-costs .pdd-table-wrap[data-view="cards"] .archive-cost-select {
    width: auto;
    text-align: left;
  }
}
html.yy-data-app:root .dashboard-tabs-inner {
  width: min(1440px, calc(100% - 32px));
  margin-inline: auto;
  padding-inline: 0;
}
.pdd-app[data-page="costs"] .pdd-archive-costs .pdd-table td.archive-cost-select input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
}
@media(min-width: 641px) {
  html.yy-data-app:root .dashboard-tabs-inner {
    width: min(1440px, calc(100% - 64px));
  }
}
.shop-directory > .shop-editor { margin: 0 0 8px; }
.archive-select-all { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.pdd-app .pdd-archive-costs .pdd-table th:first-child,
.pdd-app .pdd-archive-costs .archive-cost-select { width: 72px; }
@media(min-width: 1201px) {
  html.yy-data-app:root main.page[data-data-app-content="dashboard"] {
    --data-app-dashboard-content-width: calc(100vw - 64px);
    width: 100%;
    max-width: 100%;
  }
  html.yy-data-app:root .dashboard-tabs-inner {
    width: calc(100% - 64px);
  }
}
.access-admin { max-width: 1440px; }
.access-admin .admin-sections a { padding: 7px 12px; border: 1px solid var(--work-line); border-radius: 8px; background: white; text-decoration: none; }
.access-heading { justify-content: space-between; margin-bottom: 12px; }
.access-heading h2 { margin: 0; }
#account-matrix th { background: #E8F0EE; white-space: nowrap; }
#account-editor[hidden],.access-admin #shops[hidden] { display: none; }
.access-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.access-grid label { border: 1px solid var(--work-line); border-radius: 10px; padding: 12px; font-weight: 600; }
.access-grid small { color: var(--work-muted); font-weight: 400; }
@media(max-width:640px) { .access-grid { grid-template-columns: 1fr; } }
.work-hub .work-main > main { max-width: none; padding-inline: clamp(16px,3vw,48px); }
.work-hub .work-main > header nav { flex-wrap: wrap; }
@media(max-width:640px) {
  .work-hub .work-sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .work-hub .work-sidebar nav a { padding: 8px 10px; }
}
/* Hosted reconciliation shares the workbench's grouped side navigation. */
html.yy-data-app:root .dashboard-tabs-collapse { display: none; }
html.yy-data-app:root .dashboard-root { --dashboard-tabs-visible-height: 0px; }
.finance-workspace-menu { background: var(--work-sidebar); color: #EDF5F1; border-radius: 12px; padding: 14px; }
.finance-workspace-brand { display: grid; gap: 2px; padding: 4px 8px 10px; }
.pdd-app .finance-workspace-brand small,.finance-menu-group > span { color: #A8C4B6; font-size: 12px; }
.finance-menu-group { display: grid; gap: 3px; padding-block: 5px; }
.finance-menu-group > span { padding-inline: 8px; }
.pdd-app .finance-menu-group button,.pdd-app .finance-menu-toggle {
  background: transparent; color: #EDF5F1; border: 0; border-radius: 8px; text-align: left; min-height: 36px; padding: 6px 10px;
}
.pdd-app .finance-menu-group button:hover { background: #1B5A48; }
.pdd-app .finance-menu-group button[aria-current="page"] { background: var(--work-selected); color: var(--work-sidebar); font-weight: 650; }
.pdd-app .finance-menu-toggle { display: none; }
@media(min-width:1201px) {
  .pdd-app.yy-has-rail { position: relative; padding-inline-start: 244px; }
  .finance-workspace-rail { position: absolute; inset: 0 auto 0 0; width: 224px; }
  .finance-workspace-menu { position: sticky; top: 64px; max-height: calc(100dvh - 76px); overflow: auto; }
}
@media(max-width:1200px) {
  .finance-workspace-rail { margin-bottom: 10px; }
  .finance-workspace-brand { display: none; }
  .pdd-app .finance-menu-toggle { display: block; width: 100%; }
  .finance-workspace-menu { padding: 6px 10px; }
  .finance-workspace-menu nav[data-expanded="false"] { display: none; }
  .finance-workspace-menu nav[data-expanded="true"] { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 8px; }
}
html.yy-data-app:root .dashboard-topbar {
  border-bottom: 0;
  box-shadow: none;
}
.overview-months { margin: 16px 0; }
.overview-table { min-width: 760px; font-variant-numeric: tabular-nums; }
.overview-table :is(th,td):not(:first-child) { text-align: right; }
.overview-table tfoot { background: #E8F0EE; font-weight: 650; }
.overview-trend { display: grid; gap: 5px; margin-bottom: 16px; }
.overview-trend-row { display: grid; grid-template-columns: 72px 1fr; gap: 8px; align-items: center; }
.overview-track { height: 6px; margin-block: 3px; background: #E8F0EE; }
.overview-track i { display: block; height: 100%; background: var(--work-green); }
.overview-track i.shop { background: #6E9A82; }
html.yy-data-app:root section.theme-drawer:not(.is-open) {
  display: none;
}
html.yy-data-app:root .dashboard-topbar { display: none; }
html.yy-data-app:root .dashboard-root { --dashboard-topbar-base-height: 0px; }
@media(min-width:1201px) {
  .finance-workspace-menu { top: 16px; max-height: calc(100dvh - 32px); }
}
.finance-menu-group a { color: #EDF5F1; text-decoration: none; border-radius: 8px; padding: 6px 10px; min-height: 36px; }
.finance-menu-group a:hover { background: #1B5A48; }
#otherBills table { min-width: 790px; }
#otherBills td small { display: block; color: var(--work-muted); }
#otherBills details p { min-width: 160px; white-space: pre-wrap; overflow-wrap: anywhere; }


/* ==================================================================
   PHASE 1 · unified shell / tokens / components / system switcher
   Appended 2026-11-09. No markup, business logic or data changes.
   ================================================================== */

/* 1 · Accessibility: focus ring, reduced motion, numeric alignment */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,
textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible{
  outline:3px solid rgba(17,88,70,.38);outline-offset:2px;
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:.01ms!important;scroll-behavior:auto!important;
  }
}

/* 2 · Portal palette: override hardcoded colors in views.py STYLE */
body.yy-auth-login,body.yy-work-hub{
  background:var(--yy-paper);color:var(--yy-ink);
  font-family:"PingFang SC","Microsoft YaHei",system-ui,-apple-system,"Segoe UI",sans-serif;
}
body.yy-work-hub a,body.yy-auth-login a{color:var(--yy-brand)}
body.yy-work-hub :is(p,th,.hint,small),body.yy-auth-login :is(p,th,.hint,small){color:var(--yy-slate)}
body.yy-work-hub :is(section,.card),body.yy-auth-login :is(section,.card){
  border-color:var(--yy-line);border-radius:var(--yy-r-md);
}
body.yy-work-hub header{border-color:var(--yy-line)}
body.yy-work-hub button.primary,body.yy-auth-login button.primary{
  background:var(--yy-brand);border-color:var(--yy-brand);
}
body.yy-work-hub button.primary:hover,body.yy-auth-login button.primary:hover{
  background:var(--yy-brand-deep);border-color:var(--yy-brand-deep);
}
body.yy-work-hub :is(input,select,textarea),body.yy-auth-login :is(input,select,textarea){
  border-color:#C9D9D0;
}
body.yy-work-hub :is(input,select,textarea):focus,body.yy-auth-login :is(input,select,textarea):focus{
  border-color:var(--yy-brand);
}
body.yy-work-hub .notice,body.yy-auth-login .notice{
  border-left-color:var(--yy-amber);background:#FBF6EF;color:var(--yy-amber-ink);
}
body.yy-work-hub table,body.yy-auth-login table{font-variant-numeric:tabular-nums}

/* 3 · Login brand split — pure CSS, no views.py change, no restart */
@media(min-width:901px){
  body.yy-auth-login{
    position:relative;min-height:100vh;display:flex;align-items:center;justify-content:flex-end;
    padding:0 clamp(40px,9vw,160px) 0 0;
    background:linear-gradient(90deg,#0C4335 0 50%,var(--yy-paper) 50% 100%);
  }
  body.yy-auth-login::before{
    content:"友圆贸易";position:absolute;left:clamp(48px,9vw,160px);top:35%;
    font-size:clamp(34px,3.4vw,50px);font-weight:650;letter-spacing:.08em;color:#fff;
  }
  body.yy-auth-login::after{
    content:"YOUYUAN TRADING  /  BUSINESS WORKSPACE\A\A 合同管理 · 店铺经营对账 · 运费计算 · ERPNext\A 一套账号，贯通业务全流程。";
    white-space:pre-wrap;position:absolute;left:clamp(48px,9vw,160px);top:calc(35% + 88px);
    max-width:430px;font-size:14px;line-height:2;letter-spacing:.03em;color:#BFD8CD;
  }
  body.yy-auth-login > main.login{margin:0;width:min(420px,42vw);max-width:none}
  body.yy-auth-login > main.login > section{
    margin:0;padding:36px 34px;border-radius:var(--yy-r-lg);
    border-top:3px solid var(--yy-amber);box-shadow:0 24px 60px rgba(12,67,53,.16);
  }
  body.yy-auth-login > main.login h1{color:var(--yy-ink);font-size:23px}
  body.yy-auth-login > main.login h1::before{
    content:"YOUYUAN WORKSPACE";display:block;margin-bottom:10px;
    font-size:11px;letter-spacing:.18em;font-weight:600;color:var(--yy-amber-ink);
  }
}
@media(max-width:900px){
  body.yy-auth-login > main.login > section{border-top:3px solid var(--yy-amber);border-radius:var(--yy-r-lg)}
}

/* 4 · Workbench shell + system entry cards */
.work-hub .work-sidebar{background:var(--yy-brand-deep)}
.work-hub .work-sidebar small{color:#A8C4B6}
.work-hub .work-sidebar nav a[aria-current]{background:var(--yy-soft);color:var(--yy-brand-deep)}
.work-hub .work-grid .card{
  border-radius:var(--yy-r-md);border-color:var(--yy-line);box-shadow:var(--yy-sh);
  transition:border-color var(--yy-t),transform var(--yy-t),box-shadow var(--yy-t);
}
.work-hub .work-grid .card:hover{
  border-color:var(--yy-brand);background:#fff;transform:translateY(-2px);box-shadow:var(--yy-sh-md);
}
.work-hub .work-grid .card b{font-size:16px;color:var(--yy-ink)}
.work-hub .work-grid .card p{color:var(--yy-slate);font-size:13px}

/* 5 · Reconciliation board: bridge generated light-dark() tokens */
/* PHASE 6 / C1 - static token fallback for kernels without light-dark().
   The @supports block below wins on modern engines, so rendering is unchanged. */
html.yy-data-app:root{--accent:#115846;--chart-1:#115846;--chart-4:#BD8F5E;--text:#20352D;--secondary:#607068;--border:#DCE6E1;--border-strong:#C3D3C9;--positive:#20704A;--negative:#B34642;--card-radius:16px;--control-radius:12px;--card-shadow:0 1px 2px rgba(17,88,70,.06),0 4px 16px rgba(17,88,70,.06)}
@supports (color: light-dark(#000,#fff)){
html.yy-data-app:root{
  --accent:light-dark(#115846,#8ecbb0);
  --chart-1:light-dark(#115846,#8ecbb0);
  --chart-4:light-dark(#BD8F5E,#dcb572);
  --text:light-dark(#20352D,#edf3ef);
  --secondary:light-dark(#607068,#a5b8ad);
  --border:light-dark(#DCE6E1,#34473c);
  --border-strong:light-dark(#C3D3C9,#526b5b);
  --positive:light-dark(#20704A,#88cba3);
  --negative:light-dark(#B34642,#e89a92);
  --card-radius:16px;
  --control-radius:12px;
  --card-shadow:0 1px 2px rgba(17,88,70,.06),0 4px 16px rgba(17,88,70,.06);
}
}


/* 6 · Contract: semantic status colors aligned, radius unified */
body.work-contract{
  --danger:#B34642;--danger-soft:#FBF0EF;
  --success:#20704A;--success-soft:#EDF5F0;
  --warn:#B07A22;--warn-soft:#FBF4E8;
  --radius:12px;--border:#DCE6E1;
}

/* 7 · Cross-system switcher (incl. ERPNext) — styles ready for phase 2 DOM */
.yy-sysbar{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  padding:8px 10px;background:var(--yy-brand-deep);border-radius:var(--yy-r-md);
}
.yy-sysbar__label{font-size:11px;letter-spacing:.12em;color:#A8C4B6;padding:0 8px}
.yy-sysbar a{
  display:inline-flex;align-items:center;min-height:36px;padding:6px 14px;
  border-radius:var(--yy-r-sm);border:1px solid transparent;color:#E8F2ED;
  font-size:13px;font-weight:600;text-decoration:none;
  transition:background var(--yy-t),color var(--yy-t);
}
.yy-sysbar a:hover{background:rgba(255,255,255,.10);color:#fff}
.yy-sysbar a[aria-current="page"]{background:var(--yy-soft);color:var(--yy-brand-deep);border-color:var(--yy-soft)}
.yy-sysbar a[data-system="erp"]{border-color:rgba(189,143,94,.55);color:#F0D9BE}
.yy-sysbar a[data-system="erp"]:hover{background:rgba(189,143,94,.16);color:#fff}
@media(max-width:640px){
  .yy-sysbar{gap:4px;padding:6px}
  .yy-sysbar__label{display:none}
  .yy-sysbar a{flex:1 1 auto;justify-content:center;min-width:96px}
}

/* 8 · Reusable components for phase 2 */
.yy-btn{
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;
  padding:10px 18px;border:1px solid transparent;border-radius:var(--yy-r-sm);
  font-size:14px;font-weight:600;cursor:pointer;transition:background var(--yy-t),border-color var(--yy-t);
}
.yy-btn--primary{background:var(--yy-brand);color:#fff}
.yy-btn--primary:hover{background:var(--yy-brand-deep)}
.yy-btn--outline{background:#fff;border-color:var(--yy-line);color:var(--yy-brand)}
.yy-btn--outline:hover{border-color:var(--yy-brand)}
.yy-btn--ghost{background:transparent;color:var(--yy-brand)}
.yy-btn--amber{background:#fff;border-color:var(--yy-amber);color:var(--yy-amber-ink)}
.yy-btn:disabled{opacity:.5;cursor:default}
.yy-tag{
  display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;
  border:1px solid transparent;font-size:12px;font-weight:600;white-space:nowrap;
}
.yy-tag--ok{background:#EAF4EE;border-color:#C9E3D3;color:#20704A}
.yy-tag--mid{background:#FBF3E6;border-color:#EBD7B8;color:#8A6238}
.yy-tag--no{background:#FBEEED;border-color:#EFCAC7;color:#B34642}
.yy-progress{height:8px;background:var(--yy-soft);border-radius:999px;overflow:hidden}
.yy-progress > i{display:block;height:100%;background:var(--yy-brand);border-radius:inherit;transition:width var(--yy-t)}
.yy-progress--amber > i{background:var(--yy-amber)}
/* Amber is decorative only. Readable amber text must use --yy-amber-ink (5.41:1). */
/* End of phase 1 */


/* ==================================================================
   PHASE 2 · cross-system switcher layout + freight brand bridge
   Appended 2026-11-09. Fixed 44px bar, scoped offsets for known
   sticky/fixed chrome so no existing layout is crushed.
   ================================================================== */
html.yy-sysbar-on body { padding-top: 44px !important; }
.yy-sysbar{
  position:fixed; inset:0 0 auto 0; z-index:900; height:44px;
  display:flex; align-items:center; gap:10px; padding:0 clamp(10px,2vw,24px);
  background:var(--yy-brand-deep); border-radius:0; flex-wrap:nowrap;
  box-shadow:0 1px 0 rgba(255,255,255,.08),0 4px 18px rgba(12,67,53,.20);
}
.yy-sysbar__brand{
  display:inline-grid; place-items:center; width:26px; height:26px; flex:0 0 26px;
  border-radius:7px; background:var(--yy-amber); color:#0C4335;
  font-size:14px; font-weight:650; line-height:1;
}
.yy-sysbar__label{
  flex:0 0 auto; font-size:10px; font-weight:650; letter-spacing:.16em;
  color:#A8C4B6; padding:0 6px 0 0; border-right:1px solid rgba(255,255,255,.16);
}
.yy-sysbar__links{
  display:flex; align-items:center; gap:2px; flex:1 1 auto;
  min-width:0; overflow-x:auto; scrollbar-width:none;
}
.yy-sysbar__links::-webkit-scrollbar{display:none}
/* Higher specificity than portal's `body.yy-work-hub a` rule,
   which otherwise forces dark green text onto the dark green bar. */
html.yy-sysbar-on .yy-sysbar a{
  flex:0 0 auto; min-height:44px; padding:0 14px; border:0; border-radius:0;
  background:transparent; color:#C6DCD1; font-size:13px; font-weight:600;
  transition:background var(--yy-t),color var(--yy-t);
}
html.yy-sysbar-on .yy-sysbar a:hover{background:rgba(255,255,255,.10);color:#fff}
html.yy-sysbar-on .yy-sysbar a[aria-current="page"]{
  background:rgba(255,255,255,.10); color:#fff; border:0;
  box-shadow:inset 0 -3px 0 var(--yy-amber);
}
html.yy-sysbar-on .yy-sysbar a[data-system="erp"]{color:#F0D9BE;border:0}
html.yy-sysbar-on .yy-sysbar a[data-system="erp"]:hover{background:rgba(189,143,94,.18);color:#fff}
@media(max-width:640px){
  .yy-sysbar{gap:6px;padding:0 8px}
  .yy-sysbar__label{display:none}
  html.yy-sysbar-on .yy-sysbar a{padding:0 10px;min-width:84px;justify-content:center;font-size:12px}
}

/* Scoped offsets for existing sticky / fixed chrome */
html.yy-sysbar-on .work-contract .topbar{top:44px}
html.yy-sysbar-on .work-contract .nav{top:108px}
html.yy-sysbar-on .finance-workspace-menu{top:60px}
html.yy-sysbar-on .pdd-category-nav{top:154px}
html[data-yy-app="freight"].yy-sysbar-on .sidebar{top:44px}
html[data-yy-app="freight"].yy-sysbar-on .editor-tabs{top:155px}

/* Freight (Vite build) brand tokens — scoped by data attribute */
html[data-yy-app="freight"]{
  --green:#115846; --green-soft:#E8F0EE; --amber:#BD8F5E;
  --ink:#20352D; --muted:#607068; --line:#DCE6E1; --paper:#F6F8F7;
  --serif:"PingFang SC","Microsoft YaHei",system-ui,-apple-system,"Segoe UI",sans-serif;
}
html[data-yy-app="freight"] body{background:var(--yy-paper)}
/* Freight's active sidebar rule is dark green with light text — keep it dark,
   only align the hue. Making it light would destroy text contrast. */
html[data-yy-app="freight"] .sidebar{background:var(--yy-brand-deep);border-right-color:var(--yy-brand-deep)}
html[data-yy-app="freight"] .yy-sysbar a[aria-current="page"]{color:#fff}
/* End of phase 2 */


/* ==================================================================
   PHASE 3 · unified typography + two-row header + reconciliation overview
   Appended 2026-11-09. Uses fresh class names so phase 1/2 rules stay inert.
   ================================================================== */

:root{
  /* 1 · Type scale — one source of truth for every business system */
  --yy-font:"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Source Han Sans SC",
            system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --yy-font-num:"DIN Alternate","Bahnschrift","SF Pro Display",var(--yy-font);
  --yy-fs-xs:11px;   --yy-fs-sm:12px;  --yy-fs-base:13px;
  --yy-fs-md:14px;   --yy-fs-lg:16px;  --yy-fs-xl:20px;
  --yy-fs-2xl:24px;  --yy-fs-3xl:30px;
  --yy-lh:1.5;       --yy-lh-tight:1.3;
  --yy-head-h:100px; --yy-head-brand:56px; --yy-head-nav:44px;
}

/* 2 · Global typography normalisation (scoped to pages carrying the header) */
html.yy-head-on body,
html.yy-head-on :is(button,input,select,textarea,a,td,th,label,span,b,small){
  font-family:var(--yy-font);
}
html.yy-head-on body{font-size:var(--yy-fs-md);line-height:var(--yy-lh);color:var(--yy-ink)}
html.yy-head-on :is(h1,h2,h3,h4){font-family:var(--yy-font);line-height:var(--yy-lh-tight);font-weight:650}
html.yy-head-on :is(button,input,select,textarea){font-size:inherit}
html.yy-head-on :is(.dashboard-root,#root,.work-hub,.work-contract){
  --font-sans:var(--yy-font);
  --font-sans-default:var(--yy-font);
  --vscode-font-family:var(--yy-font);
}
/* Numeric columns and KPI values must align vertically */
html.yy-head-on :is(td,th,.yy-ov__kpi-value,.yy-ov__pct,.yy-head__version){
  font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;
}

/* 3 · Two-row header (56px brand + 44px navigation) */
.yy-head{
  position:fixed;inset:0 0 auto 0;z-index:1000;
  display:block;background:transparent;
  font-family:var(--yy-font);
  -webkit-font-smoothing:antialiased;
}
.yy-head__brand{
  height:var(--yy-head-brand);box-sizing:border-box;
  display:flex;align-items:center;gap:18px;
  padding:0 clamp(14px,2vw,28px);
  background:var(--yy-brand-deep);color:#fff;
}
.yy-head__identity{display:flex;align-items:center;gap:9px;flex:0 0 auto}
.yy-head__logo{
  display:inline-grid;place-items:center;width:30px;height:30px;
  border-radius:9px;background:var(--yy-amber);color:#0C4335;
  font-size:var(--yy-fs-md);font-weight:700;line-height:1;
}
.yy-head__wordmark{display:flex;flex-direction:column;line-height:1.15}
.yy-head__wordmark b{font-size:var(--yy-fs-md);font-weight:650;letter-spacing:.04em}
.yy-head__wordmark small{font-size:9px;letter-spacing:.16em;color:#A8C4B6;margin-top:2px}
.yy-head__system{
  display:inline-flex;align-items:center;gap:10px;
  height:30px;padding:0 13px;margin-left:8px;
  background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);
  border-radius:var(--yy-r-sm);color:#fff;
  font-size:var(--yy-fs-base);font-weight:600;cursor:pointer;
  font-family:var(--yy-font);
}
.yy-head__system:hover{background:rgba(255,255,255,.20)}
.yy-head__caret{
  width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;
  border-top:5px solid #C6DCD1;
}
.yy-head__meta{margin-left:auto;display:flex;align-items:center;gap:14px}
.yy-head__version{font-size:var(--yy-fs-sm);color:#C6DCD1;letter-spacing:.02em}
.yy-head__divider{width:1px;height:16px;background:rgba(255,255,255,.22)}
.yy-head__issues{
  font-size:var(--yy-fs-sm);color:#F0D9BE;text-decoration:none;
  font-weight:600;white-space:nowrap;
}
.yy-head__issues:hover{text-decoration:underline}
.yy-head__avatar{
  display:inline-grid;place-items:center;width:30px;height:30px;flex:0 0 30px;
  border-radius:50%;background:var(--yy-amber);color:#0C4335;
  font-size:var(--yy-fs-base);font-weight:700;
}
.yy-head__nav{
  height:var(--yy-head-nav);box-sizing:border-box;
  display:flex;align-items:center;
  padding:0 clamp(14px,2vw,28px);
  background:#fff;border-bottom:1px solid var(--yy-line);
  box-shadow:0 1px 3px rgba(17,88,70,.05);
}
.yy-head__links{display:flex;align-items:center;gap:2px;min-width:0;overflow-x:auto;scrollbar-width:none}
.yy-head__links::-webkit-scrollbar{display:none}
html.yy-head-on .yy-head__links a{
  flex:0 0 auto;display:inline-flex;align-items:center;height:var(--yy-head-nav);
  padding:0 14px;border:0;border-radius:0;background:transparent;
  color:var(--yy-slate);font-size:var(--yy-fs-base);font-weight:600;
  text-decoration:none;white-space:nowrap;
  box-shadow:none;transition:color var(--yy-t),background var(--yy-t);
}
html.yy-head-on .yy-head__links a:hover{background:var(--yy-soft);color:var(--yy-brand)}
html.yy-head-on .yy-head__links a[aria-current="page"]{
  color:var(--yy-brand);background:transparent;
  box-shadow:inset 0 -3px 0 var(--yy-brand);
}
html.yy-head-on .yy-head__links a[data-system="erp"]{color:var(--yy-amber-ink)}
html.yy-head-on .yy-head__links a[data-system="erp"]:hover{background:#FBF6EF;color:var(--yy-amber-ink)}
.yy-head__sso{
  margin-left:auto;padding-left:18px;white-space:nowrap;
  font-size:var(--yy-fs-xs);color:var(--yy-slate);
  border-left:1px solid var(--yy-line);
}

/* 4 · Push existing chrome down by the full 100px */
html.yy-head-on body{padding-top:var(--yy-head-h)!important}
html.yy-head-on .work-contract .topbar{top:var(--yy-head-h)!important}
html.yy-head-on .work-contract .nav{top:164px!important}
html.yy-head-on .sidebar{top:var(--yy-head-h)!important}
html[data-yy-app="freight"].yy-head-on .editor-tabs{top:211px!important}
html.yy-head-on .pdd-category-nav{top:210px!important}
html.yy-head-on .finance-workspace-menu{top:116px!important}
html.yy-head-on .dashboard-topbar{top:var(--yy-head-h)!important}
html[data-yy-app="freight"] .yy-head__links a[aria-current="page"]{color:var(--yy-brand)}

/* 5 · Reconciliation overview (outside the React root) */
.yy-ov{
  display:grid;grid-template-columns:196px minmax(0,1fr);
  gap:0;max-width:1440px;margin:0 auto;
  padding:22px clamp(14px,2vw,28px) 40px;
  min-height:calc(100vh - var(--yy-head-h));
  box-sizing:border-box;font-family:var(--yy-font);color:var(--yy-ink);
}
html.yy-board-on .yy-ov{display:none}
.yy-ov__rail{
  padding:6px 14px 24px 0;border-right:1px solid var(--yy-line);
}
.yy-ov__group{
  font-size:var(--yy-fs-xs);font-weight:650;letter-spacing:.08em;
  color:var(--yy-slate);text-transform:none;
  padding:16px 10px 7px;
}
.yy-ov__rail-item{
  display:flex;align-items:center;gap:9px;
  min-height:34px;padding:0 11px;margin:2px 0;
  border-radius:var(--yy-r-sm);
  color:var(--yy-ink);font-size:var(--yy-fs-base);text-decoration:none;
}
.yy-ov__rail-item::before{
  content:"";width:5px;height:5px;border-radius:50%;
  background:#B9CBC3;flex:0 0 5px;
}
.yy-ov__rail-item:hover{background:var(--yy-soft);color:var(--yy-brand)}
.yy-ov__rail-item.is-on{
  background:var(--yy-soft);color:var(--yy-brand);font-weight:650;
}
.yy-ov__rail-item.is-on::before{background:var(--yy-brand)}
.yy-ov__main{min-width:0;padding-left:24px}
.yy-ov__crumb{
  display:flex;align-items:center;gap:8px;
  font-size:var(--yy-fs-sm);color:var(--yy-slate);margin:2px 0 10px;
}
.yy-ov__crumb i{font-style:normal;color:#B3C2BB}
.yy-ov__crumb b{color:var(--yy-brand);font-weight:650}
.yy-ov__titlebar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.yy-ov__titlebar h1{margin:0;font-size:var(--yy-fs-xl);font-weight:650;color:var(--yy-ink)}
.yy-ov__tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.yy-ov__select,.yy-ov__btn{
  display:inline-flex;align-items:center;justify-content:center;
  height:34px;padding:0 13px;border:1px solid var(--yy-line);
  border-radius:var(--yy-r-sm);background:#fff;color:var(--yy-ink);
  font-size:var(--yy-fs-sm);font-weight:600;cursor:pointer;
  font-family:var(--yy-font);white-space:nowrap;
}
.yy-ov__select:hover,.yy-ov__btn:hover{border-color:var(--yy-brand);color:var(--yy-brand)}
.yy-ov__btn--primary,.yy-ov__btn--primary:hover{
  background:var(--yy-brand);border-color:var(--yy-brand);color:#fff;
}
.yy-ov__kpis{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  background:#fff;border:1px solid var(--yy-line);border-radius:var(--yy-r-md);
  overflow:hidden;box-shadow:var(--yy-sh);
}
.yy-ov__kpi{padding:16px 18px 15px;border-right:1px solid var(--yy-line);min-width:0}
.yy-ov__kpi:last-child{border-right:0}
.yy-ov__kpi-label{font-size:var(--yy-fs-sm);color:var(--yy-slate)}
.yy-ov__kpi-value{
  margin:7px 0 4px;font-family:var(--yy-font-num);
  font-size:var(--yy-fs-3xl);font-weight:700;line-height:1.15;
  color:var(--yy-brand);letter-spacing:-.02em;
}
.yy-ov__kpi-value.is-amber{color:var(--yy-amber-ink)}
.yy-ov__kpi-sub{font-size:var(--yy-fs-xs);color:var(--yy-slate)}
.yy-ov__progress{
  margin-top:16px;padding:14px 18px;
  background:#fff;border:1px solid var(--yy-line);border-radius:var(--yy-r-md);
  box-shadow:var(--yy-sh);
}
.yy-ov__progress-top,.yy-ov__progress-bottom{display:flex;align-items:center;gap:12px}
.yy-ov__progress-top b{font-size:var(--yy-fs-base);font-weight:650;white-space:nowrap}
.yy-ov__track{
  flex:1 1 auto;min-width:80px;height:9px;border-radius:999px;
  background:var(--yy-soft);overflow:hidden;
}
.yy-ov__track > i{display:block;height:100%;background:var(--yy-brand);border-radius:inherit}
.yy-ov__track--amber{flex:0 0 180px;height:7px}
.yy-ov__track--amber > i{background:var(--yy-amber)}
.yy-ov__pct{font-family:var(--yy-font-num);font-size:var(--yy-fs-sm);font-weight:700;color:var(--yy-brand)}
.yy-ov__sep{width:1px;height:15px;background:var(--yy-line)}
.yy-ov__note-text,.yy-ov__sub-label{font-size:var(--yy-fs-xs);color:var(--yy-slate);white-space:nowrap}
.yy-ov__push{margin-left:auto}
.yy-ov__progress-bottom{margin-top:12px;padding-top:12px;border-top:1px solid var(--yy-line)}
.yy-ov__grid{
  display:grid;grid-template-columns:minmax(0,1.55fr) minmax(260px,1fr);
  gap:16px;margin-top:16px;align-items:start;
}
.yy-ov__card{
  background:#fff;border:1px solid var(--yy-line);border-radius:var(--yy-r-md);
  box-shadow:var(--yy-sh);overflow:hidden;
}
.yy-ov__card-head{
  display:flex;align-items:baseline;justify-content:space-between;gap:10px;
  padding:14px 18px;border-bottom:1px solid var(--yy-line);
}
.yy-ov__card-head h2{margin:0;font-size:var(--yy-fs-md);font-weight:650}
.yy-ov__unit{font-size:var(--yy-fs-xs);color:var(--yy-slate);text-align:right}
.yy-ov__table{width:100%;border-collapse:collapse;font-size:var(--yy-fs-sm)}
.yy-ov__table th{
  padding:10px 12px;text-align:right;font-weight:600;color:var(--yy-slate);
  border-bottom:1px solid var(--yy-line);white-space:nowrap;
}
.yy-ov__table th:first-child,.yy-ov__table td:first-child{text-align:left;padding-left:18px}
.yy-ov__table td{
  padding:12px;text-align:right;border-bottom:1px solid #EEF3F0;
  font-variant-numeric:tabular-nums;
}
.yy-ov__table tr:last-child td{border-bottom:0}
.yy-ov__tag{
  display:inline-flex;padding:3px 9px;border-radius:999px;
  background:#EAF4EE;color:#20704A;font-size:var(--yy-fs-xs);font-weight:650;
  white-space:nowrap;
}
.yy-ov__todos{list-style:none;margin:0;padding:6px 0}
.yy-ov__todo{
  display:flex;gap:11px;padding:12px 18px;
  border-bottom:1px solid #EEF3F0;border-left:3px solid var(--yy-brand);
  margin:6px 14px;border-radius:0 var(--yy-r-sm) var(--yy-r-sm) 0;
  background:#FBFCFB;
}
.yy-ov__todo:last-child{border-bottom:0}
.yy-ov__todo.is-amber{border-left-color:var(--yy-amber)}
.yy-ov__todo.is-red{border-left-color:var(--yy-danger)}
.yy-ov__todo b{display:block;font-size:var(--yy-fs-sm);font-weight:650;margin-bottom:3px}
.yy-ov__todo span{display:block;font-size:var(--yy-fs-xs);color:var(--yy-slate);line-height:1.55}
.yy-ov__foot{
  margin:14px 0 0;font-size:var(--yy-fs-xs);color:var(--yy-slate);line-height:1.7;
}
.yy-ov__back{
  display:none;position:fixed;left:20px;bottom:20px;z-index:999;
  height:38px;padding:0 16px;border:1px solid var(--yy-brand);
  border-radius:999px;background:#fff;color:var(--yy-brand);
  font-family:var(--yy-font);font-size:var(--yy-fs-base);font-weight:650;
  cursor:pointer;box-shadow:var(--yy-sh-md);
}
html.yy-board-on .yy-ov__back{display:inline-flex;align-items:center}
html.yy-overview-on #root{display:none!important}
html.yy-board-on #root{display:block!important}

/* 6 · Responsive */
@media(max-width:1200px){
  .yy-ov{grid-template-columns:168px minmax(0,1fr)}
  .yy-ov__kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .yy-ov__kpi:nth-child(2){border-right:0}
  .yy-ov__kpi:nth-child(-n+2){border-bottom:1px solid var(--yy-line)}
  .yy-ov__grid{grid-template-columns:1fr}
  .yy-ov__track--amber{flex:0 0 110px}
}
@media(max-width:640px){
  :root{--yy-head-h:96px;--yy-head-brand:52px}
  .yy-head__brand{gap:10px;padding:0 12px}
  .yy-head__wordmark small,.yy-head__version,.yy-head__divider,
  .yy-head__issues,.yy-head__sso{display:none}
  .yy-head__system{margin-left:0;font-size:var(--yy-fs-sm);height:28px;padding:0 9px}
  .yy-head__meta{margin-left:auto;gap:8px}
  html.yy-head-on .yy-head__links a{padding:0 11px;font-size:var(--yy-fs-sm);min-width:auto}
  .yy-ov{grid-template-columns:1fr;padding:16px 12px 32px}
  .yy-ov__rail{
    display:flex;gap:6px;overflow-x:auto;border-right:0;
    border-bottom:1px solid var(--yy-line);padding:0 0 12px;margin-bottom:14px;
  }
  .yy-ov__group{display:none}
  .yy-ov__rail-item{flex:0 0 auto;min-height:32px}
  .yy-ov__rail-item::before{display:none}
  .yy-ov__main{padding-left:0}
  .yy-ov__kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .yy-ov__kpi-value{font-size:var(--yy-fs-2xl)}
  .yy-ov__progress-top{flex-wrap:wrap;gap:8px}
  .yy-ov__progress-top .yy-ov__track{flex:1 1 100%;min-width:100%;order:5}
  .yy-ov__note-text,.yy-ov__sub-label,.yy-ov__sep,.yy-ov__push{display:none}
  .yy-ov__track{min-width:60px}
  .yy-ov__progress-bottom .yy-ov__track{flex:0 0 110px}
  .yy-ov__tools{width:100%}
  .yy-ov__btn--primary{flex:1 1 100%;margin-top:2px}
  .yy-ov__card{overflow-x:auto}
  .yy-ov__table{min-width:520px}
  .yy-ov__card-head{flex-direction:column;gap:3px}
  .yy-ov__unit{text-align:left}
}
/* Login keeps the same type family and base size; inputs stay 16px to avoid
   iOS Safari auto-zoom on focus. */
body.yy-auth-login{font-family:var(--yy-font);font-size:var(--yy-fs-md)}
body.yy-auth-login :is(input,select,textarea){font-family:var(--yy-font);font-size:16px}
@media(prefers-reduced-motion:reduce){
  .yy-head__links a,.yy-ov__track > i{transition:none}
}
/* End of phase 3 */


/* ==================================================================
   PHASE 4 · one shared header (three rows, four systems)
   Appended 2026-11-09. Fresh class names; phase 1/2/3 rules stay inert.
   ================================================================== */
:root{ --yy-sub-h:38px; }

/* ---------- row 3 · unified sub tabs (in normal flow, sticky under head) ----- */
.yy-sub{
  position:sticky;top:var(--yy-head-h);z-index:900;
  display:flex;align-items:center;gap:3px;
  height:var(--yy-sub-h);box-sizing:border-box;
  padding:0 clamp(12px,2vw,28px);
  background:#F7FAF8;border-bottom:1px solid var(--yy-line);
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
  font-family:var(--yy-font);-webkit-overflow-scrolling:touch;
}
.yy-sub::-webkit-scrollbar{display:none}
html.yy-head-on .yy-sub a{
  flex:0 0 auto;display:inline-flex;align-items:center;height:26px;
  padding:0 10px;border:0;border-radius:7px;background:transparent;
  color:var(--yy-slate);font-size:var(--yy-fs-base);font-weight:600;
  text-decoration:none;white-space:nowrap;box-shadow:none;
  font-family:var(--yy-font);cursor:pointer;
}
html.yy-head-on .yy-sub a:hover{background:var(--yy-soft);color:var(--yy-brand)}
html.yy-head-on .yy-sub a[aria-current="page"]{
  background:var(--yy-soft);color:var(--yy-brand);font-weight:700;
}
html.yy-head-on .yy-sub .yy-sub__more{
  position:sticky;right:0;z-index:2;
  margin-left:auto;flex:0 0 26px;width:26px;height:26px;padding:0;
  justify-content:center;border:1px solid var(--yy-line);background:#fff;
  color:var(--yy-slate);font-size:14px;line-height:1;
  box-shadow:-7px 0 9px -7px rgba(17,88,70,.28);
}
html.yy-head-on .yy-sub .yy-sub__more:hover{background:var(--yy-soft);color:var(--yy-brand)}

/* ---------- avatar becomes the single account menu trigger ------------------ */
html.yy-head-on .yy-head__avatar{cursor:pointer;user-select:none}
html.yy-head-on .yy-head__avatar:focus-visible{outline:2px solid #fff;outline-offset:2px}
.yy-menu{
  position:fixed;top:calc(var(--yy-head-h) + 6px);
  right:clamp(12px,2vw,28px);z-index:1100;
  width:212px;max-width:calc(100vw - 24px);
  background:#fff;border:1px solid var(--yy-line);border-radius:11px;
  box-shadow:0 12px 34px rgba(12,67,53,.22);overflow:hidden;
  font-family:var(--yy-font);
}
.yy-menu[hidden]{display:none}
.yy-menu__who{padding:11px 14px;background:var(--yy-soft);border-bottom:1px solid #CFE3D6}
.yy-menu__who b{display:block;font-size:var(--yy-fs-md);font-weight:650;color:var(--yy-brand-deep)}
.yy-menu__who small{font-size:var(--yy-fs-xs);color:var(--yy-slate)}
.yy-menu__meta{
  padding:8px 14px;font-size:var(--yy-fs-xs);color:var(--yy-slate);
  border-bottom:1px solid #EDF2EF;line-height:1.7;
}
html.yy-head-on .yy-menu a{
  display:block;padding:9px 14px;font-size:var(--yy-fs-base);
  color:var(--yy-ink);text-decoration:none;border-bottom:1px solid #F1F5F2;
  background:#fff;font-weight:500;
}
html.yy-head-on .yy-menu a:hover{background:var(--yy-soft);color:var(--yy-brand)}
html.yy-head-on .yy-menu a:last-child{border-bottom:0}
html.yy-head-on .yy-menu a.yy-menu__danger{color:#B4453F}
html.yy-head-on .yy-menu a.yy-menu__danger:hover{background:#FDF6F5;color:#B4453F}

/* ---------- remove each system's own chrome --------------------------------- */
/* work · hub: dark ZANSO sidebar + duplicated workspace/identity bar */
html.yy-v4-work .work-hub .work-sidebar,
html.yy-v4-work .work-hub .work-main > header{display:none!important}
html.yy-v4-work .work-hub .work-layout{grid-template-columns:minmax(0,1fr)!important}
html.yy-v4-work .work-hub .work-main > main{padding-top:20px}
/* contract · dark title bar, messy team links, side nav and bottom tab bar */
html.yy-v4-contract .topbar,
html.yy-v4-contract .teambar,
html.yy-v4-contract .nav,
html.yy-v4-contract .bottomtab{display:none!important}
html.yy-v4-contract main{margin-left:0!important;margin-top:0!important}
/* freight · dark sticky sidebar (brand + icon nav) and its status bar */
html.yy-v4-freight .sidebar,
html.yy-v4-freight .topbar{display:none!important}
html.yy-v4-freight .main-shell{margin-left:0!important}
/* finance · left untouched on purpose (the approved baseline) */

/* ---------- responsive ------------------------------------------------------- */
@media(max-width:640px){
  :root{--yy-sub-h:36px}
  .yy-sub{padding:0 10px}
  html.yy-head-on .yy-sub a{padding:0 9px;font-size:var(--yy-fs-sm)}
  .yy-menu{right:10px;top:calc(var(--yy-head-h) + 4px)}
}
@media(prefers-reduced-motion:reduce){
  html.yy-head-on .yy-sub a{transition:none}
}
/* End of phase 4 */


/* ==================================================================
   PHASE 4B · shared header box-model repair
   ------------------------------------------------------------------
   views.py ships a global element rule `header{background:white;
   padding:16px 24px;...}` (and `header{padding:14px}` on small screens).
   The injected shared header IS a <header class="yy-head">, so it silently
   inherited 14-24px of padding and a border. That made the head 132px tall
   while every offset (body padding, sticky top, sub tabs) assumed 100px:
   row 3 ended up crushed under row 2 and the head looked inset on phones.

   Fix: pin the shared header's box model explicitly, on every host, so a
   host page's own element-level `header` rules can never reach it again.
   ================================================================== */
html.yy-head-on .yy-head{
  position:fixed!important;
  top:0!important;right:0!important;left:0!important;bottom:auto!important;
  width:100%!important;max-width:none!important;min-width:0!important;
  height:auto!important;min-height:0!important;
  margin:0!important;padding:0!important;border:0!important;
  border-radius:0!important;box-shadow:none!important;
  background:transparent!important;
  display:block!important;gap:0!important;flex-wrap:nowrap!important;
  transform:none!important;filter:none!important;
}
/* rows 1 & 2 must span the full viewport, exactly like the approved page 4 */
html.yy-head-on .yy-head__brand,
html.yy-head-on .yy-head__nav{
  width:100%!important;max-width:none!important;
  margin:0!important;border-radius:0!important;
}
/* `header nav{gap:18px}` in views.py also reached the system switcher */
html.yy-head-on .yy-head__links{gap:2px!important;margin:0!important}

/* row 3 sits immediately under the 100px head, full width, in normal flow */
html.yy-head-on .yy-sub{
  width:100%!important;max-width:none!important;margin:0!important;
  left:0!important;right:0!important;
  top:var(--yy-head-h)!important;
  box-sizing:border-box!important;
}
html.yy-head-on .yy-sub .yy-sub__more{
  align-self:center!important;box-sizing:border-box!important;
  flex:0 0 26px!important;
}
/* End of phase 4B */


/* ==================================================================
   PHASE 5 · make the reconciliation FULL BOARD look like the approved
   "经营概览" page (light grouped rail, white cards, one KPI strip).
   ------------------------------------------------------------------
   Target reference: the .yy-ov overview layer (yy-recon.js + phase 3 CSS).
   Scope is limited to React-owned classes (.pdd-app / .finance-*), so the
   approved .yy-ov overview itself is deliberately NOT touched.
   Phase 1 painted this rail dark green; those rules are overridden here.
   ================================================================== */

/* ---- 0 · one token mapping for the whole generated app ------------------ */
html.yy-head-on .pdd-app{
  --font-sans:var(--yy-font);
  --font-sans-default:var(--yy-font);
  --vscode-font-family:var(--yy-font);
  --text:var(--yy-ink);
  --secondary:var(--yy-slate);
  --border:var(--yy-line);
  --border-strong:#C7D8D0;
  --surface:#fff;
  --muted:var(--yy-paper);
  --control:#fff;
  --chart-1:var(--yy-brand);
  font-family:var(--yy-font)!important;
  font-size:var(--yy-fs-md)!important;
  line-height:var(--yy-lh)!important;
  color:var(--yy-ink);
  background:var(--yy-paper);
}

/* ---- 1 · left rail: 196px grouped light rail (same as .yy-ov__rail) ----- */
html.yy-head-on .pdd-app.yy-has-rail{padding-inline-start:220px!important}
html.yy-head-on .finance-workspace-rail{width:196px!important}
html.yy-head-on .finance-workspace-menu{
  background:transparent!important;
  color:var(--yy-ink)!important;
  border:0!important;
  border-right:1px solid var(--yy-line)!important;
  border-radius:0!important;
  box-shadow:none!important;
  padding:6px 14px 24px 0!important;
  font-family:var(--yy-font)!important;
}
html.yy-head-on .finance-workspace-brand{display:none!important}
html.yy-head-on .pdd-app .finance-workspace-brand small,
html.yy-head-on .finance-menu-group > span{
  color:var(--yy-slate)!important;
  font-size:var(--yy-fs-xs)!important;
  font-weight:650!important;
  letter-spacing:.08em;
}
html.yy-head-on .finance-menu-group{display:grid;gap:2px;padding:5px 0!important}
html.yy-head-on .finance-menu-group > span{padding:11px 10px 6px!important}
html.yy-head-on .pdd-app .finance-menu-group button,
html.yy-head-on .finance-menu-group a{
  display:flex!important;align-items:center;gap:9px;
  min-height:34px!important;padding:0 11px!important;margin:2px 0;
  border:0!important;border-radius:var(--yy-r-sm)!important;
  background:transparent!important;
  color:var(--yy-ink)!important;
  font-family:var(--yy-font)!important;
  font-size:var(--yy-fs-base)!important;
  font-weight:500;
  text-align:left;text-decoration:none;
}
html.yy-head-on .pdd-app .finance-menu-group button::before,
html.yy-head-on .finance-menu-group a::before{
  content:"";width:5px;height:5px;border-radius:50%;
  background:#B9CBC3;flex:0 0 5px;
}
html.yy-head-on .pdd-app .finance-menu-group button:hover,
html.yy-head-on .finance-menu-group a:hover{
  background:var(--yy-soft)!important;color:var(--yy-brand)!important;
}
html.yy-head-on .pdd-app .finance-menu-group button[aria-current="page"]{
  background:var(--yy-soft)!important;
  color:var(--yy-brand)!important;
  font-weight:650!important;
}
html.yy-head-on .pdd-app .finance-menu-group button[aria-current="page"]::before{
  background:var(--yy-brand)!important;
}
html.yy-head-on .pdd-app .finance-menu-toggle{
  background:var(--yy-soft)!important;
  border:1px solid var(--yy-line)!important;
  border-radius:var(--yy-r-sm)!important;
  color:var(--yy-brand)!important;
  font-size:var(--yy-fs-sm)!important;
  font-weight:650;
}

/* ---- 2 · top module strip -------------------------------------------------
   When the grouped rail is present it already carries every module, so the
   duplicate horizontal strip is removed. If a page renders without the rail,
   the strip stays (restyled below) as the only navigation. */
html.yy-head-on .pdd-app.yy-has-rail > .pdd-module-nav{
  display:none!important;
}
html.yy-head-on .pdd-app > .pdd-module-nav{
  background:#F7FAF8!important;
  border:1px solid var(--yy-line)!important;
  border-radius:var(--yy-r-sm)!important;
  color:var(--yy-ink)!important;
  padding:0 10px!important;
}
html.yy-head-on .pdd-app .pdd-module-nav > span{
  color:var(--yy-slate)!important;font-size:var(--yy-fs-xs)!important;
}
html.yy-head-on .pdd-app .pdd-module-nav button{
  color:var(--yy-ink)!important;
  font-family:var(--yy-font)!important;
  font-size:var(--yy-fs-base)!important;
}
html.yy-head-on .pdd-app .pdd-module-nav button[aria-current="page"]{
  background:var(--yy-soft)!important;
  color:var(--yy-brand)!important;
  font-weight:650!important;
  border-radius:7px!important;
}

/* ---- 3 · page header: white card, one title, no duplicated site links -- */
html.yy-head-on .pdd-app .pdd-workspace-header{
  background:#fff!important;
  border:1px solid var(--yy-line)!important;
  border-radius:var(--yy-r-md)!important;
  box-shadow:var(--yy-sh)!important;
  padding:14px 18px!important;
  margin-bottom:16px!important;
}
html.yy-head-on .pdd-app .pdd-workspace-header h2,
html.yy-head-on .pdd-app .pdd-page-header h2{
  font-family:var(--yy-font)!important;
  font-size:var(--yy-fs-xl)!important;
  font-weight:650!important;
  letter-spacing:0!important;
  line-height:1.3!important;
  color:var(--yy-ink)!important;
  margin:0 0 4px!important;
}
html.yy-head-on .pdd-app .pdd-workspace-header p,
html.yy-head-on .pdd-app .pdd-page-header p{
  font-size:var(--yy-fs-sm)!important;
  line-height:1.6!important;
  color:var(--yy-slate)!important;
  margin:0!important;
}
html.yy-head-on .pdd-app .pdd-header-scope{font-size:var(--yy-fs-xs)!important}
/* cross-system / account links already live in the shared header + avatar */
html.yy-head-on .pdd-app .pdd-header-account nav{display:none!important}
html.yy-head-on .pdd-app .pdd-session-meta{
  font-size:var(--yy-fs-xs)!important;
  color:var(--yy-slate)!important;
}

/* ---- 4 · KPI strip: one white card divided by hairlines ---------------- */
html.yy-head-on .pdd-app .report-kpis{
  background:#fff!important;
  border:1px solid var(--yy-line)!important;
  border-radius:var(--yy-r-md)!important;
  box-shadow:var(--yy-sh)!important;
  overflow:hidden;gap:0!important;
}
html.yy-head-on .pdd-app .report-kpi{
  background:transparent!important;
  border:0!important;
  border-right:1px solid var(--yy-line)!important;
  border-radius:0!important;
  padding:16px 18px!important;
}
html.yy-head-on .pdd-app .report-kpi:last-child{border-right:0!important}
html.yy-head-on .pdd-app .report-kpi > span,
html.yy-head-on .pdd-app .report-kpi small{
  font-size:var(--yy-fs-sm)!important;
  color:var(--yy-slate)!important;
}
html.yy-head-on .pdd-app .report-kpi strong{
  font-family:var(--yy-font-num)!important;
  /* 20px: the board has 5 long currency columns; 30px wrapped the value */
  font-size:var(--yy-fs-xl)!important;
  white-space:nowrap!important;
  overflow-wrap:normal!important;
  font-weight:700!important;
  line-height:1.15!important;
  color:var(--yy-brand)!important;
  letter-spacing:-.02em;
  margin:7px 0 4px!important;
}
html.yy-head-on .pdd-app .report-kpi.is-pending strong,
html.yy-head-on .pdd-app .report-missing{color:var(--yy-amber-ink)!important}
html.yy-head-on .pdd-app .report-kpi.is-negative strong,
html.yy-head-on .pdd-app .report-loss{color:var(--yy-danger)!important}
html.yy-head-on .pdd-app .report-heading h2{
  font-family:var(--yy-font)!important;
  font-size:var(--yy-fs-lg)!important;
  font-weight:650!important;
  color:var(--yy-ink)!important;
}

/* ---- 5 · controls, links, cards, tables: one shared vocabulary --------- */
html.yy-head-on .pdd-app button,
html.yy-head-on .pdd-app input,
html.yy-head-on .pdd-app select{
  font-family:var(--yy-font)!important;
  font-size:var(--yy-fs-sm)!important;
  border-radius:var(--yy-r-sm)!important;
  border-color:var(--yy-line)!important;
}
html.yy-head-on .pdd-app a{
  color:var(--yy-brand)!important;
  text-decoration:none!important;
}
html.yy-head-on .pdd-app a:hover{text-decoration:underline!important}
html.yy-head-on .pdd-app .pdd-queue-card,
html.yy-head-on .pdd-app .card,
html.yy-head-on .pdd-app .pdd-review-top,
html.yy-head-on .pdd-app .pdd-queue-top{
  background:#fff!important;
  border:1px solid var(--yy-line)!important;
  border-radius:var(--yy-r-md)!important;
  box-shadow:var(--yy-sh)!important;
}
html.yy-head-on .pdd-app :is(h1,h2,h3,h4){
  font-family:var(--yy-font)!important;
  font-weight:650!important;
}
html.yy-head-on .pdd-app table{font-size:var(--yy-fs-sm)!important}
html.yy-head-on .pdd-app th{
  font-size:var(--yy-fs-sm)!important;
  color:var(--yy-slate)!important;
  font-weight:600!important;
}
html.yy-head-on .pdd-app td{font-variant-numeric:tabular-nums}

/* ---- 6 · keep the approved overview layer exactly as it is ------------- */
/* .yy-ov* rules live outside .pdd-app and are intentionally not restyled. */
/* End of phase 5 */

/* ==================================================================
   PHASE 6 - logic audit fixes (A4 / C4)
   ================================================================== */
/* A4 - fallback entries stay visible but are never presented as usable */
html.yy-head-on .yy-head__links a.is-unverified{opacity:.42;cursor:not-allowed}
html.yy-head-on .yy-head__links a.is-unverified:hover{text-decoration:none}
/* C4 - sign-out card keeps the brand palette, without the login split-screen */
body.yy-auth-plain{background:var(--yy-paper);color:var(--yy-ink);font-family:var(--yy-font);font-size:var(--yy-fs-md)}
body.yy-auth-plain a{color:var(--yy-brand)}
body.yy-auth-plain p{color:var(--yy-slate)}
body.yy-auth-plain h1{color:var(--yy-ink);font-size:23px}
body.yy-auth-plain section{background:#fff;border:1px solid var(--yy-line);border-radius:var(--yy-r-lg);border-top:3px solid var(--yy-amber,#BD8F5E);padding:36px 34px;box-shadow:0 24px 60px rgba(12,67,53,.12)}
body.yy-auth-plain button.primary{background:var(--yy-brand);border-color:var(--yy-brand);color:#fff}
body.yy-auth-plain :is(input,select,textarea){border-color:#C9D9D0;font-size:16px}
/* B5 note: the three freight offsets above are now domain-scoped. Their
   numeric values are kept byte-identical on purpose (zero visual regression);
   --yy-head-h / --yy-sub-h already exist from PHASE 3/4, converting these
   last few offsets to calc() is a separate, purely cosmetic follow-up.
   The yy-sysbar-on variants are v2 legacy (v3+ emits yy-head-on only). */
/* End of PHASE 6 */


/* ==================================================================
   PHASE 7 - role-aware admin-only header entries
   [hidden] must beat html.yy-head-on .yy-menu a{display:block} and
   .yy-sub a{display:inline-flex}, otherwise a non-admin would still
   see the entry. Disabled entries mirror the v6/A4 unverified state.
   ================================================================== */
html.yy-head-on .yy-menu a[hidden],
html.yy-head-on .yy-sub a[hidden]{display:none!important}
html.yy-head-on .yy-menu a.is-unverified,
html.yy-head-on .yy-sub a.is-unverified{opacity:.42;cursor:not-allowed}
html.yy-head-on .yy-menu a.is-unverified:hover,
html.yy-head-on .yy-sub a.is-unverified:hover{background:transparent;text-decoration:none}


/* ==================================================================
   PHASE 8 · persistent navigation shell for the reconciliation app
   ------------------------------------------------------------------
   Before: overview mode rendered .yy-ov (rail A + main), board mode
   hid it and showed #root with a DIFFERENT rail B. Every click rebuilt
   the whole shell and the two rails had different groups/items.

   After: .yy-ov stays mounted forever. It owns ONE rail (built from the
   real #finance-workspace-navigation, plus a "经营概览" entry) and one
   content cell. Clicking a rail item only swaps the content cell
   (.yy-ov__main <-> #root). The fixed .yy-head and the rail never move.
   ================================================================== */

/* 1 · the shell is visible in BOTH modes (phase 3 hid it on board mode) */
html.yy-head-on.yy-shell-on .yy-ov{display:grid!important}

/* 2 · one rail, one content cell. Both content panes share grid cell (1,2) */
html.yy-head-on.yy-shell-on .yy-ov__rail{
  grid-column:1;grid-row:1;
  position:sticky;top:calc(var(--yy-head-h) + 6px);
  max-height:calc(100vh - var(--yy-head-h) - 30px);
  overflow-y:auto;overscroll-behavior:contain;
}
html.yy-head-on.yy-shell-on .yy-ov__main,
html.yy-head-on.yy-shell-on .yy-ov > #root{
  grid-column:2;grid-row:1;min-width:0;
}
/* align the board's first card with the overview's first card:
   .page carries its own 32px gutters, so #root must not add another 24px */
html.yy-head-on.yy-shell-on .yy-ov > #root{padding-left:0}
html.yy-head-on.yy-shell-on .yy-ov > #root .page{
  padding-left:24px!important;padding-right:0!important
}

/* 3 · content-only swap. More specific than the phase-3 #root rules. */
html.yy-head-on.yy-shell-on.yy-overview-on .yy-ov__main{display:block}
html.yy-head-on.yy-shell-on.yy-board-on   .yy-ov__main{display:none}
html.yy-head-on.yy-shell-on.yy-overview-on .yy-ov > #root{display:none!important}
html.yy-head-on.yy-shell-on.yy-board-on    .yy-ov > #root{display:block!important}

/* 4 · the React app's own rail / module strip / back button are redundant */
html.yy-head-on.yy-shell-on .finance-workspace-rail,
html.yy-head-on.yy-shell-on .finance-workspace-menu,
html.yy-head-on.yy-shell-on .pdd-app > .pdd-module-nav,
html.yy-head-on.yy-shell-on .yy-ov__back{display:none!important}
html.yy-head-on.yy-shell-on .pdd-app.yy-has-rail{
  padding-inline-start:0!important
}

/* 5 · rail state: one shared active style, external links get a subtle arrow */
html.yy-head-on.yy-shell-on .yy-ov__rail-item.is-external::after{
  content:'↗';margin-left:auto;font-size:11px;opacity:.5
}
html.yy-head-on.yy-shell-on .yy-ov__rail-item.is-loading{
  opacity:.55;pointer-events:none
}

/* 6 · content-only loading bar (never touches header or rail) */
.yy-shell-progress{
  position:absolute;left:0;right:0;top:0;height:2px;z-index:5;
  background:linear-gradient(90deg,transparent,var(--yy-brand),transparent);
  opacity:0;transform:translateX(-100%);
  transition:opacity .18s ease;
  pointer-events:none;
}
.yy-shell-progress.is-on{opacity:1;animation:yy-shell-sweep .7s linear infinite}
@keyframes yy-shell-sweep{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}
html.yy-head-on.yy-shell-on .yy-ov{position:relative}

/* 7 · narrow screens: rail becomes the phase-3 horizontal strip;
        both content panes must fall back to the single column */
@media(max-width:640px){
  html.yy-head-on.yy-shell-on .yy-ov__rail{
    position:static;max-height:none;overflow:visible;
    grid-column:1;grid-row:auto;
  }
  html.yy-head-on.yy-shell-on .yy-ov__main,
  html.yy-head-on.yy-shell-on .yy-ov > #root{
    grid-column:1;grid-row:auto;padding-left:0;
  }
  html.yy-head-on.yy-shell-on .yy-ov > #root .page{
    padding-left:12px!important;padding-right:12px!important
  }
  html.yy-head-on.yy-shell-on .yy-ov > #root{margin-top:14px}
}
/* End of PHASE 8 */

/* ==========================================================================
   PHASE 10 / SOFT-NAV · content-area-only loading veil (2026-11-10)
   The veil is a grid child of .yy-ov pinned to the content cell
   (row 1 / column 2).  An absolutely positioned child of a grid container
   uses its grid area as the containing block, so the veil physically cannot
   cover the fixed header (row above) or the rail (column 1): the loading
   animation only ever exists inside the content region.
   ========================================================================== */
html.yy-head-on.yy-shell-on .yy-ov__veil{
  position:absolute;grid-row:1;grid-column:2;inset:0;z-index:30;
  display:flex;align-items:center;justify-content:center;
  background:light-dark(rgba(255,255,255,.88),rgba(16,26,23,.82));
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  html.yy-head-on.yy-shell-on .yy-ov__veil{
    background:light-dark(color-mix(in srgb,#ffffff 88%,transparent),
                          color-mix(in srgb,#101a17 82%,transparent));
  }
}
html.yy-head-on.yy-shell-on .yy-ov__veil[hidden]{display:none}
.yy-ov__veil-box{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  width:min(420px,86%);padding:28px 32px;border-radius:16px;
  border:1px solid light-dark(#dde7e4,#2c3f38);
  background:light-dark(#ffffff,#16211d);
  box-shadow:0 10px 30px rgba(9,32,26,.12);
  font:14px/1.6 system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif;
  color:light-dark(#21463f,#cfe3da);
}
.yy-ov__veil-box b{font-size:16px;margin-top:8px}
.yy-ov__veil-box span{color:light-dark(#627871,#8aa69a);font-size:12.5px}
.yy-ov__veil-spin{
  width:26px;height:26px;border-radius:50%;
  border:3px solid light-dark(#e2ebe8,#2c3f38);
  border-top-color:light-dark(#286451,#5fa88c);
  animation:yy-veil-spin .85s linear infinite;
}
.yy-ov__veil-skel{
  width:100%;height:11px;margin-top:10px;border-radius:6px;
  background:linear-gradient(90deg,light-dark(#edf2f0,#1d2b26),light-dark(#dce8e2,#24352e),light-dark(#edf2f0,#1d2b26));
  background-size:200% 100%;animation:yy-veil-shimmer 1.4s ease infinite;
}
.yy-ov__veil-skel.short{width:62%}
@keyframes yy-veil-spin{to{transform:rotate(360deg)}}
@keyframes yy-veil-shimmer{to{background-position:-200% 0}}
@media(max-width:640px){
  html.yy-head-on.yy-shell-on .yy-ov__veil{grid-column:1/-1}
  .yy-ov__veil-box{padding:22px}
}
@media(prefers-reduced-motion:reduce){
  .yy-ov__veil-spin,.yy-ov__veil-skel{animation:none}
}


/* ==========================================================================
   PHASE 11 / DECLUTTER (2026-11-10)
   Remove low-value repeated text, blank the numeric placeholders, add air.
   Everything is class-targeted and display/color only -- React never sees
   a DOM mutation, so remounts and soft navigation are unaffected.
   ========================================================================== */

/* 1 · page header: drop the one-line usage description; keep title + scope */
html.yy-head-on .pdd-app .pdd-page-header .pdd-header-main > p{display:none!important}

/* 2 · session badges (测试/管理员/已同步) duplicate the shell avatar/identity */
html.yy-head-on .pdd-app .pdd-session-meta{display:none!important}

/* 3 · scope bar: the inline formula line; the collapsible 口径 details stays */
html.yy-head-on .pdd-app .cost-scope-explainer > span{display:none!important}

/* 4 · toolbar whisper texts (已显示N组… / 未加载部分不按空白处理…) */
html.yy-head-on .pdd-app .pdd-toolbar small{display:none!important}

/* 5 · long duplicated note directly under the batch toolbars (costs pages) */
html.yy-head-on .pdd-app .pdd-archive-costs > p.pdd-note{display:none!important}

/* 6 · numeric cells: placeholder 空白不当0 -> truly blank while editing */
html.yy-head-on .pdd-app .pdd-table td.pdd-numeric input::placeholder{
  color:transparent!important;
}

/* 7 · per-row 已保存值按日期沿用 whisper under the save button */
html.yy-head-on .pdd-app .pdd-table td.pdd-numeric small{display:none!important}

/* 8 · breathing room: header card and content flow get more air */
html.yy-head-on .pdd-app .pdd-page-header{padding:18px 22px!important;margin-bottom:20px!important}
html.yy-head-on .pdd-app .pdd-page-header h2{margin:0 0 2px!important}
html.yy-head-on .pdd-app .pdd-scopebar{margin-bottom:18px!important}
html.yy-head-on .pdd-app .pdd-content-flow{gap:20px!important}
html.yy-head-on .pdd-app .pdd-toolbar{padding-top:14px!important;padding-bottom:14px!important}

/* 9 · overview shell cards: same air */
html.yy-head-on.yy-shell-on .yy-ov__grid{gap:20px;margin-top:20px}
html.yy-head-on.yy-shell-on .yy-ov__card-head{padding:16px 20px}


/* ==========================================================================
   PHASE 12 / VEIL VIEWPORT CENTERING (2026-11-10 evening)
   The veil itself stays an absolute inset:0 grid child -- it still spans
   the whole scrollable content column and still cannot cover the header or
   the rail.  But flex-centering the box inside that full-height veil put it
   at the middle of the PAGE, which on tall pages (待处理) can be below the
   viewport.  The box is now position:sticky with a viewport-based top, so
   it is always centered in the VISIBLE content area, independent of page
   height and scroll position.
   ========================================================================== */
html.yy-head-on.yy-shell-on .yy-ov__veil{display:block}
html.yy-head-on.yy-shell-on .yy-ov__veil-box{
  position:sticky;
  top:max(calc(50vh - 120px), calc(var(--yy-head-h) + var(--yy-sub-h) + 22px));
  margin:0 auto;
}
@media(max-width:640px){
  html.yy-head-on.yy-shell-on .yy-ov__veil-box{
    top:max(calc(50vh - 120px), calc(var(--yy-head-h) + var(--yy-sub-h) + 14px));
  }
}


/* ==========================================================================
   PHASE 13 / SHOP MANAGER PANEL (2026-11-10 evening)
   Shell-owned 店铺管理 module.  The panel is a grid child of .yy-ov like the
   overview cards and the veil -- it can never cover the header or the rail.
   Shown only under html.yy-shops-on (third shell mode next to overview /
   board); hidden together with the app root and the overview cards.
   ========================================================================== */
html.yy-head-on.yy-shell-on .yy-shops-panel{
  grid-row:1;grid-column:2;min-width:0;display:none;
}
html.yy-head-on.yy-shell-on.yy-shops-on .yy-shops-panel{display:block}
html.yy-head-on.yy-shell-on.yy-shops-on .yy-ov__main{display:none}
html.yy-head-on.yy-shell-on.yy-shops-on .yy-ov > #root{display:none!important}

.yy-shops-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:16px;
  background:#fff;border:1px solid var(--yy-line);border-radius:var(--yy-r-md);
  box-shadow:var(--yy-sh);padding:18px 22px;margin-bottom:16px;
}
.yy-shops-head-text h2{margin:0 0 4px;font-size:var(--yy-fs-xl);color:var(--yy-ink)}
.yy-shops-head-text p{margin:0;font-size:var(--yy-fs-sm);color:var(--yy-slate)}

.yy-btn{
  display:inline-flex;align-items:center;gap:6px;
  min-height:34px;padding:0 14px;border-radius:var(--yy-r-sm);
  border:1px solid var(--yy-line);background:#fff;color:var(--yy-ink);
  font-size:var(--yy-fs-sm);font-weight:550;cursor:pointer;
  transition:background .15s ease,border-color .15s ease;
}
.yy-btn:hover{background:var(--yy-soft)}
.yy-btn-primary{background:var(--yy-brand);border-color:var(--yy-brand);color:#fff}
.yy-btn-primary:hover{background:#1d5342;border-color:#1d5342}
.yy-btn-primary[disabled]{opacity:.6;cursor:default}
.yy-btn-ghost{background:transparent}

.yy-shops-list{display:flex;flex-direction:column;gap:12px}
.yy-shop-card{
  background:#fff;border:1px solid var(--yy-line);border-radius:var(--yy-r-md);
  box-shadow:var(--yy-sh);padding:16px 20px;
}
.yy-shop-top{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.yy-shop-platform{
  font-size:var(--yy-fs-xs);font-weight:650;letter-spacing:.04em;
  color:var(--yy-brand);background:var(--yy-soft);
  border:1px solid var(--yy-line);border-radius:999px;padding:2px 10px;
}
.yy-shop-top strong{font-size:var(--yy-fs-md)}
.yy-shop-link{font-size:var(--yy-fs-sm);color:var(--yy-brand);text-decoration:none}
.yy-shop-link:hover{text-decoration:underline}
.yy-shop-nolink,.yy-shop-updated{font-size:var(--yy-fs-xs);color:var(--yy-slate)}
.yy-shop-top .yy-btn{margin-left:auto}

.yy-shop-entities{
  display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;
}
.yy-entity-chip{
  display:inline-flex;align-items:center;gap:8px;
  background:var(--yy-soft);border:1px solid var(--yy-line);
  border-radius:999px;padding:4px 12px;font-size:var(--yy-fs-xs);
  max-width:100%;
}
.yy-entity-chip b{font-weight:600;color:var(--yy-ink)}
.yy-entity-chip i{
  font-style:normal;color:var(--yy-brand);
  background:#fff;border:1px solid var(--yy-line);border-radius:999px;padding:0 8px;
}
.yy-entity-chip small{color:var(--yy-slate)}
.yy-entity-missing{font-size:var(--yy-fs-sm);color:var(--yy-slate);font-style:italic}

.yy-shops-error,.yy-shops-empty{
  background:#fff;border:1px dashed var(--yy-line);border-radius:var(--yy-r-md);
  padding:18px 20px;color:var(--yy-slate);font-size:var(--yy-fs-sm);
}

.yy-shop-editor{
  background:#fff;border:1px solid var(--yy-brand);
  border-radius:var(--yy-r-md);box-shadow:var(--yy-sh);
  padding:18px 22px;margin-top:14px;
}
.yy-shop-editor h3{margin:0 0 12px;font-size:var(--yy-fs-md)}
.yy-shop-form{display:flex;flex-direction:column;gap:10px}
.yy-shop-field{
  display:flex;align-items:center;gap:10px;font-size:var(--yy-fs-sm);
}
.yy-shop-field > span{flex:0 0 88px;color:var(--yy-slate)}
.yy-shop-field input,.yy-shop-field select{
  flex:1;min-width:0;min-height:34px;padding:0 10px;
  border:1px solid var(--yy-line);border-radius:var(--yy-r-sm);
  font-size:var(--yy-fs-sm);background:#fff;color:var(--yy-ink);
}
.yy-shop-field input[readonly]{background:var(--yy-soft);color:var(--yy-slate)}
.yy-entity-caption{margin:6px 0 0;font-size:var(--yy-fs-xs);color:var(--yy-slate)}
.yy-entity-rows{display:flex;flex-direction:column;gap:10px}
.yy-entity-row{
  border:1px solid var(--yy-line);border-radius:var(--yy-r-sm);
  padding:10px 12px 12px;margin:0;display:flex;flex-direction:column;gap:8px;
}
.yy-entity-row legend{font-size:var(--yy-fs-xs);color:var(--yy-brand);font-weight:650;padding:0 6px}
.yy-entity-row .yy-shop-field > span{flex:0 0 76px}
.yy-entity-del{align-self:flex-end;min-height:30px}
.yy-shop-actions{display:flex;gap:10px;margin-top:4px}
.yy-shop-status{margin:0;font-size:var(--yy-fs-sm);color:var(--yy-brand);min-height:1.2em}

@media(max-width:640px){
  .yy-shops-head{flex-direction:column;gap:10px;padding:14px 16px}
  .yy-shop-top .yy-btn{margin-left:0}
  .yy-shop-field,.yy-entity-row .yy-shop-field{flex-wrap:wrap}
  .yy-shop-field > span,.yy-entity-row .yy-shop-field > span{flex:0 0 100%}
}
