/* ── PIX DROP ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      var(--in-accent, #E92038);
  --bg:       var(--in-bg, #020202);
  --canvas-bg:#060606;
  --top:      52px;
  --hud:      var(--inlab-hud-h, 85px);
  --sf:       var(--in-font-display, 'Steelfish', sans-serif);
  --pp:       var(--in-font-body, 'Poppins', sans-serif);
  --g1:       #c9c9c9;
  --g2:       #7a7a7a;
  --g3:       #3a3a3a;
  --g4:       #1a1a1a;
  --g5:       #0e0e0e;
}

html, body {
  background: var(--bg);
  color: #fff;
  font-family: var(--pp);
  height: 100dvh; width: 100vw;
  overflow: hidden;
  user-select: none;
  cursor: crosshair;
}

/* ── CANVAS WRAP ── */
#heapWrap {
  position: fixed;
  top: var(--top);
  left: 0;
  right: 0;
  bottom: var(--hud);
  background: var(--canvas-bg);
  overflow: hidden;
  z-index: 1;
  transition: background .25s ease;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
body[data-tool="erase"] #heapWrap { cursor: cell; }

#heapWrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
#heapCanvas         { z-index: 1; }
#heapFallCanvas     { z-index: 2; }

/* ── INTRO ── */
.heap-intro {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.4rem;
  background: rgba(2,2,2,.94);
  pointer-events: auto;
  transition: opacity .5s ease, visibility .5s ease;
}
.heap-intro.is-fading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hp-eyebrow {
  font-family: var(--pp);
  font-size: .48rem;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: .8rem;
}
.hp-eyebrow::before,
.hp-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(233,32,56,.3);
  max-width: 55px;
}

.hp-title {
  font-family: var(--sf);
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.03em;
  line-height: 1.02;
  color: #fff;
  margin-bottom: .6rem;
}
.hp-title em { font-style: normal; color: var(--red); }

.hp-sub {
  font-family: var(--pp);
  font-size: .56rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 2.2rem;
  max-width: 520px;
}

.hp-guide {
  display: flex;
  gap: 0;
  border: 1px solid rgba(255,255,255,.13);
  width: 100%;
  max-width: 700px;
  margin-bottom: 1.5rem;
}
.hp-item {
  flex: 1;
  padding: 1.2rem .9rem;
  border-right: 1px solid rgba(255,255,255,.1);
  text-align: center;
}
.hp-item:last-child { border-right: none; }
.hp-item i {
  font-size: 1rem;
  color: var(--red);
  display: block;
  margin-bottom: .5rem;
}
.hp-item h5 {
  font-family: var(--sf);
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: .25rem;
  line-height: 1.1;
  letter-spacing: .02em;
}
.hp-item p {
  font-family: var(--pp);
  font-size: .45rem;
  color: rgba(255,255,255,.5);
  line-height: 1.6;
  letter-spacing: .04em;
}

/* ENTER BUTTON */
.hp-enter {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  background: var(--red);
  color: #fff;
  border: 0;
  outline: 0;
  font-family: var(--pp);
  font-size: .52rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  padding: 1rem 1.8rem;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, padding .18s ease;
}
.hp-enter:hover {
  background: #ff3550;
  padding-right: 2.2rem;
}
.hp-enter:active { transform: scale(.97); }
.hp-enter i { font-size: .7rem; }
.hp-enter__lbl { display: inline-block; }

/* ── HUD ── */
#heapHud {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--hud);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  padding: 0 clamp(.7rem, 1.8vw, 1.8rem);
  background: var(--g5);
  z-index: 9100;
}

#heapHud .inlab-hud__title {
  border-right: 1px solid rgba(255,255,255,.07);
  padding: 0 1.1rem;
}
#heapHud .inlab-hud__title-text {
  font-family: var(--sf);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  line-height: 1;
}
#heapHud .inlab-hud__title-text em {
  font-style: normal;
  color: var(--red);
}

#heapHud .heap-hud__center,
.heap-hud__center {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 100%;
  gap: 0;
  overflow: visible !important;
  scrollbar-width: thin;
}
#heapHud .heap-hud__center > .heap-seg:first-child { margin-left: auto; }
#heapHud .heap-hud__center > .heap-seg:last-child  { margin-right: auto; }
.heap-hud__center::-webkit-scrollbar { height: 3px; }
.heap-hud__center::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }
@media (min-width: 721px) {
  body #heapHud .heap-seg { padding: 0 .6rem !important; }
  #heapHud .heap-shapes { gap: .15rem; }
  #heapHud .heap-shape { width: 30px; height: 30px; }
  #heapHud .heap-canvas-bar, #heapHud .heap-music-bar { gap: 6px; }
  #heapHud .heap-bg-colors { gap: 4px; }
}
@media (max-width: 1500px) {
  body #heapHud .heap-seg.heap-seg--progress { display: none !important; }
}
@media (max-width: 1400px) {
  #heapHud .heap-hud__center,
  .heap-hud__center { overflow-x: auto !important; overflow-y: hidden !important; overscroll-behavior-x: contain; }
}

.heap-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 .85rem;
  border-right: 1px solid rgba(255,255,255,.06);
  gap: .3rem;
  flex-shrink: 0;
}
.heap-seg:first-child {
  border-left: 1px solid rgba(255,255,255,.06);
}

.heap-lbl {
  font-family: var(--pp);
  font-size: .4rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(255,255,255,.32);
  line-height: 1;
}

.heap-val {
  font-family: var(--sf);
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: .02em;
}
.heap-val--red   { color: var(--red); }
.heap-val--small { font-size: 1rem; letter-spacing: .04em; }

/* Progress */
.heap-seg--progress {
  min-width: 130px;
  max-width: 170px;
  align-items: center;
  gap: .35rem;
}
.heap-progress-dots {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 130px;
}
.heap-progress-dot {
  height: 8px;
  background: rgba(255,255,255,.08);
  transition: background .25s ease;
}
.heap-progress-dot.is-on { background: var(--red); }
.heap-progress-foot {
  display: flex;
  align-items: baseline;
  justify-content: center;
}
.heap-progress-frac {
  font-family: var(--sf);
  font-size: .82rem;
  color: #fff;
  letter-spacing: .02em;
}
.heap-bar-track {
  width: 70%;
  max-width: 140px;
  height: 2px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.heap-bar-fill {
  height: 100%;
  background: var(--red);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.heap-seg--tool { padding: 0 .85rem; }
.heap-tool {
  display: flex;
  background: var(--g4);
}
.heap-tool-btn {
  width: 30px; height: 30px;
  background: transparent;
  border: 0; outline: 0;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  font-size: .8rem;
  transition: background .15s ease, color .15s ease;
  padding: 0;
}
.heap-tool-btn:hover { color: #fff; background: rgba(255,255,255,.05); }
.heap-tool-btn.is-active {
  background: var(--red);
  color: #fff;
}

.heap-seg--shapes { padding: 0 .95rem; }
.heap-shapes {
  display: flex;
  gap: .35rem;
  align-items: center;
}
.heap-shape {
  width: 34px; height: 34px;
  cursor: pointer;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
  border: 1px solid transparent;
  outline: 0;
  padding: 0;
  opacity: .55;
  color: #fff;
  font-size: 1.05rem;
}
.heap-shape i { color: #fff; }
.heap-shape__cv {
  display: block;
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}
.heap-shape:hover {
  opacity: 1;
  transform: scale(1.10);
}
.heap-shape.is-active {
  opacity: 1;
  border-color: var(--red);
  transform: scale(1.10);
}

.heap-seg--colors { padding: 0 .85rem; }
.heap-colors {
  display: flex;
  gap: .3rem;
  align-items: center;
}
.heap-color {
  width: 22px; height: 22px;
  cursor: pointer;
  outline: 0;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: transform .15s ease, border-color .15s ease;
  position: relative;
  padding: 0;
}
.heap-color:hover { transform: scale(1.12); }
.heap-color.is-active {
  border-color: #fff;
  transform: scale(1.18);
}

.heap-color--add {
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  border: 1px dashed rgba(255,255,255,.25);
  font-size: .55rem;
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.heap-color--add:hover {
  color: #fff;
  border-color: rgba(255,255,255,.6);
  transform: scale(1.12);
}
.heap-color-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
  overflow: hidden;
}
.heap-color--remove {
  position: absolute;
  top: -4px; right: -4px;
  width: 12px; height: 12px;
  background: var(--g5);
  color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  font-size: .35rem;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.heap-color-wrap {
  position: relative;
  display: inline-flex;
}
.heap-color-wrap:hover .heap-color--remove { display: inline-flex; }

/* ── Inline color bar + popover for extras ── */
.heap-color-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.heap-color-defaults {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.heap-color-defaults .heap-color-sw {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,.22);
  background: #fff;
  cursor: pointer;
  padding: 0;
  outline: 0;
  transition: transform .12s ease, border-color .12s ease;
}
.heap-color-defaults .heap-color-sw:hover { transform: scale(1.12); }
.heap-color-defaults .heap-color-sw.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--red, var(--in-accent, #E92038));
  transform: scale(1.1);
}

.heap-color-more {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: rgba(255,255,255,.7);
  border: 1px dashed rgba(255,255,255,.32);
  font-size: .55rem;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, transform .12s ease;
}
.heap-color-more:hover {
  color: #fff;
  border-color: rgba(255,255,255,.7);
  transform: scale(1.1);
}
.heap-color-more.is-open {
  color: #fff;
  border-style: solid;
  border-color: var(--red, var(--in-accent, #E92038));
}

.heap-color-pop {
  position: absolute;
  bottom: calc(100% + 18px);
  right: 0;
  min-width: 264px;
  max-width: 300px;
  padding: 10px 12px 12px;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 -4px 18px rgba(0,0,0,.55);
  display: none;
  z-index: 99999;
}
.heap-color-pop.is-open { display: block; }
.heap-color-pop.is-floating { position: fixed; right: auto; z-index: 9650; }
.heap-color-pop.is-floating::after { right: auto; left: var(--pop-arrow-x, calc(100% - 14px)); margin-left: -6px; }
.heap-color-pop::after {
  content: '';
  position: absolute;
  bottom: -7px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: #0a0a0a;
  border-right: 1px solid rgba(255,255,255,.14);
  border-bottom: 1px solid rgba(255,255,255,.14);
  transform: rotate(45deg);
}
.heap-color-pop__eyebrow {
  margin: 0 0 8px;
  font-family: 'Poppins', sans-serif;
  font-size: .42rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.heap-color-pop__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}
.heap-color-pop__grid .heap-color-sw {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border: 1px solid rgba(255,255,255,.22);
  cursor: pointer;
  padding: 0;
  outline: 0;
  transition: transform .12s ease, border-color .12s ease;
}
.heap-color-pop__grid .heap-color-sw:hover { transform: scale(1.12); }
.heap-color-pop__grid .heap-color-sw.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--red, var(--in-accent, #E92038));
  transform: scale(1.1);
}

/* ── Canvas bar ── */
.heap-seg--canvas { padding: 0 .85rem; }
.heap-canvas-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.heap-bg-colors {
  display: flex;
  align-items: center;
  gap: 6px;
}
.heap-bg-colors .heap-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  cursor: pointer;
  padding: 0;
  outline: 0;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.heap-bg-colors .heap-color:hover { transform: scale(1.14); }
.heap-bg-colors .heap-color.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--red, var(--in-accent, #E92038));
  transform: scale(1.08);
}
.heap-canvas-div {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.12);
  flex-shrink: 0;
}
.heap-grid-toggle {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: .8rem;
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.heap-grid-toggle:hover {
  color: #fff;
  border-color: rgba(255,255,255,.45);
}
.heap-grid-toggle.is-active {
  color: #fff;
  background: rgba(233,32,56,.16);
  border-color: var(--red, var(--in-accent, #E92038));
  box-shadow: 0 0 0 1px rgba(233,32,56,.4) inset;
}

/* ── Music bar ── */
.heap-seg--music { padding: 0 .85rem; }
.heap-music-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.heap-amb-toggle,
.heap-mute-toggle {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: .8rem;
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.heap-amb-toggle:hover,
.heap-mute-toggle:hover { color: #fff; border-color: rgba(255,255,255,.45); }
.heap-amb-toggle.is-active {
  color: #fff;
  background: rgba(123,97,255,.18);
  border-color: #7b61ff;
  box-shadow: 0 0 0 1px rgba(123,97,255,.45) inset;
  animation: heapAmbPulse 2.4s ease-in-out infinite;
}
@keyframes heapAmbPulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(123,97,255,.45) inset, 0 0 0 0 rgba(123,97,255,.0); }
  50%     { box-shadow: 0 0 0 1px rgba(123,97,255,.55) inset, 0 0 10px 2px rgba(123,97,255,.35); }
}
.heap-mute-toggle.is-muted {
  color: #ff6b7e;
  border-color: rgba(233,32,56,.5);
}
.heap-mood-picker {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.03);
}
.heap-mood-btn {
  width: 27px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  font-size: .72rem;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.heap-mood-btn:hover { color: #fff; }
.heap-mood-btn.is-active {
  color: #fff;
  background: rgba(123,97,255,.22);
  box-shadow: 0 0 0 1px rgba(123,97,255,.5) inset;
}

/* Brush size picker */
.heap-seg--brush { padding: 0 .85rem; }
.heap-brush {
  display: flex;
  gap: .25rem;
  align-items: center;
}
.heap-brush-btn {
  width: 26px; height: 26px;
  font-family: var(--sf);
  font-size: .9rem;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.04);
  border: 0; outline: 0;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  padding: 0;
}
.heap-brush-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.heap-brush-btn.is-active { background: var(--red); color: #fff; }

/* Buttons */
.heap-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  padding: .35rem .7rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
  color: rgba(255,255,255,.55);
  transition: background .18s, color .18s, border-color .18s;
  font-family: var(--pp);
  white-space: nowrap;
}
.heap-btn:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.22);
  color: #fff;
}
.heap-btn.is-active {
  background: rgba(233,32,56,.1);
  border-color: rgba(233,32,56,.5);
  color: var(--red);
}
.heap-btn i { font-size: .82rem; }
.heap-btn__lbl {
  font-size: .32rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1;
  opacity: .8;
}
.heap-btn--ghost {
  background: transparent;
  border-color: rgba(255,255,255,.08);
}
.heap-btn--danger:hover {
  background: rgba(233,32,56,.12);
  border-color: rgba(233,32,56,.5);
  color: var(--red);
}

.heap-btn--archive {
  background: var(--red);
  border: 1px solid var(--red);
  color: #fff;
  min-width: 140px;
  padding: .35rem 1.1rem;
}
.heap-btn--archive .heap-btn__lbl { opacity: 1; color: #fff; }
.heap-btn--archive i { color: #fff; }
.heap-btn--archive:hover {
  background: #ff3550;
  border-color: #ff3550;
  color: #fff;
}

.heap-bg-hidden { display: none !important; }

/* Right actions */
#heapHud .inlab-hud__actions {
  border-left: 1px solid rgba(255,255,255,.06);
  padding: 0 .85rem;
  gap: .35rem;
}
#heapHud .inlab-hud__info-btn {
  width: 38px; height: 38px;
}

/* ── PENCERELER ── */
.in-modal.pd-modal { background: #0c0c0d; border-radius: 4px; }
#heapSaveModal[hidden], #heapArchiveModal[hidden], #heapDetailModal[hidden] { display: none; }
.heap-eyebrow {
  font-family: var(--pp);
  font-size: .42rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: .6rem;
}
.heap-modal__title {
  font-family: var(--sf);
  font-size: 2.2rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #fff;
  margin-bottom: .6rem;
  line-height: 1;
}
.heap-modal__title em { font-style: normal; color: var(--red); }
.heap-save { text-align: left; }
.heap-save .heap-eyebrow { font-size: .38rem; letter-spacing: .38em; margin-bottom: .4rem; text-align: left; }
.heap-save .heap-modal__title { font-size: 1.55rem; margin-bottom: .35rem; text-align: left; }
.heap-save .heap-modal__sub { font-size: .46rem; margin-bottom: 1rem; text-align: left; }
.heap-modal__sub {
  font-family: var(--pp);
  font-size: .54rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 1.6rem;
  line-height: 1.5;
}
.heap-modal__btn {
  font-family: var(--pp);
  font-size: .55rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  padding: .7rem 1.3rem;
  background: transparent;
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.heap-modal__btn:hover {
  border-color: rgba(255,255,255,.4);
  color: #fff;
}
.heap-modal__btn i { font-size: .72rem; }
.heap-modal__btn--primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.heap-modal__btn--primary:hover {
  background: #ff3550;
  border-color: #ff3550;
  color: #fff;
}

/* ── SETTINGS PANEL ── */
.heap-settings { padding: 2rem 2.2rem; text-align: left; }
.heap-set-grid {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
}
.heap-set-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.4rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.heap-set-row:last-child { border-bottom: none; }
.heap-set-row__lbl strong {
  display: block;
  font-family: var(--sf);
  font-size: 1.05rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: .2rem;
}
.heap-set-row__lbl span {
  font-family: var(--pp);
  font-size: .42rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.42);
  line-height: 1.5;
}

/* Pill group */
.heap-pill-group {
  display: inline-flex;
  background: var(--g4);
}
.heap-pill {
  font-family: var(--pp);
  font-size: .42rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  background: transparent;
  border: 0; outline: 0;
  padding: .55rem .9rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.heap-pill:hover { color: #fff; background: rgba(255,255,255,.05); }
.heap-pill.is-active {
  background: var(--red);
  color: #fff;
}

/* Volume slider */
.heap-slider-row {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  min-width: 220px;
}
.heap-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 4px;
  background: rgba(255,255,255,.1);
  outline: 0;
  cursor: pointer;
}
.heap-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  background: var(--red);
  cursor: pointer;
  border: 0;
}
.heap-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--red);
  cursor: pointer;
  border: 0;
}
.heap-slider-val {
  font-family: var(--sf);
  font-size: 1rem;
  color: #fff;
  letter-spacing: .04em;
  min-width: 52px;
  text-align: right;
}

/* ── SAVE MODAL ── */
.in-modal.pd-modal--save {
  max-width: 560px;
  padding: 1.5rem 1.6rem;
  background: rgba(18,18,20,.72);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
}
.pd-modal--save h2.heap-modal__title { margin: 0 0 .35rem; padding-right: 2.6rem; font-size: 1.55rem; font-weight: 700; line-height: 1; color: #fff; }
.pd-modal--archive h2.pd-arch-title { margin: 0; font-size: 2.4rem; font-weight: 700; line-height: 1; color: #fff; }
.heap-save-preview {
  width: 100%;
  margin: 0 0 .85rem 0;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.heap-save-preview canvas {
  width: auto;
  max-width: 100%;
  max-height: 38vh;
  height: auto;
  display: block;
  image-rendering: pixelated;
}
.heap-save-meta {
  font-family: var(--pp);
  font-size: .42rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: .9rem;
  display: flex;
  gap: .55rem;
  justify-content: flex-start;
  align-items: center;
}
.heap-save-meta strong { color: var(--red); font-weight: 600; }
.heap-dot-sep { color: rgba(255,255,255,.25); }

.heap-input-wrap {
  display: block;
  text-align: left;
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.heap-input-wrap--full {
  max-width: 520px;
  margin: 0 auto .7rem auto;
}
/* Iki input yan yana */
.heap-save-row {
  display: flex;
  align-items: flex-end;
  gap: .6rem;
  width: 100%;
  margin: 0 0 .85rem 0;
}
.heap-save-row .heap-input-wrap { flex: 1 1 0; }
.heap-input-lbl {
  display: flex;
  align-items: center;
  gap: .45em;
  font-family: var(--pp);
  font-size: .42rem;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: .5rem;
  padding-left: .15rem;
}
.heap-input-lbl i { font-size: .62rem; color: var(--red); }

.heap-input-field { display: block; position: relative; }
.heap-input {
  width: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px;
  outline: 0;
  font-family: var(--pp);
  font-size: .66rem;
  letter-spacing: .03em;
  color: #fff;
  padding: 1.2rem 1.05rem;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.heap-input::placeholder { color: rgba(255,255,255,.28); letter-spacing: .02em; }
.heap-input:hover { border-color: rgba(255,255,255,.26); }
.heap-input:focus {
  border-color: rgba(233,32,56,.7);
  background: linear-gradient(180deg, rgba(233,32,56,.08), rgba(233,32,56,.02));
  box-shadow: inset 0 1px 2px rgba(0,0,0,.3), 0 0 0 3px rgba(233,32,56,.18);
  border-radius: 4px;
}

.heap-save-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  margin: 0;
  font-family: var(--pp);
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  padding: 1.15rem 1.7rem;
  border: 0;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #ff2c45 0%, var(--in-accent, #E92038) 55%, #c4172b 100%);
  box-shadow: 0 10px 24px rgba(233,32,56,.4), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s ease, filter .2s ease;
}
.heap-save-go::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-18deg);
  transition: left .5s ease;
}
.heap-save-go:hover {
  box-shadow: 0 12px 28px rgba(233,32,56,.5), inset 0 1px 0 rgba(255,255,255,.3);
  filter: brightness(1.05);
}
.heap-save-go:hover::after { left: 130%; }
.heap-save-go:active { filter: brightness(.98); }
.heap-save-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
}
.heap-save-go .heap-save-ico i { font-size: .72rem; }
@media (max-width: 480px) {
  .heap-save-row { flex-direction: column; align-items: stretch; }
}
.heap-save-foot {
  font-family: var(--pp);
  font-size: .38rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.34);
  margin-top: .35rem;
}

/* ── ARCHIVE GALLERY ── */
.in-modal.pd-modal--archive {
  max-width: min(1200px, 100%); height: 88vh;
  padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.pd-modal--archive .in-modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pd-arch { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.pd-arch-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 4rem 1rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.pd-arch-head__l { display: flex; flex-direction: column; gap: .35rem; }
.pd-arch-eyebrow {
  font-family: var(--pp); font-size: .42rem;
  letter-spacing: .4em; text-transform: uppercase;
  color: var(--red);
}
.pd-arch-title {
  font-family: var(--sf); font-size: 2.4rem;
  font-weight: 700; letter-spacing: -.02em;
  color: #fff; line-height: 1;
}
.pd-arch-title em { color: var(--red); font-style: normal; }
.pd-arch-sub {
  font-family: var(--pp); font-size: .55rem;
  letter-spacing: .15em; text-transform: uppercase;
  color: rgba(255,255,255,.4); margin-top: .25rem;
}
.pd-arch-body { flex: 1; overflow-y: auto; padding: 1.5rem 2rem 2rem; }
.pd-arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.pd-arch-card {
  position: relative;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .25s, transform .25s;
  cursor: pointer;
  text-align: left; padding: 0; outline: 0;
}
.pd-arch-card:hover { border-color: var(--red); }
.pd-arch-card__img {
  aspect-ratio: 16 / 10;
  background: #111;
  width: 100%; object-fit: cover; display: block;
  image-rendering: pixelated;
}
.pd-arch-card__body {
  padding: .6rem .75rem .75rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.pd-arch-card__title {
  font-family: var(--pp); font-size: .7rem; font-weight: 600;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-arch-card__meta {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--pp); font-size: .5rem;
  letter-spacing: .15em; text-transform: uppercase;
  color: rgba(255,255,255,.4);
}
.pd-arch-empty {
  grid-column: 1 / -1;
  padding: 4rem 2rem; text-align: center;
  color: rgba(255,255,255,.4);
  font-family: var(--pp); font-size: .85rem; line-height: 1.7;
}
.pd-arch-empty i { font-size: 2rem; color: var(--red); display: block; margin-bottom: 1rem; }
.pd-arch-loading {
  grid-column: 1 / -1;
  padding: 3rem 2rem; text-align: center;
  color: rgba(255,255,255,.5);
  font-family: var(--pp); font-size: .7rem;
  letter-spacing: .25em; text-transform: uppercase;
}
.pd-arch-loading i { color: var(--red); margin-right: .55rem; }

/* ── ARCHIVE PREVIEW ── */
.in-modal.pd-modal--preview { max-width: min(1200px, 100%); padding: 3.4rem 1.4rem 1.4rem; }
.pd-preview img {
  display: block; margin: 0 auto;
  max-width: 100%; max-height: 66vh;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 12px 60px rgba(0,0,0,.7);
  image-rendering: pixelated;
}
.pd-preview-info {
  margin-top: 1rem;
  display: flex; flex-direction: column; gap: .4rem;
  align-items: flex-start;
}
.pd-preview-info .pd-pi-title {
  font-family: var(--sf); font-size: 1.6rem; font-weight: 700;
  color: #fff; letter-spacing: -.01em; text-transform: uppercase;
}
.pd-preview-info .pd-pi-meta {
  font-family: var(--pp); font-size: .55rem;
  letter-spacing: .25em; text-transform: uppercase;
  color: rgba(255,255,255,.5);
}
.pd-preview-dl {
  margin-top: .25rem;
  font-family: var(--pp); font-size: .5rem; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase;
  padding: .7rem 1.3rem; cursor: pointer; color: #fff;
  background: var(--red); border: 1px solid var(--red);
  display: inline-flex; align-items: center; gap: .55rem;
  transition: background .2s, border-color .2s;
}
.pd-preview-dl:hover { background: #ff3550; border-color: #ff3550; }
.pd-preview-dl i { font-size: .72rem; }

[data-tip] { position: relative; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .heap-seg--progress { display: none; }
  .heap-seg .heap-val { font-size: 1.2rem; }
}

@media (max-width: 900px) {
  .heap-shape, .heap-brush-btn { width: 22px; height: 22px; font-size: .85rem; }
  .heap-color { width: 18px; height: 18px; }
  .heap-set-row { grid-template-columns: 1fr; gap: .6rem; }
}

@media (max-width: 720px) {
  :root { --hud: 116px; }
  #heapHud { padding: 0 .4rem; grid-template-columns: 1fr auto; }
  #heapHud .inlab-hud__title { display: none; }
  .heap-seg { padding: 0 .55rem; }
  .heap-btn__lbl { display: none; }
  
  .hp-guide { flex-direction: column; }
  .hp-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,.1); }
  .hp-item:last-child { border-bottom: none; }
  .heap-archive-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .heap-seg .heap-lbl { font-size: .38rem; }
  .heap-seg .heap-val { font-size: 1rem; }
  .heap-color { width: 16px; height: 16px; }
  .heap-shape, .heap-brush-btn { width: 20px; height: 20px; font-size: .8rem; }
}

#heapHudBarFill { width: 0; }

/* ── MOBİL HUD ── */
@media (max-width: 720px) {
  #heapHud { --inlab-hud-h: 116px; }
  body #heapHud {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 54px 62px;
    padding: 0 !important;
  }
  body #heapHud .inlab-hud__title { display: none !important; }
  body #heapHud .inlab-hud__actions {
    grid-row: 1; grid-column: 1;
    justify-content: flex-end !important;
    border-left: none !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
    padding: 0 10px !important;
    gap: 6px !important;
  }
  body #heapHud .inlab-hud__actions button,
  body #heapHud .inlab-hud__actions a {
    width: 44px !important; min-width: 44px !important; height: 44px !important;
  }
  body #heapHud .heap-hud__center {
    grid-row: 2; grid-column: 1;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }
  body #heapHud .heap-seg.heap-seg--progress { display: none !important; }

  .heap-tool-btn,
  .heap-shape,
  .heap-brush-btn,
  .heap-color-defaults .heap-color-sw,
  .heap-color-more,
  .heap-bg-colors .heap-color,
  .heap-grid-toggle,
  .heap-mood-btn,
  .heap-amb-toggle,
  .heap-mute-toggle { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .heap-shapes, .heap-brush, .heap-color-defaults, .heap-bg-colors, .heap-canvas-bar, .heap-music-bar, .heap-color-bar { gap: 4px; }
  .heap-shape, .heap-shape.is-active, .heap-color.is-active,
  .heap-color-defaults .heap-color-sw.is-active, .heap-bg-colors .heap-color.is-active { transform: none; }
  .heap-mood-picker { padding: 0; gap: 0; }

  .heap-color-pop { min-width: 0; max-width: none; }
  .heap-color-pop::after { display: none; }
  .heap-color-pop__grid .heap-color-sw { min-height: 40px; }
}
