:root {
  --bg: #000;
  --pane: #0c0c0c;
  --line: rgba(255, 255, 255, 0.12);
  --muted: rgba(255, 255, 255, 0.62);
  --fg: #f5f5f5;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

.preview-pane,
.library-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.preview-pane {
  background: #000;
  border-right: 1px solid var(--line);
}

.filter-row {
  display: flex;
  gap: 8px;
  padding: 14px 16px 10px;
  overflow-x: auto;
  flex: none;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  border: 0;
  background: #8a8a8a;
  color: #2e2e2e;
  border-radius: 18px;
  padding: 6px 12px 5px;
  font: inherit;
  cursor: pointer;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
}

.chip-name {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.chip-en {
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.02em;
  color: #3a3a3a;
  white-space: nowrap;
}

.filter-chip.is-active {
  background: #fff;
  color: #111;
  box-shadow: none;
}

.filter-chip.is-active .chip-en {
  color: #1a1a1a;
}

.preview-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #070707;
}

.preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.zoom-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.zoom-btn:hover {
  background: #fff;
}

.preview-empty {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin: 0;
  transform: translateY(-50%);
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}

.preview-status {
  flex: none;
  margin: 0 16px 6px;
  min-height: 1.2em;
  font-size: 12px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 20px 22px;
  gap: 12px;
}

.reset-btn {
  justify-self: end;
  width: 72px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.reset-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
}

.reset-btn:hover .reset-icon {
  background: rgba(255, 255, 255, 0.24);
}

.reset-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
}

.download-group {
  justify-self: start;
  display: flex;
  gap: 12px;
  margin-bottom: -15px;
}

.download-group .reset-label {
  line-height: 15px;
  text-align: center;
}

.pad-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pad {
  position: relative;
  width: 188px;
  height: 188px;
  border-radius: 46px;
  touch-action: none;
  cursor: grab;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 10px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.pad:active {
  cursor: grabbing;
}

.pad--warm {
  background:
    radial-gradient(130% 90% at 88% 0%, rgba(232, 164, 86, 0.95), transparent 58%),
    linear-gradient(180deg, #6d5848 0%, #161210 100%);
}

.pad--cool {
  background:
    radial-gradient(130% 90% at 88% 0%, rgba(126, 176, 224, 0.92), transparent 58%),
    linear-gradient(180deg, #3c4d5e 0%, #101216 100%);
}

.pad--rose {
  background:
    radial-gradient(130% 90% at 88% 0%, rgba(214, 146, 136, 0.92), transparent 58%),
    linear-gradient(180deg, #5e4842 0%, #141110 100%);
}

.pad--neutral {
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(255, 255, 255, 0.38), transparent 52%),
    linear-gradient(180deg, #5e5e5e 0%, #121212 100%);
}

.pad--mono {
  background: linear-gradient(180deg, #8d8d8d 0%, #141414 100%);
}

.pad-dots {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pad::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 20, 20, 0.42), transparent 46%);
  pointer-events: none;
}

.puck {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.35);
  left: 50%;
  top: 50%;
}

.readout {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.library-pane {
  background: var(--pane);
}

.dropzone {
  flex: none;
  margin: 16px 16px 8px;
  min-height: 132px;
  border: 1.5px dashed rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.dropzone-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dropzone-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.restore-folder {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.restore-folder:hover,
.restore-folder:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.gallery-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 16px 0 20px;
}

.gallery-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.gallery {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--cell, 74px));
  grid-auto-rows: var(--cell, 74px);
  gap: 8px;
  padding: 8px 16px 16px;
  justify-content: start;
  align-content: start;
}

.shot {
  position: relative;
  box-sizing: border-box;
  width: var(--cell, 74px);
  height: var(--cell, 74px);
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #161616;
  cursor: pointer;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot.is-active {
  border-color: #fff;
}

@media (max-width: 980px) {
  .split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(520px, 62vh) 1fr;
  }

  .preview-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
