:root{--bg:#f5f7fb;--panel:#fff;--panel2:#eef3f8;--text:#16202a;--muted:#667481;--blue:#246bfd;--blue-soft:#eaf1ff;--green:#168668;--coral:#e85d52;--line:#dfe5eb;--shadow:0 18px 50px rgba(27,45,67,.1)}
*{box-sizing:border-box}html{font:16px/1.45 Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}body{margin:0;min-height:100vh;background:linear-gradient(180deg,#fff 0,#f5f7fb 260px)}button,input,select,textarea{font:inherit}.appbar{position:sticky;z-index:20;top:0;height:72px;padding:0 max(20px,env(safe-area-inset-left));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(223,229,235,.9);background:rgba(255,255,255,.88);backdrop-filter:blur(18px)}.app-logo{display:flex;align-items:center;gap:11px;color:inherit;text-decoration:none}.app-logo img{width:42px;height:42px;border-radius:12px}.app-logo b,.app-logo small{display:block}.app-logo b{letter-spacing:-.02em}.app-logo small{color:var(--muted);font-size:.75rem}.top-actions{display:flex;gap:8px}.top-actions button,.period-nav button,.view-switch button,.child-switch button{border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--text);font-weight:700}.top-actions button{min-height:42px;padding:0 14px}.top-actions .add{border-color:var(--blue);background:var(--blue);color:#fff;box-shadow:0 8px 20px rgba(36,107,253,.24)}main{width:min(1320px,100%);margin:auto;padding:34px 24px 96px}.calendar-head{display:flex;align-items:end;justify-content:space-between;gap:20px}.calendar-head p{margin:0 0 4px;color:var(--blue);font-size:.76rem;font-weight:800;text-transform:capitalize}.calendar-head h1{margin:0;font-size:clamp(2rem,4vw,3.25rem);font-weight:760;letter-spacing:-.05em}.period-nav{display:flex;gap:7px}.period-nav button{height:42px;min-width:42px;padding:0 13px}.privacy-note{margin:20px 0 0;padding:13px 15px;display:flex;align-items:center;gap:11px;border:1px solid #cfe7df;border-radius:14px;background:#f0faf7}.privacy-note>span{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:var(--green);color:#fff;font-weight:900}.privacy-note b,.privacy-note small{display:block}.privacy-note small{margin-top:2px;color:#557269;font-size:.78rem}.control-row{margin:17px 0;display:flex;justify-content:space-between;gap:14px}.view-switch,.child-switch{display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:12px;background:#fff}.view-switch button,.child-switch button{min-height:38px;padding:0 15px;border:0;background:transparent;color:var(--muted)}.view-switch button.active{background:var(--blue);color:#fff}.child-switch button.active{background:var(--blue-soft);color:#174baf}.child-switch i{width:24px;height:24px;display:inline-grid;place-items:center;margin-right:6px;border-radius:50%;background:var(--panel2)!important;font-style:normal;font-size:1rem}.calendar-surface{min-height:570px;overflow:auto;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:var(--shadow)}.week-grid{display:grid;grid-template-columns:repeat(7,minmax(140px,1fr));min-width:980px}.day-column{min-height:570px;border-right:1px solid var(--line);background:linear-gradient(180deg,#fff,#fbfcfe)}.day-column:last-child{border:0}.day-label{position:sticky;top:0;z-index:4;padding:15px 13px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.95);backdrop-filter:blur(10px)}.day-label b,.day-label span{display:block}.day-label b{font-size:.78rem;color:#43515d}.day-label span{margin-top:2px;color:#89949d;font-size:.7rem}.day-column.today{background:#f8fbff}.day-column.today .day-label{box-shadow:inset 0 3px var(--blue)}.event-card{--child-color:#246bfd;position:relative;margin:10px;padding:12px;border:1px solid #e2e8ef;border-radius:13px;background:#fff;box-shadow:0 6px 18px rgba(31,55,80,.07);cursor:pointer}.event-card::before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:3px;border-radius:3px;background:var(--child-color)}.event-card>.activity-mark{float:left;display:grid;place-items:center;width:34px;height:34px;margin:0 8px 6px 3px;border-radius:10px;background:var(--blue-soft);font-size:1rem}.event-card time{display:block;color:#365065;font-size:.72rem;font-weight:800}.event-card b,.event-card small{display:block}.event-card b{margin-top:3px;font-size:.9rem;line-height:1.25}.event-card small{margin-top:4px;color:var(--muted);font-size:.72rem}.transport-summary{clear:both;padding-top:7px}.empty-day{padding:24px 12px;color:#9aa4ad;font-size:.75rem}.day-list{padding:12px}.day-list .event-card{display:grid;grid-template-columns:42px 110px 1fr;align-items:center;min-height:90px}.day-list .event-card::before{top:14px;bottom:14px}.month-grid{display:grid;grid-template-columns:repeat(7,1fr);min-width:700px}.month-weekday{padding:13px;color:#78848f;font-size:.72rem;font-weight:800;text-align:center}.month-day{min-height:118px;padding:9px;border-top:1px solid var(--line);border-right:1px solid var(--line)}.month-day:nth-child(7n){border-right:0}.month-day.muted{background:#fafbfc;color:#aab2ba}.month-day.today>span{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:var(--blue);color:#fff;font-weight:800}.month-event{margin-top:6px;padding:6px 7px;overflow:hidden;border-radius:7px;background:var(--blue-soft);color:#274e8d;font-size:.66rem;white-space:nowrap;text-overflow:ellipsis}.bottom-nav{display:none}dialog{width:min(540px,calc(100% - 24px));padding:0;border:1px solid var(--line);border-radius:18px;background:#fff;color:var(--text);box-shadow:0 40px 100px rgba(17,31,45,.24)}dialog::backdrop{background:rgba(24,36,48,.52);backdrop-filter:blur(6px)}dialog form{position:relative;display:grid;gap:13px;padding:27px}dialog h2,dialog p{margin:0}dialog p{color:var(--blue);font-size:.72rem;font-weight:850;letter-spacing:.1em}dialog h2{font-size:1.55rem;letter-spacing:-.025em}dialog label{display:grid;gap:6px;color:#53616d;font-size:.8rem;font-weight:750}dialog input,dialog select,dialog textarea{width:100%;min-height:44px;padding:0 11px;border:1px solid #cfd7df;border-radius:9px;background:#fff;color:var(--text);color-scheme:light}dialog textarea{min-height:90px;padding:11px;resize:vertical}.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}.close{position:absolute;right:14px;top:14px;border:0;background:none;color:#53616d;font-size:1.5rem}.save{min-height:46px;border:0;border-radius:10px;background:var(--blue);color:#fff;font-weight:850}.danger{min-height:44px;border:1px solid #efc5c2;border-radius:10px;background:#fff5f4;color:#b53f37;font-weight:800}.secondary-save{min-height:44px;padding:0 15px;border:1px solid #cfd7df;border-radius:10px;background:#fff;color:#31404c;font-weight:800}#toast{position:fixed;z-index:50;left:50%;bottom:26px;transform:translate(-50%,15px);padding:12px 16px;border-radius:11px;background:#16202a;color:#fff;font-weight:700;opacity:0;transition:.2s}#toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:760px){body{padding-bottom:82px}.appbar{height:64px}.app-logo img{width:36px;height:36px}.app-logo small{display:none}.top-actions #installApp{font-size:.72rem;padding:0 9px}.top-actions .add span{display:none}.top-actions #manageFamily{width:42px;padding:0;font-size:0}.top-actions #manageFamily::before{content:"👥";font-size:1rem}main{padding:22px 12px 32px}.calendar-head{align-items:center}.calendar-head h1{font-size:1.8rem}.period-nav button{height:38px;min-width:36px;padding:0 10px}.privacy-note small{font-size:.72rem}.control-row{margin:12px 0;display:grid}.view-switch,.child-switch{justify-content:space-between;overflow:auto}.view-switch button,.child-switch button{flex:1;padding:0 8px;white-space:nowrap}.calendar-surface{min-height:520px;border-radius:14px}.week-grid{min-width:910px}.day-column{min-height:520px}.bottom-nav{position:fixed;z-index:30;left:10px;right:10px;bottom:max(8px,env(safe-area-inset-bottom));height:64px;padding:7px 18px;display:flex;align-items:center;justify-content:space-between;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.94);box-shadow:0 10px 30px rgba(24,40,58,.18);backdrop-filter:blur(16px)}.bottom-nav a,.bottom-nav button{display:grid;justify-items:center;gap:2px;border:0;background:none;color:var(--muted);font-size:.65rem;text-decoration:none}.bottom-nav span{font-size:1.1rem}.bottom-nav .active{color:var(--blue)}.bottom-nav #mobileAdd{width:55px;height:55px;margin-top:-28px;place-items:center;border:5px solid var(--bg);border-radius:50%;background:var(--blue);color:#fff;font-size:0}.bottom-nav #mobileAdd span{font-size:1.5rem}.two{grid-template-columns:1fr}}

/* Colore stabile per tipo di attività, usato nelle viste giorno, settimana e mese. */
.event-card{--activity-color:#77838f}
.event-card::before{width:4px;background:var(--activity-color)}
.event-card>.activity-mark{border:1px solid color-mix(in srgb,var(--activity-color) 28%,white);background:color-mix(in srgb,var(--activity-color) 14%,white)}
.month-event{--activity-color:#77838f;border-left:4px solid var(--activity-color);background:color-mix(in srgb,var(--activity-color) 13%,white);color:#27333d;font-weight:700}
.editor-scope{display:block;margin:-3px 0 2px;padding:9px 11px;border-radius:9px;background:#f2f6fb;color:#526474;font-size:.75rem;line-height:1.4}

@media(max-width:760px){
  body{padding-bottom:88px;background:#f5f7fb}
  .appbar{height:58px;padding:0 14px}.app-logo{gap:9px}.app-logo img{width:34px;height:34px}.app-logo b{font-size:.95rem}.top-actions{display:none}
  main{padding:18px 10px 26px}.calendar-head{display:grid;grid-template-columns:1fr;gap:12px}.calendar-head h1{font-size:1.55rem;line-height:1.1}.calendar-head p{font-size:.7rem}.period-nav{display:grid;grid-template-columns:44px 1fr 44px;width:100%}.period-nav button{height:42px}
  .privacy-note{margin-top:14px;padding:10px 12px}.privacy-note>span{width:25px;height:25px}.privacy-note b{font-size:.82rem}.privacy-note small{display:none}
  .control-row{gap:9px}.view-switch,.child-switch{width:100%;padding:3px}.view-switch button,.child-switch button{min-height:42px;font-size:.8rem}.child-switch{justify-content:flex-start;scrollbar-width:none}.child-switch button{flex:0 0 auto;min-width:112px}
  .calendar-surface{min-height:470px;border-radius:14px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}.week-grid{display:flex;min-width:0}.day-column{flex:0 0 100%;min-height:470px;border-right:0;scroll-snap-align:start}.day-label{padding:12px 13px}.event-card{margin:9px;padding:12px 11px 11px 14px}.event-card b{font-size:.88rem}.event-actions button{min-height:36px;flex:1}.transport-summary{line-height:1.45}
  .day-list{padding:5px}.day-list .event-card{display:grid;grid-template-columns:38px 70px minmax(0,1fr);min-height:84px}.day-list .transport-summary,.day-list .event-actions,.day-list .event-note{grid-column:1/-1}
  .month-grid{min-width:0}.month-weekday{padding:9px 2px;font-size:.62rem}.month-day{min-height:78px;padding:5px 3px}.month-day>span{font-size:.72rem}.month-event{height:8px;margin-top:5px;padding:0;border-left-width:3px;border-radius:4px;font-size:0}
  .bottom-nav{left:6px;right:6px;bottom:max(6px,env(safe-area-inset-bottom));height:70px;padding:7px 8px;gap:2px;border-radius:18px}.bottom-nav a,.bottom-nav button{flex:1;min-width:0;min-height:48px;font-size:.6rem}.bottom-nav span{font-size:1.05rem}.bottom-nav #mobileAdd{flex:0 0 56px;width:56px;height:56px;margin:-24px 3px 0;border-width:4px}.bottom-nav #mobileAdd span{font-size:1.45rem}
  dialog{width:100%;max-width:none;max-height:92dvh;margin:auto 0 0;border-width:1px 0 0;border-radius:22px 22px 0 0}dialog form{max-height:92dvh;padding:24px 16px calc(22px + env(safe-area-inset-bottom));overflow:auto}dialog h2{padding-right:28px;font-size:1.35rem}dialog label{font-size:.82rem}dialog input,dialog select,dialog textarea{min-height:48px}.two{grid-template-columns:1fr}.close{position:sticky;float:right;z-index:3;top:0;margin-left:auto;width:42px;height:42px;border-radius:50%;background:#f2f5f8}
  #childrenDialog form{max-height:92dvh}.weekday-picker{grid-template-columns:repeat(7,minmax(34px,1fr));gap:3px}.weekday-picker button{width:100%;max-width:40px}.break-row{grid-template-columns:1fr 1fr}.break-row button{grid-column:1/-1;width:100%}
}
