/* Shared tokens and accessible primitives */
:root {
  --ink: #283747;
  --muted: #718094;
  --quiet: #8b99ab;
  --blue: #2366e8;
  --blue-light: #edf3ff;
  --line: #e6eaf0;
  --paper: #fff;
  --back: #f6f8fb;
  --yellow: #f4d975;
  --radius: 18px;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--back);
  font-size: 14px;
  line-height: 1.5;
}
body:has(dialog[open]) {
  overflow: hidden;
}
button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #91b8ff;
  outline-offset: 4px;
}
textarea,
input,
select {
  min-width: 0;
}
textarea {
  resize: vertical;
}
textarea:focus,
input:focus,
select:focus {
  outline: 2px solid #91b8ff;
  outline-offset: 2px;
}
.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Site frame */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--back);
  height: 100px;
  max-width: 1280px;
  margin: auto;
  padding: 0 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand strong {
  font-size: 28px;
  letter-spacing: 3px;
  font-weight: 780;
}
.brand-mark {
  width: 24px;
  height: 29px;
  display: grid;
  place-items: center;
  position: relative;
  border: 1.8px solid var(--blue);
  border-radius: 3px;
  transform: rotate(-7deg);
  color: var(--blue);
}
.brand-mark::after {
  content: '';
  position: absolute;
  right: -4px;
  top: -4px;
  width: 9px;
  height: 6px;
  background: var(--yellow);
}
.brand-mark svg {
  width: 17px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.brand-sub {
  margin-left: 7px;
  padding-left: 17px;
  border-left: 1px solid #d6dee7;
  color: var(--quiet);
  font-size: 12px;
  letter-spacing: 1px;
}
.site-header nav,
.header-actions {
  display: flex;
  align-items: center;
  gap: 26px;
}
.text-button,
.header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  color: #69798a;
  font-size: 12px;
}
.text-button:hover,
.header-link:hover {
  color: var(--blue);
}
.text-button span {
  font-size: 15px;
}
.site-header .text-button,
.header-link {
  min-height: 44px;
}
.header-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 7px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #c5d6ee;
  border-radius: 8px;
  background: #fff;
  color: #3568ad;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.header-create:hover {
  background: #edf3ff;
  border-color: #abc3e6;
}
.header-create .icon {
  width: 16px;
  height: 16px;
}
.header-auth-button {
  min-height: 42px;
  padding: 9px 20px;
  border: 1px solid #d4dfef;
  border-radius: 999px;
  background: var(--paper);
  color: #3d618e;
  font-size: 13px;
  font-weight: 550;
}
.header-auth-button:hover:not(:disabled) {
  border-color: #9fbae0;
  background: var(--blue-light);
}
.header-auth-button.is-authenticated {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-color: #d8e4f5;
  background: var(--blue-light);
  color: #4479c7;
}
.header-auth-button.is-authenticated:hover {
  border-color: #9fbae0;
  background: #e3edff;
}
#login-avatar {
  display: flex;
}
#login-avatar .icon {
  width: 21px;
  height: 21px;
}
.mobile-help {
  display: none;
}
.workspace {
  width: min(1160px, calc(100% - 96px));
  margin: 28px auto 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 480px);
  gap: 80px;
  align-items: start;
}
.intro-column {
  min-width: 0;
  padding-top: 15px;
}
/* A quiet first step; the editor appears only after a photo is selected. */
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.3px;
  color: #7f8ea0;
}
.landing {
  display: grid;
  place-items: center;
  width: min(560px, calc(100% - 40px));
  min-height: calc(100svh - 210px);
  margin: 0 auto;
  padding: 64px 0 80px;
  text-align: center;
}
.landing-inner {
  width: 100%;
}
.landing-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.2px;
}
.landing-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
}
.landing-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 192px;
  min-height: 58px;
  padding: 13px 34px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 21px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s;
}
.landing-upload:hover {
  background: #1a56c9;
}
.landing-drag-hint {
  margin: 24px 0 0;
  color: #5e7085;
  font-size: 17px;
  font-weight: 550;
}
.landing-upload[aria-busy='true'],
.landing-upload[aria-disabled='true'] {
  background: #6488d5;
  box-shadow: none;
  cursor: wait;
}
.landing-upload-hint {
  margin: 15px 0 0;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.8;
}
.landing-upload-hint kbd {
  display: inline-block;
  margin-left: 5px;
  padding: 0 4px;
  border: 1px solid #e0e4e7;
  border-radius: 3px;
  color: #6e7a86;
  font: inherit;
  line-height: 17px;
}
.mobile-upload-hint {
  display: none;
}
.photo-guidance {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 40px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.photo-guidance > summary {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  list-style: none;
  cursor: pointer;
}
.photo-guidance > summary::-webkit-details-marker {
  display: none;
}
.photo-guidance > summary .icon {
  width: 12px;
  height: 12px;
  transform: rotate(90deg);
}
.photo-guidance[open] > summary .icon {
  transform: rotate(-90deg);
}
.photo-guidance > summary:hover {
  color: var(--blue);
}
.photo-guidance-content {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  line-height: 1.8;
}
.photo-guidance[open] {
  width: 100%;
}
.photo-guidance-content strong {
  display: block;
  color: #35414d;
  font-size: 13px;
  font-weight: 600;
}
.photo-guidance-content p {
  margin: 5px 0 16px;
}
.photo-guidance-content p:last-child {
  margin-bottom: 0;
}
.landing-status,
.landing-inner > .field-error {
  margin: 18px 0 0;
  color: #637c9e;
  font-size: 12px;
}
.landing-drop-cover {
  position: fixed;
  inset: 12px;
  z-index: 9;
  display: none;
  place-content: center;
  border: 2px solid #4e81e8;
  border-radius: 20px;
  background: #fbfdff;
  color: #242832;
  text-align: center;
  pointer-events: none;
}
body[data-view='landing'].file-dragging .landing-drop-cover {
  display: grid;
}
.landing-drop-cover strong {
  font-size: 30px;
  font-weight: 550;
}
.landing-drop-cover span {
  margin-top: 15px;
  color: #8793a7;
  font-size: 14px;
}
.landing-footer-brand,
.landing-footer-delivery {
  display: none;
}
body[data-view='landing'] .about-details {
  display: none;
}
body[data-view='landing'] footer {
  width: min(1160px, calc(100% - 96px));
  max-width: none;
  margin: 0 auto;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  color: var(--quiet);
  font-size: 11px;
}
body[data-view='landing'] footer > :not(.landing-footer-brand):not(.landing-footer-delivery) {
  display: none;
}
body[data-view='landing'] .landing-footer-brand,
body[data-view='landing'] .landing-footer-delivery {
  display: inline;
}
.landing-footer-brand {
  letter-spacing: 0.8px;
}
.landing-footer-delivery {
  color: #9299a4;
}
body[data-view='landing'] .toast {
  bottom: 25px;
}

/* The user's photograph stays in one place throughout the workflow. */
.source-stage {
  padding-top: 3px;
}
.source-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.source-heading h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.source-heading button {
  min-height: 44px;
  color: #5e7897;
  font-size: 12px;
}
.source-heading button:hover {
  color: var(--blue);
}
.source-canvas {
  display: flex;
  width: 100%;
  cursor: zoom-in;
  align-items: center;
  justify-content: center;
  min-height: 390px;
  padding: 28px 24px;
}
.source-canvas img {
  display: block;
  max-width: 100%;
  max-height: 348px;
  border-radius: 2px;
  object-fit: contain;
  box-shadow: 0 8px 25px #253d5510;
}
.source-caption {
  margin: 4px 0 0;
  color: #8594a6;
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
  text-wrap: balance;
}

/* Creation form */
.creation-card {
  scroll-margin-top: 120px;
  padding: 27px 30px 21px;
  background: var(--paper);
  border: 1px solid #e9edf2;
  border-radius: var(--radius);
  box-shadow:
    0 12px 52px #3447600a,
    0 1px 3px #23395208;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.card-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.step-label {
  display: block;
  margin-bottom: 5px;
  color: #8b9aae;
  font-size: 11px;
  letter-spacing: 1px;
}
.editor-summary > h2,
.editor-summary h2 {
  margin: 0 0 23px;
  font-size: 18px;
  font-weight: 600;
}
.editor-summary dl {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px 18px;
  margin: 0 0 27px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
}
.editor-summary dt {
  color: #7c8da1;
}
.editor-summary dd {
  margin: 0;
  color: #344b65;
  overflow-wrap: anywhere;
}
.editor-summary > p {
  color: #8a98a9;
  font-size: 12px;
  line-height: 1.8;
}
.completed-source {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 25px;
  color: #8092a8;
  font-size: 11px;
}
.completed-source > span {
  flex: 1;
}
.completed-source > button {
  white-space: nowrap;
  font-size: 11px;
}
#completed-source {
  width: 32px;
  height: 43px;
  border-radius: 3px;
  object-fit: cover;
}
.editor-source-recovery {
  margin: 17px 0;
  padding: 12px 15px;
  border-radius: 8px;
  background: #f4f7fc;
  color: #69809c;
  font-size: 12px;
}
.editor-source-recovery p {
  margin: 0 0 5px;
}
#edit-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  border: 1px solid #d6e1ef;
  border-radius: 8px;
  color: #456791;
  background: #f9fbff;
  font-size: 13px;
  font-weight: 550;
}
#edit-result:hover {
  border-color: #aec8eb;
  background: var(--blue-light);
}
#edit-back {
  min-height: 44px;
  color: #6d829b;
  font-size: 12px;
}
#editor-fields > .requirements-heading {
  margin-top: 21px;
}
.requirements-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0 8px;
}
.requirements-heading label {
  font-size: 13px;
  font-weight: 550;
}
.requirements-heading > span {
  font-size: 11px;
  color: #8895a5;
}
.composer {
  overflow: hidden;
  border: 1px solid #dfe5ed;
  border-radius: 10px;
  background: var(--paper);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.composer:focus-within,
.composer.dragging {
  border-color: #86aef7;
  box-shadow: 0 0 0 3px #2366e808;
}
.composer textarea {
  display: block;
  width: 100%;
  min-height: 101px;
  max-height: 240px;
  padding: 14px 15px 6px;
  border: 0;
  background: transparent;
  color: #33485f;
  font-size: 14px;
  line-height: 1.8;
}
.composer textarea:focus {
  outline: none;
}
.composer textarea::placeholder {
  color: #98a5b6;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.8;
  opacity: 1;
}
.composer:focus-within textarea::placeholder {
  color: #8999ad;
}
.composer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px 6px;
}
.attach-button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 0;
  color: #8393a9;
  font-size: 11px;
  font-weight: 400;
}
.attach-button:hover,
.attach-button:focus-visible {
  color: #3769b2;
}
.attach-button .icon {
  width: 16px;
  height: 16px;
}
.composer-tools > span {
  color: #8997a8;
  font-size: 11px;
}
.composer-tools .composer-format {
  color: #91a0b2;
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}
.composer:focus-within .composer-format,
.composer.dragging .composer-format {
  opacity: 1;
}
.field-help {
  position: relative;
  z-index: 6;
  margin-left: auto;
  font-weight: 400;
}
.field-help > summary {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 0 4px 9px;
  list-style: none;
  cursor: pointer;
  color: #93a0b1;
  font-size: 11px;
  user-select: none;
}
.field-help > summary::-webkit-details-marker,
.about-details > summary::-webkit-details-marker {
  display: none;
}
.field-help > summary:hover,
.field-help[open] > summary,
.field-help > summary:focus-visible {
  color: #6284b2;
}
.info-mark {
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font:
    9px/1 Georgia,
    serif;
}
.field-help-content {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 292px;
  max-width: calc(100vw - 72px);
  padding: 15px 16px;
  border: 1px solid #e1e7ef;
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 8px 25px #203d6212;
  color: #65778f;
  font-size: 12px;
  line-height: 1.85;
}
.field-help-content strong {
  color: #4a627e;
  font-size: 12px;
  font-weight: 550;
}
.field-help-content p {
  margin: 7px 0 0;
}
.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 12px 8px;
}
.attachment {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 5px 4px 6px;
  border: 1px solid #e0e8f1;
  border-radius: 5px;
  background: #f7f9fc;
}
.attachment > img {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 2px;
}
.attachment > span {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.attachment .icon {
  width: 14px;
  height: 14px;
}
.attachment > button {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  padding: 3px;
  color: #7e8da1;
}

/* Explicit specifications and optional styling */
.quick-options {
  display: grid;
  gap: 9px;
  margin: 17px 0 16px;
}
.option-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 40px;
}
.field-label {
  min-width: 28px;
  color: #6d7e91;
  font-size: 13px;
}
.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  min-height: 38px;
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f5f7fa;
  color: #617083;
  font-size: 13px;
  line-height: 20px;
}
.chip:hover {
  background: #edf2fb;
}
.chip.selected {
  border-color: #c6d9fb;
  background: var(--blue-light);
  color: #2c64c6;
}
.chip.derived {
  border-color: #bdcde3;
  border-style: dashed;
  background: #f7faff;
}
.color-options {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 2px;
}
.color-auto {
  min-width: 68px;
  min-height: 40px;
  margin-right: 2px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #7e8c9e;
  font-size: 12px;
  line-height: 24px;
}
.color-auto.selected {
  border-color: #c6d9fb;
  background: var(--blue-light);
  color: #2c64c6;
}
.swatch {
  position: relative;
  width: 39px;
  min-width: 39px;
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  transition: transform 0.15s;
}
.swatch:hover {
  transform: translateY(-2px);
}
.swatch::before {
  content: '';
  position: absolute;
  inset: 10px 7px;
  border: 1px solid #0000000d;
  border-radius: 50%;
  background: var(--swatch-color);
}
.swatch.white {
  --swatch-color: #fff;
}
.swatch.blue {
  --swatch-color: #438edb;
}
.swatch.lightblue {
  --swatch-color: #64c5ff;
}
.swatch.red {
  --swatch-color: #dc565a;
}
.swatch.gray {
  --swatch-color: #e5e8eb;
}
.swatch.white::before {
  border-color: #cdd6e0;
}
.swatch.selected::before {
  outline: 1.5px solid #7790b1;
  outline-offset: 3px;
}
.swatch.selected::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 14px;
}
.swatch.white.selected::after,
.swatch.gray.selected::after {
  color: #527095;
}
.swatch.derived::before {
  outline: 1px dashed #8aa4c2;
  outline-offset: 3px;
}
.color-name {
  min-width: 24px;
  color: #708398;
  font-size: 11px;
}
.custom-size {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 42px;
  color: #7d8b9d;
  font-size: 12px;
}
.custom-size label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.custom-size input,
.custom-size select {
  padding: 6px;
  border: 1px solid #dce3ec;
  border-radius: 5px;
  background: var(--paper);
}
.custom-size input {
  width: 70px;
  appearance: textfield;
}
.appearance-options {
  margin: 19px 0 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.appearance-options > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 53px;
  list-style: none;
  cursor: pointer;
  color: #62758d;
  font-size: 12px;
}
.appearance-options > summary::-webkit-details-marker {
  display: none;
}
.appearance-options > summary > .icon {
  width: 13px;
  height: 13px;
  margin-left: 5px;
  color: #879bb5;
  transform: rotate(90deg);
}
.appearance-options[open] > summary > .icon {
  transform: rotate(-90deg);
}
.appearance-label {
  color: #3c536d;
  font-size: 13px;
  font-weight: 550;
}
.appearance-label > span,
.appearance-label small,
.appearance-options > summary > small {
  margin-left: 5px;
  color: #8796a8;
  font-size: 11px;
  font-weight: 400;
}
#appearance-value {
  margin-left: auto;
  color: #8494a7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.appearance-options:has(.is-customized) #appearance-value {
  color: #4c76ad;
}
.style-options {
  display: flex;
  align-items: center;
  margin: 0 0 9px;
  padding: 0 0 6px;
}
.style-entry {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 3px 4px;
  text-align: left;
}
.style-entry:hover .style-text strong {
  color: var(--blue);
}
.style-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 32px;
  flex-shrink: 0;
  color: #7d90a7;
}
.style-icon .icon {
  width: 21px;
  height: 21px;
}
.style-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.style-text > strong {
  font-size: 13px;
  font-weight: 550;
}
.style-text > span {
  max-width: 143px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #98a4b5;
  font-size: 11px;
  font-weight: 400;
}
.style-text > span.is-customized {
  color: #54779e;
  font-weight: 500;
}
.chevron {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: #a7b1be;
}
.style-separator {
  width: 1px;
  height: 28px;
  flex-shrink: 0;
  margin: 0 14px;
  background: #e8edf3;
}
.spec-summary {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 0 13px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #f7f9fc;
  color: #5b7290;
  font-size: 12px;
  line-height: 1.7;
}
.summary-label {
  padding-top: 1px;
  color: #93a0b1;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}
.spec-summary #parsed-text {
  color: #516c8b;
}
.spec-summary.needs-input {
  background: #fbf8f3;
}
.spec-summary.needs-input #parsed-text {
  color: #8b7662;
}
.parsed-summary {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-top: 9px;
  color: #658368;
  font-size: 11px;
}
.parsed-summary > .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}
.material-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 5px;
  background: #faf8f4;
  color: #8a7965;
  font-size: 11px;
  line-height: 1.7;
}
.field-error,
.form-feedback,
.auth-error {
  margin: 8px 0;
  color: #a34e3d;
  font-size: 12px;
  line-height: 1.8;
}
.form-feedback {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 6px;
  background: #fff8f5;
  scroll-margin: 40px;
}
.conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.conflict-actions .chip {
  border-color: #edd9d2;
  background: white;
  font-size: 11px;
}

/* Primary and secondary actions */
.button,
.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 48px;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition:
    background 0.15s,
    transform 0.15s;
}
.button.primary,
.button-primary {
  background: var(--blue);
  color: white;
}
.button.primary:hover,
.button-primary:hover {
  background: #1a56c9;
}
.button.primary:active,
.button-primary:active {
  transform: translateY(1px);
}
.button.primary:disabled,
.button-primary:disabled {
  opacity: 0.7;
}
.button.secondary,
.button-secondary {
  min-height: 44px;
  padding: 9px 18px;
  border-color: #dce4ee;
  background: var(--paper);
  color: #526d91;
  font-size: 13px;
}
.button.secondary:hover,
.button-secondary:hover {
  background: var(--blue-light);
}
.submit-area > .button {
  width: 100%;
  height: 49px;
}
.submit-area > .button .icon {
  width: 19px;
  height: 19px;
}
.submit-area > .button.unchanged {
  border: 1px solid #d7e2f1;
  background: #edf3fc;
  color: #3d64a3;
}
.submit-area > .button.unchanged:hover {
  background: #e3edfb;
}
.submit-note {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 15px;
  margin-top: 10px;
  color: #a0acbb;
  font-size: 10px;
}
.elapsed {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.working .submit-note,
.processing .submit-note {
  color: #7e90a7;
}
.working .submit-area > .button,
.processing .submit-area > .button {
  background: #4680eb;
}
.working .submit-area .icon,
.processing .button.primary .icon {
  animation: arrow-pulse 1.6s ease-in-out infinite;
}

/* Completed work and live progress */
.workspace.has-result .intro-column {
  padding-top: 19px;
}
.result-area {
  min-width: 0;
  scroll-margin: 120px 0 24px;
}
.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.result-heading h2 {
  margin: 5px 0;
  font-size: 27px;
  letter-spacing: -0.5px;
}
.outline-badge {
  padding: 3px 7px;
  border: 1px solid #dbe2eb;
  border-radius: 4px;
  color: #7e8fa2;
  font-size: 10px;
  white-space: nowrap;
}
.outline-badge.dirty {
  border-color: #eadcab;
  background: #fff9e9;
  color: #9a7c37;
}
.output-switch {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.output-switch button {
  min-height: 44px;
  padding: 10px 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: #71839a;
  font-size: 13px;
}
.output-switch button[aria-pressed='true'] {
  border-bottom-color: var(--blue);
  color: var(--ink);
  font-weight: 600;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 42px;
  gap: 0 8px;
  color: #6e8197;
  font-size: 12px;
}
.preview-toolbar .text-button {
  min-height: 42px;
  padding: 8px 0 8px 8px;
  color: #365d96;
  font-size: 12px;
}
.result-stage {
  --preview-height: 336px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 368px;
  padding: 16px;
  border-radius: 0;
  background: transparent;
  cursor: zoom-in;
}
.result-stage:disabled {
  opacity: 1;
  cursor: wait;
}
.result-stage[aria-busy='false']:has(.preview-message:not([hidden])) {
  cursor: pointer;
}
.photo-mount {
  --preview-ratio: 0.7142857;
  display: block;
  width: min(100%, calc(var(--preview-height) * var(--preview-ratio)));
  flex: none;
  aspect-ratio: var(--preview-ratio);
  background: var(--paper);
  box-shadow:
    0 0 0 1px #253d5512,
    0 10px 24px #253d5510;
}
.photo-mount > img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.result-stage[data-view='actual'] .photo-mount {
  width: min(var(--file-width, 144px), 100%, calc(var(--preview-height) * var(--preview-ratio)));
}
.preview-caption {
  margin: 5px 0 22px;
  color: #718094;
  font-size: 12px;
  text-align: center;
  text-wrap: balance;
}
.preview-message {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.stage-caption {
  position: absolute;
  right: 16px;
  bottom: 13px;
  left: 16px;
  color: #8496ad;
  font-size: 10px;
  text-align: center;
}
.stage-corner {
  position: absolute;
  width: 17px;
  height: 17px;
  border-color: #bac8d9;
  border-style: solid;
}
.top-left {
  top: 23px;
  left: 23px;
  border-width: 1px 0 0 1px;
}
.bottom-right {
  right: 23px;
  bottom: 23px;
  border-width: 0 1px 1px 0;
}
.result-specs,
.result-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 15px 0 19px;
  color: #6e8197;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.result-specs {
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-bottom: 12px;
}
.result-specs strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
}
.result-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.result-styles {
  margin: -5px 0 18px;
  color: #8091a4;
  font-size: 12px;
}
.result-dirty-note {
  margin: 8px 0 18px;
  padding-left: 9px;
  border-left: 2px solid #e2c671;
  color: #907948;
  font-size: 12px;
}
.result-actions,
.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.result-actions .icon {
  width: 16px;
  height: 16px;
}
.result-actions .text-button {
  min-height: 44px;
  font-size: 13px;
}
.result-downloads {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 15px 0;
}
.result-downloads > a {
  min-width: 0;
  padding-right: 12px;
  padding-left: 12px;
  font-size: 13px;
}
.download-more {
  position: relative;
}
.download-more summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 49px;
  padding: 12px 15px;
  border: 1px solid #d6e1ee;
  border-radius: 8px;
  background: var(--paper);
  color: #486891;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}
.download-more summary::-webkit-details-marker {
  display: none;
}
.download-more summary .icon {
  width: 12px;
  height: 12px;
  transform: rotate(90deg);
}
.download-more[open] summary .icon {
  transform: rotate(-90deg);
}
.download-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 3;
  width: 180px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 10px 30px #263e551a;
}
.download-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #486891;
  font-size: 13px;
}
.download-menu a:hover {
  background: var(--blue-light);
}
.result-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 370px;
  padding: 32px 24px;
  border-radius: 12px;
  background: #f0f4fa;
  text-align: center;
}
.progress-art {
  position: relative;
  width: 62px;
  height: 76px;
  margin-bottom: 12px;
}
.progress-art span {
  position: absolute;
  top: 6px;
  left: 11px;
  width: 40px;
  height: 56px;
  border: 1px solid #bdcce0;
  border-radius: 3px;
  background: #f9fbff;
}
.progress-art span:first-child {
  transform: translate(-7px, 5px) rotate(-7deg);
  opacity: 0.5;
}
.progress-art span:nth-child(2) {
  transform: translate(7px, 5px) rotate(7deg);
  opacity: 0.5;
}
.progress-art span:nth-child(3) {
  border-color: #8ca9cf;
  animation: photo-pulse 2.4s ease-in-out infinite;
}
.progress-art span:nth-child(3)::after {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid #d7e1ee;
  background: #eef3fa;
}
#progress-source {
  position: absolute;
  top: 10px;
  left: 15px;
  width: 32px;
  height: 48px;
  border-radius: 1px;
  object-fit: cover;
}
.result-progress strong {
  font-size: 17px;
  font-weight: 550;
}
.result-progress p {
  max-width: 290px;
  margin: 0;
  color: #71849b;
  font-size: 12px;
  line-height: 1.8;
}
.result-progress .elapsed {
  color: #8c9caf;
  font-size: 11px;
}
.result-progress .result-toolbar {
  margin-top: 9px;
  gap: 24px;
}
.result-progress #cancel-job {
  color: #7e8ea1;
  font-size: 11px;
}
#upload-progress {
  width: 190px;
  height: 4px;
  margin: 4px 0;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #dce6f4;
  accent-color: #5186db;
}
#upload-progress::-webkit-progress-bar {
  background: #dce6f4;
}
#upload-progress::-webkit-progress-value {
  background: #5186db;
  border-radius: 5px;
}
#upload-progress::-moz-progress-bar {
  background: #5186db;
}
.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: 360px;
  padding: 0;
  margin: 21px 0 0;
  list-style: none;
}
.progress-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #8593a5;
}
.progress-steps li + li::before {
  content: '';
  position: absolute;
  top: 10px;
  right: calc(50% + 17px);
  width: calc(100% - 34px);
  height: 1px;
  background: #d8e1ed;
}
.progress-steps li > span {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid #d5dfed;
  border-radius: 50%;
  font-size: 10px;
  background: #f7f9fc;
}
.progress-steps li.is-current {
  color: #3265aa;
}
.progress-steps li.is-current > span {
  border-color: #557eb8;
  color: white;
  background: #557eb8;
  box-shadow: 0 0 0 4px #dfe9f7;
}
.progress-steps li.is-done > span {
  color: #5276a7;
  background: #e3ecf8;
  border-color: #d0dff2;
}
.new-photo-dialog {
  width: min(440px, calc(100% - 28px));
}
.new-photo-choices {
  display: grid;
  gap: 12px;
}
.new-photo-choices > button {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 86px;
  padding: 17px;
  border: 1px solid #dce5f1;
  border-radius: 10px;
  background: #fafcff;
  text-align: left;
}
.new-photo-choices > button:hover {
  background: #f1f6fd;
  border-color: #aac4e6;
}
.new-photo-choices > button > .icon {
  width: 21px;
  height: 21px;
  color: #698bb5;
  flex: none;
}
.new-photo-choices > button > .icon:last-child {
  width: 14px;
  height: 14px;
  margin-left: auto;
}
.new-photo-choices strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.new-photo-choices small {
  display: block;
  margin-top: 5px;
  color: #8190a3;
  font-size: 11px;
}
.new-photo-note {
  margin: 20px 0 0;
  color: #8c99aa;
  font-size: 11px;
  text-align: center;
}
/* Dialogs, template library, and account history */
dialog {
  width: min(510px, calc(100% - 32px));
  max-height: 90dvh;
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dfe6ef;
  border-radius: 16px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 100px #17263b26;
}
dialog::backdrop {
  background: #26364a38;
  backdrop-filter: blur(3px);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}
.dialog-top h2 {
  margin: 5px 0 0;
  font-size: 23px;
  letter-spacing: -0.5px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f4f6f9;
  color: #8592a2;
}
.icon-button:hover {
  color: var(--blue);
}
.dialog-description {
  margin: 12px 0 22px;
  color: #8493a5;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.8;
}
.style-dialog {
  width: min(590px, calc(100% - 32px));
}
.style-dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.style-dialog .dialog-top,
.style-dialog .dialog-description,
.style-categories {
  flex-shrink: 0;
}
.style-dialog .dialog-description {
  margin-bottom: 12px;
}
.style-dialog .dialog-description .text-button {
  min-height: 36px;
  color: #58749c;
  font-size: inherit;
}
.style-categories {
  display: flex;
  gap: 5px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.style-categories button {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}
.style-categories button[aria-pressed='true'] {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}
.style-dialog-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 3px 5px;
  margin: 0 -5px;
}
.style-load-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.style-load-feedback p {
  margin: 0 0 12px;
}
.style-load-feedback button {
  margin-bottom: 12px;
  flex-shrink: 0;
  font-size: 12px;
}
.style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.style-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 5px;
  border: 1px solid #e5eaf1;
  border-radius: 9px;
  background: #fff;
  color: #536b88;
  font-size: 12px;
}
.style-tile[hidden] {
  display: none;
}
.style-tile .tile-visual {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 5px;
  background-color: #f5f7fa;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.style-tile .tile-visual:not(.ready)::after {
  content: '';
  display: block;
  width: 32%;
  height: 65%;
  margin: 13% auto;
  border-radius: 18px 18px 5px 5px;
  background: #e9eef4;
}
.style-tile .tile-label {
  display: grid;
  align-items: center;
  min-height: 42px;
  padding: 5px 3px 2px;
  line-height: 1.5;
}
.style-tile.selected {
  border-color: #7ea9f0;
  background: #f1f6ff;
  color: #306ac8;
  box-shadow: 0 0 0 1px #7ea9f0;
}
.style-tile.selected::after {
  content: '✓';
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 12px;
}
.style-tile:hover {
  border-color: #a7bfea;
}
.style-custom {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.style-custom-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}
.style-custom-heading span {
  color: var(--muted);
  font-size: 11px;
}
.style-dialog .reference-row {
  margin: 0 0 12px;
}
.style-dialog .dialog-label {
  margin: 0 0 8px;
}
.style-dialog .style-description-input {
  display: block;
  min-height: 70px;
  max-height: 105px;
}
.style-dialog .dialog-bottom {
  flex-shrink: 0;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.style-choice-summary {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.style-choice-summary .text-button {
  min-height: 32px;
}
.style-choice-summary .text-button[aria-pressed='true'] {
  color: var(--blue);
}
.style-choice-summary .text-button[aria-pressed='true']::before {
  content: '✓';
  margin-right: 6px;
}
#style-selection {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}
.style-choice-summary .text-button[aria-pressed='true'] + #style-selection {
  display: none;
}

.reference-row {
  margin: 18px 0;
}
.reference-upload {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  padding: 12px;
  border: 1px dashed #d4dfea;
  border-radius: 7px;
  color: #7a8ba0;
  font-size: 13px;
}
.reference-upload > span:last-child {
  margin-left: auto;
}
.reference-upload .icon {
  width: 17px;
  height: 17px;
}
.dialog-label {
  display: block;
  margin: 15px 0 8px;
  color: #728299;
  font-size: 13px;
}
.style-description-input {
  width: 100%;
  max-height: 140px;
  padding: 11px;
  border: 1px solid #dfe6ef;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.8;
}
.style-description-input::placeholder {
  color: #9ba8b9;
  font-size: 12px;
}
.dialog-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 21px;
}
.dialog-bottom .button {
  min-height: 44px;
  padding: 9px 20px;
  font-size: 13px;
}
.help-steps {
  margin: 27px 0;
  padding-left: 22px;
  color: #677b91;
}
.help-steps li {
  margin: 23px 0;
  padding-left: 9px;
}
.help-steps strong {
  font-size: 14px;
}
.help-steps p {
  color: #8796a7;
  font-size: 12px;
  line-height: 1.9;
}
.help-dialog > .button {
  width: 100%;
  font-size: 13px;
}
.style-reference-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 7px;
  border-radius: 7px;
  background: #f6f8fb;
}
.style-reference-chip img {
  width: 32px;
  height: 40px;
  flex-shrink: 0;
  object-fit: cover;
}
.style-reference-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.style-reference-chip button {
  min-height: 36px;
  margin-left: auto;
  color: #8a98a8;
  font-size: 11px;
}
.paste-dialog {
  width: min(470px, calc(100% - 32px));
}
.paste-dialog h2 {
  font-size: 20px;
}
.paste-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.paste-choices > button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 19px;
  border: 1px solid #dfe7f1;
  border-radius: 10px;
  text-align: left;
}
.paste-choices > button:hover {
  border-color: #90b3ee;
  background: #f7faff;
}
.paste-choices .icon {
  width: 25px;
  height: 25px;
  color: #668bbd;
}
.paste-choices strong {
  font-size: 14px;
}
.paste-choices span {
  color: #8797aa;
  font-size: 12px;
}
.viewer-dialog {
  width: fit-content;
  min-width: min(280px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 20px;
  background: #f8fafc;
}
.viewer-dialog .dialog-top {
  margin-bottom: 18px;
}
.viewer-dialog .dialog-top h2 {
  font-size: 16px;
  font-weight: 550;
}
.viewer-dialog > img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(840px, calc(100vw - 74px));
  max-height: calc(90dvh - 160px);
  margin: auto;
  object-fit: contain;
}
.viewer-caption {
  max-width: 460px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-wrap: balance;
}
#auth-dialog,
#registration-dialog {
  width: min(410px, calc(100% - 32px));
}
#registration-login {
  width: 100%;
  margin-top: 24px;
}
.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.auth-form label {
  color: #62788f;
  font-size: 13px;
}
.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #dce4ee;
  border-radius: 7px;
  background: #fbfcfe;
  font-size: 16px;
}
.auth-form .button {
  width: 100%;
}
.auth-error {
  margin: 0;
}
#history-dialog {
  width: min(650px, calc(100% - 32px));
}
.jobs-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.jobs-list:empty::after {
  content: '暂无作品，先制作一张吧。';
  padding: 35px 15px;
  color: #8b99ab;
  font-size: 13px;
  text-align: center;
}
.job-card {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-width: 0;
  min-height: 84px;
  padding: 12px;
  border: 1px solid #e3e9f1;
  border-radius: 10px;
  background: #fbfcfe;
  text-align: left;
}
.job-card:hover {
  border-color: #abc4eb;
  background: #f6f9ff;
}
.job-card > img {
  width: 43px;
  height: 58px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 3px;
  background: #ecf1f7;
}
.job-card > div {
  flex: 1;
  min-width: 0;
}
.job-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 550;
}
.status-label,
.job-date {
  display: block;
  margin-top: 4px;
  color: #8090a4;
  font-size: 11px;
  font-weight: 400;
}
.status-label {
  color: #617b9c;
}
.job-card > .status-label {
  margin-left: auto;
  text-align: right;
}

/* Quiet contextual information */
.about-details {
  width: min(1160px, calc(100% - 96px));
  margin: 0 auto 30px;
  border-top: 1px solid #e9edf3;
}
.about-details > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: max-content;
  min-height: 43px;
  margin: auto;
  padding: 19px 0 3px;
  list-style: none;
  color: #99a5b4;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}
.about-details > summary:hover,
.about-details > summary:focus-visible {
  color: #6f87a5;
}
.about-details > summary > span {
  font-size: 14px;
  line-height: 1;
  transition: transform 0.15s;
}
.about-details[open] > summary > span {
  transform: rotate(45deg);
}
.capabilities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  width: 100%;
  margin: 0;
  padding: 25px 0 5px;
}
.capabilities > div {
  display: flex;
  gap: 13px;
}
.cap-number {
  margin-top: 2px;
  color: #a4afbd;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.capabilities p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.capabilities strong {
  color: #7e8fa5;
  font-size: 12px;
  font-weight: 450;
}
.capabilities p > span {
  color: #96a3b4;
  font-size: 11px;
}
footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px;
  max-width: 1256px;
  margin: auto;
  padding: 0 48px 22px;
  color: #929faf;
  font-size: 10px;
}
footer i {
  margin: 0 5px;
  font-style: normal;
}
.toast {
  position: fixed;
  z-index: 10;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 9px;
  background: #2e4052;
  box-shadow: 0 4px 20px #20304420;
  color: white;
  font-size: 12px;
}

@keyframes arrow-pulse {
  50% {
    transform: translateX(4px);
    opacity: 0.45;
  }
}
@keyframes photo-pulse {
  50% {
    opacity: 0.5;
  }
}

/* Wide screens preserve the compact creation surface. */
@media (min-width: 1500px) {
  .workspace {
    margin-top: 48px;
    margin-bottom: 62px;
  }
}

@media (min-width: 801px) and (max-width: 1100px) {
  .site-header {
    padding: 0 32px;
  }
  .workspace {
    width: calc(100% - 64px);
    grid-template-columns: minmax(0, 1fr) minmax(390px, 440px);
    gap: 32px;
  }
  .creation-card {
    padding: 25px 24px;
  }
  .background-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px;
  }
  .background-row > .field-label {
    grid-column: 1;
    grid-row: 1;
  }
  .color-name {
    grid-column: 2;
    grid-row: 1;
  }
  .color-options {
    grid-column: 1 / -1;
    gap: 9px;
  }
  .swatch {
    width: 44px;
    min-width: 44px;
  }
  .swatch::before {
    inset: 10px;
  }
  .color-auto {
    min-width: 72px;
  }
  .about-details {
    width: calc(100% - 64px);
  }
  footer {
    padding-right: 32px;
    padding-left: 32px;
  }
}

/* Touch layout has a separate, reachable action area. */
@media (max-width: 800px) {
  body {
    padding-bottom: 111px;
    scroll-padding-bottom: 120px;
  }
  .site-header {
    height: 64px;
    padding: 0 21px;
    gap: 14px;
  }
  .brand strong {
    font-size: 24px;
  }
  .brand-sub {
    display: none;
  }
  .site-header nav,
  .header-actions {
    gap: 14px;
  }
  .site-header .text-button,
  .header-link {
    font-size: 12px;
  }
  .header-create {
    padding: 9px 12px;
    font-size: 12px;
  }
  #how-button {
    display: none;
  }
  .mobile-help {
    display: inline-flex;
    min-height: 44px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 21px;
    width: min(550px, calc(100% - 32px));
    margin: 15px auto 26px;
  }
  .intro-column {
    width: 100%;
    padding: 0;
  }
  body[data-view='landing'],
  body[data-view='completed'] {
    padding-bottom: 0;
  }
  body[data-view='completed']:has(#editor-fields:not([hidden])) {
    padding-bottom: 111px;
  }
  body:not([data-auth='authenticated']) #history-button,
  body:not([data-view='landing']) #registration-entry {
    display: none;
  }
  .desktop-upload-hint,
  .landing-upload-hint kbd {
    display: none;
  }
  .mobile-upload-hint {
    display: inline;
  }
  .landing {
    width: min(440px, calc(100% - 40px));
    min-height: calc(100svh - 170px);
    padding: 56px 0 64px;
  }
  .landing-copy h1 {
    font-size: 29px;
  }
  .landing-upload {
    min-height: 56px;
    min-width: 188px;
    font-size: 20px;
  }
  .landing-upload-hint {
    margin-top: 19px;
  }
  .photo-guidance {
    margin-top: 34px;
  }
  .header-auth-button {
    min-height: 40px;
    padding: 8px 15px;
    font-size: 12px;
  }
  body[data-view='landing'] footer {
    width: calc(100% - 32px);
    padding-top: 18px;
    font-size: 10px;
    gap: 20px;
  }
  .landing-footer-delivery {
    text-align: right;
  }
  .source-stage {
    display: grid;
    grid-template-columns: 75px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0 16px;
    width: 100%;
    min-height: 119px;
    padding: 12px 15px;
    border: 1px solid #e4eaf2;
    border-radius: 13px;
    background: #ffffff99;
  }
  .source-heading {
    grid-column: 2;
    grid-row: 1;
    gap: 5px;
  }
  .source-heading h2 {
    font-size: 15px;
  }
  .source-heading button {
    font-size: 11px;
  }
  .source-canvas {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-height: 94px;
    padding: 0;
  }
  .source-canvas img {
    max-height: 94px;
    border-radius: 3px;
    box-shadow: none;
  }
  .source-caption {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin-top: 1px;
    font-size: 11px;
    text-align: left;
  }
  .step-label {
    font-size: 10px;
  }
  .editor-summary dl {
    gap: 12px 14px;
    margin-bottom: 19px;
    padding-bottom: 19px;
  }
  .editor-summary h2 {
    margin-bottom: 19px;
    font-size: 17px;
  }
  .creation-card {
    scroll-margin-top: 84px;
    width: 100%;
    padding: 17px 20px 15px;
    border-radius: 14px;
    box-shadow: 0 8px 30px #334c7010;
  }
  .card-heading {
    margin-bottom: 12px;
  }
  .card-heading h2 {
    font-size: 17px;
  }
  .requirements-heading {
    margin-top: 22px;
    margin-bottom: 9px;
  }
  .requirements-heading label {
    font-size: 14px;
  }
  .requirements-heading > span {
    display: none;
  }
  .composer textarea {
    min-height: 105px;
    padding: 12px 12px 5px;
    font-size: 16px;
    line-height: 1.7;
    resize: none;
  }
  .composer textarea::placeholder {
    font-size: 14px;
  }
  .composer-tools {
    padding: 0 11px 5px;
  }
  .attach-button {
    min-height: 40px;
    font-size: 12px;
  }
  .composer-tools .composer-format {
    font-size: 10px;
  }
  .field-help > summary {
    min-height: 36px;
    padding-left: 12px;
  }
  .field-help-content {
    max-width: calc(100vw - 68px);
  }
  .quick-options {
    gap: 10px;
    margin: 16px 0 15px;
  }
  .option-row {
    gap: 12px;
  }
  .field-label {
    min-width: 26px;
  }
  .size-options {
    flex: 1;
    gap: 5px;
  }
  .chip {
    flex: 1;
    min-height: 42px;
    padding: 5px 10px;
    white-space: nowrap;
  }
  .background-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0;
  }
  .background-row > .field-label {
    grid-column: 1;
    grid-row: 1;
  }
  .color-name {
    grid-column: 2;
    grid-row: 1;
    color: #657c98;
    font-size: 12px;
    text-align: right;
  }
  .color-options {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1.4fr repeat(5, 1fr);
    gap: 3px;
    margin-top: 3px;
  }
  .color-auto {
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 0 4px;
  }
  .swatch {
    width: 100%;
    min-width: 0;
  }
  .swatch::before {
    inset: auto;
    width: 23px;
    height: 23px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .appearance-options {
    margin: 17px 0 0;
    border-bottom: 0;
  }
  .style-options {
    margin: 2px 0 0;
    padding: 8px 0 4px;
    border-bottom: 0;
  }
  .style-entry {
    gap: 8px;
  }
  .style-text > strong {
    font-size: 14px;
  }
  .style-text > span {
    max-width: 111px;
  }
  .style-separator {
    margin: 0 12px;
  }
  .spec-summary {
    gap: 9px;
    margin-bottom: 12px;
  }
  .material-note {
    font-size: 12px;
  }
  .form-feedback {
    margin-top: 13px;
    scroll-margin: 30px;
  }
  .submit-area {
    position: fixed;
    z-index: 4;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 582px;
    padding: 12px 20px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #e2e8f0;
    background: #ffffffed;
    backdrop-filter: blur(14px);
    box-shadow: 0 -4px 20px #34476006;
  }
  .submit-area > .button {
    min-height: 50px;
    font-size: 15px;
  }
  .submit-note {
    margin-top: 6px;
  }
  .keyboard-open {
    padding-bottom: 20px;
  }
  .keyboard-open .submit-area,
  .creation-card.completed:not(.has-changes) .submit-area {
    position: static;
    transform: none;
    margin-top: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
  }
  .custom-size {
    justify-content: flex-end;
    gap: 7px;
    padding-left: 0;
  }
  .custom-size input {
    width: 65px;
    min-height: 42px;
    font-size: 16px;
  }
  .custom-size select {
    min-height: 42px;
    font-size: 16px;
  }
  .workspace.has-result .intro-column {
    padding-top: 0;
  }
  .result-area {
    width: 100%;
    padding: 6px 8px;
    scroll-margin: 84px 0 15px;
  }
  .result-heading {
    margin-bottom: 14px;
  }
  .result-heading h2 {
    font-size: 25px;
    text-wrap: balance;
  }
  .result-stage {
    --preview-height: 288px;
    height: 320px;
    padding: 16px;
  }
  .result-progress {
    min-height: 330px;
    padding: 25px 16px;
  }
  .result-actions {
    gap: 10px;
  }
  .result-actions .button {
    padding: 10px 12px;
    font-size: 12px;
  }
  .result-actions .text-button {
    font-size: 12px;
  }
  .result-downloads {
    gap: 8px;
  }
  .result-downloads > a {
    min-height: 46px;
    font-size: 12px;
  }
  .download-more summary {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 12px;
  }
  dialog {
    width: calc(100% - 28px);
    max-height: 88dvh;
    padding: 23px;
  }
  .style-dialog {
    width: 100%;
    max-width: 600px;
    max-height: 85dvh;
    margin: auto auto 0;
    padding: 26px 22px calc(22px + env(safe-area-inset-bottom));
    border-bottom: 0;
    border-radius: 19px 19px 0 0;
  }
  .style-dialog::before {
    content: '';
    position: absolute;
    top: 8px;
    left: calc(50% - 16px);
    width: 32px;
    height: 4px;
    border-radius: 3px;
    background: #dce3ec;
  }
  .dialog-top h2 {
    font-size: 22px;
  }
  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .style-categories button {
    min-height: 44px;
    padding: 8px;
  }
  #style-selection {
    max-width: 155px;
  }
  .style-choice-summary .text-button {
    min-height: 44px;
  }
  .style-description-input {
    font-size: 16px;
  }
  .style-description-input::placeholder {
    font-size: 14px;
  }
  .dialog-bottom {
    margin-top: 18px;
  }
  .paste-dialog h2 {
    font-size: 19px;
  }
  .paste-choices > button {
    padding: 15px;
  }
  .about-details {
    width: min(510px, calc(100% - 48px));
    margin-bottom: 21px;
  }
  .about-details > summary {
    padding-top: 13px;
  }
  .capabilities {
    grid-template-columns: 1fr;
    gap: 21px;
    padding: 19px 0 5px;
  }
  .capabilities p {
    gap: 3px;
  }
  footer {
    justify-content: center;
    padding: 0 22px 15px;
    font-size: 11px;
  }
  footer > .retention-note {
    display: none;
  }
  .toast {
    bottom: 114px;
  }
}

@media (max-width: 360px) {
  .site-header {
    padding: 0 17px;
  }
  .site-header nav,
  .header-actions {
    gap: 12px;
  }
  .source-stage {
    grid-template-columns: 65px minmax(0, 1fr);
    gap: 0 12px;
    padding-inline: 12px;
  }
  .source-heading h2 {
    font-size: 14px;
  }
  .workspace {
    width: calc(100% - 24px);
  }
  .creation-card {
    padding-right: 16px;
    padding-left: 16px;
  }
  .size-options {
    gap: 4px;
  }
  .chip {
    padding: 5px 7px;
    font-size: 12px;
  }
  .option-row {
    gap: 9px;
  }
  .color-options {
    grid-template-columns: 1.35fr repeat(5, 1fr);
    gap: 1px;
  }
  .color-auto {
    font-size: 11px;
  }
  .style-text > strong {
    font-size: 13px;
  }
  .style-text > span {
    max-width: 87px;
  }
  .style-entry {
    gap: 5px;
  }
  .style-icon {
    width: 23px;
  }
  .style-separator {
    margin: 0 7px;
  }
  .composer textarea::placeholder {
    font-size: 13px;
  }
  .result-downloads > a {
    flex-basis: 100%;
  }
  .job-card {
    gap: 10px;
  }
}

@media (hover: hover) {
  .composer:hover .composer-format {
    opacity: 1;
  }
}

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

@media (max-height: 650px) {
  .landing {
    min-height: 0;
    padding-top: 40px;
    padding-bottom: 40px;
  }
}

/* Work continuity: the same photo cards on the home page and in the library. */
.recent-work {
  max-width: 1160px;
  margin: 40px auto 48px;
  padding-top: 28px;
  border-top: 1px solid #e2e8f0;
}
.recent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.recent-heading h2 {
  margin: 0;
  font-size: 19px;
  color: #283849;
}
.recent-heading p {
  margin: 7px 0 0;
  font-size: 13px;
  color: #75869b;
}
.recent-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.recent-list .job-card {
  background: #fff;
  padding: 16px;
  border-radius: 14px;
}
.job-card > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.job-card strong {
  font-size: 14px;
  color: #30445f;
}
.job-card small {
  font-size: 11px;
  color: #7a899c;
}
.job-card > img {
  width: 56px;
  height: 76px;
  background: transparent;
}
.work-state {
  font-size: 12px;
  color: #667991;
}
.work-state[data-status='running'],
.work-state[data-status='queued'] {
  color: #245fed;
}
.work-state[data-status='completed'] {
  color: #32816c;
}
.draft-resume {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 20px;
  margin-bottom: 14px;
  border: 1px solid #cfdcf5;
  border-radius: 12px;
  background: #f5f8ff;
  color: #345b98;
  text-align: left;
}
.draft-resume strong,
.draft-resume small {
  display: block;
}
.draft-resume small {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 400;
  color: #71829b;
}
#history-dialog {
  width: min(760px, calc(100% - 32px));
}
#history-dialog .jobs-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 650px) {
  .recent-work {
    margin: 24px 0;
  }
  .recent-list,
  #history-dialog .jobs-list {
    grid-template-columns: 1fr;
  }
  .recent-heading p {
    font-size: 12px;
  }
  #history-button {
    display: inline-flex !important;
  }
}
.work-expiry {
  font-size: 12px;
  color: #74859b;
  margin: 0 0 14px;
}
@media (max-width: 650px) {
  .site-header {
    gap: 10px;
    padding-inline: 16px;
  }
  .site-header nav,
  .header-actions {
    gap: 10px;
  }
  .site-header button {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .header-create {
    padding-inline: 9px;
  }
  .header-create .icon {
    display: none;
  }
  #login-button {
    padding-inline: 12px;
  }
  .recent-work {
    margin-inline: 16px;
  }
}
/* Completed work: preview on the left, all delivery decisions on the right. */
.delivery-panel {
  margin: 22px 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}
.delivery-panel .result-specs {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  flex-wrap: wrap;
  gap: 6px;
}
.delivery-panel .result-downloads {
  margin-top: 0;
  flex-wrap: wrap;
}
.delivery-panel .result-downloads .button-primary {
  min-width: 170px;
}
.delivery-panel .work-expiry {
  margin: 12px 0 0;
  font-size: 11px;
}
body[data-view='completed'] .result-heading {
  margin-bottom: 14px;
}
body[data-view='completed'] .result-stage {
  height: 390px;
  --preview-height: 366px;
}
body[data-view='completed'] .preview-caption {
  margin-bottom: 0;
}
body[data-view='completed'] .completed-source {
  margin-top: 20px;
  padding-top: 18px;
}
body[data-view='completed'] .summary-note {
  margin-bottom: 0;
}
body[data-view='landing']:has(#recent-work:not([hidden])) .landing {
  min-height: 460px;
  padding-block: 60px;
}
.progress-art {
  width: 92px;
  height: 114px;
}
.progress-art span {
  display: none;
}
#progress-source {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 5px;
}
.result-progress {
  min-height: 390px;
}
.workspace {
  scroll-margin-top: 100px;
}
@media (max-width: 800px) {
  body[data-view='completed'] .result-stage {
    height: 330px;
    --preview-height: 306px;
  }
  .delivery-panel .result-downloads {
    flex-wrap: nowrap;
  }
  .result-progress {
    min-height: 340px;
    padding: 24px 16px;
  }
  .workspace {
    scroll-margin-top: 72px;
  }
  body[data-view='landing']:has(#recent-work:not([hidden])) .landing {
    min-height: 380px;
    padding-block: 40px;
  }
}
body[data-view='completed'] .editor-summary dl {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
  gap: 12px 18px;
}
body[data-view='completed'] .completed-source {
  padding-top: 0;
  margin-bottom: 16px;
}
body[data-view='completed'] .delivery-panel {
  margin-block: 20px;
}
@media (max-width: 800px) {
  body[data-view='completed']:has(#editor-summary:not([hidden])) {
    padding-bottom: 88px;
  }
  body[data-view='completed'] #editor-summary:not([hidden]) .result-downloads {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px #263e5508;
  }
  body[data-view='completed'] .delivery-panel .download-menu {
    top: auto;
    bottom: calc(100% + 8px);
  }
}
