/* Checkpoint46: Gallery Art manager, scoped to the existing backend. */
.studio-gallery-admin{--gallery-ink:#152132;--gallery-muted:#6b7787;--gallery-line:#dce3ec;--gallery-panel:#fff;--gallery-soft:#f3f6f7;--gallery-red:#d9232e;color:var(--gallery-ink);max-width:1380px;margin:24px auto 50px;padding:0 24px;font-family:Arial,sans-serif;line-height:1.5}
.studio-gallery-admin,.studio-gallery-admin *{box-sizing:border-box}
.studio-gallery-admin button,.studio-gallery-admin input,.studio-gallery-admin select{font:inherit;letter-spacing:normal}
.studio-gallery-admin button{cursor:pointer;text-transform:none;box-shadow:none}
.studio-gallery-admin button:disabled{opacity:.48;cursor:not-allowed;transform:none}
.studio-gallery-admin h2,.studio-gallery-admin h3,.studio-gallery-admin p{margin:0}
.studio-gallery-admin h2,.studio-gallery-admin h3{font-family:inherit}
.studio-gallery-admin .studio-gallery-heading,.studio-gallery-admin .studio-gallery-dialog>header{height:auto;min-height:0;padding:0;background:transparent;color:inherit;border:0;box-shadow:none;position:static}
.studio-gallery-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:22px}
.studio-gallery-heading h2{font-size:30px;font-weight:750;line-height:1.18;margin:4px 0 8px;color:var(--gallery-ink)}
.studio-gallery-heading p:not(.studio-gallery-eyebrow){font-size:13px;color:var(--gallery-muted)}
.studio-gallery-eyebrow{font-size:10px;letter-spacing:.14em;font-weight:700;color:var(--gallery-muted)}
.studio-gallery-unsaved{color:#b24a18;font-weight:650}
.studio-gallery-header-actions{display:flex;gap:9px;flex-shrink:0}
.studio-gallery-admin .studio-gallery-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:43px;padding:10px 16px;border:1px solid var(--gallery-line);border-radius:8px;background:var(--gallery-panel);color:var(--gallery-ink);font-size:13px;font-weight:700;line-height:1.3;white-space:normal;text-align:center;text-decoration:none}
.studio-gallery-admin .studio-gallery-button:hover:not(:disabled),.studio-gallery-admin .studio-gallery-button:focus-visible{background:var(--gallery-red);border-color:var(--gallery-red);color:#fff}
.studio-gallery-admin .studio-gallery-primary{background:var(--gallery-red);border-color:var(--gallery-red);color:#fff}
.studio-gallery-admin .studio-gallery-primary:hover:not(:disabled){background:#b91b25;border-color:#b91b25;color:#fff}
.studio-gallery-admin :is(button,input,select):focus-visible{outline:2px solid var(--gallery-red);outline-offset:3px}
.studio-gallery-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:20px 0 16px}
.studio-gallery-tabs{display:flex;gap:4px;border-radius:9px;padding:4px;background:var(--gallery-soft)}
.studio-gallery-tabs button{border:0;border-radius:6px;min-height:38px;padding:8px 20px;background:transparent;color:var(--gallery-muted);font-size:13px;font-weight:700}
.studio-gallery-tabs button.is-active{background:#152132;color:#fff}
.studio-gallery-tabs button:hover:not(.is-active){color:var(--gallery-red);background:rgba(217,35,46,.06)}
.studio-gallery-filters{display:grid;grid-template-columns:minmax(220px,1fr) minmax(160px,.55fr) minmax(140px,.35fr);gap:12px;margin-bottom:12px}
.studio-gallery-filters.is-categories{grid-template-columns:1fr}
.studio-gallery-filters label{display:block;min-width:0}
.studio-gallery-admin :is(input[type=text],input[type=search],input[type=number],select.browser-default){box-sizing:border-box;display:block;width:100%;min-width:0;height:44px;border:1px solid var(--gallery-line);border-radius:7px;background:var(--gallery-panel);color:var(--gallery-ink);margin:0;padding:9px 12px;box-shadow:none;font-size:14px;line-height:1.4}
.studio-gallery-admin input::placeholder{color:var(--gallery-muted);opacity:.9}
.studio-gallery-admin select.browser-default{appearance:auto;-webkit-appearance:menulist;padding-right:28px}
.studio-gallery-admin .studio-gallery-help{color:var(--gallery-muted);font-size:12px;max-width:950px;margin:0 0 22px}
.studio-gallery-feedback{padding:12px 15px;border-radius:8px;border:1px solid var(--gallery-line);font-size:13px;overflow-wrap:anywhere;margin:12px 0!important}
.studio-gallery-feedback.is-error{color:#a21a27;background:#fff1f2;border-color:#f4c4ca}
.studio-gallery-feedback.is-success{color:#1c6b4c;background:#edf9f3;border-color:#c8e8d8}
.studio-gallery-feedback.is-notice{color:#7d5a13;background:#fff9e8;border-color:#ebd9a6}
.studio-gallery-loading{padding:30px;color:var(--gallery-muted);text-align:center}
.studio-gallery-admin-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.studio-gallery-card{min-width:0;overflow:hidden;background:var(--gallery-panel);border:1px solid var(--gallery-line);border-radius:12px}
.studio-gallery-card-image{height:174px;background:var(--gallery-soft);display:flex;align-items:center;justify-content:center;padding:22px}
.studio-gallery-card-image img{display:block;width:100%;height:100%;object-fit:contain}
.studio-gallery-card.is-inactive .studio-gallery-card-image{opacity:.56}
.studio-gallery-card-body{padding:14px 15px 12px}
.studio-gallery-card-category{display:flex;justify-content:space-between;gap:12px;color:var(--gallery-muted);font-size:10px;line-height:1.4}
.studio-gallery-card-category span:first-child{overflow-wrap:anywhere}
.studio-gallery-card-category span:last-child{flex-shrink:0}
.studio-gallery-card h3{font-size:16px;font-weight:700;color:var(--gallery-ink);margin:6px 0 14px;line-height:1.4;overflow-wrap:anywhere}
.studio-gallery-card-controls{display:flex;justify-content:space-between;align-items:center;gap:7px;border-top:1px solid var(--gallery-line);padding-top:11px}
.studio-gallery-card-controls>div{display:flex;gap:11px}
.studio-gallery-admin .studio-gallery-check{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--gallery-ink);cursor:pointer;min-height:28px}
.studio-gallery-admin .studio-gallery-check input[type=checkbox]{position:static!important;opacity:1!important;pointer-events:auto!important;appearance:auto;-webkit-appearance:checkbox;display:block;width:17px;height:17px;min-width:17px;margin:0;accent-color:var(--gallery-red)}
.studio-gallery-admin .studio-gallery-check span{padding:0;line-height:1.5;height:auto;font-size:12px;color:inherit}
.studio-gallery-admin .studio-gallery-check span{pointer-events:none}
.studio-gallery-admin .studio-gallery-check span:before,.studio-gallery-admin .studio-gallery-check span:after{display:none!important;content:none!important}
.studio-gallery-admin .studio-gallery-link{display:inline-flex;align-items:center;justify-content:center;padding:4px 0;min-height:30px;border:0;background:transparent;color:var(--gallery-ink);font-size:12px;font-weight:700;text-decoration:none}
.studio-gallery-admin .studio-gallery-link:hover,.studio-gallery-admin .studio-gallery-link:focus-visible{color:var(--gallery-red);background:transparent}
.studio-gallery-admin .studio-gallery-link.is-danger{color:#bc2938}
.studio-gallery-card .studio-gallery-hidden-note{font-size:11px;color:#a06020;margin:-7px 0 10px}
.studio-gallery-category-list{display:flex;flex-direction:column;gap:10px}
.studio-gallery-category-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:22px;align-items:center;padding:18px 20px;border:1px solid var(--gallery-line);border-radius:10px;background:var(--gallery-panel)}
.studio-gallery-category-title h3{font-size:16px;line-height:1.4;font-weight:700;color:var(--gallery-ink);overflow-wrap:anywhere}
.studio-gallery-category-title p{font-size:12px;color:var(--gallery-muted);margin-top:4px}
.studio-gallery-category-actions{display:flex;align-items:center;gap:16px}
.studio-gallery-category-actions .studio-gallery-button{min-height:35px;padding:7px 13px}
.studio-gallery-empty{padding:45px 20px;text-align:center;border:1px dashed var(--gallery-line);border-radius:12px;background:var(--gallery-panel);color:var(--gallery-muted)}
.studio-gallery-empty h3{font-size:19px;line-height:1.3;color:var(--gallery-ink);margin-bottom:9px;font-weight:700}
.studio-gallery-empty p{font-size:13px}
.studio-gallery-more{display:flex;justify-content:center;margin-top:20px}
body.studio-gallery-dialog-open{overflow:hidden}
.studio-gallery-backdrop{position:fixed;inset:0;z-index:18000;background:rgba(13,22,35,.58);display:flex;align-items:center;justify-content:center;padding:24px;overflow:auto;overscroll-behavior:contain}
.studio-gallery-dialog{width:min(100%,790px);max-height:calc(100dvh - 48px);overflow:auto;background:var(--gallery-panel);color:var(--gallery-ink);border:1px solid var(--gallery-line);border-radius:15px;box-shadow:0 25px 85px rgba(0,0,0,.22);padding:24px;overscroll-behavior:contain}
.studio-gallery-dialog>header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:20px}
.studio-gallery-dialog h3{font-size:23px;font-weight:750;line-height:1.25;color:var(--gallery-ink);margin-top:3px}
.studio-gallery-admin .studio-gallery-close{border:1px solid var(--gallery-line);background:var(--gallery-soft);color:var(--gallery-ink);border-radius:7px;min-width:36px;height:36px;font-size:25px;line-height:1;padding:0;flex-shrink:0}
.studio-gallery-admin .studio-gallery-close:hover{background:var(--gallery-red);color:#fff;border-color:var(--gallery-red)}
.studio-gallery-editor-grid{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:25px}
.studio-gallery-fields{min-width:0}
.studio-gallery-fields>label:not(.studio-gallery-check){display:block;font-size:12px;font-weight:650;color:var(--gallery-ink);margin:0 0 6px}
.studio-gallery-fields>label:not(:first-child):not(.studio-gallery-check){margin-top:16px}
.studio-gallery-fields>label span{font-weight:400;color:var(--gallery-muted)}
.studio-gallery-active-field{margin:18px 0 7px}
.studio-gallery-editor-preview{height:220px;display:flex;align-items:center;justify-content:center;padding:22px;border-radius:9px;border:1px solid var(--gallery-line);background-color:var(--gallery-soft);background-image:linear-gradient(45deg,rgba(155,165,175,.1) 25%,transparent 25%),linear-gradient(-45deg,rgba(155,165,175,.1) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(155,165,175,.1) 75%),linear-gradient(-45deg,transparent 75%,rgba(155,165,175,.1) 75%);background-size:18px 18px;background-position:0 0,0 9px,9px -9px,-9px 0;margin-bottom:12px}
.studio-gallery-editor-preview img{width:100%;height:100%;object-fit:contain;display:block}
.studio-gallery-editor-preview span{font-size:13px;color:var(--gallery-muted);text-align:center}
.studio-gallery-admin .studio-gallery-file-picker{position:relative;display:flex;width:100%;overflow:hidden;cursor:pointer}
.studio-gallery-file-picker input[type=file]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;margin:0;font-size:16px}
.studio-gallery-file-picker:focus-within{outline:2px solid var(--gallery-red);outline-offset:3px}
.studio-gallery-file-name{font-size:12px;overflow-wrap:anywhere;color:var(--gallery-ink);margin-top:8px!important}
.studio-gallery-file-help,.studio-gallery-field-hint{font-size:11px;line-height:1.55;color:var(--gallery-muted);margin:8px 0 0!important}
.studio-gallery-dialog-actions{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid var(--gallery-line);padding-top:18px;margin-top:24px}
.studio-gallery-confirm{max-width:490px}
.studio-gallery-confirm>p{font-size:14px;line-height:1.7;color:var(--gallery-muted);margin-top:14px;overflow-wrap:anywhere}
.studio-gallery-sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.studio-gallery-admin-open .backend>header{display:block;box-sizing:border-box;height:80px;min-height:0;padding:10px 20px 10px 270px;background:#f0f0f0}
.studio-gallery-admin-open .backend>header nav{height:60px;line-height:60px;width:100%;border-radius:7px;box-shadow:none}
.studio-gallery-admin-open .backend>header nav>.row{margin:0}.studio-gallery-admin-open .backend>header nav>.row>.col{padding:0}
.studio-gallery-admin-open .backend>header .nav-wrapper>.col{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;padding:0 14px}
.studio-gallery-admin-open .backend>header [ncy-breadcrumb]{flex:1;min-width:0;overflow:hidden;white-space:nowrap}
.studio-gallery-admin-open .backend>header .breadcrumb{max-width:100%;float:none;white-space:nowrap;text-align:left;font-size:15px}
.studio-gallery-admin-open .backend>header #right-content{position:static;flex:none;display:flex;align-items:center;line-height:60px}
.studio-gallery-admin-open .backend>header #right-content .frontend{white-space:nowrap;font-size:13px}
@media(max-width:992px){.studio-gallery-admin-open .backend>header{padding:10px 14px}.studio-gallery-admin-open .backend>header .nav-wrapper>.col{padding-left:40px}}
@media(max-width:620px){.studio-gallery-admin-open .backend>header .breadcrumb li:not(:last-child){display:none}.studio-gallery-admin-open .backend>header .breadcrumb{font-size:14px}.studio-gallery-admin-open .backend>header #right-content .frontend{font-size:12px;margin-right:6px}}
body.dyo-dark.studio-gallery-admin-open .backend>header{background:#1b1e27}
body.dyo-dark.studio-gallery-admin-open .backend{background:#080d15}
body.dyo-dark .studio-gallery-admin{--gallery-ink:#f7f9fc;--gallery-muted:#a7b4c4;--gallery-line:#334052;--gallery-panel:#0b111a;--gallery-soft:#182231}
body.dyo-dark .studio-gallery-tabs button.is-active{background:#d9232e;color:#fff}
body.dyo-dark .studio-gallery-unsaved,body.dyo-dark .studio-gallery-hidden-note{color:#f1bc73}
body.dyo-dark .studio-gallery-feedback.is-error{background:#34171e;color:#ffb9bf;border-color:#6a2a36}
body.dyo-dark .studio-gallery-feedback.is-success{background:#12352b;color:#a7e8c7;border-color:#2e6150}
body.dyo-dark .studio-gallery-feedback.is-notice{background:#332b19;color:#f4d58e;border-color:#63512a}
body.dyo-dark .studio-gallery-admin .studio-gallery-link.is-danger{color:#ff8e99}
@media(min-width:1700px){.studio-gallery-admin-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1150px){.studio-gallery-admin-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.studio-gallery-filters{grid-template-columns:minmax(180px,1fr) minmax(140px,.65fr)}.studio-gallery-filters>label:first-child{grid-column:1/-1}}
@media(max-width:600px){.studio-gallery-admin{margin:18px 0 35px}.studio-gallery-heading{display:block}.studio-gallery-heading h2{font-size:27px}.studio-gallery-header-actions{margin-top:16px}.studio-gallery-header-actions button{flex:1}.studio-gallery-toolbar{gap:8px}.studio-gallery-tabs button{padding:8px 11px;font-size:12px}.studio-gallery-toolbar>.studio-gallery-button{padding:10px 11px;font-size:12px}.studio-gallery-filters{grid-template-columns:1fr}.studio-gallery-admin :is(input[type=text],input[type=search],input[type=number],select.browser-default){font-size:16px}.studio-gallery-admin-grid{gap:12px}.studio-gallery-card-image{height:135px;padding:17px}.studio-gallery-card-body{padding:11px}.studio-gallery-card-category{display:block}.studio-gallery-card-category span{display:block}.studio-gallery-card h3{font-size:15px}.studio-gallery-card-controls{flex-wrap:wrap;gap:4px}.studio-gallery-card-controls>div{width:100%;justify-content:space-between}.studio-gallery-category-row{grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:15px}.studio-gallery-category-title{grid-column:1/-1}.studio-gallery-category-actions{justify-content:flex-end}.studio-gallery-category-actions .studio-gallery-button{min-height:38px}.studio-gallery-backdrop{padding:12px}.studio-gallery-dialog{padding:18px;max-height:calc(100dvh - 24px);border-radius:12px}.studio-gallery-editor-grid{grid-template-columns:1fr;gap:20px}.studio-gallery-editor-preview{height:170px}.studio-gallery-dialog h3{font-size:22px}.studio-gallery-dialog-actions>.studio-gallery-button{flex:1;min-width:0}.studio-gallery-help{font-size:11px!important}}
@media(max-width:600px){.studio-gallery-admin{padding:0 14px}}
@media(max-width:360px){.studio-gallery-admin-grid{grid-template-columns:1fr}.studio-gallery-card-image{height:180px}.studio-gallery-card-controls{flex-wrap:nowrap}.studio-gallery-card-controls>div{width:auto;gap:14px}.studio-gallery-toolbar{flex-wrap:wrap}.studio-gallery-toolbar>.studio-gallery-button{margin-left:auto}.studio-gallery-dialog{padding:15px}.studio-gallery-dialog-actions .studio-gallery-button{padding-left:10px;padding-right:10px;font-size:12px}}
