:root {
  --bg: #0d1411;
  --bg-soft: #151f1a;
  --panel: rgba(22, 32, 27, 0.92);
  --panel-solid: #18241e;
  --line: rgba(199, 220, 205, 0.18);
  --line-strong: rgba(199, 220, 205, 0.34);
  --text: #f3f6f3;
  --muted: #b9c6bd;
  --accent: #d9a441;
  --accent-2: #7fa990;
  --danger: #e0786c;
  --success: #8dcf9b;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  --radius: 18px;
  --radius-small: 11px;
  --content: min(1180px, calc(100vw - 32px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(10, 15, 12, 0.96), rgba(10, 15, 12, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,.025) 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,.025) 32px),
    var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, video { max-width: 100%; display: block; }
.hidden { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  background:
    linear-gradient(90deg, rgba(7, 12, 9, .18), rgba(7, 12, 9, .92) 62%),
    url("assets/monte-bove-fargno.jpg") center / cover no-repeat;
}
.login-visual {
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 72px);
}
.visual-copy { max-width: 680px; text-shadow: 0 4px 22px rgba(0,0,0,.7); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .73rem;
  font-weight: 800;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
.login-visual h1 { font-size: clamp(3rem, 7vw, 6.8rem); line-height: .9; margin-bottom: 20px; }
.login-visual p { max-width: 620px; font-size: clamp(1rem, 1.6vw, 1.25rem); color: #edf3ee; }
.photo-credit { margin-top: 28px; font-size: .73rem !important; color: rgba(255,255,255,.72) !important; }
.login-panel {
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: clamp(24px, 5vw, 72px);
  backdrop-filter: blur(12px);
  background: rgba(10, 16, 12, .82);
  border-left: 1px solid rgba(255,255,255,.12);
}
.brand-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 46px; font-weight: 850; letter-spacing: .04em; }
.brand-icon {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 12px; color: var(--accent);
  background: rgba(255,255,255,.045);
}
.brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 5px 14px rgba(0,0,0,.28));
}
.login-card { max-width: 460px; width: 100%; }
.login-card h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 9px; }
.login-card > p { color: var(--muted); margin-bottom: 28px; }
.form-grid { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: .86rem; font-weight: 700; }
input, textarea, select {
  width: 100%;
  color: var(--text);
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 13px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
select option {
  color: #111814;
  background: #ffffff;
}
select option:checked {
  color: #07100c;
  background: #9ec7f7;
}
textarea { min-height: 112px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217,164,65,.16);
  background: rgba(255,255,255,.075);
}
.primary-button, .secondary-button, .danger-button, .ghost-button {
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 12px 17px;
  font-weight: 800;
  transition: transform .15s, filter .15s, border-color .15s, background .15s;
}
.primary-button { color: #17130a; background: var(--accent); }
.secondary-button { color: var(--text); background: var(--accent-2); }
.danger-button { color: #190b09; background: var(--danger); }
.ghost-button { color: var(--text); background: transparent; border-color: var(--line); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover, .ghost-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: wait; transform: none !important; }
.demo-box {
  margin-top: 22px; padding: 15px; border: 1px dashed var(--line-strong); border-radius: 12px;
  color: var(--muted); background: rgba(255,255,255,.035); font-size: .82rem; line-height: 1.55;
}
.demo-box strong { color: var(--text); }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(13, 20, 17, .86); backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  width: var(--content); margin: auto; min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.topbar .brand-mark { margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 8px 10px; color: var(--muted); font-size: .82rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(141,207,155,.1); }
.icon-button {
  width: 42px; height: 42px; display: grid; place-items: center;
  color: var(--text); background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 11px;
}

.hero {
  min-height: 590px;
  position: relative;
  display: flex; align-items: end;
  overflow: hidden;
  background-image:
    linear-gradient(0deg, var(--bg) 0%, rgba(13,20,17,.22) 65%),
    linear-gradient(90deg, rgba(13,20,17,.84), transparent 72%),
    var(--hero-image, url("assets/monte-bove-fargno.jpg"));
  background-position: center, center, center 46%;
  background-size: auto, auto, cover;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line);
}
.hero-brand-logo {
  position: absolute;
  z-index: 2;
  top: clamp(26px, 4vw, 54px);
  left: 50%;
  width: min(760px, 58vw);
  max-height: 220px;
  object-fit: contain;
  transform: translateX(-50%);
  opacity: .80;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,.46));
  pointer-events: none;
  user-select: none;
}
.hero-inner { position: relative; z-index: 3; width: var(--content); margin: auto; padding: 255px 0 54px; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 6.6rem); line-height: .91; max-width: 860px; margin-bottom: 20px; letter-spacing: -.045em; }
.hero-copy { max-width: 650px; color: #e1e9e3; font-size: clamp(1rem, 1.8vw, 1.2rem); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.stat-pill { padding: 9px 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(13,20,17,.48); backdrop-filter: blur(6px); font-size: .8rem; }

.content { width: var(--content); margin: auto; padding: 42px 0 72px; }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 25px; }
.toolbar h2 { margin-bottom: 5px; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.toolbar p { color: var(--muted); margin: 0; }
.search-field { max-width: 330px; position: relative; }
.search-field input { padding-left: 42px; }
.search-field span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.events-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.event-card {
  min-height: 410px; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-solid); box-shadow: var(--shadow);
  transition: transform .22s, border-color .22s;
}
.event-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.event-cover { height: 205px; position: relative; background: linear-gradient(135deg, #31483b, #111a15); overflow: hidden; }
.event-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.event-card:hover .event-cover img { transform: scale(1.035); }
.cover-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(9,14,11,.78), transparent 70%); }
.event-date { position: absolute; left: 14px; bottom: 14px; padding: 8px 10px; background: rgba(12,18,14,.72); border: 1px solid rgba(255,255,255,.18); border-radius: 9px; font-weight: 800; font-size: .82rem; backdrop-filter: blur(5px); }
.event-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.event-location { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 850; }
.event-body h3 { margin: 8px 0 10px; font-size: 1.35rem; }
.event-body p { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.event-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 14px; }
.meta-tag { padding: 6px 8px; border-radius: 7px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: #d6ded8; font-size: .72rem; }
.event-link { appearance: none; border: 0; background: none; color: inherit; text-align: left; padding: 0; width: 100%; }

.page-banner { padding: 52px 0 28px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(127,169,144,.1), transparent); }
.page-banner-inner { width: var(--content); margin: auto; }
.back-button { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 22px; border: 0; background: none; padding: 0; }
.page-banner h1 { font-size: clamp(2.5rem, 6vw, 5.8rem); letter-spacing: -.04em; margin-bottom: 12px; }
.banner-meta { display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); }
.event-description { max-width: 790px; margin: 0 0 34px; color: var(--muted); line-height: 1.75; font-size: 1.03rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.media-card {
  position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: #101713; box-shadow: 0 12px 30px rgba(0,0,0,.24);
}
.media-card img, .media-card video { width: 100%; height: 100%; object-fit: cover; }
.media-card .media-open { border: 0; padding: 0; width: 100%; height: 100%; background: none; color: inherit; }
.media-delete {
  position: absolute; top: 9px; left: 9px; z-index: 3;
  width: 34px; height: 34px; padding: 0; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(151,42,36,.92); color: #fff;
  font-size: 1.45rem; line-height: 1; font-weight: 800;
  box-shadow: 0 5px 16px rgba(0,0,0,.35);
}
.media-delete:hover, .media-delete:focus-visible { filter: brightness(1.15); transform: scale(1.04); }
.media-type { position: absolute; right: 10px; top: 10px; padding: 6px 8px; border-radius: 8px; font-size: .68rem; background: rgba(7,11,9,.72); border: 1px solid rgba(255,255,255,.15); }
.media-caption { position: absolute; inset: auto 0 0; padding: 28px 12px 11px; background: linear-gradient(transparent, rgba(6,10,8,.88)); font-size: .78rem; text-align: left; }
.empty-state { grid-column: 1 / -1; padding: 50px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; color: var(--muted); }

.admin-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.admin-sidebar { border-right: 1px solid var(--line); background: rgba(255,255,255,.018); padding: 28px 18px; }
.admin-sidebar h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.admin-nav { display: grid; gap: 8px; }
.admin-nav button { text-align: left; border: 1px solid transparent; background: transparent; color: var(--muted); padding: 12px; border-radius: 10px; }
.admin-nav button.active, .admin-nav button:hover { color: var(--text); background: rgba(255,255,255,.055); border-color: var(--line); }
.admin-main { padding: 36px clamp(20px, 4vw, 54px) 70px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.admin-header h1 { margin-bottom: 5px; font-size: clamp(2rem,4vw,3.4rem); }
.admin-header p { margin: 0; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel h3 { margin-bottom: 18px; }
.span-2 { grid-column: span 2; }
.form-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.event-admin-list { display: grid; gap: 10px; }
.event-admin-item { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.event-admin-item small { color: var(--muted); }
.inline-actions { display: flex; gap: 8px; }
.file-drop { border: 1px dashed var(--line-strong); border-radius: 13px; padding: 22px; text-align: center; background: rgba(255,255,255,.025); }
.file-drop input { margin-top: 12px; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07); margin-top: 13px; }
.progress > span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s; }

.appearance-current {
  display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 16px; align-items: center;
}
.appearance-current img {
  width: 150px; height: 102px; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--line); background: #101713;
}
.appearance-current p { margin: 6px 0 12px; color: var(--muted); line-height: 1.5; font-size: .86rem; }
.appearance-picker-head {
  display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px;
}
.appearance-picker-head h3 { margin-bottom: 6px; }
.appearance-picker-head p { margin: 0; color: var(--muted); }
.appearance-picker-head label { min-width: min(360px, 100%); }
.appearance-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px;
}
.appearance-card {
  overflow: hidden; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.appearance-image-wrap { position: relative; aspect-ratio: 4 / 3; background: #101713; }
.appearance-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.appearance-badges {
  position: absolute; inset: 10px 10px auto; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none;
}
.appearance-badges span {
  padding: 6px 8px; border-radius: 8px; background: rgba(7,11,9,.82);
  border: 1px solid rgba(255,255,255,.2); color: var(--accent); font-size: .68rem; font-weight: 850;
  text-transform: uppercase; letter-spacing: .06em;
}
.appearance-card-body { padding: 12px; }
.appearance-card-body p {
  min-height: 38px; margin: 0 0 11px; color: var(--muted); font-size: .79rem; line-height: 1.45;
  overflow-wrap: anywhere;
}
.appearance-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.appearance-actions button { padding: 10px 9px; font-size: .75rem; }
.appearance-warning { display: block; margin-top: 14px; color: var(--accent); }

.mode-banner { padding: 10px 14px; color: #261b08; background: var(--accent); font-size: .78rem; font-weight: 800; text-align: center; }

.toast {
  position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 360px;
  background: #eef5ef; color: #111912; padding: 13px 16px; border-radius: 11px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #ffd9d4; }
.lightbox {
  width: min(1500px, 96vw); height: min(94vh, 1100px); max-width: none; max-height: none;
  padding: 0; border: 1px solid var(--line-strong); border-radius: 16px;
  background: #080c0a; color: var(--text); overflow: hidden;
}
.lightbox::backdrop { background: rgba(0,0,0,.9); backdrop-filter: blur(5px); }
.lightbox-close {
  position: absolute; z-index: 12; top: 12px; right: 12px; font-size: 1.5rem;
  background: rgba(8,12,10,.82); box-shadow: 0 5px 20px rgba(0,0,0,.45);
}
#lightbox-content { width: 100%; height: 100%; }
#lightbox-content > video { width: 100%; height: 100%; object-fit: contain; }
.video-frame { width: 100%; height: 100%; border: 0; display: block; }
.zoom-viewer {
  position: relative; width: 100%; height: 100%; overflow: hidden; display: flex;
  align-items: center; justify-content: center; background: #050706;
  cursor: zoom-in; touch-action: none; user-select: none; overscroll-behavior: contain;
}
.zoom-viewer.is-zoomed { cursor: grab; }
.zoom-viewer.is-zoomed:active { cursor: grabbing; }
.zoom-image {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; transform-origin: center center; will-change: transform;
  transition: transform .06s linear; pointer-events: none; user-select: none;
}
.zoom-viewer.is-zoomed .zoom-image { transition: none; }
.zoom-help {
  position: absolute; z-index: 4; left: 50%; bottom: 18px; transform: translateX(-50%);
  max-width: calc(100% - 250px); padding: 8px 12px; border-radius: 9px;
  background: rgba(5,8,6,.75); border: 1px solid rgba(255,255,255,.15);
  color: #edf4ee; font-size: .76rem; text-align: center; pointer-events: none;
  transition: opacity .25s;
}
.zoom-viewer.is-zoomed .zoom-help { opacity: 0; }
.zoom-controls {
  position: absolute; z-index: 5; left: 14px; bottom: 14px; display: flex; gap: 6px;
  padding: 5px; border-radius: 11px; background: rgba(5,8,6,.8);
  border: 1px solid rgba(255,255,255,.16); box-shadow: 0 5px 20px rgba(0,0,0,.35);
}
.zoom-controls button {
  min-width: 38px; height: 36px; padding: 0 9px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08);
  color: #fff; font: inherit; font-weight: 800;
}
.zoom-controls button[data-zoom-value] { min-width: 64px; font-size: .76rem; }
.zoom-controls button:hover, .zoom-controls button:focus-visible { background: rgba(255,255,255,.16); }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 42vh; }
  .login-panel { min-height: auto; border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .events-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .admin-sidebar h2 { display: none; }
  .admin-nav { display: flex; overflow-x: auto; }
  .admin-nav button { white-space: nowrap; }
  .appearance-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  :root { --content: min(100% - 24px, 1180px); }
  .login-visual { min-height: 36vh; padding: 28px 20px; }
  .login-visual h1 { font-size: 3.3rem; }
  .login-panel { padding: 32px 20px; }
  .appearance-picker-head { align-items: stretch; flex-direction: column; }
  .appearance-picker-head label { min-width: 0; width: 100%; }
  .appearance-grid { grid-template-columns: 1fr; }
  .appearance-current { grid-template-columns: 110px minmax(0,1fr); }
  .appearance-current img { width: 110px; height: 82px; }
  .appearance-actions { grid-template-columns: 1fr; }
  .topbar-inner { min-height: 64px; }
  .topbar .brand-mark span:last-child { display: none; }
  .user-chip { display: none; }
  .hero { min-height: 530px; }
  .hero-brand-logo {
    top: 24px;
    width: min(92vw, 620px);
    max-height: 180px;
    opacity: .82;
  }
  .hero-inner { padding: 205px 0 38px; }
  .hero h1 { font-size: 3rem; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { max-width: none; }
  .events-grid, .gallery-grid, .admin-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .event-card { min-height: 370px; }
  .form-row { grid-template-columns: 1fr; }
  .admin-main { padding: 26px 14px 60px; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .event-admin-item { grid-template-columns: 1fr; }
}

/* Accesso selettivo agli eventi */
.access-list { display: grid; gap: 10px; }
.access-user {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px;
  padding: 13px; border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255,255,255,.025); cursor: pointer;
}
.access-user:hover { border-color: var(--line-strong); background: rgba(255,255,255,.045); }
.access-user input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.access-user span { display: grid; gap: 3px; }
.access-user small { color: var(--muted); }
.access-summary { display: grid; gap: 14px; }
.access-summary .meta-tag { justify-self: start; }
.access-summary > strong { font-size: 1.25rem; }
.access-summary p, .privacy-note p { color: var(--muted); line-height: 1.65; margin: 0; }
.privacy-note { margin-top: 24px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: rgba(255,255,255,.025); }
.privacy-note strong { display: block; margin-bottom: 7px; }
.empty-state.compact { padding: 24px 16px; }

/* v1.3 - inviti partecipanti */
.field-note { color: var(--muted); font-weight: 400; }
.field-title { display: block; margin-bottom: 10px; }
.invite-event-list { max-height: 285px; overflow: auto; padding-right: 4px; }
.invite-actions { display: grid; gap: 10px; }
.invite-actions button { width: 100%; }
.panel-help { margin: 16px 0 0; color: var(--muted); line-height: 1.55; font-size: .92rem; }
@media (min-width: 720px) {
  .invite-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* v1.5 - contributi degli utenti agli album */
.event-upload-panel {
  margin-top: 38px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  display: grid;
  grid-template-columns: minmax(230px, .75fr) minmax(320px, 1.25fr);
  gap: 28px;
  align-items: start;
}
.event-upload-copy h2 { margin: 5px 0 10px; }
.event-upload-copy p:last-child { color: var(--muted); line-height: 1.65; }
.event-upload-form .file-drop { margin: 0; }
.media-owner {
  position: absolute;
  right: 9px;
  top: 48px;
  z-index: 2;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(8, 20, 15, .82);
  color: #fff;
  font-size: .63rem;
  font-weight: 800;
  letter-spacing: .07em;
}
@media (max-width: 760px) {
  .event-upload-panel { grid-template-columns: 1fr; padding: 18px; }
}

@media (max-width: 640px) {
  .lightbox { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .zoom-help { bottom: 70px; max-width: calc(100% - 28px); font-size: .72rem; }
  .zoom-controls { left: 50%; bottom: 14px; transform: translateX(-50%); }
}

/* v1.7 - identità partecipanti e inviti telefonici */
.identity-preview {
  display: grid;
  gap: 5px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.identity-preview strong { color: var(--text); font-size: 1.08rem; }
.identity-preview span { color: var(--muted); }
.invite-status, .invite-error { display: grid; gap: 14px; justify-items: start; }
.invite-status { justify-items: center; text-align: center; padding: 36px 0; color: var(--muted); }
.invite-error p { color: var(--muted); line-height: 1.6; }
.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255,255,255,.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.inline-link { display: inline-block; text-decoration: none; }
.profile-logout { width: 100%; margin-top: 12px; }
.access-user strong { overflow-wrap: anywhere; }
.access-user small { overflow-wrap: anywhere; line-height: 1.35; }

.app-version { margin-top: 12px; text-align: center; color: var(--muted); font-size: .78rem; opacity: .8; }

/* v1.8.0 - consultazione e download pubblici; login richiesto solo per contribuire */
.guest-chip {
  color: var(--muted);
  font-size: .82rem;
  padding: 8px 10px;
}
.login-button { padding: 9px 14px; }
.public-return { width: 100%; margin-top: 10px; }
.public-contribute-callout {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.03);
}
.public-contribute-callout span { color: var(--muted); line-height: 1.55; }
.public-contribute-callout .primary-button { justify-self: start; }
.media-download {
  position: absolute; top: 9px; left: 9px; z-index: 3;
  width: 34px; height: 34px; padding: 0; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(12,25,19,.9); color: #fff;
  font-size: 1.25rem; line-height: 1; font-weight: 900;
  box-shadow: 0 5px 16px rgba(0,0,0,.35);
}
.media-download.with-delete { left: 51px; }
.media-download:hover, .media-download:focus-visible { filter: brightness(1.2); transform: scale(1.04); }
@media (max-width: 640px) {
  .guest-chip { display: none; }
  .login-button { padding: 9px 12px; }
}


.image-optimization-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.image-optimization-panel > div:first-child { max-width: 760px; }
.image-optimization-panel p { color: var(--muted); line-height: 1.65; }
.optimization-actions {
  min-width: 250px;
  display: grid;
  gap: 10px;
  justify-items: stretch;
}
.optimization-status {
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}
@media (max-width: 760px) {
  .image-optimization-panel { align-items: stretch; flex-direction: column; }
  .optimization-actions { min-width: 0; }
  .brand-logo { width: 42px; height: 42px; flex-basis: 42px; }
}

/* v1.9.3 — protezione contro il caricamento involontario degli originali */
.media-card-unoptimized { background: linear-gradient(145deg, #18231d, #0d1410); }
.media-card-unoptimized .media-open { cursor: default; }
.media-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 28px; text-align: center; color: var(--muted);
  background: radial-gradient(circle at 50% 35%, rgba(229,174,64,.10), transparent 48%);
}
.media-placeholder-icon { color: var(--accent); font-size: 2.2rem; line-height: 1; transform: rotate(-14deg); }
.media-placeholder strong { color: var(--text); font-size: .86rem; }
.media-placeholder small { max-width: 230px; font-size: .72rem; line-height: 1.45; }


/* v1.9.4 — invito al login compatto per i visitatori */
.public-contribute-panel {
  margin: 38px auto 0;
  max-width: 520px;
}
.public-contribute-panel .public-contribute-callout {
  justify-items: center;
  text-align: center;
  padding: 20px 22px;
}
.public-contribute-panel .public-contribute-callout .primary-button {
  justify-self: center;
}


/* v1.10.0 — video esterni multipiattaforma */
.event-contribution-forms { display: grid; gap: 18px; }
.external-video-add {
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); overflow: hidden;
}
.external-video-add summary {
  cursor: pointer; padding: 13px 14px; color: var(--accent); font-weight: 800; user-select: none;
}
.external-video-add[open] summary { border-bottom: 1px solid var(--line); }
.external-video-add form { padding: 15px; }
.external-video-help { display: block; margin-top: -3px; color: var(--muted); line-height: 1.5; }
.media-card-external-video .media-open { cursor: pointer; }
.external-video-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 26px; text-align: center; color: var(--muted);
  background: radial-gradient(circle at 50% 42%, rgba(229,174,64,.16), transparent 44%), linear-gradient(145deg,#18231d,#0d1410);
}
.external-video-play {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: #111; font-size: 1.35rem; padding-left: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.external-video-placeholder strong { color: var(--text); font-size: .9rem; }
.external-video-placeholder small { max-width: 230px; line-height: 1.4; }

/* v1.11.0 — dashboard statistiche amministratore */
.analytics-header { align-items: flex-start; gap: 24px; }
.analytics-live {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
  color: var(--text); font-size: .82rem; font-weight: 800; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025);
}
.analytics-live small { width: 100%; color: var(--muted); font-size: .68rem; text-align: right; font-weight: 500; }
.analytics-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.analytics-kpi {
  border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
}
.analytics-kpi span { color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.analytics-kpi strong { display: block; margin: 8px 0 3px; color: var(--accent); font-size: clamp(1.55rem, 3vw, 2.35rem); line-height: 1; }
.analytics-kpi small { color: var(--muted); font-size: .72rem; }
.analytics-grid-main { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(300px,.8fr); gap: 18px; margin-bottom: 18px; }
.analytics-panel {
  margin-bottom: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(255,255,255,.025); box-shadow: 0 12px 30px rgba(0,0,0,.10);
}
.analytics-panel h2 { margin: 3px 0 0; font-size: 1.2rem; }
.analytics-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.analytics-chart { height: 230px; display: flex; align-items: flex-end; gap: 4px; padding: 16px 8px 4px; border-top: 1px solid var(--line); }
.analytics-bar-item { flex: 1 1 0; min-width: 4px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.analytics-bar { width: min(18px,90%); min-height: 2px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent), rgba(229,174,64,.38)); }
.analytics-bar-item span { color: var(--muted); font-size: .56rem; transform: rotate(-52deg); transform-origin: center; white-space: nowrap; margin-bottom: -13px; }
.storage-numbers { display: grid; gap: 10px; margin: 16px 0; }
.storage-numbers div { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.storage-numbers span { color: var(--muted); font-size: .78rem; }
.storage-numbers strong { color: var(--text); }
.storage-meter { height: 12px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07); margin: 14px 0 9px; }
.storage-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #f4c760); }
.storage-panel > small { color: var(--muted); line-height: 1.5; }
.analytics-table-wrap { overflow-x: auto; }
.analytics-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.analytics-table th, .analytics-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.analytics-table th { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; }
.analytics-table td { font-size: .79rem; }
.analytics-table td small { display: block; max-width: 380px; margin-top: 3px; color: var(--muted); line-height: 1.35; }
.architecture-panel { overflow: hidden; }
.architecture-roles, .data-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: stretch; margin: 18px 0; }
.architecture-role, .flow-node { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.architecture-role strong, .flow-node strong { color: var(--accent); font-size: .9rem; }
.architecture-role span, .flow-node span { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.architecture-role.public { border-color: rgba(99,160,255,.28); }
.architecture-role.user { border-color: rgba(107,194,112,.28); }
.architecture-role.admin { border-color: rgba(229,174,64,.45); }
.flow-arrow { display: grid; place-items: center; color: var(--accent); font-size: 1.5rem; font-weight: 900; }
.data-flow { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; }
.tracking-flow { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding: 14px; border-radius: 14px; background: rgba(229,174,64,.055); }
.tracking-flow span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: .72rem; }
.tracking-flow b { color: var(--accent); }
.analytics-privacy { margin: 16px 0 0; }
.media-cover-button {
  position: absolute; left: 10px; top: 10px; z-index: 4; display: grid; place-items: center;
  width: 34px; height: 34px; border: 1px solid rgba(229,174,64,.55); border-radius: 50%;
  background: rgba(7,13,9,.84); color: var(--accent); cursor: pointer; font-size: 1rem;
  backdrop-filter: blur(6px);
}
.media-cover-button:hover, .media-cover-button.active { background: var(--accent); color: #111; }

@media (max-width: 1100px) {
  .analytics-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .analytics-grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .analytics-header { flex-direction: column; }
  .analytics-live { justify-content: flex-start; }
  .analytics-live small { text-align: left; }
  .analytics-kpis { grid-template-columns: 1fr 1fr; }
  .analytics-chart { height: 190px; overflow-x: auto; align-items: flex-end; }
  .analytics-bar-item { min-width: 18px; }
  .architecture-roles, .data-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); min-height: 22px; }
}
@media (max-width: 480px) {
  .analytics-kpis { grid-template-columns: 1fr; }
}


/* v1.12.0 — Storage ibrido Supabase + Cloudflare R2 */
.storage-subtitle { margin: 1.1rem 0 .55rem; font-size: .98rem; }
.r2-meter span { background: linear-gradient(90deg, #d59a25, #f5c85c); }
.r2-migration-panel { border-color: rgba(245, 190, 70, .28); }
.analytics-kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* v1.12.1 - fix sovrapposizione controlli galleria admin */
.media-card:has(.media-cover-button) .media-delete { left: 51px; }
.media-card:has(.media-cover-button) .media-download.with-delete { left: 93px; }


/* v1.13.2 - pulsanti report */
.report-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.report-actions .primary-button,.report-actions .secondary-button{white-space:nowrap}

/* Sentieri & Vette v1.14.0 - condivisioni private */
.share-warning,
.share-inline-error {
  border: 1px solid rgba(232, 187, 76, .35);
  background: rgba(232, 187, 76, .10);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  line-height: 1.55;
}

.share-inline-error {
  border-color: rgba(226, 92, 92, .45);
  background: rgba(226, 92, 92, .10);
}

.share-scope-fieldset {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.share-scope-fieldset legend {
  padding: 0 8px;
  color: var(--muted);
  font-size: .9rem;
}

.share-scope-fieldset label,
.share-media-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-scope-fieldset input,
.share-media-check input {
  width: auto;
  flex: 0 0 auto;
}

.share-media-selection {
  display: grid;
  gap: 10px;
}

.share-media-selection[hidden] {
  display: none;
}

.share-media-checklist {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  display: grid;
  gap: 4px;
}

.share-media-check {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}

.share-media-check span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-media-check small {
  color: var(--muted);
}

.share-link-result {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  display: grid;
  gap: 10px;
}

.share-link-result > span {
  color: var(--muted);
  line-height: 1.5;
}

.share-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.share-security-notes {
  color: var(--muted);
  line-height: 1.65;
}

.share-security-notes strong {
  color: var(--text);
}

.share-admin-list {
  display: grid;
  gap: 10px;
}

.share-admin-item {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}

.share-admin-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.share-admin-main small {
  color: var(--muted);
}

.share-admin-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.share-status.active {
  background: rgba(91, 184, 129, .14);
  color: #9ee1b8;
}

.share-status.expired {
  background: rgba(232, 187, 76, .13);
  color: #edd78f;
}

.share-status.revoked {
  background: rgba(226, 92, 92, .13);
  color: #f0aaaa;
}

.share-page-shell {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(202, 167, 71, .10), transparent 34%),
    linear-gradient(150deg, #111b17, #17251f 58%, #101815);
}

.share-access-card {
  width: min(520px, 100%);
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(18, 29, 24, .92);
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}

.share-access-card h1 {
  margin: 6px 0 10px;
}

.share-access-card > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.share-brand-logo {
  width: min(320px, 88%);
  height: auto;
  margin-bottom: 26px;
}

.share-home-link {
  display: inline-flex;
  margin-top: 16px;
  text-decoration: none;
}

.share-brand-static {
  cursor: default;
}

.share-content {
  padding-top: clamp(30px, 5vw, 64px);
}

.share-event-header {
  max-width: 900px;
  margin-bottom: 32px;
}

.share-event-header h1 {
  margin: 4px 0 14px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: .98;
}

.share-event-header > p:not(.eyebrow):not(.share-expiry) {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.7;
}

.share-expiry,
.share-footer-note {
  color: var(--muted);
  font-size: .88rem;
}

.share-gallery {
  margin-top: 28px;
}

.share-media-card .media-download {
  right: 10px;
}

.share-footer-note {
  padding: 28px 0 10px;
  text-align: center;
}

@media (max-width: 720px) {
  .share-link-row {
    grid-template-columns: 1fr;
  }

  .share-admin-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .share-page-shell {
    padding: 16px;
  }
}

/* Sentieri & Vette v1.14.1 - gestione duplicati upload */
.duplicate-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 10, 12, 0.82);
  backdrop-filter: blur(6px);
}
.duplicate-dialog {
  width: min(720px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: #10191b;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.duplicate-dialog h2 { margin-top: 4px; }
.duplicate-file-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}
.duplicate-file-list li {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 3px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.055);
}
.duplicate-file-list strong { overflow-wrap: anywhere; }
.duplicate-file-list span { opacity: .8; font-size: .88rem; }
.duplicate-file-list small { grid-column: 1 / -1; opacity: .62; }
.duplicate-note { font-size: .92rem; opacity: .8; }
.duplicate-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
@media (max-width: 640px) {
  .duplicate-dialog { padding: 18px; }
  .duplicate-dialog-actions { display: grid; grid-template-columns: 1fr; }
  .duplicate-dialog-actions button { width: 100%; }
}

/* v1.15.0 — escursioni pianificate, Komoot/GPX, adesioni e suggerimenti */
.home-section-heading { margin: 46px 0 18px; }
.home-section-heading h2 { margin-bottom: 8px; }
.home-section-heading p:last-child { color: var(--muted); }
.planned-events-grid { margin-bottom: 18px; }
.event-route-section,
.route-panel,
.poi-section,
.weather-section,
.participation-section,
.comments-section,
.event-portal-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
  margin-bottom: 24px;
}
.section-heading { margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 8px; }
.section-heading p:last-child { color: var(--muted); }
.event-portal-content { padding-top: 30px; padding-bottom: 56px; }
.event-portal-hero h1 { font-size: clamp(2.1rem, 5vw, 4.4rem); margin-bottom: 14px; }
.event-portal-hero > p:not(.eyebrow) { color: var(--muted); line-height: 1.75; max-width: 900px; }
.event-portal-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.komoot-embed { width: 100%; min-height: 700px; border: 0; border-radius: 14px; background: var(--bg-soft); }
.poi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.poi-card { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-small); background: rgba(255,255,255,.035); }
.poi-card h3 { margin: 0 0 6px; font-size: 1rem; }
.poi-card p { color: var(--muted); line-height: 1.55; margin: 0; font-size: .9rem; }
.poi-number { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 30px; color: var(--bg); background: var(--accent); font-weight: 900; }
.participant-count { border-color: rgba(217,164,65,.45); }
.compact-form { max-width: 720px; }
.comment-list { display: grid; gap: 12px; margin: 16px 0 24px; }
.comment-card { padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius-small); background: rgba(255,255,255,.03); }
.comment-card p { margin: 7px 0; line-height: 1.6; }
.comment-card small { color: var(--muted); }
.comment-author { font-weight: 850; color: var(--accent); }
.gpx-map { height: 420px; border-radius: 14px; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--line); }
.gpx-profile { margin-top: 14px; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.025); border: 1px solid var(--line); padding: 12px; color: var(--accent); }
.elevation-svg { width: 100%; height: auto; min-height: 180px; display: block; }
.elevation-svg text { fill: var(--muted); font-size: 20px; }
.leaflet-container { font-family: inherit; }
.registration-summary { margin: 18px 0; color: var(--muted); }
.registration-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-small); }
.registration-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.registration-table th, .registration-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.registration-table th { color: var(--accent); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.registration-table td { color: var(--text); }
.registration-table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 760px) {
  .komoot-embed { min-height: 580px; }
  .gpx-map { height: 340px; }
  .event-portal-actions { display: grid; }
  .event-portal-actions > * { width: 100%; justify-content: center; text-align: center; }
}


/* v1.15.2 — meteo Windy per escursioni */
.weather-section { overflow: hidden; }
#event-weather-body { display: grid; gap: 14px; }
.weather-card { border: 1px solid var(--line); border-radius: var(--radius-small); background: rgba(255,255,255,.035); padding: 18px; }
.weather-card-heading { display: flex; gap: 14px; justify-content: space-between; align-items: start; margin-bottom: 16px; }
.weather-card-heading h3 { margin: 2px 0 0; }
.compact-button { padding: 8px 12px; min-height: auto; font-size: .84rem; }
.weather-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.weather-metrics > div { border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 12px; padding: 12px; display: grid; gap: 5px; }
.weather-metrics span { color: var(--muted); font-size: .78rem; }
.weather-metrics strong { font-size: 1.05rem; }
.weather-source-note { margin: 4px 2px 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
@media (max-width: 640px) {
  .weather-card-heading { display: grid; }
  .weather-card-heading .compact-button { width: 100%; text-align: center; justify-content: center; }
}

/* v1.15.9 — riepilogo escursione ad alta rilevanza */
.page-banner { padding-bottom: 38px; }
.page-banner-inner { width: var(--content); }
.page-banner .event-overview-layout { margin-top: 26px; }
.event-detail-content { padding-top: 28px; }
.event-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: stretch;
}
.event-facts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.event-fact-card,
.event-difficulty-card {
  min-height: 112px;
  border: 1px solid rgba(144, 189, 153, .32);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(37, 70, 49, .34), rgba(14, 26, 20, .58));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.event-fact-card {
  display: grid;
  grid-template-columns: 54px minmax(0,1fr);
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
}
.event-fact-card > div { min-width: 0; }
.event-fact-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #a7d77e;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.event-fact-clock { font-size: 2.35rem; }
.event-fact-label {
  display: block;
  color: #abc3ad;
  font-size: .88rem;
  font-weight: 800;
  margin-bottom: 5px;
}
.event-fact-card strong {
  display: block;
  color: #f5f8f5;
  font-size: clamp(1.15rem, 2vw, 1.72rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.event-fact-map {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(129, 226, 97, .55);
  background: linear-gradient(180deg, rgba(64, 174, 66, .9), rgba(38, 132, 49, .9));
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(21, 94, 36, .26);
}
.event-fact-map:hover { filter: brightness(1.08); transform: translateY(-1px); }
.event-fact-empty { color: var(--muted); font-size: 1.2rem; }
.event-difficulty-card {
  border-color: rgba(228, 173, 57, .82);
  background: linear-gradient(145deg, rgba(93, 70, 18, .42), rgba(36, 31, 16, .7));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  box-shadow: inset 0 0 0 1px rgba(228, 173, 57, .16), 0 10px 26px rgba(0,0,0,.18);
}
.event-difficulty-icon { color: #e5ae39; font-size: 2.4rem; line-height: 1; margin-bottom: 5px; }
.event-difficulty-card .event-fact-label { color: #d3d9cf; }
.event-difficulty-card strong { color: #f1b53d; font-size: 3rem; line-height: .95; letter-spacing: .02em; }
.event-description-feature {
  margin: 34px 0 30px;
  padding: 28px 4px 4px;
  border-top: 2px solid rgba(149, 201, 141, .72);
  background: transparent;
}
.event-description-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.event-description-heading h2 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.55rem); }
.event-description-icon { color: #9fd17d; font-size: 2rem; font-weight: 900; }
.event-description-feature p {
  margin: 0;
  max-width: 1120px;
  color: #e4eae5;
  line-height: 1.72;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
}
.event-portal-hero {
  background: linear-gradient(180deg, rgba(22, 47, 31, .54), rgba(17, 28, 22, .78));
  border-color: rgba(128, 171, 139, .3);
}
.event-portal-hero h1 { margin-bottom: 24px; }
.event-portal-hero > .event-description-feature { margin-bottom: 20px; }
.event-portal-actions { align-items: center; }
.event-portal-actions .participant-count { margin-right: auto; padding: 9px 12px; font-size: .78rem; }

@media (max-width: 980px) {
  .event-overview-layout { grid-template-columns: 1fr; }
  .event-facts-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .event-difficulty-card { min-height: 104px; flex-direction: row; gap: 15px; }
  .event-difficulty-icon { margin: 0; }
  .event-difficulty-card .event-fact-label { margin: 0; }
  .event-difficulty-card strong { font-size: 2.35rem; }
}
@media (max-width: 640px) {
  .page-banner { padding-top: 34px; }
  .page-banner h1, .event-portal-hero h1 { font-size: clamp(2.15rem, 12vw, 3.65rem); }
  .event-facts-grid { grid-template-columns: 1fr; gap: 10px; }
  .event-fact-card { min-height: 92px; grid-template-columns: 44px minmax(0,1fr); padding: 14px 15px; gap: 10px; }
  .event-fact-icon { width: 40px; height: 40px; font-size: 1.65rem; }
  .event-fact-card strong { font-size: 1.25rem; }
  .event-description-feature { margin-top: 26px; padding-top: 22px; }
}

/* v1.16.0 — header evento più compatto + copertina */
.page-banner { padding: 34px 0 24px; }
.page-banner .event-overview-layout { margin-top: 16px; }
.page-banner h1,
.event-portal-hero h1,
.share-event-header h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  margin: 0 0 16px;
}
.event-heading-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.event-heading-grid.has-cover {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
}
.event-heading-copy { min-width: 0; }
.event-cover-feature {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(150, 191, 157, .28);
  background: rgba(255,255,255,.03);
  box-shadow: 0 14px 34px rgba(0,0,0,.24);
}
.event-cover-feature img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.event-cover-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(4,10,7,.28));
  pointer-events: none;
}
.event-overview-layout {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}
.event-facts-grid { gap: 9px; }
.event-fact-card,
.event-difficulty-card {
  min-height: 70px;
  border-radius: 13px;
}
.event-fact-card {
  grid-template-columns: 32px minmax(0,1fr);
  gap: 9px;
  padding: 10px 12px;
}
.event-fact-icon {
  width: 30px; height: 30px;
  font-size: 1.25rem;
}
.event-fact-clock { font-size: 1.4rem; }
.event-fact-label {
  font-size: .72rem;
  margin-bottom: 2px;
}
.event-fact-card strong {
  font-size: clamp(.92rem, 1.25vw, 1.12rem);
  line-height: 1.12;
}
.event-fact-map {
  padding: 6px 9px;
  border-radius: 10px;
  font-size: .82rem;
  gap: 5px;
}
.event-fact-empty { font-size: .95rem; }
.event-difficulty-card { padding: 10px; }
.event-difficulty-icon { font-size: 1.45rem; margin-bottom: 1px; }
.event-difficulty-card strong { font-size: 1.8rem; }
.event-description-feature {
  margin: 24px 0 24px;
  padding-top: 20px;
}
.event-description-heading { margin-bottom: 11px; gap: 10px; }
.event-description-heading h2 { font-size: clamp(1.45rem, 2.2vw, 1.9rem); }
.event-description-icon { font-size: 1.45rem; }
.event-description-feature p { font-size: 1rem; line-height: 1.65; }
.event-portal-hero { padding: 26px; }
.event-portal-hero > .event-description-feature { margin-bottom: 16px; }
.share-event-header.event-portal-hero { max-width: none; }

/* Selettore copertina in amministrazione */
.event-cover-picker {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px;
  display: grid;
  gap: 12px;
  background: rgba(255,255,255,.018);
}
.event-cover-picker-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.event-cover-picker-heading strong { display: block; margin-bottom: 3px; }
.event-cover-picker-heading small { color: var(--muted); display: block; }
.cover-current-preview,
.cover-selected-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  background: rgba(255,255,255,.02);
}
.cover-current-preview img,
.cover-selected-preview img {
  width: 112px;
  height: 72px;
  object-fit: cover;
  border-radius: 9px;
}
.cover-current-preview span,
.cover-selected-preview strong,
.cover-selected-preview small { display: block; }
.cover-selected-preview small { color: var(--muted); margin-top: 3px; }
.cover-selected-preview .compact-button { margin-left: auto; }
.cover-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.cover-suggestion {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  color: inherit;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}
.cover-suggestion:hover,
.cover-suggestion.selected { border-color: rgba(226,172,56,.85); transform: translateY(-1px); }
.cover-suggestion img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.cover-suggestion-copy { display: block; padding: 8px 9px 9px; }
.cover-suggestion-copy strong { display: block; font-size: .82rem; line-height: 1.25; }
.cover-suggestion-copy small { display: block; color: var(--muted); font-size: .68rem; margin-top: 3px; line-height: 1.25; }
.compact-cover-upload { margin-top: 2px; }

@media (max-width: 980px) {
  .event-heading-grid.has-cover { grid-template-columns: 1fr; }
  .event-cover-feature { max-width: 520px; }
  .event-overview-layout { grid-template-columns: 1fr; }
  .event-difficulty-card { min-height: 66px; flex-direction: row; gap: 9px; }
  .event-difficulty-card strong { font-size: 1.55rem; }
  .cover-suggestion-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .page-banner { padding-top: 26px; }
  .page-banner h1,
  .event-portal-hero h1,
  .share-event-header h1 { font-size: clamp(1.75rem, 9vw, 2.5rem); }
  .event-facts-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .event-fact-card { min-height: 64px; grid-template-columns: 26px minmax(0,1fr); padding: 9px; gap: 7px; }
  .event-fact-icon { width: 25px; height: 25px; font-size: 1.05rem; }
  .event-fact-card strong { font-size: .9rem; }
  .event-fact-map { font-size: .75rem; padding: 5px 7px; }
  .event-cover-picker-heading { display: grid; }
  .cover-suggestion-grid { grid-template-columns: 1fr 1fr; }
  .cover-current-preview img,
  .cover-selected-preview img { width: 86px; height: 58px; }
}


/* v1.16.1 - partecipanti nella scheda Modifica escursione */
.event-editor-registrations { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.event-editor-registrations-head { display:flex; gap:16px; align-items:flex-end; justify-content:space-between; margin-bottom:14px; }
.event-editor-registrations-head h3 { margin:0 0 4px; }
.event-editor-registrations-head p { margin:0; color:var(--muted); font-size:.9rem; }
@media (max-width: 760px) { .event-editor-registrations-head { align-items:flex-start; flex-direction:column; } }


/* v1.16.2 — formattazione descrizione percorso */
.description-editor { display: grid; gap: 8px; }
.description-format-toolbar { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.description-format-toolbar .compact-button { min-width: 42px; padding: 7px 10px; }
.event-description-body { max-width: 1120px; color: #e4eae5; font-size: 1rem; line-height: 1.65; }
.event-description-body p { margin: 0 0 1em; max-width: none; color: inherit; font-size: inherit; line-height: inherit; }
.event-description-body p:last-child { margin-bottom: 0; }
.event-description-body ul, .event-description-body ol { margin: .35em 0 1em 1.35em; padding-left: .9em; }
.event-description-body li { margin: .28em 0; padding-left: .15em; }
.event-description-body strong { color: #fff; font-weight: 800; }
.event-description-body em { color: #f0f3ef; }


/* v1.16.3 — Markdown controllato nella descrizione evento */
.event-description-markdown > :first-child { margin-top: 0; }
.event-description-markdown > :last-child { margin-bottom: 0; }
.event-description-markdown p { margin: 0 0 1rem; line-height: 1.7; }
.event-description-markdown .event-md-heading { color: var(--text, #f2f4ef); line-height: 1.25; margin: 1.45rem 0 .65rem; font-weight: 750; }
.event-description-markdown .event-md-h1 { font-size: clamp(1.55rem, 2.1vw, 2rem); }
.event-description-markdown .event-md-h2 { font-size: clamp(1.3rem, 1.8vw, 1.65rem); }
.event-description-markdown .event-md-h3 { font-size: clamp(1.15rem, 1.5vw, 1.35rem); color: #dfe9da; }
.event-description-markdown .event-md-h4 { font-size: 1.05rem; color: #dfe9da; }
.event-description-markdown .event-md-separator { border: 0; border-top: 1px solid rgba(174, 211, 155, .38); margin: 1.5rem 0; }
.event-description-markdown .event-md-list { margin: .45rem 0 1rem 1.55rem; padding-left: .55rem; }
.event-description-markdown .event-md-list li { margin: .35rem 0; padding-left: .2rem; line-height: 1.6; }
.event-description-markdown strong { color: #fff; font-weight: 760; }
.event-description-markdown em { color: #dbe8d4; }


/* v1.16.4 — descrizioni Markdown e anteprime home */
.event-card-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 0;
  line-height: 1.55;
}

.event-description-markdown {
  max-width: 1080px;
}
.event-description-markdown p {
  margin: 0 0 1.15rem;
  line-height: 1.72;
}
.event-description-markdown .event-md-heading {
  letter-spacing: -0.01em;
}
.event-description-markdown .event-md-h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.15rem);
  margin: 1.65rem 0 .8rem;
}
.event-description-markdown .event-md-h2 {
  font-size: clamp(1.5rem, 2vw, 1.85rem);
  margin: 1.6rem 0 .75rem;
  color: #f2f4ef;
}
.event-description-markdown .event-md-h3 {
  font-size: clamp(1.28rem, 1.65vw, 1.5rem);
  margin: 1.45rem 0 .65rem;
  color: #dfe9da;
}
.event-description-markdown .event-md-h4 {
  font-size: clamp(1.08rem, 1.35vw, 1.22rem);
  margin: 1.25rem 0 .45rem;
  color: #eef3eb;
  font-weight: 760;
}
.event-description-markdown .event-md-separator {
  margin: 1.7rem 0;
  border-top-color: rgba(174, 211, 155, .5);
}
.event-description-markdown strong {
  color: #fff;
  font-weight: 820;
}
@media (max-width: 680px) {
  .event-description-markdown .event-md-h2 { font-size: 1.32rem; }
  .event-description-markdown .event-md-h3 { font-size: 1.18rem; }
  .event-description-markdown .event-md-h4 { font-size: 1.05rem; }
  .event-description-markdown p { line-height: 1.62; }
}


/* v1.16.5 — editor visuale rich text descrizione */
.description-editor-label { font-weight: 700; color: var(--text); }
.description-rich-editor {
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid rgba(193, 211, 195, .28);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  padding: 16px 18px;
  line-height: 1.62;
  outline: none;
}
.description-rich-editor:focus { border-color: rgba(225,171,48,.82); box-shadow: 0 0 0 2px rgba(225,171,48,.12); }
.description-rich-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.description-rich-editor p { margin: 0 0 .9rem; }
.description-rich-editor h2 { margin: 1.2rem 0 .55rem; font-size: 1.45rem; line-height: 1.25; }
.description-rich-editor h3 { margin: 1.05rem 0 .5rem; font-size: 1.23rem; line-height: 1.3; }
.description-rich-editor h4 { margin: .95rem 0 .45rem; font-size: 1.08rem; line-height: 1.35; }
.description-rich-editor ul, .description-rich-editor ol { margin: .35rem 0 1rem 1.5rem; }
.description-rich-editor hr { border: 0; border-top: 1px solid rgba(174,211,155,.38); margin: 1.25rem 0; }
.description-rich-editor strong { font-weight: 800; color: #fff; }
.event-description-rich > :first-child { margin-top: 0; }
.event-description-rich > :last-child { margin-bottom: 0; }
.event-description-rich p { margin: 0 0 1rem; line-height: 1.7; }
.event-description-rich h2 { margin: 1.5rem 0 .65rem; font-size: clamp(1.45rem,2vw,1.85rem); line-height:1.25; }
.event-description-rich h3 { margin: 1.3rem 0 .58rem; font-size: clamp(1.22rem,1.65vw,1.5rem); line-height:1.3; }
.event-description-rich h4 { margin: 1.12rem 0 .5rem; font-size: clamp(1.06rem,1.4vw,1.25rem); line-height:1.35; color:#e4ece0; }
.event-description-rich ul, .event-description-rich ol { margin: .4rem 0 1rem 1.6rem; padding-left: .55rem; }
.event-description-rich li { margin: .35rem 0; line-height: 1.6; }
.event-description-rich hr { border:0; border-top:1px solid rgba(174,211,155,.4); margin:1.5rem 0; }
.event-description-rich strong { color:#fff; font-weight:800; }
.event-description-rich em { color:#dbe8d4; }


/* v1.16.6 — previsione meteo oraria 00-24 */
.weather-hourly-card { border: 1px solid var(--line); border-radius: var(--radius-small); background: rgba(255,255,255,.035); padding: 18px; overflow: hidden; }
.weather-hourly-card .weather-card-heading p { margin: 4px 0 0; color: var(--muted); }
.weather-day-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.weather-day-summary span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: .82rem; }
.weather-day-summary strong { color: var(--text); margin-left: 4px; }
.weather-hourly-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.12); }
.weather-hourly-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; font-size: .84rem; }
.weather-hourly-table th, .weather-hourly-table td { padding: 9px 8px; text-align: center; border-right: 1px solid rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.06); }
.weather-hourly-table thead th { position: sticky; top: 0; background: #17231d; color: var(--text); font-weight: 800; }
.weather-hourly-table th:first-child { position: sticky; left: 0; z-index: 2; width: 112px; text-align: left; background: #17231d; color: var(--muted); }
.weather-hourly-table thead th:first-child { z-index: 3; }
.weather-hourly-table tr:last-child th, .weather-hourly-table tr:last-child td { border-bottom: 0; }
.weather-hourly-table td:last-child, .weather-hourly-table th:last-child { border-right: 0; }
.weather-icon-cell { font-size: 1.25rem; }
.weather-cell-warning { background: rgba(238,174,45,.16); color: #ffd877; font-weight: 800; }
.weather-cell-alert { background: rgba(223,82,70,.2); color: #ffb0a7; font-weight: 900; }
.weather-resolution-note { color: var(--muted); font-size: .78rem; margin: 10px 2px 0; }
.compact-public-info { padding-bottom: 4px; }
@media (max-width: 720px) {
  .weather-hourly-card { padding: 13px; }
  .weather-hourly-table { min-width: 720px; font-size: .8rem; }
  .weather-hourly-table th, .weather-hourly-table td { padding: 8px 6px; }
}
