/* ============================================================
   Kreate3D Catalogue Studio
   1. Fonts & tokens
   2. Base
   3. Top bar
   4. Workspace rail
   5. Catalogue grid
   6. Product drawer
   7. PDF overlay + A4 sheets
   8. Print
   9. Responsive
   ============================================================ */

@font-face {
  font-family: 'Playfair';
  src: url('/fonts/playfair-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f1eb;
  --surface: #fffdfa;
  --surface-2: #faf7f2;
  --matte: #f1ece4;
  --ink: #17130f;
  --ink-2: #3b352c;
  --muted: #7b7368;
  --line: #e4ded3;
  --line-strong: #cec6b8;
  --accent: #b4462a;
  --accent-ink: #ffffff;
  --accent-soft: #f6e6df;
  --good: #3f6b4f;
  --warn: #a4621f;
  --serif: 'Playfair', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 19, 15, 0.04), 0 18px 40px -28px rgba(23, 19, 15, 0.45);
  --paper: #fdfcf9;
  --paper-ink: #17130f;
}

[data-theme='dark'] {
  --bg: #121110;
  --surface: #1b1917;
  --surface-2: #211e1a;
  --matte: #26221e;
  --ink: #f4eee5;
  --ink-2: #ded5c8;
  --muted: #a2998c;
  --line: #332e28;
  --line-strong: #4a433a;
  --accent: #e0673f;
  --accent-ink: #1a1109;
  --accent-soft: #38231b;
  --good: #7fb78f;
  --warn: #d8a15c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -24px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
select { color-scheme: light; }
[data-theme='dark'] select { color-scheme: dark; }
img { display: block; max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.solid { background: var(--surface); border-color: var(--ink); }
.btn.solid:hover { background: var(--ink); color: var(--surface); }
.btn.ghost { color: var(--ink-2); }
.whatsapp-btn { color:#2f8f58 !important; border-color:color-mix(in srgb,#2f8f58 45%,var(--line)); }
.whatsapp-btn:hover { background:color-mix(in srgb,#2f8f58 14%,var(--surface)); border-color:#2f8f58; }
.pdf-design-card { width:min(100%,780px); max-height:92vh; overflow:auto; }
.pdf-design-card h2 { max-width:none; }
.pdf-design-presets { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; margin:20px 0 16px; }
.pdf-design-section { padding:15px 0; border-top:1px solid var(--line); }
.pdf-design-section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.pdf-design-section-head h3 { font-family:var(--serif); font-size:19px; }
.pdf-design-section .fields { align-items:end; }
.pdf-design-section output { float:right; color:var(--accent); font-size:10px; }
.pdf-design-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:15px; border-top:1px solid var(--line); }
.pdf-design-warning { min-height:18px; color:var(--warn); font-size:11px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.chip {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.chip.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 3vw, 36px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark { width: 34px; height: 40px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-text strong span { color: var(--accent); }
.brand-text em {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.top-actions { display: flex; align-items: center; gap: 7px; }
.utility-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:36px; height:34px; padding:0 9px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--ink-2); font-size:11px; font-weight:600; white-space:nowrap; }
.utility-btn:hover { background:var(--surface-2); border-color:var(--line-strong); }
.utility-icon { display:inline-grid; place-items:center; min-width:18px; font-size:17px; line-height:1; }
.utility-label { font-size:11px; }
.collection-heading-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.collection-heading-row h1 { margin:0; }
.collection-heading-actions { display:flex; align-items:center; gap:7px; margin-left:auto; }
.collection-heading-actions .icon-btn { width:32px; height:32px; font-size:17px; }
.master-search-card { width:min(100%,680px); }
.master-search-input { position:relative; margin-top:18px; }
.master-search-input input { width:100%; height:46px; padding:0 42px 0 14px; border:1px solid var(--line-strong); border-radius:12px; background:var(--surface-2); color:var(--ink); font-size:14px; }
.master-search-input span { position:absolute; top:50%; right:14px; transform:translateY(-50%); color:var(--muted); font-size:19px; }
.master-search-results { display:grid; gap:7px; max-height:48vh; overflow:auto; margin-top:14px; }
.master-search-result { display:grid; grid-template-columns:46px minmax(0,1fr) auto; align-items:center; gap:11px; width:100%; padding:8px; border:1px solid var(--line); border-radius:11px; background:var(--surface); color:var(--ink); text-align:left; }
.master-search-result:hover { border-color:var(--accent); background:var(--surface-2); }
.master-search-thumb { display:grid; place-items:center; width:46px; height:46px; overflow:hidden; border-radius:8px; background:var(--matte); color:var(--muted); }
.master-search-thumb img { width:100%; height:100%; object-fit:cover; }
.master-search-copy { min-width:0; display:grid; gap:2px; }
.master-search-copy strong,.master-search-copy small,.master-search-copy > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.master-search-copy small { color:var(--accent); font-size:10px; }
.master-search-copy > span { color:var(--muted); font-size:11px; }
.utility-workspace-card { width:min(100%,760px); }
.utility-section-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:20px; }
.utility-section-card { display:grid; gap:5px; min-height:86px; padding:15px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); color:var(--ink); text-align:left; }
.utility-section-card:hover { border-color:var(--accent); background:var(--accent-soft); }
.utility-section-card strong { font-family:var(--serif); font-size:17px; font-weight:600; }
.utility-section-card span { color:var(--muted); font-size:11px; line-height:1.35; }
.utility-panel { margin-top:20px; }
.utility-panel h3 { margin:12px 0 5px; font-family:var(--serif); font-size:25px; }
.utility-panel-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:18px; }
.utility-panel-actions .btn { min-height:40px; }
.utility-panel-actions a { display:flex; align-items:center; justify-content:center; }

.collection-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 3px 4px 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.collection-switcher label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.collection-switcher select {
  min-width: 120px;
  max-width: 190px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}
.collection-select-native { position:absolute; opacity:0; pointer-events:none; width:1px; height:1px; }
.collection-dropdown-toggle { min-width:140px; min-height:38px; display:flex; align-items:center; justify-content:space-between; gap:10px; border:0; border-radius:9px; padding:0 9px; background:var(--surface-2); color:var(--ink); font-size:12px; font-weight:650; text-align:left; }
.collection-dropdown-toggle:hover,.collection-dropdown-toggle[aria-expanded="true"] { background:var(--accent-soft); }
.collection-dropdown-menu { position:absolute; top:calc(100% + 7px); left:78px; min-width:220px; max-height:300px; overflow:auto; padding:6px; background:var(--surface); border:1px solid var(--line-strong); border-radius:12px; box-shadow:var(--shadow); z-index:70; }
.collection-dropdown-menu[hidden] { display:none; }
.collection-dropdown-option { width:100%; min-height:42px; display:flex; align-items:center; justify-content:space-between; gap:10px; border:0; border-radius:8px; padding:8px 10px; background:transparent; color:var(--ink); font-size:12px; text-align:left; }
.collection-dropdown-option:hover,.collection-dropdown-option.active { background:var(--surface-2); color:var(--accent); }
.btn.compact { height: 29px; padding: 0 9px; font-size: 11px; }
.cloud-btn { max-width: 142px; overflow: hidden; text-overflow: ellipsis; }
.cloud-btn #cloudStatus { overflow:hidden; text-overflow:ellipsis; }
.cloud-btn[data-status='synced'] { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.cloud-btn[data-status='pending'] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.cloud-btn[data-status='error'] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.toolbar-select select { height:36px; max-width:175px; padding:0 28px 0 11px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--ink); font-size:11.5px; appearance:none; background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position:calc(100% - 13px) 15px,calc(100% - 9px) 15px; background-size:4px 4px,4px 4px; background-repeat:no-repeat; }
.view-toggle { display:flex; gap:2px; padding:2px; border:1px solid var(--line); border-radius:999px; background:var(--surface-2); }
.view-toggle button { min-height:30px; padding:0 9px; border:0; border-radius:999px; background:transparent; color:var(--muted); font-size:11px; }
.view-toggle button.active { background:var(--ink); color:var(--surface); }

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-modal.hidden { display: none; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(23, 19, 15, 0.46); backdrop-filter: blur(4px); }
.auth-card {
  position: relative;
  width: min(100%, 440px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(23, 19, 15, 0.28);
}
.auth-card h2 { max-width: 12ch; margin: 7px 0 13px; font-family: var(--serif); font-size: 31px; line-height: 1.03; font-weight: 500; letter-spacing: -0.03em; }
.auth-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 25px; line-height: 1; }
.auth-close:hover { background: var(--surface-2); color: var(--ink); }
.auth-copy { max-width: 44ch; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-copy strong { color: var(--ink); overflow-wrap: anywhere; }
.auth-form { margin-top: 20px; }
.auth-form .field { margin-bottom: 10px; }
.auth-form .btn { width: 100%; }
.auth-message { min-height: 20px; margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.auth-status { margin: 20px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--good); font-size: 12px; font-weight: 600; }
.auth-status[data-status='pending'] { color: var(--warn); }
.auth-status[data-status='conflict'], .auth-status[data-status='error'] { color: var(--accent); }
.auth-actions { display: flex; justify-content: flex-end; gap: 8px; }
.conflict-card { width: min(100%, 520px); }
.conflict-card h2 { max-width: 16ch; }
.conflict-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.save-state {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-right: 4px;
  transition: opacity 0.3s ease;
}
.save-state.flash { color: var(--good); }

.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 232px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.menu[hidden] { display: none; }
.menu button, .menu a {
  display: block;
  text-align: left;
  border: 0;
  background: none;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu button.danger { color: var(--accent); }
.utility-menu.is-mobile-sheet { display:flex; }

/* ---------- Workspace ---------- */

.workspace {
  display: grid;
  grid-template-columns: 314px minmax(0, 1fr);
  gap: clamp(20px, 2.6vw, 40px);
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 36px) 80px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.panel h2 { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.45; margin-bottom: 14px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 500; }
.fields label .unit { color: var(--line-strong); font-size: 10px; }
.fields input, .fields select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  width: 100%;
}
.fields input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }
.fields label:last-child:nth-child(odd) { grid-column: span 2; }

.formula {
  margin: 14px 0 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
}
.formula span { display: block; font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.formula code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 10.5px; line-height: 1.5; color: var(--ink-2); }

.preset-row { display: flex; gap: 6px; margin-bottom: 12px; }
.preset {
  flex: 1;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.preset:hover { border-color: var(--accent); color: var(--accent); }

.toggle-list { display: flex; flex-direction: column; gap: 1px; }
.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 2px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.switch:last-child { border-bottom: 0; }
.switch input {
  appearance: none;
  width: 30px; height: 17px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  flex: 0 0 auto;
  transition: background 0.18s ease;
  cursor: pointer;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(13px); }
.switch em { margin-left: auto; font-style: normal; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Content head ---------- */

.content { min-width: 0; }
.content-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.content-title h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 6px 0 8px;
}
.catalogue-context { margin-bottom:10px; }
.catalogue-context .collection-switcher { width:max-content; max-width:100%; }
.catalogue-context .collection-dropdown-toggle { min-width:190px; }
.count { font-size: 12px; color: var(--muted); }
.content-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.search-tools { display:flex; align-items:center; gap:8px; }
.catalogue-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.add-product-btn { box-shadow:0 8px 18px color-mix(in srgb,var(--accent) 22%,transparent); }

.search input {
  height: 36px;
  width: 190px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- Catalogue grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 18px;
}
.grid.view-grid { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; }
.tile-card { min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow-soft); cursor:pointer; }
.tile-card.is-hidden { opacity:.55; }
.tile-media { display:grid; place-items:center; width:100%; aspect-ratio:1; padding:0; border:0; background:var(--surface-2); color:var(--muted); overflow:hidden; }
.tile-media img { width:100%; height:100%; object-fit:cover; transition:transform .2s ease; }
.tile-card:hover .tile-media img { transform:scale(1.03); }
.tile-copy { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; padding:10px 11px 12px; }
.tile-copy h3 { min-width:0; margin:0; overflow:hidden; display:-webkit-box; display:box; -webkit-box-orient:vertical; box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; font-size:12px; line-height:1.25; }
.tile-copy strong { flex:none; color:var(--accent); font-size:12px; white-space:nowrap; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.card.is-hidden { opacity: 0.55; }

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--matte);
  cursor: pointer;
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.card-media.fill img { object-fit: cover; }

.card-sku {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 8px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--ink-2);
  backdrop-filter: blur(6px);
}

.card-thumbs {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.card:hover .card-thumbs, .card:focus-within .card-thumbs { opacity: 1; transform: none; }
.card-thumbs button {
  width: 26px; height: 26px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  backdrop-filter: blur(4px);
}
.card-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.card-thumbs button.active { outline: 2px solid var(--accent); outline-offset: 1px; }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 15px 15px; }
.card-cat { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.card-title {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 5px 0 6px;
  overflow-wrap: anywhere;
}
.card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; }
.card-price { display: flex; flex-direction: column; line-height: 1.05; }
.card-price small { font-size: 8.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.card-price strong { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.card-price strong.manual { color: var(--accent); }
.card-actions { display: flex; gap: 6px; }
.card-actions .btn { height: 30px; padding: 0 11px; font-size: 11.5px; }
.card-pdf-toggle { width: 30px; height: 30px; border-radius: 7px; font-size: 16px; color: var(--muted); }
.card-pdf-toggle.active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.card-pdf-toggle span { transform: translateY(-1px); }
.grid.view-compact { display:flex; flex-direction:column; gap:8px; }
.compact-card { min-height:72px; display:grid; grid-template-columns:56px minmax(0,1fr) auto minmax(180px,auto); align-items:center; gap:12px; padding:8px 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.compact-card.is-hidden { opacity:.55; }
.compact-thumb { width:56px; height:56px; display:grid; place-items:center; padding:0; border:0; border-radius:9px; overflow:hidden; background:var(--matte); color:var(--muted); }
.compact-thumb img { width:100%; height:100%; object-fit:cover; }
.compact-copy { min-width:0; }
.compact-copy h3 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-family:var(--serif); font-size:17px; }
.compact-copy span { display:inline-block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--accent); font-size:10px; letter-spacing:.08em; text-transform:uppercase; }
.compact-price { font-family:var(--serif); font-size:18px; white-space:nowrap; }
.compact-price.manual { color:var(--accent); }
.compact-actions { display:flex; align-items:center; justify-content:flex-end; gap:6px; }
.compact-actions .btn { min-height:32px; }
.compact-actions .card-pdf-toggle { width:32px; height:32px; }
.compact-action-label { display:inline; }
.shared-links-card { width:min(100%,760px); max-height:90vh; overflow:auto; }
.shared-links-list { display:grid; gap:9px; margin-top:20px; }
.shared-link-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; padding:13px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
.shared-link-item h3 { font-family:var(--serif); font-size:18px; }
.shared-link-meta { margin-top:3px; color:var(--muted); font-size:11px; }
.shared-link-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:5px; }
.sheet-preview-card { width:min(100%,1180px); max-height:92vh; overflow:hidden; }
.sheet-preview-scroll { overflow:auto; max-height:58vh; margin:18px -4px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
.sheet-preview-table { border-collapse:collapse; min-width:100%; font-size:11px; white-space:nowrap; }
.sheet-preview-table th, .sheet-preview-table td { padding:9px 11px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.sheet-preview-table th { position:sticky; top:0; z-index:1; background:var(--ink); color:var(--surface); font-size:9px; letter-spacing:.08em; text-transform:uppercase; }
.sheet-preview-table td { color:var(--ink-2); }
.sheet-preview-table tr:last-child td { border-bottom:0; }
.pdf-quick-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.pdf-quick-grid label { display:grid; gap:5px; color:var(--ink-2); font-size:11px; font-weight:600; }
.pdf-quick-grid select { width:100%; min-height:40px; padding:0 32px 0 11px; border:1px solid var(--line-strong); border-radius:9px; background-color:var(--surface-2); color:var(--ink); appearance:none; -webkit-appearance:none; background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position:calc(100% - 15px) 17px,calc(100% - 11px) 17px; background-size:4px 4px,4px 4px; background-repeat:no-repeat; }
.pdf-quick-grid select:hover, .pdf-quick-grid select:focus { border-color:var(--accent); outline:2px solid color-mix(in srgb,var(--accent) 24%,transparent); outline-offset:0; }
.pdf-quick-grid select option { background:var(--surface); color:var(--ink); }
.pdf-stepper-list { display:grid; gap:6px; margin-top:12px; }
.pdf-stepper-row { display:grid; grid-template-columns:minmax(76px,.8fr) minmax(70px,1fr) 58px 38px 38px; align-items:center; gap:6px; min-height:42px; padding:4px 6px 4px 10px; border:1px solid var(--line); border-radius:9px; background:var(--surface-2); }
.pdf-stepper-row span { font-size:12px; color:var(--ink-2); }
.pdf-stepper-row output { font-size:11px; color:var(--muted); text-align:right; font-variant-numeric:tabular-nums; }
.pdf-stepper-meter { height:6px; overflow:hidden; border-radius:999px; background:var(--line); }
.pdf-stepper-meter i { display:block; width:50%; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--accent-soft),var(--accent)); transition:width .16s ease; }
.pdf-stepper-row button { width:36px; height:34px; border:1px solid var(--line-strong); border-radius:7px; background:var(--surface); color:var(--ink); font-size:20px; line-height:1; touch-action:manipulation; }
.pdf-stepper-row button:active { background:var(--ink); color:var(--surface); }
.pdf-inline-action { grid-column:1 / -1; justify-self:start; }
.pdf-design-share-actions { display:flex; gap:8px; flex-wrap:wrap; }
.mobile-bottom-nav { display:none; }

@media (max-width: 767px) {
  body { padding-bottom:0; }
  .workspace { padding-bottom:78px; }
  .topbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 10px; padding:7px 12px 8px; border-bottom:0; }
  .top-actions { grid-column:1 / -1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; width:100%; }
  .top-actions .save-state { display:none; }
  .utility-btn { width:100%; min-height:36px; height:36px; padding:0 7px; }
  .utility-label, .cloud-btn #cloudStatus { display:none; }
  .collection-switcher { display:grid; grid-template-columns:auto minmax(0,1fr) auto; padding:4px; border-radius:12px; }
  .collection-switcher label { padding-left:5px; }
  .collection-dropdown-toggle { min-width:0; width:100%; min-height:42px; }
  .collection-dropdown-menu { left:0; right:0; min-width:0; }
  .collection-switcher .btn { min-height:42px; }
  .top-actions .cloud-btn { grid-column:1; grid-row:1; }
  .top-actions #themeBtn { grid-column:2; grid-row:1; }
  .top-actions #masterSearchBtn { grid-column:3; grid-row:1; }
  .top-actions #publishingBtn { display:none; }
  .collection-heading-row { align-items:flex-start; gap:8px; }
  .collection-heading-row h1 { max-width:calc(100vw - 120px); font-size:clamp(34px,10vw,48px); }
  .collection-heading-actions { gap:5px; }
  .collection-heading-actions .chip { display:inline-flex; padding:4px 6px; font-size:9px; }
  .collection-heading-actions .btn { display:none; }
  .collection-heading-actions .icon-btn { width:34px; height:34px; }
  .content-title .count { margin-top:4px; }
  .content-head { gap:12px; }
  .content-actions { display:grid; grid-template-columns:1fr; width:100%; gap:8px; }
  .search-tools { display:grid; grid-template-columns:minmax(0,1fr) 44px; gap:7px; width:100%; }
  .search input { width:100%; height:40px; }
  .toolbar-select { position:relative; width:44px; }
  .toolbar-select::after { content:'≡'; position:absolute; inset:0; display:grid; place-items:center; color:var(--ink-2); font-size:17px; pointer-events:none; }
  .toolbar-select select { width:44px; max-width:none; height:40px; padding:0; color:transparent; background-image:none; opacity:.98; }
  .catalogue-actions { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:7px; width:100%; }
  .catalogue-actions .view-toggle { grid-column:1 / -1; width:100%; height:40px; align-items:center; }
  .catalogue-actions .view-toggle button { flex:1; min-height:34px; }
  .catalogue-actions #pullAllBtn, .catalogue-actions #pdfBtn { min-height:40px; }
  .catalogue-actions #addBtn { grid-column:1 / -1; min-height:44px; order:-1; }
  .view-toggle { height:40px; align-items:center; }
  .view-toggle button { min-height:34px; }
  .overlay-bar { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:9px 12px; }
  .overlay-info { margin:0; min-width:0; }
  .overlay-info .eyebrow { display:none; }
  .overlay-info h2 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:17px; }
  .overlay-actions { display:flex; align-items:center; width:auto; gap:5px; }
  .overlay-actions .seg { display:none; }
  .overlay-actions #pdfDesignBtn,.overlay-actions #downloadPdf,.overlay-actions #closePdf { min-height:34px; }
  .overlay-actions #pdfDesignBtn { width:34px; padding:0; overflow:hidden; font-size:0; }
  .overlay-actions #pdfDesignBtn::before { content:'⚙'; font-size:15px; }
  .overlay-actions #downloadPdf { padding:0 10px; white-space:nowrap; }
  .overlay-actions #closePdf { width:34px; border-radius:10px; }
  .pdf-share-status { padding:9px 12px; }
  .compact-card { grid-template-columns:48px minmax(0,1fr); gap:9px; padding:7px 9px; }
  .compact-thumb { width:48px; height:48px; }
  .compact-price { display:none; }
  .compact-actions { grid-column:2; justify-content:flex-start; }
  .compact-actions .btn { min-height:38px; }
  .compact-action-label { display:none; }
  .sheet-preview-card { padding:20px 12px 12px; }
  .sheet-preview-scroll { margin-left:-2px; margin-right:-2px; max-height:56vh; }
  .pdf-quick-grid { grid-template-columns:1fr; }
  .pdf-stepper-row { min-height:46px; grid-template-columns:minmax(76px,.9fr) minmax(52px,1fr) 52px 38px 38px; }
  .utility-workspace-card { width:100%; max-height:calc(100dvh - 24px); overflow:auto; padding:24px 16px 20px; }
  .utility-section-grid { grid-template-columns:1fr; gap:8px; margin-top:16px; }
  .utility-section-card { min-height:68px; padding:12px; }
  .utility-section-card strong { font-size:16px; }
  .utility-panel-actions { grid-template-columns:1fr; }
  .master-search-card { width:100%; max-height:calc(100dvh - 24px); overflow:auto; padding:24px 16px 20px; }
  .shared-link-item { grid-template-columns:1fr; }
  .shared-link-actions { justify-content:flex-start; }
  .utility-menu.is-mobile-sheet { position:fixed !important; z-index:200; left:10px; right:10px; top:auto !important; bottom:calc(76px + env(safe-area-inset-bottom)) !important; width:auto; max-height:min(520px,calc(100dvh - 132px)); overflow:auto; border-radius:16px; background:var(--surface); box-shadow:0 20px 60px rgba(0,0,0,.28); }
  .mobile-bottom-nav { position:fixed; z-index:70; left:0; right:0; bottom:0; display:grid; grid-template-columns:repeat(4,1fr); height:calc(68px + env(safe-area-inset-bottom)); min-height:68px; padding:7px 8px env(safe-area-inset-bottom); border-top:1px solid var(--line); background:var(--surface); box-shadow:0 -12px 30px -22px rgba(23,19,15,.55); }
  .mobile-nav-item { display:grid; place-items:center; align-content:center; gap:2px; min-height:52px; border:0; border-radius:12px; background:transparent; color:var(--muted); touch-action:manipulation; }
  .mobile-nav-item span { font-size:18px; line-height:1; }
  .mobile-nav-item small { font-size:10px; font-weight:600; letter-spacing:.02em; }
  .mobile-nav-item.active { color:var(--accent); background:var(--accent-soft); }
  .drawer-panel { width:100vw; border-left:0; }
  .drawer-head { padding:16px 16px 13px; }
  .drawer-body { padding:16px; }
  .grid.view-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .tile-card { border-radius:13px; }
  .tile-copy { display:block; padding:8px 8px 9px; }
  .tile-copy h3 { font-size:10px; }
  .tile-copy strong { display:block; margin-top:5px; font-size:11px; }
}

.empty {
  grid-column: 1 / -1;
  padding: 70px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty h3 { font-family: var(--serif); font-size: 24px; color: var(--ink); margin-bottom: 6px; }

/* ---------- Drawer ---------- */

.drawer { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
.drawer.hidden { display: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(20, 16, 12, 0.42); backdrop-filter: blur(2px); }
.drawer-panel {
  position: relative;
  width: min(560px, 100vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  animation: slide-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slide-in { from { transform: translateX(28px); opacity: 0.6; } to { transform: none; opacity: 1; } }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.drawer-head h2 { font-family: var(--serif); font-size: 25px; line-height: 1.1; margin-top: 4px; }
.drawer-body { padding: 20px 22px 60px; overflow-y: auto; }

.section { margin-bottom: 26px; }
.section > h3 {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.editor-section { border-top:1px solid var(--line); padding-top:12px; }
.editor-section summary { display:flex; align-items:center; justify-content:space-between; min-height:40px; cursor:pointer; list-style:none; color:var(--ink-2); font-size:12px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.editor-section summary::-webkit-details-marker { display:none; }
.editor-section summary::after { content:'+'; color:var(--accent); font-size:20px; font-weight:400; line-height:1; }
.editor-section[open] summary::after { content:'−'; }
.editor-section > .hint { margin:2px 0 12px; }

.gallery-main {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--matte);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-main.fill img { object-fit: cover; }
.gallery-main .tag {
  position: absolute;
  top: 8px; left: 8px;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.gallery-strip { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.thumb {
  position: relative;
  width: 58px; height: 58px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--matte);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.thumb .del {
  position: absolute;
  top: 1px; right: 1px;
  width: 15px; height: 15px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 16, 12, 0.72);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.thumb:hover .del { opacity: 1; }
.thumb .primary-dot {
  position: absolute;
  left: 3px; bottom: 3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface);
}

.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions .btn { height: 31px; padding: 0 11px; font-size: 11.5px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
.field-row.four { grid-template-columns: repeat(4, 1fr); }
.collection-checks { display: grid; gap: 4px; }
.collection-checks .switch { border: 0; padding: 4px 0; }
.import-status { margin: -3px 0 14px; font-size: 11px; line-height: 1.45; color: var(--muted); }
.import-status.is-error { color: var(--warn); }
.import-preview { margin: -2px 0 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.import-preview[hidden] { display: none; }
.import-preview-head { display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.import-preview-head span { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.import-preview-head b { font-family: var(--serif); font-size: 18px; line-height: 1.15; }
.import-preview-body { display: grid; grid-template-columns: 78px 1fr; gap: 11px; padding: 11px 12px; }
.import-preview-image { width: 78px; height: 78px; border-radius: 7px; overflow: hidden; background: var(--matte); }
.import-preview-image img { width: 100%; height: 100%; object-fit: cover; }
.import-preview-image-empty { display: grid; place-items: center; height: 100%; padding: 8px; text-align: center; font-size: 10px; color: var(--muted); }
.import-preview-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.import-preview-copy p { margin: 0; font-size: 11px; line-height: 1.4; color: var(--ink-2); }
.import-preview-copy small { font-size: 10px; line-height: 1.35; color: var(--muted); }
.import-preview-actions { display: flex; justify-content: flex-end; gap: 7px; padding: 0 12px 12px; }

.price-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px;
}
.price-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.price-head strong { font-family: var(--serif); font-size: 30px; font-weight: 600; }
.price-head span { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.breakdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.breakdown div { display: flex; flex-direction: column; gap: 2px; }
.breakdown small { font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.breakdown b { font-size: 12.5px; font-variant-numeric: tabular-nums; font-weight: 600; }
.manual-note { margin-top: 10px; font-size: 11.5px; color: var(--warn); display: flex; align-items: center; gap: 6px; }
.hardware-note { margin-top: 9px; color: var(--muted); font-size: 10.5px; line-height: 1.4; }

.drawer-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 6px; }
.danger-btn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* ---------- PDF overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: #e9e5de;
}
[data-theme='dark'] .overlay { background: #0e0d0c; }
.overlay.hidden { display: none; }

.overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.overlay-info h2 { font-family: var(--serif); font-size: 20px; line-height: 1.1; margin-top: 2px; }
.overlay-actions { display: flex; align-items: center; gap: 8px; }

.seg { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.seg button {
  border: 0;
  background: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--muted);
}
.seg button.active { background: var(--ink); color: var(--surface); }

.overlay-note {
  padding: 8px 20px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.overlay-note b { color: var(--ink-2); font-weight: 600; }
.overlay-note .warn { color: var(--warn); }
.pdf-share-status { padding:9px 20px; border-bottom:1px solid var(--line); background:color-mix(in srgb, var(--accent) 8%, var(--surface)); color:var(--ink-2); font-size:11.5px; }
.pdf-share-status[data-ready="true"] { color:var(--accent); font-weight:600; }

.overlay-scroll { flex: 1; overflow: auto; padding: 26px 20px 60px; }
.print-root { display: flex; flex-direction: column; align-items: center; gap: 22px; }

/* ---------- A4 sheets (shared preview + print) ---------- */

.sheet-frame {
  --s: 0.68;
  width: calc(210mm * var(--s));
  height: calc(297mm * var(--s));
  flex: 0 0 auto;
  position: relative;
}
.sheet {
  width: 210mm;
  height: 297mm;
  transform: scale(var(--s));
  transform-origin: top left;
  background: var(--paper);
  color: var(--paper-ink);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 26px 60px -30px rgba(0, 0, 0, 0.5);
  font-family: var(--sans);
  --fit: 1;
  --imgfit: contain;
}

.sheet-body {
  position: absolute;
  inset: 0;
  padding: 14mm 16mm 15mm;
  display: flex;
  flex-direction: column;
  font-size: calc(13.4px * var(--fit));
  line-height: 1.45;
  overflow: hidden;
}

/* Children keep their natural height so overflow is measurable and the
   fit-to-page pass can shrink the page instead of clipping the text. */
.sheet-body > * { flex: 0 0 auto; min-height: 0; }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 2.6mm;
  border-bottom: 0.4pt solid #ddd5c9;
  margin-bottom: 5.5mm;
  flex: 0 0 auto;
}
.sheet-brand { display: flex; align-items: center; gap: 2.4mm; }
.sheet-brand img { height: 5.4mm; width: auto; object-fit: contain; }
.sheet-brand b { font-family: var(--sans); font-size: 0.72em; letter-spacing: 0.16em; font-weight: 700; }
.sheet-head-right { display:flex; align-items:center; gap:8px; }
.sheet-edition { font-size: 0.62em; letter-spacing: 0.18em; text-transform: uppercase; color: #8b8378; }
.pdf-link-button,.pdf-photo-button { display:inline-flex; align-items:center; justify-content:center; width:max-content; border:0.5pt solid #b4462a; border-radius:999px; padding:1.5mm 3mm; color:#b4462a; font-size:0.56em; letter-spacing:.08em; text-transform:uppercase; text-decoration:none; }

.sheet-foot {
  position: absolute;
  left: 16mm; right: 16mm; bottom: 7.5mm;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-top: 2.2mm;
  border-top: 0.4pt solid #e6dfd4;
  font-size: 7.2px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8b8378;
}

/* Product page */

.p-hero {
  position: relative;
  height: calc(148mm * var(--fit));
  flex: 0 0 auto;
  background: #f1ece4;
  margin-bottom: 5mm;
  overflow: hidden;
}
.p-hero img { width: 100%; height: 100%; object-fit: var(--imgfit); }
.p-hero-link { position:relative; display:block; width:100%; height:100%; color:inherit; text-decoration:none; }
.p-hero-link img { display:block; }
.pdf-gallery-cue { position:absolute; right:3mm; bottom:3mm; display:inline-flex; align-items:center; padding:1.7mm 3mm; border-radius:999px; background:#b4462a; color:#fff; font-size:8px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; box-shadow:0 1px 4px rgba(0,0,0,.18); -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.p-hero-link:hover .pdf-gallery-cue { background:#8f321f; }
.pdf-photo-button { margin-top:3mm; }
.toc-image-link { display:block; width:13mm; height:10mm; }
.toc-image-link img { width:100%; height:100%; object-fit:cover; }
.p-hero .p-sku {
  position: absolute;
  top: 4mm; left: 4mm;
  padding: 1.6mm 2.6mm;
  background: rgba(255, 255, 255, 0.94);
  border: 0.4pt solid #e2dbd0;
  border-radius: 1mm;
  font-size: 0.6em;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: #3b352c;
}

.p-eyebrow {
  font-size: 0.6em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8b8378;
  font-weight: 600;
  margin-bottom: 2mm;
}

.p-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6mm;
  flex: 0 0 auto;
}
.p-title {
  font-family: var(--serif);
  font-size: 3.02em;
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-weight: 500;
  max-width: 78%;
  overflow-wrap: anywhere;
}
.p-price { text-align: right; flex: 0 0 auto; }
.p-price small { display: block; font-size: 0.58em; letter-spacing: 0.2em; text-transform: uppercase; color: #8b8378; margin-bottom: 0.6mm; }
.p-price strong { font-family: var(--serif); font-size: 2.85em; font-weight: 600; line-height: 1; letter-spacing: -0.01em; }

.p-desc {
  font-size: 0.95em;
  line-height: 1.5;
  color: #3b352c;
  margin: 3.4mm 0 4.4mm;
  max-width: 62ch;
  overflow-wrap: anywhere;
  flex: 0 0 auto;
}

.p-specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 0.5pt solid #d9d1c4;
  border-bottom: 0.5pt solid #d9d1c4;
  flex: 0 0 auto;
}
.p-specs > div { padding: 2.6mm 3mm 2.8mm 0; border-right: 0.4pt solid #e6dfd4; }
.p-specs > div:last-child { border-right: 0; }
.p-specs > div + div { padding-left: 3mm; }
.p-specs small { display: block; font-size: 0.55em; letter-spacing: 0.16em; text-transform: uppercase; color: #8b8378; margin-bottom: 1.2mm; }
.p-specs b { font-size: 0.8em; font-weight: 600; line-height: 1.25; display: block; overflow-wrap: anywhere; }

.p-colours { margin-top: 3.6mm; flex: 0 0 auto; }
.p-colours .lbl { font-size: 0.55em; letter-spacing: 0.16em; text-transform: uppercase; color: #8b8378; margin-bottom: 1.6mm; }
.p-colours .dots { display: flex; flex-wrap: wrap; gap: 2.4mm 4.5mm; }
.p-colours .dot { display: flex; align-items: center; gap: 1.6mm; font-size: 0.72em; }
.p-colours .dot i {
  width: 2.4mm; height: 2.4mm; border-radius: 50%;
  border: 0.4pt solid rgba(0, 0, 0, 0.25);
  display: block;
}

.p-cost {
  margin-top: 4mm;
  padding: 3mm 3.4mm;
  background: #f6f2ea;
  border: 0.4pt solid #e6dfd4;
  flex: 0 0 auto;
}
.p-cost .grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2mm; }
.p-cost small { display: block; font-size: 0.52em; letter-spacing: 0.14em; text-transform: uppercase; color: #8b8378; margin-bottom: 0.8mm; }
.p-cost b { font-size: 0.76em; font-weight: 600; font-variant-numeric: tabular-nums; }
.p-cost .licence {
  display: flex;
  gap: 2mm;
  align-items: flex-start;
  margin-top: 2.6mm;
  padding-top: 2.2mm;
  border-top: 0.4pt solid #e0d8cb;
  font-size: 0.62em;
  line-height: 1.4;
  color: #4a433a;
}
.p-cost .licence i { width: 1.7mm; height: 1.7mm; border-radius: 50%; background: #b4462a; flex: 0 0 auto; margin-top: 1.3mm; }

.p-licence-only {
  margin-top: 3.4mm;
  font-size: 0.62em;
  color: #6a6257;
  line-height: 1.4;
  border-left: 1.6pt solid #b4462a;
  padding-left: 2.6mm;
  flex: 0 0 auto;
}

.p-note { margin-top: 2.6mm; font-size: 0.66em; color: #6a6257; flex: 0 0 auto; }

/* Cover */

.cover { display: flex; flex-direction: column; }
.cover-head {
  flex: 0 0 auto;
  height: 30mm;
  padding: 0 16mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 7.4px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #4a433a;
}
.cover-image { flex: 0 0 auto; height: 166mm; overflow: hidden; background: #f1ece4; }
.cover-image img { width: 100%; height: 100%; object-fit: cover; }
.cover-copy { flex: 1 1 auto; display: flex; flex-direction: column; padding: 9mm 16mm 0; min-height: 0; }
.cover-kicker { font-size: 8px; letter-spacing: 0.24em; text-transform: uppercase; color: #8b8378; margin-bottom: 4.5mm; }
.cover-copy h1 {
  font-family: var(--serif);
  font-size: 76px;
  line-height: 0.9;
  letter-spacing: -0.035em;
  font-weight: 400;
  margin: 0;
}
.cover-meta {
  margin-top: auto;
  padding: 4mm 0 10mm;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6mm;
}
.cover-meta .lines { display: flex; flex-direction: column; gap: 1.4mm; font-size: 7.8px; letter-spacing: 0.16em; text-transform: uppercase; color: #6a6257; }
.cover-meta .lines b { font-weight: 600; color: #17130f; letter-spacing: 0.1em; }
.cover-logo { height: 13mm; width: auto; object-fit: contain; }

/* Contents */

.toc h1 { font-family: var(--serif); font-size: 42px; line-height: 1; letter-spacing: -0.03em; margin: 2mm 0 6mm; font-weight: 500; }
.toc-group { margin-bottom: 7.5mm; }
.toc-group h2 { font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.toc-group p { font-size: 8.6px; color: #7b7368; margin: 0.8mm 0 2.4mm; }
.toc-row {
  display: grid;
  grid-template-columns: 13mm minmax(0, 1fr) auto 9mm;
  align-items: center;
  gap: 3mm;
  padding: 2.2mm 0;
  border-bottom: 0.4pt solid #e6dfd4;
}
.toc-row img { width: 13mm; height: 10mm; object-fit: cover; background: #f1ece4; }
.toc-row .nm { font-size: 9.4px; font-weight: 500; overflow-wrap: anywhere; }
.toc-row .pr { font-size: 9.4px; font-variant-numeric: tabular-nums; }
.toc-row .pg { font-size: 8.4px; color: #8b8378; text-align: right; }

/* Closing page */

.closing h1 { font-family: var(--serif); font-size: 44px; line-height: 1.02; letter-spacing: -0.03em; font-weight: 400; margin: 2mm 0 5mm; max-width: 14ch; }
.closing .lead { font-size: 9.8px; line-height: 1.6; color: #3b352c; max-width: 62ch; margin-bottom: 11mm; }
.steps { display: grid; grid-template-columns: 1fr 1fr; border: 0.5pt solid #ddd5c9; }
.steps > div { padding: 6.5mm; border-right: 0.5pt solid #ddd5c9; border-bottom: 0.5pt solid #ddd5c9; }
.steps > div:nth-child(2n) { border-right: 0; }
.steps > div:nth-last-child(-n + 2) { border-bottom: 0; }
.steps em { font-style: normal; font-size: 8px; letter-spacing: 0.18em; color: #b4462a; display: block; margin-bottom: 2.4mm; }
.steps h3 { font-family: var(--serif); font-size: 17px; font-weight: 500; margin-bottom: 1.6mm; }
.steps p { font-size: 8.6px; line-height: 1.5; color: #4a433a; }
.materials { margin-top: 9mm; }
.materials .lbl { font-size: 7.6px; letter-spacing: 0.18em; text-transform: uppercase; color: #8b8378; margin-bottom: 2.4mm; }
.mat-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 0.5pt solid #ddd5c9; border-bottom: 0.5pt solid #ddd5c9; }
.mat-grid > div { padding: 3.4mm 3mm 3.4mm 0; border-right: 0.4pt solid #e6dfd4; }
.mat-grid > div:last-child { border-right: 0; }
.mat-grid > div + div { padding-left: 3mm; }
.mat-grid b { display: block; font-size: 9px; font-weight: 600; margin-bottom: 1mm; }
.mat-grid span { font-size: 7.6px; line-height: 1.4; color: #6a6257; display: block; }

.contact-list { margin-top: 12mm; border-top: 0.5pt solid #ddd5c9; }
.contact-list div { display: grid; grid-template-columns: 26mm 1fr; align-items: baseline; padding: 3.4mm 0; border-bottom: 0.5pt solid #e6dfd4; }
.contact-list small { font-size: 7.6px; letter-spacing: 0.18em; text-transform: uppercase; color: #8b8378; }
.contact-list b { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.closing .fine { margin-top: 10mm; font-size: 7.6px; line-height: 1.5; color: #8b8378; max-width: 70ch; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 120;
  max-width: min(90vw, 520px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Print ---------- */

@page { size: A4 portrait; margin: 0; }

@media print {
  html, body { background: #fff !important; }
  body > *:not(#pdfOverlay) { display: none !important; }
  #pdfOverlay {
    position: static !important;
    display: block !important;
    background: #fff !important;
  }
  .overlay-bar, .overlay-note, .pdf-share-status, .toast { display: none !important; }
  .overlay-scroll { overflow: visible !important; padding: 0 !important; height: auto !important; }
  .print-root { display: block !important; }
  .sheet-frame {
    --s: 1;
    width: 210mm !important;
    height: 297mm !important;
    overflow: hidden;
    break-after: page;
    page-break-after: always;
  }
  .sheet-frame:last-child { break-after: auto; page-break-after: auto; }
  .sheet {
    transform: none !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  a[href]::after { content: none !important; display: none !important; }
  .pdf-link-button,.pdf-photo-button { color:#b4462a !important; text-decoration:none !important; }
  .pdf-gallery-cue { background:#b4462a !important; color:#fff !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 280px minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .top-actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .workspace { grid-template-columns: 1fr; }
  .rail { position: static; max-height: none; overflow: visible; order: 2; }
  .content { order: 1; }
  .content-head { flex-direction: column; align-items: flex-start; }
  .content-actions { justify-content: flex-start; width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .save-state { display: none; }
  .collection-switcher { margin-right: auto; }
  .top-actions .btn.ghost#themeBtn { display: inline-flex; }
}

@media (max-width: 560px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 26px; height: 32px; }
  .brand-text strong { font-size: 17px; }
  .brand-text em { display: none; }
  .top-actions { gap: 6px; justify-content: stretch; }
  .collection-switcher { order: 1; flex: 1 1 100%; width: 100%; justify-content: space-between; margin: 0; }
  .collection-switcher select { flex: 1 1 auto; max-width: none; }
  .cloud-btn { order: 2; flex: 1 1 auto; max-width: none; }
  #themeBtn { order: 3; flex: 1 1 auto; }
  #dataBtn { order: 4; flex: 1 1 auto; }
  #pdfBtn { order: 5; flex: 1 1 100%; }
  .auth-modal { padding: 14px; }
  .auth-card { padding: 26px 20px 22px; }
  .conflict-actions { flex-direction: column-reverse; }
  .conflict-actions .btn { width: 100%; }
  .top-actions .btn { height: 33px; padding: 0 11px; font-size: 12px; }
  .content-head h1 { font-size: 34px; }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr 1fr; }
  .field-row.four { grid-template-columns: 1fr 1fr; }
  .overlay-actions .seg { display: none; }
  .overlay-bar { flex-wrap: wrap; }
  .overlay-actions { flex-wrap: wrap; justify-content: flex-end; }
  .overlay-actions #prepareCustomerPdf { order: 10; flex: 1 1 100%; }
  .overlay-actions #copyCustomerLink { order: 11; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* Collection manager, PDF presentation controls, and public viewer */
.style-preset-row { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin:2px 0 13px; }
.style-preset { min-height:58px; padding:8px 5px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); text-align:left; color:var(--ink-2); }
.style-preset b,.style-preset small { display:block; } .style-preset b { font-size:11px; } .style-preset small { margin-top:3px; font-size:9px; color:var(--muted); }
.style-preset.active { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); color:var(--accent); }
.fields input[type=range] { height:20px; padding:0; accent-color:var(--accent); background:transparent; }
.collection-manager-card { width:min(100%,720px); max-height:min(760px,90vh); overflow:auto; } .collection-manager-card h2 { max-width:none; }
.collection-manager-actions { display:flex; justify-content:space-between; gap:8px; margin:20px 0 12px; }
.collection-form { margin:12px 0; padding:13px; border:1px solid var(--accent); border-radius:12px; background:var(--surface-2); }
.collection-form[hidden] { display:none; }
.collection-form-actions { display:flex; justify-content:flex-end; gap:7px; margin-top:11px; }
.collection-manager-list { display:grid; gap:8px; } .collection-manager-item { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); } .collection-manager-item.active { border-color:var(--accent); }
.collection-manager-copy h3 { margin:3px 0 3px; font-family:var(--serif); font-size:20px; } .collection-manager-copy p { margin:0; color:var(--muted); font-size:11px; } .collection-manager-item-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px; } .danger-text { color:var(--accent)!important; } .empty-collection-manager { display:grid; gap:5px; padding:25px; border:1px dashed var(--line-strong); border-radius:12px; color:var(--muted); text-align:center; }
.publishing-card { width:min(100%,860px); max-height:min(820px,92vh); overflow:auto; }
.publishing-site { margin-top:18px; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.publishing-site .hint { margin-top:6px; }
.publishing-site-actions { display:flex; justify-content:flex-end; margin-top:8px; }
.publishing-feedback-list { display:grid; gap:6px; margin:10px 0 0; padding-left:18px; color:var(--muted); font-size:12px; }
.publishing-feedback-list li.is-error { color:var(--accent); }
.publishing-feedback-list li.is-warning { color:var(--warn); }
.publishing-feedback-list .link-btn { margin-left:5px; font-size:11px; }
.publishing-list { display:grid; gap:10px; margin-top:18px; }
.publishing-item { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.publishing-item.active { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 10%,transparent); }
.publishing-item-copy { min-width:0; }
.publishing-item-head { display:flex; align-items:center; gap:8px; }
.publishing-item-copy h3 { margin:5px 0 4px; font-family:var(--serif); font-size:21px; }
.publishing-slug { display:grid; grid-template-columns:auto minmax(140px,260px); align-items:center; gap:8px; margin:7px 0; color:var(--muted); font-size:11px; }
.publishing-slug input { min-height:30px; padding:0 8px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--ink); font-size:12px; }
.publishing-item-copy p { margin:0; color:var(--muted); font-size:12px; }
.publishing-item-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.publishing-url { display:block; margin-top:8px; color:var(--accent); font-size:11px; overflow-wrap:anywhere; }
.publishing-history { margin-top:10px; color:var(--muted); font-size:11px; }
.publishing-history summary { cursor:pointer; color:var(--accent); }
.publishing-history span { display:block; margin-top:4px; }
@media (max-width:720px) { .publishing-item { flex-direction:column; } .publishing-item-actions { justify-content:flex-start; } }
.delete-warning { color:var(--accent); font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.share-result { display:flex; gap:8px; margin:18px 0; } .share-result input { min-width:0; flex:1; height:38px; padding:0 11px; border:1px solid var(--line); border-radius:9px; background:var(--surface-2); color:var(--ink); font-size:12px; }
.share-modal-actions { display:flex; flex-wrap:wrap; gap:8px; }
.share-body { min-height:100vh; background:var(--bg); color:var(--ink); } .share-shell { max-width:1180px; margin:auto; padding:28px 22px 70px; } .share-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding-bottom:20px; border-bottom:1px solid var(--line); } .share-badge { padding:7px 10px; border:1px solid var(--line); border-radius:999px; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.12em; } .share-intro { padding:70px 0 35px; } .share-intro h1 { max-width:850px; margin:8px 0; font-family:var(--serif); font-size:clamp(44px,8vw,86px); font-weight:500; line-height:.95; } .share-intro p:not(.eyebrow) { color:var(--muted); } .share-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:18px; } .share-card { overflow:hidden; border:1px solid var(--line); border-radius:14px; background:var(--surface); } .share-photo-button { display:block; position:relative; width:100%; padding:0; border:0; background:var(--surface-2); text-align:left; } .share-card img,.share-card-empty { width:100%; height:250px; object-fit:cover; background:var(--surface-2); } .share-card-empty { display:grid; place-items:center; color:var(--muted); font-size:12px; } .share-photo-label { position:absolute; right:12px; bottom:12px; padding:7px 10px; border-radius:999px; background:rgba(23,19,15,.86); color:#fff; font-size:10px; letter-spacing:.08em; text-transform:uppercase; } .share-card-copy { padding:15px; } .share-card-copy h2 { margin:6px 0 7px; font-family:var(--serif); font-size:23px; } .share-card-copy p { color:var(--muted); font-size:12px; line-height:1.5; } .share-card-copy strong { display:block; margin-top:10px; font-family:var(--serif); font-size:24px; } .share-dimensions { margin-top:9px; } .share-dimensions b { color:var(--ink); } .share-card-cta { margin-top:14px; } .share-loading,.share-error { padding:100px 0; text-align:center; color:var(--muted); } .share-scope-note { color:var(--muted); font-size:12px; } .share-gallery-modal { display:none; position:fixed; inset:0; z-index:140; align-items:center; justify-content:center; padding:22px; } .share-gallery-modal.open { display:flex; } .share-gallery-scrim { position:absolute; inset:0; background:rgba(23,19,15,.7); } .share-gallery-card { position:relative; z-index:1; width:min(100%,980px); max-height:90vh; overflow:auto; padding:28px; border-radius:18px; background:var(--surface); box-shadow:0 24px 70px rgba(0,0,0,.35); } .share-gallery-card h2 { margin:5px 0 20px; font-family:var(--serif); font-size:36px; } .share-gallery-close { position:absolute; top:12px; right:12px; } .share-gallery-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; } .share-gallery-grid img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:10px; background:var(--surface-2); }
.sheet-body { font-size:calc(13.4px * var(--fit) * var(--pdf-scale, 1)); gap:calc(4mm * var(--pdf-spacing, 1)); } .cover-copy h1 { font-size:calc(76px * var(--pdf-scale, 1)); } .cover-subtitle { margin:0 0 5mm; color:#8b8378; font-size:calc(12px * var(--pdf-scale, 1)); }
@media (max-width:720px) { .collection-manager-item { align-items:flex-start; flex-direction:column; } .collection-manager-item-actions { justify-content:flex-start; } .style-preset-row { grid-template-columns:1fr; } .share-header { align-items:flex-start; flex-direction:column; } }

@media (max-width:767px) {
  .pdf-design-card { width:100%; max-height:94vh; padding:22px 16px 16px; }
  .pdf-design-presets { grid-template-columns:1fr 1fr; }
  .pdf-design-section .fields { grid-template-columns:1fr; }
  .pdf-design-footer { position:sticky; bottom:-16px; margin:0 -16px; padding:12px 16px; background:var(--surface); }
  .pdf-design-footer .btn { min-height:42px; }
  .overlay-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
  .overlay-actions #prepareCustomerPdf { order:1; grid-column:1 / -1; grid-row:1; }
  .overlay-actions #copyCustomerLink { order:2; grid-column:1; grid-row:2; }
  .overlay-actions #whatsappCustomerLink { order:3; grid-column:2; grid-row:2; }
  .overlay-actions #pdfDesignBtn { order:4; grid-column:3; grid-row:2; min-width:0; }
  .overlay-actions #printNow { order:5; grid-column:1; grid-row:3; }
  .overlay-actions #downloadPdf { order:6; grid-column:2; grid-row:3; }
  .overlay-actions #closePdf { order:7; grid-column:3; grid-row:3; }
}

.print-root[data-pdf-style="standard"] .sheet-body { gap:calc(3mm * var(--pdf-spacing, 1)); }
.print-root[data-pdf-style="compact"] .sheet-body { gap:calc(2mm * var(--pdf-spacing, 1)); }
.print-root[data-pdf-style="compact"] .p-title { font-size:2.55em; }

/* Live PDF design system: values are set on .print-root by pdf.js. */
.print-root { --pdf-display-font: var(--serif); --pdf-body-font: var(--sans); }
.print-root[data-pdf-font="modern"], .print-root[data-pdf-font="clean"] { --pdf-display-font: var(--sans); --pdf-body-font: var(--sans); }
.print-root[data-pdf-font="classic"] { --pdf-display-font: Georgia, 'Times New Roman', serif; --pdf-body-font: var(--sans); }
.print-root .sheet { font-family:var(--pdf-body-font); }
.print-root .sheet-body { padding:calc(14mm * var(--pdf-margin-scale,1)) calc(16mm * var(--pdf-margin-scale,1)) calc(15mm * var(--pdf-margin-scale,1)); font-size:calc(13.4px * var(--fit) * var(--pdf-scale,1) * var(--pdf-body-scale,1)); line-height:var(--pdf-line-height,1.45); gap:calc(4mm * var(--pdf-spacing,1)); }
.print-root .sheet-head, .print-root .sheet-foot { font-family:var(--pdf-body-font); }
.print-root .cover-copy h1, .print-root .toc h1, .print-root .closing h1, .print-root .p-title, .print-root .p-price strong, .print-root .toc-group h2 { font-family:var(--pdf-display-font); }
.print-root .cover-copy h1 { font-size:calc(76px * var(--pdf-scale,1) * var(--pdf-heading-scale,1)); }
.print-root .toc h1, .print-root .closing h1 { font-size:calc(42px * var(--pdf-scale,1) * var(--pdf-heading-scale,1)); }
.print-root .p-title { font-size:calc(3.02em * var(--pdf-heading-scale,1)); }
.print-root .p-price strong { font-size:calc(2.85em * var(--pdf-price-scale,1)); }
.print-root .p-desc { font-size:calc(.95em * var(--pdf-body-scale,1)); line-height:var(--pdf-line-height,1.5); }
.print-root .p-eyebrow, .print-root .p-specs small, .print-root .p-colours .lbl, .print-root .sheet-edition, .print-root .sheet-foot, .print-root .p-sku { font-size:calc(.6em * var(--pdf-meta-scale,1)); }
.print-root .p-hero { height:calc(148mm * var(--fit) * var(--pdf-image-scale,1)); }
.print-root[data-pdf-layout="image-led"] .p-hero { height:calc(155mm * var(--fit) * var(--pdf-image-scale,1)); }
.print-root[data-pdf-layout="text-led"] .p-hero { height:calc(125mm * var(--fit) * var(--pdf-image-scale,1)); }
.print-root[data-pdf-layout="text-led"] .p-desc { max-width:72ch; }
.print-root[data-pdf-layout="image-led"] .p-desc { max-width:56ch; }
.print-root[data-pdf-products="compact"] .toc-row { padding-top:1.5mm; padding-bottom:1.5mm; }
.print-root[data-pdf-products="spacious"] .toc-row { padding-top:3mm; padding-bottom:3mm; }
.print-root[data-pdf-button="filled"] .pdf-link-button, .print-root[data-pdf-button="filled"] .pdf-photo-button { background:#b4462a; border-color:#b4462a; color:#fff !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.print-root[data-pdf-button="minimal"] .pdf-link-button, .print-root[data-pdf-button="minimal"] .pdf-photo-button { border-color:transparent; padding-left:0; padding-right:0; }
.print-root[style*="--pdf-avoid-breaks: avoid"] .p-hero, .print-root[style*="--pdf-avoid-breaks: avoid"] .p-head, .print-root[style*="--pdf-avoid-breaks: avoid"] .p-desc, .print-root[style*="--pdf-avoid-breaks: avoid"] .p-specs { break-inside:avoid; page-break-inside:avoid; }
