/* ===== Agendona — stile ===== */
:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --surface-3: #e4e7f0;
  --text: #171a2b;
  --muted: #666c85;
  --border: #e2e5ee;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #e5e7ff;
  --on-accent: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 18px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.18);
  --radius: 14px;
  --radius-sm: 9px;
  --nav-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  /* nero assoluto per schermi OLED; le schede restano appena più chiare per distinguersi */
  --bg: #000000;
  --surface: #0e0f14;
  --surface-2: #181a22;
  --surface-3: #23262f;
  --text: #e9ebf3;
  --muted: #9298ad;
  --border: #23252e;
  --accent: #8b8ff8;
  --accent-strong: #a5a8fb;
  --accent-soft: #2b2e5c;
  --on-accent: #0f1117;
  --danger: #f87171;
  --danger-soft: #3b1f22;
  --success: #4ade80;
  --success-soft: #16311f;
  --warning: #fbbf24;
  --warning-soft: #3a2d10;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
::selection { background: var(--accent-soft); }

.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 14px; color: var(--muted); }
.boot-logo, .logo {
  width: 64px; height: 64px; display: block; object-fit: contain; flex: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
}

/* ===== Layout ===== */
.app { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.side { display: none; }
/* min-width:0 e overflow-x:clip: nessuna schermata può diventare più larga del telefono (evita lo zoom automatico) */
.main { padding: 12px 14px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1100px; width: 100%; margin: 0 auto; min-width: 0; overflow-x: clip; }
.grid-2 > *, .plan-layout > *, .card { min-width: 0; }
@media (max-width: 899px) {
  /* su iPhone un campo con testo < 16px fa ingrandire la pagina quando si scrive */
  input, select, textarea { font-size: 16px; }
  .input-title { font-size: 18px; }
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(6, 1fr); z-index: 30;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none;
  color: var(--muted); font-size: 10.5px; font-weight: 500; padding-top: 6px;
}
.tabbar a.active { color: var(--accent); }
.tabbar svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .app { grid-template-columns: 236px 1fr; }
  .side {
    display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
    background: var(--surface); border-right: 1px solid var(--border);
  }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 18px; }
  .side .brand .logo { width: 36px; height: 36px; }
  .side a {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; text-decoration: none;
    color: var(--muted); font-weight: 500; font-size: 14.5px;
  }
  .side a:hover { background: var(--surface-2); color: var(--text); }
  .side a.active { background: var(--accent-soft); color: var(--accent); }
  .side svg { width: 20px; height: 20px; }
  .side .spacer { flex: 1; }
  .side .sync-pill { margin: 0 4px; }
  .tabbar { display: none; }
  .main { padding: 24px 32px 40px; }
}

/* ===== Barra superiore ===== */
.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-height: 40px; }
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
.datenav { display: flex; align-items: center; gap: 2px; }

/* ===== Bottoni ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 550; font-size: 14px;
  line-height: 1.2; transition: background 0.12s, transform 0.08s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 8px; border-color: transparent; background: transparent; border-radius: 10px; color: var(--muted); }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }
.btn-google { gap: 10px; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); width: 56px; height: 56px;
  border-radius: 18px; background: var(--accent); color: var(--on-accent); border: none; box-shadow: var(--shadow-lg);
  display: grid; place-items: center; z-index: 25;
}
.fab svg { width: 26px; height: 26px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }

/* ===== Card, sezioni ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card + .card, .section + .section { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h2 { flex: 1; }
.card-head .count { color: var(--muted); font-weight: 500; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 > .card + .card { margin-top: 0; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: 14px; }
.empty svg { width: 30px; height: 30px; opacity: 0.5; margin-bottom: 6px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 10px 0; }

/* ===== Form ===== */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  outline: none; transition: border-color 0.12s, box-shadow 0.12s; min-height: 42px;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }
.input-title { font-size: 18px; font-weight: 600; background: transparent; border-color: transparent; padding-left: 4px; }
.input-title:focus { background: var(--surface-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch input { width: 42px; height: 24px; appearance: none; background: var(--surface-3); border-radius: 99px; position: relative; cursor: pointer; transition: background 0.15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.help { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.quick-add { display: flex; gap: 8px; align-items: center; }
.quick-add .input { flex: 1; min-width: 0; }
.quick-add input[type="date"] { width: auto; flex: 0 1 auto; min-width: 0; }

/* ===== Chip ===== */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; line-height: 1.2;
}
.chip svg { width: 14px; height: 14px; }
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent)); }
.tag.overdue { background: var(--danger-soft); color: var(--danger); }
.tag.today { background: var(--accent-soft); color: var(--accent); }
.tag svg { width: 12px; height: 12px; }
.segmented { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; gap: 2px; }
.segmented button { border: none; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 550; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.color-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.color-dot.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.prio-btn { border-color: transparent; background: var(--surface-2); }
.prio-btn.active { background: var(--p); color: #fff; }
.weekday-toggles { display: flex; gap: 5px; }
.weekday-toggles button { flex: 1; padding: 8px 0; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.weekday-toggles button.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ===== Attività ===== */
.task-list { display: flex; flex-direction: column; }
.task {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.task:last-child { border-bottom: none; }
.task:hover { background: var(--surface-2); border-radius: 8px; }
.task.sub { padding-left: 34px; }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 500; overflow-wrap: anywhere; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; align-items: center; }
.task .meta .tag { font-weight: 500; }
.task.selected { outline: 2px solid var(--accent); border-radius: 8px; }
.task.dragging { opacity: 0.4; }
.check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--p, var(--muted)); background: transparent; flex: none;
  display: grid; place-items: center; margin-top: 1px; color: transparent; padding: 0; transition: background 0.12s;
}
.check:hover { background: color-mix(in srgb, var(--p, var(--muted)) 18%, transparent); }
.check.on { background: var(--p, var(--muted)); color: #fff; border-color: var(--p, var(--muted)); }
.check svg { width: 14px; height: 14px; }
.group-title { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 14px 0 4px; }
.group-title:first-child { margin-top: 0; }
.drag-handle { color: var(--muted); cursor: grab; opacity: 0.6; }

/* ===== Priorità del giorno ===== */
.prio-list { display: flex; flex-direction: column; gap: 6px; }
.prio-item { display: flex; align-items: center; gap: 10px; }
.prio-item .n { width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.prio-item input { flex: 1; border: none; background: transparent; padding: 8px 6px; border-radius: 8px; outline: none; }
.prio-item input:focus { background: var(--surface-2); }
.prio-item.done input { text-decoration: line-through; color: var(--muted); }

/* ===== Timeline ===== */
.tl-wrap { position: relative; padding: 8px 0 12px; }
.tl-allday { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px 52px; }
.tl { position: relative; display: grid; grid-template-columns: 48px 1fr; }
.tl-hours { position: relative; }
.tl-hour { position: absolute; right: 8px; font-size: 11px; color: var(--muted); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.tl-grid { position: relative; border-left: 1px solid var(--border); }
.tl-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.tl-line.half { border-top-style: dashed; opacity: 0.5; }
.tl-slot { position: absolute; left: 0; right: 0; cursor: pointer; }
.tl-slot:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tl-slot.drop { background: color-mix(in srgb, var(--accent) 18%, transparent); outline: 2px dashed var(--accent); outline-offset: -2px; z-index: 2; }
.tl-event {
  position: absolute; border-radius: 8px; padding: 4px 8px; overflow: hidden; cursor: pointer; font-size: 12.5px; line-height: 1.25;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 3px solid var(--c); color: var(--text); z-index: 3;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06); transition: filter 0.1s;
}
.tl-event:hover { filter: brightness(0.96); z-index: 4; }
.tl-event .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-event .h { color: var(--muted); font-size: 11px; }
.tl-event { display: flex; flex-direction: column; }
.tl-event .h, .tl-event .cal { flex: none; }
.tl-event .t { flex: none; }
.tl-event > * { min-height: 0; }
.tl-event.done { opacity: 0.55; }
.tl-event.done .t { text-decoration: line-through; }
.tl-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 5; pointer-events: none; }
.tl-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.tl-scroll { max-height: 70vh; overflow-y: auto; }

/* ===== Settimana ===== */
.week-head { display: grid; grid-template-columns: 48px repeat(7, 1fr); margin-bottom: 4px; }
.week-head .d { text-align: center; padding: 6px 0; font-size: 12px; color: var(--muted); border-radius: 10px; cursor: pointer; }
.week-head .d b { display: block; font-size: 17px; color: var(--text); font-weight: 600; }
.week-head .d.today b { color: var(--accent); }
.week-head .d.active { background: var(--accent-soft); }
.week-grid { display: grid; grid-template-columns: 48px repeat(7, 1fr); }
.week-grid .tl { grid-template-columns: 1fr; }
.week-grid .tl-grid { border-left: 1px solid var(--border); }
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.day-strip button { border: 1px solid transparent; background: var(--surface); border-radius: 12px; padding: 6px 0; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.day-strip button b { font-size: 16px; color: var(--text); }
.day-strip button.active { background: var(--accent); border-color: var(--accent); }
.day-strip button.active b, .day-strip button.active { color: var(--on-accent); }
.day-strip button.today:not(.active) b { color: var(--accent); }
.day-strip .dots { display: flex; gap: 2px; height: 4px; }
.day-strip .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: 0.7; }
.day-strip button.active .dots i { background: var(--on-accent); }

/* ===== Settimana su telefono (stile Samsung Calendar) ===== */
.week-mobile { padding: 8px 6px 10px 0; }
.week-mobile .week-head { grid-template-columns: 34px repeat(7, 1fr); margin-bottom: 4px; }
.wk-day { text-align: center; padding: 2px 0 4px; font-size: 10.5px; color: var(--muted); cursor: pointer; text-transform: lowercase; }
.wk-day b { display: block; width: 28px; height: 28px; line-height: 28px; margin: 2px auto 0; border-radius: 50%; font-size: 14.5px; font-weight: 600; color: var(--text); }
.wk-day.today { color: var(--accent); font-weight: 600; }
.wk-day.today b { background: var(--accent); color: var(--on-accent); }
.wk-day.active:not(.today) b { background: var(--accent-soft); color: var(--accent); }
.wk-allday { display: grid; grid-template-columns: 34px repeat(7, 1fr); margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.wk-allday .wk-corner { font-size: 8.5px; line-height: 1.1; padding-right: 3px; text-align: right; align-self: center; }
.wk-allday-col { display: flex; flex-direction: column; gap: 2px; padding: 0 1px; min-width: 0; border-left: 1px solid var(--border); }
.wk-chip { display: block; font-size: 9.5px; line-height: 1.25; padding: 2px 3px; border-radius: 4px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); border-left: 2px solid var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.week-mobile .week-grid { grid-template-columns: 34px repeat(7, 1fr); }
.week-mobile .tl-wrap { padding: 6px 0 8px; }
.week-mobile .tl-hour { font-size: 9.5px; right: 4px; }
.week-mobile .tl-line.half { display: none; }
.week-mobile .tl-event { font-size: 10px; padding: 2px 3px; border-radius: 4px; border-left-width: 2px; box-shadow: none; }
.week-mobile .tl-event .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.15; font-weight: 600; overflow-wrap: anywhere; }
.week-mobile .tl-event.google { border-left-width: 3px; }
.week-mobile .tl-now::before { width: 7px; height: 7px; top: -2.5px; left: -3px; }

/* pinch-to-zoom gestito dall'app: il browser fa solo lo scorrimento verticale */
.pinch-area { touch-action: pan-y; }
.week-mobile .tl-event.small .t { -webkit-line-clamp: 1; }

/* ===== Mese ===== */
.month-head { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-wd { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0 6px; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.month-cell { min-height: 78px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 3px 2px 4px; cursor: pointer; min-width: 0; display: flex; flex-direction: column; gap: 2px; transition: background 0.12s; }
.month-cell:hover { background: var(--surface-2); }
.month-cell .n { font-size: 12px; font-weight: 600; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; margin: 0 auto 1px; }
.month-cell.out .n { color: var(--muted); opacity: 0.55; }
.month-cell.out .month-ev { opacity: 0.6; }
.month-cell.today .n { background: var(--accent); color: var(--on-accent); }
.month-cell.active { background: var(--accent-soft); }
.month-cell.active.today .n { box-shadow: 0 0 0 2px var(--surface); }
.month-ev { font-size: 9.5px; line-height: 1.25; padding: 1px 3px; border-radius: 3px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); border-left: 2px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-more { font-size: 9px; color: var(--muted); padding-left: 3px; }
.month-tasks { font-size: 9px; color: var(--muted); padding-left: 3px; }
.month-mobile .month-tasks { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); padding: 0; margin: auto auto 0; }
.month-mobile { padding: 10px 8px 12px; }
@media (min-width: 900px) {
  .month-cell { min-height: 112px; padding: 6px 5px; }
  .month-cell .n { margin: 0 0 4px; }
  .month-ev { font-size: 12px; padding: 2px 6px; border-radius: 5px; cursor: pointer; }
  .month-ev:hover { filter: brightness(0.95); }
  .month-more, .month-tasks { font-size: 11px; }
}
/* ===== Anno ===== */
.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
@media (min-width: 900px) { .year-grid { grid-template-columns: repeat(4, 1fr); gap: 20px 24px; } }
.ym { cursor: pointer; border-radius: 10px; padding: 4px; min-width: 0; }
.ym:hover { background: var(--surface-2); }
.ym h4 { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--accent); }
.ym.current h4 { text-decoration: underline; text-underline-offset: 3px; }
.ym-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px 0; }
.ym-w { font-size: 8px; color: var(--muted); text-align: center; line-height: 12px; }
.ym-d { font-size: 9px; text-align: center; line-height: 15px; height: 15px; width: 15px; margin: 0 auto; border-radius: 50%; color: var(--muted); font-variant-numeric: tabular-nums; }
.ym-d.has { color: var(--text); font-weight: 700; }
.ym-d.today { background: var(--accent); color: var(--on-accent); font-weight: 700; }
@media (min-width: 900px) { .ym h4 { font-size: 13.5px; } .ym-w { font-size: 10px; } .ym-d { font-size: 11px; line-height: 20px; height: 20px; width: 20px; } }
.year-mobile { padding: 12px 10px; }

.daylist-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 14px; }
.daylist-row:last-child { border-bottom: none; }
.daylist-row:hover { background: var(--surface-2); }
.daylist-time { width: 92px; flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.daylist-bar { width: 4px; height: 22px; border-radius: 2px; background: var(--c); flex: none; }
.daylist-title { flex: 1; min-width: 0; font-weight: 500; }

/* ===== Abitudini ===== */
.habit { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.habit:last-child { border-bottom: none; }
.habit .icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); flex: none; }
.habit .body { flex: 1; min-width: 0; cursor: pointer; }
.habit .name { font-weight: 600; }
.habit .streak { font-size: 12.5px; color: var(--muted); }
.habit-days { display: flex; gap: 4px; }
.habit-days button { width: 22px; height: 22px; border-radius: 6px; border: none; background: var(--surface-2); padding: 0; font-size: 9px; color: var(--muted); }
.habit-days button.on { background: var(--c); color: #fff; }
.habit-days button.na { opacity: 0.3; }
.habit-toggle { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--c); background: transparent; color: var(--c); display: grid; place-items: center; flex: none; padding: 0; font-weight: 700; font-size: 12px; }
.habit-toggle.on { background: var(--c); color: #fff; }
.habit-toggle svg { width: 20px; height: 20px; }
.habit-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.habit-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px 8px 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 550; font-size: 13.5px; }
.habit-chip.on { background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-color: var(--c); }
.habit-chip .em { font-size: 16px; }
.habit-chip .cnt { font-size: 11.5px; color: var(--muted); }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 99px; }

/* ===== Note ===== */
.note-card { padding: 12px 14px; cursor: pointer; }
.note-card h3 { margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.note-card .ex { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.note-card .when { font-size: 12px; color: var(--muted); margin-top: 6px; }
.notes-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .notes-grid { grid-template-columns: 1fr 1fr; } }
.md { line-height: 1.6; }
.md h2, .md h3, .md h4, .md h5 { margin: 12px 0 4px; }
.md p { margin: 0 0 8px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
.md li.done { color: var(--muted); text-decoration: line-through; }
.md ul.md-tasks { list-style: none; padding-left: 4px; }
.md code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0 0 8px; padding: 4px 12px; border-left: 3px solid var(--accent); color: var(--muted); }
.md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
textarea.editor-area { min-height: 150px; max-height: 45vh; font-size: 15px; line-height: 1.5; }

/* ===== Diario protetto ===== */
.locked { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; color: var(--muted); text-align: center; font-size: 14px; }
.locked svg { width: 30px; height: 30px; opacity: 0.6; }
.pin-input { font-size: 26px; letter-spacing: 0.45em; text-align: center; font-variant-numeric: tabular-nums; }
.pin-input::placeholder { letter-spacing: normal; font-size: 15px; }
.bio-btn { flex-direction: column; gap: 4px; padding: 14px; }
.bio-btn svg { width: 30px; height: 30px; }

/* ===== Statistiche ===== */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.tile .l { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tile .delta { font-size: 12px; margin-top: 4px; }
.tile .delta.up { color: var(--success); }
.tile .delta.down { color: var(--danger); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 15px; fill: var(--muted); }
.chart .bar { fill: var(--accent); }
.chart .bar.h { fill: var(--success); }
.chart .axis { stroke: var(--border); }
.stat-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-row .progress { flex: 1; }
.stat-row .pct { width: 42px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 12, 25, 0.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.15s ease-out;
}
.modal {
  background: var(--surface); width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  animation: up 0.2s ease-out; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.modal-head h2 { flex: 1; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.modal-foot .left { margin-right: auto; }
.sheet-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 10px; border: none; background: transparent; border-radius: 10px; text-align: left; font-size: 15px; font-weight: 500; }
.sheet-list button:hover { background: var(--surface-2); }
.sheet-list svg { width: 22px; height: 22px; color: var(--accent); }
@media (min-width: 700px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { max-width: 560px; border-radius: 18px; padding: 20px 22px; max-height: 88vh; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }

/* ===== Transizioni (solo trasformazioni e opacità: leggere anche sul telefono) ===== */
.modal { animation: pop 0.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes pop { from { transform: translateY(18px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-backdrop.closing { animation: fadeOut 0.15s ease-in forwards; pointer-events: none; }
.modal-backdrop.closing .modal { animation: popOut 0.15s ease-in forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { transform: translateY(14px) scale(0.98); opacity: 0; } }
.view { animation: viewIn 0.18s ease-out; }
/* Vista e Statistiche più grandi su PC con mouse (Impostazioni → Aspetto → Ingrandimento) */
@media (min-width: 900px) and (pointer: fine) {
  .view-week, .view-stats { zoom: var(--desk-zoom, 1.25); }
  .main.wide { max-width: 1480px; }
}
@media (min-width: 1150px) and (pointer: fine) {
  .view-stats .tiles { grid-template-columns: repeat(5, 1fr); }
}
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.slide-left { animation: slideL 0.24s cubic-bezier(0.2, 0.7, 0.2, 1); }
.slide-right { animation: slideR 0.24s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes slideL { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideR { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { animation: toastIn 0.18s ease-out; }
@keyframes toastIn { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
/* ===== Allegati ===== */
.att-section { margin-top: 10px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.att { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.att-open { width: 100%; height: 100%; border: none; padding: 0; background: transparent; display: block; }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; padding: 6px; font-size: 11.5px; text-align: center; color: var(--text); }
.att-file .ellipsis { max-width: 100%; }
.att-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 16px; line-height: 1; padding: 0; }
@media (pointer: fine) { .only-touch { display: none; } }

/* ===== Liste condivise ===== */
.sl-icon { margin-right: 6px; }
.sl-list { display: flex; flex-direction: column; }
.sl-item { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.sl-item:last-child { border-bottom: none; }
.sl-item .input { min-height: 36px; padding: 6px 8px; }
.sl-text { cursor: text; overflow-wrap: anywhere; font-size: 15.5px; }
.sl-item.done .sl-text { text-decoration: line-through; color: var(--muted); }
.sl-members { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sl-member { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 14px; }
.tabs-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.feed-url { font-family: var(--mono); font-size: 12px; }

/* ===== Modelli ===== */
.tpl-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.tpl-row:last-of-type { border-bottom: none; }
.tpl-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; font-size: 19px; flex: none; }
.tpl-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.tpl-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; }
.tpl-item .input { min-height: 36px; padding: 6px 8px; width: auto; }
.tpl-item .tpl-title { flex: 1 1 150px; }

/* ===== Umore ed energia ===== */
.mood-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.mood-group { display: flex; align-items: center; gap: 6px; }
.mood-label { font-size: 12.5px; color: var(--muted); font-weight: 600; min-width: 52px; }
.mood-opts { display: flex; gap: 2px; }
.mood-btn { border: none; background: transparent; font-size: 22px; line-height: 1; padding: 4px; border-radius: 10px; filter: grayscale(1); opacity: 0.45; transition: transform 0.1s, opacity 0.1s, filter 0.1s; }
.mood-btn:hover { opacity: 0.8; }
.mood-btn.on { filter: none; opacity: 1; background: var(--accent-soft); transform: scale(1.1); }
.energy-btn { border: none; background: transparent; font-size: 18px; line-height: 1; padding: 4px 2px; filter: grayscale(1); opacity: 0.35; transition: opacity 0.1s, filter 0.1s; }
.energy-btn.on { filter: none; opacity: 1; }
.mood-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.mood-stats div { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.mood-stats b { font-size: 18px; }
.mood-stats span { font-size: 12px; color: var(--muted); }
.mood-card .mood-chart { max-height: 260px; }
.mood-chart .mood-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.mood-chart .energy-line { fill: none; stroke: #f59e0b; stroke-width: 2; stroke-dasharray: 5 4; }
.mood-chart .mood-dot { fill: var(--accent); }
.mood-chart .energy-dot { fill: #f59e0b; }

.accent-swatches { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 190px; }
.accent-swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); background: var(--sw); box-shadow: 0 0 0 1px var(--border); padding: 0; cursor: pointer; }
.accent-swatch.active { box-shadow: 0 0 0 2px var(--text); }
.toast.has-action { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; }
.toast.undo { background: var(--text); color: var(--bg); }
.toast-action { border: none; background: rgba(127, 127, 127, 0.22); color: inherit; font-weight: 800; font-size: 13px; padding: 7px 12px; border-radius: 9px; letter-spacing: 0.02em; text-transform: uppercase; }
.toast-action:hover { background: rgba(127, 127, 127, 0.34); }
.tl-event, .daylist-row, .month-cell, .habit-chip, .chip, .btn { transition: transform 0.08s, background 0.12s; }
.tl-event:active, .daylist-row:active, .habit-chip:active { transform: scale(0.97); }
.fab { transition: transform 0.12s; }
.fab:active { transform: scale(0.92); }

/* ===== Trascinamento eventi ===== */
.tl-event { touch-action: none; user-select: none; -webkit-user-select: none; }
.tl-event.dragging { opacity: 0.85; box-shadow: var(--shadow-lg); z-index: 20; pointer-events: none; transition: none; filter: none; }
.tl-event.moving-day { outline: 2px dashed var(--accent); }
.tl-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; touch-action: none; }
.tl-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: color-mix(in srgb, var(--c) 60%, transparent); opacity: 0; transition: opacity 0.12s; }
.tl-event:hover .tl-resize::after, .tl-event.dragging .tl-resize::after { opacity: 1; }
.tl-event .rec { color: var(--muted); font-weight: 400; }

/* ===== Inserimento rapido / etichette / Inbox / Todoist ===== */
.nl-chips { margin-top: 6px; }
.tag.label { background: var(--accent-soft); color: var(--accent); }
.tag.td { background: #fbe7e5; color: #b8321f; }
[data-theme="dark"] .tag.td { background: #3a1f1c; color: #f2a59c; }
.td-dot { width: 7px; height: 7px; border-radius: 50%; background: #db4c3f; display: inline-block; margin-right: 4px; }
.labels-input .chips { align-items: center; }
.chip-x { border: none; background: transparent; color: inherit; font-size: 14px; line-height: 1; padding: 0 0 0 2px; cursor: pointer; opacity: 0.8; }
.inbox-actions { flex: none; gap: 4px; }
.inbox-actions .chip { padding: 4px 8px; font-size: 12px; }
.btn-icon.mic.on { color: var(--danger); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.side-sep { height: 1px; background: var(--border); margin: 6px 8px; }

/* ===== Routine ===== */
.routine { padding: 10px 0; border-bottom: 1px solid var(--border); }
.routine:last-child { border-bottom: none; }
.routine.off { opacity: 0.55; }
.routine-head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.routine-head .name { font-weight: 600; }
.routine-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--surface-2); flex: none; }

/* ===== Timer di concentrazione ===== */
.focus-card { display: flex; flex-direction: column; align-items: center; padding: 22px 16px; }
.focus-ring { position: relative; width: 240px; height: 240px; }
.focus-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.focus-ring circle { fill: none; stroke-width: 10; }
.focus-ring .bg { stroke: var(--surface-2); }
.focus-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; }
.focus-ring.break .fg, .focus-ring.long .fg { stroke: var(--success); }
.focus-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.focus-time .clock { font-size: 52px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.focus-time .phase { color: var(--muted); font-size: 13px; margin-top: 6px; }
.focus-rounds { display: flex; align-items: center; gap: 6px; margin: 14px 0 12px; }
.focus-rounds i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.focus-rounds i.on { background: var(--accent); }
.focus-task { display: flex; gap: 6px; width: 100%; max-width: 420px; margin-bottom: 14px; }
.focus-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.focus-main { padding: 12px 22px; font-size: 16px; border-radius: 14px; }
.focus-bar {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 28;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow-lg); cursor: pointer; animation: up 0.2s ease-out;
}
.focus-bar.break, .focus-bar.long { background: var(--success); color: #fff; }
.focus-bar .fb-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.focus-bar .fb-label { flex: 1; min-width: 0; font-size: 13px; }
.focus-bar .btn-icon { color: inherit; padding: 4px; }
.focus-bar .btn-icon:hover { background: rgba(255,255,255,0.15); }
.has-focusbar .fab { bottom: calc(var(--nav-h) + 68px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .focus-bar { left: auto; right: 28px; bottom: 28px; width: 380px; }
  .has-focusbar .fab { bottom: 84px; }
}
.tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ===== Revisione settimanale ===== */
.review-steps { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.review-steps::-webkit-scrollbar { display: none; }
.review-step { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.review-step i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.review-step.active { border-color: var(--accent); color: var(--accent); }
.review-step.active i { background: var(--accent); color: var(--on-accent); }
.review-step.done i { background: var(--success-soft); color: var(--success); }

/* ===== Liste ===== */
.list-editor { display: flex; flex-direction: column; gap: 6px; }
.list-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.list-tools .chip { padding: 5px 10px; }
.md-inline { padding: 10px 12px; min-height: 56px; box-shadow: none; }
.md-interactive li[data-line] { cursor: pointer; user-select: none; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.md-interactive li[data-line]:hover { background: var(--surface-2); }
.md-interactive li[data-line]:active { transform: scale(0.99); }
.md-check { font-size: 1.05em; margin-right: 2px; color: var(--accent); }
.md li.done .md-check { color: var(--success); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== Toast, sync ===== */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); max-width: 92vw;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 5px 9px; border-radius: 99px; background: var(--surface-2); }
.sync-pill svg { width: 14px; height: 14px; }
.sync-pill.error { color: var(--danger); background: var(--danger-soft); }
.sync-pill.syncing svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
.cal-list label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; cursor: pointer; }
.cal-list input { width: 16px; height: 16px; accent-color: var(--accent); }
.tl-event.google { border-left-style: double; border-left-width: 4px; }
.tl-event .cal { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--warning-soft); color: var(--text); font-size: 13.5px; margin-bottom: 12px; }
.banner svg { width: 18px; height: 18px; color: var(--warning); flex: none; }
.banner.info { background: var(--accent-soft); }
.banner.info svg { color: var(--accent); }

/* ===== Login ===== */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .card { width: 100%; max-width: 400px; padding: 28px 24px; text-align: center; }
.login .logo { width: 76px; height: 76px; margin: 0 auto 14px; }
.login h1 { font-size: 24px; margin-bottom: 6px; }
.login .stack { margin-top: 20px; text-align: left; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 6px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ===== Pianificazione ===== */
.plan-layout { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .plan-layout { grid-template-columns: 380px 1fr; align-items: start; } .plan-layout .card + .card { margin-top: 0; } }
.plan-hint { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.dur-chips button { padding: 5px 9px; }

/* ===== Impostazioni ===== */
.settings-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row .body { flex: 1; min-width: 0; }
.settings-row .title { font-weight: 550; }
.settings-row .desc { font-size: 12.5px; color: var(--muted); }
kbd { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; overflow-x: auto; white-space: pre; }
