:root {
  --beta-ink: #1e2a35;
  --beta-muted: #667481;
  --beta-line: #dce4ea;
  --beta-soft: #f5f8fa;
  --beta-blue: #2f638f;
  --beta-blue-soft: #eaf3f8;
  --beta-green: #25735d;
  --beta-green-soft: #e8f5ef;
  --beta-warm: #9a642c;
  --beta-warm-soft: #fbf2e7;
  --beta-danger: #a6423a;
}

body.beta-style-open { overflow: hidden; }

.beta-style-shell {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f4f7f9;
  color: var(--beta-ink);
  font-family: inherit;
  overflow: hidden;
}

.beta-style-shell[hidden] { display: none; }

.beta-style-shell button,
.beta-style-shell a,
.beta-style-shell input,
.beta-style-shell textarea,
.beta-style-shell select { letter-spacing: 0; }
.beta-style-shell :focus-visible { outline: 2px solid rgba(47,99,143,.42); outline-offset: 2px; }

.beta-style-topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--beta-line);
  background: rgba(255,255,255,.96);
}

.beta-style-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.beta-style-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  background: #2f638f;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}
.beta-style-brand-copy { min-width: 0; }
.beta-style-brand-copy strong { display: block; font-size: 16px; line-height: 1.2; }
.beta-style-brand-copy span { display: block; margin-top: 3px; color: var(--beta-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.beta-style-top-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.beta-style-status { display: inline-flex; align-items: center; gap: 6px; color: var(--beta-muted); font-size: 12px; }
.beta-style-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa8b3; }
.beta-style-status.ready::before { background: var(--beta-green); }
.beta-style-status.busy::before { background: #c68132; box-shadow: 0 0 0 3px rgba(198,129,50,.14); }
.beta-style-status.error::before { background: var(--beta-danger); }

.beta-style-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--beta-line);
  border-radius: 8px;
  background: #fff;
  color: #3d566d;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
}
.beta-style-button:hover { border-color: #9bb7ca; background: #f8fbfd; }
.beta-style-button:disabled { opacity: .5; cursor: not-allowed; }
.beta-style-button.primary { border-color: var(--beta-blue); background: var(--beta-blue); color: #fff; }
.beta-style-button.primary:hover { background: #285779; }
.beta-style-button.green { border-color: var(--beta-green); background: var(--beta-green); color: #fff; }
.beta-style-button.danger { color: var(--beta-danger); }
.beta-style-button.compact { min-height: 30px; padding: 0 9px; font-size: 11px; }
.beta-style-nav-item { gap: 8px; }

.beta-style-body { min-height: 0; flex: 1; display: grid; grid-template-columns: 310px minmax(0, 1fr); overflow: hidden; }
.beta-style-rail { min-width: 0; padding: 20px 16px 24px; border-right: 1px solid var(--beta-line); background: #fff; overflow: auto; }
.beta-style-workspace { min-width: 0; overflow: auto; }
.beta-style-main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 25px 0 54px; }

.beta-style-section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.beta-style-section-label strong { font-size: 12px; }
.beta-style-section-label span { color: var(--beta-muted); font-size: 11px; }
.beta-style-step { display: flex; gap: 9px; padding: 12px 0; border-bottom: 1px solid #edf1f3; }
.beta-style-step:last-child { border-bottom: 0; }
.beta-style-step-index { flex: none; width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid #bfd2df; border-radius: 50%; color: var(--beta-blue); font-size: 11px; font-weight: 700; }
.beta-style-step.done .beta-style-step-index { border-color: #9bc7b8; background: var(--beta-green-soft); color: var(--beta-green); }
.beta-style-step-copy { min-width: 0; }
.beta-style-step-copy strong { display: block; font-size: 12px; }
.beta-style-step-copy span { display: block; margin-top: 3px; color: var(--beta-muted); font-size: 11px; line-height: 1.45; }

.beta-style-upload {
  display: block;
  min-height: 92px;
  padding: 14px;
  border: 1px dashed #9bb7ca;
  border-radius: 9px;
  background: #f7fbfd;
  cursor: pointer;
}
.beta-style-upload:hover { border-color: var(--beta-blue); background: #f1f8fc; }
.beta-style-upload.dragging { border-color: var(--beta-blue); background: #eaf3f8; box-shadow: 0 0 0 3px rgba(47,99,143,.12); }
.beta-style-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.beta-style-upload strong { display: block; font-size: 12px; color: #315f82; }
.beta-style-upload span { display: block; margin-top: 6px; color: var(--beta-muted); font-size: 11px; line-height: 1.45; }
.beta-style-file { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 9px; border: 1px solid #d8e5ec; border-radius: 7px; background: #f7fbfd; color: #315f82; font-size: 11px; }
.beta-style-file strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beta-style-direct-create { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--beta-line); }
.beta-style-direct-title { color: var(--beta-ink); font-size: 11px; font-weight: 700; }
.beta-style-input { width: 100%; box-sizing: border-box; min-height: 34px; margin-top: 5px; padding: 0 9px; border: 1px solid #d5e0e6; border-radius: 8px; background: #fff; color: var(--beta-ink); font: inherit; font-size: 12px; }
.beta-style-input:focus { outline: 2px solid rgba(47,99,143,.16); border-color: #7da7c1; }
.beta-style-upload.compact { min-height: 0; padding: 9px; }
.beta-style-upload.compact span { font-size: 10px; }
.beta-style-search { display: block; margin-top: 8px; }
.beta-style-search input { width: 100%; min-height: 32px; box-sizing: border-box; padding: 0 10px; border: 1px solid #d5e0e6; border-radius: 7px; background: #fff; color: var(--beta-ink); font: inherit; font-size: 11px; }
.beta-style-search input::placeholder { color: #9aa7af; }
.beta-style-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.beta-style-product-list { display: grid; gap: 6px; margin-top: 10px; }
.beta-style-product { width: 100%; display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid transparent; border-radius: 8px; background: #f7f9fa; color: var(--beta-ink); text-align: left; cursor: pointer; font: inherit; }
.beta-style-product:hover { border-color: #c6d8e4; background: #f2f7fa; }
.beta-style-product.active { border-color: #8fb2c8; background: var(--beta-blue-soft); }
.beta-style-product:disabled { opacity: .65; cursor: wait; }
.beta-style-product-thumb { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #d9e2e7; border-radius: 6px; overflow: hidden; background: #fff; color: #92a0aa; font-size: 10px; }
.beta-style-product-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.beta-style-product-copy { min-width: 0; }
.beta-style-product-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.beta-style-product-copy span { display: block; margin-top: 4px; color: var(--beta-muted); font-size: 10px; }

.beta-style-empty { padding: 22px 12px; border: 1px dashed var(--beta-line); border-radius: 8px; color: var(--beta-muted); font-size: 11px; line-height: 1.6; text-align: center; }
.beta-style-empty-action { display: flex; flex-direction: column; align-items: center; gap: 7px; min-height: 100px; justify-content: center; }
.beta-style-empty-action strong { color: var(--beta-ink); font-size: 13px; }
.beta-style-empty-action span { max-width: 410px; }
.beta-style-notice { padding: 10px 11px; border-left: 3px solid #9bb7ca; background: #f6f9fb; color: var(--beta-muted); font-size: 11px; line-height: 1.55; }
.beta-style-notice.warm { border-left-color: #d5a064; background: var(--beta-warm-soft); color: #76502b; }

.beta-style-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.beta-style-kicker { margin-bottom: 7px; color: var(--beta-blue); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.beta-style-intro h1 { margin: 0; font-size: 24px; letter-spacing: 0; }
.beta-style-intro p { max-width: 680px; margin: 8px 0 0; color: var(--beta-muted); font-size: 13px; line-height: 1.6; }
.beta-style-intro-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.beta-style-badge { flex: none; padding: 7px 10px; border: 1px solid #d6e5dc; border-radius: 7px; background: var(--beta-green-soft); color: var(--beta-green); font-size: 11px; }
.beta-style-protection { display: inline-flex; align-items: center; gap: 5px; color: var(--beta-green); font-size: 11px; white-space: nowrap; }
.beta-style-protection span { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--beta-green-soft); font-size: 10px; }
.beta-style-progress-strip { display: flex; align-items: center; gap: 8px; margin: 0 0 17px; padding: 10px 12px; border: 1px solid var(--beta-line); border-radius: 9px; background: #fbfcfd; }
.beta-style-progress-strip > div { display: inline-flex; align-items: center; gap: 6px; color: #8997a0; font-size: 11px; white-space: nowrap; }
.beta-style-progress-strip > div span { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #cbd7dd; border-radius: 50%; font-size: 10px; font-weight: 700; }
.beta-style-progress-strip > div.active { color: var(--beta-blue); font-weight: 700; }
.beta-style-progress-strip > div.active span { border-color: var(--beta-blue); background: var(--beta-blue-soft); color: var(--beta-blue); }
.beta-style-progress-strip > div.done { color: var(--beta-green); }
.beta-style-progress-strip > div.done span { border-color: #a7cbb9; background: var(--beta-green-soft); color: var(--beta-green); }
.beta-style-progress-strip > i { flex: 1; min-width: 14px; height: 1px; background: #dfe6ea; }

.beta-style-panel { margin-top: 14px; padding: 17px; border: 1px solid var(--beta-line); border-radius: 10px; background: #fff; }
.beta-style-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.beta-style-panel-head h2 { margin: 0; font-size: 15px; }
.beta-style-panel-head p { margin: 5px 0 0; color: var(--beta-muted); font-size: 11px; line-height: 1.5; }
.beta-style-panel-head > div:last-child { flex: none; }

.beta-style-source { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; align-items: start; }
.beta-style-reference-picker { min-width: 0; }
.beta-style-reference-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.beta-style-reference-actions .beta-style-button { min-height: 30px; }
.beta-style-reference-count { color: var(--beta-muted); font-size: 10px; }
.beta-style-source-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.beta-style-market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.beta-style-market-grid .beta-style-field-label { margin: 0; }
.beta-style-market-summary { margin-top: 10px; color: var(--beta-muted); font-size: 10px; line-height: 1.5; }
.beta-style-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border: 1px solid #dbe4e9; border-radius: 6px; background: #f8fafb; color: #536673; font-size: 11px; }
.beta-style-chip.blue { border-color: #c7dce9; background: var(--beta-blue-soft); color: #315f82; }
.beta-style-chip.green { border-color: #c8e2d6; background: var(--beta-green-soft); color: var(--beta-green); }
.beta-style-select, .beta-style-textarea { width: 100%; box-sizing: border-box; border: 1px solid #d5e0e6; border-radius: 8px; background: #fff; color: var(--beta-ink); font: inherit; }
.beta-style-select { min-height: 36px; padding: 0 10px; font-size: 12px; }
.beta-style-textarea { min-height: 105px; padding: 11px 12px; resize: vertical; font-size: 13px; line-height: 1.6; }
.beta-style-textarea:focus, .beta-style-select:focus { outline: 2px solid rgba(47,99,143,.16); border-color: #7da7c1; }
.beta-style-field-label { display: block; margin-bottom: 6px; color: #536673; font-size: 11px; font-weight: 700; }

.beta-style-segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid #d8e1e6; border-radius: 8px; background: #f6f8f9; }
.beta-style-segmented button { min-height: 29px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--beta-muted); cursor: pointer; font: inherit; font-size: 11px; }
.beta-style-segmented button:disabled { opacity: .45; cursor: not-allowed; }
.beta-style-segmented button.active { background: #fff; color: var(--beta-blue); box-shadow: 0 1px 3px rgba(27,49,66,.12); }

.beta-style-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.beta-style-image-card { min-width: 0; border: 1px solid var(--beta-line); border-radius: 8px; overflow: hidden; background: #fff; }
.beta-style-image-card.selected { border-color: #6e9ebc; box-shadow: 0 0 0 2px rgba(47,99,143,.13); }
.beta-style-image-frame { position: relative; width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; margin: 0; padding: 0; border: 0; background: #f2f5f6; color: inherit; overflow: hidden; cursor: pointer; font: inherit; }
.beta-style-image-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.beta-style-image-frame .beta-style-image-tag { position: absolute; top: 8px; left: 8px; padding: 4px 6px; border-radius: 4px; background: rgba(27,43,54,.78); color: #fff; font-size: 10px; }
.beta-style-image-frame .beta-style-image-check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--beta-blue); font-size: 12px; }
.beta-style-image-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; }
.beta-style-image-meta strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.beta-style-image-meta span { flex: none; color: var(--beta-muted); font-size: 10px; }

.beta-style-prompt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.beta-style-quick-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.beta-style-quick-actions button { min-height: 27px; padding: 0 9px; border: 1px solid #d6e2e8; border-radius: 6px; background: #f8fafb; color: #526876; cursor: pointer; font: inherit; font-size: 10px; }
.beta-style-quick-actions button:hover { border-color: #9eb9ca; color: var(--beta-blue); }
.beta-style-action-stack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.beta-style-helper { margin-top: 8px; color: var(--beta-muted); font-size: 10px; line-height: 1.5; }

.beta-style-plan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.beta-style-plan-block { min-height: 86px; padding: 11px; border-radius: 8px; background: #f7f9fa; }
.beta-style-plan-block strong { display: block; margin-bottom: 7px; font-size: 11px; }
.beta-style-plan-block ul { margin: 0; padding-left: 16px; color: #5c6b76; font-size: 11px; line-height: 1.6; }
.beta-style-plan-block.keep { border-left: 3px solid #7cae99; background: #f0f8f3; }
.beta-style-plan-block.change { border-left: 3px solid #7da7c1; background: #f0f7fb; }
.beta-style-plan-block.lock { border-left: 3px solid #d5a064; background: #fff8ef; }
.beta-style-plan-prompt { margin-top: 11px; padding: 10px; border: 1px solid #e0e6e9; border-radius: 7px; background: #fff; color: #536673; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }

.beta-style-timeline { display: grid; gap: 8px; }
.beta-style-version { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 10px; border: 1px solid #e0e6e9; border-radius: 8px; background: #fff; }
.beta-style-version.active { border-color: #9dbbd0; background: #f7fbfd; }
.beta-style-version-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; grid-column: 1 / -1; }
.beta-style-version-head strong { font-size: 11px; }
.beta-style-version-gallery { display: flex; gap: 5px; grid-column: 1 / -1; min-width: 78px; max-width: 100%; overflow-x: auto; }
.beta-style-version-thumb { position: relative; flex: 0 0 78px; width: 78px; height: 58px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 5px; overflow: hidden; background: #f1f4f5; cursor: pointer; }
.beta-style-version-thumb:hover, .beta-style-version-thumb.selected { border-color: #6e9ebc; }
.beta-style-version-thumb img { width: 100%; height: 100%; object-fit: contain; }
.beta-style-version-thumb span { position: absolute; right: 4px; bottom: 4px; min-width: 15px; padding: 1px 3px; border-radius: 3px; background: rgba(27,43,54,.76); color: #fff; font-size: 9px; }
.beta-style-version-thumb-empty { color: var(--beta-muted); font-size: 10px; }
.beta-style-version-copy { grid-column: 1; min-width: 0; }
.beta-style-version-copy strong { display: block; font-size: 11px; }
.beta-style-version-copy span { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--beta-muted); font-size: 10px; }
.beta-style-version-copy small { display: block; margin-top: 5px; color: #71828c; font-size: 10px; }
.beta-style-version-status { display: inline-flex; margin-top: 4px; padding: 2px 5px; border-radius: 4px; background: #f1f4f5; color: var(--beta-muted); font-size: 9px; }
.beta-style-version-status.completed { background: var(--beta-green-soft); color: var(--beta-green); }
.beta-style-version-status.processing, .beta-style-version-status.queued, .beta-style-version-status.preparing { background: var(--beta-blue-soft); color: var(--beta-blue); }
.beta-style-version-status.failed, .beta-style-version-status.cancelled { background: var(--beta-warm-soft); color: var(--beta-danger); }
.beta-style-version-actions { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.beta-style-toast { position: fixed; right: 22px; bottom: 22px; z-index: 1600; max-width: min(360px, calc(100vw - 32px)); padding: 11px 13px; border: 1px solid #c6d8e4; border-radius: 8px; background: #fff; color: #315f82; box-shadow: 0 8px 24px rgba(25,48,65,.15); font-size: 12px; line-height: 1.45; }
.beta-style-toast.error { border-color: #e3bcb7; color: var(--beta-danger); }
.beta-style-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.45); border-top-color: currentColor; border-radius: 50%; animation: beta-style-spin .8s linear infinite; }
@keyframes beta-style-spin { to { transform: rotate(360deg); } }

@media (max-width: 1000px) {
  .beta-style-body { grid-template-columns: 260px minmax(0, 1fr); }
  .beta-style-main { width: min(100% - 32px, 920px); }
  .beta-style-source { grid-template-columns: 1fr; }
  .beta-style-market-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .beta-style-topbar { min-height: 58px; padding: 0 14px; }
  .beta-style-brand-copy span { display: none; }
  .beta-style-top-actions .beta-style-status { display: none; }
  .beta-style-body { display: block; overflow: auto; }
  .beta-style-rail { border-right: 0; border-bottom: 1px solid var(--beta-line); padding: 12px 14px; }
  .beta-style-rail .beta-style-rail-details { display: block; }
  .beta-style-rail-details { max-height: 42vh; overflow: auto; }
  .beta-style-main { width: calc(100% - 28px); padding-top: 16px; }
  .beta-style-intro { display: block; }
  .beta-style-badge { display: inline-block; margin-top: 10px; }
  .beta-style-prompt-row { grid-template-columns: 1fr; }
  .beta-style-action-stack { justify-content: flex-start; }
  .beta-style-plan { grid-template-columns: 1fr; }
  .beta-style-version { grid-template-columns: minmax(0, 1fr); }
  .beta-style-version-gallery { max-width: none; }
  .beta-style-version-thumb { flex-basis: 58px; width: 58px; height: 48px; }
  .beta-style-version-copy, .beta-style-version-actions { grid-column: 1; }
  .beta-style-version-actions { justify-content: flex-start; }
  .beta-style-images { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 420px) {
  .beta-style-images { grid-template-columns: 1fr; }
  .beta-style-panel { padding: 13px; }
  .beta-style-panel-head { display: block; }
  .beta-style-panel-head > div:last-child { margin-top: 9px; }
  .beta-style-progress-strip { gap: 4px; padding: 8px; }
  .beta-style-progress-strip > div strong { display: none; }
  .beta-style-progress-strip > i { min-width: 5px; }
}
