/* Haygoodies Designer: front-end. Light "sunny sky" look to match the shop theme. */
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body.hgd-body { padding-top: env(safe-area-inset-top, 0px); padding-bottom: 0; box-sizing: border-box; }
img { max-width: 100%; }
[hidden]:not([hidden=until-found i]) { display: none !important; }

/* Layout: phone = header, view bar, stage, pull-up panel, bottom tool bar. Desktop = tool rail | panel | stage | live preview.
   Single committed light "sunny sky" look to match the Haygoodies Sky theme; every colour is set explicitly here. */
:root {
	--sky: #c4ebff; --sky2: #e7f6ff; --ink: #34263f; --muted: #6e5d77; --line: #34263f;
	--card: #ffffff; --sheet: #fffaff; --stage: #eef6ff; --soft: #f4eefa;
	--accent: #ff8cc0; --accent2: #7fdcc4; --accent3: #ffd45e; --shadow: #a9c8ff; --warn: #b5307a;
	--display: "Fredoka", "Baloo 2", system-ui, sans-serif;
	--body: "Nunito", system-ui, -apple-system, sans-serif;
	--r: 16px;
	color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--sky); color: var(--ink); font: 400 15px/1.45 var(--body); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { height: 100%; display: grid; grid-template-columns: 84px 330px minmax(0, 1fr) 360px; grid-template-rows: auto auto minmax(0, 1fr);
	grid-template-areas: "head head head head" "rail panel bar preview" "rail panel stage preview"; }

/* header */
header.top { grid-area: head; display: flex; align-items: center; gap: 12px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--card); border-bottom: 3px solid var(--line); }
.brand { font: 700 1.25rem/1 var(--display); white-space: nowrap; }
.brand small { display: block; font: 800 .68rem/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.prod-name { min-width: 0; flex: 1; }
.prod-name b { display: block; font: 600 1.05rem/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-name span { font-size: .85rem; color: var(--muted); }
.price { font: 700 1.35rem/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 1rem/1.1 var(--display); background: var(--accent); color: var(--ink); border: 2.5px solid var(--line); border-radius: 14px; padding: 10px 16px; box-shadow: 3px 3px 0 var(--line); white-space: nowrap; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn.alt { background: var(--accent2); }
.btn.plain { background: var(--card); }
.btn.small { font-size: .88rem; padding: 7px 11px; border-radius: 11px; box-shadow: 2px 2px 0 var(--line); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* tool rail / bottom tabs */
nav.rail { grid-area: rail; display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; background: var(--card); border-right: 3px solid var(--line); overflow-y: auto; }
.tab { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px; border-radius: 14px; font: 700 .74rem/1.1 var(--body); color: var(--muted); text-align: center; }
.tab svg { width: 26px; height: 26px; }
.tab[aria-selected="true"] { background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 2.5px var(--line); }
.tab:focus-visible { outline: 3px solid var(--accent); }

/* panel */
section.panel { grid-area: panel; background: var(--sheet); border-right: 3px solid var(--line); overflow-y: auto; padding: 16px; min-width: 0; }
.pane { display: flex; flex-direction: column; gap: 14px; }
.pane[hidden] { display: none; }
.pane h2 { margin: 0; font: 700 1.3rem/1.2 var(--display); }
.hint { margin: -6px 0 0; color: var(--muted); font-size: .88rem; }
.label { font: 800 .72rem/1 var(--body); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 4px 0 -4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 2px solid var(--line); border-radius: 99px; background: var(--card); font-weight: 700; font-size: .88rem; }
.chip[aria-pressed="true"] { background: var(--accent); box-shadow: 2px 2px 0 var(--line); }
.chip:focus-visible { outline: 3px solid var(--accent2); }
.chip i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; }
.chip .add { color: var(--muted); font-weight: 800; font-size: .8rem; }
.search { width: 100%; padding: 10px 14px 10px 38px; border: 2.5px solid var(--line); border-radius: 14px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e5d77' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") 12px center / 18px no-repeat; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { all: unset; cursor: pointer; position: relative; aspect-ratio: 1; border: 2px solid var(--line); border-radius: 16px; background: var(--card); display: grid; place-items: center; padding: 12%; transition: transform .15s; }
.tile:hover { transform: translateY(-3px); }
.tile:focus-visible { outline: 3px solid var(--accent); }
.tile svg { width: 100%; height: 100%; }
.empty { color: var(--muted); font-size: .9rem; grid-column: 1 / -1; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.pcard { all: unset; cursor: pointer; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); }
.pcard[aria-current="true"] { box-shadow: 3px 3px 0 var(--line); background: var(--soft); }
.pcard:focus-visible { outline: 3px solid var(--accent); }
.pcard .pic { width: 64px; height: 64px; border-radius: 12px; background: var(--sky2); display: grid; place-items: center; }
.pcard .pic svg { width: 46px; height: 46px; }
.pcard b { display: block; font: 600 1rem/1.2 var(--display); }
.pcard span { font-size: .82rem; color: var(--muted); }
.pcard .pp { font: 700 1.05rem var(--display); font-variant-numeric: tabular-nums; }
textarea.txt { width: 100%; min-height: 70px; resize: vertical; padding: 10px 12px; border: 2.5px solid var(--line); border-radius: 14px; background: var(--card); font-size: 1.05rem; }
.fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.font { all: unset; cursor: pointer; text-align: center; padding: 8px 6px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); font-size: 1.15rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font[aria-pressed="true"] { background: var(--accent); box-shadow: 2px 2px 0 var(--line); }
.font:focus-visible { outline: 3px solid var(--accent2); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { all: unset; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.sw[aria-pressed="true"]::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--ink); }
.sw:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.sw.anyc { background: conic-gradient(#ff4f9a, #ffd45e, #7fdcc4, #8fc8ff, #c9a7ff, #ff4f9a); overflow: hidden; }
.sw.anyc input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.sw.none { background: repeating-linear-gradient(45deg, #fff 0 5px, #f1d6e4 5px 10px); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.drop { display: grid; place-items: center; gap: 8px; text-align: center; padding: 22px 14px; border: 3px dashed var(--line); border-radius: 18px; background: var(--card); cursor: pointer; }
.drop.over { background: var(--soft); }
.drop svg { width: 44px; height: 44px; }
.drop b { font: 600 1.1rem var(--display); }
.note { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: .88rem; }
.note.warn { background: #fff0f6; color: var(--warn); font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 2.5px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.qty button { all: unset; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; font: 700 1.3rem var(--display); }
.qty button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.qty output { min-width: 34px; text-align: center; font: 700 1.1rem var(--display); font-variant-numeric: tabular-nums; }
.sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.sum .tot { font: 700 1.2rem var(--display); border-top: 2px dashed var(--line); padding-top: 6px; }
.layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.layer { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
.layer.on { background: var(--soft); box-shadow: 2px 2px 0 var(--line); }
.layer .lname { all: unset; cursor: pointer; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer .lname:focus-visible { outline: 3px solid var(--accent); }
.layer .ico { width: 30px; height: 30px; border-radius: 9px; background: var(--sky2); display: grid; place-items: center; font: 700 .8rem var(--display); }
.layer .acts { display: flex; gap: 2px; }
.ib { all: unset; cursor: pointer; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.ib:hover { background: var(--soft); }
.ib[hidden], .selbar [hidden] { display: none !important; }
.ib:focus-visible { outline: 3px solid var(--accent); }
.ib svg { width: 18px; height: 18px; }
input[type=range] { width: 100%; accent-color: #ff6fae; }

/* view bar + stage */
.viewbar { grid-area: bar; display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; min-width: 0; }
.views { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.views .chip { flex: none; }
.undo { display: flex; gap: 4px; }
.undo .ib { background: var(--card); border: 2px solid var(--line); width: 36px; height: 36px; }
.undo .ib[disabled] { opacity: .35; pointer-events: none; }
main.stage { grid-area: stage; position: relative; min-height: 0; display: grid; place-items: center; padding: 16px; overflow: hidden; }
.area { position: relative; box-shadow: 6px 6px 0 var(--shadow); border: 2.5px solid var(--line); border-radius: 4px; }
.area.checker { background: repeating-conic-gradient(#f3eef8 0 25%, #fff 0 50%) 0 0 / 22px 22px; }
.guides { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.guides svg { width: 100%; height: 100%; display: block; }
.area-label { position: absolute; left: 50%; bottom: -28px; transform: translateX(-50%); white-space: nowrap; text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.selbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; gap: 2px; padding: 4px; background: var(--card); border: 2.5px solid var(--line); border-radius: 14px; box-shadow: 3px 3px 0 var(--line); max-width: calc(100% - 24px); overflow-x: auto; }
.selbar[hidden] { display: none; }
.selbar .warnchip { align-self: center; font-size: .78rem; font-weight: 800; color: var(--warn); padding: 0 8px; white-space: nowrap; }
.mini { display: none; }
.partbtn { all: unset; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; flex: none; }
.partbtn i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); }
.partbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.partbtn[hidden] { display: none; }
.pick { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.pick input[type=color] { width: 44px; height: 36px; padding: 0; border: 2px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.hexin { width: 104px; padding: 7px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); font: 700 .95rem ui-monospace, Menlo, monospace; text-transform: uppercase; }
.oc { display: flex; flex-direction: column; gap: 10px; }
.rangerow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rangerow output { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; font-size: .9rem; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: .92rem; }
.check input { width: 20px; height: 20px; accent-color: #ff6fae; }
.gallery-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gal { aspect-ratio: 1; max-width: 100%; border: 2px solid var(--line); border-radius: 12px; background: var(--sky2); display: grid; place-items: center; overflow: hidden; font-size: .72rem; font-weight: 700; color: var(--muted); text-align: center; padding: 6px; }
.gal img { width: 100%; height: 100%; object-fit: contain; }
.desc p { margin: 0 0 8px; }
.desc ul { margin: 0; padding-left: 18px; }
.chart-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
table.chart { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .88rem; }
table.chart th, table.chart td { padding: 7px 10px; text-align: center; border-bottom: 1px solid #e6dcef; white-space: nowrap; }
table.chart th { background: var(--soft); font-weight: 800; }
table.chart tr:last-child td { border-bottom: 0; }
.fx { display: flex; flex-wrap: wrap; gap: 6px; }
.tile .tag { position: absolute; }
.tile.tilepat { padding: 0; overflow: hidden; }
.tile.tilepat svg { border-radius: 14px; }

/* live preview */
aside.preview { grid-area: preview; background: var(--card); border-left: 3px solid var(--line); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
aside.preview h2 { margin: 0; font: 700 1.2rem var(--display); }
.pv-box { position: relative; border-radius: 18px; background: radial-gradient(circle at 50% 40%, #ffffff, var(--sky2) 70%); border: 2px solid var(--line); aspect-ratio: 1 / 1.05; max-width: 100%; }
.pv-box canvas { width: 100%; height: 100%; display: block; }
.pv-ctrl { display: flex; flex-direction: column; gap: 8px; }
.pv-close { display: none; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(52, 38, 63, .45); display: grid; place-items: center; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.modal[hidden] { display: none; }
.dialog { width: min(640px, 100%); max-height: 100%; overflow-y: auto; background: var(--sheet); border: 3px solid var(--line); border-radius: 22px; box-shadow: 6px 6px 0 var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.dialog h2 { margin: 0; font: 700 1.5rem var(--display); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file { border: 2px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.file .img { background: repeating-conic-gradient(#f3eef8 0 25%, #fff 0 50%) 0 0 / 16px 16px; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.file img { max-width: 100%; max-height: 100%; display: block; }
.file p { margin: 0; padding: 8px 10px; font-size: .82rem; }
.file p b { display: block; font-size: .9rem; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 120; background: var(--ink); color: #fff; font-weight: 800; padding: 10px 16px; border-radius: 99px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* ---------- phones & small tablets ---------- */
@media (max-width: 959px) {
	.app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "head" "bar" "stage" "panel" "rail"; }
	header.top { gap: 10px; padding-block: 8px; }
	.brand { display: none; }
	.price { font-size: 1.15rem; }
	header.top .btn { padding: 9px 12px; }
	nav.rail { flex-direction: row; justify-content: space-around; border-right: 0; border-top: 3px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); padding-left: max(4px, env(safe-area-inset-left, 0px)); padding-right: max(4px, env(safe-area-inset-right, 0px)); overflow: visible; }
	.tab { flex: 1; min-width: 0; padding: 6px 1px; font-size: .62rem; }
	.tab svg { width: 24px; height: 24px; }
	section.panel { border-right: 0; border-top: 3px solid var(--line); max-height: 44vh; border-radius: 22px 22px 0 0; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
	section.panel.closed { display: none; }
	.viewbar { padding: 8px 16px 0; flex-wrap: wrap; row-gap: 6px; }
	.viewbar .views { flex: 1 1 100%; order: 2; }
	.viewbar .partbtn { margin-left: auto; }
	main.stage { padding: 12px 16px 34px; }
	aside.preview { position: fixed; inset: 0; z-index: 90; border: 0; padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
	aside.preview.closed { display: none; }
	.pv-box { width: min(100%, 52vh); margin: 0 auto; }
	.pv-close { display: inline-flex; align-self: flex-end; }
	.mini { display: block; position: absolute; right: 12px; top: 10px; z-index: 15; width: 78px; height: 82px; border-radius: 16px; border: 2.5px solid var(--line); background: radial-gradient(circle at 50% 40%, #fff, var(--sky2) 70%); box-shadow: 3px 3px 0 var(--line); padding: 0; overflow: hidden; }
	.mini canvas { width: 100%; height: 100%; display: block; }
	.mini span { position: absolute; left: 0; right: 0; bottom: 2px; font: 800 .62rem var(--body); text-align: center; color: var(--ink); }
	.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.area-label { font-size: .7rem; bottom: -24px; }
	.selbar { left: 12px; transform: none; max-width: calc(100% - 108px); }
	.toast { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 520px) {
	header.top { gap: 8px; }
	.prod-name b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .92rem; line-height: 1.15; }
	header.top .hbtn { width: 36px; height: 36px; }
}
@media (max-width: 420px) {
	.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.prod-name span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- plugin additions ---------- */
.hgd-loading { margin: auto; font: 600 1.1rem var(--display); }
.app[aria-busy=true] { display: grid; place-items: center; }
.hbtn { all: unset; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; flex: none; }
.hbtn svg { width: 20px; height: 20px; }
.hbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.menu { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: 62px; z-index: 80; background: var(--card); border: 2.5px solid var(--line); border-radius: 16px; box-shadow: 4px 4px 0 var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 230px; }
.menu button, .menu a { all: unset; cursor: pointer; padding: 10px 12px; border-radius: 10px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.menu button:hover, .menu a:hover, .menu button:focus-visible, .menu a:focus-visible { background: var(--soft); }
.seg { display: flex; border: 2.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.seg button { all: unset; cursor: pointer; flex: 1; text-align: center; padding: 8px 10px; font-weight: 800; font-size: .9rem; background: var(--card); }
.seg button[aria-pressed="true"] { background: var(--accent); }
.seg button + button { border-left: 2.5px solid var(--line); }
.seg button:focus-visible { outline: 3px solid var(--accent2); outline-offset: -3px; }
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.catcard { all: unset; cursor: pointer; border: 2px solid var(--line); border-radius: 16px; background: var(--card); overflow: hidden; display: flex; flex-direction: column; }
.catcard .cv { aspect-ratio: 4 / 3; background: var(--sky2); display: grid; place-items: center; }
.catcard .cv img { width: 80%; height: 80%; object-fit: contain; }
.catcard b { font: 600 .98rem/1.2 var(--display); padding: 8px 10px 0; }
.catcard span { font-size: .78rem; color: var(--muted); padding: 0 10px 9px; }
.catcard:focus-visible { outline: 3px solid var(--accent); }
.crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumb button { all: unset; cursor: pointer; font-weight: 800; color: var(--warn); }
.crumb b { font: 600 1.1rem var(--display); }
.rowhead { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 -4px; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.strip .tile { width: 74px; flex: none; }
.tile { position: relative; }
.tile img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.tile.tilepat { background-size: 50% 50%; background-repeat: repeat; }
.fav { all: unset; cursor: pointer; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; font-size: 14px; line-height: 1; color: #b9adc6; z-index: 2; }
.fav[aria-pressed="true"] { color: #ff4f9a; }
.fav:focus-visible { outline: 2px solid var(--accent); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pager span { font-weight: 700; font-size: .88rem; color: var(--muted); }
.fontlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.font { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px 6px; }
.font .fp { font-size: 1.35rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font small { font: 700 .66rem var(--body); color: var(--muted); letter-spacing: .04em; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: .9rem; }
.check input { width: 22px; height: 22px; accent-color: #ff6fae; flex: none; margin: 0; }
.drop.locked { opacity: .45; pointer-events: none; }
.tpl { aspect-ratio: 1; padding: 6%; }
.warnlist { margin: 0; padding-left: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.field input, .field select { padding: 10px 12px; border: 2.5px solid var(--line); border-radius: 12px; background: var(--card); font: inherit; }
.stock { color: var(--warn); font-weight: 800; }
.mkchips { display: flex; flex-wrap: wrap; gap: 6px; }

/* zoom */
.zbtn { all: unset; cursor: pointer; position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); display: grid; place-items: center; color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.zbtn svg { width: 22px; height: 22px; }
.zbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.zoom { position: fixed; inset: 0; z-index: 120; background: #241a2e; display: flex; flex-direction: column; }
.zoom[hidden] { display: none; }
.zstage { flex: 1; overflow: hidden; display: grid; place-items: center; touch-action: none; cursor: grab; min-height: 0; }
.zstage img { max-width: 100%; max-height: 100%; background: radial-gradient(circle at 50% 40%, #ffffff, #dff0ff 75%); border-radius: 12px; transform-origin: center; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.zbar { display: flex; gap: 10px; justify-content: center; align-items: center; padding: 10px 16px 4px; }
.zbar .hbtn { background: var(--card); }
.zhint { margin: 0; padding: 4px 16px calc(12px + env(safe-area-inset-bottom, 0px)); text-align: center; color: #fff; opacity: .8; font-size: .8rem; }
.desc img, .gal img { cursor: zoom-in; }
.desc img { max-width: 100%; height: auto; border-radius: 10px; }
.chartimg { width: 100%; height: auto; display: block; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: zoom-in; }
