/* Oct 30 (t1317u/t1318u): custom colour picker everywhere — square fields, 2px buttons */
.gx-sv, .gx-hue, .gx.gx-v2 .gx-bar, .gx.gx-v2 .gx-sw, .gx.gx-v2 .gx-hex, .gx.gx-v2 .gx-chip { border-radius: 0 !important; }
.gx-hue-dot { border-radius: 0; } .gx-sv-dot { border-radius: 0; width: calc(16px * var(--ui, 1)); height: calc(16px * var(--ui, 1)); margin: calc(-8px * var(--ui, 1)) 0 0 calc(-8px * var(--ui, 1)); border-width: 2px; }
.gx-hex-ed { border-radius: 2px; }
html:not(.phone) .gx.gx-v2 .gx-bar { height: calc(30px * var(--ui, 1)) !important; }
html:not(.phone) .gx-sv { aspect-ratio: auto; height: calc(120px * var(--ui, 1)); }
html:not(.phone) .gx-hue { height: calc(16px * var(--ui, 1)); margin: calc(4px * var(--ui, 1)) 0; } html:not(.phone) .gx-hue-dot { height: calc(22px * var(--ui, 1)); width: calc(12px * var(--ui, 1)); margin: calc(-11px * var(--ui, 1)) 0 0 calc(-6px * var(--ui, 1)); border-width: 2px; }
html:not(.phone) .gx.gx-v2 .gx-edit { grid-template-columns: calc(30px * var(--ui, 1)) 1fr auto; gap: calc(8px * var(--ui, 1)); }
html:not(.phone) .gx.gx-v2 .gx-sw { width: calc(30px * var(--ui, 1)) !important; height: calc(30px * var(--ui, 1)) !important; }
html:not(.phone) .gx.gx-v2 .gx-hex, html:not(.phone) .gx-hex-ed { height: calc(30px * var(--ui, 1)); font-size: calc(12px * var(--ui, 1)); }
html:not(.phone) .gx.gx-v2 .gx-chip { min-height: calc(20px * var(--ui, 1)); }
html:not(.phone) .gx.gx-v2 .gx-swatches { gap: calc(6px * var(--ui, 1)) !important; }
.color-pill-pop { display: inline-flex; align-items: center; gap: calc(8px * var(--ui, 1)); height: calc(30px * var(--ui, 1)); padding: 0 calc(10px * var(--ui, 1)) 0 calc(4px * var(--ui, 1)); border: 1px solid rgba(255,255,255,.16); border-radius: 0; background: rgba(255,255,255,.03); color: #fff; font: 500 calc(12px * var(--ui, 1))/1 var(--mono, ui-monospace, monospace); letter-spacing: .05em; cursor: pointer; }
.color-pill-pop i { width: calc(22px * var(--ui, 1)); height: calc(22px * var(--ui, 1)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.color-pill-pop:hover { border-color: rgba(255,255,255,.4); }
.cpop { position: fixed; z-index: 2147483000; width: calc(248px * var(--ui, 1)); padding: calc(10px * var(--ui, 1)); border: 1px solid rgba(255,255,255,.18); border-radius: 0; background: #0b0b0d; box-shadow: 0 16px 40px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: calc(8px * var(--ui, 1)); }
.cpop[hidden] { display: none; }
.cpop .gx-sv { height: calc(140px * var(--ui, 1)); aspect-ratio: auto; max-height: none; }
.cpop .gx-hue { height: calc(14px * var(--ui, 1)); margin: 2px 0; } .cpop .gx-hue-dot { height: calc(20px * var(--ui, 1)); width: calc(10px * var(--ui, 1)); margin: calc(-10px * var(--ui, 1)) 0 0 calc(-5px * var(--ui, 1)); border-width: 2px; }
.cpop-row { display: grid; grid-template-columns: calc(28px * var(--ui, 1)) 1fr auto; gap: calc(6px * var(--ui, 1)); align-items: center; }
.cpop-sw { width: calc(28px * var(--ui, 1)); height: calc(28px * var(--ui, 1)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.cpop-hex { height: calc(28px * var(--ui, 1)); min-width: 0; padding: 0 calc(8px * var(--ui, 1)); border: 1px solid rgba(255,255,255,.16); border-radius: 0; background: rgba(255,255,255,.03); color: #fff; font: 500 calc(12px * var(--ui, 1))/1 var(--mono, ui-monospace, monospace); letter-spacing: .05em; }
.cpop-ok { height: calc(28px * var(--ui, 1)); padding: 0 calc(10px * var(--ui, 1)); border: 1px solid #fff; border-radius: 2px; background: #fff; color: #000; font-size: calc(12px * var(--ui, 1)); font-weight: 600; cursor: pointer; }
.cpop-chips { display: grid !important; grid-template-columns: repeat(12, 1fr); gap: calc(3px * var(--ui, 1)); }
.cpop .gx-chip { aspect-ratio: 1; width: 100%; height: auto; padding: 0; border: 0; border-radius: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); cursor: pointer; }
.cpop .gx-chip.on { box-shadow: 0 0 0 1px #000, 0 0 0 2px #fff; }
.scheme-sw { display: flex; flex-direction: column; gap: calc(8px * var(--ui, 1)); }
/* t1321u: + New beside Browse */
#presetSel.pn-host { position: relative; display: flex; align-items: stretch; gap: calc(6px * var(--ui, 1)); }
#presetSel.pn-host > :first-child { flex: 1 1 auto; min-width: 0; }
.pn-new { flex: none; display: inline-flex; align-items: center; gap: calc(5px * var(--ui, 1)); padding: 0 calc(10px * var(--ui, 1)); min-height: calc(32px * var(--ui, 1)); border: 1px solid rgba(255,255,255,.22); border-radius: 2px; background: transparent; color: #fff; font-size: calc(12px * var(--ui, 1)); font-weight: 600; cursor: pointer; white-space: nowrap; }
.pn-new svg { width: calc(12px * var(--ui, 1)); height: calc(12px * var(--ui, 1)); } .pn-new:hover { border-color: #fff; }
.pn-pop { position: absolute; z-index: 60; top: calc(100% + calc(6px * var(--ui, 1))); right: 0; width: min(calc(280px * var(--ui, 1)), calc(100vw - calc(24px * var(--ui, 1)))); padding: calc(10px * var(--ui, 1)); border: 1px solid rgba(255,255,255,.18); border-radius: 0; background: #0b0b0d; box-shadow: 0 16px 40px rgba(0,0,0,.6); display: grid; gap: calc(8px * var(--ui, 1)); }
.pn-pop[hidden] { display: none; }
.pn-l { font: 600 calc(10px * var(--ui, 1))/1 var(--mono, ui-monospace, monospace); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.pn-in { height: calc(34px * var(--ui, 1)); padding: 0 calc(10px * var(--ui, 1)); border: 1px solid rgba(255,255,255,.18); border-radius: 0; background: rgba(255,255,255,.03); color: #fff; font-size: calc(13px * var(--ui, 1)); min-width: 0; }
html.phone .pn-in { font-size: calc(16px * var(--ui, 1)); height: calc(40px * var(--ui, 1)); }
.pn-in:focus { outline: none; border-color: #fff; }
.pn-acts { display: flex; gap: calc(6px * var(--ui, 1)); } .pn-acts button { flex: 1; height: calc(32px * var(--ui, 1)); border-radius: 2px; font-size: calc(12px * var(--ui, 1)); font-weight: 600; cursor: pointer; }
.pn-ok { background: #fff; color: #000; border: 1px solid #fff; } .pn-x { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.22); }
.pn-h { margin: 0; font-size: calc(11px * var(--ui, 1)); line-height: 1.4; color: rgba(255,255,255,.45); }
/* t1329u: compact Save / Rename by Browse */
.pn-new.pn-ic { padding: 0 calc(8px * var(--ui, 1)); }
.pn-new.pn-ic span { font-size: calc(11.5px * var(--ui, 1)); }
.pn-new:disabled { opacity: .38; cursor: default; border-color: rgba(255,255,255,.14); }
@media (max-width: 1500px) { html:not(.phone) .pn-new.pn-ic span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } html:not(.phone) .pn-new.pn-ic { width: calc(32px * var(--ui, 1)); justify-content: center; padding: 0; } }
.sp-undo:disabled { opacity: .38; cursor: default; }
/* Look Manager: every sub preset visible (wrap, no hidden horizontal scroll) */
.sp-bar.sp-v3 .sp-v2-list { flex-wrap: wrap; overflow: visible; }
.mp-cur { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: calc(8px * var(--ui, 1)) calc(10px * var(--ui, 1)); padding: calc(10px * var(--ui, 1)) calc(12px * var(--ui, 1)); margin-bottom: calc(10px * var(--ui, 1)); border: 1px solid rgba(255,255,255,.14); }
.mp-cur-n { min-width: 0; display: flex; flex-direction: column; } .mp-cur-n small { font-size: calc(10.5px * var(--ui, 1)); letter-spacing: .12em; text-transform: uppercase; opacity: .5; } .mp-cur-n b { font-size: calc(14px * var(--ui, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-cur-a { display: flex; gap: calc(6px * var(--ui, 1)); flex-wrap: wrap; }
.mp-cur-b { display: inline-flex; align-items: center; gap: calc(5px * var(--ui, 1)); min-height: calc(36px * var(--ui, 1)); padding: 0 calc(10px * var(--ui, 1)); border: 1px solid rgba(255,255,255,.22); border-radius: 2px; background: transparent; color: #fff; font-size: calc(12px * var(--ui, 1)); font-weight: 600; }
.mp-cur-b svg { width: calc(12px * var(--ui, 1)); height: calc(12px * var(--ui, 1)); } .mp-cur-b:disabled { opacity: .38; }
.mp-cur .mp-rename { flex-basis: 100%; }

/* t1364u: Preset row — Browse pill gets its own full-width line; New / Save / Rename share the line under it
   as three equal labelled buttons. Nothing overlaps at any panel width (was one cramped row: text collided). */
html:not(.phone) #presetSel.pn-host { flex-wrap: wrap; gap: calc(6px * var(--ui, 1)); width: 100%; min-width: 0; }
html:not(.phone) #presetSel.pn-host > .sel-pill { flex: 1 1 100% !important; width: 100% !important; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: calc(8px * var(--ui, 1)); }
html:not(.phone) #presetSel.pn-host > .sel-pill .k { flex: none; }
html:not(.phone) #presetSel.pn-host > .sel-pill .v { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html:not(.phone) #presetSel.pn-host > .sel-pill svg { flex: none; margin-left: auto; }
html:not(.phone) #presetSel.pn-host > .pn-new,
html:not(.phone) #presetSel.pn-host > .pn-new.pn-ic { flex: 1 1 0; min-width: 0; width: auto; justify-content: center; padding: 0 calc(6px * var(--ui, 1)); gap: calc(5px * var(--ui, 1)); overflow: hidden; }
html:not(.phone) #presetSel.pn-host > .pn-new span { position: static !important; width: auto !important; height: auto !important; overflow: hidden !important; clip: auto !important; text-overflow: ellipsis; white-space: nowrap; font-size: calc(11.5px * var(--ui, 1)); }
html:not(.phone) #presetSel.pn-host > .pn-new svg { flex: none; }
html:not(.phone) .preset-primary #presetSel.pn-host,
html:not(.phone) #presetPrimary #presetSel.pn-host { height: auto !important; min-height: 0; border: 0 !important; background: none !important; box-shadow: none !important; padding: 0; overflow: visible; }
html:not(.phone) #presetSel.pn-host > .pn-new { min-height: calc(32px * var(--ui, 1)); height: calc(32px * var(--ui, 1)); }

/* t1373u: in-between sizes (tablets / foldables / small laptops). The site shows the editor at ~78% (GeneratorFrame zoom),
   so the editor lays out on a larger virtual viewport; these rules use that room and stop anything clipping or spilling. */
/* side columns grow with the room instead of staying at the narrow landscape-tablet widths */
@media (orientation:landscape) and (min-width:1180px){html.tablet{--left:clamp(calc(252px * var(--ui, 1)),21vw,calc(300px * var(--ui, 1)));--right:clamp(calc(284px * var(--ui, 1)),24vw,calc(336px * var(--ui, 1)))}}
/* (t1379u: removed a self-referencing --left rule; the scaled column widths come from editor.css) */
/* layer names / subtitles wrap (2 lines max) instead of being cut off */
html:not(.phone) .layer .nm{white-space:normal;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-height:1.25;overflow-wrap:anywhere}
html:not(.phone) .layer .nm small{white-space:normal;line-height:1.35;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
/* Preset row: when the panel is narrow, Save / Rename become icon buttons (the title gives the tooltip) — never "Rena…" */
html:not(.phone) #presetSel.pn-host{container-type:inline-size;container-name:pnrow}
@container pnrow (max-width:200px){
  html:not(.phone) body #presetSel.pn-host > .pn-new.pn-ic span{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap}
  html:not(.phone) body #presetSel.pn-host > .pn-new.pn-ic{flex:0 0 calc(44px * var(--ui, 1))!important;width:calc(44px * var(--ui, 1))!important;min-width:calc(44px * var(--ui, 1))!important;padding:0!important;gap:0!important}
  html:not(.phone) body #presetSel.pn-host > .pn-new:not(.pn-ic){flex:1 1 auto!important}
}
/* the transport never leaves the Editor column: its rows wrap inside it */
html:not(.phone) #dock{max-width:calc(100% - calc(4px * var(--ui, 1)))!important;box-sizing:border-box}
html:not(.phone) #dock.dk-wrap{flex-wrap:wrap;height:auto;row-gap:calc(8px * var(--ui, 1))}
