/* SWYOS staff UI v1. Scoped adapters let existing business pages adopt one system safely. */
body.swy-ds {
  --swy-ds-font: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --swy-ds-radius-sm: 7px;
  --swy-ds-radius-md: 11px;
  --swy-ds-space-1: 4px;
  --swy-ds-space-2: 8px;
  --swy-ds-space-3: 12px;
  --swy-ds-space-4: 16px;
  --swy-ds-space-6: 24px;
  --swy-ds-control-height: 36px;
  --swy-ds-surface: #fff;
  font-family: var(--swy-ds-font);
}
body.swy-ds--os { --swy-ds-accent: var(--oh-accent, #292929); --swy-ds-muted: var(--oh-muted, #777c78); --swy-ds-line: var(--oh-line, #e6e8e6); }
body.swy-ds--kh { --swy-ds-accent: var(--primary, #2563eb); --swy-ds-muted: var(--muted, #6b7280); --swy-ds-line: var(--line, #e5e7eb); --sidebar:238px; }
body.swy-ds--hub { --swy-ds-accent: var(--hub-accent, #292929); --swy-ds-muted: var(--hub-muted, #777c78); --swy-ds-line: var(--hub-line, #e6e8e6); }
body.swy-ds--cp { --swy-ds-accent: var(--blue, #2563eb); --swy-ds-muted: var(--muted, #6b7280); --swy-ds-line: var(--line, #e5e7eb); }
body.swy-ds--wz { --swy-ds-accent: var(--blue, #2563eb); --swy-ds-muted: var(--muted, #6b7280); --swy-ds-line: var(--line, #e5e7eb); }
body.swy-ds--yx { --swy-ds-accent: var(--blue, #2563eb); --swy-ds-muted: var(--muted, #6b7280); --swy-ds-line: var(--line, #e5e7eb); }
body.swy-ds--xx { --swy-ds-accent: var(--blue, #2563eb); --swy-ds-muted: var(--muted, #6b7280); --swy-ds-line: var(--line, #e5e7eb); }
body.swy-ds--ai { --swy-ds-accent: var(--swy-workspace-accent, #2563eb); --swy-ds-muted: var(--muted, #64748b); --swy-ds-line: var(--border, #e5e7eb); }
body.swy-ds--yf { --swy-ds-accent: var(--swy-workspace-accent, #2563eb); --swy-ds-muted: var(--muted, #64748b); --swy-ds-line: var(--line, #dbe4ef); }

.swy-ds-page-header { display:flex; align-items:flex-end; justify-content:space-between; gap:var(--swy-ds-space-4); min-width:0; margin:0 0 var(--swy-ds-space-4); }
.swy-ds-page-header-copy { min-width:0; }
.swy-ds-page-header h1 { margin:0 0 4px; font-size:clamp(22px,1.7vw,26px); line-height:1.25; letter-spacing:-.02em; }
.swy-ds-page-header p { margin:0; color:var(--swy-ds-muted); font-size:13px; line-height:1.5; }
.swy-ds-eyebrow { display:block; margin-bottom:6px; color:var(--swy-ds-accent); font-size:11px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.swy-ds-page-header-actions { display:flex; align-items:center; justify-content:flex-end; gap:var(--swy-ds-space-2); flex-wrap:wrap; }

/* Existing page components receive the same surface and control rhythm. */
.swy-ds--os .os-page-main .card,
.swy-ds--kh .content-shell .table-card,
.swy-ds--hub .hub-os-main .card { border-radius:var(--swy-ds-radius-md); }
.swy-ds--cp .container .card,
.swy-ds--wz .app-content .card,
.swy-ds--yx .workspace main .card,
.swy-ds--xx .admin-content .card { border-radius:var(--swy-ds-radius-md); }
.swy-ds--ai .ai-main .ai-card,
.swy-ds--yf .content .card { border-radius:var(--swy-ds-radius-md); }
.swy-ds--kh .sidebar { color:#242625; background:var(--swy-ds-surface); border-right:1px solid var(--swy-ds-line); }
.swy-ds--kh .sidebar-brand,
.swy-ds--kh .sidebar-meta { border-color:var(--swy-ds-line); }
.swy-ds--kh .sidebar-brand strong,
.swy-ds--kh .sidebar-meta strong { color:#242625; }
.swy-ds--kh .sidebar-brand small,
.swy-ds--kh .sidebar-meta,
.swy-ds--kh .nav-group h2 { color:var(--swy-ds-muted); }
.swy-ds--kh .nav-item { min-height:38px; margin:3px 0; color:#46514a; }
.swy-ds--kh .nav-item:hover { color:var(--swy-ds-accent); background:#f4f6f5; }
.swy-ds--kh .nav-item.active { color:var(--swy-ds-accent); background:color-mix(in srgb,var(--swy-ds-accent) 9%,white); }
.swy-ds--kh .nav-icon { background:#f2f4f3; }
.swy-ds--kh .nav-item.active .nav-icon { background:color-mix(in srgb,var(--swy-ds-accent) 12%,white); }
.swy-ds--kh .workspace-toolbar .page-heading p { display:none; }
.swy-ds--kh .content-shell .table-card,
.swy-ds--hub .hub-os-main .card { background:var(--swy-ds-surface); border:1px solid var(--swy-ds-line); }
.swy-ds--kh .content-shell .btn,
.swy-ds--hub .hub-os-main :is(.button,.form button,.filters button,.post button) { border-radius:var(--swy-ds-radius-sm); }
.swy-ds--kh .content-shell table th { background:#f7f8f7; }
.swy-ds--kh .content-shell :is(.alert,.empty),
.swy-ds--hub .hub-os-main :is(.notice,.empty) { border-radius:var(--swy-ds-radius-sm); }
.swy-ds--os .os-page-main input,
.swy-ds--os .os-page-main select,
.swy-ds--kh .content-shell input,
.swy-ds--kh .content-shell select,
.swy-ds--hub .hub-os-main input,
.swy-ds--hub .hub-os-main select { border-radius:var(--swy-ds-radius-sm); }
.swy-ds--cp .container :is(input,select,textarea),
.swy-ds--wz .app-content :is(input,select,textarea),
.swy-ds--yx .workspace main :is(input,select,textarea),
.swy-ds--xx .admin-content :is(input,select,textarea) { border-radius:var(--swy-ds-radius-sm); }
.swy-ds--ai .ai-main :is(input,select,textarea),
.swy-ds--yf .content :is(input,select,textarea) { border-radius:var(--swy-ds-radius-sm); }
.swy-ds :is(a,button,input,select,textarea,summary):focus-visible { outline:2px solid var(--swy-ds-accent); outline-offset:2px; }
.swy-ds :is(button,input,select,textarea) { font:inherit; }
.swy-ds :is(.swy-tabs,.module-tabs,.admin-tabs) { scrollbar-width:thin; }

/* OS and KH use the same registry entries and the same header order. */
.swy-ds-nav-icon { display:inline-flex; align-items:center; justify-content:center; width:22px; min-width:22px; font-size:17px; line-height:1; }
.swy-ds-nav-icon .swy-nav-flag { width:20px; height:20px; object-fit:contain; }
.swy-ds-nav-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.swy-ds .oh-web-items [hidden],.swy-ds .kh-global-web-items [hidden],.swy-ds .oh-web-empty[hidden],.swy-ds .kh-global-web-empty[hidden] { display:none !important; }
.swy-ds--kh .sidebar-brand .brand-logo { width:36px; height:36px; flex:none; border-radius:9px; object-fit:cover; }
.swy-ds--kh .topbar { gap:10px; }
.swy-ds--kh .global-search { min-width:120px; }
.swy-ds--kh .topbar-actions { gap:5px; }
.swy-ds--kh .kh-global-nav { display:flex; align-items:center; gap:5px; }
.swy-ds--kh .kh-global-pop { position:relative; }
.swy-ds--kh .kh-global-pop > summary { display:flex; align-items:center; gap:6px; height:38px; padding:0 9px; border:1px solid transparent; border-radius:8px; font-size:12px; color:#303b46; background:#fff; }
.swy-ds--kh .kh-global-pop > summary:hover,.swy-ds--kh .kh-global-pop[open] > summary { border-color:var(--line); background:#f7f8f7; }
.swy-ds--kh .kh-global-symbol { width:17px; text-align:center; font-size:17px; line-height:1; }
.swy-ds--kh .kh-global-caret { color:#6b7280; font-size:11px; }
.swy-ds--kh .kh-global-color-dot { width:11px; height:11px; border-radius:50%; background:var(--primary); }
.swy-ds--kh .kh-global-menu { position:absolute; top:42px; right:0; z-index:50; min-width:220px; max-height:min(510px,calc(100vh - 80px)); overflow:auto; padding:8px; border:1px solid var(--line); border-radius:11px; background:#fff; box-shadow:0 18px 55px rgba(24,29,25,.14); }
.swy-ds--kh .kh-global-caption { padding:6px 9px 9px; color:#7d8790; font-size:10px; font-weight:700; }
.swy-ds--kh .kh-global-menu a,.swy-ds--kh .kh-global-menu button { display:flex; align-items:center; gap:10px; width:100%; padding:9px; border:0; border-radius:7px; text-align:left; color:#303b46; background:transparent; cursor:pointer; font-size:12px; }
.swy-ds--kh .kh-global-menu a:hover,.swy-ds--kh .kh-global-menu button:hover { background:#f3f6f5; }
.swy-ds--kh .kh-global-menu a[aria-current="page"] { color:var(--primary); font-weight:700; background:color-mix(in srgb,var(--primary) 9%,white); }
.swy-ds--kh .kh-global-menu form { margin:0; }
.swy-ds--kh .kh-global-menu p { padding:0 9px; color:var(--muted); font-size:12px; }
.swy-ds--kh .kh-global-web-menu { width:310px; }
.swy-ds--kh .kh-global-web-search { width:100%; height:36px; padding:0 9px; border:1px solid var(--line); border-radius:7px; }
.swy-ds--kh .kh-global-web-items { display:grid; grid-template-columns:1fr 1fr; gap:3px; margin-top:7px; }
.swy-ds--kh .kh-global-web-items a { min-width:0; gap:6px; }
.swy-ds--kh .kh-global-color-menu button i { width:14px; height:14px; flex:none; border-radius:50%; }
.swy-ds--kh .kh-global-check { margin-left:auto; visibility:hidden; color:var(--primary); }
.swy-ds--kh .kh-global-color-menu button[aria-pressed="true"] .kh-global-check { visibility:visible; }
.swy-ds--kh .kh-global-nav .notification-button { border-color:transparent; }
@media (max-width:1320px) { .swy-ds--kh .kh-global-nav .kh-global-pop > summary { padding:0 6px; } .swy-ds--kh .top-link b { display:none; } }
@media (max-width:950px) { .swy-ds--kh .kh-global-pop > summary { font-size:0; gap:0; } .swy-ds--kh .kh-global-caret { display:none; } .swy-ds--kh .kh-global-symbol,.swy-ds--kh .kh-global-color-dot { font-size:17px; } }
@media (max-width:680px) { .swy-ds--kh .kh-global-nav .kh-global-pop { display:none; } }

@media (max-width:760px) {
  .swy-ds-page-header { align-items:flex-start; flex-direction:column; gap:var(--swy-ds-space-2); }
  .swy-ds-page-header-actions { justify-content:flex-start; }
}
