/* Trama by Lume — app.css v0.3
   Carta calda, inchiostro, un solo accento (alba). Mobile-first: la barra di cattura sta sotto il pollice. */
:root {
  --bg: #F8F5EF;
  --surface: #FFFFFF;
  --surface-2: #F4F0E8;
  --ink: #1E1B18;
  --ink-2: #5C5650;
  --ink-3: #96897A;
  --line: #E4DED2;
  --line-2: #EFEAE0;
  --dawn: #D9A21B;
  --dawn-soft: #FBF3DC;
  --dawn-ink: #7A5A0C;
  --dusk: #8A7F6E;
  --dusk-soft: #F1ECE2;
  --ok: #3E8E5E; --ok-soft: #E9F4EC;
  --warn: #B0413E; --warn-soft: #F8E9E8;
  --amb-1: rgba(217,162,27,.09); --amb-2: rgba(138,127,110,.07); --amb-3: rgba(217,162,27,.05); /* sfondo ambientale di Alba: i temi lo ridefiniscono più sotto, questo è solo il punto di partenza */
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 14px; --r-sm: 9px;
  --nav-w: 248px;
  --hour-h: 48px;
  --shadow: 0 1px 2px rgba(25,28,31,.04), 0 4px 16px rgba(25,28,31,.04);
  --shadow-lg: 0 12px 40px rgba(25,28,31,.16);
  --tap: 48px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17140F; --surface: #211D18; --surface-2: #27221B; --ink: #ECE7DE; --ink-2: #C7BFB1; --ink-3: #96897A;
    --line: #2A313B; --line-2: #232931; --dawn: #E2AE2C; --dawn-soft: #2E2812; --dawn-ink: #F0C55A; --dusk: #A79C8A; --dusk-soft: #2B261E;
    --ok: #3FA66A; --ok-soft: #17301F; --warn: #DA5E52; --warn-soft: #3A1E1D; --shadow: none; --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { overflow-x: hidden; max-width: 100%; }
body { overflow-x: clip; max-width: 100%; }   /* clip, non hidden: hidden trasforma il body in un contenitore di scorrimento e spegne position:sticky (barra laterale) */
/* Una stringa lunga senza spazi (parole chiave, email, link) non deve mai più poter allargare la pagina:
   qui sta la causa reale del bug "Impostazioni centrata con spazio vuoto a destra" su schermi ad alta densità. */
.task .sub, .sub span, .wrap, .empty, .small, p, td, .rv-orig, .crumbs, .crumbs a, .page-title, .prodotto-nota { overflow-wrap: anywhere; }
.card, .task, .event, .tx { min-width: 0; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--dawn); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: .5rem; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.stack > * + * { margin-top: .75rem; }

/* ================= Shell ================= */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100dvh; }
.nav {
  position: sticky; top: 0; height: 100dvh; padding: 1rem .75rem; display: flex; flex-direction: column; gap: .15rem;
  background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.brand { font-family: var(--serif); font-size: 1.35rem; padding: .35rem .6rem 1rem; display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.brand img { width: 22px; height: 22px; }
.brand small { font-family: var(--sans); font-size: .65rem; color: var(--ink-3); background: var(--dawn-soft); color: var(--dawn-ink); padding: .1rem .4rem; border-radius: 999px; }
.nav a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-size: .95rem; min-height: 36px; }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.active { background: var(--dawn-soft); color: var(--ink); }
.nav a.active svg { color: var(--dawn-ink); }
.nav-group { margin-top: .9rem; }
.nav-group .gt { display: flex; align-items: center; justify-content: space-between; padding: .2rem .6rem; font-size: .75rem; color: var(--ink-3); }
.nav-group .gt button { border: 0; background: transparent; color: var(--ink-3); padding: .15rem; border-radius: 6px; display: grid; place-items: center; }
.nav-group .gt button:hover { background: var(--bg); color: var(--ink); }
.nav-group .gt button svg { width: 14px; height: 14px; }
.tree a { padding: .35rem .6rem; min-height: 32px; font-size: .92rem; }
.tree .sub { padding-left: 1.1rem; }
.tree .ic { width: 18px; text-align: center; font-size: .95rem; flex: none; }
.tree .tw { width: 14px; height: 14px; color: var(--ink-3); transition: transform .15s; flex: none; margin-left: -4px; }
.tree .open > a .tw { transform: rotate(90deg); }
.tree .kids { display: none; }
.tree .open > .kids { display: block; }
.nav .spacer { flex: 1; }
.nav-user { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .75rem !important; }
.nav-user .cog { margin-left: auto; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--bg); display: inline-grid; place-items: center; font-size: .8rem; font-weight: 600; text-decoration: none; flex: none; overflow: hidden; }
.avatar.has-img { background: var(--surface-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar { display: none; }
.main { padding: 1.5rem 2.5rem 6rem; max-width: 1180px; width: 100%; }

/* ================= Cattura (desktop: in alto; mobile: in basso) ================= */
.capture { position: fixed; z-index: 30; left: var(--nav-w); right: 0; top: 0; padding: .9rem 2.5rem 0; pointer-events: none; }
.capture form {
  pointer-events: auto; display: flex; align-items: center; gap: .3rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: .3rem .4rem .3rem .4rem; box-shadow: var(--shadow); max-width: 720px;
}
.capture form:focus-within { border-color: var(--dawn); box-shadow: 0 0 0 4px var(--dawn-soft), var(--shadow); }
/* L'anteprima non aveva mai avuto un proprio stile: dentro la barra fissa, un testo lungo (più eventi
   in una frase sola) cresceva senza limite e finiva scritto sopra al resto della pagina, che non si
   sposta mai sotto un elemento fisso. Ora è una scheda vera, con sfondo, ombra, e un tetto di altezza:
   oltre quello scorre dentro se stessa, non trabocca mai più sul contenuto sotto. */
.preview { pointer-events: auto; max-width: 720px; margin-top: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .9rem; box-shadow: var(--shadow-lg); font-size: .86rem; color: var(--ink-2); max-height: 6.6em; overflow-y: auto; }
.preview:empty { display: none; }
.capture input { flex: 1; border: 0; background: transparent; outline: 0; min-width: 0; font-size: 16px; padding: .35rem .25rem; }
.capture input::placeholder { color: var(--ink-3); }
.capture .go { border: 0; background: var(--ink); color: var(--bg); border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.capture .mic { border: 0; background: transparent; color: var(--ink-3); width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; flex: none; }
.capture .mic:hover { color: var(--ink); background: var(--bg); }
.capture .mic.rec { color: #fff; background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(176,65,62,.25); } }
.capture .preview { pointer-events: none; font-size: .8rem; color: var(--dusk); padding: 0 1.2rem .3rem; min-height: 0; max-width: 720px; }
@media (min-width: 700px) {
  .capture { display: flex; flex-direction: column-reverse; }
  .capture .preview { padding: .3rem 1.2rem 0; }
  .main { padding-top: 5.25rem; }
}
/* Schermi larghi: usa lo spazio che c'è davvero, non solo una colonna stretta al centro */
@media (min-width: 1300px) { .main { max-width: 1360px; padding-left: 3.2rem; padding-right: 3.2rem; } :root { --nav-w: 264px; } }
@media (min-width: 1600px) { .main { max-width: 1560px; padding-left: 4rem; padding-right: 4rem; } }
@media (min-width: 1300px) { .capture { padding-left: 3.2rem; padding-right: 3.2rem; } }
@media (min-width: 1600px) { .capture { padding-left: 4rem; padding-right: 4rem; } }
/* Tablet (iPad e simili, sotto la soglia della barra laterale): due colonne nella home invece di una sola pensata per il telefono */
@media (min-width: 640px) and (max-width: 699px) {
  .widgets.cols-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.25rem; }
  .widgets.cols-1 .widget.wide { grid-column: 1 / -1; }
  .main { max-width: 720px; margin: 0 auto; padding-left: 2rem; padding-right: 2rem; }
  .notes-layout { grid-template-columns: 260px 1fr; }
}

/* ================= Pagina ================= */
.page-head { margin: .25rem 0 1.25rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head .date { color: var(--ink-3); font-size: .95rem; }
.section { margin-top: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem .6rem; }
.card-head h2 { font-size: 1.1rem; }
.card-head .meta { font-size: .82rem; color: var(--ink-3); }
.card-head .meta a { color: var(--dusk); text-decoration: none; }
.card-head .meta a:hover { text-decoration: underline; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.section-title .meta { font-size: .85rem; color: var(--ink-3); }
.empty { padding: 1rem 1.1rem; color: var(--ink-3); }
.empty b { color: var(--ink-2); font-weight: 500; }
.empty a { color: var(--dusk); }
.list > * { border-top: 1px solid var(--line-2); }
.list > :first-child { border-top: 0; }

/* ================= Bottoni ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; line-height: 1.2; min-height: 38px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: #000; }
@media (prefers-color-scheme: dark) { .btn.primary:hover { background: #fff; } }
.btn.dawn { background: var(--dawn); color: #1E1B18; border-color: var(--dawn); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--warn); }
.btn.sm { padding: .35rem .75rem; font-size: .875rem; min-height: 32px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; color: var(--ink-3); padding: .35rem; border-radius: 8px; display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; }
.icon-btn:hover { color: var(--ink); background: var(--bg); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--dawn); }
.icon-btn.on svg { fill: var(--dawn); }

/* ================= Task ================= */
.task { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem 1rem; min-height: var(--tap); }
.task[draggable="true"] { cursor: grab; }
.task.dragging { opacity: .4; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: transparent; flex: none; margin-top: 2px; display: grid; place-items: center; padding: 0; transition: background .15s; }
.check:hover { border-color: var(--ink); }
.check.done { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.check svg { width: 13px; height: 13px; }
.task .title { line-height: 1.35; }
.task.done .title { color: var(--ink-3); text-decoration: line-through; }
.task .sub { font-size: .8rem; color: var(--ink-3); display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .1rem; }
.task .sub .late { color: var(--warn); }
.tag-bk { display: inline-flex; align-items: center; gap: .3rem; color: var(--bc, var(--ink-3)); font-weight: 600; }
.tag-bk i { width: 6px; height: 6px; border-radius: 50%; background: var(--bc, var(--ink-3)); display: inline-block; }
.prio { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: .3rem; vertical-align: middle; }
.prio.p1 { background: var(--warn); } .prio.p2 { background: var(--dawn); } .prio.p3 { background: var(--line); }
.task .actions { margin-left: auto; display: flex; gap: 0; opacity: 0; }
.task:hover .actions, .task:focus-within .actions { opacity: 1; }
@media (hover: none) { .task .actions { opacity: 1; } .task .actions .icon-btn[data-plan], .task .actions .icon-btn[data-edit] { display: none; } }

/* ================= Eventi ================= */
.event { display: flex; gap: .9rem; padding: .7rem 1rem; align-items: flex-start; min-height: var(--tap); }
.event time { font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 600; font-size: .85rem; color: var(--ink-2); width: 92px; flex: none; padding-top: .15rem; }
.event .bar { width: 3px; border-radius: 2px; background: var(--dusk); flex: none; align-self: stretch; }
.event.from-task .bar { background: var(--dawn); }
.event .title { line-height: 1.35; }
.event.done .title { color: var(--ink-3); text-decoration: line-through; }
.event .check { margin: 2px 0 0; }

/* ================= Widget (home) ================= */
.widgets { display: grid; gap: 1rem; margin-top: .25rem; }
.widgets.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.25rem; }
.widgets.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem 1.25rem; }
.widget { min-width: 0; }
.widgets.cols-2 .widget.wide, .widgets.cols-3 .widget.wide { grid-column: 1 / -1; }
.widget .card-head .icon-btn { min-width: 30px; min-height: 30px; }
.page-embed { padding: .5rem 1.1rem 1rem; font-size: .95rem; line-height: 1.6; white-space: pre-wrap; max-height: 320px; overflow: auto; color: var(--ink-2); }
.fin-head { display: grid; grid-template-columns: repeat(3, 1fr); }
.fin-head > div { padding: .85rem 1.1rem; }
.fin-head > div + div { border-left: 1px solid var(--line-2); }
.fin-head .k { font-size: .78rem; color: var(--ink-3); }
.fin-head .v { font-family: var(--serif); font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.v.neg { color: var(--warn); } .v.pos { color: var(--ok); }
.habits { display: flex; flex-wrap: wrap; gap: .45rem; padding: .5rem 1.1rem 1rem; }
.habit { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .45rem .9rem; font-size: .9rem; display: inline-flex; gap: .4rem; align-items: center; min-height: 38px; }
.habit.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Routine "Adesso" */
.now-card { background: var(--ink); color: var(--bg); border-radius: var(--r); padding: 1.25rem 1.4rem; margin: 0 0 1.25rem; box-shadow: var(--shadow-lg); }
.now-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .4rem; }
.now-label { font-size: .85rem; font-weight: 600; color: rgba(255,255,255,.75); font-family: var(--sans); }
.now-title { font-family: var(--serif); font-size: 2rem; font-weight: 500; margin: 0 0 .75rem; color: var(--bg); }
.now-body { font: 1rem/1.65 var(--sans); white-space: pre-wrap; margin: 0; color: rgba(245,245,242,.9); max-width: 68ch; }
.now-card .btn.dawn { border-color: var(--dawn); }
.now-card .btn.primary { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.next-line { font-size: .9rem; color: var(--ink-2); margin: -.25rem 0 1rem; display: flex; gap: .5rem; align-items: center; }
@media (prefers-color-scheme: dark) { .now-card { background: #0E1218; } }

/* Onboarding */
.start { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.start h2 { margin-bottom: .25rem; }
.start .steps { display: grid; gap: .5rem; margin-top: .75rem; }
.start .step { display: flex; gap: .8rem; align-items: center; padding: .6rem .8rem; border-radius: var(--r-sm); background: var(--bg); text-decoration: none; min-height: var(--tap); }
.start .step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--dawn); color: #1E1B18; display: grid; place-items: center; font-size: .8rem; font-weight: 600; flex: none; }
.start .step.done .n { background: var(--ok); color: #fff; }
.start .step .t { flex: 1; }
.start .step .t small { display: block; color: var(--ink-3); }
.start .close { margin-left: auto; }

/* ================= Routine ================= */
.routines { display: grid; gap: 1rem; }
@media (min-width: 700px) { .routines { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rcard { padding: 1rem 1.1rem; }
.rcard .rt { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.rcard h3 { font-size: 1.15rem; }
.rcard .rtime { font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); font-size: .92rem; }
.rcard .rdays { display: flex; gap: .25rem; margin: .5rem 0; }
.rcard .rdays span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; color: var(--ink-3); background: var(--bg); }
.rcard .rdays span.on { background: var(--ink); color: var(--bg); }
.rcard .rbody { white-space: pre-wrap; color: var(--ink-2); font-size: .92rem; line-height: 1.55; max-height: 120px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.rcard .rfoot { display: flex; gap: .4rem; margin-top: .75rem; align-items: center; }
.rcard .rfoot .small { margin-left: auto; }
.templates { display: flex; gap: .5rem; flex-wrap: wrap; }
.tpl { border: 1px dashed var(--line); background: transparent; border-radius: var(--r); padding: .8rem 1rem; text-align: left; flex: 1 1 200px; color: var(--ink); }
.tpl:hover { border-color: var(--dawn); background: var(--dawn-soft); }
.tpl b { display: block; font-family: var(--serif); font-weight: 500; }
.tpl small { color: var(--ink-3); }

/* ================= Pagine (Notion-like) ================= */
.page-editor { max-width: 780px; }
.crumbs { font-size: .85rem; color: var(--ink-3); display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.crumbs a { text-decoration: none; color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.page-title-row { display: flex; align-items: center; gap: .5rem; }
.page-icon { width: 46px; height: 46px; border: 0; background: transparent; font-size: 1.9rem; border-radius: var(--r-sm); display: grid; place-items: center; }
.page-icon:hover { background: var(--bg); }
.page-title { flex: 1; width: 100%; max-width: 100%; border: 0; background: transparent; font-family: var(--serif); font-size: 2rem; padding: .25rem 0; min-width: 0; }
.page-title-row { min-width: 0; }
.page-editor { min-width: 0; max-width: 100%; }
.page-title:focus { outline: 0; }
.page-tools { display: flex; gap: .15rem; align-items: center; margin: .25rem 0 .75rem; flex-wrap: wrap; }
.page-body { width: 100%; min-height: 50dvh; border: 0; background: transparent; padding: .5rem 0 2rem; line-height: 1.7; font-size: 1.05rem; resize: vertical; }
.page-body:focus { outline: 0; }
/* Sottopagine: una striscia subito sotto il titolo, come i link a pagina di Notion — non più in fondo, dopo un'area di testo vuota. */
.subpage-strip { display: flex; gap: .5rem; flex-wrap: wrap; margin: .3rem 0 1.1rem; }
.subpage-strip:empty { display: none; }
.sp-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-decoration: none; color: var(--ink); font-size: .9rem; max-width: 220px; }
.sp-chip .ic { flex: none; }
.sp-chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-chip:hover { border-color: var(--ink-3); }
.sp-chip.sp-add { background: transparent; border-style: dashed; color: var(--ink-2); cursor: pointer; font: inherit; }
.sp-chip.sp-add:hover { border-color: var(--dawn); color: var(--ink); }
.subpages { margin-top: 1rem; }
.subpages .sp { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; text-decoration: none; min-height: var(--tap); }
.subpages .sp .ic { width: 22px; text-align: center; }
.subpages .sp .p { color: var(--ink-3); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pages-grid { display: grid; gap: .75rem; }
@media (min-width: 640px) { .pages-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.pg-sec-h { font: 700 .72rem var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 1.5rem 0 .6rem; }
.pg-sec-h:first-child { margin-top: 0; }
.pcard { padding: .9rem 1rem; text-decoration: none; display: block; min-height: 96px; transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pcard .ic { font-size: 1.15rem; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; }
.pcard .t { font-family: var(--serif); font-size: 1.1rem; margin-top: .55rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .p { color: var(--ink-3); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .k { color: var(--ink-3); font-size: .75rem; margin-top: .3rem; }
.fav-grid .pcard { background: linear-gradient(160deg, var(--dawn-soft), var(--surface) 60%); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: .2rem; }
.emoji-grid button { border: 0; background: transparent; font-size: 1.4rem; padding: .3rem; border-radius: 8px; }
.emoji-grid button:hover { background: var(--bg); }
.emoji-grid button.emoji-none { color: var(--ink-3); border: 1px dashed var(--line); }

/* ================= Diario ================= */
.moods { display: flex; gap: .4rem; }
.mood { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 1.15rem; }
.mood.on { border-color: var(--ink); background: var(--dawn-soft); }
.mood.sm { width: 32px; height: 32px; font-size: .9rem; }
.journal-editor textarea { width: 100%; min-height: 220px; border: 0; background: transparent; resize: vertical; padding: 1rem 1.1rem; line-height: 1.7; font-family: var(--serif); font-size: 1.1rem; }
.journal-editor textarea:focus { outline: 0; }
.context { padding: .75rem 1.1rem; border-top: 1px solid var(--line-2); font-size: .875rem; color: var(--ink-2); display: grid; gap: .3rem; background: var(--surface-2); }
.context b { font-weight: 500; color: var(--ink); }
.journal-day { display: flex; gap: 1rem; padding: .75rem 1rem; text-decoration: none; min-height: var(--tap); align-items: center; }
.journal-day .d { font-family: var(--serif); width: 110px; flex: none; }
.journal-day .p { color: var(--ink-2); font-size: .9rem; }

/* ================= Finanze ================= */
.tx { display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; min-height: var(--tap); }
.tx .cat { font-size: .75rem; color: var(--ink-3); }
.tx .amt { font-family: var(--sans); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; }
.tx .amt.in { color: var(--ok); }
.tx .day { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--ink-3); width: 30px; flex: none; }
.cat-row { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; padding: .6rem 1rem; align-items: center; }
.cat-row .track { grid-column: 1 / -1; height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.cat-row .fill { height: 100%; background: var(--dusk); }
.cat-row .fill.over { background: var(--warn); }
.cat-row .budget-input { width: 92px; text-align: right; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .5rem; background: var(--bg); }

/* ================= Calendario ================= */
.cal-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cal-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem; align-items: start; }
.week { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.week-head { display: grid; grid-template-columns: 52px repeat(var(--days, 7), minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.week-head div { padding: .5rem .35rem; text-align: center; font-size: .78rem; color: var(--ink-2); border-left: 1px solid var(--line-2); }
.week-head div:first-child { border-left: 0; }
.week-head .today { color: var(--ink); }
.week-head .today .dn { background: var(--ink); color: var(--bg); border-radius: 50%; width: 30px; height: 30px; line-height: 30px; margin: 2px auto 0; }
.week-head .dn { font-family: var(--serif); font-size: 1.1rem; display: block; }
.allday { display: grid; grid-template-columns: 52px repeat(var(--days, 7), minmax(0, 1fr)); border-bottom: 1px solid var(--line); min-height: 28px; }
.allday > div { border-left: 1px solid var(--line-2); padding: 2px; }
.allday > div:first-child { border-left: 0; }
.week-body { display: grid; grid-template-columns: 52px repeat(var(--days, 7), minmax(0, 1fr)); max-height: 62dvh; overflow: auto; position: relative; }
.hours { position: relative; }
.hours div { height: var(--hour-h); font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--ink-3); text-align: right; padding-right: 6px; transform: translateY(-7px); font-family: var(--sans); }
.day-col { position: relative; border-left: 1px solid var(--line-2); height: calc(var(--hour-h) * 24); background-image: linear-gradient(var(--line-2) 1px, transparent 1px); background-size: 100% var(--hour-h); }
.day-col.drop { background-color: var(--dawn-soft); }
.chip { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 2px 6px; font-size: .75rem; line-height: 1.25; overflow: hidden; background: var(--dusk); color: #fff; cursor: pointer; }
.chip.from-task { background: var(--dawn); color: #1E1B18; }
.chip.task-chip { background: transparent; color: var(--ink); border: 1px dashed var(--dawn); }
.chip.allday-chip { position: static; display: block; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--warn); pointer-events: none; }
.side-tasks { position: sticky; top: 5.25rem; }
.side-tasks .task { padding: .55rem .8rem; }

/* ================= Altro (mobile) ================= */
.menu-list a { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; text-decoration: none; min-height: 56px; }
.menu-list a svg { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
.menu-list a .ic { width: 22px; text-align: center; font-size: 1.2rem; }
.menu-list a .chev { margin-left: auto; width: 16px; height: 16px; }
.menu-list a small { display: block; color: var(--ink-3); font-size: .8rem; }

/* ================= Form / modale ================= */
.modal-bg { position: fixed; inset: 0; background: rgba(25,28,31,.45); display: grid; place-items: end center; z-index: 50; }
@media (min-width: 640px) { .modal-bg { place-items: center; padding: 1rem; } }
.modal { background: var(--surface); border-radius: 20px 20px 0 0; width: 100%; max-width: 540px; padding: 1.25rem 1.25rem max(1.25rem, env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto; box-shadow: var(--shadow-lg); }
@media (min-width: 640px) { .modal { border-radius: 16px; } }
.modal h2 { margin-bottom: 1rem; }
.field { display: grid; gap: .3rem; margin-bottom: .85rem; }
.field label { font-size: .85rem; color: var(--ink-2); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem; background: var(--bg); width: 100%; min-height: 44px; font-size: 16px; box-sizing: border-box; }
.field textarea { min-height: 0; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--dawn); box-shadow: 0 0 0 3px var(--dawn-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button, .seg a { border: 0; background: transparent; padding: .45rem .85rem; color: var(--ink-2); text-decoration: none; font-size: .9rem; min-height: 36px; display: inline-flex; align-items: center; }
.seg button.on, .seg a.on { background: var(--ink); color: var(--bg); }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.modal-actions .left { margin-right: auto; }
.daypick { display: flex; gap: .35rem; flex-wrap: wrap; }
.daypick label { position: relative; }
.daypick input { position: absolute; opacity: 0; inset: 0; }
.daypick span { display: inline-grid; place-items: center; min-width: 42px; height: 38px; padding: 0 .5rem; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--ink-2); background: var(--surface); }
.daypick input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.daypick input:focus-visible + span { outline: 2px solid var(--dawn); }
.toast { position: fixed; left: 50%; bottom: 8.5rem; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .65rem 1.1rem; border-radius: 999px; font-size: .9rem; z-index: 60; box-shadow: var(--shadow-lg); max-width: 92vw; text-align: center; }
@media (min-width: 700px) { .toast { bottom: 2rem; } }
.install-banner { border: 1px solid var(--line); background: var(--dawn-soft); border-radius: var(--r); padding: .75rem 1rem; display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.note-foot { border-top: 1px solid var(--line-2); padding: .6rem .9rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; background: var(--surface-2); }

/* ================= Mobile ================= */
.tabbar { display: none; }
@media (max-width: 699px) {
  .shell { grid-template-columns: 1fr; }
  .nav { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem;
    padding-top: max(.6rem, env(safe-area-inset-top));
    position: fixed; top: 0; left: 0; right: 0; background: var(--bg); z-index: 50;
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; font-size: 1.25rem; }
  /* La barra è "fixed", quindi fuori dalla griglia di .shell: niente più altezze diverse per pagina (bug corretto). */
  .main { padding: calc(3.4rem + env(safe-area-inset-top)) 1rem 9.5rem; }
  h1 { font-size: 1.65rem; }
  .card-head h2 { font-size: 1.05rem; }
  .capture { left: 0; top: auto; bottom: calc(66px + env(safe-area-inset-bottom)); padding: .5rem .75rem; background: linear-gradient(transparent, var(--bg) 40%); }
  .capture form { max-width: none; box-shadow: var(--shadow-lg); }
  .capture .preview { padding: 0 1rem .35rem; }
  .capture .hint { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: .35rem 0 max(.35rem, env(safe-area-inset-bottom)); height: calc(66px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; font-size: .72rem; color: var(--ink-3); text-decoration: none; padding: .3rem 0; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--ink); }
  .cal-layout { grid-template-columns: 1fr; }
  .side-tasks { position: static; }
  .week-body { max-height: 52dvh; }
  .fin-head .v { font-size: 1.15rem; }
  .event time { width: 76px; }
  .page-title { font-size: 1.6rem; }
  .now-card { padding: 1rem 1.1rem; }
  .now-title { font-size: 1.5rem; }
  .widgets { gap: .85rem; }
  .modal .grid2 { grid-template-columns: 1fr 1fr; }
}

/* Separatori per righe direttamente dentro una card */
.card > .task, .card > .event, .card > .tx, .card > .journal-day, .card > .cat-row, .card > .sp, .card > .menu-list > a { border-top: 1px solid var(--line-2); }
.card > :first-child, .card > .menu-list > a:first-child { border-top: 0; }
.card > .card-head + * { border-top: 0; }

/* =====================================================================
   v0.4 — minimal, moderno, professionale
   Meno linee, niente ombre sulle card, etichette piccole in maiuscoletto, aria attorno alle cose.
   ===================================================================== */
:root { --r: 12px; --r-sm: 8px; --shadow: none; --line: #E4DED2; --line-2: #EFEAE0; --bg: #F8F5EF; }
@media (prefers-color-scheme: dark) { :root { --line: #35302A; --line-2: #2A251E; --bg: #17140F; } }

/* Tipografia: il serif resta solo ai titoli grandi; le etichette sono sans, piccole, maiuscole */
h1 { font-weight: 400; letter-spacing: -0.02em; }
.page-head { margin: .25rem 0 1.5rem; }
.page-head .date { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.card-head h2, .section-title h2 { font-family: var(--serif); font-size: 1.05rem; font-weight: 500; letter-spacing: -.005em; text-transform: none; color: var(--ink); }
.card-head { padding: .85rem 1.1rem .35rem; }
.card-head .meta, .section-title .meta { font-size: .78rem; }
.card-head .meta a { color: var(--ink-3); }
.card-head .meta a:hover { color: var(--ink); text-decoration: none; }
.section { margin-top: 1.75rem; }

/* Card e liste: un solo bordo sottile, nessuna ombra */
.card { box-shadow: none; border-color: var(--line); }
.week, .modal { box-shadow: none; }
.modal { box-shadow: var(--shadow-lg); }
.now-card { box-shadow: none; }
.start { box-shadow: none; }
.start .step { background: transparent; border: 1px solid var(--line); }

/* Sidebar: stesso fondo della pagina, niente bordo; la voce attiva è un rettangolo bianco */
.nav { background: var(--bg); border-right: 0; padding: 1.1rem .9rem; }
.brand { font-size: 1.25rem; padding-bottom: 1.25rem; }
.brand small { background: transparent; color: var(--ink-3); padding: 0; letter-spacing: .06em; text-transform: uppercase; font-size: .6rem; }
.nav a { color: var(--ink-2); border-radius: var(--r-sm); }
.nav a.active { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding-top: calc(.5rem - 1px); padding-bottom: calc(.5rem - 1px); }
.nav a.active svg { color: var(--ink); }
.nav-group .gt { text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 600; padding-top: .35rem; }
.nav-user { border-top: 0; }
.avatar { background: var(--ink); }

/* Bottoni: angoli morbidi, non pillole; il primario è l'unico pieno */
.btn { border-radius: 10px; }
.btn.dawn { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.sm { border-radius: 8px; }
.seg { border-radius: 10px; }
.seg button.on, .seg a.on { border-radius: 8px; }
.habit { border-radius: 10px; }
.check { border-width: 1.5px; border-color: var(--line); }
.check:hover { border-color: var(--ink-3); }
.prio.p2 { background: var(--dawn); }

/* Cattura: rettangolo morbido, bordo sottile */
.capture form { border-radius: 12px; box-shadow: none; padding: .25rem .35rem; }
.capture form:focus-within { border-color: var(--ink); box-shadow: none; }
.capture .go { border-radius: 9px; }
.capture .preview { color: var(--ink-3); }
@media (max-width: 699px) { .capture form { box-shadow: 0 6px 24px rgba(25,28,31,.10); } }

/* Routine "Adesso": più piatta, il tempo in alto come etichetta */
.now-card { border-radius: var(--r); padding: 1.35rem 1.5rem; }
.now-label { text-transform: uppercase; letter-spacing: .08em; font-family: var(--sans); font-size: .72rem; font-weight: 600; }
.now-title { font-weight: 400; }

/* Widget in modalità Organizza: più discreto */

/* Pagine */
.page-title { font-weight: 400; }
.pcard .t { font-weight: 400; }
.crumbs { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }

/* Diario/finanze */
.fin-head .v { font-weight: 400; }
.journal-editor textarea { font-size: 1.08rem; }
.context { background: transparent; }
.note-foot { background: transparent; }

/* Revisione AI: riformulazione sopra, parole originali sotto */
.review { display: grid; gap: .75rem; }
.rv { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .6rem .75rem; }
.rv-kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; margin-bottom: .3rem; }
.rv input { width: 100%; border: 0; background: transparent; font-size: 1rem; padding: .15rem 0; }
.rv input:focus { outline: 0; border-bottom: 1px solid var(--dawn); }
.rv-orig { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: .9rem; margin-top: .3rem; }
.rv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.rv-del { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); background: var(--surface-2); }
.rv-del:hover { color: var(--warn); }
.rv-times { display: flex; align-items: center; gap: .4rem; margin-top: .3rem; }
.rv-times input, .rv-time-1 { width: auto !important; border: 1px solid var(--line) !important; border-radius: 8px; padding: .3rem .5rem !important; font-size: .92rem !important; }
.rv-time-1 { margin-top: .3rem; display: block; }

/* Tab bar mobile: più leggera */
.tabbar { border-top-color: var(--line); }
.tabbar a.active svg { color: var(--ink); }
.topbar .brand { font-size: 1.15rem; }

/* =====================================================================
   v0.5 — colore con misura, tema forzabile, calendario tondeggiante
   ===================================================================== */
/* Colori di modulo (chiaro) */
:root {
  --c-oggi: #C8901A; --c-oggi-soft: #FBF1D8;
  --c-att: #2F6FDE; --c-att-soft: #E6EEFC;
  --c-cal: #7A4FD6; --c-cal-soft: #EFE9FA;
  --c-dia: #D0527A; --c-dia-soft: #FBE7EE;
  --c-fin: #2E9C64; --c-fin-soft: #E4F5EB;
  --c-rou: #1E9FA8; --c-rou-soft: #E1F5F6;
  --c-pag: #6B7280; --c-pag-soft: #EEF0F3;
  --today: #E5443B;
}
/* Scuro: automatico o forzato */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-oggi: #E2AE2C; --c-oggi-soft: #2C2512; --c-att: #7FA6F0; --c-att-soft: #1B2740; --c-cal: #B39AEB; --c-cal-soft: #271F3B;
    --c-dia: #F08AAB; --c-dia-soft: #3A1E2A; --c-fin: #6FD09A; --c-fin-soft: #163024; --c-rou: #67CFD6; --c-rou-soft: #12303A; --c-pag: #A3A9B4; --c-pag-soft: #232830;
  }
}
[data-theme="dark"] {
  --bg: #17140F; --surface: #211D18; --surface-2: #27221B; --ink: #ECE7DE; --ink-2: #C7BFB1; --ink-3: #96897A;
  --line: #35302A; --line-2: #2A251E; --dawn: #E2AE2C; --dawn-soft: #2E2812; --dawn-ink: #F0C55A; --dusk: #A79C8A; --dusk-soft: #2B261E;
  --ok: #3FA66A; --ok-soft: #17301F; --warn: #DA5E52; --warn-soft: #3A1E1D; --shadow: none; --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --c-oggi: #E2AE2C; --c-oggi-soft: #2C2512; --c-att: #7FA6F0; --c-att-soft: #1B2740; --c-cal: #B39AEB; --c-cal-soft: #271F3B;
  --c-dia: #F08AAB; --c-dia-soft: #3A1E2A; --c-fin: #6FD09A; --c-fin-soft: #163024; --c-rou: #67CFD6; --c-rou-soft: #12303A; --c-pag: #A3A9B4; --c-pag-soft: #232830;
}
[data-theme="light"] {
  --bg: #F8F5EF; --surface: #FFFFFF; --surface-2: #F4F0E8; --ink: #1E1B18; --ink-2: #5C5650; --ink-3: #96897A;
  --line: #E4DED2; --line-2: #EFEAE0; --dawn: #D9A21B; --dawn-soft: #FBF3DC; --dawn-ink: #7A5A0C; --dusk: #8A7F6E; --dusk-soft: #F1ECE2;
  --ok-soft: #E9F4EC; --warn-soft: #F8E9E8; --shadow: none;
  --c-oggi: #C8901A; --c-oggi-soft: #FBF1D8; --c-att: #2F6FDE; --c-att-soft: #E6EEFC; --c-cal: #7A4FD6; --c-cal-soft: #EFE9FA;
  --c-dia: #D0527A; --c-dia-soft: #FBE7EE; --c-fin: #2E9C64; --c-fin-soft: #E4F5EB; --c-rou: #1E9FA8; --c-rou-soft: #E1F5F6; --c-pag: #6B7280; --c-pag-soft: #EEF0F3;
}
[data-theme="dark"] .now-card { background: #0E1218; }
[data-theme="dark"] .mark .mk-h, [data-theme="dark"] .brand .mk-h { fill: #ECE7DE; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mk-h { fill: #ECE7DE; } }
.brand .mark { flex: none; }

/* Icone del menu colorate: ogni modulo ha il suo */
.nav a[href="#oggi"] svg, .tabbar a[href="#oggi"] svg { color: var(--c-oggi); }
.nav a[href="#attivita"] svg, .tabbar a[href="#attivita"] svg { color: var(--c-att); }
.nav a[href="#calendario"] svg, .tabbar a[href="#calendario"] svg { color: var(--c-cal); }
.nav a[href="#diario"] svg, .tabbar a[href="#diario"] svg { color: var(--c-dia); }
.nav a[href="#finanze"] svg { color: var(--c-fin); }
.nav a[href="#routine"] svg { color: var(--c-rou); }
/* Pillole colorate al posto delle linee: un cerchietto morbido con dentro un emoji, lo stesso colore
   di sempre per ogni voce — e siccome quel colore cambia già da solo con il tema, cambia anche la
   pillola, senza bisogno di un secondo sistema di colori parallelo. */
.nic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px; flex: none; line-height: 1; background: var(--surface-2); }
.nic svg { width: 18px; height: 18px; }
.tabbar .nic { width: 28px; height: 28px; border-radius: 9px; }
.tabbar .nic svg { width: 18px; height: 18px; }
a[href="#oggi"] .nic { background: var(--c-oggi-soft); }
a[href="#attivita"] .nic { background: var(--c-att-soft); }
a[href="#calendario"] .nic { background: var(--c-cal-soft); }
a[href="#diario"] .nic { background: var(--c-dia-soft); }
a[href="#finanze"] .nic { background: var(--c-fin-soft); }
a[href="#routine"] .nic { background: var(--c-rou-soft); }
a[href="#pagine"] .nic { background: var(--c-pag-soft); }
a[href="#assistente"] .nic { background: var(--c-oggi-soft); }
a[href="#chatta"] .nic { background: var(--c-att-soft); }
a[href="#altro"] .nic, a[href="#impostazioni"] .nic { background: var(--surface-2); }
.nav a.active svg { color: inherit; }
.nav a.active[href="#oggi"] { background: var(--c-oggi-soft); border-color: transparent; }
.nav a.active[href="#attivita"] { background: var(--c-att-soft); border-color: transparent; }
.nav a.active[href="#calendario"] { background: var(--c-cal-soft); border-color: transparent; }
.nav a.active[href="#diario"] { background: var(--c-dia-soft); border-color: transparent; }
.nav a.active[href="#finanze"] { background: var(--c-fin-soft); border-color: transparent; }
.nav a.active[href="#routine"] { background: var(--c-rou-soft); border-color: transparent; }
.nav a.active[href="#oggi"] svg { color: var(--c-oggi); } .nav a.active[href="#attivita"] svg { color: var(--c-att); } .nav a.active[href="#calendario"] svg { color: var(--c-cal); }
.nav a.active[href="#diario"] svg { color: var(--c-dia); } .nav a.active[href="#finanze"] svg { color: var(--c-fin); } .nav a.active[href="#routine"] svg { color: var(--c-rou); }
.tabbar a { color: var(--ink-3); } .tabbar a svg { color: var(--ink-3); }
.tabbar a.active[href="#oggi"] svg { color: var(--c-oggi); } .tabbar a.active[href="#attivita"] svg { color: var(--c-att); } .tabbar a.active[href="#calendario"] svg { color: var(--c-cal); } .tabbar a.active[href="#diario"] svg { color: var(--c-dia); }
.menu-list a[href="#finanze"] svg { color: var(--c-fin); } .menu-list a[href="#routine"] svg { color: var(--c-rou); } .menu-list a[href="#pagine"] svg { color: var(--c-pag); }

/* Etichette dei blocchi con un punto colorato */
.widget .card { border-left: 3px solid var(--line); }
.widget[data-w="programma"] .card { border-left-color: var(--c-cal); }
.widget[data-w="dafare"] .card { border-left-color: var(--c-att); }
.widget[data-w="diario"] .card { border-left-color: var(--c-dia); }
.widget[data-w="soldi"] .card { border-left-color: var(--c-fin); }
.widget[data-w="routine"] .card { border-left-color: var(--c-rou); }
.widget[data-w="abitudini"] .card { border-left-color: var(--c-oggi); }
.widget[data-w="preferiti"] .card, .widget[data-w^="pagina:"] .card { border-left-color: var(--c-pag); }
.event .bar { background: var(--c-cal); }
.event.from-task .bar { background: var(--c-att); }
.habit.on { background: var(--c-oggi); border-color: var(--c-oggi); color: #1E1B18; }
.check.done { background: var(--c-att); border-color: var(--c-att); color: #fff; }
.start .step .n { background: var(--c-oggi); }
.start .step.done .n { background: var(--c-fin); }
.tx .amt.in { color: var(--c-fin); }
.cat-row .fill { background: var(--c-fin); }
.now-card { background: var(--c-rou); color: #fff; }
.now-label { color: rgba(255,255,255,.75); }
.now-body { color: rgba(255,255,255,.92); }
.now-title { color: #fff; }
.now-card .btn.dawn { background: #fff; color: #135F66; border-color: #fff; }
.now-card .btn.primary { background: rgba(255,255,255,.18); color: #fff; border-color: transparent; }
.rcard h3 { color: var(--c-rou); }
.rcard .rdays span.on { background: var(--c-rou); color: #fff; }
.mood.on { border-color: var(--c-dia); background: var(--c-dia-soft); }
.pcard .ic { line-height: 1; }
.install-banner { background: var(--c-att-soft); border-color: transparent; }
.install-banner .btn.primary { background: var(--c-att); border-color: var(--c-att); color: #fff; }

/* Calendario: griglia leggera, eventi tondeggianti in pastello, oggi cerchiato */
.week { border-color: var(--line); }
.week-head { border-bottom-color: var(--line-2); }
.week-head div { border-left: 0; padding: .6rem .35rem .5rem; }
.week-head .wd { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.week-head .today .wd { color: var(--today); }
.week-head .dn { font-family: var(--sans); font-size: 1.15rem; font-weight: 500; width: 32px; height: 32px; line-height: 32px; margin: 2px auto 0; border-radius: 50%; }
.week-head .today .dn { background: var(--today); color: #fff; }
.allday { border-bottom-color: var(--line-2); }
.allday > div { border-left-color: var(--line-2); }
.day-col { border-left-color: var(--line-2); background-image: linear-gradient(var(--line-2) 1px, transparent 1px); }
.hours div { color: var(--ink-3); font-family: var(--sans); font-size: .68rem; }
.chip { left: 3px; right: 4px; border-radius: 7px; padding: 3px 7px; background: var(--c-cal-soft); color: var(--ink); border-left: 3px solid var(--c-cal); font-size: .74rem; line-height: 1.25; }
.chip b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip span { display: block; color: var(--ink-3); font-size: .68rem; }
.chip.from-task { background: var(--c-att-soft); border-left-color: var(--c-att); color: var(--ink); }
.chip.task-chip { background: var(--surface); border: 1px dashed var(--c-att); border-left: 3px solid var(--c-att); }
.chip.allday-chip { background: var(--c-cal-soft); border-left-color: var(--c-cal); border-radius: 6px; }
.chip:hover { filter: brightness(.97); }
.now-line { background: var(--today); }
.now-line i { position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--today); }
.day-col.drop { background-color: var(--c-att-soft); }
.side-tasks .card { border-color: var(--line); }
.cal-tools .btn.dawn { background: var(--c-cal); border-color: var(--c-cal); color: #fff; }
.week-body::-webkit-scrollbar { width: 8px; } .week-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* =====================================================================
   v0.6 — smooth: splash 0,5 s, transizioni, onda vocale, assistente
   ===================================================================== */
/* Splash: la trama si compone in mezzo secondo e sparisce */
#splash { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; transition: opacity .25s ease, visibility .25s; }
#splash.out { opacity: 0; visibility: hidden; }
.splash-mark { width: 64px; height: 64px; }
.splash-mark .sh rect { fill: var(--ink); transform-origin: left center; transform: scaleX(0); animation: sx .28s cubic-bezier(.2,.7,.2,1) forwards; }
.splash-mark .sv rect { fill: var(--dawn); transform-origin: center top; transform: scaleY(0); animation: sy .28s .12s cubic-bezier(.2,.7,.2,1) forwards; }
.splash-mark .sh rect:nth-child(2) { animation-delay: .05s; } .splash-mark .sh rect:nth-child(3) { animation-delay: .1s; }
.splash-mark .sv rect:nth-child(2) { animation-delay: .17s; } .splash-mark .sv rect:nth-child(3) { animation-delay: .22s; }
.splash-mark g.sh:last-child rect { animation: fade .15s .3s forwards; opacity: 0; transform: none; }
@keyframes sx { to { transform: scaleX(1); } } @keyframes sy { to { transform: scaleY(1); } } @keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .splash-mark rect { animation: none !important; transform: none !important; opacity: 1 !important; } }

/* Transizione tra viste + skeleton */
#view { opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease; }
#view.in { opacity: 1; transform: none; }
.skel { display: grid; gap: .75rem; padding-top: .5rem; }
.sk { height: 56px; border-radius: var(--r); background: linear-gradient(90deg, var(--line-2), var(--surface), var(--line-2)); background-size: 200% 100%; animation: sh 1.1s linear infinite; }
.sk.h { height: 34px; width: 55%; } .sk.s { height: 40px; width: 70%; }
@keyframes sh { to { background-position: -200% 0; } }

/* Micro-interazioni: tocco che risponde */
.btn, .check, .habit, .tabbar a, .nav a, .task, .event, .tx, .sp, .menu-list a, .pcard, .mood, .icon-btn { transition: transform .12s ease, background-color .15s ease, color .15s ease, border-color .15s ease, opacity .15s; }
.btn:active, .habit:active, .mood:active, .icon-btn:active { transform: scale(.96); }
.tabbar a:active svg { transform: scale(.9); }
.tabbar a svg { transition: transform .12s ease, color .15s; }
.check.done { animation: pop .18s ease; } @keyframes pop { 50% { transform: scale(1.18); } }
.card { transition: border-color .15s ease; }
.modal-bg { animation: fadein .15s ease; } @keyframes fadein { from { opacity: 0; } }
.modal { animation: sheet .22s cubic-bezier(.2,.8,.2,1); } @keyframes sheet { from { transform: translateY(24px); opacity: .6; } }
.toast { animation: toastin .2s cubic-bezier(.2,.8,.2,1); } @keyframes toastin { from { transform: translate(-50%, 8px); opacity: 0; } }
html { scroll-behavior: smooth; }
* { -webkit-tap-highlight-color: transparent; }

/* Cattura: microfono → onda al posto del testo */
/* Barrette: si muovono mentre parli, ferme nel silenzio. Non toccano il microfono. */
.vbars { display: none; align-items: center; gap: 3px; height: 24px; padding: 0 2px; flex: none; }
.capture.listening .vbars { display: flex; }
.vbars i { width: 3px; height: 5px; border-radius: 2px; background: var(--c-att); transition: height .15s; }
.capture.speaking .vbars i { animation: vb .5s ease-in-out infinite; }
.capture.speaking .vbars i:nth-child(2) { animation-delay: .08s; } .capture.speaking .vbars i:nth-child(3) { animation-delay: .16s; } .capture.speaking .vbars i:nth-child(4) { animation-delay: .24s; } .capture.speaking .vbars i:nth-child(5) { animation-delay: .32s; }
@keyframes vb { 50% { height: 20px; } }
.capture form { position: relative; transition: border-color .15s, box-shadow .15s; }
.capture.listening form { border-color: var(--c-att); }
.capture.thinking .go { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.capture .mic.rec { animation: none; background: var(--c-att); color: #fff; }

/* Bolla dell'assistente */
.abubble { pointer-events: auto; max-width: 720px; margin: 0 0 .5rem; background: var(--ink); color: var(--bg); border-radius: 14px; padding: .8rem 1rem; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; cursor: pointer; }
.abubble.in { opacity: 1; transform: none; }
.ab-reply { font-size: .95rem; line-height: 1.45; }
.ab-done { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.ab-done span { font-size: .75rem; background: rgba(255,255,255,.12); padding: .2rem .55rem; border-radius: 999px; }
.ab-more { display: block; margin-top: .4rem; font-size: .75rem; color: var(--dawn); text-decoration: none; }
@media (min-width: 700px) { .capture { flex-direction: column-reverse; } .abubble { margin: .5rem 0 0; } }

/* Conversazione */
.chat { display: grid; gap: .5rem; }
.msg { display: flex; } .msg.user { justify-content: flex-end; }
.bub { max-width: 78%; padding: .6rem .9rem; border-radius: 16px; line-height: 1.45; font-size: .95rem; white-space: pre-wrap; }
.msg.user .bub { background: var(--c-att); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant .bub { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.chat-empty { padding: 1.5rem 1rem; text-align: center; }
.nav a[href="#assistente"] svg { color: var(--c-oggi); }
.nav a.active[href="#assistente"] { background: var(--c-oggi-soft); border-color: transparent; }
.menu-list a[href="#assistente"] svg { color: var(--c-oggi); }

/* Mobile: più aria, meno rumore */
@media (max-width: 699px) {
  .card { border-radius: 16px; }
  .task, .event, .tx { padding-left: 1.1rem; padding-right: .8rem; }
  .capture form { padding: .35rem .4rem; border-radius: 16px; }
  .capture .go, .capture .mic { width: 40px; height: 40px; border-radius: 12px; }
  .tabbar { height: calc(66px + env(safe-area-inset-bottom)); padding-top: .4rem; }
  .tabbar a { font-size: .72rem; letter-spacing: .01em; }
  .tabbar a.active { font-weight: 600; }
  .page-head { margin-bottom: 1rem; }
  .now-card { border-radius: 18px; }
  .abubble { margin-bottom: .6rem; }
}
@media (max-width: 699px) { .install-banner { padding: .55rem .75rem; border-radius: 12px; } .install-banner .small { display: none; } .install-banner b { font-weight: 500; font-size: .9rem; } }


/* =============== Home mobile più essenziale =============== */
.start-line { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; margin-bottom: 1rem; font-size: .92rem; }
.start-line .n { font-size: .7rem; font-weight: 600; color: var(--c-oggi); background: var(--c-oggi-soft); padding: .15rem .45rem; border-radius: 999px; }
.start-line svg { color: var(--ink-3); }
.fin-line { display: flex; justify-content: space-between; gap: .5rem; padding: .8rem 1.1rem; text-decoration: none; font-size: .8rem; color: var(--ink-3); }
.fin-line b { display: block; font-family: var(--serif); font-size: 1.05rem; font-weight: 400; color: var(--ink); }
.fin-line b.neg { color: var(--warn); } .fin-line b.pos { color: var(--ok); }
@media (max-width: 699px) {
  .card-head { padding: .75rem 1.1rem .25rem; }
  .card-head .meta a { display: none; }
  .widget[data-w="dafare"] .card-head .meta a, .widget[data-w="programma"] .card-head .meta a { display: inline; }
  .widget .card { border-left-width: 3px; }
  .empty { padding: .8rem 1.1rem; font-size: .92rem; }
  .task .sub, .event .small { font-size: .76rem; }
  .task .sub span:nth-child(n+3) { display: none; }
  .next-line { font-size: .85rem; }
  .page-head .row .btn.sm.icon { width: 34px; min-height: 34px; }
  h1 { font-size: 1.55rem; }
  .now-card { padding: 1rem 1.1rem .9rem; }
  .now-body { font-size: .95rem; max-height: 9.5rem; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
}

/* Registrazione (Whisper): onda vera al posto delle barrette */
#wave { display: none; flex: 1; height: 36px; min-width: 0; }
.capture.recorder.listening #wave { display: block; }
.capture.recorder.listening #capture { display: none; }
.capture.recorder .vbars { display: none !important; }
.capture .mic.busy { color: var(--ink-3); background: var(--line-2); pointer-events: none; }

/* =============== v0.9: ambiti, calendario a scorrimento, senza microfono =============== */
.capture form { padding-left: .9rem; }
.bk-pick { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.bk-pick label { position: relative; }
.bk-pick input[type="radio"] { position: absolute; opacity: 0; inset: 0; }
.bk-pick span { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem .3rem .5rem; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; color: var(--ink-2); background: var(--surface); }
.bk-pick span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--bc); }
.bk-pick input:checked + span { border-color: var(--bc); background: color-mix(in srgb, var(--bc) 14%, var(--surface)); color: var(--ink); }
.bk-pick.colors { gap: .5rem; }
.bk-add { border: 1px dashed var(--line); background: transparent; color: var(--ink-3); border-radius: 999px; padding: .3rem .7rem; font-size: .82rem; cursor: pointer; }
.bk-add:hover { border-color: var(--dawn); color: var(--dawn-ink); }
.bk-pick span.bk-new { display: none; gap: .35rem; align-items: center; }
.bk-pick span.bk-new:not([hidden]) { display: inline-flex; }
.bk-new input[type="text"] { border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; font-size: .82rem; width: 130px; }
.csw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--bc); cursor: pointer; }
.csw.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.csw-row { display: inline-flex; gap: .3rem; }
.csw.sm { width: 20px; height: 20px; }
.bdot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 6px; }
.chip { background: color-mix(in srgb, var(--bc, var(--c-cal)) 16%, var(--surface)); border-left-color: var(--bc, var(--c-cal)); }
.chip.allday-chip { background: color-mix(in srgb, var(--bc, var(--c-cal)) 16%, var(--surface)); border-left-color: var(--bc, var(--c-cal)); }.rv .bk-pick { margin-top: .45rem; }

/* =============== v0.9: gerarchia della home, allegati =============== */
.next-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: var(--r); background: color-mix(in srgb, var(--bc) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bc) 35%, var(--line)); text-decoration: none; margin-bottom: 1rem; }
.nc-time { font-family: var(--serif); font-size: 1.9rem; line-height: 1; color: var(--bc); min-width: 4.6rem; }
.nc-time span { display: block; font-family: var(--sans); font-size: .75rem; color: var(--ink-3); margin-top: .2rem; }
.nc-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.nc-title { font-size: 1.15rem; line-height: 1.25; margin-top: .15rem; }
.next-card svg { color: var(--ink-3); flex: none; }
.stagger .widget { animation: up .35s cubic-bezier(.2,.7,.2,1) both; }
.stagger .widget:nth-child(2) { animation-delay: .05s; } .stagger .widget:nth-child(3) { animation-delay: .1s; } .stagger .widget:nth-child(4) { animation-delay: .15s; } .stagger .widget:nth-child(5) { animation-delay: .2s; } .stagger .widget:nth-child(n+6) { animation-delay: .25s; }
.now-card, .next-card, .start, .start-line { animation: up .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .stagger .widget, .now-card, .next-card, .start, .start-line { animation: none; } }
.page-head .date { font-size: .78rem; }
h1 { font-size: 2.1rem; }
@media (max-width: 699px) { h1 { font-size: 1.85rem; } .page-head { margin-bottom: 1rem; } .nc-time { font-size: 1.6rem; min-width: 4rem; } .card-head h2 { font-size: .7rem; } }
.ratt img, .now-att img { display: block; max-width: 100%; max-height: 240px; border-radius: 10px; margin: .5rem 0; object-fit: cover; }
.now-att img { max-height: 320px; border: 1px solid rgba(255,255,255,.25); }
.topbar { background: var(--bg); }

/* =============== v0.9.1: tabella scheda, titoli puliti =============== */
.sched { display: grid; gap: .9rem; margin: .5rem 0; }
.sched-oggi-nota { font-size: .8rem; color: var(--ink-3); margin-bottom: .3rem; }
.sched-tutti { color: var(--dawn-ink); text-decoration: none; font-weight: 600; }
.now-card .sched-oggi-nota { color: rgba(255,255,255,.7); }
.now-card .sched-tutti { color: #fff; text-decoration: underline; }
.sched-day h4 { font-family: var(--sans); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--c-rou); margin: 0 0 .35rem; }
.sched-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.sched-day li { padding: .4rem .6rem; background: var(--surface-2); border-radius: 8px; font-size: .9rem; }
.sched.compact .sched-day li { padding: .3rem .55rem; font-size: .85rem; }
.now-card .sched-day h4 { color: rgba(255,255,255,.75); }
.now-card .sched-day li { background: rgba(255,255,255,.12); color: #fff; }
#r-preview:empty { display: none; }

/* Calendario: scorrimento continuo, non un cambio di pagina */
.cal-shell { overflow: hidden; border-radius: var(--r); }
.cal-viewport { position: relative; }
.cal-viewport .week { transition: none; }
.cal-viewport > .week-enter { position: absolute; inset: 0; transition: transform .22s cubic-bezier(.22,.68,0,1), opacity .22s ease; }
.cal-viewport > .week-enter.from-r { transform: translateX(28px); opacity: 0; }
.cal-viewport > .week-enter.from-l { transform: translateX(-28px); opacity: 0; }
.cal-viewport > .week-enter.settled { transform: translateX(0); opacity: 1; }
.cal-viewport > :first-child:not(.week-enter) { position: relative; }
.cal-viewport > .week-enter ~ *:not(.week-enter) { transition: transform .22s cubic-bezier(.22,.68,0,1), opacity .22s ease; }
.cal-viewport > .week-enter ~ *.leave-l { transform: translateX(-28px); opacity: 0; }
.cal-viewport > .week-enter ~ *.leave-r { transform: translateX(28px); opacity: 0; }
@media (prefers-reduced-motion: reduce) { .cal-viewport > .week-enter, .cal-viewport > .week-enter ~ * { transition: none !important; transform: none !important; opacity: 1 !important; } }

/* Pannello beta (Impostazioni, solo admin) */
#admin-list .task .sub { flex-wrap: wrap; }
#admin-list .btn { flex: none; align-self: center; }

/* Personalizza: interruttori per sezioni e blocchi (niente da trascinare) */
.pers-sec { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 1.1rem 0 .5rem; }
.pers-sec:first-of-type { margin-top: .25rem; }
.pers-list { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.pers-row { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; border-top: 1px solid var(--line-2); cursor: pointer; min-height: 48px; }
.pers-row:first-child { border-top: 0; }
.pers-row:hover { background: var(--sky, var(--bg)); }
.pers-row input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--c-att); }
.pers-row b { font-weight: 500; display: block; }
.pers-row small { color: var(--ink-3); display: block; font-size: .8rem; margin-top: .1rem; }
.pers-ic { font-size: 1.1rem; width: 1.4rem; text-align: center; flex: none; }
.pers-block { gap: .5rem; }
.pers-grip { border: 0; background: transparent; color: var(--ink-3); flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.pers-grip:hover { background: var(--surface-2); color: var(--ink-2); }
.pers-block.dragging { opacity: .3; }
.pers-ghost { position: fixed; z-index: 500; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 10px 28px -10px rgba(0,0,0,.35); opacity: .97; transform: scale(1.015); }
.pers-placeholder { border: 1.5px dashed var(--line); border-radius: var(--r-sm); margin: 2px 4px; box-sizing: border-box; }

/* ============================ TOUR GUIDATO ============================ */
#tour-root { position: fixed; inset: 0; z-index: 400; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15,17,20,.72); transition: top .3s cubic-bezier(.2,.8,.3,1), left .3s cubic-bezier(.2,.8,.3,1), width .3s, height .3s; pointer-events: none; }
.tour-card { position: fixed; max-width: 290px; background: var(--surface); border-radius: 14px; padding: .85rem .9rem .8rem; box-shadow: var(--shadow-lg); animation: tourin .25s cubic-bezier(.2,.8,.3,1); }
@keyframes tourin { from { opacity: 0; transform: translateY(6px); } }
.tour-card p { font-size: .92rem; line-height: 1.45; margin: 0 0 .7rem; color: var(--ink); }
.tour-bars { display: flex; gap: 4px; margin-bottom: .6rem; }
.tour-bars i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; display: block; list-style: none; font-style: normal; }
.tour-bars i.done { background: var(--dawn); }
.tour-bars i b { display: block; height: 100%; width: 0; background: var(--dawn); border-radius: 2px; }
.tour-bars i b.run { animation: tourbar linear forwards; }
@keyframes tourbar { to { width: 100%; } }
.tour-actions { display: flex; justify-content: flex-end; gap: .5rem; }
@media (prefers-reduced-motion: reduce) { .tour-hole { transition: none; } .tour-bars i b.run { animation: none; width: 100%; } }

/* =====================================================================
   v1.3 — nuovo stile: un carattere solo, colore più quieto, più aria,
   pensato da mobile in su. Le card hanno angoli più morbidi e un confine
   quasi invisibile; il colore di sezione vive nel bordo sinistro e
   nell'icona di menu, non più ripetuto in pallini e testo colorato.
   ===================================================================== */
:root { --r: 18px; --r-sm: 12px; }

/* Tipografia: dimensioni leggermente più generose, un solo respiro */
body { font-size: 16.5px; }
h1 { font-weight: 400; }
.card-head h2, .section-title h2 { font-weight: 500; }

/* Nav desktop: niente più "pillola" colorata sulla voce attiva — solo icona a colore + testo pieno */
.nav a.active { background: transparent; border: 0; padding-top: .5rem; padding-bottom: .5rem; font-weight: 600; }
.nav a.active[href="#oggi"], .nav a.active[href="#attivita"], .nav a.active[href="#calendario"], .nav a.active[href="#diario"], .nav a.active[href="#finanze"], .nav a.active[href="#routine"], .nav a.active[href="#assistente"] { background: var(--surface-2); }

/* Card: bordo quasi invisibile, angoli più morbidi, più respiro interno */
.card { border-color: var(--line-2); border-radius: var(--r); }
.card-head { padding: 1.05rem 1.2rem .65rem; }
.widget .card { border-left-width: 4px; }
.widgets { gap: 1.1rem; }

/* Righe di lista: più alte, più leggibili, meno segni tutti insieme */
.task, .event, .tx, .journal-day, .sp, .note-item { min-height: 52px; }
.task .title, .event .title { font-size: 1rem; line-height: 1.4; }
.task .sub span, .tx .cat { font-size: .82rem; }

/* Bottoni: un solo accento pieno per azione, il resto discreto */
.btn { font-weight: 600; }
.btn.dawn { box-shadow: 0 6px 16px rgba(217,162,27,.22); }
[data-theme="dark"] .btn.dawn, html:not([data-theme="light"]) .btn.dawn { box-shadow: none; }

/* Capture: l'unico elemento con un po' di peso visivo in più, perché è quello che si usa sempre */
.capture form { box-shadow: 0 10px 30px rgba(25,28,31,.06); }
@media (max-width: 699px) { .capture form { box-shadow: 0 14px 36px rgba(25,28,31,.14); } }

/* Mobile: più aria, bersagli più grandi, meno cose per riga */
@media (max-width: 699px) {
  body { font-size: 17px; }
  .main { padding-top: calc(3.6rem + env(safe-area-inset-top)); }
  .page-head { gap: .6rem; }
  .page-head .date { font-size: .82rem; }
  h1 { font-size: 1.7rem; }
  .card { border-radius: 20px; }
  .card-head { padding: 1.1rem 1.2rem .6rem; }
  .card-head h2 { font-size: 1.1rem; }
  .task, .event, .tx { padding-top: .85rem; padding-bottom: .85rem; min-height: 56px; }
  .check { width: 26px; height: 26px; }
  .btn { min-height: 46px; }
  .btn.sm { min-height: 40px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .now-card { border-radius: 22px; padding: 1.3rem 1.3rem; }
  .now-title { font-size: 1.65rem; }
  .next-card { border-radius: 18px; padding: 1.1rem 1.2rem; }
  .widgets { gap: 1rem; }
  .section { margin-top: 1.4rem; }
  .tabbar { padding-top: .5rem; }
  .tabbar a { gap: 3px; }
  .tabbar a svg { width: 25px; height: 25px; }
  .modal { border-radius: 24px 24px 0 0; padding: 1.4rem 1.3rem max(1.4rem, env(safe-area-inset-bottom)); }
  .field input, .field select, .field textarea { border-radius: 14px; min-height: 48px; padding: .75rem .9rem; }
  .seg button, .seg a { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* Stato "AI non configurata": deve saltare all'occhio, non essere una notarella grigia */
.ai-off-notice { background: var(--dawn-soft); border: 1px solid rgba(217,162,27,.35); border-radius: var(--r-sm); padding: .85rem 1rem; font-size: .9rem; line-height: 1.5; margin-bottom: 1rem; }
.ai-off-notice a { color: var(--dawn-ink); font-weight: 600; }

/* ============================ EDITOR PAGINE v2.0 ============================
   Un foglio per prendere appunti, pensato da tablet: pannello pagine a sinistra, foglio a destra,
   barra strumenti che resta sotto le dita. Su telefono il pannello diventa un foglio "Tutte le pagine". */
.page-layout { display: grid; grid-template-columns: 1fr; gap: 1.25rem; min-width: 0; }
.pages-side { display: none; }
.only-phone { display: inline-flex; }
.not-phone { display: none; }
@media (min-width: 640px) {
  .page-layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
  .page-editor.notion { padding-left: 48px; }   /* spazio per le maniglie + e ⋮⋮ dei blocchi, così non finiscono sopra il pannello */
  .pages-side { display: block; position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .5rem; min-width: 0; }
  .only-phone { display: none; }
  .not-phone { display: inline; }
  .page-editor { max-width: 820px; }
}
@media (min-width: 700px) { .pages-side { top: 5.5rem; max-height: calc(100dvh - 6.5rem); } }
.ps-head { display: flex; align-items: center; justify-content: space-between; padding: .35rem .5rem .5rem; font-size: .95rem; }
.ps-tree { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ps-tree.sheet { max-height: 60dvh; overflow: auto; }
.ps-item { display: flex; align-items: center; gap: .5rem; padding: .55rem .6rem .55rem calc(.6rem + var(--d, 0) * 1rem); border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-size: .95rem; min-height: 40px; min-width: 0; flex: 1; }
.ps-item .ic { flex: none; width: 1.3rem; text-align: center; }
.ps-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.ps-item:hover { background: var(--bg); color: var(--ink); }
.ps-item.on { background: var(--dawn-soft); color: var(--ink); font-weight: 600; }

/* barra strumenti: grande, con etichette chiare — niente sigle da programmatori */
.rt-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .2rem; flex-wrap: wrap; padding: .4rem; margin: .25rem 0 .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 6px 20px -14px rgba(0,0,0,.25); }
@media (max-width: 699px) { .rt-toolbar { top: calc(3.4rem + env(safe-area-inset-top)); } }
.rt-toolbar button, .rt-toolbar .rt-img { border: 0; background: transparent; min-width: 40px; height: 40px; padding: 0 .55rem; border-radius: 8px; font: inherit; font-size: 1rem; color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; }
.rt-toolbar button:hover, .rt-toolbar .rt-img:hover { background: var(--bg); color: var(--ink); }
.rt-toolbar button.on { background: var(--dawn-soft); color: var(--ink); }
.rt-style { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; height: 40px; padding: 0 .6rem; font: inherit; font-size: .95rem; max-width: 9.5rem; }
.rt-sep { width: 1px; height: 24px; background: var(--line); margin: 0 .25rem; }
.rt-img { cursor: pointer; }

/* il foglio */
.page-body.rich { min-height: 55dvh; padding: .5rem .25rem 6rem; line-height: 1.75; font-size: 1.08rem; outline: 0; caret-color: var(--dawn); }
.page-body.rich.is-empty::before { content: attr(data-placeholder); color: var(--ink-3); pointer-events: none; }
.page-body.rich > :first-child { margin-top: 0; }
.page-body.rich p { margin: 0 0 .65rem; }
.page-body.rich h1 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; line-height: 1.25; margin: 1.4rem 0 .5rem; }
.page-body.rich h2 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; line-height: 1.3; margin: 1.2rem 0 .4rem; }
.page-body.rich h3 { font-weight: 600; font-size: 1.1rem; margin: 1rem 0 .3rem; color: var(--ink); }
.page-body.rich blockquote { margin: .8rem 0; padding: .5rem 1rem; border-left: 3px solid var(--dawn); background: var(--dawn-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink-2); font-style: italic; }
.page-body.rich ul, .page-body.rich ol { padding-left: 1.5rem; margin: .4rem 0 .7rem; }
.page-body.rich li { margin: .2rem 0; }
.page-body.rich hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.page-body.rich img { max-width: 100%; height: auto; border-radius: var(--r-sm); display: block; margin: .75rem 0; }
.page-body.rich a { color: var(--dawn-ink); }
.page-body.rich pre, .page-body.rich code { background: var(--surface-2); border-radius: 6px; padding: .1rem .35rem; font-size: .95em; }
.page-body.rich pre { padding: .6rem .8rem; overflow: auto; }

/* menu "altre azioni" della pagina */
.pmenu-wrap { position: relative; }
.pmenu { position: absolute; top: calc(100% + 4px); right: 0; left: auto; z-index: 30; min-width: 220px; max-width: calc(100vw - 2rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 12px 30px -12px rgba(0,0,0,.35); padding: .3rem; display: flex; flex-direction: column; }
.pmenu button { text-align: left; border: 0; background: transparent; padding: .6rem .75rem; border-radius: 6px; font: inherit; color: var(--ink); cursor: pointer; }
.pmenu button:hover { background: var(--bg); }
.pmenu button.danger { color: #B5482E; }
.pmenu.hidden { display: none; }

/* tablet: il foglio usa tutta la larghezza disponibile, tocchi più grandi */
@media (min-width: 640px) and (max-width: 699px) {
  .page-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .page-title { font-size: 1.8rem; }
  .rt-toolbar button, .rt-toolbar .rt-img { min-width: 44px; height: 44px; font-size: 1.05rem; }
  .rt-style { height: 44px; }
}

.rt-lbl { display: none; font-size: .8rem; margin-left: .35rem; color: var(--ink-3); }
.rt-toolbar button, .rt-toolbar .rt-img { display: inline-flex; align-items: center; justify-content: center; }
@media (min-width: 640px) { .rt-lbl { display: inline; } .rt-toolbar button.on .rt-lbl { color: var(--ink); } }

/* Home su telefono: meno rumore. Stati vuoti su una riga, intestazione compatta su una riga sola. */
.empty.slim { padding: .35rem 0 .1rem; font-size: .92rem; }
@media (max-width: 639px) {
  #personalizza-btn .lbl { display: none; }
  #personalizza-btn { min-width: 40px; padding: 0 .55rem; }
  .page-head .day-nav .btn.icon { min-width: 40px; }
  .page-head { align-items: center; }
  .page-head h1 { font-size: 1.5rem; }
  .widget .card { padding: .95rem 1rem; }
}
@media (max-width: 639px) {
  .task, .event { padding: .65rem .75rem; gap: .6rem; }
  .event time { width: 74px; font-size: .8rem; letter-spacing: -.01em; }
  .task .actions .icon-btn, .event .actions .icon-btn { min-width: 34px; min-height: 34px; }
}

/* ============================ EDITOR A BLOCCHI (stile Notion) ============================ */
.page-editor.notion { position: relative; max-width: 820px; }
.crumbs .icon-btn { min-width: 32px; min-height: 32px; }
/* copertina e testata */
.cover { height: 180px; border-radius: var(--r); background: var(--surface-2) center/cover no-repeat; position: relative; margin: .25rem 0 .5rem; }
.cover.none { display: none; }
.cover-tools { position: absolute; right: .6rem; bottom: .6rem; display: flex; gap: .35rem; opacity: 0; transition: opacity .15s; }
.cover:hover .cover-tools, .cover:focus-within .cover-tools { opacity: 1; }
@media (hover: none) { .cover-tools { opacity: 1; } }
.cover-tools .btn { background: rgba(255,255,255,.9); color: #222; border-color: transparent; }
.page-top { margin: .25rem 0 .5rem; }
.page-adders { display: flex; gap: .25rem; min-height: 32px; opacity: .55; transition: opacity .15s; }
.page-top:hover .page-adders, .page-adders:focus-within { opacity: 1; }
.page-adders .btn { padding: 0 .55rem; min-height: 30px; font-size: .82rem; color: var(--ink-3); }
.page-icon.none { display: none; }
.cover:not(.none) + .page-top .page-icon { width: 64px; height: 64px; font-size: 2.6rem; margin-top: -34px; background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.cover:not(.none) + .page-top .page-title-row { align-items: flex-end; }   /* l'icona sporge sopra la copertina, il titolo resta al suo posto: si allineano dal basso, non dal centro */
.page-title { font-size: 2.2rem; }

/* blocchi */
.blocks { padding: .25rem 0 3rem; }
.blk { position: relative; display: flex; align-items: flex-start; gap: .25rem; padding: 2px 0 2px 44px; margin-left: -44px; border-radius: 6px; }
.blk-handles { position: absolute; left: 0; top: 2px; display: flex; gap: 0; opacity: 0; transition: opacity .12s; }
.blk:hover .blk-handles, .blk:focus-within .blk-handles { opacity: 1; }
@media (hover: none) { .blk-handles { opacity: .35; } .blk:focus-within .blk-handles { opacity: 1; } }
.bh { border: 0; background: transparent; color: var(--ink-3); width: 22px; height: 26px; padding: 0; border-radius: 5px; font-size: 1rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.bh:hover { background: var(--surface-2); color: var(--ink); }
.bh.drag { cursor: grab; }
.bh.drag svg { display: block; width: 14px; height: 14px; }
.blk.dragging { opacity: .35; }
.blk.drop-before::before, .blk.drop-after::after { content: ''; position: absolute; left: 44px; right: 0; height: 3px; background: var(--dawn); border-radius: 2px; }
.blk.drop-before::before { top: -2px; } .blk.drop-after::after { bottom: -2px; }
.blk-main { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: .5rem; }
.be { flex: 1; min-width: 0; outline: 0; line-height: 1.65; font-size: 1.05rem; padding: .2rem 0; caret-color: var(--dawn); word-break: break-word; }
.be:empty::before, .be.ph::before { content: attr(data-ph); color: var(--ink-3); opacity: 0; pointer-events: none; }
.be:empty:focus::before { opacity: 1; }   /* 5.3.1: il suggerimento solo dove c'è il cursore, non su tutte le righe vuote */
.blocks .blk:only-child .be:empty::before { opacity: 1; }
.be b, .be strong { font-weight: 700; }
.be code { background: var(--surface-2); border-radius: 5px; padding: .05rem .35rem; font-size: .92em; }
/* evidenziazione stile Notion: spazio intorno al testo e angoli morbidi, non solo il colore incollato addosso.
   box-decoration-break fa sì che, se va a capo, ogni riga abbia il suo "cuscinetto" pulito invece di un blocco unico spezzato. */
.be span[style*="background-color"] { padding: .05em .2em; margin: 0 -.05em; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.be a { color: var(--dawn-ink); }
.be img { max-width: 100%; border-radius: 6px; }
.t-h1 .be { font-family: var(--serif); font-weight: 500; font-size: 1.85rem; line-height: 1.25; padding: .55rem 0 .2rem; }
.t-h2 .be { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; line-height: 1.3; padding: .45rem 0 .15rem; }
.t-h3 .be { font-weight: 600; font-size: 1.15rem; padding: .35rem 0 .1rem; }
.t-quote .blk-main { border-left: 3px solid var(--ink); padding-left: .8rem; margin: .2rem 0; }
.t-quote .be { font-style: italic; color: var(--ink-2); }
.t-callout .blk-main { background: var(--dawn-soft); border-radius: var(--r-sm); padding: .6rem .8rem; margin: .25rem 0; align-items: flex-start; }
.callout-ic { border: 0; background: transparent; font-size: 1.25rem; line-height: 1; padding: .15rem .1rem; cursor: pointer; border-radius: 6px; }
.callout-ic:hover { background: rgba(0,0,0,.06); }
.marker { flex: none; width: 1.4rem; text-align: center; padding-top: .28rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.marker.num { width: 1.9rem; text-align: right; padding-right: .3rem; }
.todo-box { flex: none; width: 20px; height: 20px; margin-top: .42rem; border: 1.5px solid var(--ink-3); border-radius: 5px; background: var(--bg); font-size: .8rem; line-height: 1; padding: 0; color: #fff; cursor: pointer; }
.blk.checked .todo-box { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.blk.checked .be { color: var(--ink-3); text-decoration: line-through; }
.blk.ind-1 .blk-main { padding-left: 1.6rem; } .blk.ind-2 .blk-main { padding-left: 3.2rem; } .blk.ind-3 .blk-main { padding-left: 4.8rem; }
.tg-arrow { flex: none; border: 0; background: transparent; width: 24px; height: 28px; margin-top: .2rem; color: var(--ink-2); cursor: pointer; border-radius: 5px; transition: transform .15s; }
.tg-arrow.open { transform: rotate(90deg); }
.tg-arrow:hover { background: var(--surface-2); }
.t-toggle .blk-main { flex-wrap: wrap; }
.t-toggle .tg-title { font-weight: 600; }
.tg-body { flex-basis: 100%; padding-left: 1.6rem; }
.tg-body.hidden { display: none; }
.tg-content { font-size: 1rem; color: var(--ink-2); }
.t-code pre { flex: 1; margin: .3rem 0; background: var(--surface-2); border-radius: var(--r-sm); padding: .7rem .9rem; overflow: auto; }
.be.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; white-space: pre-wrap; line-height: 1.5; }
.t-divider .blk-main { padding: .6rem 0; }
.t-divider hr { flex: 1; border: 0; border-top: 1px solid var(--line); margin: 0; }
.t-image .blk-main { flex-direction: column; gap: .2rem; }
.t-image img { max-width: 100%; height: auto; border-radius: var(--r-sm); display: block; cursor: pointer; }
.be.caption { font-size: .85rem; color: var(--ink-3); text-align: center; width: 100%; }
.page-block { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .7rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; margin: .15rem 0; }
.page-block:hover { background: var(--surface-2); }
.page-block .t { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

/* menu "/" e menu del blocco */
.slash-menu, .blk-menu { position: absolute; z-index: 40; left: 44px; top: 100%; min-width: 260px; max-width: 320px; max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 16px 40px -14px rgba(0,0,0,.35); padding: .3rem; display: flex; flex-direction: column; }
.slash-menu button, .blk-menu button { display: flex; align-items: center; gap: .65rem; text-align: left; border: 0; background: transparent; padding: .5rem .6rem; border-radius: 6px; font: inherit; color: var(--ink); cursor: pointer; }
.slash-menu button.on, .slash-menu button:hover, .blk-menu button:hover { background: var(--bg); }
.slash-menu .si, .blk-menu .si { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; font-size: .9rem; font-weight: 700; background: var(--surface-2); }
.slash-menu small { display: block; color: var(--ink-3); font-size: .78rem; }
.blk-menu { min-width: 200px; }
.blk-menu button.danger { color: #B5482E; }
@media (max-width: 639px) { .slash-menu, .blk-menu { left: 0; right: 0; max-width: none; } }

/* barra di selezione flottante */
.sel-bar { position: absolute; z-index: 45; display: flex; gap: 2px; padding: 3px; background: #1E1B18; border-radius: 8px; box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); }
.sel-bar.hidden { display: none; }
.sel-bar button { border: 0; background: transparent; color: #fff; min-width: 32px; height: 32px; border-radius: 6px; font: inherit; font-size: .95rem; cursor: pointer; }
.sel-bar button:hover, .sel-bar button.on { background: rgba(255,255,255,.18); }

/* barra inferiore su touch (sopra la tastiera) */
.blk-bar { display: none; }
body.editing-block .blk-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; gap: .25rem; padding: .4rem .6rem calc(.4rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); overflow-x: auto; }
.blk-bar button { flex: none; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 0 .7rem; height: 38px; font: inherit; font-size: .9rem; }
@media (max-width: 699px) { body.editing-block .capture, body.editing-block .tabbar { display: none; } }

/* pannello pagine: apri/chiudi, preferiti, ricerca */
.ps-search { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: .5rem .65rem; font: inherit; font-size: .9rem; margin: 0 0 .4rem; min-height: 38px; }
.ps-sec { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: .55rem .5rem .2rem; }
.ps-row { display: flex; align-items: center; gap: 0; padding-left: calc(var(--d, 0) * .9rem); min-width: 0; position: relative; }
.ps-row .ps-item { flex: 1; padding-left: .3rem; }
.ps-tg { flex: none; width: 24px; height: 36px; border: 0; background: transparent; color: var(--ink-3); font-size: .8rem; cursor: pointer; border-radius: 5px; position: relative; z-index: 1; }
.ps-tg:hover { background: var(--bg); color: var(--ink); }
.ps-tg.none { cursor: default; color: var(--line); }
/* nidificazione: un trattino verticale, allineato al centro del pulsante ▸/▾ del livello genitore
   (12px = metà dei 24px di .ps-tg) — un solo indicatore per riga, non un albero a rami multipli:
   con un elenco piatto invece di nodi davvero annidati, replicare le linee continue di un vero
   file-tree richiederebbe sapere se un fratello successivo esiste a ogni livello, cosa che
   quest'architettura non traccia. Meglio un segno onesto e sempre allineato che una finzione. */
.ps-row[data-d]:not([data-d="0"])::before {
  content: ''; position: absolute; left: calc((var(--d, 0) - 1) * .9rem + 12px); top: 0; bottom: 0; width: 1px; background: var(--line);
}
.ps-fav { flex: none; width: 24px; height: 36px; border: 0; background: transparent; color: var(--dawn); font-size: .78rem; cursor: pointer; border-radius: 5px; opacity: 0; }
.ps-row:hover .ps-fav, .ps-fav.on { opacity: 1; }
.ps-fav:hover { background: var(--bg); }
.ps-item .fav { color: var(--dawn); font-size: .8rem; margin-left: auto; }
.pages-side.sheet { display: block; position: static; max-height: none; border: 0; padding: 0; }

/* telefono: gutter piccolo, solo la maniglia del menu; i menu non escono dallo schermo */
@media (max-width: 639px) {
  .blk { padding-left: 26px; margin-left: -6px; }
  .blk-handles { left: 0; }
  .bh.add { display: none; }
  .bh.drag { width: 22px; }
  .slash-menu, .blk-menu { left: 20px; right: 0; }
  .blk.drop-before::before, .blk.drop-after::after { left: 26px; }
  .cover { height: 140px; }
}

/* Tema automatico in modalità scura: la card Adesso deve essere scura come con "Scuro" scelto a mano
   (la regola dei colori per ambito, più in basso nel file, vinceva sulla media query più in alto). */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .now-card { background: #0E1218; } }

/* colore testo / evidenziazione nella barra di selezione */
.sb-sep { width: 1px; height: 20px; background: rgba(255,255,255,.2); margin: 0 2px; align-self: center; }
.sb-color, .sb-mark { font-weight: 700; }
.sel-pop { position: absolute; top: 100%; left: 0; margin-top: 6px; display: grid; grid-template-columns: repeat(4, 28px); gap: 2px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 26px -10px rgba(0,0,0,.4); z-index: 5; }
.sel-pop button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); display: grid; place-items: center; cursor: pointer; padding: 0; }
.sel-pop button:hover { border-color: var(--ink-3); }
.sel-pop .sw { width: 18px; height: 18px; border-radius: 5px; font-weight: 700; font-size: .8rem; display: grid; place-items: center; }

/* selettore font della pagina */
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; max-height: 60dvh; overflow: auto; }
.font-opt { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: .6rem .7rem; font-size: 1.05rem; cursor: pointer; color: var(--ink); }
.font-opt small { display: block; font-size: .72rem; color: var(--ink-3); font-family: var(--sans); margin-top: .15rem; }
.font-opt.on { border-color: var(--dawn); background: var(--dawn-soft); }
.font-opt:hover { border-color: var(--ink-3); }

/* ============================ TEMI (v2.3) — pochi, ma cambiano TUTTO ===========================
   Alba è quello di sempre (nessun attributo). Oceano, Foresta e Tramonto ridefiniscono l'intera scala:
   sfondo, superfici, testo, linee, accento, colori per categoria — in chiaro E in scuro — più uno sfondo
   ambientale che si muove piano dietro a tutto. I colori di categoria sono scelti nella famiglia del tema
   (niente marroni in Oceano), ognuno verificato per contrasto prima di essere scritto. */
[data-palette="oceano"] { --bg: #EEF3F8; --surface: #FFFFFF; --surface-2: #E2EAF2; --ink: #14202E; --ink-2: #4A5A6E; --ink-3: #7A8A9E; --line: #D2DCE8; --line-2: #E3EAF2; --dawn: #2771A5; --dawn-ink: #114569; --dawn-soft: #E2EFF8; --c-oggi: #1E6FA8; --c-oggi-soft: #DFEDF6; --c-att: #1A7797; --c-att-soft: #DFF0F6; --c-cal: #5B5FC7; --c-cal-soft: #E1E1F5; --c-dia: #377596; --c-dia-soft: #E1EEF4; --c-fin: #1B796B; --c-fin-soft: #DFF6F2; --c-rou: #2C6E9E; --c-rou-soft: #DFECF6; --c-pag: #666C7A; --c-pag-soft: #EEF0F3; --amb-1: rgba(39,113,165,.16); --amb-2: rgba(99,159,202,.14); --amb-3: rgba(20,60,110,.10); }
[data-palette="oceano"][data-theme="dark"] { --bg: #0C1420; --surface: #132030; --surface-2: #1A2A3D; --ink: #E6EEF7; --ink-2: #A9B8CB; --ink-3: #7A8CA2; --line: #243548; --line-2: #1C2B3C; --dawn: #357DB1; --dawn-ink: #639FCA; --dawn-soft: #172C3B; --c-oggi: #4C97CC; --c-oggi-soft: #192F3D; --c-att: #4BACCD; --c-att-soft: #19343E; --c-cal: #7477C2; --c-cal-soft: #1F2038; --c-dia: #629AB7; --c-dia-soft: #1F2F37; --c-fin: #52C6B5; --c-fin-soft: #1B3C37; --c-rou: #5894C0; --c-rou-soft: #1D2E3A; --c-pag: #A3A9B4; --c-pag-soft: #232830; --amb-1: rgba(53,125,177,.22); --amb-2: rgba(99,159,202,.12); --amb-3: rgba(10,30,60,.30); }
@media (prefers-color-scheme: dark) { [data-palette="oceano"]:not([data-theme="light"]) { --bg: #0C1420; --surface: #132030; --surface-2: #1A2A3D; --ink: #E6EEF7; --ink-2: #A9B8CB; --ink-3: #7A8CA2; --line: #243548; --line-2: #1C2B3C; --dawn: #357DB1; --dawn-ink: #639FCA; --dawn-soft: #172C3B; --c-oggi: #4C97CC; --c-oggi-soft: #192F3D; --c-att: #4BACCD; --c-att-soft: #19343E; --c-cal: #7477C2; --c-cal-soft: #1F2038; --c-dia: #629AB7; --c-dia-soft: #1F2F37; --c-fin: #52C6B5; --c-fin-soft: #1B3C37; --c-rou: #5894C0; --c-rou-soft: #1D2E3A; --c-pag: #A3A9B4; --c-pag-soft: #232830; --amb-1: rgba(53,125,177,.22); --amb-2: rgba(99,159,202,.12); --amb-3: rgba(10,30,60,.30); } }
[data-palette="foresta"] { --bg: #EFF4EE; --surface: #FFFFFF; --surface-2: #E3ECE2; --ink: #15221A; --ink-2: #4B5E50; --ink-3: #7A8E7F; --line: #D3E0D5; --line-2: #E4ECE5; --dawn: #1D7C3D; --dawn-ink: #10602B; --dawn-soft: #E2F8EA; --c-oggi: #297C42; --c-oggi-soft: #E0F5E7; --c-att: #33795D; --c-att-soft: #E2F3EC; --c-cal: #587528; --c-cal-soft: #EDF5E1; --c-dia: #866B2E; --c-dia-soft: #F5EEE1; --c-fin: #1B795D; --c-fin-soft: #DFF6EF; --c-rou: #417936; --c-rou-soft: #E5F2E3; --c-pag: #666C7A; --c-pag-soft: #EEF0F3; --amb-1: rgba(29,124,61,.14); --amb-2: rgba(99,202,133,.12); --amb-3: rgba(20,80,50,.10); }
[data-palette="foresta"][data-theme="dark"] { --bg: #0D1711; --surface: #142219; --surface-2: #1B2D21; --ink: #E7F0E9; --ink-2: #AABDAF; --ink-3: #7C9283; --line: #25392C; --line-2: #1D2F23; --dawn: #35B15E; --dawn-ink: #63CA85; --dawn-soft: #173B23; --c-oggi: #5EBA7A; --c-oggi-soft: #1E3826; --c-att: #67B294; --c-att-soft: #21362E; --c-cal: #97B95F; --c-cal-soft: #2E381F; --c-dia: #B99E5F; --c-dia-soft: #38301F; --c-fin: #52C6A4; --c-fin-soft: #1B3C32; --c-rou: #74AF69; --c-rou-soft: #243521; --c-pag: #A3A9B4; --c-pag-soft: #232830; --amb-1: rgba(53,177,94,.20); --amb-2: rgba(99,202,133,.10); --amb-3: rgba(10,50,30,.30); }
@media (prefers-color-scheme: dark) { [data-palette="foresta"]:not([data-theme="light"]) { --bg: #0D1711; --surface: #142219; --surface-2: #1B2D21; --ink: #E7F0E9; --ink-2: #AABDAF; --ink-3: #7C9283; --line: #25392C; --line-2: #1D2F23; --dawn: #35B15E; --dawn-ink: #63CA85; --dawn-soft: #173B23; --c-oggi: #5EBA7A; --c-oggi-soft: #1E3826; --c-att: #67B294; --c-att-soft: #21362E; --c-cal: #97B95F; --c-cal-soft: #2E381F; --c-dia: #B99E5F; --c-dia-soft: #38301F; --c-fin: #52C6A4; --c-fin-soft: #1B3C32; --c-rou: #74AF69; --c-rou-soft: #243521; --c-pag: #A3A9B4; --c-pag-soft: #232830; --amb-1: rgba(53,177,94,.20); --amb-2: rgba(99,202,133,.10); --amb-3: rgba(10,50,30,.30); } }
[data-palette="tramonto"] { --bg: #FBF1EA; --surface: #FFFFFF; --surface-2: #F6E6DA; --ink: #2A1B14; --ink-2: #6B5247; --ink-3: #9C8378; --line: #EBD9CC; --line-2: #F3E5DA; --dawn: #A54D27; --dawn-ink: #692C11; --dawn-soft: #F8E9E2; --c-oggi: #B5511D; --c-oggi-soft: #F6E7DF; --c-att: #4F8B3B; --c-att-soft: #E7F1DF; --c-cal: #7A3B6E; --c-cal-soft: #F3E3EF; --c-dia: #BF4265; --c-dia-soft: #F5E0E6; --c-fin: #9C7A1D; --c-fin-soft: #F6EEDF; --c-rou: #2E7D77; --c-rou-soft: #DFF0EE; --c-pag: #666C7A; --c-pag-soft: #EEF0F3; --amb-1: rgba(165,77,39,.14); --amb-2: rgba(202,130,99,.14); --amb-3: rgba(217,162,27,.10); }
[data-palette="tramonto"][data-theme="dark"] { --bg: #1A100C; --surface: #251813; --surface-2: #31201A; --ink: #F5E9E2; --ink-2: #CDB3A6; --ink-3: #A38A7D; --line: #3E2A22; --line-2: #32211B; --dawn: #B15A35; --dawn-ink: #CA8263; --dawn-soft: #3B2217; --c-oggi: #CF774A; --c-oggi-soft: #3E2519; --c-att: #7FBF6B; --c-att-soft: #22321C; --c-cal: #B888C4; --c-cal-soft: #332538; --c-dia: #BB627B; --c-dia-soft: #381E26; --c-fin: #D9B65C; --c-fin-soft: #3A3219; --c-rou: #5CBAB0; --c-rou-soft: #1B3634; --c-pag: #A3A9B4; --c-pag-soft: #232830; --amb-1: rgba(177,90,53,.20); --amb-2: rgba(202,130,99,.12); --amb-3: rgba(60,25,15,.30); }
@media (prefers-color-scheme: dark) { [data-palette="tramonto"]:not([data-theme="light"]) { --bg: #1A100C; --surface: #251813; --surface-2: #31201A; --ink: #F5E9E2; --ink-2: #CDB3A6; --ink-3: #A38A7D; --line: #3E2A22; --line-2: #32211B; --dawn: #B15A35; --dawn-ink: #CA8263; --dawn-soft: #3B2217; --c-oggi: #CF774A; --c-oggi-soft: #3E2519; --c-att: #7FBF6B; --c-att-soft: #22321C; --c-cal: #B888C4; --c-cal-soft: #332538; --c-dia: #BB627B; --c-dia-soft: #381E26; --c-fin: #D9B65C; --c-fin-soft: #3A3219; --c-rou: #5CBAB0; --c-rou-soft: #1B3634; --c-pag: #A3A9B4; --c-pag-soft: #232830; --amb-1: rgba(177,90,53,.20); --amb-2: rgba(202,130,99,.12); --amb-3: rgba(60,25,15,.30); } }

[data-palette="viola"] {
  --bg: #F7F4FA; --surface: #FFFFFF; --surface-2: #EEE7F7; --ink: #1E1626; --ink-2: #5A4C69; --ink-3: #8C7D9E;
  --line: #DED2EB; --line-2: #E9E0F4; --dawn: #6F30A6; --dawn-ink: #4E1F79; --dawn-soft: #F0E5FA;
  --c-oggi: #C8901A; --c-oggi-soft: #F9F0DC; --c-att: #2E9C64; --c-att-soft: #E1F5EA; --c-cal: #6F36A1; --c-cal-soft: #EAE6F9;
  --c-dia: #A1368F; --c-dia-soft: #F9E6F4; --c-fin: #3057B0; --c-fin-soft: #E6ECF9; --c-rou: #1E8FA1; --c-rou-soft: #DFF2F5; --c-pag: #666C7A; --c-pag-soft: #EEF0F3;
  --amb-1: rgba(111,48,166,.14); --amb-2: rgba(161,54,143,.12); --amb-3: rgba(71,54,161,.10);
}
[data-palette="viola"][data-theme="dark"] {
  --bg: #14101A; --surface: #1E1726; --surface-2: #261D31; --ink: #EEE7F7; --ink-2: #C4B6D6; --ink-3: #9687AB;
  --line: #3A2D4A; --line-2: #2D2339; --dawn: #B17CDE; --dawn-ink: #D3B0F0; --dawn-soft: #2E2140;
  --c-oggi: #D9A21B; --c-oggi-soft: #332911; --c-att: #5FBE8B; --c-att-soft: #1A3326; --c-cal: #9589D2; --c-cal-soft: #262138;
  --c-dia: #D289C6; --c-dia-soft: #331F30; --c-fin: #6F93D9; --c-fin-soft: #1E2A3D; --c-rou: #4FB8C4; --c-rou-soft: #163238; --c-pag: #A3A9B4; --c-pag-soft: #232830;
  --amb-1: rgba(177,124,222,.20); --amb-2: rgba(210,137,198,.12); --amb-3: rgba(30,15,50,.30);
}
@media (prefers-color-scheme: dark) { [data-palette="viola"]:not([data-theme="light"]) {
  --bg: #14101A; --surface: #1E1726; --surface-2: #261D31; --ink: #EEE7F7; --ink-2: #C4B6D6; --ink-3: #9687AB;
  --line: #3A2D4A; --line-2: #2D2339; --dawn: #B17CDE; --dawn-ink: #D3B0F0; --dawn-soft: #2E2140;
  --c-oggi: #D9A21B; --c-oggi-soft: #332911; --c-att: #5FBE8B; --c-att-soft: #1A3326; --c-cal: #9589D2; --c-cal-soft: #262138;
  --c-dia: #D289C6; --c-dia-soft: #331F30; --c-fin: #6F93D9; --c-fin-soft: #1E2A3D; --c-rou: #4FB8C4; --c-rou-soft: #163238; --c-pag: #A3A9B4; --c-pag-soft: #232830;
  --amb-1: rgba(177,124,222,.20); --amb-2: rgba(210,137,198,.12); --amb-3: rgba(30,15,50,.30);
} }

/* ============================ MOVIMENTO (v2.3) — l'app respira ============================
   Principi: tutto in transform/opacity (la GPU ci pensa, niente scatti), curve morbide, mai
   più di qualche centinaio di millisecondi, e con "riduci movimento" attivo nel sistema si spegne tutto. */
:root { --ease-out: cubic-bezier(.2,.8,.2,1); --ease-soft: cubic-bezier(.4,0,.2,1); }

body::before { content: ''; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 18% 22%, var(--amb-1), transparent 70%),
    radial-gradient(35% 40% at 82% 30%, var(--amb-2), transparent 70%),
    radial-gradient(45% 40% at 55% 85%, var(--amb-3), transparent 70%);
  animation: ambDrift 48s var(--ease-soft) infinite alternate; will-change: transform; }
@keyframes ambDrift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(-2.5%, 1.5%) scale(1.06); } 100% { transform: translate(2%, -2%) scale(1.03); } }

/* cambio tema: si scioglie, non scatta */
body, .card, .widget, .nav, .topbar, .tabbar, .capture-form, .pages-side, .btn, input, textarea, select, .chip, .blk-bar, .modal, .now-card
  { transition: background-color .45s var(--ease-soft), color .45s var(--ease-soft), border-color .45s var(--ease-soft); }

/* ingresso di una vista: più morbido, più presente */
#view { opacity: 0; transform: translateY(14px); transition: opacity .34s var(--ease-out), transform .34s var(--ease-out); }
#view.in { opacity: 1; transform: none; }
/* e dentro, i pezzi arrivano a cascata, uno dopo l'altro */
#view.in > .page-head, #view.in > .section, #view.in > .card, #view.in .widgets > .widget, #view.in .home-grid > *
  { animation: riseIn .5s var(--ease-out) both; }
#view.in > *:nth-child(1) { animation-delay: .02s; } #view.in > *:nth-child(2) { animation-delay: .07s; } #view.in > *:nth-child(3) { animation-delay: .12s; }
#view.in > *:nth-child(4) { animation-delay: .17s; } #view.in > *:nth-child(5) { animation-delay: .22s; } #view.in > *:nth-child(6) { animation-delay: .27s; }
#view.in > *:nth-child(n+7) { animation-delay: .32s; }
#view.in .widgets > .widget:nth-child(1) { animation-delay: .08s; } #view.in .widgets > .widget:nth-child(2) { animation-delay: .15s; }
#view.in .widgets > .widget:nth-child(3) { animation-delay: .22s; } #view.in .widgets > .widget:nth-child(4) { animation-delay: .29s; }
#view.in .widgets > .widget:nth-child(n+5) { animation-delay: .36s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } }

/* elementi di elenco: arrivano in fila */
#view.in .list > *, #view.in .task, #view.in .ps-item { animation: riseIn .4s var(--ease-out) both; }
#view.in .list > *:nth-child(1), #view.in .task:nth-child(1) { animation-delay: .04s; }
#view.in .list > *:nth-child(2), #view.in .task:nth-child(2) { animation-delay: .08s; }
#view.in .list > *:nth-child(3), #view.in .task:nth-child(3) { animation-delay: .12s; }
#view.in .list > *:nth-child(4), #view.in .task:nth-child(4) { animation-delay: .16s; }
#view.in .list > *:nth-child(5), #view.in .task:nth-child(5) { animation-delay: .20s; }
#view.in .list > *:nth-child(n+6), #view.in .task:nth-child(n+6) { animation-delay: .24s; }

/* pulsanti: rispondono sotto il dito */
.btn, .tab, .icon-btn, .palette-opt, .font-opt, .bh, .sp-chip { transition: transform .12s var(--ease-out), background-color .2s, border-color .2s, box-shadow .2s, color .2s; }
.btn:active, .tab:active, .icon-btn:active, .palette-opt:active, .font-opt:active, .sp-chip:active { transform: scale(.96); }
.btn.primary:hover, .btn.dawn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); }

/* card e widget: si sollevano appena col mouse (solo dove esiste un mouse) */
@media (hover: hover) {
  .widget, .page-card, .pages-grid > * { transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), background-color .45s var(--ease-soft), border-color .45s var(--ease-soft); }
  .widget:hover, .page-card:hover, .pages-grid > *:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
}

/* spunta di un'attività: più soddisfacente */
.check.done { animation: checkPop .32s var(--ease-out); }
@keyframes checkPop { 0% { transform: scale(.85); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
.task.done .t, .task.done b { text-decoration-color: transparent; transition: color .3s, text-decoration-color .3s; }
.task.done .t { text-decoration: line-through; text-decoration-color: currentColor; }

/* menu laterale: la voce attiva scivola invece di apparire */
.nav a { transition: background-color .22s var(--ease-soft), color .22s var(--ease-soft), transform .18s var(--ease-out); }
@media (hover: hover) { .nav a:hover { transform: translateX(2px); } }

/* barra di cattura: si "sveglia" quando la tocchi */
#capture-form { transition: box-shadow .25s var(--ease-out), transform .25s var(--ease-out), background-color .45s var(--ease-soft), border-color .45s var(--ease-soft); }
#capture-form:focus-within { transform: translateY(-1px); box-shadow: 0 8px 28px -10px rgba(0,0,0,.3), 0 0 0 3px var(--dawn-soft); }

/* toast e modali: più morbidi */
.toast { animation: toastin .32s var(--ease-out); }
.modal { animation: sheet .3s var(--ease-out); }

/* scorrimento morbido tra le sezioni */
html { scroll-behavior: smooth; }

/* chi ha chiesto meno movimento al sistema: lo rispettiamo per intero */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  #view, #view.in > *, #view.in .widgets > .widget, #view.in .list > *, #view.in .task, #view.in .ps-item { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
  .btn, .tab, .icon-btn, .widget, .nav a, #capture-form, .check.done { transition: none !important; animation: none !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ---- regole ripristinate (erano tra i blocchi temi e movimento) ---- */
/* foto del profilo, cerchio grande in Impostazioni */
.avatar-big { width: 56px; height: 56px; min-width: 56px; border-radius: 50%; background: var(--ink); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 600; flex: none; overflow: hidden; }
.avatar-big.has-img { background: var(--surface-2); }
.avatar-big img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* selettore tema: cerchi di colore veri (sfondo + pallino accento), col nome sotto */
.palette-grid { display: flex; flex-wrap: wrap; gap: .9rem .9rem; padding: .85rem 0 .25rem; }
.palette-opt { display: flex; flex-direction: column; align-items: center; gap: .45rem; border: 0; background: transparent; padding: 0; cursor: pointer; width: 4.2rem; font: inherit; }
.palette-opt .sw { width: 44px; height: 44px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line) inset; transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out); position: relative; }
.palette-opt .sw i { position: absolute; width: 40%; height: 40%; border-radius: 50%; left: 30%; top: 30%; }
.palette-opt span.lbl { font-size: .74rem; color: var(--ink-2); line-height: 1.15; text-align: center; }
.palette-opt:hover .sw { transform: scale(1.08); }
.palette-opt.on .sw { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.palette-opt.on span.lbl { color: var(--ink); font-weight: 600; }

/* carattere per parti di testo nella barra di selezione */
.sb-font { font-weight: 700; font-size: .85rem; }
.sel-pop-font { grid-template-columns: none; display: flex; flex-direction: column; min-width: 170px; max-height: 260px; overflow-y: auto; padding: 4px; }
.sel-pop-font button { width: 100%; text-align: left; height: auto; padding: .45rem .6rem; border: 0; border-radius: 6px; background: transparent; font-size: .95rem; }
.sel-pop-font button:hover { background: var(--bg); }
.sel-pop-font .font-reset { font-family: var(--sans); color: var(--ink-2); font-size: .82rem; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 2px; padding-bottom: .5rem; }

/* collegamento a Claude (MCP) */
.mcp-steps { padding-left: 1.2rem; margin: 0 0 .8rem; display: grid; gap: .6rem; font-size: .92rem; line-height: 1.5; }
.mcp-steps code { font-family: var(--mono); font-size: .82rem; background: var(--surface-2); padding: .1rem .4rem; border-radius: 5px; }
.mcp-steps code.mcp-val { display: inline-block; max-width: 100%; overflow-wrap: anywhere; user-select: all; }
.mcp-steps .btn { vertical-align: middle; margin-left: .25rem; }
.mcp-adv { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.mcp-adv summary { cursor: pointer; font-size: .85rem; color: var(--ink-2); }

/* ============================ v2.9 ============================ */
/* la tua trama */
.trama-w { display: flex; align-items: center; gap: 1rem; padding: .4rem .2rem; flex-wrap: wrap; }
.trama-n { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.trama-n b { font: 600 2.2rem/1 var(--serif); color: var(--dawn-ink); } .trama-n span { font-size: .7rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.trama-w.done .trama-n b { color: var(--ok); }
.trama-msg { font-weight: 500; }
.trama-dots { display: flex; gap: 5px; width: 100%; padding-top: .3rem; }
.trama-dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.trama-dots i.on { background: var(--dawn); } .trama-dots i.today { background: var(--line); outline: 2px dashed var(--dawn); outline-offset: -1px; }
.trama-w.done .trama-dots i.on { background: var(--ok); }
/* memorie */
.mem + .mem { border-top: 1px solid var(--line-2); margin-top: .6rem; padding-top: .6rem; }
.mem { padding: 0 1.15rem 1rem; }
.mem-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .2rem; }
.mem-j { display: block; color: var(--ink-2); text-decoration: none; font-style: italic; line-height: 1.45; }
.mem-t { display: flex; flex-wrap: wrap; gap: .3rem .7rem; margin-top: .3rem; font-size: .85rem; color: var(--ink-2); }
/* obiettivi */
.goals { display: grid; gap: .35rem; padding: 0 1.15rem 1rem; }
.goal { display: flex; align-items: center; gap: .6rem; text-align: left; background: transparent; border: 0; padding: .45rem .3rem; border-radius: 8px; color: var(--ink); font: inherit; cursor: pointer; }
.goal:hover { background: var(--surface-2); }
.gchk { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.goal.on .gchk { background: var(--ok); border-color: var(--ok); } .goal.on .gchk::after { content: '✓'; color: #fff; font-size: .75rem; font-weight: 700; }
.goal.on span:last-child { color: var(--ink-3); text-decoration: line-through; }
/* concentrazione */
.focus-w { display: grid; gap: .55rem; padding: 0 1.15rem 1rem; }
.focus-sel { width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font: inherit; }
.focus-btns { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.focus-custom { display: inline-flex; gap: .3rem; align-items: center; }
.focus-custom input { width: 62px; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .6rem; font-size: .82rem; text-align: center; }
#focus-bar { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 60; display: flex; align-items: center; gap: .8rem; width: min(560px, calc(100% - 2rem)); padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); transition: transform .35s var(--ease-out), opacity .35s var(--ease-out); }
#focus-bar.in { transform: translate(-50%, 0); opacity: 1; }
@media (min-width: 700px) { #focus-bar { bottom: 1.2rem; left: calc(var(--nav-w) + (100% - var(--nav-w)) / 2); } }
.fb-ring { position: relative; width: 52px; height: 52px; flex: none; }
.fb-ring svg { width: 52px; height: 52px; transform: rotate(-90deg); } .fb-ring circle { fill: none; stroke: var(--line); stroke-width: 3; }
.fb-ring circle.p { stroke: var(--dawn); stroke-dasharray: 100.53; stroke-dashoffset: 0; stroke-linecap: round; transition: stroke-dashoffset 1s linear; pathLength: 100; }
.fb-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .72rem; font-variant-numeric: tabular-nums; }
.fb-t { font-weight: 600; }
/* celebrazione */
.celebrate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .3s; }
.celebrate.in { opacity: 1; pointer-events: auto; }
.cb { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.4rem 2rem; text-align: center; box-shadow: var(--shadow-lg); display: grid; gap: .25rem; transform: scale(.85); transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.celebrate.in .cb { transform: scale(1); }
.cb-ic { font-size: 2rem; color: var(--dawn); animation: spin1 .9s var(--ease-out); } .cb b { font: 600 1.15rem var(--serif); } .cb span { color: var(--ink-2); font-size: .9rem; }
@keyframes spin1 { from { transform: rotate(-90deg) scale(.4); opacity: 0; } }
/* riti */
.ritual-card { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; margin: 0 0 1rem; padding: .9rem 1rem; border: 1px solid var(--dawn); background: var(--dawn-soft); color: var(--ink); border-radius: var(--r); font: inherit; cursor: pointer; animation: riseIn .5s var(--ease-out) both; }
.ritual-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.rc-ic { font-size: 1.5rem; color: var(--dawn-ink); } .ritual-card b { display: block; font-family: var(--serif); font-size: 1.05rem; } .ritual-card span span { display: block; color: var(--ink-2); font-size: .88rem; } .rc-go { color: var(--dawn-ink); font-size: 1.2rem; }
.plan-list { display: grid; gap: .3rem; max-height: 46dvh; overflow: auto; }
.plan-row { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 8px; background: var(--bg); }
.plan-row.late { border-left: 3px solid var(--warn); } .plan-row small { display: block; color: var(--ink-3); font-size: .75rem; }
.plan-sel { font: inherit; font-size: .8rem; padding: .25rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.close-done { padding: .6rem .8rem; background: var(--ok-soft); border-radius: 10px; }
.mood-row { display: flex; gap: .4rem; margin-bottom: .5rem; } .mood-b { font-size: 1.4rem; background: transparent; border: 2px solid transparent; border-radius: 10px; padding: .2rem .35rem; cursor: pointer; } .mood-b.on { border-color: var(--dawn); background: var(--dawn-soft); }
.rv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .6rem; }
.rv-grid div { background: var(--bg); border-radius: 10px; padding: .6rem .5rem; text-align: center; } .rv-grid b { display: block; font: 600 1.3rem var(--serif); } .rv-grid span { font-size: .72rem; color: var(--ink-3); }
/* command palette */
#palette { position: fixed; inset: 0; z-index: 90; opacity: 0; transition: opacity .18s; } #palette.in { opacity: 1; }
.pal-bg { position: absolute; inset: 0; background: rgba(0,0,0,.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.pal { position: absolute; left: 50%; top: 12vh; transform: translateX(-50%); width: min(600px, calc(100% - 2rem)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; transform-origin: top center; animation: palIn .22s var(--ease-out); }
@keyframes palIn { from { transform: translateX(-50%) scale(.97); opacity: 0; } }
#pal-in { width: 100%; padding: .95rem 1.1rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: 1.05rem var(--sans); outline: none; }
.pal-list { max-height: 50vh; overflow: auto; padding: .35rem; }
.pal-it { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; padding: .55rem .7rem; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.pal-it.on, .pal-it:hover { background: var(--dawn-soft); } .pi-ic { width: 22px; text-align: center; color: var(--ink-3); } .pi-k { font-size: .72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.pal-empty { padding: 1rem; color: var(--ink-3); text-align: center; } .pal-foot { padding: .45rem .9rem; font-size: .72rem; color: var(--ink-3); border-top: 1px solid var(--line-2); }
/* View Transitions: la vista nuova si dissolve dentro la vecchia */
::view-transition-old(root) { animation: 160ms var(--ease-soft) both vtOut; } ::view-transition-new(root) { animation: 220ms var(--ease-out) both vtIn; }
@keyframes vtOut { to { opacity: 0; } } @keyframes vtIn { from { opacity: 0; } }

/* ============================ HOME v2.9.2 — tre livelli, non undici scatole uguali ============================ */
/* striscia compatta: trama/concentrazione/obiettivi come tessere piccole, non tre riquadri interi */
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 1.1rem 0; }
.stat-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: .8rem .9rem; font: inherit; color: var(--ink); cursor: pointer; position: relative; overflow: hidden; }
.stat-tile:hover { border-color: var(--line); transform: translateY(-1px); box-shadow: var(--shadow); }
.st-ic { position: absolute; right: .7rem; top: .7rem; color: var(--dawn); opacity: .5; font-size: 1rem; }
.stat-tile b { font: 600 1.7rem/1 var(--serif); } .stat-tile.ok b { color: var(--ok); }
.st-l { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-top: .3rem; }
.st-s { font-size: .8rem; color: var(--ink-2); }
@media (max-width: 639px) { .stat-strip { grid-template-columns: 1fr; gap: .5rem; } .stat-tile { flex-direction: row; align-items: center; gap: .7rem; padding: .65rem .8rem; } .stat-tile b { font-size: 1.35rem; } .st-l { margin: 0; } .st-ic { position: static; margin-left: auto; opacity: .4; } }

/* "il resto della giornata": più quieto, e ripiegabile */
.home-more { margin-top: .3rem; }
.home-more-t { display: flex; align-items: center; gap: .4rem; width: 100%; background: transparent; border: 0; border-top: 1px solid var(--line-2); padding: .9rem .1rem .7rem; font: 600 .78rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); cursor: pointer; }
.home-more-t:hover { color: var(--ink-2); }
.home-more-t svg { transition: transform .2s var(--ease-out); transform: rotate(90deg); }
.home-more-t.open svg { transform: rotate(-90deg); }
#widgets-rest { display: none; }
#widgets-rest.open { display: grid; }
.widgets.quiet .card { box-shadow: none; }
.widgets.quiet .card-head h2 { font: 600 .95rem var(--sans); color: var(--ink-2); }
.widgets.quiet .widget { border-left: none !important; }
.widgets.quiet .widget > .card { border-left: 2px solid var(--line); border-radius: 4px; }

/* ============================ Blocco Colonne (v3.1) — nascono trascinando, come in Notion ============================ */
.page-columns-edit { display: flex; align-items: stretch; position: relative; }
@media (max-width: 639px) { .page-columns-edit { flex-direction: column; } .page-columns-edit .pcol-resize { display: none; } .page-columns-edit .pcol-wrap { flex: 1 1 auto !important; } }
.pcol-wrap { min-width: 0; border: 1px dashed transparent; border-radius: 10px; padding: .4rem .7rem .7rem; transition: border-color .15s, background-color .15s; position: relative; }
.pcol-wrap:hover { border-color: var(--line-2); background: var(--surface-2); }
.pcol-wrap.col-edge-l, .pcol-wrap.col-edge-r { border-color: var(--dawn); background: var(--dawn-soft); }
.pcol-wrap.col-edge-l::before, .pcol-wrap.col-edge-r::before { content: ''; position: absolute; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--dawn); }
.pcol-wrap.col-edge-l::before { left: -2px; } .pcol-wrap.col-edge-r::before { right: -2px; }
.pcol-bar { display: flex; justify-content: flex-end; height: 20px; opacity: 0; transition: opacity .15s; }
.pcol-wrap:hover .pcol-bar { opacity: 1; }
.pcol-x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: .75rem; padding: .1rem .3rem; border-radius: 5px; }
.pcol-x:hover { color: var(--warn); background: var(--warn-soft); }
.pcol-blocks { display: grid; gap: .15rem; min-height: 2rem; }
.pcol-add { align-self: center; flex: none; width: 30px; height: 30px; margin: 0 .3rem; border-radius: 50%; border: 1px dashed var(--line); background: transparent; color: var(--ink-3); font-size: 1.05rem; cursor: pointer; }
.pcol-add:hover { border-color: var(--dawn); color: var(--dawn-ink); }
/* il divisorio: una linea sottilissima che si allarga e si accende quando ci passi sopra o lo trascini */
.pcol-resize { flex: none; width: 13px; margin: 0 -6px; cursor: col-resize; position: relative; z-index: 2; }
.pcol-resize::after { content: ''; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 2px; transform: translateX(-50%); background: var(--line); border-radius: 2px; transition: background-color .15s, width .1s; }
.pcol-resize:hover::after, .pcol-resize:active::after { background: var(--dawn); width: 3px; }
@media (hover: none) { .pcol-resize { width: 18px; } .pcol-resize::after { background: var(--line); width: 3px; } }
/* bordo sinistro/destro di un blocco NORMALE (fuori da una colonna): qui nascono le colonne */
.blk.drop-left, .blk.drop-right { position: relative; }
.blk.drop-left::before, .blk.drop-right::before { content: ''; position: absolute; top: 2px; bottom: 2px; width: 3px; border-radius: 2px; background: var(--dawn); z-index: 3; }
.blk.drop-left::before { left: -8px; } .blk.drop-right::before { right: -8px; }
.pcb { display: flex; align-items: flex-start; gap: .3rem; padding: .15rem 0; position: relative; }
.pcb.dragging { opacity: .35; }
.pcb-drag { flex: none; width: 18px; height: 22px; margin-top: .1rem; border: 0; background: transparent; color: var(--ink-3); cursor: grab; opacity: 0; transition: opacity .12s; padding: 0; display: grid; place-items: center; }
.pcb-drag svg { width: 12px; height: 12px; }
.pcb:hover .pcb-drag { opacity: .6; } .pcb-drag:hover { opacity: 1 !important; }
.pcb .be { flex: 1; min-width: 0; outline: none; padding: .1rem 0; line-height: 1.5; }
.pcb .be:empty::before { content: attr(data-ph); color: var(--ink-3); opacity: 0; }
.pcb .be:empty:focus::before { opacity: 1; }
.pcb.t-h1 .be { font: 600 1.4rem/1.25 var(--serif); } .pcb.t-h2 .be { font: 600 1.15rem/1.3 var(--serif); } .pcb.t-h3 .be { font: 600 1rem/1.3 var(--sans); }
.pcb.t-quote { border-left: 2px solid var(--dawn); padding-left: .6rem; font-style: italic; color: var(--ink-2); }
.pcb.t-bullet .marker, .pcb.t-number .marker { flex: none; color: var(--ink-3); margin-top: .1rem; }
.pcb.t-todo .todo-box { flex: none; width: 18px; height: 18px; margin-top: .15rem; border: 1.5px solid var(--line); border-radius: 5px; background: var(--surface); cursor: pointer; font-size: .7rem; display: grid; place-items: center; color: var(--bg); padding: 0; }
.pcb.t-todo.checked .todo-box { background: var(--ink); border-color: var(--ink); }
.pcb.t-todo.checked .be { color: var(--ink-3); text-decoration: line-through; }
/* touch: le maniglie restano sempre visibili (niente hover su telefono/tablet) */
@media (hover: none) { .pcol-bar { opacity: 1; } .pcb-drag { opacity: .5; } }
/* aspetto salvato dentro alla pagina (fuori dall'editor: sola lettura, senza cornici tratteggiate) */
.page-columns { display: flex; gap: 1.6rem; margin: .5rem 0; align-items: flex-start; }
.page-columns .pcol { min-width: 0; }
@media (max-width: 639px) { .page-columns { flex-direction: column; gap: 1rem; } .page-columns .pcol { flex: 1 1 auto !important; } }
.push-cron { margin-top: .5rem; padding: .5rem .7rem; border-radius: 8px; font-size: .82rem; }
.push-cron.warn { background: var(--warn-soft); color: var(--warn); }
.push-cron.ok { background: var(--ok-soft); color: var(--ok); }

/* ============================================================================================
   RESTYLE v3.0 — "Manoscritto": un linguaggio visivo più audace, non solo una riorganizzazione.
   Card senza più il bordo colorato a sinistra (leggeva "modulo di dashboard"); un distintivo
   rotondo colorato in ogni intestazione al suo posto. Titoli più grandi e più sicuri di sé,
   grana di carta leggerissima su tutto, bottoni con più peso, un punto colorato per la voce
   attiva nel menu invece del solo sfondo. Tutto tramite classi condivise: cambia ovunque insieme.
   ============================================================================================ */

/* --- grana di carta: texture quasi impercettibile, presente sempre, sotto ogni tema --- */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; opacity: .035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::after { mix-blend-mode: overlay; opacity: .05; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body::after { mix-blend-mode: overlay; opacity: .05; } }
@media print { body::after { display: none; } }

/* --- masthead: la data di oggi come titolo di un giornale, non come etichetta di sistema --- */
.page-head { border-bottom: 1px solid var(--line-2); padding-bottom: 1.1rem; }
.page-head .date { font: 700 .74rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--dawn-ink); margin-bottom: .15rem; display: inline-block; }
.page-head h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 2.35rem; }
@media (max-width: 639px) { h1 { font-size: 1.85rem; } }

/* --- card: via il bordo colorato a sinistra, dentro un distintivo rotondo nell'intestazione --- */
.card { border-radius: var(--r); border: 1px solid var(--line-2); }
.widget .card { border-left: none !important; }
.widget .card-head { position: relative; padding-left: 3.05rem; min-height: 1.7rem; }
.widget .card-head::before {
  content: '•'; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 1.7rem; height: 1.7rem;
  border-radius: 50%; display: grid; place-items: center; font-size: .92rem; line-height: 1; background: var(--surface-2); color: var(--ink-2); flex: none;
}
.widget[data-w="routine"] .card-head::before { content: '⏱'; background: var(--c-rou-soft); color: var(--c-rou); }
.widget[data-w="programma"] .card-head::before { content: '📅'; background: var(--c-cal-soft); color: var(--c-cal); }
.widget[data-w="dafare"] .card-head::before { content: '☑'; background: var(--c-att-soft); color: var(--c-att); }
.widget[data-w="diario"] .card-head::before { content: '✎'; background: var(--c-dia-soft); color: var(--c-dia); }
.widget[data-w="soldi"] .card-head::before { content: '€'; background: var(--c-fin-soft); color: var(--c-fin); }
.widget[data-w="abitudini"] .card-head::before { content: '↻'; background: var(--c-oggi-soft); color: var(--c-oggi); }
.widget[data-w="memorie"] .card-head::before { content: '↺'; background: var(--c-dia-soft); color: var(--c-dia); }
.widget[data-w="preferiti"] .card-head::before, .widget[data-w^="pagina:"] .card-head::before { content: '★'; background: var(--c-pag-soft); color: var(--c-pag); }

/* --- bottoni: più peso, il primario si solleva un poco al passaggio --- */
.btn.primary, .btn.dawn { box-shadow: 0 3px 10px -3px rgba(20,17,14,.35); }
@media (hover: hover) { .btn.primary:hover, .btn.dawn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -4px rgba(20,17,14,.4); } }

/* --- menu: un punto acceso segna dove sei, non solo lo sfondo --- */
.nav a { position: relative; }
.nav a.active::before { content: ''; position: absolute; left: -.55rem; top: 50%; transform: translateY(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--dawn); }
@media (max-width: 699px) { .nav a.active::before { display: none; } }

/* ============================ Home v3.3 — "La tua giornata": intestazione + percorso ============================ */
.util-row { display: flex; justify-content: flex-end; gap: .5rem; margin-bottom: .9rem; }
.m-top { display: flex; align-items: center; gap: 1.3rem; margin-bottom: 1.6rem; }
.m-lvl-wrap { flex: none; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.m-lvl { width: 54px; height: 54px; border-radius: 50%; background: var(--dawn-soft); color: var(--dawn-ink); display: grid; place-items: center; font: 600 1.4rem var(--serif); cursor: default; }
.m-lvl-cap { font-size: .62rem; color: var(--ink-3); text-align: center; line-height: 1.15; max-width: 60px; }
.m-top-txt { flex: 1; min-width: 0; }
.m-kicker { font: 700 .72rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.m-top-txt h1 { margin: .1rem 0 0; font: 600 1.5rem var(--serif); }
.m-bar-mini { display: flex; align-items: center; gap: .55rem; margin-top: .5rem; }
.m-track { flex: 1; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; max-width: 220px; }
.m-fill { height: 100%; background: var(--dawn); border-radius: 3px; transition: width .4s var(--ease-out); }
.m-bar-mini span { font-size: .76rem; color: var(--ink-3); white-space: nowrap; }

/* il percorso: una fila, un pallino per fermata, una riga che li attraversa esattamente al centro.
   --rail = dove sta la riga (dal bordo di .path); --gap = quanto spazio resta libero dopo il pallino,
   PRIMA dell'orario — le due cose non dipendono l'una dall'altra, si possono cambiare separatamente
   senza doverle far tornare a mano ogni volta (lezione imparata: un bordo che si "aggiunge" alla
   larghezza dichiarata invece di starci dentro basta a scentrare tutto di qualche pixel). */
.path { position: relative; --rail: 7px; --gap: 16px; padding-left: calc(var(--rail) + 7px + var(--gap)); margin-bottom: 1.6rem; }
.path::before { content: ''; position: absolute; left: calc(var(--rail) - 1px); top: .5rem; bottom: .5rem; width: 2px; background: var(--line-2); }
.path .dnode { position: relative; padding: .65rem 0; display: flex; align-items: baseline; gap: 1rem; }
.path .dnode + .dnode { border-top: 1px solid var(--line-2); }
.path .dnode::before { content: ''; position: absolute; box-sizing: border-box; left: calc(-14px - var(--gap)); top: 1.05rem; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.path .dnode.done::before { background: var(--dawn); border-color: var(--dawn); }
.path .dnode.now::before { border-color: var(--dawn); box-shadow: 0 0 0 4px var(--dawn-soft); }
.dnode-time { flex: none; width: 46px; font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dnode-txt { flex: 1; min-width: 0; }
.dnode-txt b { font-weight: 500; }
.dnode-txt small { display: block; color: var(--ink-3); font-size: .78rem; margin-top: .05rem; }
.path .dnode.done .dnode-txt b { color: var(--ink-3); text-decoration: line-through; }
.path .dnode.now .dnode-txt b { color: var(--dawn-ink); }
.path .dnode[data-kind="event"] .dnode-txt small { color: var(--c-cal); }
.dnode-chk { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; padding: 0; position: relative; }
.dnode-chk.on { background: var(--ok); border-color: var(--ok); }
.dnode-chk.on::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .7rem; font-weight: 700; }
.dnode-edit { opacity: 0; flex: none; }
.path .dnode:hover .dnode-edit { opacity: 1; }
@media (hover: none) { .dnode-edit { opacity: .55; } }

.late-block, .untimed-block { margin-bottom: 1.4rem; }
.late-h { font: 700 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .5rem; display: flex; align-items: center; justify-content: space-between; }
.late-block .late-h { color: var(--warn); }

.m-foot { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line-2); font-size: .86rem; }
.m-foot-i { background: transparent; border: 0; padding: 0; color: var(--ink-2); text-decoration: none; font: inherit; cursor: pointer; }
.m-foot-i:hover { color: var(--ink); }
.m-foot-i b { color: var(--ink); font-weight: 600; }

@media (max-width: 480px) {
  .m-top { flex-wrap: wrap; row-gap: .9rem; }
  .m-top-txt { flex: 1 1 auto; min-width: 0; }
  .m-top .btn { flex: 1 1 100%; }
  .m-track { max-width: none; }
  .m-foot { flex-direction: column; gap: .6rem; }
}

/* ============================ Diario: vista mensile ============================ */
.dm-tabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 2px; gap: 2px; }
.dm-tabs button, .dm-tabs .btn-tab { border: 0; background: transparent; padding: .35rem .8rem; border-radius: 8px; font-size: .82rem; color: var(--ink-3); cursor: pointer; text-decoration: none; line-height: 1.4; }
.dm-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }
.dm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dm-dow { text-align: center; font-size: .68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding-bottom: .3rem; }
.dm-cell { aspect-ratio: 1; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); padding: .4rem; position: relative; text-decoration: none; display: block; }
.dm-cell:hover { border-color: var(--line); }
.dm-cell.empty { background: transparent; border-color: transparent; pointer-events: none; }
.dm-cell .n { font-size: .78rem; color: var(--ink-3); }
.dm-cell.has .n { color: var(--ink); font-weight: 600; }
.dm-mood { position: absolute; bottom: .35rem; right: .4rem; font-size: 1rem; }
.dm-dot { position: absolute; bottom: .5rem; left: .5rem; width: 6px; height: 6px; border-radius: 50%; background: var(--dawn); }
.dm-cell.today { border-color: var(--dawn); border-width: 1.5px; }
@media (max-width: 480px) { .dm-cell { border-radius: 8px; padding: .25rem; } .dm-cell .n { font-size: .7rem; } .dm-mood { font-size: .8rem; bottom: .2rem; right: .25rem; } }

/* ============================ Finanze: modulo rapido ============================ */
.qf-more { font-size: .82rem; color: var(--dusk); cursor: pointer; text-decoration: underline; display: inline-block; margin: .2rem 0 .8rem; }
.qf-extra { display: none; gap: .7rem; margin-bottom: .3rem; }
.qf-extra:not([hidden]) { display: grid; }
.fincat-pick { max-height: 140px; overflow-y: auto; }

.shake { animation: bk-shake .42s var(--ease-out); border-color: var(--warn) !important; }
@keyframes bk-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }

/* ============================ Calendario: trascinare un evento ============================ */
.chip[data-ev]:not(.allday-chip) { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chip.dragging-src { opacity: .35; }
.chip-ghost { position: fixed; z-index: 500; pointer-events: none; box-shadow: 0 8px 24px -8px rgba(0,0,0,.35); transform: scale(1.03); opacity: .96; }

/* ============================ Calendario: selettore vista e vista mensile ============================ */
.cal-view-seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 2px; gap: 2px; margin-right: .4rem; }
.cal-view-seg button { border: 0; background: transparent; padding: .35rem .65rem; border-radius: 8px; font-size: .8rem; color: var(--ink-3); cursor: pointer; }
.cal-view-seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cal-view-seg .cal-custom-btn { padding: .35rem .5rem; display: inline-flex; }
.mcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--line-2); gap: 1px; }
.mcal-dow { background: var(--surface); text-align: center; font: 700 .68rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: .5rem 0; }
.mcal-cell { background: var(--surface); min-height: 118px; padding: .5rem; display: flex; flex-direction: column; gap: .3rem; cursor: pointer; transition: background .12s; }
.mcal-cell:hover { background: var(--surface-2); }
.mcal-cell.out .n { color: var(--line); }
.mcal-cell .n-row { display: flex; justify-content: flex-end; }
.mcal-cell .n { font: 500 .8rem var(--sans); color: var(--ink-3); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.mcal-cell.today .n { background: var(--dawn); color: #fff; font-weight: 700; }
.mcal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mcal-item { display: flex; align-items: center; gap: .35rem; width: 100%; text-align: left; border: 0; padding: .2rem .4rem; border-radius: 6px; background: color-mix(in srgb, var(--bc, var(--dusk)) 14%, var(--surface)); font-size: .72rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.mcal-item:hover { background: color-mix(in srgb, var(--bc, var(--dusk)) 26%, var(--surface)); }
.mcal-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bc, var(--dusk)); flex: none; }
.mcal-item .tm { color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.mcal-item .tt { overflow: hidden; text-overflow: ellipsis; }
.mcal-more { font-size: .68rem; color: var(--ink-3); padding: .15rem .4rem; }
@media (max-width: 699px) { .mcal-cell { min-height: 72px; padding: .3rem; } .mcal-item { font-size: .64rem; padding: .15rem .3rem; } .cal-view-seg button { padding: .3rem .5rem; font-size: .74rem; } }

/* ============================ Pagina Analisi (amministratore) ============================ */
.an-chart-card { max-width: 620px; }
.an-bar-row { display: flex; align-items: center; gap: .7rem; padding: .4rem 0; }
.an-bar-l { width: 90px; flex: none; font-size: .82rem; color: var(--ink-2); }
.an-bar-track { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.an-bar-fill { height: 100%; border-radius: 999px; background: var(--dawn); }
.an-bar-n { width: 40px; flex: none; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
/* riga utente: più lunga di una riga attività normale (email, date, conteggi) — va a capo in modo
   pulito invece di stringere il pulsante contro il testo, su schermi stretti. */
.an-user-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line-2); }
.an-user-row:last-child { border-bottom: 0; }
.an-user-row .grow { min-width: 220px; }
.an-user-row .sub { font-size: .8rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: .1rem .5rem; }
.an-user-row .sub span:not(:last-child)::after { content: '·'; margin-left: .5rem; color: var(--line); }
@media (max-width: 480px) { .an-user-row .sub span::after { content: none; } .an-user-row .sub span { display: block; } }

/* ============================ Avviso aggiornamento disponibile ============================ */
#sw-update { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 600; display: flex; align-items: center; gap: .8rem; background: var(--ink); color: var(--bg); padding: .7rem .7rem .7rem 1.1rem; border-radius: 999px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4); font-size: .88rem; max-width: min(420px, calc(100vw - 2rem)); }
#sw-update span { white-space: nowrap; }
#sw-update button { background: var(--dawn); color: #fff; border: 0; border-radius: 999px; padding: .45rem 1rem; font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap; flex: none; }
@media (max-width: 699px) { #sw-update { left: .75rem; right: .75rem; bottom: calc(66px + env(safe-area-inset-bottom) + .75rem); max-width: none; } #sw-update span { white-space: normal; } }

/* ============================ Chatta (privata, utente <-> amministratore) ============================ */
.menu-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 .3rem; border-radius: 999px; background: var(--dawn); color: #fff; font-size: .68rem; font-weight: 700; }
.chat-conv-row { display: flex; align-items: center; gap: .7rem; }
.chat-conv-row .grow { min-width: 0; }
.chat-conv-row .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
.chat-conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; flex: none; }
.chat-conv-meta small { color: var(--ink-3); font-size: .74rem; }
.chat-head { display: flex; align-items: center; gap: .6rem; }
.chat-head h1 { font-size: 1.3rem; }
.chat-thread { display: flex; flex-direction: column; gap: .4rem; padding: .5rem .2rem 6rem; min-height: 40vh; max-height: 62dvh; overflow-y: auto; }
.chat-row { display: flex; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble { max-width: min(72%, 480px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px 14px 14px 3px; padding: .55rem .8rem; font-size: .9rem; line-height: 1.4; position: relative; }
.chat-row.mine .chat-bubble { background: var(--dawn-soft); border-color: transparent; border-radius: 14px 14px 3px 14px; }
.chat-time { display: block; text-align: right; font-size: .66rem; color: var(--ink-3); margin-top: .2rem; }
/* la barra generale ("Dimmi cosa fare") non serve dentro una conversazione: lascerebbe due barre in
   fondo allo schermo. Quella della chat prende il suo posto, fissa nello stesso punto — non "appiccicata"
   al contenitore interno, che lasciava un vuoto sopra la barra delle schede su telefono. */
body.chat-open .capture { display: none; }
.chat-input-row { display: flex; align-items: flex-end; gap: .5rem; position: fixed; left: var(--nav-w); right: 0; bottom: 0; z-index: 30; background: linear-gradient(transparent, var(--bg) 30%); padding: .7rem 2.5rem calc(.7rem + env(safe-area-inset-bottom)); }
.chat-input-row textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 18px; padding: .6rem 1rem; font: inherit; font-size: 16px; max-height: 120px; background: var(--surface); box-shadow: var(--shadow-lg); }
.chat-input-row button { width: 42px; height: 42px; border-radius: 50%; flex: none; }
@media (max-width: 699px) { .chat-input-row { left: 0; bottom: calc(66px + env(safe-area-inset-bottom)); padding: .5rem .75rem; } }

/* ============================ Chatta: allegati foto ============================ */
.chat-img { display: block; max-width: 260px; max-height: 320px; width: 100%; border-radius: 10px; margin-bottom: .3rem; cursor: zoom-in; object-fit: cover; }
.chat-bubble-photo { padding: .3rem; }
.chat-bubble-photo .chat-img { margin-bottom: 0; }
.chat-bubble-photo .chat-time { position: absolute; right: .5rem; bottom: .3rem; background: rgba(0,0,0,.45); color: #fff; padding: .05rem .35rem; border-radius: 999px; margin-top: 0; }
.chat-preview { position: fixed; left: var(--nav-w); right: 0; bottom: 4.6rem; z-index: 31; display: flex; align-items: center; gap: .5rem; padding: 0 2.5rem; }
.chat-preview[hidden] { display: none; }
.chat-preview img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow-lg); }
.chat-preview button { background: var(--ink); color: var(--bg); border-radius: 50%; width: 26px; height: 26px; }
@media (max-width: 699px) { .chat-preview { left: 0; padding: 0 .75rem; bottom: calc(66px + 3.6rem + env(safe-area-inset-bottom)); } }

/* ============================ Eccezione singola su evento ricorrente ============================ */
.ev-onlyday { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--ink-2); margin-top: .3rem; cursor: pointer; }
.ev-onlyday input { width: auto; }

/* ============================ Scheda-pagina nella home, cliccabile per intero ============================ */
.card-openable { cursor: pointer; transition: box-shadow .15s, transform .1s; }
.card-openable:hover { box-shadow: var(--shadow-lg); }
.card-openable:active { transform: scale(.995); }

/* ============================ Elimina evento: pulsante unico a destra + scelta ============================ */
.btn.danger-solid { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn.danger-solid:hover { filter: brightness(.93); }
.del-choice { display: grid; gap: .5rem; margin-top: .6rem; }
.del-choice .btn { width: 100%; justify-content: center; min-height: 46px; }
/* v4.7.3: tre scelte, due su due righe ("da oggi in poi" + "i giorni passati restano"); il testo va a capo
   invece di allargare la finestra oltre lo schermo del telefono */
.del-choice { grid-template-columns: minmax(0, 1fr); }
.del-choice .btn { white-space: normal; text-align: center; }
.del-choice .btn.del-two { flex-direction: column; gap: 1px; padding-top: .5rem; padding-bottom: .5rem; }
.del-choice .btn.del-two small { font-weight: 500; font-size: .76rem; opacity: .9; }
.del-choice .btn.danger { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }

/* Pagina senza icona: nessun "foglio" di ripiego — lo spazio dell'icona sparisce del tutto */
.ic:empty, .sp .ic:empty, .page-block .ic:empty, .sp-chip .ic:empty, .pcard .ic:empty, .ps-ic:empty, .nav .pi:empty { display: none; }

/* ============================ Ricorrenza personalizzata ============================ */
.rec-opts { border: 1px solid var(--line); border-radius: 14px; padding: .9rem; margin: -.2rem 0 .9rem; display: grid; gap: .8rem; background: var(--surface-2); }
.rec-opts[hidden], .rec-custom[hidden], .rec-row[hidden] { display: none !important; }
.rec-custom { display: grid; gap: .8rem; }
.rec-row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .6rem; }
.rec-lbl { width: 5.6rem; flex: none; font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); }
/* stepper − 1 + : niente campo numerico grezzo del browser */
.rec-stepper { display: inline-flex; align-items: stretch; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.rec-stepper button { width: 34px; border: 0; background: transparent; color: var(--ink-2); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.rec-stepper button:hover { background: var(--surface); color: var(--ink); }
.rec-stepper input { width: 2.8rem; border: 0; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); background: transparent; color: var(--ink); text-align: center; font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; padding: 0; min-height: 0; }
.rec-stepper input::-webkit-outer-spin-button, .rec-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rec-stepper input:focus { outline: 0; background: var(--dawn-soft); }
/* pillole a scelta singola (unità, termine) */
.rec-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); }
.rec-seg button, .rec-seg label span { display: inline-flex; align-items: center; height: 30px; padding: 0 .75rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: .86rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.rec-seg label { position: relative; cursor: pointer; }
.rec-seg label input { position: absolute; opacity: 0; pointer-events: none; }
.rec-seg button:hover, .rec-seg label:hover span { color: var(--ink); }
.rec-seg button.on, .rec-seg label input:checked + span { background: var(--dawn); color: #fff; box-shadow: 0 2px 8px -3px color-mix(in srgb, var(--dawn) 70%, transparent); }
.rec-seg label input:focus-visible + span, .rec-seg button:focus-visible { outline: 2px solid var(--dawn); outline-offset: 1px; }
.rec-days { display: flex; gap: .35rem; flex-wrap: wrap; }
.rec-days label { position: relative; cursor: pointer; }
.rec-days input { position: absolute; opacity: 0; pointer-events: none; }
.rec-days span { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); transition: background .15s, color .15s, transform .1s; }
.rec-days label:active span { transform: scale(.92); }
.rec-days input:checked + span { background: var(--dawn); border-color: var(--dawn); color: #fff; }
.rec-input { height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); padding: 0 .7rem; font-size: .95rem; min-width: 10.5rem; }
.rec-input:focus { outline: 0; border-color: var(--dawn); box-shadow: 0 0 0 3px var(--dawn-soft); }
.rec-unit-txt { font-size: .9rem; color: var(--ink-2); }
.rec-summary { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; border-radius: 10px; background: var(--dawn-soft); color: var(--dawn-ink); font-size: .86rem; font-weight: 600; line-height: 1.35; }
.rec-summary::before { content: '↻'; font-size: 1rem; flex: none; }
.rec-summary:empty { display: none; }
@media (max-width: 480px) { .rec-lbl { width: 100%; } }
/* i campi nativi (data, ora, select) seguono il tema: niente riquadri bianchi nel buio */
[data-theme="dark"] { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }

/* ============================ Time blocking: blocco disegnato trascinando ============================ */
.week-body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.week-body.drafting, .week-body.drafting * { cursor: ns-resize !important; }
.chip.draft-chip { z-index: 6; pointer-events: none; background: color-mix(in srgb, var(--c-cal) 30%, var(--surface)); border-left: 3px solid var(--c-cal); color: var(--ink); box-shadow: 0 6px 18px -6px rgba(0,0,0,.3); outline: 1.5px dashed color-mix(in srgb, var(--c-cal) 70%, transparent); outline-offset: -1.5px; }
.chip.draft-chip span { display: block; font-variant-numeric: tabular-nums; opacity: .8; }
@media (hover: hover) { .day-col { cursor: cell; } .day-col .chip { cursor: pointer; } }
.chip.draft-chip.narrow { overflow: visible; }
.chip.draft-chip.narrow b { display: none; }
.chip.draft-chip.narrow span { position: absolute; top: 0; left: calc(100% + 5px); white-space: pre; font-size: .74rem; font-weight: 700; line-height: 1.3; opacity: 1; background: var(--ink); color: var(--bg); padding: 4px 7px; border-radius: 8px; box-shadow: 0 6px 16px -6px rgba(0,0,0,.4); z-index: 7; }
.chip.draft-chip.narrow.pill-left span { left: auto; right: calc(100% + 5px); }

/* ============================ Analisi v3.36 ============================ */
.an-ctrl { gap: .6rem; flex-wrap: wrap; align-items: center; }
.an-me { display: inline-flex; align-items: center; gap: .4rem; font-size: .86rem; color: var(--ink-2); cursor: pointer; }
.an-me input { width: 16px; height: 16px; accent-color: var(--dawn); }
.an-note { margin: -.4rem 0 1rem; font-size: .82rem; color: var(--ink-3); }
.an-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1.4rem; }
.an-kpi { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.an-kpi-l { font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.an-kpi-v { font-family: var(--serif, inherit); font-size: 2.1rem; line-height: 1.1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.an-kpi-s { font-size: .8rem; color: var(--ink-3); }
.an-kpi-s.up { color: var(--ok); font-weight: 600; } .an-kpi-s.down { color: var(--warn); font-weight: 600; }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.an-grid .section { min-width: 0; }
.an-span2 { grid-column: 1 / -1; }
.an-card { padding: 1rem 1.1rem; }
/* insight */
.an-ins { padding: .3rem 0; }
.an-in { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line-2); font-size: .93rem; line-height: 1.5; color: var(--ink-2); }
.an-in:last-child { border-bottom: 0; }
.an-in b { color: var(--ink); }
.an-in-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.05rem; background: var(--surface-2); }
.an-in.up .an-in-ic { background: var(--ok-soft); } .an-in.down .an-in-ic { background: var(--warn-soft); } .an-in.flat .an-in-ic { background: var(--dawn-soft); }
.an-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.an-chip { font-size: .8rem; font-weight: 600; padding: .3rem .65rem; border-radius: 999px; background: var(--dawn-soft); color: var(--dawn-ink); text-decoration: none; }
.an-chip:hover { background: var(--dawn); color: #fff; }
/* barre giornaliere */
.an-days { display: flex; align-items: flex-end; gap: 2px; height: 140px; }
.an-day { flex: 1; height: 100%; display: flex; align-items: flex-end; border-radius: 4px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.an-day.we { background: var(--surface-2); }
.an-day i { display: block; width: 100%; border-radius: 4px; background: var(--dawn); opacity: .85; transition: opacity .15s; }
.an-day:hover i { opacity: 1; }
.an-day.today i { background: var(--dawn-ink); }
.an-days-x { display: flex; justify-content: space-between; margin-top: .45rem; font-size: .72rem; color: var(--ink-3); }
/* heatmap */
.an-heat { display: grid; gap: 3px; }
.an-hrow { display: grid; grid-template-columns: 16px repeat(24, 1fr); gap: 3px; align-items: center; }
.an-hl { font-size: .7rem; font-weight: 700; color: var(--ink-3); }
.an-hrow i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.an-hrow i.l1 { background: color-mix(in srgb, var(--dawn) 28%, var(--surface-2)); }
.an-hrow i.l2 { background: color-mix(in srgb, var(--dawn) 52%, var(--surface-2)); }
.an-hrow i.l3 { background: color-mix(in srgb, var(--dawn) 76%, var(--surface-2)); }
.an-hrow i.l4 { background: var(--dawn); }
.an-hax span { font-size: .66rem; color: var(--ink-3); }
/* strumenti */
.an-tool { display: grid; grid-template-columns: 8.5rem 1fr 11rem; align-items: center; gap: .8rem; padding: .45rem 0; }
.an-tool-l { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; color: var(--ink); }
.an-tool-l i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.an-tool-t { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.an-tool-t div { height: 100%; border-radius: 999px; min-width: 0; }
.an-tool-n { font-size: .8rem; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.an-tool-n b { color: var(--ink); }
/* utenti */
.an-users { padding: 0; }
.an-u { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .5rem 1rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.an-u:last-child { border-bottom: 0; }
.an-u .avatar { width: 36px; height: 36px; font-size: .9rem; }
.an-u-main { min-width: 0; }
.an-u-top { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.an-u-sub { font-size: .8rem; color: var(--ink-3); margin-top: .15rem; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .4rem; }
.an-pill { font-size: .7rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; letter-spacing: .01em; }
.an-pill.ok { background: var(--ok-soft); color: var(--ok); }
.an-pill.dawn { background: var(--dawn-soft); color: var(--dawn-ink); }
.an-pill.warn { background: var(--warn-soft); color: var(--warn); }
.an-pill.mute { background: var(--surface-2); color: var(--ink-3); }
.an-dot { display: inline-flex; align-items: center; gap: .25rem; }
.an-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.an-spark { display: grid; grid-template-columns: repeat(30, 5px); gap: 2px; }
.an-spark i { height: 16px; border-radius: 2px; background: var(--surface-2); }
.an-spark i.on { background: var(--dawn); }
.an-u-act { display: flex; gap: .3rem; }
@media (max-width: 1100px) { .an-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .an-grid { grid-template-columns: 1fr; } .an-u { grid-template-columns: auto 1fr; } .an-spark { grid-column: 2; } .an-u-act { grid-column: 2; } }
@media (max-width: 560px) {
  .an-kpi { padding: .8rem .9rem; } .an-kpi-v { font-size: 1.7rem; }
  .an-tool { grid-template-columns: 1fr auto; gap: .3rem .6rem; } .an-tool-t { grid-column: 1 / -1; grid-row: 2; }
  .an-in { padding: .75rem .9rem; font-size: .9rem; }
  .an-spark { grid-template-columns: repeat(30, 1fr); width: 100%; }
  .an-hrow { gap: 2px; } .an-heat { gap: 2px; }
}

/* ============================ Trama libera v4.0: blocchi vivi, modalità, modelli ============================ */
.blocks { display: flex; flex-wrap: wrap; column-gap: 16px; align-items: stretch; }
.blocks > .blk { flex: 0 0 calc(100% + 44px); min-width: 0; box-sizing: border-box; }
@media (min-width: 700px) {
  .blocks > .blk.sz-half { flex-basis: calc(50% + 44px - 8px); }
  .blocks > .blk.sz-third { flex-basis: calc(33.333% + 44px - 10.67px); }
}
.blk.t-live { padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 639px) { .blocks > .blk { flex-basis: calc(100% + 6px); } .cov-grads { display: none !important; } }
.blk.t-live .blk-main { width: 100%; min-width: 0; align-items: stretch; }
.blk.t-live .live-card { flex: 1; min-width: 0; }
.live-card { --lc: var(--dawn); --lcs: var(--dawn-soft); height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .95rem .7rem; box-shadow: var(--shadow); font-family: var(--sans, inherit); cursor: default; user-select: none; -webkit-user-select: none; }
.live-card.lk-tasks { --lc: var(--c-att); --lcs: var(--c-att-soft); }
.live-card.lk-cal { --lc: var(--c-cal); --lcs: var(--c-cal-soft); }
.live-card.lk-habits { --lc: var(--c-rou); --lcs: var(--c-rou-soft); }
.live-card.lk-money { --lc: var(--c-fin); --lcs: var(--c-fin-soft); }
.live-card.lk-now { --lc: var(--c-oggi); --lcs: var(--c-oggi-soft); }
.live-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; font-size: .92rem; }
.live-head b { font-weight: 700; color: var(--ink); }
.live-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--lcs); color: var(--lc); font-size: .85rem; font-weight: 700; flex: none; }
.live-opt { white-space: nowrap; border: 0; background: var(--surface-2); color: var(--ink-2); font: inherit; font-size: .78rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; cursor: pointer; }
.live-opt:hover { color: var(--ink); }
.live-set { border: 0; background: transparent; color: var(--ink-3); width: 28px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 1rem; opacity: .6; }
.live-card:hover .live-set, .live-set:focus-visible { opacity: 1; }
.live-set:hover { background: var(--surface-2); color: var(--ink); }
@media (hover: none) { .live-set { opacity: 1; } }
.live-body { font-size: .9rem; }
.live-empty { color: var(--ink-3); font-size: .86rem; padding: .35rem 0; }
.live-empty.sm { padding: .1rem 0 .3rem; font-size: .8rem; }
.live-more { display: inline-block; margin-top: .35rem; font-size: .8rem; color: var(--ink-3); }
.live-add { margin-top: .5rem; border: 1px dashed var(--line); background: transparent; color: var(--ink-3); font: inherit; font-size: .82rem; font-weight: 600; padding: .35rem .6rem; border-radius: 9px; cursor: pointer; width: 100%; text-align: left; }
.live-add:hover { color: var(--ink); border-color: var(--lc); background: var(--lcs); }
/* attività */
.lt-row { display: flex; align-items: center; gap: .55rem; padding: .42rem .1rem; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.lt-row:last-child { border-bottom: 0; }
.lt-row:hover .lt-t { color: var(--ink); }
.lt-ck { flex: none; width: 18px; height: 18px; border: 1.6px solid var(--ink-3); border-radius: 5px; background: transparent; cursor: pointer; padding: 0; }
.lt-ck:hover { border-color: var(--ok); }
.lt-ck.on { background: var(--ok); border-color: var(--ok); }
.lt-row.done .lt-t { text-decoration: line-through; color: var(--ink-3); }
.lt-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.lt-p { flex: none; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; }
.lt-p.hi { background: var(--warn-soft); color: var(--warn); } .lt-p.me { background: var(--dawn-soft); color: var(--dawn-ink); } .lt-p.lo { background: var(--ok-soft); color: var(--ok); }
.lt-d { flex: none; font-size: .76rem; color: var(--ink-3); min-width: 4.5rem; text-align: right; }
.lt-d.late { color: var(--warn); font-weight: 600; }
.sz-third .lt-p, .sz-third .lt-d { display: none; }
/* 1.1.6 · le pagine nei blocchi della home: «Una pagina» (il suo contenuto) e «Le tue pagine» (recenti, preferite, tutte) */
.live-ic.ti { background: transparent; }
.live-ic.ti svg { width: 24px; height: 24px; }
.live-card.lk-page, .live-card.lk-pages { --lc: var(--c-pag); --lcs: var(--c-pag-soft); }
.lp-body { position: relative; max-height: 15.5rem; overflow: hidden; cursor: pointer; font-size: .92rem; line-height: 1.5; color: var(--ink-2); border-radius: 10px; -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
.lp-body.empty { -webkit-mask-image: none; mask-image: none; padding: .2rem 0; }
.lp-body > :first-child { margin-top: 0; }
.lp-body h1 { font-size: 1.15rem; } .lp-body h2 { font-size: 1.05rem; } .lp-body h3 { font-size: .98rem; }
.lp-body img { max-width: 100%; height: auto; border-radius: 8px; }
.lp-body .live-block { display: none; }
.lp-body:focus-visible { outline: 2px solid var(--lc); outline-offset: 2px; }
.sz-half .lp-body, .sz-third .lp-body { max-height: 9.5rem; }
.lpl { display: flex; flex-direction: column; }
.lpl-row { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .45rem .1rem; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.lpl-row:last-child { border-bottom: 0; }
.lpl-ic { flex: none; width: 24px; height: 24px; display: grid; place-items: center; font-size: 1.05rem; }
.lpl-ic svg { width: 22px; height: 22px; }
.lpl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lpl-t b { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lpl-t small { font-size: .78rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lpl-d { flex: none; font-size: .74rem; color: var(--ink-3); }
.lpl-row:hover b { color: var(--lc); }
.sz-third .lpl-t small, .sz-third .lpl-d { display: none; }
@media (hover: none) { .lpl-row { min-height: 44px; } }
/* le liste da spuntare dentro un'anteprima di pagina (blocco «Una pagina» e scheda «Una pagina»): quadratini, non puntini */
.lp-body ul.todo-list, .h5-page ul.todo-list { list-style: none; padding-left: 0; }
.lp-body li.todo, .h5-page li.todo { position: relative; padding-left: 1.65rem; }
.lp-body li.todo::before, .h5-page li.todo::before { content: ''; position: absolute; left: 0; top: .25em; width: 15px; height: 15px; box-sizing: border-box; border: 1.5px solid var(--ink-3); border-radius: 4px; }
.lp-body li.todo.checked, .h5-page li.todo.checked, .lp-body li.todo[data-checked="1"], .h5-page li.todo[data-checked="1"] { color: var(--ink-3); text-decoration: line-through; }
.lp-body li.todo.checked::before, .h5-page li.todo.checked::before, .lp-body li.todo[data-checked="1"]::before, .h5-page li.todo[data-checked="1"]::before { background: var(--ink-3); border-color: var(--ink-3); }
/* calendario */
.lc-day { padding: .25rem 0 .35rem; }
.lc-dl { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .2rem; }
.lc-dl.today { color: var(--lc); }
.lc-ev { display: flex; gap: .55rem; align-items: baseline; padding: .3rem .5rem; margin-bottom: 3px; border-left: 3px solid var(--bc, var(--lc)); background: var(--surface-2); border-radius: 0 7px 7px 0; color: var(--ink); text-decoration: none; font-size: .86rem; }
.lc-ev.past { opacity: .5; }
.lc-h { flex: none; font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 2.6rem; }
/* abitudini */
.lh-prog { height: 6px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.lh-prog i { display: block; height: 100%; background: var(--lc); border-radius: 9px; transition: width .3s; }
.lh-n { font-size: .75rem; color: var(--ink-3); margin: .3rem 0 .2rem; }
.lh-row { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: transparent; font: inherit; color: var(--ink-2); padding: .4rem .1rem; border-bottom: 1px solid var(--line-2); cursor: pointer; text-align: left; }
.lh-row:last-child { border-bottom: 0; }
.lh-ck { width: 18px; height: 18px; border-radius: 50%; border: 1.6px solid var(--ink-3); flex: none; }
.lh-row.on { color: var(--ink); } .lh-row.on .lh-ck { background: var(--lc); border-color: var(--lc); }
/* soldi */
.lm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.lm-grid small { display: block; font-size: .72rem; color: var(--ink-3); }
.lm-grid b { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.lm-grid b.neg { color: var(--warn); } .lm-grid b.pos { color: var(--ok); }
.sz-third .lm-grid { grid-template-columns: 1fr; }
.lm-today { font-size: .8rem; color: var(--ink-3); margin-top: .35rem; }
/* adesso */
.ln-clock { font-family: var(--serif); font-size: 2.3rem; line-height: 1.05; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.ln-date { font-size: .82rem; color: var(--ink-3); margin-bottom: .55rem; }
.ln-date::first-letter { text-transform: uppercase; }
.ln-line { display: flex; align-items: baseline; gap: .45rem; font-size: .88rem; padding: .2rem 0; color: var(--ink); flex-wrap: wrap; }
.ln-line small { color: var(--ink-3); } .ln-line.muted { color: var(--ink-3); font-size: .84rem; }
.ln-k { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .12rem .45rem; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); }
.ln-k.now { background: var(--lcs); color: var(--lc); }
/* azioni rapide */
.la-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.la-grid button, .la-grid a { display: flex; align-items: center; gap: .45rem; padding: .6rem .7rem; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.la-grid button:hover, .la-grid a:hover { background: var(--dawn-soft); color: var(--dawn-ink); }
/* menu del blocco */
.live-menu { position: absolute; z-index: 90; width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .35rem; }
.live-menu .lmh { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: .45rem .55rem .2rem; }
.live-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; font-size: .88rem; color: var(--ink); padding: .45rem .55rem; border-radius: 7px; cursor: pointer; }
.live-menu button:hover { background: var(--surface-2); } .live-menu button.on { font-weight: 700; } .live-menu button.danger { color: var(--warn); }
.live-menu hr { border: 0; border-top: 1px solid var(--line-2); margin: .3rem 0; }
/* menu "/" */
.slash-sec { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: .6rem .6rem .25rem; border-top: 1px solid var(--line-2); margin-top: .25rem; }
.si-live { font-style: normal; font-size: .62rem; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: .05rem .35rem; border-radius: 5px; margin-left: .25rem; vertical-align: 1px; }
/* copertine a sfumatura */
.cov-grads { display: inline-flex; gap: 4px; align-items: center; background: rgba(0,0,0,.35); padding: 4px; border-radius: 9px; }
.cov-g { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid rgba(255,255,255,.55); cursor: pointer; padding: 0; background-size: cover; }
/* larghezza piena e home */
.page-editor.notion.wide { max-width: none; }
@media (min-width: 640px) { .page-layout.home { grid-template-columns: minmax(0, 1fr); } .page-layout.home .pages-side { display: none; } }
.page-layout.home .page-editor.notion.wide { max-width: 1180px; margin: 0 auto; width: 100%; }
/* impostazioni: modalità */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; text-align: left; padding: .9rem; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mode-card:hover { border-color: var(--ink-3); }
.mode-card.on { border-color: var(--dawn); box-shadow: 0 0 0 4px var(--dawn-soft); }
.mode-card b { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin-top: .4rem; }
.mode-card small { color: var(--ink-2); font-size: .84rem; line-height: 1.4; }
.mode-prev { width: 100%; height: 86px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); display: grid; gap: 5px; padding: 8px; }
.mode-prev i { border-radius: 5px; background: var(--surface-2); }
.mode-prev.g { grid-template-columns: 1fr 1fr; grid-template-rows: 14px 1fr; } .mode-prev.g i:first-child { grid-column: 1 / -1; width: 45%; }
.mode-prev.l { grid-template-columns: 1fr 2fr 1fr; grid-template-rows: 26px 1fr; background: linear-gradient(to bottom, #6b2a1c 0, transparent 45%), var(--bg); } .mode-prev.l i:first-child { grid-column: 1 / -1; background: transparent; }
.mode-prev.l i:nth-child(3) { outline: 1.5px dashed var(--dawn); outline-offset: -1px; }
@media (max-width: 520px) { .mode-grid { grid-template-columns: 1fr; } .mode-prev { height: 64px; } }
/* modelli */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin: .5rem 0; }
.tpl-card { display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.tpl-card:hover { border-color: var(--dawn); }
.tpl-card.busy { border-color: var(--dawn); opacity: .85; }
.tpl-card:disabled { cursor: progress; }
.tpl-cov { height: 64px; display: grid; place-items: center; font-size: 1.9rem; background: var(--surface-2) center/cover; }
.tpl-txt { display: flex; flex-direction: column; padding: .55rem .7rem .7rem; gap: .15rem; }
.tpl-card b { font-size: .95rem; }
.tpl-card small { color: var(--ink-3); font-size: .78rem; line-height: 1.35; }
@media (max-width: 560px) { .tpl-grid { grid-template-columns: 1fr; } .tpl-card { flex-direction: row; align-items: center; } .tpl-cov { width: 64px; height: auto; align-self: stretch; flex: none; } }

/* ============================ Abitudini v4.1: griglia a quadratini ============================ */
:root { --hc-empty: #E9E3D8; }
[data-theme="dark"] { --hc-empty: #2E2922; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hc-empty: #2E2922; } }
.h-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1.1rem; }
.h-sum > div { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: .75rem .9rem; min-width: 0; }
.h-sum small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.h-sum b { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.h-sum span { display: block; font-size: .76rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-streak { color: #E8903E; }
.h-cards { display: grid; grid-template-columns: 1fr; gap: .8rem; }
@media (min-width: 700px) { .h-cards { grid-template-columns: 1fr 1fr; } }
.hcard { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: .8rem .85rem .7rem; min-width: 0; }
.hc-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .65rem; }
.hc-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.05rem; flex: none; background: color-mix(in srgb, var(--hc) 22%, var(--surface)); }
.hc-name { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: var(--ink); font: inherit; padding: 0; cursor: pointer; }
.hc-name b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-name small { display: block; font-size: .76rem; color: var(--ink-3); }
.hc-name:hover b { text-decoration: underline; text-decoration-color: var(--line); }
.hc-pct { text-align: right; font-weight: 700; font-size: .92rem; color: var(--ink-2); flex: none; font-variant-numeric: tabular-nums; }
.hc-pct small { display: block; font-size: .66rem; font-weight: 600; color: var(--ink-3); }
.h-tap { flex: none; min-width: 40px; height: 40px; border-radius: 12px; border: 1.6px solid var(--line); background: transparent; color: var(--ink-3); font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; padding: 0 .5rem; transition: background .15s, transform .1s; }
.h-tap:hover { border-color: var(--hc); color: var(--hc); }
.h-tap:active { transform: scale(.93); }
.h-tap.on { background: var(--hc); border-color: var(--hc); color: #17140F; }
.h-tap.cnt { font-size: .8rem; border-color: color-mix(in srgb, var(--hc) 70%, transparent); color: var(--hc); }
.h-tap.cnt.on { color: #17140F; }
.h-tap.off { opacity: .4; cursor: default; }
.h-tap.sm { min-width: 30px; height: 28px; border-radius: 8px; font-size: .78rem; }
/* quadratini */
.hc { display: block; border-radius: 2.5px; background: var(--hc-empty); }
.hc.l1 { background: color-mix(in srgb, var(--hc, var(--c-rou)) 32%, var(--hc-empty)); }
.hc.l2 { background: color-mix(in srgb, var(--hc, var(--c-rou)) 55%, var(--hc-empty)); }
.hc.l3 { background: color-mix(in srgb, var(--hc, var(--c-rou)) 78%, var(--hc-empty)); }
.hc.l4 { background: var(--hc, var(--c-rou)); }
.hc.off:not(.l1):not(.l2):not(.l3):not(.l4) { opacity: .35; }
.hc.fut { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.hc.today { box-shadow: 0 0 0 1.5px var(--ink); }
.hc.blank { background: transparent; }
.hc[data-hd] { cursor: pointer; }
.hc[data-hd]:hover { filter: brightness(1.15); box-shadow: 0 0 0 1.5px var(--ink-3); }
.hg-year { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); gap: 2.5px; }
.hg-year .hc { aspect-ratio: 1; }
.hg-months { position: relative; height: 14px; margin-top: 4px; font-size: .64rem; color: var(--ink-3); }
.hg-months span { position: absolute; top: 0; white-space: nowrap; }
.hg-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.hg-week > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .7rem; color: var(--ink-3); font-weight: 700; }
.hg-week .hc, .hg-month .hc { width: 100%; aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; }
.hc.big b { font-size: .72rem; font-weight: 700; color: var(--ink-3); }
.hc.big.l3 b, .hc.big.l4 b { color: #17140F; }
.hg-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.hg-month > span { text-align: center; font-size: .68rem; font-weight: 700; color: var(--ink-3); }
@media (min-width: 700px) { .hg-week, .hg-month { max-width: 420px; } }
.h-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: .72rem; color: var(--ink-3); margin-top: .7rem; flex-wrap: wrap; }
.h-legend .hc { width: 11px; height: 11px; --hc: var(--c-rou); }
/* − n + */
.h-step { position: absolute; z-index: 95; display: flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .45rem .55rem; }
.h-step small { position: absolute; top: -1.35rem; left: .3rem; font-size: .72rem; font-weight: 700; color: var(--ink-2); background: var(--surface); padding: .05rem .4rem; border-radius: 6px; border: 1px solid var(--line-2); white-space: nowrap; }
.h-step button { width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--ink); font-size: 1.15rem; cursor: pointer; }
.h-step button:hover { background: color-mix(in srgb, var(--hc) 30%, var(--surface-2)); }
.h-step b { min-width: 3.4rem; text-align: center; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.h-step b span { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
/* modale abitudine */
.h-form-top { display: flex; gap: .7rem; align-items: flex-end; }
.h-form-top .field { flex: 1; }
.h-emoji { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 1.5rem; cursor: pointer; margin-bottom: .9rem; flex: none; }
.h-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: -.3rem 0 .8rem; padding: .5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.h-emoji-grid[hidden] { display: none; }
.h-emoji-grid button { border: 0; background: transparent; font-size: 1.25rem; padding: .25rem; border-radius: 8px; cursor: pointer; }
.h-emoji-grid button:hover { background: var(--surface); }
.h-colors { display: flex; gap: .45rem; flex-wrap: wrap; }
.h-colors label { position: relative; cursor: pointer; }
.h-colors input { position: absolute; opacity: 0; }
.h-colors span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--surface); }
.h-colors input:checked + span { border-color: var(--ink); }
/* Oggi e blocchi vivi */
.habit .hcount { font-size: .78em; opacity: .75; font-variant-numeric: tabular-nums; }
.habit-more { text-decoration: none; opacity: .7; }
.lh-cnt { margin-left: auto; font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lhg { display: grid; gap: .7rem; }
.lhg-h { display: flex; align-items: center; gap: .45rem; margin-bottom: .35rem; font-size: .86rem; }
.lhg-h b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hg-year.mini { gap: 2px; text-decoration: none; }
@media (max-width: 700px) { .h-sum { grid-template-columns: 1fr 1fr; gap: .5rem; } .h-sum b { font-size: 1.25rem; } .hcard { padding: .7rem .7rem .6rem; } .hg-year { gap: 2px; } }

/* ============================ Calendari collegati v4.2 ============================ */
.ext-dir { display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1rem .5rem; }
.ext-dir b { font-size: .92rem; }
.ext-row { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.ext-row .grow { min-width: 160px; }
.ext-row b { display: block; font-size: .92rem; }
.ext-row small { color: var(--ink-3); font-size: .78rem; }
.ext-err { color: var(--warn); }
.ext-dot { width: 12px; height: 12px; border-radius: 4px; flex: none; display: inline-block; }
.ext-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); margin-bottom: .6rem; }
.ext-tabs button { flex: 1; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: .86rem; font-weight: 600; padding: .45rem .5rem; border-radius: 8px; cursor: pointer; }
.ext-tabs button.on { background: var(--dawn); color: #fff; }
.ext-steps { margin: 0 0 .9rem; padding-left: 1.2rem; font-size: .86rem; color: var(--ink-2); display: grid; gap: .3rem; }
.ext-steps code { font-size: .8em; background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; }
.ext-when { margin: 0 0 .6rem; font-weight: 600; color: var(--ink-2); }
.ext-notes { margin: 0 0 .8rem; font-size: .9rem; color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; }
.ext-from { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--ink-3); padding: .6rem .7rem; border-radius: 10px; background: var(--surface-2); }
.chip.ext { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255,255,255,.05) 6px 12px); cursor: pointer; }

/* ============================ Collega a Claude v4.3 ============================ */
.mcp-hero { padding: .9rem 1rem .4rem; }
.mcp-hero b { display: block; font-size: .95rem; margin-bottom: .15rem; }
.mcp-url { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .5rem 1rem; padding: .6rem .75rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.mcp-url .small { width: 100%; }
.mcp-url code { flex: 1; min-width: 0; font-family: var(--mono); font-size: .86rem; overflow-wrap: anywhere; user-select: all; color: var(--ink); }
.mcp-check { margin: .4rem 1rem .6rem; padding: .55rem .75rem; border-radius: 10px; font-size: .88rem; }
.mcp-check.ok { background: var(--ok-soft); color: var(--ok); }
.mcp-check.warn { background: var(--warn-soft); color: var(--ink); }
.mcp-check.warn b { color: var(--warn); }
.mcp-check code { font-family: var(--mono); font-size: .8rem; background: var(--surface); padding: .05rem .3rem; border-radius: 4px; }
.mcp-steps.big { margin: .4rem 1rem .6rem 1rem; padding-left: 1.3rem; }
.mcp-tools, .mcp-log { margin: 0 1rem .6rem; }
.mcp-cid { margin-top: .55rem; padding-top: .5rem; border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent); font-size: .86rem; color: var(--ink-2); }
.mcp-cid code { font-family: var(--mono); font-size: .84rem; background: var(--surface); padding: .1rem .4rem; border-radius: 5px; color: var(--ink); user-select: all; }
.mcp-cid .btn { margin-left: .25rem; }

/* v4.3.2 registro collegamento Claude */
.conn-log{display:flex;flex-direction:column;gap:.15rem;max-height:260px;overflow:auto;font-size:.78rem;margin-top:.3rem}
.conn-row{display:grid;grid-template-columns:auto auto 1fr;gap:.55rem;align-items:baseline;padding:.3rem .5rem;border-radius:8px;background:var(--bg)}
.conn-row .t{color:var(--ink-3);font-variant-numeric:tabular-nums;white-space:nowrap}.conn-row .d{color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.conn-row.bad b{color:var(--warn,#B0413E)}
@media(max-width:520px){.conn-row{grid-template-columns:1fr}.conn-row .d{white-space:normal}}

/* ============================ v4.4 TRAMA SEMPLICE ============================ */
a[href="#agenda"] .nic { background: var(--c-cal-soft); } a[href="#agenda"] .nic svg { color: var(--c-cal); }
a[href="#note"] .nic { background: var(--c-dia-soft); } a[href="#note"] .nic svg { color: var(--c-dia); }
a[href="#spazi"] .nic { background: var(--c-fin-soft); } a[href="#spazi"] .nic svg { color: var(--c-fin); }
.tabbar a { position: relative; }
.s-dot { position: absolute; top: 6px; right: calc(50% - 20px); width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }
.s-navsub { margin: .5rem 0 0; padding-top: .5rem; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; }
.s-navsub a { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: .92rem; }
.s-navsub a:hover, .s-navsub a.active { background: var(--surface-2); color: var(--ink); }
.s-e { width: 28px; text-align: center; font-size: 1.05rem; }
.s-e2 { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.15rem; flex: none; }

/* testate comuni */
.s-oggi, .s-agenda, .s-spazi { max-width: 680px; }
.s-date { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.s-date a { color: var(--dawn-ink); }
.s-h1 { font: 600 clamp(1.7rem, 5vw, 2.2rem)/1.15 var(--serif); margin: .25rem 0 .35rem; letter-spacing: -.01em; }
.s-sum { color: var(--ink-2); margin: 0 0 1.1rem; font-size: 1rem; }
.s-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .25rem 0 .9rem; }
.s-head h1 { margin: 0; }
.s-lbl { display: flex; align-items: center; justify-content: space-between; margin: 1.3rem .15rem .5rem; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.s-lbl a, .s-lbl button { letter-spacing: 0; text-transform: none; font-size: .86rem; font-weight: 600; color: var(--ink-2); background: none; border: 0; cursor: pointer; text-decoration: none; padding: .2rem .1rem; }
.s-add { color: var(--dawn-ink) !important; }
.s-empty { padding: 1rem 1.1rem; color: var(--ink-2); font-size: .95rem; }
.s-empty a { color: var(--dawn-ink); }
.s-more { display: block; margin: .5rem .2rem 0; font-size: .88rem; color: var(--ink-2); text-decoration: none; }
.s-more.in { margin: 0; padding: .7rem 1rem; border-top: 1px solid var(--line-2); }

/* il prossimo impegno */
.s-now { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; font: inherit; border-radius: 18px; padding: 1rem 1.15rem; margin: .2rem 0 .2rem; background: var(--ink); color: var(--bg); position: relative; overflow: hidden; }
.s-now::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--ec, var(--dawn)); }
.s-now small { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; opacity: .72; }
.s-now b { display: block; font: 600 1.35rem/1.25 var(--serif); margin: .25rem 0 .15rem; }
.s-now span { opacity: .8; font-size: .9rem; }
[data-theme="dark"] .s-now { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .s-now { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); } }

/* righe attività */
.s-list { padding: .15rem 0; }
.s-task { display: flex; align-items: center; gap: .75rem; padding: 0 .9rem 0 1rem; min-height: 54px; border-bottom: 1px solid var(--line-2); }
.s-task:last-child { border-bottom: 0; }
.s-ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: transparent; flex: none; display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.s-ck:hover { border-color: var(--ok); }
.s-ck.on { background: var(--ok); border-color: var(--ok); }
.s-ck svg { width: 14px; height: 14px; color: #fff; }
.s-tt { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: .7rem 0; cursor: pointer; font: inherit; color: var(--ink); }
.s-tt span { display: block; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.s-tt small { display: block; color: var(--ink-3); font-size: .8rem; margin-top: .1rem; }
.s-tt small .late { color: var(--warn); }
.s-task.done .s-tt span { color: var(--ink-3); text-decoration: line-through; }
.s-bk { display: inline-flex; align-items: center; gap: .3rem; }
.s-bk::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--bc); }
.s-evl { display: flex; align-items: center; gap: .7rem; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: .75rem 1rem; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.s-evl:last-child { border-bottom: 0; }
.s-evl i { width: 4px; align-self: stretch; border-radius: 3px; background: var(--ec); }
.s-evl span { flex: 1; } .s-evl small { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* abitudini e soldi in una riga */
.s-habs { display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem; }
.s-hab { display: inline-flex; align-items: center; gap: .45rem; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .45rem .8rem .45rem .55rem; cursor: pointer; font: inherit; font-size: .9rem; max-width: 100%; }
.s-hab .e { font-size: 1.05rem; } .s-hab .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 20ch; }
.s-hab b { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: .85rem; }
.s-hab.on { border-color: var(--hc); background: color-mix(in srgb, var(--hc) 18%, var(--surface)); }
.s-hab.on b { color: var(--ink); }
.s-money { display: flex; align-items: center; gap: .4rem 1.2rem; flex-wrap: wrap; padding: .9rem 1.1rem; margin-top: .8rem; text-decoration: none; color: var(--ink-2); font-size: .93rem; }
.s-money b { color: var(--ink); font-variant-numeric: tabular-nums; } .s-money .chev { display: none; }
.s-diaryline { display: block; margin-top: .8rem; padding: .9rem 1.1rem; border-radius: 16px; background: var(--c-dia-soft); color: var(--ink); text-decoration: none; font-weight: 600; }
.s-diaryline span { font-weight: 400; color: var(--ink-2); }

/* suggerimento e primo aiuto */
.s-hint { position: relative; background: var(--dawn-soft); border: 1px dashed color-mix(in srgb, var(--dawn) 55%, transparent); border-radius: 16px; padding: .9rem 2.4rem .9rem 1.05rem; color: var(--dawn-ink); margin-bottom: .6rem; }
.s-hint b { color: var(--ink); }
.s-x { position: absolute; top: .35rem; right: .45rem; width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); font-size: 1.3rem; cursor: pointer; }
.s-sug { border: 1.5px solid var(--dawn); background: color-mix(in srgb, var(--dawn-soft) 60%, var(--surface)); border-radius: 18px; padding: 1rem 1.1rem; margin-bottom: .8rem; }
.s-sug small { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dawn-ink); font-weight: 700; }
.s-sug b { display: block; font: 600 1.12rem/1.3 var(--serif); margin: .3rem 0; }
.s-sug p { margin: 0 0 .75rem; color: var(--ink-2); font-size: .93rem; }
.s-sug div { display: flex; gap: .5rem; flex-wrap: wrap; }

/* agenda */
.s-seg { flex: none; }
.s-week { display: grid; grid-template-columns: 26px repeat(7, 1fr) 26px; gap: 3px; align-items: center; margin-bottom: .9rem; }
.s-wnav { background: none; border: 0; color: var(--ink-3); font-size: 1.4rem; cursor: pointer; height: 100%; padding: 0; }
.s-wd { background: none; border: 0; border-radius: 14px; padding: .45rem 0 .5rem; cursor: pointer; color: var(--ink-3); font: inherit; font-size: .72rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.s-wd b { font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.s-wd u { width: 5px; height: 5px; border-radius: 50%; background: var(--dawn); } .s-wd u.no { background: transparent; }
.s-wd.today b { color: var(--dawn-ink); }
.s-wd.on { background: var(--ink); color: color-mix(in srgb, var(--bg) 75%, transparent); } .s-wd.on b { color: var(--bg); } .s-wd.on u { background: var(--dawn); }
.s-dayh { display: flex; align-items: center; gap: .6rem; margin: .2rem .15rem .2rem; }
.s-dayh b { font: 600 1.15rem var(--serif); text-transform: capitalize; }
.s-link { background: none; border: 0; color: var(--dawn-ink); font: inherit; cursor: pointer; font-size: .9rem; }
.s-newbtn { margin-left: auto; }
.s-allday { display: flex; flex-direction: column; gap: .35rem; margin: .7rem 0 0; }
.s-ev { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer; border: 0; border-left: 4px solid var(--ec); border-radius: 12px; padding: .6rem .8rem; background: color-mix(in srgb, var(--ec) 13%, var(--surface)); }
.s-ev b { font-weight: 600; display: block; } .s-ev small { color: var(--ink-2); font-size: .8rem; }
.s-timeline { display: flex; flex-direction: column; gap: .35rem; }
.s-tl { display: grid; grid-template-columns: 46px 1fr; gap: .6rem; align-items: start; }
.s-tl .h { font-size: .8rem; color: var(--ink-3); padding-top: .7rem; text-align: right; font-variant-numeric: tabular-nums; }
.s-tlt { background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; }
.s-tlt .s-task { border: 0; min-height: 46px; }
.s-nowline { display: grid; grid-template-columns: 46px 1fr; gap: .6rem; align-items: center; margin: .1rem 0; }
.s-nowline span { font-size: .72rem; color: var(--today, #E5443B); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.s-nowline i { height: 2px; background: var(--today, #E5443B); border-radius: 2px; position: relative; }
.s-nowline i::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--today, #E5443B); }
.s-inbox { margin-top: 1.1rem; } .s-inbox summary { cursor: pointer; color: var(--ink-2); font-size: .92rem; padding: .3rem .15rem .5rem; }
.s-foot { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: 1.4rem .15rem .5rem; font-size: .9rem; }
.s-foot a { color: var(--ink-2); text-decoration: none; } .s-foot a:hover { color: var(--ink); }

/* note: il diario del giorno in cima */
.s-diary { display: block; text-decoration: none; color: var(--ink); background: var(--dawn-soft); border: 1px solid color-mix(in srgb, var(--dawn) 30%, transparent); border-radius: 18px; padding: .95rem 1.1rem; margin: 0 0 1.1rem; max-width: 680px; }
.s-diary small { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dawn-ink); font-weight: 700; }
.s-diary b { display: block; font: 600 1.2rem var(--serif); margin: .2rem 0 .1rem; }
.s-diary span { color: var(--ink-2); font-size: .92rem; }

/* spazi */
.s-sps { padding: 0 1rem; }
.s-sp { display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid var(--line-2); }
.s-sp:last-child { border-bottom: 0; }
.s-spm { flex: 1; min-width: 0; display: flex; align-items: center; gap: .85rem; padding: .8rem 0; text-decoration: none; color: var(--ink); }
.s-spm .e { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.s-spm .t { font-size: 1rem; min-width: 0; } .s-spm .t small { display: block; color: var(--ink-3); font-size: .82rem; margin-top: .1rem; }
.s-addb { border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 10px; padding: .4rem .8rem; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; flex: none; }
.s-off { border: 0; background: none; color: var(--ink-3); font: inherit; font-size: .85rem; cursor: pointer; padding: .4rem .2rem; flex: none; }
.s-off:hover { color: var(--warn); }
.s-on { color: var(--ok); font-size: .82rem; font-weight: 700; flex: none; }
.s-always a { gap: .85rem; }

/* impostazioni: avanzate */
.s-adv { margin-top: 1.5rem; border: 1px dashed var(--line); border-radius: 18px; padding: .2rem 1rem; }
.s-adv > summary { cursor: pointer; padding: .9rem 0; list-style: none; display: flex; flex-direction: column; gap: .15rem; }
.s-adv > summary::-webkit-details-marker { display: none; }
.s-adv > summary span { font-weight: 700; font-size: 1.02rem; } .s-adv > summary span::after { content: ' ›'; color: var(--ink-3); }
.s-adv[open] > summary span::after { content: ' ⌄'; }
.s-adv > summary small { color: var(--ink-3); font-size: .85rem; }
.s-switch { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.1rem; cursor: pointer; }
.s-switch input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--dawn); flex: none; }
.s-switch small { display: block; color: var(--ink-3); font-size: .85rem; margin-top: .15rem; }

/* scheda "Nuova" */
.s-bigin { width: 100%; font: 600 1.35rem var(--serif) !important; border: 0 !important; border-bottom: 2px solid var(--dawn) !important; border-radius: 0 !important; padding: .35rem 0 .5rem !important; background: transparent !important; color: var(--ink); margin-bottom: .4rem; }
.s-bigin:focus { outline: none; }
.s-fld { border-bottom: 1px solid var(--line-2); padding: .75rem 0; }
.s-fld > small { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); margin-bottom: .5rem; }
.s-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.s-chip { position: relative; cursor: pointer; }
.s-chip input { position: absolute; opacity: 0; pointer-events: none; }
.s-chip span { display: inline-block; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: .45rem .85rem; font-size: .9rem; transition: background .12s, color .12s; }
.s-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.s-chip input:focus-visible + span { outline: 2px solid var(--dawn); outline-offset: 2px; }
.s-chip.day span { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; }
.s-days { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .6rem; }
.s-times { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; } .s-times input { width: auto; flex: 1; max-width: 150px; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; background: var(--surface); color: var(--ink); font: inherit; }
.s-dateinp { border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; background: var(--surface); color: var(--ink); font: inherit; }
.s-dateinp { margin-top: .6rem; max-width: 200px; display: block; }
.s-dateinp[hidden] { display: none; }

/* primo accesso */
.s-onb h2 { font: 600 1.6rem/1.2 var(--serif); }
.s-onb .modal-actions { justify-content: stretch; } .s-onb .modal-actions .btn { flex: 1; padding: .85rem; font-size: 1rem; }
.s-base { display: flex; gap: .6rem; align-items: flex-start; background: var(--surface-2); border-radius: 14px; padding: .75rem .9rem; font-size: .9rem; color: var(--ink-2); margin-bottom: .8rem; }
.s-base b { color: var(--ink); }
.s-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.s-opt { position: relative; cursor: pointer; }
.s-opt input { position: absolute; opacity: 0; }
.s-opt > span { display: block; height: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: .8rem .8rem .75rem; transition: border-color .15s, background .15s; }
.s-opt i { font-style: normal; font-size: 1.5rem; display: block; }
.s-opt b { display: block; font-size: .95rem; line-height: 1.25; margin-top: .3rem; color: var(--ink); }
.s-opt small { display: block; font-size: .8rem; color: var(--ink-3); margin-top: .15rem; }
.s-opt input:checked + span { border-color: var(--dawn); background: var(--dawn-soft); }
.s-opt input:checked + span::after { content: '✓'; position: absolute; top: .55rem; right: .6rem; width: 22px; height: 22px; border-radius: 50%; background: var(--dawn); color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 800; }
.s-opt input:focus-visible + span { outline: 2px solid var(--dawn); outline-offset: 2px; }
.s-ex { border: 1px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: .7rem .9rem; margin-bottom: .5rem; }
.s-ex small { color: var(--ink-3); font-size: .78rem; } .s-ex > div { font-size: 1rem; margin-bottom: .4rem; }
.s-exr { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: .95rem; }
.s-exr.ev { border-left: 4px solid var(--dawn); background: var(--dawn-soft); border-radius: 10px; padding: .4rem .7rem; }
.s-exr em { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: .82rem; }
.s-exr .s-ck { width: 20px; height: 20px; }
.s-map { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.s-map div { display: grid; grid-template-columns: 1fr 20px auto; gap: .5rem; padding: .6rem .85rem; border-bottom: 1px solid var(--line-2); font-size: .92rem; align-items: center; }
.s-map div:last-child { border-bottom: 0; } .s-map span { color: var(--ink-2); } .s-map i { color: var(--ink-3); font-style: normal; }

@media (min-width: 700px) {
  .s-now b { font-size: 1.5rem; }
  .s-pick { grid-template-columns: repeat(3, 1fr); }
}

/* v4.4 emoji a categorie + colore libero */
.emj { display: flex; flex-direction: column; gap: .4rem; }
.emj-search { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem; background: var(--surface); color: var(--ink); font: inherit; }
.emj-tabs { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .1rem; }
.emj-tabs::-webkit-scrollbar { display: none; }
.emj-tab { flex: none; border: 0; background: transparent; font-size: 1.15rem; padding: .3rem .4rem; border-radius: 9px; cursor: pointer; opacity: .55; }
.emj-tab.on, .emj-tab:hover { background: var(--surface-2); opacity: 1; }
.emj-grid { max-height: 240px; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.emj-sec { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; }
.emj-sec[hidden] { display: none; }
.emj-h { grid-column: 1 / -1; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: .55rem .2rem .2rem; position: sticky; top: 0; background: inherit; }
.emj-grid button { border: 0; background: transparent; font-size: 1.45rem; line-height: 1; padding: .35rem 0; border-radius: 9px; cursor: pointer; }
.emj-grid button:hover, .emj-grid button:focus-visible { background: var(--surface-2); }
.emj-grid button[hidden] { display: none; }
.emj-none { color: var(--ink-3) !important; font-size: 1.1rem !important; border: 1px dashed var(--line) !important; margin: 0 0 .3rem; width: 40px; }
.h-emoji-grid:has(.emj) { display: block; background: var(--surface); }
.h-emoji-grid:has(.emj)[hidden] { display: none; }
.h-emoji-grid .emj-h { background: var(--surface); }
.modal .emj-h { background: var(--surface); }
.ricon-pop { position: absolute; z-index: 5; margin-top: .3rem; width: min(330px, 86vw); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .6rem; box-shadow: var(--shadow-lg); }
.ricon-pop .emj-h { background: var(--surface); }
.hc-free span { background: conic-gradient(#E5484D, #F5A524, #46A758, #1E9FA8, #3E63DD, #8E4EC6, #D6409F, #E5484D); }
.hc-free input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.csw-free { position: relative; display: inline-block; background: conic-gradient(#E5484D, #F5A524, #46A758, #1E9FA8, #3E63DD, #8E4EC6, #D6409F, #E5484D); }
.csw-free input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.csw-row { flex-wrap: wrap; }
.bk-pick.colors { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ============================ v4.5 ICONE DI TRAMA + TELEFONO COME NOTION ============================ */
.ti { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -.22em; flex: none; }
.ti .a { fill: var(--ac, var(--dawn)); fill-opacity: .42; }
.ti-tile { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: color-mix(in srgb, var(--ac) 15%, var(--surface)); color: color-mix(in srgb, var(--ac) 55%, var(--ink)); }
.ti-tile .ti { width: 22px; height: 22px; vertical-align: 0; }
.ti-tile.lg { width: 46px; height: 46px; border-radius: 14px; } .ti-tile.lg .ti { width: 27px; height: 27px; }
.ti-tile.tb { width: 30px; height: 28px; border-radius: 9px; background: transparent; } .ti-tile.tb .ti { width: 22px; height: 22px; }
.active > .ti-tile.tb, .s-tab.active .ti-tile.tb { background: color-mix(in srgb, var(--ac) 16%, var(--surface)); }
.mood-ti { width: 1.35em; height: 1.35em; }
.page-icon .ti { width: 1em; height: 1em; vertical-align: -.1em; }
.callout-ic .ti, .hc-ic .ti, .h-emoji .ti, .ricon-btn .ti { width: 1.25em; height: 1.25em; }
.pcard .ic .ti, .sp-chip .ic .ti { width: 1.3em; height: 1.3em; }
/* barra laterale (computer) */
.nav .s-tab { gap: .55rem; }
.nav .s-tab .ti-tile.tb { width: 28px; height: 28px; } .nav .s-tab .ti-tile.tb .ti { width: 19px; height: 19px; color: inherit; }
.s-navsub a .ti { width: 20px; height: 20px; }
.nav a .ti, .s-navsub a .ti { color: color-mix(in srgb, var(--ac) 50%, var(--ink-2)); }
/* barra in basso (telefono): Oggi · Agenda · ＋ · Pagine · Tutto */
.tabbar.s-tb5 { align-items: end; }
.tabbar .s-tab { display: grid; justify-items: center; gap: 2px; font-size: .72rem; color: var(--ink-3); text-decoration: none; padding: .25rem 0; position: relative; }
.tabbar .s-tab.active { color: var(--ink); font-weight: 700; }
.s-plus { justify-self: center; align-self: center; width: 54px; height: 54px; margin-top: -20px; border-radius: 18px; border: 0; background: var(--ink); color: var(--bg); font-size: 1.9rem; font-weight: 300; line-height: 1; cursor: pointer; box-shadow: 0 6px 16px rgba(30,20,5,.25); }
[data-theme="dark"] .s-plus { background: var(--dawn); color: #1b1407; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .s-plus { background: var(--dawn); color: #1b1407; } }
@media (max-width: 699px) {
  /* una sola barra: quella che capisce l'italiano vive dentro il ＋ */
  .capture:not(.in-sheet) { display: none; }
  .main { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
.s-plus-ov { position: fixed; inset: 0; z-index: 60; background: rgba(20,16,10,.38); display: flex; align-items: flex-end; justify-content: center; animation: sfade .18s ease; }
.s-plus-ov.out { opacity: 0; transition: opacity .18s; }
@keyframes sfade { from { opacity: 0; } }
.s-plus-sh { width: 100%; max-width: 560px; background: var(--surface); border-radius: 26px 26px 0 0; padding: .7rem 1.1rem max(1.3rem, env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheet .24s cubic-bezier(.2,.8,.2,1); }
.s-plus-sh .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto .8rem; }
.s-plus-sh h2 { font: 600 1.3rem var(--serif); margin: 0 0 .7rem; }
.s-capslot .capture.in-sheet { position: static; display: block; padding: 0; background: none; pointer-events: auto; left: auto; right: auto; top: auto; bottom: auto; }
.s-capslot .capture.in-sheet form { box-shadow: none; border: 1.5px solid var(--dawn); max-width: none; }
.s-capslot .capture.in-sheet .preview { padding: .4rem .3rem 0; }
.s-qk { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .9rem; }
.s-qk button { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: .75rem .3rem .65rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; font: inherit; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.s-qk button:active { background: var(--surface-2); }
@media (min-width: 700px) { .s-plus-ov { align-items: center; } .s-plus-sh { border-radius: 22px; } }
/* Tutto */
.s-tutto { max-width: 680px; }
.s-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.s-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; padding: .95rem .4rem .8rem; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.s-tile b { font-weight: 600; font-size: .95rem; } .s-tile small { color: var(--ink-3); font-size: .78rem; line-height: 1.25; }
.s-tile.add { background: transparent; border: 1.5px dashed var(--line); box-shadow: none; color: var(--ink-3); }
.s-addi { width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.6rem; }
.s-links { padding: .15rem 0; }
.s-links a { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.s-links a:last-child { border-bottom: 0; }
.s-links .s-li { width: 24px; display: grid; place-items: center; font-size: 1.15rem; } .s-links .s-li .ti { width: 22px; height: 22px; }
.s-links .t { flex: 1; } .s-links .chev { color: var(--ink-3); }
.s-back { display: inline-block; color: var(--ink-3); text-decoration: none; font-size: .9rem; margin-bottom: .3rem; }
.s-spm .ti-tile.lg { width: 44px; height: 44px; }
.s-always a .ti-tile, .menu-list a .ti-tile { width: 36px; height: 36px; }
/* Agenda: Giorno · Attività · Mese */
.s-aseg { display: inline-flex; }
.s-asegbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin: -.2rem 0 1rem; }
.s-asegbar b { font: 600 1.35rem var(--serif); }
/* Pagine: albero */
.s-pagine { max-width: 680px; }
.s-search { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border-radius: 12px; padding: .1rem .8rem; color: var(--ink-3); margin-bottom: .6rem; }
.s-search input { flex: 1; border: 0; background: transparent; padding: .65rem 0; font: inherit; color: var(--ink); outline: 0; min-width: 0; }
.pt-sec { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin: 1rem .2rem .3rem; }
.pt-row { display: flex; align-items: center; gap: .15rem; padding-left: calc(var(--d, 0) * 1.25rem); border-radius: 10px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pt-row:active { background: var(--surface-2); }
.pt-tw { width: 26px; height: 40px; border: 0; background: none; color: var(--ink-3); font-size: .75rem; cursor: pointer; flex: none; transition: transform .15s; padding: 0; }
.pt-tw.open { transform: rotate(90deg); } .pt-tw.none { cursor: default; }
.pt-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; padding: .55rem .2rem; text-decoration: none; color: var(--ink); }
.pt-ic { width: 24px; display: grid; place-items: center; font-size: 1.1rem; flex: none; } .pt-ic .ti { width: 21px; height: 21px; }
.pt-t { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-act { width: 36px; height: 36px; border: 0; background: none; color: var(--ink-3); font-size: 1rem; cursor: pointer; flex: none; border-radius: 9px; letter-spacing: 1px; }
.pt-act:active { background: var(--surface-2); }
.pt-new { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--ink-3); font: inherit; padding: .8rem .5rem; margin-top: .3rem; cursor: pointer; }
.s-menu { display: flex; flex-direction: column; }
.s-menu button { display: flex; align-items: center; gap: .8rem; border: 0; background: none; padding: .8rem .3rem; font: inherit; font-size: 1rem; color: var(--ink); text-align: left; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.s-menu button:last-child { border-bottom: 0; } .s-menu button .ti { width: 22px; height: 22px; color: var(--ink-2); }
.s-menu button.danger { color: var(--warn); } .s-del { width: 22px; text-align: center; }
/* primo accesso con le icone */
.s-opt i .ti-tile { margin-bottom: .1rem; }
.s-base .ti-tile { width: 32px; height: 32px; } .s-base .ti-tile .ti { width: 19px; height: 19px; }
/* scelta icona: le icone di Trama */
.emj-sbox { display: flex; align-items: center; gap: .45rem; border: 1px solid var(--line); border-radius: 10px; padding: 0 .7rem; color: var(--ink-3); background: var(--surface); }
.emj-sbox .emj-search { border: 0; padding: .55rem 0; background: transparent; }
.emj-sbox .emj-search:focus { outline: none; }
.emj-tab .ti { width: 22px; height: 22px; }
.emj-sec { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; }
.emj-grid button { padding: 2px 0; display: grid; place-items: center; }
.emj-grid button .ti-tile { width: 42px; height: 42px; border-radius: 12px; }
.emj-grid button .ti-tile .ti { width: 24px; height: 24px; }
.emj-none { width: auto !important; padding: .35rem .8rem !important; font-size: .85rem !important; border-radius: 10px !important; }

/* ============================ v4.6 ICONE PIENE ============================ */
.ti.tf { stroke: none; fill: none; --c: var(--c0); --ti-dk: color-mix(in srgb, var(--c) 45%, #1a1208); --ti-dk2: color-mix(in srgb, var(--c) 40%, #2a2420); }
.tf .f { fill: var(--c); }
.tf .f2 { fill: color-mix(in srgb, var(--c) 52%, #fff); }
.tf .w { fill: #fff; }
.tf .d { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tf .l { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tf .l2 { fill: none; stroke: color-mix(in srgb, var(--c) 55%, #fff); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .ti.tf { --c: color-mix(in srgb, var(--c0) 84%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ti.tf { --c: color-mix(in srgb, var(--c0) 84%, #fff); } }
.ti-tile { background: color-mix(in srgb, var(--ac) 14%, var(--surface)); }
[data-theme="dark"] .ti-tile { background: color-mix(in srgb, var(--ac) 22%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ti-tile { background: color-mix(in srgb, var(--ac) 22%, var(--surface)); } }
.ti-tile.tb { background: transparent; }
.nav a .ti.tf, .s-navsub a .ti.tf { color: inherit; }

/* ============================ v4.6 TEMI COME AMBIENTI ============================
   Ogni tema: colori (come prima) + trama discreta dello sfondo + ombre nella sua tinta + arrotondamenti +
   il riquadro "Prossimo" e il ＋ nei suoi colori. Nuovo: Rosa. */
:root { --pat: radial-gradient(circle at 1px 1px, rgba(122,90,12,.09) 1px, transparent 1.3px) 0 0/15px 15px; --hero: linear-gradient(135deg, #1E1B18, #3A2F1E); }
body::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--pat); opacity: 1; }
[data-theme="dark"] body::after { opacity: .7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { opacity: .7; } }
.s-now { background: var(--hero); color: #fff; }
.s-plus { background: var(--hero); color: #fff; }
[data-theme="dark"] .s-plus, [data-theme="dark"] .s-now { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .s-plus, :root:not([data-theme="light"]) .s-now { color: #fff; } }
/* Alba scuro: il riquadro resta sobrio */
[data-theme="dark"]:not([data-palette]) .s-now { background: var(--surface-2); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-palette]) .s-now { background: var(--surface-2); color: var(--ink); } }
[data-theme="dark"]:not([data-palette]) .s-plus { background: var(--dawn); color: #1b1407; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-palette]) .s-plus { background: var(--dawn); color: #1b1407; } }
[data-palette="oceano"] { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='26'%3E%3Cpath d='M0 13 Q21 4 42 13 T84 13' fill='none' stroke='%232771A5' stroke-opacity='.10' stroke-width='1.3'/%3E%3C/svg%3E") 0 0/84px 26px; --hero: linear-gradient(135deg, #1F5F92, #14A8C7); --shadow: 0 1px 2px rgba(20,80,140,.06), 0 10px 26px rgba(20,80,140,.10); --r: 16px; }
[data-palette="foresta"] { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70'%3E%3Cg fill='%232E7D4A' fill-opacity='.08'%3E%3Cpath d='M14 20c0-6 4-10 11-10 0 7-4 10-11 10z'/%3E%3Cpath d='M50 52c0-5 3-8 9-8 0 6-3 8-9 8z'/%3E%3Cpath d='M46 16c0-4 3-7 7-7 0 5-3 7-7 7z'/%3E%3C/g%3E%3C/svg%3E") 0 0/70px 70px; --hero: linear-gradient(135deg, #24633B, #6BAA3D); --shadow: 0 1px 0 rgba(20,60,30,.06), 0 8px 22px rgba(20,60,30,.09); --r: 12px; }
[data-palette="tramonto"] { --pat: radial-gradient(120% 55% at 50% -10%, rgba(240,125,43,.16), transparent 60%), repeating-linear-gradient(135deg, rgba(224,102,43,.045) 0 2px, transparent 2px 24px); --hero: linear-gradient(135deg, #E0662B, #E0578C); --shadow: 0 1px 2px rgba(224,102,43,.06), 0 10px 26px rgba(224,102,43,.12); --r: 16px; }
[data-palette="viola"] { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76'%3E%3Cg fill='%237A4FD6' fill-opacity='.12'%3E%3Cpath d='M18 10l1.6 4.4L24 16l-4.4 1.6L18 22l-1.6-4.4L12 16l4.4-1.6z'/%3E%3Ccircle cx='56' cy='50' r='1.6'/%3E%3Cpath d='M58 20l1 2.6 2.6 1-2.6 1-1 2.6-1-2.6-2.6-1 2.6-1z'/%3E%3Ccircle cx='26' cy='58' r='1.1'/%3E%3C/g%3E%3C/svg%3E") 0 0/76px 76px; --hero: linear-gradient(135deg, #6D45D0, #B04DC9); --shadow: 0 1px 2px rgba(122,79,214,.07), 0 10px 28px rgba(122,79,214,.14); --r: 18px; }
[data-palette="rosa"] { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cg fill='%23D6457A' fill-opacity='.09'%3E%3Cpath d='M20 16c1.4-2.8 5.6-2.8 5.6.7S20 23 20 23s-5.6-2.8-5.6-6.3 4.2-3.5 5.6-.7z'/%3E%3Cellipse cx='54' cy='50' rx='3.2' ry='5' transform='rotate(35 54 50)'/%3E%3Cellipse cx='60' cy='18' rx='2.2' ry='3.6' transform='rotate(-30 60 18)'/%3E%3C/g%3E%3C/svg%3E") 0 0/72px 72px; --hero: linear-gradient(135deg, #D6457A, #F08BAE); --shadow: 0 1px 2px rgba(214,69,122,.06), 0 10px 26px rgba(214,69,122,.12); --r: 20px;
  --bg: #FCF1F4; --surface: #FFFFFF; --surface-2: #F8E4EB; --ink: #2C1820; --ink-2: #6E4D5A; --ink-3: #A58693;
  --line: #F0D6E0; --line-2: #F6E4EB; --dawn: #D6457A; --dawn-ink: #9C2552; --dawn-soft: #FCE3EC;
  --c-oggi: #C8901A; --c-oggi-soft: #FBF1D8; --c-att: #2E9C64; --c-att-soft: #E4F5EB; --c-cal: #8B5CF6; --c-cal-soft: #EFE9FB;
  --c-dia: #D6457A; --c-dia-soft: #FCE3EC; --c-fin: #2E9C64; --c-fin-soft: #E4F5EB; --c-rou: #1E9FA8; --c-rou-soft: #E1F5F6; --c-pag: #6B7280; --c-pag-soft: #EEF0F3;
  --amb-1: rgba(214,69,122,.12); --amb-2: rgba(240,139,174,.12); --amb-3: rgba(214,69,122,.06); }
[data-palette="rosa"][data-theme="dark"] {
  --bg: #1A1115; --surface: #24181E; --surface-2: #2E1F27; --ink: #F6E8EE; --ink-2: #D2B6C2; --ink-3: #A48897;
  --line: #43303A; --line-2: #33242C; --dawn: #EE7FA7; --dawn-ink: #F5A9C4; --dawn-soft: #3A2230;
  --c-oggi: #E2AE2C; --c-oggi-soft: #33290F; --c-att: #5FBE8B; --c-att-soft: #1A3326; --c-cal: #B39AEB; --c-cal-soft: #271F3B;
  --c-dia: #EE7FA7; --c-dia-soft: #3A2230; --c-fin: #6FD09A; --c-fin-soft: #163024; --c-rou: #67CFD6; --c-rou-soft: #12303A; --c-pag: #A3A9B4; --c-pag-soft: #232830;
  --amb-1: rgba(238,127,167,.18); --amb-2: rgba(214,69,122,.10); --amb-3: rgba(50,15,30,.30); }
@media (prefers-color-scheme: dark) { [data-palette="rosa"]:not([data-theme="light"]) {
  --bg: #1A1115; --surface: #24181E; --surface-2: #2E1F27; --ink: #F6E8EE; --ink-2: #D2B6C2; --ink-3: #A48897;
  --line: #43303A; --line-2: #33242C; --dawn: #EE7FA7; --dawn-ink: #F5A9C4; --dawn-soft: #3A2230;
  --c-oggi: #E2AE2C; --c-oggi-soft: #33290F; --c-att: #5FBE8B; --c-att-soft: #1A3326; --c-cal: #B39AEB; --c-cal-soft: #271F3B;
  --c-dia: #EE7FA7; --c-dia-soft: #3A2230; --c-fin: #6FD09A; --c-fin-soft: #163024; --c-rou: #67CFD6; --c-rou-soft: #12303A; --c-pag: #A3A9B4; --c-pag-soft: #232830;
  --amb-1: rgba(238,127,167,.18); --amb-2: rgba(214,69,122,.10); --amb-3: rgba(50,15,30,.30); } }
[data-theme="dark"] { --shadow: none; }
.card, .s-tile { border-radius: var(--r); }
.card { box-shadow: var(--shadow); }

/* ============================ v4.6 HOME LIBERA: MODIFICA SENZA FATICA ============================ */
.s-homebar { display: flex; justify-content: flex-end; gap: .5rem; margin: 0 0 .6rem; }
.s-homebar .btn { display: inline-flex; align-items: center; gap: .35rem; }
.s-hedit { max-width: 760px; }
.s-editbn { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--ink); color: var(--bg); border-radius: 16px; padding: .7rem .9rem .7rem 1.1rem; margin-bottom: 1rem; position: sticky; top: calc(3.6rem + env(safe-area-inset-top)); z-index: 5; }
@media (min-width: 700px) { .s-editbn { top: 4.2rem; } }
.s-editbn .btn { background: var(--dawn); color: #fff; border: 0; }
.s-hgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.s-hb { grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .8rem .8rem; outline: 2px dashed color-mix(in srgb, var(--dawn) 45%, transparent); outline-offset: 2px; box-shadow: var(--shadow); min-width: 0; }
.s-hb.half { grid-column: span 1; }
.s-hbar { display: flex; align-items: center; gap: .35rem; padding-bottom: .55rem; margin-bottom: .55rem; border-bottom: 1px solid var(--line-2); }
.s-hbar .nm { flex: 1; min-width: 0; display: flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .92rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.s-hbar .nm .ti { width: 20px; height: 20px; flex: none; }
.s-hbar .sz { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; gap: 2px; flex: none; }
.s-hbar .sz button { border: 0; background: none; font: inherit; font-size: .75rem; padding: .3rem .5rem; border-radius: 7px; color: var(--ink-3); cursor: pointer; }
.s-hbar .sz button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.s-hbar .ib { flex: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: .95rem; display: grid; place-items: center; }
.s-hbar .ib:disabled { opacity: .35; cursor: default; }
.s-hbar .ib.x { color: var(--warn); }
.s-hprev { font-size: .88rem; color: var(--ink-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.s-hadd { grid-column: span 2; border: 2px dashed var(--line); border-radius: var(--r); padding: 1rem; text-align: center; color: var(--ink-2); font-weight: 700; background: transparent; font: inherit; font-weight: 700; cursor: pointer; }
.s-gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.s-gal button { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: .7rem .35rem .6rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; font: inherit; cursor: pointer; color: var(--ink); text-align: center; }
.s-gal button b { font-size: .88rem; font-weight: 600; } .s-gal button small { font-size: .74rem; color: var(--ink-3); line-height: 1.2; }
.s-gal-h { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin: .9rem .1rem .5rem; }
@media (max-width: 520px) { .s-hbar .sz button { padding: .3rem .4rem; } .s-hbar .ib { width: 30px; height: 30px; } }

/* v4.6: nei temi colorati il riquadro "Prossimo" resta nei colori del tema anche sullo scuro */
[data-palette][data-theme="dark"] .s-now { background: var(--hero); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) { :root[data-palette]:not([data-theme="light"]) .s-now { background: var(--hero); color: #fff; box-shadow: none; } }
.s-hb.half .s-hbar { flex-wrap: wrap; row-gap: .45rem; }
.s-hb.half .s-hbar .nm { flex-basis: 100%; }
.s-hb.half .s-hbar .sz { margin-right: auto; }

/* v4.6.1 ambiti: modifica nel selettore */
.bk-pick.editing label[data-bkid] span { border-style: dashed; cursor: pointer; }
.bk-pick.editing label[data-bkid] span::after { content: "✎"; font-size: .78em; opacity: .6; }
.bk-pick.editing label.cur span { border-style: solid; border-color: var(--bc); background: color-mix(in srgb, var(--bc) 14%, var(--surface)); color: var(--ink); }
.bk-pick span.bk-new { flex-wrap: wrap; padding: 0; border: 0; background: none; }
.bk-pick span.bk-new::before, .bk-pick span.csw-row::before { content: none; }
.bk-hint { flex-basis: 100%; color: var(--ink-3); font-size: .78rem; }
.bk-pick [hidden] { display: none !important; }
.bk-pick span.csw-row { border: 0; padding: 0; background: none; }

/* ============================ v4.7 PIANI: Trama · Plus · Pro ============================ */
.p-pill { font-style: normal; font-size: .64rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: .18rem .5rem; border-radius: 999px; flex: none; line-height: 1.3; white-space: nowrap; }
.p-pill.plus { background: var(--dawn-soft); color: var(--dawn-ink); }
.p-pill.pro { background: color-mix(in srgb, #8B5CF6 15%, var(--surface)); color: color-mix(in srgb, #8B5CF6 72%, var(--ink)); }
.s-navsub a .p-pill { margin-left: auto; }
.p-cur { color: var(--ink-3); font-size: .86rem; }
.p-lklist a .p-pill { margin-left: auto; }
.p-lklist a .t { flex: 0 1 auto; }
.card[hidden] { display: none; }

/* avviso in cima a Tutto (prova in corso, pagamento fallito) */
.p-banner { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; margin: 0 0 .9rem; border-radius: var(--r); text-decoration: none; color: var(--ink); background: color-mix(in srgb, #8B5CF6 9%, var(--surface)); border: 1px solid color-mix(in srgb, #8B5CF6 26%, var(--line-2)); }
.p-banner span:nth-child(2) { flex: 1; min-width: 0; } .p-banner b { display: block; font-weight: 600; } .p-banner small { color: var(--ink-2); font-size: .84rem; }
.p-banner .chev { color: var(--ink-3); font-size: 1.2rem; }
.p-banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }

/* uno spazio chiuso */
.p-lockv { max-width: 560px; }
.p-lockc { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .55rem; padding: 2rem 1.4rem 1.6rem; margin-top: .4rem; }
.p-lockc .ti-tile.lg { width: 64px; height: 64px; border-radius: 20px; } .p-lockc .ti-tile.lg .ti { width: 38px; height: 38px; }
.p-lockc h1 { font: 600 1.7rem var(--serif); margin: .3rem 0 0; }
.p-lockc p { margin: 0; color: var(--ink-2); max-width: 34ch; }
.p-need { display: inline-flex; align-items: center; gap: .5rem; margin: .7rem 0 .5rem; padding: .5rem .9rem; border-radius: 999px; background: var(--surface-2); font-size: .9rem; color: var(--ink-2); }
.p-need .ti { width: 18px; height: 18px; } .p-need b { color: var(--ink); }
.p-lockc .btn { width: 100%; max-width: 340px; padding: .8rem 1rem; white-space: normal; }
.p-lockc small { color: var(--ink-3); font-size: .82rem; margin-top: .5rem; max-width: 36ch; }

/* il foglio "serve un piano" */
.p-ov { z-index: 70; }
.p-sh-top { display: flex; align-items: center; gap: .9rem; margin: .2rem 0 .6rem; }
.p-sh-top .ti-tile.lg { width: 54px; height: 54px; border-radius: 16px; } .p-sh-top .ti-tile.lg .ti { width: 32px; height: 32px; }
.p-sh-top small { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--dawn-ink); }
.p-sh .p-sh-top h2 { margin: .05rem 0 0; font: 600 1.4rem/1.2 var(--serif); }
.p-sh > p { margin: 0 0 1rem; color: var(--ink-2); }
.p-sh-act { display: flex; flex-direction: column; gap: .4rem; } .p-sh-act .btn { padding: .85rem 1rem; font-size: 1rem; width: 100%; }

/* la pagina dei piani */
.p-page { max-width: 680px; }
.p-now { display: flex; align-items: center; gap: .95rem; padding: 1.05rem 1.15rem; border-radius: 18px; background: var(--hero); color: #fff; margin-bottom: 1.1rem; }
.p-now .ti-tile.lg { background: rgba(255,255,255,.16); flex: none; }
.p-now b { display: block; font: 600 1.3rem/1.2 var(--serif); } .p-now span { display: block; opacity: .86; font-size: .92rem; margin-top: .15rem; }
[data-theme="dark"]:not([data-palette]) .p-now { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-palette]) .p-now { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); } }
.p-now.warn { background: var(--warn); color: #fff; }
.p-test { margin: -.3rem 0 1rem; padding: .6rem .85rem; border-radius: 12px; background: var(--dawn-soft); color: var(--dawn-ink); font-size: .85rem; }
.p-iv { display: flex; justify-content: center; margin-bottom: .9rem; }
.p-iv .seg button { padding: .5rem 1rem; }
.p-cards { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.p-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 1.15rem 1.15rem 1.1rem; box-shadow: var(--shadow); position: relative; }
.p-card.mine { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.p-card-h { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.p-card h2 { font: 600 1.3rem var(--serif); margin: 0; }
.p-tag { font-style: normal; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .18rem .55rem; border-radius: 999px; background: var(--ink); color: var(--bg); }
.p-sub { margin: .15rem 0 .8rem; color: var(--ink-2); font-size: .9rem; }
.p-price { display: flex; align-items: baseline; gap: .4rem; } .p-price b { font: 600 2.1rem/1 var(--serif); letter-spacing: -.01em; } .p-price span { color: var(--ink-2); font-size: .92rem; }
.p-eq { color: var(--ink-3); font-size: .82rem; margin: .25rem 0 .9rem; }
.p-card ul { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: .45rem; font-size: .93rem; }
.p-card li { position: relative; padding-left: 1.5rem; color: var(--ink); }
.p-card li::before { content: ''; position: absolute; left: .15rem; top: .42em; width: .8rem; height: .42rem; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.p-cta { margin-top: auto; width: 100%; padding: .75rem 1rem; }
.p-cta.busy { opacity: .6; }
.p-card.pulse { animation: ppulse 1.1s var(--ease-out, ease) 1; }
@keyframes ppulse { 0%, 100% { box-shadow: var(--shadow); } 35% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--dawn) 45%, transparent), var(--shadow); } }
@media (min-width: 700px) { .p-page { max-width: 1020px; } .p-cards { grid-template-columns: repeat(3, 1fr); align-items: stretch; } .p-page > .s-links, .p-foot { max-width: 680px; } }
.p-uses { padding: .9rem 1.1rem; display: grid; gap: .8rem; }
.p-use { display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; align-items: baseline; font-size: .92rem; }
.p-use b { font-weight: 600; font-variant-numeric: tabular-nums; } .p-use span { color: var(--ink-2); }
.p-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.p-bar i { display: block; height: 100%; border-radius: 3px; background: var(--dawn); } .p-bar i.full { background: var(--warn); }
.p-page .s-links .t small { display: block; color: var(--ink-3); font-size: .8rem; }
.p-foot { margin: 1.3rem .15rem .5rem; color: var(--ink-3); font-size: .8rem; line-height: 1.5; }

/* impostazioni */
.p-acc { color: var(--ink); font-weight: 600; }
.palette-opt.p-lk { position: relative; } .palette-opt.p-lk .sw { opacity: .55; }
.palette-opt.p-lk .p-pill { font-size: .56rem; padding: .1rem .4rem; }
.mode-card .p-pill { vertical-align: middle; }
.p-seclock { display: flex; align-items: center; gap: .85rem; padding: .95rem 1.1rem; flex-wrap: wrap; }
.p-seclock > span:nth-child(2) { flex: 1; min-width: 200px; } .p-seclock b { display: block; font-weight: 600; } .p-seclock small { color: var(--ink-3); font-size: .84rem; }
.p-trialn { background: color-mix(in srgb, #8B5CF6 9%, var(--surface)); }

/* il regalo */
.p-gift { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; padding: .4rem 0 .2rem; }
.p-gift .ti-tile.lg { width: 76px; height: 76px; border-radius: 24px; margin-bottom: .5rem; } .p-gift .ti-tile.lg .ti { width: 46px; height: 46px; }
.p-gift b { font: 600 1.7rem/1.2 var(--serif); } .p-gift span { color: var(--ink-2); }
.p-gift blockquote { margin: 1rem 0 .2rem; padding: .9rem 1.1rem; border-radius: 16px; background: var(--surface-2); font: 500 1.05rem/1.45 var(--serif); color: var(--ink); }
.p-gift small { color: var(--ink-3); font-size: .88rem; }
.p-giftm h2 { text-align: center; }

/* Analisi › Abbonati */
.an-tabs { margin: -.4rem 0 1.2rem; }
.an-pill.pl-gift { background: color-mix(in srgb, #E0578C 15%, var(--surface)); color: color-mix(in srgb, #E0578C 75%, var(--ink)); }
.an-pill.pl-paid { background: var(--ok-soft); color: var(--ok); }
.an-pill.pl-trial { background: color-mix(in srgb, #8B5CF6 15%, var(--surface)); color: color-mix(in srgb, #8B5CF6 72%, var(--ink)); }
.an-pill.pl-early, .an-pill.pl-freep { background: var(--surface-2); color: var(--ink-3); }
.pl-u { grid-template-columns: auto auto 1fr auto; }
.pl-sel { display: grid; place-items: center; width: 22px; } .pl-sel input { width: 18px; height: 18px; accent-color: var(--dawn); }
.pl-bulk { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; margin-bottom: .5rem; border-radius: 12px; background: var(--dawn-soft); color: var(--dawn-ink); font-size: .9rem; }
.pl-bulk[hidden] { display: none; } .pl-bulk span { flex: 1; }
.pl-pad { padding: 1rem 1.1rem; display: grid; gap: .8rem; }
.pl-p { margin: 0; color: var(--ink-2); font-size: .93rem; } .pl-s { margin: 0; color: var(--ink-3); font-size: .82rem; line-height: 1.45; } .pl-s a { color: var(--dawn-ink); }
.pl-pad code { font-family: var(--mono); font-size: .82em; background: var(--surface-2); padding: .05rem .35rem; border-radius: 6px; }
.pl-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.pl-row input[type="password"] { flex: 1; min-width: 200px; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; background: var(--bg); font-family: var(--mono); font-size: 15px; min-height: 44px; }
.pl-st { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pl-chk-l { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: .92rem; }
.pl-chk-l li { position: relative; padding-left: 1.6rem; }
.pl-chk-l li::before { content: ''; position: absolute; left: .2rem; top: .42em; width: .8rem; height: .42rem; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.pl-chk-l li.n { color: var(--warn); } .pl-chk-l li.n::before { content: '!'; border: 0; transform: none; top: 0; left: .35rem; font-weight: 800; color: var(--warn); width: auto; height: auto; }
.pl-launch { padding: .75rem .95rem; border-radius: 12px; font-size: .93rem; line-height: 1.45; }
.pl-launch.ok { background: var(--ok-soft); color: color-mix(in srgb, var(--ok) 60%, var(--ink)); } .pl-launch.warn { background: var(--dawn-soft); color: var(--dawn-ink); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; align-items: end; }
.pl-f { display: grid; gap: .3rem; font-size: .85rem; color: var(--ink-2); }
.pl-f input { border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; background: var(--bg); min-height: 42px; font-size: 16px; width: 100%; }
.pl-sw { padding: .2rem 0; } .pl-tax { gap: .5rem; align-items: flex-start; }
.pl-adv summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; padding: .2rem 0; } .pl-adv[open] summary { margin-bottom: .7rem; } .pl-adv > * + * { margin-top: .7rem; }
@media (max-width: 860px) { .pl-u { grid-template-columns: auto auto 1fr; } .pl-u .an-u-act { grid-column: 3; } }
.field[hidden] { display: none; }
.modal .field .seg { justify-self: start; }
.pl-u[hidden] { display: none; }
.pl-top { margin: -.5rem 0 0; }
.pl-q { width: 100%; max-width: 360px; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .8rem; background: var(--surface); min-height: 42px; font-size: 16px; margin-bottom: .6rem; }
.pl-more { margin-top: .5rem; }
.pl-more[hidden] { display: none; }

/* ============================ v4.7.1 PAGAMENTI VERI: conferma d'acquisto, recesso, lista di lancio ============================ */
.p-buy .p-sh-top { margin-bottom: .85rem; }
.p-buy-l { list-style: none; margin: 0 0 1rem; padding: .9rem 1rem; display: grid; gap: .6rem; border-radius: 16px; background: var(--surface-2); font-size: .95rem; color: var(--ink-2); line-height: 1.4; }
.p-buy-l li { position: relative; padding-left: 1.55rem; } .p-buy-l b { color: var(--ink); font-weight: 600; }
.p-buy-l li::before { content: ''; position: absolute; left: .15rem; top: .42em; width: .8rem; height: .42rem; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.p-buy-ok { display: flex; gap: .7rem; align-items: flex-start; margin: 0 .1rem 1rem; font-size: .9rem; color: var(--ink-2); line-height: 1.45; cursor: pointer; }
.p-buy-ok input { width: 22px; height: 22px; flex: none; margin: .05rem 0 0; accent-color: var(--ink); }
.p-buy-ok a { color: var(--ink); text-underline-offset: 2px; }
.p-buy .p-sh-act .btn[disabled] { opacity: .45; }
.p-buy-s { display: block; text-align: center; margin-top: .75rem; color: var(--ink-3); font-size: .78rem; }
.p-legal { display: block; margin-top: .55rem; } .p-legal a { color: var(--ink-2); text-underline-offset: 2px; }
.p-wd { display: grid; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.p-wd > div { display: grid; grid-template-columns: 8.6rem 1fr; gap: .8rem; padding: .65rem .9rem; font-size: .92rem; } .p-wd > div + div { border-top: 1px solid var(--line-2); }
.p-wd span { color: var(--ink-3); } .p-wd b { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 480px) { .p-wd > div { grid-template-columns: 1fr; gap: .1rem; } }
.p-ack { width: 100%; font: .8rem/1.5 var(--mono); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; background: var(--bg); color: var(--ink); resize: vertical; }
.lc { padding: 0; }
.lc-r { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .85rem; align-items: center; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.lc-r:last-child { border-bottom: 0; }
.lc-r > i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.lc-r.y > i { background: var(--ok); border-color: var(--ok); }
.lc-r.y > i::after { content: ''; position: absolute; left: 4.5px; top: 5px; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.lc-r.n > i { border-color: var(--dawn); }
.lc-r.o > i { border-style: dashed; }
.lc-r b { display: block; font-weight: 600; } .lc-r small { display: block; color: var(--ink-3); font-size: .84rem; line-height: 1.4; }
.lc-r.y b { color: var(--ink-2); font-weight: 500; }
.lc-r small a { color: var(--dawn-ink); text-underline-offset: 2px; }
.lc-a { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .lc-r { grid-template-columns: auto 1fr; } .lc-a { grid-column: 2; justify-content: flex-start; margin-top: .4rem; } }
.lc-done summary { cursor: pointer; padding: .1rem .15rem; color: var(--ink-3); font-size: .86rem; list-style: none; display: flex; align-items: center; gap: .5rem; }
.lc-done summary::-webkit-details-marker { display: none; }
.lc-done summary::before { content: ''; width: .7rem; height: .36rem; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg) translateY(-2px); flex: none; }
.lc-done summary span { margin-left: auto; text-decoration: underline; text-underline-offset: 2px; }
.lc-done[open] summary { margin-bottom: .6rem; }
.lc-wd { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: .6rem; }
.ics-l { padding: 0 1.1rem .8rem; display: grid; gap: .3rem; } .ics-l > div { display: flex; align-items: center; justify-content: space-between; gap: .8rem; font-size: .88rem; color: var(--ink-2); }

/* ============================ v4.8 — Soldi: «Da parte» ============================ */
.qf-more[hidden] { display: none; }
.fin-head.f4 { grid-template-columns: repeat(4, 1fr); }
.fin-head .v.sv { color: #1E9FA8; } .fin-head .v.muted { color: var(--ink-3); }
@media (max-width: 640px) {
  .fin-head.f4 { grid-template-columns: repeat(2, 1fr); }
  .fin-head.f4 > div:nth-child(3) { border-left: 0; }
  .fin-head.f4 > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
.f-split { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin: .9rem .2rem .45rem; background: var(--line-2); }
.f-split i { display: block; height: 100%; min-width: 3px; } .f-split i + i { border-left: 2px solid var(--bg); }
.f-leg { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--ink-2); margin: 0 .2rem; }
.f-leg span i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .35rem; }
.f-rate { margin: .7rem .2rem 0; font-size: .92rem; color: var(--ink-2); } .f-rate b { color: #1E9FA8; }
/* i salvadanai: righe sul telefono, schede sul computer */
.f-pots { padding: 0; overflow: hidden; }
.f-pot, .f-new { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .85rem 1rem; border: 0; border-top: 1px solid var(--line-2); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.f-pot:first-child { border-top: 0; }
.f-pot:hover, .f-new:hover { background: var(--surface-2); }
.f-pm { flex: 1; min-width: 0; }
.f-pm b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-pm small { display: block; color: var(--ink-3); font-size: .8rem; margin-top: .05rem; }
.f-pot .amt2 { text-align: right; flex: none; } .f-pot .amt2 b { display: block; font: 500 1.12rem var(--serif); font-variant-numeric: tabular-nums; } .f-pot .amt2 small { display: block; color: var(--ink-3); font-size: .8rem; }
.f-pot .amt2 small.up, .f-card .up, .f-two b.up { color: var(--ok); font-weight: 600; } .f-pot .amt2 small.down, .f-card .down, .f-two b.down { color: var(--warn); font-weight: 600; }
.f-bar { height: 5px; border-radius: 3px; background: var(--line-2); margin-top: .45rem; overflow: hidden; } .f-bar i { display: block; height: 100%; border-radius: 3px; background: #1E9FA8; }
.f-bar.lg { height: 8px; margin-top: .7rem; } .f-bar-sp { height: 5px; margin-top: .45rem; }
.f-new { color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.f-new .pl, .f-card .pl { width: 36px; height: 36px; border-radius: 11px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--ink-3); font-size: 1.15rem; flex: none; }
.f-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
.f-card { display: block; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 1rem 1.05rem .95rem; cursor: pointer; }
.f-card:hover { border-color: var(--line); }
.f-card .h { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; } .f-card .h b { font-weight: 600; display: block; } .f-card .h small { display: block; color: var(--ink-3); font-size: .78rem; }
.f-card .big { font: 500 1.7rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.f-card .sub { font-size: .82rem; color: var(--ink-2); margin-top: .25rem; } .f-card .sub.dim { color: var(--ink-3); margin-top: .55rem; }
.f-card.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; border-style: dashed; box-shadow: none; background: transparent; color: var(--ink-2); font-weight: 600; min-height: 150px; }
.f-empty { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; flex-wrap: wrap; }
.f-empty > div { flex: 1; min-width: 200px; } .f-empty b { display: block; } .f-empty span { color: var(--ink-2); font-size: .9rem; }
.tx .amt.sv, .tx .cat.sv { color: #1E9FA8; }
/* foglio del salvadanaio */
.f-hint { font-size: .86rem; color: var(--ink-2); background: color-mix(in srgb, #1E9FA8 9%, var(--surface)); border-radius: 10px; padding: .55rem .7rem; margin: .5rem 0 .2rem; }
.f-hint a { color: #137E86; font-weight: 600; }
.tx-save .seg, .tx-kind { display: flex; width: 100%; } .tx-save .seg button, .tx-kind button { flex: 1; justify-content: center; white-space: nowrap; }
.tx-save { margin-bottom: .2rem; } .tx-save .seg { margin-top: -.2rem; }
.f-det .f-dh { display: flex; align-items: center; gap: .7rem; margin: -.2rem 0 .3rem; } .f-det .f-dh b { font-weight: 600; }
.f-det .lbl { font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin: 1rem 0 .45rem; }
.f-det .val { font: 500 2.3rem/1.05 var(--serif); font-variant-numeric: tabular-nums; }
.f-det .when { font-size: .84rem; color: var(--ink-3); margin-top: .3rem; } .f-det .when a { color: var(--dawn-ink); font-weight: 600; text-decoration: none; margin-left: .3rem; }
.f-two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .9rem; }
.f-two div { background: var(--surface-2); border-radius: 12px; padding: .6rem .75rem; } .f-two small { display: block; font-size: .74rem; color: var(--ink-3); } .f-two b { font: 500 1.1rem var(--serif); font-variant-numeric: tabular-nums; }
.f-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; align-items: end; height: 70px; }
.f-bars i { display: block; border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, #1E9FA8 70%, var(--surface)); }
.f-bars i.neg { background: color-mix(in srgb, var(--warn) 55%, var(--surface)); }
.f-bl { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; text-align: center; font-size: .62rem; color: var(--ink-3); margin-top: .3rem; }
.f-auto { display: flex; align-items: center; gap: .7rem; margin-top: 1rem; padding: .7rem .8rem; border: 1px solid var(--line-2); border-radius: 12px; font-size: .92rem; cursor: pointer; }
.f-auto > span:not(.ti-tile) { flex: 1; min-width: 0; } .f-auto small { display: block; color: var(--ink-3); font-size: .78rem; }
.f-swi { appearance: none; -webkit-appearance: none; width: 42px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.f-swi::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.f-swi:checked { background: var(--ok); } .f-swi:checked::after { left: 19px; }
.f-acts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1rem; } .f-acts .btn { min-height: 46px; }
.f-last > div { display: flex; justify-content: space-between; gap: .8rem; padding: .45rem 0; border-top: 1px solid var(--line-2); font-size: .88rem; }
.f-last > div:first-child { border-top: 0; } .f-last span { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-last b { font-weight: 600; color: #1E9FA8; font-variant-numeric: tabular-nums; white-space: nowrap; } .f-last b.neg { color: var(--warn); }
.pe-icons { display: flex; flex-wrap: wrap; gap: .4rem; }
.pe-icons button { border: 2px solid transparent; background: transparent; border-radius: 14px; padding: 2px; cursor: pointer; }
.pe-icons button.on { border-color: var(--ink); }
.pe-auto, .pe-inv { margin-top: .6rem; }
.mini-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mini-seg button { border: 0; background: transparent; padding: .35rem .6rem; font-size: .82rem; color: var(--ink-2); cursor: pointer; }
.mini-seg button.on { background: var(--ink); color: var(--bg); }
.pot-new { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pot-new[hidden] { display: none; }
/* i salvadanai hanno la loro icona: niente pallino; il piccolo Risparmio/Investimento non è una pillola */
.pot-pick label > span::before { content: none; }
.pot-pick label > span svg { width: 16px; height: 16px; flex: none; }
.bk-pick span.mini-seg { display: inline-flex; gap: 0; padding: 0; border-radius: 10px; background: var(--surface); }
.bk-pick span.mini-seg::before { content: none; }
.pot-new input[type="text"] { flex: 1 1 11rem; min-width: 0; }

/* 1.1.7 · home libera: le pagine come le schede della home a schede */
.live-card.lk-home { background: none; border: 0; padding: 0; box-shadow: none; height: auto; border-radius: 18px; }
.live-card.lk-home > .h5c { height: 100%; box-sizing: border-box; margin: 0; }
.live-card.lk-home .h5c .live-add { margin-top: 8px; }
.live-card.lk-home .h5c:focus-visible { outline: 2px solid var(--dawn); outline-offset: 2px; }
.s-hchg { margin-left: .5rem; padding: .15rem .55rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: .82rem; cursor: pointer; }
.tb7-prev + .t10-note { margin-top: 12px; }
/* 1.1.7 · impostazioni: notifiche, fuso orario, barra in basso */
.n7-sel { margin-left: auto; max-width: 52%; font: inherit; font-size: 15px; color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); border: 0; border-radius: 8px; padding: 6px 8px; text-overflow: ellipsis; }
.n7-sel:disabled, .t10-row.muted .t11-time { opacity: .45; }
.tb7-prev { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; margin: 4px 0 2px; padding: 12px 6px 9px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
.tb7-c { display: grid; justify-items: center; gap: 3px; color: var(--ink-3); min-width: 0; }
.tb7-c small { font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb7-c .ti-tile.tb { width: 30px; height: 28px; }
.tb7-c.empty i { width: 26px; height: 26px; border-radius: 8px; border: 1.5px dashed var(--line); display: block; margin-bottom: 2px; }
.tb7-plus { justify-self: center; align-self: center; width: 44px; height: 44px; border-radius: 15px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 1.6rem; font-weight: 300; line-height: 1; }
[data-theme="dark"] .tb7-plus { background: var(--dawn); color: #1b1407; }
.s-menu button .tb7-ck { margin-left: auto; color: var(--dawn); }
.s-menu button:disabled { opacity: .45; cursor: default; }

/* 1.1.8 · «Il mio spazio» si presenta come la home a schede: niente briciole, titolo, icona o copertina,
   niente maniglie dei blocchi; data e saluto in alto, «Modifica home» in fondo, le pagine come schede */
.page-layout.t8-home { display: block; }
.page-layout.t8-home .pages-side, .page-layout.t8-home .crumbs, .page-layout.t8-home .cover,
.page-layout.t8-home .page-top, .page-layout.t8-home .subpage-strip { display: none !important; }
.page-layout.t8-home .page-editor.notion, .page-layout.t8-home .page-editor.notion.wide { max-width: 680px; width: auto; margin: 0; padding-left: 0; }
@media (min-width: 700px) { .page-layout.t8-home .page-editor.notion, .page-layout.t8-home .page-editor.notion.wide { max-width: 940px; } }
.page-layout.t8-home .blocks { padding: 0; margin-top: 4px; }
.page-layout.t8-home .blk-handles { display: none; }
.page-layout.t8-home .blocks { column-gap: 11px; }
.page-layout.t8-home .blocks > .blk { flex-basis: 100%; padding-left: 0; margin-left: 0; }
.page-layout.t8-home .blocks > .blk.t8-pg.sz-half, .page-layout.t8-home .blocks > .blk.t8-pg.sz-third { flex-basis: calc(50% - 5.5px); }
@media (min-width: 700px) {
  .page-layout.t8-home .blocks { column-gap: 14px; }
  .page-layout.t8-home .blocks > .blk.sz-half, .page-layout.t8-home .blocks > .blk.t8-pg.sz-half { flex-basis: calc(50% - 7px); }
  .page-layout.t8-home .blocks > .blk.sz-third, .page-layout.t8-home .blocks > .blk.t8-pg.sz-third { flex-basis: calc(33.333% - 9.34px); }
}
.page-layout.t8-home .blk.t-live, .page-layout.t8-home .blk.t-page { padding-top: 5.5px; padding-bottom: 5.5px; }
.page-layout.t8-home .blk.t-page .blk-main { width: 100%; min-width: 0; align-items: stretch; }
.page-layout.t8-home .blk.t-page .live-card { flex: 1; min-width: 0; }
.page-layout.t8-home .live-card:not(.lk-home) { border: 0; border-radius: 18px; padding: 12px 14px 13px; }
.page-layout.t8-home .live-card:not(.lk-home) .live-head { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.page-layout.t8-home .live-card:not(.lk-home) .live-head b { font-weight: 600; color: var(--ink-3); }
.t8-head .s-sum[hidden] { display: block; visibility: hidden; }
.t8-head .s-sum:empty { min-height: 1.4em; }
/* una riga di testo vuota nella home non lascia un buco prima di «Modifica home» */
.page-layout.t8-home .blk.t-text:has(> .blk-main > .be:empty):not(:focus-within) { display: none; }
/* due schede affiancate sono alte uguali, come nella griglia della home a schede */
.page-layout.t8-home .blk.t8-pg, .page-layout.t8-home .blk.t-page { align-items: stretch; }
.page-layout.t8-home .blk.t8-pg > .blk-main > .live-card.lk-home { display: flex; flex-direction: column; }
.page-layout.t8-home .blk.t8-pg > .blk-main > .live-card.lk-home > .h5c { flex: 1; height: auto; }

/* 1.1.9 · le pagine in anteprima (home a schede e «Il mio spazio»): una scheda per pagina, col contenuto.
   Nella home a schede il gruppo prende tutta la riga e dentro ripete la griglia: Grande = come «Una pagina», Piccola = due per riga */
.h5-grp { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; min-width: 0; }
@media (min-width: 760px) { .h5-grp { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1280px) { .h5-grp { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.live-card.lk-home > .h5-grp { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.live-card.lk-home > .h5-grp > .h5c.lg { grid-column: span 2; }
.live-card.lk-home > .h5-grp > .h5c.sm { grid-column: span 1; }
@media (min-width: 700px) {
  .live-card.lk-home > .h5-grp { gap: 14px; }
  .blk.sz-full .live-card.lk-home > .h5-grp { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.page-layout.t8-home .blocks > .blk.t9-grp { flex-basis: 100%; }
@media (min-width: 700px) { .page-layout.t8-home .blocks > .blk.t9-grp.sz-half { flex-basis: calc(50% - 7px); } }
.page-layout.t8-home .blk.t9-grp .blk-main { width: 100%; min-width: 0; }
.page-layout.t8-home .blk.t9-grp .live-card.lk-home { flex: 1; min-width: 0; }
.s-hprev .t9-view { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; gap: 2px; margin-left: 6px; vertical-align: middle; }
.s-hprev .t9-view button { border: 0; background: none; font: inherit; font-size: .75rem; padding: .3rem .55rem; border-radius: 7px; color: var(--ink-3); cursor: pointer; }
.s-hprev .t9-view button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
