/* The supplied gallery reference: compact chrome, two large frames and a photo inspector. */
.sidebar>.workspace-brand { gap:8px; margin-bottom:20px; padding:0 2px; letter-spacing:-.3px; font-size:13px; }
.workspace-brand-mark { display:grid; place-items:center; width:24px; height:24px; flex-shrink:0; border-radius:5px; background:var(--text); color:var(--surface); font-size:17px; font-weight:600; }
.workspace-brand-name { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.workspace-brand>svg { width:13px; height:13px; margin-left:auto; flex-shrink:0; color:var(--muted); }
.sidebar-quick-actions { display:flex; flex-direction:column; gap:3px; margin:20px 0 0; }
.sidebar-quick-actions .nav-link { min-height:33px; }
.sidebar-quick-actions kbd { margin-left:auto; padding:0 4px; border:1px solid var(--border); border-radius:3px; color:var(--secondary); font:9px var(--display); white-space:nowrap; }
.app-shell:has(.gallery-workbench) .nav-link.active>svg { color:#9697c5; }
@media(min-width:981px) {
 .app-shell:has(.gallery-workbench) { grid-template-columns:clamp(150px,11.2vw,224px) minmax(0,1fr); }
 .gallery-workbench-body { grid-template-columns:clamp(200px,14vw,280px) minmax(0,1fr); }
}
.workspace:has(.gallery-workbench) .workspace-topbar { height:44px; }
#route-content:has(.gallery-workbench) { min-height:calc(100dvh - 44px); }
.gallery-workbench-header { min-height:62px; padding:14px 18px; }
.gallery-heading-title h1.page-title { font-size:18px; letter-spacing:-.35px; }
.gallery-heading-icon { width:32px; height:32px; }
.gallery-workbench-body { min-height:calc(100dvh - 106px); align-items:start; }
.gallery-properties { align-self:stretch; padding:19px 14px; }
.gallery-property-intro h2 { font-size:14px; }
.gallery-property-intro p { margin-bottom:24px; }
.gallery-property { grid-template-columns:16px 50px minmax(0,1fr); gap:7px; padding:8px 0; }
.gallery-property-clients { margin-left:-14px; margin-right:-14px; padding-left:14px; padding-right:14px; }
.gallery-workbench-main>.admin-tabs { min-height:52px; padding:0 18px; gap:19px; }
.gallery-workbench-main>.admin-tabs>a { min-height:52px; font-size:12px; }
.gallery-workbench-main>.admin-content { padding:0 18px 36px; }
.gallery-photo-toolbar { position:relative; min-height:52px; margin:0 -18px; padding:9px 18px; gap:8px; }
.gallery-photo-toolbar>.ui-select { width:132px; }
.gallery-photo-filters { position:static; margin:0; order:1; }
.gallery-photo-filters>summary { width:30px; min-height:32px; display:grid; place-items:center; border-radius:5px; }
.gallery-photo-filters>summary:hover,.gallery-photo-filters[open]>summary { background:var(--accent-soft); }
.gallery-photo-filters>summary>span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.gallery-photo-filters .admin-photo-tools { position:absolute; left:12px; right:12px; top:calc(100% + 5px); z-index:22; display:flex; flex-wrap:wrap; gap:10px; margin:0; padding:14px; border:1px solid var(--border); border-radius:7px; background:var(--surface); box-shadow:var(--shadow); }
.gallery-photo-filters .admin-search { flex:1 1 160px; }
.gallery-photo-filters .admin-photo-tools>.ui-select { flex:1 1 130px; }
.gallery-photo-filters .admin-photo-tools>.btn { flex:1 1 100%; }
.gallery-photo-toolbar>.btn[data-action=upload] { order:2; }
.gallery-selection-notice { min-height:70px; padding:16px; gap:14px; margin:20px 0 18px; }
.gallery-selection-notice>span:first-child { width:36px; height:36px; }
.gallery-selection-notice strong { font-size:13px; }
.gallery-selection-notice small { font-size:11px; }
.gallery-album-chips { gap:8px; margin:0 0 16px; }
.gallery-album-chips .btn { min-height:33px; }
.gallery-album-chips [data-action=new-album] { font-size:0; width:32px; min-width:32px; padding:6px; }
.gallery-album-chips [data-action=new-album]>svg { width:16px; height:16px; }
.gallery-workbench .admin-photo-bulk:not(.has-selection) { display:none; }
.gallery-workbench .admin-order-hint { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); margin:0; }
.gallery-workbench .admin-photo-grid { --photo-columns:4; --photo-gap:16px; }
.gallery-workbench .admin-photo-card { overflow:visible; }
.gallery-workbench .admin-photo-image { aspect-ratio:1.23; border-radius:6px; }
.gallery-workbench .admin-photo-card.is-inspected .admin-photo-image { outline:2px solid #aab6f5; outline-offset:3px; }
.gallery-workbench .admin-photo-open:focus-visible { outline-offset:-4px; }
.gallery-workbench .admin-photo-check { opacity:0; transition:opacity .15s; }
.gallery-workbench .admin-photo-card:hover .admin-photo-check,.gallery-workbench .admin-photo-card:focus-within .admin-photo-check,.gallery-workbench .admin-photo-card.selected .admin-photo-check { opacity:1; }
.gallery-photo-expand { position:absolute; right:8px; bottom:8px; background:var(--surface); color:var(--muted); opacity:0; }
.admin-photo-card:hover .gallery-photo-expand,.admin-photo-card:focus-within .gallery-photo-expand { opacity:1; }
.gallery-workbench .admin-photo-caption { padding:9px 0 3px; min-height:30px; }
.gallery-workbench .admin-photo-caption>div:first-child { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; min-width:0; }
.gallery-workbench .admin-photo-caption strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.gallery-workbench .admin-photo-caption small { white-space:nowrap; font-size:10px; }
.gallery-workbench .admin-order-buttons { position:absolute; right:7px; bottom:38px; background:var(--surface); border-radius:5px; }
.gallery-workbench .gallery-photo-list { --photo-columns:1; }
.gallery-photo-list .admin-order-buttons { position:static; }
.gallery-photo-list .admin-photo-caption>div:first-child { align-items:start; flex-direction:column; }
.gallery-photo-list .gallery-photo-expand { display:none; }

.gallery-photo-inspector { align-self:start; position:sticky; top:44px; min-width:0; height:calc(100dvh - 44px); overflow-y:auto; overscroll-behavior:contain; background:var(--surface); border-left:1px solid var(--border); }
.gallery-photo-inspector[hidden] { display:none; }
.photo-inspector-heading { display:flex; align-items:center; gap:9px; padding:10px 14px; min-height:52px; border-bottom:1px solid var(--border); }
.photo-inspector-heading .icon-button { width:28px; min-width:28px; min-height:28px; height:28px; padding:6px; border:0; background:transparent; box-shadow:none; color:var(--muted); }
.photo-inspector-heading [data-action="close-photo-inspector"]>svg { width:16px; height:16px; transform:rotate(-90deg); }
.admin-root .photo-inspector-heading h2 { color:var(--muted); font-size:12px; font-weight:400; margin:0; letter-spacing:0; }
.photo-inspector-content { padding:16px 14px 24px; }
.photo-inspector-preview { display:block; position:relative; width:100%; aspect-ratio:1.5; overflow:hidden; border:0; border-radius:5px; padding:0; background:var(--surface-alt); }
.photo-inspector-preview>img { width:100%; height:100%; object-fit:cover; display:block; }
.photo-inspector-preview>.media-fallback { height:100%; }
.photo-inspector-preview>span:not(.media-fallback) { position:absolute; inset:auto 0 0; display:flex; align-items:center; justify-content:center; gap:6px; padding:9px; color:#fff; background:#222b; opacity:0; font-size:11px; }
.photo-inspector-preview:hover>span,.photo-inspector-preview:focus-visible>span { opacity:1; }
.photo-inspector-preview svg { width:16px; height:16px; }
.photo-inspector-name { margin:14px 0 24px; padding:9px 10px; border-radius:6px; background:var(--bg); font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.admin-root .photo-inspector-properties h3 { margin:0 0 10px; font-size:12px; font-weight:400; color:var(--muted); }
.photo-inspector-properties dl { margin:0 0 22px; }
.photo-inspector-properties dl>div { display:grid; grid-template-columns:16px 54px minmax(0,1fr); align-items:start; column-gap:7px; padding:7px 0; font-size:10px; color:var(--muted); }
.photo-inspector-properties dl svg { width:15px; height:15px; color:var(--secondary); }
.photo-inspector-properties dt,.photo-inspector-properties dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.photo-inspector-properties dt { color:var(--muted); }
.photo-inspector-cover { width:100%; justify-content:center; font-size:10px; font-weight:400; color:var(--muted); }
.photo-inspector-cover:disabled { opacity:1; color:var(--muted); cursor:default; }
.photo-inspector-trash { width:100%; margin-top:8px; justify-content:center; }
.photo-inspector-album select { width:100%; min-width:0; font-size:11px; }
.photo-inspector-album .ui-select { min-width:0; width:100%; }
.photo-inspector-album .ui-select-button { min-width:0; min-height:30px; font-size:11px; }
.photo-inspector-note { display:flex; flex-direction:column; gap:19px; margin-top:25px; font-size:12px; color:var(--muted); }
.photo-inspector-note textarea { width:100%; min-height:90px; resize:vertical; font-size:11px; padding:10px; line-height:1.6; }
.photo-note-privacy,.photo-note-status { font-size:10px; color:var(--muted); margin:13px 0 0; line-height:1.5; }
.photo-note-status:empty { display:none; }
@media(min-width:1101px) {
 .gallery-workbench-body:has(.gallery-photo-inspector:not([hidden])) { grid-template-columns:clamp(200px,14vw,280px) minmax(0,1fr) clamp(220px,15.6vw,310px); }
 .gallery-workbench-body:has(.gallery-photo-inspector:not([hidden])) .admin-heading-actions { gap:6px; }
}
@media(max-width:1100px) {
 .gallery-workbench .admin-photo-grid:not(.gallery-photo-list) { --photo-columns:2; }
 .gallery-photo-inspector:not(.is-requested) { display:none; }
 .gallery-photo-inspector.is-requested { position:fixed; inset:0 0 0 auto; z-index:35; width:min(310px,100%); height:100dvh; box-shadow:-12px 0 32px #0002; }
 .gallery-photo-inspector.is-requested .photo-inspector-heading { position:sticky; top:0; background:var(--surface); z-index:1; }
 .gallery-workbench-body:not(:has(.gallery-photo-inspector.is-requested)) .admin-photo-card.is-inspected .admin-photo-image { outline:0; }
 .gallery-workbench-main>.admin-tabs { gap:14px; }
 .gallery-photo-toolbar { flex-wrap:wrap; }
}
@media(max-width:760px) {
 .gallery-workbench-body { align-items:stretch; }
 .gallery-workbench-header { padding:14px 16px; }
 .gallery-workbench-header .admin-heading-actions { justify-content:flex-start; flex-wrap:wrap; gap:6px; }
 .gallery-workbench-header .admin-heading-actions .btn { min-height:32px; font-size:11px; padding:6px 8px; }
 .gallery-workbench-header .admin-heading-actions .icon-button { width:28px; height:32px; min-height:32px; padding:5px; }
 .gallery-workbench-main>.admin-tabs { padding:0 14px; gap:14px; }
 .gallery-workbench-main>.admin-tabs>a { font-size:11px; }
 .gallery-workbench-main>.admin-content { padding-left:14px; padding-right:14px; }
 .gallery-photo-toolbar { margin:0 -14px; padding:10px 14px; }
 .gallery-photo-toolbar>h2 { flex-basis:calc(100% - 48px); order:-2; }
 .gallery-photo-toolbar>.ui-select { flex:1; min-width:120px; }
 .gallery-photo-filters { order:-1; }
 .gallery-photo-toolbar>.btn[data-action=upload] { order:0; }
 .gallery-photo-filters .admin-photo-tools { left:8px; right:8px; }
 .gallery-properties { padding:16px; }
 .gallery-property-intro { grid-template-columns:64px minmax(0,1fr); }
 .gallery-property-intro h2 { font-size:13px; }
 .gallery-workbench .admin-photo-check,.gallery-photo-expand { opacity:1; }
 .gallery-workbench .admin-order-buttons { position:static; opacity:1; margin:3px 0; }
 .gallery-workbench .admin-photo-caption { gap:2px; }
 .gallery-workbench .admin-photo-caption strong { font-size:10px; }
 .gallery-workbench .admin-photo-caption small { font-size:9px; }
 .gallery-selection-notice { padding:13px; gap:10px; }
 .gallery-selection-notice strong { font-size:12px; }
 .gallery-selection-notice small { font-size:10px; }
}
@media(min-width:761px) and (max-width:980px) {
 .sidebar>.workspace-brand { justify-content:center; padding:0; }
 .workspace-brand-name,.workspace-brand>svg,.sidebar-quick-actions .nav-link>span,.sidebar-quick-actions kbd { display:none; }
 .sidebar-quick-actions .nav-link { justify-content:center; padding:8px; }
}
@media(max-width:760px) {
 .sidebar>.workspace-brand { width:calc(100% - 52px); max-width:260px; min-height:30px; margin-bottom:9px; padding:0 4px; }
 .sidebar-quick-actions { flex-direction:row; margin:6px 0 0; gap:8px; }
 .sidebar-quick-actions .nav-link { min-height:36px; padding:5px 8px; font-size:11px; }
 .sidebar-quick-actions kbd { display:none; }
 .sidebar nav .nav-link { min-height:42px; }
}
@media(max-width:380px) {
 .gallery-workbench-main>.admin-tabs { gap:9px; padding:0 12px; }
 .gallery-workbench-main>.admin-tabs>a { font-size:10px; }
 .gallery-photo-toolbar>.ui-select { width:auto; min-width:90px; }
 .gallery-photo-toolbar .btn { font-size:11px; padding:6px 8px; }
 .gallery-workbench .admin-photo-grid { --photo-gap:10px; }
}
@media(hover:none) { .gallery-workbench .admin-photo-check,.gallery-photo-expand { opacity:1; } }
@media(prefers-reduced-motion:reduce) { .gallery-workbench .admin-photo-check { transition:none; } }

/* On-card actions remain keyboard and touch accessible. */
.gallery-photo-quick-actions { position:absolute; right:8px; bottom:8px; display:flex; gap:4px; z-index:2; padding:3px; border:1px solid var(--border); border-radius:6px; background:var(--surface); }
.gallery-photo-quick-actions .icon-button { width:32px; height:32px; padding:7px; }
.gallery-photo-quick-actions .icon-button:hover { background:var(--surface-alt); }
.gallery-workbench .admin-photo-card { user-select:none; }
.gallery-workbench .admin-photo-card.selected .admin-photo-image { outline:2px solid var(--accent,#6579ff); outline-offset:2px; }
.gallery-workbench .admin-photo-card.selected.is-inspected .admin-photo-image { outline-color:var(--accent,#6579ff); }
.photo-dragging::after { content:attr(data-drag-count) ' фото'; position:absolute; left:8px; top:8px; padding:6px 10px; border-radius:5px; color:var(--text); background:var(--surface); border:1px solid var(--border); z-index:4; pointer-events:none; }
.gallery-quick-property { min-width:0; }
.gallery-quick-property>summary { list-style:none; cursor:pointer; grid-template-columns:16px 50px minmax(0,1fr) 12px; }
.gallery-quick-property>summary::-webkit-details-marker { display:none; }
.gallery-quick-property>summary>svg:last-child { width:12px; height:12px; opacity:.5; }
.gallery-quick-property>summary:hover strong { color:var(--accent,var(--text)); }
.gallery-quick-property form { display:grid; gap:9px; padding:9px 0 14px; }
.gallery-quick-property input,.gallery-quick-property select { min-width:0; width:100%; padding:8px; }
.gallery-quick-property .field { font-size:11px; gap:6px; }
.gallery-quick-property .field:has([hidden]),.gallery-quick-property [hidden] { display:none; }
.gallery-quick-property small { font-size:10px; color:var(--muted); line-height:1.5; }
.gallery-quick-buttons { display:flex; gap:4px; flex-wrap:wrap; }
.gallery-quick-buttons .btn { min-width:0; padding:6px 9px; font-size:11px; }
.gallery-quick-property .error:empty { display:none; }
.gallery-property-intro>.gallery-property-cover { display:block; width:100%; object-fit:cover; }
.gallery-property strong { overflow-wrap:anywhere; white-space:normal; }
.gallery-photo-list .gallery-photo-quick-actions { position:static; flex-shrink:0; margin-left:auto; }
.gallery-photo-list .admin-photo-caption { flex-wrap:wrap; gap:8px; }
@media(max-width:760px) {
 .gallery-properties .gallery-property-group { display:block; margin-top:14px; }
 .gallery-property-intro { display:block; }
 .gallery-property-intro>.gallery-property-cover { width:100px; margin-bottom:8px; }
 .gallery-quick-property>summary { grid-template-columns:16px 55px minmax(0,1fr) 12px; }
 .gallery-quick-property>summary>strong { grid-column:auto; }
}
.gallery-properties .gallery-property:not(summary)>strong { grid-column:auto; }

/* Shared chrome for gallery header actions. */
.gallery-workbench-header .admin-heading-actions :is(.btn,.icon-button) {
 display:inline-flex; align-items:center; justify-content:center; gap:6px;
 height:32px; min-height:32px; border:1px solid var(--border); border-radius:6px;
 background:var(--surface); color:var(--text); padding:6px 10px; box-shadow:none;
 font-size:12px; font-weight:500; line-height:18px;
}
.gallery-workbench-header .admin-heading-actions .icon-button { width:32px; min-width:32px; padding:6px; }
.gallery-workbench-header .admin-heading-actions :is(.btn,.icon-button)>svg { width:16px; height:16px; }
.gallery-workbench-header .admin-heading-actions :is(.btn,.icon-button):hover { background:var(--surface-alt); }
.gallery-workbench-header .admin-heading-actions .btn.primary { background:var(--action-blue); border-color:var(--action-blue); color:#fff; }
.gallery-workbench-header .admin-heading-actions .btn.primary:hover { background:var(--action-blue-hover); }
.gallery-quick-upload {
 display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px;
 flex-shrink:0; width:min(280px,100%); min-width:0; min-height:180px; margin:auto;
 padding:18px 10px; border:0; color:var(--muted);
}
.gallery-quick-upload>svg { width:24px; height:24px; }
.gallery-quick-upload>span { font-size:12px; text-align:center; }
.gallery-quick-upload>div { display:flex; justify-content:center; flex-wrap:wrap; gap:6px; }
.gallery-quick-upload .btn { min-width:0; font-size:12px; padding:6px 9px; }
.gallery-workbench-main:has(.gallery-quick-upload) { display:flex; flex-direction:column; min-height:calc(100dvh - 106px); }
.gallery-workbench-main:has(.gallery-quick-upload)>.admin-content { display:flex; flex-direction:column; flex:1; }
.admin-photo-results:has(.gallery-quick-upload) { display:flex; flex-direction:column; flex:1; gap:24px; }
.gallery-upload-canvas:has(>.gallery-quick-upload) { flex:1; display:grid; grid-template-rows:minmax(min-content,1fr) auto 1fr; gap:24px; }
.gallery-upload-canvas:has(>.gallery-quick-upload)::after { content:''; }
.gallery-photo-collection { min-width:0; align-self:start; }
.gallery-upload-canvas>.gallery-quick-upload { grid-row:2; }
.admin-photo-results:has(.gallery-quick-upload)>.gallery-album-chips { margin-bottom:0; }
@media(max-width:760px) {
 .gallery-workbench-header .admin-heading-actions :is(.btn,.icon-button) { height:36px; min-height:36px; }
 .gallery-workbench-header .admin-heading-actions .icon-button { width:36px; min-width:36px; }
 .gallery-quick-upload { gap:9px; padding:14px 8px; }
 .gallery-quick-upload .btn { min-height:36px; }
}

