:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.16);
  --soft: #f5f5f7;
  --paper: #ffffff;
  --accent: #0a7c6f;
  --accent-dark: #075f55;
  --gold: #b48a3c;
  --danger: #9f3b36;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f5f5f7;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.94), rgba(245, 245, 247, 0.98) 55%),
    #f5f5f7;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 34px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.09);
  backdrop-filter: blur(22px);
}

.login-card img {
  width: 156px;
  height: 58px;
  object-fit: contain;
}

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

.login-card p,
.login-card small {
  color: var(--muted);
}

.login-card input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.9);
}

.google-login {
  display: grid;
  gap: 8px;
  min-width: 0;
}

#googleSignInButton,
#googleSignInButton > div,
#googleSignInButton iframe {
  max-width: 100% !important;
}

#loginPinMessage {
  overflow-wrap: anywhere;
}

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

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

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

button {
  min-height: 34px;
  border: 1px solid rgba(60, 60, 67, 0.18);
  border-radius: 10px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  font-size: 12px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms ease, box-shadow 140ms ease;
}

button:hover {
  border-color: var(--accent);
  background: #f0f8f6;
  box-shadow: 0 6px 18px rgba(10, 124, 111, 0.09);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.danger {
  border-color: #d6b7b4;
  color: var(--danger);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: 170px;
  height: 60px;
  object-fit: contain;
  background: #fff;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
  letter-spacing: 0;
}

h2 {
  font-size: 12px;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.brand p {
  color: var(--muted);
  margin-top: 3px;
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.surface-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.82);
}

.surface-switcher button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  background: transparent;
  box-shadow: none;
}

.surface-switcher button.active {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.public-surface .top-actions #storageStatus,
.public-surface .top-actions #downloadAllBtn,
.public-surface .top-actions #clearBtn,
.public-surface .top-actions #adminAccessBtn,
.public-surface .top-actions .system-pill {
  display: none;
}

.top-actions .system-pill {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: #3d474f;
  font-size: 12px;
  font-weight: 700;
}

.studio {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  gap: 9px;
  padding: 9px;
  min-height: calc(100vh - 76px);
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.library-page {
  padding: 14px;
  min-height: calc(100vh - 76px);
}

.library-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.library-page-head h2 {
  font-size: 18px;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.library-page-head p {
  color: var(--muted);
  font-size: 13px;
}

.storage-pill.ok {
  color: #0f5f4c;
  background: #e9f6f1;
  border-color: #b9dfd1;
}

.storage-pill.warn {
  color: #8a5a00;
  background: #fff7df;
  border-color: #ead28d;
}

.storage-notice {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #ead28d;
  border-radius: 10px;
  color: #604200;
  background: #fff9e9;
  font-size: 12px;
  line-height: 1.45;
}

.storage-notice strong {
  display: block;
  margin-bottom: 2px;
  color: #352500;
}

.storage-notice small {
  display: block;
  margin-top: 4px;
  color: #7a641f;
  word-break: break-all;
}

.client-catalogue-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 24px;
  align-items: center;
  margin-top: 12px;
  padding: 26px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 248, 246, 0.8)),
    #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.07);
}

.client-catalogue-intro span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.client-catalogue-intro h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 0.98;
  text-transform: none;
  letter-spacing: -0.01em;
}

.client-catalogue-intro p {
  max-width: 610px;
  margin-top: 10px;
  color: #4c5358;
  font-size: 15px;
  line-height: 1.55;
}

.client-catalogue-stats {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 8px;
}

.client-catalogue-stats div {
  display: grid;
  gap: 2px;
  min-height: 78px;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.client-catalogue-stats strong {
  font-size: 24px;
  line-height: 1;
}

.client-catalogue-stats small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.client-catalogue-actions {
  display: grid;
  gap: 8px;
}

.client-catalogue-actions button {
  min-width: 150px;
  min-height: 40px;
}

.public-catalogue-explore {
  max-width: 1480px;
  margin: 18px auto 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 14px;
}

.public-catalogue-explore section {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.045);
  backdrop-filter: blur(20px);
}

.public-catalogue-explore section > span {
  color: #6f6455;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.public-explore-chips,
.public-search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-explore-chips button,
.public-search-suggestions button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border-color: rgba(60, 60, 67, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: #2d2d2f;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.035);
}

.public-explore-chips button:hover,
.public-search-suggestions button:hover {
  border-color: rgba(180, 138, 60, 0.36);
  background: #fffaf1;
}

.public-explore-chips small {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f2eee6;
  color: #7a684e;
  font-size: 10px;
}

.library-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.library-mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.library-mode-toggle button {
  border: 0;
  background: transparent;
}

.library-mode-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.shopfloor-view-mode .library-page-head > div:first-child,
.shopfloor-view-mode .library-page-actions > button {
  display: none;
}

.shopfloor-view-mode .library-page-head {
  padding: 10px;
}

.shopfloor-view-mode .library-page-actions,
.shopfloor-view-mode .library-mode-toggle {
  width: 100%;
}

.shopfloor-view-mode .library-mode-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shopfloor-view-mode .library-mode-toggle button {
  min-width: 0;
  padding-inline: 6px;
}

.library-filter-shell {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.smart-library-filter {
  align-items: start;
}

.library-filter-top {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.library-filter-top input,
.library-filter-top button,
.library-facet-filters select,
.library-bulk-actions select,
.library-bulk-actions input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
}

.library-smart-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.library-smart-chips button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
}

.library-smart-chips button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.library-active-filter-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.library-bulk-actions {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.library-bulk-actions summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.library-bulk-actions[open] summary {
  margin-bottom: 10px;
}

.library-filter-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: 12px;
}

.library-filter-grid section {
  padding: 10px;
  background: #f8f9f8;
  border: 1px solid #edf0ee;
  border-radius: 8px;
}

.library-filter-grid h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.library-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.library-chip-row button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
}

.library-chip-row button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.library-selection-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.library-selection-actions button,
.library-selection-actions select,
.library-selection-actions input {
  min-height: 32px;
}

.library-selection-actions button,
.library-selection-actions select {
  white-space: nowrap;
}

.library-selection-actions input {
  width: min(220px, 100%);
}

.library-facet-filters div {
  display: grid;
  gap: 8px;
}

.background-render-status {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d6b875;
  border-radius: 8px;
  background: #fff8e7;
  color: #5a4410;
}

.background-render-status strong {
  display: block;
  font-size: 13px;
}

.background-render-status span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #75612b;
}

.background-render-status button {
  white-space: nowrap;
}

.library-page-summary {
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.library-dashboard-card {
  position: relative;
  display: grid;
  gap: 8px;
  text-align: left;
  padding: 10px;
  min-height: 250px;
  align-content: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.library-dashboard-card.selected-for-export {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(28, 98, 83, 0.16);
}

.library-select-chip {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.library-dashboard-card.selected-for-export .library-select-chip {
  background: var(--accent);
  color: #fff;
}

.library-dashboard-card.showcase-card {
  min-height: 338px;
  padding: 12px;
  border-radius: 22px;
  border-color: rgba(60, 60, 67, 0.12);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.055);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.library-dashboard-card.showcase-card:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 124, 111, 0.3);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.09);
}

.library-dashboard-card.showcase-card strong {
  font-size: 17px;
  line-height: 1.12;
}

.library-dashboard-card.showcase-card img,
.library-dashboard-card.showcase-card .library-dashboard-thumb-empty {
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  background: #fff;
}

.library-dashboard-thumb-wrap {
  position: relative;
}

.library-dashboard-card img,
.library-dashboard-thumb-empty {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 1px solid #edf0ee;
  border-radius: 6px;
  background: #f8f9f8;
}

.library-thumbnail-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.library-dashboard-thumb-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.library-dashboard-card strong {
  font-size: 14px;
}

.library-card-status {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

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

.shopfloor-page {
  display: grid;
  gap: 14px;
}

.shopfloor-capture,
.shopfloor-review {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.shopfloor-title h2 {
  font-size: 18px;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.shopfloor-title p {
  color: var(--muted);
  font-size: 13px;
}

.shopfloor-form {
  display: grid;
  gap: 14px;
}

.shopfloor-meta {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.7fr) minmax(260px, 1.25fr);
  gap: 10px;
}

.shopfloor-meta label,
.shopfloor-dimensions {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shopfloor-dimensions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border: 0;
}

.shopfloor-dimensions legend {
  grid-column: 1 / -1;
  padding: 0;
  color: var(--muted);
}

.shopfloor-meta input,
.shopfloor-meta select,
.shopfloor-meta textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

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

.shopfloor-slot-grid.detail {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shopfloor-slot {
  display: grid;
  gap: 8px;
  min-height: 210px;
  padding: 10px;
  border: 1px dashed rgba(60, 60, 67, 0.28);
  border-radius: 8px;
  background: #fbfcfb;
  cursor: pointer;
}

.shopfloor-slot span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.shopfloor-slot strong {
  display: grid;
  place-items: center;
  min-height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.shopfloor-slot input {
  position: absolute;
  width: 1px;
  height: 1px;
  inset: 0 auto auto 0;
  opacity: 0;
  pointer-events: none;
}

.shopfloor-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid #e8ecea;
  border-radius: 6px;
  background: #f4f6f5;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}

.shopfloor-preview img,
.shopfloor-thumb-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shopfloor-uploaded-grid {
  display: grid;
  gap: 12px;
}

.shopfloor-product {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.shopfloor-product-summary {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.shopfloor-product-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.shopfloor-primary-thumb {
  position: relative;
  overflow: hidden;
  border: 1px solid #e8ecea;
  border-radius: 6px;
  background: #fff;
}

.shopfloor-primary-thumb img,
.shopfloor-primary-thumb > div {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  color: var(--muted);
  font-size: 11px;
}

.shopfloor-product-summary strong {
  display: block;
  font-size: 15px;
}

.shopfloor-product-summary small,
.shopfloor-product-summary > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shopfloor-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.shopfloor-thumb-grid figure {
  display: grid;
  gap: 6px;
  margin: 0;
}

.shopfloor-thumb-grid img {
  aspect-ratio: 4 / 3;
  border: 1px solid #e8ecea;
  border-radius: 6px;
  background: #fff;
}

.shopfloor-thumb-grid figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.shopfloor-thumb-grid button {
  min-height: 28px;
  padding: 4px 8px;
}

.library-quick-add {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.library-quick-add:hover {
  background: var(--accent-dark);
}

.library-card-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.library-card-badges span {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--soft);
  color: #4e5962;
  font-size: 10px;
  font-weight: 900;
}

.library-card-badges .ok {
  background: #dff1ea;
  color: var(--accent-dark);
}

.library-card-badges .warn {
  background: #fff1d7;
  color: #7a5514;
}

.library-missing-note {
  color: #7a5514;
  line-height: 1.35;
}

.showcase-detail-panel {
  width: min(1080px, calc(100vw - 42px));
  max-height: calc(100vh - 64px);
  overflow: hidden;
}

.showcase-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  padding: 16px;
  overflow-y: auto;
}

.showcase-detail-image {
  min-height: 420px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.showcase-detail-image img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.showcase-detail-copy {
  display: grid;
  align-content: start;
  gap: 14px;
}

.showcase-detail-copy p {
  color: #374047;
  font-size: 14px;
  line-height: 1.55;
}

.showcase-detail-copy dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.showcase-detail-copy dl div {
  display: grid;
  gap: 3px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.showcase-detail-copy dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.showcase-detail-copy dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.customer-gallery {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #fff;
  color: #171b1f;
}

.customer-gallery-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: #fff;
}

.customer-gallery-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px 10px;
}

.customer-gallery-top img {
  width: 158px;
  height: 48px;
  object-fit: contain;
}

.customer-gallery-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.customer-gallery-top button {
  min-height: 36px;
  padding-inline: 14px;
}

.customer-gallery-main {
  min-height: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
}

.customer-gallery-frame {
  min-height: 0;
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
}

.customer-gallery-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.customer-gallery-frame figcaption {
  min-height: 24px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.customer-gallery-nav {
  width: 48px;
  height: 72px;
  border: 0;
  border-radius: 999px;
  background: #f1f3f2;
  color: #293037;
  font-size: 42px;
  font-family: Georgia, serif;
  line-height: 1;
}

.customer-gallery-nav:hover {
  background: var(--accent);
  color: #fff;
}

.customer-gallery-nav:disabled {
  opacity: 0.25;
}

.customer-gallery-info {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 26px;
  padding: 12px 8vw 18px;
  border-top: 1px solid #edf0ee;
}

.customer-gallery-meta {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-gallery-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.04;
  text-transform: none;
  letter-spacing: 0;
}

.customer-gallery-copy p {
  max-width: 620px;
  color: #30363b;
  font-size: 15px;
  line-height: 1.55;
}

.customer-gallery-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
}

.customer-gallery-details div {
  min-width: 0;
}

.customer-gallery-details dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-gallery-details dd {
  margin: 3px 0 0;
  color: #22282d;
  font-size: 13px;
  line-height: 1.35;
}

.customer-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 24px 14px;
}

.customer-gallery-dots button {
  width: 9px;
  height: 9px;
  min-height: 9px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: #cfd6d3;
}

.customer-gallery-dots button.active {
  width: 28px;
  background: var(--accent);
}

.library-gallery-chip {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f4f3;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.showcase-mode .library-page-head {
  border-radius: 24px;
}

.showcase-mode .library-filter-shell {
  border-radius: 20px;
  padding: 14px;
}

.public-surface .library-page {
  padding: 22px clamp(16px, 3vw, 44px) 40px;
  background:
    radial-gradient(circle at 18% 0%, rgba(245, 240, 229, 0.75), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 245, 247, 0.96) 48%, rgba(255, 255, 255, 0.98) 100%),
    #f5f5f7;
}

.public-surface .library-page-head {
  display: none;
}

.public-surface .library-filter-shell {
  max-width: 1180px;
  margin: 0 auto 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.045);
}

.public-surface .library-filter-top {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.public-surface #librarySearchInput {
  min-height: 54px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  padding-inline: 18px;
}

.public-surface .library-smart-chips,
.public-surface .library-active-filter-summary,
.public-surface .library-bulk-actions,
.public-surface #backgroundRenderStatus {
  display: none;
}

.public-surface .library-dashboard-grid {
  max-width: 1480px;
  margin-inline: auto;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 26px;
}

.public-surface .library-dashboard-card.showcase-card {
  min-height: 472px;
  gap: 10px;
  padding: 16px;
  border-radius: 30px;
  border-color: rgba(60, 60, 67, 0.11);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.075);
}

.public-surface .library-dashboard-card.showcase-card img,
.public-surface .library-dashboard-card.showcase-card .library-dashboard-thumb-empty {
  aspect-ratio: 16 / 11;
  border: 0;
  border-radius: 20px;
  background: #fff;
}

.public-surface .library-dashboard-card.showcase-card .library-card-status {
  color: #81766b;
  font-size: 12px;
  font-weight: 750;
}

.public-surface .library-dashboard-card.showcase-card strong {
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.public-surface .library-dashboard-card.showcase-card small {
  font-size: 12px;
}

.public-surface .library-gallery-chip {
  width: fit-content;
  margin-top: 4px;
  padding: 9px 14px;
  background: #f2eee6;
  color: #4b4034;
}

.studio-surface .client-catalogue-intro {
  display: none;
}

.showcase-mode .library-smart-chips button {
  min-height: 34px;
}

.showcase-mode .library-bulk-actions,
.showcase-mode #libraryBatchMappingBtn,
.showcase-mode #libraryBatchRenderBtn,
.showcase-mode #libraryImportFolderBtn {
  display: none;
}

.showcase-mode .library-dashboard-grid {
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

@media (max-width: 860px) {
  .client-catalogue-intro {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .public-catalogue-explore {
    grid-template-columns: 1fr;
  }

  .client-catalogue-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .client-catalogue-actions {
    grid-template-columns: 1fr 1fr;
  }

  .customer-gallery-shell {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }

  .customer-gallery-main {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    padding: 0 6px;
  }

  .customer-gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 34px;
    height: 54px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    font-size: 32px;
  }

  #customerGalleryPrev {
    left: 8px;
  }

  #customerGalleryNext {
    right: 8px;
  }

  .customer-gallery-frame {
    width: 100%;
  }

  .customer-gallery-frame img {
    width: 100%;
    max-height: calc(100vh - 252px);
  }

  .customer-gallery-info {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 12px 10px;
    max-height: 24vh;
    overflow-y: auto;
  }

  .customer-gallery-details {
    grid-template-columns: 1fr;
  }
}

.sidebar,
.workspace {
  min-width: 0;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar section,
.progress-strip,
.view-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar section {
  padding: 8px;
}

.library-panel {
  display: grid;
  gap: 7px;
}

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

.library-head h2 {
  margin-bottom: 0;
}

.library-panel select {
  width: 100%;
  min-height: 34px;
  font-size: 12px;
}

.library-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.library-actions button {
  min-height: 32px;
  padding-inline: 8px;
  font-size: 11px;
}

.library-actions #importFolderBtn {
  grid-column: 1 / -1;
}

.library-panel p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.library-grid {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.external-import-panel {
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 64px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
}

.external-import-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.external-import-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.external-import-toolbar input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
}

.external-import-summary {
  margin: 10px 14px 0;
  padding: 9px 10px;
  border: 1px solid #e1d2a7;
  border-radius: 6px;
  background: #fff8e7;
  color: #6c5116;
  font-size: 12px;
  font-weight: 800;
}

.external-import-list-head {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px 8px;
}

.external-import-list {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
  overflow-y: auto;
}

.external-import-row {
  display: grid;
  grid-template-columns: 26px 82px 1.2fr 0.8fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.external-import-row.selected {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.external-import-row img,
.external-import-thumb-empty {
  width: 82px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f7f4;
}

.external-import-thumb-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.external-import-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.external-import-meta strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.external-import-meta small {
  color: var(--muted);
  font-size: 11px;
}

.external-import-fields {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 8px;
}

.external-import-fields input,
.external-import-fields select {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
}

.library-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 7px;
  align-items: center;
  min-height: 66px;
  padding: 5px;
  text-align: left;
}

.library-card.active {
  border-color: var(--accent);
  background: #edf6f3;
}

.library-card img,
.library-empty {
  grid-row: span 2;
  width: 58px;
  height: 52px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e5e9e7;
  border-radius: 5px;
}

.library-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 9px;
}

.library-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-card small {
  color: var(--muted);
  font-size: 10px;
}

.library-empty-state {
  color: var(--muted);
  font-size: 11px;
}

.upload-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.upload-slot {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "thumb"
    "action"
    "remove";
  align-items: stretch;
  gap: 5px;
  padding: 6px;
  border: 1px dashed #aeb9b5;
  border-radius: 8px;
  background: #fbfcfb;
}

.remove-ref-btn {
  grid-area: remove;
  min-height: 26px;
  padding: 3px 6px;
  color: var(--danger);
  font-size: 10px;
}

.upload-slot strong {
  grid-area: title;
  display: block;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.upload-slot img {
  grid-area: thumb;
  width: 100%;
  height: 78px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e5e9e7;
  border-radius: 6px;
}

.mini-empty {
  grid-area: thumb;
  display: grid;
  place-items: center;
  width: 100%;
  height: 78px;
  border: 1px solid #e5e9e7;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.sidebar-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 8px 18px rgba(33, 43, 49, 0.06);
}

.sidebar-tools button {
  width: 100%;
  min-height: 34px;
  padding-inline: 8px;
  font-size: 11px;
  line-height: 1.15;
}

.sidebar-tools #backToLibraryBtn {
  grid-column: 1 / -1;
  min-height: 38px;
  border-color: rgba(0, 136, 111, 0.24);
  background: #edf6f3;
  color: var(--accent-dark);
}

.sidebar-tools #checkReferencesBtn {
  grid-column: 1 / -1;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-button {
  grid-area: action;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 25px;
  padding: 3px 6px;
  border: 1px solid #b9c3bf;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.file-button:hover {
  border-color: var(--accent);
  background: #edf6f3;
  color: var(--accent-dark);
}

.settings-list {
  margin: 0;
  display: grid;
  gap: 8px;
}

.compact-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: start center;
  padding: 80px 18px 18px;
  background: rgba(18, 24, 27, 0.34);
}

.compact-panel {
  width: min(520px, 100%);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.prompt-panel {
  width: min(760px, 100%);
}

.export-review-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.catalogue-pdf-panel {
  width: min(640px, 100%);
}

.admin-access-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.admin-access-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.admin-access-message {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid #d9e4e0;
  border-radius: 10px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-access-list {
  display: grid;
  gap: 12px;
}

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(140px, 0.9fr) minmax(120px, 0.7fr) minmax(260px, 1.6fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #dfe6e3;
  border-radius: 14px;
  background: #fff;
}

.admin-user-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-user-card input,
.admin-user-card select {
  min-height: 34px;
}

.admin-permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-permission-grid label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid #d7dfdc;
  border-radius: 999px;
  background: #f8fbfa;
  color: var(--ink);
  text-transform: none;
  font-size: 11px;
  cursor: pointer;
}

.admin-permission-grid input {
  min-height: auto;
}

.admin-remove-user {
  align-self: end;
  color: #9d443f;
}

.catalogue-pdf-options {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.catalogue-pdf-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.catalogue-pdf-option strong,
.catalogue-pdf-option small {
  display: block;
}

.catalogue-pdf-option small,
.catalogue-pdf-summary {
  color: var(--muted);
}

.catalogue-pdf-summary {
  padding: 10px 12px;
  border: 1px solid #eadcb6;
  border-radius: 8px;
  background: #fff8e8;
  line-height: 1.4;
}

.unsaved-panel {
  width: min(480px, 100%);
}

#unsavedChangesModal {
  z-index: 60;
}

.unsaved-panel .modal-head {
  margin-bottom: 14px;
}

.unsaved-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.unsaved-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.export-review-body {
  display: grid;
  gap: 14px;
}

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

.export-warning-list div {
  padding: 9px 10px;
  border: 1px solid #d8c9a5;
  border-radius: 7px;
  background: #fff8e8;
  color: #6d5520;
  font-size: 13px;
  font-weight: 700;
}

.export-path-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.export-path-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf9;
}

.export-path-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.export-path-grid strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

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

.export-choice {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px;
  text-align: left;
  border: 1px solid #cfd7d3;
  background: #fff;
}

.export-choice.active {
  border-color: var(--accent);
  background: #edf6f3;
  box-shadow: inset 0 0 0 1px var(--accent);
}

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

.export-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.export-file-list {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
}

.export-file-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.export-file-list-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.export-file-list-body {
  display: grid;
  gap: 5px;
  max-height: 170px;
  overflow: auto;
  padding-right: 4px;
}

.export-file-list-body div {
  padding: 7px 8px;
  border-radius: 6px;
  background: #f6f8f7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-head h2 {
  margin: 0;
}

.settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.settings-list dt {
  color: var(--muted);
}

.settings-list dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

select,
textarea,
input[type="text"] {
  width: 100%;
  border: 1px solid #cbd4d0;
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8faf9;
  border: 1px solid #dce3df;
  border-radius: 7px;
  padding: 10px;
  max-height: 160px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
}

.generate-all {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.generate-all h2 {
  grid-column: 1 / -1;
  margin-bottom: 1px;
}

.generate-all .primary {
  grid-column: 1 / -1;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
}

.manage-product-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.manage-title-copy {
  min-width: 0;
}

.manage-product-title span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.manage-product-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  text-transform: none;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.manage-product-title p {
  max-width: 720px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.manage-title-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.mobile-production-bar {
  display: none;
}

.manage-title-actions #toggleCatalogueStatusBtn {
  min-height: 38px;
  padding-inline: 14px;
  border-color: rgba(0, 136, 111, 0.24);
  background: #edf6f3;
  color: var(--accent-dark);
  white-space: nowrap;
}

.progress-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.catalogue-readiness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e4d6b8;
  border-radius: 8px;
  background: #fff8e8;
  color: #684814;
}

.catalogue-readiness strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.catalogue-readiness span {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
}

.catalogue-readiness.ready,
.catalogue-readiness.in-catalogue {
  border-color: #b8d8ca;
  background: #eef8f3;
  color: var(--accent-dark);
}

.progress-item {
  display: grid;
  gap: 4px;
  padding: 7px;
  border-radius: 7px;
  background: var(--soft);
}

.progress-item.is-busy,
.view-card.is-busy {
  border-color: #d7c8a8;
  background: #fffaf0;
}

.progress-item strong {
  font-size: 13px;
}

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

.credit-pill {
  border: 1px solid #d7c8a8;
  background: #fbf7ee;
  color: #5d4721;
  white-space: nowrap;
}

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

.catalogue-panel,
.line-panel,
.special-panel,
.material-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.035);
}

.special-panel {
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 247, 244, 0.88)),
    #fff;
}

.catalogue-head,
.line-head,
.special-head,
.material-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.catalogue-head p,
.line-head p,
.special-head p,
.material-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.catalogue-actions,
.line-actions,
.special-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.special-actions select,
.finish-swatch-card input {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 8px;
  background: #fff;
  font-weight: 700;
  color: var(--ink);
}

.line-body,
.special-body {
  display: grid;
  gap: 9px;
}

.line-preview,
.special-preview {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--muted);
  overflow: hidden;
}

.line-preview img,
.special-preview img {
  width: 100%;
  height: 100%;
  max-height: 460px;
  object-fit: contain;
}

.special-builder {
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(280px, 0.75fr) minmax(280px, 0.75fr);
  gap: 12px;
}

.special-builder label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.special-builder textarea {
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.special-reference-tools {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfa;
}

.special-reference-tools input {
  max-width: 100%;
  font-size: 11px;
}

.special-reference-tools p,
.material-guidance {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.special-builder .wide {
  grid-row: span 2;
}

.special-edit-field {
  grid-column: span 2;
}

.special-edit-field textarea {
  min-height: 96px;
  border-color: rgba(10, 124, 111, 0.34);
  background: #fbfffd;
}

.special-edit-field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 124, 111, 0.12);
}

.lifestyle-brief-panel {
  grid-column: span 3;
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.035);
}

.lifestyle-brief-panel h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.lifestyle-brief-panel p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.lifestyle-brief-grid label {
  min-width: 0;
}

.lifestyle-brief-grid textarea {
  min-height: 74px;
  font-size: 12px;
  line-height: 1.35;
}

.special-product-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.special-product-picker.special-picker-muted {
  opacity: 0.72;
}

.special-product-picker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.special-product-picker-head input,
.special-product-picker-head select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.special-product-picker-head select {
  appearance: none;
}

.special-selected-products {
  min-height: 30px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.special-selected-chip {
  min-height: 26px;
  padding: 4px 8px;
  border-color: #b8d6cc;
  border-radius: 999px;
  background: #e5f4ef;
  color: var(--accent-dark);
  font-size: 10px;
}

.special-guidance {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.special-product-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 9px;
  max-height: 310px;
  overflow-y: auto;
  padding-right: 2px;
}

.special-product-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 86px;
  padding: 8px;
  border-radius: 16px;
  text-align: left;
  background: #fff;
}

.special-product-card.selected {
  border-color: var(--accent);
  background: #edf6f3;
  box-shadow: 0 0 0 2px rgba(31, 95, 85, 0.12);
}

.special-product-thumb {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid #edf0ee;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
}

.special-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.special-product-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.special-product-copy strong,
.special-product-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-product-copy strong {
  font-size: 11px;
  color: var(--ink);
}

.special-product-copy small,
.special-picker-empty {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.special-preview {
  min-height: 320px;
}

.special-preview-zoom {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 320px;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
}

.special-preview-zoom img {
  width: 100%;
  height: 100%;
  max-height: 460px;
  object-fit: contain;
}

.special-preview-zoom span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

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

.finish-swatch-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(248, 249, 247, 0.9);
}

.finish-swatch-card h3 {
  font-size: 13px;
  color: var(--ink);
}

.finish-swatch-card p,
.finish-swatch-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.finish-swatch-card input {
  width: 100%;
  padding: 6px 8px;
}

@media (max-width: 980px) {
  .finish-swatch-grid {
    grid-template-columns: 1fr;
  }
}

.special-zoom-panel {
  grid-template-rows: auto auto minmax(320px, 1fr) auto;
}

.inspector-prompt {
  max-height: 130px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8f7;
  color: var(--muted);
  font-size: 11px;
  white-space: pre-wrap;
}

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.catalogue-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.catalogue-grid label.wide {
  grid-column: span 5;
}

.catalogue-grid input,
.catalogue-grid select,
.catalogue-grid textarea {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.view-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  min-width: 0;
}

.view-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.view-head h2 {
  margin: 0;
  font-size: 15px;
}

.view-source {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.image-pane {
  min-width: 0;
}

.image-pane label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-box {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #dbe2de;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.generated-box {
  position: relative;
}

.image-approval {
  position: absolute;
  z-index: 3;
  top: 7px;
  right: 7px;
  min-height: 28px;
  max-width: calc(100% - 14px);
  padding: 5px 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}

.image-approval.pending-state {
  background: #fff8eb;
  border-color: #d5a84f;
  color: #73531a;
}

.image-approval.approved-state {
  background: #1f7a52;
  border-color: #1f7a52;
  color: #fff;
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

.loading-state {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 16px;
  color: #5d4721;
  background: linear-gradient(180deg, #fffaf0, #ffffff);
  text-align: center;
}

.loading-state strong {
  font-size: 13px;
}

.loading-state small {
  max-width: 220px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #eadfc9;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.version-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.version-thumb {
  position: relative;
  flex: 0 0 74px;
  border: 1px solid #d5ddd9;
  border-radius: 7px;
  padding: 4px;
  background: #fff;
  cursor: pointer;
}

.version-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 95, 85, 0.15);
}

.version-thumb.approved {
  border-color: var(--gold);
}

.version-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.version-thumb span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  text-align: center;
}

.version-thumb .version-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 0;
  border: 1px solid #d8aaa6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--danger);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.version-thumb .version-delete:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.correction {
  display: grid;
  gap: 8px;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.locked-standard-actions .card-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.locked-inspector-tools {
  justify-content: flex-end;
}

.locked-inspector-tools span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.manual-upload-btn {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid #b9c3bf;
  border-radius: 6px;
  padding: 6px 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
}

.manual-upload-btn:hover {
  border-color: var(--accent);
  background: #edf6f3;
}

.line-import-btn {
  min-height: 34px;
}

.manual-version-input {
  display: none;
}

.export-all-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #cfd7d3;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.export-all-toggle input {
  margin: 0;
}

.source-select {
  padding: 7px 8px;
  font-size: 12px;
}

.generate-btn:hover,
[data-generate]:hover {
  background: #e7f4f0;
  border-color: var(--accent);
  color: var(--accent-dark);
}

.generate-btn:active,
[data-generate]:active {
  background: var(--accent);
  color: #fff;
}

.edit-btn:hover {
  background: #fff6e4;
  border-color: var(--gold);
  color: #7a5719;
}

.edit-btn:active {
  background: var(--gold);
  color: #fff;
}

.cleanup-btn {
  color: var(--muted);
}

.cleanup-btn:hover {
  background: #f1f7ff;
  border-color: #4b76a8;
  color: #254f7d;
}

.cleanup-btn:active {
  background: #4b76a8;
  color: #fff;
}

.expand-btn:hover {
  background: #eef2f4;
  border-color: #5e6872;
  color: #38434c;
}

.expand-btn:active {
  background: #5e6872;
  color: #fff;
}

.approve-btn:hover,
.approve-btn.approved-state {
  background: #16803c;
  border-color: #16803c;
  color: #fff;
}

.approve-btn:active {
  background: #0f6530;
  color: #fff;
}

.inspector {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(18, 24, 27, 0.55);
  padding: 14px;
}

.hidden {
  display: none !important;
}

.inspector-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(320px, 1fr) auto auto;
  gap: 10px;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px;
  background: #fff;
  border-radius: 8px;
}

.inspector-head,
.zoom-controls,
.compare-row,
.source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.source-row label {
  display: grid;
  grid-template-columns: auto minmax(220px, 340px);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inspector-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.zoom-stage {
  overflow: auto;
  display: grid;
  place-items: center;
  background: #f6f7f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 420px;
}

.zoom-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.inspector-contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 980px);
}

.inspector-contact figure {
  margin: 0;
  display: grid;
  gap: 6px;
}

.inspector-contact img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inspector-contact figcaption {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.inspector-edit {
  display: grid;
  gap: 8px;
}

.import-review {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(18, 24, 27, 0.58);
  padding: 10px;
}

.import-review-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  height: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
}

.batch-mapping-meta {
  display: grid;
  grid-template-columns: 190px minmax(220px, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.batch-mapping-meta label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.batch-mapping-meta input,
.batch-mapping-meta select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.import-review-content {
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 12px;
  padding-right: 4px;
}

.import-review-content section:nth-child(4) {
  grid-column: 2;
  grid-row: 1 / span 3;
}

.import-review-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 6px;
}

.import-review-title h3 {
  margin: 0;
  font-size: 14px;
}

.import-review-title p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.import-active-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.import-active-tools span {
  padding: 6px 8px;
  border: 1px solid #1d6b38;
  border-radius: 6px;
  color: #1d6b38;
  background: #f3faf5;
  font-size: 11px;
  font-weight: 800;
}

.import-active-tools button {
  min-height: 30px;
  padding-inline: 9px;
  font-size: 11px;
}

.import-slot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.import-slot,
.import-bank-card {
  display: grid;
  gap: 6px;
  padding: 7px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.import-slot,
.import-bank-card {
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.import-line-slot {
  max-width: none;
}

.import-preview {
  display: grid;
  place-items: center;
  min-height: 64px;
  background: #f7f7f5;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.compact-import-slot {
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
}

.compact-import-slot .import-preview {
  min-height: 58px;
  height: 58px;
}

.compact-import-slot.active {
  border-color: #1d6b38;
  outline: 2px solid #1d6b38;
  background: #f3faf5;
}

.compact-import-slot.filled:not(.active) {
  border-color: #b8c8bf;
}

.import-slot-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.import-slot-meta strong {
  font-size: 12px;
}

.import-slot-meta small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.import-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.import-file-bank {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  align-content: start;
}

.import-bank-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
}

.import-bank-card.selected {
  outline: 2px solid #1d6b38;
  border-color: #1d6b38;
}

.import-bank-image {
  width: 100%;
  height: 100%;
  background: #f7f7f5;
}

.import-bank-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.import-kind-badge,
.import-view-badge,
.import-selected-badge {
  position: absolute;
  left: 6px;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.import-kind-badge {
  top: 6px;
}

.import-view-badge {
  bottom: 6px;
}

.import-selected-badge {
  right: 6px;
  left: auto;
  top: 6px;
  background: #1d6b38;
  color: #fff;
}

.import-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 460px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #1f2428;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  z-index: 40;
}

@media (max-width: 1180px) {
  .studio {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .sidebar-tools {
    position: static;
  }

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

  .special-builder {
    grid-template-columns: 1fr;
  }

  .special-builder .wide,
  .special-edit-field,
  .lifestyle-brief-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .lifestyle-brief-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    background: #fff;
  }

  .toast {
    top: 10px;
    right: 10px;
    bottom: auto;
    left: 10px;
    max-width: none;
    padding: 10px 12px;
    font-size: 12px;
    z-index: 80;
  }

  .topbar,
  .brand,
  .top-actions,
  .comparison,
  .view-grid,
  .import-slot-grid,
  .progress-strip,
  .special-builder,
  .card-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    position: static;
  }

  .brand {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .brand img {
    width: 88px;
    height: 34px;
    align-self: center;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    display: none;
  }

  .top-actions button,
  .top-actions .pill {
    width: 100%;
    justify-content: center;
  }

  .top-actions .surface-switcher,
  .top-actions .surface-switcher button {
    width: auto;
  }

  .surface-switcher button {
    padding-inline: 10px;
  }

  .top-actions .pill,
  .top-actions #downloadAllBtn,
  .top-actions #clearBtn {
    display: none;
  }

  .top-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }

  .top-actions #adminAccessBtn {
    min-height: 32px;
    padding: 5px 10px;
  }

  .shopfloor-view-mode .top-actions #adminAccessBtn {
    display: none;
  }

  .shopfloor-view-mode .top-actions {
    gap: 8px;
  }

  .shopfloor-view-mode .topbar {
    gap: 8px;
  }

  .library-page {
    padding: 8px;
  }

  .shopfloor-view-mode .library-page {
    padding: 6px;
  }

  .library-page-head {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    position: sticky;
    top: 0;
    z-index: 8;
  }

  .library-page-head > div:first-child {
    display: none;
  }

  .shopfloor-view-mode .library-page-head {
    gap: 0;
    padding: 0;
    border: 0;
    background: transparent;
    position: static;
  }

  .library-page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .library-page-actions > button {
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .library-mode-toggle {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .library-mode-toggle button {
    min-width: 0;
    min-height: 34px;
    padding: 5px 4px;
    font-size: 11px;
  }

  .shopfloor-view-mode .library-mode-toggle {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .shopfloor-view-mode .library-mode-toggle button {
    min-height: 36px;
    padding-inline: 4px;
    font-size: 11px;
  }

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

  .library-filter-shell {
    gap: 8px;
    margin-top: 8px;
    padding: 8px;
  }

  .library-smart-chips,
  .library-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .library-smart-chips::-webkit-scrollbar,
  .library-chip-row::-webkit-scrollbar {
    display: none;
  }

  .library-smart-chips button,
  .library-chip-row button {
    flex: 0 0 auto;
  }

  .library-filter-grid {
    gap: 8px;
  }

  .library-filter-grid section {
    padding: 8px;
  }

  .library-bulk-actions {
    padding-top: 6px;
  }

  .studio-surface:not(.library-has-selection) .library-bulk-actions {
    display: none;
  }

  .library-bulk-actions[open] {
    display: grid;
    gap: 8px;
    overflow: visible;
  }

  .library-selection-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-selection-actions input,
  .library-selection-actions select,
  .library-selection-actions button {
    width: 100%;
    min-width: 0;
  }

  .library-dashboard-grid {
    gap: 8px;
  }

  .library-dashboard-card {
    min-height: 0;
    gap: 6px;
    padding: 8px;
  }

  .library-dashboard-card:not(.showcase-card) {
    grid-template-columns: 116px minmax(0, 1fr);
    align-items: start;
  }

  .library-dashboard-card:not(.showcase-card) .library-dashboard-thumb-wrap {
    grid-row: 1 / span 6;
  }

  .library-dashboard-card:not(.showcase-card) .library-select-chip {
    position: static;
    grid-column: 2;
    width: fit-content;
    padding: 3px 7px;
    font-size: 10px;
  }

  .library-dashboard-card img,
  .library-dashboard-thumb-empty {
    aspect-ratio: 4 / 3;
  }

  .library-dashboard-card:not(.showcase-card) img,
  .library-dashboard-card:not(.showcase-card) .library-dashboard-thumb-empty {
    aspect-ratio: 1 / 1;
  }

  .library-dashboard-card strong {
    font-size: 13px;
    line-height: 1.2;
  }

  .library-dashboard-card small {
    font-size: 10px;
  }

  .library-card-badges,
  .library-missing-note {
    font-size: 10px;
  }

  .library-missing-note {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .library-dashboard-card.showcase-card {
    min-height: 0;
    grid-template-columns: 1fr;
    align-items: start;
    border-radius: 8px;
    gap: 8px;
    padding: 8px;
    box-shadow: none;
  }

  .library-dashboard-card.showcase-card .library-dashboard-thumb-wrap {
    grid-row: auto;
  }

  .library-dashboard-card.showcase-card img,
  .library-dashboard-card.showcase-card .library-dashboard-thumb-empty {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
  }

  .public-surface .library-dashboard-grid {
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .public-surface .library-dashboard-card.showcase-card {
    min-height: 0;
    padding: 8px;
    border-radius: 10px;
  }

  .public-surface .library-dashboard-card.showcase-card .library-card-status,
  .public-surface .library-dashboard-card.showcase-card .library-card-badges,
  .public-surface .library-dashboard-card.showcase-card strong,
  .public-surface .library-dashboard-card.showcase-card small,
  .public-surface .library-dashboard-card.showcase-card .library-gallery-chip {
    margin-inline: 2px;
  }

  .public-surface .library-dashboard-card.showcase-card strong {
    font-size: 17px;
    line-height: 1.15;
  }

  .public-surface .library-dashboard-card.showcase-card small {
    font-size: 11px;
    line-height: 1.3;
  }

  .public-surface .library-gallery-chip {
    margin-top: 2px;
    padding: 7px 10px;
    border-radius: 999px;
  }

  .client-catalogue-intro {
    gap: 10px;
    margin-top: 8px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: none;
  }

  .client-catalogue-intro h2 {
    font-size: 24px;
  }

  .client-catalogue-intro p {
    font-size: 12px;
    line-height: 1.4;
  }

  .client-catalogue-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .client-catalogue-stats div {
    min-height: 58px;
    border-radius: 8px;
  }

  .client-catalogue-stats strong {
    font-size: 18px;
  }

  .client-catalogue-actions {
    grid-template-columns: 1fr 1fr;
  }

  .client-catalogue-actions button {
    min-width: 0;
    min-height: 36px;
  }

  .shopfloor-capture,
  .shopfloor-review {
    gap: 12px;
    padding: 12px;
  }

  .shopfloor-title {
    flex-direction: column;
    align-items: stretch;
  }

  .shopfloor-title h2 {
    font-size: 17px;
  }

  .shopfloor-title p {
    line-height: 1.35;
  }

  .shopfloor-product-summary {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .shopfloor-product-summary > span {
    grid-column: 2;
  }

  .shopfloor-meta,
  .shopfloor-slot-grid,
  .shopfloor-slot-grid.detail {
    grid-template-columns: 1fr;
  }

  .shopfloor-dimensions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shopfloor-slot {
    min-height: 0;
  }

  .shopfloor-slot strong,
  #shopfloorSubmitBtn {
    min-height: 44px;
  }

  #shopfloorSubmitBtn {
    width: 100%;
    font-size: 14px;
  }

  .manage-product-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .manage-title-actions,
  .manage-title-actions #toggleCatalogueStatusBtn {
    width: 100%;
  }

  .manage-product-title p {
    max-width: none;
    text-align: left;
  }

  .manage-product-title h2 {
    font-size: 18px;
  }

  .studio {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 8px 86px;
  }

  .studio:not(.hidden) .mobile-production-bar {
    position: fixed;
    right: 8px;
    bottom: 8px;
    left: 8px;
    z-index: 70;
    display: grid;
    grid-template-columns: 0.7fr 1fr 1.2fr;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(60, 60, 67, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(16px);
  }

  .mobile-production-bar button {
    min-width: 0;
    min-height: 42px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .sidebar {
    order: 2;
  }

  .workspace {
    order: 1;
    gap: 8px;
  }

  .library-grid {
    max-height: 220px;
  }

  .catalogue-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalogue-actions #exportLibraryBtn,
  .catalogue-actions #saveCatalogueBtn {
    display: none;
  }

  .special-product-picker {
    padding: 10px;
    border-radius: 12px;
  }

  .special-product-picker-head {
    grid-template-columns: 1fr;
  }

  .special-product-results {
    grid-template-columns: 1fr;
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0;
    border-radius: 10px;
  }

  .special-product-card {
    min-height: 72px;
    border-radius: 10px;
  }

  .progress-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .progress-item {
    padding: 6px;
  }

  .progress-item strong,
  .progress-item span {
    font-size: 11px;
  }

  .catalogue-readiness {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .view-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .view-card {
    padding: 8px;
  }

  .view-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .view-source {
    text-align: left;
  }

  .comparison {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .image-pane img,
  .image-pane .empty-image {
    max-height: 280px;
  }

  .catalogue-grid {
    grid-template-columns: 1fr;
  }

  .catalogue-grid label,
  .catalogue-grid label.wide {
    grid-column: auto;
  }

  .card-actions {
    gap: 6px;
  }

  .card-actions button {
    width: 100%;
  }

  .import-review-content {
    grid-template-columns: 1fr;
  }

  .import-review-content section:nth-child(4) {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 430px) {
  .customer-gallery-top {
    gap: 8px;
    padding: 8px 10px 4px;
  }

  .customer-gallery-top img {
    width: 112px;
    height: 34px;
  }

  .customer-gallery-actions {
    gap: 6px;
  }

  .customer-gallery-top button {
    min-height: 30px;
    padding-inline: 8px;
    font-size: 11px;
  }

  .customer-gallery-frame figcaption {
    min-height: 18px;
    padding-top: 2px;
    font-size: 10px;
  }

  .customer-gallery-copy h2 {
    margin-bottom: 4px;
    font-size: 18px;
  }

  .customer-gallery-copy p,
  .customer-gallery-details dd {
    font-size: 11px;
    line-height: 1.32;
  }

  .customer-gallery-meta,
  .customer-gallery-details dt {
    font-size: 9px;
  }

  .customer-gallery-details {
    gap: 5px;
  }

  .customer-gallery-dots {
    gap: 6px;
    padding: 4px 12px 8px;
  }

  .customer-gallery-dots button {
    width: 7px;
    height: 7px;
    min-height: 7px;
  }

  .customer-gallery-dots button.active {
    width: 22px;
  }

  .login-gate {
    padding: 14px;
    place-items: start center;
    overflow: auto;
  }

  .login-card {
    width: 100%;
    padding: 22px 16px;
    border-radius: 16px;
    margin-top: 18px;
  }

  .login-card img {
    width: 132px;
    height: 48px;
  }

  .login-card h1 {
    font-size: 23px;
  }

  .shopfloor-view-mode .library-mode-toggle {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .shopfloor-dimensions {
    grid-template-columns: 1fr;
  }

  .shopfloor-product-summary {
    grid-template-columns: 84px minmax(0, 1fr);
  }
}
