/* NiceUI Shader Studio. Layout shared with Pattern Maker (.pm-*) plus .ss-* bits. */
.ss-root { min-height: calc(100dvh - var(--ap-bar, 52px)); }
.ss [hidden] { display: none !important; }
.ss { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100vh - var(--ap-bar, 52px)); height: calc(100dvh - var(--ap-bar, 52px)); }
.ss-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; padding: 14px; }
.ss-stage { position: relative; min-height: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-2); background: #000; isolation: isolate; }
.ss-stage > div:first-child { position: absolute; inset: 0; }
.ss-card { z-index: 2; pointer-events: none; }
.ss-card .pm-card-p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ss-stage .pm-stage-bar { z-index: 3; }
.ss-types { grid-auto-columns: 96px; }
.ss-sw { position: relative; overflow: hidden; background: linear-gradient(135deg, #1e1b4b, #0c4a6e); }
.ss-sw img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ss-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-presets button { height: 30px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--mute); }
.ss-presets button[aria-pressed="true"] { background: var(--sky); border-color: var(--sky); color: var(--sky-ink); }
.ss-field { display: grid; gap: 7px; margin-top: 10px; }
.ss-field:first-of-type { margin-top: 4px; }
.ss-inline { grid-template-columns: 1fr auto; align-items: center; }
.ss-lab { font-size: 12.5px; color: var(--mute); }
.ss-lab i { font-style: normal; font: 500 10.5px var(--mono); opacity: .7; margin-left: 4px; }
.ss-colors { display: grid; gap: 6px; }
.ss-color { display: flex; align-items: center; gap: 6px; }
.ss-color input[type="color"] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; flex: none; }
.ss-hex { width: 100%; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--s1); color: var(--text); font: 12px var(--mono); }
.ss-inline .ss-color { width: 150px; }
.ss-x { width: 26px; height: 30px; flex: none; border-radius: 8px; color: var(--mute); font-size: 16px; }
.ss-x:hover { color: var(--text); background: var(--s3); }
.ss-add { justify-self: start; }
.ss-select { height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--s1); color: var(--text); font-size: 12.5px; }
.ss-check input { accent-color: var(--sky); width: 16px; height: 16px; }
.ss-field .gm-seg button { font-size: 12px; padding: 0 2px; }
.ss-imgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ss-img { position: relative; aspect-ratio: 1; border-radius: 9px; border: 1px solid var(--line-2); overflow: hidden; display: grid; place-items: center; font-size: 11.5px; color: var(--mute); cursor: pointer; background: var(--s1); }
.ss-img img { width: 100%; height: 100%; object-fit: cover; }
.ss-img-logo { background: #e5e7eb; }
.ss-img-logo img { object-fit: contain; padding: 6px; }
.ss-img[aria-pressed="true"], .ss-img.on { border-color: var(--sky); box-shadow: 0 0 0 1px var(--sky); color: var(--text); }
.ss-img-up input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ss-credit { font-size: 11.5px; color: var(--mute); padding: 2px 4px 6px; }
.ss-credit a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.ss-export-note { font-size: 11.5px; }
.ss-list { display: grid; gap: 6px; padding-left: 18px; font-size: 14px; }
.ss-noscript { padding: 40px; text-align: center; color: var(--mute); }
@media (max-width: 1000px) {
  .ss { height: auto; grid-template-columns: 1fr; }
  .ss-main { grid-template-rows: auto auto; }
  .ss-stage { height: 56vh; }
}

/* shared with Pattern Maker */
.pm-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; padding: 14px; }
.pm-stage-unused { position: relative; min-height: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-2); background-color: #020617; isolation: isolate; }
.pm-stage.pm-transparent { background-image: conic-gradient(#1c1e22 25%, #121316 0 50%, #1c1e22 0 75%, #121316 0); background-size: 20px 20px; }
html[data-theme="light"] .pm-stage.pm-transparent { background-image: conic-gradient(#eceef1 25%, #fff 0 50%, #eceef1 0 75%, #fff 0); }
.pm-layer { position: absolute; inset: 0; }
.pm-card { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); padding: 26px 26px 24px; border-radius: 18px; border: 1px solid rgba(255,255,255,.12); background: rgba(6,7,8,.62); backdrop-filter: blur(14px); color: #f3f4f6; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.pm-card-tag { font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #7dd3fc; }
.pm-card-h { margin-top: 10px; font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.pm-card-p { margin-top: 8px; font-size: 13.5px; color: #a3a8b0; }
.pm-card-btn { display: inline-flex; margin-top: 18px; padding: 8px 14px; border-radius: 999px; background: #f3f4f6; color: #000; font-size: 13px; font-weight: 500; }
.pm-stage-bar { position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pm-toggle { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 10px; background: rgba(0,0,0,.55); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: rgba(255,255,255,.85); cursor: pointer; }
.pm-toggle input { accent-color: var(--sky); }
.pm-toggle-s { height: 28px; padding: 0 8px; background: transparent; backdrop-filter: none; border-color: var(--line-2); color: var(--mute); }
.pm-chip { height: 32px; padding: 0 12px; border-radius: 10px; background: #fff; color: #000; font-size: 12.5px; font-weight: 500; }
.pm-chip:active { transform: scale(.97); }
.pm-canvas { display: block; width: 100%; height: 100%; }
.pm-strip { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: stretch; min-width: 0; }
.pm-cats { display: grid; grid-auto-rows: 1fr; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--s1); }
.pm-cats button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; border-radius: 8px; font-size: 12px; color: var(--mute); white-space: nowrap; }
.pm-cats button i { font-style: normal; font: 500 10px var(--mono); color: var(--dim, var(--mute)); opacity: .7; }
.pm-cats button[aria-pressed="true"] { background: var(--s3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.pm-types { display: grid; grid-auto-flow: column; grid-auto-columns: 86px; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.pm-type { display: grid; gap: 6px; padding: 5px 5px 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--s1); text-align: left; transition: border-color .2s; }
.pm-type:hover { border-color: var(--line-3); }
.pm-type[aria-checked="true"] { border-color: var(--sky); box-shadow: 0 0 0 1px var(--sky); }
.pm-type-sw { display: block; height: 44px; border-radius: 8px; }
.pm-type b { padding: 0 2px; font-size: 11px; font-weight: 500; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-type[aria-checked="true"] b { color: var(--text); }
.pm-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--s1); }
.pm-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.pm-scroll .gm-card { background: var(--s2); }
.pm-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pm-presets .gm-preset { padding: 4px 4px 6px; border-radius: 10px; }
.pm-presets .gm-preset span { aspect-ratio: 4 / 3; border-radius: 7px; }
.pm-presets .gm-preset b { font-size: 11.5px; padding: 2px 2px 0; }
.pm-bgrow { display: inline-flex; align-items: center; gap: 8px; }
.pm-seg5 { grid-template-columns: repeat(5, 1fr); }
.pm-seg5 button { font-size: 12px; }
.pm-export { display: grid; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: var(--s1); }
.pm-export .gm-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.pm-export .gm-code { max-height: 150px; }
.pm-export .gm-actions .btn-cmd { padding: 0 12px; }
@media (max-width: 1000px) {
  .pm { height: auto; grid-template-columns: 1fr; }
  .pm-main { grid-template-rows: auto auto; }
  .pm-stage-unused { height: 56vh; }
  .pm-side { border-left: 0; border-top: 1px solid var(--line); }
  .pm-scroll { overflow: visible; }
  .pm-export { position: sticky; bottom: 0; z-index: 5; }
}
@media (max-width: 640px) {
  .pm-strip { grid-template-columns: 1fr; }
  .pm-cats { grid-auto-rows: auto; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .pm-cats button { height: 32px; justify-content: center; }
}
@media (max-width: 480px) {
  .pm-card { padding: 20px; }
  .pm-card-h { font-size: 20px; }
  .pm-seg5 button { font-size: 11px; padding: 0 2px; }
}
.pm-light .pm-card { background: rgba(255,255,255,.72); border-color: rgba(0,0,0,.08); color: #0b0c0e; box-shadow: 0 30px 70px -30px rgba(15,23,42,.35); }
.pm-light .pm-card-tag { color: #0284c7; }
.pm-light .pm-card-p { color: #5c616a; }
.pm-light .pm-card-btn { background: #0b0c0e; color: #fff; }
