/* vesto form — premium consumer skin */
:root {
  --ivory: #faf8f4;
  --paper: #ffffff;
  --ink: #221f1b;
  --soft: #6f6a62;
  --hair: #e7e1d6;
  --brass: #a3835a;
  --brass-dark: #87683f;
  --select: #2f6fed;
  --ok: #2e7d32;
  --danger: #b3402f;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  background: var(--ivory); color: var(--ink);
  display: flex; flex-direction: column; overflow: hidden;
}
button { font-family: inherit; }

/* ---------- nav ---------- */
#vf-nav {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px; border-bottom: 1px solid var(--hair); background: var(--ivory);
}
.wordmark {
  font-size: 24px; letter-spacing: 6px; text-transform: lowercase; cursor: pointer;
  font-weight: 400;
}
.wordmark em { font-style: italic; color: var(--brass); }
#vf-nav nav { display: flex; gap: 28px; align-items: center; }
.nav-link {
  background: none; border: none; cursor: pointer; font-size: 13.5px;
  letter-spacing: 2.5px; text-transform: lowercase; color: var(--soft); padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.nav-link.active, .nav-link:hover { color: var(--ink); border-bottom-color: var(--brass); }
.cart-badge {
  display: inline-block; min-width: 20px; text-align: center; margin-left: 4px;
  background: var(--brass); color: #fff; border-radius: 50%;
  font-size: 11px; padding: 2px 4px; font-family: Arial, sans-serif;
}

/* ---------- views ---------- */
.vf-view { display: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.vf-view.active { display: block; }
#view-studio.active { display: flex; flex-direction: column; overflow: hidden; }

/* ---------- closets view ---------- */
.hero { text-align: center; padding: 56px 24px 30px; }
.hero h1 { font-size: 42px; font-weight: 400; margin: 0 0 12px; letter-spacing: .5px; }
.hero p { color: var(--soft); font-size: 16.5px; max-width: 520px; margin: 0 auto; line-height: 1.6; }
.closet-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px; padding: 26px 48px 64px; max-width: 1180px; margin: 0 auto;
}
.closet-card {
  background: var(--paper); border: 1px solid var(--hair); border-radius: 10px;
  padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 1px 2px #0000000a; transition: box-shadow .15s ease;
}
.closet-card:hover { box-shadow: 0 8px 28px #00000014; }
.closet-card h3 { margin: 0; font-size: 19px; font-weight: 500; }
.closet-card .meta { color: var(--soft); font-size: 12.5px; line-height: 1.6; }
.closet-card .price { font-size: 17px; color: var(--brass-dark); margin-top: 4px; }
.closet-card .card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.closet-card.new-card {
  align-items: center; justify-content: center; min-height: 170px; cursor: pointer;
  border-style: dashed; color: var(--soft); font-size: 15px; gap: 10px;
}
.closet-card.new-card:hover { color: var(--brass-dark); border-color: var(--brass); }
.closet-card.new-card .plus { font-size: 34px; line-height: 1; color: var(--brass); }

.btn {
  border: 1px solid var(--hair); background: var(--paper); border-radius: 6px;
  padding: 7px 16px; cursor: pointer; font-size: 13px; letter-spacing: .5px; color: var(--ink);
}
.btn:hover { border-color: var(--brass); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.btn.primary:hover { background: #000; }
.btn.big { padding: 13px 26px; font-size: 15px; width: 100%; margin-top: 16px; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.link { background: none; border: none; cursor: pointer; color: var(--brass-dark); font-size: 12.5px; text-decoration: underline; }
.link.danger { color: var(--danger); }

/* ---------- studio ---------- */
#studio-layout { display: flex; flex: 1 1 auto; min-height: 0; }
#palette { width: 270px; flex: 0 0 auto; background: var(--paper); border-right: 1px solid var(--hair); overflow-y: auto; }
.pal-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--hair); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.pal-head #studio-closet-name { display: block; font-size: 16px; font-weight: 600; }
.pal-sub { font-size: 11px; color: var(--soft); letter-spacing: 1px; }
.pal-group { border-bottom: 1px solid var(--hair); }
.pal-group > summary {
  cursor: pointer; padding: 10px 16px; font-size: 13px; letter-spacing: 1.5px;
  text-transform: lowercase; color: var(--soft); list-style: none;
  display: flex; justify-content: space-between;
}
.pal-group > summary::after { content: "+"; color: var(--brass); }
.pal-group[open] > summary::after { content: "–"; }
.pal-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 16px 8px 8px; cursor: pointer;
}
.pal-icon {
  flex: 0 0 28px; width: 28px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.pal-icon-svg { width: 24px; height: 28px; display: block; }
.pal-text { flex: 1 1 auto; min-width: 0; }
.pal-item:hover { background: #f6f1e8; }
.pal-item .p-name { font-size: 13.5px; }
.pal-item .p-dim { color: var(--soft); font-size: 11px; margin-top: 1px; }
.pal-item .p-price { color: var(--brass-dark); font-size: 13.5px; white-space: nowrap; }

#stage { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; position: relative; background: #fdfcfa; }
#view-tabs {
  display: flex; gap: 6px; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--hair); flex: 0 0 auto; background: var(--ivory);
}
.tab {
  border: 1px solid var(--hair); background: var(--paper); padding: 6px 18px;
  border-radius: 18px; cursor: pointer; font-size: 13px; letter-spacing: 1px; color: var(--soft);
}
.tab.active { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.room-controls { margin-left: auto; font-size: 12px; color: var(--soft); display: flex; gap: 8px; align-items: center; }
.room-controls input { width: 52px; padding: 3px 5px; border: 1px solid var(--hair); border-radius: 4px; background: var(--paper); font-family: inherit; }
.styled-contents-toggle {
  font-size: 12px; color: var(--soft); display: flex; gap: 6px; align-items: center;
  cursor: pointer; user-select: none; white-space: nowrap; letter-spacing: 0.3px;
}
.styled-contents-toggle input { width: auto; margin: 0; cursor: pointer; }
.rc-unit { font-size: 10.5px; letter-spacing: 1px; }
.view { display: none; flex: 1 1 auto; min-height: 0; position: relative; }
.view.active { display: block; }
#view2d-wrap { background: #fdfcfa; overflow: auto; }
#view2d { display: block; width: 100%; height: 100%; }
#view3d-wrap { background: #eceae4; }
#view3d { width: 100%; height: 100%; display: block; }
#view3d-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11.5px; color: #00000077; background: #ffffffd5; padding: 4px 14px; border-radius: 12px;
  pointer-events: none; font-style: italic;
}

/* wall selector (bottom-right of each view) */
.wall-selector {
  position: absolute; bottom: 12px; right: 12px; z-index: 5;
  display: flex; align-items: center; gap: 2px;
  background: #fffefbee; border: 1px solid #e0d8c8; border-radius: 12px;
  padding: 3px 5px; box-shadow: 0 1px 6px #00000022;
  font-size: 11.5px; font-family: Georgia, serif;
}
.wall-selector .ws-label { color: #a59a86; padding: 0 7px 0 5px; font-style: italic; }
.wall-selector button {
  border: 0; background: transparent; border-radius: 9px; padding: 4px 11px;
  cursor: pointer; color: #6f6a62; font: inherit; line-height: 1;
}
.wall-selector button:hover { background: #00000010; }
.wall-selector button.active { background: var(--select); color: #fff; }

/* 2D svg styles (shared class names with the engine) */
.dim-line, .dim-tick { stroke: #b3402f; stroke-width: 1; fill: none; }
.dim-text { fill: #b3402f; font-size: 11px; font-family: Georgia, serif; }
.sect-outline { stroke: #38332c; fill: #fff; stroke-width: 1.5; }
.sect-outline.selected { stroke: var(--select); stroke-width: 2.5; }
.panel-edge { stroke: #5c564c; stroke-width: .75; fill: #f3efe7; }
.shelf-line { stroke: #4a443b; stroke-width: 2; }
.shelf-line.shoe-back { stroke: #9a948a; stroke-width: 1; }
.rod-line { stroke: #999; stroke-width: 3; stroke-linecap: round; }
.drawer-box { fill: #faf6ee; stroke: #4a443b; stroke-width: 1; }
.sku-label { font-size: 10.5px; font-family: Georgia, serif; fill: #6f6a62; text-anchor: middle; font-style: italic; }
.click-target { fill: transparent; cursor: grab; touch-action: none; }
.click-target:hover { fill: #2f6fed11; }
.acc-target { fill: transparent; cursor: grab; touch-action: none; }
.acc-target:hover { fill: #2f6fed18; }
.sect-dragging { opacity: 0.65; }
.acc-dragging .shelf-line, .acc-dragging .rod-line { stroke: var(--select); }
.acc-dragging .drawer-box { stroke: var(--select); }
.acc-removing .shelf-line, .acc-removing .rod-line { stroke: #b3402f; stroke-dasharray: 4 3; }
.acc-removing .drawer-box { stroke: #b3402f; stroke-dasharray: 4 3; }
.acc-removing { opacity: 0.55; }
.drag-hint { font-size: 13px; font-family: Georgia, serif; fill: #b3402f; font-weight: 700; text-anchor: middle; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
#view3d { cursor: grab; }

#toast {
  position: absolute; top: 58px; left: 50%; transform: translateX(-50%);
  background: #221f1bee; color: #faf8f4; padding: 9px 18px; border-radius: 8px;
  font-size: 13px; display: none; z-index: 30; max-width: 72%;
}
#toast.show { display: block; }
#toast.err { background: #8d3225ee; }

#studio-side { width: 320px; flex: 0 0 auto; background: var(--paper); border-left: 1px solid var(--hair); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.side-card { border-bottom: 1px solid var(--hair); }
.side-title {
  font-size: 11.5px; letter-spacing: 2px; text-transform: lowercase; color: var(--brass-dark);
  padding: 12px 16px 8px;
}
#inspector-body, #mini-summary-body { padding: 4px 16px 14px; }
.empty { color: var(--soft); font-size: 13px; font-style: italic; padding: 8px 0 12px; }
.insp-head { margin-bottom: 4px; }
.insp-head .sku { font-size: 16px; font-weight: 600; display: block; }
.insp-head .dims { font-size: 12px; color: var(--soft); }
.insp-btns { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.insp-btns button {
  font-size: 12px; padding: 5px 10px; border: 1px solid var(--hair); background: var(--ivory);
  border-radius: 5px; cursor: pointer;
}
.insp-btns button:hover { border-color: var(--brass); }
.insp-btns button.danger { color: var(--danger); }
.acc-list { display: flex; flex-direction: column; gap: 5px; }
.acc-row {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  border: 1px solid var(--hair); border-radius: 6px; padding: 5px 9px; background: #fdfcfa;
}
.acc-row .a-sku { flex: 1; }
.acc-row .a-pos { color: var(--soft); font-size: 11px; white-space: nowrap; }
.acc-row .tag-incl { font-size: 9.5px; background: #edf3ec; color: var(--ok); border-radius: 3px; padding: 1px 6px; letter-spacing: .5px; }
.acc-row button { border: none; background: none; cursor: pointer; font-size: 13px; color: var(--soft); padding: 1px 3px; }
.acc-row button:hover { color: var(--ink); }
.acc-row button.del:hover { color: var(--danger); }
.acc-row.acc-removed { background: #f5f3ef; border-style: dashed; opacity: .75; }
.acc-row.acc-removed .a-sku { color: var(--soft); text-decoration: line-through; }
.acc-row.acc-removed .a-pos { font-style: italic; }
.insp-sub { font-size: 10.5px; text-transform: lowercase; letter-spacing: 1.5px; color: var(--soft); margin: 12px 0 6px; }

.mini-rows { font-size: 13px; }
.mini-rows .mr { display: flex; justify-content: space-between; padding: 3px 0; color: var(--soft); }
.mini-rows .mr b { color: var(--ink); font-weight: 500; }
.mini-total { display: flex; justify-content: space-between; border-top: 1px solid var(--hair); margin-top: 8px; padding-top: 8px; font-size: 15px; }
.mini-total .amt { color: var(--brass-dark); }
#mini-summary .btn { margin-top: 12px; width: 100%; }

/* ---------- cart ---------- */
.cart-wrap { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }
.cart-title { font-weight: 400; font-size: 32px; margin: 0 0 24px; }
.cart-empty { text-align: center; padding: 60px 0; color: var(--soft); }
.cart-empty .sub { font-size: 13.5px; }
.cart-empty .btn { margin-top: 16px; }
.cart-group { background: var(--paper); border: 1px solid var(--hair); border-radius: 10px; padding: 18px 22px; margin-bottom: 18px; }
.cart-group-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--hair); padding-bottom: 10px; margin-bottom: 6px; }
.cart-group-head h3 { margin: 0; font-size: 18px; font-weight: 500; }
.cart-group-actions { display: flex; gap: 12px; }
.cart-line { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--hair); }
.cart-line:last-child { border-bottom: none; }
.cart-line .cl-name { flex: 1; font-size: 14.5px; }
.cart-line .cl-dims { display: block; font-size: 11.5px; color: var(--soft); }
.cart-line .cl-qty { color: var(--soft); font-size: 13px; }
.cart-line .cl-price { min-width: 84px; text-align: right; font-size: 14.5px; }
.cart-line.subtotal { border-top: 1px solid var(--hair); margin-top: 4px; }
.cart-line.subtotal .cl-name { font-style: italic; color: var(--soft); }
.cart-totals { background: var(--paper); border: 1px solid var(--hair); border-radius: 10px; padding: 18px 22px; }
.ct-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 15px; }
.ct-row.grand { border-top: 1px solid var(--ink); margin-top: 8px; padding-top: 12px; font-size: 19px; }
.ct-note { font-size: 12px; color: var(--soft); margin-top: 10px; line-height: 1.5; }
.install-opt {
  display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 6px;
  padding: 12px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  cursor: pointer; font-size: 14px;
}
.install-opt input { margin-top: 3px; accent-color: var(--brass-dark); }
.install-copy { display: flex; flex-direction: column; gap: 3px; }
.install-title { font-weight: 500; color: var(--ink); }
.install-sub { font-size: 12.5px; color: var(--soft); line-height: 1.45; }
.checkout { background: var(--paper); border: 1px solid var(--hair); border-radius: 10px; padding: 22px; margin-top: 18px; }
.checkout h3 { margin: 0 0 14px; font-weight: 500; }
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.co-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--soft); letter-spacing: .5px; }
.co-grid input {
  border: 1px solid var(--hair); border-radius: 6px; padding: 9px 10px; font-size: 14px;
  font-family: inherit; background: var(--ivory);
}
.co-grid input:focus { outline: none; border-color: var(--brass); }
.postal-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.postal-msg.ok { color: var(--ok); }
.postal-msg.err { color: var(--danger); }

.confirm { text-align: center; background: var(--paper); border: 1px solid var(--hair); border-radius: 10px; padding: 48px 32px; }
.confirm-mark {
  width: 54px; height: 54px; border-radius: 50%; background: var(--brass); color: #fff;
  font-size: 28px; line-height: 54px; margin: 0 auto 14px;
}
.confirm h2 { font-weight: 400; margin: 0 0 6px; }
.confirm .ref { color: var(--soft); }
.confirm-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }

/* ---------- dialog ---------- */
dialog {
  border: 1px solid var(--hair); border-radius: 12px; padding: 26px 28px; min-width: 340px;
  box-shadow: 0 20px 60px #00000022; background: var(--paper); font-family: inherit;
}
dialog::backdrop { background: #221f1b55; }
dialog h3 { margin: 0 0 14px; font-weight: 500; }
dialog label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--soft); margin-bottom: 12px; }
dialog input, dialog select {
  border: 1px solid var(--hair); border-radius: 6px; padding: 9px 10px; font-size: 14px;
  font-family: inherit; background: var(--ivory);
}
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- AR share (QR dialog + room-view button) ---------- */
#ar-wrap { display: flex; align-items: center; }
#btn-ar { white-space: nowrap; }
#btn-ar:disabled { opacity: .55; cursor: default; }
#dlg-ar { width: 330px; min-width: 0; text-align: center; }
#dlg-ar .ar-sub { font-size: 12.5px; color: var(--soft); margin: 0 0 16px; }
#ar-qr {
  width: 216px; margin: 0 auto; padding: 14px; background: #fff;
  border: 1px solid var(--hair); border-radius: 10px;
}
#ar-qr svg { display: block; width: 100%; height: auto; }
#ar-link { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--brass-dark); word-break: break-all; }
.ar-hint { font-size: 11.5px; color: var(--soft); margin: 10px 0 0; }
#dlg-ar .dlg-actions { justify-content: center; margin-top: 16px; }

/* ---------- account / auth ---------- */
.auth-tabs { display: flex; gap: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--hair); }
.auth-tab {
  background: none; border: none; cursor: pointer; font-family: inherit; font-size: 13.5px;
  letter-spacing: 1.5px; text-transform: lowercase; color: var(--soft);
  padding: 4px 0 10px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tab.active { color: var(--ink); border-bottom-color: var(--brass); }
.auth-error { color: #a33; font-size: 12.5px; min-height: 16px; margin-bottom: 6px; }
.auth-note { margin-top: 14px; font-size: 11.5px; color: var(--soft); max-width: 300px; }

.guest-note {
  max-width: 980px; margin: 0 auto 18px; padding: 10px 16px; font-size: 13px;
  color: var(--soft); background: var(--ivory); border: 1px solid var(--hair); border-radius: 8px;
}
.guest-note .link {
  background: none; border: none; cursor: pointer; font-family: inherit; font-size: inherit;
  color: var(--brass); text-decoration: underline; padding: 0;
}

.tag-shared {
  display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 7px;
  font-size: 10px; letter-spacing: 1px; text-transform: lowercase;
  background: var(--brass); color: #fff; border-radius: 999px;
}
