/* Shared theme tokens and a restrained, data-first overview. */
:root{--dash-bg:#f6f7f9;--dash-card:#fff;--dash-muted:#f0f2f5;--dash-line:#d4d9e1;--dash-fg:#182230;--dash-secondary:#526174;--dash-strong:#182230;--dash-on-strong:#fff;--dash-chart:#3b556f;--accent:#096b5b;--accent-hover:#075748;--on-accent:#fff;--accent-soft:#e5f3ee;--success:#116545;--success-bg:#e7f4ed;--warning:#795009;--warning-bg:#fff4d9;--danger:#ad293d;--danger-bg:#fcebef;--info:#225ba5;--info-bg:#eaf1fc;--focus:#1876d2;--sidebar:#152235;--sidebar-fg:#c2cedf;--bg:var(--dash-bg);--surface:var(--dash-card);--surface2:var(--dash-muted);--line:var(--dash-line);--text:var(--dash-fg);--text-bright:var(--dash-fg);--muted:var(--dash-secondary);--text-muted:var(--dash-secondary);--green:var(--success);color-scheme:light}
:root[data-theme=dark]{--dash-bg:#0c1119;--dash-card:#141c28;--dash-muted:#1d2838;--dash-line:#39485d;--dash-fg:#edf2fa;--dash-secondary:#afbed1;--dash-strong:#edf2fa;--dash-on-strong:#142033;--dash-chart:#afc3df;--accent:#73ddc3;--accent-hover:#a0eedb;--on-accent:#102b26;--accent-soft:#163e36;--success:#8ce0b8;--success-bg:#17392e;--warning:#f4cd7c;--warning-bg:#382e19;--danger:#ffa8b8;--danger-bg:#3d2230;--info:#a9ceff;--info-bg:#1b3250;--focus:#85bdff;--sidebar:#111925;--sidebar-fg:#c2cedf;color-scheme:dark}
body{background:var(--dash-bg)}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;flex-shrink:0;border:1px solid var(--dash-line);border-radius:8px;background:var(--dash-card);color:var(--dash-fg);cursor:pointer}
.theme-toggle:hover{background:var(--dash-muted)}
.account-menu{position:relative;flex-shrink:0;line-height:1.4}
.account-menu summary{display:flex;align-items:center;justify-content:center;gap:6px;min-height:38px;padding:3px 5px;list-style:none;cursor:pointer;border:1px solid transparent;border-radius:9px;color:var(--dash-secondary)}
.account-menu summary::-webkit-details-marker{display:none}
.account-menu summary:hover,.account-menu[open] summary{background:var(--dash-muted);border-color:var(--dash-line)}
.account-menu summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.account-avatar{display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--dash-line);border-radius:50%;background:var(--dash-muted);color:var(--dash-fg);font-size:12px;font-weight:550}
.account-menu svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.account-popover{position:absolute;right:0;top:calc(100% + 10px);width:240px;max-width:calc(100vw - 32px);padding:6px;border:1px solid var(--dash-line);background:var(--dash-card);color:var(--dash-fg);border-radius:11px;box-shadow:0 8px 30px #00000018;z-index:70;text-align:left}
.account-menu-heading{padding:10px 9px 12px}
.account-menu-heading strong,.account-menu-heading small{display:block}
.account-menu-heading strong{font-size:12px;font-weight:600;color:var(--dash-fg)}
.account-menu-heading small{font-size:11px;color:var(--dash-secondary);margin-top:3px}
.account-popover>button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:40px;padding:10px;border:0;border-radius:6px;background:transparent;color:var(--dash-fg);font-size:12px;text-align:left}
.account-popover>button:hover,.account-popover>button:focus-visible{background:var(--dash-muted)}
.account-popover>button>span:last-child{color:var(--dash-secondary)}
.account-menu-divider{height:1px;background:var(--dash-line);margin:5px -6px}
.account-popover>.account-signout{color:#bd4552}
.account-dialog{width:min(500px,calc(100vw - 32px));padding:26px;background:var(--dash-card);color:var(--dash-fg);border-color:var(--dash-line)}
.account-dialog-heading{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:20px}
.account-dialog-heading h2{font-size:23px;color:var(--dash-fg);margin-top:7px}
.account-tabs{display:flex;gap:4px;padding:4px;margin-bottom:20px;background:var(--dash-muted);border:1px solid var(--dash-line);border-radius:8px}
.account-tabs button{flex:1;min-height:36px;padding:7px 10px;color:var(--dash-secondary);background:transparent;border:1px solid transparent;border-radius:5px;font-size:12px}
.account-tabs button[aria-pressed=true]{background:var(--dash-card);color:var(--dash-fg);border-color:var(--dash-line);box-shadow:0 1px 2px #00000005}
.account-info{margin:0}
.account-info>div{display:flex;align-items:baseline;justify-content:space-between;gap:20px;padding:15px 0;border-bottom:1px solid var(--dash-line);font-size:12px}
.account-info dt{color:var(--dash-secondary)}
.account-info dd{margin:0;color:var(--dash-fg);text-align:right;font-weight:500;overflow-wrap:anywhere}
.account-setting-row{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px 0;border-bottom:1px solid var(--dash-line)}
.account-setting-row h3{color:var(--dash-fg);font-size:13px}
.account-setting-row p{color:var(--dash-secondary);font-size:12px;margin-top:6px;line-height:1.7}
.account-dialog footer{font-size:11px;color:var(--dash-secondary);margin-top:20px}
.account-dialog footer a{color:var(--accent);text-decoration:none}
.account-dialog .error{margin-top:12px}
.account-loading{display:flex;align-items:center;gap:9px;margin:0 0 14px;color:var(--dash-secondary);font-size:12px}
.account-loading::before{content:"";width:12px;height:12px;flex-shrink:0;border:2px solid var(--dash-line);border-top-color:var(--accent);border-radius:50%;animation:account-loading-spin .8s linear infinite}
@keyframes account-loading-spin{to{transform:rotate(360deg)}}
@media(max-width:700px){.account-popover>button{min-height:44px}.account-dialog{padding:22px}.account-info>div{gap:14px}.account-menu summary{min-height:40px}.account-setting-row{gap:16px}}
.edit-key-controls{display:grid;gap:16px;padding:20px 0;margin-top:22px;border-top:1px solid var(--dash-line)}
.edit-key-controls h3{font-size:13px;font-weight:600}
.edit-key-controls p{color:var(--dash-secondary);font-size:12px;margin-top:5px}
.edit-key-control-buttons{display:flex;flex-wrap:wrap;gap:10px}
.actions-cell-wrap:has(>.row-action:only-child){padding:0;border:0;background:transparent;box-shadow:none}
.actions-cell-wrap .row-action.edit-btn:only-child{margin:0;min-width:76px;height:36px}
.theme-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-sun{display:none}
[data-theme=dark] .theme-toggle .theme-moon{display:none}
[data-theme=dark] .theme-toggle .theme-sun{display:block}
.theme-floating{position:fixed;right:24px;bottom:24px;z-index:45;box-shadow:0 3px 12px #00000010}
body:has(#workspace:not([hidden])) .theme-floating{display:none}
body:has(#reseller-console:not([hidden])) .theme-floating{display:none}
.topbar{background:var(--dash-card);border-color:var(--dash-line)}
#overview-view{color:var(--dash-fg)}
#workspace[data-current-view=overview] .page-heading>.eyebrow{color:var(--dash-secondary)}
#workspace[data-current-view=overview] .page-heading h1{font-size:30px;font-weight:700;letter-spacing:-1.3px;color:var(--dash-fg)}
#workspace[data-current-view=overview] .page-heading p{color:var(--dash-secondary)}
#overview-view .overview-welcome{padding:0 0 26px;margin:0;border:0;border-radius:0;background:transparent;gap:24px;align-items:center}
#overview-view .welcome-copy .eyebrow{color:var(--dash-secondary);font-size:10px;letter-spacing:1.1px}
#overview-view .welcome-copy h2{color:var(--dash-fg);font-size:23px;font-weight:600;letter-spacing:-.7px;margin-top:8px}
#overview-view .welcome-copy p{color:var(--dash-secondary);font-size:13px;line-height:1.7;max-width:540px}
#overview-view .welcome-actions{margin-top:18px;gap:20px}
#overview-view .primary{background:var(--dash-strong);color:var(--dash-on-strong);box-shadow:0 1px 2px #0000000d;border:1px solid var(--dash-strong);border-radius:7px;font-weight:550}
#overview-view .primary:hover{opacity:.85}
#overview-view .welcome-find{color:var(--dash-secondary)}
.dashboard-live{display:flex;align-items:center;gap:9px;white-space:nowrap;font-size:11px;border:1px solid var(--dash-line);padding:9px 12px;border-radius:7px;color:var(--dash-secondary);background:var(--dash-card)}
.dashboard-live .status-dot{background:#10b981;margin:0;box-shadow:0 0 0 3px #10b98112}
#overview-view .overview-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:0 0 24px}
#overview-view .overview-stat{display:flex;flex-direction:row-reverse;justify-content:space-between;gap:12px;min-height:145px;padding:22px;border:1px solid var(--dash-line);background:var(--dash-card);border-radius:10px;box-shadow:0 1px 2px #00000003}
#overview-view .stat-symbol{border:0;background:transparent;color:var(--dash-secondary);width:18px;height:18px;margin-top:2px}
#overview-view .overview-stat>div>span{color:var(--dash-fg);font-size:12px;font-weight:550;margin:0 0 17px}
#overview-view .overview-stat:last-child{grid-column:auto;flex-direction:row-reverse}
#overview-view .overview-stat:last-child>div{display:grid;grid-template-columns:1fr;width:auto;align-items:start}
#overview-view .overview-stat:last-child strong{grid-column:auto;grid-row:auto;text-align:left}
#overview-view .overview-stat:last-child small{grid-column:auto}
#overview-view .overview-stat strong{font-size:30px;font-weight:650;letter-spacing:-1px;color:var(--dash-fg);font-variant-numeric:tabular-nums;line-height:1}
#overview-view .overview-stat strong.stat-word{font-size:21px;line-height:30px;letter-spacing:-.6px}
#overview-view .overview-stat small{margin-top:10px;color:var(--dash-secondary);font-size:11px;line-height:1.5}
.dashboard-distribution{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(220px,1fr);gap:28px;background:var(--dash-card);border:1px solid var(--dash-line);border-radius:10px;padding:26px;margin-bottom:24px}
.dashboard-section-kicker{font-size:10px;color:var(--dash-secondary);letter-spacing:1.1px;text-transform:uppercase;display:block;margin-bottom:10px}
.dashboard-distribution h2{font-size:17px;letter-spacing:-.4px;color:var(--dash-fg)}
.dashboard-distribution p{font-size:12px;color:var(--dash-secondary);margin:8px 0 20px;max-width:440px}
.distribution-total{font-size:36px;line-height:1.2;font-weight:600;letter-spacing:-1.5px;font-variant-numeric:tabular-nums}
.distribution-total small{font-size:12px;color:var(--dash-secondary);letter-spacing:0;font-weight:400;margin-left:8px}
.distribution-bars{display:grid;gap:18px;align-content:center;min-width:0}
.distribution-label{display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--dash-secondary);margin-bottom:8px}
.distribution-label strong{color:var(--dash-fg);font-weight:550;white-space:nowrap;font-variant-numeric:tabular-nums}
.distribution-track{height:7px;background:var(--dash-muted);border-radius:3px;overflow:hidden}
.distribution-fill{height:100%;background:var(--dash-chart);border-radius:3px}
#overview-view .overview-search{background:var(--dash-card);border-color:var(--dash-line);border-radius:10px;margin-bottom:28px}
#overview-view .overview-search label,#overview-view .overview-search-heading svg{color:var(--dash-secondary)}
#overview-view .overview-search input{background:var(--dash-muted);color:var(--dash-fg);border-radius:6px}
#overview-view .section-heading h2{font-size:17px;letter-spacing:-.4px;color:var(--dash-fg)}
#overview-view .section-heading p{color:var(--dash-secondary)}
#overview-view .overview-projects{gap:16px}
#overview-view .overview-app-card{padding:22px;background:var(--dash-card);border-color:var(--dash-line);border-radius:10px;box-shadow:0 1px 2px #00000003}
#overview-view .overview-app-card h3{color:var(--dash-fg);font-size:13px;font-weight:600}
#overview-view .application-icon{background:var(--dash-muted);border-color:var(--dash-line);border-radius:8px;width:34px;height:34px}
#overview-view .application-icon img{width:19px;height:19px}
#overview-view .app-card-platform,#overview-view .app-card-metrics span{color:var(--dash-secondary);font-size:11px}
#overview-view .app-card-metrics strong{color:var(--dash-fg);font-size:27px;font-weight:600}
#overview-view .app-card-actions{border-color:var(--dash-line)}
#overview-view .app-card-actions button{color:var(--dash-secondary)}
#overview-view .app-card-actions button:first-child{color:var(--dash-fg)}
#overview-view .recent-panel,#overview-view .quick-guide{background:var(--dash-card);border-color:var(--dash-line);border-radius:10px;box-shadow:none}
#overview-view .panel-heading h2,#overview-view .quick-guide h3{color:var(--dash-fg);font-size:15px}
#overview-view .quick-guide p,#overview-view .quick-guide li,#overview-view .panel-heading p{color:var(--dash-secondary)}
#overview-view .text-button{color:var(--dash-secondary)}
#overview-view .recent-customer{color:var(--dash-fg)}
#overview-view .table-scroll,#overview-view th,#overview-view td{background:var(--dash-card);border-color:var(--dash-line)}
#overview-view th{color:var(--dash-secondary);font-size:9px}
#overview-view td{color:var(--dash-secondary)}
/* One semantic palette for every view, including legacy dialogs and filters. */
:root :is(.panel,.stats article,.session-card,dialog,.table-scroll,.table-toolbar,.unified-filter-toolbar,.topbar,.project-toolbar,.generation-section,.generation-ticket,.generation-ticket dl,.generation-submit,.generation-summary,.project-card,.pricing-notes-card,.filter-popover-panel){background:var(--dash-card);border-color:var(--dash-line);color:var(--dash-fg)}
#generate-view :is(.generation-form,.generation-summary,.generation-ticket){background:var(--dash-card);border-color:var(--dash-line)}
:root :is(input,select,textarea,.search-box,.search-composite,.generation-input-unit,.duration-num-input,.stepper-input-wrap,.calendar-input,.price-input-group){background:var(--dash-card);color:var(--dash-fg);border-color:var(--dash-line)}
:root :is(input,textarea)::placeholder{color:var(--dash-secondary);opacity:1}
:root :is(input,select,textarea):focus-visible{border-color:var(--focus);outline:2px solid var(--focus);outline-offset:2px;box-shadow:none}
:root :is(button,a,summary):focus-visible{outline:2px solid var(--focus);outline-offset:3px}
:root :is(label,.generation-step h3,.generation-project-card strong,.generation-ticket-brand h2,.generation-summary h2,.project-card-titles h3,.stats strong,.session-card h2,.plan-title-text,.feature-label-text,.popover-title-row span,.expiry-meta-grid strong,.devices-dialog-meta strong,.device-meta-row span,.edit-device-count-line strong,.vault-project-badge,.summary-value){color:var(--dash-fg)}
:root :is(.muted,.stat-label,.stats article>span,.caret,.eyebrow,.page-heading p,.section-heading p,.panel-heading p,.generation-step p,.generation-custom-duration,.generation-summary-help,.generation-note,.generation-project-card small,.generation-ticket-brand small,.generation-ticket dt,.generation-preview-heading .eyebrow,.generation-sample-key>span,.generation-sample-key small,.generation-submit p,.generation-submit small,.project-card p,.project-card-titles p,.project-meta,.project-badge-unit .badge-stack label,.session-label,.session-card p,.note,.table-empty,.table-footer,.breadcrumb,.recent-project-name,.project-tag-mini,.filter-field label,.filter-tag-chip .tag-label,.filter-tag-chip button,.devices-empty,.devices-sub,.unactivated-note,.section-title,.calendar-hint,.stepper-custom-label,.summary-label,.summary-remaining,.field-sublabel,.expiry-meta-grid small,.devices-dialog-meta small,.edit-device-title,.device-meta-row,.devices-empty-state small,.feature-category-title,.feature-desc-text,.vault-proj-label,.vault-key-label,.price-prefix,.price-unit-label,.event,.event small,.event time,.main-footer){color:var(--dash-secondary)}
.form-grid label>small,.generation-note>span{color:var(--dash-secondary)}
:root :is(.primary,.copy-key-primary-btn){background:var(--accent);color:var(--on-accent);border-color:var(--accent);box-shadow:none}
:root :is(.primary,.copy-key-primary-btn):hover{background:var(--accent-hover);color:var(--on-accent);box-shadow:none}
:root :is(.secondary,.row-action,.expiry-edit-btn,.recent-open,.filter-toggle-btn,.step-btn,.preset-btn,.stepper-chip,.copy-uuid-btn){background:var(--dash-card);color:var(--dash-fg);border-color:var(--dash-line)}
:root :is(.secondary,.row-action,.expiry-edit-btn,.recent-open,.filter-toggle-btn,.step-btn,.preset-btn,.stepper-chip,.copy-uuid-btn):hover{background:var(--dash-muted);color:var(--dash-fg);border-color:var(--focus)}
:root :is(.text-button,.welcome-find){color:var(--accent)}
:root :is(.row-action.danger,.row-action.delete-btn,.danger-icon-btn,.danger-subtle,.device-unbind-btn){background:var(--danger-bg);color:var(--danger);border-color:var(--dash-line)}
:root :is(.row-action.danger,.row-action.delete-btn,.danger-icon-btn,.danger-subtle,.device-unbind-btn):hover{background:var(--danger-bg);color:var(--danger);border-color:var(--danger)}
.actions-cell-wrap .row-action.edit-btn{background:var(--dash-strong);color:var(--dash-on-strong)}
.actions-cell-wrap .row-action.edit-btn:hover{background:var(--dash-strong);color:var(--dash-on-strong);opacity:.9}
.account-popover>.account-signout,.error,#reseller-error{color:var(--danger)}
:root :is(.count-badge,.environment,.owner-mini,.application-icon,.creator-pill,.creator-pill.owner,.creator-pill.bot,.project-pill,.plan-badge,.plan-badge.custom,.filter-tag-chip,.filter-tag,.active-filter-tags .tag,.device-session-pill.offline,.device-status-badge.empty,.view-uuid-tag,.feature-category-group,.plan-status-pill.off){background:var(--dash-muted);border-color:var(--dash-line);color:var(--dash-secondary)}
:root :is(.status-pill,.admin-status-pill.active,.device-status-badge,.device-session-pill.online,.plan-status-pill.both,.key-type-badge.full,.generation-preview-live){background:var(--success-bg);color:var(--success);border-color:var(--dash-line)}
:root :is(.status-pill.pending,.device-status-badge.full,.plan-status-pill.admin,.key-type-badge.legacy){background:var(--warning-bg);color:var(--warning);border-color:var(--dash-line)}
:root :is(.status-pill.disabled,.status-pill.expired,.admin-status-pill.banned){background:var(--danger-bg);color:var(--danger);border-color:var(--dash-line)}
:root :is(.plan-status-pill.buyer,.key-type-badge.fetching){background:var(--info-bg);color:var(--info);border-color:var(--dash-line)}
:root :is(.info-box,.bot-health,.generation-ticket-footer,.generation-step>span,.bulk-action-bar,.bulk-pill,.filter-toggle-btn.active,.generation-trust,.new-expiry-summary){background:var(--accent-soft);border-color:var(--dash-line);color:var(--accent);box-shadow:none}
:root :is(.bulk-pill strong,.bot-health h3,.generation-ticket-footer,.generation-sample-key code,.vault-hint-note){color:var(--accent)}
.bot-health :is(p,.eyebrow){color:var(--dash-secondary)}
.notice{background:var(--warning-bg);color:var(--warning);border-color:var(--dash-line)}
:root :is(.error,.notice):empty{display:none}
:root :is(.vault-key-display,.expiry-section,.generation-sample-key,.project-card-visual,.integration-panel pre,.devices-dialog-header,.expiry-card-preview,.device-card,.device-uuid-box,.devices-empty-state,.edit-device-overview-card,.edit-expiry-subpanel,.edit-key-vault-card,.vault-key-box,.key-preview,.key-preview-full,.feature-item-row){background:var(--dash-muted);border-color:var(--dash-line);color:var(--dash-fg);box-shadow:none}
:root :is(.key-preview-full:hover,.feature-item-row:hover,.project-card:hover){background:var(--dash-muted);border-color:var(--focus);color:var(--dash-fg)}
.edit-key-vault-card::before{background:var(--accent)}
:root :is(.uuid-code,.key,.clickable-key,.breadcrumb strong,.devices-empty-state p,.expiry-date-text){color:var(--dash-fg)}
:root :is(.expiry-unactivated-badge strong,.exp-countdown.active){color:var(--success)}
.exp-countdown.expired{color:var(--danger)}
:root :is(.generation-ticket-brand,.generation-sample-key,.generation-section,.panel-heading,.card-actions,.popover-title-row,.popover-actions,.vault-top-row,.expiry-key-header,.device-meta-row,.dialog-actions-spread,.activated-only-controls,.features-bulk-bar){border-color:var(--dash-line)}
.generation-project-card{background:var(--dash-card);border-color:var(--dash-line)}
.generation-project-card:hover{background:var(--dash-muted);border-color:var(--accent)}
.generation-project-card[aria-pressed=true]{background:var(--accent-soft);border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.generation-project-check{background:var(--dash-card);border-color:var(--dash-line)}
.generation-project-card[aria-pressed=true] .generation-project-check{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
#generate-view .duration-presets button{background:var(--dash-card);color:var(--dash-fg);border-color:var(--dash-line)}
#generate-view .duration-presets button:is(:hover,[aria-pressed=true]){background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}
#generate-view :is(.generation-input-unit input,.generation-ticket dd){color:var(--dash-fg)}
#generate-view .generation-summary .secondary{background:var(--dash-card);color:var(--dash-fg);border-color:var(--dash-line)}
.generation-input-unit :is(input,select),.search-box input,.search-composite input{background:transparent;color:var(--dash-fg)}
:root :is(.integration-panel code,code){background:var(--dash-muted);color:var(--dash-fg)}
:root :is(table,td){color:var(--dash-fg)}
:root :is(thead,th){background:var(--dash-muted);color:var(--dash-secondary)}
:root :is(th,td,.reseller-key){border-color:var(--dash-line)}
.table-footer{background:var(--dash-card)}
.table-scroll :is(th:last-child,td:last-child,tr:hover td:last-child){background:var(--dash-card);box-shadow:-1px 0 var(--dash-line)}
.table-scroll th:last-child{background:var(--dash-muted)}
.table-scroll tbody tr:hover{background:var(--dash-muted)}
tr.selected{background:var(--accent-soft)!important}
tr.selected td:last-child{background:var(--accent-soft)!important}
.devices-pill-btn{background:var(--dash-muted);color:var(--dash-fg);border-color:var(--dash-line)}
.devices-pill-btn:hover{background:var(--dash-muted);color:var(--dash-fg);border-color:var(--focus)}
.devices-pill-btn small{background:var(--dash-muted)!important;color:var(--dash-secondary)!important}
.calendar-input{background:var(--dash-card)!important;color:var(--dash-fg)!important;border-color:var(--dash-line)!important}
.calendar-input::-webkit-calendar-picker-indicator{filter:none}
.unactivated-banner,.reset-pause-btn{background:var(--warning-bg)!important;color:var(--warning)!important;border-color:var(--dash-line)!important}
.reset-pause-btn:hover{background:var(--warning-bg)!important;color:var(--warning)!important}
:root :is(.switch-slider,.feature-toggle .slider){background:var(--dash-line);border-color:var(--dash-secondary)}
:root :is(.switch-slider,.feature-toggle .slider)::before{background:var(--dash-secondary)}
.switch-label input:checked+.switch-slider,.feature-toggle input:checked+.slider{background:var(--accent);border-color:var(--accent)}
.switch-label input:checked+.switch-slider::before,.feature-toggle input:checked+.slider::before{background:var(--on-accent)}
.switch-label input:focus-visible+.switch-slider,.feature-toggle input:focus-visible+.slider{outline:2px solid var(--focus);outline-offset:3px}
.login-screen,.session-screen{background:var(--dash-bg)}
.login-panel{background:var(--dash-card)}
.login-art{background:var(--accent-soft);border-color:var(--dash-line)}
.login-copy h1,.login-form-wrap h2{color:var(--dash-fg)}
.login-copy :is(p,.eyebrow),.login-benefits,.login-form-wrap>p,.telegram-login p,.login-benefits span,.login-form-wrap label{color:var(--dash-secondary)}
.login-form-wrap .login-note{color:var(--dash-secondary);font-size:13px!important}
.remember-label{color:var(--dash-secondary)!important}
:root :is(.auth-tabs,.telegram-login){border-color:var(--dash-line)}
.tab-btn{color:var(--dash-secondary);background:transparent}
.tab-btn.active{background:var(--dash-muted);color:var(--dash-fg);border-color:var(--dash-line)}
:root :is(.google-account-badge,.google-fallback-wrap){background:var(--dash-muted);border-color:var(--dash-line);color:var(--dash-fg)}
a{color:var(--accent)}
.sidebar{background:var(--sidebar);border-color:var(--dash-line)}
.sidebar :is(.nav-item,.nav-more summary,.protocol-badge,.protocol-badge>span:last-child,.sidebar-label,.console-brand-text small,.sidebar-help p,.sidebar-help strong){color:var(--sidebar-fg)}
.sidebar .nav-item{background:transparent}
.sidebar .nav-item.active{background:var(--accent-soft);color:var(--accent);border-color:var(--dash-line)}
.sidebar .nav-item:hover{background:#ffffff0d;color:#fff}
.sidebar .nav-item.active:hover{background:var(--accent-soft);color:var(--accent)}
.sidebar .nav-count{background:#ffffff12;color:var(--sidebar-fg)}
.sidebar .active .nav-count{background:var(--accent-soft);color:var(--accent)}
.sidebar .quick-guide{background:var(--dash-card);border-color:var(--dash-line)}
dialog::backdrop{background:#0c172b9e}
[data-theme=dark] dialog::backdrop{background:#03070ebd}
.panel:has(.filter-popover-container){overflow:visible}
.row-key-select{display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.row-key-select span,.select-all-label{display:none}
@media(max-width:1200px){#overview-view .overview-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){#overview-view .overview-welcome{align-items:flex-start;flex-direction:column;gap:16px}#overview-view .overview-stats{gap:10px}#overview-view .overview-stat{padding:16px;min-height:135px}#overview-view .overview-stat strong{font-size:27px}#overview-view .overview-stat strong.stat-word{font-size:17px}.dashboard-distribution{grid-template-columns:1fr;padding:20px;gap:20px}.dashboard-live{font-size:10px}.theme-floating{right:16px;bottom:16px}.topbar-right{gap:10px}.topbar-right .theme-toggle{width:32px;height:32px}#overview-view .overview-search{padding:16px}#overview-view .overview-search-field{width:100%}}

/* Motion stays subtle: short feedback for controls, softer entry for surfaces. */
:root{--motion-ease:cubic-bezier(.22,1,.36,1);--motion-fast:180ms;--motion-surface:280ms;--motion-shadow:0 8px 24px #1826380a}
.console-mark:has(.console-logo){width:40px;height:40px;padding:0;background:transparent;border-radius:11px;overflow:hidden;box-shadow:0 0 0 1px #ffffff20}
.console-logo{display:block;width:100%;height:100%;object-fit:cover}
.account-avatar:has(img){overflow:hidden;padding:0;background:var(--dash-card)}
.account-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.project-brand-mark{position:relative;display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;flex:0 0 auto;border:1px solid var(--dash-line);border-radius:12px;background:var(--dash-card);padding:0}
.project-brand-mark>img.project-brand-image,#overview-view .application-icon>img.project-brand-image,.generation-ticket-brand .project-brand-image{display:block;width:100%;height:100%;max-width:none;padding:0;border:0;border-radius:inherit;object-fit:cover;background:transparent;filter:none}
.project-platform-mark{display:grid;place-items:center;position:absolute;right:-5px;bottom:-5px;width:23px;height:23px;padding:2px;border:2px solid var(--dash-card);border-radius:8px;background:#19241f;box-shadow:0 1px 3px #0000001a}
.project-brand-mark .project-platform-mark>img,.generation-ticket-brand .project-platform-mark>img{display:block;width:17px;height:17px;max-width:none;padding:0;border:0;border-radius:4px;object-fit:contain;filter:none;background:transparent}
#overview-view .application-icon.project-brand-mark{width:46px;height:46px;border-radius:12px}
#overview-view .application-icon .project-platform-mark img{filter:none}
.generation-project-card>.project-brand-mark.generation-project-mark{width:42px;height:42px;border-radius:10px;margin:0 4px 0 0;padding:0}
.generation-project-card .project-platform-mark{width:21px;height:21px;right:-4px;bottom:-4px;border-radius:7px}
.ticket-brand-mark{width:50px;height:50px;border-radius:12px;margin-right:4px}
.project-card-visual:has(.project-card-logo){display:flex;align-items:center;gap:16px}
.project-card-logo{width:50px;height:50px}
.project-card-titles .profile-badge-logo,.project-card-titles .platform-badge,#project-profile-badge{display:none}
.project-tag-mini .project-tag-thumb{display:block;width:24px;height:24px;object-fit:cover;border-radius:6px;border:1px solid var(--dash-line)}
.reseller-brandline{display:flex;align-items:center;gap:10px}
.reseller-brandline>img{display:block;object-fit:cover;border-radius:10px;border:1px solid var(--dash-line)}
[data-theme=dark]{--motion-shadow:0 8px 24px #00000030}
:is(button,.account-menu summary,.nav-item,.app-card-actions button){transition:transform var(--motion-fast) var(--motion-ease),background-color var(--motion-fast) ease,border-color var(--motion-fast) ease,color var(--motion-fast) ease,box-shadow var(--motion-fast) ease}
:is(.overview-app-card,.overview-stat,.project-card,.reseller-panel,.dashboard-distribution){transition:transform var(--motion-surface) var(--motion-ease),box-shadow var(--motion-surface) var(--motion-ease),border-color var(--motion-surface) ease,background-color 200ms ease}
:is(input,select,textarea,.search-box,.search-composite,.generation-input-unit){transition:border-color 180ms ease,box-shadow 180ms ease,background-color 200ms ease,color 200ms ease}
:is(.theme-toggle svg,.account-menu summary svg,.welcome-find svg,.text-button svg){transition:transform var(--motion-surface) var(--motion-ease),opacity var(--motion-fast) ease}
.account-menu summary svg{transform-origin:center}
.account-menu[open] summary>svg{transform:rotate(180deg)}
.account-menu[open] .account-popover{animation:menu-arrive 180ms var(--motion-ease) both;transform-origin:top right}
dialog[open]{animation:dialog-arrive 220ms var(--motion-ease) both}
dialog[open]::backdrop{animation:backdrop-arrive 180ms ease both}
.view:not([hidden]){animation:view-arrive 260ms var(--motion-ease) both}
.distribution-fill{transform-origin:left;animation:bar-arrive 650ms var(--motion-ease) both}
.table-scroll tbody tr{transition:background-color 160ms ease}
.table-scroll td:last-child{transition:background-color 160ms ease}
:is(.primary,.secondary,.theme-toggle,.row-action,.account-menu summary):active:not(:disabled){transform:translateY(0) scale(.98)}
@media(hover:hover) and (pointer:fine){
  :is(.primary,.secondary,.theme-toggle,.row-action):hover:not(:disabled){transform:translateY(-1px)}
  :is(.overview-app-card,.overview-stat,.project-card):hover{transform:translateY(-2px);box-shadow:var(--motion-shadow);border-color:color-mix(in srgb,var(--dash-secondary) 35%,var(--dash-line))}
  .sidebar .nav-item:hover{transform:translateX(2px)}
  .account-menu summary:hover .account-avatar{box-shadow:0 0 0 3px var(--dash-muted)}
  .theme-toggle:hover svg{transform:rotate(-12deg)}
  :is(.welcome-find,.text-button):hover svg{transform:translateX(2px)}
  .account-popover>button:hover{transform:translateX(1px)}
}
@keyframes menu-arrive{from{opacity:0;transform:translateY(-5px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes dialog-arrive{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes backdrop-arrive{from{opacity:0}to{opacity:1}}
@keyframes view-arrive{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@keyframes bar-arrive{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
  :is(button,.account-menu summary,.sidebar .nav-item,.overview-app-card,.overview-stat,.project-card):hover{transform:none!important}
}

/* Mobile records expose every field without a wide table or clipped actions. */
@media(max-width:1100px){
  .record-table{display:block;width:100%;min-width:0!important;border-spacing:0}
  .table-scroll:has(>.record-table){overflow:visible;background:transparent}
  .record-table thead{display:block;background:transparent;padding:12px 16px;border-bottom:1px solid var(--dash-line)}
  .record-table thead tr{display:flex;background:transparent}
  .record-table th.cb-th{display:flex;align-items:center;gap:12px;width:100%;padding:0;background:transparent;border:0}
  .record-table th:not(.cb-th),.record-table:not(:has(.cb-th)) thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
  .record-table .select-all-label{display:block;color:var(--dash-fg);font-size:14px;letter-spacing:0;min-height:44px;align-content:center;text-transform:none;cursor:pointer}
  .record-table tbody{display:grid;gap:12px;padding:12px}
  .record-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 16px;padding:12px 16px;border:1px solid var(--dash-line);border-radius:10px;background:var(--dash-card)}
  .record-table tbody tr.selected{border-color:var(--accent)}
  .record-table td{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:5px;min-width:0;width:auto!important;padding:8px 0!important;border:0;white-space:normal;text-align:left;overflow-wrap:anywhere;background:transparent!important;box-shadow:none!important}
  .record-table td::before{content:attr(data-label);color:var(--dash-secondary);font-size:12px;font-weight:500;text-transform:capitalize;letter-spacing:0}
  .record-table td:first-child,.record-table tr:has(.cb-td) td:nth-child(2){grid-column:1/-1}
  .record-table td:first-child::before,.record-table tr:has(.cb-td) td:nth-child(2)::before,.record-table td.align-right::before{display:none}
  .record-table td.cb-td{grid-column:1;grid-row:1;padding:0!important}
  .record-table .row-key-select{min-height:44px;gap:10px;flex-direction:row;font-size:13px}
  .record-table .row-key-select span{display:inline;color:var(--dash-secondary)}
  .record-table input[type=checkbox]{width:20px;height:20px;min-height:20px;accent-color:var(--accent);flex-shrink:0}
  .record-table td.align-right{grid-column:1/-1;flex-direction:row;flex-wrap:wrap;gap:8px}
  .record-table tr:has(.cb-td) td.align-right{grid-column:2;grid-row:1;justify-self:end;align-self:center;padding:0!important}
  .record-table td:has(.expiry-cell),.record-table td:has(.devices-pill-btn){grid-column:1/-1}
  .record-table :is(.project-tag-mini,.creator-pill){max-width:100%;white-space:normal}
  .record-table .expiry-cell{flex-wrap:wrap}
  .record-table .actions-cell-wrap .row-action.edit-btn:only-child{height:44px;min-width:84px}
  .recent-panel .record-table tr{grid-template-columns:minmax(0,1fr) auto}
  .recent-panel .record-table td:nth-child(2),.recent-panel .record-table td:nth-child(3){grid-column:1}
  .recent-panel .record-table td:nth-child(4){grid-column:2;grid-row:2/4;align-self:center}
  .recent-panel .record-table td::before{display:none}
  .recent-panel .record-table .status-pill{font-size:12px}
  .record-table .price-input-group{max-width:100%}
  .record-table .price-input{width:100%;min-width:0}
  .record-table :is(input:not([type=checkbox]),select){font-size:16px}
}

@media(max-width:700px){
  .topbar{position:sticky;top:0;z-index:40;min-height:64px;height:auto;padding:8px 12px;gap:8px}
  .topbar-left{min-width:0;gap:8px;flex:1}
  .topbar-right{gap:6px;flex-shrink:0}
  .topbar .breadcrumb{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .topbar .environment{display:none}
  .topbar-right .theme-toggle,.theme-toggle,.nav-toggle,.recent-open,.close{width:44px;height:44px;min-width:44px;min-height:44px}
  .account-menu summary{min-height:44px;min-width:44px;padding:4px}
  .sidebar{width:min(300px,calc(100vw - 32px));padding-bottom:calc(20px + env(safe-area-inset-bottom))}
  main{padding:24px 16px}
  .page-heading,.panel-heading,.section-heading{flex-wrap:wrap;align-items:flex-start;gap:14px}
  .page-heading{margin-bottom:24px}
  .panel-heading{padding:20px 16px}
  .panel-heading>div,.generation-step>div,.account-setting-row>div{min-width:0}
  .table-toolbar,.unified-filter-toolbar{padding:16px;gap:12px;flex-wrap:wrap}
  .table-toolbar .search-box,.search-composite{width:100%;min-width:0;flex:1 1 100%}
  .search-box input,.search-composite input{min-width:0;width:100%}
  .filter-popover-container{position:static}
  .unified-filter-toolbar{position:relative}
  .filter-popover-panel{left:12px;right:12px;width:auto;max-height:calc(100dvh - 160px);overflow-y:auto}
  .popover-grid{gap:16px 12px}
  .bulk-action-bar,.bulk-left,.bulk-right{flex-wrap:wrap;gap:10px}
  .bulk-action-bar{margin:12px 0;padding:14px}
  .bulk-right{width:100%}
  .table-footer{flex-wrap:wrap;gap:8px;padding:16px}
  :is(.primary,.secondary,.row-action,.duration-presets button,.tab-btn,.copy-key-primary-btn,.device-unbind-btn,.copy-uuid-btn,.step-btn,.preset-btn,.stepper-chip,.filter-toggle-btn,.expiry-edit-btn){min-height:44px}
  .expiry-edit-btn{min-width:44px}
  .generation-custom-duration{flex-wrap:wrap;gap:10px}
  .generation-input-unit{min-width:0;max-width:100%}
  .generation-input-unit input{width:100%;min-width:0}
  #generate-view .generation-summary{padding:20px 16px}
  .generation-step{align-items:flex-start}
  .generation-ticket dl{padding:16px}
  .generation-ticket-brand{padding:18px 16px}
  .generation-preview-heading{flex-wrap:wrap;gap:10px}
  .generation-project-check{flex-shrink:0}
  .generation-ticket-brand h2{overflow-wrap:anywhere}
  .project-cards{padding:16px;grid-template-columns:minmax(0,1fr)}
  .project-card-visual{min-width:0;padding:16px;gap:12px}
  .project-card-titles{min-width:0}
  .card-actions{flex-wrap:wrap;gap:12px}
  .bot-health{padding:20px 16px;flex-wrap:wrap;gap:16px}
  .integration-panel{padding:20px 16px}
  .integration-panel pre{max-width:100%;overflow:auto;padding:14px}
  dialog,#edit-license-dialog,#devices-dialog,#adjust-expiry-dialog{width:calc(100vw - 24px);max-width:600px;max-height:calc(100dvh - 24px);padding:20px 16px;overflow-y:auto}
  .dialog-heading,.account-dialog-heading{gap:12px;align-items:flex-start}
  .dialog-heading>div,.account-dialog-heading>div{min-width:0}
  .vault-top-row,.vault-key-label,.edit-device-overview-card,.dialog-actions-spread,.dialog-actions-spread .actions-right,.device-card-top{flex-wrap:wrap;gap:12px}
  .vault-key-display .key-preview-full{min-width:0;max-width:100%;flex-basis:100%;overflow-wrap:anywhere}
  .expiry-meta-grid,.devices-dialog-meta{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  .expiry-meta-grid>div,.devices-dialog-meta>div,.account-info dd{min-width:0}
  .devices-list{max-height:none;overflow:visible;padding:0}
  .account-info>div{gap:14px;align-items:flex-start}
  .account-info dt{flex-shrink:0}
  .account-tabs button{padding:8px 6px;min-height:44px}
  .account-setting-row{gap:16px}
  .account-setting-row>button{flex-shrink:0}
  .theme-floating{right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom))}
  .login-panel{padding:32px 20px 84px}
  .login-form-wrap{max-width:400px}
  .login-form-wrap h2{margin-top:12px}
  .auth-tabs{gap:8px}
  .auth-tabs .tab-btn{flex:1 1 0;min-width:0;white-space:normal;padding:10px 8px}
  .google-account-badge{min-width:0;overflow-wrap:anywhere}
}
@media(max-width:400px){
  .topbar .breadcrumb{font-size:0}
  .topbar .breadcrumb span{display:none}
  .topbar .breadcrumb strong{font-size:13px}
  #overview-view .overview-stat{padding:16px 12px}
  #overview-view .overview-stat strong.stat-word{font-size:18px}
  .overview-search-field{flex-wrap:wrap}
  .overview-search-field input{flex:1 1 100%;width:100%}
  .overview-search-field .secondary{width:100%}
  .generation-input-unit{width:100%}
  .account-setting-row{flex-wrap:wrap}
}

.certificate-stats{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:25px}
.installer-certificate-panel{margin-bottom:25px}
.installer-certificate-search{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;padding:0 22px 20px}
.installer-certificate-search label{flex:1;min-width:180px;max-width:360px;margin:0}
.installer-certificate-search .text-button{padding:8px 4px}
.installer-certificate-message{margin:0 22px 18px}
.installer-certificate-panel .table-footer{gap:14px;flex-wrap:wrap}
.installer-certificate-panel .table-footer .note{flex:1;min-width:200px}
@media(max-width:700px){.certificate-stats{grid-template-columns:1fr}}

/* Resolve scoped legacy colors at their source component boundaries. */
:root :is(.nav-toggle,.close,.search-lens){color:var(--dash-secondary);background:transparent}
:root .close:hover{background:var(--dash-muted);color:var(--dash-fg)}
:root :is(.dialog-heading h2,.device-card h4,.device-card strong){color:var(--dash-fg)}
:root .auth-tabs{background:var(--dash-muted)}
:root .tab-btn:hover{background:var(--dash-card);color:var(--dash-fg)}
:root .tab-btn.active{background:var(--dash-card);color:var(--dash-fg)}
:root .login-art .console-brand{color:var(--dash-fg)}
:root .login-art :is(.console-brand-text small,.footer-note){color:var(--dash-secondary)}
:root :is(.green,.orange){color:var(--accent)}
:root .breadcrumb span{color:var(--dash-secondary)}
.breadcrumb .breadcrumb-root{padding:0}
.breadcrumb .breadcrumb-separator{padding:0 8px}
#generate-view :is(.generation-ticket dt,.generation-summary-help,.form-grid label small){color:var(--dash-secondary)}
.generated-key-dialog #generated-keys{background:var(--dash-muted);border-color:var(--dash-line);color:var(--dash-fg)}
:root .generated-key-meta,:root .generated-key-meta span{background:var(--dash-muted);border-color:var(--dash-line);color:var(--dash-fg)}
:root .generated-key-help{color:var(--dash-secondary)}
@media(max-width:1100px){
  .unified-filter-toolbar{position:relative}
  .filter-popover-container{position:static}
  .filter-popover-panel{left:auto;right:12px;width:min(340px,calc(100% - 24px))}
}
@media(max-width:700px){
  .filter-popover-panel{left:12px;right:12px;width:auto}
}
@media(max-width:400px){.topbar .breadcrumb :is(.breadcrumb-root,.breadcrumb-separator){display:none}}
@media(pointer:coarse){
  :is(.primary,.secondary,.text-button,.theme-toggle,.row-action,.duration-presets button,.tab-btn,.copy-key-primary-btn,.device-unbind-btn,.copy-uuid-btn,.filter-toggle-btn,.expiry-edit-btn,.close,.nav-toggle){min-height:44px}
  .account-menu summary{min-height:44px;min-width:44px}
}

:root .sidebar .nav-item.active>span{color:var(--accent)}
:root .sidebar .console-brand{color:#f6f8fc}
:root .quick-guide li>span{color:var(--dash-secondary);border-color:var(--dash-line)}
:root .project-meta .separator{color:var(--dash-secondary)}

.session-recovery{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}
.session-recovery a{text-decoration:none}
.session-card{max-width:100%;overflow-wrap:anywhere}
