:root {
  --bg: #f4f6fa;
  --shell: #f4f6fa;
  --line: #d8dde6;
  --line-strong: #c5ceda;
  --text: #171f2d;
  --muted: #687487;
  --accent: #071224;
  --accent2: #0d3d4d;
  --assistant: #ffffff;
  --user: #e7f0ff;
  --danger: #b42318;
  --good: #16803d;
  --warn: #b37512;
  --sidebar: #081121;
  --sidebar-panel: #0f1a2e;
  --sidebar-active: #12324a;
  --sidebar-text: #eef5ff;
  --sidebar-muted: #8ea0b8;
  --sidebar-accent: #0ea5b7;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    "Helvetica Neue",
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

.bg-shape {
  display: none;
}

.bg-shape-a {
  width: 320px;
  height: 320px;
  background: #9dc6ea;
  top: -140px;
  left: -90px;
}

.bg-shape-b {
  width: 360px;
  height: 360px;
  background: #eab894;
  right: -120px;
  bottom: -140px;
}

.shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  margin: 0;
  height: 100vh;
  border: none;
  border-radius: 0;
  background: var(--shell);
  backdrop-filter: none;
  overflow: hidden;
  box-shadow: none;
}

.hidden {
  display: none !important;
}

.login-panel {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 22px 42px rgba(15, 28, 52, 0.08);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

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

.login-form label {
  display: grid;
  gap: 5px;
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

button {
  border: none;
  font: inherit;
  cursor: pointer;
}

.error {
  margin-top: 10px;
  color: var(--danger);
  font-size: 14px;
}

.app-panel {
  height: 100%;
  display: grid;
  grid-template-columns: 460px 1fr;
}

.app-panel.module-start,
.app-panel.module-create {
  grid-template-columns: 1fr;
}

.app-panel.module-start .sidebar,
.app-panel.module-create .sidebar {
  display: none;
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 183, 0.12), transparent 28%),
    linear-gradient(180deg, #0a1324 0%, #081121 100%);
  color: var(--sidebar-text);
}

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

.brand {
  font-weight: 700;
  color: var(--sidebar-text);
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: #05111d;
  background: linear-gradient(135deg, #50d5e6 0%, #7edfb0 100%);
  box-shadow: 0 8px 18px rgba(22, 163, 184, 0.25);
}

.brand-copy {
  min-width: 0;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.mini-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
}

.sidebar .mini-btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
}

.primary-btn {
  background: linear-gradient(135deg, #0c5562 0%, #0d6e7f 100%);
  color: #fff;
  border: 1px solid rgba(69, 211, 228, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(2, 132, 199, 0.18);
}

.sidebar-action-btn {
  width: 100%;
  margin-top: -4px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(14, 165, 183, 0.12);
  color: var(--sidebar-text);
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 700;
  text-align: left;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.sidebar-action-btn:hover {
  background: rgba(14, 165, 183, 0.2);
  border-color: rgba(125, 211, 252, 0.58);
  transform: translateY(-1px);
}

.section-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar .section-label {
  color: var(--sidebar-muted);
}

.section-label.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#offerFilterInput {
  font-size: 13px;
  padding: 9px 10px;
}

.offers-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.offers-controls select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}

.link-btn {
  background: transparent;
  color: var(--accent2);
  font-size: 12px;
  padding: 0;
}

.sidebar .link-btn {
  color: #9bd7e7;
}

.sessions,
.offers {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sessions {
  max-height: 34vh;
}

.offers {
  flex: 1;
}

.session-item,
.offer-item {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 13px;
  text-align: left;
}

.sidebar .session-item,
.sidebar .offer-item {
  border-color: rgba(255, 255, 255, 0.14);
  background: var(--sidebar-panel);
  color: var(--sidebar-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.session-card-layout {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.session-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: #eef2f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.session-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.session-copy {
  min-width: 0;
}

.offer-card-layout {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.offer-thumb {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f3f6fa;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
}

.sidebar .session-thumb,
.sidebar .offer-thumb {
  border-color: rgba(255, 255, 255, 0.16);
  background: #172235;
  color: var(--sidebar-muted);
}

.offer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.offer-thumb.is-empty {
  opacity: 0.72;
}

.offer-copy {
  min-width: 0;
}

.session-item.active {
  border-color: #2f5f96;
  background: #e9f1ff;
  box-shadow: inset 0 0 0 1px rgba(47, 95, 150, 0.16);
}

.sidebar .session-item.active {
  border-color: #0e7490;
  background: var(--sidebar-active);
  box-shadow: none;
}

.session-item .title,
.offer-item .title {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.session-item .meta,
.offer-item .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.sidebar .session-item .meta,
.sidebar .offer-item .meta {
  color: var(--sidebar-muted);
}

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

.channel-badge {
  font-size: 10px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.channel-badge.fba {
  color: #0d7a3a;
  border-color: rgba(13, 122, 58, 0.35);
  background: rgba(13, 122, 58, 0.08);
}

.channel-badge.fbm {
  color: #8b4c00;
  border-color: rgba(139, 76, 0, 0.35);
  background: rgba(139, 76, 0, 0.08);
}

.sidebar .channel-badge.fba {
  color: #74e0a2;
  border-color: rgba(116, 224, 162, 0.45);
  background: rgba(13, 122, 58, 0.14);
}

.sidebar .channel-badge.fbm {
  color: #f6c77d;
  border-color: rgba(246, 199, 125, 0.45);
  background: rgba(139, 76, 0, 0.14);
}

.channel-badge.unknown {
  color: var(--muted);
}

.offers-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-top: 8px;
}

.offers-page-info {
  font-size: 12px;
  color: var(--muted);
}

.sidebar .offers-page-info {
  color: var(--sidebar-muted);
}

.sidebar input,
.sidebar select {
  border-color: rgba(255, 255, 255, 0.16);
  background: #0f1726;
  color: var(--sidebar-text);
}

.sidebar input::placeholder {
  color: #8595ad;
}

.workspace {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.workspace.dock-expanded .history,
.workspace.dock-expanded .sku-memory {
  display: none;
}

.workspace.dock-expanded .workspace-dock {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
}

.workspace.dock-expanded .create-panel {
  padding-bottom: 10px;
}

.workspace-top {
  border-bottom: 1px solid var(--line-strong);
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
}

.module-home-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #18365a;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  margin: 0 0 10px;
}

.module-home-btn:hover {
  border-color: rgba(14, 116, 144, 0.45);
  background: #f4fbff;
}

.workspace-top > div:first-child {
  min-width: 0;
  flex: 1;
}

.workspace-top h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.workspace-top p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-chip {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  padding: 6px 10px;
}

.status-chip.ok {
  color: var(--good);
  border-color: rgba(22, 128, 61, 0.35);
}

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

.status-chip.pending {
  color: var(--warn);
}

.history {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sku-memory {
  margin: 10px 20px 0;
  border: 1px solid rgba(47, 95, 150, 0.3);
  background: #eef5ff;
  color: #17406f;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  width: fit-content;
}

.module-chooser {
  margin: 14px 22px 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.2fr);
  gap: 14px;
  align-items: stretch;
}

.app-panel.module-start .workspace {
  background:
    radial-gradient(circle at 18% 22%, rgba(80, 213, 230, 0.16), transparent 30%),
    radial-gradient(circle at 84% 80%, rgba(255, 102, 0, 0.10), transparent 34%),
    #f4f5f7;
}

.app-panel.module-start .workspace-top {
  border-bottom: none;
  background: transparent;
  padding: 28px 34px 0;
}

.app-panel.module-start .history,
.app-panel.module-start .sku-memory,
.app-panel.module-start .workspace-tools,
.app-panel.module-start .composer {
  display: none;
}

.app-panel.module-start .module-chooser {
  margin: auto;
  width: min(1240px, calc(100% - 64px));
  min-height: 420px;
  padding: 28px;
  grid-template-columns: 0.85fr 1.45fr;
  gap: 24px;
  border-radius: 26px;
  border-color: rgba(17, 24, 39, 0.12);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.10);
}

.app-panel.module-start .module-chooser-copy {
  border-radius: 22px;
  padding: 24px;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(80, 213, 230, 0.28), transparent 34%),
    linear-gradient(155deg, #081121 0%, #12324a 100%);
}

.app-panel.module-start .module-chooser-copy span {
  color: #8ee7f2;
}

.app-panel.module-start .module-chooser-copy h3 {
  margin: 16px 0 10px;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.app-panel.module-start .module-chooser-copy p {
  color: rgba(238, 245, 255, 0.74);
  font-size: 15px;
  line-height: 1.55;
}

.app-panel.module-start .module-cards {
  gap: 16px;
}

.app-panel.module-start .module-card {
  position: relative;
  min-height: 260px;
  padding: 24px;
  border-radius: 22px;
  overflow: hidden;
}

.app-panel.module-start .module-card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -46px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: rgba(14, 165, 183, 0.10);
}

.app-panel.module-start .module-card strong {
  position: relative;
  z-index: 1;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.app-panel.module-start .module-card span {
  position: relative;
  z-index: 1;
  font-size: 14px;
  line-height: 1.55;
}

.app-panel.module-start .module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 116, 144, 0.45);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.10);
}

.app-panel.module-start .module-card:nth-child(2)::after {
  background: rgba(255, 102, 0, 0.12);
}

.app-panel.module-start .spapi-auth-card {
  grid-column: 2;
}

.app-panel.module-create .history,
.app-panel.module-create .sku-memory,
.app-panel.module-create .composer {
  display: none;
}

.app-panel.module-create .workspace-tools {
  flex: 1;
  border-top: none;
}

.app-panel.module-create .workspace-tools-tabs {
  display: none;
}

.app-panel.module-create .workspace-dock {
  flex: 1;
  height: auto;
  max-height: none;
  border-top: 1px solid var(--line-strong);
}

.app-panel.module-create .create-panel {
  height: 100%;
  max-height: none;
  padding: 18px 20px 22px;
  background:
    radial-gradient(circle at 15% 10%, rgba(80, 213, 230, 0.14), transparent 30%),
    radial-gradient(circle at 88% 86%, rgba(255, 102, 0, 0.08), transparent 32%),
    #f4f6f9;
}

.app-panel.module-create .create-workspace {
  width: min(1960px, calc(100vw - 40px));
  max-width: none;
  margin: 0 auto;
}

.module-chooser-copy span {
  color: var(--accent2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.module-chooser-copy h3 {
  margin: 4px 0;
  font-size: 18px;
}

.module-chooser-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.module-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.module-card {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 6px;
  color: var(--text);
  cursor: pointer;
}

.module-card strong {
  font-size: 16px;
}

.module-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.module-card.active {
  border-color: rgba(14, 116, 144, 0.52);
  background: linear-gradient(135deg, rgba(14, 165, 183, 0.12), rgba(255, 255, 255, 0.95));
  box-shadow: 0 12px 28px rgba(14, 116, 144, 0.1);
}

.spapi-auth-card {
  border: 1px solid rgba(14, 116, 144, 0.24);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.spapi-auth-card.is-disabled {
  opacity: 0.62;
}

.spapi-auth-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--accent2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spapi-auth-card strong {
  display: block;
  font-size: 17px;
}

.spapi-auth-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.spapi-auth-actions {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
}

.spapi-auth-result {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.spapi-auth-result a {
  color: var(--accent2);
  font-weight: 800;
}

.spapi-auth-note {
  margin-top: 6px;
}

.workspace-tools {
  border-top: 1px solid var(--line-strong);
  background: var(--panel-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.workspace-tools-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 10px;
  overflow-x: auto;
}

.tool-tab {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease;
}

.tool-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(140deg, #0d223d, #144a63);
  box-shadow: 0 6px 14px rgba(15, 34, 60, 0.12);
}

.tool-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.workspace-dock {
  border-top: 1px solid var(--line-strong);
  background: var(--panel);
  height: 520px;
  min-height: 320px;
  max-height: 60vh;
  overflow: hidden;
  min-width: 0;
}

.images-panel {
  height: 100%;
  padding: 18px 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: auto;
}

.images-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.images-panel-top h3 {
  margin: 0;
  font-size: 18px;
}

.images-panel-top p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.images-gallery {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 8px;
  padding-bottom: 4px;
}

.image-card {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 118px;
  width: 118px;
}

.image-card img {
  width: 100px;
  height: 100px;
  margin: 8px auto 0;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.image-card .meta {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 8px 8px;
  line-height: 1.35;
}

.image-card .meta .res {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.images-upload {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.attribute-editor {
  height: 100%;
  padding: 18px 20px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  min-height: 0;
}

.offer-editor-panel {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.offer-editor-panel-top h4 {
  margin: 0;
  font-size: 15px;
}

.offer-editor-panel-top p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.offer-editor-list {
  padding-right: 0;
}

.instructions-panel {
  height: 100%;
  padding: 18px 20px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  min-height: 0;
}

.instructions-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.instructions-panel-top h3 {
  margin: 0;
  font-size: 18px;
}

.instructions-panel-top p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.instructions-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.instructions-last-used {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.instructions-last-used-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.instructions-last-used-list {
  font-size: 13px;
  color: var(--text);
}

.instructions-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
}

.instructions-files-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.instruction-file-item {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.instruction-file-item.active {
  border-color: rgba(20, 98, 201, 0.45);
  background: rgba(233, 241, 255, 0.9);
}

.instructions-editor-wrap {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.instruction-file-name {
  font-weight: 700;
  font-size: 13px;
}

.instruction-editor {
  width: 100%;
  min-height: 0;
  height: 100%;
  resize: none;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  line-height: 1.5;
  background: #fff;
}

.attribute-editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attribute-editor-top h3 {
  margin: 0;
  font-size: 18px;
}

.attribute-editor-top p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.attribute-suggest-trace {
  border: 1px solid rgba(20, 98, 201, 0.42);
  background: rgba(233, 241, 255, 0.82);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.attribute-suggest-trace-title {
  font-weight: 700;
  font-size: 13px;
}

.attribute-suggest-trace-meta {
  font-size: 11px;
  color: var(--muted);
}

.attribute-suggest-trace-block {
  display: none;
}

.attribute-suggest-trace-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.attribute-suggest-trace-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(20, 98, 201, 0.24);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  padding: 10px 12px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  max-height: 220px;
  overflow: auto;
}

.attribute-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.offer-context-bar {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-context-bar .context-chip {
  border: 1px solid rgba(23, 64, 111, 0.24);
  background: rgba(235, 244, 255, 0.88);
  color: #17406f;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.attribute-editor-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 2px 6px 4px 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#attributeEditorFilter {
  position: relative;
  z-index: 2;
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(15, 28, 52, 0.04);
}

.payload-panel,
.audit-panel,
.diagnostics-panel,
.create-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 18px 20px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.payload-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.create-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.payload-panel-top,
.audit-panel-top,
.create-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payload-panel-top h3,
.audit-panel-top h3,
.create-panel-top h3 {
  margin: 0;
  font-size: 18px;
}

.payload-panel-top p,
.audit-panel-top p,
.create-panel-top p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.create-workspace {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(190px, 230px);
  gap: 12px;
}

.create-process-panel,
.create-help-panel,
.create-main-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 22px;
}

.create-process-panel {
  padding: 20px;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(80, 213, 230, 0.26), transparent 34%),
    linear-gradient(155deg, #081121 0%, #12324a 100%);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}

.create-process-kicker,
.create-help-kicker,
.create-main-intro span {
  color: #0e7490;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.create-process-panel .create-process-kicker {
  color: #8ee7f2;
}

.create-process-panel h4,
.create-help-panel h4 {
  margin: 12px 0 8px;
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.create-process-panel p,
.create-help-panel p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.create-process-panel p {
  color: rgba(238, 245, 255, 0.74);
}

.create-process-steps {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}

.create-process-steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 245, 255, 0.80);
}

.create-process-steps li > span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
}

.create-process-steps strong,
.create-process-steps small {
  display: block;
  overflow-wrap: anywhere;
}

.create-process-steps small {
  margin-top: 2px;
  color: rgba(238, 245, 255, 0.56);
  font-size: 11px;
}

.create-process-steps li.active {
  border-color: rgba(125, 211, 252, 0.62);
  background: rgba(14, 165, 183, 0.18);
  color: #fff;
}

.create-process-steps li.done > span {
  color: #052e1c;
  background: linear-gradient(135deg, #74e0a2 0%, #8ee7f2 100%);
}

.create-process-steps li.warning {
  border-color: rgba(246, 199, 125, 0.62);
  background: rgba(139, 76, 0, 0.16);
}

.create-main-panel {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
}

.create-main-panel *,
.create-process-panel *,
.create-help-panel * {
  min-width: 0;
}

.create-main-intro {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.create-main-intro strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.create-main-intro p {
  max-width: none;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.create-help-panel {
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

.create-help-panel h4 {
  color: var(--ink);
}

.create-help-panel p {
  color: var(--muted);
}

.create-help-list {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.create-help-list div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
}

.create-help-list strong,
.create-help-list span {
  display: block;
}

.create-help-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.create-flow {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.create-card {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 18px;
  background: #fff;
  padding: 16px 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
  min-width: 0;
  overflow-wrap: anywhere;
}

.create-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.create-card h4 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.create-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.create-upload-row,
.create-product-type-row,
.create-locale-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.create-locale-row {
  grid-template-columns: minmax(160px, 260px) minmax(0, 1fr);
  align-items: start;
}

.create-locale-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.create-locale-row .create-session-info {
  align-self: stretch;
  display: flex;
  align-items: center;
}

.create-step-actions.create-product-type-row {
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.7fr) auto auto;
}

.create-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid rgba(14, 116, 144, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.94), rgba(240, 253, 250, 0.82));
  padding: 10px 12px;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.create-step-actions .mini-btn {
  min-height: 42px;
}

.create-step-actions .primary-step {
  border-color: rgba(14, 116, 144, 0.42);
  background: #0f2744;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 39, 68, 0.14);
}

.create-step-actions .primary-step:hover {
  background: #17385f;
}

.create-session-info,
.create-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: var(--panel-soft);
  padding: 10px 12px;
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.create-empty.small {
  padding: 7px 9px;
  font-size: 12px;
}

.create-mapping-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.create-map-row {
  display: grid;
  grid-template-columns: minmax(150px, 230px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  font-size: 13px;
  min-width: 0;
}

.create-map-row > * {
  min-width: 0;
}

.create-map-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.create-map-row select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.create-table-wrap {
  max-height: 320px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.create-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
  min-width: 860px;
}

.create-table th,
.create-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
}

.create-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.create-table th:nth-child(1),
.create-table td:nth-child(1) {
  width: 44px;
}

.create-table th:nth-child(2),
.create-table td:nth-child(2) {
  width: 90px;
}

.create-table th:nth-child(3),
.create-table td:nth-child(3) {
  width: 130px;
}

.create-table th:nth-child(4),
.create-table td:nth-child(4) {
  width: 130px;
}

.create-table th:nth-child(5),
.create-table td:nth-child(5) {
  width: 118px;
}

.create-table td {
  overflow-wrap: anywhere;
}

.create-table tr.is-selected-row {
  background: rgba(239, 246, 255, 0.86);
  box-shadow: inset 4px 0 0 #2563eb;
}

.create-result-title {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.28;
}

.create-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.create-selected-chip {
  border: 1px solid rgba(37, 99, 235, 0.34);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  padding: 4px 8px;
  font-weight: 700;
}

.comparison-chip {
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.08);
  color: #475569;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.comparison-chip.ok {
  border-color: rgba(22, 128, 61, 0.35);
  background: rgba(22, 128, 61, 0.08);
  color: var(--good);
}

.comparison-chip.review,
.comparison-chip.warning {
  border-color: rgba(179, 117, 18, 0.38);
  background: rgba(179, 117, 18, 0.09);
  color: var(--warn);
}

.comparison-chip.conflict {
  border-color: rgba(180, 35, 24, 0.38);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.comparison-chip.new {
  border-color: rgba(14, 116, 144, 0.34);
  background: rgba(14, 165, 183, 0.08);
  color: var(--accent2);
}

.create-status {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.create-status.found {
  color: var(--warn);
  border-color: rgba(179, 117, 18, 0.38);
  background: rgba(179, 117, 18, 0.08);
}

.create-status.not_found {
  color: var(--good);
  border-color: rgba(22, 128, 61, 0.35);
  background: rgba(22, 128, 61, 0.08);
}

.create-status.error,
.create-status.missing_ean {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.06);
}

.create-ptd-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.create-selected-catalog {
  grid-column: 1 / -1;
  border: 1px solid rgba(14, 116, 144, 0.34);
  border-radius: 12px;
  background: rgba(14, 165, 183, 0.08);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.create-selected-catalog strong {
  color: var(--accent2);
}

.create-selected-catalog span {
  overflow-wrap: anywhere;
}

.create-decision-empty {
  display: grid;
  gap: 5px;
}

.create-decision-empty strong {
  color: var(--accent);
}

.create-decision-empty span {
  display: block;
}

.create-decision-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.create-decision-card.conflict {
  border-color: rgba(180, 35, 24, 0.34);
}

.create-decision-card.review,
.create-decision-card.warning {
  border-color: rgba(179, 117, 18, 0.34);
}

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

.create-decision-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.create-decision-head strong {
  color: var(--accent);
}

.create-decision-head span:not(.comparison-chip) {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.create-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.create-compare-grid div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 9px 10px;
  min-width: 0;
}

.create-compare-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.create-compare-grid p {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.create-findings {
  display: grid;
  gap: 8px;
}

.create-finding {
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: 12px;
  background: #fff;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.create-finding.warning,
.create-finding.review {
  border-color: rgba(179, 117, 18, 0.35);
  background: rgba(179, 117, 18, 0.06);
}

.create-finding.conflict {
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.05);
}

.create-finding strong {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.create-finding span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.create-stat {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.create-stat span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.create-stat strong {
  overflow-wrap: anywhere;
}

.create-ptd-fields {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.create-ptd-field {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 9px;
  background: #fff;
  min-width: 0;
}

.create-ptd-field.is-required {
  border-color: rgba(180, 35, 24, 0.42);
  box-shadow: inset 4px 0 0 rgba(180, 35, 24, 0.16);
}

.create-ptd-field.has-enum {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

.create-ptd-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.create-ptd-head p {
  margin: 2px 0 0;
}

.create-ptd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 180px;
}

.create-ptd-badges .payload-badge {
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1;
  min-height: auto;
  white-space: nowrap;
}

.create-ptd-meta {
  color: var(--muted);
  font-size: 12px;
}

.create-ptd-select {
  width: min(520px, 100%);
  max-width: 100%;
}

.create-ptd-suggestions {
  grid-column: 1 / -1;
  border: 1px solid rgba(14, 116, 144, 0.3);
  border-radius: 14px;
  background: rgba(14, 165, 183, 0.07);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.create-ptd-suggestions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.create-ptd-suggestions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.create-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.create-step-grid div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
}

.create-step-grid span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.create-step-grid strong {
  overflow-wrap: anywhere;
}

.create-selected-catalog.compact {
  margin: 8px 0;
}

.create-content-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.create-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.create-content-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  min-height: 130px;
  min-width: 0;
}

.create-content-item.filled {
  border-color: rgba(22, 128, 61, 0.32);
  box-shadow: inset 4px 0 0 rgba(22, 128, 61, 0.14);
}

.create-content-item span,
.create-images-meta span,
.create-image-candidate span {
  color: var(--muted);
  font-size: 11px;
}

.create-content-item p {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
}

.create-images-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.create-images-grid {
  display: flex;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 4px 10px 0;
}

.create-image-candidate {
  flex: 0 0 140px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.create-image-candidate.mapped {
  border-color: rgba(14, 116, 144, 0.38);
  background: rgba(14, 165, 183, 0.06);
}

.create-image-candidate img {
  width: 100%;
  height: 112px;
  aspect-ratio: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.create-image-candidate strong,
.create-image-candidate span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-field-editor {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.create-field-row {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.create-field-row.is-missing {
  border-color: rgba(180, 35, 24, 0.46);
  box-shadow: inset 4px 0 0 rgba(180, 35, 24, 0.16);
}

.create-field-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.create-field-info strong,
.create-field-info span {
  overflow-wrap: anywhere;
}

.create-field-info span {
  color: var(--muted);
  font-size: 12px;
}

.create-field-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.create-field-row input,
.create-field-row select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.create-submit-state {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  background: #fff;
}

.create-submit-state span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.create-submit-state.blocked {
  border-color: rgba(180, 35, 24, 0.42);
  background: rgba(180, 35, 24, 0.04);
}

.create-submit-state.ready {
  border-color: rgba(22, 128, 61, 0.32);
  background: rgba(22, 128, 61, 0.05);
}

.create-payload-preview {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f172a;
  color: #e5eefb;
  padding: 12px;
  margin: 0;
  max-height: 420px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.payload-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.payload-summary-item {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.payload-summary-item.is-sku {
  grid-column: span 2;
}

.payload-summary-item span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.payload-summary-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

.payload-preview,
.audit-error,
.diagnostic-card pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  font:
    12px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  overflow: auto;
}

.payload-fields {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.payload-field-card {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.payload-field-card.is-changed {
  border-color: rgba(22, 128, 61, 0.35);
  box-shadow: inset 0 0 0 1px rgba(22, 128, 61, 0.12);
}

.payload-field-card.is-unchanged {
  border-color: rgba(179, 117, 18, 0.35);
  box-shadow: inset 0 0 0 1px rgba(179, 117, 18, 0.12);
}

.payload-field-card.is-manual {
  border-color: rgba(23, 64, 111, 0.3);
}

.payload-field-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.payload-field-name {
  font-size: 14px;
  font-weight: 700;
}

.payload-field-label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.payload-field-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.payload-badge {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #fff;
}

.payload-badge.changed {
  color: var(--good);
  border-color: rgba(22, 128, 61, 0.35);
}

.payload-badge.unchanged {
  color: var(--warn);
  border-color: rgba(179, 117, 18, 0.35);
}

.payload-badge.manual,
.payload-badge.source {
  color: #17406f;
  border-color: rgba(23, 64, 111, 0.3);
}

.payload-badge.required {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.35);
}

.payload-badge.linked {
  color: #17406f;
  border-color: rgba(23, 64, 111, 0.3);
}

.payload-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payload-field-caption {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.payload-field-grid pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font:
    12px/1.45 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
}

.audit-list,
.diagnostics-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.audit-item,
.diagnostic-card {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.audit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.audit-meta,
.diagnostic-title {
  font-size: 12px;
  color: var(--muted);
}

.diagnostic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.diagnostic-chip {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.diagnostic-chip.ok {
  color: var(--good);
  border-color: rgba(22, 128, 61, 0.35);
}

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

.diagnostic-chip.info,
.diagnostic-chip.degraded {
  color: var(--warn);
  border-color: rgba(179, 117, 18, 0.35);
}

.attribute-card {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.attribute-card.is-required {
  border-color: rgba(180, 35, 24, 0.35);
}

.attribute-card.is-linked {
  box-shadow: inset 0 0 0 1px rgba(20, 98, 201, 0.15);
}

.attribute-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.attribute-name {
  font-weight: 700;
  font-size: 14px;
}

.attribute-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.attribute-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.attribute-badge {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.attribute-badge.required {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.35);
}

.attribute-badge.conditional {
  color: #8b4c00;
  border-color: rgba(139, 76, 0, 0.35);
}

.attribute-badge.linked {
  color: #17406f;
  border-color: rgba(23, 64, 111, 0.3);
}

.attribute-current {
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
}

.attribute-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.attribute-validation {
  font-size: 11px;
  color: var(--muted);
}

.attribute-editor-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.attribute-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.attribute-input,
.attribute-select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.attribute-multi-inputs {
  display: grid;
  gap: 8px;
}

.attribute-multi-input {
  min-height: 42px;
}

.attribute-add-row {
  justify-self: start;
}

.attribute-counter {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.msg {
  max-width: min(1020px, 94%);
  display: grid;
  gap: 6px;
  animation: fadeIn 0.18s ease-out;
}

.msg.user {
  margin-left: auto;
}

.msg-role {
  font-size: 12px;
  color: var(--muted);
}

.msg-body {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 16px 18px;
  background: var(--assistant);
  white-space: normal;
  line-height: 1.6;
  box-shadow: 0 10px 20px rgba(15, 28, 52, 0.04);
}

.msg.user .msg-body {
  background: var(--user);
  white-space: pre-wrap;
}

.msg-body p {
  margin: 0 0 10px;
}

.msg-body p:last-child {
  margin-bottom: 0;
}

.msg-body ul,
.msg-body ol {
  margin: 6px 0 12px;
  padding-left: 22px;
}

.msg-body li {
  margin: 4px 0;
}

.msg-body h3,
.msg-body h4,
.msg-body h5,
.msg-body h6 {
  margin: 14px 0 8px;
  line-height: 1.25;
  font-weight: 800;
}

.msg-body h3:first-child,
.msg-body h4:first-child,
.msg-body h5:first-child,
.msg-body h6:first-child {
  margin-top: 0;
}

.msg-body strong {
  font-weight: 800;
}

.msg-body code {
  background: rgba(15, 34, 60, 0.08);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

.md-spacer {
  height: 8px;
}

.msg-instructions {
  font-size: 11px;
  color: var(--muted);
  margin-top: -2px;
  padding-left: 2px;
}

.composer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  border-top: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: 0 -6px 16px rgba(20, 30, 50, 0.05);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
}

.composer textarea {
  min-height: 46px;
  max-height: 180px;
  resize: none;
}

.composer button,
.login-form button {
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  color: #fff;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 600;
}

.secondary-btn {
  background: #fff !important;
  color: var(--accent) !important;
  border: 1px solid var(--line-strong);
}

.attr-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 300px 1fr auto;
  gap: 8px;
  padding-top: 2px;
}

.attr-options select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .shell {
    width: 100vw;
    margin: 0;
    height: 100vh;
    border-radius: 0;
    border: none;
  }

  .app-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 38vh;
  }

  .sessions {
    max-height: 18vh;
  }

  .msg {
    max-width: 100%;
  }

  .composer {
    grid-template-columns: 1fr auto;
  }

  .attr-options {
    grid-template-columns: 1fr;
  }

  .images-upload {
    grid-template-columns: 1fr;
  }

  .workspace-dock {
    height: 42vh;
    max-height: 42vh;
  }

  .payload-summary,
  .payload-field-grid {
    grid-template-columns: 1fr;
  }

  .attribute-editor-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .offers-controls {
    grid-template-columns: 1fr;
  }

  .create-workspace {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .create-process-panel,
  .create-help-panel,
  .create-main-panel {
    min-height: auto;
  }

  .create-process-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .create-card-head,
  .create-upload-row,
  .create-product-type-row,
  .create-step-actions.create-product-type-row,
  .create-field-row {
    grid-template-columns: 1fr;
  }

  .create-mapping-grid,
  .create-ptd-summary,
  .create-step-grid {
    grid-template-columns: 1fr;
  }
}
