/* finesse · register=product+commerce · shell=sticky-filter-grid · palette=restrained-red+neutral · SOUL=4 SPECTACLE=1 DENSITY=8 */
:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --brand: #a62922;
  --brand-dark: #7f1d1d;
  --chip: #f7ecea;
  --brand-line: #ddb9b5;
  --focus: rgba(166, 41, 34, 0.2);
  --shadow: 0 10px 28px rgba(22, 32, 42, 0.08);
  --nav-h: 64px;
  --z-nav: 10;
  --z-sticky: 5;
}

/* finesse · component: popularity badge · register=product · tokens: inherited */
.product-popular-badge { display: inline-block; vertical-align: middle; margin-inline-start: 4px; padding: 1px 6px; border: 1px solid var(--brand-line); border-radius: 4px; color: var(--brand-dark); background: var(--chip); font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; }

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.quote-app-shell {
  position: relative;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px max(20px, calc((100vw - 1360px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

[data-app-shell] {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}

.quote-app-nav,
.quote-app-identity {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.quote-app-nav-link,
.quote-app-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.quote-app-nav-link[aria-current="page"] {
  color: #a62922;
  background: #f4deda;
  font-weight: 700;
}

.quote-app-count,
.quote-app-role,
.quote-app-version {
  color: var(--muted);
  font-size: 12px;
}

.quote-app-user {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button,
select,
input {
  font: inherit;
}

.page {
  width: 100%;
  max-width: 1360px;
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 12px 12px;
}

.app-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.3;
}

.app-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.app-footer {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 0 16px 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.filter-toggle {
  display: none;
}

.filter-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: repeat(8, minmax(104px, 1fr)) auto auto;
  gap: 10px;
  padding: 12px;
  background: rgba(244, 246, 248, 0.94);
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 6px;
  color: #425066;
  font-size: 13px;
  font-weight: 700;
}

.search-label,
.image-search-label {
  grid-column: span 2;
}

.text-search-button {
  min-width: 72px;
}

.image-search-label input[type="file"] {
  height: auto;
  min-height: 40px;
  padding: 8px 10px;
  line-height: 1.4;
}

.image-search-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.is-hidden {
  display: none !important;
}

select,
input,
button {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

select,
input {
  width: 100%;
  padding: 0 10px;
}

select:focus,
input:focus,
button:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus);
}

button {
  align-self: end;
  padding: 0 14px;
  color: var(--brand-dark);
  background: var(--chip);
  border-color: var(--brand-line);
  cursor: pointer;
  white-space: nowrap;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  color: var(--muted);
  font-size: 13px;
}

.series-focus-status {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--brand-dark);
  background: var(--chip);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  font-weight: 700;
}

.series-focus-status[hidden] {
  display: none;
}

.series-focus-status span {
  overflow-wrap: anywhere;
}

.exit-series-focus {
  flex: 0 0 auto;
  min-width: 112px;
  height: 34px;
  align-self: center;
  padding: 0 14px;
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding-bottom: 24px;
}

.product-card {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-card.has-audit {
  border-color: #d85b45;
}

.product-card.is-blocked {
  background: #fffafa;
}

.product-media {
  display: grid;
  gap: 8px;
  padding: 0 0 10px;
  background: #ffffff;
  border-bottom: 1px solid #eef2f5;
}

.product-image {
  width: 100%;
  min-height: 140px;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  display: block;
  background: #ffffff;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.product-image-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  padding: 0;
  margin: 0;
  border: 0;
  background: #ffffff;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}

.product-image-button .product-image {
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.product-image-button:hover .product-image {
  transform: scale(1.03);
}

.product-image-button::after {
  content: "\1F50D";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.product-image-button:hover::after,
.product-image-button:focus-visible::after {
  opacity: 1;
}

.product-image-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.thumb-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 10px;
}

.thumb-button {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  padding: 2px;
  align-self: auto;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
}

.thumb-button.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--focus);
}

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

.product-body {
  display: grid;
  gap: 11px;
  padding: 12px;
}

.product-name {
  min-height: 44px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.price-box {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 2px 10px;
  align-items: end;
  padding: 10px;
  background: var(--chip);
  border: 1px solid var(--brand-line);
  border-radius: 6px;
}

.price-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.price-box strong {
  color: #b13f2d;
  font-size: 22px;
  line-height: 1;
}

.price-box em {
  grid-column: 1 / -1;
  color: #425066;
  font-size: 12px;
  font-style: normal;
}

.series-style-button {
  align-self: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--brand-dark);
  background: #ffffff;
  border: 1px solid var(--brand-line);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.series-style-button:hover {
  border-color: var(--accent);
}

.smart-driver-button {
  width: 100%;
  height: 36px;
  align-self: auto;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 800;
}

.smart-driver-button:hover {
  background: var(--brand-dark);
}

.audit-box {
  padding: 8px 10px;
  color: #a43725;
  background: #fff0ec;
  border: 1px solid #efb8ac;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.audit-box.is-warning {
  color: #8a5a00;
  background: #fff8e6;
  border-color: #f1d48a;
}

.spec-list {
  display: grid;
  gap: 7px;
}

.spec-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 13px;
  line-height: 1.35;
}

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

.spec-value {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.card-quote-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 2px;
}

.card-quote-actions button {
  width: 100%;
  height: 36px;
  align-self: auto;
}

.add-card-quote {
  color: var(--brand-dark);
  background: var(--chip);
  border-color: var(--brand-line);
  font-weight: 700;
}

.card-draft-status,
.smart-driver-draft-status {
  min-height: 1.35em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #c7d0dc;
  border-radius: 8px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 0 0 28px;
}

.app-footer {
  display: flex;
  min-height: 28px;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 2px 2px;
  color: #72808c;
  font-size: 11px;
  line-height: 1.4;
}

.app-version {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.load-more-button {
  min-width: 180px;
  height: 42px;
  align-self: auto;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.load-more-button[hidden] {
  display: none;
}

.quote-preview {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.64);
}

.quote-preview.is-open {
  display: grid;
}

.quote-preview-panel {
  width: 100%;
  max-width: 760px;
  width: min(760px, 100%);
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.28);
}

.quote-preview-head,
.quote-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.quote-preview-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.quote-preview-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-preview-close,
.quote-preview-download {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--brand-dark);
  background: var(--chip);
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  text-decoration: none;
}

.quote-preview-body {
  overflow: auto;
  padding: 12px;
  background: #edf1f5;
}

.quote-preview-image {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.quote-status {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  display: none;
  transform: translateX(-50%);
  padding: 10px 14px;
  color: #fff;
  background: rgba(15, 23, 42, 0.88);
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.22);
}

body.is-quote-busy .quote-status {
  display: block;
}

.download-card-quote:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.smart-driver-dialog {
  width: calc(100% - 32px);
  max-width: 680px;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.28);
}

.smart-driver-dialog::backdrop {
  background: rgba(15, 23, 42, 0.62);
}

.smart-driver-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.smart-driver-dialog-head h2 {
  margin: 3px 0 5px;
  font-size: 22px;
}

.smart-driver-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.smart-driver-product-name {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.smart-driver-close {
  height: 34px;
  align-self: auto;
}

.smart-driver-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 0;
}

.smart-driver-result {
  min-height: 170px;
  padding: 18px 20px;
}

.smart-driver-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.smart-driver-details div {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  padding: 9px 10px;
  background: #f7f9fb;
  border-radius: 6px;
  font-size: 13px;
}

.smart-driver-details dt {
  color: var(--muted);
}

.smart-driver-details dd {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dimension-status {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.dimension-status.is-ok {
  color: #0b5f43;
  background: #e8f7ef;
  border-color: #9bd5b8;
}

.dimension-status.is-warning {
  color: #5f3d00;
  background: #fff1b8;
  border-color: #e2b94f;
}

.smart-driver-multihead {
  margin: 10px 0 0;
  padding: 10px 12px;
  color: #58451e;
  background: #fff9e9;
  border-left: 4px solid #d7a83b;
  font-size: 13px;
  line-height: 1.5;
}

.smart-driver-empty {
  min-height: 150px;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  background: #f7f9fb;
  border: 1px dashed #bbc5d2;
  border-radius: 8px;
}

.smart-driver-empty strong {
  color: var(--ink);
}

.smart-driver-dialog-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}

.smart-driver-dialog-actions button {
  width: 100%;
  align-self: auto;
}

.smart-driver-dialog-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 640px) {
  .smart-driver-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }

  .smart-driver-dialog-head,
  .smart-driver-result {
    padding: 14px;
  }

  .smart-driver-selectors,
  .smart-driver-dialog-actions,
  .smart-driver-details {
    grid-template-columns: 1fr;
  }

  .smart-driver-selectors {
    padding: 14px 14px 0;
  }

  .smart-driver-dialog-actions {
    padding: 14px;
  }

  .smart-driver-dialog-actions button {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  :root {
    --nav-h: 106px;
  }

  .quote-app-shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding-inline: 10px;
  }

  .quote-app-nav,
  .quote-app-identity {
    width: 100%;
    overflow-x: auto;
  }

  .quote-app-identity {
    justify-content: flex-end;
  }

  .page {
    padding: 10px;
  }

  .filter-toggle {
    position: sticky;
    top: var(--nav-h);
    z-index: calc(var(--z-sticky) + 1);
    display: block;
    width: 100%;
    margin-bottom: 8px;
  }

  .filter-bar {
    top: calc(var(--nav-h) + 48px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 70vh;
    overflow: auto;
    visibility: visible;
    pointer-events: auto;
    transition: max-height 0.2s ease, padding 0.2s ease, border-width 0.2s ease;
  }

  .filter-bar.is-collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-width: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
  }

  .search-label,
  .image-search-label {
    grid-column: 1 / -1;
  }

  button {
    grid-column: 1 / -1;
  }

  .card-quote-actions button {
    grid-column: auto;
  }

  .load-more-button {
    grid-column: auto;
    width: 100%;
    max-width: 260px;
    width: min(260px, 100%);
  }
}

@media (max-width: 480px) {
  .page {
    padding: 8px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  button {
    grid-column: auto;
  }

  .result-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 8px 0;
  }

  .series-focus-status {
    width: 100%;
    justify-content: space-between;
  }

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

  .product-card {
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(22, 32, 42, 0.06);
  }

  .product-media {
    gap: 0;
    padding-bottom: 0;
  }

  .product-image {
    min-height: 120px;
  }

  .thumb-row {
    display: none;
  }

  .product-body {
    gap: 8px;
    padding: 8px;
  }

  .product-name {
    min-height: 38px;
    font-size: 12px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .price-box {
    display: block;
    padding: 7px;
  }

  .price-box span,
  .price-box em {
    display: none;
  }

  .price-box strong {
    font-size: 17px;
  }

  .spec-list {
    gap: 4px;
  }

  .spec-row {
    grid-template-columns: 42px 1fr;
    gap: 5px;
    font-size: 10px;
    line-height: 1.25;
  }

  .spec-row:nth-child(n + 4) {
    display: none;
  }

  .audit-box {
    padding: 6px;
    font-size: 11px;
    line-height: 1.25;
  }

  .card-quote-actions {
    gap: 6px;
  }

  .card-quote-actions button {
    height: 44px;
    padding: 0 6px;
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
  }

  .card-quote-actions .add-card-quote {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-lightbox.is-open {
  display: flex;
}

body.is-lightbox-open {
  overflow: hidden;
}

.image-lightbox-panel {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  max-width: 96vw;
  max-height: 94vh;
}

.image-lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 94vh;
  min-width: 0;
}

.image-lightbox-image {
  max-width: 100%;
  max-height: 94vh;
  object-fit: contain;
  display: block;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

.image-lightbox-close,
.image-lightbox-prev,
.image-lightbox-next {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-dark, #7f1d1d);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: background 0.15s ease, transform 0.15s ease;
}

.image-lightbox-close:hover,
.image-lightbox-prev:hover,
.image-lightbox-next:hover {
  background: #fff;
  transform: scale(1.06);
}

.image-lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  font-size: 20px;
  z-index: 1;
}

.image-lightbox-prev[hidden],
.image-lightbox-next[hidden] {
  display: none;
}

.image-lightbox-caption {
  position: absolute;
  bottom: -38px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 13px;
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .image-lightbox-panel {
    grid-template-columns: minmax(0, 1fr);
  }
  .image-lightbox-prev,
  .image-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .image-lightbox-prev {
    left: 8px;
  }
  .image-lightbox-next {
    right: 8px;
  }
  .image-lightbox-close {
    top: -14px;
    right: -8px;
  }
  .image-lightbox-image {
    max-height: 80vh;
  }
}

.finished-office-product-card {
  min-width: 0;
}

.finished-office-source-note {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  background: var(--chip);
  border: 1px solid var(--brand-line);
  border-radius: 6px;
}

.finished-office-source-note span {
  color: var(--muted);
  font-size: 12px;
}

.finished-office-source-note strong {
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.finished-office-card-actions button {
  width: 100%;
  min-height: 44px;
  color: var(--panel);
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 800;
  white-space: nowrap;
}

.finished-office-card-actions button:hover {
  background: var(--brand-dark);
}

.finished-office-dialog {
  inset: 0 0 0 auto;
  width: min(440px, 42vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  border: 0;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.finished-office-dialog::backdrop {
  background: rgba(23, 32, 42, 0.42);
}

.finished-office-dialog-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
}

.finished-office-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.finished-office-dialog-heading {
  min-width: 0;
}

.finished-office-dialog-heading h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.finished-office-dialog-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.finished-office-close {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 44px;
  align-self: start;
}

.finished-office-dialog-scroll {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 24px;
}

.finished-office-product-summary {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.finished-office-product-summary img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.finished-office-product-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.finished-office-product-summary strong,
.finished-office-product-summary span {
  overflow-wrap: anywhere;
}

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

.finished-office-field-grid,
.finished-office-option-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin-top: 16px;
}

.finished-office-field-grid label:last-child {
  grid-column: 1 / -1;
}

.finished-office-field-grid label {
  min-width: 0;
}

.finished-office-field-error {
  min-height: 17px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 500;
}

.finished-office-choice-group {
  min-width: 0;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.finished-office-choice-group legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.finished-office-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.finished-office-choice-grid label {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.finished-office-choice-grid input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.finished-office-choice-grid span {
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.finished-office-choice-grid input:checked + span {
  color: var(--brand-dark);
  background: var(--chip);
  border-color: var(--brand);
}

.finished-office-choice-grid label > span {
  display: grid;
  align-content: center;
  gap: 2px;
}

.finished-office-choice-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.finished-office-choice-grid input:focus-visible + span,
.finished-office-dialog :focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.finished-office-validation-status,
.finished-office-preview-loading,
.finished-office-preview-error {
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  color: var(--brand-dark);
  background: var(--chip);
  font-size: 13px;
  line-height: 1.45;
}

.finished-office-preview-status {
  min-width: 0;
}

.finished-office-preview-success {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  background: var(--chip);
}

.finished-office-preview-success[hidden] {
  display: none;
}

.finished-office-preview-success > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.finished-office-preview-success span,
.finished-office-preview-success dt {
  color: var(--muted);
  font-size: 12px;
}

.finished-office-preview-success strong {
  color: var(--brand-dark);
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.finished-office-preview-success dl {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  margin: 2px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--brand-line);
}

.finished-office-preview-success dl div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
}

.finished-office-preview-success dd {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.finished-office-dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: grid;
  gap: 9px;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.finished-office-dialog-actions p {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.finished-office-sticky-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.finished-office-sticky-summary > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.finished-office-sticky-summary span {
  color: var(--muted);
  font-size: 11px;
}

.finished-office-sticky-summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.finished-office-sticky-summary strong span {
  color: inherit;
  font-size: inherit;
}

.finished-office-button-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.finished-office-dialog-actions button {
  min-height: 44px;
  align-self: auto;
  white-space: nowrap;
}

#finishedOfficeAdd:not(:disabled) {
  color: var(--panel);
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 800;
}

#finishedOfficeAdd:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

@media (max-width: 640px) {
  .finished-office-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 88dvh;
    margin: auto 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 10px 10px 0 0;
  }

  .finished-office-dialog-panel {
    max-height: 88dvh;
  }

  .finished-office-dialog-head {
    padding: 14px 14px 12px;
  }

  .finished-office-dialog-scroll {
    padding: 14px 14px 24px;
  }

  .finished-office-field-grid,
  .finished-office-option-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .finished-office-field-grid label:last-child {
    grid-column: auto;
  }

  .finished-office-dialog-actions {
    padding-inline: 14px;
  }
}
