html,
body {
  height: 100%;
}

body.tool {
  overflow: hidden;
  background: var(--content);
}

.app {
  display: grid;
  grid-template-columns: var(--w-sidebar) 1fr;
  height: calc(100vh - var(--h-toolbar));
}

.inspector {
  background: var(--sidebar);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--separator);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 28px;
}

.inspector::-webkit-scrollbar {
  width: 11px;
}

.inspector::-webkit-scrollbar-thumb {
  background: var(--label-3);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-pill);
}

.group {
  border-bottom: 1px solid var(--separator);
}

.group > summary {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 14px 0 10px;
  cursor: default;
  list-style: none;
  user-select: none;
  color: var(--label-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06px;
  text-transform: uppercase;
}

.group > summary::-webkit-details-marker {
  display: none;
}

.group > summary:hover {
  color: var(--label);
}

.group > summary .tri {
  width: 10px;
  height: 10px;
  flex: none;
  color: var(--label-3);
  transition: transform var(--dur-fast) var(--ease);
}

.group[open] > summary .tri {
  transform: rotate(90deg);
}

.group > summary .count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12px;
  color: var(--label-3);
  text-transform: none;
}

.gbody {
  padding: 2px 14px 12px;
}

.row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 2px 0;
}

.row > label {
  font-size: 12px;
  line-height: 15px;
  letter-spacing: 0;
  color: var(--label-2);
  text-align: left;
  overflow-wrap: break-word;
}

.row .field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.row.wide {
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 4px 0 3px;
}

.row.wide > label {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06px;
  color: var(--label-3);
}

.row.wide + .row > .hint {
  grid-column: 1 / -1;
}

.hint {
  grid-column: 1 / -1;
  font-size: 10px;
  line-height: 13px;
  letter-spacing: 0.12px;
  color: var(--label-3);
  margin: -1px 0 4px;
}

.note {
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.06px;
  color: var(--label-3);
  margin: 0 0 8px;
}

.note.after {
  margin: 8px 0 0;
}

input[type='range'] {
  flex: 1;
  min-width: 0;
  height: 18px;
  appearance: none;
  background: transparent;
  margin: 0;
  cursor: default;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 / var(--fill, 0%) 100% no-repeat,
    var(--well);
  box-shadow: inset 0 0 0 1px var(--control-stroke-2);
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--knob);
  border: 0.5px solid rgba(0, 0, 0, 0.2);
  box-shadow: var(--shadow-knob);
}

input[type='range']::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--control-stroke-2);
}

input[type='range']::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}

input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  background: var(--knob);
  box-shadow: var(--shadow-knob);
}

.trailing {
  position: relative;
  width: 66px;
  flex: none;
}

.trailing .unit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  letter-spacing: 0.12px;
  color: var(--label-3);
  pointer-events: none;
}

.trailing.has-unit .numfield {
  padding-right: 24px;
}

.numfield {
  width: 100%;
  flex: none;
  height: var(--h-control);
  padding: 0 5px;
  text-align: right;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.06px;
  font-variant-numeric: tabular-nums;
  color: var(--label);
  background: var(--control);
  border: 1px solid var(--control-stroke);
  border-radius: 5px;
  box-shadow: var(--shadow-control);
}

.numfield:focus {
  outline: 3px solid var(--accent-ring);
  outline-offset: 0;
  border-color: var(--accent);
}

.numfield::-webkit-outer-spin-button,
.numfield::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.textfield {
  width: 100%;
  height: var(--h-control-lg);
  padding: 0 8px;
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: -0.08px;
  color: var(--label);
  background: var(--control);
  border: 1px solid var(--control-stroke);
  border-radius: 5px;
  box-shadow: var(--shadow-control);
}

.textfield:focus {
  outline: 3px solid var(--accent-ring);
  border-color: var(--accent);
}

.textfield.mono {
  font-family: var(--mono);
  font-size: 11px;
}

.swatch {
  appearance: none;
  width: 44px;
  height: var(--h-control);
  flex: none;
  padding: 0;
  border: 1px solid var(--control-stroke);
  border-radius: 5px;
  background: transparent;
  cursor: default;
  box-shadow: var(--shadow-control);
}

.swatch::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.swatch::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

.switch {
  appearance: none;
  width: 30px;
  height: 18px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--control-stroke-2);
  position: relative;
  cursor: default;
  transition: background var(--dur-fast) var(--ease);
}

.switch::after {
  content: '';
  position: absolute;
  top: 1.5px;
  left: 1.5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-knob);
  transition: transform var(--dur-fast) var(--ease);
}

.switch:checked {
  background: var(--accent);
  box-shadow: none;
}

.switch:checked::after {
  transform: translateX(12px);
}

.checkbox {
  appearance: none;
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 3.5px;
  border: 1px solid var(--control-stroke);
  background: var(--control);
  box-shadow: var(--shadow-control);
  cursor: default;
  position: relative;
}

.checkbox:checked {
  background: var(--accent);
  border-color: transparent;
}

.checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3.5px;
  height: 7.5px;
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(43deg);
}

.checkline {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--label);
  cursor: default;
  min-height: 20px;
}

.drop {
  border: 1px dashed var(--separator-strong);
  border-radius: var(--r-group);
  padding: 14px 12px;
  text-align: center;
  cursor: default;
  background: var(--content-2);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

[data-theme='dark'] .drop {
  background: rgba(255, 255, 255, 0.03);
}

.drop:hover,
.drop:focus-visible,
.drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.drop strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.drop span {
  display: block;
  margin-top: 2px;
  color: var(--label-3);
  font-size: 10px;
  letter-spacing: 0.12px;
}

.layerlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.layerrow {
  display: grid;
  grid-template-columns: 12px 14px 32px 1fr auto;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px;
  border-radius: var(--r-control);
  cursor: default;
  color: var(--label);
  transition: background var(--dur-fast) var(--ease);
}

.layerrow:hover {
  background: var(--label-4);
}

.layerrow.on {
  background: var(--accent);
  color: #fff;
}

.layerrow.on .lsub,
.layerrow.on .grip {
  color: rgba(255, 255, 255, 0.72);
}

.layerrow.on .checkbox {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.layerrow.on .checkbox:checked {
  background: #fff;
}

.layerrow.on .checkbox:checked::after {
  border-color: var(--accent);
}

.layerrow.dragging {
  opacity: 0.4;
}

.layerrow.dropbefore {
  box-shadow: inset 0 2px 0 var(--accent);
}

.layerrow.dropafter {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.grip {
  color: var(--label-3);
  cursor: grab;
  display: grid;
  place-items: center;
}

.grip:active {
  cursor: grabbing;
}

.grip svg {
  width: 10px;
  height: 14px;
}

.lthumb {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  background: #b9b9be;
  border: 1px solid var(--control-stroke-2);
  display: block;
  object-fit: contain;
}

.lname {
  min-width: 0;
  font-size: 12px;
  letter-spacing: 0;
  line-height: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lsub {
  display: block;
  font-size: 10px;
  line-height: 13px;
  letter-spacing: 0.12px;
  color: var(--label-3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.trash {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.45;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  cursor: default;
}

.trash:hover {
  opacity: 1;
  background: var(--label-4);
  color: var(--danger);
}

.layerrow.on .trash:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.trash svg {
  width: 12px;
  height: 12px;
}

.canvasarea {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--content);
}

.canvastop {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 12px 20px;
  background: var(--chrome);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}

.desk {
  position: relative;
  flex: 1;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 26px 26px 150px;
  overflow: hidden;
}

.wall {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 650ms var(--ease);
  will-change: opacity;
}

.wall.day {
  background-image: url('assets/wall-day.jpg?v=18');
  opacity: 1;
}

.wall.night {
  background-image: url('assets/wall-night.jpg?v=18');
  opacity: 0;
}

.desk.night .wall.day {
  opacity: 0;
}

.desk.night .wall.night {
  opacity: 1;
}

.iconwell {
  position: relative;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: var(--r-card);
}

.iconwell[hidden] {
  display: none;
}

#preview {
  display: block;
  width: 280px;
  height: 280px;
  max-width: 32vh;
  max-height: 32vh;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.3));
}

.macwin {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  background: var(--chrome);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36), 0 2px 6px rgba(0, 0, 0, 0.2);
  max-width: 100%;
}

[data-theme='dark'] .macwin {
  border-color: rgba(255, 255, 255, 0.14);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border-bottom: 1px solid var(--separator);
  position: relative;
}

.lights {
  display: flex;
  gap: 6px;
  flex: none;
}

.lights i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}

.lights .l1 { background: #ff5f57; }
.lights .l2 { background: #febc2e; }
.lights .l3 { background: #28c840; }

.wtitle {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--label-2);
  pointer-events: none;
}

.wbody {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 12px;
}

.rnote {
  font-size: 10px;
  letter-spacing: 0.12px;
  color: var(--label-3);
}

.sizes {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  padding: 14px 18px;
}

.sizes figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sizes canvas {
  display: block;
}

.sizes figcaption {
  font-size: 10px;
  letter-spacing: 0.12px;
  color: var(--label-3);
  font-variant-numeric: tabular-nums;
}

.dockbar {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  overflow: hidden;
  backdrop-filter: blur(26px) saturate(1.7);
  -webkit-backdrop-filter: blur(26px) saturate(1.7);
  background: rgba(232, 236, 240, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22),
    inset 1px 0 0 rgba(255, 255, 255, 0.24),
    inset -1px 0 0 rgba(255, 255, 255, 0.24),
    0 12px 34px rgba(0, 0, 0, 0.3);
  transition: background 650ms var(--ease);
}

.desk.night .dockbar {
  background: rgba(40, 42, 48, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.07),
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    inset -1px 0 0 rgba(255, 255, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.5);
}

.dockbar[hidden] {
  display: none;
}

#dock {
  display: block;
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status {
  margin: 9px 0 0;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.06px;
  color: var(--label-3);
  min-height: 14px;
}

.status.err {
  color: var(--danger);
}

.status.ok {
  color: var(--ok);
}

.footnote {
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.12px;
  color: var(--label-3);
}
