* {
  box-sizing: border-box;
}
:root {
  --ink: #28372e;
  --muted: #718276;
}
body {
  margin: 0;
  color: var(--ink);
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 10% 6%, #dcece0, transparent 34%),
    radial-gradient(circle at 88% 18%, #eadfe8, transparent 32%),
    radial-gradient(circle at 60% 95%, #d8e7ee, transparent 38%), #eef2eb;
  min-height: 100vh;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
.glass {
  background: linear-gradient(145deg, #ffffffbd, #ffffff70);
  border: 1px solid #ffffffb5;
  box-shadow:
    0 12px 35px #4c695014,
    inset 0 1px 1px #fff;
  backdrop-filter: blur(24px) saturate(155%);
}
header {
  height: 74px;
  margin: 14px 18px 0;
  padding: 0 22px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.mark {
  width: 44px;
  height: 44px;
  flex: none;
  filter: drop-shadow(0 4px 8px #315f4b24);
}
.brand-copy {
  display: grid;
  gap: 3px;
  line-height: 1;
}
.brand-name {
  color: #254838;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.6px;
}
.brand-byline {
  color: #607b6a;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.btn {
  border: 1px solid #ffffffd9;
  background: linear-gradient(145deg, #ffffffe8, #ffffff91);
  box-shadow:
    0 3px 10px #52695a12,
    inset 0 1px 1px white;
  border-radius: 13px;
  padding: 9px 12px;
  color: #354c3a;
  font-weight: 650;
}
.btn:hover {
  background: #fff;
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.primary {
  color: #fff;
  border-color: #ffffff7a;
  background: linear-gradient(145deg, #67977a, #3d6e50);
  box-shadow:
    0 5px 14px #456f5050,
    inset 0 1px 1px #ffffff91;
}
.primary:hover {
  background: #4d8060;
}
.wide {
  width: 100%;
  margin-top: 9px;
}
.layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr) 240px;
  gap: 14px;
  padding: 14px 18px 18px;
  min-height: calc(100vh - 88px);
}
aside {
  border-radius: 25px;
  padding: 22px 17px;
  min-width: 0;
}
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 800;
  color: #819285;
}
h1,
h2 {
  letter-spacing: -0.7px;
  margin: 6px 0;
}
h1 {
  font-size: 25px;
}
h2 {
  font-size: 19px;
}
p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 6px 0;
}
.section {
  margin-top: 24px;
}
.label {
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 9px;
}
.presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.preset {
  border: 1px solid #ffffffb8;
  background: #ffffff76;
  border-radius: 16px;
  padding: 12px 3px;
  color: #607466;
  font-size: 11px;
}
.preset.active {
  background: #dcecd8a8;
  border-color: #a5c4a4;
  color: #315a3d;
}
.mini {
  width: 55px;
  height: 36px;
  border-radius: 6px;
  margin: 0 auto 8px;
  background: linear-gradient(135deg, #e1e7e3, #abb6b0);
  box-shadow:
    inset 0 1px 2px #fff,
    0 4px 8px #657b6c25;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
}
.pro .mini {
  background: linear-gradient(135deg, #b9c4bd, #6e7c74);
}
.bag {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}
.bag button {
  aspect-ratio: 1;
  background: #ffffff8c;
  border: 1px solid #ffffffc9;
  border-radius: 15px;
  padding: 8px;
  position: relative;
}
.bag img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.bag .x {
  position: absolute;
  right: 4px;
  top: 1px;
  color: #8a998e;
  font-size: 16px;
}
.upload {
  border-style: dashed;
  color: #527b5a;
}
input[type="file"] {
  display: none;
}
.workspace {
  border-radius: 25px;
  padding: 22px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.stage {
  margin-top: 18px;
  flex: 1;
  min-height: 460px;
  position: relative;
  border: 1px solid #ffffffbf;
  border-radius: 21px;
  background-color: #e6eee6b0;
  background-image: radial-gradient(#b7cbbd 1px, transparent 1px);
  background-size: 20px 20px;
  overflow: hidden;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.stage-label {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #ffffff85;
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid #ffffffc9;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #778679;
  pointer-events: none;
}
.bottom {
  position: absolute;
  inset: auto 12px 12px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}
.tools,
.zoom {
  display: flex;
  align-items: center;
  gap: 6px;
}
.zoom,
.tools {
  background: linear-gradient(145deg, #ffffffa6, #ffffff60);
  border: 1px solid #ffffffc9;
  border-radius: 16px;
  padding: 4px;
  box-shadow:
    0 6px 18px #344b3d26,
    inset 0 1px 1px #fff;
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  pointer-events: auto;
}
@supports not (backdrop-filter: blur(1px)) {
  .stage-label,
  .zoom,
  .tools {
    background: #f3f8f1ed;
  }
}
.zoom .btn {
  padding: 6px 10px;
  min-width: 34px;
}
.zoom input {
  width: 95px;
  accent-color: #4d8060;
}
.zoom output {
  min-width: 40px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #607366;
}
.empty {
  margin-top: 20px;
  padding: 18px 12px;
  background: #ffffff65;
  border: 1px dashed #c6d8c6;
  border-radius: 15px;
  color: #788678;
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}
.selected {
  margin-top: 19px;
}
.selected .btn {
  width: 100%;
  text-align: left;
  margin: 3px 0;
}
.layer-title {
  font-size: 10px;
  color: #839083;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 750;
  margin: 17px 0 7px;
}
.layers {
  max-height: 150px;
  overflow: auto;
  display: grid;
  gap: 5px;
}
.layer {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #ffffffbf;
  background: #ffffff69;
  border-radius: 12px;
  padding: 5px;
  text-align: left;
  color: #526153;
  font-size: 11px;
}
.layer.active {
  border-color: #9dbca2;
  background: #e5f2e2c9;
}
.layer img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.layer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.field input,
.modal input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #ffffffd9;
  border-radius: 12px;
  background: #ffffffb8;
  color: #26352a;
}
.field span {
  font-size: 12px;
  color: #768476;
}
.hint {
  background: #ffffff7a;
  border: 1px solid #ffffffb5;
  border-radius: 15px;
  padding: 12px;
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
  color: #657c68;
}
.menu {
  position: fixed;
  z-index: 20;
  width: 205px;
  background: #f8fcf8ed;
  border: 1px solid #fff;
  border-radius: 16px;
  box-shadow: 0 15px 40px #263e2d36;
  backdrop-filter: blur(24px);
  padding: 6px;
  display: none;
}
.menu.open {
  display: block;
}
.menu button {
  width: 100%;
  border: 0;
  background: none;
  border-radius: 10px;
  padding: 9px 10px;
  text-align: left;
  color: #283b2d;
  font-size: 12px;
}
.menu button:hover {
  background: #d9ead7a8;
}
.menu button:disabled {
  opacity: 0.35;
}
.menu hr {
  border: 0;
  border-top: 1px solid #dce8dc;
}
.modal-back {
  position: fixed;
  inset: 0;
  background: #24352a70;
  backdrop-filter: blur(8px);
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-back.open {
  display: flex;
}
.modal {
  width: min(460px, 100%);
  border-radius: 25px;
  padding: 24px;
  background: linear-gradient(145deg, #fffffff2, #f1f7f2ed);
  border: 1px solid #fff;
  box-shadow: 0 20px 60px #233b2b40;
}
.modal label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 17px;
}
.modal .row {
  display: flex;
  gap: 10px;
}
.modal .row > div {
  flex: 1;
  min-width: 0;
}
.modal input {
  margin-top: 6px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #263b2ce8;
  color: #fff;
  border-radius: 13px;
  padding: 10px 16px;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
  font-size: 12px;
  z-index: 50;
}
.toast.show {
  opacity: 1;
}
@media (max-width: 850px) {
  .layout {
    grid-template-columns: 205px 1fr;
  }
  .right {
    grid-column: 1/-1;
  }
  .selected .btn {
    max-width: 210px;
  }
  .stage {
    min-height: 420px;
  }
}
@media (max-width: 600px) {
  header {
    margin: 10px 10px 0;
    padding: 0 14px;
    height: 64px;
  }
  .layout {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }
  .workspace {
    order: 0;
    padding: 18px 12px;
  }
  .left {
    order: 1;
  }
  .right {
    order: 2;
  }
  .stage {
    min-height: 340px;
  }
  .zoom input {
    width: 45px;
  }
  .zoom .btn {
    min-width: 30px;
    padding: 6px;
  }
  .zoom output {
    min-width: 32px;
  }
  .tools .btn {
    padding: 6px 8px;
  }
  .bag {
    grid-template-columns: repeat(5, 1fr);
  }
  .presets {
    max-width: 300px;
  }
  aside {
    padding: 20px;
  }
}
