/* ====== Customize drawer UI styles =================== */

#apgCustomize { font-family: "Inter", system-ui, sans-serif; }

#apgCustomize .apg-trigger {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 100;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ink, #0A0907);
  color: var(--bg, #F1ECE0);
  border: 0;
  display: grid; place-items: center;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.35), 0 2px 0 rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
#apgCustomize .apg-trigger:hover { transform: translateY(-2px) rotate(30deg); }
#apgCustomize .apg-trigger:active { transform: translateY(0); }

#apgCustomize .apg-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,9,7,0.36);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 101;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
#apgCustomize.is-open .apg-backdrop { opacity: 1; pointer-events: auto; }

#apgCustomize .apg-panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--bg, #F1ECE0);
  border-left: 1px solid rgba(10,9,7,0.08);
  z-index: 102;
  transform: translateX(110%);
  transition: transform .35s cubic-bezier(.5,.1,.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: -30px 0 60px -30px rgba(0,0,0,0.3);
}
#apgCustomize.is-open .apg-panel { transform: translateX(0); }

#apgCustomize .apg-head {
  padding: 28px 28px 18px;
  display: flex; justify-content: space-between; gap: 18px;
  border-bottom: 1px solid rgba(10,9,7,0.08);
}
#apgCustomize .apg-eyebrow {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4, #8B8275);
  margin-bottom: 8px;
}
#apgCustomize .apg-head h3 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 8px;
  color: var(--ink, #0A0907);
}
#apgCustomize .apg-head h3 em { font-style: italic; color: var(--acid, #3DD68C); }
#apgCustomize .apg-head p {
  font-size: 13.5px;
  color: var(--ink-3, #5C544A);
  margin: 0;
  max-width: 36ch;
  line-height: 1.5;
}
#apgCustomize .apg-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent; border: 0;
  color: var(--ink-3, #5C544A);
  font-size: 22px;
  cursor: pointer;
  align-self: start;
  display: grid; place-items: center;
  flex-shrink: 0;
}
#apgCustomize .apg-close:hover { background: rgba(10,9,7,0.08); color: var(--ink, #0A0907); }

#apgCustomize .apg-section {
  padding: 22px 28px;
  border-bottom: 1px solid rgba(10,9,7,0.06);
}
#apgCustomize .apg-section:last-of-type { border-bottom: 0; }

#apgCustomize .apg-label {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4, #8B8275);
  margin-bottom: 12px;
}

#apgCustomize .apg-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
#apgCustomize .apg-row label {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4, #8B8275);
}
#apgCustomize .apg-row label .apg-val {
  font-family: "Inter", sans-serif;
  margin-left: 8px;
  color: var(--ink, #0A0907);
  font-size: 11px;
}

#apgCustomize input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 180px;
  background: transparent;
}
#apgCustomize input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(10,9,7,0.12);
  border-radius: 99px;
}
#apgCustomize input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink, #0A0907);
  margin-top: -6px;
  cursor: pointer;
}
#apgCustomize input[type="range"]::-moz-range-track {
  height: 4px;
  background: rgba(10,9,7,0.12);
  border-radius: 99px;
}
#apgCustomize input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink, #0A0907);
  border: 0;
  cursor: pointer;
}

#apgCustomize .apg-seg {
  display: inline-flex;
  background: rgba(10,9,7,0.06);
  border-radius: 99px;
  padding: 3px;
}
#apgCustomize .apg-seg button {
  background: transparent;
  border: 0;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2, #25211C);
  transition: all .15s;
}
#apgCustomize .apg-seg button.on {
  background: var(--ink, #0A0907);
  color: var(--bg, #F1ECE0);
}

#apgCustomize .apg-palettes,
#apgCustomize .apg-bgs,
#apgCustomize .apg-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
#apgCustomize .apg-palettes button,
#apgCustomize .apg-bgs button,
#apgCustomize .apg-types button {
  background: var(--bg-2, #E5DDC9);
  border: 1.5px solid transparent;
  padding: 12px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: all .15s;
}
#apgCustomize .apg-palettes button:hover,
#apgCustomize .apg-bgs button:hover,
#apgCustomize .apg-types button:hover {
  background: var(--bg, #F1ECE0);
}
#apgCustomize .apg-palettes button.on,
#apgCustomize .apg-bgs button.on,
#apgCustomize .apg-types button.on {
  border-color: var(--ink, #0A0907);
  background: var(--bg, #F1ECE0);
}

#apgCustomize .apg-palettes button {
  position: relative;
  height: 70px;
}
#apgCustomize .apg-palettes .sw-a, #apgCustomize .apg-palettes .sw-b {
  position: absolute;
  border-radius: 50%;
  top: 14px;
}
#apgCustomize .apg-palettes .sw-a {
  width: 28px; height: 28px; left: 18px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
#apgCustomize .apg-palettes .sw-b {
  width: 18px; height: 18px; left: 40px; top: 18px;
  z-index: 1;
}
#apgCustomize .apg-pname {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-3, #5C544A);
  margin-top: auto;
  text-transform: lowercase;
}
#apgCustomize .apg-palettes button.on .apg-pname { color: var(--ink, #0A0907); font-weight: 600; }

#apgCustomize .apg-bgs button { height: 70px; padding: 8px; }
#apgCustomize .apg-bgs .bg-card {
  width: 100%; flex: 1;
  border-radius: 6px;
  border: 1px solid;
  position: relative;
}
#apgCustomize .apg-bgs .bg-chip {
  position: absolute;
  inset: 4px;
  border-radius: 4px;
}

#apgCustomize .apg-types { grid-template-columns: repeat(3, 1fr); }
#apgCustomize .apg-types button { height: 78px; padding-top: 14px; }
#apgCustomize .apg-types .apg-type-sample {
  font-size: 26px;
  line-height: 1;
  color: var(--ink, #0A0907);
}

#apgCustomize .apg-foot {
  margin-top: auto;
  display: flex; justify-content: space-between; gap: 10px;
  padding: 18px 28px 28px;
  border-top: 1px solid rgba(10,9,7,0.08);
}
#apgCustomize .apg-foot button {
  height: 44px; padding: 0 18px;
  border-radius: 10px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  transition: all .15s;
}
#apgCustomize .apg-reset {
  background: transparent;
  color: var(--ink-2, #25211C);
}
#apgCustomize .apg-reset:hover { background: rgba(10,9,7,0.06); }
#apgCustomize .apg-done {
  background: var(--ink, #0A0907);
  color: var(--bg, #F1ECE0);
  padding: 0 24px;
}
#apgCustomize .apg-done:hover { opacity: 0.88; }

/* dark mode */
[data-theme="dark"] #apgCustomize .apg-panel { background: #14110D; border-left-color: rgba(255,255,255,0.08); }
[data-theme="dark"] #apgCustomize .apg-head,
[data-theme="dark"] #apgCustomize .apg-section,
[data-theme="dark"] #apgCustomize .apg-foot { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] #apgCustomize .apg-seg { background: rgba(255,255,255,0.08); }
[data-theme="dark"] #apgCustomize .apg-seg button.on { background: var(--bg, #F1ECE0); color: var(--ink, #0A0907); }
[data-theme="dark"] #apgCustomize input[type="range"]::-webkit-slider-runnable-track { background: rgba(255,255,255,0.14); }
[data-theme="dark"] #apgCustomize input[type="range"]::-webkit-slider-thumb { background: var(--bg, #F1ECE0); }

@media (max-width: 600px) {
  #apgCustomize .apg-palettes,
  #apgCustomize .apg-bgs,
  #apgCustomize .apg-types { grid-template-columns: repeat(2, 1fr); }
}
