:root {
  --ink: #18202a;
  --muted: #687487;
  --line: #dde3ea;
  --panel: #ffffff;
  --bg: #f4f7f9;
  --brand: #0f766e;
  --brand-dark: #0b4f4a;
  --accent: #d97706;
  --soft: #eef8f6;
  --danger: #b42318;
}

@media print {
  .first-output-page {
    display: grid !important;
    grid-template-rows: 42mm 1fr !important;
    gap: 6mm !important;
    height: 180mm !important;
    max-height: 180mm !important;
    overflow: hidden !important;
    break-after: page !important;
    page-break-after: always !important;
  }

  .first-output-page .proposal-cover {
    min-height: 0 !important;
    height: 42mm !important;
    padding: 8mm !important;
    box-sizing: border-box !important;
  }

  .first-output-page .proposal-cover h2 {
    margin-bottom: 6mm !important;
    font-size: 28px !important;
  }

  .first-output-page .first-print-product {
    height: 132mm !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 8mm !important;
    break-before: avoid !important;
    page-break-before: avoid !important;
  }

  .first-output-page .print-product {
    height: 132mm !important;
    min-height: 0 !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  .first-output-page .print-product-images,
  .first-output-page .print-product-images img {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
  }

  .first-output-page .print-product-detail {
    padding: 18px 28px !important;
  }

  .first-output-page .print-product-detail h4 {
    font-size: 22px !important;
  }

  .first-output-page .detail-block,
  .first-output-page .print-price-list {
    font-size: 16px !important;
    line-height: 1.32 !important;
  }

  .first-output-page .blue-rule {
    margin: 7px 0 11px !important;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body.locked .app-shell {
  display: none;
}

.login-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(20, 59, 58, 0.88), rgba(20, 59, 58, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='760' viewBox='0 0 1200 760'%3E%3Crect width='1200' height='760' fill='%230f766e'/%3E%3Cpath d='M0 520c170-68 320-42 500-112 185-72 240-188 438-156 126 20 196 92 262 76v432H0z' fill='%23d97706' opacity='.62'/%3E%3Cpath d='M0 160c220 80 406-72 620-26 180 39 320 126 580 52V0H0z' fill='%23fff' opacity='.13'/%3E%3C/svg%3E");
  background-size: cover;
}

body.locked .login-screen {
  display: grid;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  padding: 32px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
}

.login-card h1,
.login-card p {
  margin: 0;
}

.login-card p {
  color: var(--muted);
}

.login-error {
  display: none;
  min-height: 20px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff1f0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.login-error.visible {
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  color: #f7fbfa;
  background: #143b3a;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  color: #143b3a;
  background: #f6c76a;
  font-size: 22px;
  font-weight: 800;
}

.brand h1,
.brand p,
.workspace h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 19px;
}

.brand p {
  margin-top: 4px;
  color: #b9ceca;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  color: #dcebe8;
  background: transparent;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  color: #143b3a;
  background: #f7fbfa;
}

.sidebar-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-panel span {
  color: #b9ceca;
  font-size: 13px;
}

.sidebar-panel strong {
  font-size: 24px;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace h2 {
  font-size: 28px;
}

.topbar-actions,
.toolbar,
.panel-heading,
.form-row,
.terms {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hidden-action {
  display: none !important;
}

#productsView.form-closed .product-form-panel {
  display: none;
}

#productsView.form-closed .content-grid {
  grid-template-columns: minmax(0, 1fr);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.primary,
.secondary,
.ghost,
.file-button,
.icon-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
}

.primary {
  color: #fff;
  background: var(--brand);
}

.primary:hover {
  background: var(--brand-dark);
}

.secondary,
.ghost,
.file-button,
.icon-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.ghost {
  background: transparent;
}

.full {
  width: 100%;
}

.file-button {
  display: inline-flex;
  align-items: center;
}

.file-button input {
  display: none;
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(440px, 100%);
  padding: 0 14px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search-box span {
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
}

.content-grid,
.proposal-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-heading {
  justify-content: space-between;
  min-height: 58px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h3 {
  font-size: 17px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
}

.form-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-form,
.proposal-form,
.settings-grid {
  display: grid;
  gap: 14px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 400;
  outline-color: var(--brand);
}

select {
  min-height: 42px;
}

textarea {
  resize: vertical;
}

.form-row {
  align-items: start;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.small-inline {
  min-height: 42px;
  padding: 0 14px;
}

.danger-inline {
  color: var(--danger);
}

.form-row label {
  flex: 1;
}

.image-upload-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.image-upload-group > span {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.image-upload-group label {
  display: grid;
  gap: 6px;
}

.image-upload-group input[type="file"],
.video-upload-group input[type="file"] {
  min-width: 0;
  padding: 8px;
  font-size: 0;
}

.image-upload-group input[type="file"]::file-selector-button,
.video-upload-group input[type="file"]::file-selector-button {
  font-size: 12px;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 150px;
  align-content: start;
  padding: 8px;
  overflow: hidden;
  border: 1px dashed #b7c2cd;
  border-radius: 8px;
  color: var(--muted);
  background: #f9fbfc;
}

.image-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
}

.preview-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
}

.preview-item {
  position: relative;
  width: 100%;
}

.image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: rgba(185, 28, 28, 0.9);
}

.video-upload-group {
  display: grid;
  gap: 7px;
}

.media-hint,
.media-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.media-status:not(:empty) {
  color: var(--brand);
  font-weight: 700;
}

.video-preview {
  display: grid;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.video-preview[hidden] {
  display: none;
}

.video-preview video {
  display: block;
  width: 100%;
  max-height: 240px;
  border-radius: 6px;
  background: #0b1715;
}

.video-preview-meta,
.video-preview-meta > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-preview-meta {
  justify-content: space-between;
}

.video-preview-meta > div {
  min-width: 0;
  align-items: baseline;
}

.video-preview-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-preview-meta span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.video-preview-meta button {
  flex: 0 0 auto;
  min-width: 86px;
  white-space: nowrap;
}

.product-list,
.selected-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 0;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #344054;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  user-select: none;
}

.category-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-tab strong {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: var(--brand);
  background: var(--soft);
  font-size: 12px;
}

.category-tab .category-drag-grip {
  display: inline-grid;
  flex: 0 0 16px;
  width: 16px;
  height: 24px;
  margin-left: -4px;
  place-items: center;
  overflow: visible;
  color: #98a2b3;
  font-size: 17px;
  line-height: 1;
  text-overflow: clip;
  cursor: grab;
  touch-action: none;
}

.category-tab .category-tab-label {
  min-width: 0;
}

.category-tab.active {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.category-tab.active strong {
  color: var(--brand-dark);
  background: #fff;
}

.category-tab.active .category-drag-grip {
  color: rgba(255, 255, 255, 0.82);
}

.category-filter.is-sorting .category-drag-grip,
.category-sort-dragging .category-drag-grip {
  cursor: grabbing;
}

.category-sort-ghost {
  opacity: 0.35;
}

.category-sort-chosen {
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.category-sort-dragging {
  cursor: grabbing;
}

.product-card {
  display: grid;
  grid-template-columns: 32px 92px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.drag-handle {
  display: grid;
  width: 32px;
  height: 40px;
  align-self: center;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #667085;
  background: transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.drag-handle span {
  display: block;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  transform: scaleX(0.85);
}

.drag-handle:hover,
.drag-handle:focus-visible {
  border-color: var(--line);
  color: var(--brand-dark);
  background: var(--soft);
}

.drag-handle:active,
.is-sorting .drag-handle {
  cursor: grabbing;
}

.drag-handle:disabled {
  opacity: 0.3;
  cursor: default;
}

.product-sort-ghost {
  opacity: 0.35;
  border-style: dashed;
  border-color: var(--brand);
}

.product-sort-chosen,
.product-sort-dragging {
  border-color: var(--brand);
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.16);
}

.product-card.selected {
  border-color: var(--brand);
  background: var(--soft);
}

.product-card img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef2f6;
}

.product-card h4 {
  margin: 0 0 4px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.pill {
  border-radius: 999px;
  padding: 4px 9px;
  color: #425466;
  background: #eef2f6;
  font-size: 12px;
}

.price-line {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.price-line strong {
  color: var(--ink);
}

.card-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.small-button {
  min-width: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.small-button.danger {
  color: var(--danger);
}

.promotion-showcase {
  overflow: hidden;
}

.promotion-showcase-header {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  min-height: 142px;
  align-items: center;
  gap: 26px;
  padding: 24px 30px;
  border-bottom: 4px solid var(--accent);
  color: #fff;
  background: #123f3a;
}

.promotion-showcase-logo {
  display: block;
  width: 170px;
  height: 82px;
  object-fit: contain;
  object-position: left center;
}

.promotion-showcase-copy {
  min-width: 0;
  padding-left: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.promotion-showcase-copy p,
.promotion-showcase-copy h3,
.promotion-showcase-copy span {
  margin: 0;
}

.promotion-showcase-copy p {
  margin-bottom: 5px;
  color: #efbd9c;
  font-size: 11px;
  font-weight: 900;
}

.promotion-showcase-copy h3 {
  margin-bottom: 6px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 28px;
}

.promotion-showcase-copy span,
.promotion-showcase-header > strong {
  color: #d8e5e1;
  font-size: 13px;
  font-weight: 500;
}

.promotion-showcase-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 24px 0 0;
}

.promotion-showcase-toolbar .search-box {
  width: min(520px, 100%);
}

.promotion-showcase > .category-filter {
  padding: 18px 0 0;
}

.promotion-product-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 0 0;
}

.promotion-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  animation: promotion-card-enter 320ms ease both;
  animation-delay: calc(var(--promotion-card-index) * 35ms);
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.promotion-card:hover,
.promotion-card:focus-visible {
  border-color: #9db8af;
  outline: 0;
  box-shadow: 0 14px 34px rgba(24, 47, 40, 0.11);
  transform: translateY(-2px);
}

.promotion-card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--line);
  background: #f6f7f4;
}

.promotion-card-media > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 300ms ease;
}

.promotion-card:hover .promotion-card-media > img {
  transform: scale(1.02);
}

.promotion-card-media > span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(18, 63, 58, 0.86);
  font-size: 11px;
  font-weight: 800;
}

.promotion-image-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #8c9892;
  background: #edf1ed;
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
}

.promotion-card-copy {
  display: grid;
  min-width: 0;
  align-content: start;
  padding: 18px;
}

.promotion-card-category {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.promotion-card h4 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 50px;
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.promotion-card-model {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  margin-top: 9px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #415149;
  background: #e8f1ed;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promotion-card-description {
  display: -webkit-box;
  overflow: hidden;
  min-height: 50px;
  margin: 12px 0 0;
  color: #4e5b55;
  font-size: 14px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.promotion-card-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e8ece9;
}

.promotion-card-price {
  display: grid;
  gap: 3px;
}

.promotion-card-price span {
  color: var(--muted);
  font-size: 11px;
}

.promotion-card-price strong {
  color: #123f3a;
  font-size: 21px;
}

.promotion-card-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #bed0ca;
  border-radius: 999px;
  color: var(--brand);
  font-size: 19px;
  line-height: 1;
}

.promotion-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.promotion-detail-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.promotion-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(320px, 1fr);
  gap: 46px;
  align-items: start;
}

.promotion-detail-gallery {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.promotion-gallery-stage {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.promotion-gallery-stage > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.promotion-detail-thumbnails {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 112px));
  gap: 10px;
}

.promotion-detail-thumbnails button {
  aspect-ratio: 1;
  overflow: hidden;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.promotion-detail-thumbnails button:hover,
.promotion-detail-thumbnails button:focus-visible,
.promotion-detail-thumbnails button.active {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.12);
}

.promotion-detail-thumbnails img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.promotion-product-video {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.promotion-product-video p {
  margin: 0;
  color: #53615b;
  font-size: 13px;
  font-weight: 800;
}

.promotion-product-video video {
  display: block;
  width: 100%;
  max-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1715;
}

.promotion-detail-copy {
  position: sticky;
  top: 24px;
  min-width: 0;
  padding-top: 8px;
}

.promotion-detail-category,
.promotion-detail-copy h3,
.promotion-detail-model {
  margin: 0;
}

.promotion-detail-category {
  margin-bottom: 11px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.promotion-detail-copy h3 {
  font-family: "Songti SC", "STSong", serif;
  font-size: 34px;
  line-height: 1.35;
}

.promotion-detail-model {
  margin-top: 13px;
  color: #53615b;
  line-height: 1.7;
}

.promotion-retail-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 0;
  padding: 19px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.promotion-retail-price strong {
  color: #123f3a;
  font-size: 32px;
}

.promotion-description h4 {
  margin: 0 0 10px;
  font-size: 17px;
}

.promotion-description p {
  margin: 0;
  color: #3f4d47;
  line-height: 1.9;
  white-space: pre-wrap;
}

.promotion-detail-facts {
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
}

.promotion-detail-facts > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.promotion-detail-facts dt,
.promotion-detail-facts dd {
  margin: 0;
}

.promotion-detail-facts dt {
  color: var(--muted);
  font-size: 13px;
}

.promotion-detail-facts dd {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.promotion-detail-note {
  margin: 17px 0 0;
  color: #7c8882;
  font-size: 12px;
  line-height: 1.7;
}

@keyframes promotion-card-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.selected-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.selected-item h4 {
  margin: 0 0 8px;
}

.selected-meta {
  color: var(--muted);
  font-size: 13px;
}

.proposal-price-editors {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.proposal-price-editors label {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.proposal-price-editors input {
  min-height: 38px;
  padding: 8px 10px;
}

.proposal-library {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.proposal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proposal-card h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.proposal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.proposal-card-actions {
  display: flex;
  gap: 8px;
}

.proposal-preview {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proposal-cover {
  display: flex;
  min-height: 220px;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  color: #fff;
  background:
    linear-gradient(rgba(20, 59, 58, 0.78), rgba(20, 59, 58, 0.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='520' viewBox='0 0 1200 520'%3E%3Crect width='1200' height='520' fill='%230f766e'/%3E%3Cpath d='M0 360c160-72 280-38 420-88 150-54 214-162 382-150 160 11 246 122 398 68v330H0z' fill='%23d97706' opacity='.72'/%3E%3Cpath d='M0 112c210 74 364-56 540-30 202 30 286 182 660 68v-150H0z' fill='%23ffffff' opacity='.16'/%3E%3Ccircle cx='967' cy='260' r='84' fill='%23ffffff' opacity='.14'/%3E%3C/svg%3E");
  background-size: cover;
}

.proposal-kicker {
  margin: 0 0 12px;
  font-weight: 800;
}

.proposal-cover h2 {
  margin: 0 0 18px;
  max-width: 760px;
  font-size: 42px;
}

.proposal-date {
  align-self: flex-end;
  white-space: nowrap;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.summary-strip div {
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}

.summary-strip div:last-child {
  border-right: 0;
}

.summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.print-section {
  padding: 26px 34px;
}

.product-detail-section {
  padding-top: 24px;
}

.print-section h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.print-products {
  display: grid;
  gap: 24px;
}

.print-page {
  display: grid;
  gap: 16px;
}

.first-print-product {
  padding: 0 34px 26px;
}

.print-product {
  display: grid;
  grid-template-columns: 44% 56%;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.print-product-images {
  display: grid;
  gap: 8px;
  min-height: 430px;
  padding: 8px;
  background: #f3f5f7;
}

.print-product-images img {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 4px;
  object-fit: cover;
  background: #eef2f6;
}

.print-product-detail {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 54px;
}

.print-product-detail h4 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
}

.blue-rule {
  width: 100%;
  height: 3px;
  margin: 14px 0 28px;
  border-radius: 999px;
  background: #4f7ed7;
}

.detail-block {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.55;
}

.detail-block strong {
  display: block;
}

.detail-block p {
  margin: 0;
}

.print-price-list {
  margin-top: 10px;
  font-size: 20px;
  line-height: 1.35;
}

.print-price-list p {
  margin: 0;
}

.terms span {
  display: inline-flex;
  padding: 9px 12px;
  border-radius: 8px;
  background: #f0f5f7;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.settings-panel {
  max-width: 820px;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-panel .primary {
  margin: 0 18px 18px;
}

@media (max-width: 980px) {
  .app-shell,
  .content-grid,
  .proposal-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .summary-strip,
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .print-product {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .promotion-detail-layout {
    grid-template-columns: 1fr;
  }

  .promotion-detail-copy {
    position: static;
  }

  .print-product-images,
  .print-product-images img {
    min-height: 320px;
  }

  .print-product-detail {
    padding: 30px;
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .form-row,
  .product-card,
  .proposal-cover {
    flex-direction: column;
  }

  .topbar {
    align-items: stretch;
  }

  .topbar-actions,
  .category-row,
  .form-row {
    display: grid;
  }

  .category-row {
    grid-template-columns: 1fr;
  }

  .image-upload-group,
  .image-preview {
    grid-template-columns: 1fr;
  }

  .video-preview-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-columns: 32px 84px minmax(0, 1fr);
  }

  .promotion-showcase-header {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 118px;
    gap: 16px;
    padding: 20px;
  }

  .promotion-showcase-logo {
    width: 112px;
    height: 66px;
  }

  .promotion-showcase-copy {
    padding-left: 16px;
  }

  .promotion-showcase-copy h3 {
    font-size: 22px;
  }

  .promotion-showcase-header > strong {
    grid-column: 1 / -1;
  }

  .promotion-showcase-toolbar {
    padding-top: 18px;
  }

  .promotion-product-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .promotion-card {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .promotion-card-media {
    height: 100%;
    min-height: 204px;
    aspect-ratio: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .promotion-card-copy {
    padding: 14px;
  }

  .promotion-card h4 {
    min-height: 0;
    font-size: 17px;
  }

  .promotion-card-description {
    min-height: 0;
    margin-top: 9px;
    font-size: 13px;
  }

  .promotion-card-footer {
    margin-top: 12px;
    padding-top: 11px;
  }

  .promotion-detail-layout {
    gap: 24px;
  }

  .promotion-detail-copy h3,
  .promotion-retail-price strong {
    font-size: 24px;
  }

  .card-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
  }

  .proposal-card {
    grid-template-columns: 1fr;
  }

  .proposal-card-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-strip,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .proposal-cover h2 {
    font-size: 30px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar,
  .topbar,
  .toolbar,
  .content-grid,
  .proposal-layout,
  #settingsView,
  #promotionView,
  #productsView {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .view.active {
    display: block;
    padding: 0;
  }

  .proposal-preview {
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    width: 100%;
  }

  .proposal-cover {
    min-height: 165px;
    padding: 22px 28px;
  }

  .summary-strip {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .product-detail-section {
    padding: 0 22px;
  }

  .first-output-page {
    gap: 12px;
    break-after: page;
    page-break-after: always;
  }

  .first-print-product {
    padding: 0 22px;
  }

  .print-page {
    break-after: page;
    page-break-after: always;
  }

  .print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .two-products-page {
    gap: 12px;
  }

  .print-product {
    grid-template-columns: 44% 56% !important;
    min-height: 300px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .first-output-page .print-product {
    min-height: 345px;
  }

  .print-product-images,
  .print-product-images img {
    min-height: 300px;
  }

  .first-output-page .print-product-images,
  .first-output-page .print-product-images img {
    min-height: 345px;
  }

  .terms-section {
    break-before: page;
    page-break-before: always;
  }

  .print-product-detail {
    padding: 28px 38px;
  }

  .print-product-detail h4 {
    font-size: 25px;
  }

  .detail-block {
    margin-bottom: 10px;
    font-size: 17px;
    line-height: 1.45;
  }

  .blue-rule {
    margin: 10px 0 18px;
  }
}
