:root {
  --bg: #14161b;
  --card: #1d2027;
  --line: #2d313b;
  --tx: #e8eaf0;
  --mut: #8f95a3;
  --acc: #3ddc84;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font:
    14px/1.4 system-ui,
    "Segoe UI",
    Arial,
    sans-serif;
}
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 150px;
  display: grid;
  gap: 12px;
}
h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 650;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px;
  align-items: end;
}
label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--mut);
}
.fld {
  display: grid;
  gap: 4px;
}
.lbl {
  font-size: 12px;
  color: var(--mut);
}
.chk {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--tx);
  align-self: center;
}
textarea {
  width: 100%;
  height: 150px;
  resize: vertical;
  padding: 12px 14px;
  background: #1a1d24;
  color: var(--tx);
  border: 1px solid var(--line);
  border-radius: 12px;
  color-scheme: dark;
  transition: border-color 0.15s;
  font:
    13px/1.4 Consolas,
    monospace;
}
textarea::placeholder {
  color: var(--mut);
}
textarea:hover {
  border-color: #464c5b;
}
textarea:focus {
  outline: none;
  border-color: var(--acc);
}
button {
  background: #323744;
  color: var(--tx);
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}
button:hover {
  background: #3d4352;
}
button.pri {
  background: var(--acc);
  color: #06210f;
  font-weight: 650;
}
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
.sep {
  width: 1px;
  height: 26px;
  background: var(--line);
}
.hint {
  color: var(--mut);
  font-size: 12px;
  margin: 0;
}
#pal {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 340px;
  background: rgba(29, 32, 39, 0.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  z-index: 5;
  backdrop-filter: blur(6px);
}
#pal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 650;
  margin-bottom: 8px;
}
#pal header button {
  padding: 2px 9px;
}
#pc {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
#pc button {
  background: #14161b;
  font-weight: 650;
  font-size: 12px;
  padding: 7px 2px;
}
#pal.min #pc {
  display: none;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #000;
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 9;
}
#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 640px) {
  #pal {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: 8px;
  }
  #pc {
    grid-template-columns: repeat(4, 1fr);
  }
  main {
    padding-bottom: 210px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #toast {
    transition: none;
  }
}

#box {
  position: relative;
  padding: 10px;
  overflow-x: auto;
  min-height: 60px;
}
#box.transp {
  background: #24282e;
}
#box.text {
  background: #5d6574;
}
#pv {
  white-space: pre;
  width: max-content;
  user-select: text;
  cursor: text;
}
#pv ::selection {
  background: transparent;
}
#pv .l {
  width: fit-content;
}
#box.text #pv .l {
  background: #000;
  padding: 0 2px;
}
#sl div {
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
  background: rgba(74, 155, 255, 0.28);
  border: 1px solid #4a9bff;
  border-radius: 5px;
}
output {
  color: var(--tx);
}
[data-x="bar"] {
  background: #000;
  color: transparent !important;
  text-shadow: none;
}
[data-x="blur"] {
  filter: blur(3px);
}
.num {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 3px 3px 3px 10px;
  width: 104px;
}
.num input {
  all: unset;
  flex: 1;
  min-width: 0;
  color: #111;
  font-size: 14px;
  width: 100%;
}
.num input::-webkit-inner-spin-button,
.num input::-webkit-outer-spin-button {
  display: none;
}
.num input {
  -moz-appearance: textfield;
  appearance: textfield;
}
.st {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #e3e5ea;
  border-radius: 6px;
  padding: 1px;
}
.st button {
  background: none;
  color: #333;
  padding: 3px 8px;
  border-radius: 5px;
  line-height: 0;
}
.st button:hover {
  background: #cfd2d9;
}
.exp {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: #14161b;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.seg {
  display: flex;
  background: #262a33;
  border-radius: 8px;
  padding: 2px;
}
.seg button {
  background: none;
  padding: 6px 10px;
}
.seg button.on {
  background: #3d4352;
  box-shadow: inset 0 0 0 1px var(--acc);
}

.inp {
  height: 33px;
  width: 170px;
  padding: 0 10px;
  background: #14161b;
  color: var(--tx);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}
.inp::placeholder {
  color: var(--mut);
}
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 33px;
  padding: 0 10px;
  background: #14161b;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--tx);
  font-size: 13px;
  cursor: pointer;
  align-self: end;
  white-space: nowrap;
}
.opt:hover {
  border-color: #464c5b;
}
.opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.sw {
  flex: none;
  width: 30px;
  height: 18px;
  border-radius: 9px;
  background: #3a3f4b;
  position: relative;
  transition: background 0.15s;
}
.sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.opt input:checked + .sw {
  background: var(--acc);
}
.opt input:checked + .sw::after {
  transform: translateX(12px);
}
.opt input:focus-visible + .sw {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  textarea,
  .sw,
  .sw::after {
    transition: none;
  }
}
