:root {
  --bg: #f3eee2;
  --bg-soft: #faf6ec;
  --bg-elev: #ffffff;
  --ink: #1a2238;
  --ink-soft: #3e4666;
  --muted: #7a7e94;
  --line: #ddd5c4;
  --line-strong: #c9bfa9;
  --accent: #b97a2b;
  --accent-soft: #f1e3cd;
  --accent-ink: #ffffff;
  --gold: #c08a3b;
  --warn: #c4533a;
  --ok: #3d8a5a;
  --shadow-sm: 0 1px 2px rgba(26, 34, 56, 0.07);
  --shadow-md: 0 8px 24px -10px rgba(26, 34, 56, 0.18);
  --shadow-lg: 0 24px 60px -22px rgba(26, 34, 56, 0.32);
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --serif: "Iowan Old Style", "Apple Garamond", Baskerville, "Times New Roman", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0e1530;
  --bg-soft: #15203c;
  --bg-elev: #1a294b;
  --ink: #f1e7d2;
  --ink-soft: #c8bea8;
  --muted: #8a8674;
  --line: #283354;
  --line-strong: #3a4a72;
  --accent: #d9a05a;
  --accent-soft: #2a2540;
  --accent-ink: #0e1530;
  --gold: #e6c074;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { color-scheme: light dark; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.6rem); line-height: 1.1; margin: 0; }
h2 { font-size: 1.5rem; margin: 0; }
.h2-icon { display: inline-flex; align-items: center; gap: 12px; }
.h2-icon svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
h3 { font-size: 1.05rem; margin: 0; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 0 0 8px 0; z-index: 100; }
.skip-link:focus { left: 0; }

/* Buttons — façon timbré, coins légèrement arrondis */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  position: relative;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 2px 0 0 color-mix(in srgb, var(--accent) 60%, #000);
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.55) 0 1.5px, transparent 2px),
    radial-gradient(circle at 80% 30%, rgba(255,255,255,0.5) 0 1px, transparent 1.5px),
    radial-gradient(circle at 50% 70%, rgba(255,255,255,0.5) 0 1.5px, transparent 2px);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 3px 0 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn-primary:hover::before { opacity: 1; animation: spark 1.2s linear infinite; }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, #000); }
@keyframes spark {
  0% { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 80px 0, -60px -10px, 100px 30px; }
}
.btn-ghost { background: var(--bg-soft); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; }
.link-btn {
  background: transparent; border: 0; color: var(--accent);
  font-weight: 500; padding: 4px 6px; border-radius: 6px;
}
.link-btn:hover { background: var(--accent-soft); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--ink); border-radius: 50%;
}
.icon-btn:hover { border-color: var(--ink-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.discord-btn { color: #5865F2; }
.discord-btn:hover { background: #5865F2; color: #fff; border-color: #5865F2; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 2px 0 0 var(--accent);
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text strong { display: block; font-family: var(--serif); font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-text small { display: block; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; }

.topbar-nav { display: flex; gap: 4px; justify-self: center; }
.topbar-nav a {
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
}
.topbar-nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

.topbar-tools { display: inline-flex; gap: 10px; align-items: center; }
.lang { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-btn {
  background: transparent; border: 0; padding: 5px 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--ink-soft); border-radius: 999px;
}
.lang-btn.active { background: var(--ink); color: var(--bg); }

/* Main layout */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Hero — asymétrique avec bande gauche */
.hero {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 48px clamp(28px, 5vw, 64px);
  display: grid;
  gap: 28px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; right: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-inner { max-width: 720px; display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
/* Vraies runes Forgemagie Retro (SVG) scattered dans tout le hero */
.hero-runes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-runes .rune {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 72px; height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
  transform: rotate(var(--rot));
  animation: rune-bob 6s ease-in-out infinite;
}
.hero-runes .rune-lg { width: 96px; }
.hero-runes .rune-sm { width: 52px; opacity: 0.75; }
.hero-runes .rune:nth-child(2) { animation-delay: -1.2s; }
.hero-runes .rune:nth-child(3) { animation-delay: -2.4s; }
.hero-runes .rune:nth-child(4) { animation-delay: -3.1s; }
.hero-runes .rune:nth-child(5) { animation-delay: -1.8s; }
.hero-runes .rune:nth-child(6) { animation-delay: -4.0s; }
@keyframes rune-bob {
  0%, 100% { transform: rotate(var(--rot)) translateY(0); }
  50%      { transform: rotate(var(--rot)) translateY(-5px); }
}
@media (max-width: 720px) {
  .hero-runes .rune { width: 44px; }
  .hero-runes .rune-lg { width: 56px; }
  .hero-runes .rune-sm { width: 32px; opacity: 0.5; }
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  align-self: flex-start;
}
.hero-lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* Stats — bandeau horizontal façon ticker */
.hero-stats {
  list-style: none; padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.hero-stats li {
  flex: 1 1 150px;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-right: 1px dashed var(--line);
}
.hero-stats li:last-child { border-right: 0; }
.hero-stats strong {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hero-stats span { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }

/* Panel */
.panel {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px clamp(20px, 3vw, 36px);
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > legend {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.field input, .field select, .field textarea {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .12s, box-shadow .12s, background .12s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field textarea { resize: vertical; min-height: 80px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

fieldset.field-ini {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg);
}
fieldset.field-ini legend { padding: 0 6px; }

.grid-order {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.grid-order .field-item { grid-column: span 7; }
.grid-order .field-qty { grid-column: span 2; }
.grid-order .field-item + .field { grid-column: span 3; }
.grid-order .field:not(.field-item):not(.field-qty):not(.field-item):not(.field-details):not(.field-ini) { grid-column: span 4; }
.grid-order .field-ini { grid-column: span 8; }
.grid-order .field-details { grid-column: span 12; }
@media (max-width: 900px) {
  .grid-order .field-item, .grid-order .field-qty, .grid-order .field-ini, .grid-order .field-details, .grid-order .field { grid-column: span 12 !important; }
}

.autocomplete { position: relative; }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 20;
  max-height: 320px;
  overflow: auto;
}
.suggestion {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.suggestion:hover, .suggestion:focus { background: var(--accent-soft); }
.suggestion img { width: 36px; height: 36px; object-fit: contain; }
.suggestion strong { display: block; font-family: var(--sans); font-weight: 600; font-size: 14px; }
.suggestion span { display: block; font-size: 12px; color: var(--muted); }

.order-submit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.price-preview { font-size: 15px; font-weight: 500; color: var(--ink); }
.price-preview strong { color: var(--accent); }
.form-status { font-size: 13px; color: var(--warn); grid-column: 1 / -1; min-height: 1.2em; }
.form-status.ok { color: var(--ok); }
@media (max-width: 600px) {
  .order-submit { grid-template-columns: 1fr; }
}

/* Orders grid */
.orders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) { .orders-grid { grid-template-columns: 1fr; } }
.orders-col h3 { margin-bottom: 12px; font-family: var(--sans); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color .12s;
}
.order-row:hover { border-color: var(--line-strong); }
.order-row .order-media {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--bg-soft); border-radius: 10px; border: 1px solid var(--line);
}
.order-row .order-media img { width: 38px; height: 38px; object-fit: contain; }
.order-row .order-copy strong { display: block; font-weight: 600; font-size: 14px; color: var(--ink); }
.order-row .order-copy span { display: block; font-size: 12px; color: var(--muted); }
.order-aside { text-align: right; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.status-pill {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.status-pill.done { background: color-mix(in srgb, var(--ok) 18%, var(--bg-soft)); color: var(--ok); }
.status-pill.in_progress { background: color-mix(in srgb, var(--gold) 22%, var(--bg-soft)); color: var(--gold); }
.status-pill.queue, .status-pill.todo { background: var(--accent-soft); color: var(--accent); }
.empty-list { padding: 22px 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-illu { width: 60px; height: 48px; color: var(--muted); opacity: 0.55; }

.admin-actions { display: inline-flex; gap: 4px; margin-top: 6px; }
.admin-actions button {
  font-size: 11px; padding: 3px 8px;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--ink-soft);
}
.admin-actions button:hover { border-color: var(--accent); color: var(--accent); }
.admin-actions .refuse-btn { color: var(--warn); }
.admin-actions .refuse-btn:hover { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }

/* Catalogue section — filtres à droite */
.catalogue-section {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.catalogue-section .filters { grid-column: 2; grid-row: 1; }
.catalogue-section .catalogue { grid-column: 1; grid-row: 1; }
@media (max-width: 1024px) {
  .catalogue-section { grid-template-columns: 1fr; }
  .catalogue-section .filters, .catalogue-section .catalogue { grid-column: 1; }
  .catalogue-section .filters { grid-row: 2; }
  .catalogue-section .catalogue { grid-row: 1; }
}
.filters {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 80px;
  max-height: calc(100vh - 100px);
  overflow: auto;
}
@media (max-width: 1024px) {
  .filters { position: static; max-height: none; }
}
.filters-head { display: flex; align-items: center; justify-content: space-between; }
.filters-head h2 { font-size: 1.2rem; }
.label-mini { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.filter-group { border-top: 1px solid var(--line); padding-top: 16px; }
.filter-group:first-of-type { border-top: 0; padding-top: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; gap: 6px; align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-size: 10px; opacity: .6; }
.range { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.range strong { color: var(--accent); }
.range input { width: 100%; accent-color: var(--accent); }

/* Catalogue */
.catalogue { display: flex; flex-direction: column; gap: 18px; }
.catalogue-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.catalogue-head h2 { font-size: 1.8rem; }
.count-badge {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
}
.active-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-active {
  background: var(--accent-soft); color: var(--accent);
  padding: 4px 10px 4px 12px; border-radius: 999px;
  font-size: 12px; display: inline-flex; gap: 8px; align-items: center;
  border: 0;
}
.badge-active button { background: transparent; border: 0; color: inherit; font-size: 14px; line-height: 1; padding: 0; }

.catalogue-tools {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.search {
  flex: 1; min-width: 220px;
  position: relative;
  display: flex; align-items: center;
}
.search svg { position: absolute; left: 14px; width: 16px; height: 16px; color: var(--muted); }
.search input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  padding: 11px 14px 11px 40px;
  border-radius: 999px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.sort { display: inline-flex; gap: 4px; align-items: center; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.sort .label-mini { margin: 0 6px 0 8px; }
.sort-btn {
  background: transparent; border: 0; padding: 5px 12px;
  font-size: 13px; color: var(--ink-soft); border-radius: 999px;
}
.sort-btn:hover { color: var(--ink); }
.sort-btn.active { background: var(--ink); color: var(--bg); }

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.item-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.item-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.item-card:hover::after { transform: scaleX(1); }
.item-media {
  display: flex; align-items: center; justify-content: center;
  gap: 14px;
  padding: 18px 20px 10px;
  border-bottom: 1px dashed var(--line);
  background: var(--bg-soft);
}
.item-image { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.item-image[src=""] { visibility: hidden; }
.item-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.item-type {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.item-name { font-family: var(--serif); font-size: 1.1rem; }
.item-level {
  display: inline-block; align-self: flex-start;
  font-size: 11px; letter-spacing: 0.04em;
  background: var(--bg); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 999px; color: var(--ink-soft);
}
.effects { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 3px; font-size: 12px; color: var(--ink); line-height: 1.35; }
.item-last-price { font-size: 12px; color: var(--muted); margin-top: auto; }
.item-actions { display: flex; gap: 8px; margin-top: 6px; }
.item-actions .btn { flex: 1; }

.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* Footer */
.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}

/* Toast notifications (admin) */
.admin-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--warn);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  max-width: 380px;
  z-index: 100;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 19, 28, 0.5);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 16px;
}
.overlay-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.overlay-card-wide { max-width: 720px; text-align: left; align-items: stretch; }
.overlay-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 8px; }
.success-check {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--ok) 16%, var(--bg-soft));
  color: var(--ok);
  border-radius: 50%;
}
.success-check svg { width: 36px; height: 36px; }

/* Theme toggle icons */
#themeToggle .theme-moon { display: none; }
html[data-theme="dark"] #themeToggle .theme-sun { display: none; }
html[data-theme="dark"] #themeToggle .theme-moon { display: block; }

/* History */
.history-chart svg { width: 100%; height: auto; display: block; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-area { fill: var(--accent-soft); stroke: none; }
.chart-axis { stroke: var(--line-strong); stroke-width: 1; }
.chart-point { fill: var(--accent); }
.chart-label { font-size: 10px; fill: var(--muted); font-family: var(--sans); }
.history-breakdown { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.history-stat { background: var(--bg); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.history-stat strong { color: var(--accent); }
.history-rows { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.history-row span { color: var(--muted); font-size: 12px; }

/* Topbar nav on mobile */
@media (max-width: 720px) {
  .topbar-inner { grid-template-columns: auto auto; gap: 12px; }
  .topbar-nav { display: none; }
  .brand-text small { display: none; }
}
