:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-soft: #faf9f6;
  --ink: #151515;
  --text: #302f2d;
  --muted: #77736c;
  --line: #e5e0d8;
  --line-strong: #cfc8bd;
  --accent: #111111;
  --orange: #ff7a1a;
  --orange-deep: #b84e00;
  --orange-soft: #fff2e6;
  --danger: #d93025;
  --shadow: 0 14px 36px rgba(30, 24, 16, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

button.secondary {
  background: var(--surface);
}

button:hover {
  filter: brightness(0.98);
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px max(28px, calc((100vw - 1240px) / 2));
  border-top: 10px solid #ffd7a8;
}

.brand-block {
  display: grid;
  gap: 8px;
}

.brand-block p {
  color: var(--muted);
  font-size: 13px;
}

.product-badge,
.eyebrow {
  width: fit-content;
  color: #7c756c;
  font-size: 12px;
  font-weight: 700;
}

.product-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface);
}

.eyebrow {
  margin-bottom: 6px;
  color: #a15a00;
  text-transform: uppercase;
}

.userbar,
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.page-wrap {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto 36px;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.control-pane,
.workspace-pane {
  min-width: 0;
}

.control-pane {
  display: grid;
  gap: 12px;
}

.quick-guide {
  position: absolute;
  top: 0;
  right: calc(100% + 16px);
  width: clamp(190px, calc((100vw - 1440px) / 2 - 16px), 280px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quick-guide summary {
  padding: 12px 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.quick-guide[open] summary {
  border-bottom: 1px solid var(--line);
}

.quick-guide ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 14px 4px;
  list-style: none;
  counter-reset: guide-step;
}

.quick-guide li {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 50px;
  padding: 10px 0 10px 34px;
  border-bottom: 1px solid var(--line);
  counter-increment: guide-step;
}

.quick-guide li:last-child {
  border-bottom: 0;
}

.quick-guide li::before {
  content: counter(guide-step);
  position: absolute;
  top: 11px;
  left: 0;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.quick-guide li b {
  font-size: 13px;
  line-height: 1.4;
}

.quick-guide li span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.workspace-pane {
  min-height: 780px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-card,
.generated-section,
.idea-card,
.module-card,
.image-card,
.analysis-drawer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel-card {
  padding: 14px;
}

.card-title,
.section-heading,
.workspace-head,
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-title {
  margin-bottom: 12px;
}

.card-title p,
.workspace-head p,
.idea-card p,
.idea-card ul,
.inline-status,
.progress-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inline-status {
  overflow-wrap: anywhere;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: #34302a;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--surface-soft);
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #cfc6b9;
  background: #ffffff;
}

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

.file-drop input {
  display: none;
}

.image-preview {
  display: grid;
  min-height: 106px;
  place-items: center;
  border: 1px dashed #d8d0c6;
  border-radius: 12px;
  background: var(--surface-soft);
}

.image-preview img {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: contain;
  border-radius: 10px;
}

.upload-hint {
  display: grid;
  gap: 6px;
  color: var(--ink);
  text-align: center;
}

.upload-hint span {
  color: var(--muted);
  font-size: 12px;
}

.image-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.mode-tabs button {
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.mode-tabs .is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.settings-row,
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.image-number-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0 0 12px;
  border: 0;
  padding: 0;
}

.image-number-field legend {
  width: 100%;
  margin-bottom: 7px;
  padding: 0;
  color: #34302a;
  font-size: 12px;
  font-weight: 700;
}

.image-number-field legend small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.image-number-picker {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 5px;
}

.image-number-picker label {
  display: block;
  margin: 0;
  cursor: pointer;
}

.image-number-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-number-picker span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.image-number-picker input:checked + span {
  border-color: var(--orange);
  background: var(--orange);
  color: #ffffff;
}

.image-number-picker input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.field-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #34302a;
  font-size: 12px;
  font-weight: 700;
}

.field-caption small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.idea-picker {
  margin-bottom: 12px;
}

.idea-refresh-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-bottom: 8px;
}

.idea-refresh-row input,
.idea-refresh-row button {
  min-height: 38px;
  margin: 0;
}

.idea-refresh-row button {
  padding: 0 10px;
  white-space: nowrap;
  font-size: 11px;
}

.idea-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.idea-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.idea-switcher button {
  position: relative;
  min-height: 38px;
  padding: 0;
  border-color: var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 14px;
  font-weight: 700;
}

.idea-switcher button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.idea-switcher button.is-adopted::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

.idea-switcher button.is-active.is-adopted::after {
  background: #ffffff;
}

.idea-choice {
  display: grid;
  min-width: 0;
  min-height: 0;
  align-content: start;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}

.idea-choice-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.idea-choice input,
.idea-choice textarea {
  width: 100%;
  min-width: 0;
  margin: 0;
  border-color: #ddd8cf;
  background: #fdfcf9;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  resize: vertical;
}

.idea-choice input:focus,
.idea-choice textarea:focus {
  border-color: var(--orange);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.1);
}

.idea-choice .idea-title-editor {
  min-height: 40px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.idea-choice .idea-angle-editor {
  min-height: 76px;
  color: #5f5b55;
}

.idea-choice .idea-list-editor {
  min-height: 72px;
  color: #2f2d29;
}

.idea-choice .idea-use-button {
  min-height: 40px;
  padding: 0 12px;
  border-color: var(--line-strong);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.idea-editor-field {
  display: grid;
  gap: 5px;
  margin: 0;
}

.idea-choice .idea-editor-field > span {
  display: block;
  color: #6d675f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.idea-choice.is-edited .idea-use-button,
.idea-choice.is-active .idea-use-button {
  border-color: var(--orange);
  color: var(--orange-deep);
}

.idea-choice strong,
.idea-choice span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.idea-choice strong {
  font-size: 12px;
  line-height: 1.35;
}

.idea-choice span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.idea-choice .idea-detail {
  padding-top: 5px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
}

.idea-choice.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
  box-shadow: inset 0 0 0 1px var(--orange);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: auto;
}

.block-button {
  width: 100%;
  margin-top: 4px;
}

.output-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.output-action-row button {
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
}

.message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.diagnostic-panel {
  margin-top: 10px;
  border: 1px solid rgba(255, 122, 26, 0.35);
  border-radius: 8px;
  background: #fff7ed;
  color: #8a3c00;
}

.diagnostic-panel summary {
  padding: 9px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.diagnostic-panel pre {
  max-height: 180px;
  margin: 0 10px 10px;
  padding: 10px;
  overflow: auto;
  border-radius: 6px;
  background: #1f1b16;
  color: #ffe4c2;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.diagnostic-panel button {
  margin: 0 10px 10px;
}

.pending-review {
  margin-top: 10px;
  border: 1px solid #e7b96a;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff8e8;
  color: #7a4b00;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.verification-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 16, 10, 0.22);
}

.verification-dialog::backdrop {
  background: rgba(20, 18, 15, 0.48);
}

.verification-dialog form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.verification-dialog p,
.verification-dialog li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.verification-dialog ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 12px 12px 30px;
  border-radius: 8px;
  background: #fff8e8;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.analysis-drawer summary {
  padding: 12px 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.drawer-body {
  padding: 0 14px 14px;
}

.workspace-head {
  margin-bottom: 14px;
}

.generation-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.generation-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.generation-progress-head strong {
  color: var(--ink);
  font-size: 13px;
}

.generation-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 5px;
  background: #e9e5df;
}

.generation-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  transition: width 320ms ease;
}

.generation-progress.is-completed .generation-progress-track span {
  background: #238636;
}

.generation-progress.is-failed .generation-progress-track span {
  background: var(--danger);
}

.listing-copy-section {
  margin-bottom: 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.listing-copy-section[hidden] {
  display: none;
}

.copy-platform-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 11px;
}

.listing-copy-field {
  margin-top: 12px;
}

.listing-copy-label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #34302a;
  font-size: 12px;
  font-weight: 700;
}

.listing-copy-label > span:nth-child(2) {
  color: var(--muted);
  font-weight: 400;
}

.listing-copy-label button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.listing-copy-field textarea {
  resize: vertical;
  border-color: var(--line);
  background: var(--surface-soft);
}

.listing-copy-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.generated-section {
  min-height: 250px;
  margin-bottom: 16px;
  padding: 16px;
}

.prompt-section {
  min-height: 0;
  margin-bottom: 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.history-section {
  margin-bottom: 16px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}

.recent-history-section .history-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recent-history-section .history-item {
  min-width: 0;
}

.recent-history-section .history-thumbs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 16, 10, 0.22);
}

.history-dialog::backdrop {
  background: rgba(20, 18, 15, 0.48);
}

.history-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.history-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.history-dialog .history-list {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding-right: 4px;
}

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

.history-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface-soft);
}

.history-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.history-item.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.history-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.history-item h3 {
  font-size: 14px;
}

.history-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.history-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.status-completed {
  background: #e8f6ec;
  color: #1f7a3e;
}

.status-failed {
  background: #fce9e7;
  color: #b42318;
}

.status-running {
  background: #fff1dd;
  color: #a15a00;
}

.history-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.history-thumbs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.history-actions {
  display: flex;
  justify-content: flex-end;
}

.manual-import {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.manual-import summary {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.manual-import[open] summary {
  border-bottom: 1px solid var(--line);
}

.manual-import .import-row {
  margin: 0;
  padding: 12px;
}

.import-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 12px;
}

.file-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.file-button input {
  display: none;
}

.compact-heading {
  margin-bottom: 12px;
}

.images-output {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 210px));
  justify-content: start;
  align-items: start;
  gap: 12px;
}

.image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.image-card img,
.placeholder-box {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.image-card img {
  display: block;
  height: auto;
  object-fit: contain;
  background: #f2eee8;
}

.placeholder-box {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  background: #f2eee8;
}

.placeholder-box span {
  font-size: 12px;
}

.image-card a,
.image-card button {
  display: block;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generated-empty {
  display: grid;
  min-height: 170px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  text-align: center;
}

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.idea-card {
  display: grid;
  gap: 9px;
  padding: 13px;
}

.idea-card.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.idea-card ul {
  margin: 0;
  padding-left: 18px;
}

.idea-best {
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.tabs button {
  min-width: 42px;
  background: var(--surface-soft);
}

.tabs button.is-active {
  border-color: var(--orange);
  background: var(--orange);
  color: #ffffff;
}

.modules-output {
  display: grid;
  gap: 12px;
}

.module-card {
  padding: 14px;
}

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

.module-number {
  margin-bottom: 5px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
}

.module-card textarea {
  min-height: 190px;
  border-color: var(--line-strong);
  background: #ffffff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.module-card textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 111, 24, 0.12);
}

.module-card.is-edited textarea {
  border-left: 3px solid var(--orange);
}

.auth-shell {
  display: grid;
  place-items: start center;
  padding: 42px 18px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.field-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .app-shell,
  .ideas-grid {
    grid-template-columns: 1fr;
  }

  .workspace-pane {
    min-height: 520px;
  }

  .recent-history-section .history-list {
    grid-template-columns: 1fr;
  }

  .quick-guide {
    position: static;
    width: auto;
  }
}

@media (min-width: 981px) and (max-width: 1819px) {
  .page-wrap {
    width: calc(100vw - 24px);
  }

  .app-shell {
    grid-template-columns: 210px 350px minmax(0, 1fr);
    gap: 12px;
  }

  .quick-guide {
    position: sticky;
    top: 16px;
    right: auto;
    width: auto;
  }
}

@media (max-width: 640px) {
  .topbar,
  .workspace-head,
  .card-head {
    flex-direction: column;
  }

  .page-wrap {
    width: calc(100vw - 24px);
  }

  .settings-row,
  .field-grid,
  .import-row {
    grid-template-columns: 1fr;
  }

  .idea-choices {
    grid-template-columns: 1fr;
  }

  .idea-refresh-row {
    grid-template-columns: 1fr;
  }

  .idea-choice {
    min-height: 64px;
  }

  .images-output {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-row,
  .button-row button {
    width: 100%;
  }

  .output-action-row {
    grid-template-columns: 1fr;
  }
}
