/* Studio components. Shared sizing and colors come from usability.css/theme tokens. */
body.ops-app,body.client-app{line-height:1.5}
html:has(body.studio-dialog-open){overflow:hidden!important}
body.studio-dialog-open{overflow:hidden!important;height:100dvh!important;min-height:0!important}
.btn,.btn-ghost,.btn-sm,.pp-add,.up-btn{min-height:36px;align-items:center;justify-content:center;font-size:var(--ui-control);line-height:1.4}
.field input,.field select,.field textarea{font-size:var(--ui-control);line-height:1.5;padding:9px 11px;border:1px solid var(--border);border-radius:8px}
.field{margin-bottom:16px}.field label{font-size:13px;margin-bottom:6px;line-height:1.4}
.dash-card,.home-widget,.column,.deliv-card,.validate-box{box-shadow:none;border:1px solid var(--border);border-radius:10px}
.dash-card h4,.home-section-title,.hw-title,.portal-section-title{font-size:13px;letter-spacing:0;text-transform:none}
.dash-hint,.deliv-sub,.deliv-sub2,.vb-sub,.vb-next,.hf-sub,.hw-empty,.home-empty,.studio-recent,.studio-eyebrow{font-size:12px;line-height:1.6;color:var(--text2)}
.deliv-hidden-tag,.deliv-hrow,.card-video-count,.card-date,.card-shooting-info,.card-client-link,.np-type-sub{font-size:12px!important}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--accent)!important;outline-offset:3px}
button:disabled{cursor:not-allowed}.btn-primary{font-weight:650}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;scroll-behavior:auto!important;transition:none!important}}

/* Primary navigation: secondary destinations live in a labelled disclosure. */
.topbar{gap:12px;box-shadow:none}
.topbar .workspace-nav{flex:1;min-width:0;justify-content:flex-start;overflow:visible;padding:0;gap:2px}
.topbar .ws-btn{flex:0 0 auto;padding:8px 10px;font-size:14px;gap:5px}
.studio-resources{position:relative;flex:0 0 auto;font-size:14px}
.studio-resources>summary{cursor:pointer;padding:8px 10px;border-radius:7px;white-space:nowrap;color:var(--text2)}
.studio-resources.active>summary,.studio-resources[open]>summary{color:var(--text);background:var(--bg3)}
.studio-resources>div{position:absolute;right:0;top:calc(100% + 8px);min-width:190px;padding:8px;background:var(--bg2);border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 24px #0002;z-index:80}
.studio-resources .ws-btn{display:flex!important;width:100%;text-align:left;justify-content:flex-start}
.studio-resources .nav-denied,.studio-resources[hidden]{display:none!important}
#topbar:has(#settingsMenu:not(.hidden)){z-index:450!important}
#settingsMenu:not(.hidden){animation:none!important;overscroll-behavior:contain}
.topbar .header-user{min-width:0;flex-shrink:0}.topbar .header-user>span{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
@media(min-width:701px) and (max-width:1120px){.topbar .header-user>span{display:none}.topbar .ws-btn{padding-inline:7px;gap:4px;font-size:13px}.topbar{gap:8px;padding-inline:12px}.undo-nav{gap:0}}

/* The project remains a popup. Only its content viewport scrolls. */
#cardModal .modal{padding:20px;width:min(1400px,94vw);max-width:1400px;height:92dvh;max-height:92dvh;overflow:hidden;gap:0}
#cardModal .card-head{margin:0 0 12px;padding:0;flex-wrap:nowrap;flex-shrink:0;gap:12px}
#cardModal .card-head h2{font-size:18px;line-height:1.4;white-space:normal;overflow:visible;text-overflow:clip;-webkit-line-clamp:unset;display:block}
#cardModal .status-banner{padding:8px 12px;margin:0 0 10px;font-size:13px}
#cardWorkspace{display:grid;grid-template-columns:200px minmax(0,1fr);flex:1;min-height:0;overflow:hidden;border-top:1px solid var(--border)}
#cardSectionNav.card-section-nav{display:block;min-width:0;overflow-y:auto;overflow-x:hidden;padding:16px 12px 16px 0;border:0;border-right:1px solid var(--border);background:transparent}
.studio-section-picker{display:none}.studio-section-group{margin:0 0 16px}.studio-section-group:last-child{margin-bottom:0}
.studio-section-group h3{font-size:12px;color:var(--text2);font-weight:600;margin:0 8px 5px}
#cardSectionNav .card-section-button{display:flex;align-items:center;justify-content:flex-start;width:100%;min-height:36px;border:1px solid transparent;padding:8px;font-size:13px;white-space:normal;text-align:left;margin:2px 0;gap:8px;color:var(--text)}
#cardSectionNav .card-section-button.active{border-color:var(--border);background:var(--bg3);box-shadow:inset 3px 0 var(--accent);font-weight:650}
#cardPanelViewport{min-width:0;min-height:0;overflow:auto;padding:20px 8px 20px 20px;overscroll-behavior:contain}
#cardModal #cardPanelViewport>.ctab-panel{overflow:visible;flex:none;min-height:0}
#ctab-settings{max-width:900px}#ctab-settings>h3{font-size:18px;margin-bottom:16px}
#ctab-settings>.dash-card{margin-bottom:16px}
#cardModal .card-foot{padding:0;margin:8px 0 0;min-height:0;justify-content:flex-start}
#cardModal .card-foot:not(:has(.show,.date-save-prompt:not(.hidden),.btn-warn)){display:none}
.studio-progress-legacy{display:none}
.studio-next{display:flex;gap:20px;align-items:center;justify-content:space-between;background:var(--bg3);border-radius:10px;padding:20px;margin-bottom:16px}
.studio-next h3{font-size:20px;line-height:1.3;margin:4px 0 8px}.studio-next p{font-size:14px;max-width:650px;margin:0;color:var(--text2)}
.studio-next>.btn{flex-shrink:0}.studio-eyebrow{font-weight:650}
.studio-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:16px;margin:0 0 20px}
.studio-summary-grid>div{border-bottom:1px solid var(--border);padding:0 0 12px}.studio-summary-grid dt{font-size:12px;color:var(--text2);margin-bottom:4px}.studio-summary-grid dd{font-size:14px;font-weight:600;margin:0}
.studio-overdue{color:var(--ui-danger)}.studio-recent{margin-bottom:20px}.studio-recent summary{cursor:pointer;padding:6px 0}.studio-recent p{padding:5px 0}
.proj-dash{gap:16px}.dash-card{padding:16px;margin-bottom:16px}.dash-card h4{margin-bottom:12px}
.card{background:var(--bg2);padding:16px}.card-title.card-project-primary{font-size:15px;line-height:1.4}.card-client-link{margin-top:4px}.card-footer{gap:8px;margin-top:8px}.card-videos:empty{display:none}
.card-action{font-size:13px;min-height:36px;margin-top:12px}.card-date{white-space:normal}.dual-validate{display:flex;gap:8px}.dual-validate .card-action{flex:1}.card-emoji{display:none}

/* Work comes before metrics on the home screen. */
.home-grid{grid-template-columns:minmax(0,1fr) 300px;gap:24px}.home-wrap{max-width:1400px}
.studio-home-priorities{margin-bottom:28px}.studio-home-priorities h2{font-size:19px;margin:0 0 16px}
.studio-priority-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
.studio-priority-grid>section{border:1px solid var(--border);padding:16px;background:var(--bg2);border-radius:10px}
.studio-priority-grid h3{font-size:14px;margin:0 0 12px}.studio-priority-grid h3 span{font-weight:400;color:var(--text2);margin-left:6px}.studio-priority-grid p{font-size:13px;color:var(--text2)}
.studio-work-row{display:flex;flex-direction:column;gap:5px;align-items:flex-start;width:100%;text-align:left;border:0;border-bottom:1px solid var(--border);padding:10px 0;background:transparent;color:var(--text);cursor:pointer}.studio-work-row:last-child{border-bottom:0}.studio-work-row strong{font-size:14px}.studio-work-row span{font-size:12px;color:var(--text2)}
.studio-home-metrics{margin-top:24px}.studio-home-metrics>summary{font-size:14px;cursor:pointer;padding:12px 0}.studio-home-metrics .home-widget{margin-top:12px}
.home-empty{min-height:100px}.home-feed-row{min-height:44px}

/* Document identity and review actions use the same hierarchy on both sides. */
.studio-review-documents{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.studio-review-document{display:flex;flex-direction:column;gap:5px;align-items:flex-start;text-align:left;max-width:100%;padding:10px 12px;background:var(--bg2);color:var(--text);border:1px solid var(--border);border-radius:8px;cursor:pointer}
.studio-review-document strong{font-size:14px;overflow-wrap:anywhere}.studio-review-document span{font-size:12px;color:var(--text2)}.studio-review-document.active{border-color:var(--accent);box-shadow:inset 3px 0 var(--accent)}
.validate-box{padding:20px}.validate-box .vb-title{font-size:16px}.validate-box .vb-sub,.validate-box .vb-next{font-size:13px;line-height:1.6}
.delivery-review-states{gap:8px}.delivery-review-states small{font-size:12px}.delivery-review-states strong{font-size:14px}
.deliv-card{padding:16px}.deliv-actrow{gap:8px;flex-wrap:wrap}.deliv-vactions{flex-wrap:wrap;gap:8px}.deliv-vact{min-height:32px}
.deliv-grid{gap:16px}.deliv-head h4{font-size:16px}.deliv-latest{padding:12px}.deliv-cta{background:var(--bg3);color:var(--text);border:1px solid var(--border)}
.studio-inline-error{border:1px solid var(--ui-danger);border-left-width:4px;padding:16px;border-radius:8px;margin-bottom:16px;background:var(--bg2)}.studio-inline-error p{font-size:14px;margin:8px 0 12px}
.portal-wrap{max-width:1100px;padding:28px 24px}.portal-project-row{padding:16px;margin:10px 0;gap:16px}.portal-project-row strong{font-size:15px}.portal-project-row small{font-size:13px;line-height:1.5}.portal-project-row>span:last-child{font-size:13px;white-space:nowrap}
#portalProjectSearch,#deliverySearch{width:100%;border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--bg2);color:var(--text);font-size:14px;margin:6px 0 20px}
.delivery-project a{display:inline-flex;gap:8px;flex-wrap:wrap}.delivery-project a small{font-size:12px;color:var(--text2)}
.portal-view-nav{margin-bottom:24px}.portal-section-title{margin-top:24px}.portal-project-row:hover{background:var(--bg3)}
.script-reader-review{gap:12px;padding:12px 16px}.script-reader-review>span{font-size:13px}.script-reader-review .btn{min-height:36px}
.studio-editor-tools{position:relative;font-size:14px}.studio-editor-tools>summary{cursor:pointer;padding:8px 12px;min-height:36px;border:1px solid var(--border);border-radius:7px;background:var(--bg2)}
.studio-editor-tools>div{position:absolute;z-index:90;left:0;top:calc(100% + 6px);display:grid;gap:6px;min-width:190px;padding:10px;background:var(--bg2);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px #0002}
.studio-format-tools{position:relative}.studio-format-tools>summary{cursor:pointer;min-height:36px;padding:8px 12px;border:1px solid var(--border);border-radius:7px;font-size:14px;background:var(--bg2)}
.studio-format-tools .studio-format-buttons{position:absolute;top:calc(100% + 6px);left:0;z-index:95;display:grid;grid-template-columns:repeat(5,36px);gap:6px;padding:10px;background:var(--bg2);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px #0002}
.studio-format-tools:not([open]) .studio-format-buttons{display:none}.studio-format-tools .sv-sep{display:none}#svNormalTools button{width:36px;height:36px}
.sv-title,.proposal-editor-title{font-size:16px}.sv-status,.proposal-save-state,.proposal-editor-meta{font-size:12px!important}.sv-toolbar{gap:8px}.proposal-editor-actions{gap:8px}
.pp-table th{font-size:13px}.pp-table td{padding:8px}.pp-table input,.pp-table select{font-size:14px;min-height:36px}.pp-add{margin:10px 8px 0 0}.pp-vis,.pp-del,.dir-soc-edit{min-height:32px;min-width:32px}
.assign-pop{z-index:1100;max-width:calc(100vw - 24px)}.assign-item{min-height:44px;white-space:normal;align-items:flex-start}.assign-sub{font-size:12px;white-space:normal}.assign-name{overflow-wrap:anywhere}.assign-search input{font-size:16px}
.studio-mobile-phase{display:none}
@media(max-width:1050px){.home-grid{grid-template-columns:1fr}.home-side{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:16px}.studio-next{flex-wrap:wrap}.deliv-grid{grid-template-columns:1fr}}
@media(max-width:700px){
  button,summary{min-height:44px}
  .studio-format-tools .studio-format-buttons{grid-template-columns:repeat(5,44px)}#svNormalTools button{width:44px;height:44px}
  #settingsMenu{bottom:calc(64px + env(safe-area-inset-bottom,0px))!important;max-height:calc(100dvh - 140px)!important;overflow-y:auto!important}
  .btn,.btn-ghost,.btn-sm,.pp-add,.up-btn,.pp-vis,.pp-del,.dir-soc-edit{min-height:44px;min-width:44px}
  .field input,.field select,.field textarea,#portalProjectSearch,#deliverySearch{font-size:16px}
  #cardModal .modal{padding:12px!important;min-height:0!important;height:100dvh!important;max-height:100dvh!important;width:100vw!important;border-radius:0}
  #cardModal .card-head{gap:8px!important;padding:0 0 10px!important;margin:0!important;align-items:flex-start}
  #cardModal .card-head h2{font-size:15px!important;white-space:normal!important;line-height:1.4;overflow-wrap:anywhere;display:block!important;-webkit-line-clamp:unset!important}
  #cardModal .card-head>.btn{flex-shrink:0}#cardModal .status-banner{padding:6px 8px;font-size:12px;margin-bottom:8px}
  #cardWorkspace{display:flex;flex-direction:column;overflow:hidden}
  #cardSectionNav.card-section-nav{padding:8px 0;border:0;overflow:visible;flex-shrink:0;background:var(--bg2)}
  .studio-section-picker{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--text2)}.studio-section-picker select{min-width:0;flex:1;min-height:44px;font-size:16px;border:1px solid var(--border);border-radius:8px;background:var(--bg);color:var(--text);padding:8px}
  .studio-section-list{display:none}#cardPanelViewport{padding:12px 0 20px;flex:1;min-height:0;overflow-x:hidden}
  .studio-next{padding:16px;gap:12px}.studio-next h3{font-size:18px}.studio-summary-grid{grid-template-columns:1fr 1fr;gap:12px}.studio-summary-grid dd{font-size:13px}
  .proj-dash{display:block}.studio-next>.btn{width:100%}.dash-card{padding:14px}
  .portal-wrap{padding:20px 14px}.portal-project-row{flex-wrap:wrap}.portal-project-row>span:first-child{flex-basis:100%}.portal-project-row>span:last-child{margin-left:auto;white-space:normal}.portal-project-row strong{font-size:16px}
  #projModal .modal{margin:0!important;width:100%!important;max-width:100%!important;min-height:100dvh;max-height:100dvh!important;border-radius:0;padding:16px!important}
  #projModal .modal>div:first-child{position:sticky;top:-16px;background:var(--bg2);z-index:5;padding:12px 0;align-items:flex-start!important}#projModalTitle{font-size:18px;padding-right:8px}
  .pm-stepper{overflow-x:auto}.pm-stepper .step-label{font-size:12px}.validate-box{padding:16px;min-width:0!important}.studio-review-document{width:100%}.script-reader-review>.btn{min-height:44px;flex:1 1 140px}.script-reader-review>span{flex-basis:100%}
  .pm-stepper .stepper:has(.step.current){overflow:visible;margin:4px 0 12px}
  .pm-stepper .stepper:has(.step.current) .step:not(.current){display:none}
  .pm-stepper .stepper .step.current{display:flex;flex-direction:row;justify-content:flex-start;gap:10px;min-width:0;align-items:center}
  .pm-stepper .step.current::before,.pm-stepper .step.current::after{display:none}
  .pm-stepper .step.current .step-label{font-size:14px}.pm-stepper .step.current .step-label::before{content:'Étape actuelle : ';font-weight:400;color:var(--text2)}
  .pm-details>summary{text-transform:none;letter-spacing:0;font-size:13px;line-height:1.5}
  .studio-mobile-phase{display:flex;align-items:center;gap:12px;padding:10px 12px;font-size:13px;border-bottom:1px solid var(--border);background:var(--bg2)}.studio-mobile-phase select{min-width:0;flex:1;padding:10px;font-size:16px;min-height:44px;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:8px}
  .board-col-nav{display:none!important}#board{display:flex!important;flex-direction:column!important;align-items:stretch;overflow:auto!important;gap:16px;scroll-snap-type:none;padding:12px;min-width:0}
  #board .column{width:100%!important;min-width:0!important;max-width:100%!important;flex:0 0 auto;max-height:none;height:auto;overflow:visible}
  #board .column-body,#board .drop-zone{overflow:visible;max-height:none;height:auto;flex:none}#board .column.studio-mobile-filtered{display:none!important}#board .card{width:100%;margin-bottom:12px}#board .empty-col{min-height:60px;padding:16px}
  .board-container{min-width:0}.mobile-prod-bar{gap:8px}.planif-chips{max-height:90px;overflow:auto}.home-wrap{padding:20px 14px}.studio-priority-grid{grid-template-columns:1fr}.home-grid{gap:20px}
  .pp-table,.pp-table tbody,.pp-table tr,.pp-table td{display:block;width:100%}.pp-table thead{display:none}.pp-table tr{padding:12px;border:1px solid var(--border);border-radius:10px;margin:0 0 12px;background:var(--bg2)}.pp-table td{border:0;text-align:left!important;padding:6px 0;min-width:0}
  .pp-table td::before{content:attr(data-label);display:block;font-size:12px;font-weight:600;color:var(--text2);margin-bottom:4px}.pp-table td input,.pp-table td select,.pp-table td textarea{width:100%;min-width:0;font-size:16px;min-height:44px}.pp-table td.act{display:inline-flex;width:auto;margin-right:12px;gap:8px;align-items:center}.pp-table .gear-mat{display:flex;gap:8px}
  .modal-actions{flex-wrap:wrap;gap:8px}.modal-row{flex-wrap:wrap}.modal-row>.field{min-width:min(100%,150px)}
  .cal-toolbar,.cal-topbar{flex-wrap:wrap;gap:8px}.cal-week-lbl{white-space:normal}.cal-task{min-height:32px}.cal-prod-band{font-size:12px;line-height:1.4;height:auto;min-height:28px}.cal-prod-row{min-height:32px}
  .proposal-editor-head{gap:8px;flex-wrap:wrap}.proposal-editor-actions{flex-wrap:wrap}.proposal-editor-title{min-width:0}.proposal-secondary-tools[open]>div{right:0;max-width:calc(100vw - 24px)}
}
