/* The UI 3.0 token sheet owns colors, typography, density and brand dimensions. */
[hidden]{display:none!important}
html{scroll-padding-block:16px}
body{overflow-wrap:break-word}
h1,h2,h3,p,dl,dd{margin:0}
h1{font-size:var(--xh-font-size-page);line-height:var(--xh-line-height-page);font-weight:600}
h2,h3{font-size:var(--xh-font-size-section);line-height:var(--xh-line-height-section);font-weight:600}
strong,b,th{font-weight:600}
button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:var(--xh-touch-target);min-height:var(--xh-control-height);padding:0 var(--xh-control-padding-inline);border:1px solid var(--xh-control-border);border-radius:var(--xh-radius);color:var(--xh-text);background:var(--xh-surface);font-weight:500;text-decoration:none;cursor:pointer}
button:hover,.btn:hover{background:var(--xh-surface-hover)}
button:active,.btn:active{background:var(--xh-surface-pressed)}
button.primary,.btn.primary{color:var(--xh-on-primary);background:var(--xh-primary);border-color:var(--xh-primary)}
button.primary:hover,.btn.primary:hover{background:var(--xh-primary-hover)}
button.primary:active,.btn.primary:active{background:var(--xh-primary-pressed)}
button:disabled,.btn[aria-disabled=true]{background:var(--xh-disabled-bg);color:var(--xh-disabled-text);border-color:var(--xh-disabled-border);cursor:default}
button.quiet{border-color:var(--xh-border)}
button.text-button,.bar-button,.icon-button{border-color:transparent;background:transparent}
button.text-button{color:var(--xh-primary)}
input:not([type=checkbox]):not([type=radio]),select,textarea{width:100%;min-width:0;min-height:var(--xh-control-height);padding:8px 12px;border:1px solid var(--xh-control-border);border-radius:var(--xh-radius);background:var(--xh-surface);color:var(--xh-text)}
input::placeholder,textarea::placeholder{color:var(--xh-text-secondary)}
input[type=checkbox],input[type=radio]{accent-color:var(--xh-primary);width:16px;height:16px;flex:none}
textarea{min-height:96px;resize:vertical}
label{display:grid;gap:4px;font-weight:500}
a:hover{text-decoration:underline}
details>summary{cursor:pointer}
.skip{position:fixed;z-index:var(--xh-z-notice);top:8px;left:-10000px;padding:12px;background:var(--xh-surface)}
.skip:focus{left:8px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
svg.ui-icon{width:18px;height:18px;flex:none;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
[data-icon]{display:inline-flex;align-items:center;justify-content:center}
.icon-button{width:44px;height:44px;padding:0;flex:none}
.workspace{display:grid;grid-template-columns:var(--xh-sidebar-width) minmax(0,1fr);min-height:100vh}
.sheet{min-width:0}
.rail{display:flex;flex-direction:column;background:var(--xh-surface);border-inline-end:1px solid var(--xh-border);position:sticky;top:0;height:100vh;height:100dvh;min-width:0}
.rail-head{display:flex;align-items:center;justify-content:space-between;min-height:64px;border-bottom:1px solid var(--xh-border);padding:0 16px}
.brand-lockup{display:inline-flex;align-items:center;gap:var(--xh-brand-gap);min-height:44px;min-width:44px;color:var(--xh-text);text-decoration:none}
.brand-lockup:hover{text-decoration:none}
.brand-symbol{width:var(--xh-brand-mark-width);height:var(--xh-brand-mark-height);object-fit:contain;flex:none}
.wordmark{width:var(--xh-brand-wordmark-width);height:var(--xh-brand-wordmark-height);background:currentColor;mask:url('/static/ui3/assets/brand/xiaohe-wordmark.svg') center/contain no-repeat;flex:none}
.product-name{font-weight:500;border-inline-start:1px solid var(--xh-border);padding-inline-start:12px;margin-inline-start:4px;white-space:nowrap}
#nav-close,#nav-toggle,.compact-brand{display:none}
#navigation{min-height:0;overflow-y:auto;padding:24px 12px;flex:1}
#primary-nav,#tool-links{display:grid;gap:4px}
#navigation a,#tools-menu summary{display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 12px;border-radius:var(--xh-radius);color:var(--xh-text);text-decoration:none;position:relative}
#navigation a:hover,#tools-menu summary:hover{background:var(--xh-surface-hover)}
#navigation a.active{background:var(--xh-selected-bg);color:var(--xh-selected-text);font-weight:600}
#navigation a.active::before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:3px;border-radius:var(--xh-inner-radius);background:var(--xh-primary)}
#tools-menu{margin-top:16px;padding-top:16px;border-top:1px solid var(--xh-border)}
#tools-menu summary{list-style:none;color:var(--xh-text-secondary)}
#tools-menu summary::-webkit-details-marker{display:none}
.fold-arrow{margin-inline-start:auto}
#tools-menu[open] .fold-arrow{transform:rotate(180deg)}
#tool-links{margin-top:4px}
.account{display:flex;align-items:center;gap:12px;padding:12px 16px;border-top:1px solid var(--xh-border)}
.avatar{display:grid;width:32px;height:32px;flex:none;place-items:center;border-radius:50%;background:var(--xh-surface-muted);color:var(--xh-text);font-weight:600}
.identity{min-width:0;flex:1}
.identity strong,.identity small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.identity small{color:var(--xh-text-secondary);font-size:var(--xh-font-size-meta);line-height:var(--xh-line-height-meta)}
.topbar{display:flex;align-items:center;gap:8px;min-height:64px;padding:0 32px;background:var(--xh-surface);border-bottom:1px solid var(--xh-border)}
#crumb{min-width:0;display:flex;align-items:center;gap:8px;color:var(--xh-text-secondary)}
#crumb a,#crumb span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#crumb a{display:inline-flex;align-items:center;min-height:44px;color:var(--xh-text-secondary);text-decoration:none}
#crumb a:hover{color:var(--xh-primary);text-decoration:underline}
#crumb [aria-current]{color:var(--xh-text);font-weight:500}
#crumb svg{width:12px;height:12px}
.toolbar-actions{display:flex;align-items:center;gap:4px;margin-inline-start:auto;flex:none}
.bar-button,.toolbar-actions .icon-button{color:var(--xh-text-secondary)}
#content{max-width:1600px;padding:32px 32px 48px;margin:0 auto}
#content:focus:not(:focus-visible){outline:none}
#feedback:not(:empty),.failure{padding:16px;margin-bottom:16px;border:1px solid var(--xh-info-border);border-radius:var(--xh-radius);background:var(--xh-info-bg);color:var(--xh-info)}
.failure{border-color:var(--xh-danger-border);background:var(--xh-danger-bg);color:var(--xh-danger)}
.failure button{margin-top:12px}
.waiting,.empty,.boot{padding:24px;color:var(--xh-text-secondary)}
.page-head{margin-bottom:24px}
.subtitle,.panel-note,.confirm-copy{color:var(--xh-text-secondary);margin-top:4px;white-space:pre-line}
.panel{background:var(--xh-surface);border:1px solid var(--xh-border);border-radius:var(--xh-radius);margin-bottom:16px;min-width:0}
.panel-heading{padding:16px var(--xh-card-padding);border-bottom:1px solid var(--xh-border)}
.scroll-table{overflow-x:auto;overscroll-behavior-x:contain}
table{width:100%;border-collapse:collapse;text-align:start}
th,td{text-align:start;padding:8px 16px;vertical-align:middle;border-bottom:1px solid var(--xh-border)}
th{font-size:var(--xh-font-size-meta);line-height:var(--xh-line-height-meta);color:var(--xh-text-secondary);background:var(--xh-surface-muted)}
td{height:var(--xh-table-row-height);white-space:pre-line;overflow-wrap:anywhere}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:var(--xh-surface-hover)}
td a{color:var(--xh-primary)}
mark{color:var(--xh-warning);background:var(--xh-warning-bg)}
.error-text{color:var(--xh-danger);white-space:pre-line}
.error-text:empty{display:none}
.login-screen{display:grid;place-items:center;padding:24px;min-height:100vh}
.login-panel{width:min(400px,100%);padding:32px;background:var(--xh-surface);border:1px solid var(--xh-border);border-radius:var(--xh-radius)}
.login-panel h1{margin:24px 0}
.login-panel form,#action-fields{display:grid;gap:16px}
dialog{width:min(520px,calc(100% - 32px));max-height:calc(100dvh - 32px);padding:0;color:var(--xh-text);background:var(--xh-surface);border:1px solid var(--xh-border);border-radius:var(--xh-radius);box-shadow:var(--xh-shadow)}
dialog::backdrop{background:var(--xh-overlay)}
#action-form,.utility-dialog{padding:var(--xh-card-padding)}
.dialog-top,.dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:12px}
.dialog-top{margin-bottom:16px}
.dialog-footer{justify-content:flex-end;margin-top:16px;border-top:1px solid var(--xh-border);padding-top:16px}
#action-fields{margin-block:16px}
.utility-dialog fieldset{margin:16px 0 0;padding:0;border:0}
.utility-dialog legend{font-weight:600;margin-bottom:8px}
.choice-row{display:flex;gap:8px;flex-wrap:wrap}
.choice-row label{display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;background:var(--xh-surface);border:1px solid var(--xh-border);border-radius:var(--xh-radius);cursor:pointer}
.choice-row label:has(:checked){border-color:var(--xh-primary);background:var(--xh-selected-bg);color:var(--xh-selected-text)}
#jump-links{display:grid;margin-top:12px;overflow-y:auto;max-height:50vh}
#jump-links a{display:flex;align-items:center;gap:12px;min-height:44px;color:var(--xh-text);padding:0 12px;border-radius:var(--xh-radius);text-decoration:none}
#jump-links a:hover,#jump-links a:focus-visible{background:var(--xh-selected-bg);color:var(--xh-selected-text)}
#mobile-menu{position:fixed;inset:0 auto 0 0;margin:0;width:min(var(--xh-sidebar-width),calc(100vw - 32px));max-width:none;max-height:none;height:100dvh;border:0;border-radius:0}
#mobile-menu .rail{width:100%;position:static}
#mobile-menu .rail-head{padding-inline:12px}
#mobile-menu #nav-close{display:inline-flex}
#mobile-menu .product-name{display:none}
@media(max-width:1439.98px){
  .workspace{grid-template-columns:72px minmax(0,1fr)}
  .topbar{padding-inline:24px}#content{padding:24px 24px 48px}
  #nav-toggle{display:inline-flex}
  .workspace>.rail .product-name,.workspace>.rail .wordmark,.workspace>.rail .nav-label,.workspace>.rail .fold-arrow,.workspace>.rail .identity,.workspace>.rail .avatar{display:none}
  .workspace>.rail .rail-head,.workspace>.rail .home-brand,.workspace>.rail .account,.workspace>.rail #navigation a,.workspace>.rail #tools-menu summary{justify-content:center}
  .workspace>.rail .rail-head,.workspace>.rail .account{padding-inline:8px}
  .workspace>.rail #navigation{padding-inline:8px}
  .workspace.nav-detached>.sheet{grid-column:2}
}
@media(max-width:899.98px){
  .workspace{display:block}.workspace>.rail{display:none}
  .compact-brand{display:inline-flex}
  .compact-brand .brand-symbol,#mobile-menu .brand-symbol{width:24px;height:24px}
  .compact-brand .wordmark,#mobile-menu .wordmark{width:36px;height:20px}
  #crumb{border-inline-start:1px solid var(--xh-border);padding-inline-start:12px}
  #crumb .crumb-root,#crumb .crumb-root+svg{display:none}
}
@media(max-width:639.98px){
  .topbar{min-height:56px;padding-inline:8px;gap:4px}
  #content{padding:16px 16px 32px}
  .toolbar-label{display:none}.toolbar-actions{gap:0}.toolbar-actions .bar-button{padding:0}
  #crumb{font-size:var(--xh-font-size-meta);gap:4px;padding-inline-start:8px;flex:1}
  #crumb .crumb-parent{max-width:5em}
  #editor{inset:0;width:100%;height:100dvh;max-width:none;max-height:100dvh;margin:0;border:0;border-radius:0}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:var(--xh-motion-reduced)!important;transition-duration:var(--xh-motion-reduced)!important}}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:var(--xh-space-12);margin-block:0 var(--xh-space-24)}
.kpi{min-width:0;padding:var(--xh-card-padding);background:var(--xh-surface);border:1px solid var(--xh-border);border-radius:var(--xh-radius)}
.kpi dt{color:var(--xh-text-secondary);font-size:var(--xh-font-size-meta);line-height:var(--xh-line-height-meta)}
.kpi dd{margin-block-start:var(--xh-space-8);font-size:var(--xh-font-size-metric);line-height:var(--xh-line-height-metric);font-weight:var(--xh-font-weight-semibold);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.kpi dd.long{font-size:var(--xh-font-size-section);line-height:var(--xh-line-height-section)}
@media(max-width:1439.98px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1440px){.kpis:has(.kpi:nth-child(5)){grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:899.98px){#login-screen .brand-lockup{--xh-brand-mark-width:24px;--xh-brand-mark-height:24px;--xh-brand-wordmark-width:36px;--xh-brand-wordmark-height:20px}}
@media(max-width:639.98px){.kpis{grid-template-columns:minmax(0,1fr)}}
@media(forced-colors:active){.wordmark{background:CanvasText;forced-color-adjust:none}#navigation a[aria-current=page]{outline:1px solid Highlight}}
