/* v1.0.8 — styles for qvs-studio.js (Templates tab) and the v1.0.8 layout fixes. Loaded after qvs-layout-a.css. */

/* sliders: dragging right always means "more", also in the Arabic (RTL) page. Without this the browser flips them. */
html body input[type=range]:not(#seekBar){direction:ltr}

/* ---------- Templates tab ---------- */
.qvst-pane{padding-bottom:calc(var(--qvs12-fh,34px) + 24px)}
.qvst-head{padding:6px 2px 2px}
.qvst-head strong{font-size:16px}
.qvst-note{margin:4px 0 10px;font-size:12px;line-height:1.7;opacity:.75}
.qvst-tools{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.qvst-btn{flex:1 1 150px;padding:9px 12px;border-radius:10px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.05);color:inherit;font-family:inherit;font-weight:600;font-size:13px;line-height:1.3;cursor:pointer}
.qvst-btn:disabled{opacity:.4;cursor:default}
.qvst-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}
.qvst-card{display:flex;flex-direction:column;gap:4px;padding:6px;border-radius:12px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.04);color:inherit;text-align:start;cursor:pointer;min-width:0}
.qvst-card.on{border-color:#5fe0cf;box-shadow:0 0 0 2px rgba(95,224,207,.35)}
.qvst-th{width:100%;height:auto;aspect-ratio:240/140;border-radius:8px;display:block}
.qvst-name{font-family:inherit;font-weight:700;font-size:13px;line-height:1.3}
.qvst-desc{font-size:11px;line-height:1.5;opacity:.7}

/* sections */
.qvst-sec{border:1px solid rgba(255,255,255,.12);border-radius:12px;margin:0 0 10px;background:rgba(255,255,255,.03)}
.qvst-sec>summary{list-style:none;display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;min-height:48px}
.qvst-sec>summary::-webkit-details-marker{display:none}
.qvst-t{flex:1;font-family:inherit;font-weight:700;font-size:14px;line-height:1.3;min-width:0}
.qvst-chev{opacity:.6;transition:transform .15s}
.qvst-sec[open]>summary .qvst-chev{transform:rotate(-90deg)}
.qvst-body{display:grid;gap:12px;padding:4px 14px 14px}
.qvst-sec.off .qvst-body{display:none}
.qvst-sec.off>summary .qvst-chev{visibility:hidden}

/* on / off switch in a section header */
.qvst-sw{position:relative;display:inline-block;width:42px;height:24px;flex:none}
.qvst-sw input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;z-index:1}
.qvst-sw i{position:absolute;inset:0;border-radius:12px;background:rgba(255,255,255,.18);transition:background .15s}
.qvst-sw i::after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .15s}
.qvst-sw input:checked+i{background:#2bbfae}
.qvst-sw input:checked+i::after{transform:translateX(18px)}
html[dir=rtl] .qvst-sw input:checked+i::after,html body[dir=rtl] .qvst-sw input:checked+i::after{transform:translateX(-18px)}

/* one row = label · control · value. The value cell has a fixed width, so long numbers can never overflow. */
.qvst-row{display:grid;grid-template-columns:minmax(72px,34%) minmax(0,1fr) 44px;align-items:center;gap:10px;font-size:13px;margin:0}
.qvst-row.nov{grid-template-columns:minmax(72px,34%) minmax(0,1fr)}
.qvst-lb{min-width:0;overflow-wrap:anywhere}
.qvst-row input[type=range]{width:100%;min-width:0;margin:0}
.qvst-row.col{grid-template-columns:minmax(0,1fr) auto 46px}
.qvst-row.col .qvst-val{min-width:62px;text-align:center;padding:6px 8px;border-radius:8px;background:rgba(255,255,255,.07)}
.qvst-row input[type=color]{width:46px;height:28px;padding:0;border:2px solid rgba(255,255,255,.55);border-radius:7px;background:none;cursor:pointer}
.qvst-row input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.qvst-row input[type=color]::-webkit-color-swatch{border:0;border-radius:4px}
.qvst-row.sel{grid-template-columns:minmax(0,1fr);gap:6px}
.qvst-row select{width:100%;min-width:0}
.qvst-val{direction:ltr;unicode-bidi:isolate;text-align:end;white-space:nowrap;font:600 12px/1 ui-monospace,Menlo,monospace;opacity:.85}

/* the moved appearance block */
.qvst-sec[data-el="sec-appearance"]>.qvst-body{display:block}
.qvst-sec[data-el="sec-appearance"] .qvs-card-body{padding:0}

/* ---------- fixed footer: the last controls stay reachable above it ---------- */
html body .qvs9-sheet-body,html body .panel.controls{padding-bottom:calc(var(--qvs12-fh,34px) + 20px)!important}

/* ---------- preview player bar: time on one side, four equal buttons on the other ---------- */
html body section.panel.preview div.timeline-control{padding-inline:10px!important}
html body section.panel.preview div.timeline-control .timeline-head{display:flex!important;align-items:center!important;gap:8px!important;padding-inline:2px!important}
html body section.panel.preview div.timeline-control .timeline-head #seekLabel{flex:1 1 auto!important;min-width:0!important;margin:0!important;white-space:nowrap!important;direction:ltr!important;text-align:start!important}
html body section.panel.preview div.timeline-control .timeline-head>*{flex:none}
html body section.panel.preview div.timeline-control .timeline-head>#seekLabel{flex:1 1 auto}

/* ---------- sticky element bar: nothing hides under its bottom line ---------- */
html body [data-settings-pane]{scroll-margin-top:64px}
html body #qvsElementBar::before{display:none!important}
html body .qvs18-head{display:none!important}

/* guide screenshots */
.qvs14-gimg{display:block;max-width:100%;height:auto;margin:6px auto 12px;border-radius:10px;border:1px solid rgba(255,255,255,.14)}

/* appearance sub-cards inside the templates pane fold like normal accordions */
html body .qvst-pane details.qvs20-static:not([open])>:not(summary){display:none!important}

/* ---------- one look for every settings control (v1.0.8 polish) ---------- */
/* selects: text starts at the reading side, never centred, one height, long names end with … instead of being cut */
html body .panel.controls select,html body .qvs9-sheet-body select,html body .qvst-pane select{display:block;width:100%;box-sizing:border-box;height:44px!important;min-height:44px!important;padding-block:0!important;padding-inline:14px 34px!important;text-align:start!important;text-align-last:start!important;line-height:42px!important;font-size:14px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* colour rows: label · hex · swatch, each vertically centred, same size everywhere */
html body .qvs-card .field:has(>.q14-chipbtn){display:grid!important;grid-template-columns:minmax(0,1fr) auto 46px!important;align-items:center!important;column-gap:10px!important;grid-column:1/-1!important;width:100%!important;max-width:none!important;flex:1 1 100%!important;min-height:46px;margin:0!important;padding:0!important}
html body .qvs-card .field:has(>.q14-chipbtn)>label{grid-column:1!important;margin:0!important;font-size:14px!important;line-height:1.35!important;white-space:normal!important;min-width:0;text-align:start}
html body .qvs-card .field:has(>.q14-chipbtn)>.q15-hex{grid-column:2!important;order:0!important;min-width:62px;text-align:center;padding:6px 8px!important;border-radius:8px;background:rgba(255,255,255,.07);font:600 12px/1 ui-monospace,Menlo,monospace!important;opacity:.9!important;direction:ltr}
html body .qvs-card .field:has(>.q14-chipbtn)>.q14-chipbtn{grid-column:3!important;order:0!important;width:46px!important;min-width:46px!important;max-width:46px!important;height:28px!important;min-height:28px!important;max-height:28px!important;margin:0!important}
html body .qvs-card .row:has(.q14-chipbtn){flex-wrap:wrap}
/* checkbox rows: the box, then the text next to it, both centred in the frame */
html body .qvs-card label.toggle{display:flex!important;align-items:center!important;gap:12px!important;min-height:46px;box-sizing:border-box;padding:10px 14px!important;line-height:1.4;text-align:start!important}
html body .qvs-card label.toggle>input[type=checkbox]{order:-1;flex:none;margin:0}
html body .qvs-card label.toggle>span,html body .qvs-card label.toggle>b{flex:1 1 auto;min-width:0;text-align:start}
/* value boxes next to sliders */
html body .qvs-card .range-value{display:inline-flex;align-items:center;justify-content:center;min-width:56px;height:34px;box-sizing:border-box;padding:0 8px;white-space:nowrap;direction:ltr;unicode-bidi:isolate}
/* the "vector marks" hint sat in a one-cell grid and wrapped word by word */
html body .marker-gallery>.hint{grid-column:1/-1}

/* ---------- player bar (v1.0.8 rebuild) ----------
   runtime DOM (ui-v12): .timeline-head is display:contents, so its children are flex items of .timeline-control.
   Row 1 = seek bar (full width, 28px hit area). Row 2 = play/stop · time · volume · fullscreen. */
html body[data-theme] section.panel.preview div.timeline-control{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;align-items:center!important;gap:6px 12px!important;padding:10px 14px!important;box-sizing:border-box;width:100%}
html body[data-theme] section.panel.preview div.timeline-control input#seekBar{order:-1!important;flex:0 0 100%!important;max-width:100%!important;min-width:0!important;direction:ltr!important;display:block!important;width:100%!important;height:28px!important;min-height:28px!important;margin:0!important;padding:0!important;-webkit-appearance:none;appearance:none;background:transparent!important;cursor:pointer;touch-action:none}
html body[data-theme] section.panel.preview div.timeline-control input#seekBar::-webkit-slider-runnable-track{height:6px;border-radius:3px;background:linear-gradient(to right,var(--accent,#d4af37) var(--seek,0%),rgba(255,255,255,.22) var(--seek,0%))}
html body[data-theme] section.panel.preview div.timeline-control input#seekBar::-moz-range-track{height:6px;border-radius:3px;background:rgba(255,255,255,.22)}
html body[data-theme] section.panel.preview div.timeline-control input#seekBar::-moz-range-progress{height:6px;border-radius:3px;background:var(--accent,#d4af37)}
html body[data-theme] section.panel.preview div.timeline-control input#seekBar::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;margin-top:-7px;border-radius:50%;background:#fff;border:3px solid var(--accent,#d4af37);box-shadow:0 1px 4px rgba(0,0,0,.5)}
html body[data-theme] section.panel.preview div.timeline-control input#seekBar::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--accent,#d4af37)}
html body[data-theme] section.panel.preview div.timeline-control input#seekBar:disabled{opacity:.45}
html body[data-theme] section.panel.preview div.timeline-control #seekLabel{flex:1 1 auto!important;width:auto!important;min-width:0;text-align:center!important;direction:ltr;font:600 13px/1 ui-monospace,Menlo,monospace;white-space:nowrap}
html body[data-theme] section.panel.preview div.timeline-control .transport-volume{flex:0 1 150px!important;min-width:0}
html body[data-theme] section.panel.preview div.timeline-control .transport-volume input{min-width:0;flex:1 1 auto}
html body[data-theme] section.panel.preview div.timeline-control .clip-note{flex:0 0 100%}
html body[data-theme] section.panel.preview div.timeline-control #seekLabel{flex:0 0 auto!important;margin-inline:auto!important;overflow:visible}
