:root {
  --bg: #EAE2D3;
  --panel: #F3ECDF;
  --paper: #FCFAF5;
  --dropzone-bg: #F8F4EC;
  --ink: #211E1A;
  --ink2: #3A352E;
  --muted: #6B6459;
  --muted2: #8A8073;
  --muted3: #9A9088;
  --muted4: #A89D8B;
  --muted5: #BBB1A0;
  --border: #D2C7B3;
  --border2: #D8CEBE;
  --border3: #E4D9C5;
  --accent: #C0402E;
  --accent-dark: #A6331F;
  --accent2: #D9A57C;
  --tint: #FBEDE6;
  --switch-off: #CFC5B4;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(#00000008 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
}

/* ---- Masthead ---- */
.masthead {
  background-color: var(--panel);
  border-bottom: 2px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 20;
}

.masthead-row {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--accent);
  color: #FBF6EC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif SC', serif;
  font-weight: 900;
  font-size: 19px;
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Noto Serif SC', serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 2px;
}

.brand-tag {
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  color: var(--muted2);
  letter-spacing: 2px;
}

.masthead-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13.5px;
  color: var(--ink2);
}

.nav-dot {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--accent);
}

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: 'Noto Serif SC', serif;
}

.masthead-meta {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 8px 32px;
  border-top: 1px solid var(--border2);
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  color: var(--muted2);
}

/* ---- Workbench layout ---- */
.workbench {
  max-width: 1340px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  align-items: start;
}

.input-col {
  padding: 36px 34px 60px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 99px;
}

.preview-col {
  padding: 36px 40px 60px;
  min-width: 0;
}

/* ---- Steps ---- */
.step {
  margin-bottom: 38px;
}

.step:last-of-type {
  margin-bottom: 30px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.step-num {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.step-title {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 16.5px;
}

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border2);
}

/* ---- Dropzone ---- */
.dropzone {
  border: 1.5px dashed #C8BCA6;
  border-radius: 13px;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  background: var(--dropzone-bg);
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--tint);
}

.dropzone-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted4);
  margin-bottom: 10px;
}

.dropzone p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink2);
  line-height: 1.7;
}

.hint-sm {
  display: inline-block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted3);
}

/* ---- Or divider ---- */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
  color: var(--muted3);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
}

.or-line {
  flex: 1;
  height: 1px;
  background: var(--border2);
}

/* ---- Textarea ---- */
textarea {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 13.5px;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--ink);
  background: var(--paper);
  resize: vertical;
  line-height: 1.7;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tint);
}

/* ---- Theme picker ---- */
.theme-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.theme-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border-radius: 13px;
  cursor: pointer;
  background: var(--paper);
  border: 1.5px solid var(--border3);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.theme-card:hover {
  transform: translateY(-1px);
}

.theme-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tint);
}

.theme-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 54px;
  flex-shrink: 0;
}

.theme-bar {
  height: 5px;
  border-radius: 3px;
}

.theme-bar:first-child {
  height: 6px;
  width: 80%;
}

.theme-bar:last-child {
  width: 70%;
}

.theme-info {
  flex: 1;
  min-width: 0;
}

.theme-name {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 2px;
}

.theme-tag {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted3);
}

.theme-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.3;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.theme-card.active .theme-dot {
  opacity: 1;
}

.theme-card.auto-card {
  border-style: dashed;
}

.auto-card-icon {
  width: 54px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
  background: var(--tint);
  border-radius: 10px;
}

/* ---- Spacing picker ---- */
.spacing-head {
  margin-top: 16px;
  margin-bottom: 10px;
}

.spacing-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.spacing-card {
  flex: 1;
  min-width: 86px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  background: var(--paper);
  border: 1.5px solid var(--border3);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.spacing-card:hover {
  transform: translateY(-1px);
}

.spacing-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tint);
}

.spacing-card.auto-card {
  border-style: dashed;
}

.spacing-card-name {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 2px;
}

.spacing-card-tag {
  font-family: 'Space Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 1px;
  color: var(--muted3);
}

/* ---- Settings ---- */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

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

.setting-label {
  font-size: 13px;
  color: var(--ink2);
}

.setting-divider {
  height: 1px;
  background: #EAE0D0;
}

/* ---- Reference image upload ---- */
.ref-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #EAE0D0;
}

.ref-block-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.ref-upload {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed #C8BCA6;
  background: var(--dropzone-bg);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ref-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--tint);
}

.ref-thumb-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.ref-thumb-wrap[hidden] {
  display: none;
}

.ref-thumb {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border2);
}

.ref-remove-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--panel);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ---- Regenerate-with-prompt modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 30, 26, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 24px 60px -20px rgba(33, 30, 26, 0.45);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-family: 'Noto Serif SC', serif;
  font-weight: 900;
  font-size: 16px;
  color: var(--ink);
}

.modal-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted3);
  cursor: pointer;
  padding: 0;
}

.modal-close:hover {
  color: var(--accent);
}

.modal-textarea {
  margin-top: 8px;
  margin-bottom: 18px;
  min-height: 76px;
}

.modal-input {
  display: block;
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--ink);
  background: var(--paper);
  margin: 8px 0 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tint);
}

/* ---- Auth tabs ---- */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border3);
}

.auth-tab {
  border: none;
  background: none;
  padding: 8px 4px 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--muted2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.auth-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---- Credit balance (masthead) ---- */
.credit-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink2);
}

.credit-balance b {
  font-family: 'Space Mono', monospace;
  color: var(--accent);
  font-size: 14px;
}

/* ---- QR payment area ---- */
.qr-area {
  text-align: center;
  margin-top: 6px;
}

.qr-image {
  width: 200px;
  height: 200px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
}

.qr-hint {
  margin: 14px 0 4px;
  font-size: 13px;
  color: var(--ink2);
}

.qr-status {
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--muted3);
  margin: 0 0 16px;
}

.modal-ref-row .setting-label {
  display: block;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal-btn {
  border-radius: 100px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}

.modal-btn-ghost {
  border: 1px solid var(--border2);
  background: var(--panel);
  color: var(--ink2);
}

.modal-btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-btn-primary {
  border: none;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 8px 20px -8px rgba(33, 30, 26, 0.5);
}

.modal-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent);
}

.modal-btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ---- Stepper control ---- */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border3);
  border-radius: 100px;
  background: var(--panel);
  overflow: hidden;
}

.stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--ink2);
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.stepper-btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--panel);
}

.stepper-btn:disabled {
  color: var(--muted5);
  cursor: not-allowed;
}

.stepper-value {
  min-width: 28px;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* ---- Toggle switch ---- */
.switch {
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 25px;
  border-radius: 100px;
  padding: 3px;
  cursor: pointer;
  background: var(--switch-off);
  justify-content: flex-start;
  transition: background 0.2s;
}

.switch.on {
  background: var(--accent);
  justify-content: flex-end;
}

.switch-knob {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ---- Generate button & status ---- */
.generate-btn {
  width: 100%;
  border: none;
  border-radius: 100px;
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--panel);
  background: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(33, 30, 26, 0.5);
  transition: background 0.2s, transform 0.12s, box-shadow 0.15s;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px rgba(33, 30, 26, 0.55);
}

.generate-btn:active:not(:disabled) {
  transform: translateY(0);
}

.generate-btn:disabled {
  background: #A99F8D;
  cursor: wait;
  box-shadow: none;
}

.status {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.7;
  min-height: 18px;
  color: var(--muted2);
  white-space: pre-line;
}

.status.error {
  color: #C0463A;
}

.status.success {
  color: var(--accent-dark);
}

.progress-bar {
  margin-top: 10px;
  height: 5px;
  border-radius: 3px;
  background: #E0D6C5;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 40%;
  border-radius: 3px;
  background-color: var(--accent);
  background-image: linear-gradient(90deg, var(--accent), var(--accent2));
  animation: progress-slide 1.2s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

/* ---- Result head ---- */
.result-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
  margin-bottom: 24px;
}

.result-theme-tag {
  display: inline-block;
  padding: 4px 13px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--panel);
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.result-title {
  font-family: 'Noto Serif SC', serif;
  font-weight: 900;
  font-size: 30px;
  line-height: 1.4;
  margin: 0 0 10px;
  color: var(--ink);
}

.result-summary {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.85;
  margin: 0;
  max-width: 620px;
}

.copy-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--dropzone-bg);
  border-radius: 100px;
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink2);
  transition: border-color 0.18s, color 0.18s;
}

.copy-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---- Preview grid ---- */
.preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  align-items: flex-start;
}

.cover-col {
  flex: 1 1 320px;
  min-width: 300px;
}

.phone-col {
  flex: 0 0 320px;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.section-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--muted2);
  white-space: nowrap;
}

/* ---- Cover ---- */
.cover-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--dropzone-bg);
  border-radius: 100px;
  padding: 5px 13px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.dl-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dl-chip[hidden] {
  display: none;
}

.dl-chip:disabled {
  border-color: var(--border3);
  background: transparent;
  color: var(--muted5);
  cursor: not-allowed;
}

.cover-placeholder[hidden] {
  display: none;
}

.cover-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 1.9 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border2);
  background-color: var(--bg);
  background-image: repeating-linear-gradient(135deg, #00000008 0 10px, transparent 10px 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 0 20px;
}

.cover-placeholder.generating {
  animation: cover-stripes-move 1s linear infinite;
}

@keyframes cover-stripes-move {
  from { background-position: 0 0; }
  to { background-position: 28.28px 28.28px; }
}

.cover-state {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted4);
}

.cover-sub {
  font-size: 12px;
  color: var(--muted3);
}

.cover-regen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  border: none;
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--panel);
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(192, 64, 46, 0.5);
  transition: transform 0.12s, opacity 0.15s;
}

.cover-regen-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.cover-regen-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.cover-regen-btn[hidden] {
  display: none;
}

.cover-img {
  display: block;
  width: 100%;
  aspect-ratio: 1.9 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border2);
}

.cover-img[hidden] {
  display: none;
}

.cover-note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 13px 15px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--border3);
}

.note-mark {
  font-family: 'Noto Serif SC', serif;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  color: var(--accent);
}

.cover-note span:last-child {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.cover-note b {
  color: var(--ink2);
}

/* ---- Export ---- */
.export-block {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.export-block .section-label {
  display: block;
  margin-bottom: 13px;
}

.copy-body-btn {
  width: 100%;
  border-radius: 100px;
  padding: 14px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
  transition: transform 0.12s;
}

.copy-body-btn:disabled {
  border: 1.5px solid var(--border3);
  color: var(--muted5);
  background: transparent;
  cursor: not-allowed;
}

.copy-body-btn.ready {
  border: none;
  color: var(--panel);
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(192, 64, 46, 0.5);
}

.copy-body-btn.ready:hover {
  transform: translateY(-1px);
}

.export-hint {
  margin: 11px 0 0;
  font-size: 12px;
  color: var(--muted3);
  line-height: 1.7;
}

/* ---- Phone mock ---- */
.phone-mock {
  background: var(--ink);
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 30px 60px -28px rgba(40, 30, 15, 0.5);
}

.phone-mock-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 0 9px;
}

.phone-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4A453D;
}

.phone-mock-bar-pill {
  width: 34px;
  height: 5px;
  border-radius: 3px;
  background: #4A453D;
}

.phone-screen {
  background: #fff;
  border-radius: 28px;
  height: 560px;
  overflow: hidden;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .workbench {
    grid-template-columns: 1fr;
  }
  .input-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: static;
  }
  .preview-grid {
    flex-direction: column;
  }
  .phone-col {
    flex: 0 0 auto;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
  }
}

/* ---- Credit packages (landing pricing + buy modal) ---- */
.credit-packages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.credit-package-card {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--border3);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.18s, transform 0.12s, box-shadow 0.15s;
}

.credit-package-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.credit-package-card.featured {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--panel);
}

.credit-package-badge {
  position: absolute;
  top: -12px;
  right: 18px;
  background: var(--accent);
  color: #FBF6EC;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 5px 12px;
  border-radius: 100px;
}

.credit-package-label {
  font-family: 'Noto Serif SC', serif;
  font-weight: 900;
  font-size: 19px;
}

.credit-package-price {
  font-family: 'Space Mono', monospace;
  font-size: 34px;
  font-weight: 700;
}

.credit-package-price sup {
  font-size: 16px;
  margin-right: 2px;
}

.credit-package-credits {
  font-size: 13.5px;
  color: var(--muted2);
}

.credit-package-card.featured .credit-package-credits {
  color: var(--muted5);
}

.credit-package-bonus {
  color: var(--accent2);
  font-weight: 700;
}

.credit-package-card.featured .credit-package-bonus {
  color: #F2CDA3;
}

.credit-package-estimate {
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--muted3);
}

.credit-package-card.featured .credit-package-estimate {
  color: var(--muted5);
}

.credit-package-btn {
  margin-top: auto;
  border: none;
  border-radius: 100px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--panel);
  background: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
}

.credit-package-card.featured .credit-package-btn {
  background: var(--accent);
  color: #FBF6EC;
}

.credit-package-btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

@media (max-width: 600px) {
  .masthead-row,
  .masthead-meta {
    padding-left: 18px;
    padding-right: 18px;
  }
  .input-col,
  .preview-col {
    padding-left: 20px;
    padding-right: 20px;
  }
  .result-title {
    font-size: 24px;
  }
  .brand-tag {
    display: none;
  }
  .credit-packages {
    grid-template-columns: 1fr;
  }
}
