/* Glint: styles. Colors and fonts are set once in :root below. */

/* Fonts live in assets/fonts so the site needs nothing from other servers. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../assets/fonts/plus-jakarta-sans.woff2") format("woff2");
}

@font-face {
  font-family: "Tilt Neon";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/tilt-neon.woff2") format("woff2");
}

:root {
  --bg: #07070B;
  --panel: #0D0D14;
  --surface: rgba(255,255,255,.045);
  --surface2: rgba(255,255,255,.085);
  --line: rgba(255,255,255,.09);
  --line2: rgba(255,255,255,.17);
  --text: #F3F4F8;
  --mute: #A4A7BA;
  --c1: #2BE4FF;
  --c2: #8B6CFF;
  --c3: #FF3DB5;
  --err: #FF6B88;
  --grad: linear-gradient(100deg,var(--c1),var(--c2) 52%,var(--c3));
  --display: "Tilt Neon","Plus Jakarta Sans",system-ui,sans-serif;
  --ui: "Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font: 500 13.5px/1.45 var(--ui);
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body.is-empty {
  overflow: auto;
  background: radial-gradient(48% 38% at 88% 4%,rgba(139,108,255,.20),transparent 70%), radial-gradient(42% 36% at 4% 78%,rgba(43,228,255,.11),transparent 70%), radial-gradient(36% 30% at 70% 100%,rgba(255,61,181,.10),transparent 70%),var(--bg);
  background-attachment: fixed;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 2px;
}

svg.ic,
.btn svg,
.ib svg,
.tb svg,
.chip svg,
.rail svg,
.features svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- neon wordmark ---------- */
.neon {
  font-family: var(--display);
  font-weight: 400;
  color: #fff;
  text-shadow: 0 0 5px rgba(43,228,255,.95),0 0 16px rgba(43,228,255,.6),0 0 34px rgba(139,108,255,.6),0 0 64px rgba(255,61,181,.4);
  animation: flicker 1.3s linear 1 both;
}

@keyframes flicker {
  0% {
    opacity: .08;
  }
  7% {
    opacity: 1;
  }
  10% {
    opacity: .2;
  }
  14% {
    opacity: 1;
  }
  22% {
    opacity: .45;
  }
  26%,
  100% {
    opacity: 1;
  }
}

/* ---------- top bar ---------- */
.top {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 20px;
  background: rgba(9,9,14,.74);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.logo {
  appearance: none;
  border: 0;
  background: none;
  padding: 4px 4px 4px 0;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
  margin-right: 6px;
  letter-spacing: .01em;
  border-radius: 8px;
}

.logo:hover {
  filter: brightness(1.2);
}

.top-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* quiet text buttons in the top bar: Home, Reset all, Close photo */
.tb {
  appearance: none;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--mute);
  font: 700 12.5px/1 var(--ui);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.tb svg {
  width: 16px;
  height: 16px;
}

.tb:hover {
  color: #fff;
  background: var(--surface2);
}

.tsep {
  width: 1px;
  height: 18px;
  background: var(--line2);
  margin: 0 6px;
}

.fileinfo {
  flex: 1;
  min-width: 0;
  font: 12px/1.6 var(--mono);
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
}

.top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.is-empty .app-only {
  display: none;
}

body:not(.is-empty) .landing-only {
  display: none;
}

.privacy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--mute);
  font-size: 12.5px;
  margin-right: 6px;
}

.privacy svg {
  width: 15px;
  height: 15px;
  stroke: var(--c1);
}

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--text);
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font: 700 13.5px/1 var(--ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s,border-color .15s,box-shadow .2s,transform .08s;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn:hover {
  background: var(--surface2);
  border-color: rgba(255,255,255,.28);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  border: 0;
  background: var(--grad);
  color: #08080C;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset,0 8px 26px -8px rgba(139,108,255,.8);
}

.btn.primary:hover {
  box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset,0 0 26px rgba(43,228,255,.5),0 0 46px rgba(255,61,181,.38);
}

.btn.big {
  height: 52px;
  padding: 0 24px;
  font-size: 15.5px;
  border-radius: 14px;
}

.btn.wide {
  width: 100%;
}

.btn:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.ib {
  appearance: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--mute);
  display: grid;
  place-items: center;
  cursor: pointer;
  font: 800 14px/1 var(--ui);
}

.ib svg {
  width: 18px;
  height: 18px;
}

.ib:hover {
  color: #fff;
  background: var(--surface2);
}

.ib:disabled {
  opacity: .28;
  cursor: default;
  background: none;
}

.chip {
  appearance: none;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--mute);
  font: 700 12px/1 var(--ui);
  display: inline-flex;
  gap: 7px;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s,border-color .15s,box-shadow .2s;
}

.chip svg {
  width: 15px;
  height: 15px;
}

.chip:hover {
  color: #fff;
}

.chip[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(43,228,255,.6);
  box-shadow: 0 0 16px -3px rgba(43,228,255,.55) inset,0 0 14px -6px rgba(43,228,255,.8);
}

/* ---------- landing ---------- */
.landing {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(28px,7vh,84px) clamp(18px,4.5vw,56px) 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0,5fr) minmax(0,6fr);
  gap: clamp(26px,4.5vw,64px);
  align-items: center;
}

.eyebrow {
  font: 700 11.5px/1 var(--ui);
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--c1);
  margin: 0 0 20px;
}

.hero h1 {
  margin: 0;
  font: 800 clamp(42px,5.2vw,68px)/1.04 var(--ui);
  letter-spacing: -.035em;
}

.hero h1 .dull {
  color: #6E7187;
}

.hero h1 .neon {
  font-size: 1.16em;
  letter-spacing: 0;
  display: inline-block;
  animation-delay: .35s;
}

.lede {
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--mute);
  max-width: 47ch;
  margin: 24px 0 30px;
  font-weight: 500;
}

.hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hint {
  color: var(--mute);
  margin: 16px 0 0;
  font-size: 12.5px;
}

.hint kbd,
.keys kbd {
  font: 600 11px/1 var(--mono);
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--text);
}

.demo-wrap {
  min-width: 0;
}

.demo {
  position: relative;
  aspect-ratio: 451/300;
  border-radius: 20px;
  overflow: hidden;
  --split: 50%;
  border: 1px solid var(--line2);
  background: #111;
  box-shadow: 0 36px 90px -34px rgba(139,108,255,.7),0 0 70px -30px rgba(43,228,255,.5);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.demo canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.demo-cap {
  margin: 14px 2px 0;
  color: var(--mute);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-cap i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 10px var(--c1);
  flex: none;
}

.features {
  list-style: none;
  padding: 0;
  margin: clamp(40px,8vh,84px) 0 0;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
}

.features li {
  padding: 20px 20px 22px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.features svg {
  width: 22px;
  height: 22px;
  stroke: url(#gr);
}

.features b {
  display: block;
  font: 700 15px/1.3 var(--ui);
  margin: 14px 0 5px;
}

.features span {
  color: var(--mute);
  font-size: 13px;
  line-height: 1.55;
}

/* ---------- app layout ---------- */
.app {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) 340px 78px;
}

.stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  --split: 50%;
  cursor: grab;
  background: radial-gradient(55% 45% at 0% 0%,rgba(43,228,255,.075),transparent 70%), radial-gradient(55% 45% at 100% 100%,rgba(255,61,181,.065),transparent 70%), radial-gradient(rgba(255,255,255,.06) 1px,transparent 1.5px) 0 0/22px 22px,#08080C;
}

.stage.grabbing {
  cursor: grabbing;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.after {
  clip-path: inset(0 0 0 var(--split));
}

.stage.nosplit .after,
.stage.cropping .after {
  clip-path: none;
}

.stage.holding .after {
  visibility: hidden;
}

.stage.nosplit .divider,
.stage.nosplit .tag-before,
.stage.holding .divider {
  display: none;
}

.stage.nosplit.sweeping .divider {
  display: block;
}

.stage.nosplit.sweeping .after {
  clip-path: inset(0 0 0 var(--split));
}

.stage.cropping {
  cursor: default;
}

.stage.cropping .divider,
.stage.cropping .tag,
.stage.cropping .viewbar,
.stage.cropping .strip {
  display: none;
}

.panel {
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 20px 18px 32px;
  scrollbar-width: thin;
  scrollbar-color: #2a2a36 transparent;
}

.rail {
  background: #0A0A10;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 7px;
}

.rail button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--mute);
  border-radius: 12px;
  padding: 11px 2px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font: 700 10.5px/1 var(--ui);
  cursor: pointer;
  transition: color .15s,background .15s;
}

.rail svg {
  width: 21px;
  height: 21px;
}

.rail button:hover {
  color: #fff;
}

.rail button[aria-selected="true"] {
  color: #fff;
  background: var(--surface2);
  box-shadow: 0 0 0 1px var(--line) inset;
}

.rail button[aria-selected="true"] svg {
  stroke: url(#gr);
  filter: drop-shadow(0 0 6px rgba(43,228,255,.7));
}

body.is-busy .panel,
body.is-busy .rail {
  opacity: .45;
  pointer-events: none;
}

/* ---------- stage overlays ---------- */
.tag {
  position: absolute;
  top: 14px;
  padding: 6px 10px 6px;
  border-radius: 999px;
  background: rgba(8,8,12,.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line2);
  font: 800 10px/1 var(--ui);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #fff;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 2;
}

.tag-before {
  left: 14px;
}

.tag-after {
  right: 14px;
}

.tag.off {
  opacity: 0;
}

.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 44px;
  margin-left: -22px;
  cursor: ew-resize;
  touch-action: none;
  z-index: 3;
}

.divider::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg,var(--c1),var(--c2),var(--c3));
  box-shadow: 0 0 0 1px rgba(0,0,0,.3),0 0 10px rgba(43,228,255,.85),0 0 24px rgba(255,61,181,.55);
}

.sweeping .divider::before {
  width: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.3),0 0 18px #fff,0 0 40px rgba(43,228,255,.95),-30px 0 60px rgba(43,228,255,.35);
}

.grip {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  background: rgba(9,9,14,.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.9);
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(43,228,255,.6);
}

.grip svg {
  width: 17px;
  height: 17px;
  stroke: #fff;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.divider:focus-visible {
  outline: none;
}

.divider:focus-visible .grip {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.glass {
  background: rgba(10,10,16,.7);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line2);
}

.viewbar {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  border-radius: 12px;
  padding: 3px;
  z-index: 4;
}

.viewbar button {
  appearance: none;
  background: none;
  border: 0;
  color: #fff;
  height: 32px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 9px;
  font: 700 12px/1 var(--ui);
  cursor: pointer;
}

.viewbar button:hover {
  background: var(--surface2);
}

.viewbar output {
  font: 12px/1 var(--mono);
  min-width: 6ch;
  text-align: center;
  color: var(--mute);
}

.viewbar .sep {
  width: 1px;
  height: 16px;
  background: var(--line2);
  margin: 0 3px;
}

.strip {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: calc(100% - 270px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  overflow-x: auto;
  z-index: 4;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar {
  display: none;
}

.thumb {
  appearance: none;
  position: relative;
  flex: none;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #15151c;
  cursor: pointer;
  overflow: visible;
}

.thumb canvas {
  position: static;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  display: block;
  opacity: .6;
  transition: opacity .15s;
}

.thumb:hover canvas,
.thumb.on canvas {
  opacity: 1;
}

.thumb.on {
  box-shadow: 0 0 0 2px #0b0b10,0 0 0 4px var(--c1),0 0 16px rgba(43,228,255,.7);
}

.thumb .rm {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1b1b25;
  border: 1px solid var(--line2);
  color: #fff;
  display: none;
  place-items: center;
  font: 800 11px/1 var(--ui);
}

.thumb:hover .rm,
.thumb:focus-within .rm {
  display: grid;
}

.strip .ib {
  width: 40px;
  height: 40px;
  border: 1px dashed var(--line2);
  border-radius: 9px;
  flex: none;
}

.toast {
  position: fixed;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(520px,calc(100% - 28px));
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  z-index: 50;
  border-left: 3px solid var(--c1);
  box-shadow: 0 10px 40px -10px rgba(0,0,0,.8);
}

.toast.err {
  border-left-color: var(--err);
}

.busy {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(6,6,10,.66);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 9;
  cursor: default;
  overflow: hidden;
}

.busy.on {
  display: grid;
}

.scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -140px;
  height: 140px;
  background: linear-gradient(180deg,transparent,rgba(43,228,255,.16) 72%,rgba(255,255,255,.85));
  border-bottom: 1px solid #fff;
  box-shadow: 0 10px 34px rgba(43,228,255,.65);
  animation: scan 1.9s cubic-bezier(.45,0,.55,1) infinite;
}

@keyframes scan {
  to {
    top: 100%;
  }
}

.busy-box {
  position: relative;
  width: min(360px,82%);
  padding: 18px 18px 16px;
  border-radius: 16px;
}

.busy-label {
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.busy-label span:last-child {
  font: 12px/1.7 var(--mono);
  color: var(--mute);
  font-weight: 400;
}

.track {
  height: 5px;
  border-radius: 5px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 14px var(--c1);
}

.busy .btn {
  margin-top: 16px;
  height: 34px;
}

.dropveil {
  position: fixed;
  inset: 12px;
  border: 2px dashed var(--c1);
  border-radius: 22px;
  background: rgba(6,6,10,.78);
  color: #fff;
  display: none;
  place-items: center;
  font: 800 24px/1 var(--ui);
  z-index: 60;
  pointer-events: none;
  box-shadow: 0 0 60px -10px rgba(43,228,255,.6) inset;
}

body.dragover .dropveil {
  display: grid;
}

/* ---------- crop box ---------- */
.cropbox {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(4,4,8,.7);
  outline: 1.5px solid #fff;
  cursor: move;
  touch-action: none;
  z-index: 4;
}

.cropbox i {
  position: absolute;
  background: rgba(255,255,255,.3);
  pointer-events: none;
}

.cropbox i:nth-of-type(1) {
  left: 33.33%;
  top: 0;
  bottom: 0;
  width: 1px;
}

.cropbox i:nth-of-type(2) {
  left: 66.66%;
  top: 0;
  bottom: 0;
  width: 1px;
}

.cropbox i:nth-of-type(3) {
  top: 33.33%;
  left: 0;
  right: 0;
  height: 1px;
}

.cropbox i:nth-of-type(4) {
  top: 66.66%;
  left: 0;
  right: 0;
  height: 1px;
}

.cropbox b {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: -15px;
}

.cropbox b::after {
  content: "";
  position: absolute;
  inset: 9px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(43,228,255,.95),0 0 0 1px rgba(0,0,0,.4);
}

.cropbox b[data-h="nw"] {
  left: 0;
  top: 0;
  cursor: nwse-resize;
}

.cropbox b[data-h="n"] {
  left: 50%;
  top: 0;
  cursor: ns-resize;
}

.cropbox b[data-h="ne"] {
  left: 100%;
  top: 0;
  cursor: nesw-resize;
}

.cropbox b[data-h="e"] {
  left: 100%;
  top: 50%;
  cursor: ew-resize;
}

.cropbox b[data-h="se"] {
  left: 100%;
  top: 100%;
  cursor: nwse-resize;
}

.cropbox b[data-h="s"] {
  left: 50%;
  top: 100%;
  cursor: ns-resize;
}

.cropbox b[data-h="sw"] {
  left: 0;
  top: 100%;
  cursor: nesw-resize;
}

.cropbox b[data-h="w"] {
  left: 0;
  top: 50%;
  cursor: ew-resize;
}

.cropbox output {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  padding: 5px 9px;
  border-radius: 999px;
  font: 12px/1 var(--mono);
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- panel ---------- */
.tab h2 {
  font: 800 18px/1.2 var(--ui);
  letter-spacing: -.015em;
  margin: 0 0 16px;
}

.tab h3 {
  font: 800 10.5px/1 var(--ui);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 26px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tab h3 button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--c1);
  font: 700 11px/1 var(--ui);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  padding: 4px;
}

.note {
  color: var(--mute);
  font-size: 12.5px;
  line-height: 1.55;
  margin: 12px 0 0;
}

.row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.row > * {
  flex: 1;
  min-width: 0;
}

#s-mix {
  margin-top: 14px;
}

.seg {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.seg + .seg {
  margin-top: 8px;
}

.seg label {
  flex: 1;
  position: relative;
  text-align: center;
}

.seg input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.seg span {
  display: block;
  padding: 8px 4px;
  border-radius: 9px;
  font-weight: 700;
  color: var(--mute);
  transition: color .15s,background .15s;
}

.seg input:checked + span {
  background: rgba(255,255,255,.12);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(43,228,255,.55) inset,0 0 18px -5px rgba(43,228,255,.75);
}

.seg input:disabled {
  cursor: not-allowed;
}

.seg input:disabled + span {
  opacity: .35;
  text-decoration: line-through;
}

.seg input:focus-visible + span {
  outline: 2px solid var(--c1);
  outline-offset: 2px;
}

.sl {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 8px;
  padding: 5px 0 5px;
}

.sl-name {
  font-size: 13px;
  font-weight: 600;
}

.sl-val {
  font: 12px/1 var(--mono);
  color: var(--mute);
  min-width: 4ch;
  text-align: right;
}

.sl.changed .sl-val {
  color: #fff;
  font-weight: 700;
}

.sl input {
  grid-column: 1/-1;
  width: 100%;
  height: 22px;
  margin: 2px 0 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  border-radius: 6px;
  --ta: 0;
  --tb: 0;
  --tz: 0;
  --a: calc(8px + (100% - 16px) * var(--ta));
  --b: calc(8px + (100% - 16px) * var(--tb));
  background: linear-gradient(rgba(255,255,255,.4),rgba(255,255,255,.4)) no-repeat calc(100% * var(--tz) + 8px - 16px * var(--tz)) 50% / 2px 10px transparent;
}

.sl input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg,#272731 0 var(--a),transparent var(--a) var(--b),#272731 var(--b) 100%),var(--grad);
}

.sl input::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg,#272731 0 var(--a),transparent var(--a) var(--b),#272731 var(--b) 100%),var(--grad);
}

.sl input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  margin-top: -6px;
  box-shadow: 0 0 0 3px rgba(43,228,255,.18),0 1px 4px rgba(0,0,0,.6);
  transition: box-shadow .15s;
}

.sl input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 3px rgba(43,228,255,.18),0 1px 4px rgba(0,0,0,.6);
}

.sl input:hover::-webkit-slider-thumb,
.sl input:active::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(43,228,255,.3),0 0 16px rgba(43,228,255,.9);
}

.tip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 14px;
  padding: 11px 6px 11px 13px;
  border-radius: 12px;
  background: rgba(43,228,255,.07);
  border: 1px solid rgba(43,228,255,.28);
}

.tip p {
  margin: 0;
  flex: 1;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--mute);
}

.tip b {
  color: #fff;
}

.tip .ib {
  width: 26px;
  height: 26px;
  flex: none;
}

.tip .ib svg {
  width: 14px;
  height: 14px;
}

.linkbtn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--c1);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.looks {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px 8px;
}

.look {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--mute);
  font: 700 11.5px/1 var(--ui);
  cursor: pointer;
  text-align: center;
}

.look .ph {
  display: block;
  padding: 2px;
  border-radius: 12px;
  transition: box-shadow .2s;
}

.look canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 10px;
  background: #15151c;
}

.look .nm {
  display: block;
  margin-top: 7px;
}

.look:hover {
  color: #fff;
}

.look[aria-pressed="true"] {
  color: #fff;
}

.look[aria-pressed="true"] .ph {
  background: var(--grad);
  box-shadow: 0 0 18px -2px rgba(139,108,255,.9);
}

.viz {
  margin: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  overflow: hidden;
}

.viz canvas {
  display: block;
  width: 100%;
}

#histo {
  height: 86px;
}

#curve {
  height: 210px;
  touch-action: none;
  cursor: crosshair;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tools .btn {
  height: 40px;
  font-size: 12.5px;
  padding: 0 8px;
}

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  font-weight: 600;
  font-size: 13px;
}

.field select {
  appearance: none;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: #15151d url("../assets/chevron.svg") no-repeat right 12px center/11px;
  padding: 0 34px 0 12px;
  font-weight: 700;
  cursor: pointer;
}

.outsize {
  font: 12px/1.5 var(--mono);
  color: var(--mute);
  margin: 12px 0 0;
}

.outsize b {
  color: #fff;
  font-weight: 600;
}

dialog {
  background: #11111A;
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 18px;
  padding: 22px 22px 18px;
  width: min(440px,calc(100% - 32px));
  box-shadow: 0 40px 120px -20px #000,0 0 80px -30px rgba(139,108,255,.7);
}

dialog::backdrop {
  background: rgba(4,4,8,.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

dialog h2 {
  margin: 0 0 14px;
  font: 800 18px/1.2 var(--ui);
}

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 16px;
  margin: 0 0 18px;
  align-items: center;
}

.keys dt {
  white-space: nowrap;
}

.keys dd {
  margin: 0;
  color: var(--mute);
}

/* ---------- small screens ---------- */
@media (max-width:1320px) {
  .top .chip span {
    display: none;
  }

  .top .chip {
    padding: 0 9px;
  }
}

@media (max-width:1120px) {
  .tb span {
    display: none;
  }

  .fileinfo {
    visibility: hidden;
  }
}

@media (max-width:900px) {
  html,
  body {
    height: auto;
    min-height: 100%;
  }
  body {
    overflow: auto;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .features {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .app {
    display: flex;
    flex-direction: column;
  }
  .stage {
    flex: none;
    height: 54vh;
    min-height: 320px;
  }
  .rail {
    order: 2;
    flex-direction: row;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 56px;
    z-index: 10;
    padding: 6px 8px;
    overflow-x: auto;
  }
  .rail button {
    flex: 1;
    min-width: 62px;
    padding: 8px 2px 7px;
  }
  .panel {
    order: 3;
    border-left: 0;
    overflow: visible;
    padding-bottom: 48px;
  }
  .fileinfo,
  .top .chip,
  .top .tb,
  .tsep,
  .privacy,
  #btnKeys {
    display: none;
  }
  .top {
    padding: 0 10px 0 14px;
    gap: 4px;
  }
  .logo {
    font-size: 24px;
    margin-right: 4px;
  }
  .btn .lbl-wide {
    display: none;
  }
  .strip {
    max-width: calc(100% - 28px);
    bottom: 60px;
  }
}

@media (max-width:560px) {
  .features {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: clamp(40px,12.5vw,60px);
  }
  .btn.big {
    flex: 1;
  }
  #btnOpen span {
    display: none;
  }
  .hint {
    display: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  * {
    transition: none !important;
  }
  .neon {
    animation: none;
  }
  .scan {
    animation: none;
    top: 40%;
  }
}
