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

* {
  border: 0;
  border-radius: 0;
  margin: 0;
  outline: 0;
  padding: 0;
}

button,
div,
input,
span {
  color: #e8ecf6;
}

button,
canvas,
div,
input,
span {
  -webkit-appearance: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-size: 100%;
  vertical-align: baseline;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: #05070d;
  color: #e8ecf6;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  font-size: 0;
  line-height: 1;
  -webkit-text-size-adjust: 100%;
}

input[type=file] {
  display: none;
}

button {
  cursor: pointer;
  background-color: transparent;
  font-family: inherit;
}

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

:root {
  --color-body-background: #05070d;
  --color-panel-background: #0c1120;
  --color-panel-header-background: #0e1426;
  --color-panel-border: #1b2740;
  --color-panel-group-border: #141d30;
  --color-input-border: #2a3a5c;
  --color-selected: #182238;
  --color-font: #e8ecf6;
  --color-group-header-font: #7080a4;
  --color-icon: #c3cde4;
  --color-accent: #e8a4b8;
  --color-accent-strong: #f0b3c4;
  --color-accent-ink: #1a0e12;
}

.Beauty {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(ellipse at top, rgba(232, 164, 184, 0.05), transparent 55%), radial-gradient(ellipse at bottom, rgba(90, 140, 255, 0.04), transparent 55%), var(--color-body-background);
}
.Beauty-Canvas {
  display: block;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
  touch-action: none;
  cursor: crosshair;
}
.Beauty-Empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgba(232, 236, 246, 0.32);
  letter-spacing: 0.04em;
  pointer-events: none;
}
.Beauty-Empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}
.Beauty-Empty-Hint {
  font-size: 12px;
}
.Beauty[data-has-image] .Beauty-Empty {
  display: none;
}
.Beauty-Peek {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border: 1px solid var(--color-panel-border);
  border-radius: 999px;
  background: var(--color-panel-background);
  color: rgba(232, 236, 246, 0.7);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  user-select: none;
  z-index: 9;
  display: none;
}
.Beauty-Peek:active {
  background: var(--color-selected);
  color: var(--color-font);
}
.Beauty[data-has-image] .Beauty-Peek {
  display: block;
}
.Beauty-Tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 8px 12px;
}
.Beauty-Tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  aspect-ratio: 1;
  padding: 4px 2px;
  border: 1px solid var(--color-panel-group-border);
  border-radius: 8px;
  background: transparent;
  color: var(--color-group-header-font);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.12s ease;
}
.Beauty-Tool:hover {
  background: var(--color-selected);
  color: var(--color-font);
}
.Beauty-Tool[data-active] {
  border-color: var(--color-accent);
  background: rgba(232, 164, 184, 0.1);
  color: var(--color-accent);
}
.Beauty-Tool svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.6;
}
.Beauty-Status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 12px 10px;
  color: var(--color-group-header-font);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}
.Beauty-Status-Dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #5a6680;
}
.Beauty-Status[data-kind=loading] .Beauty-Status-Dot {
  background: var(--color-accent);
  animation: pulse 1.2s infinite;
}
.Beauty-Status[data-kind=ready] .Beauty-Status-Dot {
  background: #6fae8a;
}
.Beauty-Status[data-kind=error] .Beauty-Status-Dot {
  background: #e0566b;
}
.Beauty-Toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 22px;
  border: 1px solid var(--color-panel-border);
  border-radius: 10px;
  background: var(--color-panel-background);
  color: var(--color-font);
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}
.Beauty-Toast[data-visible] {
  opacity: 1;
}

.SinglePanel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 264px;
  background: var(--color-panel-background);
  border: 1px solid var(--color-panel-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  z-index: 10;
  transition: opacity 0.2s;
}
.SinglePanel-Header {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
}
.SinglePanel-Header:active {
  cursor: grabbing;
}
.SinglePanel-Title {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  background: var(--color-panel-header-background);
  border-bottom-right-radius: 12px;
  font-size: 11px;
  color: var(--color-font);
}
.SinglePanel-Minimize {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-icon);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.SinglePanel-Minimize:hover {
  color: var(--color-font);
}
.SinglePanel-Main {
  overflow-y: scroll;
  overscroll-behavior-y: none;
  scrollbar-width: none;
  max-height: calc(100vh - 96px);
}
.SinglePanel[data-collapsed] .SinglePanel-Main {
  display: none;
}

.PanelGroup + .PanelGroup {
  border-top: 1px solid var(--color-panel-group-border);
}
.PanelGroup-Header {
  display: flex;
  height: 28px;
  padding: 9px 12px 0;
  font-size: 12px;
  color: var(--color-group-header-font);
}
.PanelGroup[data-hidden] {
  display: none;
}

.RightLabelGrid {
  display: grid;
  grid-template-columns: max-content 1fr;
  padding: 8px 12px;
}
.RightLabelGrid-Row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1/-1;
  align-items: center;
  height: 36px;
  column-gap: 8px;
}
.RightLabelGrid-Row-Label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  font-size: 13px;
  color: var(--color-font);
  user-select: none;
}

.NumberInput {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 4px;
}
.NumberInput-Arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: var(--color-icon);
  cursor: pointer;
}
.NumberInput-Arrow[data-disabled] {
  opacity: 0.3;
  cursor: default;
}
.NumberInput-Field {
  display: flex;
  align-items: center;
  gap: 4px;
}
.NumberInput-Input {
  min-width: calc(3ch + 16px);
  max-width: calc(3ch + 16px);
  height: 24px;
  padding: 0 4px;
  border: 1px solid var(--color-input-border);
  border-radius: 2px;
  background: transparent;
  font-size: 12px;
  color: var(--color-font);
  text-align: center;
  user-select: text;
}
.NumberInput-Input:focus {
  outline: none;
}
.NumberInput-Unit {
  font-size: 12px;
  color: var(--color-group-header-font);
  user-select: none;
}

.Palette {
  position: relative;
  padding: 8px 12px;
}
.Palette-Swatches {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.Palette-Swatch {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.12s;
}
.Palette-Swatch:hover {
  transform: scale(1.08);
}
.Palette-Swatch[data-active]::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
}
.Palette-AddColor {
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff4d6d, #ffae5e, #ffe66d, #6fcf97, #56ccf2, #9b51e0, #ff4d6d);
  cursor: pointer;
}
.Palette-AddColor[data-active]::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
}
.Palette-ColorInput {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.SelectList {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
}
.SelectList-Item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 2px;
  font-size: 13px;
  color: var(--color-font);
  cursor: pointer;
  user-select: none;
}
.SelectList-Item svg {
  width: 14px;
  height: 14px;
}
.SelectList-Item:hover:not(:disabled) {
  background: var(--color-selected);
}
.SelectList-Item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.SelectList-Item[data-role=detect] {
  justify-content: center;
  border: 1px solid var(--color-input-border);
}
.SelectList-Item[data-role=detect][data-detected] {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.SelectList-Item[data-variant=primary] {
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 600;
}
.SelectList-Item[data-variant=primary]:hover {
  background: var(--color-accent-strong);
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}
@media (max-width: 480px) {
  .SinglePanel {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}
