:root{--gallery-purple:#5c4de8;--gallery-ink:#232438;--gallery-muted:#717487;--gallery-line:#e6e5ef}
.gallery-page{margin:0;background:#f7f7fb;color:var(--gallery-ink);font:15px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif}
.gallery-page *,.sharing-dialog *{box-sizing:border-box}
.gallery-page button,.gallery-page input,.gallery-page select,.sharing-dialog button,.sharing-dialog input,.sharing-dialog select{font:inherit}
.gallery-page a,.sharing-dialog a{color:var(--gallery-purple);text-decoration:none}
.gallery-page button,.sharing-dialog button,.gallery-page select{min-height:40px;border:1px solid var(--gallery-line);border-radius:9px;background:#fff;padding:8px 15px;color:var(--gallery-ink);cursor:pointer}
.gallery-page button:disabled,.sharing-dialog button:disabled{opacity:.5;cursor:not-allowed}
.gallery-page :focus-visible,.sharing-dialog :focus-visible{outline:3px solid #aaa2ff;outline-offset:3px}
.gallery-page .primary,.sharing-dialog .primary{display:inline-flex;align-items:center;justify-content:center;min-height:44px;background:var(--gallery-purple);color:#fff;border:0;border-radius:10px;padding:10px 20px;font-weight:650;white-space:nowrap}
.gallery-page [hidden],.sharing-dialog [hidden]{display:none!important}
.gallery-header{height:70px;background:white;display:flex;align-items:center;justify-content:space-between;padding:0 max(24px,calc((100vw - 1280px)/2));border-bottom:1px solid var(--gallery-line);gap:16px}
.gallery-brand{font-size:18px;font-weight:750;color:var(--gallery-ink)!important;white-space:nowrap}
.gallery-account{display:flex;gap:16px;align-items:center;font-size:13px;min-width:0}.gallery-account span{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gallery-main{max-width:1280px;margin:auto;padding:42px 24px}.gallery-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:34px}.gallery-heading h1{font-size:32px;letter-spacing:-.7px;margin:6px 0 10px}.gallery-heading p{color:var(--gallery-muted);margin:0}.gallery-heading .eyebrow{color:var(--gallery-purple);font-size:13px;font-weight:650}
.gallery-tabs{display:flex;gap:8px;border-bottom:1px solid var(--gallery-line);margin-bottom:22px;padding-bottom:12px;overflow-x:auto}.gallery-tabs button{background:transparent;border-color:transparent;white-space:nowrap}.gallery-tabs [aria-pressed=true]{background:#ece9ff;color:var(--gallery-purple);font-weight:650}
.gallery-filters{display:flex;gap:10px;margin-bottom:24px}.gallery-filters label{flex:1}.gallery-filters input{width:100%;height:42px;border:1px solid var(--gallery-line);border-radius:10px;padding:0 14px}.gallery-notice{color:var(--gallery-muted);padding:8px 0}.gallery-notice:empty{display:none}
.gallery-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}.pattern-card{background:white;border:1px solid var(--gallery-line);border-radius:16px;overflow:hidden;min-width:0}.pattern-card>button{display:block;width:100%;text-align:left;border:0;padding:0;border-radius:0}.pattern-card .card-image{display:flex;height:240px;align-items:center;justify-content:center;padding:18px;background:repeating-conic-gradient(#eeedf3 0% 25%,#fafafd 0% 50%) 50%/18px 18px}.card-image img{max-width:100%;max-height:100%;object-fit:contain;image-rendering:pixelated}.pattern-card .card-copy{padding:16px}.card-copy h2{font-size:16px;margin:0 0 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-copy p{font-size:12px;color:var(--gallery-muted);margin:5px 0}.card-copy .card-meta{color:#55576e}.card-status{font-size:12px;display:inline-block;color:#705c16;background:#fff4d8;padding:3px 8px;border-radius:6px}.card-status.approved{color:#12705b;background:#e7f6f1}.load-more{display:block;margin:28px auto}.gallery-footnote{margin-top:40px;color:var(--gallery-muted);font-size:12px;text-align:center}
.gallery-detail,.sharing-dialog{border:1px solid var(--gallery-line);border-radius:18px;padding:24px;width:min(880px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;color:var(--gallery-ink);background:#fff;font:14px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif}
.gallery-detail::backdrop,.sharing-dialog::backdrop{background:#18152b88}.gallery-detail>header,.sharing-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.gallery-detail h2,.sharing-dialog h2{margin:0;font-size:21px;overflow-wrap:anywhere}.gallery-detail header button,.sharing-dialog header button{flex-shrink:0;font-size:22px;min-width:42px}
.detail-layout,.sharing-layout{display:grid;grid-template-columns:1fr 1fr;gap:26px}.detail-preview,.sharing-preview{display:flex;align-items:center;justify-content:center;min-height:220px;max-height:540px;aspect-ratio:1;background:repeating-conic-gradient(#eeedf3 0% 25%,#fafafd 0% 50%) 50%/18px 18px;border-radius:12px;padding:16px}.detail-preview img,.sharing-preview canvas{max-width:100%;max-height:100%;object-fit:contain;image-rendering:pixelated}.detail-meta{color:var(--gallery-muted)}.detail-license{font-size:12px;color:var(--gallery-muted);line-height:1.8}.detail-actions{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0}.detail-inventory{max-height:220px;overflow:auto}.inventory-row{display:flex;gap:10px;align-items:center;padding:6px 0;border-bottom:1px solid var(--gallery-line)}.inventory-row i{display:block;width:20px;height:20px;border:1px solid #0002;border-radius:4px}.inventory-row span:last-child{margin-left:auto}.detail-reason{white-space:pre-wrap;color:#93451e}.detail-report{display:grid;gap:10px;margin-top:15px}.detail-report textarea{min-height:90px;font:inherit;resize:vertical;width:100%;border:1px solid var(--gallery-line);border-radius:8px;padding:10px}
.sharing-dialog label:not(.sharing-consent){display:grid;gap:5px;margin:10px 0}.sharing-dialog input:not([type=checkbox]),.sharing-dialog select{width:100%;min-height:40px;border:1px solid var(--gallery-line);border-radius:8px;padding:8px 10px;background:#fff}.sharing-consent{display:flex;align-items:flex-start;gap:10px;font-size:12px}.sharing-consent input{flex-shrink:0;margin-top:4px}.sharing-privacy{font-size:12px;color:#38776c;background:#edf8f4;padding:12px;border-radius:9px}.sharing-summary{margin-top:0;color:var(--gallery-muted)}.sharing-session,.sharing-feedback{font-size:13px;overflow-wrap:anywhere}.sharing-login{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.sharing-login button{font-size:12px}.sharing-dialog form>.primary{width:100%}
.gallery-entry-row{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap;margin-top:12px}.gallery-entry-row button{border:0;background:none;color:#5c4de8;font:inherit;cursor:pointer;padding:8px}.gallery-share-button{width:100%;margin-top:10px;padding:12px;background:#f1efff;color:#5c4de8;border:1px solid #dbd5ff;border-radius:10px;cursor:pointer;font-weight:650}.gallery-share-button:disabled{opacity:.5;cursor:not-allowed}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:1000px){.gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){.gallery-header{padding:0 16px;height:58px}.gallery-account span{display:none}.gallery-main{padding:24px 16px}.gallery-heading{display:block;margin-bottom:24px}.gallery-heading h1{font-size:26px}.gallery-heading>.primary{margin-top:18px}.gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.pattern-card .card-image{height:190px;padding:10px}.pattern-card .card-copy{padding:12px}.gallery-filters{flex-wrap:wrap}.gallery-filters label{flex-basis:100%}.gallery-filters select{flex:1;min-width:0;font-size:13px}.gallery-detail,.sharing-dialog{padding:16px}.detail-layout,.sharing-layout{grid-template-columns:1fr;gap:16px}.detail-preview,.sharing-preview{min-height:160px;height:240px;max-height:35dvh;aspect-ratio:auto}.gallery-footnote{text-align:left}}
@media(max-width:380px){.pattern-card .card-image{height:150px}.gallery-account{gap:8px}.card-copy .card-meta{font-size:11px}}
.gallery-page,.sharing-dialog{font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif}
.detail-layout,.sharing-layout{grid-template-columns:repeat(2,minmax(0,1fr))}.detail-layout>*,.sharing-layout>*{min-width:0}
.sharing-preview canvas,.detail-preview img,.card-image img{width:100%;height:100%;object-fit:contain}
@media(max-width:720px){.detail-layout,.sharing-layout{grid-template-columns:1fr}.sharing-preview{height:160px;max-height:24dvh}}

/* Match the editor's readable control scale without changing gallery data flow. */
.gallery-page button,.sharing-dialog button,.gallery-page select { border-radius:10px; font-size:14px; font-weight:650; }
.gallery-page input,.sharing-dialog input:not([type=checkbox]),.sharing-dialog select { min-height:40px; font-size:14px; border-radius:10px; }
.sharing-dialog .sharing-login button { font-size:14px; }
.sharing-consent { font-size:13px; line-height:1.6; }
.sharing-consent input { width:18px; height:18px; }
.gallery-account a { display:inline-flex; min-height:40px; align-items:center; }
@media(max-width:900px) {
  .gallery-page button,.sharing-dialog button,.gallery-page select,.sharing-dialog select { min-height:44px; font-size:15px; }
  .gallery-page input,.sharing-dialog input:not([type=checkbox]) { min-height:44px; font-size:16px; }
  .gallery-account a { min-height:44px; }
  .sharing-dialog header button,.gallery-detail header button { min-width:44px; }
  .gallery-detail .detail-actions { display:grid; grid-template-columns:1fr; }
}
