body.theme-gallery-page {margin:0;min-height:100vh;display:block;background:radial-gradient(ellipse at 20% 0,rgba(37,92,72,.22),transparent 55%),#0b1118;color:#e5edf4;}
.theme-gallery-page * {box-sizing:border-box;}
.theme-gallery-shell {width:min(1440px,calc(100% - 40px));margin:auto;padding:44px 0 70px;}
.theme-gallery-intro {display:flex;justify-content:space-between;align-items:end;gap:26px;flex-wrap:wrap;margin-bottom:30px;}
.theme-gallery-eyebrow {font:600 .85rem/1.5 ui-monospace,monospace;color:#85bf9b;letter-spacing:.04em;margin:0 0 12px;}
.theme-gallery-page h1 {margin:0 0 16px;font-size:clamp(2.2rem,5vw,4rem);line-height:1.05;letter-spacing:-.045em;}
.theme-gallery-lead {max-width:66ch;line-height:1.7;color:#b6c4d1;margin:0;}
.theme-current {display:grid;gap:10px;padding:18px 20px;background:#111f25;border:1px solid #345647;border-radius:14px;min-width:230px;max-width:100%;}
.theme-current>span {font-size:.75rem;text-transform:uppercase;letter-spacing:.1em;color:#92bda4;}
.theme-current strong {font-size:1.05rem;}
.theme-current button {justify-self:start;background:none;border:0;color:#b5d3c3;padding:4px 0;cursor:pointer;font:inherit;text-decoration:underline;text-underline-offset:4px;}
.theme-controls {display:flex;gap:16px;align-items:end;flex-wrap:wrap;padding:20px;background:#111b26;border:1px solid #2d3d4b;border-radius:14px;}
.theme-controls[hidden] {display:none;}
.theme-controls label {display:grid;gap:8px;font-size:.85rem;flex:1 1 175px;color:#bfcbd6;}
.theme-controls label:first-child {flex:2 1 280px;}
.theme-controls input,.theme-controls select {width:100%;min-width:0;padding:11px 12px;background:#0b1420;border:1px solid #435463;border-radius:8px;color:#e9f1f9;font:inherit;min-height:44px;}
.theme-button {display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:9px 16px;background:#224b38;color:#d4f1df;border:1px solid #3e7756;border-radius:8px;cursor:pointer;font:650 .9rem/1.4 system-ui;}
.theme-button:hover {background:#2a6044;}
.theme-button.secondary {background:#192837;border-color:#405366;color:#d8e5f1;}
.theme-button.secondary:hover {background:#243a4f;}
.theme-button:disabled {opacity:.5;cursor:default;}
.theme-gallery-page :is(button,a,input,select):focus-visible {outline:2px solid #a8ddb9;outline-offset:4px;}
.theme-gallery-meta {display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:18px 0;color:#91a6b8;font-size:.85rem;}
.theme-gallery-meta p {margin:0;}
.theme-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;}
.theme-card {min-width:0;overflow:hidden;border:1px solid #2a3b48;border-radius:14px;background:#111c27;box-shadow:0 12px 30px rgba(0,0,0,.14);transition:border-color .15s;}
.theme-card:hover {border-color:#5c796a;}
.theme-card.is-current {border-color:#76b791;}
.theme-picture {position:relative;aspect-ratio:16/9;overflow:hidden;background:linear-gradient(135deg,#132d31,#26355c);}
.theme-picture>img {width:100%;height:100%;object-fit:cover;display:block;}
.theme-picture::after {content:"";position:absolute;inset:0;box-shadow:inset 0 -18px 32px rgba(0,0,0,.18);pointer-events:none;}
.theme-picture-button {position:absolute;inset:0;border:0;background:none;cursor:pointer;z-index:2;}
.theme-picture-button:focus-visible {outline-offset:-5px!important;}
.theme-applied {position:absolute;top:12px;left:12px;z-index:3;pointer-events:none;padding:5px 10px;border:1px solid #79ba93;border-radius:999px;color:#c8f5d9;background:#102d20;font-size:.75rem;font-weight:700;}
.theme-applied[hidden] {display:none;}
.theme-sample-panels {position:absolute;width:35%;bottom:12%;display:grid;gap:6px;pointer-events:none;}
.theme-sample-panels.on-right {right:7%;}.theme-sample-panels.on-left {left:7%;}
.theme-sample-panels>span {display:block;border:1px solid var(--tile-accent,#729d82);border-radius:5px;background:var(--tile-panel,rgba(10,19,27,.83));padding:7px 9px;box-shadow:0 4px 8px rgba(0,0,0,.2);}
.theme-sample-panels i,.theme-sample-panels b {display:block;height:3px;background:#d9e4e8;border-radius:2px;opacity:.55;margin-bottom:4px;}
.theme-sample-panels i {width:45%;background:var(--tile-accent);opacity:1;height:4px;}.theme-sample-panels b:last-child {width:65%;margin:0;}
.theme-picture-blue {background:#063dbc;}.theme-blue-copy {display:block;color:white;white-space:pre-line;font:500 clamp(.8rem,1.5vw,1.1rem)/1.9 system-ui;padding:25px;}
.theme-picture-blue .theme-sample-panels {display:none;}
.theme-card-body {padding:18px;}.theme-category-label {color:#91a5b5;font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;margin:0 0 8px;}
.theme-card h2 {font-size:1.1rem;line-height:1.4;margin:0 0 18px;min-height:3.1em;color:#edf4f8;}
.theme-card-actions {display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.theme-status {min-height:1.6em;color:#b7dec5;font-size:.95rem;line-height:1.6;margin:20px 0;}
.theme-empty {padding:30px;background:#14202d;border:1px solid #415262;border-radius:12px;color:#c7d4df;}.theme-empty[hidden] {display:none;}
.theme-gallery-footer {border-top:1px solid #293c47;margin-top:36px;padding-top:22px;color:#92a9b8;font-size:.9rem;line-height:1.7;}
.theme-gallery-footer a {color:#b1d9c0;}
.theme-preview-dialog {position:fixed;inset:0;width:min(1600px,calc(100vw - 32px));height:calc(100dvh - 32px);max-width:none;max-height:none;padding:0;background:#0a111b;color:#e6eef7;border:1px solid #466052;border-radius:14px;margin:auto;overflow:hidden;z-index:2147483647;}
.theme-preview-dialog:not([open]) {display:none;}
.theme-preview-dialog[open] {display:flex;flex-direction:column;}
.theme-preview-dialog::backdrop {background:rgba(0,0,0,.85);}
.theme-preview-toolbar {padding:14px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border-bottom:1px solid #314453;flex-shrink:0;}
.theme-preview-toolbar h2 {font-size:1.1rem;margin:0;line-height:1.5;}.theme-preview-toolbar p {margin:5px 0 0;font-size:.8rem;color:#a4b7c7;max-width:70ch;}
.theme-preview-actions {display:flex;gap:10px;flex-wrap:wrap;}.theme-preview-actions button[aria-pressed="true"] {border-color:#9ce0b2;color:#cbf6da;}
.theme-preview-stage {position:relative;flex:1;min-height:0;display:flex;justify-content:center;overflow:hidden;background:#020609;}
.theme-preview-stage iframe {display:block;width:100%;height:100%;border:0;background:#0b1118;pointer-events:none;}
.theme-preview-stage.is-phone iframe {width:390px;max-width:100%;border-inline:1px solid #3c4b56;}
@media(min-width:1500px) {.theme-grid {grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(max-width:1000px) {.theme-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:540px) {.theme-gallery-shell {width:calc(100% - 24px);padding-top:28px;}.theme-grid {grid-template-columns:minmax(0,1fr);gap:18px;}.theme-current {width:100%;}.theme-controls {padding:16px;}.theme-controls label {flex-basis:100%;}.theme-card h2 {min-height:0;}.theme-preview-dialog {width:100vw;height:100dvh;border:0;border-radius:0;}.theme-preview-toolbar {padding:12px;}.theme-preview-actions {width:100%;}.theme-preview-actions button {flex:1;min-width:85px;padding:9px;}.theme-preview-toolbar p {font-size:.75rem;}}
@media(prefers-reduced-motion:reduce) {.theme-card {transition:none;}}
.theme-picture.image-unavailable::before {content:attr(data-icon);position:absolute;inset:0;display:grid;place-items:center;font-size:4rem;}

/* The gallery's own painting studio; independent of the saved site theme. */
body.theme-gallery-page {isolation:isolate;background:#0b1118;}
body.theme-gallery-page::before {content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(90deg,rgba(5,9,14,.08),rgba(5,9,14,.22) 34%,rgba(5,9,14,.66) 65%,rgba(5,9,14,.76)),url('/themes/assets/tux-painting-studio.webp') center center/cover no-repeat;}
.theme-gallery-intro {padding:24px;border:1px solid rgba(135,161,148,.25);border-radius:16px;background:rgba(10,19,24,.82);box-shadow:0 14px 36px rgba(0,0,0,.18);}
.theme-gallery-intro h1 {text-shadow:0 2px 12px rgba(0,0,0,.35);}
.theme-controls {background:rgba(17,27,38,.94);}
.theme-card {background:rgba(17,28,39,.95);}
.theme-gallery-meta {padding:12px 16px;border-radius:10px;background:rgba(10,19,26,.85);color:#c1cfd8;}
.theme-gallery-footer {padding:20px;border-radius:12px;background:rgba(10,19,26,.88);}
@media(min-width:1440px) {.theme-gallery-shell {width:min(1180px,calc(100% - clamp(420px,35vw,690px) - 56px));margin-left:auto;margin-right:28px;}.theme-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(min-width:2300px) {.theme-grid {grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:1439px) {body.theme-gallery-page::before {background-image:linear-gradient(rgba(5,9,14,.56),rgba(5,9,14,.74)),url('/themes/assets/tux-painting-studio.webp');}}
@media(max-width:740px) {body.theme-gallery-page::before {background-position:28% center;}.theme-gallery-intro {padding:20px;}}
.theme-picture>img.theme-scene-character {position:absolute;left:16%;bottom:8%;width:23%;height:auto;object-fit:contain;pointer-events:none;}
.theme-picture>img.theme-fire-poster {position:absolute;left:39.65%;top:40.35%;width:21.4%;height:22%;object-fit:cover;mix-blend-mode:screen;filter:saturate(.82) brightness(.9);-webkit-mask-image:radial-gradient(ellipse 65% 75% at 50% 54%,#000 50%,transparent 95%);mask-image:radial-gradient(ellipse 65% 75% at 50% 54%,#000 50%,transparent 95%);pointer-events:none;}

.theme-sample-panels.on-center {left:18%;right:18%;width:auto;grid-template-columns:repeat(3,minmax(0,1fr));}
