/* Struttura ripresa da Liberly / Cam.TV: testata fissa, colonna dei post, colonna destra.
   Aspetto: un solo tema scuro con i colori del marchio (docs/09-marchio.md).
   Ogni blocco è una scheda staccata dal fondo; l'oro è riservato alle azioni e ai punti da notare. */

:root {
  /* oro: tre toni e la sfumatura "metallo" dei pulsanti principali */
  --gold-hi: #f5e2a0;
  --primary: #d4af37;
  --primary-dark: #a67c1e;
  --gold-grad: #d4af37;
  --primary-soft: rgba(212, 175, 55, .12);
  --on-primary: #17130a;
  --link: #e4c768;
  /* blu e viola del marchio: solo per fondi decorativi */
  --blue: #0b2d5b;
  --purple: #4b1f7a;
  --deco: radial-gradient(120% 150% at 85% -10%, rgba(212, 175, 55, .14), transparent 55%), linear-gradient(135deg, #232328 0%, #121214 100%);
  /* fondi e testi */
  /* come Liberly scuro: fondo #111, contenitore grigio scuro, schede nere con bordo sottile */
  --page: #080809;
  --shell: #080809;
  --surface: #1b1b1f;
  --surface-2: #232328;
  --surface-3: #2e2e35;
  --field: #111113;
  --line: #2a2a30;
  --line-2: #36363e;
  --text: #f2f0ea;
  --text-2: #a5a5af;
  --text-3: #8a8a94;
  --danger: #f0524f;
  --ok: #3cc46a;
  --pink: #f0456a;
  --overlay: rgba(0, 0, 0, .7);
  --radius: 8px;
  --radius-l: 12px;
  --shadow: none;
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, .7), 0 0 0 1px var(--line-2);
  --topbar: 54px;
  --gap: 20px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar) + 12px); overflow-x: clip; scrollbar-color: #33333c transparent; }
body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font: 16px/1.5 Inter, Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(212, 175, 55, .35); color: #fff; }
a { color: var(--link); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-hi); text-decoration: none; }
img, video { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.012em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
code, pre, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: 5px; overflow-wrap: anywhere; }
small { color: var(--text-3); }
.muted, .meta { color: var(--text-2); }
.meta { font-size: .86rem; margin: .2rem 0; }
.lead { color: var(--text-2); font-size: 1.05rem; }
.pad { padding: 0 24px; }
.spacer { flex: 1; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; fill: currentColor; flex: none; vertical-align: middle; }
.ic.xl { width: 40px; height: 40px; }
.ic.blue { color: var(--primary); }
.ic.badge { width: 18px; height: 18px; color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---- testata ---- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); background: var(--page); border-bottom: 1px solid var(--line); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 5%, rgba(212, 175, 55, .55) 50%, transparent 95%); }
.topbar-in { max-width: 1150px; margin: 0 auto; height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; margin: 0 14px 0 4px; color: var(--text);
  font-weight: 600; font-size: 1.02rem; letter-spacing: .22em; text-transform: uppercase; }
.logo:hover { color: var(--text); }
.logo svg { width: 28px; height: 28px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.logo svg circle { fill: var(--primary); stroke: none; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%;
  color: var(--text-2); background: none; border: 0; cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.create { width: 38px; height: 38px; margin: 0 4px; background: var(--gold-grad); color: var(--on-primary); box-shadow: 0 4px 14px rgba(212, 175, 55, .28); }
.icon-btn.create:hover { color: var(--on-primary); filter: brightness(1.08); }
.top-search { flex: 1; max-width: 360px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  background: rgba(var(--tint), .05); border: 1px solid var(--line); color: var(--text-3); transition: border-color .15s, background .15s; }
.top-search:focus-within { border-color: rgba(212, 175, 55, .6); background: var(--field); }
.top-search .ic { width: 18px; height: 18px; }
.top-search input { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; font-size: .93rem; }
.top-search input:focus { outline: none; box-shadow: none; }
.top-search-icon { display: none; }

/* ---- menu laterale ---- */
.drawer { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: 330px; max-width: 88vw; background: var(--surface-2); border-right: 1px solid var(--line);
  transform: translateX(-105%); transition: transform .22s ease; overflow-y: auto; box-shadow: 0 0 60px rgba(0, 0, 0, .7); }
.drawer:target, .drawer.open { transform: none; }
.drawer-backdrop { display: none; position: fixed; inset: 0; z-index: 40; background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.drawer:target ~ .drawer-backdrop, .drawer.open ~ .drawer-backdrop { display: block; }
.drawer-close { position: absolute; top: 10px; right: 10px; color: var(--text-2); padding: 8px; border-radius: 50%; }
.drawer-close:hover { background: var(--surface-2); color: var(--text); }
.drawer-head { background: var(--deco); padding: 22px 18px 18px; }
.drawer-user { display: flex; align-items: center; gap: 12px; color: var(--text); }
.drawer-user:hover { color: var(--text); }
.drawer-user strong { display: block; font-size: 1.08rem; }
.drawer-user small { color: rgba(var(--tint), .75); }
.drawer-list { list-style: none; margin: 0; padding: 10px; border-bottom: 1px solid var(--line); }
.drawer-list a, .drawer-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; color: var(--text-2);
  background: none; border: 0; border-radius: var(--radius); font: inherit; cursor: pointer; text-align: left; }
.drawer-list a:hover, .drawer-list button:hover { background: var(--surface-2); color: var(--text); }
.drawer-label { padding: 8px 12px 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); }
.drawer-channel { display: flex; align-items: center; gap: 6px; padding-right: 6px; }
.drawer-channel > a { flex: 1; min-width: 0; }
.drawer-channel form { margin: 0; }
.drawer-list .drawer-channel button.tag { width: auto; padding: 3px 10px; display: inline-block; color: var(--link); border-color: rgba(212, 175, 55, .45); }

/* ---- colonne ---- */
/* Contenitore centrale da 1150px come in Liberly: 50px di margine, colonna dei post, colonna destra da 300px nera e attaccata in alto. */
.page { max-width: 1150px; margin: 0 auto; min-height: calc(100vh - var(--topbar)); background: var(--shell);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 50px; padding: 0 50px; align-items: start; }
.page.wide { display: block; padding: 26px 50px 60px; }
.page-top { grid-column: 1 / -1; min-width: 0; }
.main-col { min-width: 0; padding: 20px 0 60px; }
.page.wide .main-col { padding: 0; }
.side-col { position: sticky; top: var(--topbar); max-height: calc(100vh - var(--topbar)); min-height: calc(100vh - var(--topbar)); overflow-y: auto; scrollbar-width: none;
  background: var(--surface); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.page-top:not(:empty) ~ .side-col { min-height: 0; border-top: 0; }
.side-col::-webkit-scrollbar { display: none; }

/* ---- schede: la base comune ---- */
.post, .composer, .comments, .panel, .channel-page, .dialog, .narrow, .people, .empty, .hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---- avatar ---- */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; background: var(--deco); color: #fff; font-weight: 700; border: 2px solid rgba(var(--tint), .9); }
.avatar[data-initial]::before { content: attr(data-initial); }
.avatar.xs { width: 30px; height: 30px; font-size: .8rem; border-width: 1px; }
.avatar.sm { width: 38px; height: 38px; font-size: .9rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar.xl { width: 128px; height: 128px; font-size: 3rem; border-width: 4px; box-shadow: 0 0 0 2px var(--primary), 0 14px 34px rgba(0, 0, 0, .6); }
.avatar.sys { background: var(--surface-2); color: var(--primary); }
.avatar.sys .ic { width: 20px; height: 20px; }

/* ---- bottoni ---- */
.btn, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.2;
  background: var(--gold-grad); color: var(--on-primary); border: 1px solid rgba(255, 236, 170, .55); border-radius: var(--radius); padding: 10px 20px;
  box-shadow: inset 0 1px 0 rgba(var(--tint), .45), 0 6px 18px rgba(212, 175, 55, .2); transition: filter .15s, transform .15s, background .15s, border-color .15s; }
.btn:hover, .button:hover { color: var(--on-primary); filter: brightness(1.08); transform: translateY(-1px); }
.btn:active, .button:active { transform: none; filter: brightness(.96); }
.btn .ic { width: 18px; height: 18px; }
.btn.outline, .button.ghost { background: transparent; color: var(--link); border-color: rgba(212, 175, 55, .5); box-shadow: none; }
.btn.outline:hover, .button.ghost:hover { background: var(--primary-soft); color: var(--gold-hi); border-color: var(--primary); filter: none; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); filter: none; transform: none; }
.btn.small, .button.small { padding: 6px 13px; font-size: .84rem; border-radius: 8px; }
.btn.big { padding: 14px 34px; font-size: 1.08rem; }
.btn.block { display: flex; width: 100%; }
.btn.cta { margin-bottom: 10px; }
.btn:disabled, .button:disabled { opacity: .4; cursor: default; transform: none; filter: none; }
button.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; }
button.link:hover { color: var(--gold-hi); }

/* ---- schede di navigazione ---- */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 var(--gap); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 11px 16px; color: var(--text-2); font-weight: 500; white-space: nowrap; border-radius: 8px 8px 0 0; }
.tabs a:hover { color: var(--text); background: rgba(var(--tint), .03); }
.tabs a.on { color: var(--text); font-weight: 650; }
.tabs a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gold-grad); }
.tabs .ic { width: 20px; height: 20px; }

/* ---- invito per chi non ha un account ---- */
.hero { position: relative; overflow: hidden; padding: 38px 34px 34px; margin-bottom: var(--gap); background: var(--deco); border-color: rgba(212, 175, 55, .25); }
.hero::after { content: ""; position: absolute; inset: auto -10% -60% -10%; height: 90%; pointer-events: none;
  background: radial-gradient(50% 60% at 50% 0%, rgba(212, 175, 55, .22), transparent 70%); }
.hero-kicker { margin: 0 0 10px; font-size: .78rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-hi); }
.hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); max-width: 20ch; color: #fff; }
.hero p.lead { max-width: 52ch; color: rgba(var(--tint), .82); margin: 12px 0 22px; }
.hero .row { position: relative; z-index: 1; }

/* ---- "crea nuovo" in cima al wall ---- */
.composer { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: var(--gap); }
.composer-input { flex: 1; background: var(--field); border: 1px solid var(--line); border-radius: 999px; padding: 11px 22px; color: var(--text-3); transition: border-color .15s; }
.composer-input:hover { border-color: rgba(212, 175, 55, .55); color: var(--text-2); }

/* ---- scheda del post ---- */
.post { margin-bottom: var(--gap); overflow: clip; transition: border-color .15s; }
.post:hover { border-color: var(--line-2); }
.post-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 10px; }
.post-who { flex: 1; min-width: 0; }
.post-who a { color: var(--text); }
.post-who strong { color: var(--text); font-size: 1rem; }
.post-who small { display: block; margin-top: 1px; }
.post-who small a { color: var(--text-3); }
.post-menu { position: relative; }
.post-menu summary { list-style: none; cursor: pointer; color: var(--text-3); padding: 6px; border-radius: 50%; }
.post-menu summary::-webkit-details-marker { display: none; }
.post-menu summary:hover { background: var(--surface-2); color: var(--text); }
.post-menu ul { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; list-style: none; margin: 0; padding: 6px; min-width: 210px;
  background: var(--surface-2); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.post-menu li a, .post-menu li button { display: block; width: 100%; text-align: left; padding: 8px 12px; background: none; border: 0; border-radius: 7px; font: inherit; color: var(--text); cursor: pointer; }
.post-menu li a:hover, .post-menu li button:hover { background: var(--surface-3); }
.post-title { padding: 4px 22px 0; font-size: 1.3rem; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--gold-hi); }
.post-lead { padding: 4px 22px 0; color: var(--text-2); margin: 0 0 12px; }
.post-text { padding: 4px 22px; margin: 0 0 12px; overflow-wrap: break-word; }
.post-text p { margin: 0 0 .8em; }
.post-text.clamp { max-height: 12.2em; overflow: hidden; position: relative; }
.post-text.clamp.cut::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3.5em; background: linear-gradient(transparent, var(--surface)); }
.post-more { display: block; margin: -8px 22px 12px; background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; }
/* Stesso respiro sopra e sotto: prima stavano attaccati alla fascia della galleria. */
.post-tags { margin: 0; padding: 14px 22px 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .84rem; }
.post-text + .post-tags { padding-top: 2px; } /* il testo porta già il suo spazio sotto */
.post-tags a { display: inline-flex; align-items: center; line-height: 1.2; padding: 5px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--link); }
.post-tags a:hover { background: rgba(212, 175, 55, .22); }
.post-media { position: relative; display: block; background: #000; overflow: hidden; }
.post-media > img { display: block; width: 100%; max-height: 560px; object-fit: cover; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; height: min(62vw, 480px); overflow: hidden; background: #000; }
.slide img:not(.blur) { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; }
.slide img.blur { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); max-width: none; object-fit: cover; filter: blur(24px) brightness(.7); }
.slide video { width: 100%; height: 100%; background: #000; }
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.slide-nav:hover { background: rgba(0, 0, 0, .75); }
.slide-nav.prev { left: 12px; }
.slide-nav.next { right: 12px; }
.video-wait { color: #fff; padding: 20px; text-align: center; margin: 0; }
.post-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 22px; color: var(--text-2); font-size: .9rem;
  background: linear-gradient(90deg, rgba(212, 175, 55, .13), rgba(212, 175, 55, .03)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.post-bar > span { display: inline-flex; align-items: center; gap: 8px; }
.post-bar .ic { width: 18px; height: 18px; color: var(--primary); }
.post-bar.locked { background: linear-gradient(90deg, rgba(75, 31, 122, .32), rgba(11, 45, 91, .18)); }
.post audio { display: block; width: calc(100% - 44px); margin: 10px 22px; }
.post-files { list-style: none; margin: 0; padding: 4px 22px 10px; }
.post-files .ic { width: 18px; height: 18px; }
.post-stats { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 0 22px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text-3); font-size: .86rem; font-weight: 500; }
.post-stats .ic { width: 15px; height: 15px; }
.post-actions { display: flex; align-items: center; gap: 4px; padding: 8px 14px 10px; flex-wrap: wrap; }
.post-actions form { margin: 0; }
.act { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: .92rem; font-weight: 500; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.act:hover { background: var(--surface-2); color: var(--text); }
.act .ic { width: 20px; height: 20px; }
.act.on { color: var(--text); }
.act.on .ic { color: var(--pink); }
.act.icon-only.on .ic { color: var(--primary); }
.more { text-align: center; }
.empty { text-align: center; padding: 46px 24px; color: var(--text-2); border-style: dashed; box-shadow: none; background: rgba(var(--tint), .02); margin-bottom: var(--gap); }
.empty strong { color: var(--text); font-size: 1.1rem; }

/* ---- colonna destra ---- */
.featured { position: relative; display: block; height: 130px; background: var(--deco); color: #fff; overflow: hidden; border-bottom: 1px solid var(--line); }
.featured:hover { color: #fff; }
.featured::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0, 0, 0, .7)); }
.featured-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.featured:hover .featured-bg { transform: scale(1.04); }
.featured-label { position: absolute; z-index: 1; top: 12px; left: 12px; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: var(--gold-grad); color: var(--on-primary); }
.featured-who { position: absolute; z-index: 1; left: 14px; bottom: 12px; right: 14px; display: flex; align-items: center; gap: 12px; }
.featured-who .avatar { width: 52px; height: 52px; font-size: 1.2rem; border-color: rgba(var(--tint), .85); }
.featured-who strong { display: block; font-size: 1.05rem; line-height: 1.25; }
.featured-who small { color: rgba(var(--tint), .8); }
.side-box { padding: 16px 16px 18px; border-bottom: 1px solid var(--line); }
.side-box h2 { font-size: .74rem; color: var(--text-3); margin: 0 0 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.side-box.center { text-align: center; background: linear-gradient(180deg, rgba(212, 175, 55, .12), transparent 70%); }
.side-box.center h2 { color: var(--gold-hi); }
.side-box p { margin: 0 0 12px; color: var(--text-2); font-size: .93rem; }
.side-box > .btn.block + .btn.block, .side-box > form + form { margin-top: 8px; }
.side-channels, .side-actions, .side-tags { list-style: none; margin: 0; padding: 0; }
.side-channels a, .side-channel-card { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: var(--radius); color: var(--text); }
.side-channels a:hover, .side-channel-card:hover { background: var(--surface-2); color: var(--text); }
.side-channels span, .side-channel-card span { min-width: 0; }
.side-channels strong, .side-channel-card strong { display: block; font-size: .93rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-channels small, .side-channel-card small { display: block; font-size: .79rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-actions { margin-top: 12px; }
.side-actions a, .side-actions button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 8px; margin: 0 -8px; width: calc(100% + 16px); background: none; border: 0; border-radius: var(--radius); font: inherit; color: var(--text-2); cursor: pointer; text-align: left; }
.side-actions a:hover, .side-actions button:hover { color: var(--text); background: var(--surface-2); }
.side-actions .ic { color: var(--primary); width: 20px; height: 20px; }
.side-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.side-tags a { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: .82rem; color: var(--text-2); transition: border-color .15s, color .15s; }
.side-tags a:hover { border-color: rgba(212, 175, 55, .6); color: var(--gold-hi); }
.side-foot { padding: 14px 16px; margin: 0; font-size: .8rem; }
.side-foot a { color: var(--text-3); }
.side-notice { margin: 12px 16px; }
.follow-notify { margin-top: 10px; }
.follow-notify button { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-2); }
.follow-notify .ic { width: 18px; height: 18px; }

/* ---- pagina canale ---- */
/* Come in Liberly: copertina e intestazione larghe quanto tutto il contenitore, sotto le due colonne. */
.channel-hero { background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.channel-cover { position: relative; height: 266px; background: var(--deco); overflow: hidden; }
.channel-cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 60%, rgba(0, 0, 0, .55)); }
.channel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.channel-stats { position: absolute; z-index: 1; top: 14px; right: 14px; display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; color: #fff; font-weight: 600; font-size: .88rem; }
.channel-stats li { display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(0, 0, 0, .45); border: 1px solid rgba(var(--tint), .14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.channel-stats .ic { width: 16px; height: 16px; }
.channel-head { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 16px; padding: 0 36px 14px; }
/* flex: none: con un nome lungo il riquadro non si stringe e il logo non diventa ovale */
.channel-avatar { flex: none; margin-top: -70px; }
.channel-avatar .avatar.xl { max-width: none; aspect-ratio: 1; object-fit: cover; width: 148px; height: 148px; border-color: #fff; border-width: 3px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.channel-name { padding-bottom: 6px; min-width: 0; }
.channel-name h1 { font-size: 1.5rem; display: flex; align-items: center; gap: 8px; }
.channel-name p { margin: 4px 0 0; color: var(--text-3); font-size: .93rem; }
.channel-about { padding: 4px 6px 16px; margin: 0; white-space: pre-line; color: var(--text-2); }
.channel-menu a.view { padding: 9px; }
.grid { list-style: none; margin: 0 0 var(--gap); padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; display: block; aspect-ratio: 1; background: #000; border-radius: var(--radius); overflow: hidden; color: #fff; border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.tile:hover { color: #fff; border-color: rgba(212, 175, 55, .6); transform: translateY(-2px); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.tile:hover img { transform: scale(1.05); }
.tile.text { background: var(--deco); }
.tile-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px 16px 30px; text-align: center; font-weight: 600; line-height: 1.35; overflow: hidden; }
.tile-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 30px; font-size: .88rem; font-weight: 600; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); }
.tile-views { position: absolute; left: 10px; bottom: 8px; display: flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; text-shadow: 0 1px 2px #000; }
.tile-views .ic, .tile-multi .ic { width: 15px; height: 15px; }
.tile-multi { position: absolute; top: 8px; right: 8px; padding: 4px; border-radius: 50%; background: rgba(0, 0, 0, .5); display: inline-flex; }
.tile-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .45); border: 1px solid rgba(var(--tint), .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.backlink { margin: 0 0 14px; }
.backlink a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 500; }
.backlink a:hover { color: var(--text); }
.channel-page { padding: 24px 0; margin-bottom: var(--gap); }
.channel-page-title { padding: 0 26px 14px; font-size: 1.45rem; }
.channel-page > p { padding: 0 26px; }

/* ---- commenti ---- */
.comments { padding: 18px 22px 10px; margin-bottom: var(--gap); }
.comments h2 { margin-bottom: 14px; }
.comment-form { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.comment-form textarea { margin: 0; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment.reply { border-top: 0; padding: 10px 0 0; }
.comment-body { flex: 1; min-width: 0; }
.comment .body { margin: .2rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-tools summary { cursor: pointer; font-size: .82rem; color: var(--text-3); }
.comment-tools summary:hover { color: var(--link); }
.comment-tools form { margin: 8px 0; }

/* ---- elenchi ---- */
.page-title { display: flex; align-items: center; gap: 8px; margin: 2px 0 18px; font-size: 1.45rem; }
.page-title form { margin: 0; }
.section-title { margin: 26px 0 12px; font-size: .78rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.section-title small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.people { list-style: none; margin: 0 0 var(--gap); padding: 6px; }
.people:empty { display: none; }
.people li > * { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); color: var(--text); }
.people li + li { border-top: 1px solid var(--line); }
.people li > a:hover { background: var(--surface-2); color: var(--text); }
.people strong { display: block; }
.channel-list .grow { flex: 1; min-width: 0; }
.channel-list small { display: block; }
.searchbox { display: flex; align-items: center; gap: 10px; background: var(--field); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 18px; color: var(--text-3); margin-bottom: var(--gap); }
.searchbox:focus-within { border-color: rgba(212, 175, 55, .7); box-shadow: 0 0 0 3px rgba(212, 175, 55, .14); }
.searchbox input { border: 0; background: none; margin: 0; padding: 11px 0; box-shadow: none; }
.searchbox input:focus { outline: none; box-shadow: none; }
.channel-cards { list-style: none; margin: 0 0 var(--gap); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.channel-cards a { display: flex; flex-direction: column; align-items: center; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; padding-bottom: 16px; color: var(--text); text-align: center;
  transition: border-color .15s, transform .15s; }
.channel-cards a:hover { border-color: rgba(212, 175, 55, .6); transform: translateY(-2px); color: var(--text); }
.cc-cover { display: block; width: 100%; height: 72px; background: var(--deco); }
.cc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.channel-cards .avatar { margin-top: -30px; margin-bottom: 8px; width: 56px; height: 56px; font-size: 1.3rem; }

/* ---- finestra di creazione ---- */
.dialog { max-width: 680px; margin: 4px auto 0; box-shadow: var(--shadow-pop); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 8px; }
.dialog-head h1 { font-size: 1.05rem; }
.dialog .tabs { margin: 0; padding: 0 10px; }
.dialog-body { padding: 16px 30px 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); margin: 20px -30px 0; padding: 14px 30px; background: rgba(var(--tint), .02); border-radius: 0 0 var(--radius-l) var(--radius-l); }
.counted { position: relative; }
.counter { display: block; text-align: right; font-size: .75rem; color: var(--text-3); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 190px; text-align: center;
  background: var(--field); border: 1.5px dashed var(--line-2); border-radius: var(--radius-l); cursor: pointer; color: var(--text-2); transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.dropzone .ic { color: var(--primary); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.chosen { font-size: .85rem; color: var(--link); padding: 0 12px; }

/* ---- moduli, avvisi, tabelle (anche Studio e Redazione) ---- */
form { margin: 0; }
label { display: block; margin: .9rem 0; font-size: .86rem; font-weight: 500; color: var(--text-2); }
label small { margin-left: .4rem; font-weight: 400; }
label.check { display: flex; align-items: center; gap: .6rem; font-weight: 400; }
input, select, textarea { width: 100%; margin-top: .4rem; padding: 10px 13px; font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: rgba(var(--tint), .26); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(212, 175, 55, .16); outline: none; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; margin: 0; padding: 0; flex: none; accent-color: var(--primary); box-shadow: none; }
input[type="file"] { padding: 7px; color: var(--text-2); }
input[type="file"]::file-selector-button { font: inherit; font-size: .85rem; font-weight: 600; margin-right: 12px; padding: 6px 14px; border-radius: 7px; cursor: pointer;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); }
input[type="file"]::file-selector-button:hover { border-color: var(--primary); }
textarea { resize: vertical; min-height: 5.2em; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row > label { flex: 1; min-width: 180px; }
.row > input, .row > select { flex: 1; min-width: 160px; margin-top: 0; }
.inline { display: inline; }
.narrow { max-width: 440px; margin: 26px auto; padding: 30px 32px 32px; box-shadow: var(--shadow-pop); }
.narrow h1 { margin-bottom: 18px; }
.narrow .btn[type="submit"] { margin-top: 6px; }
.panel { padding: 20px 24px 24px; margin: 0 0 var(--gap); }
.page.wide .panel { margin: var(--gap) 0; }
.page.wide table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.page.wide .panel table { border: 0; }
.panel h2 { margin: 0 0 14px; }
.crumbs { font-size: .85rem; color: var(--text-3); margin: 0 0 10px; }
.crumbs a { color: var(--text-2); }
.notice { border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: var(--radius); padding: .75rem 1rem; background: var(--surface-2); margin: 1rem 0; }
.notice.ok { border-left-color: var(--ok); background: rgba(60, 196, 106, .08); }
.notice.error { border-left-color: var(--danger); background: rgba(240, 82, 79, .08); }
.tag { display: inline-block; font-size: .66rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; border: 1px solid var(--line-2); border-radius: 999px; padding: 1px .6rem; color: var(--text-2); background: rgba(var(--tint), .04); vertical-align: middle; white-space: nowrap; }
.tag.warn, .tag.lock { color: var(--danger); border-color: rgba(240, 82, 79, .5); background: rgba(240, 82, 79, .08); }
.tag.on { color: var(--ok); border-color: rgba(60, 196, 106, .5); background: rgba(60, 196, 106, .08); }
button.tag { cursor: pointer; font-family: inherit; }
button.tag:hover { border-color: var(--primary); color: var(--gold-hi); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--text-3); font-weight: 650; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
tbody tr:hover td { background: rgba(var(--tint), .025); }
td a:not(.btn) { color: var(--text); font-weight: 500; }
td a:not(.btn):hover { color: var(--gold-hi); }
td:last-child a:not(.btn) { color: var(--link); font-weight: 500; }
.prose { font-size: 1.05rem; line-height: 1.7; }
.prose h1, .prose h2, .prose h3 { margin: 1.4em 0 .5em; }
.prose blockquote { border-left: 3px solid var(--primary); margin: 1em 0; padding: .1em 1em; color: var(--text-2); }
.prose pre { background: var(--field); padding: 12px; border-radius: var(--radius); overflow-x: auto; }
.prose img { height: auto; border-radius: var(--radius); }
.toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 60; background: #25252a; color: #fff; padding: 10px 22px; border-radius: 999px; font-size: .9rem; box-shadow: var(--shadow-pop); }
details.advanced { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 14px 0; background: rgba(var(--tint), .02); }
details.advanced summary { cursor: pointer; font-weight: 500; color: var(--text-2); }
details.advanced summary:hover { color: var(--text); }
.schedule { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.schedule label { margin: 0; }
.schedule input { width: auto; }
.report { border-top: 1px solid var(--line); padding: 14px 0; }
.report textarea { margin-top: 6px; }

/* ---- blocchi di articoli e pagine (le "card" di Cam.TV) ---- */
.blk { margin: 0 0 1.2em; }
.post .blk, .channel-page .blk { padding: 0 22px; }
.post .blk.blk-img, .post .blk.blk-video, .post .blk.blk-two { padding: 0; }
.blk-text { font-family: charter, Georgia, Cambria, "Times New Roman", serif; font-size: 17.5px; line-height: 1.7; }
.blk-img img { display: block; width: 100%; height: auto; }
.blk-audio { margin: 0; }
.blk-audio audio { display: block; width: 100%; }
.cover-preview audio { display: block; width: 100%; margin: 14px 0; }
.blk-img figcaption, .blk-video figcaption, .blk-audio figcaption { padding: 8px 22px 0; font-size: .85rem; color: var(--text-3); text-align: center; }
.blk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.blk-two img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.blk-two.round { gap: 20px; padding: 0 22px !important; }
.blk-two.round img { border-radius: 50%; }
.blk-video video, .blk-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.blk-btn { text-align: center; }
.blk-card { border: 1px solid var(--line); border-radius: var(--radius-l); margin: 0 22px 1.2em !important; padding: 18px 20px !important; background: var(--surface-2); }
.blk-card strong { display: block; font-size: 1.15rem; }
.blk-card span { color: var(--text-2); }
.blk-card ul { list-style: none; margin: 10px 0; padding: 0; }
.blk-links a { margin-right: 12px; }
.blk-map { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.blk-contact { border: 1px solid rgba(212, 175, 55, .25); border-radius: var(--radius-l); margin: 0 22px 1.2em !important; padding: 20px !important; text-align: center; background: var(--primary-soft); }
.blk-contact strong { display: block; font-size: 1.1rem; }

/* ---- editor a blocchi ---- */
.editor-title { margin: 22px 0 6px; font-size: 1.05rem; }
.ed-block { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2); margin: 0; }
.ed-head { display: flex; align-items: center; gap: 6px; padding: 7px 12px; background: var(--surface-3); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; font-weight: 600; font-size: .88rem; }
.ed-block > div:last-child, .ed-block > label, .ed-block > p { padding: 12px 14px; margin: 0; }
.ed-add { display: flex; justify-content: center; padding: 8px 0; }
.ed-add select { width: auto; margin: 0; padding: 5px 12px; font-size: .85rem; color: var(--link); border-style: dashed; border-color: rgba(212, 175, 55, .45); border-radius: 999px; background: transparent; }
.ed-tool { background: var(--field); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 10px; font: inherit; font-size: .85rem; color: var(--text); cursor: pointer; }
.ed-tool:hover:not(:disabled) { border-color: var(--primary); color: var(--gold-hi); }
.ed-tool:disabled { opacity: .4; cursor: default; }
.ed-tool.danger:hover { border-color: var(--danger); color: var(--danger); }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ed-rich { min-height: 130px; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; }
.ed-rich:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(212, 175, 55, .16); outline: none; }
.ed-media { flex: 1; min-width: 200px; }
.ed-preview img, .ed-preview video { display: block; max-width: 100%; max-height: 260px; margin-top: 8px; border-radius: var(--radius); }
.menu-editor input { margin: 0; }
.menu-editor td { vertical-align: middle; }

/* ---- notifiche ---- */
.badge-unread { position: absolute; top: 1px; right: -1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff;
  border: 2px solid var(--surface); font-size: 10.5px; font-weight: 700; line-height: 15px; text-align: center; }
.notif-holder { position: relative; }
.notif-popup { position: absolute; right: -40px; top: calc(100% + 10px); z-index: 35; width: 390px; max-width: calc(100vw - 20px); max-height: 460px; overflow-y: auto; background: var(--surface-2);
  border-radius: var(--radius-l); box-shadow: var(--shadow-pop); }
.notif-head { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif-all { margin: 0; padding: 10px; text-align: center; border-top: 1px solid var(--line); }
.notif-popup .empty { padding: 24px 14px; border: 0; background: none; margin: 0; }
.notifs { list-style: none; margin: 0 0 var(--gap); padding: 0; }
.main-col > .notifs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.notif-popup .notifs { margin: 0; }
.notifs li + li { border-top: 1px solid var(--line); }
.notifs li.unread { background: linear-gradient(90deg, rgba(212, 175, 55, .13), transparent 70%); box-shadow: inset 3px 0 0 var(--primary); }
.notifs a { display: flex; align-items: center; gap: 12px; padding: 11px 16px; color: var(--text); }
.notifs a:hover { background: rgba(var(--tint), .04); color: var(--text); }
.notif-text { flex: 1; min-width: 0; font-size: .92rem; overflow-wrap: anywhere; }
.notif-text small { display: block; }
.notifs .ic.kind { width: 18px; height: 18px; color: var(--text-3); }

/* ---- abbonamenti ---- */
.plan { display: flex; align-items: center; gap: 14px; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius-l); padding: 16px 18px; margin: 10px 0; cursor: pointer; color: var(--text); font-size: 1rem; font-weight: 400; transition: border-color .15s, background .15s; }
.plan:hover { border-color: rgba(212, 175, 55, .5); }
.plan:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(212, 175, 55, .12); }
.plan > span:nth-child(2) { flex: 1; }
.plan small { display: block; margin: 0; }
.plan .price { font-size: 1.35rem; font-weight: 700; text-align: right; color: var(--gold-hi); }
.plan .price small { display: inline; font-weight: 400; font-size: .8rem; }
.subscribe h1 { margin: 14px 0; }

/* ---- barra inferiore su telefono (come in Cam.TV) ---- */
.bottombar { display: none; }

/* ---- schermi stretti ---- */
@media (max-width: 1000px) {
  .page { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .page.wide { padding: 20px 16px 50px; }
  .main-col { padding-bottom: 20px; }
  .side-col { position: static; max-height: none; min-height: 0; overflow: visible; margin: 0 -16px; border-left: 0; border-right: 0; border-top: 1px solid var(--line); }
  .channel-head { padding: 0 20px 14px; }
  /* Pagina canale su schermi stretti: le azioni (Segui, Abbonati…) salgono subito sotto l'intestazione, il resto della colonna va in fondo. */
  .page:has(> .page-top) > .side-col { display: contents; }
  .page:has(> .page-top) > .page-top { order: -2; }
  .page:has(> .page-top) > .side-col > * { order: 1; margin-left: -16px; margin-right: -16px; background: var(--surface); }
  .page:has(> .page-top) > .side-col > .side-box:first-child { order: -1; }
}
@media (max-width: 700px) {
  :root { --topbar: 54px; --gap: 14px; }
  .topbar-in { padding: 0 8px; gap: 2px; }
  .top-search { display: none; }
  .top-search-icon { display: inline-flex; }
  .logo { margin-right: 2px; font-size: .92rem; letter-spacing: .16em; }
  .page { padding: 0 10px; border: 0; }
  .page.wide { padding: 16px 12px 40px; }
  .main-col { padding-top: 12px; }
  .side-col { margin: 0 -10px; }
  .page-top { margin: 0 -10px; }
  .channel-hero { border-left: 0; border-right: 0; }
  .post-head { padding: 14px 14px 8px; }
  .post-title, .post-lead, .post-text { padding-left: 14px; padding-right: 14px; }
  .post-tags { padding: 0 14px 10px; }
  .post-more { margin-left: 14px; }
  .post-stats { margin: 0 14px; }
  .post-bar { padding: 10px 14px; flex-wrap: wrap; }
  .post-actions { padding: 6px 6px 8px; flex-wrap: nowrap; gap: 0; }
  .act { padding: 8px 7px; font-size: .82rem; gap: 5px; white-space: nowrap; }
  .page:has(> .page-top) > .side-col > * { margin-left: -10px; margin-right: -10px; }
  .post .blk, .channel-page .blk { padding: 0 14px; }
  .channel-cover { height: 160px; }
  .channel-head { padding: 0 14px 14px; gap: 12px; }
  .avatar.xl, .channel-avatar .avatar.xl { width: 92px; height: 92px; font-size: 2.1rem; }
  .channel-avatar { margin-top: -44px; }
  .channel-name h1 { font-size: 1.2rem; }
  .channel-about { padding: 12px 14px 14px; }
  .channel-stats li { padding: 4px 8px; font-size: .8rem; }
  .grid { gap: 6px; }
  .tile { border-radius: 8px; }
  .dialog { margin: 0; }
  .dialog-body { padding: 12px 16px 0; }
  .dialog-foot { margin: 16px -16px 0; padding: 12px 16px; flex-wrap: wrap; }
  .comments { padding: 14px 14px 6px; }
  .narrow { margin: 10px auto; padding: 22px 18px 24px; }
  .hero { padding: 26px 20px 24px; }
  .notif-popup { position: fixed; left: 10px; right: 10px; top: calc(var(--topbar) + 6px); width: auto; }
  /* barra inferiore: le cinque azioni principali a portata di pollice */
  .has-bottombar { padding-bottom: 66px; }
  .has-bottombar .topbar .icon-btn.create, .has-bottombar .topbar .notif-holder, .has-bottombar .topbar .top-search-icon { display: none; }
  .bottombar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: rgba(9, 9, 12, .9);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .bottombar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--text-3); font-size: .66rem; font-weight: 500; }
  .bottombar a.on { color: var(--gold-hi); }
  .bottombar .ic { width: 23px; height: 23px; }
  .bottombar a.make span { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gold-grad); color: var(--on-primary);
    box-shadow: 0 6px 18px rgba(212, 175, 55, .35); }
  .bottombar .badge-unread { top: 0; right: calc(50% - 22px); }
  .toast { bottom: 80px; }
}
@media (max-width: 420px) { .logo span { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- finestre (dialog) ---------- */
dialog.modal { width: min(650px, calc(100vw - 24px)); max-height: min(92vh, 820px); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-l); box-shadow: var(--shadow-pop); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(0, 0, 0, .72); }
.modal .dialog-head { position: relative; justify-content: center; padding: 14px 52px; flex: none; }
.modal .dialog-head h2, .edit-card .dialog-head h2 { margin: 0; font-size: 1.05rem; font-weight: 650; }
.modal .dialog-head .icon-btn { position: absolute; right: 6px; top: 5px; }

/* ---------- modifica profilo del canale (come in Liberly: anteprima, schede, Avanti / Salva) ---------- */
.edit { display: flex; flex-direction: column; min-height: 0; margin: 0; }
.modal .edit { flex: 1; }
.edit-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); margin-bottom: var(--gap); max-width: 720px; overflow: hidden; }
.edit-card .dialog-head { padding: 14px 24px; }
.edit-tabs { margin: 0; padding: 0 30px; flex: none; }
.edit-tabs a { flex: 1; justify-content: center; }
.edit:not(.js) .edit-tabs, .edit:not(.js) [data-tab-next] { display: none; }
.edit-body { padding: 22px 30px 8px; overflow-y: auto; min-height: 0; }
.edit.js [data-pane]:not(.on) { display: none; }
.edit:not(.js) [data-pane] + [data-pane] { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 8px; }
.edit-title { margin: 18px 0 6px; font-size: 1rem; }
.edit-title:first-child { margin-top: 0; }
.edit-foot { margin: 0; padding: 14px 30px; flex: none; align-items: center; }
.edit-preview { position: relative; margin-bottom: 8px; padding-bottom: 14px; }
.edit-cover { position: relative; height: 150px; border-radius: var(--radius); overflow: hidden; background: var(--deco); border: 1px solid var(--line); }
.edit-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edit-avatar { position: absolute; left: 18px; top: 86px; }
.edit-avatar .avatar.xl { width: 112px; height: 112px; font-size: 2.6rem; border-color: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, .6); }
.edit-name { margin: 12px 0 0 146px; min-height: 44px; }
.edit-name strong { display: block; font-size: 1.15rem; color: var(--text); overflow-wrap: anywhere; }
.edit-name small { color: var(--text-3); }
.edit-pick { position: absolute; display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border-radius: 999px; background: rgba(0, 0, 0, .72); border: 1px solid rgba(var(--tint), .22); color: #fff; font-size: .8rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.edit-pick:hover, .edit-pick:focus-within { background: #000; border-color: var(--primary); color: var(--gold-hi); }
.edit-pick .ic { width: 18px; height: 18px; }
.edit-cover .edit-pick { right: 10px; top: 10px; }
.edit-avatar .edit-pick { right: -4px; bottom: -2px; padding: 8px; }
.edit-hint { margin: 0 0 6px; }
.input-prefix, .input-icon { display: flex; align-items: center; gap: 0; margin-top: .4rem; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius); }
.input-prefix:focus-within, .input-icon:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(212, 175, 55, .16); }
.input-prefix > span { padding-left: 13px; color: var(--text-3); }
.input-prefix input, .input-icon input { margin: 0; border: 0; background: none; box-shadow: none; }
.input-prefix input { padding-left: 2px; }
.input-prefix input[readonly] { color: var(--text-2); }
.input-icon .ic { width: 22px; height: 22px; margin-left: 11px; flex: none; }
.input-icon input { padding-left: 9px; }

/* colori delle reti social */
.ic.s-facebook { color: #1877f2; }
.ic.s-x { color: #fff; }
.ic.s-linkedin { color: #3b82c4; }
.ic.s-pinterest { color: #e60023; }
.ic.s-whatsapp { color: #25d366; }
.ic.s-instagram { color: #e4405f; }
.ic.s-youtube { color: #ff0033; }
.ic.s-tiktok { color: #fff; }
.ic.s-sito { color: var(--primary); }
.channel-socials { display: flex; gap: 8px; margin: -6px 0 16px; padding: 0 6px; }
.channel-socials a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.channel-socials a:hover { border-color: var(--primary); transform: translateY(-1px); }
.channel-socials .ic { width: 20px; height: 20px; }

/* ---------- condividi ---------- */
dialog.share-modal { width: min(450px, calc(100vw - 24px)); }
.share-body { padding: 18px 30px 26px; overflow-y: auto; text-align: center; }
.share-label { margin: 0 0 14px; color: var(--text); }
.share-nets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.share-nets a { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); font-weight: 500; text-align: left; transition: border-color .15s, background .15s; }
.share-nets a:hover { border-color: var(--primary); background: var(--surface-3); color: var(--text); }
.share-nets a.full { grid-column: 1 / -1; }
.share-nets .ic { width: 22px; height: 22px; }
.share-link { display: flex; align-items: center; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius); padding-right: 2px; }
.share-link input { margin: 0; border: 0; background: none; box-shadow: none; font-size: .85rem; text-overflow: ellipsis; }
.share-link .icon-btn { flex: none; color: var(--primary); }
.share-qr { display: block; width: 220px; height: 220px; margin: 20px auto 0; padding-top: 0; background: #fff; border-radius: var(--radius); border-top: 0; }

/* ---------- piani dell'account ---------- */
.plan-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin: 22px 0; }
.plan-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px 22px; }
.plan-card.top { border-color: rgba(212, 175, 55, .45); background: linear-gradient(180deg, rgba(212, 175, 55, .08), transparent 42%), var(--surface); }
.plan-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(212, 175, 55, .12); }
.plan-card h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; font-size: 1.25rem; }
.plan-limit { margin: 0 0 14px; color: var(--text-2); }
.plan-limit strong { font-size: 2.4rem; line-height: 1; margin-right: 4px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-card ul { flex: 1; margin: 0 0 18px; padding-left: 18px; color: var(--text-2); }
.plan-card li { margin: 6px 0; }
.plan-price { margin: 0 0 12px; font-weight: 650; color: var(--text); }
@media (max-width: 800px) { .plan-cards { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
    dialog.modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; margin: 0; }
    dialog.share-modal { height: auto; margin: auto 0 0; border-radius: var(--radius-l) var(--radius-l) 0 0; }
    .edit-tabs { padding: 0 8px; }
    .edit-tabs a { padding: 11px 8px; font-size: .9rem; }
    .edit-body { padding: 18px 16px 8px; }
    .edit-foot { padding: 12px 16px; }
    .share-body { padding: 16px 16px 24px; }
}/* la finestra di modifica non cambia altezza passando da una scheda all'altra */
dialog.edit-modal { height: min(92vh, 760px); }
@media (max-width: 700px) { dialog.edit-modal { height: 100dvh; } }

/* ---------- allineamenti di moduli e tabelle ---------- */
/* Pagine di lavoro fatte di moduli (gestione del canale, editor): una sola colonna, tutti i riquadri larghi uguali. */
.page.wide.form-page .main-col { max-width: 880px; margin: 0 auto; }
.form-page .edit-card { max-width: none; }
.form-page .main-col > h1 { margin: 4px 0 var(--gap); }
/* Righe di campi: i campi si allineano in basso anche quando un'etichetta ha una nota o va a capo; il pulsante sta alla loro altezza. */
.row:has(> label) { align-items: flex-end; margin: .9rem 0; }
.row > label { margin: 0; }
.row > label small { display: block; margin: 2px 0 0; }
.row:has(> label) > .btn, .row:has(> label) > button.btn { min-height: 44px; }
.row > label.check { align-self: center; flex: none; }
/* Una cella con più pulsanti resta una cella della tabella: così le righe di separazione non si spezzano. */
td.row { display: table-cell; white-space: nowrap; }
td.row > * { display: inline-flex; vertical-align: middle; margin: 2px 6px 2px 0; }
td.row > form { align-items: center; gap: 6px; }
td .row { flex-wrap: nowrap; margin: 0; }
td input, td select { margin-top: 0; min-width: 120px; }
.menu-editor { margin-bottom: 14px; }
.panel > form > .row:last-child, .panel > .row:last-child { margin-bottom: 0; }
.panel h3.editor-title { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- editor dei contenuti ---------- */
.content-editor { overflow: visible; }
.content-editor > .dialog-head { justify-content: flex-start; gap: 6px; padding: 8px 20px 8px 8px; border-radius: var(--radius-l) var(--radius-l) 0 0; }
.content-editor > .dialog-head h2 { flex: 1; text-transform: none; }
.content-editor > .dialog-head h2::first-letter { text-transform: uppercase; }
.content-editor .edit-body { overflow: visible; padding-bottom: 20px; }
.content-state { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 4px; }
.content-state:empty { display: none; }
.content-foot { position: sticky; bottom: 0; z-index: 5; background: var(--surface); border-radius: 0 0 var(--radius-l) var(--radius-l); flex-wrap: wrap; }
.content-foot .spacer { flex: 1; }
.schedule-btn { color: var(--primary); border: 1px solid var(--line-2); }
.schedule-btn:hover { border-color: var(--primary); color: var(--gold-hi); }
dialog.schedule-modal { width: min(450px, calc(100vw - 24px)); }
.schedule-body { text-align: left; }
.schedule-body p { margin: 0 0 6px; color: var(--text); }
.ed-add { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0; }
.ed-plus { width: 30px; height: 30px; border-radius: 50%; border: 1px dashed rgba(212, 175, 55, .55); background: transparent; color: var(--primary); font: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.ed-plus:hover, .ed-add.open .ed-plus { background: var(--primary-soft); border-style: solid; }
.ed-add .ed-palette { display: none; }
.ed-add.open .ed-palette { display: flex; }
.ed-palette { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ed-pick { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: .88rem; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s; }
.ed-pick::before { content: "+ "; color: var(--primary); font-weight: 700; }
.ed-pick:hover { border-color: var(--primary); color: var(--gold-hi); }
.ed-end { margin-top: 14px; padding: 18px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); text-align: center; background: rgba(var(--tint), .02); }
.ed-end-title { margin: 0 0 12px; font-weight: 600; color: var(--text); }
.ed-block .row { margin: 0 0 .9rem; }
@media (max-width: 700px) {
    .content-foot { position: static; }
    .content-foot .spacer { flex-basis: 100%; height: 0; }
    td.row { white-space: normal; }
}@media (min-width: 701px) { .form-page table { display: table; } }
.panel > form.row { margin-top: 14px; }
td.who strong, td.who small { display: block; }
td.who small { color: var(--text-3); overflow-wrap: anywhere; }

/* =====================================================================================
   Finestre e editor sulla traccia di Cam.TV (front-base-ui dialog-modal, front-base-css form-base,
   front-editor-base). Le misure sono quelle originali; i colori passano dalle variabili del tema,
   con l'oro al posto dell'arancione.
   ===================================================================================== */
.ctv-dialog, dialog.ctv-modal { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 650px; padding: 0; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 5px; }
.ctv-dialog { margin: 34px auto var(--gap); min-height: min(700px, calc(100vh - 150px)); }
dialog.ctv-modal { margin: auto; overflow: visible; max-height: calc(100vh - 60px); box-shadow: var(--shadow-pop); }
dialog.ctv-modal:not([open]) { display: none; }
dialog.ctv-modal::backdrop { background: var(--overlay); }

.ctv-dialog-header { position: relative; display: flex; align-items: center; justify-content: space-between; flex: none; height: 40px; min-height: 40px; padding: 5px 0 0; }
.ctv-dialog-header .title { position: absolute; left: 50%; top: 0; transform: translateX(-50%) translateY(-19px); display: flex; align-items: center; justify-content: center;
  min-width: 200px; max-width: calc(100% - 120px); padding: 10px 35px; background: var(--gold-grad); color: var(--on-primary); border: 2px solid var(--surface); border-radius: 25px;
  font-size: 16px; font-weight: 500; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); }
.ctv-dialog-header .title > svg { position: absolute; left: 10px; width: 24px; height: 24px; }
.ctv-dialog-header .title span { display: block; overflow: hidden; text-overflow: ellipsis; padding: 0 24px; min-width: 130px; text-align: center; }
.ctv-dialog-header .title span::first-letter { text-transform: uppercase; }
.ctv-dialog-header .arrow-container { display: flex; align-items: center; margin-left: 15px; height: 36px; color: var(--text-2); font-size: 14px; }
.ctv-dialog-header .arrow-container:hover { color: var(--text); }
.ctv-dialog-header .arrow-container[hidden] { display: none; }
.ctv-dialog-header .arrow-container svg { width: 20px; height: 20px; }
.ctv-dialog-header .arrow-container span { margin: 0 4px; }
.ctv-dialog-close { position: absolute; top: 8px; right: 10px; z-index: 4; display: flex; padding: 0; background: none; border: 0; color: #999; cursor: pointer; }
.ctv-dialog-close:hover { color: var(--text); }
.ctv-dialog-close svg { width: 24px; height: 24px; }

.ctv-dialog-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 23px 0 30px; scrollbar-width: thin; }
.ctv-dialog > .ctv-dialog-body { padding-top: 14px; padding-bottom: 18px; }
dialog.ctv-modal > .ctv-dialog-body { padding-top: 22px; padding-bottom: 14px; }
.ctv-dialog-footer { display: flex; justify-content: space-between; align-items: center; flex: none; min-height: 60px; border-top: 1px solid var(--line); }
.ctv-dialog > .ctv-dialog-footer { position: sticky; bottom: 0; z-index: 5; background: var(--surface); border-radius: 0 0 5px 5px; }
.ctv-dialog-footer > div { display: flex; align-items: center; min-width: 0; }
.ctv-dialog-footer > div:first-child { justify-content: flex-start; padding-left: 25px; }
.ctv-dialog-footer > div:last-child { justify-content: flex-end; padding-right: 30px; gap: 25px; }
.ctv-dialog-footer a, .foot-link { display: inline-flex; align-items: center; padding: 0; background: none; border: 0; font: inherit; font-size: 15px; color: var(--link); cursor: pointer; text-decoration: none; }
.ctv-dialog-footer a:hover, .foot-link:hover { color: var(--gold-hi); text-decoration: underline; }
.ctv-dialog-footer a svg { width: 24px; height: 24px; margin-right: 8px; }
.foot-link.danger { color: var(--danger); }
.ctv-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 100px; padding: 11px 22px; line-height: 1.3; font: inherit; font-size: 15px; font-weight: 500;
  color: var(--on-primary); background: var(--gold-grad); border: 1px solid transparent; border-radius: 4px; cursor: pointer; transition: opacity .3s ease; }
.ctv-button:hover, .ctv-button:active { opacity: .85; }
.ctv-button.small { min-width: 0; font-size: 14px; padding: 8px 16px; }
.ctv-button[hidden], .foot-link[hidden] { display: none; }
.plain-cta { color: var(--link); cursor: pointer; text-decoration: none; }
.plain-cta:hover { text-decoration: underline; }

/* campi: etichetta piccola sopra, campo alto 38px, errore a destra sotto il campo */
.ctv-input-field { position: relative; display: flex; flex-direction: column; width: 100%; margin: 0 0 5px; }
.ctv-input-field > label, .ctv-input-field .field-label { order: 0; align-self: flex-start; margin: 0; padding: 3px 5px; font-size: 13px; font-weight: 400; color: var(--text-3); text-align: left; }
.ctv-input-field:focus-within > label { color: var(--text); }
.ctv-input-field input:not([type=radio]):not([type=checkbox]):not([type=file]), .ctv-input-field textarea, .ctv-input-field select {
  order: 1; width: 100%; min-height: 38px; margin: 0; padding: 5px 15px; font: inherit; font-size: 15px; line-height: normal; color: var(--text); background: var(--field);
  border: 1px solid var(--line-2); border-radius: 3px; box-shadow: none; transition: all .3s ease-out; }
.ctv-input-field input:focus, .ctv-input-field textarea:focus, .ctv-input-field select:focus { border-color: transparent; box-shadow: 0 0 2px 1px var(--primary); outline: none; }
.ctv-input-field textarea { min-height: 90px; resize: none; }
.ctv-input-field .error { order: 2; height: 15px; margin: 2px 0; font-size: 12px; color: var(--danger); text-align: right; visibility: hidden; }
.ctv-input-field.error .error { visibility: visible; }
.ctv-input-field.error input, .ctv-input-field.error textarea, .ctv-input-field.error .placeholder_cont { border-color: transparent; box-shadow: 0 0 0 2px var(--danger); }
.ctv-input-field .tip, .ctv-dialog .tip { order: 2; margin: 3px 5px 8px; font-size: 12px; color: var(--text-3); }
.optional-fields-title { margin: 18px 0 8px; font-size: 15px; font-weight: 500; color: var(--text); }
.form-row { display: flex; align-items: flex-end; flex-wrap: wrap; margin: 0 -7px; }
.form-row > div { padding: 0 7px; }
.form-row > .col-6, .form-row.two > div { flex: 1 1 50%; width: 50%; min-width: 200px; }
.form-row[hidden] { display: none; }

/* scelte e spunte disegnate come in Cam.TV */
.ctv-input-field .options { order: 1; display: flex; flex-wrap: wrap; align-items: center; min-height: 30px; }
.ctv-input-field .options.column { flex-direction: column; align-items: flex-start; }
.ctv-input-field .options > div { display: flex; padding: 5px 0; margin-right: 15px; }
.ctv-input-field input[type=radio], .ctv-input-field input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.ctv-input-field input[type=radio] + label { position: relative; padding: 0 0 0 27px; font-size: 15px; line-height: 1.4; color: var(--text-2); cursor: pointer; user-select: none; }
.ctv-input-field input[type=radio] + label::before, .ctv-input-field input[type=radio] + label::after { content: ""; position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%; transition: .28s ease; }
.ctv-input-field input[type=radio] + label::before { border: 1px solid var(--line-2); }
.ctv-input-field input[type=radio] + label::after { background: var(--primary); transform: scale(0); }
.ctv-input-field input[type=radio]:checked + label { color: var(--text); }
.ctv-input-field input[type=radio]:checked + label::before { border-color: var(--primary); }
.ctv-input-field input[type=radio]:checked + label::after { transform: scale(.6); }
.ctv-input-field input[type=radio]:focus-visible + label::before, .ctv-input-field input[type=checkbox]:focus-visible + label::before { box-shadow: 0 0 0 3px var(--primary-soft); }
.ctv-input-field input[type=radio]:disabled + label { color: var(--text-3); cursor: auto; }
.ctv-input-field input[type=radio]:disabled + label::before { opacity: .4; }
.ctv-input-field input[type=checkbox] + label { position: relative; display: inline-block; align-self: flex-start; min-height: 25px; margin: 0 0 15px 2px; padding: 0 0 0 30px; font-size: 15px; line-height: 25px; color: var(--text-2); cursor: pointer; user-select: none; }
.ctv-input-field input[type=checkbox] + label::before { content: ""; position: absolute; top: 2px; left: 0; width: 18px; height: 18px; border: 1px solid var(--text-3); border-radius: 3px; transition: .2s; }
.ctv-input-field input[type=checkbox]:checked + label::before { top: -3px; left: 4px; width: 9px; height: 19px; border: 3px solid transparent; border-right-color: var(--primary); border-bottom-color: var(--primary); border-radius: 1px; transform: rotate(40deg); }

/* titolo e descrizione: i campi «in linea» del passo 1 */
.ctv-dialog .step-1 { margin-top: 25px; }
.ctv-input-field .ql-edit-field { border: 1px solid var(--line-2); border-radius: 3px; text-align: left; }
.ctv-input-field input.title-field { padding: 5px 10px; font-family: Lora, Georgia, Cambria, "Times New Roman", serif; font-size: 20px; font-weight: 700; line-height: 1.3; }
.ctv-input-field textarea.ql-edit-field { padding: 10px 15px; line-height: 1.35; resize: vertical; }
.ctv-input-field textarea.ql-edit-field.tall { min-height: 300px; }
.length-container { order: 2; padding: 2px 2px 0 15px; text-align: right; font-size: 11px; color: var(--text-3); }
.ctv-input-field .length-container + .error { margin-top: -14px; text-align: left; padding-left: 5px; }
.content-state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0; font-size: 13px; color: var(--text-3); }

/* caricamento della copertina e dei file delle card */
.upload-media-edit { position: relative; display: block; width: 100%; }
.upload-media-edit .placeholder_cont { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; padding: 25px; min-height: 260px; overflow: hidden;
  text-align: center; background-color: var(--surface-2); border: 1px solid var(--line-2); border-radius: 5px; cursor: pointer; transition: all .5s; }
.upload-media-edit .placeholder_cont[hidden] { display: none; }
.upload-media-edit .placeholder_cont::before { content: ""; position: absolute; inset: 0; background-image: var(--art-upload); background-size: 100%; background-position: center; background-repeat: no-repeat; opacity: var(--art-opacity); transition: all .5s; }
.upload-media-edit .placeholder_cont:hover::before { background-size: 110%; }
.upload-media-edit .placeholder_cont.file_over { opacity: .6; }
.upload-media-edit .placeholder_cont > * { position: relative; }
.upload-media-edit .placeholder_cont.small { min-height: 150px; padding: 16px; }
.upload-media-edit .big_icon { position: relative; display: block; width: 80px; height: 80px; margin-bottom: 20px; color: var(--primary); }
.upload-media-edit .big_icon svg { width: 80px; height: 80px; transition: all .5s; }
.upload-media-edit .big_icon::before { content: ""; position: absolute; left: -5px; bottom: 0; width: 90px; height: 9px; border-radius: 100%; background: rgba(var(--tint), .1); transition: all .5s; }
.upload-media-edit .placeholder_cont:hover .big_icon svg { transform: translateY(-4px); }
.upload-media-edit .placeholder_cont:hover .big_icon::before { transform: scaleX(.83); }
.upload-media-edit .placeholder_cont p { margin: 0 0 15px; font-size: 14px; color: var(--text-2); }
.upload-media-edit .placeholder_cont b { font-weight: 500; color: var(--text); }
.upload-media-edit .title-text-mobile { display: none; }
.upload-media-edit.loading { opacity: .5; pointer-events: none; }
.cover-preview { position: relative; border: 1px solid var(--line-2); border-radius: 5px; overflow: hidden; background: var(--field); }
.cover-preview[hidden] { display: none; }
.cover-preview img, .cover-preview video { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.cover-change { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 4px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 18px; cursor: pointer; }
.cover-change:hover { background: #000; }
.cover-change .ic { width: 20px; height: 20px; }

/* passo 2: editor a card (block-editor) */
.ctv-dialog .step-2 { margin-top: 10px; }
.ctv-block-editor { display: block; width: 100%; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.ctv-block-editor .first-plus { display: none; }
.ctv-block-editor.is-empty { height: calc(100vh - 330px); min-height: 380px; border-color: var(--line-2); }
.ctv-block-editor.is-empty .first-plus { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; max-width: 597px; height: 100%; margin: 0 auto; overflow: hidden; cursor: pointer; }
.ctv-block-editor.is-empty .first-plus > i { display: none; }
.ctv-block-editor.is-empty .first-plus::before { content: ""; position: absolute; inset: 0; background-image: var(--art-editor-empty); background-repeat: no-repeat; background-size: cover; background-position: center; opacity: var(--art-opacity); }
.ctv-block-editor.is-empty .first-plus::after { content: "+"; position: absolute; top: 50%; left: 50%; display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; margin-left: -30px; border-radius: 50%;
  background: var(--gold-grad); color: var(--on-primary); font-size: 40px; line-height: 1; transform: translateY(-100px); transition: all .5s; }
.ctv-block-editor.is-empty .first-plus:hover::after { transform: translateY(-110px) scale(1.08); }
.ctv-block-editor.is-empty .first-plus a { position: relative; display: block; margin-top: 30px; font-weight: 500; color: var(--link); }
.ctv-block-editor .cards-container { margin: 0; padding: 0; background: var(--surface); color: var(--text); border-radius: 5px; }
.ctv-card { position: relative; margin: -1px 0 0; min-height: 44px; }
.ctv-card .card-view { pointer-events: none; padding: 1px 0; }
.ctv-card .card-view > .blk { margin: 0; padding-top: 10px; padding-bottom: 10px; }
.ctv-card .card-view > .blk-img, .ctv-card .card-view > .blk-video, .ctv-card .card-view > .blk-two:not(.round) { padding: 0; }
.ctv-card .card-view > .blk-text { padding-left: 15px; padding-right: 15px; }
.ctv-card .card-view .blk-text > :first-child { margin-top: 0; }
.ctv-card .card-view .blk-text > :last-child { margin-bottom: 0; }
.block-edit-shield { position: absolute; inset: 0; cursor: pointer; }
.block-edit-shield .editing-overlay { position: absolute; inset: 0; border: 1px dashed var(--line-2); background: transparent; transition: background .15s; }
.block-edit-shield .editing-overlay:hover { background: rgba(var(--tint), .07); }
.shield-menu { position: absolute; top: 5px; right: 5px; display: flex; align-items: center; justify-content: center; width: 31px; height: 31px; padding: 3px; border: 0; border-radius: 4px; background: rgba(0, 0, 0, .38); color: #fff; cursor: pointer; }
.shield-menu:hover { background: rgba(0, 0, 0, .7); }
.shield-menu svg { width: 24px; height: 24px; }
.ctv-card > .adder { position: absolute; bottom: -10px; left: calc(50% - 10px); z-index: 1; width: 21px; height: 21px; padding: 0; border: 0; border-radius: 21px; background: var(--primary); color: var(--on-primary); font-size: 15px; font-weight: 700; line-height: 21px; text-align: center; cursor: pointer; transition: transform .15s; }
.ctv-card > .adder::after { content: "+"; }
.ctv-card > .adder:hover { transform: scale(1.25); }
.ctv-card:last-child { margin-bottom: 14px; }

/* «Seleziona elemento» */
.choose-card-dialog .card-buttons { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-start; margin: 20px 0 0; }
.choose-card-dialog .card-buttons > button { display: block; width: 30.56%; margin: 10px 8px 30px; padding: 5px; background: transparent; border: 0; cursor: pointer; font: inherit; }
.choose-card-dialog .card-buttons svg { display: block; width: 100%; max-width: 150px; height: auto; margin: 0 auto; padding: 6px; border-radius: 8px; background: var(--art-tile); opacity: .85; pointer-events: none; }
.choose-card-dialog .card-buttons span { display: block; padding-top: 8px; font-size: 15px; font-weight: 500; line-height: 1.3; text-align: center; color: var(--text-2); pointer-events: none; }
.choose-card-dialog .card-buttons > button:hover svg { opacity: 1; }
.choose-card-dialog .card-buttons > button:hover span { color: var(--text); }

/* menu della card */
.ctv-context-menu { position: fixed; z-index: 1000000; width: 200px; padding: 12px 0; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; box-shadow: 1px 1px 8px rgba(0, 0, 0, .35); user-select: none; }
.ctv-context-menu ul { margin: 0; padding: 0; list-style: none; }
.ctv-context-menu li { display: flex; align-items: center; font-size: 15px; letter-spacing: .5px; color: var(--text-2); }
.ctv-context-menu li:not(.separator) { padding: 10px 20px; cursor: pointer; }
.ctv-context-menu li:not(.separator):not([disabled]):hover { background: rgba(var(--tint), .07); color: var(--text); }
.ctv-context-menu li[disabled] { color: var(--text-3); opacity: .5; cursor: default; }
.ctv-context-menu .line { width: 100%; height: 1px; margin: 5px 0; border-bottom: 1px solid var(--line); }

/* testo della card e finestrelle di messaggio */
.ed-text .ed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 6px; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 3px 3px 0 0; background: var(--surface-2); }
.ed-text .ed-tool { min-width: 30px; height: 28px; padding: 0 6px; border: 0; border-radius: 3px; background: none; font-size: 14px; color: var(--text-2); }
.ed-text .ed-tool:hover { background: rgba(var(--tint), .09); color: var(--text); }
.ed-text .ed-tool.b { font-weight: 800; } .ed-text .ed-tool.i { font-style: italic; } .ed-text .ed-tool.u { text-decoration: underline; }
.ed-sep { width: 1px; height: 18px; margin: 0 5px; background: var(--line-2); }
.ed-text .ed-rich { min-height: 260px; max-height: 50vh; overflow-y: auto; border-radius: 0 0 3px 3px; }
dialog.ctv-popup { max-width: 420px; }
dialog.ctv-popup .ctv-dialog-body { padding: 26px 30px 18px; text-align: center; }
dialog.ctv-popup h3 { margin: 0 0 10px; font-size: 18px; }
dialog.ctv-popup p { margin: 0; color: var(--text-2); }
#card-dialog .ctv-dialog-body { min-height: 200px; }

@media (max-width: 700px) {
    .ctv-dialog { margin: 28px 0 0; border-radius: 0; border-left: 0; border-right: 0; min-height: calc(100dvh - 190px); }
    dialog.ctv-modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border: 0; border-radius: 0; overflow: hidden; }
    dialog.ctv-popup { height: auto; margin: auto 12px; width: auto; border-radius: 5px; border: 1px solid var(--line-2); }
    dialog.ctv-modal .ctv-dialog-header { height: 60px; min-height: 60px; padding: 0; border-bottom: 1px solid var(--line); justify-content: center; }
    dialog.ctv-modal .ctv-dialog-header .title { position: static; transform: none; background: none; border: 0; box-shadow: none; color: var(--text); font-size: 18px; }
    dialog.ctv-modal .ctv-dialog-close { top: 18px; }
    .ctv-dialog-body { padding: 0 13px 0 20px; }
    .ctv-dialog > .ctv-dialog-footer { position: static; }
    .ctv-dialog-footer > div:first-child { padding-left: 15px; }
    .ctv-dialog-footer > div:last-child { padding-right: 15px; gap: 15px; }
    .ctv-dialog-header .arrow-container span { display: none; }
    .upload-media-edit .title-text { display: none; }
    .upload-media-edit .title-text-mobile { display: block; }
    .choose-card-dialog .card-buttons { justify-content: space-between; }
    .choose-card-dialog .card-buttons > button { width: 45%; margin: 10px 5px 30px; }
    .form-row > .col-6, .form-row.two > div { flex-basis: 100%; width: 100%; }
}

/* =====================================================================================
   Tema chiaro. Lo scuro è quello predefinito (variabili in cima al file); il chiaro riprende
   i grigi di Cam.TV e Liberly chiari, con l'oro più scuro dove fa da testo.
   ===================================================================================== */
:root { --tint: 255, 255, 255; --art-opacity: .1; --art-tile: #f3f3f5; }
:root[data-theme="light"] {
  --tint: 0, 0, 0; --art-opacity: 1; --art-tile: transparent;
  --gold-hi: #6b4e09;
  --primary: #b98f1e;
  --primary-soft: rgba(185, 143, 30, .14);
  --link: #8a6510;
  --page: #ebebeb;
  --shell: #f6f6f6;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --surface-3: #e8e8ec;
  --field: #ffffff;
  --line: #dddddd;
  --line-2: #cdcdd2;
  --text: #161616;
  --text-2: #545454;
  --text-3: #7e7e7e;
  --danger: #d9302c;
  --ok: #15a831;
  --overlay: rgba(0, 0, 0, .5);
  --shadow-pop: 0 14px 40px rgba(0, 0, 0, .22), 0 0 0 1px var(--line);
  color-scheme: light;
}
:root[data-theme="light"] html, html[data-theme="light"] { scrollbar-color: #c4c4cc transparent; }
[data-theme="light"] ::selection { color: #161616; }
.theme-switch { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.theme-switch .state { margin-left: auto; font-size: .8rem; color: var(--text-3); }dialog.ctv-modal { max-height: calc(100vh - 90px); }
.ctv-dialog .step-3 { margin-top: 20px; font-size: 15px; }
.ctv-dialog .step-3 .ctv-input-field + .ctv-input-field { margin-top: 14px; }
.ctv-dialog .content-state { margin-bottom: 6px; }
@media (max-width: 700px) {
    .ctv-dialog-header .title { min-width: 0; max-width: calc(100% - 96px); padding: 9px 18px 9px 40px; }
    .ctv-dialog-header .title span { min-width: 0; padding: 0; }
    dialog.ctv-modal .ctv-dialog-header .title { max-width: calc(100% - 70px); padding: 0; }
}
.share-qr { width: 200px; height: 200px; }
.share-save { margin: 14px 0 0; }

/* ---------- «Crea» e «Crea Post» (front-dialog-create, front-dialog-post) ---------- */
.ctv-dialog.auto-height { min-height: 0; }
.create-dialog { text-align: start; padding-bottom: 10px; }
.create-dialog .truncate { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.create-dialog .channel { position: relative; display: flex; align-items: center; padding: 10px 10px 10px 13px; color: var(--text); cursor: pointer; }
.create-dialog .channel.active::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--primary); }
.create-dialog .channel:not(:first-child) { border-top: 1px solid var(--line); }
.create-dialog .channel .avatar { flex: none; }
.create-dialog .name-container { margin-left: 10px; overflow: hidden; flex-grow: 1; min-width: 0; }
.create-dialog .channel .name { font-size: 16px; font-weight: 600; color: var(--text); }
.create-dialog .channel .description { font-size: 14px; color: var(--text-2); }
.create-dialog .channel-picker { position: relative; margin: 40px 0 15px; }
.create-dialog .btn-pick-channel { max-width: 420px; margin: 0 auto; border: 1px solid var(--line); list-style: none; }
.create-dialog .btn-pick-channel::-webkit-details-marker { display: none; }
.create-dialog .arrow { display: flex; border-radius: 50%; color: var(--text-3); transition: transform .2s; }
.create-dialog .arrow svg { width: 24px; height: 24px; }
.create-dialog .channel-picker[open] .arrow { transform: rotate(180deg); background: var(--surface-3); }
.create-dialog .channels-container { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; width: 100%; max-width: 420px; max-height: 320px; overflow: auto; background: var(--surface-2); box-shadow: 0 1px 5px rgba(0, 0, 0, .25), 0 0 0 1px var(--line); }
.create-dialog .channels-container .channel:hover { background: rgba(var(--tint), .05); }
.create-dialog .what-create { margin: 40px 0 15px; font-size: 20px; font-weight: 700; color: var(--text); }
.create-dialog .add-buttons-container { padding-bottom: 30px; }
.create-dialog .content { display: flex; align-items: center; margin-bottom: 10px; padding: 10px; border-radius: 5px; color: var(--text); cursor: pointer; }
.create-dialog .content:hover { background: var(--surface-2); color: var(--text); }
.create-dialog .icon-wrapper { flex: none; display: flex; margin-right: 15px; padding: 15px; border-radius: 50%; background: var(--gold-grad); color: var(--on-primary); }
.create-dialog .icon-wrapper .ic { display: block; width: 24px; height: 24px; fill: currentColor; }
.create-dialog .content .name { display: block; font-size: 18px; font-weight: 600; color: var(--text); }
.create-dialog .content .description { display: block; margin-top: 5px; font-size: 14px; color: var(--text-2); }
.create-dialog .create-channel { margin: 30px 0 10px; }
.plain-link-secondary { color: var(--link); cursor: pointer; }
.plain-link-secondary:hover { text-decoration: underline; }
.ctv-input-field textarea.post-text { min-height: 160px; }
.ctv-input-field input[type=file]:not([hidden]) { order: 1; padding: 7px; }
.media-chosen { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 6px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--field); }
.media-chosen[hidden] { display: none; }
.media-chosen .media-item { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 3px; background: var(--surface-2); font-size: 13px; color: var(--text-2); text-align: center; overflow-wrap: anywhere; padding: 0; }
.media-chosen .media-item:only-of-type { grid-column: 1 / -1; aspect-ratio: auto; max-height: 420px; }
.media-chosen .media-item img, .media-chosen .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-chosen .media-item:only-of-type img, .media-chosen .media-item:only-of-type video { object-fit: contain; max-height: 420px; }
.media-chosen .media-item span { padding: 20px 12px; }
.multi-button { position: relative; }
.multi-button .popup { position: absolute; right: -7px; bottom: calc(100% + 5px); z-index: 5; display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 100%; padding: 5px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 5px; box-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.multi-button .popup[hidden] { display: none; }
.multi-button .popup .ctv-button { white-space: nowrap; }
.ctv-button.outline { background: transparent; color: var(--link); border-color: var(--primary); }
@media (max-width: 700px) {
    .create-dialog .content { padding: 3px 10px 3px 5px; }
    .create-dialog .content .description { font-size: 13px; line-height: 1.3; }
}.multi-button .popup a.ctv-button { justify-content: center; padding: 11px 22px; border: 1px solid var(--primary); color: var(--link); text-decoration: none; }

/* ---------- «Gestione menu» del canale (front-dialog-menu) ---------- */
.menu-dialog { display: flex; flex-direction: column; min-height: 0; flex: 1; margin: 0; }
dialog.menu-modal { height: min(700px, calc(100vh - 90px)); }
.menu-card .ctv-dialog-body { padding-top: 14px; padding-bottom: 14px; }
.menu-dialog .dropdown-wrapper { margin: 20px 10px; }
.menu-dialog .separator { display: flex; align-items: center; margin: 10px 0; font-size: 14px; color: var(--text-2); }
.menu-dialog .separator::before, .menu-dialog .separator::after { content: ""; flex-grow: 1; border-bottom: 1px solid var(--line); }
.menu-dialog .separator::before { margin-right: 5px; }
.menu-dialog .separator::after { margin-left: 5px; }
.menu-dialog .external-page-link-wrapper > p { margin: 0 0 15px; text-align: left; font-size: 15px; font-weight: 500; color: var(--text); }
.menu-dialog .external-page-link-form { display: flex; align-items: flex-start; gap: 10px; }
.menu-dialog .external-page-link-form .ctv-input-field { margin: 0; }
.menu-dialog .external-page-link-form .ctv-input-field:first-child { min-width: 230px; }
.menu-dialog .external-page-link-form .ctv-button { min-height: 38px; padding: 7px 22px; }
.menu-dialog .menu-list { margin: 0 10px; }
.menu-entry { position: relative; background: var(--surface); transition: transform .2s ease-out; }
.menu-entry .padded-wrapper { display: flex; align-items: center; max-height: 60px; padding: 12px 0; }
.menu-entry:not(:last-child) .padded-wrapper { border-bottom: 1px solid var(--line); }
.menu-entry .move-handle, .menu-entry .menu-btn { display: flex; flex: none; padding: 0; border: 0; background: none; color: var(--text-3); }
.menu-entry .move-handle { cursor: grab; touch-action: none; }
.menu-entry .move-handle svg, .menu-entry .menu-btn svg { width: 24px; height: 24px; }
.menu-entry .menu-btn { margin-left: 20px; cursor: pointer; }
.menu-entry .menu-btn:hover, .menu-entry .move-handle:hover { color: var(--text); }
.menu-entry .info { flex: 1 1 auto; min-width: 0; overflow: hidden; text-align: start; }
.menu-entry .info p { margin: 0 0 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-entry .name { font-weight: 500; color: var(--text); }
.menu-entry .kind { margin-left: 8px; font-size: 12px; color: var(--text-3); }
.menu-entry .main-page-label { display: none; margin-left: 7px; padding: 3px 7px; border-radius: 5px; background: var(--surface-3); font-size: 11px; color: var(--text-2); }
.menu-entry.home-assigned .main-page-label { display: inline; }
.menu-entry .status { display: flex; margin-left: 20px; }
.menu-entry .status-icon { width: 24px; height: 24px; color: var(--primary); }
.menu-entry.dragging { z-index: 2; transition: none; user-select: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.menu-entry.dragging * { cursor: grabbing !important; }
dialog.ctv-rename { max-width: 420px; }
dialog.ctv-rename .ctv-dialog-body p { margin: 0 0 12px; color: var(--text-2); }
@media (max-width: 700px) {
    .menu-dialog .external-page-link-form { flex-direction: column; align-items: stretch; }
    .menu-dialog .external-page-link-form .ctv-input-field:first-child { min-width: 0; }
    dialog.menu-modal { height: 100dvh; }
}.menu-dialog .tip { margin: 14px 10px 4px; }

/* ---------- «Dominio web» del canale (front-dialog-domain) ---------- */
.domain-dialog { display: flex; flex-direction: column; min-height: 0; flex: 1; text-align: start; }
.domain-status-row { display: flex; justify-content: flex-end; }
.domain-status { position: relative; margin-bottom: 20px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 5px; font-size: 15px; }
.domain-status .led { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--text-3); vertical-align: middle; }
.domain-status > span { vertical-align: middle; }
.domain-status[data-status="pending"] .led { background: #f7b500; }
.domain-status[data-status="connected"] .led { background: var(--ok); }
.tooltip-wrapper { position: relative; display: inline-block; cursor: help; }
.tooltip-wrapper svg { width: 13px; margin-left: 2px; vertical-align: middle; }
.tooltip-wrapper svg circle { stroke: var(--text-3); fill: transparent; }
.tooltip-wrapper svg rect { fill: var(--text-3); }
.tooltip-popup { position: absolute; z-index: 3; top: calc(100% + 8px); right: -15px; width: 260px; padding: 15px; border-radius: 5px; background: #505d68; color: #fff; font-size: 13px; font-weight: 400; line-height: 1.4; text-align: left; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: opacity .3s ease-out; }
.tooltip-wrapper:not(:hover):not(:focus) .tooltip-popup { opacity: 0; visibility: hidden; }
.domain-dialog .grey-area-title { margin-bottom: 10px; font-weight: 500; color: var(--text-3); }
.domain-dialog .grey-area { padding: 10px; border-radius: 5px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.domain-dialog .grey-area p { margin: 0; }
.domain-dialog .grey-area p:not(:first-child) { margin-top: 15px; }
.domain-dialog .grey-area ul { margin: 6px 0 0; padding: 0; list-style: none; }
.domain-dialog .grey-area li { position: relative; padding-left: 22px; line-height: 1.5; }
.domain-dialog .grey-area li::before { content: ""; position: absolute; left: 4px; top: 4px; width: 5px; height: 10px; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.domain-dialog .grey-area strong { font-weight: 700; color: var(--text); }
.domain-dialog .domain-intro .grey-area { margin-bottom: 20px; }
.domain-dialog .question { margin: 0 0 20px; }
.domain-dialog .domain-wrapper { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 5px; }
.domain-dialog .domain-section { padding: 10px; }
.domain-dialog .domain-add { align-items: flex-end; flex-wrap: nowrap; margin-top: 0; margin-bottom: 10px; }
.domain-dialog .domain-add .ctv-input-field { flex: 1 1 auto; width: auto; margin: 0; }
.domain-dialog .ctv-button.small { padding: 8px 16px; }
.domain-dialog .ctv-button svg { width: 20px; height: 20px; margin-right: 8px; }
.domain-dialog .icon-success { padding: 20px; text-align: center; color: var(--ok); }
.domain-dialog .icon-success svg { width: 80px; height: 80px; }
.domain-dialog .title-header { margin-bottom: 15px; text-align: center; }
.domain-dialog .title-header span { font-size: 17px; font-weight: 500; }
.domain-list { margin: 0 0 16px; padding: 0; list-style: none; }
.domain-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.domain-list li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.domain-list small { display: block; font-size: 13px; color: var(--text-3); }
.domain-list form { flex: none; }
.domain-dialog [hidden] { display: none; }
@media (max-width: 700px) {
    .domain-dialog .domain-add { flex-wrap: wrap; }
    .domain-list li { flex-wrap: wrap; }
    .domain-list li > span { flex-basis: 100%; }
}
/* ---------- «Abbonamento» del canale (front-dialog-membership) ---------- */
.membership-dialog { display: flex; flex-direction: column; min-height: 0; flex: 1; margin: 0; font-size: 15px; text-align: left; }
.membership-dialog .intro { margin: 15px 0; }
.membership-dialog .field-label { margin-bottom: 5px; color: var(--text); }
.membership-dialog .field-label b { font-weight: 500; color: var(--text-2); }
.membership-dialog .field-wrapper { display: flex; align-items: center; }
.membership-dialog .field-wrapper > div:not(:last-child) { margin-right: 10px; }
.membership-dialog .monthly-price-field { margin-bottom: 22px; }
.membership-dialog .monthly-price-field input { width: 110px; text-align: right; }
.membership-dialog .monthly-price-field .tip { margin: 6px 0 0; }
.membership-dialog .advantages-field .ctv-input-field { margin-bottom: 12px; }
.membership-dialog .advantages-field svg { display: block; width: 24px; height: 24px; color: var(--ok); }
.membership-dialog .advantages-field .input-wrapper { flex-grow: 1; }
.membership-dialog .advantages-field .field-wrapper > div:last-child { align-self: flex-start; color: var(--text-3); }
.benefits { list-style: none; margin: 0 0 18px; padding: 0; }
.benefits li { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; }
.benefits svg { flex: none; width: 22px; height: 22px; color: var(--ok); }
/* ---------- logo del titolare: l'immagine completa, con il motto, così com'è ----------
   Il file è l'originale (2000 × 667): qui se ne fissa solo l'altezza, il browser lo rimpicciolisce da sé.
   La testata è più alta di prima per dargli spazio. L'immagine ha il fondo nero: nel tema chiaro resta un riquadro nero. */
:root { --topbar: 68px; }
.logo { gap: 0; padding: 0; margin: 0 12px 0 2px; border-radius: 6px; background: #000; overflow: hidden; }
.logo .logo-full { display: block; height: calc(var(--topbar) - 6px); width: auto; max-width: none; }
@media (max-width: 700px) { :root { --topbar: 58px; } }
/* =====================================================================================
   Proposta di redesign del 19/11/2026 (docs/10): nero #080809, schede antracite #1B1B1F, oro pieno solo
   sugli inviti principali, niente grandi fondali viola, schede con angoli da 12px e pulsanti da 8px.
   ===================================================================================== */
.post, .composer, .comments, .panel, .channel-page, .dialog, .narrow, .people, .empty { border-radius: var(--radius-l); }
.btn, .button, .ctv-button { background: var(--primary); box-shadow: none; border-radius: 8px; }
.btn:hover, .button:hover { filter: brightness(1.06); transform: none; }
.btn.outline, .button.ghost, .ctv-button.outline { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn.outline:hover, .button.ghost:hover { background: var(--surface-2); border-color: var(--primary); color: var(--text); }
.btn.ghost { background: transparent; }
.icon-btn.create { box-shadow: none; }
.side-box.center { background: none; }
.side-box.center h2 { color: var(--text); font-size: .95rem; letter-spacing: 0; text-transform: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* testata di chi non ha fatto l'accesso: ricerca ampia, «Esplora» e «Accedi» come collegamenti, «Registrati» discreto */
.topbar.visitor .top-search { max-width: 520px; }
.top-link { padding: 10px 12px; font-size: .95rem; font-weight: 500; color: var(--text-2); border-radius: 8px; }
.top-link:hover { color: var(--text); background: var(--surface); }

/* homepage pubblica */
.page.home-public { max-width: 1150px; background: transparent; border: 0; padding-top: 0; }
.home-public .main-col { padding: 0; }
.pub-hero { position: relative; padding: clamp(44px, 9vw, 96px) 0 clamp(36px, 6vw, 64px); max-width: 760px; }
.pub-hero::before { content: ""; position: absolute; z-index: -1; top: -40px; right: -46%; width: 90%; height: 130%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(212, 175, 55, .13), transparent 72%); }
.pub-kicker { margin: 0 0 18px; font-size: .8rem; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--primary); }
.pub-hero h1 { font-size: clamp(1.9rem, 5.2vw, 3.5rem); line-height: 1.08; letter-spacing: -.02em; color: var(--text); }
.pub-lead { margin: 20px 0 30px; max-width: 46ch; font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.55; color: var(--text-2); }
.pub-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.pub-cta .btn { min-height: 46px; padding: 12px 22px; font-size: 1rem; }
.pub-section { padding: clamp(28px, 5vw, 48px) 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--topbar) + 8px); }
.pub-head { margin-bottom: 22px; }
.pub-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); letter-spacing: -.015em; }
.pub-head p { margin: 6px 0 0; color: var(--text-2); }
.pub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.pub-grid.channels { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pub-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, transform .15s; }
.pub-card:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-2px); }
.pub-cover { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; background: var(--deco); color: var(--text-3); }
.pub-cover > img:not(.avatar) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pub-cover > .ic { width: 40px; height: 40px; opacity: .6; }
.pub-cover .avatar { position: absolute; left: 14px; bottom: -22px; width: 52px; height: 52px; font-size: 1.2rem; border: 2px solid var(--surface); }
.pub-body { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: 16px 16px 18px; }
.pub-grid.channels .pub-body { padding-top: 32px; }
.pub-meta { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.pub-title { font-size: 1.08rem; line-height: 1.3; font-weight: 650; overflow-wrap: anywhere; }
.pub-text { font-size: .93rem; line-height: 1.5; color: var(--text-2); }
.pub-by { margin-top: auto; padding-top: 8px; font-size: .84rem; color: var(--text-3); }
.pub-more { margin: 24px 0 0; text-align: center; }
.pub-themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.pub-themes a { display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 96px; padding: 18px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s; }
.pub-themes a:hover { color: var(--text); border-color: var(--primary); }
.pub-themes strong { font-size: 1.02rem; }
.pub-themes span { font-size: .88rem; line-height: 1.45; color: var(--text-2); }
.pub-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; }
.pub-points li { display: flex; flex-direction: column; gap: 8px; padding-left: 16px; border-left: 2px solid var(--primary); }
.pub-points strong { font-size: 1.05rem; }
.pub-points span { color: var(--text-2); line-height: 1.5; }
.pub-authors { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: clamp(12px, 3vw, 28px) 0 clamp(40px, 6vw, 72px); padding: 28px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.pub-authors h2 { font-size: 1.3rem; }
.pub-authors p { margin: 6px 0 0; max-width: 56ch; color: var(--text-2); }

/* piede dei visitatori */
.site-foot { border-top: 1px solid var(--line); background: var(--page); }
.site-foot-in { max-width: 1150px; margin: 0 auto; padding: 28px 50px 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap; }
.site-foot-brand { margin: 0; display: flex; flex-direction: column; }
.site-foot-brand strong { letter-spacing: .22em; text-transform: uppercase; font-size: .95rem; }
.site-foot-brand span { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--primary); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-foot nav a { padding: 8px 0; font-size: .92rem; color: var(--text-2); }
.site-foot nav a:hover { color: var(--text); }

@media (max-width: 1000px) {
    .pub-grid.channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pub-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .hide-mobile { display: none !important; }
    .page.home-public { padding-left: 16px; padding-right: 16px; }
    .pub-hero::before { display: none; }
    .pub-cta .btn { width: 100%; justify-content: center; }
    .pub-grid, .pub-grid.channels { grid-template-columns: 1fr; gap: 16px; }
    .pub-points { grid-template-columns: 1fr; gap: 20px; }
    .pub-authors { padding: 22px 20px; }
    .pub-authors .btn { width: 100%; justify-content: center; }
    .site-foot-in { padding: 24px 16px 30px; }
    .site-foot nav a { padding: 10px 0; }
}/* il logo ha il fondo nero pieno: nel tema scuro la testata prende lo stesso nero, cosi' non si vede il riquadro */
:root:not([data-theme="light"]) .topbar { background: #000; }

/* ---------- hero con immagine a tutta larghezza (immagine del titolare, 1792 × 1024) ----------
   L'immagine riempie la hero mantenendo le sue proporzioni; una velatura scura da sinistra tiene leggibile
   il testo e una in basso la fonde con la pagina. La hero resta scura anche nel tema chiaro. */
.pub-hero.has-image { position: relative; display: flex; align-items: center; max-width: none; margin: 0 -50px; padding: 40px 50px; overflow: hidden;
  aspect-ratio: 1792 / 1024; max-height: min(660px, calc(100vh - var(--topbar) - 60px)); min-height: 420px; width: calc(100% + 100px); background: #080809; }
.pub-hero.has-image::before { display: none; }
.pub-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.pub-hero.has-image::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 8, 9, .94) 0%, rgba(8, 8, 9, .8) 30%, rgba(8, 8, 9, .28) 58%, rgba(8, 8, 9, 0) 78%),
              linear-gradient(0deg, #080809 0%, rgba(8, 8, 9, 0) 26%); }
.pub-hero-text { position: relative; z-index: 1; max-width: 540px; }
.pub-hero.has-image h1 { color: #f2f0ea; text-shadow: 0 2px 24px rgba(0, 0, 0, .6); }
.pub-hero.has-image .pub-lead { color: #d6d3ca; text-shadow: 0 1px 12px rgba(0, 0, 0, .7); }
.pub-hero.has-image .pub-kicker { color: #d4af37; }
.pub-hero.has-image .btn.outline { color: #f2f0ea; border-color: rgba(242, 240, 234, .38); background: rgba(8, 8, 9, .35); }
.pub-hero.has-image .btn.outline:hover { border-color: #d4af37; background: rgba(8, 8, 9, .6); color: #f2f0ea; }
.pub-hero.has-image + .pub-section { border-top: 0; }
:root[data-theme="light"] .pub-hero.has-image::after { background: linear-gradient(90deg, rgba(8, 8, 9, .94) 0%, rgba(8, 8, 9, .8) 30%, rgba(8, 8, 9, .28) 58%, rgba(8, 8, 9, 0) 78%); }
@media (max-width: 700px) {
    /* su telefono l'immagine sta sopra, intera, e il testo sotto: così non viene tagliata */
    .pub-hero.has-image { display: block; aspect-ratio: auto; max-height: none; min-height: 0; margin: 0 -16px; width: calc(100% + 32px); padding: 0; }
    .pub-hero-img { position: relative; inset: auto; display: block; width: 100%; height: auto; }
    .pub-hero.has-image::after { inset: 0 0 auto 0; aspect-ratio: 1792 / 1024; background: linear-gradient(0deg, #080809 0%, rgba(8, 8, 9, 0) 45%); }
    .pub-hero-text { max-width: none; padding: 0 16px 28px; margin-top: -34px; }
    :root[data-theme="light"] .pub-hero.has-image::after { background: linear-gradient(0deg, #080809 0%, rgba(8, 8, 9, 0) 45%); }
}
/* Pulsante mostrato ma non attivo (registrazione chiusa). */
.btn.is-off, .btn.is-off:hover { opacity: .4; cursor: not-allowed; transform: none; filter: none; }

/* Cambio di lingua nella testata. */
.lang-switch { font-size: .8rem; font-weight: 600; letter-spacing: .04em; }

/* Modulo in invio (caricamento di un video): i pulsanti non si premono due volte e si vede che sta lavorando. */
form.is-sending button, form.is-sending a.foot-link { pointer-events: none; opacity: .55; }
form.is-sending { cursor: progress; }
.sending-note { margin: 0; padding: 10px 24px; color: var(--gold, #D4AF37); font-size: .95rem; }
.sending-note::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sending-spin .8s linear infinite; }
@keyframes sending-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sending-note::before { animation: none; } }

/* Notarizzazione (docs/12): fascia in cima al post con la transazione, e pagina della storia delle versioni. */
.notary-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: .9rem; }
.notary-bar.ok { border-color: rgba(212, 175, 55, .55); }
.notary-seal { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--gold, #D4AF37); color: #111; }
.notary-bar.wait .notary-seal { background: transparent; border: 1px solid currentColor; color: inherit; }
.notary-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notary-text span { color: var(--text-2); display: flex; gap: 6px; min-width: 0; }
.notary-tx { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.notary-more { flex: none; white-space: nowrap; }
.notary-page code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; overflow-wrap: anywhere; }
.notary-list { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 14px; }
.notary-version { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.notary-version.ok { border-color: rgba(212, 175, 55, .45); }
.notary-version header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notary-version header time { margin-left: auto; color: var(--text-2); font-size: .85rem; }
.notary-title { margin: 8px 0; font-weight: 600; }
.notary-version dl { margin: 0 0 10px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.notary-version dt { color: var(--text-2); }
.notary-version dd { margin: 0; min-width: 0; }
@media (max-width: 640px) { .notary-version dl { grid-template-columns: 1fr; gap: 2px; } .notary-version dd { margin-bottom: 8px; } }

/* ===========================================================
   WHY SUBPLANCK · versione oro/nero ispirata al concept approvato.
   Il file hero-portale.webp e le regole .pub-hero restano invariati.
   =========================================================== */
.pub-section.pub-why {
  --why-gold: #d4af37;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 -50px;
  width: calc(100% + 100px);
  padding: clamp(32px, 4vw, 48px) 50px 24px;
  border-top: 0;
  color: #f2f0ea;
  background:
    radial-gradient(62% 65% at 58% -18%, rgba(151, 93, 22, .20), transparent 75%),
    radial-gradient(48% 56% at 94% 85%, rgba(161, 96, 12, .09), transparent 78%),
    #09090b;
}
.pub-section.pub-why::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50px;
  right: 50px;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, #95681a, #e5bc52 32%, #fff0b4 57%, #cf9630 75%, transparent);
  box-shadow: 0 0 9px rgba(242, 186, 71, .55), 0 0 22px rgba(227, 151, 33, .25);
}
.pub-section.pub-why::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50px;
  right: 50px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(190, 178, 157, .3), rgba(212,175,55,.65) 54%, rgba(190,178,157,.15));
}
.pub-why-head {
  position: relative;
  z-index: 1;
  margin: 0 0 clamp(22px, 2.8vw, 30px);
}
.pub-why-kicker {
  margin: 0 0 12px;
  color: #bfbcc1;
  font-size: clamp(.92rem, 1.35vw, 1.05rem);
  line-height: 1.45;
  letter-spacing: .005em;
}
.pub-why-head h2 {
  margin: 0;
  color: #f6f3ec;
  font-size: clamp(2.2rem, 4vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.13;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .55);
}
.pub-why-rule {
  display: block;
  width: 70px;
  height: 4px;
  margin-top: 18px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ffdf77, #c99320);
  box-shadow: 0 0 10px rgba(255, 199, 67, .7), 0 0 20px rgba(203, 137, 25, .25);
}
.pub-why-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.pub-why-grid li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 1.45vw, 20px);
  min-width: 0;
  min-height: 208px;
  padding: clamp(18px, 2vw, 24px);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(30, 26, 19, .94), rgba(15, 15, 17, .97) 62%, rgba(23, 20, 16, .96)) padding-box,
    linear-gradient(135deg, rgba(248, 206, 104, .68), rgba(114, 101, 76, .32) 38%, rgba(212, 175, 55, .26) 75%, rgba(243, 185, 57, .58)) border-box;
  box-shadow: inset 0 1px rgba(255, 236, 170, .08), 0 16px 34px -21px #000;
  transition: transform .2s ease, box-shadow .2s ease;
}
.pub-why-grid li::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 19%;
  right: 18%;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255, 227, 147, .95), rgba(222, 161, 44, .38) 32%, transparent 74%);
  filter: blur(2px);
  box-shadow: 0 2px 18px rgba(255, 192, 49, .32);
}
.pub-why-grid li::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -86px;
  height: 120px;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(226, 161, 39, .16), transparent 74%);
}
.pub-why-grid li:nth-child(3)::after { background: radial-gradient(ellipse at center, rgba(236, 174, 50, .25), transparent 76%); }
.pub-why-grid li:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 1px rgba(255, 236, 170, .14), 0 0 28px -15px rgba(235, 170, 50, .6), 0 19px 38px -21px #000;
}
.pub-why-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(221, 175, 66, .48);
  border-radius: 16px;
  color: #f3c442;
  background: linear-gradient(145deg, #2d2415, #14120d 70%);
  box-shadow: inset 0 1px rgba(255, 220, 135, .12), 0 3px 18px rgba(199, 129, 23, .2);
}
.pub-why-icon svg {
  width: 33px;
  height: 33px;
  filter: drop-shadow(0 0 4px rgba(244, 185, 40, .32));
}
.pub-why-card-copy { position: relative; z-index: 1; flex: 1; min-width: 0; }
.pub-why-card-copy h3 {
  margin: 1px 0 10px;
  color: #f7f4ed;
  font-size: clamp(1.06rem, 1.52vw, 1.36rem);
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1.22;
}
.pub-why-card-copy p {
  margin: 0;
  color: #dedbd7;
  font-size: clamp(.91rem, 1.12vw, .99rem);
  line-height: 1.62;
  overflow-wrap: anywhere;
}
.pub-why-bottom {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 145px;
  margin-top: 24px;
  padding: 8px 0 32px;
}
.pub-why-button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  padding: 10px 19px;
  border: 1.5px solid #f1c84b;
  border-radius: 9px;
  background: rgba(10, 10, 12, .82);
  color: #f5cb54;
  font-size: 1rem;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: inset 0 0 1px rgba(255,220,129,.7), 0 0 12px rgba(235,169,32,.24);
  transition: background .2s ease, box-shadow .2s ease;
}
.pub-why-button span { font-size: 1.4em; line-height: 1; font-weight: 400; }
.pub-why-button:hover, .pub-why-button:focus-visible {
  color: #ffe18a;
  background: #241d10;
  box-shadow: 0 0 20px rgba(236, 176, 40, .4);
}
.pub-why-wave {
  position: absolute;
  z-index: 1;
  right: -50px;
  bottom: -15px;
  width: 83%;
  height: 175px;
  max-width: none;
  pointer-events: none;
  opacity: .92;
  filter: drop-shadow(0 0 7px rgba(249, 174, 37, .48));
}

/* Content-first layout retained from the previous revision. */
.pub-grid.features.one { grid-template-columns: minmax(0, 1fr); max-width: 540px; }
.pub-grid.features.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
.pub-grid.features .pub-cover { aspect-ratio: 16 / 9; }
.pub-grid.features .pub-title { font-size: clamp(1.05rem, 1.5vw, 1.22rem); }
.pub-grid.features .pub-card:hover { border-color: rgba(212,175,55,.52); }

@media (min-width: 701px) and (max-width: 1000px) {
  .pub-section.pub-why {
    margin: 0 -16px;
    width: calc(100% + 32px);
    padding-left: 24px;
    padding-right: 24px;
  }
  .pub-section.pub-why::before, .pub-section.pub-why::after { left: 24px; right: 24px; }
  /* anche la hero segue il margine da 16px della pagina: con -50px sbordava e la pagina scorreva di lato */
  .pub-hero.has-image { margin: 0 -16px; width: calc(100% + 32px); padding-left: 24px; padding-right: 24px; }
  .pub-why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub-why-grid li:nth-child(3) { grid-column: 1 / -1; min-height: 140px; }
  .pub-why-wave { right: -24px; width: 85%; }
}
@media (max-width: 700px) {
  .pub-section.pub-why {
    margin: 0 -16px;
    width: calc(100% + 32px);
    padding: 32px 16px 22px;
  }
  .pub-section.pub-why::before, .pub-section.pub-why::after { left: 16px; right: 16px; }
  .pub-why-head { margin-bottom: 22px; }
  .pub-why-head h2 { font-size: clamp(2rem, 8.5vw, 2.6rem); }
  .pub-why-kicker { font-size: .92rem; }
  .pub-why-rule { margin-top: 15px; }
  .pub-why-grid { grid-template-columns: 1fr; gap: 13px; }
  .pub-why-grid li { min-height: 0; gap: 14px; padding: 18px; }
  .pub-why-icon { flex-basis: 48px; width: 48px; height: 48px; border-radius: 13px; }
  .pub-why-icon svg { width: 28px; height: 28px; }
  .pub-why-card-copy h3 { font-size: 1.12rem; margin-bottom: 7px; }
  .pub-why-card-copy p { font-size: .93rem; line-height: 1.56; }
  .pub-why-bottom { min-height: 128px; margin-top: 16px; padding-top: 4px; }
  .pub-why-wave { right: -16px; width: 100%; height: 130px; bottom: 0; opacity: .8; }
  .pub-why-button { min-height: 44px; padding: 9px 14px; font-size: .94rem; }
  .pub-grid.features.one, .pub-grid.features.two { grid-template-columns: minmax(0, 1fr); max-width: none; }
  .pub-themes { grid-template-columns: minmax(0, 1fr); }
  .pub-themes a { min-height: 0; padding: 16px; }
  .pub-head p { line-height: 1.55; }
}
@media (max-width: 360px) {
  .page.home-public { padding-left: 12px; padding-right: 12px; }
  .pub-section.pub-why { margin: 0 -12px; width: calc(100% + 24px); padding-left: 12px; padding-right: 12px; }
  .pub-section.pub-why::before, .pub-section.pub-why::after { left: 12px; right: 12px; }
  .pub-why-grid li { padding: 15px; gap: 11px; }
  .pub-why-icon { flex-basis: 42px; width: 42px; height: 42px; }
  .pub-why-icon svg { width: 24px; height: 24px; }
  .pub-why-card-copy p { font-size: .9rem; }
  .pub-hero.has-image { margin: 0 -12px; width: calc(100% + 24px); }
}
@media (prefers-reduced-motion: reduce) {
  .pub-why-grid li, .pub-why-button { transition: none; }
  .pub-why-grid li:hover { transform: none; }
}

/* ===========================================================
   Donazioni in crypto (docs/13): fascia sotto il post, finestra per donare, pannello nello Studio.
   =========================================================== */
.donate-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin: 0 0 var(--gap); padding: 12px 16px;
  border: 1px solid rgba(212, 175, 55, .45); border-radius: var(--radius-l);
  background: linear-gradient(135deg, rgba(212, 175, 55, .1), rgba(212, 175, 55, .02) 60%), var(--surface); }
.donate-btn { gap: 8px; }
.donate-btn .ic { width: 18px; height: 18px; }
.donate-note { flex: 1 1 220px; min-width: 0; color: var(--text-2); font-size: .88rem; }
/* la «i» corsiva delle informazioni: un cerchietto che apre la spiegazione */
.donate-info { display: contents; }
.donate-info summary, .donate-i { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1.5px solid var(--primary); border-radius: 50%;
  color: var(--primary); font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; font-size: .95rem; line-height: 1; }
.donate-info summary { cursor: pointer; list-style: none; user-select: none; }
.donate-info summary::-webkit-details-marker { display: none; }
.donate-info summary:hover, .donate-info[open] summary { background: var(--primary); color: var(--on-primary); }
.donate-info summary:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.donate-info > p { order: 5; flex: 1 0 100%; margin: 2px 0 0; padding: 10px 12px; border-left: 3px solid var(--primary); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--primary-soft); color: var(--text); font-size: .9rem; line-height: 1.55; }

dialog.donate-modal { width: min(470px, calc(100vw - 24px)); }
.donate-body { padding: 18px 22px 22px; overflow-y: auto; }
.donate-body .share-label { margin: 16px 0 8px; font-weight: 600; }
.donate-body .share-label small { color: var(--text-2); font-weight: 400; }
.donate-body .share-link input { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.donate-body .meta { margin: 6px 0 0; }
.donate-direct { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--primary-soft); font-size: .9rem; line-height: 1.5; }
.donate-direct .donate-i { margin-top: 1px; width: 22px; height: 22px; font-size: .85rem; }
.donate-tokens { display: flex; flex-wrap: wrap; gap: 8px; }
.donate-token { margin: 0; cursor: pointer; }
.donate-token input { position: absolute; opacity: 0; pointer-events: none; }
.donate-token span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--field); font-weight: 600; font-size: .88rem; }
.donate-token input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--gold-hi); }
.donate-token input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.donate-amount { display: block; margin: 16px 0 14px; font-weight: 600; }
.donate-amount-field { display: flex; align-items: center; margin-top: 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--field); }
.donate-amount-field input { flex: 1; min-width: 0; margin: 0; border: 0; background: none; box-shadow: none; font-size: 1.15rem; font-weight: 600; }
.donate-amount-field b { padding: 0 14px; color: var(--primary); }
.donate-nowallet { margin: 0 0 4px; padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--text-2); font-size: .9rem; line-height: 1.5; }
.donate-nowallet .btn { margin-top: 10px; }
.donate-warn { margin-top: 12px !important; font-size: .8rem; }
.wallet-status { min-height: 1.3em; margin: 8px 0; font-size: .9rem; color: var(--text); overflow-wrap: anywhere; }
.wallet-status:empty { display: none; }
.wallet-status.error { color: var(--danger); }
.wallet-picker { display: grid; gap: 8px; margin: 0 0 12px; }
.wallet-picker .share-label { margin: 0 0 2px; }
.wallet-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--field); color: var(--text); font-weight: 600; text-align: left; cursor: pointer; }
.wallet-option:hover { border-color: var(--primary); }
.wallet-option img { border-radius: 6px; }

.donations-panel h3 { margin: 24px 0 6px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 1rem; }
.wallet-linked { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 14px 0 10px; }
.wallet-linked code { font-size: .86rem; overflow-wrap: anywhere; }
.wallet-link { margin-top: 12px; }
.token-choices { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 10px 0 14px; }
.token-choices label { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-weight: 600; }
.token-choices input { width: auto; margin: 0; }
.token-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 100px; gap: 8px; margin: 0 0 8px; }
.token-row input { margin: 0; }
.token-row input:first-child { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
@media (max-width: 640px) { .token-row { grid-template-columns: 1fr 1fr; } .token-row input:first-child { grid-column: 1 / -1; } }

.site-foot-note { flex: 1 0 100%; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--text-3); }

/* Accesso con Google, Facebook, X e wallet Web3 (per ora spenti), sul modello della finestra di accesso di Liberly. */
.social-login { margin: 22px 0 18px; }
.social-or { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; color: var(--text-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; }
.social-or::before, .social-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.social-login ul { display: grid; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.social-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 10px 64px 10px 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--field); color: var(--text); font: inherit; font-weight: 600; }
.social-btn svg { flex: none; width: 20px; height: 20px; }
.social-btn em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 999px;
  font-style: normal; font-size: .62rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.social-btn.social-google { background: #fff; border-color: #fff; color: #1f1f1f; }
.social-btn.social-google em { border-color: #c9c9c9; color: #5f6368; }
.social-btn.social-facebook { background: #1877f2; border-color: #1877f2; color: #fff; }
.social-btn.social-x { background: #000; border-color: #3a3a40; color: #fff; }
.social-btn.social-web3 { background: linear-gradient(135deg, rgba(212, 175, 55, .18), rgba(212, 175, 55, .04)), var(--field); border-color: rgba(212, 175, 55, .55); color: var(--gold-hi); }
.social-btn.social-facebook em, .social-btn.social-x em, .social-btn.social-web3 em { border-color: rgba(255, 255, 255, .45); color: rgba(255, 255, 255, .85); }
.social-btn:disabled { opacity: .5; cursor: not-allowed; }
.social-login .meta { margin: 0; font-size: .82rem; }

/* Finestra di accesso sopra la pagina corrente. */
dialog.login-modal { width: min(440px, calc(100vw - 24px)); }
.login-body { padding: 20px 26px 24px; overflow-y: auto; }
.login-body .notice { margin-top: 0; }
.login-body form .btn { margin-top: 6px; }
.login-body > p:last-child { margin-bottom: 0; }

/* Immagine originale a schermo intero (doppio clic; site.js). Un clic alterna vista adattata e dimensione reale. */
.prose img[data-full], .post-media.one > img[data-full], .post-media .slide img[data-full] { cursor: zoom-in; }
dialog.image-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .94); overflow: auto; }
dialog.image-viewer[open] { display: grid; place-items: center; }
dialog.image-viewer::backdrop { background: rgba(0, 0, 0, .9); }
dialog.image-viewer img { max-width: 100vw; max-height: 100dvh; object-fit: contain; cursor: zoom-in; }
dialog.image-viewer.actual { place-items: start; }
dialog.image-viewer.actual img { max-width: none; max-height: none; cursor: zoom-out; }
.image-viewer-close { position: fixed; top: 10px; right: 12px; z-index: 1; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.image-viewer-close:hover, .image-viewer-close:focus-visible { background: rgba(0, 0, 0, .8); border-color: #fff; }

/* «Propose your channel»: finestra della home e pagina /proponi (22/11/2026). */
dialog.propose-modal { width: min(560px, calc(100vw - 24px)); }
.propose-body { padding: 18px 26px 24px; overflow-y: auto; }
.propose-intro { margin: 0 0 .4rem; color: var(--text-2); font-size: .93rem; line-height: 1.5; }
.propose-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.propose-row label { margin-bottom: 0; }
.propose-form .meta { font-weight: 400; }
.propose-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.propose-consent { display: flex; align-items: flex-start; gap: .6rem; font-weight: 400; line-height: 1.45; }
.propose-consent input { margin-top: 2px; }
.propose-form .btn { margin-top: 4px; }
.propose-done .notice { margin-top: 0; }
@media (max-width: 700px) { dialog.propose-modal { width: 100vw; } }
@media (max-width: 480px) { .propose-row { grid-template-columns: 1fr; } .propose-body { padding: 14px 16px 22px; } }

/* Donate nella barra delle azioni del post, a destra (richiesta del titolare, 20/11/2026), con la «i» accanto. */
.post-donate { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.post-actions .donate-act { color: var(--primary); font-weight: 650; }
.post-actions .donate-act:hover { color: var(--gold-hi); }
.post-donate .donate-info { display: block; }
.post-donate .donate-info summary { width: 22px; height: 22px; font-size: .88rem; }
.post-donate .donate-info > p { position: absolute; z-index: 30; right: 0; bottom: calc(100% + 10px); width: min(330px, calc(100vw - 48px)); margin: 0; padding: 12px 14px;
  border: 1px solid rgba(212, 175, 55, .55); border-left-width: 1px; border-radius: var(--radius-l); background: var(--surface-2); box-shadow: var(--shadow-pop);
  color: var(--text); font-size: .88rem; line-height: 1.55; text-align: left; }
/* loghi dei token */
.token-logo { flex: none; width: 22px; height: 22px; border-radius: 50%; object-fit: contain; vertical-align: middle; }
.token-logo.none { display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text); font-size: .72rem; font-weight: 700; font-style: normal; }
.donate-token span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; }
.token-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 20px; }
.token-choices small { color: var(--text-2); font-weight: 400; }
.token-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.token-found { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; white-space: nowrap; }
.token-found small { color: var(--text-2); }
@media (max-width: 640px) { .token-row { grid-template-columns: 1fr; } .token-row input:first-child { grid-column: auto; } }
/* Su telefono la barra è stretta: di «Donate» resta l'icona dorata con la «i», e la spiegazione si apre larga quanto la barra. */
@media (max-width: 560px) {
  .post-actions { position: relative; }
  .post-donate { position: static; gap: 2px; }
  .post-donate .donate-label { display: none; }
  .post-donate .donate-info > p { left: 10px; right: 10px; width: auto; }
}

/* Loghi dei token su cerchio bianco (richiesta del titolare, 20/11/2026), e loghi sovrapposti accanto a «Donate». */
.token-logo { box-sizing: border-box; padding: 2px; background: #fff; }
.token-logo.none, .token-logo.more { display: inline-grid; place-items: center; padding: 0; background: #fff; color: #17130a; font-size: .7rem; font-weight: 800; font-style: normal; line-height: 1; }
.token-logo.more { font-size: .62rem; letter-spacing: -.02em; }
.donate-stack { display: inline-flex; align-items: center; flex: none; }
.donate-stack .token-logo { width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--surface); }
.donate-stack .token-logo + .token-logo { margin-left: -9px; }
.post-actions .donate-act { gap: 8px; }
.token-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; }
.token-row input + input { font-size: .82rem; }
@media (max-width: 640px) { .token-row { grid-template-columns: 1fr; } }
@media (min-width: 641px) { .token-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 200px; } .token-found { overflow: hidden; } .token-found small { overflow: hidden; text-overflow: ellipsis; } }
.donate-stack .token-logo { width: 26px; height: 26px; }
.donate-stack .token-logo + .token-logo { margin-left: -7px; }
/* Con tre o più token i loghi sovrapposti bastano: la scritta farebbe andare a capo la barra. */
.post-donate.many .donate-label { display: none; }
/* Su telefono, accanto alle azioni ci stanno al massimo due loghi, più piccoli. */
@media (max-width: 560px) {
  .donate-stack .token-logo { width: 22px; height: 22px; }
  .donate-stack .token-logo + .token-logo { margin-left: -9px; }
  .donate-stack .token-logo:nth-child(n+3) { display: none; }
  .post-actions .donate-act { padding-left: 4px; padding-right: 2px; }
}

/* Loghi dei token a grandezza reale, 32x32 (richiesta del titolare, 20/11/2026): più piccoli non si leggevano. */
.token-logo { width: 32px; height: 32px; padding: 1px; }
.token-logo.none { font-size: .9rem; }
.token-logo.more { font-size: .72rem; }
.donate-stack .token-logo { width: 32px; height: 32px; }
.donate-stack .token-logo + .token-logo { margin-left: -9px; }
.donate-token span { padding: 5px 16px 5px 6px; gap: 10px; }
.token-choices label { gap: 9px; }
@media (max-width: 560px) {
  .donate-stack .token-logo { width: 28px; height: 28px; }
  .donate-stack .token-logo + .token-logo { margin-left: -12px; }
}

/* ===========================================================
   «Built to reward creators»: riquadro oro/nero della home esterna, sulla grafica fornita dal titolare (21/11/2026).
   Titoli e cifre in Source Serif 4 Bold (licenza SIL OFL), servito dal sito.
   =========================================================== */
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
.pub-section.pub-earn {
  --earn-serif: "Source Serif 4", "Iowan Old Style", Cambria, Georgia, "Times New Roman", serif;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 -50px;
  width: calc(100% + 100px);
  padding: clamp(40px, 5vw, 64px) 50px clamp(44px, 5.5vw, 70px);
  border-top: 0;
  color: #f6f3ec;
  background:
    radial-gradient(46% 42% at 88% 4%, rgba(170, 108, 22, .16), transparent 72%),
    radial-gradient(40% 38% at 6% 96%, rgba(170, 108, 22, .13), transparent 74%),
    radial-gradient(60% 40% at 60% 104%, rgba(190, 128, 30, .12), transparent 70%),
    #050506;
}
.pub-earn-arcs { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.pub-earn-head { text-align: center; margin: 0 0 clamp(26px, 3.4vw, 44px); }
.pub-earn-head h2 {
  margin: 0;
  font-family: var(--earn-serif);
  font-weight: 700;
  font-size: clamp(2rem, 4.1vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -.015em;
  color: #faf7f0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}
.pub-earn-head p { margin: 12px 0 0; font-size: clamp(1rem, 1.5vw, 1.14rem); color: #e2dfd8; }
.pub-earn-rule { display: flex; align-items: center; justify-content: center; gap: 16px; margin: clamp(18px, 2.4vw, 30px) auto 0; width: min(450px, 80%); color: #f2c462; }
.pub-earn-rule::before, .pub-earn-rule::after { content: ""; flex: 1; height: 1px; }
.pub-earn-rule::before { background: linear-gradient(90deg, transparent, rgba(226, 178, 80, .95)); }
.pub-earn-rule::after { background: linear-gradient(90deg, rgba(226, 178, 80, .95), transparent); }
.pub-earn-rule svg { flex: none; width: 20px; height: 20px; filter: drop-shadow(0 0 6px rgba(255, 205, 100, .8)); }

.pub-earn-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 30px); }
.pub-earn-grid li, .pub-earn-project {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(34, 32, 30, .96), rgba(12, 12, 13, .97) 46%, rgba(9, 9, 10, .98)) padding-box,
    linear-gradient(140deg, rgba(255, 226, 150, .95), rgba(212, 170, 80, .34) 26%, rgba(150, 120, 70, .30) 62%, rgba(240, 196, 106, .85)) border-box;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 240, 200, .05);
}
.pub-earn-grid li { min-height: clamp(190px, 20vw, 232px); padding: clamp(22px, 2.6vw, 34px) clamp(18px, 2.2vw, 26px) clamp(22px, 2.6vw, 34px) 0; }
/* l'arco luminoso in basso a sinistra, come un orizzonte */
.pub-earn-grid li::before {
  content: "";
  position: absolute;
  left: -22.6%;
  top: 64%;
  width: 65%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(120, 82, 22, .55), rgba(40, 28, 10, .5) 38%, rgba(10, 9, 8, .2) 70%);
  border-top: 2px solid rgba(255, 214, 122, .95);
  box-shadow: 0 -4px 22px rgba(238, 176, 64, .55), 0 -14px 60px rgba(214, 150, 44, .28);
}
.pub-earn-figure {
  position: relative;
  flex: 0 0 39%;
  text-align: center;
  font-family: var(--earn-serif);
  font-weight: 700;
  font-size: clamp(3.4rem, 7.2vw, 5.3rem);
  line-height: 1;
  letter-spacing: -.02em;
  background: linear-gradient(180deg, #fbe7a8 4%, #ecc662 38%, #c9942c 72%, #a87418);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .55));
  transform: translateY(-12%);
}
.pub-earn-copy { position: relative; flex: 1; min-width: 0; }
.pub-earn-grid .pub-earn-copy { padding-left: clamp(18px, 2.4vw, 28px); }
.pub-earn-grid .pub-earn-copy::before, .pub-earn-project .pub-earn-copy::before {
  content: "";
  position: absolute;
  left: 0;
  top: -6%;
  bottom: -6%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(214, 170, 84, .75) 22%, rgba(214, 170, 84, .75) 78%, transparent);
}
.pub-earn-copy h3 { margin: 0; font-family: var(--earn-serif); font-weight: 700; font-size: clamp(1.25rem, 2.1vw, 1.56rem); line-height: 1.18; color: #faf7f0; }
.pub-earn-copy p { margin: clamp(8px, 1vw, 12px) 0 0; font-size: clamp(.92rem, 1.25vw, .97rem); line-height: 1.5; color: #d6d2ca; }

.pub-earn-project {
  margin-top: clamp(18px, 3vw, 36px);
  gap: clamp(18px, 3vw, 48px);
  padding: clamp(22px, 3vw, 34px) clamp(20px, 2.8vw, 32px) clamp(22px, 3vw, 34px) clamp(22px, 4.2vw, 50px);
  background:
    linear-gradient(160deg, rgba(30, 29, 28, .92), rgba(13, 13, 14, .94) 50%, rgba(10, 10, 11, .9)) padding-box,
    linear-gradient(140deg, rgba(150, 140, 120, .55), rgba(110, 100, 84, .28) 40%, rgba(120, 104, 74, .25) 70%, rgba(212, 170, 84, .5)) border-box;
}
.pub-earn-icon { flex: none; display: flex; color: #e9bd5a; filter: drop-shadow(0 0 10px rgba(240, 180, 70, .45)); }
.pub-earn-icon svg { width: clamp(44px, 4.8vw, 56px); height: auto; }
.pub-earn-project .pub-earn-copy { padding-left: clamp(18px, 3vw, 34px); }
.pub-earn-project h3 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
.pub-earn-project p { max-width: 46ch; }
.pub-earn-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: clamp(46px, 4.6vw, 54px);
  padding: 0 clamp(22px, 2.7vw, 30px);
  border-radius: 999px;
  border: 1px solid rgba(255, 238, 180, .7);
  background: linear-gradient(180deg, #fde9a6, #eec867 42%, #d7a63c);
  color: #17120a;
  font-weight: 700;
  font-size: clamp(.98rem, 1.4vw, 1.04rem);
  white-space: nowrap;
  box-shadow: 0 0 26px rgba(240, 186, 74, .45), 0 10px 26px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.pub-earn-button span { font-size: 1.25em; line-height: 1; font-weight: 400; }
a.pub-earn-button:hover, a.pub-earn-button:focus-visible { color: #17120a; text-decoration: none; transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 0 34px rgba(246, 196, 86, .6), 0 12px 28px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .6); }
.pub-earn-button.is-off { cursor: not-allowed; opacity: .55; filter: saturate(.6); box-shadow: none; }

@media (max-width: 1000px) {
  .pub-section.pub-earn { margin: 0 -16px; width: calc(100% + 32px); padding-left: 24px; padding-right: 24px; }
  .pub-earn-grid { grid-template-columns: 1fr; }
  .pub-earn-grid li { min-height: 0; }
  .pub-earn-grid li::before { width: 46%; left: -14%; top: 58%; }
  .pub-earn-figure { flex-basis: 32%; }
}
@media (max-width: 700px) {
  .pub-section.pub-earn { margin: 0 -16px; width: calc(100% + 32px); padding-left: 16px; padding-right: 16px; }
  .pub-earn-project { flex-wrap: wrap; }
  .pub-earn-project .pub-earn-copy { flex-basis: calc(100% - 90px); }
  .pub-earn-button { margin-left: auto; margin-right: auto; }
}
@media (max-width: 520px) {
  .pub-earn-grid li { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
  .pub-earn-grid li::before { left: auto; right: -34%; top: auto; bottom: 88%; width: 80%; transform: rotate(180deg); }
  .pub-earn-figure { flex: none; text-align: left; font-size: 3.6rem; }
  .pub-earn-grid .pub-earn-copy { padding-left: 0; padding-top: 14px; margin-top: 14px; }
  .pub-earn-grid .pub-earn-copy::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 1px; background: linear-gradient(90deg, rgba(214, 170, 84, .75), transparent); }
  .pub-earn-project { padding: 22px 20px; gap: 16px; }
  .pub-earn-project .pub-earn-copy { flex-basis: 100%; padding-left: 0; }
  .pub-earn-project .pub-earn-copy::before { display: none; }
  .pub-earn-button { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .pub-earn-button { transition: none; } a.pub-earn-button:hover { transform: none; } }
@media (max-width: 360px) { .pub-section.pub-earn { margin: 0 -12px; width: calc(100% + 24px); padding-left: 12px; padding-right: 12px; } }
