/* MedaShot v0.11: consistent 5px card/field geometry and LTR-safe editor. */
/* Leave circles (color swatches, badges, status dots) round by design. */
:where(.btn,.icon-btn,.tool,.dropdown,.dropdown button,.modal,.help-note,.help-grid kbd,.toast,
.tool-hint,.soft-help,.layer-item,.layer-type-icon,.floating-card,.front-card,.rear-card,
.slides-card,.slides-thumb,.slides-mini,.slides-renamer,.slides-renamer input,.slides-stage-actions,
.slides-stage-actions button,.slides-bottom button,.doc-badge,.title-note,.feature-step-choice,
.feature-library-thumb,.feature-panel,.feature-filter,.feature-library-card,.feature-library-item,
.shot-arrow-pop,.shot-pop-close,.shot-arrow-tabs button,.shot-arrow-choice,.shot-bg-dialog,
.shot-bg-warning,.shot-bg-actions button,.shot-bg-sample,.rich-inline,.rich-toolbar,
.rich-grid-modal,.rich-grid-tools button,.rich-grid-tools select,.rich-grid-viewport,
.rich-grid td input,.rich-fonts select,.rich-toolbar input,.rich-toolbar select,.rich-toolbar button,
.master-dialog,.master6-dialog,.master6-toolbar button,.master-field,.master-field input,
.exp6-dialog,.exp6-image,.ms8-dialog,.ms8-template-row,.ms8-template-row button,
.ms8-cut-choices label,.ms9-cloud-dialog,.ms9-cloud-logo,.ms9-cloud-tabs,
.ms9-cloud-tabs button,.ms9-cloud-alert,.ms9-cloud-file,.ms9-cloud-file button,
.ms9-cloud-file a,.ms9-cloud-form input,.ms9-cloud-form button,
input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]),
textarea,select,.drop-overlay,.crop-actions){
 border-radius:5px!important;
}
/* Do not turn circular color controls or recording dots into squares. */
.swatch,.custom-color,.status-dot,.toggle-ui::before{border-radius:50%!important;}
.toggle-ui{border-radius:999px!important;}
.rich-inline{
 white-space:pre-wrap!important;
 overflow-wrap:anywhere!important;
 line-height:1.46!important;
 direction:inherit;
 min-width:120px;
 min-height:60px;
}
.rich-toolbar{
 max-width:min(520px,calc(100vw - 16px))!important;
 flex-wrap:wrap;
 row-gap:4px;
 overflow:visible;
}
.shot-arrow-pop{
 max-width:calc(100vw - 16px)!important;
 box-sizing:border-box;
 overscroll-behavior:contain;
}
/* Keep the full page within the viewport as direction changes. */
.app-shell,.workspace,.topbar,.stage-section,.stage-heading{max-width:100%;min-width:0;}
html[dir="ltr"] .topbar{
 max-width:100vw;
 padding-inline:12px;
 gap:10px;
}
html[dir="ltr"] .topbar .primary-actions{
 flex:1 1 auto;
 min-width:0;
 max-width:100%;
 overflow-x:auto;
 overflow-y:hidden;
 scrollbar-width:none;
 overscroll-behavior-inline:contain;
}
html[dir="ltr"] .topbar .primary-actions::-webkit-scrollbar{display:none;}
html[dir="ltr"] .topbar .primary-actions .btn{flex-shrink:0;}
html[dir="ltr"] .topbar .secondary-actions{
 flex:0 0 auto;
 margin-inline-start:auto;
 margin-inline-end:0;
 gap:5px;
}
html[dir="ltr"] .workspace{width:100%;max-width:100vw;overflow:hidden;}
html[dir="ltr"] .stage-section{flex:1 1 0;min-width:0;overflow:hidden;}
html[dir="ltr"] .stage-heading{padding-inline:12px;gap:7px;}
html[dir="ltr"] .stage-heading .doc-details{flex:0 1 auto;min-width:80px;max-width:34%;}
html[dir="ltr"] .stage-heading .doc-title-line{min-width:0;}
html[dir="ltr"] .stage-heading #document-title{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
html[dir="ltr"] .stage-heading-actions{
 flex:1 1 auto;
 min-width:0;
 display:flex;
 align-items:center;
 overflow-x:auto;
 overflow-y:hidden;
 scrollbar-width:none;
 padding-block:3px;
}
html[dir="ltr"] .stage-heading-actions::-webkit-scrollbar{display:none;}
html[dir="ltr"] .stage-heading-actions .btn{flex-shrink:0;}
html[dir="ltr"] .stage-viewport{min-width:0;}
html[dir="ltr"] .slides-nav,html[dir="ltr"] .inspector,html[dir="ltr"] .toolrail{max-width:100%;box-sizing:border-box;}
html[dir="ltr"] .inspector{border-inline-start:1px solid var(--line);border-right:0;}
html[dir="ltr"] .toolrail{border-inline-end:1px solid var(--line);border-left:0;}
html[dir="ltr"] .slides-nav{border-inline:1px solid var(--line);}
html[dir="ltr"] .inspector-tab,html[dir="ltr"] .field-title,html[dir="ltr"] .setting-title{overflow-wrap:break-word;}
html[dir="ltr"] .layer-item .layer-name{min-width:0;overflow:hidden;}
html[dir="ltr"] .rich-inline{direction:inherit;}
html[dir="ltr"] .shot-arrow-pop,html[dir="ltr"] .shot-bg-dialog{direction:ltr!important;}
html[dir="ltr"] .dropdown button{text-align:left;}
html[dir="ltr"] .doc-details p{margin-inline:0;}
@media (max-width:1600px){
 html[dir="ltr"] .topbar{gap:7px;padding-inline:9px;}
 html[dir="ltr"] .top-actions{gap:4px;}
 html[dir="ltr"] .topbar .btn{padding-inline:8px;}
}
@media (max-width:1350px){
 html[dir="ltr"] .stage-heading{padding-inline:8px;}
 html[dir="ltr"] .stage-heading .doc-details{max-width:24%;}
 html[dir="ltr"] .topbar .secondary-actions{gap:3px;}
}
/* Shared 5px geometry for capture dialogs and storage cards. */
:where(.beta,.empty-sparkle,.feature-step-icon,.feature-library-modal,.feature-library-controls,
.feature-library-buttons,.feature-capture-modal,.feature-region-canvas,.feature-video,
.feature-storage-card,.ms8-field input,.ms8-field select,.exp6-pager){border-radius:5px!important;}
@media (max-width:760px){
 html[dir="ltr"] .workspace{overflow:hidden;flex-direction:column;}
 html[dir="ltr"] .toolrail{border-inline:0;border-bottom:1px solid var(--line);}
 html[dir="ltr"] .stage-heading .doc-details{max-width:30%;}
 html[dir="ltr"] .stage-heading-actions{flex:1 1 0;}
 html[dir="ltr"] .slides-nav{width:100%;border-inline:0;}
 html[dir="ltr"] .inspector{width:100%;border-inline:0;}
}
