:root {
  --page: #f8faf8;
  --paper: #fff;
  --ink: #192c26;
  --muted: #586b63;
  --line: #dce4de;
  --green: #245e44;
  --accent: #d96c53;
  --font: "DM Sans", sans-serif;
  --display: "Space Grotesk", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  height: 100%;
}
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.workspace:focus-visible {
  outline: 3px solid #cc7958;
  outline-offset: 4px;
}
button {
  transition:
    background 0.15s,
    color 0.15s;
}
svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.7;
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
.app-header {
  height: 64px;
  flex-shrink: 0;
  padding: 0 5%;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--paper);
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  color: var(--ink);
}
.brand-icon {
  display: grid;
  place-items: center;
  background: #edf4ee;
  width: 35px;
  height: 35px;
  flex-shrink: 0;
  padding: 2px;
  border-radius: 7px;
  margin-right: 10px;
  transform: rotate(-7deg);
}
.brand-icon img {
  display: block;
  width: 100%;
  height: 100%;
}
.brand-dot {
  color: var(--accent);
}
.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.privacy {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #5d6e61;
}
.privacy svg {
  width: 15px;
  height: 15px;
}
main {
  width: 100%;
  max-width: 1500px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 32px 12px;
  margin: 0 auto;
}
.page-heading {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.eyebrow {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 7px;
}
h1 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
}
h1 span {
  color: var(--accent);
}
.button {
  border: 1px solid transparent;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  padding: 10px 17px;
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
}
.primary {
  background: var(--green);
  color: white;
}
.primary:hover,
.download:hover:not(:disabled) {
  background: #194b37;
}
.secondary {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}
.secondary:hover {
  background: #f0f3ef;
}
.studio {
  display: grid;
  flex: 1 0 400px;
  grid-template-columns: minmax(0, 1fr) 12px minmax(280px, var(--preview-width, 42%));
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  min-width: 0;
  min-height: 400px;
  animation: arrive 0.45s ease both;
}
.style-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 4px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.style-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.style-tab[aria-selected="true"] {
  color: var(--green);
  border-bottom-color: var(--green);
}
.style-tab:hover {
  background: #eaf2ec;
}
.style-tab:focus-visible {
  outline-offset: -3px;
}
#polaroid-settings {
  clear: both;
  margin-bottom: 12px;
}
#polaroid-settings label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}
#caption {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
}
.editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
}
.preview-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  touch-action: none;
  background: var(--paper);
  border-right: 1px solid var(--line);
}
.preview-divider svg {
  width: 12px;
  color: var(--muted);
  pointer-events: none;
}
.preview-divider:hover,
.preview-divider:focus-visible,
.preview-divider.resizing {
  background: #dce8df;
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
.studio:has(.preview-divider.resizing) {
  user-select: none;
}
.editor-toolbar {
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.section-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  font-weight: 700;
  color: #59625c;
}
.section-label svg {
  width: 15px;
  height: 15px;
}
.toolbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.icon-button {
  border: 0;
  background: transparent;
  color: #606b62;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
}
.icon-button:hover:not(:disabled) {
  background: #edf1eb;
}
.toolbar-divider {
  height: 18px;
  border-right: 1px solid var(--line);
  margin: 0 5px;
}
.workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background-color: #e7eae5;
  background-image: radial-gradient(#ccd2c9 0.7px, transparent 0.7px);
  background-size: 12px 12px;
}
.workspace > img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}
.empty-state > svg {
  width: 42px;
  height: 42px;
  stroke-width: 1;
}
.empty-state h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 5px;
}
.canvas-tag {
  position: absolute;
  bottom: 16px;
  left: 18px;
  z-index: 2;
  background: #fffef3e6;
  border-radius: 3px;
  padding: 6px 9px;
  color: #465344;
  font-size: 9px;
  pointer-events: none;
}
.drop-overlay {
  position: absolute;
  inset: 12px;
  z-index: 10;
  border: 2px dashed var(--green);
  background: #e8f0e8ed;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  border-radius: 5px;
}
.drop-overlay svg {
  width: 55px;
  height: 55px;
  color: var(--green);
}
.workspace.dragging .drop-overlay {
  display: flex;
}
.image-info {
  height: 34px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
.image-info > div {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
#filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
#source-size {
  white-space: nowrap;
}
.status-dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}
.crop-options {
  padding: 10px 18px;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  min-height: 56px;
}
.crop-options label {
  font-size: 12px;
  color: #657064;
  white-space: nowrap;
}
select {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 9px 28px 9px 10px;
  font-size: 12px;
  max-width: 100%;
  min-width: 0;
}
.settings {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}
.settings > * {
  flex-shrink: 0;
}
.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.live-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #858e83;
  white-space: nowrap;
}
.live-label span {
  height: 5px;
  width: 5px;
  background: #719878;
  border-radius: 50%;
}
.preview-stage {
  flex: 1 1 0;
  min-height: 260px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 0;
  background-color: #f5f7f5;
  background-image:
    linear-gradient(45deg, #edf0ed 25%, transparent 25%),
    linear-gradient(-45deg, #edf0ed 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf0ed 75%),
    linear-gradient(-45deg, transparent 75%, #edf0ed 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  border-radius: 3px;
  padding: 20px;
}
#preview {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  filter: drop-shadow(2px 5px 4px #25322328);
}
.preview-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #7e877d;
  font-size: 9px;
  margin-top: 11px;
}
.tiny-dot {
  color: #bdc2ba;
  margin: 0 5px;
}
fieldset {
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 0;
  min-width: 0;
}
legend {
  float: left;
  width: 100%;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  clear: both;
}
.control-row output {
  font-size: 10px;
  color: var(--muted);
}
input[type="range"] {
  width: 100%;
  height: 16px;
  accent-color: var(--green);
  cursor: pointer;
  margin: 5px 0 10px;
  display: block;
}
.color-row {
  margin-top: 1px;
}
.swatches {
  display: flex;
  align-items: center;
  gap: 7px;
}
.swatch {
  position: relative;
  width: 21px;
  height: 21px;
  background: var(--swatch);
  border: 1px solid #d4d7ce;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
}
.swatch.selected {
  outline: 1.5px solid var(--green);
  outline-offset: 2px;
}
.custom-color {
  width: 24px;
  height: 26px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
}
.custom-color svg {
  width: 15px;
  height: 15px;
  color: #697466;
}
.custom-color input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.custom-color:focus-within {
  outline: 2px solid var(--accent);
}
.download {
  width: 100%;
  background: var(--green);
  color: white;
  min-height: 46px;
  font-size: 12px;
}
.download-arrow {
  margin-left: auto;
  width: 15px;
  height: 15px;
}
.export-note {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
  min-height: 14px;
}
.message {
  flex-shrink: 0;
  margin-top: 8px;
  font-size: 12px;
  color: var(--green);
}
.message:empty {
  margin: 0;
}
.message.error {
  color: #a43e32;
}
.studio-guide {
  flex: 0 0 auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.studio-guide summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--green);
}
.studio-guide summary:focus-visible {
  outline: 3px solid #cc7958;
  outline-offset: -3px;
}
.studio-guide-content {
  padding: 8px 20px 24px;
}
.studio-guide h1 {
  font-size: 24px;
}
.studio-guide h2 {
  font: 600 18px/1.4 var(--display);
  margin: 16px 0 10px;
}
.studio-guide p {
  margin: 12px 0;
}
.studio-guide ol {
  padding-left: 22px;
}
.studio-guide li + li {
  margin-top: 8px;
}
.studio-guide a {
  color: var(--green);
  text-underline-offset: 3px;
}
.guide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 32px;
}
@media (max-width: 720px) {
  .guide-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-guide-content {
    padding-inline: 16px;
  }
}
footer {
  padding: 10px 0 0;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: #8a9185;
}
footer > span:last-child {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 9px;
}
footer svg {
  color: var(--accent);
  width: 18px;
  height: 18px;
}
.cropper-view-box {
  outline: 1.5px solid #fff;
  outline-color: #fff;
}
.cropper-line,
.cropper-point {
  background-color: #fff;
}
.cropper-point {
  width: 7px;
  height: 7px;
  opacity: 1;
}
.cropper-modal {
  background: #243529;
  opacity: 0.48;
}
.cropper-bg {
  background: none;
}
.cropper-dashed {
  border-color: #fff;
  opacity: 0.45;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 1000px) {
  main {
    padding: 16px 24px 12px;
  }
  .settings {
    padding: 14px 16px;
  }
  .crop-options {
    gap: 10px;
    flex-wrap: wrap;
  }
}
@media (min-width: 721px) and (max-height: 850px) {
  .preview-stage {
    min-height: 180px;
  }
  .settings {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  fieldset {
    padding-top: 8px;
    margin: 8px 0;
  }
  legend {
    margin-bottom: 8px;
  }
  input[type="range"] {
    margin: 4px 0 8px;
  }
  .export-note {
    margin-top: 6px;
  }
}
@media (max-width: 720px) {
  .app-header {
    height: auto;
    min-height: 56px;
    padding: 10px 16px 0;
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .site-nav {
    order: 1;
    flex-basis: 100%;
    gap: 24px;
  }
  .brand {
    font-size: 21px;
  }
  .privacy {
    font-size: 10px;
  }
  .privacy svg {
    width: 13px;
  }
  main {
    padding: 16px 12px 12px;
  }
  .page-heading {
    margin-bottom: 14px;
    gap: 12px;
  }
  h1 {
    font-size: 25px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .page-heading .button {
    font-size: 11px;
    padding: 9px 11px;
    min-height: 40px;
  }
  .studio {
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .preview-divider {
    display: none;
  }
  .editor {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace {
    flex: none;
    height: clamp(200px, 32vh, 360px);
    height: clamp(200px, 32dvh, 360px);
  }
  .editor-toolbar {
    padding: 0 12px;
    height: 46px;
  }
  .crop-options {
    padding: 10px 12px;
    min-height: 56px;
  }
  .image-info {
    padding: 0 12px;
  }
  #filename {
    max-width: 170px;
  }
  .settings {
    padding: 16px;
    overflow: visible;
  }
  .preview-stage {
    flex: none;
    aspect-ratio: auto;
    min-height: 80px;
    height: clamp(140px, 24vh, 240px);
    height: clamp(140px, 24dvh, 240px);
  }
  .preview-caption {
    font-size: 10px;
  }
  .control-row {
    font-size: 12px;
  }
  legend {
    font-size: 13px;
  }
  .swatch {
    width: 24px;
    height: 24px;
  }
  .swatches {
    gap: 10px;
  }
  .download {
    height: 48px;
  }
  footer {
    font-size: 10px;
  }
  .header-label {
    display: none;
  }
}
@media (max-width: 380px) {
  h1 {
    font-size: 22px;
  }
  .privacy {
    max-width: 105px;
  }
  .crop-options {
    gap: 8px;
  }
  .crop-options label {
    font-size: 11px;
  }
  .swatches {
    gap: 7px;
  }
  #filename {
    max-width: 135px;
  }
  footer {
    flex-wrap: wrap;
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
