/* Shared shadcn tokens and presentation for the complete application. */
html:root {
 --font-ui:"MaiNet Rounded","PingFang SC","Microsoft YaHei UI",system-ui,sans-serif;
 --bg:var(--background);--surface:var(--card);--surface-soft:var(--muted-bg);--text:var(--foreground);--muted:var(--muted-foreground);--line:var(--border);
 --accent:var(--primary);--accent-strong:var(--foreground);--accent-soft:var(--accent-bg);--focus-ring:light-dark(#27272a20,#f4f4f530);
 --nav-bg:var(--sidebar);--nav-text:var(--sidebar-foreground);--green:light-dark(#187044,#79d3a3);--pink:light-dark(#a33c67,#f3a5c9);
 --ink:var(--foreground);--blue:var(--foreground);--control-radius:8px;--item-radius:12px;--panel-padding:24px;
 --shadow:0 12px 40px #0000001a;--soft-shadow:none;--app-sidebar-width:16rem;--app-header-height:64px;
}
html[data-sidebar="collapsed"]{--app-sidebar-width:3rem}
html[data-bs-theme="light"]{color-scheme:light}
html[data-bs-theme="dark"]{color-scheme:dark}
body,body.app-mode {margin:0;background:var(--background);color:var(--foreground);font-family:var(--font-ui);font-size:14px;line-height:1.6;letter-spacing:0}
button,input,select,textarea{font-family:var(--font-ui)}
::selection{background:light-dark(#dadae4,#50505c)}
body button:focus-visible,body a:focus-visible,body summary:focus-visible {outline:2px solid var(--ring);outline-offset:3px}
body button:disabled{opacity:.5;cursor:not-allowed}
body .hidden,[hidden]{display:none!important}
/* The source DOM remains mounted; the React shell owns navigation and menus. */
body #sidebar,body #appTopbar,body #mobileMenuBtn,body #mobileSidebarBackdrop{display:none!important}
body.app-mode .shell{display:block;width:100%;max-width:none;min-height:100dvh;height:auto;margin:0;padding:0;overflow:visible}
body.app-mode #homeView.home,body.app-mode #homeView.home.sidebar-expanded,body.app-mode #homeView.home.sidebar-collapsed {display:block;min-width:0;max-width:none;width:auto;height:auto;min-height:100dvh;margin:0 0 0 var(--app-sidebar-width);padding:0;border:0;border-radius:0;background:var(--background);box-shadow:none;backdrop-filter:none;overflow:visible}
body.app-mode #workspaceContent.workspace{display:block;max-width:1560px;min-width:0;min-height:100dvh;height:auto;margin:0 auto;padding:calc(var(--app-header-height) + 36px) clamp(24px,3.3vw,52px) 28px;overflow:visible}
#shadcn-root{position:relative;z-index:40;color:var(--foreground);font-family:var(--font-ui)}
#shadcn-root .shadcn-shell{position:fixed;inset:0;pointer-events:none;min-height:0;background:transparent}
#shadcn-root [data-slot="sidebar-container"],#shadcn-root .shadcn-header{pointer-events:auto}
#shadcn-root [data-slot="sidebar-container"]{z-index:41;border-color:var(--border);height:100dvh;max-height:100dvh;overflow:hidden}
#shadcn-root [data-slot="sidebar-inner"]{background:var(--sidebar)}
#shadcn-root [data-slot="sidebar-content"],[data-slot="sidebar"][data-mobile="true"] [data-slot="sidebar-content"]{overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:thin;scrollbar-color:var(--border) transparent}
#shadcn-root .new-sidebar-header,[data-mobile="true"] .new-sidebar-header{padding:22px 18px 16px;min-height:85px;display:flex;justify-content:center}
.new-brand{display:flex;align-items:center;gap:11px;min-width:0;color:var(--foreground)}
.new-brand img{width:34px;height:34px;object-fit:cover;border:1px solid var(--border);border-radius:9px;flex-shrink:0}
.new-brand strong{font-size:14px;font-weight:700;letter-spacing:-.03em;white-space:nowrap}
.new-brand strong span{font-weight:400;margin-left:2px}
.new-brand small{display:block;font-size:10px;color:var(--muted-foreground);margin-top:2px;white-space:nowrap}
.brand-compact{justify-content:center}.brand-compact img{width:28px;height:28px}.brand-compact>div{display:none}
#shadcn-root .new-sidebar-content,[data-mobile="true"] .new-sidebar-content{padding:0 8px;gap:4px}
#shadcn-root [data-slot="sidebar-group"],[data-mobile="true"] [data-slot="sidebar-group"]{padding:2px 4px}
#shadcn-root [data-slot="sidebar-menu-button"],[data-mobile="true"] [data-slot="sidebar-menu-button"]{border:0;box-shadow:none;min-height:35px;padding:8px 12px;border-radius:7px;font-size:12px;font-weight:400;line-height:1.4;gap:10px;background:transparent;color:var(--sidebar-foreground);text-align:left}
#shadcn-root [data-slot="sidebar-menu-button"] svg,[data-mobile="true"] [data-slot="sidebar-menu-button"] svg{width:16px;height:16px;stroke-width:1.7}
#shadcn-root [data-slot="sidebar-menu-button"]:hover,[data-mobile="true"] [data-slot="sidebar-menu-button"]:hover{background:var(--sidebar-accent)}
#shadcn-root [data-slot="sidebar-menu-button"][data-active="true"],[data-mobile="true"] [data-slot="sidebar-menu-button"][data-active="true"]{background:var(--card);box-shadow:0 1px 3px #0000000b,0 0 0 1px var(--border);color:var(--foreground);font-weight:600}
#shadcn-root .nav-primary-group,[data-mobile="true"] .nav-primary-group{padding-bottom:7px;border-bottom:1px solid var(--border)}
#shadcn-root .nav-collapsible-group,[data-mobile="true"] .nav-collapsible-group{padding-block:1px}
#shadcn-root .nav-group-trigger,[data-mobile="true"] .nav-group-trigger{min-height:40px;color:var(--foreground);font-size:13px;font-weight:600}
#shadcn-root .nav-group-trigger>svg:first-child,[data-mobile="true"] .nav-group-trigger>svg:first-child{color:var(--muted-foreground)}
#shadcn-root .nav-group-trigger .nav-group-chevron,[data-mobile="true"] .nav-group-trigger .nav-group-chevron{width:15px;height:15px;margin-left:auto;color:var(--muted-foreground);transition:transform .16s ease}
#shadcn-root .nav-collapsible-group[data-state="open"] .nav-group-chevron,[data-mobile="true"] .nav-collapsible-group[data-state="open"] .nav-group-chevron{transform:rotate(90deg)}
#shadcn-root .nav-group-submenu,[data-mobile="true"] .nav-group-submenu{margin:2px 4px 7px 20px;padding:2px 0 2px 16px;gap:2px;border-color:var(--border)}
#shadcn-root .nav-group-item,[data-mobile="true"] .nav-group-item{width:100%;min-height:34px;height:auto;border:0;padding:7px 9px;border-radius:6px;background:transparent;color:var(--sidebar-foreground);font-size:12px;line-height:1.45;text-align:left;cursor:pointer}
#shadcn-root .nav-group-item:hover,[data-mobile="true"] .nav-group-item:hover{background:var(--sidebar-accent)}
#shadcn-root .nav-group-item[data-active="true"],[data-mobile="true"] .nav-group-item[data-active="true"]{background:var(--card);box-shadow:0 1px 3px #0000000b,0 0 0 1px var(--border);color:var(--foreground);font-weight:600}
#shadcn-root .nav-group-item small,[data-mobile="true"] .nav-group-item small{margin-left:auto;color:var(--muted-foreground);font-size:9px;font-weight:500}
#shadcn-root .new-sidebar-footer,[data-mobile="true"] .new-sidebar-footer{padding:8px 12px 12px;gap:8px}
#shadcn-root [data-state="collapsed"] .new-sidebar-header{padding:16px 0;min-height:70px}
#shadcn-root [data-state="collapsed"] .new-sidebar-content{padding:0 4px}
#shadcn-root [data-state="collapsed"] [data-slot="sidebar-group"]{padding:0 4px}
#shadcn-root [data-state="collapsed"] .nav-group-trigger>span,#shadcn-root [data-state="collapsed"] .nav-group-chevron{display:none}
#shadcn-root [data-state="collapsed"] .nav-primary-group{padding-bottom:4px}
#shadcn-root [data-state="collapsed"] .new-sidebar-footer{padding-inline:8px}
.shadcn-header{position:fixed;left:var(--app-sidebar-width);right:0;top:0;height:var(--app-header-height);display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 28px;background:var(--background);border-bottom:1px solid var(--border);z-index:42}
.header-context,.header-utilities{display:flex;align-items:center;gap:12px;min-width:0}
.header-context{gap:16px}.header-breadcrumb{color:var(--muted-foreground);font-size:11px;white-space:nowrap}.header-breadcrumb strong{color:var(--foreground);font-weight:500}
#shadcn-root [data-slot="button"]{margin:0;box-shadow:none;letter-spacing:0;line-height:1.4;flex-shrink:0}
#shadcn-root [data-slot="button"] svg{width:16px;height:16px;stroke-width:1.7}
#shadcn-root .command-trigger{font-size:11px;gap:7px;color:var(--muted-foreground);padding:7px 8px;height:36px}
.command-trigger kbd{border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:9px;line-height:1.5;margin-left:18px;background:var(--card);font-family:inherit}
#shadcn-root .data-source-trigger{height:36px;min-width:60px;gap:4px;padding:6px 8px;font-size:12px;color:var(--foreground)}
#shadcn-root .data-source-trigger svg{width:12px;height:12px}
#shadcn-root .notification-trigger{position:relative;width:36px;height:36px;padding:0;background:transparent;color:var(--foreground);border:0;border-radius:7px}
#shadcn-root .notification-trigger:hover,#shadcn-root .notification-trigger[data-active="true"]{background:var(--muted-bg)}
.account-avatar[data-slot="avatar"],.account-avatar [data-slot="avatar-fallback"]{border-radius:6px}
.account-avatar{border:1px solid var(--border);background:var(--muted-bg)}
.account-avatar img{object-fit:cover}
.account-menu{width:300px;max-width:calc(100vw - 24px)}
.account-menu .account-menu-item{min-height:54px;gap:12px;padding:8px}
.account-menu-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}
.account-menu-copy>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-menu-copy small{font-size:10px;color:var(--muted-foreground)}
.account-menu-item[aria-current="true"]{background:var(--muted-bg)}
.user-menu-profile{display:flex;flex-direction:column;gap:4px}
.user-menu-profile>span{color:var(--foreground);font-size:13px;font-weight:600}
.user-menu-profile small{font-size:11px;font-weight:400;color:var(--muted-foreground)}
.notification-badge{position:absolute;right:-1px;top:-1px;min-width:17px;height:17px;display:flex;align-items:center;justify-content:center;padding:0 4px;border:2px solid var(--background);border-radius:20px;background:light-dark(#b42332,#f2a2ad);color:light-dark(#fff,#391017);font-size:9px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
.notification-menu{width:320px;max-width:calc(100vw - 24px)}
.notification-menu .notification-menu-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 9px}
.notification-menu-heading small{font-size:10px;font-weight:400;color:var(--muted-foreground)}
.notification-menu .notification-item{min-height:48px;align-items:flex-start;gap:10px;padding:12px 9px;line-height:1.6}
.notification-item>span:last-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}
.notification-unread-dot{flex:0 0 6px;width:6px;height:6px;margin-top:7px;border-radius:50%;background:light-dark(#b42332,#f2a2ad)}
.notification-menu .notification-history-action{justify-content:center;gap:8px;min-height:40px;color:var(--foreground);font-weight:500}
.shadcn-popover .menu-empty{padding:20px 9px;text-align:center;font-size:12px;color:var(--muted-foreground)}
#shadcn-root .user-trigger{padding:0;height:34px;width:34px;border-radius:50%}
.shadcn-popover,.shadcn-command,[data-slot="sidebar"][data-mobile="true"]{font-family:var(--font-ui);color:var(--foreground)}
.shadcn-popover{z-index:120!important;line-height:1.5;background:var(--popover);border:1px solid var(--border);padding:5px;border-radius:10px;box-shadow:var(--shadow)}
.shadcn-popover [role^="menuitem"]{cursor:pointer;min-height:36px;font-size:12px;border-radius:5px}
.shadcn-popover [data-slot="dropdown-menu-radio-item"]{padding-left:30px}
.shadcn-popover [data-slot="dropdown-menu-label"]{font-size:11px;color:var(--muted-foreground);padding:8px}
.shadcn-popover p,.shadcn-popover small{margin:0}
.shadcn-popover [role^="menuitem"]:focus{outline:none;background:var(--accent-bg)}
[data-slot="dialog-overlay"],[data-slot="sheet-overlay"]{z-index:100;background:#0007;backdrop-filter:blur(3px)}
.shadcn-command{z-index:101!important;background:var(--popover);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow)}
.shadcn-command [data-slot="command"]{background:transparent;color:var(--foreground)}
.shadcn-command [data-slot="command-input"]{border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;min-height:52px;font-size:14px;color:var(--foreground)}
.shadcn-command [data-slot="command-input-wrapper"]{padding-inline:16px}
.shadcn-command [data-slot="command-group-heading"]{font-size:11px;color:var(--muted-foreground)}
.shadcn-command [data-slot="command-item"]{font-size:13px;min-height:42px;cursor:pointer}
.shadcn-command [data-slot="command-item"][data-selected="true"]{background:var(--accent-bg)}
.shadcn-command [data-slot="dialog-close"]{width:28px;height:28px;padding:6px}
.content-search{gap:0;max-height:calc(100dvh - 40px)}
.content-search [data-slot="command-input-wrapper"]{padding-right:52px}
.content-search [data-slot="command-list"]{max-height:min(440px,calc(100dvh - 210px));overscroll-behavior:contain}
.content-search-scopes{display:flex;gap:4px;padding:10px 12px;border-bottom:1px solid var(--border);overflow-x:auto}
.content-search-scopes button{flex-shrink:0;border:0;border-radius:6px;background:transparent;color:var(--muted-foreground);padding:7px 11px;font:inherit;font-size:12px;cursor:pointer}
.content-search-scopes button[aria-pressed="true"]{background:var(--accent-bg);color:var(--foreground);font-weight:600}
.content-search-scopes button:focus-visible,.content-search-status button:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.content-search .content-search-result{gap:12px;padding:10px 8px;min-height:60px}
.content-search-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}
.content-search-copy>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.content-search-copy small{color:var(--muted-foreground);font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.content-search-arrow{margin-left:auto;opacity:.45}
.content-search-feature-description{margin-left:auto;max-width:46%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted-foreground);font-size:11px}
.content-search .content-search-status{display:flex;align-items:center;gap:8px;margin:0;padding:12px 8px;color:var(--muted-foreground);font-size:12px;line-height:1.7}
.content-search-status button{flex-shrink:0;margin-left:auto;border:1px solid var(--border);background:var(--card);color:var(--foreground);border-radius:5px;padding:3px 8px;cursor:pointer}
.content-search .content-search-empty{justify-content:center;padding:24px 12px}
.content-search .content-search-hint{margin:0;border-top:1px solid var(--border);padding:9px 16px;color:var(--muted-foreground);font-size:10px;line-height:1.6}
[data-slot="sidebar"][data-mobile="true"]{z-index:101;inset:0 auto 0 0;height:100dvh;max-height:100dvh;max-width:calc(100vw - 48px);border-right:1px solid var(--border);background:var(--sidebar);padding:0;overflow:hidden}
/* All business controls retain their original event listeners. */
body button.ui-action,body.app-mode button.ui-action{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:9px 16px;border:1px solid var(--border);border-radius:7px;background:var(--card);color:var(--foreground);font-size:12px;font-weight:500;line-height:1.5;box-shadow:0 1px 2px #00000005;letter-spacing:0;transition:background .15s,border-color .15s}
body button.ui-action.primary,body.app-mode button.ui-action.primary{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}
body button.ui-action:hover:not(:disabled){background:var(--accent-bg);border-color:var(--input);color:var(--foreground);transform:none}
body button.ui-action.primary:hover:not(:disabled){background:var(--primary);opacity:.88;color:var(--primary-foreground)}
body input.ui-input,body select.ui-input,body textarea.ui-input,body.app-mode input.ui-input,body.app-mode select.ui-input,body.app-mode textarea.ui-input{background-color:var(--card);color:var(--foreground);border:1px solid var(--input);border-radius:7px;padding:9px 12px;min-height:40px;max-width:100%;font-size:13px;box-shadow:0 1px 2px #00000003}
body input.ui-input:focus,body select.ui-input:focus,body textarea.ui-input:focus{outline:3px solid var(--focus-ring);border-color:var(--ring);outline-offset:0}
body input::placeholder,body textarea::placeholder{color:var(--muted-foreground);opacity:.8}
body select.ui-input{padding-right:34px}
body select.ui-input option{background:var(--card);color:var(--foreground)}
body .field>span{font-size:12px;font-weight:500}
body .field-hint{font-size:11px}
body .field{margin:14px 0;gap:8px}
body input[type="checkbox"]{border-radius:4px;border-color:var(--input);background-color:var(--card)}
body input[type="checkbox"]:checked{background-color:var(--primary);border-color:var(--primary)}
.dark body input[type="checkbox"]:checked{background-color:#858593;border-color:#858593}
body .support-link{color:var(--muted-foreground);font-weight:400;font-size:11px}
body .support-link:hover{color:var(--foreground)}
body.app-mode .workspace-header,body.app-mode .workspace-header.split-header{margin:0 0 28px;gap:20px;align-items:center}
body.app-mode .workspace-header h2{font-size:26px;line-height:1.4;font-weight:650;letter-spacing:-.035em;color:var(--foreground)}
body.app-mode .workspace-header .eyebrow{font-size:10px;letter-spacing:.07em;margin-bottom:6px;color:var(--muted-foreground)}
body.app-mode .workspace-header p.muted{font-size:12px;line-height:1.7;max-width:680px}
body.app-mode :is(.tool-panel,.stats-panel,.cache-overview,.best-panel,.settings-panel){background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:11px;padding:24px;box-shadow:0 1px 3px #00000003}
body.app-mode :is(.song-result-card,.best-card,.admin-row,.collectible-card,.kaleid-card,.announcement-card,.announcement-admin-row,.map-card){background:var(--card);border-color:var(--border);border-radius:9px;box-shadow:none}
body.app-mode .best-panel-title h3,body.app-mode .section-title h2,body.app-mode .compact-title h2{font-size:15px;font-weight:600;letter-spacing:-.02em}
body.app-mode .section-title p{font-size:12px;line-height:1.7;color:var(--muted-foreground)}
body.app-mode .feature-tabs{display:flex;align-items:center;gap:4px;width:max-content;max-width:100%;margin:0 0 24px;padding:4px;background:var(--muted-bg);border:1px solid var(--border);border-radius:8px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
body.app-mode .feature-tabs>[role="tab"]{flex:0 0 auto;min-height:34px;white-space:nowrap;border:0;border-radius:5px;padding:7px 15px;background:transparent;color:var(--muted-foreground);font-size:12px;font-weight:500;box-shadow:none}
body.app-mode .feature-tabs>[role="tab"]:hover{color:var(--foreground);background:var(--accent-bg)}
body.app-mode .feature-tabs>[role="tab"][aria-selected="true"],body.app-mode .feature-tabs>[role="tab"].active{background:var(--card);color:var(--foreground);box-shadow:0 1px 3px #00000012;font-weight:600}
body .role-badge{background:var(--muted-bg);color:var(--foreground);border:1px solid var(--border);border-radius:4px;font-size:10px;line-height:1.5;padding:2px 6px}
body .toast,body .supporter-user-card{background:var(--popover)!important;color:var(--foreground);border-color:var(--border);border-radius:10px}
body :is(.support-dialog,.best50-dialog,.ban-dialog,.reauth-dialog,.bot-auth-dialog,.activation-dialog,.map-dialog,.random-song-dialog,.chart-player-dialog,.b50-export-dialog,.page-loading-dialog){background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow)}
body :is(.support-close,.best50-close,.random-song-close,.chart-player-close){background:var(--muted-bg);color:var(--foreground);border:1px solid var(--border);border-radius:6px}
body :is(.form-message.error,.operation-status-card.error,.result-card.error,.result-item.error){color:light-dark(#b52c40,#ff99ab)}
body :is(.form-message.success,.operation-status-card.success,.result-card.success,.result-item.success){color:var(--green)}
body.app-mode .app-footer{margin-top:40px;padding-top:20px;border-top:1px solid var(--border);font-size:10px}
/* Overview: metrics, account details and a separate quick-action column. */
body.app-mode .overview-header .overview-profile img{width:48px;height:48px;border-radius:12px;border:1px solid var(--border);box-shadow:none}
body.app-mode .overview-identity{font-size:11px;color:var(--muted-foreground);margin-top:5px}
body.app-mode .overview-site-summary{display:flex;flex-wrap:wrap;align-items:center;gap:12px 28px;padding:0 0 22px;margin:-5px 0 24px;border-top:0;border-bottom:1px solid var(--border)}
body.app-mode .overview-site-summary>div{display:flex;flex-direction:row;align-items:center;gap:9px}
body.app-mode .overview-site-summary dt{font-size:10px}body.app-mode .overview-site-summary dd{font-size:12px;font-weight:600;color:var(--foreground)}
body.app-mode #workspaceContent .overview-metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:0 0 24px;padding:0;background:transparent;border:0}
body.app-mode #workspaceContent .overview-metric-grid .metric-card{padding:22px 24px;background:var(--card);border:1px solid var(--border);border-radius:11px;min-height:136px;box-shadow:0 1px 3px #00000003;display:flex;flex-direction:column;gap:8px;justify-content:flex-start}
body.app-mode #workspaceContent .overview-metric-grid .metric-card>span{font-size:11px;font-weight:400;color:var(--muted-foreground)}
body.app-mode #workspaceContent .overview-metric-grid .metric-card strong{font-size:25px;font-weight:650;letter-spacing:-.035em;line-height:1.3;color:var(--foreground);white-space:normal;overflow-wrap:anywhere}
body.app-mode #workspaceContent .overview-metric-grid .rating-card strong{font-size:32px;color:var(--foreground)}
body.app-mode #workspaceContent .overview-metric-grid .metric-card small{font-size:10px;color:var(--muted-foreground);margin-top:auto}
body.app-mode .overview-account-layout{display:block;background:transparent;border:0;padding:0;margin:0 0 24px}
body.app-mode .overview-control-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;max-width:100%;margin:0}
body.app-mode .overview-control-card{padding:0;background:transparent;border:0;border-radius:0;margin:0}
body.app-mode .overview-control-card:first-child{display:none}
body.app-mode .overview-control-card:last-child{max-width:260px}
#shadcnOverviewTools{min-width:0;margin:0 0 24px}
body.app-mode #cachedOverview{min-width:0;margin:0 0 24px}
body.app-mode .overview-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px 20px}
body.app-mode .overview-grid .overview-item{border:0;background:transparent;padding:0}
body.app-mode .overview-grid strong{font-size:13px;font-weight:500;overflow-wrap:anywhere}
body .quick-actions-card{height:auto;background:var(--card);color:var(--foreground);border:1px solid var(--border);padding:24px 0;gap:18px;border-radius:11px;box-shadow:0 1px 3px #00000003}
.quick-actions-card [data-slot="card-header"]{padding:0 24px;gap:6px}
.quick-actions-card [data-slot="card-title"]{font-size:15px;font-weight:600;letter-spacing:-.02em}
.quick-actions-card [data-slot="card-description"]{font-size:11px;color:var(--muted-foreground);margin:0}
.quick-actions-card [data-slot="card-content"]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:0 14px;gap:8px}
body .quick-actions-card .quick-action{display:flex;width:100%;height:auto;min-height:67px;padding:12px 10px;gap:12px;align-items:center;justify-content:flex-start;background:transparent;box-shadow:none;border:0;border-radius:7px;color:var(--foreground);white-space:normal}
body .quick-actions-card .quick-action:hover{background:var(--muted-bg)}
.quick-action>span:nth-child(2){display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0;text-align:left}
.quick-action strong{font-size:12px;font-weight:500}.quick-action small{font-size:10px;color:var(--muted-foreground);font-weight:400}
.quick-action-icon{width:34px;height:34px;background:var(--muted-bg);border:1px solid var(--border);display:grid;place-items:center;border-radius:8px;flex-shrink:0}.quick-action-icon svg{width:16px;height:16px;stroke-width:1.5}
body.app-mode .overview-side-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr);gap:24px}
body.app-mode .overview-community-stack{display:grid;gap:16px}
body.app-mode .overview-leaderboard-panel .leaderboard-row:nth-child(n+6){display:none}
body.app-mode .overview-leaderboard-panel .leaderboard-list{gap:4px}
body.app-mode .settings-grid.feature-tabbed-layout .settings-panel{padding:28px;border-top:1px solid var(--border)}
/* A focused, centered authentication form with a compact brand in the header. */
body:not(.app-mode):not(:has(#sections)) .shell{width:min(420px,calc(100% - 48px));margin:0 auto;padding:128px 0 32px;align-content:center;gap:20px;min-height:100dvh}
body:not(.app-mode) .auth-logo{display:none}
body .auth-card{padding:0;background:transparent;border:0;border-radius:0;box-shadow:none;backdrop-filter:none}
body .auth-tabs{background:var(--muted-bg);border:1px solid var(--border);border-radius:8px;padding:4px;gap:4px;margin-bottom:30px}
body .auth-tabs .tab{min-height:35px;border-radius:5px;font-size:12px;font-weight:500;color:var(--muted-foreground)}
body .auth-tabs .tab.active{background:var(--card);color:var(--foreground);box-shadow:0 1px 3px #0000000f}
body #authView .section-title h2{font-size:26px;font-weight:650;letter-spacing:-.03em;margin-bottom:8px}
body #authView .section-title p{font-size:12px;line-height:1.7;color:var(--muted-foreground)}
body #authView .ui-input{min-height:44px;background:var(--card)}
body #authView button.primary{width:100%;min-height:44px;margin-top:18px}
body #authView .registration-actions{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:12px}
body #authView .registration-actions button{width:100%;height:44px;min-height:44px;margin:0;padding:10px 12px;white-space:nowrap}
body #authView .login-preferences{font-size:11px;gap:18px}
body #authView .auth-register-hint{font-size:11px;color:var(--muted-foreground)}
.auth-tools{position:fixed;right:28px;top:24px;display:flex;align-items:center;gap:14px;z-index:45}
.auth-brand{position:absolute;left:32px;top:28px;z-index:44}
body .auth-footer{margin:0;font-size:9px}.auth-footer .footer-actions{margin-top:8px}
/* Difficulty, cover artwork and the game canvas retain their game palette. */
.dark body :is(.song-chart-matrix,.song-chart-matrix td,.song-chart-matrix th,.song-rating-table td,.song-rating-table th,.b50-score-card,.b50-card-main,.b50-detail-meta,.record-row,.charge-item,.maimai-option-row,.region-rank-item,.score-log-item,.result-item,.result-card,.reborn-entry,.map-candidate){background-color:var(--card);border-color:var(--border);color:var(--foreground)}
.dark body :is(.b50-score-card small,.b50-score-card p,.b50-score-card .b50-title,.b50-detail-meta strong,.song-detail-meta strong){color:var(--foreground)}
.dark body :is(.chart-player-controls,.chart-player-settings,.chart-player-toolbar,.chart-player-meta,.chart-player-timeline,.chart-player-difficulty,.chart-player-heading){background-color:var(--card);color:var(--foreground);border-color:var(--border)}
.dark body .chart-player-dialog :is(select,input,button){background-color:var(--muted-bg);color:var(--foreground);border-color:var(--border)}
body .player-card .player-card-text{color:#27231a}
/* Help is the same complete help application. */
body:has(#sections) .site-header{background:var(--card);color:var(--foreground);border-color:var(--border);padding-right:90px}
body:has(#sections) :is(.sidebar,main,.category,.feature,.start-guide,.rules-strip,.search-toolbar,details,.help-account){background:var(--card);color:var(--foreground);border-color:var(--border)}
body:has(#sections) .layout{max-width:1440px}
body:has(#sections) :is(h1,h2,h3,h4,strong,a,summary,label){color:var(--foreground)}
body:has(#sections) :is(p,small,.permission,.category-description,.header-label){color:var(--muted-foreground)}
body:has(#sections) .auth-tools{top:15px;right:24px}
body:has(#sections) :is(input,select){background-color:var(--card);color:var(--foreground);border-color:var(--border)}
@media(min-width:1600px){body.app-mode #workspaceContent.workspace{padding-top:110px}}
@media(max-width:1180px){.header-breadcrumb{display:none}.header-context{gap:8px}.header-utilities{gap:9px}.command-trigger kbd{display:none}body.app-mode #workspaceContent .overview-metric-grid .metric-card strong{font-size:21px}body.app-mode .overview-side-grid{grid-template-columns:minmax(0,1.3fr) minmax(230px,1fr);gap:18px}}
@media(max-width:980px){.account-trigger-name{max-width:95px}.command-trigger span{display:none}#shadcn-root .command-trigger{width:32px;padding:0}.shadcn-header{padding-inline:20px}body.app-mode .overview-side-grid,.quick-actions-card [data-slot="card-content"]{grid-template-columns:1fr}}
@media(max-width:767px){
 html:root{--app-sidebar-width:0px;--panel-padding:18px;--app-header-height:60px}html[data-sidebar="collapsed"]{--app-sidebar-width:0px}
 body.app-mode #homeView.home,body.app-mode #homeView.home.sidebar-expanded,body.app-mode #homeView.home.sidebar-collapsed{margin-left:0}
 body.app-mode #workspaceContent.workspace,body.app-mode #homeView.home .workspace{padding:86px 18px 24px;width:100%;margin:0;min-height:100dvh}
 .shadcn-header{left:0;padding:0 12px;gap:10px}.header-context{gap:0}.header-context>[data-slot="separator"]{display:none}.header-utilities{gap:5px}
 #shadcn-root .account-trigger{padding:5px 7px}.account-trigger-name{max-width:95px}.shadcn-header #appearanceButton{width:36px}.shadcn-header .user-trigger{width:30px;height:30px}
 #shadcn-root .command-trigger{height:36px;width:32px}
 #shadcn-root .nav-group-trigger,[data-mobile="true"] .nav-group-trigger,#shadcn-root .nav-group-item,[data-mobile="true"] .nav-group-item{min-height:44px}
 body.app-mode .workspace-header,body.app-mode .workspace-header.split-header{margin-bottom:22px;gap:16px}
 body.app-mode .workspace-header h2{font-size:24px}body.app-mode .workspace-header .eyebrow{font-size:10px}
 body.app-mode .overview-profile{gap:12px}.overview-shortcuts{display:flex;gap:8px;width:100%}body.app-mode .overview-shortcuts button{flex:1;min-height:40px}
 body.app-mode .overview-site-summary{gap:16px;padding:0 0 18px;margin:0 0 18px;justify-content:space-between}
 body.app-mode .overview-site-summary>div{flex-direction:column;align-items:flex-start;gap:3px}body.app-mode .overview-site-summary dt{font-size:9px}
 body.app-mode #workspaceContent .overview-metric-grid{grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px}
 body.app-mode #workspaceContent .overview-metric-grid .metric-card{padding:16px;min-height:126px;gap:10px}
 body.app-mode #workspaceContent .overview-metric-grid .metric-card strong{font-size:20px}body.app-mode #workspaceContent .overview-metric-grid .rating-card strong{font-size:30px}
 body.app-mode #workspaceContent .overview-metric-grid .cache-metric-card{grid-column:1 / -1;min-height:0;display:grid;grid-template-columns:1fr auto;align-items:center;gap:3px 12px}
 body.app-mode #workspaceContent .overview-metric-grid .cache-metric-card strong{grid-row:1 / 3;grid-column:2;font-size:15px}.cache-metric-card small{grid-row:2}
 body.app-mode .overview-control-grid{grid-template-columns:1fr;margin:0}body.app-mode .overview-control-card:last-child{max-width:none}
 body.app-mode .overview-side-grid{grid-template-columns:1fr;gap:18px;margin-bottom:18px}
 #shadcnOverviewTools{margin-bottom:20px}
 body.app-mode :is(.tool-panel,.stats-panel,.cache-overview,.best-panel,.settings-panel){padding:18px;border-radius:10px}
 body.app-mode .overview-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px}
 body.app-mode .feature-tabs{display:flex;gap:3px;width:100%;padding:4px;margin-bottom:20px}
 body.app-mode .feature-tabs>[role="tab"]{flex:1 0 auto;font-size:12px;padding:8px 12px;min-height:36px}
 body.app-mode .feature-tabs>[role="tab"]:last-child:nth-child(odd){grid-column:auto}
 body.app-mode .settings-grid.feature-tabbed-layout .settings-panel{padding:20px}
 body.app-mode :is(input.ui-input,select.ui-input,textarea.ui-input){font-size:16px;min-height:44px}
 body button.ui-action{min-height:44px}
 .auth-tools{top:20px;right:20px;gap:8px}.auth-brand{left:20px;top:24px}
 .auth-brand .new-brand{gap:8px}.auth-brand .new-brand img{width:30px;height:30px}.auth-brand .new-brand strong{font-size:12px}.auth-brand .new-brand small{font-size:9px}
 body:not(.app-mode):not(:has(#sections)) .shell{width:min(400px,calc(100% - 40px));margin:0 auto;padding:116px 0 30px;gap:20px;min-height:100dvh}
 body:has(#sections) .site-header{padding-right:70px}.header-label{display:none}
 .shadcn-command [data-slot="command-item"]>span:last-child:not(:first-child){max-width:135px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

@media(min-width:768px){
 #shadcn-root [data-slot="sidebar"]{display:block!important}
 #shadcn-root [data-slot="sidebar-container"]{display:flex!important}
 .shadcn-header{transition:left .2s linear}
 body.app-mode #homeView.home{transition:margin-left .2s linear}
 body.app-mode #workspaceContent .overview-metric-grid .metric-card{grid-column:auto;text-align:left}
 body.app-mode #workspaceContent .overview-metric-grid .cache-metric-card strong{font-size:17px;margin-block:8px}
}
@media(min-width:768px){body.app-mode #workspaceContent .overview-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}body.app-mode #workspaceContent .overview-metric-grid .cache-metric-card{align-items:flex-start}}
@media(max-width:767px){body.app-mode #workspaceContent .overview-metric-grid{grid-template-columns:1fr 1fr!important}}
body.app-mode #workspaceContent .settings-grid.feature-tabbed-layout .settings-panel{background:var(--card);border:1px solid var(--border);border-radius:11px;padding:28px}
#shadcnAdSlot:empty{display:none}
#shadcnAdSlot .sidebar-ad{margin:0 0 8px;padding:0;border:0;border-radius:8px;overflow:hidden;background:var(--muted-bg)}
#shadcnAdSlot .sidebar-ad-media{width:100%;height:auto;max-height:none;aspect-ratio:16 / 9;position:relative;border:1px solid var(--border);border-radius:8px;overflow:hidden}
#shadcnAdSlot .sidebar-ad-slide{position:absolute;inset:0;display:block}
#shadcnAdSlot .sidebar-ad-slide img{width:100%;height:100%;object-fit:cover}
#shadcnAdSlot .sidebar-ad-toolbar{display:flex;justify-content:space-between;font-size:8px;padding:4px 2px;color:var(--muted-foreground)}
html[data-mobile="false"][data-sidebar="collapsed"] #shadcnAdSlot{display:none}

/* Artwork is kept in its original palette; its surrounding UI uses theme tokens. */
.dark body :is(.nearby-location-summary,.nearby-map-frame,.nearby-map-image,.nearby-detail-popover,.option-kind-card,.kaleid-status-grid,.recent-update-image-card,.operation-status-details span,.trend-chart){background:var(--muted-bg);border-color:var(--border);box-shadow:none}
.dark body :is(.nearby-shop-item,.nearby-stat,.maimai-option-row,.region-rank-item){background:var(--card);border-color:var(--border)}
.dark body :is(.nearby-shop-item:hover,.nearby-shop-item:focus-visible,.collectible-kind-card.active,.collectible-kind-card:nth-child(2).active,.collectible-kind-card:nth-child(3).active,.collectible-kind-card:nth-child(4).active){background:var(--accent-bg);border-color:var(--ring);box-shadow:none}
.dark body :is(.song-result-meta-chip span,.region-map-disclaimer,.recent-update-image-card small,.nearby-provider-note,.collectible-meta,.collectible-condition){color:var(--muted-foreground)}
.dark body :is(.collectible-preview,.collectible-title .collectible-preview.title-background-unavailable){background:var(--muted-bg);border-color:var(--border)}
.dark body .collectible-title-preview-text{color:var(--foreground);text-shadow:0 1px 2px #0009}
.dark body .recent-update-image-card img{background:var(--card)}
body.app-mode .b50-cover>span{background:rgba(18,18,22,.9);color:#fff}
.dark body :is(.supporter-admin-button,.developer-admin-button){background:var(--card);color:var(--foreground);border-color:var(--input)}
.dark body :is(.supporter-admin-button.active,.developer-admin-button.active){background:var(--accent-bg);color:var(--foreground);border-color:var(--ring);box-shadow:inset 3px 0 var(--ring)}
.dark body :is(.developer-badge,.supporter-badge,.developer-avatar-button,.supporter-avatar-button){background:var(--muted-bg);border-color:var(--border)}
.dark body .developer-avatar-title{color:var(--pink)}
.dark body :is(.supporter-user-card,.supporter-user-card::before){background:var(--popover);color:var(--foreground);border-color:var(--border)}
.dark body :is(.operation-status-card,.result-card){background:var(--card);border-color:var(--border)}
.dark body :is(.result-card.success,.operation-status-card.success){background:color-mix(in srgb,var(--green) 8%,var(--card));border-color:color-mix(in srgb,var(--green) 35%,var(--border))}
.dark body :is(.result-card.error,.operation-status-card.error){background:color-mix(in srgb,var(--destructive) 8%,var(--card));border-color:color-mix(in srgb,var(--destructive) 35%,var(--border))}
.dark body :is(.result-card.success strong,.operation-status-card.success strong,.nearby-shop-status.synced){color:var(--green)}
.dark body :is(.result-card.error strong,.operation-status-card.error strong,.nearby-shop-status.unsynced){color:var(--destructive)}
.dark body .china-map-wrap{background:var(--muted-bg);box-shadow:inset 0 0 0 1px var(--border)}
.dark body .china-region path{stroke:#77777f;filter:none}
.dark body .china-region.heat-0 path{fill:#39393f}
.dark body .china-region.heat-1 path{fill:#725136}
.dark body .china-region.heat-2 path{fill:#945a31}
.dark body .china-region.heat-3 path{fill:#ac5e28}
.dark body .china-region.heat-4 path{fill:#c26b29}
.dark body .china-region.heat-5 path{fill:#db8339}
.dark body .china-region text{fill:#fafafa;stroke:#242429;stroke-width:2.5px}
.dark body :is(.china-region:hover,.china-region:focus) path{stroke:#ffd2a4;filter:drop-shadow(0 0 6px #e7a26d40)}
.dark body .china-map-loading{fill:var(--muted-foreground)}
.dark body .trend-grid-line{stroke:#64646f;opacity:.6}
.dark body .trend-area{fill:#a7c9dc;opacity:.12}
.dark body :is(.trend-line,.trend-svg polyline){stroke:#b7d7ea;filter:none}
.dark body :is(.trend-dot,.trend-svg circle){fill:#f3a5c9;stroke:var(--muted-bg)}
.dark body select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 8 4 4 4-4' fill='none' stroke='%23c6c6ce' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-size:20px;background-position:right 10px center;background-repeat:no-repeat}
.dark body :is(.maimai-status-icon-rate,.maimai-status-icon-combo,.maimai-status-icon-sync,.maimai-status-icon-dx-star){filter:drop-shadow(0 1px 1px #0009)}
.dark body :is(.auth-logo,.bot-auth-logo,.brand img){filter:drop-shadow(0 2px 5px #0003)}
body dialog{margin:auto}
body dialog::backdrop{background:rgba(8,8,12,.62);backdrop-filter:blur(3px)}
.dark body dialog::backdrop{background:rgba(0,0,0,.7)}

/* Difficulty colors use the same tokens across matrices, credits and score rows. */
.dark body .difficulty-basic{--diff-bg:#1d392b;--diff-fg:#9be4b7;--diff-border:#3c674e}
.dark body .difficulty-advanced{--diff-bg:#40351c;--diff-fg:#f4d77e;--diff-border:#756338}
.dark body .difficulty-expert{--diff-bg:#44252e;--diff-fg:#ffb0be;--diff-border:#80505c}
.dark body .difficulty-master{--diff-bg:#342641;--diff-fg:#dcbaff;--diff-border:#6b4e83}
.dark body .difficulty-remaster{--diff-bg:#3b3645;--diff-fg:#f0e3ff;--diff-border:#7b6c8c}
.dark body .difficulty-utage{--diff-bg:#43283a;--diff-fg:#ffb9df;--diff-border:#81536d}
.dark body :is(.song-matched-chart,.song-score-row,.song-charter-card,.song-chart-matrix th[class*="difficulty-"],.song-chart-matrix td[class*="difficulty-"]){background:var(--diff-bg);color:var(--diff-fg);border-color:var(--diff-border)}
.dark body .song-charter-card :is(strong,span){color:var(--diff-fg)}
body .song-chart-play-icon{position:relative;display:inline-block;width:22px;height:22px;flex:0 0 22px;padding:0;border:1px solid color-mix(in srgb,currentColor 45%,transparent);background:color-mix(in srgb,currentColor 10%,transparent);color:inherit;font-size:0;line-height:0}
body .song-chart-play-icon::before{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:12px;height:12px;display:block;background:currentColor;mask:url('/assets/ui/play.svg') center/contain no-repeat}
body .song-chart-play-button{display:flex;align-items:center;justify-content:flex-start;min-height:36px;gap:8px;margin:0;padding:4px 0;line-height:1.4;text-align:left}
body .song-chart-play-button>span:last-child{line-height:1.4}
/* The controls follow the page theme; the swatches still describe game brightness. */
body .chart-player-brightness-options{background:var(--muted-bg);border-color:var(--border)}
body .chart-player-dialog .chart-player-brightness-options button{padding:0;border:1px solid transparent;background:transparent;color:var(--foreground)}
body .chart-player-dialog .chart-player-brightness-options button:hover{background:var(--card);border-color:var(--input)}
body .chart-player-dialog .chart-player-brightness-options button[aria-pressed="true"]{background:var(--card);border-color:var(--ring);box-shadow:0 1px 2px #0002}
body .chart-player-brightness-options i{border-color:light-dark(#6b7e89,#a1a1aa)}

/* Give the map the main column and preserve one uniform geographic scale. */
body.app-mode .region-dashboard{grid-template-columns:minmax(0,1fr) minmax(220px,.38fr);gap:20px}
body.app-mode .region-map-panel,body.app-mode .region-list-panel{min-width:0;min-height:0}
body .china-map-wrap{min-height:0;border-radius:12px;overflow:hidden}
body .china-map{width:100%;height:auto;max-height:none;aspect-ratio:920/820;overflow:hidden}
body .china-region-real text{font-size:14px;font-weight:600;stroke-width:3px}
body #chinaMap .china-region:focus{outline:none}
body #chinaMap .china-region:focus-visible path{stroke:var(--ring);stroke-width:2}
body .china-region-highlight{pointer-events:none;--map-active-stroke:light-dark(#a94612,#ffd2a4)}
body .china-region-highlight path{fill:none;stroke:var(--map-active-stroke);stroke-width:2;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke;filter:drop-shadow(0 0 3px color-mix(in srgb,var(--map-active-stroke) 45%,transparent))}
body .china-label-leader{stroke:var(--muted-foreground);stroke-width:1;vector-effect:non-scaling-stroke;pointer-events:none;opacity:.8}
body .china-maritime-boundary{pointer-events:none}
body #regionTooltip{background:var(--popover);color:var(--popover-foreground);border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow);font-size:12px;line-height:1.7;font-weight:500;max-width:min(220px,calc(100% - 16px))}
body .region-rank-item{border-radius:8px;font-size:12px;padding:12px;grid-template-columns:32px 1fr auto}
@media(max-width:1180px){body.app-mode .region-dashboard{grid-template-columns:1fr}body .china-map{max-width:920px;margin:auto}body .region-list{max-height:360px}}
@media(max-width:767px){
 body.app-mode .region-map-panel{padding:14px}
 body .region-map-panel .section-title{align-items:flex-start;gap:8px}
 body .region-map-panel .section-title span{font-size:10px}
 body .china-region-real text{font-size:19px;stroke-width:4px}
 body .region-map-disclaimer{font-size:10px}
}
@media(max-width:767px){body #authView .section-title h2{font-size:25px}}
@media(max-width:390px){.header-utilities{gap:2px}.account-trigger-name{max-width:70px}.header-context button{width:32px}.header-utilities .user-trigger{width:28px;height:28px}body.app-mode #workspaceContent.workspace{padding-inline:14px}}

/* Song details share one spacing rhythm in the drawer, dialog and reward view. */
body .song-detail-content{display:flex;flex-direction:column;gap:24px;min-width:0;color:var(--foreground)}
body .song-detail-content>*{flex:0 0 auto;min-width:0}
body .song-detail-intro{display:flex;flex-direction:column;gap:16px}
body .song-detail-content .song-detail-header{grid-template-columns:80px minmax(0,1fr);align-items:start;gap:16px;margin:0}
body .song-detail-content .song-detail-header>img{width:80px!important;border:1px solid var(--border);border-radius:10px}
body .song-detail-copy{min-width:0}
body .song-detail-content .song-detail-title-row{display:block}
body .song-detail-content .song-detail-header h3{margin:0;font-size:22px;line-height:1.4;letter-spacing:-.025em}
body .song-detail-copy>p{margin:8px 0 0;font-size:12px;line-height:1.8;overflow-wrap:anywhere;color:var(--muted-foreground)}
body .song-detail-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
body .song-detail-actions .alias-list{flex:1 1 160px;gap:6px;margin:0}
body .song-detail-actions .alias-list span{padding:4px 8px;font-size:11px;font-weight:500;background:var(--muted-bg);color:var(--muted-foreground)}
body .song-detail-actions .song-download{margin-left:auto}
body .song-download>summary{gap:8px;min-height:40px;padding:8px 12px;border-color:var(--input);border-radius:7px;background:var(--card);color:var(--foreground);font-size:12px;font-weight:500;line-height:1.5;white-space:nowrap;transition:background .15s,border-color .15s}
body .song-download>summary svg{width:16px;height:16px;flex:0 0 16px}
body .song-download>summary::after{content:"";width:14px;height:14px;flex:0 0 14px;background:currentColor;mask:url('/assets/ui/chevron-down.svg') center/contain no-repeat;opacity:.65}
body .song-download[open]>summary::after{transform:rotate(180deg)}
body .song-download>summary:hover,body .song-download[open]>summary{background:var(--accent-bg);border-color:var(--input)}
body .song-download-menu{display:flex;flex-direction:column;gap:4px;padding:6px;background:var(--popover);color:var(--popover-foreground);border-color:var(--border);border-radius:9px;box-shadow:var(--shadow)}
body .song-download:not([open])>.song-download-menu{display:none}
body .song-download-menu>button{min-height:44px;padding:10px 12px;font-size:12px;font-weight:400;color:var(--popover-foreground)}
body .song-download-menu>button:hover{background:var(--accent-bg)}
body .song-detail-section,body .song-detail-content .song-unlock-info{display:flex;flex-direction:column;gap:12px;padding:24px 0 0;border-top:1px solid var(--border);border-bottom:0;margin:0}
body .song-detail-content :is(.best-panel-title,.song-score-list,.song-chart-matrix-wrap,.song-charter-cards){margin:0}
body .song-detail-section>.best-panel-title{align-items:center;gap:12px}
body .song-detail-content :is(.best-panel-title h3,.song-unlock-info h3){margin:0;font-size:15px;font-weight:600;line-height:1.5}
body .song-detail-content .song-chart-title{align-items:flex-start;flex-direction:column;gap:6px}
body .song-detail-content .song-chart-play-hint{max-width:none;margin:0;font-size:12px;font-weight:400;line-height:1.7;text-align:left}
body .song-score-source-control{display:flex;align-items:center;gap:8px;min-width:0;margin:0;font-size:11px;color:var(--muted-foreground)}
body .song-score-source-control>select.ui-input{width:auto;min-width:112px;min-height:40px;margin:0;padding:8px 32px 8px 12px;font-size:12px;font-weight:500;border-radius:7px}
body .song-detail-content .song-score-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:6px 12px;padding:12px 14px;border-radius:8px}
body .song-detail-content .song-score-row>strong{min-width:0;margin:0;font-size:13px}
body .song-detail-content .song-score-play-count{justify-self:end;font-weight:700;font-variant-numeric:tabular-nums}
body .song-detail-content .song-score-meta{grid-column:1/-1;gap:6px 10px;line-height:1.7}
body .song-detail-content .song-unlock-info>p{margin:0;font-size:12px;line-height:1.7}
body .song-detail-content .song-unlock-info>button{align-self:flex-start;margin:0;min-height:44px}
body .song-detail-content .song-unlock-states{margin:0;gap:8px}
body .song-detail-content .song-unlock-states dt{font-size:11px;color:var(--muted-foreground)}
body .song-detail-content .song-unlock-states dd{font-size:12px;color:var(--foreground)}
body .song-detail-content .song-chart-notes-table{min-width:600px}
body .song-detail-content .song-chart-notes-table th:first-child{min-width:162px}
body .song-detail-content .song-chart-play-button{min-height:44px;gap:8px;padding:6px 8px;border:1px solid transparent;border-radius:7px;color:inherit;font-size:12px;font-weight:600;transition:background .15s,border-color .15s}
body .song-detail-content .song-chart-play-button:hover{background:color-mix(in srgb,currentColor 8%,transparent);border-color:color-mix(in srgb,currentColor 24%,transparent)}
body .song-detail-content .song-chart-play-button:focus-visible{outline:2px solid currentColor;outline-offset:-2px}
body .song-detail-content .song-charter-card{padding:12px;gap:6px}
body .song-detail-content .song-utage-info{margin:0;gap:8px 16px;font-size:12px}
body .song-related-collectibles-title>p{margin:0 0 0 auto;font-size:11px;font-weight:400}
body .song-related-collectibles{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px}
body .song-related-collectible{display:grid;grid-template-columns:104px minmax(0,1fr);align-items:center;gap:12px;min-height:88px;padding:10px;border:1px solid var(--border);border-radius:8px;background:var(--card);color:var(--foreground)}
body .song-related-collectible-preview{position:relative;display:grid;place-items:center;width:104px;height:66px;overflow:hidden;border:1px solid var(--border);border-radius:6px;background:var(--muted-bg)}
body .song-related-collectible-preview>:is(img,.song-related-collectible-fallback){grid-area:1/1}
body .song-related-collectible-preview>img{display:block;max-width:100%;max-height:100%;object-fit:contain}
body .song-related-collectible-fallback{padding:6px;color:var(--muted-foreground);font-size:10px;font-weight:600;text-align:center}
body .song-related-title-art{position:relative;display:block;width:calc(100% - 12px);max-width:96px;aspect-ratio:276/36;overflow:hidden;border-radius:999px;background:#d9dddc}
body .song-related-title-art.rare-bronze{background:#bb7c52}
body .song-related-title-art.rare-silver{background:#b9c2c8}
body .song-related-title-art.rare-gold{background:#d8aa38}
body .song-related-title-art.rare-rainbow{background:#9d76c4}
body .song-related-title-art>img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:fill}
body .song-related-title-art>.song-related-title-text{object-fit:contain;pointer-events:none}
body .song-related-collectible-copy{display:flex;flex-direction:column;align-items:flex-start;min-width:0;gap:4px}
body .song-related-collectible-copy>span{color:var(--muted-foreground);font-size:10px;line-height:1.4}
body .song-related-collectible-copy>strong{max-width:100%;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
body .song-related-collectible-copy>small{display:-webkit-box;max-width:100%;overflow:hidden;color:var(--muted-foreground);font-size:11px;line-height:1.55;-webkit-box-orient:vertical;-webkit-line-clamp:2}
body .song-detail-toolbar{position:sticky;top:-24px;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:16px;margin:-24px -24px 0;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--card);color:var(--muted-foreground);font-size:12px}
body .song-detail-toolbar .song-detail-close{position:static;float:none;display:grid;place-items:center;width:40px;height:40px;margin:0;padding:0;border:1px solid var(--border);border-radius:7px;background:var(--card);color:var(--foreground);font-size:0;font-weight:400}
body .song-detail-toolbar .song-detail-close::before{content:"";width:16px;height:16px;background:currentColor;mask:url('/assets/ui/x.svg') center/contain no-repeat}
body .song-detail-toolbar .song-detail-close:hover{background:var(--accent-bg)}
body .song-detail-dialog{background:var(--card);color:var(--foreground)}
body .song-detail-modal-heading{min-height:64px;margin-bottom:20px;background:var(--card);border-color:var(--border);font-size:12px}
@media(min-width:761px){
 body.app-mode .song-detail-panel{top:calc(var(--app-header-height) + 16px);right:16px;width:min(680px,calc(100vw - var(--app-sidebar-width) - 32px));height:calc(100dvh - var(--app-header-height) - 32px);max-height:calc(100dvh - var(--app-header-height) - 32px);padding:24px;border:1px solid var(--border);border-radius:12px;background:var(--card)!important;box-shadow:var(--shadow)!important;scroll-padding-top:80px}
}
@media(max-width:760px){
 body .song-detail-content{gap:20px}
 body .song-detail-content .song-detail-header{grid-template-columns:64px minmax(0,1fr)!important;gap:12px}
 body .song-detail-content .song-detail-header>img{width:64px!important}
 body .song-detail-content .song-detail-header h3{font-size:18px!important}
 body .song-detail-section,body .song-detail-content .song-unlock-info{padding-top:20px}
 body .song-score-source-control>span{display:none}
 body .song-score-source-control>select.ui-input{min-height:44px;font-size:16px}
 body .song-download>summary{min-height:44px}
 body .song-related-collectibles{grid-template-columns:1fr}
 body .song-related-collectible{grid-template-columns:88px minmax(0,1fr)}
 body .song-related-collectible-preview{width:88px;height:62px}
}

/* Game options use the current neutral data-list treatment; only real colors keep a swatch. */
body.app-mode .option-kind-card{display:flex;align-items:center;min-height:44px;margin:0 0 18px;padding:10px 14px;border:1px solid var(--border);border-radius:8px;background:var(--muted-bg);color:var(--foreground);box-shadow:none;font-size:12px;font-weight:600;line-height:1.6}
body.app-mode .maimai-option-grid{column-gap:18px}
body.app-mode .maimai-option-card{margin-bottom:18px}
body.app-mode .maimai-option-card h3{margin:0;padding:0 0 12px;border-bottom:1px solid var(--border);color:var(--foreground);font-size:14px;font-weight:600;line-height:1.5}
body.app-mode .maimai-option-list{gap:0}
body.app-mode .maimai-option-row{grid-template-columns:minmax(150px,.82fr) minmax(0,1.18fr);gap:14px;min-height:44px;padding:10px 0;border-bottom:1px solid var(--border);border-radius:0;background:transparent;color:var(--foreground)}
body.app-mode .maimai-option-row:last-child{border-bottom:0}
body.app-mode .maimai-option-row>span{color:var(--muted-foreground);font-size:12px;font-weight:400;line-height:1.6}
body.app-mode .maimai-option-value{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--foreground);font-size:12px;font-weight:600;line-height:1.6;text-align:right}
body.app-mode .maimai-option-swatch{flex:0 0 14px;width:14px;height:14px;border:1px solid color-mix(in srgb,var(--option-swatch) 70%,var(--border));border-radius:3px;background:var(--option-swatch);box-shadow:inset 0 0 0 1px #ffffff45}

/* Every global loading dialog exposes an operation-specific estimate. */
body .page-loading-dialog{display:grid;grid-template-columns:44px minmax(0,1fr);column-gap:16px;align-items:start;width:min(400px,100%);padding:24px;border-radius:10px;text-align:left}
body .page-loading-spinner{grid-row:1/4;width:40px;height:40px;margin-top:2px;border-width:3px}
body .page-loading-dialog h2{grid-column:2;margin:0;color:var(--foreground);font-size:18px;font-weight:600;line-height:1.5}
body .page-loading-dialog #pageLoadingText{grid-column:2;margin:4px 0 0;color:var(--muted-foreground);font-size:13px;line-height:1.7}
body .page-loading-dialog .page-loading-estimate{grid-column:2;margin:8px 0 0;color:var(--foreground);font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;line-height:1.5}
body .page-loading-dialog #hidePageLoadingBtn{grid-column:1/-1;width:100%;min-height:44px;margin-top:20px}

@media(max-width:620px){
 body.app-mode .maimai-option-row{grid-template-columns:1fr;gap:4px}
 body.app-mode .maimai-option-value{justify-content:flex-start;text-align:left}
 body .page-loading-dialog{grid-template-columns:36px minmax(0,1fr);column-gap:12px;padding:20px}
 body .page-loading-spinner{width:34px;height:34px}
}

/* Operation feedback uses the same card and badge tokens as the current shell. */
body.app-mode :is(.result-card,.operation-status-card){background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:9px;padding:16px;gap:10px;box-shadow:none;font-size:13px;line-height:1.6}
body.app-mode .operation-status-card:is(.success,.error,.pending){background:var(--card);border-color:var(--border)}
body.app-mode .operation-status-list{gap:12px}
body.app-mode .operation-status-list:not(:empty){margin-bottom:20px}
body.app-mode .operation-status-head{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px 16px}
body.app-mode .operation-status-title{display:flex;align-items:center;gap:8px;min-width:0}
body.app-mode .operation-status-card .operation-status-title strong{color:var(--foreground);font-size:13px;font-weight:600;line-height:1.5}
body.app-mode .operation-status-indicator{display:grid;place-items:center;flex:0 0 20px;width:20px;height:20px;border:1px solid var(--border);border-radius:50%;background:var(--muted-bg);color:var(--muted-foreground);font-size:12px;font-weight:600}
body.app-mode .operation-status-card.success .operation-status-indicator{color:var(--green);border-color:color-mix(in srgb,var(--green) 30%,var(--border));background:color-mix(in srgb,var(--green) 8%,var(--card))}
body.app-mode .operation-status-card.error .operation-status-indicator{color:var(--destructive);border-color:color-mix(in srgb,var(--destructive) 30%,var(--border));background:color-mix(in srgb,var(--destructive) 8%,var(--card))}
body.app-mode .operation-status-head small{color:var(--muted-foreground);font-size:11px;font-weight:400;font-variant-numeric:tabular-nums}
body.app-mode :is(.result-card,.operation-status-card) p{margin:0;color:var(--muted-foreground);font-size:13px;font-weight:400;line-height:1.7}
body.app-mode .operation-status-details{gap:6px}
body.app-mode .operation-status-details span{border:1px solid var(--border);border-radius:5px;background:var(--muted-bg);color:var(--muted-foreground);padding:2px 7px;font-size:11px;font-weight:500;line-height:1.6;overflow-wrap:anywhere}

.keychip-manager-controls{display:grid;grid-template-columns:minmax(180px,2fr) repeat(2,minmax(120px,1fr));gap:16px;align-items:end}
.keychip-manager-controls .action-row{grid-column:1/-1;flex-wrap:wrap}
.keychip-province{margin:12px 0;border:1px solid var(--border);border-radius:9px;background:var(--card);color:var(--foreground)}
.keychip-province>summary{cursor:pointer;padding:16px;font-size:13px;font-weight:600;min-height:44px}
.keychip-province>div{padding:0 16px 16px}
.admin-cabinet-picker{display:flex;gap:12px;align-items:end;margin:16px 0}
.admin-cabinet-picker .field{flex:1;min-width:0}
@media(max-width:600px){.keychip-manager-controls{grid-template-columns:1fr}.admin-cabinet-picker{flex-direction:column;align-items:stretch}.keychip-row{align-items:flex-start;flex-direction:column}.keychip-actions{align-self:flex-end}}
