:root {
  --bg: #f5f1e8;
  --frame: #fffdf8;
  --panel: rgba(255, 255, 255, 0.9);
  --line: #e4d8c8;
  --text: #241b16;
  --muted: #786a5d;
  --primary: #111111;
  --accent: #d56d3d;
  --accent-soft: #f4dfd1;
  --success: #506b46;
  --shadow: 0 24px 80px rgba(86, 56, 32, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(213, 109, 61, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(80, 107, 70, 0.15), transparent 24%),
    linear-gradient(180deg, #fbf7ef 0%, #efe7db 100%);
  color: var(--text);
}

.page-shell {
  min-height: 100vh;
  padding: 32px 16px;
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: min(100%, 430px);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 242, 0.94));
  border: 1px solid rgba(153, 121, 86, 0.18);
  border-radius: 30px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.hero {
  padding: 24px 20px 18px;
  background:
    linear-gradient(135deg, rgba(36, 27, 22, 0.96), rgba(61, 45, 34, 0.88)),
    linear-gradient(90deg, rgba(213, 109, 61, 0.35), transparent);
  color: #fff8f1;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 248, 241, 0.72);
}

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

.hero-stack {
  display: grid;
  gap: 18px;
}

.hero-entry {
  padding-bottom: 24px;
}

.hero-actions,
.hero-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.1;
}

.hero p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 248, 241, 0.82);
}

.ghost-button,
.secondary-button,
.primary-button,
.chip,
.segment,
.tab,
.role-card,
.icon-button,
.link-button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.ghost-button {
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff8f1;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
}

.entry-screen,
.custom-mode-screen,
.agent-chat-screen,
.planning-screen,
.generation-wait-screen {
  min-height: 100%;
}

.entry-stack {
  padding: 18px 16px 20px;
  display: grid;
  gap: 14px;
}

.entry-card,
.entry-panel {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(212, 198, 180, 0.9);
  background: var(--panel);
}

.entry-card {
  display: grid;
  gap: 16px;
}

.entry-card-primary {
  background:
    radial-gradient(circle at top right, rgba(213, 109, 61, 0.14), transparent 40%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 241, 231, 0.94));
}

.entry-copy h2,
.entry-panel h3 {
  margin: 10px 0 8px;
  font-size: 18px;
}

.entry-copy p,
.entry-panel p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.entry-steps {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.entry-steps article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.entry-steps span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #16120f;
  color: #fff8f1;
  font-weight: 700;
}

.entry-steps strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.wizard-progress-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(212, 198, 180, 0.7);
  background: rgba(255, 251, 244, 0.82);
}

.wizard-progress-panel strong {
  display: block;
  font-size: 14px;
}

.wizard-progress-panel p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.chat-progress-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #16120f;
  color: #fff8f1;
  font-size: 12px;
  font-weight: 700;
}

.wizard-step-shell,
.chat-summary-screen {
  padding: 18px 16px 18px;
}

.wizard-question-card {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.wizard-question-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.wizard-question-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.wizard-input-field {
  margin-top: 16px;
}

.wizard-input-field textarea {
  min-height: 220px;
  font-size: 18px;
  line-height: 1.7;
  border-radius: 24px;
}

.wizard-upload-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8f1e7;
}

.wizard-upload-step strong {
  display: block;
  font-size: 13px;
}

.wizard-upload-step p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.upload-inline-button {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.chat-upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.upload-token {
  padding: 8px 12px;
  border-radius: 999px;
  background: #fffaf3;
  border: 1px solid rgba(212, 198, 180, 0.9);
  font-size: 12px;
  color: #5c4d40;
}

.wizard-footer-actions {
  margin-top: 14px;
}

.wizard-footer-actions .secondary-button.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.chat-summary-grid {
  display: grid;
  gap: 10px;
}

.chat-summary-item {
  padding: 14px;
  border-radius: 16px;
  background: #fffefb;
  border: 1px solid var(--line);
}

.chat-summary-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.chat-summary-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #3b2f27;
}

.planning-shell {
  padding: 18px 16px 20px;
  display: grid;
  gap: 14px;
}

.planning-panel {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(212, 198, 180, 0.9);
  background: var(--panel);
}

.planning-panel-highlight {
  background:
    radial-gradient(circle at top right, rgba(213, 109, 61, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 241, 231, 0.94));
}

.section-title.compact {
  margin-bottom: 10px;
}

.planning-steps {
  display: grid;
  gap: 10px;
}

.planning-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #fffefb;
  border: 1px solid var(--line);
}

.planning-step-index {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #efe5d8;
  color: #5f5044;
  font-weight: 700;
}

.planning-step.is-complete .planning-step-index {
  background: #17120f;
  color: #fff8f1;
}

.planning-step.is-active {
  border-color: rgba(213, 109, 61, 0.35);
  box-shadow: 0 10px 24px rgba(213, 109, 61, 0.08);
}

.planning-step.is-active .planning-step-index {
  background: var(--accent);
  color: #fff8f1;
}

.planning-step strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.planning-step p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.planning-step-status {
  display: inline-flex;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f4eee5;
  color: #655749;
  font-size: 11px;
  font-weight: 700;
}

.planning-step.is-complete .planning-step-status {
  background: #eef6ea;
  color: #3f5b35;
}

.planning-step.is-active .planning-step-status {
  background: #fbefea;
  color: #8d4e40;
}

.planning-insight {
  min-height: 120px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(212, 198, 180, 0.9);
  font-size: 15px;
  line-height: 1.8;
}

.planning-output-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planning-output-list span {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: #fffaf3;
  border: 1px solid rgba(212, 198, 180, 0.9);
  font-size: 12px;
  color: #5e4f43;
}

.planning-complete-screen[hidden] {
  display: none !important;
}

.wait-panel {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wait-panel strong {
  display: block;
  font-size: 14px;
}

.wait-panel p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.form-stack {
  padding: 18px 16px 18px;
}

.panel {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid rgba(212, 198, 180, 0.9);
}

.section-title {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.index {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #16120f;
  color: #fff8f1;
  font-weight: 700;
  flex: 0 0 auto;
}

.section-title h2,
.outfit-header h3 {
  margin: 0;
  font-size: 16px;
}

.section-title p,
.outfit-header p,
.upload-card p,
.field-label,
.summary-label {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.chip-group,
.pill-row,
.look-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.segment {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: #efe5d8;
  color: #56483d;
}

.chip.is-selected,
.segment.is-selected {
  background: #15110f;
  color: #fff7f0;
}

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

.segmented,
.outfit-switch {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.segmented.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.outfit-switch {
  grid-template-columns: repeat(2, 1fr);
}

textarea {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffefb;
  resize: vertical;
  font: inherit;
  color: var(--text);
}

textarea:focus {
  outline: 2px solid rgba(213, 109, 61, 0.25);
  border-color: rgba(213, 109, 61, 0.45);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111111;
  color: #fffaf5;
  font-size: 11px;
}

.badge.secondary {
  background: #ead6c5;
  color: #5c4332;
}

.upload-grid {
  display: grid;
  gap: 10px;
}

.upload-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 176px;
  padding: 18px 14px 16px;
  border-radius: 18px;
  border: 1px dashed #c9b7a4;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(251, 246, 238, 0.95));
  text-align: center;
  cursor: pointer;
}

.upload-card.compact {
  min-height: auto;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.upload-card.tall {
  min-height: 220px;
}

.upload-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.upload-glyph {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(248, 236, 225, 0.92)),
    linear-gradient(180deg, rgba(244, 223, 209, 0.95), rgba(237, 228, 219, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(213, 109, 61, 0.12);
}

.upload-plus {
  font-size: 28px;
  line-height: 1;
  color: var(--accent);
  transform: translateY(-1px);
}

.upload-copy {
  margin: 10px 0 0;
  font-size: 12px;
  color: #7d6a58;
}

.upload-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
}

.preview {
  width: 100%;
  height: 132px;
  margin-bottom: 0;
  border-radius: 18px;
  background: transparent;
  background-size: cover;
  background-position: center center;
  display: none;
}

.preview.large {
  height: 180px;
}

.preview.is-filled {
  display: block;
  margin-bottom: 12px;
  background-color: #faf5ee;
  background-size: contain;
  background-repeat: no-repeat;
}

.preview.is-filled::after {
  content: "已上传";
  display: inline-flex;
  margin: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff8f1;
  font-size: 11px;
}

.config-row {
  display: grid;
  gap: 10px;
}

.config-card {
  padding: 14px;
  border-radius: 16px;
  background: #f8f1e7;
}

.prompt-shell {
  position: relative;
}

.prompt-editor {
  min-height: 260px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(50, 38, 95, 0.14);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font: inherit;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
}

.prompt-editor:empty::before {
  content: attr(data-placeholder);
  color: #9b8c7e;
}

.result-panel {
  background:
    radial-gradient(circle at top right, rgba(213, 109, 61, 0.1), transparent 38%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 241, 231, 0.95));
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.result-box {
  min-height: 140px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffefb;
  color: #3b2f27;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.result-editor {
  min-height: 180px;
  margin-top: 0;
  resize: vertical;
}

.result-editor::placeholder {
  color: #9b8c7e;
}

.result-status {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.result-status.is-success {
  padding: 12px 14px;
  border-radius: 14px;
  background: #eef6ea;
  color: #3f5b35;
}

.result-status.is-error {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fbefea;
  color: #8d4e40;
}

.status-link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.toggle-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: #fffefb;
  border: 1px solid var(--line);
}

.toggle-row input {
  width: 42px;
  height: 24px;
  accent-color: var(--accent);
}

.role-mode-panel {
  margin-top: 14px;
}

.helper-copy {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.saved-role-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.role-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 18px;
  background: #f8f1e7;
  text-align: left;
}

.role-card.is-selected {
  background: linear-gradient(180deg, rgba(24, 18, 14, 0.96), rgba(61, 45, 34, 0.92));
  color: #fff8f1;
}

.role-card.is-selected small {
  color: rgba(255, 248, 241, 0.72);
}

.role-thumb,
.mini-view {
  flex: 0 0 auto;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
}

.role-thumb {
  width: 58px;
  height: 58px;
}

.mini-view {
  width: 100%;
  aspect-ratio: 1 / 1.15;
}

.role-thumb-1 {
  background:
    linear-gradient(135deg, rgba(213, 109, 61, 0.24), rgba(80, 107, 70, 0.15)),
    #ecd7c6;
}

.role-thumb-2 {
  background:
    linear-gradient(135deg, rgba(80, 107, 70, 0.22), rgba(36, 27, 22, 0.12)),
    #dfe7d7;
}

.role-thumb-3 {
  background:
    linear-gradient(135deg, rgba(36, 27, 22, 0.18), rgba(213, 109, 61, 0.18)),
    #efe2d7;
}

.role-thumb-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #f2eadf;
}

.role-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

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

.drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.confirm-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top right, rgba(213, 109, 61, 0.16), transparent 32%),
    linear-gradient(180deg, #fffdf8 0%, #f5ede1 100%);
}

.confirm-screen[hidden] {
  display: none !important;
}

.confirm-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 16px 12px;
  border-bottom: 1px solid rgba(212, 198, 180, 0.7);
}

.confirm-back-button {
  flex: 0 0 auto;
  font-size: 28px;
  line-height: 1;
}

.confirm-copy {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.confirm-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px 20px;
}

.confirm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.confirm-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 252, 246, 0.96), rgba(244, 233, 219, 0.96));
  border: 1px solid rgba(212, 198, 180, 0.7);
}

.confirm-loading strong {
  display: block;
  font-size: 14px;
}

.confirm-loading p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.loading-orb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.1)),
    linear-gradient(135deg, rgba(213, 109, 61, 0.95), rgba(80, 107, 70, 0.82));
  box-shadow: 0 10px 24px rgba(86, 56, 32, 0.16);
  animation: pulse-orb 1.4s ease-in-out infinite;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.92);
  border: 1px solid rgba(212, 198, 180, 0.8);
  color: #4d4035;
  font-size: 12px;
}

.meta-chip-wide {
  max-width: 100%;
}

.confirm-panel {
  margin-bottom: 0;
}

.confirm-prompt-shell {
  margin-top: 6px;
}

.confirm-prompt-editor {
  min-height: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 245, 237, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.confirm-prompt-editor.is-loading {
  color: transparent;
  position: relative;
  overflow: hidden;
}

.confirm-prompt-editor.is-loading::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(240, 232, 223, 0.9) 25%, rgba(255, 255, 255, 0.92) 40%, rgba(240, 232, 223, 0.9) 55%),
    linear-gradient(180deg, rgba(241, 233, 224, 0.95) 18px, transparent 18px),
    linear-gradient(180deg, rgba(241, 233, 224, 0.95) 18px, transparent 18px),
    linear-gradient(180deg, rgba(241, 233, 224, 0.95) 18px, transparent 18px);
  background-size: 220px 100%, 100% 42px, 84% 42px, 68% 42px;
  background-position: -220px 0, 0 0, 0 64px, 0 128px;
  background-repeat: no-repeat;
  animation: shimmer 1.4s linear infinite;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 21, 16, 0.46);
  backdrop-filter: blur(6px);
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(100%, 430px);
  background: linear-gradient(180deg, #fffdf8, #f8f0e5);
  box-shadow: -20px 0 60px rgba(36, 27, 22, 0.22);
  overflow-y: auto;
  padding: 18px 16px 24px;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.eyebrow.dark {
  color: #8b755f;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #efe1d1;
  color: #34271f;
  font-size: 24px;
  line-height: 1;
}

.drawer-section {
  margin-bottom: 14px;
}

.text-input {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffefb;
  font: inherit;
}

.section-title.compact .index {
  font-size: 12px;
}

.archive-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #f8f1e7;
}

.archive-meta {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

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

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.archive-grid.is-empty {
  grid-template-columns: 1fr;
}

.archive-empty,
.empty-note {
  padding: 14px;
  border-radius: 14px;
  background: #fffaf3;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.empty-note {
  border: 1px dashed #d7c4b1;
}

.full {
  width: 100%;
}

.works-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.works-page {
  padding: 18px 16px 20px;
}

.works-toolbar {
  margin-bottom: 12px;
}

.works-list {
  display: grid;
  gap: 12px;
}

.work-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(212, 198, 180, 0.88);
  background: rgba(255, 255, 255, 0.86);
}

.work-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  min-height: 168px;
  padding: 10px;
  background-size: cover;
  background-position: center;
  border-radius: 18px;
}

.work-preview.has-video {
  background: #14110f;
  overflow: hidden;
}

.work-preview.has-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  background: #14110f;
}

.work-cover-1 {
  background:
    linear-gradient(135deg, rgba(213, 109, 61, 0.25), rgba(80, 107, 70, 0.12)),
    linear-gradient(180deg, #ebd3c1, #f0e2d6);
}

.work-cover-2 {
  background:
    linear-gradient(135deg, rgba(80, 107, 70, 0.22), rgba(36, 27, 22, 0.08)),
    linear-gradient(180deg, #dde8d8, #efe9df);
}

.work-cover-3 {
  background:
    linear-gradient(135deg, rgba(164, 83, 66, 0.22), rgba(95, 55, 42, 0.12)),
    linear-gradient(180deg, #edd8d1, #efe6df);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill.success {
  background: rgba(80, 107, 70, 0.14);
  color: #3f5b35;
}

.status-pill.processing {
  background: rgba(213, 109, 61, 0.14);
  color: #b1603b;
}

.status-pill.failed {
  background: rgba(164, 83, 66, 0.14);
  color: #9d4a36;
}

.work-meta {
  padding: 2px 2px 2px 0;
  min-width: 0;
}

.work-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.work-head h3 {
  margin: 0;
  font-size: 15px;
}

.work-head span,
.work-meta p,
.progress-row small,
.error-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.work-meta p {
  margin: 6px 0 0;
}

.work-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.work-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4ede3;
  color: #6d5f54;
  font-size: 12px;
  line-height: 1.6;
}

.work-summary.is-error {
  background: #fbefea;
  color: #8d4e40;
}

.mini-button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #efe5d8;
  color: #4d4035;
  font: inherit;
  cursor: pointer;
}

.progress-row {
  margin-top: 12px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ede4d8;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d56d3d, #e2a07f);
}

.error-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fbefea;
  color: #8d4e40;
}

.footer-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0 2px;
  background: linear-gradient(180deg, rgba(245, 241, 232, 0), rgba(245, 241, 232, 0.95) 32%);
}

.secondary-button,
.primary-button {
  height: 50px;
  border-radius: 16px;
}

.confirm-footer-actions {
  padding: 12px 16px 16px;
  margin-top: auto;
}

@keyframes shimmer {
  0% {
    background-position: -220px 0, 0 0, 0 64px, 0 128px;
  }

  100% {
    background-position: calc(100% + 220px) 0, 0 0, 0 64px, 0 128px;
  }
}

@keyframes pulse-orb {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.92;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fffaf3;
  color: #31251e;
  border: 1px solid var(--line);
  text-decoration: none;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #121212;
  color: #fffaf3;
  box-shadow: 0 10px 24px rgba(18, 18, 18, 0.2);
  text-decoration: none;
}

@media (min-width: 768px) {
  .page-shell {
    padding: 48px 24px;
  }

  .phone-frame {
    width: min(100%, 460px);
  }
}

@media (max-width: 420px) {
  .work-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .work-preview {
    min-height: 150px;
  }
}
