:root {
  --paper: #f4f3ef;
  --paper-2: #ebe9e3;
  --card: rgba(255, 255, 255, .82);
  --ink: #16181d;
  --ink-2: #4a4e57;
  --gray: #8a8f98;
  --hair: rgba(22, 24, 29, .10);
  --hair-2: rgba(22, 24, 29, .18);
  --accent: #e2512d;
  --ok: #1f8a4c;
  --warn: #c98a12;
  --err: #d6392b;
  --pine: #dcbc8c;
  --ply: #e8d3a8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 24, 29, .06), 0 8px 28px rgba(22, 24, 29, .08);
  --ease: cubic-bezier(.25, .1, .25, 1);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font: 14px/1.45 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; outline: none; touch-action: none; }

/* --- top bar --------------------------------------------------------------- */
.bar { position: fixed; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 18px; pointer-events: none; z-index: 10; }
.bar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 18px; height: 18px; border: 1.6px solid var(--ink); border-radius: 4px; position: relative; flex: none; }
.mark::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: 3px; height: 1.6px; background: var(--accent); }
.word { font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.project { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); padding: 4px 8px; border-radius: 8px; max-width: 32vw; }
.project span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project:hover { background: var(--hair); }

.tabs { display: flex; gap: 2px; padding: 3px; background: var(--card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--hair); border-radius: 999px; box-shadow: var(--shadow); }
.tabs button { padding: 6px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 500; transition: background .2s var(--ease), color .2s var(--ease); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.tabs button:not([aria-selected="true"]):hover { color: var(--ink); }

.status { justify-self: end; display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; background: var(--card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--hair); border-radius: 999px; font-variant-numeric: tabular-nums; font-weight: 500; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.chip.ok .dot { background: var(--ok); }
.chip.warn .dot { background: var(--warn); }
.chip.err .dot { background: var(--err); }

.menu { position: fixed; top: 52px; left: 44px; z-index: 20; min-width: 260px; max-height: 60vh; overflow: auto; background: #fff; border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.menu button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; }
.menu button:hover { background: var(--paper); }
.menu button small { color: var(--gray); }
.menu-sep { height: 1px; background: var(--hair); margin: 6px 4px; }

/* --- empty state ---------------------------------------------------------- */
.empty { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; width: min(620px, calc(100vw - 32px)); z-index: 5; animation: rise .6s var(--ease) both; }
.empty h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 600; letter-spacing: -.025em; margin: 0 0 10px; }
.empty p { color: var(--ink-2); margin: 0 auto 22px; max-width: 440px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.suggest button { padding: 8px 14px; border: 1px solid var(--hair-2); border-radius: 999px; background: rgba(255,255,255,.6); transition: border-color .2s, background .2s; }
.suggest button:hover { border-color: var(--ink); background: #fff; }
.suggest button[data-sample] { border-style: dashed; color: var(--ink-2); }

/* --- view tools ----------------------------------------------------------- */
.viewtools { position: fixed; right: 18px; top: 64px; display: flex; align-items: center; gap: 6px; z-index: 10; }
.viewtools button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--hair); color: var(--ink-2); }
.viewtools button:hover { color: var(--ink); border-color: var(--hair-2); }
.viewtools button[aria-pressed="true"] { color: var(--accent); }
.overall { position: fixed; left: 18px; bottom: 30px; font: 12px var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 1300px) { .overall { bottom: auto; top: 58px; } }

.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 9px; border-radius: 8px; font-size: 12px; line-height: 1.35; white-space: nowrap; transform: translate(12px, 12px); }
.tip b { font-weight: 600; }
.tip span { color: #b9bdc6; font-family: var(--mono); font-size: 11px; }

/* --- composer ------------------------------------------------------------- */
.composer-wrap { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(820px, calc(100vw - 32px)); z-index: 15; display: flex; flex-direction: column; gap: 8px; }
.composer { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 12px 12px 18px; background: #fff; border: 1px solid var(--hair-2); border-radius: 22px; box-shadow: var(--shadow); transition: border-color .2s; }
.composer:focus-within { border-color: var(--ink); }
.composer textarea { flex: 1 1 200px; min-height: 72px; max-height: 40vh; resize: none; border: 0; outline: none; font: 16px/1.5 var(--font); color: var(--ink); background: transparent; padding: 4px 0; overflow-y: hidden; scrollbar-width: thin; }
.composer textarea::placeholder { color: var(--gray); }
.composer [type=submit] { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; transition: opacity .2s; }
.composer [type=submit]:disabled { opacity: .3; cursor: default; }
.pointing { display: flex; flex-wrap: wrap; gap: 5px; flex-basis: 100%; }
.pointing:empty { display: none; }
.pointing button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 9px; border-radius: 999px; background: rgba(226, 81, 45, .1); color: #a8381b; font-size: 12.5px; font-weight: 500; }
.pointing button::after { content: "×"; opacity: .6; font-size: 14px; line-height: 1; }

.reply { background: var(--card); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--hair); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); max-height: 22vh; overflow: auto; position: relative; animation: rise .35s var(--ease) both; }
.reply-text { white-space: pre-wrap; padding-right: 84px; }
body:not([data-tab="model"]) .reply, body:not([data-tab="model"]) .history { display: none; }
.reply-text .working { color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.reply-text .working::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.reply-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; }
.reply-more { font-size: 12px; color: var(--gray); padding: 2px 6px; border-radius: 6px; }
.reply-more:hover { color: var(--ink); background: var(--hair); }
.history { background: #fff; border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 50vh; display: flex; flex-direction: column; overflow: hidden; }
.history-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--hair); font-size: 12px; font-weight: 600; color: var(--ink-2); flex: none; }
.history-close { width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--ink-2); display: grid; place-items: center; }
.history-close:hover { background: var(--paper); color: var(--ink); }
.history-body { overflow: auto; padding: 0 14px; }
.history .msg { padding: 8px 0; border-bottom: 1px solid var(--hair); white-space: pre-wrap; }
.history .msg:last-child { border-bottom: 0; }
.history .who { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); display: block; margin-bottom: 2px; }
.history .person { color: var(--ink-2); }

/* --- panels (materials, shop, cnc) ---------------------------------------- */
.panel { position: fixed; inset: 0; overflow: auto; background: var(--paper); z-index: 8; padding: 76px max(16px, calc((100vw - 1080px) / 2)) 150px; animation: fade .25s var(--ease) both; }
.panel h2 { font-size: 28px; letter-spacing: -.02em; margin: 8px 0 4px; font-weight: 650; }
.panel .lede { color: var(--ink-2); margin: 0 0 28px; max-width: 640px; }
.panel h3 { font-size: 15px; margin: 0; font-weight: 600; }
.panel .meta { color: var(--gray); font-size: 13px; font-variant-numeric: tabular-nums; }
.group { background: #fff; border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.total { background: #fff; border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 16px; }
.total .n { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.total .l { color: var(--gray); font-size: 12.5px; }

.board { display: grid; grid-template-columns: 48px 1fr 96px; align-items: center; gap: 12px; margin: 8px 0; }
.board .len, .board .waste { font: 12px var(--mono); color: var(--gray); }
.board .waste { text-align: right; white-space: nowrap; }
.board svg { width: 100%; height: 30px; display: block; overflow: visible; }
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.sheet svg { width: 100%; height: auto; display: block; }
.sheet .cap { display: flex; justify-content: space-between; margin-top: 6px; }
svg .cut { stroke: rgba(22,24,29,.35); stroke-width: .6; vector-effect: non-scaling-stroke; }
svg .cut:hover, svg .cut.hot { fill: #f2b8a6; }
svg text { font-family: var(--font); }

table.list { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.list th { text-align: left; font-weight: 500; color: var(--gray); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--hair-2); }
table.list td { padding: 8px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.list td.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr[data-pid] { cursor: pointer; }
table.list tr[data-pid]:hover td { background: var(--paper); }
.table-scroll { overflow-x: auto; }

.finding { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.finding:last-child { border-bottom: 0; }
.finding .lvl { flex: none; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; width: 58px; padding-top: 2px; }
.finding .lvl.error { color: var(--err); }
.finding .lvl.warn { color: var(--warn); }
.clean { color: var(--ok); font-weight: 500; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 500; text-decoration: none; }
.btn:hover { background: #000; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.empty { animation-name: rise-center; }
@keyframes rise-center { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .bar { grid-template-columns: 1fr auto; padding: 10px 12px; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .word, .overall { display: none; }
  .panel { padding-top: 110px; }
  .viewtools { top: 100px; right: 12px; flex-direction: column; align-items: flex-end; }
  .sheets { grid-template-columns: 1fr; }
  .board { grid-template-columns: 34px 1fr 62px; gap: 8px; }
  .board .waste { font-size: 10.5px; }
  .group { padding: 14px; }
}

.stick { position: relative; height: 30px; background: repeating-linear-gradient(45deg, #f1ece2 0 4px, #e7e1d4 4px 5px); border: 1px solid rgba(22,24,29,.25); border-radius: 3px; overflow: hidden; }
.seg { position: absolute; top: 0; bottom: 0; border-right: 1px solid rgba(22,24,29,.35); cursor: pointer; display: flex; align-items: center; padding: 0 6px; min-width: 0; }
.seg:hover { filter: brightness(.94); }
.seg span { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:not([data-tab="model"]) .composer textarea { min-height: 28px; }

/* --- Eniver CAD: guardar, pastillas, diálogo, paleta, planos --------------- */
.brand .save { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--card); font-size: 12.5px; font-weight: 500; }
.brand .save:hover { border-color: var(--ink); }
.brand .save:disabled { opacity: .4; }
.brand .saved { font-size: 11.5px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 18vw; }
@media (max-width: 1100px) { .brand .saved { display: none; } }

.viewtools .pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 999px; background: var(--card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--hair); color: var(--ink-2); font-size: 12.5px; font-weight: 500; width: auto; }
.viewtools .pill:hover { color: var(--ink); border-color: var(--hair-2); }
.viewtools .pill[aria-pressed="false"]:not(#historyToggle):not(#viewsBtn) { color: var(--gray); text-decoration: line-through; text-decoration-color: rgba(22,24,29,.3); }
#historyToggle[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.viewtools .pill.on { color: var(--ink); }
.viewtools #spinBtn:not(.on) { background: var(--ink); color: #fff; border-color: var(--ink); }
.viewtools .round { width: 36px; height: 36px; }
#spinIcon { display: inline-flex; }
@media (max-width: 720px) { .viewtools .pill span:last-child { display: none; } .viewtools .pill { padding: 0 11px; } }

.menu-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); padding: 4px 10px; }
.menu button.current { background: var(--paper); font-weight: 600; }
.meta.pad { padding: 8px 10px; }

dialog { border: 1px solid var(--hair); border-radius: 16px; padding: 0; box-shadow: 0 20px 60px rgba(22,24,29,.25); width: min(460px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(22,24,29,.25); backdrop-filter: blur(2px); }
dialog form { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 10px; }
dialog h3 { margin: 0; font-size: 17px; }
dialog p { margin: 0; }
dialog input { font: 15px var(--font); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hair-2); outline: none; }
dialog input:focus { border-color: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.versions { max-height: 50vh; overflow: auto; margin: 4px -4px; }
.version { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--hair); }
.version .n { font: 12px var(--mono); color: var(--gray); }
.version .t { display: flex; flex-direction: column; }
.version small { color: var(--gray); font-size: 11.5px; }

button.ghost { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--hair-2); background: #fff; font-size: 13px; }
button.ghost:hover:not(:disabled) { border-color: var(--ink); }
button.ghost:disabled { opacity: .4; cursor: default; }
button.btn { border: 0; cursor: pointer; font: inherit; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.wide { width: 100%; justify-content: center; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); background: var(--paper); border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: 2px; }
.err { color: var(--err); }
.total .n.small { font-size: 15px; padding-top: 8px; }
.panel .actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 0 0 20px; }
.piece { cursor: pointer; }

.palette-group { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.palette-group:last-of-type { border-bottom: 0; }
.palette-label { font-weight: 600; font-size: 13px; padding-top: 6px; }
.palette-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mat { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--hair-2); background: #fff; color: var(--gray); font-size: 12.5px; }
.mat.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.mat.used { box-shadow: inset 0 -2px 0 var(--accent); }
.mat:not(.on).used { color: var(--err); border-color: rgba(214,57,43,.5); }
.palette-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.palette-actions .grow { flex: 1; }
@media (max-width: 720px) { .palette-group { grid-template-columns: 1fr; gap: 4px; } }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.switch input { accent-color: var(--ink); width: 16px; height: 16px; }

.panel.plans { padding-left: 16px; padding-right: 16px; }
.plans-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; max-width: 1500px; margin: 0 auto; }
.plans-nav { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 200px); }
.plans-head { display: flex; justify-content: space-between; align-items: baseline; }
.plans-head h2 { margin: 0; }
.plans-list { overflow: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--hair); padding-top: 6px; }
.plan-link { display: grid; grid-template-columns: 46px 1fr; gap: 6px; text-align: left; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.plan-link:hover { background: #fff; }
.plan-link.on { background: var(--ink); color: #fff; }
.plan-link .code { font: 11.5px var(--mono); opacity: .7; padding-top: 1px; }
.plan-link .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plans-view { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.plans-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.plans-paper { background: #fff; border: 1px solid var(--hair); border-radius: 6px; box-shadow: var(--shadow); padding: 8px; overflow: auto; }
.plans-paper svg { width: 100%; height: auto; display: block; }
@media (max-width: 900px) { .plans-layout { grid-template-columns: 1fr; } .plans-nav { position: static; max-height: none; } .plans-list { max-height: 30vh; } }
.stage-notice { position: fixed; left: 50%; top: 110px; transform: translateX(-50%); z-index: 40; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); }
.webgl-fail { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--hair-2); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow); z-index: 6; }
.webgl-fail h2 { margin: 0 0 8px; font-size: 18px; }
.webgl-fail p { margin: 6px 0; color: var(--ink-2); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(22,24,29,.2); margin-right: 7px; vertical-align: -1px; }
.photo-controls { display: flex; flex-direction: column; gap: 10px; }
.photo-styles { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-controls textarea { font: 14px/1.45 var(--font); border: 1px solid var(--hair-2); border-radius: 10px; padding: 8px 10px; resize: vertical; outline: none; }
.photo-controls textarea:focus { border-color: var(--ink); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; }
@media (max-width: 720px) { .photos { grid-template-columns: 1fr; } }
.photo { margin: 0; background: #fff; border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden; }
.photo img { width: 100%; display: block; aspect-ratio: 3 / 2; object-fit: cover; background: var(--paper-2); }
.photo figcaption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 12px 4px; font-size: 12.5px; color: var(--ink-2); }
.photo figcaption a { color: var(--ink); }
.photo details { padding: 0 12px 10px; font-size: 12px; color: var(--gray); }
.photo pre { white-space: pre-wrap; font: 11.5px/1.45 var(--mono); max-height: 220px; overflow: auto; background: var(--paper); padding: 8px; border-radius: 8px; }
.photo.pending { aspect-ratio: 3 / 2; display: grid; place-items: center; }
.photo .working { color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.photo .working::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
#viewsBtn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.views-menu { left: auto; right: 18px; top: 108px; min-width: 280px; }
.view-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.view-presets button { padding: 7px 10px; border-radius: 8px; text-align: left; }
.view-presets button:hover { background: var(--paper); }
.view-row { display: flex; align-items: center; gap: 2px; }
.view-row .view-go { flex: 1; }
.view-row .view-del { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--gray); font-size: 18px; }
.view-row .view-del:hover { background: var(--paper); color: var(--err); }
.views-menu .view-save { font-weight: 600; }
.preview-banner { position: fixed; top: 108px; left: 50%; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; white-space: nowrap; justify-content: center; background: #fff8e6; border: 1px solid #e8cf8f; border-radius: 12px; padding: 8px 10px 8px 14px; box-shadow: var(--shadow); font-size: 13px; max-width: calc(100vw - 32px); }
.composer.locked { opacity: .7; }
body:not([data-tab="model"]) .views-menu { display: none; }
@media (max-width: 900px) { .preview-banner { flex-wrap: wrap; white-space: normal; } }
@media (max-width: 720px) { .views-menu { top: 150px; right: 12px; } .preview-banner { top: 150px; } }
.pov-bar { position: fixed; top: 108px; left: 50%; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 8px; white-space: nowrap; background: #fff; border: 1px solid var(--hair-2); border-radius: 12px; padding: 7px 8px 7px 14px; box-shadow: var(--shadow); font-size: 13px; max-width: calc(100vw - 32px); }
.pov-bar .btn, .pov-bar .ghost { padding: 6px 12px; font-size: 12.5px; }
body:has(#previewBanner) .pov-bar { top: 160px; }
@media (max-width: 900px) { .pov-bar { flex-wrap: wrap; white-space: normal; justify-content: center; } }
.photo-row { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center; font-size: 13.5px; }
.photo-label { font-weight: 600; font-size: 13px; }
.photo-row input { font: 14px var(--font); border: 1px solid var(--hair-2); border-radius: 10px; padding: 7px 10px; outline: none; }
.photo-row input:focus { border-color: var(--ink); }
.mat:disabled { opacity: .45; cursor: default; }
@media (max-width: 720px) { .photo-row { grid-template-columns: 1fr; gap: 4px; } }

/* sin invitación: la API responde 401 y la página lo dice encima de todo */
#gate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); }
#gate > div { max-width: 420px; padding: 24px; border-radius: 12px; background: #fff; color: #111; font: 15px/1.5 system-ui, sans-serif; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
#gate p { margin: .5em 0 0; }
