/* OnlyPDF Studio — shell de l’éditeur */
:root{--ink:#172033;--muted:#778197;--line:#e8ebf0;--surface:#fff;--canvas:#f5f6f8;--teal:#3b968f;--navy:#0b1220}
*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden;background:var(--canvas);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink)}button,input,select{font:inherit}button{cursor:pointer}.studio{display:grid;grid-template-rows:72px minmax(0,1fr);width:100vw;height:100vh;overflow:hidden;background:var(--canvas)}
/* Barre supérieure */
.topbar{display:flex;align-items:center;height:72px;padding:0 28px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.97);gap:15px;z-index:20}.topbar__back{display:grid;place-items:center;width:26px;height:28px;color:#617085;text-decoration:none}.topbar__back:hover{color:var(--ink)}.topbar__brand{font-size:18px;font-weight:800;letter-spacing:-.6px}.topbar__sep{display:block;width:1px;height:28px;background:#edf0f3}.topbar__title{width:230px;height:38px;padding:0 16px;border:1px solid #e5e9ee;border-radius:10px;background:#fafbfc;color:#263246;font-size:14px;font-weight:600;outline:none}.topbar__title:focus{border-color:#8ecbc6;box-shadow:0 0 0 3px rgba(59,150,143,.12)}.topbar__right{display:flex;align-items:center;gap:9px;margin-left:auto}.topbar__btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:38px;padding:0 13px;border:1px solid transparent;border-radius:10px;background:transparent;color:#6d7788;font-size:14px;font-weight:650}.topbar__btn:hover{background:#f5f7f9;color:#273348}.topbar__btn--import{border-color:#b9ded9;background:#f7fcfb;color:#3b968f}.topbar__btn--import:hover{background:#edf9f7}.topbar__btn--export{padding:0 17px;background:#13261f;color:#fff;box-shadow:0 4px 12px rgba(13,31,24,.12)}.topbar__btn--export:hover{background:#203a31;color:#fff}
/* Grille de travail */
.workspace{display:grid;grid-template-columns:242px minmax(0,1fr) 282px;min-height:0;overflow:hidden}.sidebar,.panel{background:var(--surface);min-width:0;z-index:10}.sidebar{display:flex;flex-direction:column;border-right:1px solid var(--line)}.sidebar__tabs{display:grid;grid-template-columns:1fr 1fr;min-height:49px;padding:5px;border-bottom:1px solid var(--line);background:#fbfcfd}.sidebar__tab{border:0;border-radius:7px;background:transparent;color:#697487;font-size:14px;font-weight:650}.sidebar__tab:hover{color:#354052}.sidebar__tab.active{background:#fff;color:#3b968f;box-shadow:0 1px 4px rgba(20,36,50,.06)}.sidebar__content{min-height:0;flex:1;overflow:auto}.panel{display:flex;flex-direction:column;border-left:1px solid var(--line)}.panel__header,.onlypdf-properties-title{height:60px;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid var(--line);font-size:14px;font-weight:800;text-transform:uppercase;letter-spacing:.4px}.panel__body,#panelBody{min-height:0;flex:1;overflow:auto}.panel__empty{display:grid;place-items:center;gap:14px;height:100%;padding:30px;color:#9aa3b1;text-align:center}.panel__empty svg{color:#58afa9}.panel__empty p{max-width:175px;margin:0;font-size:14px;line-height:1.5}
/* Canvas, espace libre pour les documents PDF */
.canvas,#canvasWrap{position:relative;min-width:0;min-height:0;overflow:auto;background:#f4f5f7;overscroll-behavior:contain}.canvas{display:flex;align-items:flex-start;justify-content:flex-start;padding:44px}.canvas>#workspaceContainer,#workspaceContainer{position:relative;min-width:max-content;min-height:max-content}.canvas__page,.page{background:#fff;box-shadow:0 12px 30px rgba(25,35,52,.12);overflow:hidden}.page.active{outline:2px solid #48a9a1;outline-offset:4px}
/* Barres existantes remplacées par la barre générée par studio-main */
.toolbar{display:none!important}.studio-floating-toolbar{position:fixed;z-index:2400;display:flex;align-items:center;gap:4px;min-height:58px;padding:7px 12px;border:1px solid #e5e8ec;border-radius:18px;background:rgba(255,255,255,.96);box-shadow:0 12px 32px rgba(20,32,50,.16);backdrop-filter:blur(12px)}.studio-toolbar-button{display:grid;place-items:center;width:38px;height:38px;padding:0;border:0;border-radius:10px;background:transparent;color:#4b5668}.studio-toolbar-button:hover,.studio-toolbar-button.is-active,.studio-toolbar-button.is-open{background:#f0f5f5;color:#267c76}.studio-toolbar-divider{width:1px;height:28px;margin:0 4px;background:#e8eaee}.studio-toolbar-zoom{min-width:50px;text-align:center;color:#3d4758;font-size:13px;font-weight:750}
/* Panneaux utilitaires générés */
.studio-shapes-panel,.studio-assets-panel{position:fixed;z-index:2300;display:none;overflow:auto;border:1px solid #e4e8ed;border-radius:15px;background:#fff;box-shadow:0 18px 52px rgba(20,32,50,.18)}.studio-shapes-panel.open,.studio-assets-panel.open{display:block}.studio-shapes-panel-header,.studio-assets-panel-header{display:flex;align-items:flex-start;justify-content:space-between;padding:15px 16px;border-bottom:1px solid #edf0f3}.studio-shapes-panel-header strong,.studio-assets-panel-header strong{display:block;font-size:14px}.studio-shapes-panel-header span,.studio-assets-panel-header span{display:block;margin-top:3px;color:#8390a1;font-size:11px}.studio-shapes-close,.studio-assets-close{border:0;background:transparent;color:#6d7788;font-size:20px}.studio-shapes-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:12px}.studio-shape-option{display:grid;place-items:center;gap:5px;min-height:66px;border:1px solid #e6eaee;border-radius:9px;background:#fff;color:#485568;font-size:10px}.studio-shape-option:hover{border-color:#78bdb7;background:#f3fbfa;color:#267c76}.studio-shapes-hint{padding:0 14px 14px;color:#8490a1;font-size:11px}.studio-assets-search-wrap{padding:10px}.studio-assets-search{width:100%;height:36px;padding:0 11px;border:1px solid #e0e5eb;border-radius:8px;outline:0}.studio-assets-grid{display:grid;gap:8px;padding:0 10px 12px}.studio-asset-option{display:grid;place-items:center;gap:5px;min-height:62px;border:1px solid #e8ebef;border-radius:8px;background:#fff;color:#506075;font-size:9px}.studio-asset-option:hover{border-color:#7dbdb7;background:#f3fbfa}


/* Only PDF — disposition Motion Studio aérée */
/* =========================================================
   MOTION STUDIO — DISPOSITION AÉRÉE
   Le thème existant est conservé ; seuls les espacements,
   les regroupements et la hiérarchie visuelle sont améliorés.
   ========================================================= */

.studio-animations-panel {
    padding: 24px 28px 20px !important;
    border-radius: 22px 22px 0 0 !important;
    overflow: hidden !important;
}

.studio-motion-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.studio-motion-header,
.studio-motion-settings,
.studio-motion-timeline-wrap {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(20, 55, 50, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(20, 55, 50, 0.035);
}

.studio-motion-header {
    flex: 0 0 auto;
    padding: 20px 22px;
}

.studio-motion-header-main,
.studio-motion-page-row,
.studio-motion-settings-heading,
.studio-motion-timeline-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.studio-motion-header-main {
    margin-bottom: 19px;
}

.studio-motion-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.studio-motion-title b {
    font-size: 18px;
    line-height: 1.2;
}

.studio-motion-title small,
.studio-motion-settings-heading small {
    color: #87939a;
    font-size: 12px;
    line-height: 1.4;
}

.studio-motion-eyebrow,
.studio-motion-section-label {
    color: #718087;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.studio-motion-header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.studio-motion-page-row {
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(20, 55, 50, 0.08);
}

.studio-motion-pagebar {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding: 2px 0 4px;
}

.studio-motion-page-tab {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(20, 55, 50, 0.10);
    border-radius: 10px;
    background: rgba(255, 255, 255, .75);
    color: #526069;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.studio-motion-page-tab:hover,
.studio-motion-page-tab.is-active {
    border-color: rgba(15, 118, 110, .35);
    background: rgba(222, 244, 240, .85);
    color: #0f766e;
}

.studio-motion-transition {
    flex: 0 0 auto;
}

.studio-motion-transition-control {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #718087;
    font-size: 11px;
    white-space: nowrap;
}

.studio-motion-transition-control select,
.studio-motion-quick-controls select,
.studio-motion-quick-controls input {
    min-height: 36px;
    border: 1px solid rgba(20, 55, 50, .13);
    border-radius: 9px;
    background: #fff;
    color: #27343a;
    padding: 0 10px;
    font: inherit;
}

.studio-motion-settings {
    flex: 0 0 auto;
    padding: 19px 22px 22px;
}

.studio-motion-settings-heading {
    align-items: flex-start;
    margin-bottom: 17px;
}

.studio-motion-settings-heading > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.studio-motion-quick-controls {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(100px, .7fr)) minmax(145px, 1fr) minmax(105px, .7fr) minmax(85px, .5fr);
    align-items: end;
    gap: 13px;
}

.studio-motion-quick-controls > label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #718087;
    font-size: 11px;
    font-weight: 700;
}

.studio-motion-selected-layer {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 9px;
    background: rgba(232, 239, 242, .68);
    color: #32444b;
    font-size: 12px;
    font-weight: 800;
}

.studio-motion-pro-actions {
    display: flex;
    align-items: center;
    grid-column: 1 / -1;
    gap: 8px;
    padding-top: 4px;
}

.studio-motion-pro-actions button,
.studio-motion-preview-selected {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(20, 55, 50, .11);
    border-radius: 9px;
    background: #fff;
    color: #53636a;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.studio-motion-pro-actions button:first-child,
.studio-motion-preview-selected {
    border-color: rgba(15, 118, 110, .18);
    background: rgba(222, 244, 240, .8);
    color: #0f766e;
}

.studio-motion-timeline-wrap {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 210px;
    padding: 19px 22px 15px;
    overflow: hidden;
}

.studio-motion-timeline-heading {
    flex: 0 0 auto;
    margin-bottom: 16px;
}

.studio-motion-timeline-duration {
    color: #87939a;
    font-size: 12px;
    font-weight: 700;
}

.studio-motion-ruler {
    flex: 0 0 auto;
}

.studio-motion-timeline-scroll {
    flex: 1 1 auto;
    min-height: 110px;
    margin-top: 12px;
    overflow: auto;
}

.studio-motion-timeline {
    min-width: 720px;
    padding-bottom: 8px;
}

.studio-motion-track {
    min-height: 54px;
    border-bottom: 1px solid rgba(20, 55, 50, .06);
}

.studio-motion-track-label {
    min-height: 54px;
    padding: 0 12px;
    border-radius: 9px;
}

.studio-motion-track.is-selected .studio-motion-track-label {
    background: rgba(222, 244, 240, .72);
}

.studio-motion-lane {
    min-height: 54px;
    padding: 8px 0;
}

.studio-motion-status {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid rgba(20, 55, 50, .08);
    color: #87939a;
    font-size: 11px;
}

.studio-motion-status > span:first-child {
    color: #273f42;
    font-size: 13px;
    font-weight: 800;
}

.studio-motion-quick-controls--empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(232, 239, 242, .58);
    color: #66757c;
    font-size: 12px;
}

.studio-motion-quick-controls--empty small {
    color: #97a1a6;
    font-size: 11px;
}

@media (max-width: 1180px) {
    .studio-motion-quick-controls {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }

    .studio-motion-selected-layer {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .studio-animations-panel {
        padding: 16px 14px 14px !important;
    }

    .studio-motion-shell {
        gap: 13px;
    }

    .studio-motion-header-main,
    .studio-motion-page-row,
    .studio-motion-status {
        align-items: stretch;
        flex-direction: column;
    }

    .studio-motion-header-tools {
        justify-content: flex-end;
    }

    .studio-motion-transition-control {
        align-items: flex-start;
        flex-direction: column;
    }

    .studio-motion-quick-controls {
        grid-template-columns: 1fr 1fr;
    }

    .studio-motion-selected-layer,
    .studio-motion-pro-actions {
        grid-column: 1 / -1;
    }

    .studio-motion-pro-actions {
        flex-wrap: wrap;
    }
}

/* Contrôle de format PDF — capsule premium */
.topbar__orientation{display:inline-flex;align-items:center;gap:8px;height:38px;padding:0 6px 0 10px;border:1px solid #e4e9ec;border-radius:12px;background:linear-gradient(180deg,#fff 0%,#fafcfc 100%);color:#7b8790;font-size:11px;font-weight:700;white-space:nowrap;box-shadow:0 1px 2px rgba(20,40,48,.03);}
.topbar__orientation-icon{display:grid;place-items:center;width:18px;height:18px;color:#5c9f99;}
.topbar__orientation-icon svg{width:16px;height:16px;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round;}
.topbar__orientation-label{letter-spacing:.01em;}
.topbar__orientation-options{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid #edf1f2;border-radius:9px;background:#f5f8f8;}
.topbar__orientation-option{height:28px;padding:0 9px;border:0;border-radius:7px;background:transparent;color:#7d8991;font-size:11px;font-weight:700;cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease;}
.topbar__orientation-option:hover{color:#2d6f6a;background:#edf7f5;}
.topbar__orientation-option.is-active{background:#fff;color:#24393d;box-shadow:0 1px 4px rgba(19,46,49,.12);}
.topbar__orientation-native{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;padding:0;}
@media (max-width:700px){.topbar__orientation{gap:4px;padding:0 4px 0 7px}.topbar__orientation-label{display:none}.topbar__orientation-option{padding:0 7px}.topbar__right{gap:5px}.topbar__btn{padding-left:8px;padding-right:8px}.topbar__btn--export{padding-left:10px;padding-right:10px}}

/* Modales Importer / Exporter : centrage fixe dans le viewport */
.modal-overlay{position:fixed!important;inset:0!important;z-index:3000!important;display:none;align-items:center;justify-content:center;padding:24px;background:rgba(18,35,36,.28);backdrop-filter:blur(3px);}
.modal-overlay.open{display:flex!important;}
.modal-overlay .modal{position:relative;width:min(430px,calc(100vw - 40px));max-height:calc(100vh - 48px);overflow:auto;padding:26px;border:1px solid #e6eeee;border-radius:16px;background:#fff;color:#203436;box-shadow:0 24px 70px rgba(20,48,47,.22);}
.modal-overlay .modal h3{margin:0 0 8px;color:#173434;font-size:18px;line-height:1.2;}
.modal-overlay .modal p{margin:0 0 18px;color:#7a898a;font-size:13px;line-height:1.5;}
.modal-overlay .export-formats,.modal-overlay .import-modal-actions{display:flex;gap:8px;flex-wrap:wrap;}
.modal-overlay .export-fmt,.modal-overlay .btn-ok,.modal-overlay .btn-cancel{min-height:36px;padding:0 13px;border:1px solid #d7e7e4;border-radius:9px;background:#fff;color:#3b6f6b;font-size:12px;font-weight:700;cursor:pointer;}
.modal-overlay .export-fmt.active,.modal-overlay .btn-ok{border-color:#3c948b;background:#eaf7f4;color:#236e67;}
.modal-overlay .btn-cancel{color:#6d7d7e;}
.modal-overlay .modal__btns{display:flex;justify-content:flex-end;gap:8px;margin-top:22px;}
.import-modal-close{position:absolute;top:12px;right:12px;width:30px;height:30px;border:0;border-radius:8px;background:transparent;color:#718182;font-size:21px;line-height:1;cursor:pointer;}
.import-modal-close:hover{background:#f1f7f6;color:#277d75;}
.import-modal-note{margin-top:18px!important;padding:10px 12px;border-radius:9px;background:#f6faf9;color:#7c8c8c!important;font-size:11px!important;}
.page-resize-handle{position:absolute;z-index:80;display:none;width:10px;height:10px;border:1.5px solid #3b958d;border-radius:3px;background:#fff;box-shadow:0 1px 4px rgba(28,91,86,.16);}
.page-locked .page-resize-handle{display:block;}
.page-resize-handle--nw{left:-6px;top:-6px;cursor:nwse-resize}.page-resize-handle--n{left:50%;top:-6px;transform:translateX(-50%);cursor:ns-resize}.page-resize-handle--ne{right:-6px;top:-6px;cursor:nesw-resize}.page-resize-handle--e{right:-6px;top:50%;transform:translateY(-50%);cursor:ew-resize}.page-resize-handle--se{right:-6px;bottom:-6px;cursor:nwse-resize}.page-resize-handle--s{left:50%;bottom:-6px;transform:translateX(-50%);cursor:ns-resize}.page-resize-handle--sw{left:-6px;bottom:-6px;cursor:nesw-resize}.page-resize-handle--w{left:-6px;top:50%;transform:translateY(-50%);cursor:ew-resize}
.page-is-resizing{outline:2px solid #3b958d!important;outline-offset:4px;}


/* ==================== ERGONOMIE PREMIUM — AJUSTEMENT DISCRET ==================== */
:root {
    --ink: #172033;
    --muted: #6c7889;
    --line: #dfe6e4;
    --canvas: #f1f4f3;
}

.topbar { box-shadow: 0 1px 10px rgba(20, 32, 50, .045); }
.topbar__btn:focus-visible, .topbar__title:focus-visible, .sidebar__tab:focus-visible, .studio-toolbar-button:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid rgba(59, 150, 143, .26);
    outline-offset: 3px;
}
.sidebar, .panel { border-color: var(--line); }
.studio-toolbar-button:hover, .studio-toolbar-button.is-active, .studio-toolbar-button.is-open { box-shadow: 0 2px 8px rgba(38, 124, 118, .10); }
