:root{
  --cover-ratio:3/2;   /* proporzione unica delle copertine: card, diario, testata, ritaglio */
  --bg:#141518;
  --bg-2:#1a1c20;
  --card:#1e2025;
  --card-2:#262930;
  --ink:#f2eee4;
  --muted:#9a9b94;
  --faint:#5f615c;
  --line:#2c2f35;
  --accent:#f5b83d;
  --accent-ink:#1d1606;
  --accent-soft:rgba(245,184,61,.12);
  --together:#2a2414;
  --together-line:#8c6a26;
  --danger:#e56b5d;
  --radius:14px;
  --shadow:0 14px 40px rgba(0,0,0,.45);
  --nav-h:64px;
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
}
*{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%; overflow-x:hidden;}
html,body{max-width:100%;}
img,video{max-width:100%;}
body{
  margin:0; overflow-x:hidden; width:100%; background:var(--bg); color:var(--ink);
  font:15px/1.55 'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent;
}
h1,h2,h3,.serif{font-family:'Fraunces',Georgia,'Times New Roman',serif; font-weight:500; letter-spacing:-.01em;}
a{color:inherit;}
button,input,select,textarea{font:inherit; color:inherit;}
button{cursor:pointer;}
[hidden]{display:none!important;}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
svg{display:block;}

/* ---------- struttura ---------- */
.app{width:100%; max-width:1180px; margin:0 auto; padding:0 clamp(12px,4.5vw,18px) calc(var(--nav-h) + var(--safe-b) + 24px); overflow-x:hidden; overflow-x:clip;}
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:calc(14px + var(--safe-t)) 0 14px; border-bottom:1px solid var(--line);
}
.brand{display:flex; align-items:center; gap:9px; font-weight:700; font-size:12px; letter-spacing:.14em; text-transform:uppercase;}
.brand .mark{width:28px; height:28px; border:1px solid var(--accent); color:var(--accent); border-radius:50%; display:grid; place-items:center; font-size:13px; letter-spacing:0;}
.topnav{display:none; gap:4px;}
.topnav button{border:0; background:none; padding:8px 14px; border-radius:9px; color:var(--muted); font-weight:600; font-size:14px;}
.topnav button.active{background:var(--accent); color:var(--accent-ink);}
.topnav button:not(.active):hover{background:var(--card);}
.whoami{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted);}
.whoami-emoji{font-size:18px;}
.whoami-label{color:var(--ink); font-weight:600;}
.link-quiet{border:0; background:none; padding:6px 4px; color:var(--muted); font-size:13px; font-weight:600; text-decoration:none;}
.link-quiet:hover{color:var(--accent);}

.bottomnav{
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  display:grid; grid-template-columns:repeat(4,1fr);
  height:calc(var(--nav-h) + var(--safe-b)); padding-bottom:var(--safe-b);
  background:rgba(20,21,24,.97); border-top:1px solid var(--line);
}
.bottomnav button{border:0; background:none; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; color:var(--faint); font-size:11px; font-weight:600;}
.bottomnav svg{width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linejoin:round; stroke-linecap:round;}
.bottomnav button.active{color:var(--accent);}
.bottomnav button.active svg{fill:var(--accent-soft);}

@media (min-width:860px){
  .topnav{display:flex;}
  .bottomnav{display:none;}
  .app{padding-bottom:40px;}
}

.appfoot{margin-top:40px; font-size:12px; color:var(--faint);}
.appfoot .ver{margin-left:6px;}

/* ---------- avviso richieste ---------- */
.alert{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:space-between;
  margin-top:14px; padding:12px 14px; border-radius:12px; font-size:13.5px;
  background:var(--together); border:1px solid var(--together-line);
}

/* ---------- intestazioni ---------- */
.intro{padding:26px 0 18px;}
.intro h1{font-size:clamp(32px,6vw,52px); line-height:1.02; margin:0 0 12px;}
.intro-line{margin:0; color:var(--muted);}
.intro-line strong{color:var(--accent); font-family:'Fraunces',serif; font-size:20px; font-weight:600;}
.section-head{padding:26px 0 18px;}
.section-head h1{font-size:clamp(30px,5vw,44px); margin:0 0 6px;}
.section-head p{margin:0; color:var(--muted); max-width:56ch;}
.group-title{
  font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--muted);
  margin:28px 0 12px; display:flex; align-items:center; gap:10px;
}
.group-title::after{content:""; flex:1; height:1px; background:var(--line);}

/* ---------- filtri ---------- */
.filters{display:flex; flex-direction:column; gap:10px;}
.search{position:relative;}
.search svg{position:absolute; left:13px; top:50%; transform:translateY(-50%); width:17px; height:17px; fill:none; stroke:var(--muted); stroke-width:2;}
.search input{width:100%; height:46px; padding:0 14px 0 40px; border-radius:12px; border:1px solid var(--line); background:var(--card); font-size:16px;}
.selects{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px;}
.selects select{height:42px; border-radius:10px; border:1px solid var(--line); background:var(--card); padding:0 10px; font-size:16px; min-width:0; width:100%; max-width:100%; text-overflow:ellipsis;}
.chips{display:flex; gap:6px; overflow-x:auto; padding-bottom:2px; scrollbar-width:none; min-width:0; max-width:100%;}
.chips::-webkit-scrollbar{display:none;}
.chip{flex-shrink:0; border:1px solid var(--line); background:var(--card); color:var(--muted); padding:7px 13px; border-radius:99px; font-size:13px; font-weight:600;}
.chip.active{background:var(--accent); border-color:var(--accent); color:var(--accent-ink);}
@media (min-width:860px){
  .filters{flex-direction:row; flex-wrap:wrap; align-items:center;}
  .search{flex:1 1 320px;}
  .selects{flex:0 1 380px; min-width:0;}
  .chips{flex-basis:100%;}
}
.results-bar{display:flex; justify-content:space-between; align-items:center; gap:10px; margin:16px 0 12px; font-size:13px; color:var(--muted); flex-wrap:wrap;}
.results-bar strong{color:var(--ink);}
.results-actions{display:flex; gap:4px 12px; flex-wrap:wrap;}
.results-actions #surpriseBtn{color:var(--accent);}

/* ---------- cartelle delle regioni ---------- */
.folders{display:flex; flex-direction:column; gap:10px;}
.folder{border:1px solid var(--line); border-radius:var(--radius); background:var(--bg-2); overflow:hidden;}
.folder.open{border-color:#3a3d44;}
.folder-head{
  width:100%; border:0; background:none; display:grid; grid-template-columns:minmax(0,1fr) auto 22px; align-items:center; gap:12px;
  padding:14px 14px 12px 16px; text-align:left;
}
.folder-name{font-family:'Fraunces',Georgia,serif; font-size:20px; line-height:1.2; overflow-wrap:anywhere;}
.folder-name small{display:block; font-family:'Inter',sans-serif; font-size:12px; color:var(--muted); margin-top:1px;}
.folder-count{font-size:14px; color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap;}
.folder-count b{color:var(--accent); font-weight:700;}
.folder-count.full b{color:var(--accent);}
.chev{width:22px; height:22px; color:var(--muted); transition:transform .2s ease;}
.chev svg{width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
.folder.open .chev{transform:rotate(90deg);}
.folder-bar{height:3px; background:var(--line); margin:0 16px 13px; border-radius:99px; overflow:hidden;}
.folder-bar > div{height:100%; background:var(--accent);}
.folder-body{padding:12px 12px 14px;}
.folder-tools{display:flex; justify-content:space-between; align-items:center; gap:10px; margin:0 2px 12px; flex-wrap:wrap;}
.seen-toggle{display:inline-flex; align-items:center; gap:8px; border:1px solid var(--line); background:var(--card); border-radius:99px; padding:6px 12px 6px 8px; font-size:12.5px; font-weight:600; color:var(--muted);}
.seen-toggle .sw{width:30px; height:18px; border-radius:99px; background:var(--line); position:relative; transition:background .15s;}
.seen-toggle .sw::after{content:""; position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:var(--ink); transition:transform .15s;}
.seen-toggle.on .sw{background:var(--accent);}
.seen-toggle.on .sw::after{transform:translateX(12px); background:var(--accent-ink);}
.folder-note{font-size:12.5px; color:var(--faint);}
.folder-empty{color:var(--muted); font-size:13.5px; padding:6px 4px;}

/* ---------- card ---------- */
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(min(270px,100%),1fr)); gap:14px;}
.card{
  position:relative; background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden; cursor:pointer; display:flex; flex-direction:column;
  transition:transform .15s ease, border-color .15s ease;
}
.card:hover{border-color:var(--faint);}
.card:active{transform:scale(.985);}
.card.is-together{background:var(--together); border-color:var(--together-line);}
.card-cover{aspect-ratio:var(--cover-ratio); background:var(--card-2) center/cover no-repeat;}
.card-body{padding:15px 56px 15px 16px; display:flex; flex-direction:column; gap:6px; flex:1;}
.card.has-cover .card-body{padding-right:16px;}
.card-kicker{font-size:11px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; color:var(--muted);}
.card-kicker .hl{color:var(--accent);}
.card h3{margin:0; font-size:21px; line-height:1.15; overflow-wrap:anywhere;}
.card p{overflow-wrap:anywhere; margin:0; font-size:13.5px; color:var(--muted); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;}
.card-foot{display:flex; align-items:center; gap:10px; margin-top:auto; padding-top:6px; font-size:12px; color:var(--muted); flex-wrap:wrap;}
.tag{font-size:11px; padding:3px 8px; border-radius:6px; background:var(--card-2); border:1px solid var(--line);}
.card.is-together .tag{background:rgba(0,0,0,.18);}
.card-foot .who{font-size:14px; letter-spacing:2px;}

.heart{
  position:absolute; top:10px; right:10px; z-index:2; width:40px; height:40px; border-radius:50%;
  border:0; background:rgba(20,21,24,.6); display:grid; place-items:center; padding:0;
}
.heart svg{width:21px; height:21px; fill:none; stroke:var(--ink); stroke-width:1.8;}
.heart.on svg{fill:var(--accent); stroke:var(--accent);}
.heart.pop svg{animation:pop .35s ease;}
@keyframes pop{0%{transform:scale(1)}40%{transform:scale(1.35)}100%{transform:scale(1)}}

.more-btn{display:block; margin:22px auto 0; border:1px solid var(--line); background:var(--card); padding:11px 22px; border-radius:99px; font-weight:600; color:var(--muted);}

.empty{border:1px dashed var(--line); border-radius:var(--radius); padding:34px 20px; text-align:center; color:var(--muted);}
.empty h3{font-size:21px; color:var(--ink); margin:0 0 6px;}
.empty p{margin:0;}

/* ---------- diario ---------- */
.diary{display:grid; grid-template-columns:repeat(auto-fill,minmax(min(300px,100%),1fr)); gap:16px;}
.diary-card{position:relative; border-radius:18px; overflow:hidden; cursor:pointer; aspect-ratio:var(--cover-ratio); background:var(--card-2) center/cover no-repeat; display:flex; align-items:flex-end; border:1px solid var(--line);}
.diary-card::before{content:""; position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,0) 30%,rgba(0,0,0,.82));}
.diary-card.no-cover{background:linear-gradient(145deg,#2d2616,#1b1d21);}
.diary-card .d-in{position:relative; padding:18px; width:100%;}
.diary-date{font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--accent);}
.diary-card h3{font-size:26px; margin:4px 0 4px; color:#fff;}
.diary-meta{font-size:12.5px; color:rgba(255,255,255,.75);}
.diary-stamp{position:absolute; top:14px; right:14px; width:50px; height:50px; border:1.5px solid rgba(245,184,61,.8); border-radius:6px; transform:rotate(6deg); display:grid; place-items:center; color:var(--accent); font-family:'Fraunces',serif; font-size:11px; text-align:center; line-height:1.15; background:rgba(0,0,0,.3);}

/* ---------- noi ---------- */
.us-hero{padding:30px 0 10px; text-align:center;}
.us-hero .big{font-family:'Fraunces',serif; font-size:clamp(64px,16vw,110px); line-height:1; color:var(--accent);}
.us-hero .of{color:var(--muted); margin-top:6px;}
.us-bar{height:6px; background:var(--line); border-radius:99px; overflow:hidden; max-width:360px; margin:16px auto 0;}
.us-bar > div{height:100%; background:var(--accent); border-radius:99px;}
.us-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr)); gap:10px; margin-top:26px;}
.stat{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px;}
.stat .n{font-family:'Fraunces',serif; font-size:30px; line-height:1.1;}
.stat .l{font-size:12.5px; color:var(--muted);}
.next-card{margin-top:22px; background:linear-gradient(135deg,#2b2413,#1e2025); border:1px solid var(--together-line); border-radius:18px; padding:20px;}
.next-card .k{font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--accent);}
.next-card h3{font-size:28px; margin:6px 0 4px;}
.next-card p{margin:0 0 14px; color:var(--muted); font-size:14px;}
.next-actions{display:flex; gap:8px; flex-wrap:wrap;}
.regions{display:flex; flex-direction:column; gap:11px;}
.region-row{display:grid; grid-template-columns:minmax(0,38%) minmax(0,1fr) auto; align-items:center; gap:12px; font-size:13.5px; cursor:pointer; background:none; border:0; padding:2px 0; text-align:left;}
.region-row .bar{height:7px; background:var(--line); border-radius:99px; overflow:hidden;}
.region-row .bar > div{height:100%; background:var(--accent); border-radius:99px;}
.region-row .c{text-align:right; color:var(--muted); font-size:12.5px; font-variant-numeric:tabular-nums;}

/* ---------- notifiche ---------- */
.push-box{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:16px;}
.push-title{font-weight:700; font-size:14.5px; margin-bottom:4px;}
.push-sub{margin:0 0 12px; font-size:13.5px; color:var(--muted); line-height:1.5;}

/* ---------- bottoni ---------- */
.btn{border:1px solid var(--line); background:var(--card-2); border-radius:10px; min-height:42px; padding:9px 16px; font-size:14px; font-weight:600; text-decoration:none; display:inline-flex; align-items:center; justify-content:center;}
.btn:hover{border-color:var(--faint);}
.btn-primary{background:var(--accent); border-color:var(--accent); color:var(--accent-ink);}
.btn-danger{color:var(--danger); border-color:rgba(229,107,93,.5); background:none;}
.btn-sm{min-height:36px; padding:6px 12px; font-size:13px;}
.icon-btn{width:40px; height:40px; border-radius:50%; border:1px solid var(--line); background:var(--card); display:grid; place-items:center; padding:0; font-size:20px; line-height:1;}
.icon-btn svg{width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round;}

/* ---------- scheda del posto ---------- */
/* Telefono: pagina intera, e la lista dietro non viene nemmeno disegnata: non c'è niente che possa scorrere per sbaglio. */
.detail{position:fixed; inset:0; z-index:60; background:var(--bg); display:flex; flex-direction:column;}
html.detail-open .app, html.detail-open .bottomnav{display:none;}
.detail-panel{display:flex; flex-direction:column; height:100%; min-height:0; width:100%;}
.d-hero{
  position:relative; flex-shrink:0; padding:calc(12px + var(--safe-t)) 16px 18px;
  background:linear-gradient(160deg,#262116 0%,#17181b 70%) center/cover no-repeat;
}
.d-hero.with-cover{aspect-ratio:var(--cover-ratio); max-height:52vh; display:flex; flex-direction:column; justify-content:space-between;}
.d-hero.with-cover::before{content:""; position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,.35),rgba(0,0,0,0) 35%,rgba(0,0,0,.85));}
.d-hero > *{position:relative;}
.d-top{display:flex; justify-content:space-between; align-items:center; gap:10px;}
.d-top .heart{position:static; width:44px; height:44px;}
.d-top .heart svg{width:23px; height:23px;}
.d-kicker{font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--accent); margin-top:16px;}
.d-hero h2{font-size:clamp(28px,7vw,40px); line-height:1.05; margin:4px 0 0; color:#fff;}
.d-date{margin-top:6px; font-size:13px; color:rgba(255,255,255,.8);}
.d-tabs{flex-shrink:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-bottom:1px solid var(--line); background:var(--bg);}
.d-tabs button{border:0; background:none; padding:13px 4px 11px; font-size:13px; font-weight:600; color:var(--muted); border-bottom:2px solid transparent;}
.d-tabs button.active{color:var(--ink); border-bottom-color:var(--accent);}
.d-tabs b{font-weight:500; color:var(--faint); margin-left:3px;}
.d-body{flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; padding:18px 16px calc(28px + var(--safe-b));}
.d-sec{margin-bottom:22px;}
.d-sec h4{margin:0 0 9px; font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--accent);}
.d-sec p{margin:0; line-height:1.6; overflow-wrap:anywhere;}
.d-sec .muted{color:var(--muted); font-size:13.5px;}
.seg{display:flex; gap:6px; flex-wrap:wrap;}
.seg button{flex:1 1 0; min-width:min(92px,30%); padding:10px 8px; border-radius:10px; border:1px solid var(--line); background:var(--card); font-size:13px; font-weight:600; color:var(--muted);}
.seg button.sel{background:var(--accent); border-color:var(--accent); color:var(--accent-ink);}
.input{width:100%; border:1px solid var(--line); border-radius:10px; background:var(--card); padding:11px 12px; font-size:16px;}
textarea.input{min-height:80px; resize:vertical;}
input[type="date"].input{max-width:min(220px,100%); color-scheme:dark; -webkit-appearance:none; appearance:none; min-height:44px;}
.travel{display:grid; gap:10px;}
.travel-card{border:1px solid var(--line); background:var(--card); border-radius:12px; padding:14px;}
.travel-card .from{font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted);}
.travel-card .est{margin:4px 0 12px; font-size:14px;}
.travel-card .row{display:flex; gap:8px; flex-wrap:wrap;}
.closer{background:var(--accent-soft); border:1px solid rgba(245,184,61,.3); border-radius:12px; padding:12px 14px; font-size:14px; margin-bottom:12px;}
.source-link{display:inline-flex; align-items:center; gap:6px; font-weight:600; color:var(--accent); text-decoration:none; font-size:14px;}

/* PC: la scheda è un pannello centrato sopra la lista oscurata */
@media (min-width:860px){
  .detail{background:rgba(8,9,10,.75); align-items:center; justify-content:center; padding:4vh 20px;}
  html.detail-open .app{display:block;}
  html.detail-open, html.detail-open body{overflow:hidden;}
  .detail-panel{max-width:760px; height:92vh; border:1px solid var(--line); border-radius:18px; overflow:hidden; background:var(--bg); box-shadow:var(--shadow);}
  .d-hero{padding-top:16px;}
  .travel{grid-template-columns:1fr 1fr;}
}

/* ---------- galleria ---------- */
.gallery{display:grid; grid-template-columns:repeat(3,1fr); gap:6px;}
@media (min-width:600px){ .gallery{grid-template-columns:repeat(4,1fr);} }
.g-item{position:relative; aspect-ratio:1; border-radius:10px; overflow:hidden; background:var(--card-2); cursor:pointer; border:0; padding:0;}
.g-item img{width:100%; height:100%; object-fit:cover; display:block;}
.g-item .ph{width:100%; height:100%; display:grid; place-items:center; color:var(--accent); font-size:22px;}
.g-item .vb{position:absolute; bottom:5px; left:5px; background:rgba(0,0,0,.65); color:#fff; font-size:9.5px; font-weight:700; padding:2px 6px; border-radius:4px;}
.g-item .who{position:absolute; top:4px; left:5px; font-size:14px; filter:drop-shadow(0 1px 2px rgba(0,0,0,.8));}
.g-item .st{position:absolute; top:5px; right:5px;}
.g-item .st svg{width:17px; height:17px; fill:var(--accent); filter:drop-shadow(0 1px 2px rgba(0,0,0,.8));}
.g-add{aspect-ratio:1; border-radius:10px; border:1.5px dashed var(--line); background:var(--card); display:grid; place-items:center; color:var(--muted); font-size:28px; cursor:pointer; padding:0;}
.g-add:hover{border-color:var(--accent); color:var(--accent);}
.locked{border:1px dashed var(--line); border-radius:12px; padding:16px; color:var(--muted); font-size:14px; text-align:center;}
.queue{display:flex; flex-direction:column; gap:7px; margin-top:12px;}
.q-row{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,25%) auto; gap:8px; align-items:center; font-size:12px; color:var(--muted);}
.q-row .name{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.q-row .bar{height:5px; background:var(--line); border-radius:99px; overflow:hidden;}
.q-row .bar > div{height:100%; width:0; background:var(--accent); transition:width .2s ease;}
.q-row.err .bar > div{background:var(--danger); width:100%!important;}
.q-row .pct{text-align:right;}
.postcard-row{margin-top:16px; display:flex; gap:8px; flex-wrap:wrap;}

/* ---------- commenti ---------- */
.comments{display:flex; flex-direction:column; gap:10px; margin-bottom:14px;}
.comment{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:11px 13px;}
.comment.mine{border-color:var(--together-line); background:var(--together);}
.c-head{display:flex; align-items:center; gap:7px; font-size:12px; font-weight:700; color:var(--muted); margin-bottom:3px;}
.c-head .em{font-size:15px;}
.c-head .when{margin-left:auto; font-weight:400;}
.c-text{white-space:pre-wrap; font-size:14.5px; overflow-wrap:anywhere;}
.c-del{border:0; background:none; color:var(--faint); font-size:12px; padding:4px 0 0; text-decoration:underline;}
.c-form{display:flex; gap:8px; align-items:flex-end;}
.c-form textarea{flex:1; min-height:46px;}

/* ---------- livelli sovrapposti (form, sito esterno) ---------- */
.layer{position:fixed; inset:0; z-index:80; background:rgba(8,9,10,.8); display:flex; align-items:flex-end; justify-content:center;}
@media (min-width:700px){ .layer{align-items:center;} }
.sheet{width:100%; max-width:520px; max-height:92vh; overflow-y:auto; overscroll-behavior:contain; background:var(--bg-2); border:1px solid var(--line); border-radius:18px 18px 0 0; padding:22px 20px calc(22px + var(--safe-b));}
@media (min-width:700px){ .sheet{border-radius:18px;} }
.sheet h2{margin:0 0 16px; font-size:26px;}
.field{display:block; margin-bottom:12px;}
.field span{display:block; font-size:12px; font-weight:600; color:var(--muted); margin-bottom:5px;}
.field input,.field select,.field textarea{width:100%; border:1px solid var(--line); border-radius:10px; background:var(--card); padding:10px 12px; font-size:16px;}
.field textarea{min-height:80px; resize:vertical;}
.check{display:flex; gap:9px; align-items:flex-start; font-size:14px; color:var(--muted); margin:4px 0 16px;}
.sheet-actions{display:flex; gap:8px;}
.web-box{width:90%; height:90vh; height:90dvh; background:var(--card); border:1px solid var(--line); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; align-self:center;}
.web-bar{display:flex; align-items:center; gap:12px; padding:8px 10px 8px 16px; border-bottom:1px solid var(--line); font-weight:600; font-size:14px;}
.web-bar #webTitle{flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.web-box iframe{flex:1; border:0; width:100%; background:#fff;}

/* ---------- visualizzatore foto ---------- */
/* Tre fasce che non si sovrappongono mai: comandi sopra, foto/video al centro, frecce e info sotto.
   Orizzontali e verticali stanno sempre intere nello spazio centrale, i comandi restano sempre visibili. */
.lightbox{position:fixed; inset:0; z-index:90; background:#000; display:flex; flex-direction:column; height:100vh; height:100dvh; touch-action:pan-y;}
.lb-top,.lb-bottom{flex-shrink:0; display:flex; align-items:center; gap:10px; padding:10px 12px; background:#000;}
.lb-top{padding-top:calc(10px + var(--safe-t));}
.lb-bottom{padding-bottom:calc(12px + var(--safe-b)); justify-content:space-between;}
.lb-top .spacer{flex:1;}
.lb-stage{flex:1; min-height:0; display:flex; align-items:center; justify-content:center; padding:0 6px;}
.lb-media{max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; display:block; border-radius:4px;}
.lb-count{font-size:13px; color:rgba(255,255,255,.7); font-variant-numeric:tabular-nums;}
.lb-meta{flex:1; text-align:center; font-size:12.5px; color:rgba(255,255,255,.75); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.lb-btn{flex-shrink:0; width:44px; height:44px; border-radius:50%; border:1px solid rgba(255,255,255,.18); background:#1e2025; color:#fff; display:grid; place-items:center; padding:0; font-size:22px;}
.lb-btn svg{width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linejoin:round; stroke-linecap:round;}
.lb-btn:disabled{opacity:.25;}
.lb-star.on{color:var(--accent); border-color:var(--accent);}
.lb-star.on svg{fill:var(--accent);}
.lb-trash{color:#f0a198;}
.lb-cover.on{color:var(--accent); border-color:var(--accent);}
.lb-cover.on svg{stroke:var(--accent);}
/* pannello per scegliere che fascia della foto finisce in copertina */
.lb-panel{flex-shrink:0; background:#0c0d0f; border-top:1px solid rgba(255,255,255,.12); padding:12px; display:flex; flex-direction:column; gap:10px; max-height:62vh; overflow-y:auto;}
.panel-actions{display:flex; gap:8px; flex-wrap:wrap;}
/* ritaglio copertina: si vede tutta la foto, dentro il tratteggio quello che finirà in copertina */
.cover-wrap{position:relative; overflow:hidden; align-self:center; max-width:100%; line-height:0; touch-action:none; cursor:grab;}
.cover-wrap:active{cursor:grabbing;}
.cover-wrap img{display:block; max-width:100%; max-height:34vh; width:auto;}
.cover-frame{position:absolute; left:0; border:2px dashed rgba(255,255,255,.95); border-radius:4px; box-shadow:0 0 0 2000px rgba(0,0,0,.66); pointer-events:none;}
.cover-edit input[type="range"]{width:100%; accent-color:var(--accent); height:30px;}
.cover-hint{margin:0; font-size:12px; color:rgba(255,255,255,.6); text-align:center;}
.lb-trash.pending{color:var(--accent); border-color:var(--accent);}
.req-title{font-weight:700; font-size:14px;}
.req-sub{margin:0; font-size:13px; color:rgba(255,255,255,.7);}
.req-form textarea{width:100%; min-height:70px; border-radius:10px; border:1px solid rgba(255,255,255,.18); background:#17181b; color:#fff; padding:10px 12px; font-size:16px; resize:vertical;}
.req-banner{background:#1b1710; border-top-color:var(--together-line);}

/* ---------- avvisi ---------- */
.toast{
  position:fixed; left:50%; transform:translateX(-50%); bottom:calc(var(--nav-h) + var(--safe-b) + 14px); z-index:100;
  background:var(--card-2); border:1px solid var(--line); padding:10px 18px; border-radius:12px; font-size:13.5px; font-weight:600;
  box-shadow:var(--shadow); max-width:calc(100vw - 32px); text-align:center; animation:fadeup .2s ease;
}
html.detail-open .toast{bottom:calc(20px + var(--safe-b));}
@keyframes fadeup{from{opacity:0; transform:translate(-50%,8px)} to{opacity:1; transform:translate(-50%,0)}}
@media (min-width:860px){ .toast{bottom:24px;} }

/* ---------- accesso ---------- */
.login-body{display:flex; align-items:center; justify-content:center; min-height:100vh; min-height:100dvh; padding:24px;}
.login-card{max-width:380px; width:100%; text-align:center;}
.login-mark{width:52px; height:52px; margin:0 auto 18px; border:1px solid var(--accent); color:var(--accent); border-radius:50%; display:grid; place-items:center; font-size:22px;}
.login-card h1{font-size:34px; line-height:1.05; margin:0 0 6px;}
.login-sub{color:var(--muted); font-size:13px; margin:0 0 26px;}
.login-error{color:var(--danger); font-size:13.5px; margin:0 0 12px;}
.login-form{display:flex; flex-direction:column; gap:14px;}
.person-picker{display:flex; gap:10px;}
.person-opt{flex:1; border:1.5px solid var(--line); border-radius:14px; padding:16px 8px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:6px; position:relative; background:var(--card);}
.person-opt input{position:absolute; opacity:0; pointer-events:none;}
.person-opt:has(input:checked){border-color:var(--accent); background:var(--accent-soft);}
.person-emoji{font-size:30px;}
.person-label{font-size:14px; font-weight:600;}
.login-form input[type="password"]{height:48px; border:1px solid var(--line); border-radius:12px; background:var(--card); padding:0 14px; font-size:16px; text-align:center;}
.login-form .btn{height:48px;}
