@font-face {
  font-display: swap;
  font-family: "EB Garamond Local";
  font-style: normal;
  font-weight: 500;
  src: url("/assets/fonts/eb-garamond-regular.woff2") format("woff2");
}

:root {
  --ink: #141414;
  --muted: #6d6a64;
  --line: #dedad3;
  --paper: #f4f1eb;
  --card: #fffcf8;
  --red: #e23b2a;
  --cube-orange: #ff5a36;
  --cube-blue: #3b6dff;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
}

button, input, textarea { font: inherit; color: inherit; }

.nav {
  align-items: center;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: none;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
}

.brand {
  align-items: baseline;
  color: inherit;
  display: flex;
  gap: 8px;
  text-decoration: none;
}

.brand-name {
  font-family: "EB Garamond Local", Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-by {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.nav-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.gate {
  border: 0;
  border-radius: 18px;
  max-width: 420px;
  padding: 0;
  width: calc(100% - 32px);
}

.gate::backdrop { background: rgba(20, 20, 20, 0.35); }

.gate-body { padding: 22px; }

.gate h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 8px;
}

.gate-body > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.gate-note { margin-bottom: 0; }

.price-tiers {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.price-tiers section {
  background: var(--paper);
  border-radius: 12px;
  padding: 12px;
}

.price-tiers strong { display: block; margin-bottom: 4px; }

.price-tiers p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.admin-whitelist {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.admin-whitelist .field { margin: 0 0 10px; }

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.gate-quiet {
  background: #fff;
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 0 14px;
}

.gate-primary {
  background: var(--cube-orange);
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.social-links a {
  background: var(--cube-orange);
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 10px 14px;
  text-decoration: none;
}

.social-links a[hidden] { display: none; }

.nav-account {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  flex: none;
  font-size: 13px;
  max-width: 9.5em;
  min-height: 32px;
  overflow: hidden;
  padding: 0 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-account.is-in {
  border-color: var(--ink);
  font-weight: 750;
}

.account-switch {
  background: var(--paper);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
  padding: 4px;
}

.account-switch button {
  background: transparent;
  color: var(--muted);
  min-height: 36px;
}

.account-switch button.is-active {
  background: #fff;
  color: var(--ink);
}

.account-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 4px;
}

.account-perks span {
  background: var(--paper);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  padding: 5px 10px;
}

.account-steps {
  display: grid;
  gap: 8px;
}

.account-steps button {
  background: var(--paper);
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
}

.field[hidden],
#account-form[hidden],
#account-home[hidden] { display: none; }

#account-form .field { margin-top: 12px; }

.field .code-line {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
}

.code-line input { min-width: 0; }

.code-line button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  flex: none;
  min-width: 7.2em;
  padding: 0 12px;
}

#account-lead,
#account-home-lead {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.gate-note.is-error { color: #9d2b22; font-weight: 650; }

#preview-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.page {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.pills span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  padding: 5px 10px;
}

h1 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 650;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin: 0;
}

.lede {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  margin: 12px 0 0;
}

.workspace {
  display: grid;
  flex: 1;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 0;
}

.stage { grid-column: 2; grid-row: 1; }
.sheet { grid-column: 1; grid-row: 1; min-width: 0; }

.editor, .stage {
  background: var(--card);
  border: 0;
  border-radius: 0;
  min-width: 0;
}

.editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 16px;
}

.sheet-handle { display: none; }

.sheet-head {
  border-bottom: 1px solid var(--line);
  flex: none;
  padding: 12px 16px;
}

.sheet-head .uploads { margin-top: 0; }

.sheet-foot {
  border-top: 1px solid var(--line);
  flex: none;
  margin-top: 0;
  padding: 12px 16px;
}

.sheet-foot .actions { margin-top: 0; }

.sheet-foot .status {
  margin: 0 0 8px;
  max-height: 4.6em;
  min-height: 0;
  overflow: auto;
}

.sheet-foot .status:empty { display: none; }

.edit-hint {
  background: var(--cube-orange);
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(255, 90, 54, 0.22);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  margin: 2px 0 14px;
  max-width: 100%;
  padding: 10px 14px;
  position: relative;
  width: max-content;
}

.edit-hint::after {
  border-color: var(--cube-orange) transparent transparent;
  border-style: solid;
  border-width: 8px 8px 0;
  content: "";
  height: 0;
  left: 28px;
  position: absolute;
  top: 100%;
  width: 0;
}

.banner {
  background: #fff6f4;
  border: 1px solid #f0c7c1;
  border-radius: 12px;
  color: #7a2e26;
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}

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

legend {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.choices-wrap {
  min-width: 0;
  position: relative;
}

.choices {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  width: 100%;
}

.choices::-webkit-scrollbar { display: none; }

.choices-wrap::after {
  background: linear-gradient(90deg, rgba(255, 252, 248, 0), var(--card) 68%);
  bottom: 0;
  content: "";
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  width: 72px;
  z-index: 1;
}

.choices-wrap:has(.template-more[hidden])::after { content: none; }

.template-more {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 0;
  bottom: 0;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  gap: 1px;
  padding: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
}

.template-more-label {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.15;
}

.template-more svg { flex: none; }

.template-more[hidden] { display: none; }

.choice {
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex: 1 0 180px;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  position: relative;
}

.choice input {
  accent-color: var(--red);
  height: 1px;
  margin: 0;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.choice:has(input:checked) {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}

.choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

.mini {
  background: var(--paper);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  height: 72px;
  padding: 8px;
}

.mini i, .mini b {
  background: #d9d3c8;
  border-radius: 99px;
  display: block;
  height: 4px;
}

.mini i:first-child { background: var(--ink); width: 46%; }
.mini-standard i:nth-child(2) { width: 88%; }
.mini-standard i:nth-child(3) { width: 72%; }
.mini-standard i:nth-child(4) { width: 80%; }

.mini-dense { grid-template-columns: 1fr 1fr; }
.mini-dense i:first-child { grid-column: 1 / -1; }
.mini-dense i:nth-child(2) { width: 100%; }
.mini-dense i:nth-child(3) { width: 100%; }
.mini-dense i:nth-child(4) { grid-column: 1 / -1; width: 70%; }

.mini-research i:first-child { height: 8px; width: 62%; }
.mini-research b {
  background: #f0c7c1;
  height: 16px;
  width: 100%;
}

.choice-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-copy strong { font-size: 13px; font-weight: 700; }
.choice-copy small { color: var(--muted); font-size: 12px; }
.choice:has(input:checked) .choice-copy strong { color: var(--red); }

.modules { margin-top: 14px; position: relative; }

.module-bar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.module-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.module-title strong {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.module-title strong::before {
  background: var(--cube-orange);
  border-radius: 99px;
  content: "";
  display: inline-block;
  height: 8px;
  margin-right: 8px;
  vertical-align: 1px;
  width: 8px;
}

.module-title small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
}

.module-bar button,
.module-remove {
  background: transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  min-height: 28px;
  padding: 0 10px;
}

.module-bar button {
  border: 1px solid var(--line);
  color: var(--ink);
  flex: none;
}

.module-bar button:hover,
.module-remove:hover { color: var(--red); }

.module-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 6px 0 0;
}

.module-menu {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(20, 20, 20, 0.14);
  padding: 8px;
  position: fixed;
  z-index: 8;
}

.module-menu-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  max-height: min(220px, 40vh);
  overflow: auto;
}

.module-menu[hidden] { display: none; }

.module-option {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: flex;
  flex: none;
  font-size: 14px;
  font-weight: 650;
  gap: 6px;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 12px;
  width: auto;
}

.module-option svg { color: var(--muted); flex: none; }

.module-option:hover { background: var(--paper); }

.module-menu-list:empty::before {
  color: var(--muted);
  content: "模块都已添加";
  display: block;
  font-size: 13px;
  padding: 10px;
}

#module-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
#module-list:empty { display: none; }

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-tab {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  flex: none;
  font-size: 13px;
  font-weight: 650;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
}

.module-tab svg { color: var(--muted); flex: none; }

.module-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.module-tab.is-active svg { color: #fff; }

.module {
  background: transparent;
  border: 0;
  padding: 0;
  position: relative;
}

.module textarea,
.module.is-line input {
  font-size: 14px;
  line-height: 1.55;
  margin-top: 0;
  padding-right: 64px;
}

.module textarea {
  min-height: 88px;
  resize: vertical;
}

.module.is-line {
  flex: none;
}

.module.is-line input {
  min-height: 44px;
}

.module.is-line .module-remove {
  top: 50%;
  transform: translateY(-50%);
}

.module .module-remove {
  background: #fff;
  margin: 0;
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 1;
}

.field { display: block; margin-top: 14px; }

.field span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

input[type="text"], input[type="password"], input[type="email"], input[type="tel"], textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  padding: 12px;
  width: 100%;
}

textarea { line-height: 1.55; resize: vertical; }

input:focus, textarea:focus { border-color: var(--ink); }

input::placeholder, textarea::placeholder { color: #b0aaa2; }

.uploads {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.upload {
  align-items: center;
  border: 0;
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 64px;
  min-width: 0;
  overflow: hidden;
  padding: 10px 12px;
  position: relative;
  text-align: left;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.upload-resume {
  background: var(--cube-orange);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 16px rgba(255, 90, 54, 0.28);
}

.upload-photo {
  background: var(--cube-blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 8px 16px rgba(59, 109, 255, 0.26);
}

.upload:hover { filter: brightness(1.05); transform: translateY(-1px); }
.upload:active { filter: brightness(0.97); transform: translateY(0); }

.upload:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.upload-mark {
  align-items: center;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  display: flex;
  flex: none;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.upload-mark svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.upload .mark-done { display: none; }

.upload.has-file .mark-idle { display: none; }
.upload.has-file .mark-done { display: block; }

.upload-resume.has-file .upload-mark { background: #fff; color: var(--cube-orange); }
.upload-photo.has-file .upload-mark { background: #fff; color: var(--cube-blue); }

.upload-copy {
  flex: 1;
  min-width: 0;
}

.upload-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.upload-copy small {
  display: block;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
  margin-top: 3px;
  opacity: 0.92;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled { cursor: not-allowed; opacity: 0.4; }

#submit-button {
  background: var(--ink);
  color: #fff;
  flex: 1.4;
  font-size: 16px;
  min-height: 48px;
  padding: 0 18px;
}

#submit-button:hover { background: var(--red); }

#export-button {
  background: #fff;
  border: 1px solid var(--ink);
  color: var(--ink);
  flex: 1;
  min-height: 48px;
  padding: 0 16px;
}

.status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 12px 0 0;
  min-height: 1.4em;
  overflow-wrap: anywhere;
}

.status.is-error { color: #9d2b22; font-weight: 650; }

.stage {
  background: #e7e3db;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#preview-export {
  background: var(--ink);
  border-radius: 999px;
  color: #fff;
  flex: none;
  font-size: 13px;
  min-height: 32px;
  padding: 0 12px;
}

#preview-export:hover { background: var(--red); }

.sheet-empty {
  margin: 16px;
  padding: 28px 8px;
  text-align: center;
}

.sheet-empty p {
  font-size: 22px;
  font-weight: 650;
  margin: 0;
}

.sheet-empty small {
  color: var(--muted);
  display: block;
  margin-top: 8px;
}

.stage.is-ready .sheet-empty { display: none; }

.zoom-bar {
  align-items: center;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  background: rgba(255, 252, 248, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  bottom: 14px;
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.1);
  display: flex;
  gap: 2px;
  left: 50%;
  padding: 4px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 3;
}

.zoom-bar button {
  background: transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  height: 32px;
  min-width: 36px;
  padding: 0 10px;
}

.zoom-bar button:hover { background: var(--paper); }

#zoom-fit {
  color: var(--muted);
  min-width: 64px;
}

.stage.is-loading .zoom-bar { visibility: hidden; }

@media (min-width: 981px) {
  .sheet-head { padding: 10px 14px; }
  .sheet-foot { padding: 10px 14px; }

  .upload {
    min-height: 58px;
    padding: 8px 12px;
  }

  .upload-copy strong { font-size: 14px; }

  .sheet-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 12px 14px;
  }

  .sheet-body fieldset,
  .sheet-body .field:not(.grow):not(.note),
  .banner { flex: none; }

  legend { margin-bottom: 6px; }

  .choice {
    gap: 6px;
    padding: 6px;
  }

  .mini { height: 40px; padding: 6px; }

  .choice-copy strong { font-size: 12px; }
  .choice-copy small { font-size: 11px; }

  .field { margin-top: 0; }
  .field span { margin-bottom: 4px; }

  .modules {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin-top: 4px;
    min-height: 0;
  }

  #module-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin-top: 8px;
    min-height: 0;
  }

  .module {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 0;
  }

  .module textarea {
    flex: 1;
    height: auto;
    min-height: 0;
    resize: none;
  }

  .module-hint { margin-top: 2px; }

  .field.grow,
  .field.note {
    display: flex;
    flex: none;
    flex-direction: column;
  }

  .field.grow textarea,
  .field.note textarea {
    font-size: 14px;
    line-height: 1.45;
    padding: 8px 10px;
    resize: vertical;
  }

  .field.grow textarea { height: 132px; min-height: 96px; }
  .field.note textarea { height: 48px; min-height: 40px; }

  .sheet-body input[type="text"] {
    font-size: 14px;
    padding: 8px 10px;
  }

  .banner {
    margin: 0;
    max-height: 4.4em;
    overflow: auto;
    padding: 8px 10px;
  }

  #submit-button,
  #export-button { min-height: 42px; }

  .preview-fit { overflow: hidden; }
}

.preview-fit {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.preview-scale {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

iframe {
  background: #fff;
  border: 0;
  display: none;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.stage.is-ready iframe { display: block; }

.loading {
  align-items: center;
  background: var(--card);
  display: none;
  flex-direction: column;
  gap: 8px;
  inset: 0;
  justify-content: center;
  padding: 0 28px;
  position: absolute;
  text-align: center;
  z-index: 2;
}

.stage.is-loading .loading { display: flex; }
.stage.is-loading iframe { visibility: hidden; }

.loading p {
  font-size: 18px;
  font-weight: 650;
  margin: 8px 0 0;
}

.loading small { color: var(--muted); }

.spinner {
  animation: spin 0.8s linear infinite;
  border: 2px solid var(--line);
  border-radius: 50%;
  border-top-color: var(--red);
  height: 28px;
  width: 28px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }

  body {
    inset: 0;
    position: fixed;
    width: 100%;
  }

  .nav {
    backdrop-filter: blur(10px);
    background: rgba(255, 252, 248, 0.94);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(20, 20, 20, 0.08);
    flex-wrap: nowrap;
    gap: 10px;
    left: 10px;
    margin: 0;
    max-width: none;
    padding: 8px 12px;
    position: fixed;
    right: 10px;
    top: max(8px, env(safe-area-inset-top));
    z-index: 6;
  }

  .brand { flex: none; }
  .brand-name { font-size: 22px; }

  .nav-account { font-size: 12px; max-width: 7.2em; padding: 0 10px; }

  #preview-note {
    font-size: 12px;
    white-space: nowrap;
  }

  #preview-note, #preview-export { flex: none; }

  .page { padding: 0; }

  .workspace {
    display: block;
    margin: 0;
  }

  .stage {
    background: #e7e3db;
    border: 0;
    border-radius: 0;
    bottom: 0;
    left: 0;
    min-height: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1;
  }

  .zoom-bar {
    bottom: auto;
    left: auto;
    position: fixed;
    right: 10px;
    top: calc(62px + env(safe-area-inset-top));
    transform: none;
    z-index: 7;
  }

  .preview-fit {
    background: #e7e3db;
    bottom: calc(36px + env(safe-area-inset-bottom));
    left: 0;
    overflow: auto;
    position: absolute;
    right: 0;
    top: calc(52px + env(safe-area-inset-top));
  }

  .preview-scale { display: block; flex: none; }

  iframe, .stage.is-ready iframe {
    display: block;
    max-width: none;
  }

  .loading {
    justify-content: flex-start;
    padding-top: 36px;
  }

  .sheet {
    background: var(--card);
    border: 0;
    border-radius: 22px 22px 0 0;
    bottom: 0;
    box-shadow: 0 -12px 40px rgba(20, 20, 20, 0.16);
    display: flex;
    flex-direction: column;
    height: auto;
    left: 0;
    max-height: calc(100dvh - 72px - env(safe-area-inset-top));
    overflow: hidden;
    position: fixed;
    right: 0;
    z-index: 5;
  }

  .sheet.is-collapsed { height: calc(36px + env(safe-area-inset-bottom)); }

  .sheet-handle {
    align-items: center;
    appearance: none;
    background: transparent;
    border-radius: 0;
    color: var(--muted);
    display: flex;
    flex: none;
    flex-direction: column;
    font-size: 11px;
    font-weight: 650;
    gap: 2px;
    height: 32px;
    justify-content: center;
    padding: 0;
    touch-action: none;
    width: 100%;
  }

  .sheet-handle:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: -4px;
  }

  .grabber {
    background: #c8c2b8;
    border-radius: 99px;
    display: block;
    height: 4px;
    width: 36px;
  }

  .sheet-handle:active .grabber { background: #9a948c; }

  .sheet-handle .when-closed { display: none; }
  .sheet.is-collapsed .sheet-handle .when-open { display: none; }
  .sheet.is-collapsed .sheet-handle .when-closed { display: block; }

  .sheet.is-dragging { user-select: none; }
  .sheet.is-dragging .sheet-handle { cursor: grabbing; }

  .editor {
    background: transparent;
    border: 0;
    border-radius: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0;
  }

  .sheet-head,
  .sheet-foot { flex: none; }

  .sheet-head {
    padding: 0 12px 8px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .sheet-head .uploads { gap: 8px; }

  .sheet-head .upload {
    border-radius: 14px;
    gap: 8px;
    min-height: 56px;
    padding: 8px 10px;
  }

  .sheet-head .upload-mark {
    border-radius: 10px;
    height: 32px;
    width: 32px;
  }

  .sheet-head .upload-copy strong { font-size: 14px; }
  .sheet-head .upload-copy small { font-size: 11px; }

  .sheet-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 8px 12px 10px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .sheet-body legend { font-size: 12px; margin-bottom: 6px; }
  .sheet-body .choices { gap: 8px; }
  .sheet-body .choice {
    align-items: stretch;
    background: #fff;
    border-radius: 12px;
    gap: 6px;
    padding: 6px 6px 8px;
  }
  .sheet-body .choice:has(input:checked) { background: var(--brand-soft); }
  .sheet-body .mini {
    align-content: center;
    height: 34px;
    overflow: hidden;
    padding: 6px;
    gap: 3px;
  }
  .sheet-body .mini i,
  .sheet-body .mini b { height: 3px; }
  .sheet-body .mini-research i:first-child { height: 4px; }
  .sheet-body .mini-research b { height: 10px; }
  .sheet-body .choice-copy { align-items: center; text-align: center; }
  .sheet-body .choice-copy strong { font-size: 12px; font-weight: 650; line-height: 1.25; }
  .sheet-body .choice-copy small { display: none; }
  .sheet-body .field { margin-top: 8px; }
  .sheet-body .field span { font-size: 12px; margin-bottom: 4px; }
  .sheet-body input,
  .sheet-body textarea { padding: 7px 10px; }
  .sheet-body textarea { resize: none; }
  .sheet-body textarea[name="source"] { height: 68px; }
  .sheet-body textarea[name="instruction"] { height: 40px; }

  .sheet-foot {
    border-top: 1px solid var(--line);
    margin-top: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .sheet-foot button { font-size: 15px; min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none !important; }
  .upload { transition: none; }
}
