/* Social v2 - brand: #1A1A1A / #FFFFFF / #F78B1E (+ #0096C7). Minimale, denso, "architettura non decorazione".
   Font: Anton (headline visual), Archivo Black (numeri/etichette forti), Archivo (testo). */
:root {
  --ink: #1A1A1A; --ink-2: #242424; --paper: #FFFFFF; --accent: #F78B1E; --accent-d: #d9760f;
  --blue: #0096C7; --muted: #7a7a7a; --muted-2: #9a9a9a; --line: #ececec; --line-2: #e0e0e0;
  --bg: #f6f6f4; --ok: #1b8a3a; --ok-bg: #e9f7ee; --warn: #c4480a; --warn-bg: #fdeee6;
  --sidebar-w: 230px; --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(26,26,26,.05), 0 6px 20px rgba(26,26,26,.05);
  --shadow-lg: 0 4px 12px rgba(26,26,26,.1), 0 18px 50px rgba(26,26,26,.14);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: "Archivo", system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; }
.boot { padding: 4rem 1rem; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.spin { width: 30px; height: 30px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
a { color: var(--blue); }
button { font-family: inherit; cursor: pointer; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: .88rem; padding: .5rem .85rem; transition: filter .12s, background .12s, border-color .12s; }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--ink); font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: var(--accent-d); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover:not(:disabled) { background: #000; }
.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-danger { background: #fff; color: var(--warn); border-color: #f1c9b3; }
.btn-danger:hover:not(:disabled) { background: var(--warn-bg); }
.btn-sm { padding: .32rem .6rem; font-size: .8rem; }
.btn-icon { padding: .35rem .5rem; line-height: 1; background: #fff; border-color: var(--line-2); }
.btn-icon:hover:not(:disabled) { border-color: var(--ink); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #cfcfcf; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sb-brand { display: flex; align-items: center; gap: .55rem; padding: 1.1rem 1.1rem; font-family: "Anton", sans-serif;
  font-size: 1.35rem; letter-spacing: .5px; color: #fff; }
.sb-brand .mark { width: 30px; height: 30px; display: inline-flex; }
.sb-brand .mark svg, .lbrand .mark svg { width: 100%; height: 100%; }
.sb-nav { padding: .5rem .6rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.sb-item { display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; border-radius: var(--radius-sm);
  color: #c4c4c4; cursor: pointer; font-size: .92rem; font-weight: 500; user-select: none; border: none; background: none; text-align: left; }
.sb-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-item.active { background: var(--accent); color: var(--ink); font-weight: 700; }
.sb-item .ico { width: 20px; height: 20px; display: inline-flex; color: #fff; }   /* icone bianche */
.sb-item .ico svg { width: 20px; height: 20px; }
.sb-item.active .ico { color: var(--ink); }                                        /* su accent: scure per contrasto */
.sb-item .badge { margin-left: auto; font-size: .7rem; background: rgba(255,255,255,.16); color: #fff; border-radius: 999px; padding: .05rem .4rem; }
.sb-item.active .badge { background: rgba(0,0,0,.18); color: var(--ink); }
.sb-foot { padding: .8rem 1.1rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; }
.sb-foot .uemail { color: #fff; font-weight: 600; word-break: break-word; }
.sb-foot .uroles { color: var(--muted-2); margin-top: .15rem; }
.sb-foot button { margin-top: .6rem; width: 100%; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.4rem; border-bottom: 1px solid var(--line);
  background: rgba(246,246,244,.85); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-family: "Anton", sans-serif; font-weight: 400; font-size: 1.5rem; margin: 0; letter-spacing: .4px; }
.topbar .sub { color: var(--muted); font-size: .85rem; }
.topbar .spacer { flex: 1; }
.tb-inner { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 0; }
.content { padding: 1.4rem; }

/* ---------- app bar: utente (gravatar + nome) ---------- */
.tb-user { position: relative; flex: 0 0 auto; }
.user-btn { display: flex; align-items: center; gap: .55rem; background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: .28rem .65rem .28rem .3rem; cursor: pointer; }
.user-btn:hover { border-color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar .ini { font-size: .74rem; font-weight: 700; font-family: "Archivo Black", sans-serif; letter-spacing: .3px; }
.user-btn .uname { font-size: .88rem; font-weight: 600; color: var(--ink); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn .chev { color: var(--muted); font-size: .7rem; }
.user-menu { position: absolute; top: calc(100% + .45rem); right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 220px; padding: .35rem; z-index: 30; }
.um-head { padding: .5rem .6rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; }
.um-name { font-weight: 700; font-size: .92rem; }
.um-roles { font-size: .72rem; color: var(--muted); margin-top: .12rem; text-transform: capitalize; }
.um-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: .5rem .6rem; border-radius: 8px; font-size: .87rem; color: var(--ink); cursor: pointer; }
.um-item:hover { background: var(--bg); }
@media (max-width: 760px) { .user-btn .uname, .user-btn .chev { display: none; } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(1200px 600px at 70% -10%, #2a2a2a, var(--ink)); }
.login-card { background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 2.2rem; width: min(430px, 100%); }
.login-card .lbrand { display: flex; align-items: center; gap: .55rem; font-family: "Anton"; font-size: 1.7rem; letter-spacing: .5px; }
.login-card .lbrand .mark { width: 38px; height: 38px; display: inline-flex; }
.login-card .sub { color: var(--muted); margin: .4rem 0 1.5rem; font-size: .92rem; }
.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: .3rem; color: #444; }
.field input, .field textarea, .field select { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem; background: #fff; color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

/* ---------- controlli: dropdown, checkbox, datetime ---------- */
select { -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%231A1A1A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; padding-right: 1.8rem !important; }
select:hover { border-color: var(--ink); }
select.mini { padding: .32rem 1.6rem .32rem .55rem; border: 1px solid var(--line-2); border-radius: 7px; font-family: inherit; font-size: .82rem; background-color: #fff; background-position: right .45rem center; }
input[type="checkbox"] { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--line-2);
  border-radius: 5px; background: #fff; cursor: pointer; position: relative; flex: 0 0 auto; transition: background .12s, border-color .12s; }
input[type="checkbox"]:hover { border-color: var(--ink); }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 5px; height: 9px;
  border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="datetime-local"], .q-when, .when-row input { font-family: inherit; color: var(--ink); }
input[type="datetime-local"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .4rem; }
.msg { padding: .6rem .7rem; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: .9rem; }
.msg.ok { background: var(--ok-bg); color: var(--ok); } .msg.err { background: var(--warn-bg); color: var(--warn); }
.code-input input { letter-spacing: .5em; text-align: center; font-size: 1.5rem; font-family: "Archivo Black"; }

/* ---------- board ---------- */
.toolbar { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.seg button { border: none; background: none; padding: .35rem .8rem; font-size: .82rem; color: var(--muted); border-radius: 0; }
.seg button.on { background: var(--ink); color: #fff; }

.board { display: grid; grid-template-columns: repeat(5, minmax(238px, 1fr)); gap: 1rem; align-items: start; }
.col-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .65rem; padding: 0 .15rem; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.col-head h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .7px; margin: 0; color: #555; font-weight: 700; }
.col-head .count { margin-left: auto; font-size: .72rem; color: var(--muted); background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: .04rem .45rem; }
.col-body { display: flex; flex-direction: column; gap: .65rem; min-height: 30px; }
.col-empty { font-size: .78rem; color: var(--muted-2); padding: .7rem; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); text-align: center; }

.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: .55rem;
  border-left: 4px solid var(--line-2); cursor: pointer; transition: transform .1s, box-shadow .12s; overflow: hidden; }
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.card .thumb { height: 96px; border-radius: var(--radius-sm); background: var(--ink); margin-bottom: .5rem; position: relative;
  display: flex; align-items: flex-end; padding: .5rem; overflow: hidden; }
.card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .thumb .hl { position: relative; font-family: "Anton"; color: #fff; font-size: .92rem; line-height: 1.02; text-transform: uppercase; z-index: 1; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.card .thumb .hl .acc { color: var(--accent); }
.card .top { display: flex; align-items: center; gap: .35rem; padding: 0 .2rem; margin-bottom: .25rem; }
.card .pill-c { font-family: "Archivo Black"; font-size: .62rem; background: var(--ink); color: #fff; border-radius: 4px; padding: .12rem .3rem; letter-spacing: .3px; }
.card .pers { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .ctext { font-size: .82rem; line-height: 1.32; margin: .1rem .2rem .45rem; color: #2a2a2a; max-height: 3.9em; overflow: hidden; }
.card .meta { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; padding: 0 .2rem .15rem; }
.plat-i { font-size: .72rem; opacity: .8; }
.card .ctopic { font-size: .72rem; color: #444; font-weight: 600; margin: .15rem .2rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* tag categoria editoriale */
.cat-tag { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: .1rem .35rem; border-radius: 4px; white-space: nowrap; }
.c-informativo { background: #e2f4fb; color: #0a6b8a; }
.c-vendita { background: #fdeede; color: #b5640c; }
.c-discovery { background: #efeaff; color: #5b3fd4; }
.c-posizionamento { background: #e9f7ee; color: #15803d; }
.c-offtopic { background: #f0f0ee; color: #666; }
/* box connettore MCP in Impostazioni */
.conn-box { background: #fff8f1; border: 1px solid var(--accent); border-radius: 10px; padding: .7rem .8rem; margin-bottom: .6rem; }
.conn-title { font-size: .8rem; font-weight: 700; margin-bottom: .55rem; }
.card .when { margin-left: auto; font-size: .68rem; color: var(--muted); display: inline-flex; gap: .25rem; align-items: center; }
.card .when.warn { color: var(--warn); }

.s-Draft { border-left-color: #9aa0a6; } .dot.s-Draft { background:#9aa0a6; }
.s-InReview { border-left-color: var(--blue); } .dot.s-InReview { background: var(--blue); }
.s-ToPublish { border-left-color: var(--accent); } .dot.s-ToPublish { background: var(--accent); }
.s-Published { border-left-color: var(--ok); } .dot.s-Published { background: var(--ok); }
.s-Rejected { border-left-color: #c0392b; } .dot.s-Rejected { background: #c0392b; }

/* ---------- editor drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(26,26,26,.5); z-index: 40; display: flex; justify-content: flex-end; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer { background: var(--bg); width: min(960px, 100%); height: 100%; overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.25);
  animation: slidein .18s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
@keyframes slidein { from { transform: translateX(40px); } to { transform: none; } }
.dr-head { position: sticky; top: 0; background: var(--ink); color: #fff; padding: .7rem 1.1rem; display: flex; align-items: center; gap: .7rem; z-index: 3; }
.dr-head .pill-c { background: var(--accent); color: var(--ink); }
.dr-head .spacer { flex: 1; }
.savestate { font-size: .78rem; color: #b9b9b9; display: inline-flex; align-items: center; gap: .35rem; min-width: 96px; }
.savestate .d { width: 7px; height: 7px; border-radius: 50%; background: #6a6a6a; }
.savestate.saving .d { background: var(--accent); animation: pulse 1s infinite; }
.savestate.saved .d { background: var(--ok); }
.savestate.dirty .d { background: var(--accent); }
@keyframes pulse { 50% { opacity: .35; } }
.dr-head .ic { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; }
.dr-head .ic:hover:not(:disabled) { background: rgba(255,255,255,.2); }
.dr-head .ic:disabled { opacity: .35; }

.editor { display: grid; grid-template-columns: 1fr 340px; gap: 1.1rem; padding: 1.1rem; align-items: start; }
.panel { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem .9rem; margin-bottom: .8rem; }
.panel h4 { margin: 0 0 .55rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .7px; color: #666; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.panel h4 .spacer { flex: 1; }
textarea.copy { width: 100%; min-height: 180px; resize: vertical; line-height: 1.5; font-size: .96rem; border: none; outline: none; font-family: inherit; color: var(--ink); }
.copy-foot { display: flex; align-items: center; gap: .6rem; margin-top: .3rem; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); padding-top: .4rem; }
.collapse { margin-top: .55rem; border-top: 1px dashed var(--line-2); padding-top: .55rem; }
.collapse summary { cursor: pointer; font-size: .82rem; color: var(--blue); font-weight: 600; }
.collapse textarea { width: 100%; min-height: 70px; margin-top: .5rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .5rem; font-family: inherit; font-size: .86rem; }

/* preview creative (right) */
.creative { aspect-ratio: 4/5; max-height: 200px; margin: 0 auto; border-radius: var(--radius-sm); background: var(--ink); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: .8rem; }
.creative img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.creative .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #555; font-size: .8rem; }
.creative .hl { position: relative; font-family: "Anton"; color: #fff; font-size: 1.4rem; line-height: 1; text-transform: uppercase; z-index: 1; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.creative .hl .acc { color: var(--accent); }
.creative .site { position: relative; z-index: 1; color: #cfcfcf; font-size: .62rem; margin-top: .5rem; letter-spacing: .3px; }
.img-actions { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }

.chips { display: flex; flex-direction: column; gap: .35rem; }
#fPlats { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .7rem; }
.chk { display: flex; align-items: center; gap: .5rem; font-size: .86rem; cursor: pointer; user-select: none; padding: .15rem 0; }
.when-row { display: flex; gap: .4rem; align-items: center; }
.when-row input { flex: 1; }
.statuspill { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; border: 1px solid var(--line-2); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .2rem; }
.actions .grow { flex: 1; }

/* history */
.vlist { display: flex; flex-direction: column; gap: .35rem; }
.vitem { display: flex; align-items: center; gap: .55rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font-size: .8rem; }
.vitem.cur { border-color: var(--accent); background: #fff8f1; }
.vitem .vn { font-family: "Archivo Black"; font-size: .76rem; min-width: 2rem; color: var(--ink); }
.vitem .vp { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff { line-height: 1.6; font-size: .9rem; white-space: pre-wrap; background: #fff; padding: .8rem; border-radius: var(--radius-sm); border: 1px solid var(--line); margin-top: .6rem; }
.diff ins { background: #d6f3df; text-decoration: none; } .diff del { background: #fbdcd2; text-decoration: line-through; color: #9a3412; }
.diff-tool { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .82rem; }
.diff-tool select { padding: .3rem .45rem; border: 1px solid var(--line-2); border-radius: 6px; }

/* schedule view */
.sched-list { display: flex; flex-direction: column; gap: .5rem; max-width: 880px; }
.sched-row { display: flex; align-items: center; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .55rem .8rem; box-shadow: var(--shadow); }
.sched-row .slot { font-family: "Archivo Black"; font-size: .82rem; min-width: 132px; color: var(--ink); }
.sched-row .slot small { display: block; font-family: "Archivo"; font-weight: 400; color: var(--muted); font-size: .72rem; }
.sched-row .st { font-size: .8rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; }
.sched-row input[type=datetime-local] { border: 1px solid var(--line-2); border-radius: 6px; padding: .3rem .4rem; font-family: inherit; }

/* generic table */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl th, .tbl td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); font-size: .86rem; }
.tbl th { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #666; background: #fafafa; }
.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.empty-state .big { font-family: "Anton"; font-size: 1.4rem; color: #bbb; margin-bottom: .3rem; }

.toast { position: fixed; bottom: 1.3rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: .6rem 1.1rem; border-radius: var(--radius-sm); font-size: .85rem; z-index: 60; box-shadow: var(--shadow-lg); }
.toast.err { background: var(--warn); }

/* ---------- topbar editor controls ---------- */
.tb-title { display: flex; flex-direction: column; }
.tb-actions { display: flex; align-items: center; gap: .5rem; }
.btn-icon svg { width: 17px; height: 17px; display: block; }
.tb-actions .savestate { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; min-width: 86px; }
.tb-actions .savestate .d { width: 7px; height: 7px; border-radius: 50%; background: #b8b8b8; }
.tb-actions .savestate.saving .d { background: var(--accent); animation: pulse 1s infinite; }
.tb-actions .savestate.saved .d { background: var(--ok); }
.tb-actions .savestate.dirty .d { background: var(--accent); }
@keyframes pulse { 50% { opacity: .35; } }
.btn-ghost svg { width: 15px; height: 15px; vertical-align: -2px; }

/* ---------- editor view ---------- */
.edit-view { display: grid; grid-template-columns: 1fr 320px; gap: .9rem; align-items: start; }
.content:has(.edit-view) { padding: 1rem 1.2rem; }
.inp-mini { border: 1px solid var(--line-2); border-radius: 6px; padding: .25rem .45rem; font-family: inherit; font-size: .82rem; }
.imgrow { display: flex; gap: .4rem; align-items: center; }
.imgrow span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statuspill { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; border: 1px solid var(--line-2); }

/* ---------- diff legend ---------- */
.diff-legend { display: flex; gap: .6rem; margin: .6rem 0 .3rem; font-size: .76rem; }
.diff-legend .lg { padding: .1rem .45rem; border-radius: 999px; font-weight: 600; }
.diff-legend .lg.ins { background: #d6f3df; color: #15803d; }
.diff-legend .lg.del { background: #fbdcd2; color: #9a3412; }

/* ---------- da pubblicare (lista) ---------- */
.qlist { display: flex; flex-direction: column; gap: .8rem; max-width: 1000px; }
.q-row { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem .9rem; }
.q-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.q-head .pers { font-size: .76rem; color: var(--muted); }
.q-save { font-size: .74rem; color: var(--muted); }
.q-text { width: 100%; min-height: 70px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .55rem .65rem;
  font-family: inherit; font-size: .92rem; line-height: 1.5; resize: vertical; overflow: hidden; }
.q-text:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.q-tools { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.q-when { border: 1px solid var(--line-2); border-radius: 6px; padding: .3rem .4rem; font-family: inherit; font-size: .82rem; }
.q-diffbox { margin-top: .6rem; }

/* ---------- tabella / utenti ---------- */
.tbl .ell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-b { font-size: .68rem; text-transform: uppercase; letter-spacing: .3px; background: var(--ink); color: #fff; border-radius: 4px; padding: .08rem .35rem; }
.dotc { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: .35rem; }
.dotc.on { background: var(--ok); } .dotc.off { background: #c0392b; }
.tag-you { font-size: .62rem; background: var(--accent); color: var(--ink); border-radius: 4px; padding: .05rem .3rem; font-weight: 700; }

/* ---------- modal centrato (utenti) ---------- */
.overlay.center { align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1.4rem; width: min(440px, 92vw); animation: pop .14s ease; }
@keyframes pop { from { transform: scale(.96); opacity: .7; } to { transform: none; opacity: 1; } }
.modal h3 { font-family: "Anton"; font-weight: 400; font-size: 1.4rem; margin: 0 0 1rem; letter-spacing: .4px; }
.modal .chips { flex-direction: row; gap: 1rem; }
.modal-wide { width: min(560px, 94vw); }
.akkey { width: 100%; height: 64px; resize: none; border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: .5rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .72rem; word-break: break-all; background: #fff8f1; color: var(--ink); }
.akcfg { width: 100%; min-height: 64px; resize: vertical; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .5rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .74rem; background: #fafafa; color: var(--ink); margin-top: .4rem; }
.modal code { background: #f0f0ee; border-radius: 4px; padding: .05rem .3rem; font-size: .82em; }
.copyrow { display: flex; gap: .4rem; }
.copyrow input { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .5rem .6rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; background: #fafafa; color: var(--ink); }
#cfgArea .akcfg { min-height: 48px; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
/* ruoli come schede selezionabili */
.role-pick { display: flex; flex-direction: column; gap: .45rem; }
.role-opt { border: 1.5px solid var(--line-2); border-radius: 10px; padding: .6rem .85rem; cursor: pointer;
  display: flex; flex-direction: row; align-items: center; gap: .8rem; transition: border-color .12s, background .12s, box-shadow .12s; user-select: none; }
.role-opt:hover { border-color: var(--ink); }
.role-opt:has(input:checked) { border-color: var(--accent); background: #fff8f1; box-shadow: 0 0 0 1px var(--accent) inset; }
.role-opt input { margin-left: auto; flex: 0 0 auto; }
.ro-text { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.ro-name { font-weight: 700; font-size: .88rem; }
.ro-desc { font-size: .76rem; color: var(--muted); line-height: 1.3; }
@media (max-width: 560px) { .row.two { grid-template-columns: 1fr; } }

@media (max-width: 1180px) { .editor, .edit-view { grid-template-columns: 1fr; } .board { grid-template-columns: repeat(5, 250px); overflow-x: auto; } }
@media (max-width: 760px) { :root { --sidebar-w: 64px; } .sb-brand .label, .sb-item .label, .sb-foot { display: none; } .sb-item { justify-content: center; } }
