:foot{
  --bg: #f7f8fb;
  --bg2:#ffffff;
  --text:#0b1220;
  --muted:#6b7280;
  --border: rgba(15,23,42,.10);
  --shadow: 0 18px 50px rgba(2,6,23,.10);
  --shadow2: 0 10px 25px rgba(2,6,23,.08);
  --radius: 18px;

  /* ✅ ROSSO + ORO */
  --brand:#b91c1c;
  --brand2:#d4af37;

  --focus: rgba(185,28,28,.30);
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 450px at 20% 10%, rgba(185,28,28,.12), transparent 55%),
    radial-gradient(900px 450px at 85% 15%, rgba(212,175,55,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), #f1f5ff);
}

/* ✅ TOGLIE SOTTOLINEATURE A TUTTI I LINK */
a,
a:visited,
a:hover,
a:active,
a:focus{
  text-decoration: none !important;
}

/* CENTRATO */
.page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 28px 16px;
}

.container{ width: min(1040px, 100%); }

/* topbar “pill” */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  box-shadow: var(--shadow2);
  margin-bottom: 18px;
  animation: dropIn .28s ease both;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color: inherit;
}
.logo{
  width:34px; height:34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 14px 22px rgba(185,28,28,.18);
}
.brand strong{ font-size:16px; letter-spacing:.2px; }

.nav{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.pill{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  color: var(--muted);
  font-weight: 750;
  font-size: 13px;
}

.card{
  background: rgba(255,255,255,.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: fadeUp .28s ease both;
}

.grid{ display:grid; gap:14px; }
.two-col{ display:grid; gap:14px; grid-template-columns: 1.5fr .9fr; }
@media (max-width: 900px){ .two-col{ grid-template-columns: 1fr; } }

hr.hr{ height:1px; border:0; background: var(--border); margin: 16px 0; }
.muted{ color: var(--muted); }

a.link{ color: var(--brand); text-decoration:none; font-weight:700; }
a.link:hover{ text-decoration: none; opacity:.9; }

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  cursor:pointer;
  text-decoration:none;
  transition: transform .10s ease, box-shadow .20s ease, background .20s ease;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow2);
}
.btn:active{ transform: translateY(0); }

.btn.primary{
  border: none;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 16px 30px rgba(185,28,28,.18);
}
.btn.primary:hover{ filter: brightness(1.03); }

/* Inputs */
input, select, textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  color: var(--text);
  outline: none;
  transition: box-shadow .20s ease, border-color .20s ease, transform .10s ease;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(185,28,28,.55);
  box-shadow: 0 0 0 4px var(--focus);
}
textarea{ min-height: 140px; resize: vertical; }

/* Tiles / cards clickable */
.tile{
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  text-decoration:none;
  color: inherit;
  transition: transform .12s ease, box-shadow .20s ease;
}
.tile:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
}

/* “Soft glow” on hover (Apple-like) */
.tile:hover .tag{ filter: brightness(1.02); }

.tag{
  display:inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(185,28,28,.10);
  border: 1px solid rgba(185,28,28,.18);
  color: #7f1d1d;
}

/* small notice */
.notice{
  border: 1px solid rgba(239,68,68,.22);
  background: rgba(239,68,68,.06);
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 14px;
}

/* animations */
@keyframes fadeUp{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}
@keyframes dropIn{
  from{ opacity:0; transform: translateY(-8px); }
  to{ opacity:1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; }
}

/* --- Layout coerente tra pagine --- */

.page-section{ margin-top: 14px; }

.page-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.page-title{
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .2px;
}

.page-subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
  justify-content:flex-end;
}

.backline{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.backline a{
  text-decoration:none;
  font-weight:800;
  color: var(--brand);
}

.form-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 900px){
  .form-row{ grid-template-columns: 1fr; }
}

/* “list item” uniforme per post/categorie */
.list-item-title{
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}
.list-item-meta{
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.toplink{
  text-decoration:none;
  font-weight:400;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  transition: background .2s ease, color .2s ease;
}
.toplink:hover{
  background: rgba(255,255,255,.65);
  color: var(--text);
}

.comment-tile{
  margin: 0;
  position: relative;
}

.comment{
  position: relative;
}

.comment::before{
  content:"";
  position:absolute;
  left:-10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(185,28,28,.18);
  border-radius: 999px;
}

.reply-details{
  margin-top: 10px;
}

.reply-link{
  cursor: pointer;
  font-weight: 900;
  color: var(--brand);
  list-style: none;
  user-select: none;
}

.reply-details > summary::-webkit-details-marker{
  display:none;
}

/* ===== Commenti ultra compatti ===== */

.comments-wrap{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.comment{
  position:relative;
  padding:6px 0 8px 0;
  border-top:1px solid var(--border);
}

.comment:first-child{
  border-top:0;
}

.comment.depth-1,
.comment.depth-2,
.comment.depth-3,
.comment.depth-4,
.comment.depth-5{
  padding-left:14px;
}

.comment.depth-1::before,
.comment.depth-2::before,
.comment.depth-3::before,
.comment.depth-4::before,
.comment.depth-5::before{
  content:"";
  position:absolute;
  left:4px;
  top:4px;
  bottom:4px;
  width:2px;
  background:rgba(15,23,42,.08);
}

/* corpo testo */
.comment-body{
  font-size:14px;
  line-height:1.4;
  margin-bottom:4px;
}

/* meta più compatto */
.comment-meta{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:8px;
}

/* rispondi inline */
.reply-details{
  margin-left:6px;
}

.reply-details summary{
  list-style:none;
  cursor:pointer;
  font-weight:700;
  color:var(--brand);
  font-size:12px;
  padding:0;
  margin:0;
}

.reply-details summary::-webkit-details-marker{
  display:none;
}

/* elimina completamente effetto box */
.comment .tile.comment-tile{
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  padding:0 !important;
}

/* Typography */
body{
  font-family: 'DM Sans', sans-serif;
  letter-spacing: -0.01em;
}

/* Background più “app” */
.page{
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(185,28,28,.20), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(212,175,55,.18), transparent 55%),
    var(--bg);
}

/* Topbar più moderna */
.topbar{
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.75);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

/* Logo più “brand” */
.logo{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 25px rgba(185,28,28,.20);
}

/* Hero */
.hero{
  padding: 28px 0 8px;
}
.hero-card{
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.82));
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: 26px;
}
.hero-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  color: var(--muted);
}
.hero-title{
  margin: 12px 0 8px;
  font-size: 34px;
  line-height: 1.1;
}
.hero-subtitle{
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 60ch;
}

/* Form */
.form .two-col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px){
  .form .two-col{ grid-template-columns: 1fr; }
}

.field label{
  display:block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}
select, input, textarea{
  transition: box-shadow .15s ease, transform .05s ease, border-color .15s ease;
}
select:focus, input:focus, textarea:focus{
  box-shadow: 0 0 0 6px var(--focus);
  border-color: rgba(185,28,28,.45);
}

/* Azioni */
.form-actions{
  display:flex;
  gap: 12px;
  align-items:center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.hint{
  color: var(--muted);
  font-size: 13px;
}

/* Card hover “premium” */
.card, .tile, .comment-tile{
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.card:hover, .tile:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
  border-color: rgba(15,23,42,.14);
}



/* ===== LIGHT THEME UPGRADE (append at end) ===== */

:root{
  --bg: #f6f8fc;
  --panel: rgba(255,255,255,.92);
  --panel2: rgba(255,255,255,.78);
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, .10);

  /* ✅ ROSSO + ORO (override finale) */
  --brand: #b91c1c;
  --brand2: #d4af37;

  --radius: 18px;
  --shadow: 0 18px 45px rgba(2,6,23,.10);
  --shadow2: 0 26px 70px rgba(2,6,23,.14);
  --focus: rgba(185, 28, 28, .18);
}

body{
  color: var(--text);
  background:
    radial-gradient(1100px 650px at 15% -10%, rgba(185,28,28,.15), transparent 60%),
    radial-gradient(900px 550px at 95% 0%, rgba(212,175,55,.12), transparent 55%),
    var(--bg);
}

.page{
  background: transparent;
}

/* Links */
a{ color: var(--brand); }
a:hover{ opacity: .9; }

/* Topbar “glass” chiara */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

/* Logo più “brand” */
.logo{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 14px 30px rgba(185,28,28,.16);
}

/* Card & tiles */
.card, .tile, .comment-tile{
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card:hover, .tile:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
}

/* Bottoni */
.btn{
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  color: var(--text);
}

.btn:hover{
  background: rgba(255,255,255,.95);
}

.btn.primary{
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  box-shadow: 0 14px 28px rgba(185,28,28,.18);
}

.btn.primary:hover{
  filter: brightness(1.03);
}

/* Form */
input, select, textarea{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.14);
  color: var(--text);
}

input::placeholder, textarea::placeholder{
  color: rgba(71,85,105,.75);
}

input:focus, select:focus, textarea:focus{
  outline: none;
  box-shadow: 0 0 0 6px var(--focus);
  border-color: rgba(185,28,28,.35);
}

/* Testi secondari (se esistono nel tuo HTML) */
.small, .muted, .meta, .hint{
  color: var(--muted);
}

/* Messaggi/notice */
.notice{
  border: 1px solid rgba(245,158,11,.40);
  background: rgba(245,158,11,.14);
  color: #7c2d12;
  padding: 10px 12px;
  border-radius: 14px;
}

.inline-form{ display:inline; margin:0; }
.mod-actions{ display:inline-flex; gap:8px; align-items:center; }

.table-wrap{ overflow:auto; border-radius: 14px; border:1px solid var(--border); }
table.db{ width:100%; border-collapse: collapse; font-size:14px; min-width: 820px; }
table.db th, table.db td{ padding: 10px 12px; border-bottom:1px solid var(--border); vertical-align: top; }
table.db th{ text-align:left; background: rgba(0,0,0,.03); position: sticky; top: 0; }
table.db tr:hover td{ background: rgba(0,0,0,.02); }
td.actions{ white-space: nowrap; }
.inline-form{ display:inline; margin:0; }
.tag{ display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid var(--border); }

.badge.banned {
  display:inline-block;
  background:#e6f0ff;
  color:#0b57d0;
  padding:4px 8px;
  border-radius:12px;
  font-weight:600;
  margin-left:8px;
}

.notice {
  color:#666;
  padding:12px;
  border-radius:6px;
  background:#fff7f7;
  border:1px solid #ffd6d6;
  margin:12px 0;
}

html, body {
  height: 100%;
}

body {
  min-height: 100vh;

  /* IMPORTANTI: evita "stacchi" e reset durante scroll/navigazione */
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
}

/* Favorites star button */
.fav-btn{
  margin-left: 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.15s ease;
}

.fav-btn:hover{
  color: var(--brand);
  transform: translateY(-1px);
}

.fav-btn:focus,
.fav-btn:active{
  outline: none;
  box-shadow: none;
}

.fav-btn.is-fav{
  color: var(--brand);
}

/* Tag container */
.tag{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ✅ EXTRA: ribadisce a fine file la rimozione underline (anti override) */
a,
a:visited,
a:hover,
a:active,
a:focus{
  text-decoration: none !important;
}

.grid-tiles{
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

@media (max-width: 900px){
  .grid-tiles{
    grid-template-columns: repeat(auto-fill, 220px);
  }
}

@media (max-width: 560px){
  .grid-tiles{
    grid-template-columns: 1fr;
  }
}