/* =============================================================
   QuickSend v5.2.1 — Fluid Grid, Adaptive Widgets & Colour Studio
   ============================================================= */

/* ---------- Twelve-column packing: no widget overlap ---------- */
.dashboard-canvas{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  grid-auto-flow:row dense;
  align-items:start;
  gap:16px;
  position:relative;
  isolation:isolate;
}
.dashboard-canvas>.dash-widget{
  min-width:0;
  max-width:100%;
  position:relative;
  align-self:start;
  transform-origin:center;
}
.dashboard-canvas>.dash-widget.span-quarter{grid-column:span 3!important}
.dashboard-canvas>.dash-widget.span-third{grid-column:span 4!important}
.dashboard-canvas>.dash-widget.span-half{grid-column:span 6!important}
.dashboard-canvas>.dash-widget.span-wide{grid-column:span 8!important}
.dashboard-canvas>.dash-widget.span-full{grid-column:span 12!important}
.dash-widget,.widget-frame,.widget-frame>*{min-width:0;max-width:100%;box-sizing:border-box}
.widget-frame{width:100%;position:relative}
.dash-widget .command-card,.dash-widget .qs-modular-card,.dash-widget .ios-widget,.dash-widget .kpi-command-grid{max-width:100%;min-width:0}
.dash-widget .command-card,.dash-widget .qs-modular-card{overflow:hidden}
.dash-widget .command-card-body{min-width:0;max-width:100%}
.dash-widget table{max-width:100%}
.dash-widget img,.dash-widget svg{max-width:100%}
.dash-widget .crisp-table{min-width:0}
.dash-widget .company-cell,.dash-widget .qs-row-main,.dash-widget .qs-row-title,.dash-widget .qs-row-sub{min-width:0}
.dash-widget .qs-row-title,.dash-widget .qs-row-sub,.dash-widget .command-card-title,.dash-widget .command-card-sub{overflow-wrap:anywhere}
.dash-widget [style*="overflow:auto"],.dash-widget .ops-list,.dash-widget .qs-compact-list{overscroll-behavior:contain}

@media(max-width:1380px){
  .dashboard-canvas>.dash-widget.span-quarter{grid-column:span 4!important}
  .dashboard-canvas>.dash-widget.span-third{grid-column:span 4!important}
}
@media(max-width:1080px){
  .dashboard-canvas>.dash-widget.span-quarter,.dashboard-canvas>.dash-widget.span-third{grid-column:span 6!important}
  .dashboard-canvas>.dash-widget.span-half,.dashboard-canvas>.dash-widget.span-wide,.dashboard-canvas>.dash-widget.span-full{grid-column:span 12!important}
}
@media(max-width:620px){
  .dashboard-canvas>.dash-widget.span-quarter,.dashboard-canvas>.dash-widget.span-third,.dashboard-canvas>.dash-widget.span-half,.dashboard-canvas>.dash-widget.span-wide,.dashboard-canvas>.dash-widget.span-full{grid-column:span 12!important}
  .dashboard-canvas{gap:14px!important}
}

/* ---------- iOS-style arrange mode ---------- */
.widget-tools{
  left:10px!important;right:auto!important;top:9px!important;
  z-index:35!important;gap:4px!important;padding:4px!important;
  border-radius:13px!important;background:rgba(15,23,42,.92)!important;
  box-shadow:0 10px 30px rgba(15,23,42,.26)!important;
  backdrop-filter:blur(16px) saturate(145%);
  -webkit-backdrop-filter:blur(16px) saturate(145%);
}
.widget-tools button{width:31px!important;height:31px!important;border-radius:9px!important;line-height:1;color:#fff!important}
.widget-drag-handle{touch-action:none;cursor:grab!important;padding:0!important}
.widget-drag-handle.is-grabbing{cursor:grabbing!important}
.widget-grip{display:grid;grid-template-columns:repeat(2,3px);grid-template-rows:repeat(3,3px);gap:3px;align-items:center;justify-content:center}
.widget-grip i{display:block;width:3px;height:3px;border-radius:50%;background:currentColor;opacity:.94}
.widget-size-button{gap:2px;flex-direction:column;font-size:12px!important}
.widget-size-button small{font-size:6.5px;line-height:1;font-weight:900;letter-spacing:.25px}
.widget-hide-button{font-size:17px!important}
body.dashboard-edit .dash-widget{cursor:grab!important;will-change:transform;outline:1.5px dashed color-mix(in srgb,var(--theme-accent) 55%,transparent)!important;outline-offset:3px!important}
body.dashboard-edit .dash-widget:active{cursor:grabbing!important}
body.dashboard-edit .dash-widget:nth-child(odd){animation:qsWidgetJiggleA 1.35s ease-in-out infinite alternate}
body.dashboard-edit .dash-widget:nth-child(even){animation:qsWidgetJiggleB 1.48s ease-in-out infinite alternate}
body.dashboard-edit .dashboard-canvas.grid-dragging .dash-widget,body.dashboard-edit .dashboard-canvas.grid-reflowing .dash-widget{animation:none!important}
body.motion-reduced.dashboard-edit .dash-widget{animation:none!important}
@keyframes qsWidgetJiggleA{from{transform:rotate(-.12deg)}to{transform:rotate(.12deg)}}
@keyframes qsWidgetJiggleB{from{transform:rotate(.11deg)}to{transform:rotate(-.11deg)}}

.widget-drag-ghost{
  position:fixed!important;left:0!important;top:0!important;margin:0!important;
  z-index:99999!important;pointer-events:none!important;will-change:transform,opacity;
  opacity:.97;filter:drop-shadow(0 28px 38px rgba(15,23,42,.28));
  outline:2px solid color-mix(in srgb,var(--theme-accent) 65%,#fff)!important;
  outline-offset:2px;border-radius:22px;
  transform-origin:top left!important;
}
.widget-drag-ghost .widget-tools{display:none!important}
.widget-drag-ghost .widget-frame{height:100%}
.widget-placeholder{
  min-width:0;position:relative!important;z-index:1!important;
  border:2px dashed color-mix(in srgb,var(--theme-accent) 72%,transparent)!important;
  border-radius:22px!important;background:color-mix(in srgb,var(--theme-accent) 10%,transparent)!important;
  box-shadow:inset 0 0 0 6px color-mix(in srgb,var(--theme-accent) 5%,transparent)!important;
  overflow:hidden!important;animation:qsPlaceholderPulse .8s ease-in-out infinite alternate!important;
}
.widget-placeholder-inner{height:100%;min-height:88px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--theme-accent);font-size:10px;font-weight:850;letter-spacing:.35px;text-transform:uppercase}
.widget-placeholder-inner span{width:34px;height:34px;border-radius:12px;background:var(--theme-accent);box-shadow:0 8px 22px color-mix(in srgb,var(--theme-accent) 28%,transparent);position:relative}
.widget-placeholder-inner span::before,.widget-placeholder-inner span::after{content:"";position:absolute;background:#fff;border-radius:99px;left:9px;right:9px;top:15px;height:3px}
.widget-placeholder-inner span::after{top:9px;bottom:9px;left:15px;width:3px;height:auto}
.widget-shift-cue{filter:brightness(1.02)}
.widget-drop-arrival{animation:qsDropArrival .28s cubic-bezier(.2,.9,.2,1)}
@keyframes qsPlaceholderPulse{from{opacity:.72}to{opacity:1}}
@keyframes qsDropArrival{0%{transform:scale(.975)}65%{transform:scale(1.008)}100%{transform:scale(1)}}
body.qs-grid-dragging{user-select:none!important;-webkit-user-select:none!important;cursor:grabbing!important}
body.qs-grid-dragging iframe{pointer-events:none!important}

/* ---------- True size variants ---------- */
.dash-widget[data-size="quarter"] .qs-modular-card,.dash-widget[data-size="quarter"] .command-card,.dash-widget[data-size="quarter"] .qs-ai-spotlight{min-height:174px}
.dash-widget[data-size="third"] .qs-modular-card,.dash-widget[data-size="third"] .command-card,.dash-widget[data-size="third"] .qs-ai-spotlight{min-height:212px}
.dash-widget[data-size="half"] .qs-modular-card,.dash-widget[data-size="half"] .command-card,.dash-widget[data-size="half"] .qs-ai-spotlight{min-height:246px}
.dash-widget[data-size="wide"] .qs-modular-card,.dash-widget[data-size="wide"] .command-card,.dash-widget[data-size="wide"] .qs-ai-spotlight{min-height:252px}
.dash-widget[data-size="full"] .qs-modular-card,.dash-widget[data-size="full"] .command-card,.dash-widget[data-size="full"] .qs-ai-spotlight{min-height:258px}

.dash-widget[data-size="quarter"] .command-card-head{padding:13px 13px 8px}
.dash-widget[data-size="quarter"] .command-card-body{padding:0 13px 13px;overflow:hidden}
.dash-widget[data-size="quarter"] .command-card-title{font-size:12.5px}
.dash-widget[data-size="quarter"] .command-card-sub,.dash-widget[data-size="quarter"] .command-link{display:none!important}
.dash-widget[data-size="third"] .command-card-head{padding:15px 15px 9px}
.dash-widget[data-size="third"] .command-card-body{padding:0 15px 15px;overflow:hidden}
.dash-widget[data-size="third"] .command-card-sub{font-size:9px;line-height:1.35}
.dash-widget[data-size="third"] .command-link{font-size:9px}

/* Lists become summaries rather than compressed copies. */
.dash-widget[data-size="quarter"] .qs-compact-list>:nth-child(n+4),
.dash-widget[data-size="quarter"] .qs-distribution>:nth-child(n+4),
.dash-widget[data-size="quarter"] .qs-app-mix>:nth-child(n+4),
.dash-widget[data-size="quarter"] .qs-quota-list>:nth-child(n+4),
.dash-widget[data-size="quarter"] .qs-typing-list>:nth-child(n+4),
.dash-widget[data-size="quarter"] .ops-list>.ops-row:nth-child(n+4){display:none!important}
.dash-widget[data-size="third"] .qs-compact-list>:nth-child(n+6),
.dash-widget[data-size="third"] .qs-distribution>:nth-child(n+6),
.dash-widget[data-size="third"] .qs-app-mix>:nth-child(n+6),
.dash-widget[data-size="third"] .qs-quota-list>:nth-child(n+6),
.dash-widget[data-size="third"] .qs-typing-list>:nth-child(n+6),
.dash-widget[data-size="third"] .ops-list>.ops-row:nth-child(n+6){display:none!important}
.dash-widget[data-size="half"] .qs-compact-list>:nth-child(n+8),
.dash-widget[data-size="half"] .qs-distribution>:nth-child(n+8),
.dash-widget[data-size="half"] .qs-app-mix>:nth-child(n+8),
.dash-widget[data-size="half"] .qs-quota-list>:nth-child(n+8),
.dash-widget[data-size="half"] .qs-typing-list>:nth-child(n+8),
.dash-widget[data-size="half"] .ops-list>.ops-row:nth-child(n+8){display:none!important}

/* Clock: compact=time only, small=time/date/location, large=full city/timezone/calendar. */
.qs-clock-view{display:none;position:relative;z-index:2;height:100%}
.dash-widget[data-widget="clock"][data-size="quarter"] .qs-clock-view-compact{display:flex;flex-direction:column;justify-content:flex-end}
.dash-widget[data-widget="clock"][data-size="third"] .qs-clock-view-small{display:block}
.dash-widget[data-widget="clock"][data-size="half"] .qs-clock-view-expanded,
.dash-widget[data-widget="clock"][data-size="wide"] .qs-clock-view-expanded,
.dash-widget[data-widget="clock"][data-size="full"] .qs-clock-view-expanded{display:block}
.dash-widget[data-widget="clock"][data-size="quarter"] .qs-clock-widget{height:174px;min-height:174px;padding:18px}
.dash-widget[data-widget="clock"][data-size="third"] .qs-clock-widget{height:212px;min-height:212px;padding:19px}
.dash-widget[data-widget="clock"][data-size="half"] .qs-clock-widget{min-height:250px}
.dash-widget[data-widget="clock"][data-size="wide"] .qs-clock-widget,.dash-widget[data-widget="clock"][data-size="full"] .qs-clock-widget{min-height:270px}
.qs-compact-clock-label{font-size:9px;font-weight:850;letter-spacing:1.1px;opacity:.65}
.qs-compact-clock-time{font-size:43px;line-height:1;font-weight:790;letter-spacing:-2.4px;margin-top:8px;white-space:nowrap}
.qs-clock-location-chip{display:inline-grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px;max-width:100%;padding:6px 9px;border:1px solid rgba(255,255,255,.22);border-radius:999px;background:rgba(255,255,255,.12);color:inherit;text-align:left;margin-bottom:9px;backdrop-filter:blur(10px)}
.qs-clock-location-chip span{font-size:7px;color:#6EF0B2}
.qs-clock-location-chip b{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.qs-clock-location-chip small{grid-column:2;font-size:7px;opacity:.65;margin-top:-4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.qs-clock-main{min-width:0}
.qs-clock-calendar{flex-shrink:0}
.dash-widget[data-widget="clock"][data-size="half"] .ios-calendar{width:158px;padding:8px}
.dash-widget[data-widget="clock"][data-size="half"] .ios-cal-grid span{height:17px}
.dash-widget[data-widget="clock"][data-size="full"] .ios-clock-time{font-size:54px}
.dash-widget[data-widget="clock"][data-size="full"] .ios-calendar{width:195px;padding:12px}
.dash-widget[data-widget="clock"][data-size="full"] .ios-cal-grid span{height:21px}

/* Weather is redrawn for each available space. */
.dash-widget[data-widget="weather"][data-size="quarter"] .weather-widget{height:174px;min-height:174px;padding:17px}
.dash-widget[data-widget="weather"][data-size="third"] .weather-widget{height:212px;min-height:212px;padding:18px}
.dash-widget[data-widget="weather"][data-size="half"] .weather-widget,.dash-widget[data-widget="weather"][data-size="wide"] .weather-widget{min-height:250px}
.dash-widget[data-widget="weather"][data-size="quarter"] .weather-location button,.dash-widget[data-widget="weather"][data-size="quarter"] .weather-feels,.dash-widget[data-widget="weather"][data-size="quarter"] .weather-stats,.dash-widget[data-widget="weather"][data-size="quarter"] .agenda-more{display:none!important}
.dash-widget[data-widget="weather"][data-size="quarter"] .weather-location{font-size:9.5px;max-width:72%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-widget[data-widget="weather"][data-size="quarter"] .weather-orb{width:74px;height:74px;right:13px;top:28px}
.dash-widget[data-widget="weather"][data-size="quarter"] .weather-temp{font-size:46px;margin-top:20px}
.dash-widget[data-widget="weather"][data-size="quarter"] .weather-condition{font-size:11px;max-width:72%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-widget[data-widget="weather"][data-size="third"] .weather-stats{grid-template-columns:1fr;left:18px;right:18px;bottom:15px}
.dash-widget[data-widget="weather"][data-size="third"] .weather-stat:nth-child(n+2){display:none!important}
.dash-widget[data-widget="weather"][data-size="third"] .weather-orb{width:88px;height:88px;right:15px;top:31px}
.dash-widget[data-widget="weather"][data-size="third"] .weather-temp{font-size:47px;margin-top:17px}
.dash-widget[data-widget="weather"][data-size="half"] .weather-stats{grid-template-columns:1fr 1fr}
.dash-widget[data-widget="weather"][data-size="half"] .weather-stat:nth-child(3){display:none!important}

/* Agenda variants. */
.dash-widget[data-widget="agenda"][data-size="quarter"] .agenda-widget{height:174px;min-height:174px;padding:16px}
.dash-widget[data-widget="agenda"][data-size="third"] .agenda-widget{height:212px;min-height:212px;padding:18px}
.dash-widget[data-widget="agenda"][data-size="half"] .agenda-widget,.dash-widget[data-widget="agenda"][data-size="wide"] .agenda-widget{min-height:250px}
.dash-widget[data-widget="agenda"][data-size="quarter"] .agenda-list{margin-top:12px}
.dash-widget[data-widget="agenda"][data-size="quarter"] .agenda-row:nth-child(n+2),.dash-widget[data-widget="agenda"][data-size="quarter"] .agenda-more{display:none!important}
.dash-widget[data-widget="agenda"][data-size="quarter"] .agenda-row{display:grid;grid-template-columns:38px 1fr;padding:10px 9px}
.dash-widget[data-widget="agenda"][data-size="quarter"] .agenda-tag{display:none!important}
.dash-widget[data-widget="agenda"][data-size="third"] .agenda-row:nth-child(n+3){display:none!important}
.dash-widget[data-widget="agenda"][data-size="third"] .agenda-more{left:18px;bottom:14px}
.dash-widget[data-widget="agenda"][data-size="half"] .agenda-row:nth-child(n+5){display:none!important}

/* AI and actions. */
.dash-widget[data-widget="aiSpotlight"][data-size="quarter"] .qs-ai-spotlight{padding:16px;display:flex;flex-direction:column;justify-content:space-between}
.dash-widget[data-widget="aiSpotlight"][data-size="quarter"] .qs-ai-example{display:none!important}
.dash-widget[data-widget="aiSpotlight"][data-size="quarter"] .qs-ai-title{font-size:15px;line-height:1.18;margin:7px 0}
.dash-widget[data-widget="aiSpotlight"][data-size="quarter"] .qs-ai-top{font-size:8px}
.dash-widget[data-widget="aiSpotlight"][data-size="quarter"] .qs-ai-spotlight button{font-size:9px;padding:8px 9px}
.dash-widget[data-widget="aiSpotlight"][data-size="third"] .qs-ai-example{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-widget[data-widget="quickActions"][data-size="quarter"] .qs-action-grid{grid-template-columns:1fr 1fr;gap:6px}
.dash-widget[data-widget="quickActions"][data-size="quarter"] .qs-action-grid button{min-height:48px;padding:7px}
.dash-widget[data-widget="quickActions"][data-size="quarter"] .qs-action-grid button:nth-child(n+5){display:none!important}
.dash-widget[data-widget="quickActions"][data-size="quarter"] .qs-action-grid button b{font-size:8px}
.dash-widget[data-widget="quickActions"][data-size="third"] .qs-action-grid{grid-template-columns:1fr 1fr}

/* KPI card reveals more metrics as it grows. */
.dash-widget[data-widget="kpis"][data-size="half"] .kpi-command-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.dash-widget[data-widget="kpis"][data-size="half"] .kpi-command:nth-child(n+5){display:none!important}
.dash-widget[data-widget="kpis"][data-size="wide"] .kpi-command-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.dash-widget[data-widget="kpis"][data-size="wide"] .kpi-command:nth-child(n+9){display:none!important}
.dash-widget[data-widget="kpis"][data-size="full"] .kpi-command-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
.dash-widget[data-widget="kpis"][data-size="half"] .kpi-command{min-height:112px;padding:13px}

/* Finance and management summaries. */
.dash-widget[data-widget="pulse"][data-size="half"] .pulse-grid,.dash-widget[data-widget="finance"][data-size="half"] .pulse-grid{grid-template-columns:1fr}
.dash-widget[data-widget="pulse"][data-size="half"] .pulse-grid>:nth-child(2),.dash-widget[data-widget="finance"][data-size="half"] .pulse-grid>:nth-child(2){display:none!important}
.dash-widget[data-widget="pulse"][data-size="wide"] .pulse-grid,.dash-widget[data-widget="finance"][data-size="wide"] .pulse-grid{grid-template-columns:1fr 1fr}

/* Tables keep decision-critical columns at medium size. */
.dash-widget[data-widget="companies"][data-size="half"] .crisp-table th:nth-child(n+4),.dash-widget[data-widget="companies"][data-size="half"] .crisp-table td:nth-child(n+4){display:none!important}
.dash-widget[data-widget="companies"][data-size="wide"] .crisp-table th:nth-child(6),.dash-widget[data-widget="companies"][data-size="wide"] .crisp-table td:nth-child(6){display:none!important}
.dash-widget[data-widget="companies"][data-size="half"] .company-cell{min-width:145px}

/* Pipeline and operations. */
.dash-widget[data-widget="pipeline"][data-size="third"] .pipeline-command{grid-template-columns:1fr 1fr}
.dash-widget[data-widget="pipeline"][data-size="third"] .pipeline-node:nth-child(n+5){display:none!important}
.dash-widget[data-widget="pipeline"][data-size="half"] .pipeline-command{grid-template-columns:repeat(2,1fr)}
.dash-widget[data-widget="pipeline"][data-size="half"] .pipeline-node:nth-child(n+7){display:none!important}
.dash-widget[data-widget="operations"][data-size="half"] .ops-columns{grid-template-columns:1fr}
.dash-widget[data-widget="operations"][data-size="half"] .ops-panel:nth-child(n+2){display:none!important}
.dash-widget[data-widget="operations"][data-size="wide"] .ops-columns{grid-template-columns:1fr 1fr}
.dash-widget[data-widget="operations"][data-size="wide"] .ops-panel:nth-child(n+3){display:none!important}
.dash-widget[data-widget="operations"][data-size="full"] .ops-columns{grid-template-columns:repeat(3,minmax(0,1fr))}
.dash-widget[data-widget="dataQuality"][data-size="half"] .qs-quality-list{grid-template-columns:1fr}
.dash-widget[data-widget="typingBalances"][data-size="third"] .qs-typing-list button{grid-template-columns:1fr 70px}
.dash-widget[data-widget="typingBalances"][data-size="third"] .qs-typing-list i{display:none!important}

/* ---------- Colour layout studio ---------- */
.palette-current-pill{flex-shrink:0;display:inline-flex;align-items:center;border:1px solid var(--line);background:var(--theme-accent-soft);color:var(--theme-accent);border-radius:99px;padding:5px 9px;font-size:8.5px;font-weight:850;white-space:nowrap}
.palette-gallery{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.palette-choice{min-width:0;display:grid;grid-template-columns:66px 1fr auto;align-items:center;gap:9px;text-align:left;border:1px solid var(--line);border-radius:13px;background:var(--card);padding:9px;color:var(--ink);transition:.18s ease}
.palette-choice:hover{border-color:var(--theme-accent);transform:translateY(-1px)}
.palette-choice.selected{border-color:var(--theme-accent);box-shadow:0 0 0 2px var(--theme-accent-soft)}
.palette-swatches{height:34px;display:grid;grid-template-columns:repeat(4,1fr);overflow:hidden;border-radius:9px;border:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
.palette-swatches i{display:block;background:var(--swatch)}
.palette-copy{min-width:0}.palette-copy b{display:block;font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.palette-copy small{display:block;font-size:7.5px;line-height:1.3;color:var(--muted);margin-top:2px}
.palette-choice em{font-style:normal;font-size:7px;font-weight:850;text-transform:uppercase;letter-spacing:.45px;color:var(--muted)}
.palette-choice.selected em{color:var(--theme-accent)}
.palette-reset{margin-top:8px;width:100%;border:1px solid var(--line);border-radius:10px;background:var(--line-2);padding:8px;font-size:8.5px;font-weight:780;color:var(--ink-2)}
.palette-reset:hover{border-color:var(--theme-accent);color:var(--theme-accent);background:var(--theme-accent-soft)}
.widget-adaptive-note{font-size:7.2px;color:var(--theme-accent);font-weight:760;margin-top:3px;letter-spacing:.15px}
.widget-size-select{width:92px!important;min-width:92px!important}
@media(max-width:560px){.palette-gallery{grid-template-columns:1fr}.palette-choice{grid-template-columns:62px 1fr auto}.widget-size-select{width:78px!important;min-width:78px!important}}

/* ---------- Palette variables affect the complete interface ---------- */
body.skin-pixel:not(.theme-dark),body.skin-apple:not(.theme-dark),body.skin-aurora:not(.theme-dark),body.skin-executive:not(.theme-dark),body.skin-bento:not(.theme-dark){
  --bg:var(--qs-card-light);--card:var(--qs-card-light);--line:var(--qs-line-light);--line-2:color-mix(in srgb,var(--qs-card-light) 86%,var(--theme-accent));
  background:var(--qs-page-light)!important;background-attachment:fixed!important;
}
body.skin-pixel.theme-dark,body.skin-apple.theme-dark,body.skin-aurora.theme-dark,body.skin-executive.theme-dark,body.skin-bento.theme-dark{
  --bg:var(--qs-card-dark);--card:var(--qs-card-dark);--line:var(--qs-line-dark);--line-2:color-mix(in srgb,var(--qs-card-dark) 90%,var(--theme-accent));
  background:var(--qs-page-dark)!important;background-attachment:fixed!important;
}
body.skin-pixel:not(.theme-dark) .sidebar,body.skin-apple:not(.theme-dark) .sidebar,body.skin-aurora:not(.theme-dark) .sidebar,body.skin-executive:not(.theme-dark) .sidebar,body.skin-bento:not(.theme-dark) .sidebar{background:var(--qs-sidebar-light)!important}
body.skin-pixel.theme-dark .sidebar,body.skin-apple.theme-dark .sidebar,body.skin-aurora.theme-dark .sidebar,body.skin-executive.theme-dark .sidebar,body.skin-bento.theme-dark .sidebar{background:var(--qs-sidebar-dark)!important}
body.skin-pixel:not(.theme-dark) .topbar,body.skin-apple:not(.theme-dark) .topbar,body.skin-aurora:not(.theme-dark) .topbar,body.skin-executive:not(.theme-dark) .topbar,body.skin-bento:not(.theme-dark) .topbar{background:color-mix(in srgb,var(--qs-card-light) 90%,transparent)!important}
body.skin-pixel.theme-dark .topbar,body.skin-apple.theme-dark .topbar,body.skin-aurora.theme-dark .topbar,body.skin-executive.theme-dark .topbar,body.skin-bento.theme-dark .topbar{background:color-mix(in srgb,var(--qs-card-dark) 90%,transparent)!important}
body.skin-pixel:not(.theme-dark) .dash-toolbar,body.skin-pixel:not(.theme-dark) .card,body.skin-pixel:not(.theme-dark) .command-card,body.skin-pixel:not(.theme-dark) .kpi-command,body.skin-pixel:not(.theme-dark) .metric-block,body.skin-pixel:not(.theme-dark) .ops-panel,
body.skin-apple:not(.theme-dark) .dash-toolbar,body.skin-apple:not(.theme-dark) .card,body.skin-apple:not(.theme-dark) .command-card,body.skin-apple:not(.theme-dark) .kpi-command,body.skin-apple:not(.theme-dark) .metric-block,body.skin-apple:not(.theme-dark) .ops-panel,
body.skin-aurora:not(.theme-dark) .dash-toolbar,body.skin-aurora:not(.theme-dark) .card,body.skin-aurora:not(.theme-dark) .command-card,body.skin-aurora:not(.theme-dark) .kpi-command,body.skin-aurora:not(.theme-dark) .metric-block,body.skin-aurora:not(.theme-dark) .ops-panel,
body.skin-executive:not(.theme-dark) .dash-toolbar,body.skin-executive:not(.theme-dark) .card,body.skin-executive:not(.theme-dark) .command-card,body.skin-executive:not(.theme-dark) .kpi-command,body.skin-executive:not(.theme-dark) .metric-block,body.skin-executive:not(.theme-dark) .ops-panel,
body.skin-bento:not(.theme-dark) .dash-toolbar,body.skin-bento:not(.theme-dark) .card,body.skin-bento:not(.theme-dark) .command-card,body.skin-bento:not(.theme-dark) .metric-block,body.skin-bento:not(.theme-dark) .ops-panel{background:var(--qs-card-light)!important}
body.skin-pixel.theme-dark .dash-toolbar,body.skin-pixel.theme-dark .card,body.skin-pixel.theme-dark .command-card,body.skin-pixel.theme-dark .metric-block,body.skin-pixel.theme-dark .ops-panel,
body.skin-apple.theme-dark .dash-toolbar,body.skin-apple.theme-dark .card,body.skin-apple.theme-dark .command-card,body.skin-apple.theme-dark .metric-block,body.skin-apple.theme-dark .ops-panel,
body.skin-aurora.theme-dark .dash-toolbar,body.skin-aurora.theme-dark .card,body.skin-aurora.theme-dark .command-card,body.skin-aurora.theme-dark .metric-block,body.skin-aurora.theme-dark .ops-panel,
body.skin-executive.theme-dark .dash-toolbar,body.skin-executive.theme-dark .card,body.skin-executive.theme-dark .command-card,body.skin-executive.theme-dark .metric-block,body.skin-executive.theme-dark .ops-panel,
body.skin-bento.theme-dark .dash-toolbar,body.skin-bento.theme-dark .card,body.skin-bento.theme-dark .command-card,body.skin-bento.theme-dark .metric-block,body.skin-bento.theme-dark .ops-panel{background:var(--qs-card-dark)!important}

body.skin-pixel .nav-item.active,body.skin-apple .nav-item.active,body.skin-aurora .nav-item.active,body.skin-executive .nav-item.active,body.skin-bento .nav-item.active{background:color-mix(in srgb,var(--theme-accent) 19%,transparent)!important;color:var(--theme-accent)!important}
body.skin-pixel .nav-item:hover,body.skin-apple .nav-item:hover,body.skin-aurora .nav-item:hover,body.skin-executive .nav-item:hover,body.skin-bento .nav-item:hover{background:color-mix(in srgb,var(--theme-accent) 10%,transparent)!important}
body.skin-pixel:not(.theme-dark) .side-user,body.skin-pixel:not(.theme-dark) .icon-btn,body.skin-pixel:not(.theme-dark) .top-clock,body.skin-pixel:not(.theme-dark) .btn-ghost,body.skin-pixel:not(.theme-dark) input,body.skin-pixel:not(.theme-dark) select,body.skin-pixel:not(.theme-dark) textarea,
body.skin-apple:not(.theme-dark) .side-user,body.skin-apple:not(.theme-dark) .icon-btn,body.skin-apple:not(.theme-dark) .top-clock,body.skin-apple:not(.theme-dark) .btn-ghost,body.skin-apple:not(.theme-dark) input,body.skin-apple:not(.theme-dark) select,body.skin-apple:not(.theme-dark) textarea,
body.skin-aurora:not(.theme-dark) .side-user,body.skin-aurora:not(.theme-dark) .icon-btn,body.skin-aurora:not(.theme-dark) .top-clock,body.skin-aurora:not(.theme-dark) .btn-ghost,body.skin-aurora:not(.theme-dark) input,body.skin-aurora:not(.theme-dark) select,body.skin-aurora:not(.theme-dark) textarea,
body.skin-executive:not(.theme-dark) .side-user,body.skin-executive:not(.theme-dark) .icon-btn,body.skin-executive:not(.theme-dark) .top-clock,body.skin-executive:not(.theme-dark) .btn-ghost,body.skin-executive:not(.theme-dark) input,body.skin-executive:not(.theme-dark) select,body.skin-executive:not(.theme-dark) textarea,
body.skin-bento:not(.theme-dark) .side-user,body.skin-bento:not(.theme-dark) .icon-btn,body.skin-bento:not(.theme-dark) .top-clock,body.skin-bento:not(.theme-dark) .btn-ghost,body.skin-bento:not(.theme-dark) input,body.skin-bento:not(.theme-dark) select,body.skin-bento:not(.theme-dark) textarea{background:var(--qs-input-light)!important}
body.theme-dark.skin-pixel .side-user,body.theme-dark.skin-pixel .icon-btn,body.theme-dark.skin-pixel .top-clock,body.theme-dark.skin-pixel .btn-ghost,body.theme-dark.skin-pixel input,body.theme-dark.skin-pixel select,body.theme-dark.skin-pixel textarea,
body.theme-dark.skin-apple .side-user,body.theme-dark.skin-apple .icon-btn,body.theme-dark.skin-apple .top-clock,body.theme-dark.skin-apple .btn-ghost,body.theme-dark.skin-apple input,body.theme-dark.skin-apple select,body.theme-dark.skin-apple textarea,
body.theme-dark.skin-aurora .side-user,body.theme-dark.skin-aurora .icon-btn,body.theme-dark.skin-aurora .top-clock,body.theme-dark.skin-aurora .btn-ghost,body.theme-dark.skin-aurora input,body.theme-dark.skin-aurora select,body.theme-dark.skin-aurora textarea,
body.theme-dark.skin-executive .side-user,body.theme-dark.skin-executive .icon-btn,body.theme-dark.skin-executive .top-clock,body.theme-dark.skin-executive .btn-ghost,body.theme-dark.skin-executive input,body.theme-dark.skin-executive select,body.theme-dark.skin-executive textarea,
body.theme-dark.skin-bento .side-user,body.theme-dark.skin-bento .icon-btn,body.theme-dark.skin-bento .top-clock,body.theme-dark.skin-bento .btn-ghost,body.theme-dark.skin-bento input,body.theme-dark.skin-bento select,body.theme-dark.skin-bento textarea{background:var(--qs-input-dark)!important}
body:not(.theme-dark) .ai-search-inner{background:var(--qs-search-light)!important}
body.theme-dark .ai-search-inner{background:var(--qs-search-dark)!important}
body.skin-pixel .ai-search-go,body.skin-apple .ai-search-go,body.skin-aurora .ai-search-go,body.skin-executive .ai-search-go,body.skin-bento .ai-search-go,
body.skin-pixel .btn-primary,body.skin-apple .btn-primary,body.skin-aurora .btn-primary,body.skin-executive .btn-primary,body.skin-bento .btn-primary{background:var(--theme-accent)!important;border-color:var(--theme-accent)!important}
body.skin-pixel .theme-dashboard-pill,body.skin-apple .theme-dashboard-pill,body.skin-aurora .theme-dashboard-pill,body.skin-executive .theme-dashboard-pill,body.skin-bento .theme-dashboard-pill{background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important}
body.skin-pixel .ios-cal-grid .today,body.skin-apple .ios-cal-grid .today,body.skin-aurora .ios-cal-grid .today,body.skin-executive .ios-cal-grid .today,body.skin-bento .ios-cal-grid .today{background:var(--theme-accent)!important}
body.skin-pixel .ios-clock-widget,body.skin-apple .ios-clock-widget,body.skin-aurora .ios-clock-widget,body.skin-executive .ios-clock-widget,body.skin-bento .ios-clock-widget{background:var(--qs-clock-bg)!important;color:#fff!important}
body.skin-pixel .weather-widget.day,body.skin-apple .weather-widget.day,body.skin-aurora .weather-widget.day,body.skin-executive .weather-widget.day,body.skin-bento .weather-widget.day{background:var(--qs-weather-day-bg)!important;color:#fff!important}
body.skin-pixel .weather-widget.night,body.skin-apple .weather-widget.night,body.skin-aurora .weather-widget.night,body.skin-executive .weather-widget.night,body.skin-bento .weather-widget.night{background:var(--qs-weather-night-bg)!important;color:#fff!important}
body.skin-pixel .agenda-widget,body.skin-apple .agenda-widget,body.skin-aurora .agenda-widget,body.skin-executive .agenda-widget,body.skin-bento .agenda-widget{background:var(--qs-agenda-bg)!important;color:#fff!important}
body.skin-pixel:not(.theme-dark) .kpi-command:nth-child(3n+1),body.skin-apple:not(.theme-dark) .kpi-command:nth-child(3n+1),body.skin-aurora:not(.theme-dark) .kpi-command:nth-child(3n+1),body.skin-executive:not(.theme-dark) .kpi-command:nth-child(3n+1),body.skin-bento:not(.theme-dark) .kpi-command:nth-child(3n+1){background:var(--qs-tile-1)!important}
body.skin-pixel:not(.theme-dark) .kpi-command:nth-child(3n+2),body.skin-apple:not(.theme-dark) .kpi-command:nth-child(3n+2),body.skin-aurora:not(.theme-dark) .kpi-command:nth-child(3n+2),body.skin-executive:not(.theme-dark) .kpi-command:nth-child(3n+2),body.skin-bento:not(.theme-dark) .kpi-command:nth-child(3n+2){background:var(--qs-tile-2)!important}
body.skin-pixel:not(.theme-dark) .kpi-command:nth-child(3n),body.skin-apple:not(.theme-dark) .kpi-command:nth-child(3n),body.skin-aurora:not(.theme-dark) .kpi-command:nth-child(3n),body.skin-executive:not(.theme-dark) .kpi-command:nth-child(3n),body.skin-bento:not(.theme-dark) .kpi-command:nth-child(3n){background:var(--qs-tile-3)!important}
/* Night mode keeps the same tile rhythm, but the accents are mixed INTO the dark card
   surface instead of into white — otherwise the pastel wash stays light while the text
   turns light too, and every number on the dashboard reads as washed out. */
body.theme-dark .kpi-command:nth-child(3n+1){background:color-mix(in srgb,var(--theme-accent) 15%,var(--card))!important}
body.theme-dark .kpi-command:nth-child(3n+2){background:color-mix(in srgb,var(--theme-accent-2) 13%,var(--card))!important}
body.theme-dark .kpi-command:nth-child(3n){background:color-mix(in srgb,var(--theme-accent-4) 11%,var(--card))!important}
body.theme-dark .kpi-command{border-color:color-mix(in srgb,var(--theme-accent) 26%,transparent)!important}
body.theme-dark .kpi-command-value{color:var(--ink)!important}
body.theme-dark .kpi-command-label,body.theme-dark .kpi-command-sub{color:var(--ink-2)!important}
/* The decorative corner disc and the icon chip are fixed pale tints from the light
   design — at night they burn a bright wedge into every tile, so both are folded
   back into the card surface and keep only a hint of their colour. */
body.theme-dark .kpi-command::after{opacity:.16}
body.theme-dark .kpi-command-icon{background:color-mix(in srgb,var(--kpi-tint,var(--theme-accent)) 20%,var(--card))!important}

/* ---------- Night-mode legibility pass ----------
   Every status colour in the app was chosen against a white page. On a dark card the
   same green, orange, red and violet land near 2:1 against their own pill, which is
   why figures, chips and badges read as washed out at night. Night mode therefore
   gets brighter TEXT tones for those states, while the handful of places that use
   the same colours as a filled background under white text keep the original,
   deeper shade. Day mode is untouched. */
body.theme-dark{--green:#4ADE80;--orange:#FB923C;--red:#FF7B7B;--purple:#B49BFF;--teal:#2DD4BF}
body.theme-dark .btn-green,body.theme-dark .tl-item.done .tl-dot,body.theme-dark .toast .ti{background:#16A66A;border-color:#16A66A}
body.theme-dark .btn-danger,body.theme-dark .tl-item.rejected .tl-dot,body.theme-dark .toast.err .ti{background:#E5484D;border-color:#E5484D}
/* Chips carry their light-mode ink baked in as a hex, so the token change cannot reach them. */
body.theme-dark .chip.green{color:#5BE49B}
body.theme-dark .chip.orange{color:#FDBA74}
body.theme-dark .chip.red{color:#FCA5A5}
body.theme-dark .chip.gray{color:#D0D5DD}
body.theme-dark th,body.theme-dark .crisp-table thead th{color:#C3CDDB}
body.theme-dark .command-link,body.theme-dark .inv-link{color:var(--blue-700)}
body.theme-dark .kpi-command-trend{color:var(--ink-2)}
/* Bento is the exception: it keeps its bright fixed blocks at night by design, so its
   tiles need dark ink on top of them rather than the light ink the rest of night mode uses. */
body.skin-bento.theme-dark .kpi-command-value{color:#111!important}
body.skin-bento.theme-dark .kpi-command-label,body.skin-bento.theme-dark .kpi-command-sub{color:#333!important}
body.skin-bento.theme-dark .kpi-command::after{opacity:1}
body.skin-bento.theme-dark .kpi-command-icon{background:#FFFDF8!important}
body.skin-pixel th,body.skin-apple th,body.skin-aurora th,body.skin-executive th,body.skin-bento th{background:color-mix(in srgb,var(--theme-accent) 12%,var(--card))!important}

/* Pixel palettes deliberately use Material tonal surfaces everywhere. */
body.skin-pixel .sidebar{color:var(--ink)!important}
body.skin-pixel .logo-name,body.skin-pixel .side-user .nm{color:var(--ink)!important}
body.skin-pixel .logo-sub,body.skin-pixel .side-user .rl{color:var(--muted)!important}
body.skin-pixel .card,body.skin-pixel .command-card,body.skin-pixel .kpi-command,body.skin-pixel .dash-toolbar{border-color:color-mix(in srgb,var(--theme-accent) 16%,transparent)!important}

/* Apple palette remains translucent but receives the selected system colour. */
body.skin-apple .topbar,body.skin-apple .dash-toolbar,body.skin-apple .card,body.skin-apple .command-card{backdrop-filter:blur(24px) saturate(155%);-webkit-backdrop-filter:blur(24px) saturate(155%)}
body.skin-apple .sidebar{border-color:color-mix(in srgb,var(--theme-accent) 14%,transparent)!important}

/* Aurora keeps its dark intelligence look while palette drives all signals. */
body.skin-aurora .command-card,body.skin-aurora .dash-toolbar,body.skin-aurora .kpi-command{border-color:color-mix(in srgb,var(--theme-accent) 28%,transparent)!important;box-shadow:0 20px 50px color-mix(in srgb,var(--theme-accent) 8%,transparent)!important}

/* Bento blocks use the selected four swatches instead of fixed colours. */
body.skin-bento .kpi-command:nth-child(4n+1),body.skin-bento .qs-action-grid button:nth-child(4n+1){background:var(--theme-accent)!important}
body.skin-bento .kpi-command:nth-child(4n+2),body.skin-bento .qs-action-grid button:nth-child(4n+2){background:var(--theme-accent-2)!important}
body.skin-bento .kpi-command:nth-child(4n+3),body.skin-bento .qs-action-grid button:nth-child(4n+3){background:var(--theme-accent-3)!important}
body.skin-bento .kpi-command:nth-child(4n),body.skin-bento .qs-action-grid button:nth-child(4n){background:var(--theme-accent-4)!important}

@media print{
  .widget-tools,.widget-placeholder,.palette-studio-group{display:none!important}
  .dash-widget{animation:none!important;transform:none!important}
}
