:root {
  --color-bg: #ded2c4;
  --color-surface: #e9ded1;
  --color-surface-soft: #f0e7dc;
  --color-text: #0f0e0d;
  --color-muted: #62574e;
  --color-border: rgba(27, 23, 20, 0.3);
  --color-primary: #2a1914;
  --color-primary-hover: #3d2921;
  --color-primary-soft: #d6c8b8;
  --color-accent: #b08a55;
  --color-accent-muted: #6f4f39;
  --color-danger: #963d32;
  --container-width: 1720px;
  --header-height: 96px;
}
* { box-sizing: border-box; }
html, body { max-width: 100vw; min-height: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font-family: Arial, Helvetica, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
code { color: var(--color-text); }
::selection { background: var(--color-primary); color: var(--color-surface); }
:focus-visible { outline: 3px solid rgba(176, 138, 85, 0.55); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1; }
.container { width: min(var(--container-width), calc(100% - 72px)); margin: 0 auto; }
.skip-link { position:absolute; left:16px; top:-200px; z-index:9999; background:#fff; color:#000; padding:10px 12px; }
.skip-link:focus { top:16px; }
.muted { color: var(--color-muted); }
.hidden { display: none !important; }

.header,
.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  height: var(--header-height);
  background: rgba(222, 210, 196, 0.94);
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px);
}
.header-inner {
  width: min(var(--container-width), calc(100% - 80px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 42px;
}
.logo { display: inline-flex; align-items: center; gap: 18px; width: max-content; color: inherit; }
.logo-mark { display: grid; place-items: center; width: 60px; height: 60px; overflow: hidden; background: var(--color-primary); border: 1px solid var(--color-accent); box-shadow: inset 0 0 0 4px rgba(176, 138, 85, 0.18); color: var(--color-surface); font-size: 13px; font-weight: 950; letter-spacing: -0.06em; }
.logo-text { font-weight: 950; letter-spacing: -0.06em; font-size: 31px; line-height: 1; }
.nav { display: flex; justify-content: center; align-items: center; gap: 14px; }
.nav-link { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; min-width: 156px; padding: 8px 20px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid var(--color-border); color: var(--color-primary); font-size: 16px; font-weight: 950; line-height: 1; white-space: nowrap; transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.nav-link:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.nav-link.active { background: var(--color-primary); color: var(--color-surface); border-color: var(--color-primary); box-shadow: inset 0 0 0 1px rgba(212,183,127,.26), 0 8px 18px rgba(42,25,20,.12); }
.cart-count { position: absolute; top: -7px; right: -6px; min-width: 22px; height: 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; background: #1f9a1f; color: #fff; font-size: 12px; font-weight: 950; line-height: 1; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.phone { white-space: nowrap; font-size: 16px; font-weight: 950; }
.admin-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border: 1px solid rgba(27,23,20,.18); color: var(--color-muted); font-size: 13px; font-weight: 900; }
.menu-button { display: none; border: 1px solid var(--color-border); background: transparent; color: var(--color-primary); width: 46px; height: 46px; border-radius: 999px; font-weight: 950; }

.page { padding: 0 0 72px; }
.intro { display: grid; grid-template-columns: minmax(0, .92fr) minmax(360px, .68fr); gap: clamp(28px, 5vw, 86px); align-items: start; padding: clamp(30px, 4.5vh, 46px) 0 clamp(28px, 4.5vh, 42px); }
.copy { max-width: 760px; }
.kicker { margin: 0 0 14px; color: var(--color-accent-muted); font-size: 12px; font-weight: 950; line-height: 1; letter-spacing: .24em; text-transform: uppercase; }
.intro-title { max-width: 800px; margin: 0; font-size: clamp(38px, 4.25vw, 68px); line-height: .96; letter-spacing: -.075em; font-weight: 950; }
.description { max-width: 700px; margin: clamp(16px, 2.2vh, 22px) 0 0; color: var(--color-muted); font-size: clamp(16px, 1.28vw, 21px); line-height: 1.36; }
.points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(16px, 2.6vh, 24px); }
.points span { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid var(--color-border); border-radius: 999px; padding: 6px 11px; background: rgba(255,255,255,.1); color: var(--color-primary); font-size: 13px; font-weight: 900; }
.media-panel { position: relative; display: grid; grid-template-rows: auto minmax(250px, 1fr) auto; min-height: clamp(360px, 50vh, 450px); margin-top: 28px; border: 1px solid var(--color-border); background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,0) 34%), var(--color-surface); overflow: hidden; }
.media-panel::before, .media-panel::after { content: ""; position: absolute; pointer-events: none; }
.media-panel::before { inset: 16px; border: 1px solid rgba(27,23,20,.12); }
.media-panel::after { width: 44%; height: 1px; right: 0; bottom: 70px; background: var(--color-border); }
.media-topline { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 20px; padding: 20px 22px 0; color: var(--color-accent-muted); font-size: 11px; font-weight: 950; letter-spacing: .18em; text-transform: uppercase; }
.stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 36px 48px 22px; }
.hero-image { width: min(55%, 270px); height: min(62%, 250px); object-fit: contain; filter: drop-shadow(20px 22px 24px rgba(42,25,20,.18)); }
.caption { position: relative; z-index: 2; display: grid; gap: 8px; max-width: 420px; padding: 0 22px 22px; }
.caption span { font-size: clamp(22px, 2.1vw, 32px); line-height: 1; letter-spacing: -.055em; font-weight: 950; }
.caption small { color: var(--color-muted); font-size: 14px; line-height: 1.34; }
.catalog-block { padding: 24px 0 0; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 34px; padding-bottom: 24px; border-bottom: 2px solid var(--color-primary); }
.title-block { display: flex; flex-direction: column; }
.catalog-title { margin: 0; font-size: clamp(34px, 4.2vw, 72px); line-height: .92; letter-spacing: -.07em; font-weight: 950; }
.meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.meta span { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border: 1px solid rgba(0,0,0,.14); border-radius: 999px; background: rgba(255,255,255,.18); color: var(--color-text); font-size: 14px; font-weight: 850; }
.grid { display: grid; }
.row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row + .row { margin-top: 42px; padding-top: 42px; border-top: 1px solid var(--color-border); }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 100%; padding: 0 18px 24px; border-left: 1px solid var(--color-border); background: transparent; color: inherit; }
.card:nth-child(4n), .card:last-child { border-right: 1px solid var(--color-border); }
.image-wrap { position: relative; height: 360px; margin: 0 -1px 18px; overflow: hidden; background: var(--color-surface); }
.sample-layer, .wall-layer { position: absolute; inset: 0; transition: opacity .26s ease, transform .26s ease; }
.sample-layer { z-index: 1; }
.wall-layer { z-index: 0; opacity: 0; transform: scale(1.03); }
.card:hover .sample-layer { opacity: 0; transform: scale(.985); }
.card:hover .wall-layer { opacity: 1; transform: scale(1); }
.product-image { width: 100%; height: 100%; object-fit: contain; padding: 28px; user-select: none; pointer-events: none; }
.wall-placeholder { width: 100%; height: 100%; background: repeating-linear-gradient(90deg, rgba(42,25,20,.1) 0 1px, transparent 1px 42px), linear-gradient(135deg, var(--tone,#c99655), rgba(42,25,20,.22)); display: grid; place-items: center; color: rgba(42,25,20,.72); font-weight: 950; }
.content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 0; }
.card-title { margin: 0 0 7px; font-size: 22px; line-height: 1.04; letter-spacing: -.045em; font-weight: 950; }
.card-desc { display: -webkit-box; min-height: 42px; margin: 0 0 14px; overflow: hidden; color: var(--color-muted); font-size: 15px; line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card:hover .card-title { color: var(--color-accent-muted); }
.price { margin-top: auto; font-weight: 950; color: var(--color-primary); font-size: 18px; }
.loading-card, .error-card { border: 1px solid var(--color-border); background: var(--color-surface); padding: 30px; color: var(--color-muted); font-weight: 900; }

.product-page { padding: 34px 0 72px; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin: 34px 0 18px; color: var(--color-muted); font-size: 14px; font-weight: 700; }
.product-hero { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 22px; align-items: stretch; margin-bottom: 42px; }
.visual, .summary { overflow: hidden; border: 1px solid var(--color-border); background: var(--color-surface); }
.visual { display: grid; place-items: center; min-height: 430px; position: relative; }
.summary { display: flex; flex-direction: column; gap: 18px; min-height: 430px; padding: clamp(34px, 4.8vw, 72px) clamp(26px, 4vw, 44px) clamp(28px, 3.6vw, 46px); }
.detail-title { margin: 0; max-width: 760px; font-size: clamp(38px, 5vw, 72px); line-height: .92; letter-spacing: -.07em; font-weight: 950; }
.detail-desc { max-width: 720px; margin: 0; color: var(--color-muted); font-size: 18px; line-height: 1.5; }
.photo-stage { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 430px; background: var(--color-surface); }
.photo-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: clamp(26px, 4vw, 58px); }
.model-holder { position: absolute; inset: 0; background: var(--color-surface); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.visual.model-ready:hover .model-holder, .model-holder.force-show { opacity: 1; pointer-events: auto; }
.viewer-canvas { width: 100%; height: 100%; touch-action: none; }
.viewer-note { position: absolute; left: 14px; bottom: 14px; z-index: 4; padding: 8px 10px; background: rgba(240,231,220,.88); border: 1px solid var(--color-border); font-size: 12px; font-weight: 900; color: var(--color-primary); }
.viewer-controls { position: absolute; right: 12px; top: 12px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; }
.viewer-controls button { border: 1px solid var(--color-border); background: rgba(240,231,220,.9); font-weight: 900; color: var(--color-primary); padding: 6px 8px; }
.section-label { margin: 0 0 8px; color: var(--color-accent-muted); font-size: 12px; font-weight: 950; letter-spacing: .16em; text-transform: uppercase; }
.material-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.material-choice { width: 84px; height: 84px; border: 1px solid var(--color-border); background: transparent; padding: 0; display: block; position: relative; }
.material-choice.active { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(42,25,20,.16); }
.material-choice img, .material-swatch { width: 100%; height: 100%; object-fit: cover; background: var(--tone,#c99655); }
.material-choice span { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px); opacity: 0; white-space: nowrap; padding: 6px 9px; background: var(--color-primary); color: var(--color-surface); font-size: 12px; font-weight: 900; pointer-events: none; }
.material-choice:hover span { opacity: 1; transform: translateX(-50%) translateY(0); }
.size-row { display: flex; flex-wrap: wrap; gap: 10px; }
.size-choice { min-height: 40px; min-width: 72px; border: 1px solid var(--color-border); background: var(--color-surface-soft); font-weight: 900; padding: 0 12px; }
.size-choice.active { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.qty-row { display: grid; grid-template-columns: minmax(130px, 180px) 1fr; gap: 12px; align-items: center; }
.qty-row input, .checkout-card input, .checkout-card textarea, .admin-card input, .admin-card textarea, .admin-card select { width: 100%; border: 1px solid var(--color-border); background: var(--color-surface-soft); color: var(--color-text); padding: 12px 13px; outline: none; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--color-primary); background: var(--color-primary); color: var(--color-surface); padding: 0 18px; font-weight: 950; }
.button.secondary { background: transparent; color: var(--color-primary); }

.cart-page { padding: 40px 0 72px; }
.cart-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; margin-bottom: 32px; padding-bottom: 28px; border-bottom: 2px solid var(--color-primary); }
.cart-title { margin: 0; font-size: clamp(46px, 5vw, 76px); line-height: .92; letter-spacing: -.07em; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; }
.cart-list { display: grid; gap: 0; border-top: 1px solid var(--color-border); }
.cart-item { display: grid; grid-template-columns: 82px 1fr auto; gap: 16px; align-items: center; min-height: 112px; padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.cart-thumb { width: 82px; height: 82px; object-fit: contain; background: var(--color-surface); }
.remove-btn { border: 0; background: transparent; color: var(--color-danger); font-weight: 950; }
.checkout-card { position: sticky; top: calc(var(--header-height) + 24px); display: grid; gap: 12px; border: 1px solid var(--color-border); border-left: 6px solid var(--color-primary); background: var(--color-surface); padding: 26px 28px; }
.checkout-card h2 { margin: 0 0 8px; font-size: 31px; line-height: 1; letter-spacing: -.055em; }
.checkout-card label, .admin-card label { display: grid; gap: 8px; color: var(--color-muted); font-size: 14px; font-weight: 900; }
.empty { display: grid; gap: 16px; max-width: 620px; border: 1px solid var(--color-border); background: var(--color-surface); padding: 30px; color: var(--color-muted); font-weight: 900; }

/* v1.6.12 — аккуратное пустое состояние корзины */
.cart-empty-state {
  max-width: 680px;
  gap: 18px;
  padding: 34px;
  color: var(--color-text);
}
.cart-empty-state h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.cart-empty-state p {
  max-width: 520px;
  margin: 0;
  color: var(--color-muted);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 700;
}
.cart-empty-button {
  width: fit-content;
  min-width: 190px;
  text-decoration: none;
}
html[data-theme="dark"] .cart-empty-state {
  background: linear-gradient(145deg, rgba(247,239,230,.08), rgba(216,183,124,.06));
  border-color: rgba(216,183,124,.26);
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
}
html[data-theme="dark"] .cart-empty-state h2 { color: #f7efe6; }
html[data-theme="dark"] .cart-empty-state p { color: rgba(247,239,230,.72); }
@media (max-width: 640px) {
  .cart-empty-state { padding: 26px 22px; }
  .cart-empty-button { width: 100%; }
}

.admin-page { padding: 40px 0 72px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.admin-card { display: grid; gap: 12px; border: 1px solid var(--color-border); background: var(--color-surface); padding: 22px; }
.admin-card h2 { margin: 0; font-size: 28px; letter-spacing: -.05em; }
.footer { border-top: 2px solid var(--color-primary); background: var(--color-bg); padding: 32px 0; color: var(--color-muted); }
.footer-inner { width: min(var(--container-width), calc(100% - 72px)); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; font-size: 14px; line-height: 1.45; }
.footer-inner div { display: grid; gap: 4px; }
.footer-inner strong { color: var(--color-text); font-size: 16px; }
.perf-badge { position: fixed; right: 14px; bottom: 14px; z-index: 100; padding: 8px 10px; background: rgba(42,25,20,.86); color: #f4eee6; font-size: 12px; font-weight: 900; pointer-events: none; }

@media (max-width: 1220px) { .header-inner { width: min(var(--container-width), calc(100% - 48px)); grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 24px; } .nav { justify-content: flex-end; } .phone { display: none; } }
@media (max-width: 1180px) { .intro { grid-template-columns: 1fr; gap: 26px; } .media-panel { min-height: 420px; margin-top: 0; } .row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card:nth-child(4n) { border-right: 0; } .card:nth-child(2n), .card:last-child { border-right: 1px solid var(--color-border); } }
@media (max-width: 920px) { .product-hero, .cart-layout, .admin-grid { grid-template-columns: 1fr; } .visual, .summary, .photo-stage { min-height: 320px; } .summary { padding-top: 30px; } .checkout-card { position: static; } .nav { display: none; } .admin-link { display:none; } .menu-button { display: inline-flex; justify-self:end; } }
@media (max-width: 760px) { :root { --header-height: 72px; } .container, .footer-inner { width: min(var(--container-width), calc(100% - 36px)); } .header-inner { width: min(var(--container-width), calc(100% - 32px)); grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; } .logo-mark { width: 46px; height: 46px; } .logo-text { font-size: 21px; } .intro { padding-top: 24px; gap: 24px; } .intro-title { font-size: clamp(34px, 11vw, 56px); } .description { font-size: 16px; } .media-panel { grid-template-rows: auto minmax(260px, 1fr) auto; min-height: 370px; } .stage { padding: 34px 26px 22px; } .hero-image { width: min(66%, 250px); height: min(58%, 220px); } .toolbar, .cart-header { align-items: flex-start; flex-direction: column; display: flex; } .meta { justify-content: flex-start; } .footer-inner { flex-direction: column; } }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } .row + .row { margin-top: 0; padding-top: 0; border-top: 0; } .card, .card:nth-child(2n), .card:nth-child(4n), .card:last-child { border-left: 0; border-right: 0; border-top: 1px solid var(--color-border); padding-left: 0; padding-right: 0; } .image-wrap { height: 330px; } .qty-row { grid-template-columns: 1fr; } .cart-item { grid-template-columns: 70px 1fr; } .remove-btn { grid-column: 2; justify-self:start; } }

/* v1.4: настоящий Three.js viewer из логики A22 */
.model-holder.real-three-viewer { overflow: hidden; }
.real-three-viewer .viewer-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.viewer-toolbar { position: absolute; right: 12px; top: 12px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; }
.viewer-toolbar button { border: 1px solid var(--color-border); background: rgba(240,231,220,.92); font-weight: 900; color: var(--color-primary); padding: 7px 9px; }
.material-grid { align-items: flex-start; }
.material-choice { height: 106px; display: grid; grid-template-rows: 84px 18px; gap: 6px; border: 0; background: transparent; }
.material-choice img, .material-swatch { border: 1px solid var(--color-border); }
.material-choice.active img, .material-choice.active .material-swatch { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(42,25,20,.16); }
.material-choice span { position: static; transform: none; opacity: 1; white-space: normal; padding: 0; background: transparent; color: var(--color-muted); font-size: 11px; line-height: 1.1; text-align: center; pointer-events: none; }
.material-choice:hover span { transform: none; opacity: 1; }

/* v1.4.3 final 3D/media hotfix */
.visual.model-ready .model-holder,
.model-holder.force-show {
  opacity: 1;
  pointer-events: auto;
}
.tile-webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: none;
}
.photo-stage img[hidden] {
  display: none !important;
}
.model-holder .viewer-note {
  pointer-events: none;
}

/* v1.4.5 A22-style viewer integration: photo first, 3D on desktop hover / mobile button */
.visual.model-ready .model-holder {
  opacity: 0;
  pointer-events: none;
}
.visual.model-ready:hover .model-holder,
.model-holder.force-show {
  opacity: 1;
  pointer-events: auto;
}
.model-holder.a22-model-holder {
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.20) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.20) 1px, transparent 1px),
    radial-gradient(circle at 52% 54%, rgba(82,54,34,.13), transparent 36%),
    var(--color-surface);
  background-size: 78px 78px, 78px 78px, auto, auto;
}
.tile-webgl-canvas { z-index: 2; }
.viewer-floor { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.viewer-contact-shadow {
  position: absolute;
  left: 20%; right: 20%; bottom: 18%; height: 12%; z-index: 1;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(42,25,20,.16), rgba(42,25,20,0) 70%);
  filter: blur(8px);
  pointer-events: none;
}
.viewer-toolbar,
.viewer-mode-toggle { position: absolute; z-index: 6; display: flex; gap: 0; border: 1px solid var(--color-border); background: rgba(240,231,220,.88); backdrop-filter: blur(4px); }
.viewer-toolbar { right: 14px; top: 14px; }
.viewer-mode-toggle { right: 14px; top: 60px; }
.viewer-toolbar button,
.viewer-mode-toggle button { min-width: 48px; min-height: 38px; border: 0; border-right: 1px solid var(--color-border); background: transparent; color: var(--color-primary); font-weight: 950; padding: 0 12px; }
.viewer-toolbar button:last-child,
.viewer-mode-toggle button:last-child { border-right: 0; }
.viewer-mode-toggle button.active { background: var(--color-primary); color: var(--color-surface); }
.viewer-hint { position: absolute; left: 14px; top: 14px; z-index: 6; max-width: 280px; padding: 12px 16px; background: rgba(42,25,20,.48); color: var(--color-surface); font-size: 13px; font-weight: 950; line-height: 1.25; }
.dimension-strip { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 6; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.dimension-strip span { min-height: 30px; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; background: rgba(240,231,220,.9); border: 1px solid var(--color-border); color: var(--color-muted); font-size: 12px; font-weight: 850; }
.dimension-strip b { color: var(--color-primary); }
.dimension-overlay { position: absolute; inset: 17% 14% 18% 14%; z-index: 5; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.a22-model-holder.is-check-mode .dimension-overlay { opacity: 1; }
.dim-line { position: absolute; color: var(--color-primary); font-size: 12px; font-weight: 950; }
.dim-line::before,
.dim-line::after { content: ""; position: absolute; background: var(--color-primary); }
.dim-width { left: 8%; right: 8%; bottom: 2%; height: 1px; border-bottom: 2px solid rgba(42,25,20,.72); text-align: center; }
.dim-width span { position: relative; top: 8px; background: rgba(240,231,220,.9); padding: 2px 7px; }
.dim-height { right: 2%; top: 8%; bottom: 8%; width: 1px; border-right: 2px solid rgba(42,25,20,.72); }
.dim-height span { position: absolute; top: 50%; left: 8px; transform: translateY(-50%) rotate(90deg); transform-origin: left center; background: rgba(240,231,220,.9); padding: 2px 7px; white-space: nowrap; }
.dim-thickness { left: 8%; top: 8%; width: 72px; border-top: 2px solid rgba(42,25,20,.72); transform: skewY(-16deg); }
.dim-thickness span { position: absolute; left: 12px; top: -22px; transform: skewY(16deg); background: rgba(240,231,220,.9); padding: 2px 7px; white-space: nowrap; }
.tile-guides { position: absolute; inset: clamp(26px, 4vw, 58px); pointer-events: none; opacity: .86; }
.tile-guides .guide { position: absolute; color: var(--color-primary); font-size: 12px; font-weight: 950; }
.tile-guides .guide-width { left: 12%; right: 12%; bottom: 0; border-bottom: 2px solid rgba(42,25,20,.62); text-align: center; }
.tile-guides .guide-width span { position: relative; top: 8px; background: rgba(240,231,220,.86); padding: 2px 7px; }
.tile-guides .guide-height { right: 4%; top: 10%; bottom: 10%; border-right: 2px solid rgba(42,25,20,.62); }
.tile-guides .guide-height span { position: absolute; top: 50%; left: 8px; transform: translateY(-50%) rotate(90deg); transform-origin: left center; background: rgba(240,231,220,.86); padding: 2px 7px; white-space: nowrap; }
.tile-guides .guide-thickness { left: 16%; top: 12%; width: 74px; border-top: 2px solid rgba(42,25,20,.62); transform: skewY(-18deg); }
.tile-guides .guide-thickness span { position: absolute; top: -22px; left: 8px; transform: skewY(18deg); background: rgba(240,231,220,.86); padding: 2px 7px; white-space: nowrap; }
.mobile-3d-button { display: none; position: absolute; right: 14px; top: 14px; z-index: 8; min-width: 52px; min-height: 42px; border: 1px solid var(--color-primary); background: rgba(42,25,20,.9); color: var(--color-surface); font-weight: 950; }
.desktop-3d-hint { margin-top: -6px; }
.perf-stack { position: fixed; right: 14px; bottom: 14px; z-index: 100; display: grid; gap: 5px; pointer-events: none; justify-items: end; }
.perf-stack .perf-badge { position: static; right: auto; bottom: auto; white-space: nowrap; }
@media (hover: none), (pointer: coarse) {
  .visual.model-ready:hover .model-holder { opacity: 0; pointer-events: none; }
  .model-holder.force-show { opacity: 1; pointer-events: auto; }
  .mobile-3d-button { display: inline-flex; align-items: center; justify-content: center; }
  .desktop-3d-hint { display: none; }
}
@media (max-width: 760px) {
  .viewer-toolbar { left: 12px; right: auto; top: 12px; }
  .viewer-mode-toggle { right: 12px; top: 12px; }
  .viewer-hint { display: none; }
  .dimension-strip { font-size: 11px; bottom: 10px; }
}


/* v1.4.6 A22 calculator viewer correction */
.photo-stage .tile-guides { display: none !important; }
.model-holder.a22-model-holder {
  background:
    linear-gradient(to top, rgba(33, 21, 17, 0.14), transparent 34%),
    linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px),
    #d9cdbc;
  background-size: 100% 100%, 64px 64px, 64px 64px, auto;
}
.model-holder.a22-model-holder::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 58%, rgba(42,25,20,.10), transparent 30%),
    linear-gradient(to bottom, rgba(255,255,255,.12), rgba(42,25,20,.06));
  pointer-events: none;
}
.tile-webgl-canvas { position: absolute; inset: 0; z-index: 2; width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.viewer-toolbar,
.viewer-mode-toggle,
.viewer-hint,
.dimension-strip,
.dimension-overlay,
.viewer-note { z-index: 6; }
.dimension-strip { opacity: 1; }
.dimension-overlay { opacity: .92; inset: 13% 11% 14% 11%; }
.a22-model-holder.is-check-mode .dimension-overlay { opacity: .98; }
.dim-line { text-shadow: 0 1px 0 rgba(240,231,220,.85); }
.dim-width { left: 7%; right: 7%; bottom: 5%; }
.dim-height { right: 3%; top: 8%; bottom: 12%; }
.dim-thickness { left: 9%; top: 12%; }
.viewer-note { position: absolute; left: 14px; bottom: 58px; color: rgba(42,25,20,.72); font-size: 12px; font-weight: 900; pointer-events: none; }
@media (max-width: 760px) {
  .dimension-overlay { inset: 16% 10% 18% 10%; }
  .viewer-note { display: none; }
}

/* v1.4.7: projected A22-style dimension overlay, viewer-only */
.photo-stage .dimension-overlay,
.photo-stage .tile-guides { display: none !important; }
.model-holder.a22-model-holder .dimension-overlay.dimension-svg {
  position: absolute;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  opacity: .96;
  pointer-events: none;
  overflow: visible;
}
.dimension-svg .dim-main {
  stroke: rgba(42,25,20,.74);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.dimension-svg .dim-extension {
  stroke: rgba(42,25,20,.45);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}
.dimension-svg .dim-label {
  font-size: 13px;
  font-weight: 950;
  fill: #2a1914;
  paint-order: stroke;
  stroke: rgba(240,231,220,.92);
  stroke-width: 6px;
  stroke-linejoin: round;
  text-anchor: middle;
  dominant-baseline: middle;
}
.model-holder.a22-model-holder .dim-line,
.model-holder.a22-model-holder .dim-width,
.model-holder.a22-model-holder .dim-height,
.model-holder.a22-model-holder .dim-thickness { display: none !important; }

/* v1.6.0 — premium HTML hero/header + light/dark theme shell */
[hidden] { display: none !important; }

html[data-theme="dark"] {
  --color-bg: #120909;
  --color-surface: #1f1010;
  --color-surface-soft: #2a1514;
  --color-text: #f7efe6;
  --color-muted: #dac9b2;
  --color-border: rgba(247,239,230,.16);
  --color-primary: #d8b77c;
  --color-primary-hover: #f1d49a;
  --color-primary-soft: rgba(216,183,124,.14);
  --color-accent: #c8a36a;
  --color-accent-muted: #b59f82;
}
html[data-theme="dark"] body {
  font-family: Manrope, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html[data-theme="dark"] .catalog-title,
html[data-theme="dark"] .detail-title,
html[data-theme="dark"] .cart-title,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2 {
  font-family: "Poiret One", "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  font-weight: 400;
  letter-spacing: .02em;
  color: #d8b77c;
}

/* Header copied from the premium HTML direction, simplified to Catalog/Cart only */
.site-header.elite-nav {
  position: fixed;
  inset: 16px 16px auto;
  height: auto;
  min-height: 58px;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 8px 16px;
  border: 1px solid rgba(216,183,124,.22);
  border-radius: 999px;
  background: rgba(18,9,9,.68);
  color: #f7efe6;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(0,0,0,.32);
}
.site-header.elite-nav .elite-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  font-family: Manrope, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: .03em;
  color: #f7efe6;
}
.site-header.elite-nav .elite-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #c8a36a;
  border-radius: 999px;
  color: #d8b77c;
  font-family: "Poiret One", Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  background: rgba(216,183,124,.08);
  box-shadow: none;
}
.site-header.elite-nav .logo-text { font-size: 16px; line-height: 1; letter-spacing: .03em; font-weight: 800; }
.site-header.elite-nav .nav-links,
.site-header.elite-nav .nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  color: #dac9b2;
  font-size: 14px;
}
.site-header.elite-nav .premium-nav-link,
.site-header.elite-nav .nav-link {
  min-width: 0;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #dac9b2;
  box-shadow: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
  opacity: .9;
  transition: color .18s ease, opacity .18s ease, transform .18s ease;
}
.site-header.elite-nav .premium-nav-link:hover,
.site-header.elite-nav .nav-link:hover { color: #f7efe6; opacity: 1; transform: none; }
.site-header.elite-nav .premium-nav-link.active,
.site-header.elite-nav .nav-link.active { color: #d8b77c; background: transparent; border: 0; box-shadow: none; }
.site-header.elite-nav .cart-count {
  top: -12px;
  right: -18px;
  min-width: 20px;
  height: 20px;
  background: #d8b77c;
  color: #211412;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.site-header.elite-nav .menu-button,
.site-header.elite-nav .elite-burger {
  justify-self: end;
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(216,183,124,.28);
  border-radius: 999px;
  background: rgba(216,183,124,.08);
  color: #f7efe6;
  padding: 0;
}
.site-header.elite-nav .elite-burger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: currentColor;
}
.elite-mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border: 1px solid rgba(216,183,124,.22);
  border-radius: 24px;
  background: rgba(18,9,9,.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(0,0,0,.32);
}
.elite-mobile-menu.is-open { display: grid; gap: 8px; }
.elite-mobile-menu .nav-link { justify-content: flex-start; min-height: 42px; padding: 0 14px; color: #f7efe6; }

/* Premium hero copied from the uploaded HTML, with the embedded image moved to a static asset */
.premium-hero-wrap.elite-home {
  --elite-bg: #1f1010;
  --elite-bg-deep: #120909;
  --elite-bg-soft: #2a1514;
  --elite-card: #301a16;
  --elite-gold: #c8a36a;
  --elite-gold-strong: #d8b77c;
  --elite-cream: #f7efe6;
  --elite-muted: #dac9b2;
  --elite-muted-2: #b59f82;
  --elite-wood: #9c5d2e;
  --elite-wood-light: #d09a5f;
  --elite-dark-text: #211412;
  --elite-line: rgba(216,183,124,.28);
  --elite-line-soft: rgba(247,239,230,.13);
  --elite-shadow: 0 28px 90px rgba(0,0,0,.46);
  --elite-radius-xl: 34px;
  --elite-radius-lg: 24px;
  --elite-container: 1180px;
  --elite-display: "Poiret One", "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --elite-sans: "Manrope", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --elite-hero-img: url('/assets/brand/elite-hero-bg.jpg');
  margin: 0;
  background: var(--elite-bg-deep);
  color: var(--elite-cream);
  font-family: var(--elite-sans);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.premium-hero-wrap.elite-home * { box-sizing: border-box; }
.premium-hero-wrap.elite-home .container { width: min(calc(100% - 44px), var(--elite-container)); margin: 0 auto; }
.premium-hero-wrap.elite-home .hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  padding: 130px 0 76px;
  background-image: var(--elite-hero-img);
  background-size: cover;
  background-position: center;
}
.premium-hero-wrap.elite-home .hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: rgba(18,9,9,.22); }
.premium-hero-wrap.elite-home .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 42%, rgba(216,183,124,.08), transparent 30%),
    linear-gradient(90deg, rgba(18,9,9,.92) 0%, rgba(18,9,9,.50) 46%, rgba(18,9,9,.85) 100%),
    linear-gradient(180deg, rgba(18,9,9,.72), rgba(18,9,9,.14) 46%, rgba(18,9,9,.92));
}
.premium-hero-wrap.elite-home .hero .container {
  width: calc(100% - clamp(72px, calc(9vw + 30px), 190px) - 44px);
  max-width: 1460px;
  margin-left: clamp(72px, calc(9vw + 30px), 190px);
  margin-right: 44px;
}
.premium-hero-wrap.elite-home .hero-grid { display: grid; grid-template-columns: minmax(0, 920px) minmax(320px, 420px); gap: 52px; align-items: end; }
.premium-hero-wrap.elite-home .hero-grid > .reveal { max-width: 920px; }
.premium-hero-wrap.elite-home .hero-spacer { min-height: 1px; pointer-events: none; visibility: hidden; }
.premium-hero-wrap.elite-home .eyebrow {
  margin: 0 0 18px;
  color: var(--elite-gold-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.premium-hero-wrap.elite-home h1,
.premium-hero-wrap.elite-home h2,
.premium-hero-wrap.elite-home h3,
.premium-hero-wrap.elite-home p { margin-top: 0; }
.premium-hero-wrap.elite-home h1,
.premium-hero-wrap.elite-home h2,
.premium-hero-wrap.elite-home .display { font-family: var(--elite-display); font-weight: 400; color: var(--elite-gold-strong); letter-spacing: .02em; }
.premium-hero-wrap.elite-home h1 { font-size: clamp(56px, 9vw, 128px); line-height: .95; margin-bottom: 22px; text-wrap: balance; }
.premium-hero-wrap.elite-home .lead { max-width: 760px; color: var(--elite-cream); font-size: clamp(20px, 2.2vw, 28px); line-height: 1.35; margin-bottom: 32px; }
.premium-hero-wrap.elite-home .button-row { display: flex; flex-wrap: wrap; gap: 14px; }
.premium-hero-wrap.elite-home .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}
.premium-hero-wrap.elite-home .btn:hover { transform: translateY(-2px); box-shadow: 0 16px 42px rgba(0,0,0,.25); }
.premium-hero-wrap.elite-home .btn-primary { background: var(--elite-gold-strong); color: var(--elite-dark-text); }
.premium-hero-wrap.elite-home .btn-secondary { background: rgba(247,239,230,.08); color: var(--elite-cream); border-color: rgba(247,239,230,.25); }
.home-page > .container { padding-top: 64px; }

/* Theme toggle */
.theme-toggle {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 1100;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(216,183,124,.28);
  background: rgba(18,9,9,.72);
  color: #f7efe6;
  backdrop-filter: blur(16px);
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 12px 36px rgba(0,0,0,.22);
}
html[data-theme="light"] .theme-toggle { background: rgba(247,242,234,.86); color: #211412; border-color: rgba(29,28,26,.16); }

/* Dark theme: keep catalog geometry/layout from current ZIP, only recolor and change typography */
html[data-theme="dark"] .catalog-block,
html[data-theme="dark"] .cart-page,
html[data-theme="dark"] .admin-page { background: var(--color-bg); color: var(--color-text); }
html[data-theme="dark"] .toolbar { border-bottom-color: rgba(216,183,124,.42); }
html[data-theme="dark"] .kicker,
html[data-theme="dark"] .section-label { color: #d8b77c; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .card:nth-child(4n),
html[data-theme="dark"] .card:last-child { border-color: rgba(247,239,230,.13); }
html[data-theme="dark"] .image-wrap,
html[data-theme="dark"] .loading-card,
html[data-theme="dark"] .error-card,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .checkout-card,
html[data-theme="dark"] .visual,
html[data-theme="dark"] .summary,
html[data-theme="dark"] .cart-item,
html[data-theme="dark"] .admin-card {
  background: linear-gradient(180deg, rgba(247,239,230,.055), rgba(247,239,230,.025)), #1f1010;
  border-color: rgba(247,239,230,.13);
  color: var(--color-text);
}
html[data-theme="dark"] .image-wrap { background: #2a1514; }
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .price { color: #f7efe6; }
html[data-theme="dark"] .card-desc,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .description { color: #dac9b2; }
html[data-theme="dark"] .card:hover .card-title { color: #d8b77c; }
html[data-theme="dark"] .meta span,
html[data-theme="dark"] .points span,
html[data-theme="dark"] .size-choice,
html[data-theme="dark"] .material-choice,
html[data-theme="dark"] .qty-row input,
html[data-theme="dark"] .checkout-card input,
html[data-theme="dark"] .checkout-card textarea,
html[data-theme="dark"] .admin-card input,
html[data-theme="dark"] .admin-card textarea,
html[data-theme="dark"] .admin-card select {
  background: rgba(247,239,230,.06);
  border-color: rgba(247,239,230,.16);
  color: #f7efe6;
}
html[data-theme="dark"] .button,
html[data-theme="dark"] .size-choice.active,
html[data-theme="dark"] .material-choice.active {
  background: #d8b77c;
  color: #211412;
  border-color: #d8b77c;
}
html[data-theme="dark"] .wall-placeholder { color: rgba(247,239,230,.72); }
html[data-theme="dark"] .footer { background: #0d0707; color: #f7efe6; }

/* Product page: premium dark variant and reduced top chrome */
.product-page { padding-top: 112px; }
.product-detail-container { width: min(1480px, calc(100% - 72px)); }
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin: 0 0 14px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 900;
}
.back-link:hover { color: var(--color-primary); }
.product-detail-hero { margin-top: 0; }
html[data-theme="dark"] .product-page {
  background: #050505;
  color: #f7efe6;
}
html[data-theme="dark"] .product-detail-hero {
  gap: 28px;
}
html[data-theme="dark"] .product-visual,
html[data-theme="dark"] .product-summary {
  border: 1px solid rgba(247,239,230,.12);
  background: linear-gradient(180deg, rgba(247,239,230,.045), rgba(247,239,230,.02)), #090606;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 40px 120px rgba(0,0,0,.44);
}
html[data-theme="dark"] .product-visual { min-height: min(76vh, 760px); }
html[data-theme="dark"] .detail-title {
  font-size: clamp(52px, 7vw, 110px);
  line-height: .92;
  margin-bottom: 18px;
}
html[data-theme="dark"] .detail-desc { font-size: clamp(19px, 2vw, 25px); color: rgba(247,239,230,.76); }

/* Cart fix and theme polish */
.cart-page { padding-top: 112px; }
html[data-theme="dark"] .cart-item { border-bottom-color: rgba(247,239,230,.13); }
html[data-theme="dark"] .cart-thumb { background: #2a1514; }

@media (max-width: 920px) {
  .site-header.elite-nav { grid-template-columns: 1fr auto; inset: 10px 10px auto; border-radius: 28px; }
  .site-header.elite-nav .nav { display: none; }
  .site-header.elite-nav .menu-button { display: grid; place-items: center; }
  .premium-hero-wrap.elite-home .hero { padding: 112px 0 64px; }
  .premium-hero-wrap.elite-home .hero .container { width: min(calc(100% - 40px), 100%); margin-left: auto; margin-right: auto; }
  .premium-hero-wrap.elite-home .hero-grid { grid-template-columns: 1fr; }
  .premium-hero-wrap.elite-home h1 { font-size: clamp(56px, 15vw, 86px); }
  .product-detail-container { width: min(calc(100% - 40px), 100%); }
}

/* v1.6.1 — product compact dark layout + premium cart polish */
.product-page { padding-top: 88px; }
.back-link {
  min-height: 42px;
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--color-primary);
}
html[data-theme="dark"] .back-link { color: #d8b77c; }
html[data-theme="dark"] .back-link:hover { color: #f7efe6; }

html[data-theme="dark"] .product-detail-hero {
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 34px;
}
html[data-theme="dark"] .product-visual {
  height: clamp(560px, 72vh, 760px);
  min-height: 560px;
}
html[data-theme="dark"] .photo-stage { min-height: 560px; }
html[data-theme="dark"] .product-summary {
  min-height: 0;
  padding: clamp(18px, 2.2vw, 28px) clamp(28px, 3.4vw, 52px) clamp(30px, 3.8vw, 44px);
  gap: 14px;
}
html[data-theme="dark"] .detail-title {
  font-size: clamp(42px, 4.5vw, 64px);
  line-height: .98;
  margin-bottom: 8px;
}
html[data-theme="dark"] .detail-desc {
  max-width: 760px;
  font-size: clamp(14px, 1.24vw, 17px);
  line-height: 1.42;
  margin-bottom: 6px;
}
html[data-theme="dark"] .product-option-block { display: grid; gap: 10px; }
html[data-theme="dark"] .section-label {
  margin-bottom: 0;
  color: #d8b77c;
  letter-spacing: .18em;
}

/* Wood choice, copied in spirit from the uploaded premium HTML swatch cards. */
html[data-theme="dark"] .product-finishes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}
html[data-theme="dark"] .material-choice {
  width: 98px;
  min-height: 116px;
  padding: 10px 8px 12px;
  border: 1px solid rgba(247,239,230,.15);
  background: linear-gradient(180deg, rgba(247,239,230,.05), rgba(247,239,230,.025));
  display: grid;
  grid-template-rows: 46px minmax(28px, auto);
  justify-items: center;
  align-content: start;
  gap: 12px;
  color: #f7efe6;
  overflow: visible;
  transition: transform .2s ease, filter .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
html[data-theme="dark"] .material-choice:hover {
  transform: translateY(-3px);
  border-color: rgba(216,183,124,.56);
  background: linear-gradient(180deg, rgba(216,183,124,.10), rgba(216,183,124,.04));
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}
html[data-theme="dark"] .material-tile {
  display: block;
  width: 44px;
  height: 44px;
  margin-top: 2px;
  border: 1px solid rgba(216,183,124,.28);
  background: rgba(247,239,230,.06);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
html[data-theme="dark"] .material-choice img,
html[data-theme="dark"] .material-choice .material-swatch {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  box-shadow: none;
}
html[data-theme="dark"] .material-name {
  position: static;
  transform: none;
  opacity: 1;
  padding: 0;
  background: transparent;
  color: #dac9b2;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
  max-width: 100%;
}
html[data-theme="dark"] .material-choice.active {
  border-color: #d8b77c;
  background: linear-gradient(180deg, rgba(216,183,124,.98), rgba(200,163,106,.94));
  box-shadow: 0 16px 36px rgba(0,0,0,.20);
}
html[data-theme="dark"] .material-choice.active .material-tile,
html[data-theme="dark"] .material-choice:hover .material-tile {
  border-color: rgba(33,20,18,.44);
  box-shadow: 0 0 0 2px rgba(216,183,124,.16), inset 0 0 0 1px rgba(255,255,255,.05);
  transform: translateY(-1px);
}
html[data-theme="dark"] .material-choice.active .material-name { color: #211412; font-weight: 900; }

.size-choice { position: relative; overflow: visible; }
.size-choice::after {
  content: attr(data-specs);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f7efe6;
  color: #211412;
  border: 1px solid rgba(216,183,124,.28);
  font-size: 12px;
  font-weight: 900;
  z-index: 25;
  transition: opacity .18s ease, transform .18s ease;
}
.size-choice:hover::after,
.size-choice:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Cart: no red, more premium wood/gold accents, animated trash delete. */
html[data-theme="dark"] .cart-page { color: #f7efe6; }
html[data-theme="dark"] .cart-header {
  border-bottom-color: rgba(216,183,124,.48);
}
html[data-theme="dark"] .cart-title { color: #d8b77c; }
html[data-theme="dark"] .cart-list {
  border-top-color: rgba(216,183,124,.28);
}
html[data-theme="dark"] .cart-item {
  grid-template-columns: 112px 1fr 54px;
  gap: 18px;
  min-height: 134px;
  padding: 18px;
  border: 1px solid rgba(247,239,230,.13);
  border-left: 4px solid rgba(216,183,124,.55);
  background: linear-gradient(135deg, rgba(216,183,124,.07), rgba(247,239,230,.025)), #120909;
  box-shadow: 0 18px 60px rgba(0,0,0,.20);
  transform-origin: calc(100% - 28px) 50%;
}
.cart-thumb-wrap {
  width: 102px;
  height: 102px;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(247,239,230,.065);
  border: 1px solid rgba(247,239,230,.12);
}
.cart-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}
.cart-item-copy { display: grid; gap: 6px; align-content: center; }
.cart-item-copy strong { color: #f7efe6; font-size: 20px; letter-spacing: -.035em; }
.cart-item-meta { color: #d8b77c; font-weight: 850; }
.cart-item-price { color: #dac9b2; }
.remove-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216,183,124,.34);
  border-radius: 999px;
  background: rgba(216,183,124,.08);
  color: #d8b77c;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.remove-btn:hover { transform: translateY(-2px); background: rgba(216,183,124,.14); border-color: #d8b77c; }
.trash-icon { position: relative; width: 22px; height: 24px; display: block; }
.trash-lid,
.trash-bin { position: absolute; left: 50%; transform: translateX(-50%); border: 2px solid currentColor; }
.trash-lid { top: 2px; width: 20px; height: 5px; border-bottom: 0; border-radius: 3px 3px 0 0; transform-origin: 18px 6px; }
.trash-bin { bottom: 1px; width: 17px; height: 17px; border-top-width: 2px; border-radius: 0 0 4px 4px; }
.cart-item.is-removing { animation: cartItemToTrash .62s cubic-bezier(.22,.9,.18,1) forwards; }
.cart-item.is-removing .trash-lid { animation: trashLidOpen .62s ease forwards; }
.cart-item.is-removing .cart-thumb-wrap,
.cart-item.is-removing .cart-item-copy { animation: paperCrumple .62s cubic-bezier(.22,.9,.18,1) forwards; }
@keyframes trashLidOpen {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  26%, 70% { transform: translateX(-45%) rotate(-28deg); }
}
@keyframes paperCrumple {
  0% { transform: scale(1) rotate(0); opacity: 1; }
  45% { transform: scale(.62) rotate(7deg); opacity: .86; }
  100% { transform: translateX(70px) scale(.1) rotate(32deg); opacity: 0; }
}
@keyframes cartItemToTrash {
  0% { max-height: 180px; opacity: 1; }
  72% { max-height: 180px; opacity: .95; }
  100% { max-height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; opacity: 0; border-width: 0; }
}
html[data-theme="dark"] .checkout-card {
  border-left-color: #d8b77c;
  box-shadow: inset 6px 0 0 rgba(216,183,124,.18), 0 24px 70px rgba(0,0,0,.28);
}
html[data-theme="dark"] .checkout-card .button,
html[data-theme="dark"] [data-checkout-form] .button {
  background: linear-gradient(90deg, #d8b77c, #c8a36a);
  color: #211412;
  border-color: #d8b77c;
}

@media (max-width: 920px) {
  html[data-theme="dark"] .product-detail-hero { grid-template-columns: 1fr; }
  html[data-theme="dark"] .product-visual { height: 430px; }
  html[data-theme="dark"] .cart-item { grid-template-columns: 92px 1fr 46px; padding: 14px; }
  .cart-thumb-wrap { width: 86px; height: 86px; padding: 10px; }
}
.material-tile { display: block; width: 100%; height: 84px; overflow: hidden; }
.material-tile img, .material-tile .material-swatch { width: 100%; height: 100%; object-fit: cover; }


/* v1.6.2 — darker 3D viewer and smaller premium wood swatches */
html[data-theme="dark"] .model-holder.a22-model-holder {
  background:
    linear-gradient(to top, rgba(216,183,124,.10), transparent 22%),
    linear-gradient(rgba(216,183,124,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,183,124,.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.08)),
    #130b0a;
  background-size: 100% 100%, 64px 64px, 64px 64px, 100% 100%, auto;
}
html[data-theme="dark"] .model-holder.a22-model-holder::before {
  background:
    radial-gradient(circle at 50% 58%, rgba(216,183,124,.08), transparent 32%),
    linear-gradient(to bottom, rgba(255,255,255,.04), rgba(0,0,0,.14));
}
html[data-theme="dark"] .viewer-toolbar,
html[data-theme="dark"] .viewer-mode-toggle {
  background: rgba(18,9,9,.88);
  border-color: rgba(216,183,124,.26);
  box-shadow: 0 16px 36px rgba(0,0,0,.22);
}
html[data-theme="dark"] .viewer-toolbar button,
html[data-theme="dark"] .viewer-mode-toggle button {
  color: #f7efe6;
  border-right-color: rgba(216,183,124,.18);
}
html[data-theme="dark"] .viewer-toolbar button:hover,
html[data-theme="dark"] .viewer-mode-toggle button:hover {
  background: rgba(216,183,124,.10);
}
html[data-theme="dark"] .viewer-mode-toggle button.active {
  background: #d8b77c;
  color: #211412;
}
html[data-theme="dark"] .viewer-hint {
  background: rgba(18,9,9,.54);
  color: #f7efe6;
  border: 1px solid rgba(216,183,124,.18);
}
html[data-theme="dark"] .viewer-note {
  background: rgba(18,9,9,.88);
  border: 1px solid rgba(216,183,124,.26);
  color: #f7efe6;
  box-shadow: 0 16px 36px rgba(0,0,0,.22);
  backdrop-filter: blur(4px);
}
html[data-theme="dark"] .dimension-strip span {
  background: rgba(18,9,9,.84);
  border-color: rgba(216,183,124,.24);
  color: #dac9b2;
}
html[data-theme="dark"] .dimension-strip b {
  color: #f7efe6;
}
html[data-theme="dark"] .dimension-svg .dim-main {
  stroke: rgba(216,183,124,.82);
}
html[data-theme="dark"] .dimension-svg .dim-label {
  fill: #f7efe6;
  stroke: rgba(18,9,9,.96);
}
@media (max-width: 920px) {
  .product-page { padding-top: 84px; }
  html[data-theme="dark"] .product-visual { height: 520px; min-height: 520px; }
  html[data-theme="dark"] .photo-stage { min-height: 520px; }
}

/* v1.6.4 — protected A40-only admin endpoint UI */
.admin-v2-page,
.admin-v2 { padding: 40px 0 76px; }
.admin-v2-container { display: grid; gap: 18px; }
.admin-v2-header,
.admin-panel,
.admin-login-card {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 18px 50px rgba(46, 33, 20, 0.08);
}
.admin-v2-header {
  padding: clamp(22px, 3vw, 34px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}
.admin-v2-header h1,
.admin-login-card h1,
.admin-panel h2 { margin: 0; letter-spacing: -.055em; line-height: .98; }
.admin-v2-header h1 { font-size: clamp(40px, 5vw, 72px); }
.admin-login-card h1 { font-size: clamp(34px, 5vw, 56px); }
.admin-panel h2 { font-size: clamp(24px, 3vw, 34px); }
.admin-v2-header p,
.admin-login-card p,
.admin-step p,
.admin-preview-card p { color: var(--color-muted); line-height: 1.5; }
.admin-eyebrow {
  margin: 0 0 8px;
  color: var(--color-accent-muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.admin-v2-meta,
.admin-tabs,
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin-v2-meta { justify-content: flex-end; }
.admin-v2-meta span,
.admin-tabs button,
.admin-linklike {
  min-height: 38px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  padding: 0 13px;
  font-weight: 950;
  font-size: 13px;
}
.admin-tabs button.active { background: var(--color-primary); color: var(--color-surface); border-color: var(--color-primary); }
.admin-linklike { cursor: pointer; }
.admin-alert { min-height: 22px; margin: 0; font-weight: 900; color: var(--color-muted); }
.admin-alert[data-tone="success"] { color: #16871c; }
.admin-alert[data-tone="error"] { color: var(--color-danger); }
.admin-login { min-height: calc(100vh - 180px); display: grid; place-items: center; }
.admin-login-card { width: min(520px, calc(100vw - 36px)); padding: clamp(22px, 4vw, 38px); display: grid; gap: 14px; }
.admin-wizard { display: grid; gap: 18px; }
.admin-panel { padding: clamp(18px, 3vw, 28px); display: grid; gap: 18px; }
.admin-form { display: grid; gap: 16px; }
.admin-form label,
.admin-control,
.admin-size-row label {
  display: grid;
  gap: 7px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 900;
}
.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-control input[type="number"] {
  width: 100%;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
  padding: 12px 13px;
  outline: none;
  font: inherit;
}
.admin-form input:disabled { opacity: .68; cursor: not-allowed; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}
.admin-step:first-child { border-top: 0; padding-top: 0; }
.admin-step > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: var(--color-surface);
  border-radius: 999px;
  font-weight: 950;
}
.admin-step h2,
.admin-step p { margin: 0; }
.admin-calculator-layout { display: grid; grid-template-columns: minmax(280px, 430px) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.admin-controls { display: grid; gap: 12px; }
.admin-control {
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  padding: 13px;
}
.admin-control > span { display: flex; justify-content: space-between; gap: 12px; color: var(--color-text); }
.admin-control output { color: var(--color-accent-muted); font-weight: 950; }
.admin-control input[type="range"] { width: 100%; accent-color: var(--color-primary); }
.admin-control small { color: var(--color-muted); line-height: 1.35; }
.admin-checkbox { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.admin-checkbox small { grid-column: 1 / -1; }
.admin-checkbox input { width: 22px; height: 22px; }
.admin-preview-card { border: 1px solid var(--color-border); background: var(--color-surface-soft); padding: 14px; display: grid; gap: 10px; }
.admin-viewer { position: relative; min-height: 520px; background: var(--color-surface); overflow: hidden; border: 1px solid var(--color-border); }
.admin-viewer .viewer-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.admin-size-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.admin-size-row { border: 1px solid var(--color-border); margin: 0; padding: 14px; display: grid; gap: 10px; background: var(--color-surface-soft); }
.admin-size-row legend { padding: 0 8px; color: var(--color-primary); font-weight: 950; }
.admin-inline-check { display: inline-flex !important; grid-auto-flow: column; justify-content: start; align-items: center; }
.admin-inline-check input { width: auto; }
.admin-wood-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 12px; }
.admin-wood-choice {
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  padding: 10px;
  display: grid;
  gap: 7px;
  cursor: pointer;
}
.admin-wood-choice input { width: auto; }
.admin-wood-choice span { aspect-ratio: 1.35; display: grid; place-items: center; background: var(--tone, #c99655); overflow: hidden; }
.admin-wood-choice img { width: 100%; height: 100%; object-fit: cover; }
.admin-wood-choice b { color: var(--color-text); }
.admin-wood-choice:has(input:checked) { border-color: var(--color-primary); box-shadow: inset 0 0 0 2px var(--color-primary); }
.admin-photo-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-photo-preview > div { min-height: 170px; display: grid; place-items: center; border: 1px dashed var(--color-border); background: var(--color-surface-soft); color: var(--color-muted); font-weight: 900; }
.admin-photo-preview img { width: 100%; height: 100%; max-height: 240px; object-fit: contain; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th,
.admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.admin-table th { color: var(--color-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.admin-shape-list { display: grid; gap: 10px; }
.admin-shape-list details { border: 1px solid var(--color-border); background: var(--color-surface-soft); padding: 12px; }
.admin-shape-list summary { cursor: pointer; }
.admin-shape-list pre { overflow-x: auto; font-size: 12px; white-space: pre-wrap; }

html[data-theme="dark"] .admin-v2-header,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-login-card,
html[data-theme="dark"] .admin-control,
html[data-theme="dark"] .admin-preview-card,
html[data-theme="dark"] .admin-size-row,
html[data-theme="dark"] .admin-wood-choice,
html[data-theme="dark"] .admin-photo-preview > div,
html[data-theme="dark"] .admin-shape-list details,
html[data-theme="dark"] .admin-viewer {
  background: linear-gradient(180deg, rgba(247,239,230,.055), rgba(247,239,230,.025)), #1f1010;
  border-color: rgba(247,239,230,.13);
  color: var(--color-text);
}
html[data-theme="dark"] .admin-form input,
html[data-theme="dark"] .admin-form textarea,
html[data-theme="dark"] .admin-form select,
html[data-theme="dark"] .admin-control input[type="number"],
html[data-theme="dark"] .admin-v2-meta span,
html[data-theme="dark"] .admin-tabs button,
html[data-theme="dark"] .admin-linklike {
  background: rgba(247,239,230,.06);
  border-color: rgba(247,239,230,.16);
  color: #f7efe6;
}
html[data-theme="dark"] .admin-tabs button.active { background: #d8b77c; color: #211412; border-color: #d8b77c; }

@media (max-width: 1100px) {
  .admin-v2-header,
  .admin-calculator-layout,
  .admin-form-grid,
  .admin-size-grid,
  .admin-photo-preview { grid-template-columns: 1fr; }
  .admin-v2-meta { justify-content: flex-start; }
  .admin-viewer { min-height: 440px; }
}

/* v1.6.6 A22-like protected admin shell */
.admin3-shell,
.admin3-login,
.admin3-loading {
  min-height: 100vh;
  background: #f6efe4;
  color: #24190f;
}

.admin3-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.admin3-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(55, 39, 23, 0.12);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  z-index: 20;
}

.admin3-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #24190f;
  font-weight: 950;
}

.admin3-logo span {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--color-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 950;
}

.admin3-nav {
  display: grid;
  gap: 8px;
}

.admin3-nav-link {
  min-height: 48px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #4b3b2c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
  font: inherit;
  font-weight: 900;
}

.admin3-nav-link small {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(55, 39, 23, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: #6d5844;
  font-size: 12px;
}

.admin3-nav-link:hover,
.admin3-nav-link.active {
  background: rgba(22, 135, 28, 0.1);
  color: var(--color-primary);
}

.admin3-nav-link.active small {
  background: var(--color-primary);
  color: #fff;
}

.admin3-userbox {
  margin-top: auto;
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(55, 39, 23, 0.12);
  padding-top: 18px;
}

.admin3-userbox p {
  margin: 0;
  color: #4b3b2c;
  font-size: 13px;
  font-weight: 850;
}

.admin3-userbox button,
.admin3-button {
  min-height: 42px;
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font: inherit;
  font-weight: 950;
  text-decoration: none;
}

.admin3-userbox button,
.admin3-button.secondary {
  background: #fff;
  color: var(--color-primary);
  border-color: rgba(22, 135, 28, 0.24);
}

.admin3-main {
  min-width: 0;
  padding: 28px;
}

.admin3-page {
  display: grid;
  gap: 20px;
}

.admin3-header,
.admin3-panel,
.admin3-toolbar,
.admin3-drawer,
.admin3-login-card {
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 50px rgba(46, 33, 20, 0.08);
}

.admin3-header {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.admin3-eyebrow {
  margin: 0 0 6px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin3-header h1,
.admin3-login-card h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  letter-spacing: -.055em;
  line-height: .96;
}

.admin3-header p,
.admin3-login-card p {
  max-width: 820px;
  margin: 10px 0 0;
  color: #715c47;
  line-height: 1.5;
}

.admin3-panel {
  padding: 20px;
}

.admin3-panel h2,
.admin3-drawer h2,
.admin3-drawer h3 {
  margin: 0 0 14px;
  letter-spacing: -.035em;
}

.admin3-alert {
  min-height: 0;
  margin: 0;
  border-radius: 16px;
  color: #4b3b2c;
  font-weight: 900;
}

.admin3-alert:not(:empty) {
  padding: 12px 14px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(55, 39, 23, 0.12);
}

.admin3-alert[data-tone="success"] {
  color: var(--color-primary);
}

.admin3-alert[data-tone="error"] {
  color: #b42318;
}

.admin3-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 16px;
}

.admin3-toolbar label,
.admin3-form label,
.admin3-login-card label {
  display: grid;
  gap: 7px;
  color: #463523;
  font-size: 13px;
  font-weight: 850;
}

.admin3-toolbar span {
  color: #715c47;
  font-size: 13px;
  font-weight: 850;
  margin-left: auto;
  padding-bottom: 11px;
}

.admin3-toolbar input,
.admin3-toolbar select,
.admin3-form input,
.admin3-form select,
.admin3-form textarea,
.admin3-login-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(55, 39, 23, 0.18);
  border-radius: 14px;
  background: #fff;
  color: #22170d;
  font: inherit;
  padding: 10px 12px;
  outline: none;
  color-scheme: light;
}

.admin3-toolbar select option,
.admin3-form select option {
  background: #fff;
  color: #22170d;
}

.admin3-toolbar input:focus,
.admin3-toolbar select:focus,
.admin3-form input:focus,
.admin3-form select:focus,
.admin3-form textarea:focus,
.admin3-login-card input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(22, 135, 28, 0.10);
}

.admin3-form textarea {
  min-height: 100px;
  resize: vertical;
}

.admin3-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin3-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 10px 0 16px;
  padding-top: 8px;
}

.admin3-step span {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--color-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 950;
}

.admin3-step h2 {
  margin: 0;
  letter-spacing: -.04em;
}

.admin3-step p,
.admin3-muted {
  margin: 5px 0 0;
  color: #715c47;
  line-height: 1.5;
}

.admin3-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 18px;
}

.admin3-column {
  min-width: 260px;
  min-height: 430px;
  max-height: calc(100vh - 260px);
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 22px;
  background: rgba(255,255,255,.58);
  display: flex;
  flex-direction: column;
}

.admin3-column header {
  border-bottom: 1px solid rgba(55, 39, 23, 0.12);
  padding: 16px;
}

.admin3-column header div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin3-column h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
}

.admin3-column header p {
  margin: 8px 0 0;
  color: #715c47;
  font-size: 12px;
  line-height: 1.35;
}

.admin3-column header span {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(22, 135, 28, .10);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 950;
}

.admin3-cards {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding: 12px;
}

.admin3-order-card {
  width: 100%;
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 18px;
  background: #fff;
  color: inherit;
  cursor: grab;
  display: grid;
  gap: 10px;
  padding: 14px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.admin3-order-card:hover,
.admin3-order-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.admin3-order-card div,
.admin3-order-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.admin3-order-card h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.admin3-order-card strong {
  color: var(--color-primary);
  white-space: nowrap;
}

.admin3-order-card p {
  color: #715c47;
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.admin3-order-card .phone {
  color: #24190f;
  font-weight: 850;
}

.admin3-order-card footer {
  color: #715c47;
  font-size: 12px;
  font-weight: 850;
}

.admin3-empty {
  color: #715c47;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px;
}

.admin3-column[data-drop-status] {
  outline-offset: -5px;
}

.admin3-column[data-drop-status]:has(.admin3-order-card:active),
.admin3-column[data-drop-status]:hover {
  outline: 1px dashed rgba(22, 135, 28, 0.25);
}

.admin3-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(460px, calc(100vw - 36px));
  z-index: 60;
  padding: 22px;
  overflow: auto;
}

.admin3-drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(55, 39, 23, .08);
  color: #24190f;
  cursor: pointer;
  font-size: 24px;
}

.admin3-drawer dl {
  display: grid;
  grid-template-columns: 100px minmax(0,1fr);
  gap: 9px 12px;
  margin: 18px 0;
}

.admin3-drawer dt {
  color: #715c47;
  font-weight: 850;
}

.admin3-drawer dd {
  margin: 0;
  font-weight: 900;
}

.admin3-drawer-items {
  display: grid;
  gap: 10px;
}

.admin3-drawer-items div {
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.admin3-drawer-items span {
  color: #715c47;
  font-size: 13px;
}

.admin3-table-wrap {
  overflow-x: auto;
}

.admin3-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin3-table th,
.admin3-table td {
  border-bottom: 1px solid rgba(55, 39, 23, 0.1);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.admin3-table th {
  color: #715c47;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.admin3-table small {
  display: block;
  margin-top: 4px;
  color: #715c47;
}

.admin3-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(22, 135, 28, .12);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 950;
}

.admin3-badge.muted {
  background: rgba(80, 60, 40, .09);
  color: #715c47;
}

.admin3-calculator-layout {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(440px, 1.22fr);
  gap: 18px;
  align-items: stretch;
  margin: 14px 0 22px;
}

.admin3-controls {
  display: grid;
  gap: 10px;
}

.admin3-control {
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.admin3-control.is-hidden {
  display: none;
}

.admin3-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #24190f;
}

.admin3-control output {
  color: var(--color-primary);
  font-weight: 950;
  white-space: nowrap;
}

.admin3-control input[type="range"] {
  padding: 0;
  min-height: 30px;
}

.admin3-control small {
  color: #715c47;
  line-height: 1.35;
}

.admin3-checkbox {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.admin3-checkbox small {
  grid-column: 1 / -1;
}

.admin3-checkbox input {
  width: 22px;
  height: 22px;
  min-height: 22px;
}

.admin3-preview-card {
  min-height: 560px;
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 24px;
  background: #fff;
  overflow: hidden;
  position: sticky;
  top: 24px;
}

.admin3-viewer,
.admin-viewer.model-holder,
.admin3-viewer.model-holder {
  position: relative !important;
  inset: auto !important;
  min-height: 560px;
  width: 100%;
  height: 100%;
  opacity: 1 !important;
  pointer-events: auto !important;
  overflow: hidden;
  background: var(--color-surface);
}

.admin3-viewer .tile-webgl-canvas,
.admin-viewer .tile-webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.admin3-size-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin3-size-row {
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.admin3-size-row legend {
  padding: 0 6px;
  font-weight: 950;
  color: var(--color-primary);
}

.admin3-inline-check,
.admin3-inline-check input {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  width: auto !important;
  min-height: auto !important;
}

.admin3-wood-picker,
.admin3-wood-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.admin3-wood-choice,
.admin3-wood-list article {
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.admin3-wood-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin3-wood-choice span,
.admin3-wood-list img {
  height: 86px;
  border-radius: 13px;
  background: var(--tone, #c99655);
  overflow: hidden;
  border: 1px solid rgba(55, 39, 23, 0.10);
}

.admin3-wood-choice img,
.admin3-wood-list img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin3-wood-choice:has(input:checked) {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22, 135, 28, .12);
}

.admin3-wood-choice b,
.admin3-wood-list b {
  font-size: 14px;
}

.admin3-wood-choice small,
.admin3-wood-list small {
  color: #715c47;
  font-weight: 850;
}

.admin3-photo-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.admin3-photo-preview div {
  min-height: 160px;
  border: 1px dashed rgba(55, 39, 23, 0.22);
  border-radius: 18px;
  background: rgba(255,255,255,.58);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #715c47;
  font-weight: 850;
}

.admin3-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin3-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.admin3-shape-list {
  display: grid;
  gap: 10px;
}

.admin3-shape-list details {
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
}

.admin3-shape-list summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin3-shape-list small {
  color: #715c47;
}

.admin3-shape-list pre {
  overflow-x: auto;
  background: #f6efe4;
  border-radius: 14px;
  padding: 12px;
}

.admin3-login,
.admin3-loading {
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin3-login-card {
  width: min(460px, 100%);
  padding: 24px;
  display: grid;
  gap: 14px;
}

.admin3-loading {
  font-weight: 950;
  color: var(--color-primary);
}

@media (max-width: 1180px) {
  .admin3-calculator-layout,
  .admin3-form-grid,
  .admin3-size-grid {
    grid-template-columns: 1fr;
  }
  .admin3-preview-card { position: relative; top: auto; }
}

@media (max-width: 900px) {
  .admin3-shell {
    grid-template-columns: 1fr;
  }
  .admin3-sidebar {
    position: static;
    height: auto;
  }
  .admin3-nav {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .admin3-main { padding: 16px; }
  .admin3-header,
  .admin3-toolbar { flex-direction: column; align-items: stretch; }
  .admin3-toolbar span { margin-left: 0; }
  .admin3-photo-preview { grid-template-columns: 1fr; }
}

/* v1.6.7 — admin product/wood editing, stable 3D texture preview */
.admin3-mini-button {
  min-height: 34px;
  border: 1px solid rgba(55, 39, 23, 0.16);
  border-radius: 999px;
  background: #fffaf2;
  color: #24190f;
  cursor: pointer;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.admin3-mini-button:hover { border-color: var(--color-primary); color: var(--color-primary); }
.admin3-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 1px solid rgba(55, 39, 23, 0.12);
  padding-bottom: 16px;
}
.admin3-editor-head h2 { margin: 0; }
.admin3-editor-head p { margin: 4px 0 0; color: #7a6550; }
.admin3-preview-card { align-content: start; }
.admin3-preview-woods {
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.admin3-preview-woods h3 { margin: 0; font-size: 16px; }
.admin3-preview-woods p { margin: 0; color: #7a6550; font-size: 12px; font-weight: 800; }
.admin3-preview-wood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.admin3-preview-wood {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(55, 39, 23, 0.14);
  border-radius: 14px;
  background: #fffaf2;
  padding: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  color: #24190f;
}
.admin3-preview-wood input { width: auto; margin: 0; }
.admin3-preview-wood span {
  display: block;
  aspect-ratio: 1.25;
  border-radius: 10px;
  overflow: hidden;
  background: var(--tone, #c99655);
}
.admin3-preview-wood img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin3-preview-wood:has(input:checked),
.admin3-preview-wood.is-active {
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 2px rgba(22, 135, 28, 0.26);
}
.admin3-wood-list article { position: relative; }
.admin3-wood-list .admin3-mini-button { margin-top: 4px; }
.admin3-param-table td:first-child small { display: block; margin-top: 4px; color: #7a6550; font-size: 11px; }
.admin3-shape-help p { margin: 0; color: #5c4a38; line-height: 1.55; }
.admin3-form h3 {
  margin: 4px 0 0;
  color: #24190f;
  letter-spacing: -.02em;
}
.admin3-form input[type="file"] {
  background: #fffaf2;
  color: #24190f;
}
.admin3-form select,
.admin3-toolbar select,
.admin3-form select option,
.admin3-toolbar select option {
  background: #fffaf2 !important;
  color: #24190f !important;
}
@media (max-width: 920px) {
  .admin3-editor-head { flex-direction: column; }
  .admin3-preview-wood-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v1.6.8 — richer admin media previews, persistent admin tab, product model editor */
.admin3-current-media-grid,
.admin3-texture-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}
.admin3-media-card {
  border: 1px solid rgba(55, 39, 23, 0.12);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.admin3-media-card > div {
  display: grid;
  gap: 4px;
}
.admin3-media-card span {
  color: #24190f;
  font-size: 13px;
  font-weight: 950;
}
.admin3-media-card small {
  color: #7a6550;
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.admin3-media-card figure {
  min-height: 138px;
  margin: 0;
  border: 1px solid rgba(55, 39, 23, 0.10);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,0,0,.035), rgba(255,255,255,.55));
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #7a6550;
  font-size: 12px;
  font-weight: 900;
}
.admin3-media-card img {
  width: 100%;
  height: 100%;
  min-height: 138px;
  object-fit: cover;
  display: block;
}
.admin3-media-status {
  display: none;
  border-radius: 12px;
  background: rgba(180, 35, 24, 0.10);
  color: #b42318;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}
.admin3-media-card.is-broken {
  border-color: rgba(180, 35, 24, 0.35);
}
.admin3-media-card.is-broken .admin3-media-status {
  display: block;
}
.admin3-media-card.is-empty figure {
  border-style: dashed;
}
.admin3-texture-file input {
  font-size: 12px;
}
.admin3-confirm-check {
  display: inline-flex !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: fit-content;
  border: 1px solid rgba(180, 103, 24, 0.22);
  border-radius: 16px;
  background: #fff6e8;
  padding: 10px 12px;
  margin: 4px 0 10px;
  color: #5b3a16 !important;
}
.admin3-confirm-check input {
  width: 20px !important;
  min-height: 20px !important;
  margin: 0;
}
.admin3-calculator-layout.is-editor {
  grid-template-columns: minmax(300px, .82fr) minmax(420px, 1.18fr);
}
.admin3-size-row small {
  color: #7a6550;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

/* v1.6.9 — admin modal notifications and reliable media preview */
.admin3-notice {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 11, 7, .42);
  backdrop-filter: blur(8px);
}
.admin3-notice-card {
  width: min(440px, 100%);
  border-radius: 24px;
  background: #fffdf7;
  border: 1px solid rgba(55, 39, 23, .16);
  box-shadow: 0 30px 80px rgba(0,0,0,.24);
  padding: 22px;
  display: grid;
  gap: 12px;
  color: #24190f;
}
.admin3-notice-card b {
  font-size: 24px;
  letter-spacing: -.04em;
}
.admin3-notice-card p {
  margin: 0;
  color: #5d4a38;
  font-weight: 800;
  line-height: 1.45;
}
.admin3-notice-error .admin3-notice-card {
  border-color: rgba(180, 35, 24, .35);
}
.admin3-notice-error .admin3-notice-card b {
  color: #b42318;
}
.admin3-texture-file img {
  object-fit: contain;
  background: #f6efe2;
}
