* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
:root {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  color: #252e3a;
  background: #f8f8f5;
  --blue: #244e79;
  --line: #dcdfdf;
  --rail: 128px;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button,
input {
  font: inherit;
}
button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.36;
  cursor: default;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #629ad9;
  outline-offset: 1px;
}
button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}
header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 7px 18px;
  background: white;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.brand,
.colors,
.nav,
.pair,
.heading {
  display: flex;
  align-items: center;
}
.brand {
  gap: 10px;
  min-width: 0;
}
.brand img {
  border-radius: 9px;
}
.brand div {
  min-width: 0;
}
.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand strong {
  font-size: 16px;
}
.brand small {
  font-size: 11px;
  color: #697380;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.nav {
  gap: 2px;
}
.colors {
  margin-left: auto;
  gap: 5px;
}
header button:not(.primary),
.pair button,
#fit {
  width: 42px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--blue);
}
.primary,
.file {
  background: var(--blue);
  color: white;
  font-weight: 650;
  padding: 10px 17px;
  border-radius: 22px;
  white-space: nowrap;
}
#recent {
  display: flex;
  align-items: center;
}
#recent button {
  width: 32px;
}
#recent i {
  display: block;
  border: 1px solid #0002;
  border-radius: 50%;
  width: 20px;
  height: 20px;
}
#recent .empty {
  width: 32px;
  display: grid;
  place-items: center;
}
.empty i {
  border: 1px dashed #b7bfca !important;
}
#palette i {
  width: 32px;
  height: 32px;
  background: var(--tint, #284f84);
  border: 3px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(var(--tint, #284f84), var(--tint, #284f84)) padding-box,
    conic-gradient(#ffb800, #ff535d, #b65cff, #2679dc, #5bd995, #ffb800) border-box;
}
.active,
#sample[aria-pressed='true'] {
  background: #e4edf5 !important;
  color: var(--blue) !important;
}
main {
  display: flex;
  flex: 1;
  min-height: 0;
}
aside {
  width: var(--rail);
  flex: none;
  background: white;
  border-right: 1px solid var(--line);
  padding: 14px 9px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
aside::-webkit-scrollbar {
  display: none;
}
.tools {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
.tools button {
  border-radius: 10px;
  min-height: 52px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  color: #596575;
  font-size: 11px;
}
.sliders {
  display: flex;
  justify-content: space-around;
  margin: 18px 0 14px;
}
.sliders label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.sliders input {
  margin: 0;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 42px;
  height: clamp(120px, 23dvh, 222px);
  accent-color: var(--blue);
  touch-action: none;
}
.sliders output {
  font-size: 10px;
  color: #677380;
  font-variant-numeric: tabular-nums;
}
.pair {
  justify-content: space-evenly;
  border-block: 1px solid var(--line);
  padding: 3px 0;
}
.effects {
  display: grid;
  gap: 12px;
  margin: 14px 3px;
}
.effects label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.effects .fade {
  display: grid;
  gap: 6px;
}
input[type='range'],
input[type='checkbox'] {
  accent-color: var(--blue);
}
#fade {
  width: 100%;
}
#stage {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  touch-action: none;
  background-color: #e9e9e5;
  background-image: radial-gradient(#ced1ce 0.65px, transparent 0.8px);
  background-size: 12px 12px;
}
#paper {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  background: white;
  box-shadow: 0 2px 9px #27343a22;
}
#paper canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#fit {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 42px;
  height: 38px;
  background: #fffffff2;
  border: 1px solid var(--line);
  border-radius: 10px;
}
footer {
  height: 28px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #56616c;
  font-size: 11px;
  border-top: 1px solid var(--line);
}
#size {
  white-space: nowrap;
}
dialog {
  position: fixed;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  width: min(410px, 94vw);
  max-height: 80dvh;
  box-shadow: 0 12px 40px #16252e33;
  color: inherit;
}
dialog::backdrop {
  background: #172b3c30;
}
.heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.heading h2 {
  font-size: 19px;
  margin: 0;
}
.heading button {
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
#wheel {
  margin: 0;
  left: auto;
  right: 20px;
  top: 70px;
  width: min(292px, 90vw);
  color: white;
  background: #292a2e;
  padding: 12px 16px;
  border-color: #373a41;
}
#disc {
  width: 100%;
  display: block;
  touch-action: none;
}
.custom {
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
}
.custom input {
  border: 0;
  background: none;
  width: 36px;
  height: 25px;
}
#works {
  max-height: 50dvh;
  overflow: auto;
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}
#works button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 8px;
  border-radius: 7px;
}
#works img {
  width: 66px;
  height: 45px;
  object-fit: contain;
  background: #efefec;
}
#works small {
  display: block;
  color: #616d78;
  margin-top: 3px;
}
.file {
  display: inline-block;
  font-size: 13px;
  cursor: pointer;
}
.file input {
  display: none;
}
#pair {
  display: grid;
  gap: 10px;
}
#code {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
  padding: 10px;
  font-size: 19px;
  border: 1px solid #bec9d2;
  border-radius: 7px;
}
#devices p {
  font-size: 13px;
  line-height: 1.6;
  color: #596779;
}
@media (max-width: 760px) {
  :root {
    --rail: 98px;
  }
  header {
    flex-wrap: wrap;
    gap: 3px 8px;
    padding: 5px 8px;
  }
  .brand {
    flex: 1;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  .colors {
    order: 2;
    width: 100%;
    justify-content: flex-end;
    height: 36px;
  }
  .colors button {
    height: 36px !important;
  }
  header .primary {
    padding: 8px 12px;
  }
  .tools button {
    min-height: 44px;
  }
  aside {
    padding: 8px 4px;
  }
  #wheel {
    top: 92px;
  }
  .sliders input {
    height: clamp(95px, 19dvh, 170px);
    width: 36px;
  }
}

[hidden] {
  display: none !important;
}

#receipt {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  max-width: calc(100% - 24px);
  padding: 9px 14px;
  color: white;
  background: #234c46;
  border-radius: 9px;
  font-size: 14px;
  pointer-events: none;
}
