/* loadout.php — the merged "My loadout / Community" page.
   Scoped to .lp-* so it cannot leak into the rest of the site. */

.lp {
  --lp-r: 4px;
  --lp-gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 90px;
  position: relative;
  z-index: 1;
}

/* ---------------- hero ---------------- */
/* The hero is a <header>, and the site's global `header` rule (flex row, centred,
   max-width, padding) was applying to it, which laid the title, text, stats and
   tabs out side by side. Reset those so it stacks. */
header.lp-hero { display: block; max-width: none; margin: 0; padding: 34px 0 0; gap: 0; }

.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim);
}
.lp-eyebrow::before {
  content: ""; width: 18px; height: 1px; background: var(--text-dim); opacity: 0.6;
}

.lp-hero h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  letter-spacing: -0.01em; margin: 6px 0 0;
}
.lp-hero h1 em { font-style: normal; color: var(--text-dim); }
.lp-lede { color: var(--text-dim); font-size: 15px; margin-top: 8px; max-width: 62ch; }

/* ---------------- stats ---------------- */
.lp-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; margin-top: 26px;
  background: var(--line); border: 1px solid var(--line);
}
.lp-stat { background: var(--surface); padding: 14px 16px; }
.lp-stat b {
  display: block; font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 26px; line-height: 1.1; letter-spacing: 0.01em;
}
.lp-stat span {
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); font-family: 'Rajdhani', sans-serif; font-weight: 600;
}

/* ---------------- tabs ---------------- */
.lp-tabs {
  display: flex; gap: 2px; margin-top: 30px;
  border-bottom: 1px solid var(--line);
}
.lp-tab {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px 13px; text-decoration: none;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 15px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim);
  border: none; background: none; cursor: pointer;
  transition: color 0.15s ease;
}
.lp-tab:hover { color: var(--text); }
.lp-tab[aria-selected="true"] { color: var(--text); }
.lp-tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; background: var(--text);
}
.lp-tab .count {
  font-size: 10.5px; letter-spacing: 0.02em; padding: 1px 6px;
  border: 1px solid var(--line); color: var(--text-dim); font-weight: 600;
}
.lp-tab[aria-selected="true"] .count { border-color: var(--text-dim); color: var(--text); }

.lp-panel { display: none; }
.lp-panel.on { display: block; }
/* The weapon picker's panel reuses the .lp-panel class but is not a page tab: it is
   shown whenever its overlay is open. Without this it stayed display:none, so the
   overlay only blurred the page. */
.lp-overlay .lp-panel { display: block; }

/* ---------------- generic bits ---------------- */
.lp-toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 22px 0 18px; padding: 12px 14px;
  background: rgba(8, 8, 8, 0.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.lp-seg { display: inline-flex; border: 1px solid var(--line); }
.lp-seg button {
  background: transparent; border: none; color: var(--text-dim); cursor: pointer;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 13.5px;
  letter-spacing: 0.08em; padding: 8px 16px; transition: background 0.12s ease, color 0.12s ease;
}
.lp-seg button + button { border-left: 1px solid var(--line); }
.lp-seg button.on { background: var(--text); color: #0a0a0a; }
.lp-seg button:hover:not(.on) { color: var(--text); }

.lp-search {
  flex: 1 1 220px; min-width: 160px; max-width: 360px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 9px 13px; font-family: 'Inter', sans-serif; font-size: 14px;
}
.lp-search::placeholder { color: var(--text-dim); }
.lp-search:focus { outline: none; border-color: var(--text-dim); }

.lp-spacer { flex: 1 1 auto; }

.lp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim);
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 9px 16px; cursor: pointer; text-decoration: none;
  transition: border-color 0.14s ease, color 0.14s ease;
}
.lp-btn:hover { border-color: var(--text-dim); color: var(--text); }
.lp-btn.on { background: var(--text); color: #0a0a0a; border-color: var(--text); }
.lp-btn.on:hover { background: #fff; color: #0a0a0a; }
.lp-btn.primary { background: var(--text); color: #0a0a0a; border-color: var(--text); }
.lp-btn.primary:hover { background: #fff; color: #0a0a0a; }
.lp-btn.danger:hover { border-color: #6b3030; color: #ff8080; }
.lp-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.lp-btn.wide { width: 100%; justify-content: center; }

.lp-note { font-size: 12.5px; color: var(--text-dim); }
.lp-flash {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 15px; margin-top: 18px; border: 1px solid var(--line);
  font-size: 14px;
}
.lp-flash.ok { border-color: #2f5a3b; background: rgba(47, 90, 59, 0.18); }
.lp-flash.err { border-color: #5c2a2a; background: rgba(92, 42, 42, 0.18); }

.lp-empty {
  padding: 64px 24px; text-align: center; border: 1px dashed var(--line);
  color: var(--text-dim);
}
.lp-empty h3 { font-size: 20px; color: var(--text); margin-bottom: 6px; }
.lp-empty p { font-size: 14px; max-width: 46ch; margin: 0 auto 18px; }

/* ---------------- editor ---------------- */
.lp-editor { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 20px; }

.lp-cats { display: flex; flex-direction: column; gap: 6px; }
.lp-cat {
  position: relative; width: 92px; padding: 11px 8px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-dim); cursor: pointer; text-align: left;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: border-color 0.14s ease, color 0.14s ease;
}
.lp-cat i {
  display: block; font-style: normal; font-size: 10px; letter-spacing: 0.02em;
  color: var(--text-dim); opacity: 0.7; margin-top: 2px;
}
.lp-cat:hover { color: var(--text); border-color: var(--text-dim); }
.lp-cat.on { color: var(--text); border-color: var(--text); background: var(--surface-2); }
.lp-cat.on::before {
  content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px;
  background: var(--text);
}

.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

/* Off-screen cards skip layout and paint. The intrinsic size keeps the
   scrollbar honest so nothing jumps as they come in. */
.lp-card {
  content-visibility: auto;
  contain-intrinsic-size: 232px;
}

.lp-wcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-top: 2px solid var(--rarity, var(--line));
  padding: 11px; cursor: pointer; text-align: left;
  transition: border-color 0.14s ease, transform 0.14s ease, background 0.14s ease;
}
.lp-wcard:hover { transform: translateY(-2px); border-color: var(--text-dim); }
.lp-wcard.equipped { box-shadow: inset 0 0 0 1px #6a5417; }
.lp-wcard.equipped:hover { border-color: #c9a13c; }

.lp-thumb {
  position: relative; height: 84px; margin-bottom: 10px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,0.05), transparent 65%),
    var(--surface-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.lp-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lp-thumb .fallback { color: var(--text-dim); font-size: 11px; padding: 0 8px; text-align: center; }

.lp-badges { position: absolute; top: 5px; left: 5px; display: flex; gap: 4px; }
.lp-chip {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 9.5px;
  letter-spacing: 0.06em; padding: 2px 5px; text-transform: uppercase;
  background: rgba(0,0,0,0.65); border: 1px solid var(--line); color: var(--text-dim);
}
.lp-chip.eq { background: #c9a13c; border-color: #c9a13c; color: #1a1400; }
.lp-chip.charm { color: #d9c07a; border-color: #4a3c1c; }
.lp-chip.sticker { color: #cfd8e2; }

.lp-wcard .nm {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 14.5px;
  line-height: 1.2; color: var(--text);
}
.lp-wcard .fin { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.lp-wcard .fin.set { color: #6fd08c; }
.lp-wcard .foot { margin-top: auto; padding-top: 9px; }
.lp-float {
  display: flex; justify-content: space-between; font-size: 10.5px;
  color: var(--text-dim); margin-top: 6px; font-variant-numeric: tabular-nums;
}
.lp-bar { height: 2px; background: var(--surface-2); margin-top: 4px; }
.lp-bar span { display: block; height: 100%; }

/* ---------------- share panel ---------------- */
.lp-share {
  display: none; margin-top: 16px; padding: 18px 20px 20px;
  background: var(--surface); border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}
.lp-share.on { display: block; }
.lp-share-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 4px;
}
.lp-share-head strong { font-family: 'Rajdhani', sans-serif; font-size: 17px; }
.lp-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px; align-items: end; margin-top: 14px;
}
.lp-fields label { display: block; font-size: 11px; color: var(--text-dim); letter-spacing: 0.04em; }
.lp-fields input[type="text"] {
  width: 100%; margin-top: 5px; padding: 9px 11px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 14px;
}
.lp-fields input[type="text"]:focus { outline: none; border-color: var(--text-dim); }
.lp-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.lp-check input { width: auto; margin: 0; accent-color: #fff; }

/* ---------------- community ---------------- */
.lp-sub {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin: 24px 0 18px;
}
.lp-sub .left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lp-sub .right { color: var(--text-dim); font-size: 13px; }

.lp-cgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.lp-ccard {
  content-visibility: auto;
  contain-intrinsic-size: 420px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.14s ease, transform 0.14s ease;
}
.lp-ccard:hover { border-color: var(--text-dim); transform: translateY(-2px); }
.lp-ccard.priv { border-style: dashed; }

.lp-strip {
  display: flex; gap: 2px; height: 96px; padding: 2px;
  background: var(--surface-2); overflow: hidden;
}
.lp-strip img {
  flex: 1 1 0; min-width: 0; height: 100%; object-fit: contain;
  background: var(--surface-2);
}
.lp-strip .empty {
  display: flex; align-items: center; justify-content: center; width: 100%;
  color: var(--text-dim); font-size: 12px; letter-spacing: 0.08em;
  font-family: 'Rajdhani', sans-serif; text-transform: uppercase;
}

.lp-cbody { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.lp-ctitle {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.lp-ctitle h3 {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 19px;
  line-height: 1.15; letter-spacing: 0.01em; overflow-wrap: anywhere;
}
.lp-vis {
  flex: 0 0 auto; font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 7px; border: 1px solid var(--line); color: var(--text-dim);
}
.lp-vis.pub { color: #6fd08c; border-color: #2f5a3b; }

.lp-owner { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.lp-owner img, .lp-owner .av {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
}
.lp-owner .av {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); font-size: 11px; font-weight: 700; color: var(--text-dim);
}
.lp-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; overflow-wrap: anywhere; }
.lp-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-meta span {
  font-size: 11px; color: var(--text-dim);
  border: 1px solid var(--line); padding: 2px 7px;
}
.lp-cactions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.lp-cactions form { display: flex; flex: 1 1 0; }
.lp-cactions .lp-btn { width: 100%; justify-content: center; }
.lp-cactions .lp-btn.on {
  background: transparent; color: var(--r-gold); border-color: var(--r-gold);
}
.lp-cactions .lp-btn.on:hover { background: rgba(228, 174, 57, 0.1); color: var(--r-gold); }

.lp-pager { display: flex; justify-content: center; gap: 6px; margin-top: 30px; flex-wrap: wrap; }
.lp-pager a, .lp-pager span {
  min-width: 36px; text-align: center; padding: 8px 11px;
  border: 1px solid var(--line); color: var(--text-dim);
  text-decoration: none; font-size: 13.5px;
}
.lp-pager a:hover { color: var(--text); border-color: var(--text-dim); }
.lp-pager .on { color: #0a0a0a; background: var(--text); border-color: var(--text); }

/* ---------------- picker ---------------- */
.lp-overlay {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(4, 4, 4, 0.9);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  padding: 24px; overflow-y: auto;
}
.lp-overlay.on { display: block; }

.lp-panel {
  max-width: 1380px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.lp-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.lp-panel-head h3 { font-size: 22px; }
.lp-panel-head .sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.lp-head-tools { display: flex; align-items: center; gap: 10px; }
.lp-x {
  width: 34px; height: 34px; flex: 0 0 auto;
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  cursor: pointer; font-size: 17px; line-height: 1;
}
.lp-x:hover { color: var(--text); border-color: var(--text-dim); }

/* Weighted toward the stage: the weapon is what people are here to look at,
   and the panel it shares with has grids that reflow happily into less space.
   Was 1.02fr/1fr, which gave the 3D view barely half the width. */
.lp-panel-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }

/* stage */
.lp-stage-col {
  position: sticky; top: 0; align-self: start;
  border-right: 1px solid var(--line);
  padding: 18px 20px 22px;
  background: var(--surface);
  min-height: 560px;
  display: flex; flex-direction: column;
}
.lp-stage {
  position: relative; flex: 1 1 auto; min-height: 420px;
  background:
    radial-gradient(90% 70% at 50% 30%, #1b1b1b, #0b0b0b 70%);
  border: 1px solid var(--line); overflow: hidden;
}
.lp-stage iframe, .lp-stage .flat {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
}
.lp-stage .flat { display: flex; align-items: center; justify-content: center; padding: 12px; }
/* The overlay must line up with the rendered image, not the whole stage. The
   stage is a different shape from a weapon render, so an overlay sized to the
   stage put stickers in empty space above and below the gun. The canvas is
   shrink-wrapped around the image by sizeFlatCanvas() in JS, which makes the
   two boxes identical by construction. */
.flat-canvas { position: relative; line-height: 0; touch-action: none; }
.lp-stage .flat img { display: block; }
.lp-stage[hidden] { display: none; }

.lp-hud {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 11px; font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; font-family: 'Rajdhani', sans-serif; font-weight: 600;
  color: var(--text-dim);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
  pointer-events: none;
}
.lp-hud b { color: var(--text); font-weight: 700; }

/* flat (2D) sticker overlay, used alongside the inventory icon */
.lp-flat-overlays { position: absolute; inset: 0; pointer-events: none; }
/* Real stickers, not dots: sized from the image so they stay proportional at
   any stage width, and always big enough to grab. */
.lp-dot {
  position: absolute; pointer-events: auto; cursor: grab;
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.35); border: 1px dashed rgba(255,255,255,0.45);
  touch-action: none;
}
.lp-dot:hover { border-color: rgba(255,255,255,0.8); }
.lp-dot.sel { border-color: #fff; border-style: solid; box-shadow: 0 0 0 1px rgba(0,0,0,0.6); }
.lp-dot.dragging { cursor: grabbing; }
.lp-dot img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
/* Rotation grip, sitting just above the sticker. */
.lp-rot {
  position: absolute; left: 50%; bottom: 100%; width: 14px; height: 14px;
  margin-left: -7px; margin-bottom: 2px; border-radius: 50%;
  background: #fff; border: 2px solid #111; cursor: grab;
  box-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.lp-rot::after {
  content: ''; position: absolute; left: 50%; top: 100%;
  width: 2px; height: 8px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6);
}
.lp-dot:not(.sel) .lp-rot { display: none; }
/* Empty 2D slot target, so it is obvious where a new sticker would land. */
.lp-anchor {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; border: 1px dashed rgba(255,255,255,0.28);
  pointer-events: none;
}

.lp-spin {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(11,11,11,0.7); color: var(--text-dim);
  font-family: 'Rajdhani', sans-serif; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.lp-spin.on { display: flex; }
.lp-spin i {
  width: 14px; height: 14px; border: 2px solid var(--line);
  border-top-color: var(--text); border-radius: 50%;
  animation: lp-rot 0.8s linear infinite;
}
@keyframes lp-rot { to { transform: rotate(360deg); } }

.lp-stage-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 11.5px; color: var(--text-dim); line-height: 1.45;
}
.lp-stage-foot .lp-btn { padding: 6px 11px; font-size: 11px; }
.lp-attr { margin-top: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lp-attr div {
  border: 1px solid var(--line); padding: 8px 10px; background: var(--surface-2);
}
.lp-attr span {
  display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); font-family: 'Rajdhani', sans-serif; font-weight: 600;
}
.lp-attr b {
  font-family: 'Rajdhani', sans-serif; font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* controls */
.lp-ctrl { padding: 0 22px 24px; min-width: 0; }
.lp-ptabs {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 2px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  margin: 0 -22px 20px; padding: 0 22px;
}
.lp-ptab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); cursor: pointer; padding: 14px 14px 12px;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 13.5px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.lp-ptab:hover { color: var(--text); }
.lp-ptab.on { color: var(--text); border-bottom-color: var(--text); }
.lp-ptab .n {
  display: inline-block; margin-left: 6px; font-size: 10px;
  color: var(--text-dim); border: 1px solid var(--line); padding: 0 4px;
}
.lp-ptab.gone { display: none; }

.lp-psec { display: none; }
.lp-psec.on { display: block; }

.lp-finishes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px;
}
.lp-fin {
  background: var(--surface-2); border: 1px solid var(--line);
  border-top: 2px solid var(--rarity, var(--line));
  padding: 8px; cursor: pointer; text-align: left; color: inherit;
}
.lp-fin:hover { border-color: var(--text-dim); }
.lp-fin.sel { box-shadow: 0 0 0 1px var(--text); }
.lp-fin .t { height: 54px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.lp-fin .t img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lp-fin .n { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 12.5px; line-height: 1.2; }
.lp-fin .r { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.lp-fin .f { font-size: 9.5px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }

.lp-block { margin-bottom: 24px; }
.lp-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 13.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 10px;
}
.lp-label .val { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--text); letter-spacing: 0; text-transform: none; }
.lp-label .cond { font-weight: 700; font-family: 'Rajdhani', sans-serif; }

.lp-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 20px; background: transparent; cursor: pointer;
  display: block; margin: 0; padding: 0; border: none;
}
.lp-range::-webkit-slider-runnable-track { height: 6px; background: var(--grad, var(--line)); }
.lp-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; margin-top: -4.5px; border-radius: 50%;
  background: #fff; border: 2px solid #111; box-shadow: 0 0 0 1px rgba(255,255,255,0.55);
}
.lp-range::-moz-range-track { height: 6px; background: var(--grad, var(--line)); }
.lp-range::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 2px solid #111;
}
.lp-range.micro::-webkit-slider-runnable-track { height: 3px; }
.lp-range.micro::-webkit-slider-thumb {
  width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #0a0a0a; background: #fff;
}
.lp-range.micro::-moz-range-track { height: 3px; }
.lp-range.micro::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid #0a0a0a; background: #fff; }

.lp-caps { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-dim); margin-top: 4px; }
.lp-presets { display: flex; gap: 5px; margin-top: 10px; flex-wrap: wrap; }
.lp-presets button {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim);
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: 0.05em; padding: 5px 11px; cursor: pointer;
}
.lp-presets button:hover:not([disabled]) { color: var(--text); border-color: var(--text-dim); }
.lp-presets button[disabled] { opacity: 0.3; cursor: not-allowed; }

.lp-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lp-num {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 11px; font-family: 'Inter', sans-serif; font-size: 14px;
  width: 118px; font-variant-numeric: tabular-nums;
}
.lp-num:focus { outline: none; border-color: var(--text-dim); }

.lp-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lp-slot {
  position: relative; aspect-ratio: 1;
  background: var(--surface-2); border: 1px dashed var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; padding: 6px;
}
.lp-slot:hover { border-color: var(--text-dim); }
.lp-slot.on { border: 1px solid var(--text); }
.lp-slot.filled { border-style: solid; }
.lp-slot img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.lp-slot .i {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 10px;
  letter-spacing: 0.08em; color: var(--text-dim);
}
.lp-slot .x {
  position: absolute; top: 2px; right: 2px; width: 17px; height: 17px;
  background: #fff; color: #0a0a0a; border: none; font-size: 12px;
  line-height: 1; cursor: pointer; padding: 0;
}

.lp-items {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px; max-height: 260px; overflow-y: auto; padding-right: 4px;
}
.lp-item {
  background: var(--surface-2); border: 1px solid var(--line);
  border-top: 2px solid var(--rarity, transparent);
  padding: 7px; cursor: pointer; text-align: center;
}
.lp-item:hover { border-color: var(--text-dim); }
.lp-item.sel { box-shadow: 0 0 0 1px var(--text); }
.lp-item img { width: 100%; height: 46px; object-fit: contain; pointer-events: none; }
.lp-item .n { font-size: 9.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.25; }

.lp-slotpanel { border: 1px solid var(--line); background: var(--surface-2); padding: 14px; margin-bottom: 16px; }
.lp-slotpanel h4 {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 12px;
}
.lp-srow { margin-bottom: 12px; }
.lp-srow .l {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; color: var(--text-dim); margin-bottom: 3px;
}
.lp-srow .l b {
  color: var(--text); font-family: 'Rajdhani', sans-serif; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.lp-sacts { display: flex; gap: 7px; flex-wrap: wrap; }

.lp-hint { color: var(--text-dim); font-size: 11.5px; line-height: 1.55; margin-top: 12px; }
.lp-warn {
  border: 1px solid #5c2a2a; background: rgba(92, 42, 42, 0.16);
  color: #ffb3b3; font-size: 12.5px; padding: 10px 12px;
}
.lp-ghost { color: var(--text-dim); font-size: 12.5px; padding: 28px; text-align: center; border: 1px dashed var(--line); }

.lp-panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.lp-panel-foot .lp-note { max-width: 62ch; }

/* ---------------- phones ---------------- */
@media (max-width: 1080px) {
  .lp-panel-body { grid-template-columns: 1fr; }
  .lp-stage-col {
    position: static; border-right: none; border-bottom: 1px solid var(--line);
    min-height: 0; padding: 14px 16px 16px;
  }
  /* Stacked, so the stage gets the full panel width back - it only loses the
     comparison with the slots next to it, which is what pushed this down to
     260px in the first place. */
  .lp-stage { min-height: 380px; height: 380px; flex: 0 0 auto; }
  .lp-ctrl { padding: 0 16px 20px; }
  .lp-ptabs { margin: 0 -16px 16px; padding: 0 16px; }
}

@media (max-width: 780px) {
  .lp { padding: 0 14px 70px; }
  .lp-stats { grid-template-columns: repeat(2, 1fr); }
  .lp-editor { grid-template-columns: 1fr; gap: 12px; }
  .lp-cats { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .lp-cat { width: auto; flex: 0 0 auto; white-space: nowrap; }
  .lp-cat i { display: none; }
  .lp-cat.on::before { left: -1px; right: -1px; top: auto; bottom: -1px; width: auto; height: 2px; }
  .lp-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .lp-cgrid { grid-template-columns: 1fr; }
  .lp-toolbar { gap: 8px; padding: 10px; }
  .lp-search { max-width: none; flex-basis: 100%; order: -1; }
  .lp-spacer { display: none; }
  .lp-overlay { padding: 0; }
  .lp-panel { min-height: 100%; border: none; clip-path: none; }
  .lp-finishes { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .lp-slots { grid-template-columns: repeat(3, 1fr); }
  .lp-attr { grid-template-columns: 1fr 1fr; }
  .lp-stage { height: 300px; min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-wcard, .lp-ccard, .lp-btn { transition: none; }
  .lp-wcard:hover, .lp-ccard:hover { transform: none; }
  .lp-spin i { animation: none; }
}