/* LIBRAVIUM 4.2 · Interfaccia "Studio"
 * Linguaggio visivo da software di impaginazione: barra dei menu, pannelli agganciati con
 * barra del titolo, barra strumenti compatta, pagina su piano di lavoro con righelli.
 * Due varianti: studio (scura, predefinita) e studio-light. Caricato per ultimo. */

body.studio{
  --st-font:"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",Arial,sans-serif;
  --st-mono:ui-monospace,"Cascadia Mono","SF Mono",Menlo,Consolas,monospace;
  --st-desk:#2a2b2f;          /* sfondo area di lavoro */
  --st-chrome:#202124;        /* barra menu, pannello di navigazione */
  --st-panel:#33353a;         /* pannelli */
  --st-title:#2b2d31;         /* barre titolo dei pannelli */
  --st-input:#1f2023;
  --st-raised:#3d3f45;        /* hover, elementi in rilievo */
  --st-line:#151618;          /* bordi esterni */
  --st-line-soft:#45474e;     /* separatori interni */
  --st-text:#e3e4e7;
  --st-muted:#9ea1a9;
  --st-faint:#757880;
  --st-accent:#4b8fe2;
  --st-accent-strong:#2f73c8;
  --st-accent-soft:#4b8fe233;
  --st-on-accent:#fff;
  --st-pasteboard:#4f5157;
  --st-ruler:#2f3135;
  --st-tick:#8a8d95;
  --st-page:#fbfaf7;
  --st-ok:#57b884;--st-warn:#e2aa4c;--st-danger:#e8615f;
  --st-btn:linear-gradient(#46484e,#3b3d42);
  --st-btn-hover:linear-gradient(#51535a,#44464c);
  --st-shadow:0 1px 0 #ffffff0a inset,0 3px 10px #00000040;
  --st-pop:0 10px 30px #00000073;
  color-scheme:dark;
}
body.studio[data-ui-theme="studio-light"]{
  --st-desk:#d4d5d7;--st-chrome:#ebebeb;--st-panel:#f5f5f5;--st-title:#e1e1e2;--st-input:#ffffff;--st-raised:#e6e7e9;
  --st-line:#a9aaad;--st-line-soft:#d0d1d4;--st-text:#1c1d20;--st-muted:#585b62;--st-faint:#80838a;
  --st-accent:#2f6fd6;--st-accent-strong:#2259b4;--st-accent-soft:#2f6fd626;
  --st-pasteboard:#a3a5a9;--st-ruler:#f2f2f2;--st-tick:#6f7177;--st-page:#ffffff;
  --st-ok:#23844f;--st-warn:#a86a07;--st-danger:#c43c3a;
  --st-btn:linear-gradient(#fdfdfd,#e8e8ea);--st-btn-hover:linear-gradient(#ffffff,#f0f0f2);
  --st-shadow:0 1px 0 #fff inset,0 1px 3px #0000001f;--st-pop:0 10px 28px #00000033;
  color-scheme:light;
}

/* Ponte verso i fogli di stile storici: le loro variabili seguono il tema Studio */
body.studio,body.studio[data-ui-theme]{--bg:var(--st-desk);--ink:var(--st-text);--muted:var(--st-muted);--surface:var(--st-panel);--surface-alt:var(--st-input);
  --line:var(--st-line-soft);--accent:var(--st-accent);--accent-ink:#fff;--shadow:var(--st-shadow);--paper:var(--st-panel);--blue:var(--st-accent);--gold:var(--st-warn)}

/* ---- Compatibilità generata automaticamente dai CSS storici (gen/compat.py) ---- */
body.studio button.secondary{background:var(--st-panel);color:var(--st-text)}
body.studio .username{color:var(--st-muted)}
body.studio .eyebrow{color:var(--st-muted)}
body.studio .panel{background:var(--st-panel)}
body.studio select{border-color:var(--st-line-soft);background:var(--st-panel)}
body.studio .book-card{background:var(--st-panel)}
body.studio .loader{color:var(--st-text)}
body.studio body{background:var(--st-panel)}
body.studio .topbar{border-bottom-color:var(--st-line-soft)}
body.studio .panel{border-color:var(--st-line-soft)}
body.studio .library-hero .eyebrow{color:var(--st-muted)}
body.studio .library-hero-side span{color:var(--st-muted)}
body.studio .install-btn{background:var(--st-input);color:var(--st-text)}
body.studio .library-stats span{border-color:var(--st-line-soft);background:var(--st-panel)}
body.studio .empty-library{background:var(--st-panel);border-color:var(--st-line-soft)}
body.studio .empty-library span{color:var(--st-muted)}
body.studio .back-link{color:var(--st-muted)}
body.studio .font-controls{color:var(--st-muted)}
body.studio .danger-link{color:var(--st-muted)}
body.studio .reading-footer #counter{color:var(--st-text)}
body.studio .reading-footer #reader-status{color:var(--st-muted)}
body.studio .reader-error{color:var(--st-text);background:var(--st-panel)}
body.studio .shelf-chip{border-color:var(--st-line-soft);background:var(--st-panel);color:var(--st-text)}
body.studio .resume-card{background:var(--st-panel);border-color:var(--st-line-soft);color:var(--st-text)}
body.studio .resume-card small{color:var(--st-muted)}
body.studio .resume-format{color:var(--st-muted)}
body.studio .resume-meter,body.studio .book-progress{background:var(--st-panel)}
body.studio .resume-meter i,body.studio .book-progress div{background:var(--st-input)}
body.studio .library-filters{background:var(--st-panel);border-color:var(--st-line-soft)}
body.studio .text-button{color:var(--st-muted) !important}
body.studio .note-item{border-color:var(--st-line-soft);background:var(--st-panel)}
body.studio .publishing-hero .button{background:var(--st-input);color:var(--st-text)}
body.studio .publication-card{background:var(--st-panel);border-color:var(--st-line-soft)}
body.studio .publication-info h2 a{color:var(--st-text)}
body.studio .publication-summary{color:var(--st-text)}
body.studio .publication-footer small{color:var(--st-muted)}
body.studio .detail-byline{color:var(--st-muted)}
body.studio .detail-actions .secondary{background:var(--st-panel);color:var(--st-text)}
body.studio .publication-form textarea,body.studio .review-actions input{border-color:var(--st-line-soft)}
body.studio .publication-status{border-color:var(--st-line-soft);background:var(--st-panel)}
body.studio .withdraw-form{border-top-color:var(--st-line-soft)}
body.studio .book-publish-status{background:var(--st-panel);border-color:var(--st-line-soft)}
body.studio .book-publish-status a{color:var(--st-text)}
body.studio .editorial-stats article{background:var(--st-panel);border-color:var(--st-line-soft)}
body.studio .editorial-stats strong{color:var(--st-text)}
body.studio .editorial-stats span{color:var(--st-muted)}
body.studio .review-actions{border-top-color:var(--st-line-soft)}
body.studio .reader-guest-tip{background:var(--st-panel);border-color:var(--st-line-soft)}
body.studio .unpublish-form input{border-color:var(--st-line-soft)}
body.studio .library-hero{border-color:var(--st-line-soft)}
body.studio .quick-view{border-color:var(--st-line-soft)}
body.studio .reader-scroll .scroll-paper{background:var(--st-panel)}
body.studio .reader-native-fallback iframe{background:var(--st-panel)}
body.studio .catalog-grid img{background:var(--st-panel)}
body.studio .pagination a{border-color:var(--st-line-soft)}
body.studio .pagination a:hover{border-color:var(--st-line-soft)}
body.studio .folio-brand-subtitle{color:var(--st-muted)}
body.studio .folio-site-footer{border-top-color:var(--st-line-soft);color:var(--st-muted)}
body.studio .folio-site-footer strong{color:var(--st-muted)}
body.studio .folio-console{color:var(--st-text)}
body.studio .folio-overline{color:var(--st-muted)}
body.studio .folio-hero-actions .folio-action{background:var(--st-input);color:var(--st-text)}
body.studio .folio-tabs a{color:var(--st-muted)}
body.studio .folio-tabs a:hover{background:var(--st-panel)}
body.studio .folio-kpi{background:var(--st-panel);color:var(--st-text) !important}
body.studio .folio-kpi-hot{border-color:var(--st-line-soft);background:var(--st-panel)}
body.studio .folio-kpi-label{color:var(--st-muted)}
body.studio .folio-kpi strong{color:var(--st-text)}
body.studio .folio-kpi small{color:var(--st-muted)}
body.studio .folio-kpi-hot .folio-kpi-icon{color:var(--st-muted)}
body.studio .folio-surface{background:var(--st-panel)}
body.studio .folio-section-head h2{color:var(--st-text)}
body.studio .folio-section-head a,body.studio .folio-review-actions a{color:var(--st-muted)}
body.studio .folio-item{border-top-color:var(--st-line-soft)}
body.studio .folio-item-graphic{background:var(--st-panel);color:var(--st-muted)}
body.studio .folio-item-copy small{color:var(--st-muted)}
body.studio .folio-pill{background:var(--st-panel);color:var(--st-muted)}
body.studio .folio-pill-warn{color:var(--st-muted);background:var(--st-panel)}
body.studio .folio-empty{color:var(--st-muted)}
body.studio .folio-empty span{color:var(--st-muted)}
body.studio .folio-empty strong{color:var(--st-text)}
body.studio .folio-health{border-bottom-color:var(--st-line-soft)}
body.studio .folio-neutral{color:var(--st-muted)}
body.studio .folio-shortcuts a{border-color:var(--st-line-soft);color:var(--st-text)}
body.studio .folio-shortcuts a:hover{background:var(--st-panel)}
body.studio .folio-alert{border-color:var(--st-line-soft);background:var(--st-panel);color:var(--st-text)}
body.studio .folio-filters label{color:var(--st-muted)}
body.studio .folio-console input[type=search],body.studio .folio-console input[type=text],body.studio .folio-console input[type=number],body.studio .folio-console select{border-color:var(--st-line-soft);background:var(--st-panel);color:var(--st-text)}
body.studio .folio-table th{background:var(--st-panel);color:var(--st-muted);border-bottom-color:var(--st-line-soft)}
body.studio .folio-table td{border-bottom-color:var(--st-line-soft);color:var(--st-text)}
body.studio .folio-table td strong{color:var(--st-text)}
body.studio .folio-table td small{color:var(--st-muted)}
body.studio .folio-hint{color:var(--st-muted)}
body.studio .folio-export{border-color:var(--st-line-soft);color:var(--st-text)}
body.studio .folio-review{border-color:var(--st-line-soft);background:var(--st-panel)}
body.studio .folio-review-date{color:var(--st-muted)}
body.studio .folio-review p{color:var(--st-muted)}
body.studio .folio-review-meta{color:var(--st-muted) !important}
body.studio .folio-review-form label{color:var(--st-muted)}
body.studio .folio-switch{border-bottom-color:var(--st-line-soft)}
body.studio .folio-switch strong{color:var(--st-text)}
body.studio .folio-switch small{color:var(--st-muted)}
body.studio .folio-switch input[type=checkbox]{background:var(--st-panel)}
body.studio .folio-switch input[type=checkbox]:before{background:var(--st-panel)}
body.studio .folio-settings-form>label:not(.folio-switch){color:var(--st-muted)}
body.studio .folio-console-footer{color:var(--st-muted)}
body.studio .folio-console-footer strong{color:var(--st-muted)}
body.studio .connect-format{border-color:var(--st-line-soft)}
body.studio .connect-stats span{border-color:var(--st-line-soft)}
body.studio .connect-recipient{border-color:var(--st-line-soft)}
body.studio .drive-hero .eyebrow{color:var(--st-muted)}
body.studio .drive-status .drive-dot{background:var(--st-input)}
body.studio .drive-status .drive-dot.connected{background:var(--st-input)}
body.studio .drive-card-icon{color:var(--st-text)}
body.studio .drive-preview-wrap iframe{background:var(--st-panel)}
body.studio .drive-hero .drive-status .secondary{background:var(--st-panel);color:var(--st-text)}
body.studio .secret-key{border-color:var(--st-line-soft);background:var(--st-panel);color:var(--st-text)}

body.studio main :is(h1,h2,h3,h4,strong,b){color:inherit}

/* ---------- Base ---------- */
body.studio{margin:0;background:var(--st-desk);color:var(--st-text);font:14px/1.5 var(--st-font);-webkit-font-smoothing:antialiased;
  display:grid;grid-template-columns:232px minmax(0,1fr);grid-template-rows:auto 1fr auto;grid-template-areas:"bar bar" "dock main" "dock foot";min-height:100vh;min-height:100dvh}
body.studio *{scrollbar-color:var(--st-line-soft) transparent}
body.studio a{color:var(--st-accent)}
body.studio a:hover{text-decoration:underline}
body.studio :is(h1,h2,h3,h4){font-family:var(--st-font);color:var(--st-text);letter-spacing:0;line-height:1.25}
body.studio h1{font-size:21px;font-weight:600;margin:0 0 6px}
body.studio h2{font-size:15px;font-weight:600;margin:0 0 10px}
body.studio h3{font-size:14px;font-weight:600;margin:0 0 6px}
body.studio p{margin:0 0 10px}
body.studio .muted,body.studio small{color:var(--st-muted)}
body.studio .muted{font-size:12.5px}
body.studio :is(.eyebrow,.folio-overline){font:600 10.5px/1.4 var(--st-font);letter-spacing:.09em;text-transform:uppercase;color:var(--st-muted);margin:0 0 4px}
body.studio code{font-family:var(--st-mono);font-size:12px;background:var(--st-input);border:1px solid var(--st-line-soft);border-radius:3px;padding:1px 5px;color:var(--st-text)}
body.studio hr{border:0;border-top:1px solid var(--st-line-soft);margin:16px 0}
body.studio ::selection{background:var(--st-accent);color:#fff}
body.studio :focus-visible{outline:2px solid var(--st-accent);outline-offset:1px}

/* ---------- Barra dei menu ---------- */
body.studio .topbar.studio-menubar{grid-area:bar;position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:10px;min-height:0;height:40px;padding:0 12px;
  background:var(--st-chrome);color:var(--st-text);border-bottom:1px solid var(--st-line);box-shadow:0 1px 0 #ffffff08}
body.studio .studio-menubar .logo{display:flex;align-items:center;gap:8px;color:var(--st-text);font:700 13.5px/1 var(--st-font);letter-spacing:.06em;text-decoration:none;white-space:nowrap;min-width:0}
body.studio .studio-menubar .folio-brandmark{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:4px;background:var(--st-accent);color:#fff;font-size:12px;letter-spacing:0}
body.studio .studio-menubar .folio-brand-subtitle{font-weight:400;letter-spacing:0;color:var(--st-muted);font-size:12.5px;overflow:hidden;text-overflow:ellipsis}
body.studio .studio-menubar-right{margin-left:auto;display:flex;align-items:center;gap:6px}
body.studio .studio-menubar-right form{margin:0}
body.studio .studio-menubar .username{display:flex;align-items:center;gap:7px;color:var(--st-text);font-size:13px;padding:3px 8px 3px 3px;border-radius:4px;text-decoration:none}
body.studio .studio-menubar .username:hover{background:var(--st-raised)}
body.studio .studio-avatar{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--st-raised);border:1px solid var(--st-line-soft);font-size:11.5px;font-weight:700}
body.studio .studio-menubar .studio-logout{height:28px;padding:0 10px;font-size:12.5px;color:var(--st-muted);background:transparent;border:1px solid transparent}
body.studio .studio-menubar .studio-logout:hover{color:var(--st-text);border-color:var(--st-line-soft);background:var(--st-raised)}
body.studio .topbar .studio-nav-toggle{display:none;width:32px;height:30px;padding:0;font-size:17px;background:transparent;border:1px solid transparent;color:var(--st-text);border-radius:4px}
body.studio .topbar .studio-nav-toggle:hover{background:var(--st-raised);border-color:var(--st-line-soft)}

/* ---------- Pannello di navigazione agganciato ---------- */
body.studio .studio-dock{grid-area:dock;position:sticky;top:40px;align-self:start;height:calc(100vh - 40px);height:calc(100dvh - 40px);overflow:auto;
  background:var(--st-chrome);border-right:1px solid var(--st-line);display:flex;flex-direction:column;z-index:50}
body.studio .studio-dock nav{padding:8px 0;flex:1}
body.studio .studio-dock-group{margin:0 0 6px}
body.studio .studio-dock-title{margin:0 8px 3px;padding:5px 8px;font:600 10.5px/1.3 var(--st-font);letter-spacing:.09em;text-transform:uppercase;color:var(--st-faint);
  border-bottom:1px solid var(--st-line-soft)}
body.studio .studio-dock a{display:flex;align-items:center;gap:9px;margin:1px 8px;padding:5px 9px;border-radius:4px;color:var(--st-text);font-size:13px;text-decoration:none;line-height:1.35}
body.studio .studio-dock a:hover{background:var(--st-raised)}
body.studio .studio-dock a.active{background:var(--st-accent);color:var(--st-on-accent)}
body.studio .studio-ico{width:16px;text-align:center;opacity:.85;font-size:13px}
body.studio .studio-dock-foot{margin:0;padding:10px 16px;font-size:11px;color:var(--st-faint);border-top:1px solid var(--st-line-soft)}
body.studio .studio-scrim{position:fixed;inset:40px 0 0;background:#0008;z-index:45}
body.studio .studio-scrim[hidden]{display:none}

/* Ospiti: nessun pannello laterale su accesso/registrazione */
body.studio.studio-guest{grid-template-columns:minmax(0,1fr);grid-template-areas:"bar" "main" "foot"}
body.studio.studio-guest .studio-dock{display:none}

/* ---------- Area di lavoro ---------- */
body.studio main.container{grid-area:main;max-width:none;width:100%;margin:0;padding:18px clamp(14px,2vw,26px) 28px;box-sizing:border-box}
body.studio:not(.studio-page-reader) main.container>*{max-width:1320px}
body.studio .folio-site-footer{grid-area:foot;display:flex;justify-content:space-between;gap:12px;margin:0;padding:8px clamp(14px,2vw,26px);border-top:1px solid var(--st-line);
  background:var(--st-chrome);color:var(--st-faint);font-size:11.5px}
body.studio .folio-site-footer strong{color:var(--st-muted);font-weight:600}
body.studio .notice{background:var(--st-accent-soft);border:1px solid var(--st-accent);border-left-width:3px;color:var(--st-text);border-radius:4px;padding:8px 12px;font-size:13px;margin:0 0 14px}

/* ---------- Pannelli (dock widget) ---------- */
body.studio :is(.panel,.folio-surface,.connect-panel,.security-panel,.drive-card,.review-card,.wishlist-card,.publication-card,.resume-card,.folio-kpi,.folio-review,.diag-item,.security-box,.note-item,.mark-entry,.highlight-entry){
  background:var(--st-panel);color:var(--st-text);border:1px solid var(--st-line);border-radius:4px;box-shadow:var(--st-shadow)}
body.studio .panel{padding:14px 16px;margin:0 0 14px}
body.studio .panel>h2:first-child,body.studio .panel>.section-intro:first-child,body.studio .folio-section-head{
  margin:-14px -16px 14px;padding:7px 16px;background:var(--st-title);border-bottom:1px solid var(--st-line);border-radius:4px 4px 0 0;
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:13px}
body.studio .panel>h2:first-child{font-size:13px;font-weight:600}
body.studio .section-intro{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:0 0 10px}
body.studio .section-intro h2{font-size:13px;margin:0}
body.studio .section-intro .eyebrow{display:none}
body.studio .section-intro p.muted{margin:0;font-size:12px}
body.studio .folio-section-head h2{font-size:13px;margin:0}
body.studio .folio-section-head .folio-overline{display:none}
body.studio .auth.panel{max-width:400px;margin:7vh auto 20px}

/* Intestazioni di pagina: niente "hero", una testata di documento sobria */
body.studio :is(.library-hero,.premium-title,.drive-hero,.publishing-hero,.folio-hero,.author-hero,.editorial-intro,.connect-intro,.diagnostics-panel>.eyebrow){
  background:var(--st-panel);background-image:none;color:var(--st-text);border:1px solid var(--st-line);border-radius:4px;box-shadow:var(--st-shadow);
  padding:14px 16px;margin:0 0 14px;min-height:0}
body.studio :is(.library-hero,.premium-title,.drive-hero,.publishing-hero,.folio-hero,.author-hero,.editorial-intro,.connect-intro)::before,
body.studio :is(.library-hero,.premium-title,.drive-hero,.publishing-hero,.folio-hero,.author-hero,.editorial-intro,.connect-intro)::after{content:none!important;display:none!important}
body.studio :is(.library-hero,.premium-title,.drive-hero,.publishing-hero,.folio-hero,.author-hero,.editorial-intro,.connect-intro) h1{font-size:20px;font-family:var(--st-font);font-weight:600;color:var(--st-text);margin:2px 0 4px;letter-spacing:0}
body.studio :is(.library-hero,.premium-title,.drive-hero,.publishing-hero,.folio-hero,.author-hero,.editorial-intro,.connect-intro) p{color:var(--st-muted);font-size:13px;max-width:760px}
body.studio .library-hero{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
body.studio .library-hero>div:first-child>p:not(.eyebrow){display:none}
body.studio .library-stats{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
body.studio .library-stats span{background:var(--st-input);border:1px solid var(--st-line-soft);color:var(--st-muted);border-radius:3px;padding:2px 8px;font-size:12px}
body.studio .library-stats strong{color:var(--st-text)}
body.studio .library-hero-side{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
body.studio .library-hero-side>span{display:none}
body.studio .offline-entry{font-size:12.5px}

/* ---------- Pulsanti ---------- */
body.studio :is(button,.button){display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:30px;height:auto;padding:4px 13px;
  font:500 13px/1.2 var(--st-font);border-radius:3px;border:1px solid var(--st-accent-strong);background:var(--st-accent);color:var(--st-on-accent);
  box-shadow:0 1px 0 #ffffff26 inset;cursor:pointer;text-decoration:none;white-space:nowrap;transition:background .12s,border-color .12s}
body.studio :is(button,.button):hover{background:var(--st-accent-strong);text-decoration:none}
body.studio :is(button,.button):disabled{opacity:.5;cursor:default}
body.studio :is(button,.button).secondary,body.studio .install-btn{background:var(--st-btn);color:var(--st-text);border-color:var(--st-line);box-shadow:var(--st-shadow)}
body.studio :is(button,.button).secondary:hover,body.studio .install-btn:hover{background:var(--st-btn-hover)}
body.studio :is(button,.button).small{min-height:26px;padding:2px 9px;font-size:12.5px}
body.studio :is(button,.button).icon-btn{width:30px;min-width:30px;height:30px;min-height:30px;padding:0;font-size:16px}
body.studio :is(button.link,.text-button,.danger-link){background:transparent;border-color:transparent;box-shadow:none;color:var(--st-accent);padding:2px 6px;min-height:0}
body.studio :is(button.link,.text-button):hover{background:var(--st-raised)}
body.studio .danger-link,body.studio .book-delete button{color:var(--st-danger)!important}
body.studio .danger-link:hover{background:color-mix(in srgb,var(--st-danger) 14%,transparent)}

/* ---------- Campi ---------- */
body.studio label{font:600 12px/1.35 var(--st-font);color:var(--st-muted);gap:4px}
body.studio label.check,body.studio .check{color:var(--st-text);font-weight:400;font-size:13px;flex-direction:row;align-items:center;gap:7px}
body.studio :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),select,textarea){
  background:var(--st-input);color:var(--st-text);border:1px solid var(--st-line);border-radius:3px;min-height:30px;padding:4px 8px;
  font:400 13px/1.4 var(--st-font);box-shadow:0 1px 2px #0000002e inset;width:100%;box-sizing:border-box}
body.studio textarea{min-height:64px}
body.studio :is(input,select,textarea):focus{outline:none;border-color:var(--st-accent);box-shadow:0 0 0 2px var(--st-accent-soft)}
body.studio input::placeholder,body.studio textarea::placeholder{color:var(--st-faint)}
body.studio input[type=file]{font-size:12.5px;color:var(--st-muted);max-width:100%}
body.studio input[type=file]::file-selector-button{font:500 12.5px var(--st-font);border:1px solid var(--st-line);border-radius:3px;background:var(--st-btn);color:var(--st-text);padding:4px 10px;margin-right:8px;cursor:pointer}
body.studio :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:var(--st-accent)}
body.studio .stack{display:flex;flex-direction:column;gap:10px}

/* ---------- Tabelle ---------- */
body.studio :is(.table-wrap,.folio-table){overflow:auto}
body.studio table{border-collapse:collapse;width:100%;font-size:13px;color:var(--st-text)}
body.studio th{background:var(--st-title);color:var(--st-muted);font:600 11px/1.3 var(--st-font);text-transform:uppercase;letter-spacing:.06em;text-align:left;padding:7px 10px;border-bottom:1px solid var(--st-line)}
body.studio td{padding:7px 10px;border-bottom:1px solid var(--st-line-soft);vertical-align:middle}
body.studio tbody tr:hover td{background:var(--st-raised)}

/* ---------- Menu a tendina ---------- */
body.studio details.studio-menu{position:relative;display:inline-block}
body.studio details.studio-menu>summary{list-style:none;cursor:pointer;user-select:none}
body.studio details.studio-menu>summary::-webkit-details-marker{display:none}
body.studio details.studio-menu[open]>summary{background:var(--st-raised);border-color:var(--st-accent)}
body.studio .studio-menu-list{position:absolute;right:0;top:calc(100% + 4px);z-index:80;min-width:250px;display:flex;flex-direction:column;gap:2px;padding:5px;
  background:var(--st-panel);border:1px solid var(--st-line);border-radius:4px;box-shadow:var(--st-pop)}
body.studio .studio-menu-list>:is(button,.button,a){justify-content:flex-start;width:100%;background:transparent;border-color:transparent;box-shadow:none;color:var(--st-text);font-size:13px;min-height:28px}
body.studio .studio-menu-list>:is(button,.button,a):hover{background:var(--st-accent);color:#fff;text-decoration:none}
body.studio .studio-menu-list label{padding:4px 9px}
body.studio .studio-menu-list form{margin:0}
body.studio .studio-menu-list hr{margin:4px 0}

/* ---------- Biblioteca: miniature come nel pannello Pagine ---------- */
body.studio .add-book .upload-grid{display:grid;grid-template-columns:minmax(160px,1.3fr) minmax(140px,1fr) minmax(200px,1.3fr) auto;gap:10px;align-items:end}
body.studio #cover-status{margin:8px 0 0}
body.studio .drive-library-callout{display:flex;align-items:center;justify-content:space-between;gap:12px}
body.studio .drive-library-callout p{margin:0}
body.studio .shelves-area,body.studio .library-list,body.studio .resume-section{background:var(--st-panel);border:1px solid var(--st-line);border-radius:4px;box-shadow:var(--st-shadow);padding:14px 16px;margin:0 0 14px}
body.studio .shelves-area>.section-intro,body.studio .library-list>.section-intro,body.studio .resume-section>.section-intro{margin:-14px -16px 12px;padding:7px 16px;background:var(--st-title);border-bottom:1px solid var(--st-line);border-radius:4px 4px 0 0}
body.studio .shelf-create{display:flex;gap:6px;align-items:center}
body.studio .shelf-create input{width:220px}
body.studio .shelf-strip{display:flex;gap:4px;flex-wrap:wrap}
body.studio .shelf-strip .shelf-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 10px!important;border-radius:3px;border:1px solid var(--st-line)!important;background:var(--st-btn)!important;color:var(--st-text)!important;font-size:12.5px;text-decoration:none!important}
body.studio .shelf-strip .shelf-chip:hover{background:var(--st-btn-hover)!important}
body.studio .shelf-strip .shelf-chip.selected{background:var(--st-accent)!important;border-color:var(--st-accent-strong)!important;color:#fff!important}
body.studio .remove-shelf{margin-top:8px}
body.studio .library-list .library-filters{display:flex;gap:8px;align-items:end;flex-wrap:wrap;background:var(--st-title);border:1px solid var(--st-line-soft);border-radius:4px;padding:8px 10px;margin:0 0 14px;box-shadow:none}
body.studio .library-filters label{flex:1;min-width:150px}
body.studio .library-filters label.filter-fave{flex:0 0 auto;min-width:0;padding-bottom:6px}
body.studio .book-grid,body.studio .premium-book-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(178px,1fr));gap:14px}
body.studio .book-card{position:relative;background:var(--st-panel);border:1px solid var(--st-line);border-radius:4px;overflow:visible;box-shadow:var(--st-shadow);display:flex;flex-direction:column;transform:none}
body.studio .book-card:hover{border-color:var(--st-accent);transform:none}
body.studio .book-card .cover{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;aspect-ratio:3/4;min-height:0;height:auto;
  padding:14px;margin:0;border-radius:3px 3px 0 0;background:var(--st-pasteboard)!important;color:#222!important;text-decoration:none;overflow:hidden}
body.studio .book-card .cover img{width:100%;height:100%;object-fit:cover;box-shadow:0 2px 10px #00000059;border-radius:1px;position:static}
body.studio .book-card .cover:not(.has-cover){box-shadow:inset 0 0 0 14px var(--st-pasteboard);background:var(--st-page)!important;padding:30px 24px;text-align:center}
body.studio .book-card .cover:not(.has-cover) strong{font:600 15px/1.25 Georgia,"Times New Roman",serif;color:#26272b!important}
body.studio .book-card .cover-decoration{color:var(--st-accent)!important;font-size:18px}
body.studio .book-card .format-label{position:absolute;left:18px;top:18px;background:#000000a6;color:#fff!important;font:600 10px/1 var(--st-font);letter-spacing:.06em;padding:3px 5px;border-radius:2px}
body.studio .quick-view{position:absolute;right:8px;top:8px;z-index:3;min-height:24px;height:24px;padding:0 8px;font-size:11.5px;background:#000000a6;border-color:transparent;color:#fff;opacity:0;transition:opacity .15s}
body.studio .quick-view span{display:inline}
body.studio .book-card:hover .quick-view,body.studio .quick-view:focus-visible{opacity:1}
body.studio .book-info{padding:9px 10px 10px;display:flex;flex-direction:column;gap:2px;flex:1;background:transparent}
body.studio .book-info h3{font-size:13.5px;font-weight:600;margin:0;color:var(--st-text);font-family:var(--st-font);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
body.studio .book-info>p{font-size:12px;color:var(--st-muted);margin:0 0 4px}
body.studio .book-progress{height:4px;border-radius:2px;background:var(--st-input);overflow:hidden;margin:4px 0 2px}
body.studio .book-progress>div{height:100%;background:var(--st-accent)}
body.studio .book-actions{display:flex;gap:5px;align-items:center;margin-top:auto;padding-top:6px}
body.studio .book-actions>.button{flex:1;min-height:28px}
body.studio .book-actions form{margin:0}
body.studio .book-actions form>button{width:30px;padding:0;min-height:28px;background:var(--st-btn);color:var(--st-warn);border-color:var(--st-line)}
body.studio .book-more>summary{width:30px;padding:0;min-height:28px;font-size:16px;letter-spacing:1px}
body.studio .book-more .studio-menu-list{min-width:260px}
body.studio .book-more .studio-menu-list>div,body.studio .book-more .studio-menu-list>form{padding:4px 6px;border-bottom:1px solid var(--st-line-soft)}
body.studio .book-more .studio-menu-list>:last-child{border-bottom:0}
body.studio .book-more .book-tools{display:flex;flex-direction:column;gap:6px;align-items:stretch}
body.studio .book-more .assign-form{display:flex;gap:4px}
body.studio .book-more .cover-replace{display:flex;flex-direction:column;gap:5px}
body.studio .book-more .replace-label{font-weight:600}
body.studio .book-more .book-publish-status{font-size:12.5px}
body.studio .book-more :is(.offline-download,.cover-replace>button,.assign-form>button){justify-content:center}
body.studio .drive-cloud-label{font-size:12px;color:var(--st-muted)}
body.studio .empty-library{grid-column:1/-1;padding:40px 10px;text-align:center;color:var(--st-muted);border:1px dashed var(--st-line-soft);border-radius:4px}
body.studio .empty-library span{font-size:28px;color:var(--st-faint)}
body.studio .resume-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
body.studio .resume-card{display:flex;flex-direction:column;gap:3px;padding:10px 12px;text-decoration:none!important;color:var(--st-text);background:var(--st-input)}
body.studio .resume-card:hover{border-color:var(--st-accent)}
body.studio .resume-format{font-size:10px;letter-spacing:.08em;color:var(--st-muted)}
body.studio .resume-meter{height:4px;background:var(--st-raised);border-radius:2px;overflow:hidden;display:block}
body.studio .resume-meter i{display:block;height:100%;background:var(--st-accent)}
body.studio .pagination{display:flex;gap:10px;align-items:center;justify-content:center;margin-top:14px;font-size:12.5px;color:var(--st-muted)}
body.studio .offline-status{font-size:12.5px;color:var(--st-muted)}
body.studio dialog.premium-modal{background:var(--st-panel);color:var(--st-text);border:1px solid var(--st-line);border-radius:4px;box-shadow:var(--st-pop)}
body.studio dialog::backdrop{background:#000a}

/* ---------- Lettore: barra strumenti, piano di lavoro con righelli, barra di stato ---------- */
body.studio .reader-layout{max-width:none}
body.studio .reader-top{display:flex;align-items:center;gap:8px;margin:0 0 8px;min-width:0}
body.studio .reader-top .back-link{font-size:12.5px;color:var(--st-muted);white-space:nowrap}
body.studio .studio-crumb-sep{color:var(--st-faint)}
body.studio .reader-head{display:flex;align-items:baseline;gap:10px;margin:0;min-width:0}
body.studio .reader-head h1{font:600 15px/1.3 var(--st-font);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.studio .reader-author{font-size:12.5px;color:var(--st-muted);margin:0;white-space:nowrap}
body.studio .reader-top .eyebrow{margin:0 0 0 auto;background:var(--st-input);border:1px solid var(--st-line-soft);border-radius:3px;padding:1px 6px}
body.studio .studio-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:0;margin:0 0 8px;padding:3px;background:var(--st-chrome);border:1px solid var(--st-line);border-radius:4px;box-shadow:var(--st-shadow)}
body.studio .studio-toolbar .tb-group{display:flex;align-items:center;gap:3px;padding:2px 6px;border-right:1px solid var(--st-line-soft);margin:0}
body.studio .studio-toolbar .tb-group:last-child{border-right:0}
body.studio .studio-toolbar .tb-grow{flex:1 1 200px;min-width:160px}
body.studio .studio-toolbar .tb-end{margin-left:auto;border-right:0;border-left:1px solid var(--st-line-soft)}
body.studio .studio-toolbar .chapter-label{flex:1;display:block;min-width:0;max-width:none}
body.studio .studio-toolbar :is(select,#chapters){min-height:28px;height:28px;padding:2px 6px;font-size:12.5px;max-width:none;width:auto}
body.studio .studio-toolbar #chapters{width:100%}
body.studio .studio-toolbar :is(button,.button,summary.button){min-height:28px;height:28px;padding:0 8px;font-size:12.5px;background:transparent;border-color:transparent;box-shadow:none;color:var(--st-text)}
body.studio .studio-toolbar :is(button,.button,summary.button):hover{background:var(--st-raised);border-color:var(--st-line-soft)}
body.studio .studio-toolbar .icon-btn{width:28px;min-width:28px;font-size:18px;padding:0}
body.studio .studio-toolbar [aria-pressed="true"]{background:var(--st-accent)!important;color:#fff!important}
body.studio .studio-toolbar .tb-count{display:inline-grid;place-items:center;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--st-input);font-size:10.5px;color:var(--st-muted)}
body.studio .studio-toolbar .font-controls{gap:2px;font-size:11.5px;color:var(--st-muted)}
body.studio .studio-toolbar .font-controls[hidden]{display:none}
body.studio .studio-toolbar .studio-menu-list{min-width:240px}
body.studio .studio-toolbar .studio-menu-list .speech-rate{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;font-weight:400;color:var(--st-text);font-size:12.5px}
body.studio .studio-toolbar .studio-menu-list .speech-rate select{width:auto}
body.studio .reader-guest-tip{font-size:12.5px;color:var(--st-muted);margin:0 0 8px}
body.studio .reader-tip{display:none}

body.studio .reader-surface,body.studio .reader-surface[data-theme]{--ruler:16px;background:var(--st-pasteboard);border:1px solid var(--st-line);border-radius:3px;box-shadow:0 1px 0 #ffffff0d inset;
  height:calc(100dvh - 205px);min-height:420px;max-height:none;padding:var(--ruler) 0 0 var(--ruler);box-sizing:border-box}
body.studio .reader-surface::before,body.studio .reader-surface::after{content:"";position:absolute;z-index:4;pointer-events:none;background-color:var(--st-ruler)}
body.studio .reader-surface::before{left:0;right:0;top:0;height:var(--ruler);border-bottom:1px solid var(--st-line);
  background-image:linear-gradient(90deg,var(--st-tick) 1px,transparent 1px),linear-gradient(90deg,var(--st-tick) 1px,transparent 1px),linear-gradient(90deg,var(--st-tick) 1px,transparent 1px);
  background-size:100px 100%,50px 45%,10px 22%;background-position:var(--ruler) 0,var(--ruler) 100%,var(--ruler) 100%;background-repeat:repeat-x}
body.studio .reader-surface::after{left:0;top:0;bottom:0;width:var(--ruler);border-right:1px solid var(--st-line);
  background-image:linear-gradient(var(--st-tick) 1px,transparent 1px),linear-gradient(var(--st-tick) 1px,transparent 1px),linear-gradient(var(--st-tick) 1px,transparent 1px);
  background-size:100% 100px,45% 50px,22% 10px;background-position:0 var(--ruler),100% var(--ruler),100% var(--ruler);background-repeat:repeat-y;
  box-shadow:inset 0 var(--ruler) 0 0 var(--st-title)}
body.studio .reader-surface:is(.reader-scroll,.reader-text-mode){--ruler:0px}
body.studio .reader-surface:is(.reader-scroll,.reader-text-mode)::before,body.studio .reader-surface:is(.reader-scroll,.reader-text-mode)::after{display:none}
body.studio .reader-surface .pdf-page,body.studio .reader-surface .single-pdf{box-shadow:0 3px 14px #00000059}
body.studio .reader-surface .loader{color:#fff;font-size:13px}
body.studio:not(.reader-immersive) .reading-footer{display:flex;align-items:center;gap:10px;max-width:none;margin:8px 0 0;padding:3px 8px;min-height:32px;background:var(--st-chrome);border:1px solid var(--st-line);border-radius:4px;font-size:12px}
body.studio .reading-footer #counter{color:var(--st-text);font:600 12px var(--st-font);min-width:110px}
body.studio .reading-footer #reader-status,body.studio .reading-footer .speech-status{color:var(--st-muted);font-size:11.5px;min-width:0;max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .reading-footer .mobile-page-btn{background:transparent;border-color:transparent;color:var(--st-text);box-shadow:none}
body.studio :is(.bookmarks-panel,.notes-panel,.reader-search-panel,.reader-highlights,.reader-ocr-panel,.reader-metrics-panel){margin:0 0 8px}
/* Focus: nasconde tutto tranne pagina e barra di stato */
body.studio.reading-focus :is(.studio-dock,.reader-top,.reader-guest-tip){display:none}
body.studio.studio-page-reader.reading-focus{grid-template-columns:minmax(0,1fr);grid-template-areas:"bar" "main" "foot"}

/* Lettore: il pannello di navigazione non ruba spazio, si apre con ☰ */
body.studio.studio-page-reader{grid-template-columns:minmax(0,1fr);grid-template-areas:"bar" "main" "foot"}
body.studio.studio-page-reader .topbar .studio-nav-toggle{display:inline-flex}
body.studio.studio-page-reader .studio-dock{position:fixed;left:0;top:40px;bottom:0;width:260px;height:auto;transform:translateX(-102%);transition:transform .18s ease;box-shadow:var(--st-pop)}
body.studio.studio-page-reader.studio-dock-open .studio-dock{transform:none}
body.studio.studio-page-reader main.container{padding-top:10px;padding-bottom:10px}

/* Schermo intero: nascondi la cornice Studio */
body.studio.reader-immersive :is(.studio-menubar,.studio-dock,.studio-toolbar,.reader-top,.studio-scrim){display:none!important}
body.studio.reader-immersive .reader-surface,body.studio.reader-immersive .reader-surface[data-theme]{--ruler:0px;border:0;border-radius:0;height:100dvh;padding:0}
body.studio.reader-immersive .reader-surface::before,body.studio.reader-immersive .reader-surface::after{display:none}
body.studio.reader-immersive .reading-footer{background:#18191ce6;border-color:#ffffff1f;border-radius:999px;color:#fff}
body.studio.reader-immersive .reading-footer #counter{color:#fff}

/* ---------- Anteprima Google Drive ---------- */
body.studio .drive-preview-wrap{border:1px solid var(--st-line);border-radius:3px;background:var(--st-pasteboard);padding:10px}
body.studio .drive-preview-wrap iframe{box-shadow:0 3px 14px #00000059;background:#fff}
body.studio .drive-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px}
body.studio .drive-card{display:flex;gap:10px;padding:10px 12px;background:var(--st-input)}
body.studio .drive-card-icon{color:var(--st-accent);font-size:20px}
body.studio .drive-card-actions{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
body.studio .drive-card-actions form{display:flex;gap:4px;margin:0}
body.studio .drive-status{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:var(--st-input);border:1px solid var(--st-line-soft);border-radius:4px;padding:6px 10px;margin-top:8px}
body.studio .drive-status form{margin:0}
body.studio .drive-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* ---------- Catalogo e pubblicazioni ---------- */
body.studio :is(.catalog-toolbar,.catalog-search){background:var(--st-title);border:1px solid var(--st-line-soft);border-radius:4px;padding:8px 10px;box-shadow:none;display:flex;gap:8px;align-items:end;flex-wrap:wrap;margin:0 0 14px}
body.studio .catalog-search label{flex:1;min-width:180px}
body.studio .public-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}
body.studio .publication-card{display:grid;grid-template-columns:96px 1fr;gap:12px;padding:10px;overflow:hidden;color:var(--st-text);background:var(--st-panel)}
body.studio .publication-card:hover{border-color:var(--st-accent)}
body.studio :is(.publication-cover,.detail-cover){background:var(--st-pasteboard)!important;border-radius:2px;padding:8px;min-height:0;aspect-ratio:3/4;display:flex;align-items:center;justify-content:center;color:#222!important;box-shadow:none}
body.studio :is(.publication-cover,.detail-cover) img{width:100%;height:100%;object-fit:cover;box-shadow:0 2px 8px #0006}
body.studio .publication-cover-fallback{background:var(--st-page);color:#26272b!important;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:8px;font:600 12px/1.25 Georgia,serif;box-shadow:0 2px 8px #0006}
body.studio :is(.publication-info,.detail-main) h2,body.studio .publication-detail h1{font-family:var(--st-font)}
body.studio .publication-detail{display:grid;grid-template-columns:minmax(160px,240px) 1fr;gap:18px;align-items:start}
body.studio .detail-cover{width:100%}
body.studio .detail-byline,body.studio .detail-description{color:var(--st-muted)}
body.studio .detail-actions{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}
body.studio .breadcrumb{font-size:12.5px;margin:0 0 10px}
body.studio .publication-status,body.studio .folio-pill{display:inline-block;font:600 10.5px/1.5 var(--st-font);letter-spacing:.05em;text-transform:uppercase;padding:1px 7px;border-radius:3px;background:var(--st-input);border:1px solid var(--st-line-soft);color:var(--st-muted)}
body.studio .folio-pill-warn{color:var(--st-warn);border-color:color-mix(in srgb,var(--st-warn) 50%,transparent)}
body.studio .editorial-stats,body.studio .connect-stats,body.studio .metric-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin:0 0 14px}
body.studio :is(.editorial-stats,.connect-stats,.metric-grid)>*{background:var(--st-panel);border:1px solid var(--st-line);border-radius:4px;padding:10px 12px;box-shadow:var(--st-shadow);color:var(--st-text)}
body.studio .metric-grid span{color:var(--st-muted);font-size:12px;display:block}
body.studio .metric-grid strong{font-size:22px;font-weight:600}
body.studio .activity-chart{display:flex;gap:4px;align-items:flex-end;height:140px;background:var(--st-input);border:1px solid var(--st-line-soft);border-radius:3px;padding:8px}
body.studio .activity-day{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:3px}
body.studio .activity-day span{width:100%;background:var(--st-accent);border-radius:2px 2px 0 0}
body.studio .activity-day small{font-size:10px}
body.studio .award-grid{display:flex;gap:6px;flex-wrap:wrap}

/* ---------- Preferenze: anteprima dei due temi ---------- */
body.studio .theme-choices{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;margin:0 0 14px}
body.studio .theme-tile{position:relative;display:flex;flex-direction:column;gap:3px;padding:8px;border:1px solid var(--st-line);border-radius:4px;background:var(--st-input);cursor:pointer;color:var(--st-text);font-weight:400}
body.studio .theme-tile:has(input:checked){border-color:var(--st-accent);box-shadow:0 0 0 2px var(--st-accent-soft)}
body.studio .theme-tile input{position:absolute;right:10px;top:10px}
body.studio .theme-tile strong{font-size:13px;color:var(--st-text)}
body.studio .theme-tile small{font-size:12px}
body.studio .theme-sample{display:grid!important;grid-template-columns:30% 1fr;grid-template-rows:12px 1fr;height:96px;border-radius:3px;overflow:hidden;border:1px solid #0006;background:none!important}
body.studio .theme-sample i{grid-column:1/-1;background:#202124;display:block}
body.studio .theme-sample b{background:#202124;border-right:1px solid #111;display:block}
body.studio .theme-sample em{display:block;background:radial-gradient(circle at 50% 55%,#fbfaf7 0 0) 50% 60%/34% 70% no-repeat,#4f5157}
body.studio .theme-studio-light .theme-sample i,body.studio .theme-studio-light .theme-sample b{background:#ebebeb;border-color:#bbb}
body.studio .theme-studio-light .theme-sample em{background:radial-gradient(circle at 50% 55%,#fff 0 0) 50% 60%/34% 70% no-repeat,#a3a5a9}
body.studio .theme-studio-light .theme-sample{border-color:#999}
body.studio .pref-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
body.studio .pref-actions{display:flex;gap:8px;margin-top:14px}

/* ---------- LIBRAVIUM Command ---------- */
body.studio.folio-admin-page{background:var(--st-desk);color:var(--st-text)}
body.studio .folio-console{--fc-accent:var(--st-accent);--fc-primary:var(--st-text);--fc-muted:var(--st-muted);--fc-border:var(--st-line-soft);color:var(--st-text);max-width:1320px;margin:0}
body.studio .folio-console :is(h1,h2,h3,h4,strong,p,td,label,li){color:inherit}
body.studio .folio-console :is(small,.folio-hint,.folio-kpi-label,.folio-review-date,.folio-review-meta){color:var(--st-muted)}
body.studio .folio-hero{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
body.studio .folio-hero .folio-overline{color:var(--st-muted)}
body.studio .folio-hero-actions{display:flex;gap:6px}
body.studio .folio-hero-actions a{padding:4px 12px;border-radius:3px;font-size:13px;font-weight:500;border:1px solid var(--st-line);background:var(--st-btn);color:var(--st-text)!important;box-shadow:var(--st-shadow)}
body.studio .folio-hero-actions a:first-child{background:var(--st-accent);border-color:var(--st-accent-strong);color:#fff!important}
body.studio .folio-tabs{display:flex;gap:0;flex-wrap:wrap;border-bottom:1px solid var(--st-line);margin:0 0 14px;background:transparent;padding:0;border-radius:0;box-shadow:none}
body.studio .folio-tabs a{padding:6px 14px;font-size:12.5px;font-weight:500;color:var(--st-muted);border:1px solid transparent;border-bottom:0;border-radius:4px 4px 0 0;margin-bottom:-1px;background:transparent;text-decoration:none}
body.studio .folio-tabs a:hover{color:var(--st-text);background:var(--st-raised)}
body.studio .folio-tabs a:is(.active,[aria-current]){color:var(--st-text);background:var(--st-panel);border-color:var(--st-line);box-shadow:none}
body.studio .folio-kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin:0 0 14px}
body.studio .folio-kpi{padding:10px 12px;border-radius:4px}
body.studio .folio-kpi strong{font-size:24px;font-weight:600;font-family:var(--st-font)}
body.studio .folio-kpi-hot{border-color:var(--st-warn);background:color-mix(in srgb,var(--st-warn) 10%,var(--st-panel))}
body.studio .folio-kpi-icon{color:var(--st-faint)}
body.studio .folio-surface{padding:14px 16px;border-radius:4px}
body.studio .folio-surface .folio-section-head{margin:-14px -16px 12px}
body.studio :is(.folio-dashboard-grid,.folio-bottom-grid){gap:12px}
body.studio :is(.folio-item,.folio-action,.folio-health>*,.folio-health){border-color:var(--st-line-soft)!important;background:transparent;color:var(--st-text)}
body.studio .folio-item-graphic{background:var(--st-input);color:var(--st-muted);border:1px solid var(--st-line-soft);border-radius:3px}
body.studio .folio-action{border:1px solid var(--st-line-soft);border-radius:3px;padding:6px 10px;text-decoration:none!important}
body.studio .folio-action:hover{background:var(--st-raised)}
body.studio .folio-switch{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--st-line-soft);color:var(--st-text)}
body.studio .folio-switch small{display:block;font-weight:400}
body.studio .folio-alert{background:color-mix(in srgb,var(--st-warn) 12%,var(--st-panel));border:1px solid var(--st-warn);border-radius:4px;color:var(--st-text)}
body.studio :is(.folio-empty,.connect-empty){color:var(--st-muted);border:1px dashed var(--st-line-soft);border-radius:4px;background:transparent}
body.studio .folio-console-footer{display:flex;justify-content:space-between;color:var(--st-faint);font-size:11.5px;border-top:1px solid var(--st-line-soft);padding-top:8px;margin-top:14px}
body.studio .folio-review{padding:10px 12px}
body.studio .folio-filters{display:flex;gap:8px;flex-wrap:wrap;align-items:end;background:var(--st-title);border:1px solid var(--st-line-soft);border-radius:4px;padding:8px 10px;margin:0 0 12px}
body.studio .folio-console :is(.diag-ok,.folio-good){color:var(--st-ok)!important}
body.studio .folio-console :is(.diag-bad,.folio-bad){color:var(--st-danger)!important}

/* ---------- Diagnostica, sicurezza, condivisione ---------- */
body.studio .diag-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:6px;margin:10px 0}
body.studio .diag-item{display:flex;justify-content:space-between;padding:6px 10px;background:var(--st-input);box-shadow:none}
body.studio .diag-ok{color:var(--st-ok)}
body.studio .diag-bad{color:var(--st-warn)}
body.studio .security-grid,body.studio .connect-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:12px}
body.studio :is(.security-box,.connect-recipient,.connect-book){background:var(--st-input);border:1px solid var(--st-line-soft);border-radius:4px;padding:10px 12px;box-shadow:none;color:var(--st-text)}
body.studio .recovery-codes{font-family:var(--st-mono)}
body.studio .secret-key{font-family:var(--st-mono);background:var(--st-input);padding:6px 8px;border-radius:3px;border:1px solid var(--st-line-soft)}
body.studio .security-links{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12.5px;margin:12px 0 0}
body.studio .notification-feed>*{border-bottom:1px solid var(--st-line-soft);padding:8px 0}
body.studio .notification-dot{background:var(--st-accent)}

/* ---------- Responsive: tablet e telefono ---------- */
@media (max-width:1060px){
  body.studio{grid-template-columns:minmax(0,1fr);grid-template-areas:"bar" "main" "foot"}
  body.studio .topbar .studio-nav-toggle{display:inline-flex}
  body.studio .studio-dock{position:fixed;left:0;top:40px;bottom:0;width:270px;height:auto;transform:translateX(-102%);transition:transform .18s ease;box-shadow:var(--st-pop)}
  body.studio.studio-dock-open .studio-dock{transform:none}
  body.studio .add-book .upload-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:640px){
  body.studio{font-size:14.5px}
  body.studio .studio-menubar .folio-brand-subtitle,body.studio .studio-username-text{display:none}
  body.studio main.container{padding:12px 10px 22px}
  body.studio .add-book .upload-grid,body.studio .drive-fields,body.studio .publication-detail{grid-template-columns:1fr}
  body.studio .book-grid,body.studio .premium-book-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  body.studio .book-more .studio-menu-list{position:fixed;left:10px;right:10px;top:auto;bottom:10px;min-width:0;max-height:70vh;overflow:auto}
  body.studio .shelf-create{width:100%}
  body.studio .shelf-create input{width:auto;flex:1}
  body.studio .studio-toolbar .tb-label{display:none}
  body.studio .studio-toolbar .tb-grow{order:10;flex-basis:100%;border-right:0;border-top:1px solid var(--st-line-soft);padding-top:4px}
  body.studio .studio-toolbar .tb-group{padding:2px 3px}
  body.studio .reader-surface,body.studio .reader-surface[data-theme]{--ruler:0px;height:calc(100dvh - 230px);min-height:300px}
  body.studio .reader-surface::before,body.studio .reader-surface::after{display:none}
  body.studio .reader-head .reader-author,body.studio .reader-top .eyebrow,body.studio .studio-crumb-sep{display:none}
  body.studio .folio-site-footer{flex-direction:column;gap:2px}
  body.studio .publication-card{grid-template-columns:72px 1fr}
}
@media (prefers-reduced-motion:reduce){body.studio *{transition:none!important}}

/* Correzioni dopo la prima verifica visiva */
body.studio .book-card .cover::before,body.studio .book-card .cover::after,body.studio .cover:before{content:none!important;display:none!important}
body.studio .resume-card strong{font:600 13.5px/1.3 var(--st-font);color:var(--st-text)}
body.studio input[type=file]{background:var(--st-input)!important;border:1px solid var(--st-line)!important;border-radius:3px!important;padding:3px!important;min-height:30px;width:100%;box-sizing:border-box;color:var(--st-muted)}
body.studio .library-list .library-filters label.filter-fave{flex:0 0 auto;min-width:0;align-self:center;padding:0;margin:0}
body.studio .library-list .library-filters label:first-of-type{flex:2 1 220px}
body.studio .library-list{margin-top:0}
body.studio .sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body.studio .theme-sample{--sd:#4f5157;--sc:#202124;--sp:#fbfaf7;height:92px!important;width:auto!important;
  background:linear-gradient(var(--sc),var(--sc)) 0 0/100% 12px no-repeat,linear-gradient(var(--sc),var(--sc)) 0 0/28% 100% no-repeat,
  linear-gradient(var(--sp),var(--sp)) 64% 70%/20% 62% no-repeat,var(--sd)!important}
body.studio .theme-studio-light .theme-sample{--sd:#a3a5a9;--sc:#ebebeb;--sp:#fff}
body.studio .theme-sample>*{display:none!important}
body.studio .catalog-toolbar:has(.catalog-search){background:none;border:0;padding:0;box-shadow:none}
body.studio .publication-cover-fallback,body.studio .publication-cover-fallback *{color:#26272b!important}
body.studio .folio-kpi{color:var(--st-text)!important;min-height:0;transition:none}
body.studio .folio-kpi:hover{transform:none;border-color:var(--st-accent)}
body.studio .folio-console .folio-kpi strong{color:var(--st-text);font:600 26px/1.15 var(--st-font);margin:6px 0 4px}
body.studio .folio-kpi-hot .folio-kpi-icon{color:var(--st-warn)}
body.studio .folio-console .folio-health strong.folio-success{color:var(--st-ok)}
body.studio .folio-console .folio-health strong.folio-warning{color:var(--st-warn)}
body.studio .folio-console .folio-health strong.folio-neutral{color:var(--st-muted)}
body.studio .folio-health{border-bottom-color:var(--st-line-soft)!important}
body.studio .folio-console .folio-action{border-radius:3px;border-color:var(--st-line-soft);color:var(--st-text);font-weight:500;font-size:13px;padding:7px 10px}
body.studio .folio-console .folio-action:hover{border-color:var(--st-accent);background:var(--st-raised)}
body.studio .offline-status{position:static;background:transparent;border:0;padding:0;margin:6px 0 0;box-shadow:none}
body.studio .offline-status:not(:empty){position:sticky;bottom:10px;background:var(--st-panel);border:1px solid var(--st-accent);border-radius:4px;padding:6px 10px;color:var(--st-text);box-shadow:var(--st-pop);z-index:20}
body.studio .studio-ico{display:inline-grid;place-items:center;width:18px;height:18px;opacity:.9}
body.studio .studio-ico svg{display:block}
body.studio .topbar.studio-menubar button.studio-logout{color:var(--st-muted)}
body.studio .topbar.studio-menubar button.studio-logout:hover{color:var(--st-text)}
body.studio .library-list .library-filters{display:grid;grid-template-columns:minmax(180px,2fr) minmax(110px,1fr) minmax(130px,1fr) auto auto;align-items:end}
body.studio .library-list .library-filters>input[type=hidden]{display:none}
body.studio .library-list .library-filters label{min-width:0}
body.studio .library-list .library-filters label.filter-fave{flex-direction:row;align-self:end;height:30px;white-space:nowrap}
body.studio .book-info>p{margin:0 0 2px}
body.studio .book-info h3{min-height:0}
@media (max-width:760px){body.studio .library-list .library-filters{grid-template-columns:1fr 1fr}body.studio .library-list .library-filters label:first-of-type{grid-column:1/-1}}
/* Telefono: la barra dei menu resta una riga (i fogli storici la impilavano in colonna) */
body.studio .topbar.studio-menubar{flex-direction:row;align-items:center;flex-wrap:nowrap;position:sticky}
body.studio .section-intro,body.studio .panel>.section-intro:first-child{text-align:left}
body.studio .catalog-count,body.studio .catalog-count *{color:var(--st-text)}
@media (max-width:700px){
  body.studio .topbar.studio-menubar{height:44px;padding:0 8px;gap:6px}
  body.studio .section-intro{flex-direction:row;align-items:center}
  body.studio .studio-toolbar{gap:0}
  body.studio .studio-toolbar .tb-end{margin-left:0}
  body.studio .studio-toolbar .font-controls{order:9}
  body.studio .reader-top{flex-wrap:nowrap}
  body.studio .reader-head h1{font-size:14px}
  body.studio .studio-dock,body.studio.studio-page-reader .studio-dock{top:44px}
  body.studio .studio-scrim{inset:44px 0 0}
}
/* I menu "⋯" devono poter uscire dalla scheda: niente contenimento/3D sulle schede */
body.studio .book-grid .book-card{content-visibility:visible;contain:none;contain-intrinsic-size:none;transform-style:flat}
body.studio .book-card:has(details[open]){z-index:30}
body.studio .topbar.studio-menubar button.studio-logout{color:var(--st-muted)!important}
body.studio .book-card .cover,body.studio .book-card:hover .cover{transform:none!important;transition:none;margin:0}
body.studio .book-more .studio-menu-list{gap:0;padding:4px 0}
body.studio .book-more .studio-menu-list>*{margin:0!important;padding:8px 10px!important;border:0;border-bottom:1px solid var(--st-line-soft);border-radius:0;background:transparent;min-height:0}
body.studio .book-more .book-tools{display:grid;gap:6px}
body.studio .book-more .book-tools .assign-form{display:flex;gap:5px}
body.studio .book-more .book-tools .assign-form select{max-width:none;flex:1;font-size:12.5px}
body.studio .book-more .cover-replace{display:grid;gap:6px;border-top:0}
body.studio .book-more .replace-label{font-size:12px;color:var(--st-muted);flex:none}
body.studio .book-more .replace-label input{font-size:12px!important;padding:3px!important}
body.studio .book-more .cover-replace button{width:100%;font-size:12.5px}
body.studio .book-more .book-publish-status{font-size:12.5px;font-weight:500;line-height:1.6;background:transparent!important}
body.studio .book-more .book-publish-status a{color:var(--st-accent)}
body.studio .book-more .book-delete button{width:100%;justify-content:flex-start;padding:4px 6px}
body.studio .book-more .offline-download{width:100%}
body.studio details.studio-menu.drop-up>.studio-menu-list{top:auto;bottom:calc(100% + 4px)}

/* ---------- Pagina offline ---------- */
body.studio.studio-page-offline .offline-main{grid-area:main;max-width:1320px;width:100%;margin:0;padding:18px clamp(14px,2vw,26px) 28px;box-sizing:border-box}
body.studio .studio-offline-badge{font-size:11.5px;color:var(--st-warn);border:1px solid color-mix(in srgb,var(--st-warn) 55%,transparent);border-radius:3px;padding:1px 7px}
body.studio .offline-alert{background:var(--st-input);border:1px solid var(--st-line-soft);border-left:3px solid var(--st-accent);border-radius:3px;color:var(--st-text);padding:8px 12px;font-size:13px}
body.studio .offline-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;margin:14px 0}
body.studio .offline-card{background:var(--st-panel);border:1px solid var(--st-line);border-radius:4px;box-shadow:var(--st-shadow);padding:10px 12px;color:var(--st-text)}
body.studio .offline-card strong{font:600 14px/1.3 var(--st-font);color:var(--st-text)}
body.studio .offline-card .off-format{color:var(--st-muted);font-size:10.5px}
body.studio .offline-toolbar,body.studio .offline-chapters,body.studio .offline-reading-prefs{display:flex;align-items:center;gap:6px;flex-wrap:wrap;background:var(--st-chrome);border:1px solid var(--st-line);border-radius:4px;padding:4px 6px;margin:0 0 8px}
body.studio .offline-toolbar h2{font-size:14px;margin:0 6px}
body.studio #offline-content{background:var(--st-pasteboard);border:1px solid var(--st-line);border-radius:3px;padding:16px}
body.studio :is(.offline-epub,.offline-epub-rich){background:var(--st-page);color:#222;max-width:820px;margin:0 auto;padding:clamp(18px,4vw,48px);box-shadow:0 3px 14px #00000059}
body.studio :is(.offline-epub,.offline-epub-rich) :is(h1,h2,h3,h4,strong,b,p,li){color:#222}
body.studio .offline-pdf{width:100%;height:75vh;border:0;background:#fff}
body.studio .offline-disclaimer{font-size:12px;color:var(--st-faint)}
body.studio .offline-purge-wrap{margin:10px 0}
body.studio main.container>.auth.panel{max-width:400px;margin:7vh auto 20px}
body.studio main.container>.auth.panel>.eyebrow{margin:-14px -16px 12px;padding:7px 16px;background:var(--st-title);border-bottom:1px solid var(--st-line);border-radius:4px 4px 0 0}
body.studio main.container>.auth.panel h1{font-size:18px}
body.studio .book-card .book-actions{flex-wrap:nowrap}
body.studio .book-card .book-actions>.button{min-width:0;padding:0 6px;overflow:hidden;text-overflow:ellipsis}
body.studio .book-card .book-actions>*{flex-shrink:0}
body.studio .book-card .book-actions>.button{flex:1 1 auto}

/* =====================================================================
   4.3 · STUDIO A COLORI
   Ogni area ha la sua tinta, striscia CMYK sotto la barra dei menu,
   copertine generate colorate, accenti vivaci. Le pagine dei libri restano neutre.
   ===================================================================== */
body.studio{
  --c-blue:#3d8bff;--c-cyan:#16c2e0;--c-magenta:#ec4899;--c-yellow:#f7c531;--c-violet:#9b6bff;--c-orange:#ff8a3d;--c-teal:#19c3a6;--c-green:#3ccf6e;--c-red:#ff5a5f;
  --st-accent:#3d8bff;--st-accent-strong:#2a6fe0;--st-accent-soft:#3d8bff33;
  --st-hue:var(--c-blue);
  --st-desk:#25262b;
  background-image:radial-gradient(1200px 600px at 100% -10%,#9b6bff14,transparent 60%),radial-gradient(900px 500px at -10% 110%,#16c2e012,transparent 60%);
  background-attachment:fixed;
}
body.studio[data-ui-theme="studio-light"]{
  --c-blue:#1f6fe5;--c-cyan:#0a9fbd;--c-magenta:#d42e7b;--c-yellow:#d99a00;--c-violet:#7b48f0;--c-orange:#e8650f;--c-teal:#0c9c84;--c-green:#1fa653;--c-red:#e03b40;
  --st-accent:#1f6fe5;--st-accent-strong:#1758bd;--st-accent-soft:#1f6fe526;--st-desk:#dcdde1;
  background-image:radial-gradient(1200px 600px at 100% -10%,#7b48f012,transparent 60%),radial-gradient(900px 500px at -10% 110%,#0a9fbd10,transparent 60%);
}
/* Tinta per area */
body.studio:is(.studio-page-library,.studio-page-reader,.studio-page-shared,.studio-page-wishlist,.studio-page-share,.studio-page-publish){--st-hue:var(--c-blue)}
body.studio:is(.studio-page-drive){--st-hue:var(--c-cyan)}
body.studio:is(.studio-page-catalog,.studio-page-publication,.studio-page-author){--st-hue:var(--c-magenta)}
body.studio:is(.studio-page-stats,.studio-page-notifications,.studio-page-preferences,.studio-page-security,.studio-page-security_enroll){--st-hue:var(--c-violet)}
body.studio:is(.studio-page-editorial){--st-hue:var(--c-orange)}
body.studio:is(.studio-page-admin,.studio-page-diagnostics,.studio-page-drive_admin){--st-hue:var(--c-teal)}
body.studio:is(.studio-page-login,.studio-page-register,.studio-page-forgot_password,.studio-page-reset_password,.studio-page-verify_2fa){--st-hue:var(--c-magenta)}

/* Barra dei menu con striscia CMYK */
body.studio .topbar.studio-menubar{position:sticky;border-bottom:0}
body.studio .topbar.studio-menubar::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;
  background:linear-gradient(90deg,var(--c-cyan) 0 25%,var(--c-magenta) 25% 50%,var(--c-yellow) 50% 75%,var(--c-blue) 75% 100%)}
body.studio .studio-menubar .folio-brandmark{background:conic-gradient(from 210deg,var(--c-cyan),var(--c-magenta),var(--c-yellow),var(--c-cyan));color:#fff;text-shadow:0 1px 2px #0006}
body.studio .studio-avatar{background:linear-gradient(135deg,var(--c-violet),var(--c-magenta));color:#fff;border-color:transparent}
body.studio .studio-dock,body.studio.studio-page-reader .studio-dock{top:40px}

/* Pannello di navigazione: ogni gruppo con il suo colore */
body.studio .studio-dock-group{--g:var(--c-blue)}
body.studio .studio-dock-group.group-account{--g:var(--c-violet)}
body.studio .studio-dock-group.group-redazione{--g:var(--c-orange)}
body.studio .studio-dock-group.group-amministrazione{--g:var(--c-teal)}
body.studio .studio-dock-title{color:var(--g);border-bottom-color:color-mix(in srgb,var(--g) 35%,transparent)}
body.studio .studio-dock a .studio-ico{color:var(--g);opacity:1}
body.studio .studio-dock a[href="?page=catalog"] .studio-ico{color:var(--c-magenta)}
body.studio .studio-dock a[href="?page=drive"] .studio-ico,body.studio .studio-dock a[href="?page=drive_admin"] .studio-ico{color:var(--c-cyan)}
body.studio .studio-dock a:hover{background:color-mix(in srgb,var(--g) 16%,transparent)}
body.studio .studio-dock a.active{background:linear-gradient(90deg,var(--g),color-mix(in srgb,var(--g) 70%,#000 0%));color:#fff;box-shadow:0 2px 10px color-mix(in srgb,var(--g) 40%,transparent)}
body.studio .studio-dock a.active .studio-ico{color:#fff}
body.studio .studio-dock a[href="?page=catalog"].active{background:var(--c-magenta)}

/* Testate di pagina: banda e velatura nel colore dell'area */
body.studio :is(.library-hero,.premium-title,.drive-hero,.publishing-hero,.folio-hero,.author-hero,.editorial-intro,.connect-intro){
  position:relative;overflow:hidden;border-left:4px solid var(--st-hue);
  background:linear-gradient(100deg,color-mix(in srgb,var(--st-hue) 20%,var(--st-panel)) 0%,var(--st-panel) 55%)!important}
body.studio :is(.library-hero,.premium-title,.drive-hero,.publishing-hero,.folio-hero,.author-hero,.editorial-intro,.connect-intro) :is(.eyebrow,.folio-overline){color:var(--st-hue)}
body.studio .library-stats span{border-color:color-mix(in srgb,var(--st-hue) 40%,var(--st-line-soft))}
body.studio .library-stats strong{color:var(--st-hue)}

/* Barre del titolo dei pannelli: punto colorato */
body.studio .panel>h2:first-child,body.studio .panel>.section-intro:first-child,body.studio .folio-section-head,
body.studio :is(.shelves-area,.library-list,.resume-section)>.section-intro{box-shadow:inset 3px 0 0 var(--st-hue)}
body.studio .eyebrow{color:var(--st-hue)}

/* Pulsanti principali più vivaci */
body.studio :is(button,.button):not(.secondary):not(.link):not(.text-button):not(.danger-link):not(.icon-btn):not(.studio-nav-toggle):not(.studio-logout):not(.quick-view):not(.modal-close){
  background:linear-gradient(180deg,color-mix(in srgb,var(--st-accent) 88%,#fff 12%),var(--st-accent));border-color:var(--st-accent-strong)}
body.studio :is(button,.button):not(.secondary):not(.link):not(.text-button):not(.danger-link):not(.studio-nav-toggle):not(.studio-logout):not(.quick-view):not(.modal-close):hover{background:var(--st-accent-strong)}
body.studio .book-actions>.button{background:linear-gradient(180deg,color-mix(in srgb,var(--st-accent) 85%,#fff 15%),var(--st-accent))}
body.studio .book-actions form>button{color:var(--c-yellow)}

/* Copertine generate: colori stabili ricavati dal titolo */
body.studio .hue-0{--h1:#3d8bff;--h2:#5b3df5}
body.studio .hue-1{--h1:#ec4899;--h2:#f43f5e}
body.studio .hue-2{--h1:#ff8a3d;--h2:#f7c531}
body.studio .hue-3{--h1:#19c3a6;--h2:#3ccf6e}
body.studio .hue-4{--h1:#9b6bff;--h2:#d946ef}
body.studio .hue-5{--h1:#16c2e0;--h2:#3d8bff}
body.studio .hue-6{--h1:#ff5a5f;--h2:#ff8a3d}
body.studio .hue-7{--h1:#0ea5a4;--h2:#2563eb}
body.studio .book-card .cover:not(.has-cover){box-shadow:inset 0 0 0 12px var(--st-pasteboard);
  background:radial-gradient(120% 80% at 85% 10%,#ffffff40,transparent 50%),linear-gradient(150deg,var(--h1),var(--h2))!important;
  justify-content:flex-end;align-items:flex-start;text-align:left;padding:26px 24px}
body.studio .book-card .cover:not(.has-cover) strong{color:#fff!important;font:700 17px/1.2 Georgia,"Times New Roman",serif;text-shadow:0 1px 6px #0004;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
body.studio .book-card .cover:not(.has-cover) .cover-decoration{color:#ffffffd0!important;font-size:22px;position:absolute;top:44px;left:24px}
body.studio .book-card .cover:not(.has-cover)::after{content:""!important;display:block!important;position:absolute;left:24px;right:24px;bottom:22px;height:2px;background:#ffffff8c}
body.studio .book-card:hover{border-color:var(--h1,var(--st-accent));box-shadow:0 6px 22px color-mix(in srgb,var(--h1,#000) 30%,transparent)}
body.studio .book-card .cover .format-label{left:20px;top:20px}
body.studio .book-card:has(.cover.hue-0),body.studio .book-card:has(.cover.hue-1),body.studio .book-card:has(.cover.hue-2),body.studio .book-card:has(.cover.hue-3),
body.studio .book-card:has(.cover.hue-4),body.studio .book-card:has(.cover.hue-5),body.studio .book-card:has(.cover.hue-6),body.studio .book-card:has(.cover.hue-7){border-top:3px solid var(--h1)}
body.studio .book-card:has(.hue-0){--h1:#3d8bff}body.studio .book-card:has(.hue-1){--h1:#ec4899}body.studio .book-card:has(.hue-2){--h1:#ff8a3d}body.studio .book-card:has(.hue-3){--h1:#19c3a6}
body.studio .book-card:has(.hue-4){--h1:#9b6bff}body.studio .book-card:has(.hue-5){--h1:#16c2e0}body.studio .book-card:has(.hue-6){--h1:#ff5a5f}body.studio .book-card:has(.hue-7){--h1:#0ea5a4}
body.studio .book-progress>div,body.studio .resume-meter i{background:linear-gradient(90deg,var(--c-cyan),var(--c-blue))}
body.studio :is(.publication-cover,.detail-cover,.wishlist-art):not(:has(img)) .publication-cover-fallback,
body.studio :is(.wishlist-art):not(:has(img)){background:linear-gradient(150deg,var(--h1,#3d8bff),var(--h2,#5b3df5))!important}
body.studio :is(.publication-cover,.detail-cover):not(:has(img)) .publication-cover-fallback,body.studio :is(.publication-cover,.detail-cover):not(:has(img)) .publication-cover-fallback *{color:#fff!important}
body.studio .resume-card{border-left:3px solid var(--h1,var(--st-accent))}

/* Etichette formato */
body.studio .format-label{border-radius:2px}
body.studio .book-card .cover.hue-0 .format-label,body.studio .book-card .cover .format-label{background:#000000a6}
body.studio .resume-format{color:var(--h1,var(--st-muted));font-weight:700}

/* Scaffali e filtri: pallini colorati */
body.studio .shelf-strip .shelf-chip:nth-child(5n+1)::before,body.studio .shelf-strip .shelf-chip:nth-child(5n+2)::before,body.studio .shelf-strip .shelf-chip:nth-child(5n+3)::before,
body.studio .shelf-strip .shelf-chip:nth-child(5n+4)::before,body.studio .shelf-strip .shelf-chip:nth-child(5n)::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--dot);margin-right:3px}
body.studio .shelf-strip .shelf-chip:nth-child(5n+1){--dot:var(--c-blue)}body.studio .shelf-strip .shelf-chip:nth-child(5n+2){--dot:var(--c-yellow)}
body.studio .shelf-strip .shelf-chip:nth-child(5n+3){--dot:var(--c-cyan)}body.studio .shelf-strip .shelf-chip:nth-child(5n+4){--dot:var(--c-green)}body.studio .shelf-strip .shelf-chip:nth-child(5n){--dot:var(--c-magenta)}
body.studio .shelf-strip .shelf-chip.selected::before{background:#fff}

/* Command e statistiche: indicatori colorati */
body.studio .folio-kpi{border-top:3px solid var(--k,var(--c-blue))}
body.studio .folio-kpi-grid>.folio-kpi:nth-child(1){--k:var(--c-blue)}body.studio .folio-kpi-grid>.folio-kpi:nth-child(2){--k:var(--c-cyan)}
body.studio .folio-kpi-grid>.folio-kpi:nth-child(3){--k:var(--c-orange)}body.studio .folio-kpi-grid>.folio-kpi:nth-child(4){--k:var(--c-magenta)}
body.studio .folio-console .folio-kpi strong{color:var(--k)}
body.studio .folio-kpi-icon{color:var(--k)!important;opacity:.8}
body.studio :is(.editorial-stats,.connect-stats,.metric-grid)>*{border-top:3px solid var(--k,var(--c-blue))}
body.studio :is(.editorial-stats,.connect-stats,.metric-grid)>:nth-child(4n+1){--k:var(--c-blue)}body.studio :is(.editorial-stats,.connect-stats,.metric-grid)>:nth-child(4n+2){--k:var(--c-green)}
body.studio :is(.editorial-stats,.connect-stats,.metric-grid)>:nth-child(4n+3){--k:var(--c-orange)}body.studio :is(.editorial-stats,.connect-stats,.metric-grid)>:nth-child(4n){--k:var(--c-magenta)}
body.studio :is(.editorial-stats,.metric-grid) strong{color:var(--k)}
body.studio .activity-day span{background:linear-gradient(180deg,var(--c-magenta),var(--c-violet))}
body.studio .folio-tabs a:is(.active,[aria-current]){box-shadow:inset 0 2px 0 var(--st-hue)}
body.studio .folio-item-graphic{color:var(--c-cyan)}

/* Lettore: strumenti attivi e barra di stato colorati */
body.studio .studio-toolbar [aria-pressed="true"]{background:var(--c-magenta)!important}
body.studio .studio-toolbar #prev,body.studio .studio-toolbar #next{color:var(--c-cyan)}
body.studio .studio-toolbar #add-bookmark{color:var(--c-yellow)}
body.studio .studio-toolbar #toggle-notes{color:var(--c-green)}
body.studio .studio-toolbar #toggle-highlights{color:var(--c-magenta)}
body.studio .studio-toolbar #toggle-search{color:var(--c-cyan)}
body.studio .studio-toolbar :is(#add-bookmark,#toggle-notes,#toggle-highlights,#toggle-search) .tb-label{color:var(--st-text)}
body.studio .reading-footer input[type=range]{accent-color:var(--c-magenta)}
body.studio .reading-footer #counter{color:var(--c-cyan)}
body.studio[data-ui-theme="studio-light"] .reading-footer #counter{color:var(--c-blue)}

/* Preferenze: anteprime dei temi con la striscia CMYK */
body.studio .theme-sample{background:linear-gradient(90deg,#16c2e0 0 25%,#ec4899 25% 50%,#f7c531 50% 75%,#3d8bff 75%) 0 12px/100% 2px no-repeat,
  linear-gradient(var(--sc),var(--sc)) 0 0/100% 12px no-repeat,linear-gradient(var(--sc),var(--sc)) 0 0/28% 100% no-repeat,
  linear-gradient(150deg,#ec4899,#9b6bff) 64% 70%/20% 62% no-repeat,var(--sd)!important}

/* 4.3.1 · Frecce a schermo per girare pagina */
body.studio .reader-stage{position:relative}
body.studio .reader-page-arrow{position:absolute;top:50%;z-index:6;width:46px;height:46px;min-height:0;margin-top:-23px;padding:0;border-radius:50%;
  display:grid;place-items:center;background:#16181ccc!important;color:#fff;border:1px solid #ffffff2e!important;box-shadow:0 4px 16px #0006;
  opacity:.72;transition:opacity .15s,transform .15s,background .15s;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);cursor:pointer}
body.studio .reader-page-arrow.prev{left:calc(var(--ruler,16px) + 12px)}
body.studio .reader-page-arrow.next{right:12px}
body.studio .reader-page-arrow:hover{opacity:1;background:var(--st-hue,var(--st-accent))!important;transform:scale(1.06)}
body.studio .reader-page-arrow:focus-visible{opacity:1;outline:2px solid #fff;outline-offset:2px}
body.studio .reader-page-arrow:disabled{opacity:.18;cursor:default;transform:none;background:#16181ccc!important}
body.studio .reader-stage.arrows-hidden .reader-page-arrow{display:none}
body.studio.reader-immersive .reader-page-arrow{position:fixed;z-index:1003}
body.studio.reader-immersive .reader-page-arrow.prev{left:16px}
body.studio.reader-immersive.reader-controls-idle .reader-page-arrow{opacity:0;pointer-events:none}
@media (max-width:640px){body.studio .reader-page-arrow{width:38px;height:38px;margin-top:-19px;opacity:.6}body.studio .reader-page-arrow.prev{left:6px}body.studio .reader-page-arrow.next{right:6px}}
/* Barra di stato: ‹ › sempre visibili anche su computer */
body.studio .reading-footer .mobile-page-btn{display:inline-flex!important;align-items:center;justify-content:center;width:26px;height:24px;min-height:0;padding:0!important;font-size:16px}
body.studio .reading-footer .mobile-page-btn:hover{background:var(--st-raised)}
