@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/lora/lora-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/lora/lora-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 600; font-display: swap; src: url('/fonts/lora/lora-latin-600-italic.woff2') format('woff2'); }
@font-face { font-family: 'Raleway'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/raleway/raleway-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Raleway'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/raleway/raleway-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Playfair'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/playfair/playfair-display-latin-600-normal.woff2') format('woff2'); }

:root {
  --paper: #F6F5FC;
  --surface: #FFFFFF;
  --ink: #2E2848;
  --ink-soft: #5F5878;
  --line: #E2DFF0;
  --viola: #6D61A8;
  --viola-scuro: #4A4080;
  --lavanda: #EEEDFE;
  --rosa: #E989B9;
  --rosa-tenue: #FBE6F0;
  --verde: #88AE3A;
  --verde-tenue: #E0EDC8;
  --lilla-tenue: #E6E1F7;
  --danger: #B3394B;
  --warn: #B07A12;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Lora', Georgia, serif;
  --display: 'Playfair', 'Playfair Display', Georgia, serif;
  --r-panel: 14px;
  --r-input: 7px;
  --shadow: 0 1px 2px rgba(46, 40, 72, .06), 0 6px 20px rgba(46, 40, 72, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-style: italic; font-weight: 600; color: var(--viola-scuro); margin: 0; line-height: 1.2; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .6em; }
a { color: var(--viola); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--viola); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Struttura ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.rail { background: var(--viola-scuro); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { font-family: var(--serif); font-style: italic; font-size: 1.3rem; padding: 0 10px 18px; line-height: 1.15; }
.brand small { display: block; font-family: var(--sans); font-style: normal; font-size: .78rem; opacity: .7; margin-top: 4px; }
.rail a { color: #fff; text-decoration: none; padding: 9px 12px; border-radius: 9px; opacity: .82; display: flex; align-items: center; gap: 10px; }
.rail a:hover { opacity: 1; background: rgba(255,255,255,.07); }
.rail a.active { background: rgba(255,255,255,.14); opacity: 1; }
.rail .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .5; flex: none; }
.rail a.active .dot { background: var(--rosa); opacity: 1; }
.rail .spacer { flex: 1; }
.rail button.link { background: none; border: 0; color: #fff; opacity: .65; text-align: left; padding: 9px 12px; cursor: pointer; }
main { padding: 30px 36px 80px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { color: var(--ink-soft); margin: 6px 0 0; max-width: 62ch; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Controlli ---------- */
.btn { text-decoration: none; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--viola); }
.btn.primary { background: var(--viola); border-color: var(--viola); color: #fff; }
.btn.primary:hover { background: var(--viola-scuro); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--viola); }
.btn.ghost:hover { background: var(--lavanda); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: .86rem; }
.btn[disabled] { opacity: .55; cursor: progress; }
input[type=text], input[type=date], input[type=number], input[type=url], input[type=password], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-input); padding: 8px 10px; background: var(--surface);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--viola); outline: none; box-shadow: 0 0 0 3px var(--lavanda); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: 4px; }
label.field small { display: block; color: var(--ink-soft); font-size: .78rem; margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }

/* ---------- Pannelli e tabelle ---------- */
.panel { background: var(--surface); border-radius: var(--r-panel); padding: 20px 22px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 18px; }
.panel h2 { margin-bottom: 12px; }
.muted { color: var(--ink-soft); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: .82rem; color: var(--ink-soft); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--paper); }
.table .title { font-weight: 500; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-soft); }
.empty .btn { margin-top: 12px; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; background: var(--lavanda); color: var(--viola-scuro); white-space: nowrap; }
.chip.s-Idea { background: #F1F0F5; color: var(--ink-soft); }
.chip.s-Bozza { background: var(--lilla-tenue); }
.chip.s-Da-rivedere { background: #FCEFD6; color: #7A5410; }
.chip.s-Approvato { background: var(--verde-tenue); color: #3F5A12; }
.chip.s-Pubblicato { background: var(--viola); color: #fff; }
.chip.s-Da-riutilizzare { background: var(--rosa-tenue); color: #8A2F5C; }
.chip.qa-Conforme { background: var(--verde-tenue); color: #3F5A12; }
.chip.qa-Da-verificare { background: #FCEFD6; color: #7A5410; }
.chip.qa-Non-conforme { background: #F8DDE1; color: var(--danger); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.c-Lilla { background: var(--lilla-tenue); } .c-Rosa { background: var(--rosa-tenue); } .c-Verde { background: var(--verde-tenue); }
.swatch.c-Lilla { background: #B9AEE6; } .swatch.c-Rosa { background: var(--rosa); } .swatch.c-Verde { background: var(--verde); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 150px; }
.filters input[type=search] { min-width: 220px; flex: 1; }

/* ---------- Dashboard ---------- */
.month-goal { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.goal-count { font-family: var(--display); font-size: 3.4rem; line-height: 1; color: var(--viola-scuro); }
.goal-count span { font-size: 1.4rem; color: var(--ink-soft); }
.goal-bar { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.goal-bar i { width: 34px; height: 42px; border-radius: 6px; background: var(--line); display: block; }
.goal-bar i.on { background: var(--viola); }
.goal-bar i.planned { background: var(--rosa); }
.dash-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.dash-cols > .panel { margin-top: 0; }
.up-list { list-style: none; margin: 0; padding: 0; }
.up-list li { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.up-list .date { font-family: var(--serif); font-style: italic; color: var(--viola); }
.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pipeline a { text-decoration: none; color: inherit; background: var(--paper); border-radius: 10px; padding: 12px; }
.pipeline b { font-family: var(--display); font-size: 1.7rem; font-weight: 600; display: block; color: var(--viola-scuro); }

/* ---------- Calendario ---------- */
.cal-wrap { display: grid; grid-template-columns: 1fr 270px; gap: 18px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-head h2 { min-width: 190px; text-transform: none; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); border-radius: var(--r-panel); overflow: hidden; box-shadow: var(--shadow); }
.cal .dow { padding: 8px; font-size: .8rem; color: var(--ink-soft); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.cal .day { min-height: 112px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cal .day.out { background: #FAFAFD; color: #B5B0C8; }
.cal .day.today .n { background: var(--viola); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.cal .day.drop { background: var(--lavanda); }
.cal .n { font-size: .82rem; }
.cal-item { font-size: .8rem; padding: 4px 7px; border-radius: 6px; cursor: grab; line-height: 1.25; border-left: 3px solid var(--viola); background: var(--lavanda); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-item.f-Reel { border-left-color: var(--rosa); background: var(--rosa-tenue); }
.cal-item.f-Post { border-left-color: var(--verde); background: var(--verde-tenue); }
.cal-item.f-Stories { border-left-color: #B9AEE6; }
.cal-item.published { opacity: .55; }
.side-list { max-height: 70vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.side-list > * { flex: none; }
.side-list .cal-item { -webkit-line-clamp: 3; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-soft); margin-top: 10px; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--viola); }
.legend .l-Reel::before { background: var(--rosa); } .legend .l-Post::before { background: var(--verde); } .legend .l-Stories::before { background: #B9AEE6; }

/* ---------- Griglia del feed (l'elemento distintivo) ---------- */
.feed-frame { max-width: 560px; background: var(--surface); border-radius: 22px; padding: 18px 12px; box-shadow: var(--shadow); }
.feed-profile { display: flex; align-items: center; gap: 12px; padding: 0 6px 14px; }
.feed-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--verde-tenue); display: grid; place-items: center; font-family: var(--serif); font-style: italic; color: var(--viola-scuro); font-size: 1.2rem; }
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.tile { aspect-ratio: 4 / 5; position: relative; overflow: hidden; cursor: grab; display: flex; align-items: center; justify-content: center; padding: 10px; text-align: center; }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .t-title { position: relative; font-family: var(--display); font-weight: 600; font-size: .78rem; line-height: 1.2; color: var(--viola-scuro); text-transform: uppercase; letter-spacing: .02em; }
.tile .t-title em { display: block; font-family: var(--serif); font-style: italic; text-transform: none; letter-spacing: 0; font-weight: 400; color: #5d5295; font-size: .74rem; margin-top: 4px; }
.tile.has-img .t-title { background: rgba(255,255,255,.88); padding: 5px 7px; border-radius: 4px; }
.tile .t-format { position: absolute; top: 6px; right: 6px; font-size: .66rem; background: rgba(255,255,255,.9); border-radius: 999px; padding: 1px 7px; color: var(--ink); }
.tile .t-order { position: absolute; bottom: 6px; left: 6px; font-size: .66rem; color: var(--ink-soft); background: rgba(255,255,255,.85); border-radius: 999px; padding: 1px 6px; }
.tile.dragging { opacity: .35; }
.tile.over { outline: 3px solid var(--viola); outline-offset: -3px; }
.tile.published::after { content: 'Pubblicato'; position: absolute; bottom: 6px; right: 6px; font-size: .64rem; background: var(--viola); color: #fff; border-radius: 999px; padding: 1px 7px; }
.feed-layout { display: grid; grid-template-columns: minmax(0, 560px) 1fr; gap: 24px; align-items: start; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 20px; align-items: start; }
.editor .brief { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -22px 18px; padding: 0 22px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 12px; cursor: pointer; color: var(--ink-soft); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--viola-scuro); border-bottom-color: var(--viola); }
.hooks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.hooks label { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-input); cursor: pointer; }
.hooks label.sel { border-color: var(--viola); background: var(--lavanda); }
.slide-edit { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.slide-edit .num { font-family: var(--display); color: var(--viola); font-size: 1.2rem; }
.slide-edit .slide-tools { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.slide-edit .thumb { width: 54px; height: 68px; object-fit: cover; border-radius: 5px; }
.thumb-wrap { width: 54px; height: 68px; border-radius: 5px; overflow: hidden; flex: none; }
.thumb-wrap img, .thumb-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.counter { font-size: .78rem; color: var(--ink-soft); text-align: right; margin-top: 3px; }
.counter.over { color: var(--danger); }
.qa-box { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; background: var(--paper); }
.qa-issue { border-top: 1px solid var(--line); padding: 8px 0; font-size: .9rem; }
.qa-issue q { font-style: italic; }
.ai-bar { display: flex; gap: 8px; margin-top: 14px; }
.ai-bar input { flex: 1; }

/* Anteprima del carosello: slide in verticale, una sotto l'altra */
.preview-col { display: flex; flex-direction: column; gap: 14px; max-width: 380px; margin: 0 auto; }
.slide-prev { aspect-ratio: 4 / 5; border-radius: 6px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 30px 28px; background: var(--verde-tenue); box-shadow: var(--shadow); }
.slide-prev:nth-child(3n+2) { background: var(--lilla-tenue); }
.slide-prev:nth-child(3n+3) { background: var(--rosa-tenue); }
.slide-prev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-prev .sp-text { position: relative; }
.slide-prev.has-img .sp-text { background: rgba(255,255,255,.9); padding: 14px; border-radius: 6px; margin-top: auto; }
.slide-prev h4 { font-family: var(--serif); font-style: italic; font-weight: 600; color: #5d5295; font-size: 1.35rem; margin: 0 0 10px; line-height: 1.2; }
.slide-prev p { white-space: pre-line; font-size: .95rem; color: #38322f; }
.slide-prev .sp-n { position: absolute; top: 10px; right: 12px; font-size: .72rem; color: var(--ink-soft); }
.caption-prev { white-space: pre-wrap; font-size: .93rem; background: var(--paper); border-radius: 10px; padding: 14px; }
.versions li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.versions { list-style: none; padding: 0; margin: 0; }

/* ---------- Media ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-card { background: var(--surface); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; position: relative; border: 2px solid transparent; }
.media-card.selected { border-color: var(--viola); }
.media-card .m-thumb { aspect-ratio: 4 / 5; background: var(--lavanda); display: grid; place-items: center; overflow: hidden; }
.media-card img, .media-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card .m-info { padding: 7px 9px; font-size: .8rem; }
.media-card .m-info div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card .m-badge { position: absolute; top: 6px; left: 6px; }
.media-card .m-pos { position: absolute; top: 6px; right: 6px; background: var(--viola); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; font-size: .78rem; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--r-panel); padding: 26px; text-align: center; color: var(--ink-soft); margin-bottom: 16px; background: var(--surface); }
.dropzone.over { border-color: var(--viola); background: var(--lavanda); }

/* ---------- Brand ---------- */
.lib-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.lib-tabs .btn.active { background: var(--viola-scuro); color: #fff; border-color: var(--viola-scuro); }
.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--surface); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; }
.card:hover { box-shadow: 0 0 0 2px var(--lavanda), var(--shadow); }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--ink-soft); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.group-title { margin: 22px 0 10px; font-size: 1rem; color: var(--ink-soft); font-family: var(--sans); font-style: normal; font-weight: 500; }

/* ---------- Modale e avvisi ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(46, 40, 72, .42); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 16px; width: min(640px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(46,40,72,.3); }
.modal.wide { width: min(980px, 100%); }
.modal header { padding: 18px 22px 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal .body { padding: 6px 22px 18px; overflow: auto; }
.modal footer { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal footer .left { margin-right: auto; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 380px; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }
.loading { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.idea-row { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log { font-family: ui-monospace, monospace; font-size: .78rem; background: var(--paper); border-radius: 8px; padding: 10px; max-height: 220px; overflow: auto; white-space: pre-wrap; }

/* ---------- Accesso ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--verde-tenue); }
.login form { background: var(--surface); border-radius: 18px; padding: 34px; width: min(380px, 100%); box-shadow: var(--shadow); }
.login h1 { margin-bottom: 4px; }
.login p { color: var(--ink-soft); margin-bottom: 22px; }
.login .btn { width: 100%; justify-content: center; margin-top: 6px; padding: 10px; }
.login .err { color: var(--danger); min-height: 1.4em; font-size: .9rem; margin-top: 10px; }

/* ---------- Schermi piccoli ---------- */
@media (max-width: 1100px) {
  .editor, .cal-wrap, .feed-layout, .dash-cols { grid-template-columns: 1fr; }
  .editor .brief { position: static; max-height: none; order: 2; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; overflow-x: auto; padding: 6px; z-index: 40; gap: 2px; }
  .rail .brand, .rail .spacer, .rail button.link { display: none; }
  .rail a { font-size: .78rem; padding: 8px 10px; white-space: nowrap; }
  .rail .dot { display: none; }
  main { padding: 18px 16px 90px; }
  .grid-2 { grid-template-columns: 1fr; }
  .cal .day { min-height: 72px; }
  .cal-item { font-size: .68rem; -webkit-line-clamp: 1; }
  .month-goal { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .table .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Copertina nella card */
.cover-preview { aspect-ratio: 4 / 5; max-width: 260px; border-radius: 10px; overflow: hidden; background: var(--lavanda); }
.cover-preview .cover-img, .cover-preview img, .cover-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-preview.empty { border: 2px dashed var(--line); background: var(--paper); display: grid; place-items: center; padding: 20px; text-align: center; color: var(--ink-soft); font-size: .9rem; }
.table .thumb-cell { width: 52px; }
.table .thumb-cell img, .table .thumb-cell .ph { width: 40px; height: 50px; border-radius: 4px; object-fit: cover; display: block; }
.table .thumb-cell .ph { background: var(--lilla-tenue); }
.table .thumb-cell .ph.c-Rosa { background: var(--rosa-tenue); } .table .thumb-cell .ph.c-Verde { background: var(--verde-tenue); }

/* Tessere realistiche del feed: il testo scala con la tessera */
.tile { container-type: inline-size; }
.tile .t-format, .tile .t-order { opacity: 0; transition: opacity .15s; }
.tile:hover .t-format, .tile:hover .t-order, .tile:focus-visible .t-format, .tile:focus-visible .t-order { opacity: 1; }
.tile.look-Grafica .t-title, .tile.look-Graficacontesto .t-title { font-size: 8.5cqw; line-height: 1.15; padding: 0 6cqw; }
.tile.look-Graficacontesto .t-title em { font-size: 7cqw; margin-top: 3cqw; }
.tile.c-Verde.look-Graficacontesto { background: #e9f5c8; }
.tile.c-Rosa.look-Graficacontesto { background: #f4c2db; }
.tile.c-Lilla.look-Graficacontesto { background: #e6e1f7; }
.tile .ov-title-box, .tile .ov-sub-box, .tile .ov-reel-title, .tile .ov-reel-sub { position: absolute; left: 9%; right: 9%; z-index: 1; overflow-wrap: anywhere; }
.tile .ov-title-box { top: 14%; background: rgba(255, 255, 255, .94); color: #5d5295; font-family: var(--display); font-weight: 600; font-size: 8.5cqw; line-height: 1.12; padding: 4cqw 5cqw; text-align: left; }
.tile .ov-sub-box { top: 55%; background: rgba(109, 97, 168, .92); color: #fff; font-family: var(--sans); font-size: 5.6cqw; line-height: 1.3; padding: 3.5cqw 5cqw; text-align: left; }
.tile .ov-reel-title { top: 20%; background: #5d5295; color: #fff; font-family: var(--display); font-weight: 600; font-size: 8cqw; line-height: 1.15; padding: 3.5cqw 4cqw; text-align: center; }
.tile .ov-reel-sub { bottom: 18%; background: #e989b9; color: #fff; font-family: var(--display); font-weight: 600; font-size: 6.5cqw; line-height: 1.2; padding: 3cqw 4cqw; text-align: center; }
.tile .ov-play { position: absolute; z-index: 1; left: 50%; top: 52%; width: 15cqw; height: 15cqw; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(30, 26, 46, .55); }
.tile .ov-play::after { content: ''; position: absolute; left: 39%; top: 30%; width: 0; height: 0; border-left: 5.4cqw solid #fff; border-top: 3.4cqw solid transparent; border-bottom: 3.4cqw solid transparent; }
.tile.has-img .t-title { background: none; padding: 0; }

/* Anteprima della tessera nella card */
.look-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.look-picker button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: .84rem; cursor: pointer; }
.look-picker button[aria-pressed="true"] { background: var(--viola); border-color: var(--viola); color: #fff; }
.cover-tile { width: 240px; max-width: 100%; }
.cover-tile .tile { cursor: default; border-radius: 6px; }

/* Slide dei caroselli con foto (anteprima in scala di una slide 1080 × 1350) */
.photo-slide { position: relative; overflow: hidden; border-radius: 6px; box-shadow: var(--shadow); background: var(--verde-tenue); }
.photo-slide .ps-inner { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.photo-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slide .ps-title, .photo-slide .ps-body { position: absolute; left: 96px; width: 888px; box-sizing: border-box; white-space: pre-line; }
.photo-slide .ps-title { background: rgba(255,255,255,.95); color: #5d5295; font-family: var(--display); font-weight: 600; font-size: 64px; line-height: 1.16; padding: 42px 52px; }
.photo-slide .ps-body { background: rgba(93,82,149,.93); color: #fff; font-family: 'Raleway', var(--sans); font-weight: 500; font-size: 42px; line-height: 1.38; padding: 38px 52px; }
.slide-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.slide-controls { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.save-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.save-bar.dirty { border-color: #e2b75a; background: #fff8e8; }
.save-bar .state { font-size: .92rem; }
.save-bar .state b { color: var(--viola-scuro); }
.tile .ov-title-box, .tile .ov-sub-box { white-space: pre-line; }
.tile .ov-sub-box { font-family: 'Raleway', var(--sans); font-weight: 500; }
