/* =======================
   Design tokens (tweak here)
======================= */
:root{
  --stage-gap: 8px;       /* space between left/center/right */
  --stage-side-pad: 10px; /* outer padding around stage */
  --left-col: 260px;      /* width of left sidebar */
  --right-col: 66px;      /* width of right palette */
}

/* =======================
   Fonts
======================= */
@font-face{
  font-family: 'SketchSocial';
  src: url('assets/fonts/Sketch.Social.ttf') format('truetype');
  font-display: swap;
}

@font-face{
  font-family: 'ComicSans';
  src: url('assets/fonts/comicsans.ttf') format('truetype');
  font-display: swap;
}

/* =======================
   Base
======================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  max-width: 2560px;
  max-height: 1440px;
  min-height: 1024px;
  min-width: 768px;
}
body { background-color: #e2e2e2; color: #111; }
.hidden { display: none !important; }

/* =======================
   Navbar — mirrors thread.html exactly
======================= */
nav {
  background: #fff;
  border-bottom: 1px solid #d4d4d4;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;            /* containing block for #midicons pill */
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  width: 100%;
  box-sizing: border-box;
}

/* Logo — exact copy of thread.html .nav-logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-text {
  font-family: 'Syne', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
}
.nav-logo-text em { color: #6b6bff; font-style: normal; }

/* Spacer — pushes midbar to center, avatar to right */
.nav-spacer { flex: 1; }

/* Midbar — absolutely centered in the nav */
#midbar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 160px;
}

/* Nav Avatar — exact copy of thread.html .nav-avatar */
.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b6cf6, #a89cf7);
  background-size: cover;
  background-position: center;
  border: 2px solid #d4d4d4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  font-family: 'Syne', ui-sans-serif, system-ui, sans-serif;
  position: relative;
  overflow: visible;             /* lets dropdown escape the circle */
  flex-shrink: 0;
}
.nav-avatar:hover { border-color: #6b6bff; }

/* Initials — exact copy of thread.html */
.nav-avatar-initials {
  position: relative;
  z-index: 1;
  pointer-events: none;
  line-height: 1;
}

/* Dropdown — exact copy of thread.html */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 160px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: all 0.15s;
}
.dropdown-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.dropdown-item {
  padding: 10px 14px;
  font-size: 13px;
  color: #555;
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background .12s;
  border: none;
  font-family: 'Ubuntu', ui-sans-serif, system-ui, sans-serif;
}
.dropdown-item:hover { background: #f8f8f8; color: #111; }
.dropdown-item.danger { color: #e05a5a; }
.dropdown-item.danger:hover { background: #ffebeb; }

/* Slider value labels */
.slider {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 44px;
  width: 18vw;
  border-radius: 10px;
  background-color: transparent;   /* sketchy colored track below is the visual */
  position: relative;
  overflow: visible;
}
.slider-label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-family: 'Ubuntu', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
}
.slider-label::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 5px 5px;
  border-style: solid;
  border-color: transparent transparent #111;
}
.slider-label.visible {
  opacity: 1;
}
#sliderSize { margin-left: 0; }
#opacity, #size {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 17vw;
  height: 35px;
  min-height: 35px;
  cursor: pointer;
  outline: none;
  border-radius: 15px;
}
/* ── Sketchy size/opacity sliders ─────────────────────────────────────
   The colored pill is a separate .sliderFill div BEHIND the transparent
   track, so masking it to a hand-drawn wavy shape never clips the icon
   thumb. The wavy edge is a static SVG PATH (no feTurbulence) and the
   fill is a plain CSS gradient driven by --f (0..1, set by JS as you
   drag) — both render identically in Chrome, Safari and Firefox. */
#opacity, #size { background-color: transparent; position: relative; z-index: 1; }

.sliderFill {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 17vw; height: 35px;
  pointer-events: none; z-index: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27280%27%20height%3D%2740%27%20viewBox%3D%270%200%20280%2040%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20d%3D%27M20.0%2C4.4%20C22.1%2C4.5%2026.2%2C4.6%2029.2%2C4.7%20C32.3%2C4.9%2035.4%2C5.4%2038.5%2C5.4%20C41.5%2C5.4%2044.6%2C4.9%2047.7%2C4.8%20C50.8%2C4.6%2053.8%2C4.7%2056.9%2C4.7%20C60.0%2C4.7%2063.1%2C4.8%2066.2%2C4.7%20C69.2%2C4.5%2072.3%2C4.0%2075.4%2C3.9%20C78.5%2C3.7%2081.5%2C4.0%2084.6%2C4.0%20C87.7%2C4.0%2090.8%2C3.9%2093.8%2C3.9%20C96.9%2C3.9%20100.0%2C4.1%20103.1%2C3.9%20C106.2%2C3.7%20109.2%2C2.9%20112.3%2C2.7%20C115.4%2C2.6%20118.5%2C2.9%20121.5%2C2.9%20C124.6%2C2.9%20127.7%2C2.5%20130.8%2C2.7%20C133.8%2C2.8%20136.9%2C3.6%20140.0%2C3.8%20C143.1%2C4.0%20146.2%2C3.9%20149.2%2C3.8%20C152.3%2C3.7%20155.4%2C3.0%20158.5%2C3.2%20C161.5%2C3.3%20164.6%2C4.5%20167.7%2C4.8%20C170.8%2C5.1%20173.8%2C5.0%20176.9%2C5.0%20C180.0%2C5.0%20183.1%2C4.8%20186.2%2C4.8%20C189.2%2C4.8%20192.3%2C5.0%20195.4%2C4.9%20C198.5%2C4.8%20201.5%2C4.5%20204.6%2C4.3%20C207.7%2C4.2%20210.8%2C4.0%20213.8%2C4.1%20C216.9%2C4.1%20220.0%2C4.7%20223.1%2C4.6%20C226.2%2C4.6%20229.2%2C3.9%20232.3%2C3.8%20C235.4%2C3.6%20238.5%2C3.7%20241.5%2C3.7%20C244.6%2C3.6%20247.7%2C3.6%20250.8%2C3.5%20C253.8%2C3.3%20257.9%2C2.7%20260.0%2C2.9%20C262.1%2C3.1%20262.4%2C4.1%20263.5%2C4.6%20C264.6%2C5.2%20265.6%2C5.6%20266.7%2C6.2%20C267.7%2C6.7%20268.9%2C7.0%20269.8%2C7.7%20C270.7%2C8.4%20271.4%2C9.4%20272.1%2C10.3%20C272.9%2C11.2%20273.8%2C12.0%20274.5%2C13.0%20C275.1%2C14.0%20275.5%2C15.2%20275.9%2C16.4%20C276.3%2C17.5%20276.8%2C18.8%20276.8%2C20.0%20C276.9%2C21.2%20276.6%2C22.5%20276.2%2C23.7%20C275.8%2C24.9%20275.1%2C25.9%20274.5%2C27.0%20C274.0%2C28.1%20273.7%2C29.4%20272.9%2C30.3%20C272.2%2C31.2%20271.1%2C31.9%20270.0%2C32.6%20C269.0%2C33.2%20267.9%2C33.7%20266.8%2C34.2%20C265.7%2C34.6%20264.6%2C34.9%20263.5%2C35.3%20C262.3%2C35.6%20262.1%2C36.3%20260.0%2C36.4%20C257.9%2C36.6%20253.8%2C36.2%20250.8%2C36.1%20C247.7%2C36.1%20244.6%2C36.1%20241.5%2C36.0%20C238.5%2C35.8%20235.4%2C35.4%20232.3%2C35.4%20C229.2%2C35.4%20226.2%2C36.1%20223.1%2C36.0%20C220.0%2C36.0%20216.9%2C35.4%20213.8%2C35.3%20C210.8%2C35.3%20207.7%2C35.8%20204.6%2C35.7%20C201.5%2C35.7%20198.5%2C35.0%20195.4%2C35.0%20C192.3%2C35.1%20189.2%2C35.7%20186.2%2C35.9%20C183.1%2C36.0%20180.0%2C36.0%20176.9%2C35.8%20C173.8%2C35.7%20170.8%2C35.0%20167.7%2C34.9%20C164.6%2C34.8%20161.5%2C35.1%20158.5%2C35.4%20C155.4%2C35.7%20152.3%2C36.5%20149.2%2C36.7%20C146.2%2C36.9%20143.1%2C36.3%20140.0%2C36.4%20C136.9%2C36.5%20133.8%2C37.2%20130.8%2C37.3%20C127.7%2C37.3%20124.6%2C36.8%20121.5%2C36.6%20C118.5%2C36.4%20115.4%2C36.2%20112.3%2C36.2%20C109.2%2C36.3%20106.2%2C36.8%20103.1%2C36.9%20C100.0%2C37.0%2096.9%2C37.1%2093.8%2C37.0%20C90.8%2C36.8%2087.7%2C36.3%2084.6%2C36.0%20C81.5%2C35.8%2078.5%2C35.6%2075.4%2C35.5%20C72.3%2C35.4%2069.2%2C35.4%2066.2%2C35.5%20C63.1%2C35.7%2060.0%2C36.1%2056.9%2C36.2%20C53.8%2C36.2%2050.8%2C35.9%2047.7%2C35.7%20C44.6%2C35.4%2041.5%2C34.8%2038.5%2C34.7%20C35.4%2C34.5%2032.3%2C34.8%2029.2%2C34.9%20C26.2%2C34.9%2022.1%2C34.8%2020.0%2C34.8%20C17.9%2C34.7%2017.8%2C34.7%2016.6%2C34.7%20C15.5%2C34.7%2014.0%2C35.1%2012.9%2C34.8%20C11.8%2C34.4%2011.0%2C33.3%2010.0%2C32.6%20C9.0%2C31.9%207.7%2C31.3%206.9%2C30.4%20C6.1%2C29.5%205.5%2C28.3%205.1%2C27.2%20C4.7%2C26.0%204.7%2C24.7%204.5%2C23.5%20C4.3%2C22.3%203.8%2C21.1%203.9%2C20.0%20C4.1%2C18.9%205.0%2C17.8%205.4%2C16.7%20C5.7%2C15.5%205.6%2C14.3%206.1%2C13.3%20C6.5%2C12.3%207.5%2C11.6%208.2%2C10.6%20C8.9%2C9.7%209.3%2C8.5%2010.1%2C7.6%20C10.9%2C6.8%2012.0%2C6.2%2013.1%2C5.6%20C14.1%2C5.0%2015.2%2C4.2%2016.4%2C4.0%20C17.5%2C3.8%2017.9%2C4.3%2020.0%2C4.4%20Z%27%20fill%3D%27%23ffffff%27%2F%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27280%27%20height%3D%2740%27%20viewBox%3D%270%200%20280%2040%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20d%3D%27M20.0%2C4.4%20C22.1%2C4.5%2026.2%2C4.6%2029.2%2C4.7%20C32.3%2C4.9%2035.4%2C5.4%2038.5%2C5.4%20C41.5%2C5.4%2044.6%2C4.9%2047.7%2C4.8%20C50.8%2C4.6%2053.8%2C4.7%2056.9%2C4.7%20C60.0%2C4.7%2063.1%2C4.8%2066.2%2C4.7%20C69.2%2C4.5%2072.3%2C4.0%2075.4%2C3.9%20C78.5%2C3.7%2081.5%2C4.0%2084.6%2C4.0%20C87.7%2C4.0%2090.8%2C3.9%2093.8%2C3.9%20C96.9%2C3.9%20100.0%2C4.1%20103.1%2C3.9%20C106.2%2C3.7%20109.2%2C2.9%20112.3%2C2.7%20C115.4%2C2.6%20118.5%2C2.9%20121.5%2C2.9%20C124.6%2C2.9%20127.7%2C2.5%20130.8%2C2.7%20C133.8%2C2.8%20136.9%2C3.6%20140.0%2C3.8%20C143.1%2C4.0%20146.2%2C3.9%20149.2%2C3.8%20C152.3%2C3.7%20155.4%2C3.0%20158.5%2C3.2%20C161.5%2C3.3%20164.6%2C4.5%20167.7%2C4.8%20C170.8%2C5.1%20173.8%2C5.0%20176.9%2C5.0%20C180.0%2C5.0%20183.1%2C4.8%20186.2%2C4.8%20C189.2%2C4.8%20192.3%2C5.0%20195.4%2C4.9%20C198.5%2C4.8%20201.5%2C4.5%20204.6%2C4.3%20C207.7%2C4.2%20210.8%2C4.0%20213.8%2C4.1%20C216.9%2C4.1%20220.0%2C4.7%20223.1%2C4.6%20C226.2%2C4.6%20229.2%2C3.9%20232.3%2C3.8%20C235.4%2C3.6%20238.5%2C3.7%20241.5%2C3.7%20C244.6%2C3.6%20247.7%2C3.6%20250.8%2C3.5%20C253.8%2C3.3%20257.9%2C2.7%20260.0%2C2.9%20C262.1%2C3.1%20262.4%2C4.1%20263.5%2C4.6%20C264.6%2C5.2%20265.6%2C5.6%20266.7%2C6.2%20C267.7%2C6.7%20268.9%2C7.0%20269.8%2C7.7%20C270.7%2C8.4%20271.4%2C9.4%20272.1%2C10.3%20C272.9%2C11.2%20273.8%2C12.0%20274.5%2C13.0%20C275.1%2C14.0%20275.5%2C15.2%20275.9%2C16.4%20C276.3%2C17.5%20276.8%2C18.8%20276.8%2C20.0%20C276.9%2C21.2%20276.6%2C22.5%20276.2%2C23.7%20C275.8%2C24.9%20275.1%2C25.9%20274.5%2C27.0%20C274.0%2C28.1%20273.7%2C29.4%20272.9%2C30.3%20C272.2%2C31.2%20271.1%2C31.9%20270.0%2C32.6%20C269.0%2C33.2%20267.9%2C33.7%20266.8%2C34.2%20C265.7%2C34.6%20264.6%2C34.9%20263.5%2C35.3%20C262.3%2C35.6%20262.1%2C36.3%20260.0%2C36.4%20C257.9%2C36.6%20253.8%2C36.2%20250.8%2C36.1%20C247.7%2C36.1%20244.6%2C36.1%20241.5%2C36.0%20C238.5%2C35.8%20235.4%2C35.4%20232.3%2C35.4%20C229.2%2C35.4%20226.2%2C36.1%20223.1%2C36.0%20C220.0%2C36.0%20216.9%2C35.4%20213.8%2C35.3%20C210.8%2C35.3%20207.7%2C35.8%20204.6%2C35.7%20C201.5%2C35.7%20198.5%2C35.0%20195.4%2C35.0%20C192.3%2C35.1%20189.2%2C35.7%20186.2%2C35.9%20C183.1%2C36.0%20180.0%2C36.0%20176.9%2C35.8%20C173.8%2C35.7%20170.8%2C35.0%20167.7%2C34.9%20C164.6%2C34.8%20161.5%2C35.1%20158.5%2C35.4%20C155.4%2C35.7%20152.3%2C36.5%20149.2%2C36.7%20C146.2%2C36.9%20143.1%2C36.3%20140.0%2C36.4%20C136.9%2C36.5%20133.8%2C37.2%20130.8%2C37.3%20C127.7%2C37.3%20124.6%2C36.8%20121.5%2C36.6%20C118.5%2C36.4%20115.4%2C36.2%20112.3%2C36.2%20C109.2%2C36.3%20106.2%2C36.8%20103.1%2C36.9%20C100.0%2C37.0%2096.9%2C37.1%2093.8%2C37.0%20C90.8%2C36.8%2087.7%2C36.3%2084.6%2C36.0%20C81.5%2C35.8%2078.5%2C35.6%2075.4%2C35.5%20C72.3%2C35.4%2069.2%2C35.4%2066.2%2C35.5%20C63.1%2C35.7%2060.0%2C36.1%2056.9%2C36.2%20C53.8%2C36.2%2050.8%2C35.9%2047.7%2C35.7%20C44.6%2C35.4%2041.5%2C34.8%2038.5%2C34.7%20C35.4%2C34.5%2032.3%2C34.8%2029.2%2C34.9%20C26.2%2C34.9%2022.1%2C34.8%2020.0%2C34.8%20C17.9%2C34.7%2017.8%2C34.7%2016.6%2C34.7%20C15.5%2C34.7%2014.0%2C35.1%2012.9%2C34.8%20C11.8%2C34.4%2011.0%2C33.3%2010.0%2C32.6%20C9.0%2C31.9%207.7%2C31.3%206.9%2C30.4%20C6.1%2C29.5%205.5%2C28.3%205.1%2C27.2%20C4.7%2C26.0%204.7%2C24.7%204.5%2C23.5%20C4.3%2C22.3%203.8%2C21.1%203.9%2C20.0%20C4.1%2C18.9%205.0%2C17.8%205.4%2C16.7%20C5.7%2C15.5%205.6%2C14.3%206.1%2C13.3%20C6.5%2C12.3%207.5%2C11.6%208.2%2C10.6%20C8.9%2C9.7%209.3%2C8.5%2010.1%2C7.6%20C10.9%2C6.8%2012.0%2C6.2%2013.1%2C5.6%20C14.1%2C5.0%2015.2%2C4.2%2016.4%2C4.0%20C17.5%2C3.8%2017.9%2C4.3%2020.0%2C4.4%20Z%27%20fill%3D%27%23ffffff%27%2F%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat;
}
#sliderSize .sliderFill {
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27280%27%20height%3D%2740%27%20viewBox%3D%270%200%20280%2040%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20d%3D%27M20.0%2C4.4%20C22.1%2C4.5%2026.2%2C4.6%2029.2%2C4.7%20C32.3%2C4.9%2035.4%2C5.4%2038.5%2C5.4%20C41.5%2C5.4%2044.6%2C4.9%2047.7%2C4.8%20C50.8%2C4.6%2053.8%2C4.7%2056.9%2C4.7%20C60.0%2C4.7%2063.1%2C4.8%2066.2%2C4.7%20C69.2%2C4.5%2072.3%2C4.0%2075.4%2C3.9%20C78.5%2C3.7%2081.5%2C4.0%2084.6%2C4.0%20C87.7%2C4.0%2090.8%2C3.9%2093.8%2C3.9%20C96.9%2C3.9%20100.0%2C4.1%20103.1%2C3.9%20C106.2%2C3.7%20109.2%2C2.9%20112.3%2C2.7%20C115.4%2C2.6%20118.5%2C2.9%20121.5%2C2.9%20C124.6%2C2.9%20127.7%2C2.5%20130.8%2C2.7%20C133.8%2C2.8%20136.9%2C3.6%20140.0%2C3.8%20C143.1%2C4.0%20146.2%2C3.9%20149.2%2C3.8%20C152.3%2C3.7%20155.4%2C3.0%20158.5%2C3.2%20C161.5%2C3.3%20164.6%2C4.5%20167.7%2C4.8%20C170.8%2C5.1%20173.8%2C5.0%20176.9%2C5.0%20C180.0%2C5.0%20183.1%2C4.8%20186.2%2C4.8%20C189.2%2C4.8%20192.3%2C5.0%20195.4%2C4.9%20C198.5%2C4.8%20201.5%2C4.5%20204.6%2C4.3%20C207.7%2C4.2%20210.8%2C4.0%20213.8%2C4.1%20C216.9%2C4.1%20220.0%2C4.7%20223.1%2C4.6%20C226.2%2C4.6%20229.2%2C3.9%20232.3%2C3.8%20C235.4%2C3.6%20238.5%2C3.7%20241.5%2C3.7%20C244.6%2C3.6%20247.7%2C3.6%20250.8%2C3.5%20C253.8%2C3.3%20257.9%2C2.7%20260.0%2C2.9%20C262.1%2C3.1%20262.4%2C4.1%20263.5%2C4.6%20C264.6%2C5.2%20265.6%2C5.6%20266.7%2C6.2%20C267.7%2C6.7%20268.9%2C7.0%20269.8%2C7.7%20C270.7%2C8.4%20271.4%2C9.4%20272.1%2C10.3%20C272.9%2C11.2%20273.8%2C12.0%20274.5%2C13.0%20C275.1%2C14.0%20275.5%2C15.2%20275.9%2C16.4%20C276.3%2C17.5%20276.8%2C18.8%20276.8%2C20.0%20C276.9%2C21.2%20276.6%2C22.5%20276.2%2C23.7%20C275.8%2C24.9%20275.1%2C25.9%20274.5%2C27.0%20C274.0%2C28.1%20273.7%2C29.4%20272.9%2C30.3%20C272.2%2C31.2%20271.1%2C31.9%20270.0%2C32.6%20C269.0%2C33.2%20267.9%2C33.7%20266.8%2C34.2%20C265.7%2C34.6%20264.6%2C34.9%20263.5%2C35.3%20C262.3%2C35.6%20262.1%2C36.3%20260.0%2C36.4%20C257.9%2C36.6%20253.8%2C36.2%20250.8%2C36.1%20C247.7%2C36.1%20244.6%2C36.1%20241.5%2C36.0%20C238.5%2C35.8%20235.4%2C35.4%20232.3%2C35.4%20C229.2%2C35.4%20226.2%2C36.1%20223.1%2C36.0%20C220.0%2C36.0%20216.9%2C35.4%20213.8%2C35.3%20C210.8%2C35.3%20207.7%2C35.8%20204.6%2C35.7%20C201.5%2C35.7%20198.5%2C35.0%20195.4%2C35.0%20C192.3%2C35.1%20189.2%2C35.7%20186.2%2C35.9%20C183.1%2C36.0%20180.0%2C36.0%20176.9%2C35.8%20C173.8%2C35.7%20170.8%2C35.0%20167.7%2C34.9%20C164.6%2C34.8%20161.5%2C35.1%20158.5%2C35.4%20C155.4%2C35.7%20152.3%2C36.5%20149.2%2C36.7%20C146.2%2C36.9%20143.1%2C36.3%20140.0%2C36.4%20C136.9%2C36.5%20133.8%2C37.2%20130.8%2C37.3%20C127.7%2C37.3%20124.6%2C36.8%20121.5%2C36.6%20C118.5%2C36.4%20115.4%2C36.2%20112.3%2C36.2%20C109.2%2C36.3%20106.2%2C36.8%20103.1%2C36.9%20C100.0%2C37.0%2096.9%2C37.1%2093.8%2C37.0%20C90.8%2C36.8%2087.7%2C36.3%2084.6%2C36.0%20C81.5%2C35.8%2078.5%2C35.6%2075.4%2C35.5%20C72.3%2C35.4%2069.2%2C35.4%2066.2%2C35.5%20C63.1%2C35.7%2060.0%2C36.1%2056.9%2C36.2%20C53.8%2C36.2%2050.8%2C35.9%2047.7%2C35.7%20C44.6%2C35.4%2041.5%2C34.8%2038.5%2C34.7%20C35.4%2C34.5%2032.3%2C34.8%2029.2%2C34.9%20C26.2%2C34.9%2022.1%2C34.8%2020.0%2C34.8%20C17.9%2C34.7%2017.8%2C34.7%2016.6%2C34.7%20C15.5%2C34.7%2014.0%2C35.1%2012.9%2C34.8%20C11.8%2C34.4%2011.0%2C33.3%2010.0%2C32.6%20C9.0%2C31.9%207.7%2C31.3%206.9%2C30.4%20C6.1%2C29.5%205.5%2C28.3%205.1%2C27.2%20C4.7%2C26.0%204.7%2C24.7%204.5%2C23.5%20C4.3%2C22.3%203.8%2C21.1%203.9%2C20.0%20C4.1%2C18.9%205.0%2C17.8%205.4%2C16.7%20C5.7%2C15.5%205.6%2C14.3%206.1%2C13.3%20C6.5%2C12.3%207.5%2C11.6%208.2%2C10.6%20C8.9%2C9.7%209.3%2C8.5%2010.1%2C7.6%20C10.9%2C6.8%2012.0%2C6.2%2013.1%2C5.6%20C14.1%2C5.0%2015.2%2C4.2%2016.4%2C4.0%20C17.5%2C3.8%2017.9%2C4.3%2020.0%2C4.4%20Z%27%20fill%3D%27none%27%20stroke%3D%27%231c2230%27%20stroke-width%3D%274%27%20stroke-linejoin%3D%27round%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat, linear-gradient(90deg, #a2c3ea 0, #a2c3ea calc(20px + (100% - 40px) * var(--f, 0.5) - 7px), #e9c1ea calc(20px + (100% - 40px) * var(--f, 0.5) + 7px), #e9c1ea 100%);
}
#sliderOpacity .sliderFill {
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27280%27%20height%3D%2740%27%20viewBox%3D%270%200%20280%2040%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20d%3D%27M20.0%2C4.4%20C22.1%2C4.5%2026.2%2C4.6%2029.2%2C4.7%20C32.3%2C4.9%2035.4%2C5.4%2038.5%2C5.4%20C41.5%2C5.4%2044.6%2C4.9%2047.7%2C4.8%20C50.8%2C4.6%2053.8%2C4.7%2056.9%2C4.7%20C60.0%2C4.7%2063.1%2C4.8%2066.2%2C4.7%20C69.2%2C4.5%2072.3%2C4.0%2075.4%2C3.9%20C78.5%2C3.7%2081.5%2C4.0%2084.6%2C4.0%20C87.7%2C4.0%2090.8%2C3.9%2093.8%2C3.9%20C96.9%2C3.9%20100.0%2C4.1%20103.1%2C3.9%20C106.2%2C3.7%20109.2%2C2.9%20112.3%2C2.7%20C115.4%2C2.6%20118.5%2C2.9%20121.5%2C2.9%20C124.6%2C2.9%20127.7%2C2.5%20130.8%2C2.7%20C133.8%2C2.8%20136.9%2C3.6%20140.0%2C3.8%20C143.1%2C4.0%20146.2%2C3.9%20149.2%2C3.8%20C152.3%2C3.7%20155.4%2C3.0%20158.5%2C3.2%20C161.5%2C3.3%20164.6%2C4.5%20167.7%2C4.8%20C170.8%2C5.1%20173.8%2C5.0%20176.9%2C5.0%20C180.0%2C5.0%20183.1%2C4.8%20186.2%2C4.8%20C189.2%2C4.8%20192.3%2C5.0%20195.4%2C4.9%20C198.5%2C4.8%20201.5%2C4.5%20204.6%2C4.3%20C207.7%2C4.2%20210.8%2C4.0%20213.8%2C4.1%20C216.9%2C4.1%20220.0%2C4.7%20223.1%2C4.6%20C226.2%2C4.6%20229.2%2C3.9%20232.3%2C3.8%20C235.4%2C3.6%20238.5%2C3.7%20241.5%2C3.7%20C244.6%2C3.6%20247.7%2C3.6%20250.8%2C3.5%20C253.8%2C3.3%20257.9%2C2.7%20260.0%2C2.9%20C262.1%2C3.1%20262.4%2C4.1%20263.5%2C4.6%20C264.6%2C5.2%20265.6%2C5.6%20266.7%2C6.2%20C267.7%2C6.7%20268.9%2C7.0%20269.8%2C7.7%20C270.7%2C8.4%20271.4%2C9.4%20272.1%2C10.3%20C272.9%2C11.2%20273.8%2C12.0%20274.5%2C13.0%20C275.1%2C14.0%20275.5%2C15.2%20275.9%2C16.4%20C276.3%2C17.5%20276.8%2C18.8%20276.8%2C20.0%20C276.9%2C21.2%20276.6%2C22.5%20276.2%2C23.7%20C275.8%2C24.9%20275.1%2C25.9%20274.5%2C27.0%20C274.0%2C28.1%20273.7%2C29.4%20272.9%2C30.3%20C272.2%2C31.2%20271.1%2C31.9%20270.0%2C32.6%20C269.0%2C33.2%20267.9%2C33.7%20266.8%2C34.2%20C265.7%2C34.6%20264.6%2C34.9%20263.5%2C35.3%20C262.3%2C35.6%20262.1%2C36.3%20260.0%2C36.4%20C257.9%2C36.6%20253.8%2C36.2%20250.8%2C36.1%20C247.7%2C36.1%20244.6%2C36.1%20241.5%2C36.0%20C238.5%2C35.8%20235.4%2C35.4%20232.3%2C35.4%20C229.2%2C35.4%20226.2%2C36.1%20223.1%2C36.0%20C220.0%2C36.0%20216.9%2C35.4%20213.8%2C35.3%20C210.8%2C35.3%20207.7%2C35.8%20204.6%2C35.7%20C201.5%2C35.7%20198.5%2C35.0%20195.4%2C35.0%20C192.3%2C35.1%20189.2%2C35.7%20186.2%2C35.9%20C183.1%2C36.0%20180.0%2C36.0%20176.9%2C35.8%20C173.8%2C35.7%20170.8%2C35.0%20167.7%2C34.9%20C164.6%2C34.8%20161.5%2C35.1%20158.5%2C35.4%20C155.4%2C35.7%20152.3%2C36.5%20149.2%2C36.7%20C146.2%2C36.9%20143.1%2C36.3%20140.0%2C36.4%20C136.9%2C36.5%20133.8%2C37.2%20130.8%2C37.3%20C127.7%2C37.3%20124.6%2C36.8%20121.5%2C36.6%20C118.5%2C36.4%20115.4%2C36.2%20112.3%2C36.2%20C109.2%2C36.3%20106.2%2C36.8%20103.1%2C36.9%20C100.0%2C37.0%2096.9%2C37.1%2093.8%2C37.0%20C90.8%2C36.8%2087.7%2C36.3%2084.6%2C36.0%20C81.5%2C35.8%2078.5%2C35.6%2075.4%2C35.5%20C72.3%2C35.4%2069.2%2C35.4%2066.2%2C35.5%20C63.1%2C35.7%2060.0%2C36.1%2056.9%2C36.2%20C53.8%2C36.2%2050.8%2C35.9%2047.7%2C35.7%20C44.6%2C35.4%2041.5%2C34.8%2038.5%2C34.7%20C35.4%2C34.5%2032.3%2C34.8%2029.2%2C34.9%20C26.2%2C34.9%2022.1%2C34.8%2020.0%2C34.8%20C17.9%2C34.7%2017.8%2C34.7%2016.6%2C34.7%20C15.5%2C34.7%2014.0%2C35.1%2012.9%2C34.8%20C11.8%2C34.4%2011.0%2C33.3%2010.0%2C32.6%20C9.0%2C31.9%207.7%2C31.3%206.9%2C30.4%20C6.1%2C29.5%205.5%2C28.3%205.1%2C27.2%20C4.7%2C26.0%204.7%2C24.7%204.5%2C23.5%20C4.3%2C22.3%203.8%2C21.1%203.9%2C20.0%20C4.1%2C18.9%205.0%2C17.8%205.4%2C16.7%20C5.7%2C15.5%205.6%2C14.3%206.1%2C13.3%20C6.5%2C12.3%207.5%2C11.6%208.2%2C10.6%20C8.9%2C9.7%209.3%2C8.5%2010.1%2C7.6%20C10.9%2C6.8%2012.0%2C6.2%2013.1%2C5.6%20C14.1%2C5.0%2015.2%2C4.2%2016.4%2C4.0%20C17.5%2C3.8%2017.9%2C4.3%2020.0%2C4.4%20Z%27%20fill%3D%27none%27%20stroke%3D%27%231c2230%27%20stroke-width%3D%274%27%20stroke-linejoin%3D%27round%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat, linear-gradient(90deg, #e9c1ea 0, #e9c1ea calc(20px + (100% - 40px) * var(--f, 0.5) - 7px), #a2c3ea calc(20px + (100% - 40px) * var(--f, 0.5) + 7px), #a2c3ea 100%);
}

/* Chrome/Edge/Safari thumb (icons unchanged) */
#opacity::-webkit-slider-thumb, #size::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  background-size: cover; border: none; border-radius: 0;
}
#opacity::-webkit-slider-thumb { height: 40px; width: 40px; background-image: url("assets/images/OpacityButtonNOBOX-3.svg"); }
#size::-webkit-slider-thumb    { height: 40px; width: 40px; background-image: url("assets/images/SizeButtonNOBOX.svg"); }
#opacity::-webkit-slider-runnable-track,
#size::-webkit-slider-runnable-track { border-radius: 0; height: 35px; background: transparent; }

/* Firefox thumb + track */
#opacity::-moz-range-thumb, #size::-moz-range-thumb {
  border: none; border-radius: 0; background-size: cover; width: 40px; height: 40px; cursor: pointer;
}
#opacity::-moz-range-thumb { background-image: url("assets/images/OpacityButtonNOBOX-3.svg"); }
#size::-moz-range-thumb    { background-image: url("assets/images/SizeButtonNOBOX.svg"); }
#opacity::-moz-range-track, #size::-moz-range-track { border-radius: 0; height: 35px; background: transparent; }

/* Undo/Clear/Redo pill — centered, straddles nav bottom edge */
#midicons {
  position: fixed;
  left: 50%;
  top: 38px;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  background: #fff;
  padding: 5px;
  border-radius: 13px;
  box-shadow: 0 6px 6px -2px rgba(0,0,0,0.2);
  z-index: 10;
}
#undo, #clear, #redo {
  display: flex; align-items: center; justify-content: center;
  margin: 0 2.5px; cursor: pointer;
}
#EraseAllIcon, #RedoIcon { width: 50px; height: 60px; }
#undoicon { width: 50px; height: 60px; }



/* =======================
   Stage Header (Palette selector above palettes)
======================= */
.stageHeader{
  display: grid;
  grid-template-columns: var(--left-col) max-content var(--right-col);
  column-gap: var(--stage-gap);
  row-gap: 0;
  padding: 12px var(--stage-side-pad) 4px;
  justify-content: center;  /* center the entire 3-col row */
  align-items: end;
  margin-left: 650px;
}

/* Palette selector */
.paletteSelector{
  justify-self: center;
  align-self: end;

  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 14px;
  padding: 6px 12px;
  box-shadow: 0 8px 10px rgba(0,0,0,.12);
}

.palNum{
  font-family: 'SketchSocial', ui-sans-serif;
  font-size: 30px;
  line-height: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #333;
  transform-origin: center;
  transition: transform .15s ease, color .15s ease, text-decoration .15s ease, font-size .15s ease;
}
.palNum.active{
  font-size: 45px;
  color: #000;
  text-decoration: underline;
}

/* =======================
   Stage Layout (3 columns tight)
======================= */
.stage{
  display: grid;
  grid-template-columns: var(--left-col) max-content var(--right-col);
  column-gap: var(--stage-gap);
  row-gap: 0;
  padding: 6px var(--stage-side-pad) 0;
  justify-content: center;   /* keep columns together */
  align-items: start;
  margin-left: -175px;
}
.stage > * { min-width: 0; }
.leftColumn{ display: flex; flex-direction: column; gap: 12px; }

/* =======================
   Toolbox
======================= */
.toolbox{
  display: flex; gap: 8px;
  background: #fff; border: 1px solid #d8d8d8;
  border-radius: 14px; padding: 10px 14px;
  box-shadow: 0 6px 12px rgba(0,0,0,.08);
}
.tool{
  display: flex; align-items:center; justify-content:center;
  width: 40px; height: 40px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer;
  transition: background .2s, transform .1s;
}
.tool img{ width:45px; height:45px; object-fit:contain; display:block; }
.tool:hover{ background:#f3f3f3; }
.tool.active{ background:#e5e5e5; }

/* =======================
   Layers Panel (left)
======================= */
.layersPanel{
  background: #eee;
  border: 1px solid #d8d8d8;
  border-radius: 16px;
  box-shadow: 0 6px 12px rgba(0,0,0,.08);
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.layerItem{
  background: #d1d1d1;
  border-radius: 12px;
  padding: 8px;
  border: 1px solid #c7c7c7;
}
.layerHeader{
  font: 600 12px/1 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: #5b5b5b;
  margin-bottom: 6px;
}
.layerBody{
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 8px; align-items: center;
}
.layerThumbWrap{
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  width: 100%; height: 84px; display:flex; align-items:center; justify-content:center;
  overflow: hidden;
}
.layerThumb{ width: 100%; height: 100%; display: block; }
.layerBtns{ display: flex; flex-direction: column; gap: 6px; }
.layerBtn{
  width: 28px; height: 28px; border: none; border-radius: 6px;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  background: #fff; box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
  font-weight: 700; font-size: 18px;
}
.layerBtn.add{ color: #2fa64a; }
.layerBtn.del{ color: #a14b41; }
.layerItem.active{ outline: 3px solid #6b6bff; }

/* =======================
   Paper / Canvas Stack (center)
======================= */
.paper{
  position: relative;
  width: 900px; height: 560px;
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 14px;
  box-shadow: 0 8px 16px rgba(0,0,0,.12);
  overflow: hidden;
}
#layerStack{ position: absolute; inset: 0; }
.stackCanvas, #draw, #draw-overlay{
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
}
#draw { opacity: 0; pointer-events: none; } /* sizing reference only */

/* =======================
   Save Row (below the stage)
======================= */
.saveRow{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 0 20px;
}

.captionGroup{
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 900px;
  padding: 0 10px;
}

#captionInput{
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  font-size: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: #fff;
  outline: none;
  transition: border-color .2s ease;
}

#captionInput:focus{
  border-color: #6b6bff;
}

.lockLabel{
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  user-select: none;
}

.lockLabel input[type="checkbox"]{
  cursor: pointer;
}

.lockIcon{
  font-size: 14px;
}

.actionButtons{
  display: flex;
  gap: 10px;
  align-items: center;
}

#saveCanvasBtn{
  background: #555; 
  color: #fff; 
  border: none;
  padding: 10px 16px; 
  border-radius: 8px;
  font-weight: 600; 
  cursor: pointer;
  transition: background .2s ease;
}

#saveCanvasBtn:hover{
  background: #444;
}

.postBtn{
  background: #6b6bff;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background .2s ease, transform .05s ease;
}

.postBtn:hover{
  background: #5a5aee;
}

.postBtn:active{
  transform: scale(0.98);
}

/* =======================
   Right Column: Palettes
======================= */
.rightColumn{
  position: relative;
  height: 560px;
  align-self: start;
}
.paletteColumn{
  position: relative;
  width: var(--right-col); height: 100%;
  background: #f6f6f6;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px #e4e4e4;
  padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

/* swatches */
.swatch{
  width: 42px; height: 42px;
  border-radius: 999px; border: none;
  display:flex; align-items:center; justify-content:center;
  cursor: pointer; background: #fff;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
  transition: background .15s ease, transform .05s ease, width .1s ease, border-radius .1s ease;
}
.swatch img{ width: 26px; height: 26px; pointer-events: none; }
.swatch:active{ transform: scale(.98); }
.swatch.color::after{
  content: "";
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--swatch);
  display: block;
}
/* selected swatch turns into a rectangle indicator */
.swatch.selected{
  background: #e5e5e5;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.05);
  width: 56px;
  border-radius: 10px;
}
.swatches{
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; align-items: center;
}

/* hide native color input (for picker button only) */
#hiddenColorInput{
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
}

/* =======================
   Text Tool UI
======================= */
#textToolbar{
  position: absolute;
  top: 8px; left: 8px;
  z-index: 40;
  display: flex; gap: 8px; align-items: center;
  background: #fff; border: 1px solid #ddd; border-radius: 10px;
  padding: 6px 8px; box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
#textToolbar label{
  font-size: 12px; color: #666;
}
#fontSelect{
  border: 1px solid #ccc; border-radius: 8px;
  padding: 4px 6px; outline: none; background: #fff;
}

/* =======================
   Swatch editor popup
======================= */
.swatchEditor{
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0,0,0,.15);
  padding: 10px;
  width: 210px;
}
.swatchEditor .row{ display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.swatchEditor .row.actions{ justify-content: flex-end; margin-bottom: 0; gap: 6px; }
.swatchEditor label{ font-size: 12px; width: 42px; color: #555; }
.swatchEditor input[type="text"],
.swatchEditor input[type="number"]{
  border: 1px solid #ccc; border-radius: 6px; padding: 4px 6px; width: 70px;
}
.swatchEditor input[type="number"]{ width: 52px; }
.swatchEditor button{
  border: none; border-radius: 6px; padding: 6px 10px; cursor: pointer;
}
#swatchSave{ background: #111; color: #fff; }
#swatchCancel{ background: #eee; color: #222; }

/* Ensure stacking order during Text preview */
#layerStack { z-index: 10; }           /* layer canvases */
#draw        { z-index: 5; }            /* hidden sizing canvas */
#draw-overlay{ z-index: 15; pointer-events: none; } /* preview strokes */

.textBox     { z-index: 100; }          /* floating text container (injected) */
.textBox .rh { z-index: 101; }          /* resize handles above the box */

/* Badge cluster */
.badges{
  position: fixed;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 10000;
}

/* Version badge (non-interactive) */
.buildBadge{
  padding: 6px 10px;
  background: rgba(17,17,17,.85);
  color: #fff;
  border-radius: 8px;
  font: 600 11px/1 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  letter-spacing: .2px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  pointer-events: none;   /* doesn't block clicks on the Discord badge */
  user-select: none;
}

/* Discord badge (clickable) */
.discordBadge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #5865F2;           /* Discord blurple */
  color: #fff;
  border-radius: 8px;
  font: 600 11px/1 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}
.discordBadge:hover{
  filter: brightness(1.05);
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
}
.discordBadge:active{
  transform: translateY(1px);
}


