/* ADLIS WEIYIN · 3D Viewer ------------------------------------------------ */
:root {
  --ink: #12151a;
  --ink-2: #4a515b;
  --ink-3: #8a929c;
  --line: #e4e7eb;
  --line-2: #eef0f3;
  --paper: #ffffff;
  --paper-2: #f6f7f9;
  --accent: #0e9f6e;
  --accent-ink: #ffffff;
  --accent-soft: #e3f6ee;
  --focus: #2f7bff;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 10px 30px -12px rgba(15, 18, 22, .28), 0 2px 6px rgba(15, 18, 22, .06);
  --panel-w: 390px;
  --stage-light: radial-gradient(120% 90% at 50% 38%, #ffffff 0%, #eef1f4 55%, #dfe4e9 100%);
  --stage-dark: radial-gradient(120% 90% at 50% 38%, #2a3038 0%, #171b20 60%, #0d0f12 100%);
  --stage-warm: radial-gradient(120% 90% at 50% 38%, #fffaf3 0%, #f3e9dc 60%, #e2d3c0 100%);
  --stage-sky: linear-gradient(180deg, #8fb8e8 0%, #cfe2f5 52%, #e9ece6 52.1%, #cfd3c9 100%);
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper-2); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.app { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); }
.app.panel-closed { grid-template-columns: minmax(0, 1fr) 0; }
.app.panel-closed .panel { transform: translateX(100%); }
.stage { position: relative; min-width: 0; min-height: 0; background: var(--stage-light); transition: background .5s; overflow: hidden; }
.stage[data-bg="dark"] { background: var(--stage-dark); color-scheme: dark; }
.stage[data-bg="warm"] { background: var(--stage-warm); }
.stage[data-bg="sky"] { background: var(--stage-sky); }
model-viewer { width: 100%; height: 100%; display: block; --poster-color: transparent; --progress-bar-color: transparent; background: transparent; }

/* ---------- brand bar ---------- */
.brandbar { position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; gap: 18px; padding: 16px 18px; pointer-events: none; }
.brandbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); background: rgba(255,255,255,.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 7px 12px 7px 7px; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.brand img { border-radius: 8px; display: block; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 13px; letter-spacing: .14em; }
.brand small { font-size: 10.5px; color: var(--ink-2); letter-spacing: .04em; margin-top: 2px; }
.product-title { flex: 1; min-width: 0; padding-top: 2px; }
.product-title .code { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; }
.product-title h1 { margin: 5px 0 0; font-size: clamp(16px, 1.6vw, 21px); font-weight: 650; letter-spacing: -.01em; line-height: 1.2; }
.stage[data-bg="dark"] .product-title h1 { color: #f3f5f7; }
.top-actions { display: flex; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: rgba(255,255,255,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 2px rgba(0,0,0,.06); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: #fff; }

/* ---------- toolbar ---------- */
.toolbar { position: absolute; z-index: 5; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; background: rgba(255,255,255,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 18px; box-shadow: var(--shadow); max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 58px; height: 54px; padding: 0 8px; border: 0; border-radius: 13px; background: transparent; color: var(--ink-2); font-size: 11px; font-weight: 550; white-space: nowrap; transition: background .15s, color .15s; }
.tool svg { width: 21px; height: 21px; }
.tool:hover { background: var(--paper-2); color: var(--ink); }
.tool[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tool.primary { background: var(--accent); color: var(--accent-ink); min-width: 64px; }
.tool.primary:hover { filter: brightness(1.06); }
.tool.primary.alt { background: var(--ink); }
.tool .sep, .toolbar .sep { width: 1px; height: 30px; background: var(--line); margin: 0 4px; flex: none; }

.panel-toggle { position: absolute; z-index: 5; right: 16px; bottom: 26px; display: flex; align-items: center; gap: 8px; border: 0; background: var(--ink); color: #fff; padding: 11px 14px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; font-size: 13px; }
.panel-toggle svg { width: 18px; height: 18px; }
.app:not(.panel-closed) .panel-toggle { background: #fff; color: var(--ink); }
.tool.pulse { animation: pulse 1.6s infinite; }

/* AR nativo: lo gestionamos con el botón de la barra */
.ar-native { display: none; }

/* ---------- progress ---------- */
.progress { position: absolute; left: 50%; top: 50%; width: min(260px, 60%); height: 4px; transform: translate(-50%, 40px); background: rgba(0,0,0,.08); border-radius: 4px; overflow: hidden; transition: opacity .4s; }
.progress .bar { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s; }
.progress.done { opacity: 0; }

/* ---------- hotspots ---------- */
.hotspot { --size: 30px; width: var(--size); height: var(--size); border-radius: 50%; border: 2px solid #fff; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0; box-shadow: 0 0 0 0 rgba(14,159,110,.55), 0 4px 12px rgba(0,0,0,.25); animation: pulse 2.4s infinite; transition: transform .15s, opacity .3s; }
.hotspot:hover, .hotspot.active { transform: scale(1.15); animation: none; background: var(--ink); }
.hotspot:not([data-visible]) { opacity: .25; }
.hide-hotspots .hotspot { display: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(14,159,110,.55), 0 4px 12px rgba(0,0,0,.25); } 70% { box-shadow: 0 0 0 12px rgba(14,159,110,0), 0 4px 12px rgba(0,0,0,.25); } 100% { box-shadow: 0 0 0 0 rgba(14,159,110,0), 0 4px 12px rgba(0,0,0,.25); } }
.hs-card { position: absolute; z-index: 6; left: 18px; bottom: 96px; width: min(330px, calc(100% - 36px)); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 14px; animation: rise .25s ease-out; }
.hs-card h3 { margin: 0 26px 6px 0; font-size: 15px; }
.hs-card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.hs-close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--paper-2); font-size: 18px; line-height: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- dimensions ---------- */
.dot { display: none; width: 7px; height: 7px; border-radius: 50%; border: 0; background: var(--ink); padding: 0; box-shadow: 0 0 0 2px #fff; }
.dim { display: none; border: 0; background: #fff; color: var(--ink); border-radius: 7px; padding: 4px 8px; font-size: 12px; font-weight: 650; box-shadow: 0 2px 8px rgba(0,0,0,.18); white-space: nowrap; pointer-events: none; }
.dim-lines { pointer-events: none; display: none; position: absolute; inset: 0; }
.dimensionLine { stroke: #12151a; stroke-width: 1.5; stroke-dasharray: 5 4; }
.stage[data-bg="dark"] .dimensionLine { stroke: #fff; }
.show-dims .dot, .show-dims .dim { display: block; }
.show-dims .dim-lines { display: block; }
.dot:not([data-visible]), .dim:not([data-visible]) { visibility: hidden; }
.dim-lines line.hide { display: none; }

/* ---------- toast ---------- */
.toast { position: absolute; z-index: 9; left: 50%; top: 84px; transform: translate(-50%, -10px); background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- panel ---------- */
.panel { position: relative; z-index: 7; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-left: 1px solid var(--line); transition: transform .3s ease; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); flex: none; }
.tab { border: 0; background: none; padding: 12px 4px 11px; font-size: 13px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 18px 24px; overscroll-behavior: contain; }
.panel-close { display: none; }
.eyebrow { margin: 22px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.tabpane > .eyebrow:first-child { margin-top: 0; }
.small { font-size: 12.5px; }
.muted { color: var(--ink-3); }
.lead { margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* presets */
.presets { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.preset { flex: none; width: 104px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px; text-align: left; transition: border-color .15s, box-shadow .15s; }
.preset:hover { border-color: var(--ink-3); }
.preset.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.preset .chips { display: flex; height: 34px; border-radius: 7px; overflow: hidden; margin-bottom: 7px; }
.preset .chips i { flex: 1; background-size: cover; background-position: center; }
.preset span { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.25; }

/* linked toggle */
.check { display: flex; align-items: center; gap: 9px; margin: 16px 0 4px; font-size: 13px; font-weight: 550; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.check.small { font-weight: 500; color: var(--ink-2); font-size: 12.5px; margin-top: 18px; }

/* part accordion */
.parts { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.part { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.part.open { border-color: #cfd4da; box-shadow: 0 4px 14px -8px rgba(0,0,0,.18); }
.part.linked-hidden { display: none; }
.part-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; background: none; text-align: left; border-radius: var(--radius); }
.part-head .sw { width: 38px; height: 38px; border-radius: 10px; flex: none; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.part-head .txt { flex: 1; min-width: 0; }
.part-head strong { display: block; font-size: 14px; font-weight: 650; }
.part-head small { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.part-head .chev { width: 18px; height: 18px; color: var(--ink-3); transition: transform .2s; flex: none; }
.part.open .chev { transform: rotate(180deg); }
.part-body { display: none; padding: 2px 12px 14px; }
.part.open .part-body { display: block; }
.groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.seg { display: flex; background: var(--paper-2); border-radius: 11px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 6px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.small button { padding: 5px 6px; font-size: 12px; }
.seg.env { display: grid; grid-template-columns: repeat(4, 1fr); }
.seg.env button { flex-direction: column; padding: 9px 4px; font-size: 11.5px; }
.sw-sun, .sw-sunset, .sw-night, .sw-studio { width: 26px; height: 26px; border-radius: 50%; display: block; }
.sw-sun { background: radial-gradient(circle at 60% 35%, #fff7c2 0 18%, #7fb3ec 20% 100%); }
.sw-sunset { background: radial-gradient(circle at 30% 70%, #ffd29a 0 16%, #e9804a 30%, #4a4e86 100%); }
.sw-night { background: radial-gradient(circle at 70% 30%, #ffcc88 0 8%, #1d2645 12% 100%); }
.sw-studio { background: radial-gradient(circle at 50% 30%, #fff, #bfc5cc); }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.swatch { position: relative; aspect-ratio: 1; border: 0; border-radius: 11px; padding: 0; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); transition: transform .12s; }
.swatch:hover { transform: translateY(-2px); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.swatch.metallic { background-image: linear-gradient(135deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 45%, rgba(0,0,0,.18) 100%); }
.swatch.glow::after { content: ""; position: absolute; inset: 28%; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 0 10px 3px rgba(255,255,255,.8); }
.opt-name { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); min-height: 1.2em; }
.custom { display: flex; gap: 10px; align-items: center; }
.custom input[type=color] { width: 52px; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; }
.custom input[type=text] { flex: 1; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }

/* scene */
input[type=range] { width: 100%; accent-color: var(--ink); }

/* specs / docs */
.specs { margin: 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--line); }
.specs dt, .specs dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.specs dt { color: var(--ink-3); padding-right: 16px; }
.specs dd { font-weight: 600; text-align: right; }
.docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.docs a { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.docs a:hover { border-color: var(--ink-3); }
.docs svg { width: 20px; height: 20px; color: var(--accent); flex: none; }

/* share */
.qr-wrap { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--paper-2); border-radius: var(--radius); }
.qr { width: 116px; height: 116px; flex: none; background: #fff; border-radius: 10px; padding: 7px; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
.qr-wrap p { margin: 0; color: var(--ink-2); line-height: 1.45; }
.row { display: flex; gap: 8px; margin-top: 12px; }
.row.wrap { flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 11px; font-size: 13px; font-weight: 600; text-decoration: none; flex: 1; white-space: nowrap; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); flex: 1 1 auto; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.btn:disabled { opacity: .5; cursor: progress; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 11px; padding: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.5; color: var(--ink-2); background: var(--paper-2); margin-bottom: 8px; }
#btnCopyEmbed { width: 100%; }

/* footer */
.panel-foot { flex: none; border-top: 1px solid var(--line); padding: 12px 18px 16px; background: #fff; }
.summary { display: flex; gap: 4px; align-items: center; margin-bottom: 10px; font-size: 12px; color: var(--ink-2); min-height: 20px; }
.summary i { width: 18px; height: 18px; border-radius: 5px; background-size: cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); flex: none; }
.summary span { margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.cta { width: 100%; padding: 13px; font-size: 14px; background: var(--accent); }

/* ---------- modal ---------- */
.modal { border: 0; border-radius: 20px; padding: 26px; width: min(400px, calc(100% - 32px)); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); text-align: center; }
.modal::backdrop { background: rgba(12, 14, 18, .55); backdrop-filter: blur(3px); }
.modal h2 { margin: 0 0 16px; font-size: 19px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--paper-2); font-size: 20px; }
.qr.big { width: 220px; height: 220px; margin: 0 auto 16px; padding: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.steps { text-align: left; margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.modal .btn { width: 100%; margin-top: 6px; }

/* ---------- no webgl / gallery ---------- */
.nogl { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; padding: 24px; background: var(--paper-2); z-index: 20; }
.nogl img { max-width: min(560px, 90%); }
.gallery { position: fixed; inset: 0; overflow: auto; background: var(--paper-2); padding: 32px clamp(16px, 4vw, 48px); z-index: 30; }
.gallery header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.gallery header img { border-radius: 10px; }
.gallery header strong { display: block; letter-spacing: .14em; }
.gallery header span { color: var(--ink-2); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: #fff; border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: box-shadow .2s, transform .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .img { aspect-ratio: 4/3; background: var(--stage-light) center/contain no-repeat; }
.card .meta { padding: 12px 14px 14px; }
.card .meta small { color: var(--accent); font-weight: 700; font-size: 11px; letter-spacing: .1em; }
.card .meta div { font-weight: 650; margin-top: 3px; }

/* ---------- modo "sólo visor" (iframe pequeño) ---------- */
.app.ui-minimal { grid-template-columns: 1fr; }
.app.ui-minimal .panel, .app.ui-minimal .panel-toggle, .app.ui-minimal .product-title, .app.ui-minimal #btnShot, .app.ui-minimal #btnReset { display: none !important; }
.app.ui-minimal .brand small { display: none; }

/* ---------- móvil / tablet ---------- */
@media (max-width: 860px) {
  .app, .app.panel-closed { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .panel { border-left: 0; border-top: 1px solid var(--line); max-height: 46vh; border-radius: 18px 18px 0 0; margin-top: -18px; box-shadow: 0 -10px 30px -18px rgba(0,0,0,.35); }
  .app.panel-closed .panel { display: none; }
  .brandbar { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .brand small { display: none; }
  .product-title { order: 3; flex-basis: 100%; }
  .product-title h1 { font-size: 15px; }
  .top-actions { margin-left: auto; }
  .toolbar { bottom: 28px; gap: 2px; padding: 5px; }
  .tool { min-width: 50px; height: 48px; font-size: 10.5px; }
  .tool svg { width: 19px; height: 19px; }
  .hs-card { bottom: 96px; left: 12px; }
  .panel-toggle { bottom: 94px; right: 12px; }
  .panel-foot { padding: 10px 14px 12px; }
  .summary { display: none; }
}
@media (max-width: 420px) {
  .tool span { display: none; }
  .tool { min-width: 44px; height: 44px; }
  .tool.primary span { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* dentro de un iframe: panel flotante y más estrecho */
@media (min-width: 861px) {
  .app.embedded { --panel-w: 320px; grid-template-columns: minmax(0, 1fr); }
  .app.embedded .panel { position: absolute; top: 0; right: 0; bottom: 0; width: var(--panel-w); box-shadow: -12px 0 30px -18px rgba(0,0,0,.35); }
  .app.embedded .panel-toggle { right: 16px; }
  .app.embedded:not(.panel-closed) .panel-toggle { right: calc(var(--panel-w) + 16px); }
}

/* ---------- toolbar: título + Customise dentro ---------- */
.toolbar { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
.toolbar .tb-title { flex: 0 0 100%; text-align: center; font-weight: 700; font-size: 13px; letter-spacing: .01em; color: var(--ink); padding: 3px 8px 5px; border-bottom: 1px solid rgba(0,0,0,.08); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar .tb-title:empty { display: none; }
.toolbar .panel-toggle.in-bar, .app .toolbar .panel-toggle.in-bar, .app.embedded .toolbar .panel-toggle.in-bar, .app.embedded:not(.panel-closed) .toolbar .panel-toggle.in-bar { position: static; right: auto; bottom: auto; box-shadow: none; border-radius: 12px; padding: 0 10px; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 500; background: transparent; color: var(--ink); }
.toolbar .panel-toggle.in-bar[aria-expanded="true"] { background: var(--ink); color: #fff; }
.toolbar .panel-toggle.in-bar svg { width: 20px; height: 20px; }
/* ---------- iframe: panel más estrecho, sin botón de pantalla completa propio ---------- */
@media (min-width: 861px) { .app.embedded { --panel-w: 270px; } }


.toolbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
.toolbar .tb-title { flex: none; }
.toolbar .tb-row { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.top-actions { display: flex; gap: 8px; }
.top-actions .icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* barra siempre horizontal, abajo en el centro */
.app .toolbar, .app.embedded .toolbar { left: 50% !important; right: auto !important; top: auto !important; bottom: 18px !important; transform: translateX(-50%) !important; flex-direction: column !important; width: auto !important; max-width: calc(100% - 24px); height: auto !important; }
.app .toolbar .tb-row { flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
.app .toolbar .tb-row .sep { width: 1px !important; height: 30px !important; }
@media (min-width: 861px) { .app.embedded:not(.panel-closed) .toolbar { left: calc((100% - var(--panel-w)) / 2) !important; max-width: calc(100% - var(--panel-w) - 24px); } }
/* AR/VR mismo tamaño que Info · barra más ancha */
.app .toolbar { padding: 6px 22px !important; }
.app .toolbar .tb-row { gap: 6px !important; }
.app .toolbar .tb-row .tool, .app .toolbar .tb-row .tool.primary, .app .toolbar .tb-row .tool.primary.alt { min-width: 58px !important; width: 58px !important; padding: 7px 4px !important; flex: none !important; }
.app .toolbar .tb-row .panel-toggle.in-bar { width: auto !important; min-width: 72px !important; }

/* EMBED FIX: el modelo siempre visible dentro de la web */
@media (max-width: 860px){
  .app.embedded .panel{max-height:38%;}
  .app.embedded .stage model-viewer{min-height:0}
}
/* EMBED FIX 2: dentro de la web el panel va a la derecha, el bus siempre visible */
@media (max-width: 860px) and (min-width: 560px){
  .app.embedded, .app.embedded.panel-closed{grid-template-columns:minmax(0,1fr) !important;grid-template-rows:minmax(0,1fr) !important}
  .app.embedded .panel{position:absolute;top:0;right:0;bottom:0;width:min(320px,42%);max-height:none;margin:0;border-radius:0;border-top:0;border-left:1px solid var(--line);box-shadow:-12px 0 30px -18px rgba(0,0,0,.35);z-index:6}
  .app.embedded:not(.panel-closed) .stage{margin-right:min(320px,42%)}
  .app.embedded:not(.panel-closed) .toolbar{max-width:calc(100% - min(320px,42%) - 20px)}
}
@media (max-width: 559px){ .app.embedded .panel{max-height:34%} }