/* Inter — self-hosted (weights 400/500; latin + latin-ext + cyrillic + cyrillic-ext).
   CJK scripts (ja/zh/ko) have no glyphs in Inter and fall back to the system font
   stack automatically per character — expected, not a bug. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

:root {
  --bg: #080808;
  --bg-2: #181818;
  --bg-3: #1e1e1e;
  --line: #373737;
  --line-strong: #505050;
  --text: #ffffff;
  --muted: #959595;
  --primary: #1d9bf0;
  --primary-2: #4db5f5;
  --accent: #ffcb45;
  --green: #38c172;
  --red: #ff6b6b;
  --pink: #ff2d95;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 20px;
  --prism-gradient: linear-gradient(97.25deg, #b8ff45 3%, #ffcb45 22%, #ff00b8 100%);
  --post-img-size: 220px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.03em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; font-weight: 500; letter-spacing: -0.025em; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 1200px;
  margin: 16px auto 0;
  position: sticky;
  top: 16px;
  z-index: 10;
  transition: transform .25s ease, background .2s ease, box-shadow .2s ease;
}
.topbar.nav-hidden { transform: translateY(calc(-100% - 24px)); }
.topbar.nav-visible { transform: translateY(0); }
.brand { font-weight: 500; font-size: 18px; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  background: var(--prism-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rt-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  color: currentColor;
}
.rt-icon-lg { width: 1.25em; height: 1.25em; vertical-align: -0.18em; }
.admin-site-badge {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-right: 8px;
  white-space: nowrap;
}
.admin-site-badge.site-sets { background: #c0392b; border-color: #c0392b; color: #fff; }
.admin-site-badge.site-wallpapers { background: #1e7a3a; border-color: #1e7a3a; color: #fff; }
.nav-wrap { display: flex; align-items: center; flex: 1; gap: 12px; min-width: 0; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 auto; }
.nav a {
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
}
.nav a:hover { color: var(--pink); background: rgba(255,45,149,0.08); text-decoration: none; }
.nav a.active { color: var(--pink); background: transparent; font-weight: 500; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.balance {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--accent);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
}
.who { color: var(--muted); font-size: 14px; }
.inline { display: inline; margin: 0; }

/* ---- layout ---- */
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 30px 16px 60px; flex: 1; }
.section-title { margin: 36px 0 16px; font-size: 20px; font-weight: 500; letter-spacing: -0.025em; }
.muted { color: var(--muted); }
.small { font-size: 13px; letter-spacing: -0.033em; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.back { display: inline-block; margin-bottom: 16px; color: var(--muted); }

/* ---- hero ---- */
.hero {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 44px 40px;
}
.hero h1 { margin: 0 0 10px; font-size: 34px; }
.hero p { margin: 0 0 22px; color: var(--muted); max-width: 620px; font-size: 17px; }
.hero-img { background-size: cover; background-position: center; min-height: 340px; display: flex; flex-direction: column; justify-content: center; border-color: transparent; }
.hero-img h1 { font-size: 42px; }
.hero-img p { color: #ffffff; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 18px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
/* Outlined by default — matches the reference system's "elevation is drawn, not
   filled" language. Filled treatment is reserved for transactional CTAs (.btn-cta). */
.btn-primary { background: transparent; color: var(--text); border-color: var(--text); }
.btn-primary:hover { background: rgba(255, 255, 255, .08); }
.btn-ghost { background: transparent; color: var(--text); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-3); }
.btn-sm { padding: 6px 12px; font-size: 14px; border-radius: var(--radius-sm); }
.btn-lg { padding: 13px 24px; font-size: 17px; }
.btn-danger { background: var(--red); color: #2a0606; border-color: var(--red); }
.btn-danger:hover { background: #ff8585; border-color: #ff8585; }
/* Filled "Primary Action Button" — reserved for money-moving actions (pay,
   checkout, redeem, subscribe, buy RT, pay commission) so they keep visual
   weight even though every other button on the site is outline-only. */
.btn-cta { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-cta:hover { background: var(--muted); border-color: var(--muted); }
.btn-nav-outline { background: transparent; color: var(--pink); border-color: var(--pink); }
.btn-nav-outline:hover { background: rgba(255,45,149,0.12); }
.btn-nav-filled { background: var(--pink); color: var(--bg); border-color: var(--pink); }
.btn-nav-filled:hover { background: #ff5aa8; border-color: #ff5aa8; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 22px 0 16px; }

/* ---- grid + cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.gallery-grid { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--text);
  display: block;
  transition: border-color .15s ease, transform .1s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); text-decoration: none; }
.card-img-wrap { overflow: hidden; }
.card-img {
  aspect-ratio: 3 / 2;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-3);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
/* Portrait preview images are anchored to the top so the frame crops the bottom
   instead of the middle. Added dynamically by public/js/gallery-cards.js. */
.card-img-portrait { background-position: top; }
/* .confirm-art has a later base rule, so we need higher specificity to win. */
.confirm-art.confirm-art-portrait { background-position: top; }
/* Home featured set images use object-fit; portrait ones anchor to the top. */
.img-portrait { object-position: top; }
.card:hover .card-img { transform: scale(1.07); }
.card-img-link { display: block; position: relative; }
/* Tags overlaid on the artwork itself instead of taking up card-body space. */
.card-tags-overlay { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 5px; max-width: calc(100% - 20px); }
.tag-overlay {
  font-size: 11px; padding: 2px 8px; border-radius: var(--radius-sm);
  background: rgba(8, 8, 8, .8); color: var(--text);
}
.link-btn {
  background: none; border: 0; color: var(--primary-2); font: inherit; font-size: 14px;
  cursor: pointer; padding: 0; text-decoration: underline;
}
.link-btn:hover { color: var(--primary); }
.link-btn.danger { color: var(--accent); }
.link-btn.danger:hover { color: #ff7a7a; }
.card-body { padding: 14px 16px; }
.card-body h3 { margin: 0; font-size: 16px; }
/* Title left, image count anchored right, both on one line. */
.card-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.card-title-row .art-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.price { color: var(--accent); font-weight: 500; }
.tag {
  font-size: 12px; padding: 2px 8px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--line); color: var(--muted);
}
.tag-owned { color: var(--green); border-color: rgba(56,193,114,.4); }
.tag-hidden { color: var(--accent); }
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  vertical-align: middle;
  margin-left: 4px;
}
.badge-new { background: var(--green); color: var(--bg); }

/* ---- item detail ---- */
.item-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: start; }
.item-art {
  aspect-ratio: 3 / 2; border-radius: var(--radius);
  background-size: cover; background-position: center; background-color: var(--bg-3);
  border: 1px solid var(--line);
}
/* Item detail preview: fixed 3:2 frame; image is contained with letterbox bars. */
.item-art-wrap {
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-3);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  aspect-ratio: 3 / 2;
  max-height: min(520px, 60vh);
}
.item-art-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.item-info h1 { margin: 0 0 8px; }
.item-desc { color: var(--muted); }
.price-row { margin: 18px 0; }
.price-big { font-size: 26px; font-weight: 500; color: var(--accent); }
.owned-box {
  background: var(--bg-2); border: 1px solid rgba(56,193,114,.4);
  border-radius: var(--radius); padding: 18px;
}
.owned-label { color: var(--green); font-weight: 500; margin: 0 0 12px; }

/* ---- bundles ---- */
.bundles .bundle { padding: 22px; text-align: center; }
.bundle-rt { font-size: 22px; font-weight: 500; color: var(--accent); }
.bundle-price { font-size: 28px; font-weight: 500; margin: 6px 0; }
.bundle-rate { margin-bottom: 14px; }
.bundle form, .bundle a { display: block; }
.sub-card { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; }
.sub-active-row { display: flex; align-items: center; gap: 14px; }
.patron-perks { margin: 12px 0 0; padding-left: 20px; color: var(--text); }
.patron-perks li { margin: 4px 0; }
.sub-options { display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.sub-option { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--bg-2); }
.sub-option:has(input:checked) { border-color: var(--primary); background: rgba(29,155,240,.08); }
.sub-option input { accent-color: var(--primary); }
.sub-option-body { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 10px; flex: 1; font-size: 14px; }
.sub-option-label { font-weight: 500; }
.sub-option-price { font-weight: 500; color: var(--accent); }
.sub-option-equiv { color: var(--muted); font-size: 12px; }
.sub-option-save { font-size: 11px; padding: 2px 7px; border-radius: var(--radius-sm); background: var(--green); color: var(--bg); font-weight: 500; }

/* ---- forms ---- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.form input, .form textarea {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius); padding: 11px 13px; font: inherit;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--line-strong); }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.form-wide { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-wide .full { grid-column: 1 / -1; }
.form-wide button { grid-column: 1 / -1; justify-self: start; }
.form-inline { display: flex; gap: 10px; }
.form-inline input { flex: 1; background: var(--bg-3); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 11px 13px; }

/* ---- centered card (auth, checkout, error) ---- */
.centered-card {
  max-width: 440px; margin: 30px auto; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 30px;
}
.centered-card h1 { margin-top: 0; }
.checkout-badge {
  display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: -0.033em;
  color: var(--accent); border: 1px solid rgba(255,203,69,.4); border-radius: var(--radius-sm); padding: 3px 10px; margin-bottom: 12px;
}
.checkout-line { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checkout-actions { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 10px; }
.checkout-actions form { margin: 0; }
.checkout-actions .btn { width: 100%; }

/* ---- flash ---- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; }
.flash-msg { background: rgba(56,193,114,.12); border: 1px solid rgba(56,193,114,.4); color: #9ff0bf; }
.flash-err { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.4); color: #ffb3b3; }
.flash-warn { background: rgba(255,203,69,.12); border: 1px solid rgba(255,203,69,.4); color: var(--accent); }
.flash-order { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flash-order .inline { margin: 0; }
.flash-x { background: none; border: 0; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .6; padding: 0 4px; }
.flash-x:hover { opacity: 1; }

/* highlighted "your order" nav tab (shown alongside the green banner) */
.nav-order {
  background: var(--accent); color: var(--bg) !important; font-weight: 500;
  border-radius: var(--radius-sm); padding: 6px 12px; animation: orderpulse 1.8s ease-in-out infinite;
}
.nav-order:hover { background: #ffd97a; text-decoration: none; }
.nav-wallet-highlight {
  background: var(--accent); color: var(--bg) !important; font-weight: 500;
  border-radius: var(--radius-sm); padding: 6px 12px; animation: orderpulse 1.8s ease-in-out infinite;
}
.nav-wallet-highlight:hover { background: #ffd97a; text-decoration: none; }
.nav-guide { color: var(--accent) !important; border: 1px solid rgba(255,203,69,.5); animation: orderpulse 2s ease-in-out infinite; }
.card-highlight { outline: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(255,203,69,.2); animation: orderpulse 1.8s ease-in-out infinite; }
@keyframes orderpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 203, 69, .55); }
  50% { box-shadow: 0 0 0 6px rgba(255, 203, 69, 0); }
}

/* ---- wallet ---- */
.wallet-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.balance-card {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; text-align: right; min-width: 220px;
}
.balance-card.wide { display: flex; justify-content: space-between; align-items: center; text-align: left; width: 100%; }
.balance-label { color: var(--muted); font-size: 13px; }
.balance-amount { font-size: 30px; font-weight: 500; color: var(--accent); margin-bottom: 8px; }
.username-subscribed { color: var(--green); }

/* ---- discord invite button ---- */
.discord-invite { margin-bottom: 18px; }
.discord-link-wrap {
  display: inline-block;
  padding: 2px;
  border-radius: 12px;
  background: linear-gradient(135deg, #5865F2, #EB459E);
}
.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 500;
  background: var(--bg-2);
  border-radius: 10px;
  color: var(--text);
}
.btn-discord:hover { background: var(--bg-3); text-decoration: none; }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); letter-spacing: -0.033em; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--bg-3); }
.pos { color: var(--green); font-weight: 500; }
.neg { color: var(--red); font-weight: 500; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.status { font-size: 12px; padding: 2px 8px; border-radius: var(--radius-sm); text-transform: capitalize; }
.status-paid { background: rgba(56,193,114,.15); color: #9ff0bf; }
.status-pending { background: rgba(255,203,69,.15); color: var(--accent); }
.status-canceled { background: rgba(255,107,107,.15); color: #ffb3b3; }

/* ---- admin ---- */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.admin-nav { display: flex; gap: 6px; }
.admin-nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; }
.admin-nav a:hover, .admin-nav a.active { color: var(--text); background: var(--bg-3); text-decoration: none; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 16px 0 10px; }
.panel h2 { margin-top: 0; }
.commission-panel h3 { margin: 18px 0 8px; font-size: 15px; }
.commission-panel ul { margin: 10px 0; padding-left: 22px; }
.commission-panel li { margin: 5px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat-num { font-size: 24px; font-weight: 500; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.cell-item { display: flex; align-items: center; gap: 10px; }
.thumb { width: 40px; height: 28px; border-radius: 6px; background-size: cover; background-position: center; background-color: var(--bg-3); display: inline-block; }

/* ---- footer ---- */
.footer {
  border-top: 1px solid var(--line); padding: 20px 28px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px;
}
.lang-switch a { margin-left: 8px; color: var(--muted); }
.lang-switch a.active { color: var(--accent); font-weight: 500; }

/* ---- cart / bundle / order ---- */
.cart-count { background: var(--primary); color: var(--bg); border-radius: var(--radius-sm); padding: 0 7px; font-size: 12px; font-weight: 500; }
.cart-toggle {
  background: var(--bg-3); border: 1px solid var(--text); color: var(--text);
  border-radius: var(--radius); padding: 6px 10px; font-size: 16px; cursor: pointer;
  position: relative; line-height: 1;
}
.cart-toggle:hover { background: var(--line); }
.cart-toggle .cart-count { position: absolute; top: -6px; right: -6px; }
.card-img-link { display: block; }
.plain { color: var(--text); }
.card-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.card-redeem-btn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.redeem-short { display: none; }
/* Small square icon button replacing the old underlined "or add to cart" text link. */
.card-cart-btn {
  flex: none; width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font-size: 15px; line-height: 1; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.card-cart-btn:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .06); }
.card-cart-btn.active { border-color: var(--green); color: var(--green); }
.full-form, .full-form button { width: 100%; }
.bundle { position: relative; }
.bundle-badge {
  position: absolute; top: 10px; right: 10px; background: rgba(255,203,69,.15);
  color: var(--accent); border: 1px solid rgba(255,203,69,.4);
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: var(--radius-sm);
}
.rt-panel { padding: 28px; max-width: 520px; margin: 0 auto 30px; }
.rt-header { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.rt-total { font-size: 32px; font-weight: 500; color: var(--accent); }
.rt-form { display: flex; flex-direction: column; gap: 14px; }
.rt-amount-label { display: flex; flex-direction: column; gap: 8px; font-weight: 500; font-size: 14px; }
.rt-amount-label input[type="number"] {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius); padding: 12px 14px; font: inherit; font-size: 18px; font-weight: 500;
}
.rt-amount-label input[type="number"]:focus { outline: none; border-color: var(--line-strong); }
.rt-amount-label input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}
.rt-amount-label input[type="range"]:disabled { opacity: .5; cursor: not-allowed; }
.rt-summary { font-size: 14px; }
.buy-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.buy-actions form { margin: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.cart-sidebar {
  position: fixed; top: 0; right: 0; width: 360px; max-width: 90vw; height: 100vh;
  background: var(--bg-2); border-left: 1px solid var(--line);
  z-index: 100;
  transform: translateX(110%); transition: transform .25s ease;
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.cart-sidebar.open { transform: translateX(0); }
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-sidebar-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.cart-close { background: none; border: 1px solid var(--text); border-radius: var(--radius); color: var(--text); font-size: 24px; cursor: pointer; line-height: 1; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.cart-sidebar-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.cart-sidebar-row {
  display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 10px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px;
}
.cart-sidebar-row .thumb { width: 56px; height: 42px; }
.cart-sidebar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cart-sidebar-price { color: var(--accent); font-weight: 500; font-size: 14px; }
.cart-sidebar-summary { border-top: 1px solid var(--line); padding-top: 14px; }
.cart-sidebar-actions { display: flex; gap: 10px; }
.cart-sidebar-actions .btn, .cart-sidebar-actions form { flex: 1; }
.cart-sidebar-actions .btn { border: 1px solid var(--text); }
.cart-sidebar-notice {
  font-size: 13px; color: var(--muted);
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px;
}
.cart-sidebar-notice a { color: var(--primary-2); }
.cart-notice { margin-top: 18px; }
.cart-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 18px; }
.cart-row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.cart-row .thumb { width: 72px; height: 54px; }
.cart-title { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.cart-price { color: var(--accent); font-weight: 500; }
.cart-remove { border: 1px solid var(--red); color: var(--red); background: transparent; padding: 4px 10px; }
.cart-remove:hover { background: rgba(255,107,107,0.12); }
.cart-summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px;
}
.cart-total { font-size: 26px; font-weight: 500; color: var(--accent); }
.cart-summary-actions { display: flex; gap: 10px; align-items: center; }
.cart-summary-actions form { margin: 0; }

.checkout-line.total { border-bottom: none; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; font-size: 18px; }
.order-items { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.order-row {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
}

/* ---- art name (distinct display font) + image count ---- */
.art-name { font-family: "Constantia", "Palatino Linotype", "Book Antiqua", Georgia, serif; font-weight: 600; letter-spacing: .2px; }
/* image count always sits on its own line under the title */
.art-count { display: block; margin-top: 2px; font-family: "Constantia", "Palatino Linotype", Georgia, serif; font-size: .72em; font-style: italic; color: var(--muted); font-weight: 400; white-space: nowrap; }
/* Gallery card header: count sits beside the title instead of on its own line. */
.card-title-row .art-count { display: inline; margin-top: 0; flex: none; }
.confirm-art { aspect-ratio: 16 / 9; border-radius: 12px; background-size: cover; background-position: center; background-color: var(--bg-3); border: 1px solid var(--line); margin-bottom: 14px; }
h1.art-name { font-size: 30px; margin: 0 0 6px; }
h3.art-name { font-size: 16px; margin: 0 0 8px; }

/* ---- item preview gallery ---- */
.item-gallery { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb-btn { width: 64px; height: 44px; border-radius: 8px; background-size: cover; background-position: center; border: 2px solid var(--line); cursor: pointer; }
.thumb-btn.active { border-color: var(--primary); }
.card-img-link { position: relative; }

/* ---- stats panel ---- */
.stats-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 16px 0; }
.stats-panel > div { background: var(--bg-2); padding: 10px 14px; }
.stats-panel dt { color: var(--muted); font-size: 12px; }
.stats-panel dd { margin: 2px 0 0; font-weight: 500; }

/* ---- password reveal ---- */
.pw { margin-top: 10px; }
.pw-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-right: 6px; }
/* Password value always stays on a single line (scrolls if very long). */
.pw-code { display: inline-block; max-width: 100%; overflow-x: auto; white-space: nowrap; vertical-align: bottom; font-family: ui-monospace, Menlo, monospace; background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; color: var(--accent); user-select: all; }

/* ---- WIP / expired ---- */
.card.wip .card-img { position: relative; filter: saturate(.8); }
.wip-badge { position: absolute; top: 10px; left: 10px; background: var(--accent); color: var(--bg); font-weight: 500; font-size: 11px; padding: 2px 8px; border-radius: var(--radius-sm); letter-spacing: .05em; }
.card-expired { opacity: .6; }
.card-expired .card-img { filter: grayscale(1); }
.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-row {
  display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  color: var(--text); text-decoration: none;
}
.ticket-row:hover { border-color: var(--line-strong); text-decoration: none; }
.ticket-kind { font-size: 11px; text-transform: uppercase; letter-spacing: -0.033em; color: var(--muted); }
.ticket-subject { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-site { font-size: 11px; }
.ticket-status.status-open { background: rgba(56,193,114,.15); color: #9ff0bf; }
.ticket-status.status-closed { background: rgba(149,149,149,.15); color: var(--muted); }
.ticket-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ticket-replies { display: flex; flex-direction: column; gap: 10px; }
.ticket-reply { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.ticket-reply.staff { border-color: rgba(29,155,240,.5); background: rgba(29,155,240,.08); }
.ticket-reply-meta { display: flex; justify-content: space-between; margin-bottom: 8px; }
.ticket-attachments { display: flex; flex-wrap: wrap; gap: 10px; }
.ticket-attachment-thumb { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.site-badge { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px 8px; font-size: 11px; color: var(--muted); }

/* ---- admin form extras ---- */
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.preview-input { display: block; width: 100%; margin-bottom: 8px; background: var(--bg-3); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 9px 12px; font: inherit; }
.order-mid { text-align: left; min-width: 0; }

/* ---- home / front page ---- */
.home-hero {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 40px;
}
.home-hero.hero-img { background-size: cover; background-position: center; min-height: 380px; display: flex; flex-direction: column; justify-content: center; border-color: transparent; }
.home-hero h1 { margin: 0 0 12px; font-size: 40px; }
.home-hero.hero-img h1 { font-size: 46px; }
.home-hero p { margin: 0 0 24px; color: var(--muted); max-width: 640px; font-size: 18px; }
.home-hero.hero-img p { color: #ffffff; }
.home-lang { margin-top: 24px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-pill { display: inline-block; padding: 4px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-3); color: var(--text); font-size: 13px; }
.lang-pill:hover { border-color: var(--line-strong); text-decoration: none; }
.lang-pill.active { background: var(--primary); color: var(--bg); border-color: transparent; font-weight: 500; }
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.showcase-item { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); }
.showcase-item img { display: block; width: 100%; height: 180px; object-fit: cover; }
.showcase-item:hover { border-color: var(--line-strong); text-decoration: none; }
.showcase-title { display: block; padding: 9px 12px; font-weight: 500; font-size: 14px; }
.home-foot { margin-top: 28px; }

/* admin showcase / featured thumbnails */
.admin-thumbs { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.admin-thumb { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; max-width: 160px; }
.admin-thumb .thumb { width: 160px; height: 100px; border-radius: 10px; }

/* ---- tags + tag filter ---- */
.tag-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.tag-chip { display: inline-block; padding: 5px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 13px; }
.tag-chip:hover { border-color: var(--line-strong); color: var(--text); text-decoration: none; }
.tag-chip.active { background: var(--primary); color: var(--bg); border-color: transparent; font-weight: 500; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.item-tags { margin: 10px 0; }
.tag-mini { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-sm); background: transparent; border: 1px solid var(--line); color: var(--muted); }
.tag-mini:hover { border-color: var(--line-strong); color: var(--text); text-decoration: none; }
.tag-mini-series { border-color: var(--line-strong); color: var(--text); }
.tags-edit { display: flex; gap: 6px; margin-top: 8px; }
.tags-input { flex: 1; min-width: 0; background: var(--bg-3); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 13px; }

/* ---- gallery search ---- */
.gallery-search { display: flex; gap: 8px; align-items: center; margin: 0 0 16px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 180px; max-width: 360px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 9px 14px; font: inherit; font-size: 15px; }
.search-input:focus { border-color: var(--line-strong); outline: none; }
.month-select { max-width: 220px; }
.tag-select, .series-select { max-width: 220px; }
.card-date { margin-top: 4px; }
.gallery-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.wip-column { position: sticky; top: 86px; }
.wip-column .section-title { margin-top: 0; font-size: 16px; }
.wip-grid { display: flex; flex-direction: column; gap: 14px; }
.wip-grid .card-img { aspect-ratio: 1 / 1; }

/* ---- FAQ accordion ---- */
/* grid-template-areas keeps the "Browse the gallery" button visually under
   the heading on desktop, while still living after the accordion in DOM
   order — so the mobile single-column fallback (natural source order) needs
   no reordering CSS at all. Must stay before the shared @media block below
   so its mobile override there can win the cascade (same specificity, later
   source order wins — matching how .gallery-layout above does it). */
.faq-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px 40px;
  align-items: start;
}
.faq-heading { grid-column: 1; grid-row: 1; position: sticky; top: 86px; }
.faq-accordion { grid-column: 2; grid-row: 1 / span 2; border-top: 1px solid var(--line); }
.faq-browse { grid-column: 1; grid-row: 2; align-self: start; }
.faq-heading h1 { margin: 0 0 16px; font-size: 30px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: 0; padding: 18px 0; text-align: left; cursor: pointer;
  font: inherit; color: var(--text);
}
.faq-q { font-size: 16px; font-weight: 500; }
/* Plus/minus toggle: two bars form a "+"; the vertical bar rotates onto the
   horizontal one when open, leaving a "−". CSS-only, no icon asset needed. */
.faq-icon { position: relative; width: 16px; height: 16px; flex: none; }
.faq-icon::before, .faq-icon::after {
  content: ''; position: absolute; top: 50%; left: 50%; background: var(--text);
  transition: transform .2s ease;
}
.faq-icon::before { width: 12px; height: 1.5px; transform: translate(-50%, -50%); }
.faq-icon::after { width: 1.5px; height: 12px; transform: translate(-50%, -50%) rotate(0deg); }
.faq-item.open .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
/* Height + opacity reveal via the grid-template-rows 0fr/1fr technique — no
   JS height measurement needed, animates to the content's real height. */
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-answer-inner { overflow: hidden; opacity: 0; transition: opacity .15s ease; padding: 0 0 18px; color: var(--muted); }
.faq-item.open .faq-answer-inner { opacity: 1; }
.faq-answer-inner ul { margin: 0; padding-left: 20px; }
.faq-answer-inner li { margin: 6px 0; }
.faq-answer-inner p { margin: 0; }

.age-gate { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.88); display: none; align-items: center; justify-content: center; padding: 20px; }
.age-gate.open { display: flex; }
.age-gate-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; max-width: 460px; width: 100%; text-align: center; }
.age-gate-box h2 { margin: 0 0 12px; font-size: 22px; }
.age-gate-box p { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }
.age-gate-actions { display: flex; flex-direction: column; gap: 10px; }
.age-gate-actions .btn { width: 100%; }

.confirm-dialog { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; max-width: 380px; width: calc(100% - 40px); color: var(--text); }
.confirm-dialog::backdrop { background: rgba(0, 0, 0, 0.88); }
.confirm-dialog h3 { margin: 0 0 10px; font-size: 18px; }
.confirm-dialog p { margin: 0 0 16px; }
.confirm-dialog input[type="password"] { width: 100%; background: var(--bg-3); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 11px 13px; margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---- hamburger (hidden on desktop) ---- */
.hamburger {
  display: none; background: none; border: 0; color: var(--text);
  font-size: 24px; cursor: pointer; padding: 4px 8px; line-height: 1;
}

/* ---- responsive ---- */
@media (max-width: 760px) {
  /* --- topbar: brand + actions on one row, nav hidden on mobile --- */
  .topbar {
    flex-wrap: nowrap; padding: 10px 16px; gap: 0;
    background: rgba(16, 19, 26, 0.8); backdrop-filter: blur(8px);
    border: none; border-bottom: 1px solid var(--line); border-radius: 0;
    max-width: none; margin: 0; top: 0;
  }
  .brand { font-size: 16px; flex: 1; }
  .nav-wrap { display: none; }
  .cart-sidebar { width: 100%; max-width: none; }

  /* --- container --- */
  .container { padding: 18px 14px 40px; }
  .section-title { font-size: 18px; margin: 24px 0 12px; }

  /* --- home hero --- */
  .home-hero { padding: 28px 18px; border-radius: 12px; }
  .home-hero h1, .home-hero.hero-img h1 { font-size: 26px; }
  .home-hero p { font-size: 15px; }
  .home-hero.hero-img { min-height: 280px; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .hero-cta .btn { width: 100%; text-align: center; }
  .home-lang { margin-top: 18px; gap: 6px; }

  /* --- gallery grid --- */
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .showcase-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .showcase-item img { height: 120px; }
  .showcase-title { font-size: 13px; padding: 7px 10px; }

  /* --- gallery search + tags --- */
  .gallery-search { margin-bottom: 12px; }
  .search-input { min-width: 0; max-width: none; font-size: 14px; padding: 8px 12px; }
  .month-select { max-width: none; }
  .tag-filter { gap: 6px; margin-bottom: 14px; }
  .tag-chip { font-size: 12px; padding: 4px 10px; }
  .gallery-layout { grid-template-columns: 1fr; }
  .wip-column { position: static; }
  .wip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .wip-grid .card-img { aspect-ratio: 3 / 2; }

  /* --- item detail --- */
  .item-detail { grid-template-columns: 1fr; gap: 20px; }
  .item-art-wrap { max-height: 300px; }
  h1.art-name { font-size: 24px; }
  .stats-panel { grid-template-columns: 1fr 1fr; }
  .buy-actions .btn { width: 100%; }

  /* --- cart --- */
  .cart-row { grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 10px; padding: 10px 12px; }
  .cart-row .thumb { width: 64px; height: 48px; }
  .cart-row .cart-rt { display: none; }
  .cart-summary { flex-direction: column; align-items: stretch; padding: 14px; gap: 12px; }
  .cart-summary-actions { flex-direction: column; gap: 8px; }
  .cart-summary-actions form { display: block; width: 100%; }
  .cart-summary-actions .btn { width: 100%; }
  .cart-summary-actions .btn-ghost { border-color: rgba(255,255,255,0.85); }

  /* --- store bundles --- */
  .bundles .bundle { padding: 16px; }
  .bundle-price { font-size: 22px; }
  .sub-card { flex-direction: column; gap: 14px; align-items: stretch; text-align: center; }
  .sub-active-row { flex-direction: column; gap: 10px; }

  /* --- forms --- */
  .form-wide { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 20px; }

  /* --- wallet --- */
  .wallet-head { flex-direction: column; }
  .balance-card { min-width: 0; width: 100%; text-align: center; }
  .balance-card.wide { flex-direction: column; text-align: center; }
  .balance-amount { font-size: 24px; }

  /* --- tables --- */
  .table { font-size: 13px; }
  .table th, .table td { padding: 6px 6px; }

  /* --- order page --- */
  .order-row { grid-template-columns: 40px 1fr; gap: 10px; }

  /* --- footer --- */
  .footer { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 16px; }
  .lang-switch { font-size: 12px; }

  /* --- misc --- */
  .centered-card { margin: 16px auto; padding: 22px 18px; }
  .admin-head { flex-direction: column; align-items: flex-start; }
  .admin-nav { flex-wrap: wrap; gap: 4px; font-size: 13px; }
  .admin-nav a { padding: 5px 10px; }

  /* --- FAQ --- */
  /* Reset to a single auto-placed column — grid-template-areas is dropped so
     items fall back to natural DOM order (heading, accordion, button),
     which is already the order wanted on mobile. No reordering needed. */
  .faq-layout { grid-template-columns: 1fr; gap: 16px; }
  .faq-heading { position: static; grid-column: auto; grid-row: auto; }
  .faq-accordion { grid-column: auto; grid-row: auto; }
  .faq-browse { grid-column: auto; grid-row: auto; }
}

/* ---- compact commission panel ---- */
.commission-panel--compact { font-size: 13.5px; line-height: 1.5; }
.commission-panel--compact h2 { font-size: 18px; }
.commission-panel--compact h3 { margin: 12px 0 5px; font-size: 14px; }
.commission-panel--compact ul { margin: 6px 0; }
.commission-panel--compact li { margin: 3px 0; }
.commission-panel--compact p { margin: 6px 0; }
.commission-fields {
  list-style: none; padding-left: 0 !important;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2px 16px;
}

/* ---- admin: user filter + pagination ---- */
.filter-tabs { display: inline-flex; gap: 6px; }
.pager { display: flex; align-items: center; gap: 14px; margin-top: 14px; }

/* ---- posts: square cover image ---- */
.post-img {
  display: block;
  width: var(--post-img-size);
  height: var(--post-img-size);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  background-color: var(--bg-3);
}
.post-img-link {
  display: block;
  float: right;
  margin: 0 0 12px 16px;
  overflow: hidden;
  border-radius: var(--radius);
}
.post-img-link:hover .post-img { transform: scale(1.04); }
.post-img-hero {
  float: right;
  margin: 0 0 16px 20px;
}
.post-card::after {
  content: "";
  display: table;
  clear: both;
}
.post-form-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 6px;
}

@media (max-width: 600px) {
  .post-img-link,
  .post-img-hero {
    float: none;
    margin: 0 auto 14px;
  }
  .post-img {
    width: min(100%, 280px);
    height: auto;
    margin: 0 auto;
  }
}

/* ============================================================
   Mobile UI revamp additions
   ============================================================ */

/* Header action group (cart + hamburger) — hidden on desktop */
.header-actions {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Drawer shell — desktop shows inline nav as before */
.mobile-drawer,
.mobile-backdrop,
.drawer-head,
.drawer-close,
.drawer-section,
.drawer-icon,
.drawer-auth,
.drawer-balance,
.bottom-nav {
  display: none;
}

/* Better home hero scrim */
.home-hero {
  position: relative;
  overflow: hidden;
}
.home-hero.hero-img::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,8,8,.82) 0%, rgba(8,8,8,.35) 55%, rgba(8,8,8,.15) 100%);
  pointer-events: none;
  z-index: 0;
}
.home-hero.hero-img > * { position: relative; z-index: 1; }

/* Language select for mobile (hidden by default) */
.home-lang-select,
.footer-lang-select {
  display: none;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}

/* Sticky item CTA bar */
.item-sticky-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  background: rgba(14,14,16,.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
}
.item-sticky-bar .item-sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
}
.item-sticky-bar .item-sticky-price { font-size: 18px; font-weight: 500; color: var(--accent); }
.item-sticky-bar .item-sticky-price small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.item-sticky-bar form { flex: 1; max-width: 220px; }
.item-sticky-bar .btn { width: 100%; }

/* Gallery filter sheet toggle */
.gallery-filter-toggle {
  display: none;
  width: 100%;
  margin-bottom: 12px;
}
.gallery-filter-sheet {
  display: contents;
}

@media (max-width: 760px) {
  /* Header */
  .topbar { padding: 10px 16px; gap: 0; }
  .header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .cart-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); color: var(--text); font-size: 22px; line-height: 1; }

  /* Mobile drawer */
  .mobile-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0;
    right: -100%;
    width: min(320px, 85vw);
    max-width: 320px;
    background: var(--bg-2);
    border-left: 1px solid var(--line);
    z-index: 9999;
    transition: right .24s ease-out, visibility .24s;
    padding: 0;
    gap: 0;
    overflow-y: auto;
    visibility: hidden;
  }
  .mobile-drawer.open { right: 0; visibility: visible; }
  .mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
    visibility: hidden;
  }
  .mobile-backdrop.open { opacity: 1; pointer-events: auto; visibility: visible; }

  .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--bg-2);
    z-index: 2;
  }
  .drawer-head .brand { font-size: 18px; }
  .drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
    border-radius: 10px; font-size: 18px; cursor: pointer;
  }
  .drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    flex: 1;
  }
  .drawer-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 15px;
    color: var(--text);
  }
  .drawer-nav a.active { background: rgba(255,45,149,0.12); color: var(--pink); font-weight: 500; }
  .drawer-section {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding: 16px 12px 6px;
  }
  .drawer-icon {
    display: inline-block;
    width: 24px;
    text-align: center;
    font-size: 17px;
  }
  .drawer-auth {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
  }
  .drawer-auth .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  .drawer-balance {
    display: block;
    color: var(--accent);
    font-weight: 500;
    text-align: center;
    padding-bottom: 4px;
  }

  /* Bottom nav */
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    background: rgba(12,12,14,.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px 4px;
    color: var(--muted);
    font-size: 10px;
    text-decoration: none;
    position: relative;
    border-radius: 10px;
  }
  .bottom-nav-item.active { color: var(--pink); }
  .bottom-nav-icon { font-size: 20px; line-height: 1; }
  .bottom-nav-label { white-space: nowrap; }
  .bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    padding: 0 4px;
    border: 2px solid #0c0c0e;
  }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }

  /* Cart sidebar full-width on small screens */
  .cart-sidebar {
    width: 100%;
    max-width: none;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  /* Container */
  .container { padding: 14px 14px 40px; }

  /* Home hero */
  .home-hero { padding: 22px 18px; border-radius: 14px; min-height: 60vh; display: flex; flex-direction: column; justify-content: flex-end; }
  .home-hero h1, .home-hero.hero-img h1 { font-size: 26px; }
  .home-hero p { font-size: 15px; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .hero-cta .btn { width: 100%; text-align: center; }
  .home-lang { display: none; }
  .home-lang-select { display: inline-block; margin-top: 16px; width: 100%; }

  /* Featured grid */
  .showcase-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .showcase-item img { height: 130px; }

  /* Gallery */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px 12px; }
  .card-body h3 { font-size: 13.5px; }
  .card-title-row { margin-bottom: 2px; }
  .art-count { font-size: 11px; }
  .card-meta { margin-top: 6px; }
  .price { font-size: 14px; }
    .card-actions { margin-top: 8px; }
  .card-actions form { flex: 1; }
  .card-actions .btn,
  .card-actions .card-redeem-btn,
  .card-actions button {
    width: 100%;
    min-height: 40px;
    font-size: 13px;
  }
  .card-redeem-btn .redeem-full { display: none; }
  .card-redeem-btn .redeem-short { display: inline; }
  .card-cart-btn { width: 100%; height: 40px; }

  /* Gallery filters */
  .gallery-search { flex-wrap: wrap; gap: 8px; }
  .gallery-search .search-input { flex: 1 1 100%; font-size: 16px; }
  .gallery-search select.search-input { flex: 1 1 calc(50% - 4px); }
  .gallery-search button[type="submit"],
  .gallery-search .btn-ghost { flex: 1; }

  /* Item page */
  .item-detail { grid-template-columns: 1fr; gap: 18px; }
  .item-art-wrap { max-height: 52vh; }
  h1.art-name { font-size: 22px; }
  .thumbs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .thumb-btn { flex: none; }
  .item-sticky-bar { display: block; }
  .buy-actions .btn-lg { width: 100%; }

  /* Footer language */
  .lang-switch a { display: none; }
  .footer-lang-select { display: inline-block; background: transparent; }
}

@media (max-width: 420px) {
  .gallery-search select.search-input { flex: 1 1 100%; }
}
