:root {
  --text: #2c2621;
  --muted: #9e948a;
  --light: #c4bab0;
  --border: #e8e1d9;
  --bg: #f8f4ef;
  --panel: #fdfaf7;
  --soft: #f2ece5;
  --sage: #8fa89b;
  --rose: #e8d5d0;
  --apricot: #e8985e;
  --slate: #7b8da0;
  --warm-shadow: 0 2px 12px rgba(80, 60, 40, .06);
  --warm-shadow-lg: 0 8px 32px rgba(80, 60, 40, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  height: 100vh;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  height: 72px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--panel) 60%, #faf5f0);
}

.brand-wordmark {
  width: 134px;
  height: auto;
  display: block;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.history-empty {
  margin-top: 42px;
  text-align: center;
  color: var(--light);
  font-size: 13px;
}

.date-label {
  margin: 16px 4px 8px;
  font-size: 11px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.history-item {
  width: 100%;
  padding: 12px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  text-align: left;
  margin-bottom: 6px;
  transition: all .2s;
  cursor: pointer;
}

.history-item:hover {
  background: var(--panel);
  box-shadow: var(--warm-shadow);
}

.history-item img {
  width: 44px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.history-item strong { display: block; font-size: 13px; font-weight: 520; }
.history-item em { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-style: normal; }

.history-item-row {
  position: relative;
  margin-bottom: 6px;
}

.history-item-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--light);
  font-size: 16px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: all .15s;
}

.history-item-row:hover .history-item-delete {
  opacity: 1;
}

.history-item-delete:hover {
  background: #fce8e8;
  color: #b45b64;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
}

.workspace {
  flex: 1;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workspace-header {
  height: 64px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--panel) 70%, #faf5f0);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.provider-select {
  height: 38px;
  padding: 0 10px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
}

.provider-select select {
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 12px;
}

.page-title {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .3px;
  color: var(--text);
}

.model-line {
  margin: 5px 0 0;
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.model-line .ok { color: var(--sage); font-weight: 520; }
.model-line .warn { color: #b28b45; }
.model-line .error { color: #b45b64; }

.steps {
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.step {
  height: 56px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--light);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 480;
  transition: color .2s, border-color .2s;
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--light);
  font-size: 11px;
  font-weight: 540;
  transition: all .2s;
}

.step.active {
  color: var(--text);
  border-bottom-color: var(--apricot);
}

.step.active .step-num {
  background: var(--apricot);
  color: white;
  border-radius: 6px;
}

.step.done {
  color: var(--sage);
  border-bottom-color: transparent;
}

.step.done .step-num {
  background: var(--sage);
  color: white;
  border-radius: 6px;
}

.step.disabled {
  pointer-events: none;
  opacity: .4;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px;
}

.panel { display: none; }
.panel.active { display: block; }

.panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 520;
  letter-spacing: .2px;
}

.panel-desc {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  max-width: 860px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--warm-shadow);
}

.type-item {
  padding: 22px 14px;
  min-height: 124px;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 16px;
  text-align: center;
  transition: all .25s ease;
  cursor: pointer;
}

.type-item:hover {
  background: var(--panel);
  border-color: var(--border);
  box-shadow: var(--warm-shadow);
  transform: translateY(-1px);
}

.type-item.selected {
  background: var(--panel);
  border-color: var(--text);
  box-shadow: var(--warm-shadow-lg);
}

.type-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fdf1e6;
  color: var(--apricot);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
  transition: all .2s;
}

.type-item:nth-child(2n) .type-icon {
  background: #edf3ef;
  color: var(--sage);
}

.type-item:nth-child(3n) .type-icon {
  background: #f5eeea;
  color: #c4957a;
}

.type-item:nth-child(4n) .type-icon {
  background: #eef0f5;
  color: var(--slate);
}

.type-item.selected .type-icon {
  background: var(--text);
  color: white;
  border-radius: 12px;
}

.type-name { display: block; font-size: 13px; font-weight: 520; }
.type-en { display: block; margin-top: 4px; font-size: 10.5px; color: var(--muted); }

.add-custom {
  width: min(860px, 100%);
  height: 44px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.custom-category-form {
  width: min(860px, 100%);
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.custom-category-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.custom-category-form input {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  outline-color: var(--sage);
  font-size: 13px;
}

.custom-category-fields input {
  margin-top: 0;
}

.custom-category-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.card {
  max-width: 860px;
  margin-top: 18px;
  padding: 24px 28px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--warm-shadow);
}

.card h3 {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.tag-row {
  display: grid;
  gap: 14px;
}

.keyword-group {
  display: grid;
  gap: 8px;
}

.keyword-group-title {
  color: var(--slate);
  font-size: 11px;
  font-weight: 520;
}

.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row button,
.tag {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  transition: all .2s;
  cursor: pointer;
}

.tag-row button:hover {
  background: var(--panel);
  border-color: var(--text);
}

.tag-row button.active,
.tag.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.tag-row button span {
  margin-left: 6px;
  color: var(--light);
  font-size: 10.5px;
}

.tag-row button.active span {
  color: rgba(255, 255, 255, .62);
}

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

.inline-form input,
.theme-row input,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  outline: none;
  font-size: 13px;
  transition: border-color .2s, box-shadow .2s;
}

.inline-form input:focus,
.theme-row input:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(143, 168, 155, .15);
}

textarea {
  min-height: 100px;
  margin-top: 14px;
  resize: vertical;
  line-height: 1.65;
}

.image-tag-grid {
  max-width: 860px;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 10px;
}

.image-tag {
  padding: 14px 18px;
  min-height: 68px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: all .2s ease;
  cursor: pointer;
}

.image-tag:hover {
  background: var(--panel);
  box-shadow: var(--warm-shadow);
}

.image-tag.selected {
  background: var(--panel);
  border-color: var(--sage);
  box-shadow: var(--warm-shadow);
}

.image-tag-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--border);
  display: grid;
  place-items: center;
  color: white;
  font-size: 10px;
  flex-shrink: 0;
  transition: all .2s;
}

.image-tag.selected .image-tag-check {
  background: var(--sage);
}

.image-tag strong { display: block; font-size: 13px; font-weight: 520; }
.image-tag span:last-child { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }

.style-summary {
  display: grid;
  gap: 10px;
  font-size: 13px;
}

.summary-row {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
}

.theme-row {
  max-width: 860px;
  margin-bottom: 16px;
}

.theme-row label,
.prompt-card label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.prompt-cards {
  max-width: 860px;
  display: grid;
  gap: 14px;
}

.prompt-card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--warm-shadow);
}

.prompt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.prompt-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 520;
  color: var(--text);
}

.prompt-card textarea {
  min-height: 140px;
  font-family: Menlo, Consolas, "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.65;
  border-radius: 10px;
  border-color: var(--border);
  background: var(--bg);
}

.prompt-card textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(143, 168, 155, .15);
}

.prompt-actions {
  display: flex;
  gap: 8px;
}

.action-bar {
  height: 64px;
  padding: 14px 28px;
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, var(--panel) 80%, #faf5f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  opacity: .8;
}

.actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 520;
  border: none;
  transition: all .2s ease;
  cursor: pointer;
  letter-spacing: .1px;
}

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--soft); color: var(--text); }
.btn-primary { background: var(--text); color: white; }
.btn-primary:hover:not(:disabled) { opacity: .88; }
.btn-primary:disabled { background: var(--light); cursor: not-allowed; opacity: .6; }
.btn-sage { background: var(--sage); color: white; }
.btn-sage:hover:not(:disabled) { background: #7d988e; }
.btn-sage:disabled { background: #c5d5cd; cursor: not-allowed; opacity: .6; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--text); background: var(--soft); }

.error {
  margin: 16px 24px 0;
  padding: 14px 16px;
  border: 1px solid #f0caca;
  border-radius: 10px;
  background: #fff7f7;
  color: #9a3940;
  font-size: 13px;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 50;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: white;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all .2s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1200px) {
  body { min-width: 0; font-size: 14px; }
  .sidebar { width: 190px; }
  .type-grid { grid-template-columns: repeat(3, minmax(96px, 1fr)); }
}

@media (max-width: 768px) {
  body { font-size: 15px; overflow-y: auto; }
  .app { flex-direction: column; height: auto; }
  .sidebar { width: 100%; height: auto; max-height: 220px; }
  .workspace { height: auto; min-height: 60vh; }
  .workspace-header { height: auto; padding: 14px; flex-wrap: wrap; }
  .page-title { font-size: 18px; }
  .steps { height: auto; padding: 8px 12px; flex-wrap: wrap; gap: 4px; }
  .step { height: auto; padding: 8px 12px; font-size: 12px; }
  .content { padding: 16px; }
  .type-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .type-item { min-height: 100px; padding: 16px 10px; }
  .image-tag-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .prompt-card textarea { min-height: 110px; font-size: 14px; }
  .action-bar { height: auto; padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
}

/* Loading spinner */
.img-loading {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--apricot);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.img-error {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff7f7;
  color: #9a3940;
  font-size: 13px;
}

/* Image card actions */
.display-card-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.btn-confirm-img {
  flex: 1;
  padding: 6px 0;
  border: 1px solid var(--sage);
  border-radius: 6px;
  background: transparent;
  color: var(--sage);
  font-size: 12px;
  transition: all .15s;
}
.btn-confirm-img:hover { background: #edf5f0; }

.btn-edit-img {
  width: 100%;
  margin-top: 8px;
  padding: 7px 0;
  border: 1px solid #ead8c8;
  border-radius: 8px;
  background: #fff8f1;
  color: #a56a3b;
  font-size: 12px;
  transition: all .15s;
}
.btn-edit-img:hover {
  border-color: var(--apricot);
  background: #fff1e4;
}

.editable-generated-image {
  cursor: pointer;
}
.editable-generated-image:hover {
  filter: saturate(1.02) contrast(1.02);
}

.btn-cancel-img {
  flex: 1;
  padding: 6px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

/* Save dialog overlay */
.save-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(60, 45, 30, .35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.save-dialog {
  width: min(440px, 90vw);
  padding: 30px;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 24px 72px rgba(60, 40, 20, .16);
}

.save-dialog h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 520;
}

.save-dialog p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.save-dialog input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.save-dialog input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(143, 168, 155, .15);
}

.save-dialog-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.edit-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  padding: 24px;
  background: rgba(60, 45, 30, .38);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-dialog {
  width: min(860px, 94vw);
  max-height: 86vh;
  display: grid;
  grid-template-columns: minmax(260px, .9fr) 1fr;
  overflow: hidden;
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 28px 86px rgba(60, 40, 20, .2);
}

.edit-preview {
  padding: 18px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.edit-preview img {
  width: 100%;
  max-height: 66vh;
  object-fit: contain;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--warm-shadow);
}

.edit-panel {
  padding: 28px;
}

.edit-panel h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 560;
}

.edit-panel p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.edit-panel textarea {
  min-height: 180px;
  margin-top: 0;
}

.edit-dialog-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .edit-dialog { grid-template-columns: 1fr; overflow-y: auto; }
  .edit-preview { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* Active history batch */
.history-item.active {
  background: #edf3ef;
  border: 1px solid var(--sage);
}

/* Clickable display cards (batch view) */
.display-card.clickable {
  cursor: pointer;
  transition: box-shadow .15s;
}
.display-card.clickable:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

/* Fullscreen overlay */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.fullscreen-overlay img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  background: var(--panel);
}
.fullscreen-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: white;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.fullscreen-close:hover {
  background: rgba(255,255,255,.25);
}
.fullscreen-label {
  margin-top: 16px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
}

/* ===== Step nav for 6 items ===== */
.steps { gap: 4px; overflow-x: auto; flex-wrap: nowrap; }
.step { white-space: nowrap; padding: 0 12px; font-size: 12.5px; }
@media (max-width: 768px) {
  .step { font-size: 11px; padding: 0 8px; }
  .step .step-num { width: 18px; height: 18px; font-size: 10px; }
}

/* ===== Concept card (Step 2) ===== */
.trend-reco-card {
  max-width: 860px;
  margin-bottom: 20px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.55), rgba(250,245,240,.8)),
    var(--panel);
  box-shadow: var(--warm-shadow);
}
.trend-reco-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}
.trend-reco-head h3 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 560;
}
.trend-reco-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}
.theme-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}
.theme-chip {
  padding: 7px 13px;
  border: 1px solid #ead8c8;
  border-radius: 999px;
  background: #fff8f1;
  color: #a56a3b;
  font-size: 12px;
}
.theme-chip:hover {
  border-color: var(--apricot);
  background: #fff1e4;
}
.micro-innovation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.micro-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.micro-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--text);
}
.micro-card span,
.trend-empty,
.trend-reco-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.trend-reco-note {
  margin: 12px 0 0;
}
@media (max-width: 640px) {
  .trend-reco-head { display: grid; }
  .micro-innovation-list { grid-template-columns: 1fr; }
}
.concept-input-row { display: flex; gap: 14px; align-items: flex-end; max-width: 860px; margin-bottom: 22px; }
.concept-theme { flex: 1; }
.concept-theme label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.concept-theme input { width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; }
.concept-card { max-width: 860px; padding: 30px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(135deg, #fcfaf7 40%, #faf5f0); box-shadow: var(--warm-shadow); }
.concept-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.concept-mood { margin: 0; font-size: 24px; font-weight: 520; color: var(--text); line-height: 1.5; }
.concept-mood-en { margin-top: 6px; font-size: 14px; color: var(--muted); font-style: italic; }
.concept-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 20px; }
@media (max-width: 640px) { .concept-grid { grid-template-columns: 1fr; } }
.concept-section { margin-bottom: 20px; }
.concept-section h4 { margin: 0 0 12px; padding-left: 10px; border-left: 3px solid var(--apricot); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 520; }
.concept-color-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip { padding: 6px 16px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); font-size: 13px; }
.concept-material-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.material-chip { padding: 6px 16px; border-radius: 20px; background: #edf3ef; color: #6b8a7a; font-size: 13px; }
.concept-symbol-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.symbol-item { padding: 12px 14px; border-radius: 10px; background: var(--bg); border-left: 3px solid var(--sage); }
.symbol-item strong { display: block; font-size: 14px; }
.symbol-item span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.concept-text { font-size: 14px; line-height: 1.75; color: var(--text); }
.concept-brand-dna { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.concept-brand-dna h4 { border-left-color: var(--rose); }
.dna-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dna-badge { padding: 5px 14px; border-radius: 16px; background: var(--rose); color: #6b4a4a; font-size: 12px; font-weight: 500; }
.concept-loading { max-width: 860px; padding: 52px; text-align: center; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.concept-loading .spinner { margin: 0 auto 16px; }
.concept-mini { max-width: 860px; margin-bottom: 20px; padding: 14px 18px; border-radius: 12px; background: linear-gradient(135deg, #fcfaf7, #faf5f0); border: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.concept-mini strong { color: var(--text); }

.blueprint-card {
  max-width: 860px;
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--warm-shadow);
}
.blueprint-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.blueprint-header h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 560;
}
.blueprint-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.blueprint-status {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
}
.blueprint-status.pending {
  background: #f7eee9;
  color: var(--apricot);
}
.blueprint-status.locked {
  background: #edf3ef;
  color: #527462;
}
.blueprint-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.blueprint-summary span {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
}
.blueprint-summary strong {
  color: var(--text);
}
.blueprint-editor {
  width: 100%;
  min-height: 280px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfaf7;
  color: var(--text);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.65;
  resize: vertical;
}
.blueprint-editor:disabled {
  color: #6f766f;
  background: #f4f6f3;
}
.blueprint-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* ===== Two-tier image type grid (Step 3) ===== */
.phase-type-section { max-width: 860px; margin-bottom: 18px; }
.phase-type-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.phase-badge { padding: 3px 12px; border-radius: 12px; font-size: 11px; font-weight: 600; color: white; letter-spacing: .3px; }
.phase-type-header.phase-1 .phase-badge { background: var(--sage); }
.phase-type-header.phase-2 .phase-badge { background: #9b8db5; }
.phase-type-header h3 { margin: 0; font-size: 15px; font-weight: 500; }
.phase-hint { font-size: 11px; color: var(--muted); }
.phase-divider { display: flex; align-items: center; gap: 14px; max-width: 860px; margin: 22px 0; }
.phase-divider-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); }
.phase-divider-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.phase-badge.phase-1 { background: var(--sage); }
.phase-badge.phase-2 { background: #9b8db5; }

/* ===== Phase card grid (Steps 4-5) ===== */
.phase-area { max-width: 860px; }
.phase-start { padding: 52px 44px; text-align: center; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--warm-shadow); }
.phase-start p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.phase-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 24px; }
.phase-material-grid { grid-template-columns: repeat(3, 1fr); }
.phase-card { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); overflow: hidden; box-shadow: var(--warm-shadow); transition: box-shadow .2s; }
.phase-card:hover { box-shadow: var(--warm-shadow-lg); }
.phase-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--bg); }
.phase-card-body { padding: 16px; }
.phase-card-body strong { display: block; font-size: 13px; font-weight: 520; }
.phase-card-body span { display: block; margin-top: 5px; color: var(--muted); font-size: 11.5px; }
.confirmed-badge { display: inline-block; margin-top: 8px; padding: 3px 12px; border-radius: 8px; background: #edf3ef; color: #6b8a7a; font-size: 11px; font-weight: 520; }
.phase-actions { display: flex; gap: 14px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ===== Final confirm (Step 6) ===== */
.final-confirm-area { max-width: 860px; }
.final-confirm-summary { display: grid; gap: 16px; margin-bottom: 28px; }
.final-confirm-section { padding: 20px 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); box-shadow: var(--warm-shadow); }
.final-confirm-section h3 { margin: 0 0 16px; font-size: 14px; font-weight: 520; display: flex; align-items: center; gap: 10px; }
.final-confirm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .final-confirm-grid { grid-template-columns: repeat(2, 1fr); } }
.final-confirm-thumb { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); transition: box-shadow .2s; }
.final-confirm-thumb:hover { box-shadow: var(--warm-shadow); }
.final-confirm-thumb img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--bg); }
.final-confirm-thumb span { display: block; padding: 6px; font-size: 10.5px; text-align: center; color: var(--muted); }
.final-confirm-btn-wrap { text-align: center; padding: 30px; }

/* ===== History modal ===== */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(60, 45, 30, .4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.hidden { display: none; }
.modal-center { width: min(840px, 90vw); max-height: 85vh; display: flex; flex-direction: column; border-radius: 22px; background: var(--panel); box-shadow: 0 24px 80px rgba(60, 40, 20, .18); overflow: hidden; }
.modal-header { padding: 24px 30px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.modal-header h2 { margin: 0; font-size: 18px; font-weight: 520; flex: 1; }
.modal-header-info { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.modal-close-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg); color: var(--muted); font-size: 20px; display: grid; place-items: center; cursor: pointer; transition: all .2s; }
.modal-close-btn:hover { background: var(--soft); color: var(--text); }
.modal-body { flex: 1; overflow-y: auto; padding: 24px 30px; }
.modal-concept { padding: 18px 20px; margin-bottom: 20px; background: linear-gradient(135deg, #fcfaf7, #faf5f0); border-radius: 14px; border: 1px solid var(--border); }
.modal-concept-mood { font-size: 15px; font-weight: 520; margin-bottom: 10px; line-height: 1.6; }
.modal-concept-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.color-chip-sm { padding: 4px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); font-size: 12px; }
.modal-image-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 640px) { .modal-image-grid { grid-template-columns: repeat(2, 1fr); } }
.modal-image-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; cursor: pointer; transition: box-shadow .15s; background: var(--bg); }
.modal-image-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.modal-image-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--bg); }
.modal-image-label { display: block; padding: 10px 12px; font-size: 12px; text-align: center; color: var(--muted); }

/* Remove old unused styles */
.btn-back-session { display: none; }
