.article-gallery-editor,.article-gallery-manage{max-width:1160px;margin:24px auto;padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--surface);box-shadow:0 2px 7px #16212d08}.article-gallery-editor h2,.article-gallery h2{margin:6px 0 12px}.article-gallery-editor>label{display:grid;gap:8px;margin:18px 0;max-width:560px;font-weight:700}.article-gallery-editor input:not([type=checkbox]),.article-gallery-editor select{width:100%;min-width:0;min-height:44px;border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--surface);color:var(--ink)}.gallery-editor-photos{display:grid;gap:16px}.gallery-editor-photo{display:grid;grid-template-columns:132px minmax(0,1fr);gap:18px;padding:16px;border:1px solid var(--line);border-radius:14px}.gallery-editor-photo>img{width:132px;height:112px;object-fit:contain;border-radius:10px;background:var(--neutral)}.gallery-editor-photo label{display:grid;gap:6px;margin:0 0 12px}.gallery-editor-photo .gallery-keep{display:flex;align-items:center;gap:10px}.gallery-keep input{width:20px;height:20px;accent-color:var(--brand)}.gallery-order,.gallery-controls{display:flex;gap:10px;align-items:center;justify-content:center;flex-wrap:wrap}.gallery-order{justify-content:flex-start}.gallery-order button,.gallery-controls button{min-width:44px;min-height:44px}.gallery-storage-note{font-size:14px;color:var(--muted)}.gallery-local-preview{margin-top:20px;padding:18px;background:var(--neutral);border-radius:14px}.gallery-local-preview [data-preview-image]{height:340px;display:grid;place-items:center}.gallery-local-preview img{max-width:100%;max-height:340px;object-fit:contain}.article-gallery{scroll-margin-top:110px;margin:32px 0 0;padding-top:24px;border-top:1px solid var(--line)}.article-gallery figure{margin:0 0 18px}.article-gallery figure[hidden]{display:none}.article-gallery-slides img{display:block;max-width:100%;height:auto;margin:auto}.article-gallery.is-enhanced .article-gallery-slides{background:var(--neutral);border-radius:16px;overflow:hidden}.article-gallery.is-enhanced .article-gallery-slides img{width:100%;height:min(58vw,580px);object-fit:contain}.article-gallery figcaption{padding:14px 18px;color:var(--muted);font-size:15px;text-align:center;overflow-wrap:anywhere}.gallery-controls{margin:16px 0}.gallery-thumbnails{display:flex;gap:10px;overflow-x:auto;padding:4px 3px 10px}.gallery-thumbnails button{padding:3px;background:var(--surface);border:2px solid var(--line);border-radius:10px;flex:0 0 86px;min-height:66px}.gallery-thumbnails button[aria-current=true]{border-color:var(--accent)}.gallery-thumbnails img{display:block;width:76px;height:58px;object-fit:cover;border-radius:6px}.article-gallery button:focus-visible{outline:3px solid var(--focus);outline-offset:3px}.article-gallery-manage>h1{font-size:clamp(26px,4vw,42px);overflow-wrap:anywhere}.article-gallery-manage .article-gallery-editor{box-shadow:none;margin:24px 0}.article-gallery-manage{width:calc(100% - 32px)}.article-gallery [hidden],.article-gallery-editor [hidden]{display:none!important}@media(max-width:600px){.article-gallery-editor{padding:18px}.gallery-editor-photo{grid-template-columns:1fr;padding:14px}.gallery-editor-photo>img{width:100%;height:160px}.gallery-local-preview [data-preview-image],.gallery-local-preview img{height:220px;max-height:220px}.article-gallery.is-enhanced .article-gallery-slides img{height:300px}.article-gallery-manage{padding:16px}.article-gallery-manage .article-gallery-editor{padding:0;border:0}}

.article-gallery-editor:has(.gallery-toggle input:not(:checked))>.gallery-config{display:none}
.article-gallery-editor>.gallery-toggle{display:flex;align-items:center;gap:14px;margin:0;cursor:pointer;padding:6px 0}
.gallery-toggle input{width:22px;height:22px;flex:0 0 22px;accent-color:var(--brand)}
.gallery-toggle span{display:grid;gap:4px}.gallery-toggle small{color:var(--muted);font-weight:400}
.gallery-config{border:0;padding:20px 0 0;margin:0;min-width:0;display:grid;gap:18px}
.gallery-disable-note{font-size:.85rem;color:var(--muted);margin:12px 0 0}
.article-gallery-editor:not(:has(.gallery-toggle input:not(:checked)))>.gallery-disable-note{display:none}
.gallery-upload input{width:100%;min-width:0}.gallery-upload input::file-selector-button{border:0;border-radius:8px;padding:10px 14px;margin-right:12px;background:var(--accent-soft);color:var(--accent);font:inherit;font-weight:700;cursor:pointer}
.gallery-config>label{display:grid;gap:8px;font-weight:700}.gallery-toggle input:focus-visible{outline:3px solid var(--focus);outline-offset:4px}.learning-editor-form>.article-gallery-editor{margin:16px 0;width:100%}
.article-gallery-editor input[type=checkbox]{width:22px;height:22px;min-height:22px;max-width:22px;padding:0;margin:0;flex:0 0 22px}
.article-gallery-editor .gallery-keep{justify-content:flex-start;min-height:44px}
.learning-create-card .article-gallery-editor,.learning-panel .article-gallery-editor{width:100%;margin:0}.article-gallery-editor{width:100%}
.article-gallery-editor:has(.gallery-toggle input:not(:checked)){background:transparent;border:0;box-shadow:none;padding:0;margin:16px 0}
.article-gallery-editor:has(.gallery-toggle input:not(:checked))>.gallery-toggle{padding:10px 0}