/* ============================================================
   365 PORTALE — Design System
   Brand 2026: nero + verde lime (365) · arancio (Maria sub-brand)
   Estratto da demo.html (reference). NON modificare a mano: rigenerare
   da demo.html oppure aggiornare entrambi in parallelo.
   ============================================================ */
/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg:        oklch(98.8% 0.003 250);
  --bg-soft:   oklch(97% 0.004 250);
  --surface:   oklch(100% 0 0);
  --ink:       oklch(22% 0.025 265);
  --ink-soft:  oklch(48% 0.015 265);
  --ink-mute:  oklch(62% 0.01 265);
  --line:      oklch(93% 0.005 265);
  --line-soft: oklch(96% 0.004 265);
  --hover:     oklch(95% 0.005 265);

  /* === 365 brand 2026: black + lime green === */
  --accent:    oklch(82% 0.22 134);    /* lime green (logo "6" + V) */
  --accent-ink:oklch(48% 0.18 134);    /* darker green for text on light */
  --accent-bg: oklch(96% 0.06 134);
  --accent-line:oklch(85% 0.12 134);
  --accent-on: oklch(22% 0.05 134);    /* black-ish for text on green button */

  /* === Maria sub-brand: keeps the orange "IA" highlight === */
  --maria:     oklch(68% 0.17 50);     /* #F07820 — used only in Maria contexts */
  --maria-ink: oklch(48% 0.16 50);
  --maria-bg:  oklch(96% 0.035 50);
  --maria-line:oklch(88% 0.06 50);

  --navy:      oklch(22% 0.04 265);    /* near-black, for shell */

  --success:   oklch(60% 0.14 155);
  --success-bg:oklch(96% 0.04 155);
  --info:      oklch(58% 0.14 250);
  --info-bg:   oklch(96% 0.03 250);
  --warn:      oklch(72% 0.15 75);
  --warn-bg:   oklch(96% 0.05 75);
  --danger:    oklch(58% 0.20 25);
  --danger-bg: oklch(96% 0.04 25);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-1: 0 1px 0 0 oklch(20% 0.02 265 / 0.04);
  --shadow-2: 0 1px 2px oklch(20% 0.02 265 / 0.04), 0 4px 8px oklch(20% 0.02 265 / 0.04);
  --shadow-3: 0 4px 6px oklch(20% 0.02 265 / 0.05), 0 12px 24px oklch(20% 0.02 265 / 0.08);

  --sb-w:      232px;
  --sb-w-collapsed: 56px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

@supports (font-variation-settings: normal) {
  :root { --font: 'InterVariable', sans-serif; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-feature-settings: 'cv11', 'ss03';
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  overflow: hidden;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  height: 100dvh;
  background: var(--bg);
}

/* SIDEBAR */
.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
}
.sb-brand-mark {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sb-brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sb-brand-text {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
}
.sb-brand-text .ia { color: var(--accent); }
.sb-brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0;
  margin-top: 1px;
}

.sb-client {
  margin: 0 12px 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: border-color .15s var(--ease);
}
.sb-client:hover { border-color: var(--line); background: var(--hover); }
.sb-client-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-client-info { flex: 1; min-width: 0; }
.sb-client-name { font-weight: 500; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-client-sub { font-size: 11px; color: var(--ink-mute); margin-top: 1px; }

.sb-section { padding: 6px 8px; }
.sb-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  padding: 8px 12px 4px;
}
.sb-maria-label {
  display: flex; align-items: center; gap: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.sb-maria-mark {
  width: 18px; height: 18px;
  object-fit: contain;
  opacity: 0.85;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
  position: relative;
}
.sb-item:hover { background: var(--hover); color: var(--ink); }
.sb-item.active {
  background: var(--accent-bg);
  color: var(--accent-ink);
}
.sb-item svg { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 1.75; }
.sb-item-count {
  margin-left: auto;
  font-size: 11px; color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.sb-item.active .sb-item-count { color: var(--accent-ink); opacity: 0.7; }
.sb-item .sb-maria-icon {
  width: 16px; height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}
.sb-item-maria { font-weight: 600; }

.sb-spacer { flex: 1; }

.sb-footer {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.sb-slot {
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.sb-slot-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-mute); margin-bottom: 4px;
}
.sb-slot-time {
  font-size: 13px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sb-quota {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px;
  font-size: 11px; color: var(--ink-mute);
}
.sb-quota-bar {
  flex: 1; height: 4px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
}
.sb-quota-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* MAIN */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: 52px;
  padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.topbar-title {
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.015em;
}
.topbar-crumb {
  color: var(--ink-mute);
  font-size: 13px;
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.persona-switch {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 4px 3px 10px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: 99px;
}
.persona-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  font-weight: 600;
}
.persona-btn {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all .12s var(--ease);
}
.persona-btn.active {
  background: var(--ink);
  color: white;
}

.kbd-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-mute);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .12s var(--ease);
}
.kbd-trigger:hover { border-color: var(--ink-mute); }
.kbd-trigger svg { width: 14px; height: 14px; stroke-width: 1.75; }
.kbd-key {
  display: inline-flex; align-items: center;
  padding: 1px 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.workspace {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: var(--bg);
}

/* ============================================================
   BUTTONS / INPUTS / GENERIC
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  transition: background .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; stroke-width: 1.75; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
}
.btn-primary:hover { background: oklch(76% 0.23 134); }
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-secondary:hover { background: var(--hover); border-color: var(--ink-mute); }
.btn-ghost {
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-danger {
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-bg); }
.btn-lg { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn-icon { width: 32px; padding: 0; justify-content: center; }

.input, .textarea, .select {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink);
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.textarea { resize: vertical; min-height: 80px; font-family: inherit; line-height: 1.5; }

.label {
  display: block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 6px;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px;
  border-radius: 99px;
  font-size: 11px; font-weight: 500;
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge-scheduled { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge-published { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge-draft     { background: var(--bg); color: var(--ink-mute); }
.badge-completed { background: oklch(95% 0.04 290); color: oklch(50% 0.18 290); border-color: transparent; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .12s var(--ease);
}
.chip:hover { border-color: var(--ink-mute); color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.chip svg { width: 13px; height: 13px; stroke-width: 1.75; }

.divider { height: 1px; background: var(--line); }

/* ============================================================
   PAGES
   ============================================================ */
.page { display: none; }
.page.active { display: block; }

.page-header {
  padding: 24px 32px 16px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-sub {
  font-size: 13px; color: var(--ink-soft);
  margin-top: 4px;
}
.page-body { padding: 0 32px 32px; }
.page-body-flush { padding: 0; }

/* ============================================================
   PAGE — CREA (compose editor)
   ============================================================ */
.crea-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  height: calc(100dvh - 52px);
}
.crea-editor {
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.crea-editor-head {
  padding: 24px 32px 16px;
}
.crea-mode {
  display: inline-flex; gap: 2px;
  padding: 3px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}
.crea-mode button {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  transition: all .15s var(--ease);
}
.crea-mode button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.crea-body {
  flex: 1; overflow-y: auto;
  padding: 0 32px 24px;
}
.crea-compose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}
.crea-compose textarea {
  width: 100%; border: none; outline: none;
  background: transparent;
  font-family: inherit; font-size: 15px; line-height: 1.6;
  color: var(--ink); resize: none;
  min-height: 120px;
}
.crea-compose textarea::placeholder { color: var(--ink-mute); }
.crea-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  margin-top: 12px;
}
.crea-toolbar-spacer { flex: 1; }
.crea-counter { font-size: 11px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }

.crea-ai-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.crea-ai-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  border: 1px solid var(--accent-line);
  border-radius: 99px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all .12s var(--ease);
}
.crea-ai-chip:hover { background: oklch(94% 0.05 55); }
.crea-ai-chip svg { width: 13px; height: 13px; }

.crea-section-title {
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.crea-section-title svg { width: 14px; height: 14px; stroke-width: 1.75; color: var(--ink-mute); }

.upload-zone {
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all .15s var(--ease);
  margin-bottom: 20px;
}
.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.upload-zone svg { width: 28px; height: 28px; color: var(--ink-mute); stroke-width: 1.5; margin: 0 auto 8px; display: block; }
.upload-zone-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.upload-zone-sub { font-size: 12px; color: var(--ink-mute); margin-top: 4px; }

.platform-toggles {
  display: flex; gap: 8px;
  margin-bottom: 20px;
}
.platform-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all .12s var(--ease);
}
.platform-toggle.on {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.platform-toggle svg { width: 14px; height: 14px; stroke-width: 1.75; }
.platform-toggle.off { opacity: 0.5; }

.crea-footer {
  padding: 12px 24px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.schedule-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.schedule-pill:hover { border-color: var(--ink-mute); }
.schedule-pill .dot { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }

/* PREVIEW PANEL */
.crea-preview {
  background: var(--bg-soft);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.preview-head {
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-soft);
}
.preview-tabs { display: flex; gap: 2px; }
.preview-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .12s var(--ease);
}
.preview-tab svg { width: 13px; height: 13px; stroke-width: 1.75; }
.preview-tab:hover { background: var(--hover); color: var(--ink); }
.preview-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.preview-stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
}

.ig-card {
  width: 100%; max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.ig-head {
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.ig-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(75% 0.18 55), oklch(60% 0.20 25), oklch(55% 0.20 320));
  padding: 2px;
}
.ig-avatar-inner {
  width: 100%; height: 100%;
  background: var(--surface);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11px; color: var(--ink);
}
.ig-handle { flex: 1; font-size: 13px; font-weight: 600; }
.ig-handle small { display: block; font-weight: 400; font-size: 11px; color: var(--ink-mute); }
.ig-image {
  width: 100%; aspect-ratio: 1;
  background:
    linear-gradient(135deg, oklch(85% 0.12 35) 0%, oklch(70% 0.14 25) 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 42px;
}
.ig-actions {
  padding: 10px 12px 4px;
  display: flex; gap: 14px;
  color: var(--ink);
}
.ig-actions svg { width: 22px; height: 22px; stroke-width: 1.5; }
.ig-actions .save { margin-left: auto; }
.ig-likes { padding: 0 12px; font-size: 13px; font-weight: 600; }
.ig-caption { padding: 4px 12px 12px; font-size: 13px; line-height: 1.45; }
.ig-caption b { font-weight: 600; }
.ig-caption .ht { color: oklch(45% 0.18 250); }
.ig-time { padding: 0 12px 10px; font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.04em; }

.preview-meta {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.preview-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
}
.preview-meta-row .k { color: var(--ink-mute); }
.preview-meta-row .v { color: var(--ink); font-weight: 500; }

/* ============================================================
   PAGE — PIANO (week view + drawer)
   ============================================================ */
.piano-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: calc(100dvh - 52px);
}
.piano-main {
  display: flex; flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.piano-toolbar {
  padding: 16px 24px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.piano-month {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.015em;
  min-width: 180px;
}
.piano-nav { display: flex; gap: 2px; margin-right: 8px; }
.piano-view-toggle {
  display: inline-flex; gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.piano-view-toggle button {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
}
.piano-view-toggle button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.piano-week {
  flex: 1;
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  grid-template-rows: 36px repeat(13, 1fr);
  overflow-y: auto;
  background: var(--surface);
}
.piano-week-head, .piano-week-time, .piano-week-cell {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.piano-week-head {
  padding: 8px;
  font-size: 11px; font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
}
.piano-week-head .day-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--ink);
}
.piano-week-head.today .day-num {
  background: var(--accent);
  color: white;
}
.piano-week-time {
  padding: 4px 8px;
  font-size: 10px; font-weight: 500;
  color: var(--ink-mute);
  background: var(--bg-soft);
  text-align: right;
  display: flex; align-items: flex-start; justify-content: flex-end;
}
.piano-week-cell {
  position: relative;
  min-height: 40px;
  transition: background .1s var(--ease);
  cursor: pointer;
}
.piano-week-cell:hover { background: var(--hover); }

.piano-event {
  position: absolute;
  left: 4px; right: 4px;
  background: var(--info-bg);
  border-left: 2px solid var(--info);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
  color: var(--info);
  cursor: grab;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.piano-event.evt-video {
  background: oklch(95% 0.04 290);
  border-left-color: oklch(55% 0.18 290);
  color: oklch(45% 0.18 290);
}
.piano-event.evt-flyer {
  background: var(--success-bg);
  border-left-color: var(--success);
  color: var(--success);
}
.piano-event .evt-time {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.7;
  margin-bottom: 1px;
  display: block;
}

/* DRAWER */
.piano-drawer {
  background: var(--bg-soft);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.drawer-day { font-size: 11px; font-weight: 600; color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.06em; }
.drawer-date { font-size: 18px; font-weight: 600; margin-top: 2px; }
.drawer-body { padding: 16px 20px; }

.drawer-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.drawer-item:hover { border-color: var(--ink-mute); box-shadow: var(--shadow-1); }
.drawer-item-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.drawer-item-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--info-bg);
  color: var(--info);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drawer-item-icon svg { width: 13px; height: 13px; stroke-width: 2; }
.drawer-item-icon.icon-video { background: oklch(95% 0.04 290); color: oklch(55% 0.18 290); }
.drawer-item-icon.icon-flyer { background: var(--success-bg); color: var(--success); }
.drawer-item-type { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.drawer-item-time { margin-left: auto; font-size: 11px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.drawer-item-title { font-size: 13px; line-height: 1.4; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   PAGE — CONTENUTI (grid + filters)
   ============================================================ */
.cont-filters {
  padding: 12px 32px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.cont-search {
  position: relative;
  width: 240px;
}
.cont-search input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
}
.cont-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--ink-mute); stroke-width: 1.75; }

.cont-grid {
  padding: 16px 32px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease), transform .15s var(--ease);
  display: flex; flex-direction: column;
}
.post-card:hover {
  border-color: var(--ink-mute);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.post-thumb {
  aspect-ratio: 1;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
}
.post-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, oklch(82% 0.14 var(--hue, 60)), oklch(68% 0.16 var(--hue, 40)));
}
.post-card.h1 .post-thumb::after { background: linear-gradient(135deg, oklch(82% 0.14 60), oklch(65% 0.18 40)); }
.post-card.h2 .post-thumb::after { background: linear-gradient(135deg, oklch(78% 0.14 180), oklch(60% 0.18 220)); }
.post-card.h3 .post-thumb::after { background: linear-gradient(135deg, oklch(80% 0.14 300), oklch(60% 0.18 280)); }
.post-card.h4 .post-thumb::after { background: linear-gradient(135deg, oklch(82% 0.14 140), oklch(60% 0.18 160)); }
.post-card.h5 .post-thumb::after { background: linear-gradient(135deg, oklch(80% 0.12 30), oklch(60% 0.18 15)); }
.post-card.h6 .post-thumb::after { background: linear-gradient(135deg, oklch(80% 0.14 250), oklch(60% 0.18 270)); }
.post-thumb-badge {
  position: absolute; top: 10px; left: 10px;
  z-index: 1;
}
.post-thumb-platforms {
  position: absolute; top: 10px; right: 10px;
  z-index: 1;
  display: flex; gap: 4px;
}
.post-thumb-platforms span {
  width: 22px; height: 22px;
  background: oklch(100% 0 0 / 0.9);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.post-thumb-platforms svg { width: 11px; height: 11px; stroke-width: 2; }

.post-body {
  padding: 12px;
  flex: 1;
  display: flex; flex-direction: column;
  gap: 8px;
}
.post-caption {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--ink-mute);
  margin-top: auto;
}
.post-meta svg { width: 12px; height: 12px; stroke-width: 1.75; }

/* ============================================================
   PAGE — MARIA PROFILO
   ============================================================ */
.maria-hero {
  padding: 24px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  background: linear-gradient(135deg, var(--maria-bg) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.maria-avatar {
  width: 72px; height: 72px;
  border-radius: 16px;
  background: var(--maria-bg);
  color: var(--maria-ink);
  font-weight: 600; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.maria-hero-info h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.maria-hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--maria-ink);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.maria-tag-logo { width: 18px; height: 18px; object-fit: contain; }
.maria-hero-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.maria-hero-meta span { display: inline-flex; align-items: center; gap: 4px; }
.maria-hero-meta svg { width: 14px; height: 14px; stroke-width: 1.75; }

.maria-stats {
  display: flex; gap: 20px;
}
.maria-stat {
  text-align: center;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.maria-stat-n {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.maria-stat-l {
  font-size: 11px; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-top: 2px;
}

.maria-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 24px 32px;
}
.maria-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.maria-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.maria-section h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.maria-section h3 small { display: block; font-size: 12px; color: var(--ink-mute); font-weight: 400; margin-top: 2px; letter-spacing: 0; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }

.toggle-group {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.toggle-pill {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .12s var(--ease);
}
.toggle-pill.on {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.maria-promo-list { display: flex; flex-direction: column; gap: 10px; }
.maria-promo {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.maria-promo-icon {
  width: 36px; height: 36px;
  background: var(--maria-bg);
  color: var(--maria-ink);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.maria-promo-icon svg { width: 16px; height: 16px; }
.maria-promo-body { flex: 1; min-width: 0; }
.maria-promo-title { font-size: 13px; font-weight: 600; }
.maria-promo-sub { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
.cmdk-overlay {
  display: none;
  position: fixed; inset: 0;
  background: oklch(20% 0.02 265 / 0.4);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  animation: fadeIn .15s var(--ease);
}
.cmdk-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.cmdk {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: slideDown .2s var(--ease);
}
@keyframes slideDown { from { transform: translateY(-12px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.cmdk-input {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  outline: none;
}
.cmdk-results { padding: 6px; max-height: 360px; overflow-y: auto; }
.cmdk-section-label {
  padding: 8px 12px 4px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-mute);
}
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.cmdk-item:hover, .cmdk-item.active { background: var(--hover); }
.cmdk-item svg { width: 15px; height: 15px; color: var(--ink-mute); stroke-width: 1.75; }
.cmdk-item-kbd { margin-left: auto; font-size: 11px; color: var(--ink-mute); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.dash-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
}
.dash-stat-icon {
  width: 32px; height: 32px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  color: var(--ink-soft);
}
.dash-stat-icon svg { width: 16px; height: 16px; stroke-width: 1.75; }
.dash-stat-n {
  font-size: 26px; font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.dash-stat-n small { font-size: 14px; color: var(--ink-mute); font-weight: 500; }
.dash-stat-l {
  font-size: 12px; color: var(--ink-soft);
  margin-top: 2px;
}
.dash-stat-sub { font-size: 11px; color: var(--ink-mute); margin-top: 4px; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.dash-card-accent {
  background: linear-gradient(135deg, var(--maria-bg) 0%, oklch(98% 0.02 50) 100%);
  border-color: var(--maria-line);
}
.dash-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.dash-card-eyebrow {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.dash-card h3 {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.dash-card-text {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 14px;
}
.dash-mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.dash-mini-stats div {
  display: flex; flex-direction: column; gap: 2px;
}
.dash-mini-stats b {
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.dash-mini-stats span {
  font-size: 11px; color: var(--ink-mute);
}
.dash-reco-list { display: flex; flex-direction: column; gap: 4px; }
.dash-reco {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  gap: 8px;
}
.dash-reco-q { color: var(--ink); font-style: italic; flex: 1; min-width: 0; }
.dash-reco-time { color: var(--ink-mute); font-variant-numeric: tabular-nums; font-size: 11px; flex-shrink: 0; }
.dash-promo-mini { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.dash-promo-mini > div { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   SIGNORA MARIA — HOME (Google-style)
   ============================================================ */
.maria-home {
  min-height: calc(100dvh - 52px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 24px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 35%, var(--maria-bg) 0%, transparent 70%),
    var(--bg);
  position: relative;
}
.maria-home-inner {
  max-width: 640px;
  width: 100%;
  text-align: center;
  margin-top: -40px;
}
.maria-home-logo {
  width: 280px;
  max-width: 60vw;
  height: auto;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
}
.maria-home-tag {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--maria-ink);
  font-weight: 600;
  margin-bottom: 36px;
}
.maria-home-search {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  box-shadow: 0 2px 8px oklch(20% 0.02 265 / 0.04), 0 12px 32px oklch(20% 0.02 265 / 0.06);
  max-width: 560px;
  margin: 0 auto;
  transition: box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.maria-home-search:focus-within {
  border-color: var(--maria-line);
  box-shadow: 0 2px 8px oklch(20% 0.02 265 / 0.06), 0 16px 40px oklch(20% 0.02 265 / 0.08), 0 0 0 4px var(--maria-bg);
}
.maria-home-search svg { width: 20px; height: 20px; color: var(--ink-mute); flex-shrink: 0; stroke-width: 1.75; }
.maria-home-search input {
  flex: 1;
  border: none; outline: none;
  background: transparent;
  font-size: 16px;
  padding: 12px 4px;
  color: var(--ink);
  min-width: 0;
}
.maria-home-search .btn { height: 40px; padding: 0 20px; }

.maria-home-chips {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.maria-home-chips .chip { background: var(--surface); }

.maria-home-recent {
  margin-top: 32px;
  font-size: 12px;
  color: var(--ink-mute);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px;
}
.maria-home-recent button {
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
  transition: color .12s, text-decoration-color .12s;
}
.maria-home-recent button:hover { color: var(--maria-ink); text-decoration-color: var(--maria-line); }

.maria-home-foot {
  position: absolute;
  bottom: 18px; left: 0; right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--ink-mute);
}
.maria-home-foot b { color: var(--ink-soft); font-weight: 600; }

/* ============================================================
   SIGNORA MARIA — RESULTS
   ============================================================ */
.maria-results-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.maria-results-search {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 4px 4px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 99px;
  flex: 1;
  max-width: 480px;
}
.maria-results-search svg { width: 15px; height: 15px; color: var(--ink-mute); flex-shrink: 0; }
.maria-results-search input {
  flex: 1; min-width: 0;
  border: none; outline: none;
  background: transparent;
  font-size: 13px;
  padding: 4px;
}
.maria-results-summary { padding-bottom: 8px; }

.esp-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding-top: 16px;
}
.esp-filters {
  display: flex; flex-direction: column; gap: 18px;
  position: sticky;
  top: 12px;
}
.esp-filter-block .label { margin-bottom: 8px; }

.esp-results { display: flex; flex-direction: column; gap: 12px; }
.esp-results-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
}

.esp-card {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.esp-card:hover {
  border-color: var(--ink-mute);
  box-shadow: var(--shadow-2);
}
.esp-card-self {
  background: linear-gradient(135deg, var(--maria-bg) 0%, var(--surface) 70%);
  border-color: var(--maria-line);
}
.esp-card-rank {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
}
.esp-rank-n {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--ink);
}
.esp-card-self .esp-rank-n { background: var(--maria); color: white; }
.esp-rank-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--maria-ink);
  white-space: nowrap;
}
.esp-rank-tag.esp-rank-sponsored { color: var(--ink-mute); }

.esp-card-body { min-width: 0; }
.esp-card-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.esp-card-head h3 {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.015em;
}
.esp-card-cat { font-size: 12px; color: var(--ink-mute); }
.esp-card-quote {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 10px;
  font-style: italic;
}
.esp-card-quote .muted { font-style: normal; font-size: 11px; }
.esp-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.esp-card-actions {
  display: flex; align-items: flex-start; gap: 6px;
  flex-shrink: 0;
}

/* ============================================================
   LOGIN PAGE PREVIEW
   ============================================================ */
.login-preview {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  overflow-y: auto;
}
.login-preview.open { display: block; }
.login-preview-inner {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(circle at 85% 15%, var(--accent-bg) 0%, transparent 45%),
    radial-gradient(circle at 15% 85%, var(--maria-bg) 0%, transparent 45%);
}
.login-back {
  position: fixed;
  top: 16px; left: 16px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 36px 36px 28px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-3);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand img { width: 56px; height: 56px; object-fit: contain; margin: 0 auto 14px; display: block; }
.login-brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.login-brand p {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.5;
}
.login-form {
  display: flex; flex-direction: column; gap: 14px;
}
.login-links {
  display: flex; justify-content: space-between;
  font-size: 12px;
  margin-top: 4px;
}
.login-links a { color: var(--accent-ink); font-weight: 500; }
.login-foot {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* ============================================================
   MOBILE — bottom nav + collapse sidebar
   ============================================================ */
.mobile-tab { display: none; }
.mobile-header { display: none; }

@media (max-width: 1023px) {
  .sidebar { display: none; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .mobile-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
  }
  .mobile-header .sb-brand { padding: 0; }
  .topbar { padding: 0 16px; }
  .topbar .kbd-trigger .lbl { display: none; }
  .page-header, .page-body { padding-left: 16px; padding-right: 16px; }
  .crea-grid { grid-template-columns: 1fr; }
  .crea-preview { display: none; }
  .crea-editor-head { padding: 16px; }
  .crea-body { padding: 0 16px 24px; }
  .piano-layout { grid-template-columns: 1fr; }
  .piano-drawer { display: none; }
  .piano-week { grid-template-columns: 50px repeat(7, 1fr); }
  /* telefono: la settimana scorre di lato dentro il suo riquadro invece di uscire dallo schermo */
  .piano-week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .piano-week-scroll .piano-week { min-width: 620px; }
  .piano-toolbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .maria-grid { grid-template-columns: 1fr; padding: 16px; }
  .maria-hero { padding: 16px; grid-template-columns: 1fr; text-align: center; }
  .maria-hero-info { text-align: center; }
  .maria-hero-meta { justify-content: center; }
  .maria-stats { justify-content: center; flex-wrap: wrap; }
  .cont-filters { padding: 12px 16px; }
  .cont-grid { padding: 16px; grid-template-columns: 1fr 1fr; gap: 12px; }
  .cont-search { width: 100%; }
  .workspace { padding-bottom: 64px; }
  .esp-layout { grid-template-columns: 1fr; }
  .esp-filters { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  .esp-filter-block { min-width: 200px; flex-shrink: 0; }
  .esp-hero { padding: 28px 16px 20px; }
  .esp-title { font-size: 22px; }
  .esp-search { flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--radius-lg); }
  .esp-search input { width: 100%; padding: 8px 0; font-size: 14px; }
  .esp-search .btn { width: 100%; justify-content: center; }
  .esp-card { grid-template-columns: 40px 1fr; }
  .esp-card-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--line-soft); margin-top: 6px; }
  .persona-switch { display: none; }
  .topbar .kbd-trigger .lbl, .topbar .login-back, .topbar button .lbl { display: none; }
  .dash-mini-stats { grid-template-columns: repeat(2, 1fr); }
  .mobile-tab {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    z-index: 50;
    justify-content: space-around;
  }
  .mobile-tab button {
    flex: 1;
    padding: 8px 4px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--ink-mute);
    font-size: 10px; font-weight: 500;
    border-radius: var(--radius);
  }
  .mobile-tab button svg { width: 20px; height: 20px; stroke-width: 1.75; }
  .mobile-tab button.active { color: var(--accent-ink); }
}

@media (max-width: 600px) {
  .cont-grid { grid-template-columns: 1fr; }
  .crea-mode { width: 100%; }
  .crea-mode button { flex: 1; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--ink-mute); }
.flex-1 { flex: 1; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
