/* Look & feel ispirato a wndws.space: cornice "cielo", foglio grigio, finestrelle con cornice a gradini. */
:root {
  --sky-top: #24489a;
  --sky-bottom: #b9d2f2;
  --sheet: rgb(188, 165, 158);  /* marrone chiaro #BCA59E */
  --frame: #d8c9c4;       /* cornice delle finestrelle */
  --pane: #ad948c;        /* sfondo delle foto in caricamento */
  --card: #ffffff;
  --ink: #000;
  --muted: rgba(0, 0, 0, 0.62);
  --line: rgba(0, 0, 0, 0.12);
  --pill-line: rgba(0, 0, 0, 0.16);
  --danger: #b3261e;
  --warn: #9a6400;
  --radius: 14px;
  --gutter: 10px;          /* spessore della cornice cielo */
  --win-w: 2cm;            /* finestrelle della home: 2 cm × 3 cm */
  --win-h: 3cm;
  --win-t: 6px;            /* spessore della cornice delle finestrelle */
  --row-h: 220px;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Bodoni Moda', 'Didot', 'Bodoni 72', 'Times New Roman', serif;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.09), 0 1px 2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--sky-top) 0%, #3f6cc0 35%, var(--sky-bottom) 100%) fixed;
  color: var(--ink);
  font: 500 15px/1.45 var(--sans);
  letter-spacing: -0.02em;
  overflow: hidden;
}
/* Il "foglio" grigio scorre dentro la cornice cielo, che resta ferma. */
.sheet {
  position: fixed;
  inset: var(--gutter);
  background: var(--sheet);
  border-radius: var(--radius);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; font-weight: 500; }
h2 { font-size: 1.05rem; }
h3 { font-size: .8rem; text-transform: lowercase; color: var(--muted); margin-top: 1.8em; }
.serif, .display {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; text-transform: uppercase;
}
.muted { color: var(--muted); }
.small { font-size: .82rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: .5rem 0; }
::selection { background: #000; color: #fff; }

/* ---------- Intestazione ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px 24px 22px;
  background: linear-gradient(var(--sheet) 78%, rgba(188, 165, 158, 0));
}
.nav-left { display: flex; gap: 18px; flex-wrap: wrap; }
.nav-left a, .nav-upload { text-decoration: none; font-size: 16px; letter-spacing: -0.04em; }
.nav-left a { color: var(--muted); }
.nav-left a:hover, .nav-left a.active { color: var(--ink); }
.wordmark {
  font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1;
  letter-spacing: -0.03em; text-decoration: none; white-space: nowrap;
}
.nav-right { display: flex; justify-content: flex-end; align-items: center; gap: 18px; }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 220px;
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 30;
}
.menu-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head span { color: var(--muted); font-size: .82rem; }
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 6px;
  text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; color: inherit; letter-spacing: inherit;
}
.menu a:hover, .menu button:hover { background: #f0f0f0; }
.menu form { margin: 4px 0 0; border-top: 1px solid var(--line); padding-top: 4px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; background: #111; color: #fff; font-weight: 500; line-height: 1; letter-spacing: 0;
}

/* ---------- Layout ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 12px 24px 60px; width: 100%; }
.page.wide { max-width: 1600px; }
.page.narrow { max-width: 620px; }
.page-title { font-size: 2.4rem; margin-bottom: 24px; }

.hero { padding: 18px 24px 18px; text-align: center; }
.hero-inner { max-width: 1600px; margin: 0 auto; }
.hero h1, .album-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 8px; }
.hero p { margin: 0; color: var(--muted); font-size: .9rem; }
.tagline { text-align: center; color: var(--muted); margin: 0 0 30px; font-size: .92rem; }

.flash {
  max-width: 640px; margin: 0 auto 10px; padding: 10px 16px; border-radius: 10px;
  width: calc(100% - 48px); background: var(--card); box-shadow: var(--shadow); text-align: center;
}
.flash-error { color: var(--danger); }
.alert { background: #fff3f2; color: var(--danger); padding: 10px 14px; border-radius: 8px; }

/* ---------- Pulsanti a pillola ---------- */
.pill, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 18px; min-height: 32px; border-radius: 6px;
  border: 1px solid var(--pill-line); background: transparent; color: rgba(0, 0, 0, 0.55);
  font: 500 13px/1.2 var(--sans); letter-spacing: -0.3px; text-decoration: none; cursor: pointer;
}
.pill:hover, .btn:hover { color: var(--ink); border-color: rgba(0, 0, 0, 0.4); }
.pill.active, .btn-primary { background: #000; border-color: #000; color: #fff; }
.pill.active:hover, .btn-primary:hover { background: #222; color: #fff; }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }
.pill-block, .btn-block { width: 100%; padding: 10px; font-size: 14px; }
.btn-danger-link, .link-btn {
  background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; cursor: pointer; color: var(--muted); text-decoration: underline;
}
.btn-danger-link, .link-btn.danger { color: var(--danger); }

input, textarea, select {
  font: 500 15px var(--sans); letter-spacing: -0.02em; color: var(--ink); width: 100%;
  padding: 10px 12px; border: 1px solid var(--pill-line); border-radius: 8px; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid #000; outline-offset: -1px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; color: var(--ink); }
label.check input { width: auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

details.inline-edit { margin: 14px 0; }
details.inline-edit summary { cursor: pointer; font-size: .88rem; text-decoration: underline; color: var(--muted); }
details.inline-edit form { margin-top: 10px; }
details.inline-edit form + form { margin-top: 14px; }

/* ---------- Finestrelle (cornice a gradini) ---------- */
.win {
  --t: var(--win-t);
  position: relative; display: block; flex: none;
  width: var(--win-w); height: var(--win-h); padding: var(--t);
  transition: transform .18s ease;
}
/* La cornice è disegnata nello pseudo-elemento, così l'etichetta sotto la finestrella non viene ritagliata. */
.win::before {
  content: ''; position: absolute; inset: 0; background: var(--frame);
  clip-path: polygon(
    var(--t) 0, calc(100% - var(--t)) 0, calc(100% - var(--t)) var(--t), 100% var(--t),
    100% calc(100% - var(--t)), calc(100% - var(--t)) calc(100% - var(--t)), calc(100% - var(--t)) 100%,
    var(--t) 100%, var(--t) calc(100% - var(--t)), 0 calc(100% - var(--t)), 0 var(--t), var(--t) var(--t)
  );
}
.win .pane { position: relative; display: block; width: 100%; height: 100%; background: var(--sheet); overflow: hidden; }
.win img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.win:hover { transform: translateY(-3px) scale(1.04); }
.win-label {
  position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .15s; pointer-events: none;
}
a.win:hover .win-label, a.win:focus-visible .win-label { opacity: 1; }

.windows {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 30px 34px; max-width: calc(10 * var(--win-w) + 9 * 34px); margin: 0 auto;
}

/* ---------- Home: elenco amici ---------- */
.members { max-width: 520px; margin: 70px auto 20px; }
.section-title { text-align: center; font-family: var(--serif); font-weight: 400; text-transform: uppercase; font-size: 1.7rem; margin-bottom: 18px; }
.member-list { list-style: none; padding: 0; margin: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.member-list li + li { border-top: 1px solid var(--line); }
.member-list a { display: flex; align-items: center; gap: 12px; padding: 12px 18px; text-decoration: none; }
.member-list a:hover { background: #f5f5f5; }
.member-name { white-space: nowrap; }
.leader { flex: 1; border-bottom: 1px dotted rgba(0, 0, 0, 0.25); transform: translateY(4px); }
.member-count { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.dock {
  position: sticky; bottom: 0; z-index: 15; display: flex; justify-content: center; gap: 8px;
  padding: 26px 16px 18px; margin-top: 10px;
  background: linear-gradient(rgba(188, 165, 158, 0), var(--sheet) 45%);
}
.corner-stats { position: fixed; left: calc(var(--gutter) + 22px); bottom: calc(var(--gutter) + 20px); margin: 0; font-size: 13px; letter-spacing: -0.3px; z-index: 16; }

/* ---------- Griglia giustificata (tutte le foto, profili, album) ---------- */
.justified { display: flex; flex-wrap: wrap; gap: 6px; }
.justified::after { content: ''; flex-grow: 999999; }
.tile {
  position: relative; display: block; overflow: hidden; background: var(--pane);
  width: calc(var(--r) * var(--row-h)); flex-grow: var(--r);
}
.tile i { display: block; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-meta {
  position: absolute; inset: auto 0 0 0; padding: 30px 10px 8px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  display: flex; flex-direction: column; opacity: 0; transition: opacity .15s; font-size: 13px;
}
.tile:hover .tile-meta, .tile:focus-visible .tile-meta { opacity: 1; }
.tile-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-by { font-size: 12px; opacity: .85; }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.pager .btn { color: var(--ink); }

.empty { text-align: center; padding: 60px 20px; }
.empty p { color: var(--muted); margin-bottom: 20px; }
.empty h1 { font-size: 3.4rem; }

/* ---------- Amici ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.person-card { background: var(--card); border-radius: var(--radius); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s; }
.person-card:hover { transform: translateY(-2px); }
.person-cover { height: 100px; background: var(--pane); }
.person-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-body { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 16px 16px; gap: 2px; }
.person-body .avatar { margin-top: -28px; border: 3px solid var(--card); box-sizing: content-box; margin-bottom: 6px; }
.person-body .muted { font-size: .82rem; }

/* ---------- Profilo ---------- */
.profile-hero { padding: 10px 24px 0; }
.profile-inner { max-width: 1600px; margin: 0 auto; display: flex; align-items: center; gap: 20px; }
.profile-inner h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0; }
.profile-inner p { margin: 4px 0 0; }
.tabs { max-width: 1600px; margin: 24px auto 0; display: flex; gap: 8px; }
.tabs a {
  text-decoration: none; padding: 7px 16px; border-radius: 6px; border: 1px solid var(--pill-line);
  color: rgba(0, 0, 0, .55); font-size: 13px;
}
.tabs a span { margin-left: 4px; opacity: .7; }
.tabs a.active { background: #000; border-color: #000; color: #fff; }
.profile-hero + .page.wide { padding-top: 22px; }

/* ---------- Spazio occupato ---------- */
.quota { background: var(--card); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 22px; font-size: .9rem; }
.bar { height: 6px; background: rgba(0, 0, 0, .1); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.bar span { display: block; height: 100%; background: #000; transition: width .3s; }
.quota.warn .bar span { background: var(--warn); }
.quota.full .bar span { background: var(--danger); }
.quota-msg { margin: 8px 0 0; font-size: .85rem; }
.quota-msg:empty { display: none; }
.quota.warn .quota-msg { color: var(--warn); }
.quota.full .quota-msg { color: var(--danger); font-weight: 600; }
.quota-mini { margin: 10px 0 0; padding: 8px 12px; max-width: 280px; }
.quota-mini .bar { margin: 0 0 6px; }

/* ---------- Album ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.album-card {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  display: block; text-decoration: none; background: var(--pane); box-shadow: var(--shadow);
}
.album-card img, .album-empty { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-meta {
  position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6)); display: flex; flex-direction: column;
}
.album-meta span { font-size: .82rem; opacity: .9; }
.album-new { background: transparent; border: 1px dashed rgba(0, 0, 0, .3); box-shadow: none; aspect-ratio: auto; min-height: 180px; padding: 16px; }
.album-new summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 150px; }
.album-new summary::-webkit-details-marker { display: none; }
.album-new[open] summary { min-height: 0; margin-bottom: 12px; }
.plus { font-size: 2.4rem; line-height: 1; font-weight: 300; }
.album-hero { padding: 18px 24px 20px; text-align: center; }
.album-hero .desc { max-width: 680px; margin: 0 auto; white-space: pre-line; }
.eyebrow { font-size: .85rem; margin: 0 0 8px; color: var(--muted); }
.eyebrow a { color: var(--ink); }

/* ---------- Pagina della foto: foglio bianco ---------- */
.stage {
  position: relative; background: var(--card); border-radius: 16px; margin: 0 24px; box-shadow: var(--shadow);
}
.stage-top { position: absolute; top: 0; left: 0; right: 0; padding: 14px 18px; z-index: 2; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; }
.back:hover { color: var(--ink); }
.stage-img { display: flex; align-items: center; justify-content: center; height: calc(100vh - 2 * var(--gutter) - 170px); min-height: 340px; padding: 48px 70px 4px; }
.stage-img img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); font-size: 3rem; line-height: 1;
  color: rgba(0, 0, 0, .35); text-decoration: none; padding: 20px 18px; user-select: none; font-weight: 300;
}
.nav-arrow:hover { color: #000; }
.nav-arrow.left { left: 0; }
.nav-arrow.right { right: 0; }
.stage-actions { display: flex; justify-content: flex-end; gap: 4px; padding: 6px 12px 10px; }
.stage-actions form { margin: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; background: none; border: 0; color: rgba(0, 0, 0, .55); cursor: pointer;
}
.icon-btn:hover { background: #f0f0f0; color: #000; }
.icon-btn.on { color: #000; }

.photo-info { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 30px; }
.owner-line { display: flex; gap: 14px; align-items: center; }
.owner-name { text-decoration: none; color: var(--muted); }
.owner-name:hover { color: var(--ink); }
.photo-title { font-family: var(--serif); font-weight: 400; font-size: 2rem; margin: 2px 0 0; letter-spacing: -0.02em; }
.photo-desc { white-space: pre-line; margin: 18px 0 0; }
.comments { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 22px; }
.comment, .comment-form { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.comment-body { flex: 1; }
.comment-body p { margin: 2px 0 0; white-space: pre-line; }
.comment-body a { text-decoration: none; }
.comment form { margin: 0; }
.stats { display: flex; gap: 30px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-size: 1.5rem; font-weight: 500; }
.stats span { color: var(--muted); font-size: .82rem; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0 0; font-size: .88rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.break { word-break: break-all; }
.album-list { list-style: none; padding: 0; margin: 0 0 12px; }
.album-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.album-list form { margin: 0; }
.album-list a { text-decoration: none; }
.photo-side select { flex: 1; }
.danger-zone { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- Caricamento ---------- */
.dropzone {
  --t: 10px;
  position: relative; padding: 60px 20px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted);
  background: var(--frame);
  clip-path: polygon(
    var(--t) 0, calc(100% - var(--t)) 0, calc(100% - var(--t)) var(--t), 100% var(--t),
    100% calc(100% - var(--t)), calc(100% - var(--t)) calc(100% - var(--t)), calc(100% - var(--t)) 100%,
    var(--t) 100%, var(--t) calc(100% - var(--t)), 0 calc(100% - var(--t)), 0 var(--t), var(--t) var(--t)
  );
  transition: background .15s;
}
.dropzone::before { content: ''; position: absolute; inset: var(--t); background: var(--sheet); z-index: 0; }
.dropzone > * { position: relative; z-index: 1; }
.dropzone strong { color: var(--ink); font-family: var(--serif); font-weight: 400; text-transform: uppercase; font-size: 1.5rem; }
.dropzone.over::before { background: #c8b3ad; }
.upload.disabled .dropzone { opacity: .45; pointer-events: none; }
.upload-options { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin: 22px 0; }
.queue { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.queue li { background: var(--card); border-radius: 10px; overflow: hidden; font-size: .8rem; box-shadow: var(--shadow); }
.queue .thumb { aspect-ratio: 1; background: var(--pane) center/cover no-repeat; position: relative; }
.queue .thumb a { position: absolute; inset: 0; }
.queue .info { padding: 8px 10px; }
.queue .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .progress { height: 3px; background: rgba(0, 0, 0, .1); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.queue .progress span { display: block; height: 100%; width: 0; background: #000; transition: width .2s; }
.queue li.error .progress span { background: var(--danger); width: 100% !important; }
.queue .status { color: var(--muted); margin-top: 4px; }
.queue li.error .status { color: var(--danger); }
.queue .remove { float: right; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; }
.upload-actions { justify-content: flex-end; margin-top: 22px; }
.upload-actions .muted { margin-right: auto; }

/* ---------- Accesso ---------- */
.login-wrap {
  max-width: 420px; margin: 0 auto; padding: 10vh 24px 40px; width: 100%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.wordmark-lg { font-size: clamp(2.4rem, 10vw, 3.8rem); white-space: normal; }
.login-wrap .tagline { margin: 10px 0 34px; }
.login-windows { display: flex; gap: 18px; margin-bottom: 38px; }
.login-windows .win { --win-w: 1.3cm; --win-h: 1.95cm; --t: 3px; }
.login-card {
  width: 100%; background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 26px; display: flex; flex-direction: column; gap: 14px; text-align: left;
}
.login-card .small { text-align: center; margin: 0; }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.disk { margin-bottom: 20px; }
.users { width: 100%; border-collapse: collapse; font-size: .9rem; }
.users th { text-align: left; font-size: .75rem; font-weight: 500; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.users td { padding: 12px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.users .actions { text-align: right; }
.users .actions details summary { list-style: none; }
.users .actions form { margin: 6px 0 0; }
.users .actions .row input { width: 150px; padding: 6px 8px; }
.badge { background: #000; color: #fff; font-size: .68rem; padding: 1px 6px; border-radius: 4px; vertical-align: middle; }

.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 20px 24px; font-size: 13px; color: var(--muted); letter-spacing: -0.3px;
}
.home .footer { padding-left: 260px; }

/* ---------- Schermi piccoli ---------- */
@media (max-width: 860px) {
  :root { --gutter: 6px; --row-h: 140px; --radius: 12px; }
  .nav { grid-template-columns: 1fr auto; grid-template-areas: 'logo right' 'links links'; padding: 14px 16px 16px; row-gap: 10px; }
  .wordmark { grid-area: logo; font-size: 28px; }
  .nav-right { grid-area: right; }
  .nav-left { grid-area: links; gap: 14px; }
  .nav-left a, .nav-upload { font-size: 15px; }
  .page, .page.wide { padding-left: 16px; padding-right: 16px; }
  .hero, .album-hero, .profile-hero { padding-left: 16px; padding-right: 16px; }
  .windows { gap: 22px 20px; }
  .photo-info, .admin-grid, .upload-options { grid-template-columns: 1fr; }
  .photo-info { gap: 24px; }
  .stage { margin: 0 10px; }
  .stage-img { height: auto; min-height: 0; padding: 46px 0 0; }
  .stage-img img { max-height: 70vh; }
  .nav-arrow { font-size: 2.2rem; padding: 12px 4px; }
  .justified { gap: 4px; }
  .tile-meta { display: none; }
  .corner-stats { position: static; text-align: center; margin: 4px 0 0; color: var(--muted); }
  .home .footer { padding-left: 24px; }
  .users .actions .row input { width: 110px; }
}

/* ---------- Eliminazione ---------- */
.icon-btn.icon-danger:hover { color: var(--danger); background: #fbeceb; }
.pill-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.pill-danger:hover { background: #8f1d17; color: #fff; }
.pill-danger:disabled { opacity: .35; cursor: not-allowed; }
.select-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.select-bar .select-actions { display: none; align-items: center; gap: 10px; flex-wrap: wrap; }
.select-bar.selecting #select-toggle { display: none; }
.select-bar.selecting .select-actions { display: flex; }
.justified.selecting .tile { cursor: pointer; }
.justified.selecting .tile::after {
  content: ''; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0, 0, 0, .25); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.justified.selecting .tile.selected::after {
  background: var(--danger) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/16px no-repeat;
}
.justified.selecting .tile.selected img { opacity: .55; }
.justified.selecting .tile-meta { display: none; }
