:root {
  --ink: #252525;
  --muted: #7a746d;
  --line: rgba(37, 37, 37, 0.11);
  --paper: #f8f5ef;
  --panel: #ffffff;
  --accent: #c6a15b;
  --accent-dark: #8a6a32;
  --accent-soft: #f5ecd9;
  --warm: #e8cfc8;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(18, 24, 22, 0.1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0%, var(--paper) 50%, #f1e7dc 100%);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 clamp(20px, 4vw, 42px);
  background: rgba(248, 245, 239, 0.9);
  border-bottom: 1px solid rgba(18, 24, 22, 0.08);
  backdrop-filter: blur(18px);
  max-width: 100vw;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #252525, #4a423a);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 750; }

.topbar nav {
  display: flex;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 14px;
}

.topbar nav a:hover { color: var(--ink); }

.account-pill {
  min-width: 116px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  cursor: pointer;
}

.account-pill:hover {
  border-color: rgba(198,161,91,.42);
  color: var(--accent-2);
}

main { padding: var(--v5-workbench-page-pad, 20px clamp(18px, 4vw, 42px)); }

.workspace-page-hero {
  max-width: var(--v5-workbench-max, 1500px);
  margin: 0 auto var(--v5-workbench-gap, 20px);
}

.studio-shell,
.studio-shell.batch-mode {
  min-width: 0;
}

.workflow-panel {
  position: relative;
  top: auto;
  align-self: start;
  padding: 24px;
  overflow: hidden;
}

.workflow-visual,
.jewelry-before-after,
.batch-visual {
  border: 1px solid var(--line);
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

.workflow-visual {
  height: 180px;
  margin-bottom: 20px;
  background-image: url("/static/assets/jewelry/hero-jewelry-studio-v2.png");
}

.jewelry-before-after {
  height: 210px;
  margin: 18px 0;
  background-image: url("/static/assets/jewelry/workflow-detail-v2.png");
}

.batch-visual {
  flex: 0 0 min(34vw, 420px);
  min-height: 190px;
  background-image: url("/static/assets/jewelry/workflow-batch-v2.png");
}

.workflow-kicker,
.section-title span,
.workflow-task-meta span,
.workflow-live-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workflow-panel h1 {
  margin: 10px 0 10px;
  font-size: 26px;
  line-height: 1.18;
}

.workflow-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.workflow-task-meta span {
  padding: 7px 10px;
  border: 1px solid rgba(198,161,91,.22);
  border-radius: 999px;
  background: rgba(245,236,217,.48);
  color: var(--accent);
}

.workflow-live-card {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251,252,250,.9);
}

.workflow-live-card strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

.workflow-live-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.task-panel {
  min-height: 640px;
  overflow: hidden;
}

.batch-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.batch-hero,
.batch-card {
  min-width: 0;
}

.batch-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.batch-hero span,
.section-title.compact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.batch-hero h2,
.section-title.compact h3 {
  margin: 6px 0 0;
  font-size: 26px;
}

.batch-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.batch-hero-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.batch-hero-actions a {
  min-height: 42px;
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.batch-hero-actions strong {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--muted);
  font-size: 13px;
}

.batch-login {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.auth-inline-hint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(18,24,22,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.74);
  box-shadow: var(--inner);
}

.auth-inline-hint strong {
  color: var(--ink);
  font-size: 13px;
}

.auth-inline-hint span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-inline-hint button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.auth-inline-hint.is-logged-in button {
  display: none;
}

.auth-inline-hint.needs-login {
  border-color: rgba(198,161,91,.72);
  background: #fffaf0;
  box-shadow: 0 0 0 3px rgba(198,161,91,.16), var(--inner);
}

.batch-import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  min-width: 0;
}

.batch-card { padding: 20px; }

.section-title.compact {
  display: grid;
  justify-content: start;
  gap: 4px;
  margin-bottom: 16px;
}

.batch-file-zone {
  display: grid;
  place-items: center;
  min-height: 128px;
  margin-bottom: 12px;
  border: 1px dashed #aebeb5;
  border-radius: 8px;
  background: #fbfdfc;
  cursor: pointer;
  text-align: center;
}

.batch-file-zone:hover,
.batch-file-zone.dragging {
  border-color: var(--accent);
  background: #f2faf6;
}

.batch-file-zone strong {
  color: var(--accent);
  font-size: 20px;
}

.batch-file-zone span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.image-zone {
  min-height: 104px;
}

.batch-asset-map {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 12px;
}

.batch-asset-map span {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.batch-actions button,
.batch-row button,
.batch-detail-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.batch-actions button:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

.batch-result-box {
  min-height: 54px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--muted);
  line-height: 1.6;
}

.batch-result-box strong,
.batch-result-box span { display: block; }

.batch-list {
  display: grid;
  gap: 10px;
}

.batch-empty-state {
  display: grid;
  align-content: center;
  min-height: 300px;
  padding: 24px;
  border: 1px solid rgba(198,161,91,.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,245,239,.9)),
    radial-gradient(circle at 82% 18%, rgba(232,207,200,.3), transparent 34%);
  text-align: left;
}

.batch-empty-state span,
.batch-empty-state strong,
.batch-empty-state p {
  display: block;
}

.batch-empty-state span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.batch-empty-state strong {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.18;
}

.batch-empty-state p {
  max-width: 320px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.batch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.batch-row.active {
  border-color: rgba(31, 122, 91, 0.45);
  background: #f1faf5;
}

.batch-row strong,
.batch-row small { display: block; }

.batch-row small {
  margin-top: 4px;
  color: var(--muted);
}

.batch-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.batch-detail-summary div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.batch-detail-summary strong,
.batch-detail-summary span { display: block; }

.batch-detail-summary strong { font-size: 22px; }

.batch-detail-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.batch-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.batch-detail-actions button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.batch-task-list {
  display: grid;
  gap: 10px;
}

.batch-task-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.batch-task-card img {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
}

.batch-output-strip {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.batch-output-strip img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: rgba(251,252,250,.72);
}

.stepper button {
  height: 48px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.stepper button:last-child { border-right: 0; }
.stepper button.active {
  color: var(--accent);
  background: rgba(245,236,217,.72);
  box-shadow: inset 0 3px 0 var(--accent);
}

.single-page-flow {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.generate-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(198,161,91,.16);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(248,245,239,.7));
}

.generate-summary strong,
.generate-summary span,
.generate-summary em,
.generate-summary small {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generate-summary strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.generate-summary span,
.generate-summary em,
.generate-summary small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.generate-summary small {
  margin-left: auto;
  color: var(--accent);
  font-weight: 800;
}

.step-view {
  display: none;
  padding: 22px 24px 24px;
}

.step-view.active { display: block; }

.single-page-flow .step-view {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18,24,22,.04);
  scroll-margin-top: 92px;
}

.single-page-flow .step-view + .step-view {
  margin-top: 0;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.step-view > .section-title {
  display: grid;
  justify-content: start;
  gap: 4px;
}

.section-title h2 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.15;
}

.step-view > .section-title p {
  max-width: 680px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.login-strip {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(150px, 1fr) minmax(120px, 0.8fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(18,24,22,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.login-context {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.login-context strong {
  color: var(--ink);
  font-size: 13px;
}

.login-strip.is-logged-in {
  grid-template-columns: 1fr;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
}

.login-strip.is-logged-in input,
.login-strip.is-logged-in button,
.login-strip.is-logged-in small,
.login-strip.is-logged-in .login-context {
  display: none;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.12);
}

.login-strip button,
.generate-btn {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.login-strip button {
  height: 44px;
  padding: 0 16px;
}

.login-strip small {
  color: var(--muted);
  font-size: 12px;
}

.auth-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.auth-dialog::backdrop {
  background: rgba(37,37,37,.28);
  backdrop-filter: blur(8px);
}

.dialog-close {
  float: right;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.auth-copy {
  display: grid;
  clear: both;
  gap: 8px;
  margin: 10px 0 16px;
}

.auth-copy span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.auth-copy strong {
  font-size: 20px;
  line-height: 1.35;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.login-form small {
  color: var(--muted);
  font-size: 12px;
}

.upload-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  margin-bottom: 10px;
  border: 1px dashed rgba(198, 161, 91, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(250,245,235,.9));
  cursor: pointer;
  text-align: center;
  overflow: hidden;
}

.upload-zone.has-assets {
  place-items: stretch;
  padding: 14px;
  background: #fff;
}

.upload-zone::before {
  display: none;
}

.upload-placeholder,
.upload-zone > span,
.upload-zone > strong,
.upload-zone > em {
  position: relative;
  z-index: 1;
  margin-left: 0;
}

.upload-placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 520px;
  padding: 22px;
}

.upload-zone.has-assets .upload-placeholder {
  display: none;
}

.upload-zone span,
.upload-placeholder span {
  display: block;
  color: var(--accent);
  font-size: 23px;
  font-weight: 900;
}

.upload-zone strong,
.upload-placeholder strong {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.upload-zone em,
.upload-placeholder em {
  display: block;
  max-width: 420px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.6;
}

.mobile-upload-actions {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}

.mobile-upload-actions button {
  min-height: 44px;
}

.mobile-upload-actions .secondary {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.76);
  color: var(--ink);
}

.upload-role-list {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 8px;
  background: var(--accent-soft);
}

.upload-role-list:empty { display: none; }

.upload-role-list strong,
.upload-role-list p {
  display: block;
  margin: 0;
}

.upload-role-list p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.upload-role-list div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-role-list span {
  padding: 7px 10px;
  border: 1px solid rgba(31, 122, 91, 0.16);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  width: 100%;
}

.asset-grid:empty { display: none; }

.asset-count {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.asset-grid figure {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 32px rgba(18, 24, 22, 0.06);
}

.asset-grid figure.asset-uploading img {
  filter: saturate(.82) contrast(.96);
  opacity: .72;
}

.asset-grid figure.asset-uploading::after {
  content: "上传中";
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(18, 24, 22, .08);
}

.asset-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  background: rgba(18,24,22,.76);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.asset-add {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  height: auto;
  aspect-ratio: 1;
  padding: 0 10px;
  border: 1px dashed rgba(198,161,91,.36);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  align-self: start;
}

.asset-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.asset-grid figcaption {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-grid figcaption b {
  display: inline-block;
  margin-right: 6px;
  color: var(--accent);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.product-intel-grid {
  position: relative;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(18,24,22,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  overflow: hidden;
}

.product-intel-grid::before {
  display: none;
}

.product-intel-after-upload {
  margin-top: 14px;
}

.product-intel-head {
  display: grid;
  gap: 4px;
  padding-bottom: 2px;
}

.product-intel-head strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.product-intel-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.package-guidance-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(18,24,22,.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,245,239,.78)),
    linear-gradient(135deg, rgba(198,161,91,.08), rgba(232,207,200,.08));
}

.product-followup-field {
  display: grid;
  align-self: stretch;
  grid-column: 1;
  grid-template-rows: auto minmax(84px, 1fr) auto;
}

.product-followup-field #sellingPoints {
  min-height: 84px;
}

.package-guidance-card > strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.package-guidance-card > small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.package-guidance-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.package-guidance-card .package-strategy-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.package-guidance-card em {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(198,161,91,.12);
  color: #72551c;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.ai-direction-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(55, 107, 79, .18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(238, 247, 241, .95), rgba(255, 252, 246, .96));
}

.ai-direction-card span,
.ai-direction-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-direction-card strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.3;
}

.ai-direction-card p {
  margin: 6px 0 0;
  color: #486255;
  font-size: 13px;
  font-weight: 800;
}

.ai-direction-state {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.ai-direction-state > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ai-direction-state button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(55, 107, 79, .2);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ai-direction-state button:first-child {
  background: var(--accent);
  color: #fff;
}

.ai-direction-state button:disabled {
  cursor: default;
  opacity: .7;
}

.smart-preview-page .package-guidance-card {
  gap: 14px;
  padding: 16px;
  border-color: rgba(138,106,50,.22);
  background: linear-gradient(180deg, #fffdf9, #fbf6eb);
}

.smart-default-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(198,161,91,.3);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(80, 64, 38, .08);
}

.smart-default-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.smart-default-head span,
.smart-default-grid span {
  display: block;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.smart-default-head strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.2;
}

.smart-default-head em {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.smart-default-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.smart-default-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(37,37,37,.08);
  border-radius: 8px;
  background: rgba(248,245,239,.62);
}

.smart-default-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.35;
}

.smart-default-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.smart-flow-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.smart-flow-map article {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(37,37,37,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.smart-flow-map article.active {
  border-color: rgba(198,161,91,.42);
  background: linear-gradient(180deg, #fffaf0, #fff);
  box-shadow: 0 14px 34px rgba(126,95,36,.1);
}

.smart-flow-map span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.smart-flow-map strong {
  font-size: 14px;
  line-height: 1.3;
}

.smart-flow-map small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.smart-manual-settings {
  border: 1px solid rgba(37,37,37,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.smart-manual-settings > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
}

.smart-manual-settings > summary::-webkit-details-marker {
  display: none;
}

.smart-manual-settings > summary span {
  font-size: 14px;
  font-weight: 900;
}

.smart-manual-settings > summary b {
  color: var(--muted);
  font-size: 12px;
}

.smart-manual-panel {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.smart-config-line {
  position: relative;
  min-width: 0;
}

.smart-config-line summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(198,161,91,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
  min-width: 0;
  cursor: pointer;
  list-style: none;
}

.smart-config-line summary::-webkit-details-marker {
  display: none;
}

.smart-config-line summary span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.smart-config-line summary strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.smart-config-line summary b {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.smart-config-line summary em {
  padding: 4px 8px;
  border: 1px solid rgba(198,161,91,.2);
  border-radius: 999px;
  background: rgba(198,161,91,.08);
  color: #72551c;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.resolution-config-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(198,161,91,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
}

.resolution-config-line span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.resolution-config-line strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.resolution-config-line em {
  padding: 4px 8px;
  border: 1px solid rgba(198,161,91,.2);
  border-radius: 999px;
  background: rgba(198,161,91,.08);
  color: #72551c;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.resolution-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(18,24,22,.08);
  border-radius: 999px;
  background: rgba(248,245,239,.72);
}

.resolution-toggle button {
  min-width: 42px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.resolution-toggle button.active {
  background: #fff;
  color: #72551c;
  box-shadow: 0 8px 18px rgba(37,37,37,.08);
}

.smart-config-popover {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(198,161,91,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 14px 32px rgba(37,37,37,.08);
}

.smart-config-popover p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.count-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px;
  border: 1px solid rgba(18,24,22,.08);
  border-radius: 8px;
  background: rgba(248,245,239,.56);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.count-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-stepper button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(198,161,91,.3);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.count-stepper strong {
  min-width: 46px;
  text-align: center;
  color: var(--ink);
  font-size: 13px;
}

.style-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.style-chip {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 9px;
  border: 1px solid rgba(198,161,91,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.style-chip.active {
  border-color: rgba(198,161,91,.42);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(198,161,91,.1));
}

.style-chip:hover {
  border-color: rgba(198,161,91,.32);
  background: rgba(255,255,255,.94);
}

.style-chip strong {
  color: #5f4617;
  font-size: 12px;
  font-weight: 900;
}

.style-chip small {
  color: #7a746d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.style-chip.active strong {
  color: var(--accent-dark);
}

.advanced-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0 18px 18px;
}

.dynamic-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-grid label span {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.product-intel-grid input,
.product-intel-grid select,
.product-intel-grid textarea {
  border-color: rgba(18,24,22,.09);
  background: rgba(255,255,255,.88);
}

.product-intel-grid input,
.product-intel-grid select {
  height: 48px;
  font-weight: 800;
}

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.field-with-action button {
  min-width: 104px;
  padding: 0 14px;
  border: 1px solid rgba(198,161,91,.34);
  border-radius: 8px;
  background: rgba(198,161,91,.1);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.field-with-action button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.field-with-action button:not(:disabled):hover {
  background: var(--accent);
  color: #fff;
}

.field-grid label span em {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(198,161,91,.22);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.field-grid label small,
.advanced-grid label small {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.field-grid label.full-row {
  grid-column: 1 / -1;
}

.auto-analysis-status {
  margin-top: 12px;
  padding: 12px 14px 12px 38px;
  border: 1px solid rgba(198,161,91,.32);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,248,232,.94), rgba(255,255,255,.96));
  color: #72551c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  position: relative;
}

.auto-analysis-status::before {
  content: "AI";
  position: absolute;
  left: 12px;
  top: 12px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.auto-analysis-status.pending {
  border-color: rgba(46,125,91,.24);
  background: linear-gradient(135deg, rgba(237,248,241,.95), rgba(255,255,255,.96));
  color: var(--accent);
}

.auto-analysis-status.ready {
  border-color: rgba(46,125,91,.24);
  background: linear-gradient(135deg, rgba(237,248,241,.95), rgba(255,255,255,.96));
  color: var(--accent);
}

.auto-analysis-status.stale {
  background: rgba(245,236,217,.58);
  color: #8a6a24;
}

.auto-analysis-status.failed {
  background: rgba(255,242,242,.72);
  color: var(--red);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.chips span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.generate-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 18px 0 12px;
}

.generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 24%;
  min-width: 0;
  min-height: 56px;
  margin: 0;
  padding: 0 16px;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  user-select: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
  -webkit-tap-highlight-color: transparent;
}

#generateBtn {
  flex: 1 1 42%;
  min-height: 62px;
  font-size: 18px;
  box-shadow: 0 10px 22px rgba(126,95,36,.18);
}

.generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37,37,37,.08);
}

.generate-btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 8px rgba(37,37,37,.12);
}

.generate-btn:focus-visible {
  outline: 3px solid rgba(198,161,91,.28);
  outline-offset: 2px;
}

.generate-btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.generate-btn.tertiary {
  background: #fff;
  color: var(--accent);
  border: 1px solid rgba(198,161,91,.34);
  cursor: pointer;
}

.generate-btn.tertiary:hover {
  border-color: rgba(198,161,91,.62);
  background: rgba(255,248,233,.76);
}

.submit-status {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(198,161,91,.16);
  border-radius: 8px;
  background: rgba(251,252,250,.86);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.generate-btn:disabled,
.login-strip button:disabled {
  background: #b8c7c0;
  cursor: not-allowed;
}

.result-panel {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
}

.result-center-view {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(252,248,240,.92)),
    linear-gradient(135deg, rgba(198,161,91,.08), rgba(232,207,200,.08));
}

.result-center-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.result-rail {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(198,161,91,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 14px 34px rgba(18,24,22,.06);
}

.result-rail strong,
.result-rail span,
.result-rail p {
  display: block;
  margin: 0;
}

.result-rail strong {
  font-size: 18px;
}

.result-rail span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.result-rail p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.result-action-stack {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.result-history-box {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.result-history-box > strong {
  font-size: 14px;
}

.result-delivery-note {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid rgba(198,161,91,.22);
  border-radius: 8px;
  background: rgba(248,245,239,.72);
}

.result-delivery-note strong,
.result-delivery-note span {
  display: block;
}

.result-delivery-note strong {
  font-size: 14px;
}

.result-delivery-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

#resultHistoryPanel {
  display: grid;
  gap: 7px;
}

.history-task-row {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 54px;
  padding: 9px;
  border: 1px solid rgba(198,161,91,.16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.history-task-row strong,
.history-task-row span {
  display: block;
}

.history-task-row strong {
  font-size: 12px;
  line-height: 1.3;
}

.history-task-row span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.result-action-stack button,
.result-toolbar button,
.mobile-bottom-flow button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.result-action-stack button:first-child,
.result-toolbar button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.result-action-stack .secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.result-center-panel {
  min-height: 420px;
  background: rgba(255,255,255,.86);
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff 0%, #edf8f1 100%);
}

.result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.72);
}

.result-toolbar button {
  min-height: 38px;
  padding: 0 12px;
}

.export-preset-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,245,239,.9)),
    radial-gradient(circle at top right, rgba(198,161,91,.16), transparent 38%);
}

.export-preset-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.export-preset-head span,
.export-preset-head strong,
.export-preset-head small {
  display: block;
}

.export-preset-head span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.export-preset-head strong {
  margin-top: 4px;
  font-size: 18px;
}

.export-preset-head small,
.export-preset-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.export-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
}

.export-preset-card {
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 11px;
  border: 1px solid rgba(198,161,91,.24);
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 24px rgba(37,37,37,.04);
}

.export-preset-card:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.export-preset-card:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.export-preset-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.export-preset-card strong {
  font-size: 14px;
}

.export-preset-card span {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(198,161,91,.14);
  color: #7b5d20;
  font-size: 12px;
  font-weight: 900;
}

.export-preset-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.result-summary div:not(.result-progress) {
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(50, 90, 70, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.result-summary span,
.result-summary strong {
  display: block;
}

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

.result-summary strong {
  margin-top: 8px;
  font-size: 22px;
}

.result-progress {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: #dfe9e3;
  overflow: hidden;
}

.result-next-step span {
  color: var(--accent);
  font-weight: 900;
}

.result-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #73b58b);
  transition: width 0.3s ease;
}

.generation-submitted {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(237,248,241,.82));
}

.generation-copy span,
.generation-copy strong,
.generation-copy p {
  display: block;
}

.generation-copy span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.generation-copy strong {
  margin-top: 4px;
  font-size: 22px;
}

.generation-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.empty-result {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px;
}

.result-section {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.result-section:last-child { border-bottom: 0; }

.result-section h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.result-quality-checklist {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,245,239,.72)),
    linear-gradient(135deg, rgba(198,161,91,.08), rgba(232,207,200,.08));
}

.result-quality-checklist > div:first-child {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.result-quality-checklist span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.result-quality-checklist strong {
  color: var(--ink);
}

.result-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.result-quality-grid article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
}

.result-quality-grid article.ok {
  border-color: rgba(198,161,91,.32);
  background: rgba(255,255,255,.92);
}

.result-quality-grid b {
  color: var(--muted);
  font-size: 11px;
}

.result-quality-grid article.ok b {
  color: var(--accent);
}

.result-quality-grid small {
  color: var(--muted);
  line-height: 1.45;
}

.result-section .result-grid {
  padding: 0;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(18, 24, 22, 0.06);
}

.result-card.detail { grid-row: span 2; }

.result-card-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
  text-decoration: none;
}

.result-card-preview:focus-visible {
  outline: 3px solid rgba(58, 126, 86, 0.34);
  outline-offset: -3px;
}

.result-card-preview:hover img {
  transform: scale(1.015);
}

.result-card img {
  width: 100%;
  aspect-ratio: var(--result-ratio, 1 / 1);
  object-fit: cover;
  display: block;
  transition: transform .18s ease;
}

.result-card.detail img,
.result-card.detail .result-card-placeholder { aspect-ratio: var(--result-ratio, 1 / 2); }

.result-card-placeholder {
  display: grid;
  gap: 8px;
  place-items: center;
  width: 100%;
  aspect-ratio: var(--result-ratio, 1 / 1);
  background:
    linear-gradient(110deg, rgba(255,255,255,.16) 8%, rgba(255,255,255,.68) 18%, rgba(255,255,255,.16) 33%),
    linear-gradient(135deg, rgba(58, 126, 86, 0.10), rgba(246, 183, 92, 0.13)),
    repeating-linear-gradient(45deg, rgba(24, 32, 28, 0.035) 0 10px, transparent 10px 20px);
  background-size: 220% 100%, 100% 100%, 100% 100%;
  color: var(--accent);
  font-weight: 800;
  padding: 16px;
  text-align: center;
  animation: v5-result-card-breathe 2.4s ease-in-out infinite, v5-result-card-shimmer 2.8s linear infinite;
}

.result-card-placeholder span,
.result-card-placeholder small {
  display: block;
}

.result-card-placeholder small {
  max-width: 12em;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.result-card.pending {
  border-style: dashed;
}

@keyframes v5-result-card-breathe {
  0%, 100% { opacity: .78; }
  50% { opacity: 1; }
}

@keyframes v5-result-card-shimmer {
  0% { background-position: 220% 0, 0 0, 0 0; }
  100% { background-position: -220% 0, 0 0, 0 0; }
}

.result-card > div:not(.result-card-placeholder) {
  padding: 10px;
}

.result-card strong {
  display: block;
  font-size: 13px;
}

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

.result-size-label {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(58, 126, 86, 0.18);
  border-radius: 999px;
  background: rgba(58, 126, 86, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.result-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.result-card-actions a,
.result-card-actions button {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.empty-result.compact {
  min-height: 54px;
  padding: 10px;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.toast.error { border-color: rgba(180, 35, 24, 0.35); color: var(--danger); }

.mobile-bottom-flow {
  display: none;
}

@media (max-width: 920px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px 20px; }
  .topbar nav { flex-wrap: wrap; gap: 10px 14px; }
  main { padding: 16px; }
  .studio-shell,
  .studio-shell.batch-mode {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
  }
  .workflow-panel { position: static; }
  .workflow-panel,
  .task-panel,
  .batch-panel {
    width: 100%;
    min-width: 0;
  }
  .batch-visual {
    flex-basis: auto;
    width: 100%;
    min-height: 160px;
  }
  .login-strip { grid-template-columns: 1fr; }
  .generate-actions { flex-direction: column; }
  .batch-import-grid { grid-template-columns: 1fr; }
  .batch-hero { align-items: flex-start; flex-direction: column; }
  .batch-detail-summary { grid-template-columns: repeat(2, 1fr); }
  .upload-zone::before { display: none; }
  .upload-placeholder,
  .upload-zone > span,
  .upload-zone > strong,
  .upload-zone > em { margin-left: 0; }
  .mobile-upload-actions { display: grid; }
  .upload-role-list { grid-template-columns: 1fr; }
  .product-intel-grid { grid-template-columns: 1fr; }
  .product-followup-field {
    grid-column: auto;
    grid-row: auto;
  }
  .package-guidance-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ai-direction-card {
    grid-template-columns: 1fr;
  }
  .ai-direction-state {
    justify-items: stretch;
  }
  .ai-direction-state > div,
  .ai-direction-state button {
    width: 100%;
  }
  .smart-default-head {
    display: grid;
  }
  .smart-default-head em {
    width: max-content;
  }
  .smart-default-grid {
    grid-template-columns: 1fr 1fr;
  }
  .smart-config-line summary { align-items: flex-start; }
  .style-chip-grid { grid-template-columns: 1fr; }
  .product-followup-field {
    grid-template-rows: auto auto auto;
  }
  .product-followup-field #sellingPoints {
    min-height: 76px;
  }
  .dynamic-fields { grid-template-columns: 1fr; }
  .single-page-flow {
    padding: 12px;
  }
  .single-page-flow .step-view {
    padding: 16px;
  }
  .stepper {
    display: none;
  }
  .result-center-shell {
    grid-template-columns: 1fr;
  }
  .result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .result-quality-checklist > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }
  .result-quality-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .result-next-step {
    grid-column: 1 / -1;
  }
}
