:root {
  color-scheme: light;
  --ink: #192b3e;
  --muted: #526477;
  --panel: #faf9f4;
  --edge: #b7c3cb;
  --wallpaper: #d8e7f3;
  --blue: #215c9d;
  --case: #2865ae;
  font-family: Tahoma, Verdana, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--wallpaper); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
:focus-visible { outline: 2px solid #255da4; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.desktop {
  min-height: 100vh;
  min-height: 100svh;
  padding: 28px 16px;
  display: grid;
  place-items: center;
  background: var(--wallpaper) url("assets/sticker-wallpaper.svg") center / 624px 442px repeat;
}
.window {
  width: min(100%, 664px);
  background: var(--panel);
  border: 3px solid var(--case);
  border-radius: 9px 9px 6px 6px;
  overflow: hidden;
  box-shadow: 0 2px 0 #174577, 0 14px 32px #17395242;
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 4px 10px;
  background: linear-gradient(#6da2e2 0%, #4582cd 22%, #2c67b3 72%, #23569b 100%);
  border-bottom: 1px solid #1c4d8c;
  color: #fff;
}
.titlebar img { border-radius: 3px; border: 1px solid #eff8ff; }
.titlebar h1 { margin: 0; font-size: 14px; line-height: 1.3; letter-spacing: .02em; text-shadow: 0 1px #1b4479; }
.workspace {
  display: grid;
  grid-template-columns: minmax(128px, 42%) minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 4vw, 30px);
  padding: clamp(18px, 3vw, 27px);
}
.cat-preview { margin: 0; min-width: 0; text-align: center; }
.photo-frame {
  width: min(100%, 196px);
  margin-inline: auto;
  padding: 5px;
  border: 1px solid #919f9f;
  background: #eae9e1;
  box-shadow: inset 0 1px 1px #59667024, 0 1px #fff;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
}
.cat-preview figcaption { margin-top: 7px; color: var(--muted); font-size: 11px; }
.studio-form { min-width: 0; }
.studio-form h2 { margin: 0 0 13px; font-size: clamp(16px, 3.5vw, 21px); line-height: 1.3; letter-spacing: -.035em; }
.upload {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 59px;
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: linear-gradient(#fff, #eef5fb);
  cursor: pointer;
}
.upload svg, .upload img { flex: 0 0 auto; }
.upload img { object-fit: cover; border: 1px solid var(--edge); }
.upload:has(img:not([hidden])) .upload-icon { display: none; }
.upload:hover, .upload.is-dragging { border-color: #5c8abc; background: #e7f1ff; }
.studio-form:has(#pfp-file:focus-visible) .upload { outline: 2px solid var(--blue); outline-offset: 2px; }
.studio-form[aria-busy="true"] .upload { opacity: .65; cursor: wait; }
.upload strong, .upload small { display: block; line-height: 1.4; }
.upload strong { font-size: 12px; font-weight: 700; color: #234e7a; }
.upload small { margin-top: 2px; font-size: 10px; color: var(--muted); }
.generator-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 13px;
  border: 1px solid #72869a;
  border-radius: 4px;
  background: linear-gradient(#fff 0%,#f4f5ee 54%,#e4e9e4 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 #c6d0d4;
  color: #1d3750;
  text-decoration: none;
  white-space: nowrap;
  font: 700 12px/1.2 Tahoma, Verdana, sans-serif;
  cursor: pointer;
}
.button:hover:not(:disabled) { border-color: #3174b4; background: #e7f3ff; }
.button:active:not(:disabled) { box-shadow: inset 0 1px 2px #293d5633; translate: 0 1px; }
.button-primary { border-color: #4577ac; background: linear-gradient(#f8fcff, #d2e8ff); box-shadow: inset 0 0 0 1px #aacaf0; }
.button:disabled { border-color: #bbc4ca; color: #6a7682; background: #ecefeb; box-shadow: none; cursor: default; }
#studio-status { min-height: 15px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.window-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 13px;
  padding: 9px 13px;
  background: #eeeee6;
  border-top: 1px solid #d1d4c9;
}
.contract { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; gap: 8px; }
#contract-label { font-size: 11px; font-weight: 700; color: #344960; }
#address {
  min-width: 0;
  flex: 1;
  padding: 6px 7px;
  background: #fff;
  border: 1px solid #b5bfbf;
  box-shadow: inset 0 1px 1px #14304b16;
  color: #1c3549;
  overflow-wrap: anywhere;
  font: 12px/1.2 "Courier New", monospace;
  user-select: all;
}
.button-small { min-height: 29px; padding: 4px 8px; font-size: 11px; }

@media (max-width: 530px) {
  .desktop { padding-inline: 12px; background-size: 465px auto; }
  .workspace { grid-template-columns: minmax(90px, 33%) minmax(0, 1fr); gap: 14px; padding: 16px; }
  .upload { gap: 6px; padding-inline: 7px; }
  .upload-icon { width: 23px; height: 23px; }
  .window-footer { padding-inline: 10px; }
  .contract { flex-basis: 100%; }
  .social { margin-inline-start: auto; }
}
@media (max-width: 350px) {
  .workspace { grid-template-columns: 1fr; gap: 14px; }
  .photo-frame { width: 114px; }
  .studio-form h2 { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .button:active:not(:disabled) { translate: none; }
}
