:root {
  color-scheme: dark;
  --bg: #101113;
  --bar: #111d18;
  --panel: #191a1d;
  --field: #222326;
  --inset: #141517;
  --line: #303135;
  --weak: #252629;
  --text: #f5f4f2;
  --sub: #b8b9bc;
  --muted: #9a9b9f;
  --accent: #b8dd55;
  --tint: #253321;
  --dot: #38393b;
  --stage: #1d1e21;
  --control-accent: #b8dd55;
  --primarytext: #11241a;
  --s: 0 3px 12px #0002;
  font:
    16px/1.45 Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f4;
  --bar: #e8f8e5;
  --panel: #fff;
  --field: #f5f5f3;
  --inset: #f7f7f6;
  --line: #d8d9d6;
  --weak: #e6e6e4;
  --text: #202124;
  --sub: #505157;
  --muted: #5d5d60;
  --accent: #24583c;
  --tint: #e8f8e5;
  --control-accent: #24583c;
  --primarytext: #fff;
  --dot: #c6c9c8;
  --stage: #edeff0;
  --s: 0 2px 6px #0001;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
select,
summary {
  cursor: pointer;
}
button {
  color: inherit;
  background: transparent;
  border: 0;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button:not(:disabled):hover {
  filter: brightness(1.12);
}
button:disabled:hover {
  filter: none;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
}
i[data-i] {
  display: inline-flex;
  font-style: normal;
  align-items: center;
  justify-content: center;
}
button {
  font-weight: 550;
}
button,
summary {
  touch-action: manipulation;
}
[hidden] {
  display: none !important;
}
.top {
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.top-inner,
main {
  max-width: 1536px;
  margin: 0 auto;
  padding-inline: clamp(22px, 4.4vw, 80px);
}
.top-inner {
  height: 67px;
  display: flex;
  align-items: center;
  gap: 44px;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-size: 21px;
  letter-spacing: -1px;
  font-weight: 850;
  white-space: nowrap;
}
.brand img {
  width: 36px;
  height: 36px;
  margin-right: 9px;
  border-radius: 5px;
  object-fit: contain;
}
.top nav {
  display: flex;
  gap: 24px;
  height: 100%;
}
.top nav button {
  position: relative;
  padding: 0 2px;
  font-size: 14px;
  color: var(--muted);
}
.top nav .nav-active {
  color: var(--text);
}
.nav-active:after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 2px;
  border-radius: 3px;
  background: var(--control-accent);
  left: 0;
  right: 0;
}
.top-end,
.actions,
.privacy,
.small-actions,
.slide-buttons,
.section-top,
.button,
.link-button,
.stage-tools,
.canvas-foot > span,
.tabs button {
  display: flex;
  align-items: center;
}
.top-end {
  margin-left: auto;
  gap: 16px;
}
.privacy {
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.privacy svg {
  width: 15px;
}
.divider {
  height: 18px;
  background: var(--line);
  width: 1px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  color: var(--sub);
}
.icon-btn:hover,
.stage-tools button:hover {
  background: var(--field);
}
main {
  padding-bottom: 45px;
  scroll-margin-top: 20px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 31px 0 25px;
}
h1 {
  font-size: clamp(1.85rem, 2.75vw, 2.7rem);
  line-height: 1.13;
  letter-spacing: -0.05em;
  font-weight: 650;
}
.intro p {
  margin-top: 8px;
  color: var(--sub);
  font-size: 15px;
}
.actions {
  gap: 10px;
}
.button {
  gap: 8px;
  min-height: 40px;
  padding: 8px 15px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  justify-content: center;
  white-space: nowrap;
}
.button svg {
  width: 16px;
  height: 16px;
}
.primary {
  background: var(--control-accent);
  color: var(--primarytext);
  border-color: var(--control-accent);
  font-weight: 650;
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.86fr) minmax(318px, 1fr);
  align-items: start;
  gap: 19px;
}
.left-col {
  display: grid;
  gap: 17px;
  min-width: 0;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  min-height: 56px;
}
.panel-head h2,
.dialog-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.panel-head h2 i {
  color: var(--sub);
}
.seg,
.tabs {
  display: flex;
  border: 1px solid var(--line);
  background: var(--inset);
  padding: 3px;
  border-radius: 7px;
}
.seg button {
  min-width: 61px;
  height: 25px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 4px;
}
.seg button[aria-pressed="true"],
.tabs button[aria-pressed="true"] {
  background: var(--field);
  color: var(--text);
  box-shadow: 0 1px 4px #0003;
}
.stage {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(360px, 31.7vw, 480px);
  border-block: 1px solid var(--line);
  background-color: var(--stage);
  background-image: radial-gradient(var(--dot) 0.9px, transparent 1.15px);
  background-size: 15px 15px;
}
.stage.dragging:after {
  content: "Drop photo to edit";
  position: absolute;
  inset: 0;
  background: var(--tint);
  color: var(--accent);
  border: 2px dashed var(--accent);
  display: grid;
  place-items: center;
  font-weight: 600;
}
.size-tag {
  position: absolute;
  top: 13px;
  left: 15px;
  color: var(--muted);
  font:
    11px/1.2 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  letter-spacing: 0.025em;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 7px;
}
.cropframe {
  height: 76%;
  aspect-ratio: 1;
  position: relative;
  max-width: 83%;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
}
.cropframe canvas {
  width: 95%;
  height: auto;
  aspect-ratio: 1;
  cursor: grab;
  touch-action: none;
}
.cropframe canvas:active {
  cursor: grabbing;
}
.cropframe b {
  position: absolute;
  pointer-events: none;
  width: 12px;
  height: 12px;
  border: 0 solid var(--muted);
  opacity: 0.55;
}
.cropframe b:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 1px 0 0 1px;
}
.cropframe b:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 1px 1px 0 0;
}
.cropframe b:nth-child(3) {
  bottom: 0;
  left: 0;
  border-width: 0 0 1px 1px;
}
.cropframe b:nth-child(4) {
  bottom: 0;
  right: 0;
  border-width: 0 1px 1px 0;
}
.stage-tools {
  position: absolute;
  bottom: 12px;
  gap: 2px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--s);
}
.stage-tools button {
  height: 26px;
  min-width: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
}
.stage-tools svg {
  width: 15px;
  height: 15px;
}
.stage-tools .zoom-read {
  font:
    12px ui-monospace,
    Menlo,
    monospace;
  color: var(--sub);
}
.stage-tools span {
  height: 15px;
  width: 1px;
  background: var(--line);
  margin: 0 4px;
}
.canvas-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 47px;
  padding: 7px 18px;
  color: var(--muted);
  font-size: 12px;
}
.canvas-foot > span,
.link-button {
  gap: 7px;
}
.canvas-foot svg {
  width: 14px;
  height: 14px;
}
.link-button {
  color: var(--sub);
  font-size: 13px;
  padding: 6px 0;
}
.in {
  font: 700 11px Arial;
  letter-spacing: -0.5px;
  color: var(--panel);
  background: var(--sub);
  padding: 0 2px;
  border-radius: 2px;
}
.slide-buttons {
  gap: 5px;
}
.slide-buttons button {
  border: 1px solid var(--line);
  width: 25px;
  height: 25px;
}
.slide-buttons svg {
  width: 13px;
}
.library .panel-head {
  padding-bottom: 9px;
  min-height: 48px;
}
.presets {
  display: flex;
  overflow-x: auto;
  padding: 2px 18px 15px;
  gap: 9px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.preset {
  flex: 0 0 calc((100% - 36px) / 5);
  min-width: 84px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0;
  scroll-snap-align: center;
  overflow: hidden;
}
.sample {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 61px;
  border-radius: 6px;
  background: radial-gradient(
    ellipse at 50% 85%,
    color-mix(in srgb, var(--c) 15%, #202126),
    #222326 76%
  );
  border: 1px solid #38383b;
}
.sample:before,
.saved-ring {
  content: "";
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c), var(--d));
  mask: radial-gradient(circle, transparent 53%, #000 56%);
  filter: brightness(1.08);
}
.sample:after {
  content: "";
  position: absolute;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  box-shadow:
    inset 0 0 5px var(--c),
    0 0 8px color-mix(in srgb, var(--c) 34%, transparent);
  opacity: 0.7;
}
.preset-label {
  display: block;
  padding: 6px 1px 1px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  color: var(--sub);
}
.preset[aria-pressed="true"] .sample {
  border-color: var(--control-accent);
  background: radial-gradient(ellipse, #483321, #29221f);
}
.preset[aria-pressed="true"] .preset-label {
  color: var(--accent);
}
.preset[aria-pressed="true"] .sample i {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 13px;
  height: 13px;
  background: var(--control-accent);
  color: var(--primarytext);
  border-radius: 50%;
}
.sample i svg {
  width: 10px;
  height: 10px;
  margin: 1.5px;
}
.small-actions {
  gap: 2px;
}
.controls > .panel-head {
  border-bottom: 1px solid var(--line);
}
.tabs {
  margin: 16px 19px 0;
}
.tabs button {
  height: 29px;
  flex: 1;
  gap: 7px;
  justify-content: center;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
}
.tabs svg {
  width: 15px;
  height: 15px;
}
.adjust-body {
  padding: 17px 20px 18px;
}
h3,
.field-title,
.range-label {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 550;
}
.section-top {
  justify-content: space-between;
  margin-bottom: 8px;
}
.section-top > span {
  font-size: 12px;
  color: var(--accent);
}
.select-wrap {
  position: relative;
}
.select-wrap > i {
  position: absolute;
  left: 11px;
  top: 11px;
  pointer-events: none;
  color: var(--sub);
}
.select-wrap select {
  padding-left: 37px;
}
.select-wrap i svg {
  width: 16px;
  height: 16px;
}
select,
.text-field,
.color-field {
  width: 100%;
  border: 1px solid var(--line);
  background-color: var(--field);
  color: var(--text);
  border-radius: 7px;
  min-height: 38px;
}
select {
  appearance: none;
  padding: 7px 31px 7px 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239b9b9d' stroke-width='1.5'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 17px;
  background-position: right 10px center;
  font-size: 14px;
}
.color-heading {
  margin: 17px 0 9px;
}
.swatches {
  display: flex;
  gap: clamp(6px, 0.8vw, 13px);
  align-items: center;
  margin: 0 2px 11px;
}
.swatch {
  border-radius: 50%;
  width: 24px;
  height: 24px;
  background: var(--sw);
  position: relative;
  flex-shrink: 0;
}
.swatch[aria-pressed="true"]:before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--sw);
  border-radius: 100%;
}
.color-field {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
}
.color-field input[type="color"] {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  width: 19px;
  height: 19px;
  border-radius: 4px;
  overflow: hidden;
  flex: none;
}
.color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 4px;
}
.color-field input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font:
    13px/1.5 ui-monospace,
    Menlo,
    monospace;
  padding: 7px 0;
}
.color-field span {
  font:
    11px ui-monospace,
    Menlo,
    monospace;
  color: var(--muted);
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.range-box {
  margin-bottom: 13px;
}
.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.range-head output {
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--sub);
  padding: 2px 6px;
  font:
    12px/1.25 ui-monospace,
    Menlo,
    monospace;
  background: var(--field);
}
input[type="range"] {
  display: block;
  width: 100%;
  height: 19px;
  margin: 5px 0 0;
  padding: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  --fill: 0%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 10px;
  background: linear-gradient(
    to right,
    var(--control-accent) var(--fill),
    var(--line) var(--fill)
  );
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border: 2px solid var(--control-accent);
  border-radius: 100%;
  margin-top: -4px;
  background: #fff0df;
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 10px;
  background: var(--line);
}
input[type="range"]::-moz-range-progress {
  height: 4px;
  background: var(--control-accent);
}
input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--control-accent);
  border-radius: 50%;
  background: #fff0df;
}
details {
  border-block: 1px solid var(--line);
  margin-top: 16px;
}
summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 0;
  font-size: 13px;
  font-weight: 550;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary i:last-child {
  margin-left: auto;
}
summary svg {
  width: 15px;
  height: 15px;
  color: var(--sub);
}
details[open] summary i:last-child {
  transform: rotate(180deg);
}
.config-tools {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}
.config-tools .button:first-child {
  flex: 1;
}
.compact {
  padding: 8px 10px;
}
.field-group {
  margin: 12px 0;
}
.field-title {
  display: block;
  margin-bottom: 6px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.check-label input {
  accent-color: var(--control-accent);
}
.muted {
  font-size: 14px;
  color: var(--muted);
  margin: 7px 0 16px;
}
.text-field {
  padding: 8px 10px;
  font-size: 15px;
}
dialog {
  width: min(420px, calc(100% - 28px));
  max-height: 88dvh;
  overflow: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 21px;
  box-shadow: 0 18px 90px #0005;
}
dialog::backdrop {
  background: #050607a6;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.dialog-head h2 {
  font-size: 20px;
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}
.dialog-actions .primary {
  flex: 1;
}
.avatar-sizes {
  display: flex;
  align-items: end;
  justify-content: space-around;
  padding: 16px 0;
  gap: 10px;
}
.avatar-sizes figure {
  margin: 0;
  text-align: center;
}
.avatar-sizes canvas {
  display: block;
  border-radius: 50%;
  margin: auto;
}
.avatar-sizes figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.saved-list {
  display: grid;
  gap: 8px;
}
.saved-list button {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  justify-content: start;
}
.saved-list .saved-ring {
  width: 23px;
  height: 23px;
  flex: none;
}
.menu-actions {
  display: grid;
  gap: 10px;
}
.toast {
  position: fixed;
  z-index: 10;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  padding: 10px 16px;
  box-shadow: var(--s);
  max-width: 90vw;
  pointer-events: none;
}
.toast:empty {
  display: none;
}
.error {
  color: var(--accent);
  font-size: 14px;
  margin: 8px 0;
}
@media (min-width: 1560px) {
  .stage {
    height: 480px;
  }
}
@media (max-width: 960px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr);
    gap: 14px;
  }
  .top-inner,
  main {
    padding-inline: 22px;
  }
  .presets {
    gap: 6px;
  }
  .swatches {
    gap: 8px;
  }
  .stage {
    height: 350px;
  }
  .cropframe {
    max-width: 80%;
  }
  .intro p {
    font-size: 14px;
  }
  .adjust-body {
    padding-inline: 16px;
  }
  .tabs {
    margin-inline: 15px;
  }
}
@media (max-width: 760px) {
  .top-inner {
    height: 57px;
    gap: 20px;
    padding-inline: 16px;
  }
  .top nav {
    gap: 15px;
  }
  .privacy,
  .divider {
    display: none;
  }
  .brand {
    font-size: 18px;
  }
  .brand img {
    width: 29px;
    height: 29px;
    margin-right: 6px;
  }
  .top nav button {
    font-size: 13px;
  }
  .top-end {
    gap: 0;
  }
  main {
    padding-inline: 15px;
  }
  .intro {
    flex-wrap: wrap;
    gap: 14px;
    padding: 23px 0 17px;
  }
  .actions {
    width: 100%;
  }
  .actions .button {
    flex: 1;
  }
  .workspace-grid {
    display: flex;
    flex-direction: column;
  }
  .left-col,
  .controls {
    width: 100%;
  }
  .left-col {
    gap: 13px;
  }
  .stage {
    height: clamp(310px, 80vw, 420px);
  }
  .panel-head {
    padding-inline: 14px;
  }
  .presets {
    padding-inline: 13px;
  }
  .canvas-foot {
    padding-inline: 12px;
  }
  .seg button {
    min-width: 51px;
  }
  .adjust-body {
    padding-inline: 18px;
  }
  .tabs button {
    height: 36px;
  }
  .range-box {
    margin-bottom: 17px;
  }
  input[type="range"] {
    height: 28px;
  }
  .icon-btn {
    min-width: 32px;
    height: 32px;
  }
  .swatches {
    gap: 14px;
  }
  .swatch {
    width: 27px;
    height: 27px;
  }
  .stage-tools button {
    min-height: 30px;
    min-width: 32px;
  }
  .brand span {
    margin-left: 3px;
  }
  .library .panel-head {
    min-height: 45px;
  }
  .toast {
    width: max-content;
    max-width: 90vw;
  }
}
@media (max-width: 380px) {
  .top-inner {
    gap: 12px;
  }
  .top nav {
    gap: 9px;
  }
  .canvas-foot {
    font-size: 11px;
  }
  .link-button {
    font-size: 12px;
  }
  .swatches {
    gap: 9px;
  }
  .avatar-sizes {
    gap: 3px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background-color 0.13s,
      border-color 0.13s,
      color 0.13s;
  }
  .presets {
    scroll-behavior: smooth;
  }
}
.export-preview {
  display: grid;
  place-items: center;
  padding: 10px;
  background-color: var(--stage);
  background-image: radial-gradient(var(--dot) 0.9px, transparent 1px);
  background-size: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.export-preview canvas {
  width: 105px;
  height: 105px;
}
.dialog-feedback:empty {
  display: none;
}
#captionText {
  margin-top: 8px;
}

@media (max-width: 500px) {
  .top nav #editorNav { display: none; }
}

.editor-privacy {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 24px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.editor-privacy label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.editor-privacy input {
  accent-color: var(--control-accent);
}
