/* Approved gallery-detail composition. Other routes and client photo layouts retain their own chrome. */
.workspace:has(.gallery-workbench) { padding:0; }
.workspace:has(.gallery-workbench) .workspace-topbar { height:54px; padding:0 22px; }
#route-content:has(.gallery-workbench) { padding:0; border-radius:10px 0 0; min-height:calc(100dvh - 54px); border-right:0; border-bottom:0; }
.gallery-workbench { min-width:0; }
.gallery-workbench-header { display:flex; align-items:center; gap:13px; min-height:76px; padding:18px 22px; border-bottom:1px solid var(--border); }
.gallery-workbench-header .gallery-properties-toggle { width:28px; min-width:28px; height:28px; min-height:28px; padding:6px; border-color:transparent; background:transparent; color:var(--muted); flex-shrink:0; }
.gallery-properties-toggle>svg { width:16px; height:16px; transform:rotate(90deg); }
.gallery-properties-toggle[aria-expanded="false"]>svg { transform:rotate(-90deg); }
.gallery-heading-icon { width:38px; height:38px; display:grid; place-items:center; flex-shrink:0; background:var(--accent-soft); color:var(--muted); border-radius:7px; }
.gallery-heading-icon svg { width:23px; height:23px; }
.gallery-heading-title { display:flex; align-items:center; gap:12px; min-width:0; flex:1; flex-wrap:wrap; }
.gallery-heading-title h1.page-title { margin:0; font-size:21px; letter-spacing:-.5px; line-height:1.3; overflow-wrap:anywhere; }
.gallery-heading-title .badge { font-size:10px; white-space:nowrap; }
.gallery-workbench-header .admin-heading-actions { margin-left:auto; flex-wrap:nowrap; max-width:none; }
.gallery-workbench-header .admin-heading-actions .btn { white-space:nowrap; font-size:12px; }
.gallery-workbench-body { display:grid; grid-template-columns:244px minmax(0,1fr); min-height:calc(100dvh - 130px); }
.gallery-properties { background:var(--surface-alt); border-right:1px solid var(--border); padding:23px 18px; min-width:0; font-size:12px; }
.gallery-property-cover { display:grid; place-items:center; width:100%; aspect-ratio:1.7; background:var(--accent-soft); border-radius:7px; overflow:hidden; color:var(--muted); }
.gallery-property-cover img { width:100%; height:100%; object-fit:cover; }
.gallery-property-cover>svg { width:34px; height:34px; }
.gallery-property-intro h2 { font-size:15px; margin:16px 0 6px; line-height:1.5; overflow-wrap:anywhere; }
.gallery-property-intro p { color:var(--muted); font-size:11px; margin:0 0 26px; }
.gallery-property-group { margin:0 0 22px; }
.gallery-property-group>summary { display:flex; align-items:center; justify-content:space-between; cursor:pointer; font-size:13px; font-weight:500; list-style:none; margin-bottom:9px; color:var(--muted); }
.gallery-property-group>summary::-webkit-details-marker { display:none; }
.gallery-property-group>summary:after { content:'⌃'; font-size:16px; }
.gallery-property-group:not([open])>summary:after { content:'⌄'; }
.gallery-property { display:grid; grid-template-columns:18px 58px minmax(0,1fr); align-items:start; gap:8px; padding:9px 0; color:var(--muted); font-size:11px; border-radius:4px; }
.gallery-property:hover { background:var(--accent-soft); }
.gallery-property svg { height:17px; width:17px; opacity:.75; }
.gallery-property strong { font-weight:400; color:var(--text); min-width:0; overflow-wrap:anywhere; }
.gallery-property-clients { border-top:1px solid var(--border); padding-top:22px; margin:26px -18px 0; padding-left:18px; padding-right:18px; }
.gallery-property-clients>div { display:flex; align-items:center; justify-content:space-between; color:var(--muted); margin-bottom:14px; }
.gallery-property-clients h3 { font-size:13px; font-weight:500; }
.gallery-property-clients>a { display:flex; align-items:center; gap:9px; min-height:43px; color:var(--muted); font-size:11px; }
.gallery-property-clients>a>span:nth-child(2) { overflow-wrap:anywhere; min-width:0; flex:1; }
.gallery-property-clients small { font-size:10px; white-space:nowrap; }
.gallery-property-clients>p { color:var(--muted); font-size:11px; }
.gallery-client-avatar { width:28px; height:28px; border-radius:50%; background:var(--accent-soft); display:grid; place-items:center; flex-shrink:0; font-size:10px; }
.gallery-property-clients>a.gallery-selection-link { margin-top:12px; font-size:11px; }
.gallery-selection-link svg { width:16px; height:16px; }
.gallery-workbench-main { min-width:0; position:relative; }
.gallery-file-drop { position:absolute; inset:10px; z-index:30; display:none; border:2px dashed var(--text); border-radius:10px; background:var(--surface); pointer-events:none; }
[data-file-drop-state] .gallery-file-drop { display:block; }
.gallery-file-drop>div { position:sticky; top:16px; min-height:min(480px,calc(100dvh - 180px)); display:grid; align-content:center; justify-items:center; gap:14px; padding:28px; text-align:center; }
.gallery-file-drop svg { width:36px; height:36px; color:var(--muted); }
.gallery-file-drop strong { font-size:20px; font-weight:500; }
.gallery-file-drop span { color:var(--muted); font-size:13px; }
.gallery-workbench-main>.admin-tabs { display:flex; flex-wrap:nowrap; overflow:visible; padding:0 20px; gap:18px; margin:0; min-height:62px; border-bottom:1px solid var(--border); align-items:center; }
.gallery-workbench-main>.admin-tabs>a { min-height:62px; display:flex; align-items:center; gap:7px; white-space:nowrap; padding:0; font-size:12px; border-radius:0; }
.gallery-workbench-main>.admin-tabs>a>svg { display:block; width:18px; height:18px; }
.gallery-workbench-main>.admin-tabs>a .badge { font-size:10px; padding:2px 5px; }
.gallery-more-tabs { margin-left:auto; position:relative; }
.gallery-more-tabs>summary { display:flex; align-items:center; gap:6px; list-style:none; cursor:pointer; white-space:nowrap; }
.gallery-more-tabs>summary::-webkit-details-marker { display:none; }
.gallery-more-tabs>summary svg { height:14px; width:14px; }
.gallery-more-tabs>div { position:absolute; right:0; top:100%; width:188px; background:var(--surface); border:1px solid var(--border); border-radius:6px; box-shadow:var(--shadow); padding:6px; z-index:35; }
.gallery-more-tabs>div>a { display:flex; align-items:center; gap:9px; padding:10px; font-size:12px; border:0; color:var(--muted); border-radius:4px; }
.gallery-more-tabs>div>a>svg { width:16px; height:16px; }
.gallery-more-tabs>div>a:hover,.gallery-more-tabs>div>a[aria-current=page] { color:var(--text); background:var(--accent-soft); }
.gallery-workbench-main>.admin-content { padding:0 20px 40px; }
.gallery-photo-toolbar { display:flex; align-items:center; gap:10px; min-height:65px; border-bottom:1px solid var(--border); margin:0 -20px; padding:12px 20px; }
.gallery-photo-toolbar h2 { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); font-weight:400; margin:0 auto 0 0; white-space:nowrap; }
.gallery-photo-toolbar h2>svg { width:19px; height:19px; }
.gallery-photo-toolbar h2>span { font-size:11px; }
.gallery-photo-toolbar>.ui-select { width:145px; min-width:100px; }
.gallery-photo-toolbar>.ui-select>.ui-select-trigger { border-color:transparent; background:transparent; }
.gallery-photo-toolbar .btn { white-space:nowrap; }
.gallery-photo-filters { margin:12px 0 16px; }
.gallery-photo-filters>summary { display:flex; align-items:center; gap:7px; color:var(--muted); cursor:pointer; font-size:11px; width:fit-content; min-height:28px; list-style:none; }
.gallery-photo-filters>summary svg { width:15px; height:15px; }
.gallery-photo-filters .admin-photo-tools { padding-top:12px; margin:0 0 18px; }
.gallery-photo-filters .admin-photo-tools>.ui-select { min-width:130px; flex:1; max-width:none; }
.gallery-photo-filters .admin-search { min-width:160px; }
.gallery-selection-notice { display:flex; align-items:center; gap:16px; padding:20px; border:1px solid var(--border); border-radius:8px; margin:16px 0 22px; color:var(--muted); }
.gallery-selection-notice>span:first-child { display:grid; place-items:center; width:42px; height:42px; border-radius:9px; background:var(--accent-soft); flex-shrink:0; }
.gallery-selection-notice svg { width:21px; height:21px; }
.gallery-selection-notice>div { flex:1; }
.gallery-selection-notice strong { font-weight:500; font-size:13px; }
.gallery-selection-notice small { display:block; margin-top:5px; font-size:11px; }
.gallery-selection-notice>span:last-child { display:flex; align-items:center; gap:12px; font-size:11px; }
.gallery-album-chips { display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin:0 0 18px; }
.gallery-album-chips .btn { min-height:36px; gap:9px; color:var(--muted); }
.gallery-album-chips .btn[aria-pressed=true] { background:var(--accent-soft); }
.gallery-album-chips .btn>span { font-size:10px; }
.gallery-album-chips [data-action=new-album] { margin-left:auto; font-size:11px; }
.gallery-workbench .admin-photo-bulk { padding:0; background:transparent; border:0; min-height:28px; margin-bottom:10px; }
.gallery-workbench .admin-photo-bulk:not(.has-selection)>.toolbar { display:none; }
.gallery-workbench .admin-photo-bulk.has-selection { background:var(--accent-soft); padding:8px; }
.gallery-workbench .admin-order-hint { font-size:10px; margin:0 0 12px; }
.gallery-workbench .admin-photo-grid { --photo-columns:3; --photo-gap:16px; }
.gallery-workbench .admin-photo-card { border:0; background:transparent; border-radius:0; margin:0; }
.gallery-workbench .admin-photo-image { border-radius:7px; overflow:hidden; }
.gallery-workbench .admin-photo-open { background:var(--surface-alt); }
.gallery-workbench .admin-photo-caption { padding:10px 0 4px; }
.gallery-workbench .admin-photo-caption strong { font-size:11px; font-weight:400; color:var(--muted); }
.gallery-workbench .admin-photo-caption small { font-size:10px; }
.gallery-workbench .admin-order-buttons { opacity:0; }
.gallery-workbench .admin-photo-card:hover .admin-order-buttons,.gallery-workbench .admin-photo-card:focus-within .admin-order-buttons { opacity:1; }
.gallery-photo-cover-badge { position:absolute; left:8px; bottom:8px; display:flex; align-items:center; gap:5px; background:var(--surface); color:var(--muted); border:1px solid var(--border); border-radius:4px; padding:4px 7px; font-size:10px; pointer-events:none; }
.gallery-photo-cover-badge svg { width:14px; height:14px; }
.gallery-workbench .gallery-photo-list { --photo-columns:1; }
.gallery-workbench .gallery-photo-list>.admin-photo-card { display:grid; grid-template-columns:100px minmax(0,1fr); gap:15px; border-bottom:1px solid var(--border); padding-bottom:12px; align-items:center; }
.gallery-workbench .gallery-photo-list .admin-photo-caption { align-items:center; }
.gallery-workbench .gallery-photo-list .admin-photo-caption>div:first-child { flex:1; }
.gallery-workbench .gallery-photo-list .admin-photo-check { width:24px; height:24px; top:3px; right:3px; }
.gallery-workbench .gallery-photo-list .gallery-photo-cover-badge { display:none; }
.gallery-workbench .admin-content:has(>.admin-settings),.gallery-workbench .admin-content:has(>.features-columns) { padding-top:22px; }
.gallery-workbench .admin-content>.admin-section-heading { margin-top:22px; }
@media(min-width:1700px) { .gallery-workbench-body { grid-template-columns:280px minmax(0,1fr); } .gallery-properties { padding:24px 20px; } .gallery-workbench-main>.admin-content { padding-left:24px; padding-right:24px; } .gallery-photo-toolbar { margin-left:-24px; margin-right:-24px; padding-left:24px; padding-right:24px; } }
@media(max-width:1200px) { .gallery-workbench-body { grid-template-columns:210px minmax(0,1fr); } .gallery-properties { padding:18px 14px; } .gallery-property { grid-template-columns:16px 45px minmax(0,1fr); gap:6px; font-size:10px; } .gallery-workbench-main>.admin-tabs { gap:12px; padding:0 16px; } .gallery-workbench-main>.admin-tabs>a { font-size:11px; } .gallery-workbench-main>.admin-content { padding-left:16px; padding-right:16px; } .gallery-photo-toolbar { margin:0 -16px; padding-left:16px; padding-right:16px; flex-wrap:wrap; } .gallery-photo-toolbar h2 { font-size:12px; } .gallery-workbench .admin-photo-grid { --photo-columns:2; } .gallery-heading-title h1.page-title { font-size:19px; } .gallery-workbench-header { padding:16px; } .gallery-workbench-header .admin-heading-actions { gap:5px; } }
@media(max-width:980px) { .gallery-workbench-body { grid-template-columns:180px minmax(0,1fr); } .gallery-workbench-main>.admin-tabs { gap:10px; } .gallery-workbench-main>.admin-tabs>a>svg { display:none; } .gallery-heading-icon { display:none; } .gallery-property { grid-template-columns:16px minmax(0,1fr); } .gallery-property>strong { grid-column:2; } .gallery-workbench-header .admin-heading-actions .btn { padding:7px; } .gallery-selection-notice { padding:14px; } .gallery-selection-notice>span:last-child { font-size:0; gap:0; } }
@media(max-width:760px) {
 .gallery-workbench-body { display:flex; flex-direction:column; }
 .gallery-properties { border-right:0; border-bottom:1px solid var(--border); padding:16px; }
 .gallery-property-intro { display:grid; grid-template-columns:100px minmax(0,1fr); column-gap:15px; align-items:start; }
 .gallery-property-cover { grid-row:1 / 3; }
 .gallery-property-intro h2 { margin:0; font-size:14px; }
 .gallery-property-intro p { margin:5px 0 0; font-size:10px; }
 .gallery-property-group,.gallery-property-clients { display:none; }
 .gallery-workbench-header { flex-wrap:wrap; gap:10px; }
 .gallery-heading-title { flex-basis:100%; }
 .gallery-workbench-header .admin-heading-actions { margin-left:0; width:100%; justify-content:flex-end; }
 .gallery-workbench-header .admin-heading-actions .btn { min-height:38px; }
 .gallery-workbench-main>.admin-tabs { min-height:54px; gap:15px; padding:0 16px; }
 .gallery-workbench-main>.admin-tabs>a { min-height:54px; }
 .gallery-workbench-main>.admin-tabs>a>.badge { display:none; }
 .gallery-more-tabs>summary { font-size:11px; padding:4px; }
 .gallery-photo-toolbar { gap:7px; }
 .gallery-photo-toolbar h2 { flex:1; }
 .gallery-photo-toolbar>.ui-select { width:130px; }
 .gallery-photo-toolbar .icon-button { min-width:36px; min-height:36px; }
 .gallery-photo-toolbar>.btn { min-height:36px; }
 .gallery-workbench .admin-order-hint { line-height:1.5; }
 .gallery-workbench .admin-photo-grid { --photo-columns:2; --photo-gap:12px; }
 .gallery-workbench .admin-order-buttons { opacity:1; }
 .gallery-workbench .admin-photo-caption { flex-wrap:wrap; }
 .gallery-workbench .admin-photo-caption>div:first-child { width:100%; }
 .gallery-album-chips [data-action=new-album] { margin-left:0; }
 .gallery-workbench .gallery-photo-list { --photo-columns:1; }
 .gallery-workbench .gallery-photo-list .admin-photo-caption { flex-wrap:nowrap; }
}
@media(max-width:380px) { .gallery-workbench-main>.admin-tabs { gap:10px; padding-left:12px; padding-right:12px; } .gallery-workbench-main>.admin-tabs>a { font-size:10px; } .gallery-property-intro { grid-template-columns:80px minmax(0,1fr); } .gallery-heading-title h1.page-title { font-size:18px; } .gallery-photo-toolbar>.ui-select { width:120px; } }

.gallery-more-tabs:has(a[aria-current=page])>summary { background:var(--accent-soft); color:var(--text); }
@media(max-width:760px) { .gallery-workbench .gallery-more-tabs>summary { font-size:11px; min-width:0; min-height:32px; padding:4px; } }
@media(max-width:380px) { .gallery-workbench-main>.admin-tabs { gap:7px; } .gallery-workbench .gallery-more-tabs>summary { font-size:10px; } }

@media(min-width:981px) { .gallery-workbench-body { grid-template-columns:clamp(190px,16.1vw,300px) minmax(0,1fr); } }
/* Equal contact-sheet frames match the approved screenshot; full viewer retains originals. */
.gallery-workbench .admin-photo-image { aspect-ratio:1.23; }
.gallery-workbench .admin-photo-open { height:100%; }
.gallery-workbench .admin-photo-open img { width:100%; height:100%; object-fit:cover; }

/* Programmatic focus after clearing a group should not outline the whole canvas. */
.gallery-upload-canvas:focus-visible { outline:none; }

.gallery-property-cover>img { width:100%; height:100%; object-fit:cover; }
.gallery-cover-edit { position:relative; padding:0; border:0; cursor:pointer; font:inherit; }
.gallery-cover-edit>span { position:absolute; inset:auto 0 0; display:flex; align-items:center; justify-content:center; gap:6px; padding:9px 5px; background:#0009; color:#fff; font-size:11px; opacity:0; }
.gallery-cover-edit>span>svg { width:14px; height:14px; }
.gallery-cover-edit:hover>span,.gallery-cover-edit:focus-visible>span { opacity:1; }
.gallery-cover-edit:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
.gallery-cover-edit:disabled { cursor:default; }
.gallery-cover-edit:disabled>span { display:none; }
.cover-editor .dialog-body { padding:20px 24px; }
.cover-editor-form>p { margin:0 0 18px; font-size:12px; line-height:1.6; }
.cover-editor-fields { padding:0; margin:0; border:0; min-width:0; }
.cover-editor-previews { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:24px; align-items:start; }
.cover-editor-device { min-width:0; }
.cover-editor-device-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:10px; }
.cover-editor h3 { font-size:13px; font-weight:500; margin:0; }
.cover-editor .btn { font-size:12px; }
.cover-editor-device-heading .btn { padding:5px 8px; min-height:28px; font-size:11px; }
.cover-editor-frame { position:relative; width:100%; aspect-ratio:16/10; background:var(--accent-soft); overflow:hidden; border-radius:6px; touch-action:none; cursor:grab; }
.cover-editor-frame.is-mobile { aspect-ratio:3/4; width:min(100%,195px); margin-inline:auto; }
.cover-editor-frame>img { display:block; width:100%; height:100%; object-fit:cover; user-select:none; }
.cover-editor-frame.is-dragging { cursor:grabbing; }
.cover-editor-frame[aria-disabled="true"] { cursor:default; }
.cover-editor-frame:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
.cover-editor-device>[data-cover-choose] { width:100%; margin-top:12px; }
.cover-editor-device>[aria-pressed=true] { background:var(--accent-soft); }
.cover-editor-filename { margin:7px 0 0; color:var(--muted); font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cover-editor-same { margin:20px 0; font-size:12px; }
.cover-editor-picker { padding-top:16px; border-top:1px solid var(--border); }
.cover-editor-picker-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:12px; }
.cover-editor-picker-heading .admin-search { max-width:240px; font-size:12px; }
.cover-editor-photos { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; }
.cover-editor-photos>button { position:relative; min-width:0; padding:3px; border:1px solid var(--border); border-radius:5px; color:var(--text); background:var(--surface); text-align:left; cursor:pointer; }
.cover-editor-photos>button[aria-pressed=true] { border-color:var(--text); background:var(--accent-soft); }
.cover-editor-photos>button>img { display:block; width:100%; aspect-ratio:1.3; object-fit:cover; border-radius:3px; }
.cover-editor-photos>button>span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; padding:6px 3px 3px; }
.cover-editor-photos>button>svg { position:absolute; right:5px; top:5px; width:18px; height:18px; padding:2px; border-radius:50%; background:var(--surface); }
.cover-editor-pages { display:flex; justify-content:center; align-items:center; gap:14px; margin-top:12px; font-size:11px; }
.cover-editor-pages:empty { display:none; }
.cover-editor-footer { display:flex; justify-content:flex-end; gap:8px; padding-top:16px; margin-top:16px; border-top:1px solid var(--border); }
@media(hover:none) { .gallery-cover-edit>span { opacity:1; } }
@media(max-width:600px) {
 .cover-editor .dialog-body { padding:16px; }
 .cover-editor-previews { grid-template-columns:minmax(0,1fr); gap:20px; }
 .cover-editor-frame.is-mobile { width:165px; }
 .cover-editor-photos { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .cover-editor-picker-heading .admin-search { flex:1 1 100%; max-width:none; }
}
/* Keep both device previews and the actions usable on laptop screens. */
dialog.cover-editor { width:min(900px,calc(100vw - 32px)); }
.cover-editor-frame { max-height:240px; }
.cover-editor-frame.is-mobile { width:180px; max-width:100%; }
.cover-editor-footer { position:sticky; bottom:-20px; padding-bottom:4px; background:var(--surface); z-index:2; }
@media(max-width:600px) { .cover-editor-footer { bottom:-16px; } }
dialog.app-dialog.cover-editor { width:min(900px,calc(100vw - 32px)); }
dialog.app-dialog.cover-editor[open] { display:flex; flex-direction:column; overflow:hidden; }
.cover-editor>.dialog-header { flex-shrink:0; }
.cover-editor>.dialog-body { min-height:0; overflow:auto; }
.cover-editor-footer { bottom:0; padding:12px 0; margin-bottom:-4px; }
@media(min-width:601px) and (max-height:850px) {
 .cover-editor-frame { max-height:180px; }
 .cover-editor-frame.is-mobile { width:135px; }
 .cover-editor-previews { gap:20px; }
 .cover-editor-same { margin:14px 0; }
}

.selection-album-fields { border:0; margin:0; padding:0; min-width:0; }
