/* --- 1. TOKEN DEFINITIONS --- */
:root {
  --primary: #0B57D0; --on-primary: #FFFFFF; --primary-container: #D3E3FD; --on-primary-container: #041E49;
  --secondary: #00639B; --on-secondary: #FFFFFF; --secondary-container: #C2E7FF;
  --tertiary: #146C2E; --on-tertiary: #FFFFFF; --tertiary-container: #C4EED0; --on-tertiary-container: #0F5223;

  --surface: #FFFFFF; --surface-container: #F0F4F9; --surface-container-high: #E9EBF0;
  --surface-container-lowest: var(--surface); --surface-container-low: var(--surface-container); --surface-container-highest: #dee1e3;
  --on-surface-default: #1B1C1D; --on-surface-de-emphasis: #444746; --on-surface-primary: #0B57D0;
  --on-primary-hover: #FFFFFF;
  --primary-hover: #0A45B4; --highlight: #D3E3FD;

  --outline: #747775; --outline-variant: #C4C7C5;
  --stroke-default: #DCDFE5; --stroke-emphasis: #80858C;

  --error: #B3261E; --on-error: #FFFFFF;
  --success: #146C2E; --on-success: #FFFFFF;
  --warning: #F9AB00; --on-warning: #FFFFFF;
  --positive: #146C2E; --positive-surface: #C4EED0; --negative: #B3261E; --negative-surface: #FFCDD2;

  --chart-1: #1558D6; --chart-2: #046E00; --chart-3: #EAA937; --chart-4: #C0151D; --chart-5: #681DA8; --chart-6: #D85900;

  --anno-red: #FE8983; --anno-orange: #FF8D41; --anno-yellow: #FCBE00; --anno-green: #44C265;
  --anno-cyan: #06BBDF; --anno-blue: #76ACFF; --anno-purple: #C598FF; --anno-pink: #FF7DD2;

  --glass-surface: rgba(255, 255, 255, 0.65);
  --ff-sans: "Google Sans", "Roboto", sans-serif;
  --ff-mono: "Google Code", "SF Mono", "Roboto Mono", monospace;
  --ff-latex: "Times New Roman", serif;
  --fs-100: 0.75rem; --fs-200: 0.875rem; --fs-300: 1rem; --fs-400: 1.125rem; --fs-500: 1.25rem; --fs-600: 1.5rem;
  --fw-regular: 400; --fw-medium: 500; --fw-bold: 700;

  /* SPACING SYSTEM */
  --space-xxs: 0.125rem;
  --space-xs: 0.25rem;
  --space-s: 0.5rem;
  --space-m: 0.75rem;
  --space-l: 1rem;
  --space-xl: 1.25rem;
  --space-xxl: 1.5rem;
  --space-3xl: 1.75rem;

  /* CORNER RADIUS */
  --radius-xs: 4px;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* BORDER */
  --border-thin: 1px;
  --border-medium: 2px;
  --border-thick: 3px;

  /* SIZING SCALE */
  --s-0-5: 2px; --s-1: 4px; --s-1-5: 6px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-4-5: 18px;
  --s-5: 20px; --s-6: 24px; --s-6-5: 26px; --s-8: 32px; --s-9: 36px; --s-11: 44px; --s-12: 48px;
  --s-14: 56px; --s-24: 96px; --s-30: 120px; --s-35: 140px; --s-40: 180px; --s-50: 200px;
  --s-60: 240px; --s-62: 250px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #A8C7FA; --on-primary: #062E6F; --primary-container: #1F3760; --on-primary-container: #D3E3FD;
    --secondary: #7FCFFF; --on-secondary: #003355; --secondary-container: #004A77;
    --tertiary: #6DD58C; --on-tertiary: #0A3818; --tertiary-container: #0F5223; --on-tertiary-container: #C4EED0;

    --surface: #101218; --surface-container: #282A2C; --surface-container-high: #2A2B36;
    --surface-container-lowest: var(--surface); --surface-container-low: var(--surface-container); --surface-container-highest: #3a3f50;
    --on-surface-default: #FFFFFF; --on-surface-de-emphasis: #C4C7C5; --on-surface-primary: #A8C7FA;
    --primary-hover: #75ABFB; --highlight: #223A94;

    --outline: #9A9B9C; --outline-variant: #4A5050;
    --stroke-default: #2D2F38; --stroke-emphasis: #ADAFB8;

    --error: #F2B8B5; --on-error: #601410;
    --success: #6DD58C; --on-success: #0A3818;
    --warning: #FCBD00; --on-warning: #3F2F00;
    --positive: #6DD58C; --positive-surface: #1F3025; --negative: #F2B8B5; --negative-surface: #381A21;

    --chart-1: #5292F9; --chart-2: #90E58C; --chart-3: #F5B84F; --chart-4: #FF878F; --chart-5: #A56EFF; --chart-6: #FFB787;
    --glass-surface: rgba(30, 35, 45, 0.65);
  }
}

:root[data-theme="dark"] {
    --primary: #A8C7FA; --on-primary: #062E6F; --primary-container: #1F3760; --on-primary-container: #D3E3FD;
    --secondary: #7FCFFF; --on-secondary: #003355; --secondary-container: #004A77;
    --tertiary: #6DD58C; --on-tertiary: #0A3818; --tertiary-container: #0F5223; --on-tertiary-container: #C4EED0;

    --surface: #101218; --surface-container: #282A2C; --surface-container-high: #2A2B36;
    --surface-container-lowest: var(--surface); --surface-container-low: var(--surface-container); --surface-container-highest: #3a3f50;
    --on-surface-default: #FFFFFF; --on-surface-de-emphasis: #C4C7C5; --on-surface-primary: #A8C7FA;
    --primary-hover: #75ABFB; --highlight: #223A94;

    --outline: #9A9B9C; --outline-variant: #4A5050;
    --stroke-default: #2D2F38; --stroke-emphasis: #ADAFB8;

    --error: #F2B8B5; --on-error: #601410;
    --success: #6DD58C; --on-success: #0A3818;
    --warning: #FCBD00; --on-warning: #3F2F00;
    --positive: #6DD58C; --positive-surface: #1F3025; --negative: #F2B8B5; --negative-surface: #381A21;

    --chart-1: #5292F9; --chart-2: #90E58C; --chart-3: #F5B84F; --chart-4: #FF878F; --chart-5: #A56EFF; --chart-6: #FFB787;
    --glass-surface: rgba(30, 35, 45, 0.65);
}

/* --- 2. RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
html, body { height: 100%; overflow: hidden; font-family: var(--ff-sans); font-size: var(--fs-300); line-height: 1.5; background-color: var(--surface-container); color: var(--on-surface-default); padding: var(--space-s); box-sizing: border-box; border-radius: var(--radius-xl); }
h1, h2, h3 { font-weight: var(--fw-medium); line-height: 1.25; }
h1 { font-size: var(--fs-600); } h2 { font-size: var(--fs-500); } h3 { font-size: var(--fs-400); }

/* CANVAS & SVG STANDARDIZATION */
.viz-container figure { margin: 0; display: flex; flex-direction: column; height: 100%; width: 100%; }
.viz-container svg { overflow: visible !important; font-family: var(--ff-sans) !important; }
.viz-container svg text { 
    fill: var(--on-surface-default) !important; 
    font-size: 11px !important; 
    font-family: var(--ff-sans) !important;
    font-variant-numeric: tabular-nums; 
}
.viz-container svg text[aria-label="tip"] { font-weight: var(--fw-bold); }
.viz-container svg path.domain { stroke: var(--outline) !important; stroke-width: var(--border-thin); }
.viz-container svg .tick line { stroke: var(--outline-variant) !important; }
.viz-container svg .grid line { stroke: var(--surface-container-highest) !important; stroke-opacity: 0.5; }
.plot-swatches { 
    font-family: var(--ff-sans) !important; 
    font-size: var(--fs-100) !important; 
    margin-bottom: var(--space-s) !important; 
    color: var(--on-surface-de-emphasis) !important; 
    display: flex; flex-wrap: wrap; gap: var(--space-s);
}

/* --- 3. LAYOUT HELPERS --- */
.widget-container { background: var(--surface-container); height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-xl); }
.viz-container { 
  position: relative; 
  overflow: hidden; 
  flex: 1 1 0;
  min-height: var(--s-50);
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-m); 
}
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-row { display: flex; flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; } .items-baseline { align-items: baseline; }
.gap-s { gap: var(--space-s); } .gap-m { gap: var(--space-m); } .gap-xs { gap: var(--space-xs); } .gap-xxs { gap: var(--space-xxs); }
.p-s { padding: var(--space-s); } .p-m { padding: var(--space-m); } .px-m { padding-left: var(--space-m); padding-right: var(--space-m); } .py-s { padding-top: var(--space-s); padding-bottom: var(--space-s); }
.m-m { margin: var(--space-m); } .mt-m { margin-top: var(--space-m); }
.border-t { border-top: var(--border-thin) solid var(--stroke-default); } .rounded-md { border-radius: var(--radius-s); }
.bg-surface { background-color: var(--surface); } .bg-surface-container { background-color: var(--surface-container); }
.relative { position: relative; } .w-full, .w-100 { width: 100%; } .w-min-content { min-width: min-content; } .h-full, .h-100 { height: 100%; }
.hidden { display: none !important; }

.widget-ui-part {
  padding: var(--space-m) var(--space-s);
  gap: var(--s-1) var(--space-m);
}

/* --- SHELL UPDATE: Stable Header Layout --- */
.widget-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-m) var(--space-m) var(--space-s);
    background: var(--surface-container);
    flex-shrink: 0;
    border-bottom: var(--border-thin) solid transparent; 
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: var(--space-m);
    min-height: 44px;
}
.widget-title {
    font-size: var(--fs-600);
    font-weight: var(--fw-medium);
    line-height: 1.25;
    color: var(--on-surface-default);
    margin: 0;
    white-space: nowrap;
}
.header-status {
    color: var(--on-surface-de-emphasis);
    font-size: var(--fs-200);
    font-weight: var(--fw-medium);
    line-height: 1.4;
    width: 100%;
    min-height: 0;
    transition: opacity 0.2s;
}
.widget-dashboard {
    margin-left: auto;
}

@media (max-width: 500px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-s);
    }
    .widget-dashboard {
        margin-left: 0;
        width: 100%;
    }
    .viz-container {
        min-height: var(--s-50);
    }
}

/* --- XXS WIDGET SYSTEM --- */
:root { 
     --xxs-h: var(--s-8);
     --xxs-radius-pill: var(--radius-full); 
    --xxs-radius-active: var(--s-1-5);
 }

/* 1. Layout Engine */
.control-grid {
    display: flex !important; flex-wrap: wrap; 
    column-gap: var(--space-s);
    row-gap: var(--space-s);
    align-content: flex-start; padding: var(--space-m) var(--space-m); width: 100%;
    max-height: 40vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface-container);
    border-radius: 0 0 var(--radius-l) var(--radius-l);
    border: none;
    z-index: 10;
}
.widget-contained .control-grid {
  border-top: var(--border-thin) solid var(--outline);
  padding: var(--space-m);
}
.control-grid::-webkit-scrollbar { width: var(--s-1-5); }
.control-grid::-webkit-scrollbar-track { background: transparent; }
.control-grid::-webkit-scrollbar-thumb { 
    background-color: var(--outline); 
    border-radius: var(--radius-xs); 
}
.control-grid::-webkit-scrollbar-thumb:hover { background-color: var(--on-surface-de-emphasis); }

.xxs-row { display: grid; align-items: center; gap: var(--space-s); min-width: 0; }
.xxs-row.full { flex: 1 1 100%; }
.xxs-row.compact { flex: 1 1 45%; min-width: var(--s-35); }
.xxs-row.segmented { min-width: var(--s-60); }
.xxs-row.standard { 
    min-width: var(--s-62);
    grid-template-columns: var(--s-40) 1fr var(--s-14);
}
.xxs-row.compact.input { grid-template-columns: var(--s-30) 1fr; }
.xxs-row.input.input-text,
.xxs-row.input.input-date,
.xxs-row.input.select {
  min-width: var(--s-60);
}
.xxs-row.compact.toggle { grid-template-columns: var(--s-30) 1fr; }

@media (max-width: 600px) {
  .xxs-row.standard { grid-template-columns: var(--s-35) 1fr var(--s-14); }
  .xxs-row.compact.input { grid-template-columns: var(--s-24) 1fr; }
  .xxs-row.compact.toggle { grid-template-columns: var(--s-24) 1fr; }
}

.xxs-row.header { flex: 1 1 100%; padding-top: var(--space-m); grid-template-columns: 1fr; border-top: var(--border-thin) solid var(--outline); }
.xxs-row.header:first-child { border-top: none; padding-top: 0; }

.xxs-label { 
    color: var(--on-surface-default);
    font-size: var(--fs-200);
    font-weight: var(--fw-medium);
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: clip;
    mask-image: linear-gradient(to right, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
}

.xxs-actions {
    flex: 1 1 100%;
    display: flex; gap: var(--space-xs); margin-top: var(--space-s);
}
.xxs-actions .xxs-btn {
    flex: 1;
    height: var(--s-8);
    display: inline-flex; align-items: center; justify-content: center;
}

/* 2. Sliders & Pills */
.xxs-slider-wrap { width: 100%; height: var(--xxs-h); display: flex; align-items: center; position: relative; }
input[type=range].xxs-slider { -webkit-appearance: none; appearance: none; width: 100%; height: var(--s-11); background: transparent; margin: 0; cursor: pointer; outline: none; z-index: 2; position: relative;}
input[type=range].xxs-slider::-webkit-slider-runnable-track {
    width: 100%; height: var(--s-1-5); border-radius: 3px;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--progress, 0%), var(--outline) var(--progress, 0%), var(--outline) 100%);
    transition: background 0.1s;
}
input[type=range].xxs-slider::-webkit-slider-thumb {
    -webkit-appearance: none; height: 22px; width: var(--s-1-5);
    border-radius: var(--xxs-radius-pill); background: var(--primary); margin-top: -8px; 
    box-shadow: 0 0 0 2px var(--surface); transition: all 0.2s cubic-bezier(0.2, 1.2, 0.2, 1);
}
input[type=range].xxs-slider:active::-webkit-slider-thumb { width: var(--s-1); height: var(--s-6); margin-top: -9px; box-shadow: 0 0 0 3px var(--surface); }
input[type=range].xxs-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary); }

.xxs-val-pill {
    width: 100%; height: var(--s-9);
    border: var(--border-thin) solid var(--outline); 
    background: transparent;
    border-radius: var(--radius-m);
    font-variant-numeric: tabular-nums;
    padding: 0 var(--space-s);
    color: var(--on-surface-default); 
    outline: none; transition: 0.2s; 
    -moz-appearance: textfield;
    appearance: textfield;
}
.xxs-val-pill:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary); }
.xxs-val-pill::-webkit-outer-spin-button, .xxs-val-pill::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.xxs-val-pill[type=number] { appearance: textfield; }

/* TOGGLE SWITCHES */
.xxs-switch {
    width: var(--s-11); height: var(--s-6);
    margin-top: var(--s-1-5); margin-bottom: var(--s-1-5);
    background: var(--surface-container-high);
    border-radius: var(--radius-full);
    position: relative; cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: var(--border-thin) solid var(--outline);
    flex-shrink: 0;
}
.xxs-switch:hover { border-color: var(--on-surface-de-emphasis); }
.xxs-switch:focus-visible { outline: 0; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary); }
.xxs-switch .knob {
    width: var(--s-4-5); height: var(--s-4-5);
    background: var(--on-surface-de-emphasis);
    border-radius: 50%; position: absolute; top: var(--s-0-5); left: var(--s-0-5);
    transition: transform 0.25s cubic-bezier(0.3, 1.3, 0.3, 1), background 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.xxs-switch.active { background: var(--primary); border-color: var(--primary); }
.xxs-switch.active .knob { background: var(--on-primary); transform: translateX(var(--s-5)); }

/* 3. Inputs & Buttons */
.xxs-input, .xxs-select {
    height: var(--s-9); width: 100%; min-width: var(--s-14);
    border: var(--border-thin) solid transparent;
    background-color: var(--surface-container-high);
    border-radius: var(--radius-m); padding: 0 var(--space-xs);
    color: var(--on-surface-default); outline: none;
    transition: background-color 0.2s, border-color 0.2s;
}

@media (prefers-color-scheme: dark) { input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); } }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }

.xxs-select { 
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-color: var(--surface); border: var(--border-thin) solid var(--outline);
    border-radius: var(--radius-m); padding-left: var(--space-s); padding-right: var(--s-9);
    text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e"); 
    background-repeat: no-repeat; background-position: right var(--space-xs) center; background-size: var(--s-5); 
}
.xxs-input:focus, .xxs-select:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary); }
.xxs-section-title { color: var(--on-surface-de-emphasis); width: 100%; }

/* SEGMENTED CONTROLS */
.xxs-btn-group { display: flex; width: 100%; gap: var(--s-1); isolation: isolate; }
.xxs-btn-group .xxs-btn { 
    flex: 1; height: var(--s-9); background: transparent; color: var(--on-secondary-container);
    cursor: pointer; position: relative; border: var(--border-thin) solid transparent; 
    background: var(--surface-container-low); margin-left: -1px; border-radius: var(--radius-xs);
    transition: background 0.2s, color 0.2s, z-index 0s, border-color 0.2s;
    display: flex; align-items: center; justify-content: center; gap: var(--s-0-5); padding: 0 var(--space-xs); 
}
.xxs-btn-group .xxs-btn:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); margin-left: 0; }
.xxs-btn-group .xxs-btn:last-child { border-radius: 0 var(--radius-full) var(--radius-full) 0; }
.xxs-btn-group .xxs-btn:hover { background: var(--surface-container-high); z-index: 2; }
.xxs-btn-group .xxs-btn.selected { background: var(--highlight); color: var(--on-surface-primary); border-color: var(--primary); z-index: 3; font-weight: 600; }
.xxs-btn-group .xxs-btn:focus-visible { outline: none; border-color: var(--primary); z-index: 4; }

/* EXPRESSIVE MORPH BUTTONS */
.xxs-btn { 
    flex: 1; height: var(--s-9); background-color: var(--surface-container-highest); color: var(--on-secondary-container);
    cursor: pointer; border: none; border-radius: 9999px; transition: border-radius 0.3s cubic-bezier(0.2, 0, 0, 1), background 0.2s, color 0.2s, border-color 0.2s; 
}
.xxs-btn:hover { background: var(--surface-container-high); }
.xxs-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary); background-color: var(--surface-container-high); }
.xxs-btn.selected { background: var(--highlight); color: var(--primary); border-color: var(--primary); }
.xxs-btn:active { background-color: var(--surface-container-highest); }

input[type="color"].xxs-color { 
    padding: 0; height: var(--s-9); width: var(--s-12); cursor: pointer; background: none;
    border-radius: var(--radius-m); overflow: hidden; border: 5px solid var(--outline); transition: border-color 0.2s;
}
input[type="color"].xxs-color:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary); }
input[type="color"].xxs-color::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].xxs-color::-webkit-color-swatch { border: none; border-radius: 3px; }

/* 4. RESTORATION & POLISH */
.viz-badges { position: absolute; top: var(--space-s); left: var(--space-s); display: flex; gap: var(--space-xs); pointer-events: none; z-index: 10; }
.badge {
    background: rgb(from var(--surface-container-high) r g b / 66%);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(8px);
    color: var(--on-surface-de-emphasis); box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 6px 10px; border-radius: 20px; font-family: var(--ff-sans); font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0px;
    display: flex; align-items: center; gap: 6px; transform-origin: top left; animation: badgePop 0.4s cubic-bezier(0.2, 1.5, 0.5, 1) forwards;
}
@media (prefers-color-scheme: dark) { .badge { background: rgba(30, 35, 45, 0.8); border-color: rgba(255,255,255,0.1); } }
.badge .google-symbols { font-size: var(--fs-200); font-weight: bold; }
.viz-tag {
    position: absolute; left: 0; top: 0; padding: 5px 10px; border-radius: var(--radius-s);
    white-space: pre; pointer-events: none; color: var(--on-surface-default);
    background: rgb(from var(--glass-surface) r g b / 40%); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    border: none; box-shadow: 0 0 4px 1px rgb(from var(--on-surface-default) r g b / 20%);
    text-shadow: 0 0 5px rgb(from var(--surface) r g b / 90%); will-change: transform; transition: opacity 0.1s;
}
@keyframes badgePop { from { opacity: 0; transform: scale(0.9) translateY(-5px); } to { opacity: 1; transform: scale(1) translateY(0); } }

#app-status {
    position: static; font-family: inherit; font-size: var(--fs-300); font-weight: var(--fw-medium); line-height: 1.5;
    color: var(--on-surface-default); background: transparent; border: none; padding: 0;
    white-space: normal; overflow: visible; text-overflow: clip; width: 100%;
}
@media (max-width: 450px) { #app-status { min-height: 1.5em; } }

.viz-container { min-height: 400px; z-index: 0; border-radius: var(--radius-l); position: relative; background: var(--surface); }
@media (max-width: 500px) { .viz-container { min-height: var(--s-50); } }
.viz-container:after { content: ''; position: absolute; inset: 0; border: none; border-radius: var(--radius-l); pointer-events: none; }

.xxs-btn::after, .xxs-switch::after {
    content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    min-width: var(--s-11); min-height: var(--s-11); width: 100%; height: 100%; z-index: 1; cursor: pointer;
}

/* Dashboard Styling */
.widget-dashboard { display: inline-flex; align-items: center; gap: var(--space-m); margin-left: auto; width: auto; background: transparent; border: none; border-radius: var(--radius-s); padding: var(--space-xs) 0; height: 44px; }
.dash-pill { display: flex; flex-direction: column; justify-content: center; height: 100%; min-width: auto; }
.dash-label { color: var(--on-surface-de-emphasis); font-size: var(--fs-100); font-weight: var(--fw-medium); letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap; margin-bottom: 4px; }
.dash-value { color: var(--on-surface-default); font-family: var(--ff-mono); font-size: var(--fs-200); line-height: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: visible; text-overflow: clip; max-width: none; }

@media (max-width: 500px) {
    .widget-dashboard { display: flex; width: 100%; margin-top: 8px; height: auto; max-height: 120px; overflow-y: auto; padding: 0; flex-direction: column; align-items: stretch; background: transparent; border: none; gap: 0; }
    .widget-dashboard::-webkit-scrollbar { width: var(--s-1-5); }
    .widget-dashboard::-webkit-scrollbar-track { background: transparent; }
    .widget-dashboard::-webkit-scrollbar-thumb { background-color: var(--outline); border-radius: var(--radius-xs); }
    .dash-pill { flex-direction: row; justify-content: space-between; align-items: center; border-right: none; border-bottom: var(--border-thin) solid var(--outline); padding: 8px 0; height: auto; }
    .dash-pill:last-child { border-bottom: none; }
    .dash-label { margin-bottom: 0; }
    .dash-value { font-size: 14px; }
}

[data-style="contained"] .widget-container { border: var(--border-thin) solid var(--outline); border-radius: var(--radius-l); margin: var(--space-m); height: calc(100% - 2 * var(--space-m)); }
[data-style="contained"] .widget-header, [data-style="contained"] .control-grid { padding-left: var(--space-m); padding-right: var(--space-m); }
[data-style="contained"] .viz-container { border-radius: 0; }
[data-style="contained"] .viz-container:after { display: none; }
.widget-ui-part { border: none; border-radius: 0 0 var(--radius-l) var(--radius-l); }
.viz-container.widget-ui-part { border-radius: var(--radius-l); }