@import url('https://cdn.jsdelivr.net/npm/@fontsource/fusion-pixel-12px-monospaced-sc@5.3.0/index.css');

:root {
  color: #173a31;
  background: #15382e;
  font-family: "Fusion Pixel 12px Monospaced SC", "Fusion Pixel 12px Monospaced Zh Hans", "Microsoft YaHei", monospace;
  --ink: #173a31;
  --ink-deep: #0a211b;
  --paper: #f6e7b8;
  --paper-light: #fff6d5;
  --coral: #e77d63;
  --sun: #f5c84f;
  --aqua: #8ed5cf;
  --leaf: #5f8f3c;
  --moss: #2f6548;
  --wood: #6a4329;
  --wood-dark: #3b2518;
  --line-soft: #b68b54;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink-deep);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--ink-deep);
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

img,
canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 3px;
}

.postcard-app {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding-bottom: 48px;
  overflow-x: clip;
}

.workshop-backdrop {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  background-color: #214f3d;
  background-image: url("/assets/pixel-greenhouse-interior.png");
  background-position: center;
  background-size: cover;
  image-rendering: pixelated;
}

.workshop-backdrop::before {
  position: absolute;
  inset: 0;
  background: rgba(8, 33, 26, .36);
  content: "";
}

.workshop-backdrop::after {
  display: none;
}

.glass-pane {
  position: absolute;
  z-index: 1;
  top: 78px;
  bottom: 42%;
  width: 31%;
  border-right: 10px solid rgba(19, 48, 39, 0.8);
  border-left: 10px solid rgba(19, 48, 39, 0.8);
  background: rgba(142, 213, 207, .05);
  opacity: .35;
}

.pane-one { left: 1%; }
.pane-two { left: 34.5%; }
.pane-three { right: 1%; }

.wood-beam {
  position: absolute;
  z-index: 2;
  top: 78px;
  bottom: 0;
  width: 12px;
  border-right: 4px solid #2e1b12;
  background: rgba(119, 80, 57, .58);
  opacity: .5;
}

.beam-one { left: 14%; }
.beam-two { right: 13%; }

.backdrop-sprite {
  position: absolute;
  z-index: 3;
  width: 96px;
  height: 96px;
  opacity: .32;
  filter: drop-shadow(6px 6px 0 rgba(10, 33, 27, 0.45));
}

.sprite-lantern { top: 130px; right: 7%; }
.sprite-books { right: 3%; bottom: 5%; }
.sprite-jar { left: 2%; bottom: 4%; }

.postcard-header {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 74px;
  padding: 10px max(22px, calc((100vw - 1480px) / 2));
  border-bottom: 4px solid var(--sun);
  background: rgba(13, 48, 39, .97);
  color: var(--paper-light);
  box-shadow: 0 6px 0 var(--ink-deep);
}

.postcard-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  color: var(--paper-light);
  text-decoration: none;
}

.postcard-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.postcard-brand strong {
  font-size: 20px;
  line-height: 1.2;
}

.postcard-brand small {
  color: var(--aqua);
  font-size: 10px;
}

.brand-pixel {
  position: relative;
  width: 34px;
  height: 38px;
  border: 3px solid var(--ink-deep);
  background: #9a6330;
  box-shadow: inset 0 -5px 0 #75451f, 3px 3px 0 #071813;
}

.brand-pixel::before,
.brand-pixel::after,
.brand-pixel i {
  position: absolute;
  display: block;
  content: "";
}

.brand-pixel::before {
  top: -5px;
  left: 3px;
  width: 12px;
  height: 15px;
  border: 3px solid var(--ink-deep);
  background: #8fc54d;
}

.brand-pixel::after {
  top: -5px;
  right: 3px;
  width: 12px;
  height: 15px;
  border: 3px solid var(--ink-deep);
  background: #b7d85c;
}

.brand-pixel i {
  top: 4px;
  left: 14px;
  width: 3px;
  height: 18px;
  background: var(--ink-deep);
}

.header-chapter {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 18px;
  border-right: 3px solid #376855;
  border-left: 3px solid #376855;
}

.header-chapter span {
  color: var(--sun);
  font-size: 10px;
}

.header-chapter strong {
  font-size: 15px;
}

.return-link {
  justify-self: end;
  padding: 10px 14px;
  border: 3px solid var(--paper-light);
  background: var(--wood);
  color: var(--paper-light);
  box-shadow: 4px 4px 0 var(--ink-deep);
  font-size: 12px;
  text-decoration: none;
}

.return-link:hover {
  filter: brightness(1.12);
}

.return-link:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink-deep);
}

.postcard-workspace {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 28px;
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: 30px;
}

.postcard-editor {
  position: relative;
  min-width: 0;
  padding: 24px 22px 26px;
  border: 4px solid var(--ink-deep);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink-deep), inset 0 0 0 4px #d3ae6c;
}

.editor-heading {
  padding: 4px 4px 16px;
  border-bottom: 4px double var(--wood);
}

.postcard-header p,
.editor-heading p {
  margin: 0;
}

.editor-heading h1,
.preview-heading h2 {
  margin: 5px 0 8px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.2;
}

.editor-heading > p:last-child {
  color: #375446;
  font-size: 12px;
  line-height: 1.75;
}

.eyebrow {
  color: #b4493a;
  font-size: 11px;
  font-weight: 700;
}

.guide-dialogue {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  margin: 16px 2px 18px;
  padding: 9px 10px 9px 8px;
  border: 3px solid var(--ink-deep);
  background: var(--moss);
  box-shadow: 4px 4px 0 #2b291b;
}

.guide-dialogue img {
  display: block;
  width: 50px;
  height: 100px;
  object-fit: contain;
}

.guide-dialogue p {
  position: relative;
  margin: 0 0 7px;
  padding: 10px;
  border: 3px solid var(--wood-dark);
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink-deep);
}

.guide-dialogue p::before {
  position: absolute;
  bottom: 10px;
  left: -9px;
  width: 9px;
  height: 9px;
  border-bottom: 3px solid var(--wood-dark);
  border-left: 3px solid var(--wood-dark);
  background: var(--paper-light);
  content: "";
}

.guide-dialogue span,
.guide-dialogue strong {
  display: block;
}

.guide-dialogue span {
  margin-bottom: 5px;
  color: #587146;
  font-size: 9px;
}

.guide-dialogue strong {
  font-size: 11px;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 14px;
}

fieldset {
  min-width: 0;
  margin: 0;
}

.quest-panel,
.privacy-fieldset,
.public-fields {
  padding: 14px;
  border: 3px solid var(--wood-dark);
  background: var(--paper-light);
  box-shadow: 4px 4px 0 #8b633b;
}

legend {
  margin-left: -5px;
  padding: 5px 9px 5px 6px;
  border-right: 3px solid var(--ink-deep);
  border-bottom: 3px solid var(--ink-deep);
  background: var(--ink);
  color: var(--paper-light);
  font-size: 12px;
  font-weight: 700;
}

legend span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 20px;
  margin-right: 5px;
  background: var(--sun);
  color: var(--ink-deep);
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 3px solid #557263;
  background: #fff8dc;
  color: var(--ink-deep);
  padding: 9px 10px;
  box-shadow: inset 3px 3px 0 #dfc994;
}

input:hover,
textarea:hover {
  border-color: var(--leaf);
}

input:focus,
textarea:focus {
  border-color: var(--coral);
  background: #fffdf0;
  box-shadow: inset 3px 3px 0 #f0c38d;
}

textarea {
  min-height: 74px;
  resize: vertical;
  line-height: 1.55;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 11px;
}

.inscription-panel > label + label {
  margin-top: 11px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 14px;
  padding: 5px;
  border: 3px solid var(--ink-deep);
  background: var(--wood);
  box-shadow: inset 0 0 0 2px #a8713d;
}

.segmented-control button {
  display: grid;
  place-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px;
  border: 3px solid var(--ink-deep);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 3px 3px 0 #2a1a11;
  cursor: pointer;
  text-align: left;
}

.segmented-control button strong,
.segmented-control button small {
  display: block;
}

.segmented-control button strong {
  font-size: 12px;
}

.segmented-control button small {
  font-size: 9px;
  line-height: 1.35;
}

.segmented-control button[aria-pressed="true"] {
  border-color: var(--sun);
  background: var(--ink);
  color: var(--paper-light);
  box-shadow: 3px 3px 0 var(--sun);
}

.segmented-control button:hover {
  filter: brightness(1.08);
}

.segmented-control button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #2a1a11;
}

.palette-line {
  display: grid;
  gap: 8px;
}

.control-label {
  font-size: 11px;
  font-weight: 700;
}

.palette-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.palette-swatch {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 4px;
  border: 3px solid var(--line-soft);
  background: var(--paper-light);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.palette-swatch > span {
  display: block;
  width: 34px;
  height: 26px;
  border: 3px solid var(--ink-deep);
}

.palette-swatch small {
  font-size: 10px;
}

.palette-swatch.citrus > span {
  background: var(--coral);
  box-shadow: inset 9px 0 0 var(--sun);
}

.palette-swatch.neon > span {
  background: #72b7ef;
  box-shadow: inset 9px 0 0 #182b2c;
}

.palette-swatch[aria-pressed="true"] {
  border-color: var(--ink-deep);
  background: #d9edd7;
  box-shadow: 3px 3px 0 var(--ink-deep);
}

.privacy-fieldset {
  display: grid;
  gap: 10px;
  border-color: #315a44;
  background: #d9edd7;
  box-shadow: 4px 4px 0 #284536;
}

.fieldset-note {
  margin: -1px 0 2px;
  padding: 7px 9px;
  border-left: 5px solid var(--sun);
  background: #c6dfc1;
  color: #375446;
  font-size: 10px;
  line-height: 1.55;
}

.toggle-list {
  display: grid;
  gap: 6px;
  padding-top: 4px;
  border-top: 3px dashed #6d8d74;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  cursor: pointer;
}

.toggle-row input {
  appearance: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 3px solid var(--ink-deep);
  background: var(--paper-light);
  box-shadow: inset 3px 3px 0 #c7b68b;
}

.toggle-row input:checked {
  border-color: var(--ink-deep);
  background: var(--sun);
  box-shadow: inset 4px 4px 0 var(--leaf), inset -4px -4px 0 var(--coral);
}

.public-fields {
  box-shadow: 4px 4px 0 var(--ink-deep);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  padding-bottom: 7px;
  border-bottom: 3px solid var(--ink);
}

.public-fields h2 {
  margin: 0;
  font-size: 13px;
}

.section-title-row > span {
  padding: 3px 5px;
  background: var(--leaf);
  color: var(--paper-light);
  font-size: 8px;
}

.public-fields ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-fields li {
  padding: 4px 6px;
  border: 2px solid #557263;
  background: #fff6d5;
  color: #375446;
  font-size: 9px;
}

.primary-action,
.download-action {
  min-height: 50px;
  border: 4px solid var(--ink-deep);
  color: var(--ink-deep);
  box-shadow: 5px 5px 0 var(--ink-deep);
  cursor: pointer;
  font-weight: 700;
}

.primary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--sun);
}

.primary-action:hover,
.download-action:not(:disabled):hover {
  filter: brightness(1.08);
}

.primary-action:active,
.download-action:not(:disabled):active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink-deep);
}

.primary-action:disabled {
  cursor: wait;
  background: #b9c9bd;
  color: #557263;
}

.workbench-decor {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  height: 42px;
  margin: 15px 2px -13px;
  border-bottom: 5px solid var(--wood-dark);
}

.workbench-decor img {
  width: 48px;
  height: 48px;
  transform: translateY(-8px);
}

.postcard-preview {
  position: sticky;
  top: 22px;
  align-self: start;
  min-width: 0;
  padding: 20px;
  border: 4px solid var(--ink-deep);
  background: #dbc78f;
  box-shadow: 8px 8px 0 var(--ink-deep), inset 0 0 0 4px #f3dc9d;
}

.preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 2px 2px 11px;
  border-bottom: 4px double var(--wood-dark);
}

.preview-heading h2 {
  margin-bottom: 0;
  font-size: 21px;
}

.state-seal {
  max-width: 230px;
  margin: 2px 0 0;
  padding: 7px 9px;
  border: 3px solid var(--ink-deep);
  background: var(--paper-light);
  color: #375446;
  box-shadow: 3px 3px 0 var(--coral);
  font-size: 10px;
  line-height: 1.45;
  text-align: right;
}

.achievement-frame {
  position: relative;
  padding: 21px;
  border: 8px solid #2a180f;
  background: #704627;
  box-shadow: 8px 8px 0 var(--ink-deep), inset 0 0 0 4px #b37a42;
}

.frame-corner {
  position: absolute;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 4px solid #2a180f;
  background: var(--sun);
  box-shadow: inset 0 0 0 4px var(--coral);
}

.corner-nw { top: -11px; left: -11px; }
.corner-ne { top: -11px; right: -11px; }
.corner-sw { bottom: -11px; left: -11px; }
.corner-se { right: -11px; bottom: -11px; }

.frame-title,
.frame-plaque {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 4px solid #2a180f;
  background: var(--ink);
  color: var(--paper-light);
}

.frame-title {
  min-height: 42px;
  padding: 8px 12px;
  border-bottom: 0;
}

.frame-title span {
  color: var(--aqua);
  font-size: 11px;
}

.frame-title strong {
  color: var(--sun);
  font-size: 11px;
}

.canvas-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
  max-height: calc(100vh - 285px);
  padding: 22px;
  overflow: auto;
  border: 4px solid #2a180f;
  background: #285847;
  box-shadow: inset 0 0 0 6px #173a31;
}

.canvas-stage::before,
.canvas-stage::after {
  position: absolute;
  z-index: 0;
  background: #376f5d;
  content: "";
}

.canvas-stage::before {
  top: 10%;
  bottom: 10%;
  left: 50%;
  width: 4px;
}

.canvas-stage::after {
  top: 50%;
  right: 8%;
  left: 8%;
  height: 4px;
}

.preview-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  width: min(360px, 92%);
  min-height: 390px;
  padding: 28px;
  border: 4px solid var(--sun);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink-deep), inset 0 0 0 5px #dfc57f;
  text-align: center;
}

.placeholder-window {
  position: relative;
  display: grid;
  place-items: center;
  width: 138px;
  height: 138px;
  margin-bottom: 18px;
  border: 4px solid var(--ink-deep);
  background: #8ed5cf;
  box-shadow: inset 0 0 0 8px #579c82, 6px 6px 0 #96704a;
}

.placeholder-window img {
  width: 96px;
  height: 96px;
}

.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--sun);
  box-shadow: 8px 0 0 var(--sun), 0 8px 0 var(--sun), -8px 0 0 var(--sun), 0 -8px 0 var(--sun);
}

.spark-one { top: 15px; right: 14px; }
.spark-two { bottom: 17px; left: 16px; background: var(--coral); box-shadow: 8px 0 0 var(--coral), 0 8px 0 var(--coral), -8px 0 0 var(--coral), 0 -8px 0 var(--coral); }

.preview-placeholder p {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.preview-placeholder > span {
  max-width: 250px;
  color: #557263;
  font-size: 11px;
  line-height: 1.65;
}

.canvas-stage:has(#postcard-canvas:not([hidden])) .preview-placeholder {
  display: none;
}

#postcard-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 330px);
  border: 4px solid var(--sun);
  background: #fff6d5;
  box-shadow: 8px 8px 0 var(--ink-deep);
}

#postcard-canvas[hidden] {
  display: none;
}

.frame-plaque {
  min-height: 38px;
  padding: 7px 10px;
  border-top: 0;
  background: #40291b;
  color: #e8d6a7;
  font-size: 9px;
}

.frame-plaque span:last-child {
  color: var(--aqua);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.download-action {
  width: 100%;
  margin-top: 16px;
  background: var(--aqua);
}

.download-action:disabled {
  cursor: not-allowed;
  background: #8aa297;
  color: #345247;
  box-shadow: 5px 5px 0 #465d53;
}

.download-note {
  margin: 12px 0 1px;
  color: #4a624f;
  font-size: 10px;
  text-align: center;
}

@media (min-width: 1280px) {
  .postcard-workspace {
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .postcard-workspace {
    width: min(100% - 28px, 1480px);
    gap: 18px;
  }

  .postcard-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-chapter {
    display: none;
  }

  .postcard-editor,
  .postcard-preview {
    padding: 16px;
  }

  .guide-dialogue {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .guide-dialogue img {
    width: 42px;
    height: 84px;
  }
}

@media (max-width: 900px) {
  .postcard-workspace {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 760px);
    gap: 24px;
  }

  .postcard-preview {
    position: relative;
    top: auto;
  }

  .canvas-stage,
  #postcard-canvas {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .postcard-app {
    padding-bottom: 28px;
  }

  .postcard-header {
    min-height: 66px;
    padding: 9px 14px;
  }

  .postcard-brand strong {
    font-size: 17px;
  }

  .postcard-brand small {
    display: none;
  }

  .return-link {
    padding: 8px 9px;
    font-size: 10px;
  }

  .postcard-workspace {
    grid-template-columns: 1fr;
    gap: 22px;
    width: min(100% - 24px, 620px);
    padding-top: 22px;
  }

  .postcard-editor {
    padding: 20px 18px;
  }

  .postcard-preview {
    position: relative;
    top: auto;
    padding: 18px;
  }

  .achievement-frame {
    padding: 15px;
  }

  .canvas-stage {
    min-height: 390px;
    max-height: none;
    padding: 14px;
  }

  #postcard-canvas {
    max-height: none;
  }

  .preview-placeholder {
    min-height: 330px;
  }

  .backdrop-sprite {
    opacity: 0.35;
  }
}

@media (max-width: 420px) {
  .brand-pixel {
    width: 29px;
    height: 34px;
  }

  .postcard-brand strong {
    font-size: 14px;
  }

  .return-link span {
    display: none;
  }

  .editor-heading h1 {
    font-size: 22px;
  }

  .field-grid,
  .segmented-control,
  .palette-row {
    grid-template-columns: 1fr;
  }

  .preview-heading {
    flex-direction: column;
    gap: 8px;
  }

  .state-seal {
    max-width: 100%;
    text-align: left;
  }

  .achievement-frame {
    padding: 10px;
    border-width: 6px;
  }

  .canvas-stage {
    min-height: 340px;
    padding: 10px;
  }

  .preview-placeholder {
    width: 100%;
    min-height: 300px;
    padding: 18px;
  }

  .placeholder-window {
    width: 116px;
    height: 116px;
  }

  .placeholder-window img {
    width: 80px;
    height: 80px;
  }

  .frame-title,
  .frame-plaque {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* Scene-first layout, readable type, and one consolidated control skin. */
body.pixel-postcard {
  font-size: 13px;
}

body.pixel-postcard .glass-pane {
  background: rgba(255, 243, 204, .035);
}

body.pixel-postcard .postcard-workspace {
  grid-template-columns: minmax(330px, 382px) minmax(0, 1fr);
  gap: 32px;
  width: min(1320px, calc(100% - 64px));
  padding-top: 28px;
}

body.pixel-postcard .postcard-editor {
  align-self: start;
  padding: 22px 20px 24px;
  border: 2px solid rgba(59, 37, 24, .84);
  background: rgba(255, 241, 200, .94);
  box-shadow: 0 12px 24px rgba(7, 27, 21, .18);
}

body.pixel-postcard .editor-heading {
  padding: 2px 2px 14px;
  border-bottom: 2px solid rgba(106, 67, 41, .62);
}

body.pixel-postcard .guide-dialogue {
  min-width: 0;
  padding: 9px 11px 10px 8px;
  border: 4px solid #4b2d1d;
  background: #8c5933;
  box-shadow: inset 0 0 0 3px #b77a43, inset 0 -5px 0 #62391f, 4px 5px 0 #352117;
  clip-path: none;
}

body.pixel-postcard .guide-dialogue p {
  min-width: 0;
  padding: 12px;
  border: 4px solid #4b2d1d;
  background: #fff4c9;
  color: #3d2b20;
  box-shadow: inset 0 0 0 3px #ead39a, inset 0 -4px 0 #d2aa68, 4px 5px 0 #352117;
}

body.pixel-postcard .guide-dialogue p::before {
  bottom: 12px;
  left: -13px;
  width: 10px;
  height: 14px;
  border-bottom: 4px solid #4b2d1d;
  border-left: 4px solid #4b2d1d;
  background: #fff4c9;
  box-shadow: -3px 3px 0 #352117;
}

body.pixel-postcard .guide-dialogue p::after {
  content: none;
}

body.pixel-postcard .guide-dialogue span {
  color: #315b48;
  font-size: 12px;
}

body.pixel-postcard .guide-dialogue strong,
body.pixel-postcard .editor-heading > p:last-child,
body.pixel-postcard label,
body.pixel-postcard input,
body.pixel-postcard textarea,
body.pixel-postcard .fieldset-note,
body.pixel-postcard .toggle-row,
body.pixel-postcard .public-fields li,
body.pixel-postcard .preview-placeholder > span,
body.pixel-postcard .download-note {
  font-size: 13px;
}

body.pixel-postcard .postcard-brand small,
body.pixel-postcard .header-chapter span,
body.pixel-postcard .eyebrow,
body.pixel-postcard legend,
body.pixel-postcard .segmented-control button small,
body.pixel-postcard .control-label,
body.pixel-postcard .palette-swatch small,
body.pixel-postcard .section-title-row > span,
body.pixel-postcard .state-seal,
body.pixel-postcard .frame-title span,
body.pixel-postcard .frame-title strong,
body.pixel-postcard .frame-plaque {
  font-size: 12px;
}

body.pixel-postcard .return-link,
body.pixel-postcard .segmented-control button strong,
body.pixel-postcard .primary-action,
body.pixel-postcard .download-action {
  font-size: 13px;
}

body.pixel-postcard .eyebrow {
  color: #765036;
}

body.pixel-postcard .postcard-brand small,
body.pixel-postcard .frame-title span,
body.pixel-postcard .frame-plaque span:last-child {
  color: #b9d4a8;
}

body.pixel-postcard .quest-panel,
body.pixel-postcard .privacy-fieldset {
  padding: 12px 2px 16px;
  border: 0;
  border-top: 1px solid rgba(91, 67, 42, .48);
  background: transparent;
  box-shadow: none;
}

body.pixel-postcard legend {
  margin-left: 0;
  padding: 0 8px 8px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

body.pixel-postcard legend span {
  width: 24px;
  height: 22px;
  margin-right: 6px;
  border: 0;
  background: #765036;
  color: #fff4c9;
}

body.pixel-postcard input:not([type="checkbox"]),
body.pixel-postcard textarea {
  border: 2px solid #806347 !important;
  background: #fff8dc !important;
  color: #3d2b20 !important;
  box-shadow: inset 2px 2px 0 #dfc994 !important;
}

body.pixel-postcard input:not([type="checkbox"]):hover,
body.pixel-postcard textarea:hover {
  border-color: #597658 !important;
}

body.pixel-postcard input:not([type="checkbox"]):focus,
body.pixel-postcard input:not([type="checkbox"]):focus-visible,
body.pixel-postcard textarea:focus,
body.pixel-postcard textarea:focus-visible {
  border-color: #8ed5cf !important;
  background: #fffdf0 !important;
  outline: 3px solid #8ed5cf !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(142, 213, 207, .24), inset 2px 2px 0 #dfc994 !important;
}

body.pixel-postcard input:not([type="checkbox"]):user-invalid,
body.pixel-postcard textarea:user-invalid {
  border-color: var(--coral) !important;
  outline-color: var(--coral) !important;
}

body.pixel-postcard .segmented-control {
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(91, 67, 42, .48);
  background: rgba(106, 67, 41, .1);
  box-shadow: none;
}

body.pixel-postcard .segmented-control button {
  position: relative;
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #806347;
  background: #f5e3b5;
  color: #3d2b20;
  box-shadow: none;
  clip-path: none;
  filter: none;
  transition: transform 70ms steps(1, end), box-shadow 70ms steps(1, end);
}

body.pixel-postcard .segmented-control button[aria-pressed="true"],
body.pixel-postcard .palette-swatch[aria-pressed="true"] {
  border-color: #8ed5cf;
  background: #173f35;
  color: #fff4c9;
  box-shadow: inset 0 0 0 2px #4f8f80, 0 0 0 2px #8ed5cf;
  filter: none;
}

body.pixel-postcard .segmented-control button[aria-pressed="true"]::after {
  content: none;
}

body.pixel-postcard .segmented-control button:focus-visible,
body.pixel-postcard .palette-swatch:focus-visible,
body.pixel-postcard .toggle-row:has(input:focus-visible) {
  outline: 3px solid #8ed5cf;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(142, 213, 207, .28);
}

body.pixel-postcard .segmented-control button:active,
body.pixel-postcard .toggle-row:active {
  transform: translate(2px, 2px);
  box-shadow: none;
  filter: none;
}

body.pixel-postcard .palette-swatch {
  min-height: 42px;
  border-width: 1px;
  box-shadow: none;
}

body.pixel-postcard .fieldset-note {
  position: relative;
  margin: 2px 0 5px;
  padding: 8px 0 8px 10px;
  border: 0;
  border-left: 2px solid #8b7044;
  background: rgba(198, 223, 193, .38);
  color: #4d4431;
  box-shadow: none;
  clip-path: none;
}

body.pixel-postcard .fieldset-note::before,
body.pixel-postcard .fieldset-note::after {
  content: none;
}

body.pixel-postcard .toggle-list {
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(91, 67, 42, .38);
}

body.pixel-postcard .toggle-row {
  position: relative;
  min-width: 0;
  min-height: 38px;
  padding: 7px 2px;
  border: 0;
  border-bottom: 1px solid rgba(91, 67, 42, .24);
  background: transparent;
  color: #3d2b20;
  box-shadow: none;
  clip-path: none;
  filter: none;
  transition: transform 70ms steps(1, end), box-shadow 70ms steps(1, end);
}

body.pixel-postcard .toggle-row:hover {
  background: rgba(255, 240, 196, .58);
}

body.pixel-postcard .toggle-row:has(input:checked) {
  color: #173f35;
  background: rgba(142, 213, 207, .16);
  box-shadow: none;
  filter: none;
}

body.pixel-postcard .toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.pixel-postcard .toggle-row::before {
  display: grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #4b2d1d;
  background: #fff8dc;
  color: #173a31;
  box-shadow: inset 2px 2px 0 #d6bd82;
  content: "";
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

body.pixel-postcard .toggle-row:has(input:checked)::before {
  border-color: #173f35;
  background: #8ed5cf;
  color: #173a31;
  content: "✓";
  box-shadow: inset 0 0 0 3px #fff4c9;
}

body.pixel-postcard .toggle-row::after {
  content: none;
}

body.pixel-postcard .public-fields {
  padding: 12px;
  border: 1px solid rgba(91, 67, 42, .44);
  background: rgba(255, 249, 229, .58);
  box-shadow: none;
}

body.pixel-postcard .section-title-row {
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(91, 67, 42, .48);
}

body.pixel-postcard .section-title-row > span {
  background: #587146;
}

body.pixel-postcard .public-fields li {
  border: 1px solid #8c7654;
  background: rgba(255, 246, 213, .82);
}

body.pixel-postcard .primary-action {
  color: var(--ink-deep);
  background: var(--sun);
  border-color: #4b2d1d;
  box-shadow: 0 4px 0 #a56e2f, 0 7px 0 var(--ink-deep), inset 0 3px 0 #ffe49a;
}

body.pixel-postcard .postcard-preview {
  position: sticky;
  top: 22px;
  padding: 18px;
  border: 1px solid rgba(59, 37, 24, .72);
  background: rgba(219, 199, 143, .92);
  box-shadow: 0 12px 24px rgba(7, 27, 21, .18);
}

body.pixel-postcard .preview-heading {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(106, 67, 41, .62);
}

body.pixel-postcard .state-seal {
  border: 1px solid #6d5438;
  background: rgba(255, 249, 229, .84);
  box-shadow: none;
}

body.pixel-postcard .frame-corner {
  box-shadow: inset 0 0 0 4px #a46a39;
}

body.pixel-postcard .placeholder-window {
  background: #7fa88a;
  box-shadow: inset 0 0 0 8px #4e7a62, 6px 6px 0 #96704a;
}

body.pixel-postcard .spark-two {
  background: var(--leaf);
  box-shadow: 8px 0 0 var(--leaf), 0 8px 0 var(--leaf), -8px 0 0 var(--leaf), 0 -8px 0 var(--leaf);
}

body.pixel-postcard .download-action {
  border: 2px solid #6d5438;
  background: #ead7a2;
  color: #3d2b20;
  box-shadow: 3px 3px 0 rgba(7, 27, 21, .58);
}

body.pixel-postcard .download-action:disabled {
  background: #aab9a9;
  color: #345247;
  box-shadow: none;
}

@media (max-width: 960px) {
  body.pixel-postcard .postcard-app,
  body.pixel-postcard .postcard-header,
  body.pixel-postcard .postcard-workspace {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.pixel-postcard .postcard-app,
  body.pixel-postcard .postcard-workspace {
    overflow-x: clip;
  }

  body.pixel-postcard .postcard-header {
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  body.pixel-postcard :where(
    .postcard-brand,
    .postcard-editor,
    .postcard-preview,
    .guide-dialogue,
    .guide-dialogue p,
    fieldset,
    .field-grid,
    .segmented-control,
    .palette-row
  ) {
    min-width: 0;
  }

  body.pixel-postcard .postcard-brand {
    overflow: hidden;
  }

  body.pixel-postcard .postcard-brand strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.pixel-postcard .return-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.pixel-postcard .postcard-workspace {
    width: min(100% - 36px, 1320px);
    gap: 20px;
  }
}

@media (max-width: 900px) {
  body.pixel-postcard .postcard-workspace {
    grid-template-columns: minmax(0, 1fr);
    width: min(100% - 28px, 760px);
    max-width: calc(100vw - 28px);
    gap: 22px;
    padding-top: 22px;
  }

  body.pixel-postcard .postcard-editor,
  body.pixel-postcard .postcard-preview {
    width: 100%;
    max-width: 100%;
  }

  body.pixel-postcard .guide-dialogue {
    width: 100%;
    max-width: 100%;
  }

  body.pixel-postcard .guide-dialogue p,
  body.pixel-postcard .editor-heading > p:last-child {
    overflow-wrap: anywhere;
  }

  body.pixel-postcard .postcard-preview {
    position: relative;
    top: auto;
  }
}

@media (max-width: 760px) {
  body.pixel-postcard .postcard-workspace {
    width: min(100% - 22px, 620px);
    max-width: calc(100vw - 22px);
    padding-top: 18px;
  }

  body.pixel-postcard .postcard-editor {
    padding: 18px 16px 20px;
    background: rgba(255, 241, 200, .92);
  }

  body.pixel-postcard .guide-dialogue {
    margin: 17px -4px 19px;
  }

  body.pixel-postcard .postcard-preview {
    padding: 14px;
  }
}

@media (max-width: 420px) {
  body.pixel-postcard .return-link {
    font-size: 12px;
  }

  body.pixel-postcard .guide-dialogue {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  body.pixel-postcard .guide-dialogue img {
    width: 40px;
    height: 82px;
  }

  body.pixel-postcard .guide-dialogue p {
    padding: 10px;
  }

  body.pixel-postcard .field-grid {
    grid-template-columns: 1fr;
  }

  body.pixel-postcard .segmented-control,
  body.pixel-postcard .palette-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.pixel-postcard .segmented-control {
    gap: 5px;
  }

  body.pixel-postcard .segmented-control button {
    min-height: 54px;
    padding: 8px;
  }

  body.pixel-postcard .toggle-row {
    min-height: 42px;
    padding: 8px 2px;
    font-size: 13px;
  }
}
