/* =================================================================== STOREFRONT (dark, minimal) */
:root {
  --paper: #141416;      /* page */
  --paper-2: #1d1d20;    /* raised surfaces */
  --surface: #1d1d20;
  --ink: #f2f2f0;        /* text */
  --ink-2: #c8c8cc;
  --muted: #8b8b93;
  --line: #2c2c31;
  --yellow: #ffe14d;     /* the one accent */
  --red: #ff4d6d;
  --radius: 14px;
  --body: 'Archivo', system-ui, -apple-system, sans-serif;
  --display: 'Anton', 'Archivo Black', Impact, sans-serif;

  /* editor */
  --ed-bg: #1b1b1d;
  --ed-panel: #262628;
  --ed-panel-2: #2e2e31;
  --ed-line: #3a3a3e;
  --ed-text: #e6e6e8;
  --ed-muted: #9a9aa2;
  --ed-accent: #2f8cff;
  color-scheme: dark;
}
/* the admin panel keeps its light theme */
body.in-admin {
  --paper: #f3eee4; --paper-2: #e9e2d4; --surface: #ffffff; --ink: #141414; --ink-2: #3a3833; --muted: #6d685f; --line: #141414; --yellow: #ffd400; --red: #ff3b2f;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
body.in-editor { overflow: hidden; background: var(--ed-bg); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .8em 1.3em; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; text-decoration: none; background: var(--surface); color: var(--ink); transition: background .12s, transform .12s; }
.btn:hover { background: color-mix(in srgb, var(--surface) 88%, var(--ink)); }
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ink:hover { background: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
.btn-yellow { background: var(--yellow); color: #111; border-color: var(--yellow); }
.btn-yellow:hover { background: #fff07a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: .45em .95em; font-size: .85rem; }
.btn.full { width: 100%; }
.btn.grow { flex: 1; }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.kicker { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }

/* ---------- header ---------- */
.site-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 2rem; padding: .9rem clamp(16px, 4vw, 48px); background: color-mix(in srgb, var(--paper) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-family: var(--display); font-size: 1.45rem; letter-spacing: .03em; line-height: 1; white-space: nowrap; }
.logo i { font-style: normal; font-family: var(--body); font-weight: 800; font-size: .68rem; letter-spacing: 0; background: var(--yellow); color: #111; border-radius: 6px; padding: .28em .4em; transform: rotate(-6deg); }
.site-nav { display: flex; gap: 1.6rem; margin-right: auto; }
.site-nav a, .site-nav .linkish { text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--muted); }
.site-nav a:hover, .site-nav .linkish:hover { color: var(--ink); }
.cart-btn { display: inline-flex; align-items: center; gap: .5rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .5rem .7rem .5rem .9rem; font-weight: 700; font-size: .9rem; }
.cart-btn:hover { background: #26262a; }
.cart-btn b { background: var(--yellow); color: #111; min-width: 1.6em; height: 1.6em; border-radius: 999px; display: grid; place-items: center; font-size: .78rem; }
.cart-btn b.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.35); } }

/* ---------- shop ---------- */
.shop-sec { padding: 18px clamp(16px, 4vw, 48px) 64px; max-width: 1440px; margin: 0 auto; scroll-margin-top: 70px; }
.shop-intro { margin: 0 0 1.4rem; color: var(--muted); font-size: .9rem; }
.shop-intro p { margin: 0; }
.shop-intro b { color: var(--ink); font-weight: 700; }
.shop-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 2.4rem; align-items: start; }
.shop-side { position: sticky; top: 80px; display: grid; gap: .6rem; max-height: calc(100vh - 96px); overflow: auto; padding: 2px; }
.side-search input { width: 100%; font: inherit; font-size: .92rem; color: var(--ink); padding: .6rem .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.side-search input::placeholder { color: var(--muted); }
.side-search input:focus { outline: none; border-color: var(--yellow); }
.side-h { margin: .8rem 0 0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: .45rem .9rem; font-weight: 600; font-size: .9rem; display: inline-flex; gap: .5rem; align-items: center; }
.chip small { font-size: .75rem; color: var(--muted); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.on small { color: #555; }
.side-cats { display: grid; gap: .1rem; }
.side-cats .chip { justify-content: space-between; border: 0; border-radius: 8px; padding: .5rem .6rem; color: var(--muted); }
.side-cats .chip:hover { color: var(--ink); background: var(--surface); }
.side-cats .chip.on { background: transparent; color: var(--ink); box-shadow: inset 3px 0 0 var(--yellow); border-radius: 0 8px 8px 0; }
.side-cats .chip.on small { color: var(--muted); }
.side-sort { font: inherit; font-size: .9rem; color: var(--ink); padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.side-studio { display: grid; gap: .2rem; margin-top: 1rem; font-size: .85rem; line-height: 1.4; color: var(--muted); text-decoration: none; }
.side-studio b { color: var(--ink); }
.side-studio:hover span { color: var(--yellow); }
.grid-count { margin: 0 0 1rem; color: var(--muted); font-size: .85rem; scroll-margin-top: 80px; }
.grid-count b { color: var(--ink); }
.grid-empty { grid-column: 1 / -1; padding: 2rem 0; color: var(--muted); }
.grid-empty a { color: var(--yellow); }

/* cards: just the sticker */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2.4rem 2rem; }
.card { cursor: pointer; display: flex; flex-direction: column; gap: .7rem; }
.card-sticker { transition: transform .2s cubic-bezier(.2,.9,.3,1.3); filter: drop-shadow(0 10px 18px rgba(0,0,0,.55)); }
.card-sticker svg { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,.07); }
.card:hover .card-sticker { transform: translateY(-3px) scale(1.02); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.card-foot .price { color: var(--muted); font-size: .88rem; font-weight: 600; }
.card-add { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; font-weight: 700; }
.card-add:hover { background: var(--yellow); border-color: var(--yellow); color: #111; }
.card-add.done { background: #1f7a45; border-color: #1f7a45; color: #fff; }

/* pack cards */
.pack-card .pack-art { position: relative; padding: .4rem 0 .2rem; }
.pack-st { width: 78%; filter: drop-shadow(0 8px 14px rgba(0,0,0,.55)); position: relative; }
.pack-st svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.pack-st.ps-0 { transform: rotate(-3deg); }
.pack-st.ps-1 { transform: rotate(2deg); margin: 1% 0 0 22%; }
.pack-st.ps-2 { transform: rotate(-1.5deg); margin: 1% 0 0 8%; }
.pack-card h3 { margin: 0; font-size: 1rem; }
.pack-card p { margin: 0; color: var(--muted); font-size: .85rem; }

/* pack popup */
.modal.pack { width: min(860px, 100%); }
.pk h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1; margin: .2rem 0 .4rem; letter-spacing: .01em; }
.pk-added { color: #7ee2a8; margin: 0 2.4rem 1rem 0; font-size: .92rem; }
.pk-blurb { color: var(--muted); margin: 0 0 1.2rem; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.pk-item { position: relative; display: flex; flex-direction: column; gap: .4rem; text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 12px; padding: .7rem; color: inherit; cursor: pointer; }
.pk-item.on { border-color: var(--yellow); background: rgba(255,225,77,.06); }
.pk-item.in { cursor: default; opacity: .55; }
.pk-item span { font-weight: 600; font-size: .8rem; line-height: 1.25; color: var(--ink-2); }
.pk-item em { font-style: normal; font-size: .78rem; color: var(--muted); }
.pk-st svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.pk-tick { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); z-index: 1; }
.pk-item.on .pk-tick { background: var(--yellow); border-color: var(--yellow); }
.pk-item.on .pk-tick::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: .75rem; color: #111; }
.pk-buy { display: flex; margin-top: 1.4rem; }
.pk-note { text-align: center; font-size: .82rem; color: var(--muted); margin: .6rem 0 0; }
.pk-alt { display: flex; justify-content: center; gap: 1.6rem; margin-top: .8rem; font-size: .9rem; color: var(--muted); }
.pk-alt .linkish:hover { color: var(--ink); }

/* basket bar + toast */
.buy-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 1rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: .45rem .45rem .45rem 1.1rem; border-radius: 999px; box-shadow: 0 12px 34px rgba(0,0,0,.6); white-space: nowrap; max-width: calc(100vw - 32px); font-size: .92rem; }
.buy-bar span { color: var(--muted); }
.buy-bar span b { color: var(--ink); }
body.in-editor .buy-bar, body.in-admin .buy-bar, body.cart-open .buy-bar { display: none; }
body.has-bar:not(.in-editor):not(.in-admin) .toast { bottom: 84px; }
body.has-bar .site-foot { padding-bottom: 90px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; background: #f2f2f0; color: #111; padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.5); display: flex; gap: .8rem; align-items: center; white-space: nowrap; max-width: calc(100vw - 32px); }
.toast.show { animation: toastIn .3s cubic-bezier(.2,.9,.3,1.3); }
.toast-link { background: #111; color: #fff; border: 0; border-radius: 999px; padding: .25rem .7rem; font-weight: 700; font-size: .8rem; }
.toast a { color: inherit; }
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0; } }

.site-foot { border-top: 1px solid var(--line); padding: 32px clamp(16px, 4vw, 48px); text-align: center; color: var(--muted); font-size: .8rem; }
.site-foot p { margin: .4rem 0 0; }
.site-foot .linkish { color: var(--muted); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .18s; }
.modal { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 2rem; animation: pop .22s cubic-bezier(.2,.9,.3,1.3); }
.modal.wide { width: min(1040px, 100%); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96) translateY(10px); opacity: 0; } }
.modal-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.3rem; line-height: 1; display: grid; place-items: center; z-index: 3; }
.modal-x:hover { background: #2a2a2f; }
.modal-x.static { position: static; }
.modal h2 { margin: 0 0 .6rem; font-size: 1.5rem; line-height: 1.15; }

.pm { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; }
.pm-preview { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.pm-stage { position: relative; border-radius: 14px; background: #0c0c0d; min-height: 300px; display: grid; place-items: center; overflow: hidden; padding: 2rem 1.2rem; }
.pm-flat { width: 100%; filter: drop-shadow(0 12px 18px rgba(0,0,0,.6)); position: relative; }
.pm-flat svg { width: 100%; height: auto; }
.pm-stage.fin-gloss .pm-flat::after { content: ''; position: absolute; inset: 0; border-radius: 12px; background: linear-gradient(160deg, rgba(255,255,255,.25), transparent 40%); pointer-events: none; }
.pm-info h2 { padding-right: 2.4rem; }
.pm-info h4 { margin: 1.3rem 0 .5rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.pm-note { margin: .4rem 0 0; font-size: .82rem; color: var(--muted); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; }
.opts button { text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .75rem; display: grid; gap: .1rem; color: var(--ink); }
.opts button b { font-size: .9rem; }
.opts button span { font-size: .78rem; color: var(--muted); }
.opts button em { font-style: normal; font-weight: 700; font-size: .82rem; }
.opts button.on { border-color: var(--yellow); background: rgba(255,225,77,.06); }
.pm-buy { display: flex; gap: .7rem; margin-top: 1.6rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { border: 0; background: none; color: var(--ink); width: 2.4rem; height: 2.6rem; font-size: 1.15rem; }
.qty span { min-width: 1.6rem; text-align: center; font-weight: 700; }
.qty.sm button { width: 1.9rem; height: 1.9rem; font-size: 1rem; }
.pm-custom { display: inline-block; margin-top: 1rem; font-size: .88rem; color: var(--muted); }
.pm-custom:hover { color: var(--yellow); }
.pm-specs { margin: 1.2rem 0 0; padding: 1rem 0 0 1.1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; line-height: 1.7; }

/* ---------- cart drawer ---------- */
.drawer-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; }
.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(430px, 100vw); background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.cart-drawer.open { transform: none; }
.cd-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); }
.cd-head h3 { margin: 0; font-size: 1.2rem; }
.cd-head small { font-size: .85rem; color: var(--muted); font-weight: 500; }
.cd-progress { height: 4px; margin: 1rem 1.3rem 0; border-radius: 99px; background: var(--surface); overflow: hidden; }
.cd-progress div { height: 100%; background: var(--yellow); transition: width .3s; }
.cd-note { margin: .5rem 1.3rem 0; font-size: .82rem; color: var(--muted); }
.cd-note b { color: var(--ink); }
.cd-secure { margin: .2rem 0 0; font-size: .75rem; color: var(--muted); text-align: center; }
.cd-items { flex: 1; overflow: auto; padding: .4rem 1.3rem; }
.cd-item { display: flex; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.cd-thumb { width: 116px; flex: none; }
.cd-thumb svg { width: 100%; height: auto; border-radius: 6px; }
.cd-meta { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 0; }
.cd-meta > b { font-size: .88rem; line-height: 1.25; }
.cd-meta > span { font-size: .76rem; color: var(--muted); }
.cd-row { display: flex; align-items: center; justify-content: space-between; margin-top: .4rem; }
.cd-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.cd-sugg { border-top: 1px solid var(--line); padding: .7rem 1.3rem; }
.cd-sugg h4 { margin: 0 0 .4rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.cd-sg { display: flex; align-items: center; gap: .7rem; padding: .25rem 0; }
.cd-sg .cd-thumb { width: 72px; }
.cd-sg b { flex: 1; font-size: .8rem; font-weight: 600; line-height: 1.2; color: var(--ink-2); }
.cd-sg .btn { white-space: nowrap; }
.cd-sum { border-top: 1px solid var(--line); padding: 1rem 1.3rem 1.3rem; display: grid; gap: .45rem; background: var(--surface); }
.cd-sum > div { display: flex; justify-content: space-between; font-size: .92rem; color: var(--ink-2); }
.cd-sum .tot { font-weight: 800; font-size: 1.15rem; color: var(--ink); padding-top: .4rem; border-top: 1px solid var(--line); margin-bottom: .5rem; }

/* ---------- order done, my designs ---------- */
.done { text-align: center; padding: 1rem 0; }
.done-mark { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: var(--yellow); color: #111; display: grid; place-items: center; font-size: 1.8rem; font-weight: 900; }
.done p { color: var(--ink-2); line-height: 1.5; margin-bottom: 1.4rem; }
.md-title { margin-bottom: 1.2rem !important; }
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; }
.md-item { display: grid; gap: .5rem; }
.md-item svg { width: 100%; height: auto; border-radius: 8px; }
.md-item div { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.md-item small { color: var(--muted); }
.md-item .linkish { justify-self: start; font-size: .8rem; color: var(--muted); }
.md-empty { color: var(--muted); margin-bottom: 1.4rem; }

@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; gap: .6rem; }
  .shop-side { position: static; max-height: none; overflow: visible; grid-template-columns: 1fr auto; padding: 0; }
  .side-sort { grid-column: 2; grid-row: 1; }
  .side-h, .side-studio { display: none; }
  .side-cats { grid-column: 1 / -1; display: flex; flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 4px 16px 6px; scrollbar-width: none; gap: .4rem; }
  .side-cats .chip { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: .4rem .85rem; color: var(--ink); }
  .side-cats .chip.on { background: var(--ink); color: #111; box-shadow: none; border-radius: 999px; }
  .side-cats .chip.on small { color: #555; }
  .pm { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-head { gap: .8rem; flex-wrap: wrap; }
  .site-nav { order: 3; width: 100%; gap: 1.2rem; overflow-x: auto; }
  .logo { font-size: 1.2rem; }
  .cart-btn { margin-left: auto; }
  .cart-btn span { display: none; }
  .grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .pk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .buy-bar { left: 12px; right: 12px; transform: none; justify-content: space-between; max-width: none; }
  .modal { padding: 1.3rem; }
}

/* =================================================================== EDITOR */
.editor { position: fixed; inset: 0; display: grid; grid-template-rows: 46px minmax(0, 1fr) 26px; grid-template-columns: minmax(0, 1fr); background: var(--ed-bg); color: var(--ed-text); font-size: 13px; user-select: none; }
.ed-top { display: flex; align-items: center; gap: .6rem; padding: 0 .6rem; background: #141416; border-bottom: 1px solid #000; }
.ed-brand { text-decoration: none; }
.ed-brand span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: var(--yellow); color: var(--ink); font-family: var(--display); font-size: 1rem; }
.ed-menus { display: flex; }
.menu { position: relative; }
.menu-b { background: none; border: 0; padding: .45rem .7rem; border-radius: 5px; color: var(--ed-text); }
.menu-b:hover, .menu.open .menu-b { background: var(--ed-panel-2); }
.menu-pop { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; min-width: 240px; background: #2b2b2e; border: 1px solid #45454a; border-radius: 8px; padding: 5px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.menu.open .menu-pop { display: block; }
.menu-pop button { display: flex; width: 100%; justify-content: space-between; gap: 1rem; background: none; border: 0; padding: .45rem .7rem; border-radius: 5px; text-align: left; }
.menu-pop button:hover { background: var(--ed-accent); color: #fff; }
.menu-pop kbd { font-family: inherit; color: var(--ed-muted); font-size: 12px; }
.menu-pop button:hover kbd { color: #dce9ff; }
.menu-pop hr { border: 0; border-top: 1px solid #45454a; margin: 4px 2px; }
.ed-name { margin: 0 auto; background: transparent; border: 1px solid transparent; color: var(--ed-text); font: inherit; font-weight: 600; text-align: center; padding: .35rem .6rem; border-radius: 6px; width: min(300px, 30vw); }
.ed-name:hover { border-color: var(--ed-line); }
.ed-name:focus { outline: none; border-color: var(--ed-accent); background: #000; }
.ed-top-actions { display: flex; align-items: center; gap: .4rem; }
.ed-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: none; border: 0; color: var(--ed-text); }
.ed-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ed-icon:hover:not(:disabled) { background: var(--ed-panel-2); }
.ed-icon:disabled { opacity: .35; cursor: default; }
.ed-icon.sm { width: 24px; height: 24px; }
.ed-icon.sm svg { width: 15px; height: 15px; }
.ed-btn { background: var(--ed-panel-2); border: 1px solid var(--ed-line); color: var(--ed-text); border-radius: 6px; padding: .45rem .8rem; font-weight: 600; }
.ed-btn:hover { background: #38383c; }
.ed-btn.primary { background: var(--yellow); color: var(--ink); border-color: var(--yellow); font-weight: 800; }
.ed-btn.primary:hover { background: #ffe14d; }

.ed-body { display: flex; min-height: 0; min-width: 0; overflow: hidden; }
.ed-top { min-width: 0; }
.ed-name { min-width: 60px; flex: 0 1 300px; }
.ed-top-actions { flex: none; }
.ed-tools { width: 64px; flex: none; background: var(--ed-panel); border-right: 1px solid #000; display: flex; flex-direction: column; gap: 2px; padding: 6px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; border-radius: 7px; padding: 7px 0 6px; color: var(--ed-muted); }
.tool svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool span { font-size: 10px; }
.tool:hover { background: var(--ed-panel-2); color: var(--ed-text); }
.tool.on { background: #3a3a3f; color: #fff; box-shadow: inset 2px 0 0 var(--ed-accent); }

.ed-drawer { width: 272px; flex: none; background: var(--ed-panel); border-right: 1px solid #000; display: flex; flex-direction: column; min-height: 0; }
.dr-head { display: flex; justify-content: space-between; align-items: center; padding: .55rem .8rem; border-bottom: 1px solid var(--ed-line); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ed-muted); }
.dr-head .ed-icon { font-size: 18px; }
.dr-body { overflow: auto; padding: .7rem; }
.dr-body h4 { margin: .4rem 0 .6rem; font-size: 12px; color: var(--ed-text); }
.dr-cat { margin: .9rem 0 .4rem; font-size: 11px; color: var(--ed-muted); text-transform: uppercase; letter-spacing: .08em; }
.dr-list { display: grid; gap: 6px; }
.dr-text { background: var(--ed-panel-2); border: 1px solid var(--ed-line); border-radius: 8px; padding: .7rem .8rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; text-align: left; overflow: hidden; }
.dr-text span { font-size: 24px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #111; padding: .2rem .4rem; border-radius: 4px; }
.dr-text small { color: var(--ed-muted); font-size: 10.5px; flex: none; }
.dr-text:hover, .dr-item:hover, .dr-t:hover { border-color: var(--ed-accent); background: #33363d; }
.dr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dr-item { min-width: 0; overflow: hidden; background: var(--ed-panel-2); border: 1px solid var(--ed-line); border-radius: 8px; padding: 6px 4px 5px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dr-item svg { width: 100%; height: 52px; }
.dr-item.art svg { padding: 4px; }
.dr-item small { font-size: 10px; color: var(--ed-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dr-tpl { display: grid; gap: 8px; margin-bottom: 1rem; }
.dr-t { background: var(--ed-panel-2); border: 1px solid var(--ed-line); border-radius: 8px; padding: 6px; display: grid; gap: 5px; text-align: left; }
.dr-t svg { width: 100%; height: auto; border-radius: 4px; }
.dr-t small { font-size: 11px; color: var(--ed-muted); }

.ed-stage { flex: 1; position: relative; min-width: 0; overflow: auto; display: grid; place-items: center; background-color: #202023; background-image: radial-gradient(#2c2c30 1px, transparent 1px); background-size: 18px 18px; touch-action: none; }
.ed-stage.dropping { outline: 3px dashed var(--ed-accent); outline-offset: -10px; }
.ed-wrap { padding: 48px; }
.ed-svg { overflow: visible; filter: drop-shadow(0 18px 30px rgba(0,0,0,.55)); }
.ed-svg .layers [data-id] { cursor: move; }
.ed-svg [data-locked] { pointer-events: none; }
.ed-svg [data-handle] { cursor: nwse-resize; }
.ed-svg .h-ne, .ed-svg .h-sw { cursor: nesw-resize; }
.ed-svg .h-n, .ed-svg .h-s { cursor: ns-resize; }
.ed-svg .h-e, .ed-svg .h-w { cursor: ew-resize; }
.ed-svg .h-rot { cursor: grab; }
.ed-zoom { position: absolute; bottom: 14px; right: 14px; display: flex; background: var(--ed-panel); border: 1px solid var(--ed-line); border-radius: 8px; overflow: hidden; }
.ed-zoom button { background: none; border: 0; color: var(--ed-text); padding: .35rem .7rem; min-width: 34px; }
.ed-zoom button:hover { background: var(--ed-panel-2); }
.ed-zoom #zoom-fit { border-inline: 1px solid var(--ed-line); min-width: 60px; font-variant-numeric: tabular-nums; }

.ed-panels { width: 300px; flex: none; background: var(--ed-panel); border-left: 1px solid #000; display: flex; flex-direction: column; min-height: 0; }
.panel { display: flex; flex-direction: column; min-height: 0; }
.panel:first-child { flex: 1 1 60%; border-bottom: 1px solid #000; }
.layers-panel { flex: 1 1 40%; }
.panel-h { display: flex; justify-content: space-between; align-items: center; padding: 0 .5rem 0 .8rem; height: 32px; flex: none; background: #202022; border-bottom: 1px solid var(--ed-line); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ed-muted); }
.panel-tools { display: flex; gap: 1px; }
.panel-b { overflow: auto; flex: 1; }
#ed-props.flash { animation: flashp .6s; }
@keyframes flashp { 30% { background: #2f3b4d; } }
.ps { border-bottom: 1px solid var(--ed-line); }
.ps-h { display: flex; justify-content: space-between; align-items: center; padding: .55rem .8rem .2rem; font-size: 11px; font-weight: 700; color: var(--ed-muted); }
.ps-b { padding: .35rem .8rem .75rem; display: grid; gap: .55rem; }
.ps-b:empty { display: none; }
.ps textarea { width: 100%; resize: vertical; background: #18181a; color: #fff; border: 1px solid var(--ed-line); border-radius: 6px; padding: .5rem .6rem; font: 600 14px/1.35 var(--body); min-height: 54px; user-select: text; }
.ps textarea:focus, .pf input:focus, .pf select:focus { outline: none; border-color: var(--ed-accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.pf { display: grid; gap: 3px; min-width: 0; }
.pf > span { font-size: 11px; color: var(--ed-muted); }
.pf .scrub { cursor: ew-resize; }
.pf .scrub:hover { color: var(--ed-text); }
.pf input[type=number], .pf select { width: 100%; background: #18181a; color: var(--ed-text); border: 1px solid var(--ed-line); border-radius: 5px; padding: .32rem .45rem; font: inherit; font-variant-numeric: tabular-nums; user-select: text; }
.pf.color .sw { display: flex; align-items: center; gap: .4rem; background: #18181a; border: 1px solid var(--ed-line); border-radius: 5px; padding: 3px; }
.pf.color input { width: 26px; height: 22px; border: 0; padding: 0; background: none; cursor: pointer; flex: none; }
.pf.color input::-webkit-color-swatch-wrapper { padding: 0; }
.pf.color input::-webkit-color-swatch { border: 1px solid #555; border-radius: 3px; }
.pf.color code { font-size: 11px; color: var(--ed-muted); overflow: hidden; }
.pf.range > span { display: flex; justify-content: space-between; }
.pf.range b { color: var(--ed-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pf input[type=range] { width: 100%; accent-color: var(--ed-accent); }
.btnrow { display: flex; flex-wrap: wrap; gap: .35rem; }
.pb { display: inline-flex; align-items: center; gap: .35rem; background: var(--ed-panel-2); border: 1px solid var(--ed-line); color: var(--ed-text); border-radius: 5px; padding: .3rem .55rem; font-size: 12px; }
.pb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pb:hover { background: #3a3a3f; }
.pb.danger:hover { background: #a3262a; border-color: #a3262a; }
.tg { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 0; color: var(--ed-muted); font-size: 11px; font-weight: 600; padding: 0; }
.tg i { width: 26px; height: 15px; border-radius: 99px; background: #45454a; position: relative; transition: background .15s; }
.tg i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #ddd; transition: transform .15s; }
.tg.on { color: var(--ed-text); }
.tg.on i { background: var(--ed-accent); }
.tg.on i::after { transform: translateX(11px); background: #fff; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: #18181a; border: 1px solid var(--ed-line); border-radius: 6px; padding: 2px; }
.seg button { background: none; border: 0; padding: .3rem; border-radius: 4px; font-size: 12px; color: var(--ed-muted); }
.seg button.on { background: #3a3a3f; color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatches button { width: 22px; height: 22px; border-radius: 5px; border: 1px solid #555; }
.swatches button:hover { transform: scale(1.12); }
.muted { color: var(--ed-muted); font-size: 12px; line-height: 1.5; margin: 0; }
.font-pick-wrap { position: relative; }
.font-pick { width: 100%; display: flex; justify-content: space-between; align-items: center; background: #18181a; border: 1px solid var(--ed-line); border-radius: 6px; padding: .35rem .6rem; font-size: 18px; color: #fff; }
.font-pick i { font-style: normal; font-family: var(--body); font-size: 11px; color: var(--ed-muted); }
.font-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 300px; overflow: auto; background: #2b2b2e; border: 1px solid #45454a; border-radius: 8px; padding: 4px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.font-list button { display: flex; width: 100%; justify-content: space-between; align-items: center; background: none; border: 0; padding: .4rem .6rem; border-radius: 5px; font-size: 19px; color: #fff; text-align: left; }
.font-list button small { font-family: var(--body); font-size: 10px; color: var(--ed-muted); }
.font-list button:hover { background: var(--ed-accent); }
.font-list button.on { background: #3a3a3f; }

.ly-row { display: flex; align-items: center; gap: .4rem; padding: 0 .4rem; height: 40px; border-bottom: 1px solid #222224; cursor: default; }
.ly-row:hover { background: #2d2d31; }
.ly-row.sel { background: #2b3b55; }
.ly-row.hid .ly-thumb, .ly-row.hid .ly-name { opacity: .4; }
.ly-row.dragging { opacity: .4; }
.ly-row.drop-a { box-shadow: inset 0 2px 0 var(--ed-accent); }
.ly-row.drop-b { box-shadow: inset 0 -2px 0 var(--ed-accent); }
.ly-btn { width: 24px; height: 24px; display: grid; place-items: center; background: none; border: 0; color: var(--ed-muted); border-radius: 4px; flex: none; }
.ly-btn svg, .ly-static { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ly-static { color: #5a5a60; margin-right: 5px; }
.ly-btn:hover { color: #fff; background: #3a3a3f; }
.ly-btn.on { color: #ff9f0a; }
.ly-thumb { width: 38px; height: 28px; flex: none; border-radius: 4px; background: #121214 repeating-conic-gradient(#1c1c1f 0 25%, #121214 0 50%) 0 0 / 8px 8px; display: grid; place-items: center; overflow: hidden; border: 1px solid #3a3a3e; }
.ly-thumb svg, .ly-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.ly-thumb.bgthumb { margin-left: 28px; }
.ly-t { font-size: 18px; line-height: 1; }
.ly-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.ly-rename { flex: 1; min-width: 0; background: #000; color: #fff; border: 1px solid var(--ed-accent); border-radius: 4px; font: inherit; padding: .2rem .35rem; }
.ly-empty { color: var(--ed-muted); padding: 1rem; font-size: 12px; line-height: 1.5; margin: 0; }
.ed-status { display: flex; align-items: center; gap: 1.4rem; padding: 0 .8rem; background: #141416; border-top: 1px solid #000; color: var(--ed-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.st-hint { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .ed-panels { width: 260px; }
  .ed-drawer { width: 230px; }
  .st-hint { display: none; }
  #ed-export { display: none; }
}
@media (max-width: 720px) {
  /* editor: stack panels under the canvas */
  .editor { grid-template-rows: auto 1fr 0; }
  .ed-top { flex-wrap: wrap; height: auto; padding: .4rem; }
  .ed-name { order: 5; width: 100%; }
  .ed-save, #ed-save { display: none; }
  .ed-body { flex-direction: column; }
  .ed-tools { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid #000; }
  .tool { min-width: 58px; }
  .ed-drawer { width: auto; max-height: 34vh; border-right: 0; border-bottom: 1px solid #000; }
  .ed-stage { min-height: 32vh; }
  .ed-wrap { padding: 20px; }
  .ed-panels { width: auto; max-height: 38vh; border-left: 0; border-top: 1px solid #000; }
  .ed-status { display: none; }
}

/* ---------- clipart drawer tabs ---------- */
.dr-tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: #18181a; border: 1px solid var(--ed-line); border-radius: 7px; padding: 2px; margin-bottom: .6rem; }
.dr-tabs button { background: none; border: 0; padding: .35rem .2rem; border-radius: 5px; font-size: 11.5px; color: var(--ed-muted); }
.dr-tabs button.on { background: #3a3a3f; color: #fff; }
.dr-search { width: 100%; background: #18181a; border: 1px solid var(--ed-line); border-radius: 6px; color: #fff; font: inherit; padding: .45rem .6rem; margin-bottom: .6rem; user-select: text; }
.dr-search:focus { outline: none; border-color: var(--ed-accent); }
.dr-note { color: var(--ed-muted); font-size: 11.5px; line-height: 1.45; margin: 0 0 .6rem; }
.dr-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dr-item.vint { background: #efe6d2; border-color: #c9bea6; }
.dr-item.vint img { width: 100%; height: 96px; object-fit: contain; }
.dr-item.vint small { color: #4a4436; }
.dr-item.vint:hover { background: #fff6df; }

/* ---------- credits ---------- */
.credits h3 { margin: 1.4rem 0 .4rem; font-size: 1rem; }
.credits p { color: var(--ink-2); line-height: 1.5; font-size: .92rem; margin: .3rem 0; }
.credits ul { margin: .4rem 0; padding-left: 1.1rem; font-size: .85rem; line-height: 1.6; color: var(--ink-2); }
.credits a { word-break: break-word; }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg.four button { font-size: 11px; padding: .3rem .1rem; }
.swatches.duo button { width: 26px; height: 26px; border-radius: 50%; }
.view.shop { overflow-x: clip; }
.dr-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: .7rem; }
.dr-chips button { background: #18181a; border: 1px solid var(--ed-line); color: var(--ed-muted); border-radius: 99px; padding: .25rem .6rem; font-size: 11px; display: inline-flex; gap: .3rem; align-items: center; }
.dr-chips button small { font-size: 9.5px; opacity: .7; }
.dr-chips button.on { background: var(--ed-accent); border-color: var(--ed-accent); color: #fff; }
.seg.two { grid-template-columns: 1fr 1fr; margin-bottom: .6rem; }
.dr-item.vint.color { background: #2a2a2e; border-color: var(--ed-line); } .dr-item.vint.color small { color: var(--ed-muted); }
.bg-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; max-height: 168px; overflow: auto; padding: 2px; }
.bg-picks button { height: 46px; padding: 0; border: 2px solid transparent; border-radius: 5px; background: #18181a; overflow: hidden; }
.bg-picks button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-picks button.on { border-color: var(--ed-accent); }
.bg-picks button.up { font-size: 18px; color: var(--ed-muted); border: 1px dashed var(--ed-line); }
.bg-picks button:hover { border-color: #6a6a72; }
/* filtered SVG art is expensive to repaint: keep stickers on their own compositor layers */
.card-sticker, .pack-st, .cd-thumb { will-change: transform; contain: paint; }

/* =================================================================== LIBRARY BROWSER */
.lib { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; }
.lib-panel { width: min(1320px, 100%); height: min(900px, 100%); background: var(--ed-panel); border: 1px solid #45454a; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); display: flex; flex-direction: column; overflow: hidden; color: var(--ed-text); }
.lib-h { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #000; background: #202022; }
.lib-tabs { display: flex; background: #18181a; border: 1px solid var(--ed-line); border-radius: 8px; padding: 2px; flex: none; }
.lib-tabs button { background: none; border: 0; color: var(--ed-muted); padding: .45rem .9rem; border-radius: 6px; font-weight: 600; }
.lib-tabs button.on { background: #3a3a3f; color: #fff; }
.lib-search { flex: 1; display: flex; gap: 6px; min-width: 0; }
.lib-q { flex: 1; min-width: 0; background: #111113; border: 1px solid var(--ed-line); color: #fff; border-radius: 8px; padding: .55rem .8rem; font: inherit; font-size: 15px; user-select: text; }
.lib-q:focus { outline: none; border-color: var(--ed-accent); }
.lib-go { background: var(--ed-accent); border: 0; color: #fff; border-radius: 8px; padding: 0 1rem; font-weight: 700; }
.lib-x { background: none; border: 0; color: var(--ed-muted); font-size: 26px; width: 38px; height: 38px; border-radius: 8px; }
.lib-x:hover { background: #3a3a3f; color: #fff; }
.lib-topics { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; border-bottom: 1px solid var(--ed-line); flex: none; scrollbar-width: thin; }
.lib-topics button { flex: none; background: #18181a; border: 1px solid var(--ed-line); color: var(--ed-text); border-radius: 99px; padding: .3rem .75rem; font-size: 12px; text-transform: capitalize; }
.lib-topics button:hover { border-color: #6a6a72; }
.lib-topics button.on { background: var(--yellow); color: #111; border-color: var(--yellow); font-weight: 700; }
.lib-body { flex: 1; display: flex; min-height: 0; }
.lib-filters { width: 240px; flex: none; padding: 14px; border-right: 1px solid #000; overflow: auto; }
.lib-filters h5 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ed-muted); }
.lib-filters h5:not(:first-child) { margin-top: 18px; }
.lib-check, .lib-radio { display: flex; gap: 8px; align-items: flex-start; padding: 6px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.lib-check:hover, .lib-radio:hover { background: #2e2e31; }
.lib-check input, .lib-radio input { accent-color: var(--ed-accent); margin-top: 2px; }
.lib-check span { display: grid; gap: 1px; }
.lib-check small { color: var(--ed-muted); font-size: 11px; }
.lib-sel { width: 100%; background: #18181a; color: var(--ed-text); border: 1px solid var(--ed-line); border-radius: 6px; padding: .4rem; font: inherit; }
.lib-legal { color: var(--ed-muted); font-size: 11.5px; line-height: 1.5; margin-top: 18px; }
.lib-results { flex: 1; overflow: auto; padding: 14px; min-width: 0; }
.lib-status { margin: 0 0 12px; color: var(--ed-muted); font-size: 13px; }
.lib-grid.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.lib-icon { aspect-ratio: 1; background: #2e2e31; border: 1px solid var(--ed-line); border-radius: 10px; padding: 14px; transition: transform .1s; }
.lib-icon svg { width: 100%; height: 100%; }
.lib-icon:hover { border-color: var(--ed-accent); background: #33363d; transform: scale(1.04); }
.lib-icon.added { background: #1f5a33; border-color: #36c26b; }
.lib-grid.art { columns: 4 200px; column-gap: 10px; }
.lib-art { display: block; width: 100%; margin: 0 0 10px; break-inside: avoid; background: #18181a; border: 1px solid var(--ed-line); border-radius: 10px; padding: 0; overflow: hidden; text-align: left; }
.lib-art img { width: 100%; display: block; min-height: 60px; background: #2e2e31; }
.lib-art span { display: block; padding: 6px 8px 8px; font-size: 11.5px; color: var(--ed-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-art:hover { border-color: var(--ed-accent); }
.lib-art:hover span { color: #fff; }
.lib-more { display: block; margin: 16px auto; background: #3a3a3f; border: 0; color: #fff; padding: .6rem 1.4rem; border-radius: 8px; font-weight: 600; }
.lib-detail { width: 320px; flex: none; border-left: 1px solid #000; padding: 14px; overflow: auto; position: relative; background: #222224; }
.lib-detail-x { position: absolute; top: 8px; right: 8px; background: none; border: 0; color: var(--ed-muted); font-size: 22px; }
.lib-prev { background: repeating-conic-gradient(#2a2a2d 0 25%, #222224 0 50%) 0 0 / 16px 16px; border-radius: 10px; display: grid; place-items: center; padding: 10px; margin-top: 18px; }
.lib-prev img { max-width: 100%; max-height: 320px; display: block; border-radius: 4px; }
.lib-detail h4 { margin: 12px 0 4px; font-size: 15px; line-height: 1.3; }
.lib-meta { color: var(--ed-muted); font-size: 12px; margin: 0 0 8px; line-height: 1.4; }
.lib-lic { font-size: 12px; color: #9fe0b0; line-height: 1.45; margin: 0 0 12px; }
.lib-lic a { color: #9fd0ff; }
.lib-actions { display: grid; gap: 6px; }
.lib-actions button { background: #3a3a3f; border: 1px solid #4a4a50; color: #fff; padding: .55rem; border-radius: 8px; font-weight: 600; }
.lib-actions button:hover { background: #46464c; }
.lib-actions button.primary { background: var(--yellow); color: #111; border-color: var(--yellow); }
.lib-tip { color: var(--ed-muted); font-size: 11.5px; line-height: 1.45; }
@media (max-width: 860px) {
  .lib { padding: 0; }
  .lib-panel { border-radius: 0; height: 100%; }
  .lib-h { flex-wrap: wrap; }
  .lib-search { order: 3; flex-basis: 100%; }
  .lib-body { flex-direction: column; }
  .lib-filters { width: auto; border-right: 0; border-bottom: 1px solid #000; max-height: 150px; }
  .lib-detail { width: auto; border-left: 0; border-top: 1px solid #000; max-height: 50%; }
}

/* ---------- shop admin ---------- */
.ed-btn.shop-btn { border-color: #2f8c5a; color: #8ff0b8; }
.ed-btn.shop-btn:hover { background: #1f3a2b; }
.view.admin { min-height: 100vh; background: var(--paper-2); }
.ad-login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.ad-card { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink); padding: 1.6rem; width: min(420px, 100%); display: grid; gap: .9rem; }
.ad-card.wide { width: 100%; max-width: 760px; margin: 0 0 1.4rem; display: block; }
.ad-card h1 { margin: .4rem 0 0; font-family: var(--display); font-weight: 400; font-size: 2.2rem; letter-spacing: .01em; }
.ad-card h2 { margin: 0 0 .6rem; font-size: 1.15rem; }
.ad-card h2 + table, .ad-card table + h2 { margin-top: .9rem; }
.ad-card p { margin: 0; color: var(--ink-2); line-height: 1.45; }
.ad-card label { display: grid; gap: .3rem; font-weight: 700; font-size: .85rem; }
.ad-card input[type=password] { padding: .7rem .8rem; border: 2px solid var(--ink); border-radius: 10px; font: inherit; background: #fff; }
.ad-card code, .ad-foot code { background: var(--paper-2); padding: .05em .35em; border-radius: 4px; font-size: .85em; }
.ad-err { color: #b3121f !important; font-weight: 700; }
.ad-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .8rem clamp(16px, 3vw, 32px); background: var(--paper); border-bottom: 3px solid var(--ink); flex-wrap: wrap; }
.ad-head h1 { margin: 0; font-size: 1.15rem; }
.ad-head-actions { margin-left: auto; display: flex; gap: .5rem; }
.ad-status { font-size: .85rem; color: var(--muted); font-weight: 600; }
.ad-status.dirty, .ad-status.saving { color: #a26b00; }
.ad-status.error { color: #b3121f; }
.ad-status.saved::before { content: '✓ '; color: #1d8a4a; }
.ad-tabs { display: flex; gap: .4rem; padding: 1rem clamp(16px, 3vw, 32px) 0; }
.ad-tabs button { border: 2px solid var(--ink); background: #fff; border-radius: 999px; padding: .5rem 1rem; font-weight: 800; display: flex; gap: .5rem; align-items: baseline; }
.ad-tabs button.on { background: var(--ink); color: #fff; }
.ad-tabs small { font-weight: 600; opacity: .7; font-size: .75rem; }
.ad-main { padding: 1rem clamp(16px, 3vw, 32px) 3rem; max-width: 1240px; }
.ad-bar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.ad-bar .ad-search { flex: 1 1 220px; }
.ad-bar input, .ad-bar select, .ad-row input, .ad-row select, .ad-row textarea, .ad-label input, .ad-table input { font: inherit; font-size: .92rem; padding: .5rem .65rem; border: 2px solid var(--ink); border-radius: 9px; background: #fff; min-width: 0; }
.ad-bar .btn { margin-left: auto; }
.ad-list { display: grid; gap: .8rem; }
.ad-row { display: grid; grid-template-columns: 240px minmax(0, 1fr) auto; gap: 1rem; align-items: start; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; padding: .9rem; box-shadow: 3px 3px 0 var(--ink); }
.ad-row.is-hidden { background: #ece7dc; border-style: dashed; box-shadow: none; }
.ad-row.is-hidden .ad-thumb svg { opacity: .55; filter: grayscale(.6); }
.ad-thumb { position: relative; }
.ad-thumb svg { display: block; width: 100%; height: auto; }
.ad-flag { position: absolute; top: 6px; left: 6px; background: var(--ink); color: #fff; font-size: .7rem; font-weight: 800; padding: .15rem .5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .08em; }
.ad-fields { display: grid; gap: .55rem; min-width: 0; }
.ad-fields label { display: grid; gap: .2rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); min-width: 0; }
.ad-fields textarea { resize: vertical; text-transform: none; letter-spacing: 0; }
.ad-line { display: flex; gap: .6rem; flex-wrap: wrap; }
.ad-line > label { flex: 0 1 150px; }
.ad-line > label.grow { flex: 1 1 220px; }
.ad-opts { align-items: center; gap: 1.1rem; }
.ad-fields .ad-check { display: flex; gap: .4rem; align-items: center; font-size: .85rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.ad-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.ad-id { margin-left: auto; font-size: .75rem; color: var(--muted); font-family: ui-monospace, monospace; }
.ad-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; width: 150px; }
.ad-actions .btn { grid-column: span 2; box-shadow: none; }
.ad-ib { border: 2px solid var(--ink); background: #fff; border-radius: 8px; font-weight: 800; padding: .3rem; }
.ad-ib:disabled { opacity: .3; }
.btn.ad-danger { color: #b3121f; border-color: #b3121f; }
.ad-note { border: 2px solid var(--ink); border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; line-height: 1.45; background: #fff; }
.ad-note.warn { background: #ffe9e9; }
.ad-note.test { background: #fffbe0; }
.ad-note.live { background: #e6f6ea; }
.ad-note code { background: rgba(0,0,0,.07); padding: .05em .35em; border-radius: 4px; font-size: .85em; }
.ad-bar .ad-sub { margin: 0; }
.ad-order { background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); overflow: hidden; }
.ad-order.st-shipped { box-shadow: none; opacity: .75; }
.ad-order > header { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .7rem .9rem; border-bottom: 1.5px dashed #cfc7b7; }
.ad-oid { font-family: ui-monospace, monospace; font-size: 1rem; }
.ad-when { color: var(--muted); font-size: .85rem; }
.ad-total { margin-left: auto; font-size: 1.1rem; }
.ad-pill { display: inline-block; border: 1.5px solid var(--ink); border-radius: 999px; padding: .05rem .55rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: #fff; }
.ad-pill.st-paid { background: var(--yellow); }
.ad-pill.st-printed { background: #d8ecff; }
.ad-pill.st-shipped { background: #e6f6ea; }
.ad-pill.test { background: #fffbe0; border-style: dashed; }
.ad-order-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; padding: .9rem; }
.ad-ship h4 { margin: 0 0 .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ad-ship p { margin: 0; line-height: 1.45; font-size: .92rem; }
.ad-contact { margin-top: .5rem !important; word-break: break-all; }
.ad-lines { display: grid; gap: .6rem; }
.ad-oline { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: .8rem; align-items: center; }
.ad-oline span { display: block; color: var(--muted); font-size: .85rem; }
.ad-othumb svg { display: block; width: 100%; height: auto; }
.ad-order > footer { display: flex; gap: .5rem; justify-content: flex-end; padding: .6rem .9rem; background: #fff; border-top: 1.5px solid #e2dccd; }
/* admin: packs */
.ad-pack { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 1rem; display: grid; gap: .8rem; }
.ad-pack .ad-line { align-items: end; }
.ad-actions.row { display: flex; width: auto; align-items: center; }
.ad-actions.row .btn { grid-column: auto; }
.ad-pack-items { display: flex; flex-wrap: wrap; gap: .7rem; align-items: stretch; }
.ad-pack-item { position: relative; width: 150px; display: grid; gap: .3rem; font-size: .75rem; font-weight: 700; line-height: 1.2; }
.ad-pack-item svg { width: 100%; height: auto; display: block; }
.ad-pack-item.is-hidden { opacity: .45; }
.ad-pack-x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-weight: 900; line-height: 1; padding: 0; }
.ad-pack-x:hover { background: var(--red); color: #fff; }
.ad-pack-add { width: 150px; display: grid; gap: .3rem; align-content: center; border: 2px dashed #b9b09f; border-radius: 10px; padding: .5rem; font-size: .78rem; font-weight: 800; }
.ad-pack-add select { width: 100%; font: inherit; font-weight: 600; }
.ad-warn-sm { margin: 0; color: #a15c00; font-size: .82rem; font-weight: 700; }
.ad-inpacks { font-size: .78rem; color: var(--muted); font-weight: 600; }

@media (max-width: 700px) {
  .ad-order-body { grid-template-columns: 1fr; }
  .ad-oline { grid-template-columns: 100px minmax(0, 1fr); }
  .ad-oline .btn { grid-column: span 2; justify-self: start; }
}
.ad-empty { color: var(--muted); padding: 2rem 0; }
.ad-foot { color: var(--muted); font-size: .85rem; margin-top: 1rem; }
.ad-table { width: 100%; border-collapse: collapse; }
.ad-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .3rem 0; }
.ad-table td { padding: .45rem 0; border-top: 1px solid var(--paper-2); }
.ad-table td:last-child, .ad-table th:last-child { text-align: right; }
.ad-money { display: inline-flex; align-items: center; gap: .3rem; font-weight: 800; }
.ad-money input { width: 90px; text-align: right; }
.ad-danger-zone { border-color: #b3121f; box-shadow: 6px 6px 0 #b3121f; }
.ad-danger-zone p { margin-bottom: .8rem; }
.ad-sub { color: var(--muted); margin: 0 0 1rem; }
.ad-label { display: grid; gap: .3rem; font-weight: 800; font-size: .85rem; margin-bottom: 1rem; }
.modal h3 { margin: 1rem 0 .5rem; font-size: 1rem; }
.ad-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.ad-pick button { border: 2px solid var(--ink); background: #fff; border-radius: 10px; padding: .5rem; display: grid; gap: .35rem; text-align: left; font-weight: 700; font-size: .82rem; }
.ad-pick button:hover { background: var(--yellow); }
.ad-pick svg { width: 100%; height: auto; display: block; }
@media (max-width: 860px) {
  .ad-row { grid-template-columns: minmax(0, 1fr); }
  .ad-thumb { max-width: 360px; }
  .ad-actions { width: auto; grid-template-columns: auto auto 1fr 1fr 1fr; }
  .ad-actions .btn { grid-column: auto; }
}
@media (max-width: 520px) {
  .ad-actions { grid-template-columns: 1fr 1fr; }
  .ad-actions .btn { grid-column: span 2; }
  .ad-head-actions { margin-left: 0; }
}
.ad-card > .logo, .ad-card > .mini-link { justify-self: start; }

/* ---------- library: tiles + "Everything" sections ---------- */
.lib-grid.tiles, .lib-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.lib-tile { position: relative; aspect-ratio: 1; background: #2e2e31; border: 1px solid var(--ed-line); border-radius: 10px; padding: 12px 12px 22px; transition: transform .1s; display: grid; place-items: center; overflow: hidden; color: var(--ed-text); min-width: 0; }
.lib-tile.icon { padding: 14px; }
.lib-tile svg, .lib-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lib-tile.lib { background: #e9dfc8; padding: 6px 6px 22px; }
.lib-tile.lib img { border-radius: 4px; }
.lib-tile small { position: absolute; left: 4px; right: 4px; bottom: 4px; font-size: 10.5px; color: var(--ed-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.lib-tile.lib small { color: #5d5548; }
.lib-tile:hover { border-color: var(--ed-accent); background: #33363d; transform: scale(1.04); }
.lib-tile.lib:hover { background: #f3ead6; }
.lib-tile.added { background: #1f5a33 !important; border-color: #36c26b; }
.lib-grid.sections { display: grid; gap: 22px; }
.lib-sec header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.lib-sec h4 { margin: 0; font-size: 14px; color: #fff; }
.lib-sec h4 small { color: var(--ed-muted); font-weight: 500; font-size: 12px; margin-left: 4px; }
.lib-see { background: none; border: 0; color: var(--ed-accent); font-weight: 700; font-size: 12.5px; padding: 2px 4px; }
.lib-see:hover { text-decoration: underline; }
.lib-none { color: var(--ed-muted); font-size: 13px; margin: 0; padding: 14px 0; }
.lib-art-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lib-art-row .lib-art { margin: 0; }
.lib-art-row .lib-art img { height: 120px; object-fit: cover; }
.lib-status .linkish { color: var(--ed-accent); }
