/* ─────────────────────────────────────────────────────────────────────────
   Veriax — LIGHT theme.
   Layered on top of styles.css / agent-edit.css / agent-model.css. Only the
   palette changes: we re-declare the CSS custom properties under
   `html[data-theme="light"]`, then patch the few places that hardcode a dark
   colour (avatar tiles, inactive surfaces, toggles, scrollbar, JSON tokens).
   Same blue-black Veriax hue family, flipped to a clean cool-white surface set.
   Accent stays Veriax blue (#4e7cff). No structural/JS changes.
   ───────────────────────────────────────────────────────────────────────── */

html[data-theme="light"] {
  /* Reticolato di sfondo (chiaro + tenue): tenue, appena percettibile —
     su fondo chiaro l'85% risultava troppo marcato. */
  --grid-line:     color-mix(in oklab, var(--border-strong) 30%, transparent);
  /* Surfaces — cool near-whites, stepping DOWN in lightness as they recede.
     bg-app (page) is a soft grey so white cards/panels lift off it. */
  --bg-app:        #eceef3;
  --bg-sidebar:    #f9fafc;
  --bg-content:    #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f3f4f9;
  --bg-elev:       #eef0f5;
  --bg-overlay:    rgba(26, 28, 44, 0.40);

  --border-faint:  #e9eaf1;
  --border:        #dcdfe9;
  --border-strong: #c5c8d6;
  --border-focus:  #4e7cff;

  --text:          #2b2d39;
  --text-strong:   #12131b;
  --text-muted:    #686b7b;
  --text-faint:    #9a9dac;
  --text-link:     #3a63e0;

  --accent:        #4e7cff;
  --accent-2:      #3a63e0;
  --accent-soft:   rgba(78, 124, 255, 0.10);
  --accent-ring:   rgba(78, 124, 255, 0.30);

  --folder:        #5570c2;
  --folder-soft:   rgba(85, 112, 194, 0.12);

  --success:       #1a9d63;
  --warn:          #b9812a;
  --danger:        #d6453f;

  /* Palette CATEGORIALE grafici — variante per fondo chiaro (un filo più profonda). */
  --cat-1:  #3f6dff; --cat-2:  #7a55e0; --cat-3:  #199e8d; --cat-4:  #c4881f; --cat-5:  #1a9d63;
  --cat-6:  #d94f7c; --cat-7:  #1f9fd6; --cat-8:  #515ad6; --cat-9:  #7fa023; --cat-10: #cf6336;

  --shadow-sm: 0 1px 2px rgba(24, 26, 44, .07);
  --shadow:    0 8px 28px rgba(24, 26, 44, .12);
  --shadow-lg: 0 24px 64px rgba(24, 26, 44, .20);
}

/* ── Patched hardcoded colours ─────────────────────────────────────────────
   These selectors bake in dark hex values in the base sheets; re-point them
   to light equivalents so nothing reads as a dark island on the light UI. */

/* Marchio Veriax nel rail — la stella usa currentColor: navy di brand su light
   (i punti restano #006EAC, fissati nell'SVG). */
html[data-theme="light"] .rail-logo,
html[data-theme="light"] .side-brand,
html[data-theme="light"] .sg-logo-mark { color: #003D61; }

/* Avatar / initial tiles (cards, table, list) */
html[data-theme="light"] .card-thumb,
html[data-theme="light"] .agent-mini,
html[data-theme="light"] .list-name .agent-mini { background: #e8eaf2; }

/* Inactive object surfaces — slightly darker than the white card */
html[data-theme="light"] .card.inactive,
html[data-theme="light"] .list-view.flat-objects .list-row.inactive,
html[data-theme="light"] .conn-card:not(.active),
html[data-theme="light"] .conn-row:not(.active) { background: #f0f1f5; }
html[data-theme="light"] .card.inactive:hover,
html[data-theme="light"] .list-view.flat-objects .list-row.inactive:hover,
html[data-theme="light"] .conn-card:not(.active):hover,
html[data-theme="light"] .conn-row:not(.active):hover { background: #e9eaf1; }

/* Off toggle track */
html[data-theme="light"] .card-toggle.off { background: #ccced9; }

/* Scrollbar thumb hover */
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #b2b5c2; }

/* JSON editor syntax tokens — deepen for contrast on white */
html[data-theme="light"] .tk-key  { color: #2f6df0; }
html[data-theme="light"] .tk-str  { color: #1a8a4f; }
html[data-theme="light"] .tk-num  { color: #b9812a; }
html[data-theme="light"] .tk-bool,
html[data-theme="light"] .tk-null { color: #8b3fd6; }

/* Side panels / drawer shadows were tuned for black bg — soften on light */
html[data-theme="light"] .conn-drawer { box-shadow: -16px 0 40px rgba(24, 26, 44, .14); }

/* Subtle top-light gradient on panel/card headers reads as a faint dark wash
   on a white surface — neutralise it so headers stay flat white. */
html[data-theme="light"] .cap-panel-head,
html[data-theme="light"] .idn-card-head { background: transparent; }
html[data-theme="light"] .cap-panel-head:hover { background: var(--bg-card-hover); }
