html { -webkit-text-size-adjust: 100% }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px) }
body { margin: 0 }
img, svg { max-width: 100% }
[hidden] { display: none !important }
/* Layout: banco de trabajo de Pliego — barra de marca arriba, controles a la izquierda, visor 3D y planilla de piezas a la derecha.
   Marca: azul pizarra #0f172a, lima #a3e635, blanco #f7f7f7. Diseño oscuro primero, como la versión principal del isologo. */
:root {
  --bg: #0b1222; --panel: #0f172a; --panel-2: #131e35; --ink: #f7f7f7; --muted: #94a3b8; --line: #1f2a40;
  --lime: #a3e635; --accent: #a3e635; --accent-ink: #0f172a; --link: #a3e635; --model: #a3e635; --view: #0a1020;
  --field: #0b1222; --ok: #a3e635; --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
  --f-display: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg: #eef1f5; --panel: #ffffff; --panel-2: #f6f8fa; --ink: #0f172a; --muted: #5b6678; --line: #dbe1e9;
  --accent: #a3e635; --accent-ink: #0f172a; --link: #3f6212; --model: #8fd61f; --view: #e3e8ef;
  --field: #f3f5f8; --ok: #3f6212; --warn: #a65b00; --warn-bg: #fff3df; color-scheme: light } }
:root[data-theme="light"] {
  --bg: #eef1f5; --panel: #ffffff; --panel-2: #f6f8fa; --ink: #0f172a; --muted: #5b6678; --line: #dbe1e9;
  --accent: #a3e635; --accent-ink: #0f172a; --link: #3f6212; --model: #8fd61f; --view: #e3e8ef;
  --field: #f3f5f8; --ok: #3f6212; --warn: #a65b00; --warn-bg: #fff3df; color-scheme: light }

* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; font-weight: 400;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 40px; }
.wrap { max-width: 1280px; margin: 0 auto; display: grid; gap: 20px }
.brandbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; padding-block: 22px 18px; border-bottom: 4px solid var(--lime) }
.brand { display: flex; align-items: center; gap: 18px; min-width: 0 }
.brandmark { height: 40px; width: auto; color: var(--ink); flex: none }
.brand .sep { width: 1px; align-self: stretch; background: var(--line) }
.brand .tag { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); line-height: 1.3 }
.apptitle { display: grid; gap: 4px; min-width: 0 }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.015em; margin: 0; text-wrap: balance; line-height: 1.1 }
.brandbar p { margin: 0; color: var(--muted); max-width: 52ch; font-size: 14px }
@media (max-width: 560px) { .brand .sep, .brand .tag { display: none } .brandmark { height: 32px } }
.grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start }
@media (max-width: 860px) { .grid { grid-template-columns: minmax(0, 1fr) } }
.grid > * { min-width: 0 }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px }
.controls { display: grid; gap: 0 }
.sec { padding: 18px 20px; display: grid; gap: 12px; border-top: 1px solid var(--line) }
.sec:first-child { border-top: 0 }
.label { font-family: var(--f-display); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.28em; color: var(--muted); display: flex; align-items: center; gap: 8px }
.sec > .label { cursor: pointer; user-select: none; border-radius: 6px; margin: -6px -8px; padding: 6px 8px; min-height: 32px }
.sec > .label:hover { color: var(--ink) }
.sec > .label:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px }
.sec > .label { flex-wrap: wrap; row-gap: 2px }
.sec > .label > .ttl { flex: 1; min-width: 0 }
.sec > .label .sum { order: 3; flex-basis: 100%; padding-left: 16px; text-transform: none; letter-spacing: 0; font-family: var(--f-mono); font-size: 12px; color: var(--ink); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.sec > .label .sum:empty { display: none }
.sec > .label .chev { width: 18px; height: 18px; flex: none; transition: transform .18s; color: var(--muted) }
.sec.closed > .label .chev { transform: rotate(-90deg) }
.sec:not(.closed) > .label .sum { display: none }
.sec.closed { padding-bottom: 18px }
.sec.closed > :not(.label) { display: none !important }
.accbar { display: flex; justify-content: flex-end; gap: 14px; padding: 10px 20px 0; font-size: 12.5px }
dialog.modal { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0,0,0,.45) }
dialog.modal::backdrop { background: rgba(5, 10, 20, .6); backdrop-filter: blur(2px) }
.modal .mbody { padding: 22px 22px 6px; display: grid; gap: 10px }
.modal h2 { margin: 0; font-family: var(--f-display); font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 10px }
.modal h2 .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-bg); color: var(--warn); font-size: 17px; font-weight: 700; flex: none }
.modal p { margin: 0; color: var(--ink); line-height: 1.5; overflow-wrap: anywhere }
.modal .hint { color: var(--muted); font-size: 13.5px }
.modal .mfoot { padding: 16px 22px 20px; display: flex; justify-content: flex-end }
.modal .mfoot .btn { width: auto; padding: 11px 26px; font-size: 15px }
.label::before { content: ""; width: 8px; height: 8px; background: var(--lime); clip-path: polygon(0 0, 100% 0, 100% 100%, 55% 100%, 55% 45%, 0 45%) }
.drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 6px; cursor: pointer; transition: border-color .15s, background .15s; background: var(--panel-2) }
.drop:hover, .drop.over { border-color: var(--lime) }
.drop:focus-within { outline: 2px solid var(--lime); outline-offset: 2px }
.drop strong { font-weight: 600 }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0 }
.fileinfo { font-family: var(--f-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere }
.field { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 4px 12px; align-items: center }
.field label { font-weight: 500 }
.field small { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px }
.num { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--field); overflow: hidden }
.num input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font-family: var(--f-mono); font-size: 15px; padding: 7px 4px 7px 9px; text-align: right; font-variant-numeric: tabular-nums }
.num span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); padding-right: 8px }
.num:focus-within { border-color: var(--lime); outline: 2px solid color-mix(in srgb, var(--lime) 30%, transparent) }
input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--lime); margin: 0 }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px }
.check.off { opacity: .45 }
.check input { margin-top: 4px; accent-color: var(--lime) }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--field) }
.seg label { flex: 1; text-align: center; font-size: 13.5px; padding: 8px 6px; cursor: pointer; border-left: 1px solid var(--line); transition: background .15s }
.seg label:first-child { border-left: 0 }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px }
.seg label:has(input:checked) { background: var(--lime); color: var(--accent-ink); font-weight: 600 }
.seg label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: -3px }
.btn { appearance: none; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-family: var(--f-display); font-weight: 600; font-size: 16px; padding: 13px 16px; cursor: pointer; width: 100%; letter-spacing: .01em }
.btn:hover { filter: brightness(1.06) }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--lime) 45%, transparent); outline-offset: 2px }
.btn:disabled { opacity: .5; cursor: default }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 500; font-size: 14.5px; padding: 11px 14px }
.btn.ghost:hover { border-color: var(--lime); filter: none }
.sub { display: grid; gap: 12px }
.lblj { font-weight: 500 }
.seg3 label { font-size: 13px; padding: 8px 4px }
.stack { display: grid; gap: 6px }
.stack label { font-weight: 500 }
.trio label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.sel { width: 100%; appearance: none; border: 1px solid var(--line); border-radius: 8px; background-color: var(--field); color: var(--ink); font-family: var(--f-body); font-size: 14px; padding: 9px 34px 9px 11px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat }
.sel:focus { outline: 2px solid color-mix(in srgb, var(--lime) 35%, transparent); border-color: var(--lime) }
tr.sub-row td { padding-top: 6px; padding-bottom: 6px; font-size: 13px; color: var(--muted) }
tr.sub-row td:first-child { padding-left: 30px; white-space: nowrap }
.chip { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px }
.row { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between }
.note { color: var(--muted); font-size: 12.5px }
.link { appearance: none; border: 0; background: none; padding: 0; color: var(--link); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px }
.link:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px }
input:disabled { opacity: .45 }
.status { font-size: 13px; color: var(--muted); min-height: 1.2em }
.profile svg { width: 100%; height: auto; display: block }
.profile text { font-family: var(--f-mono); font-size: 11px; fill: var(--muted) }

.right { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0 }
.viewer { position: relative; overflow: hidden; aspect-ratio: 16 / 10; max-width: 100%;
  background: radial-gradient(120% 90% at 50% 40%, color-mix(in srgb, var(--panel) 85%, var(--lime) 4%), var(--view)) }
.viewer canvas { width: 100% !important; height: 100% !important; display: block; touch-action: none }
.vtools { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap }
.vtools button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; font-family: var(--f-body); font-size: 13px; padding: 5px 11px; cursor: pointer }
.vtools button:hover { border-color: var(--lime) }
.vtools button:focus-visible { outline: 2px solid var(--lime) }
.vnote { position: absolute; right: 12px; bottom: 10px; font-family: var(--f-mono); font-size: 11px; color: var(--muted) }
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px }
.tablewrap { overflow-x: auto }
table { width: 100%; border-collapse: collapse; font-size: 14px }
th { text-align: left; font-family: var(--f-display); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--muted); padding: 14px 16px 9px; border-bottom: 1px solid var(--line); white-space: nowrap }
td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums }
td.m { font-family: var(--f-mono); font-size: 13px; white-space: nowrap }
tr:last-child td { border-bottom: 0 }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--lime) 16%, transparent) }
.pill.bad { color: var(--warn); background: var(--warn-bg) }
.warn { color: var(--warn); font-size: 13px }
.totals { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 13px 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); background: var(--panel-2); border-radius: 0 0 12px 12px }
.totals b { color: var(--ink); font-family: var(--f-mono); font-weight: 500 }
.sample { font-size: 12px; font-weight: 600; color: var(--link) }
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

.beta { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); background: var(--lime); border-radius: 99px; padding: 2px 8px; vertical-align: middle; margin-left: 8px; position: relative; top: -3px }
.feedback { padding: 18px 20px; display: grid; gap: 12px }
.feedback h2 { font-size: 17px; font-weight: 600; margin: 0 }
.feedback p { margin: 0; color: var(--muted); font-size: 13.5px }
.fb-opts { display: flex; flex-wrap: wrap; gap: 8px }
.fb-opts label { border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 13.5px; cursor: pointer; background: var(--field) }
.fb-opts input { position: absolute; opacity: 0; width: 1px; height: 1px }
.fb-opts label:has(input:checked) { background: var(--lime); color: var(--accent-ink); border-color: var(--lime); font-weight: 600 }
.fb-opts label:has(input:focus-visible) { outline: 2px solid var(--lime); outline-offset: 2px }
.feedback textarea, .feedback input[type=email] { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-family: var(--f-body); font-size: 14px; padding: 9px 11px }
.feedback textarea { min-height: 84px; resize: vertical }
.feedback textarea:focus, .feedback input[type=email]:focus { outline: 2px solid color-mix(in srgb, var(--lime) 35%, transparent); border-color: var(--lime) }
.fb-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.fb-row input[type=email] { flex: 1 1 220px; width: auto }
.fb-row .btn { width: auto; padding: 10px 20px; font-size: 15px }
.hp { position: absolute; left: -9999px }
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 16px }
.site-foot strong { color: var(--ink); font-weight: 600 }

/* ---- barra de navegación del sitio ---- */
.topnav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 18px 14px; border-bottom: 4px solid var(--lime) }
.topnav .logo { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; min-width: 0 }
.topnav .logo .brandmark { height: 36px; width: auto; flex: none; color: var(--ink) }
.topnav .logo .tag { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: 14px; line-height: 1.3 }
.navlinks { display: flex; gap: 4px; flex-wrap: wrap }
.navlinks a { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 8px 14px; border-radius: 99px; border: 1px solid transparent; white-space: nowrap; transition: color .15s, border-color .15s }
.navlinks a:hover { color: var(--ink); border-color: var(--line) }
.navlinks a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px }
.topnav .navlinks { margin-left: auto }
.topnav a.login { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; transition: border-color .15s }
.topnav a.login:hover { border-color: var(--lime) }
.topnav a.login:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px }
.topnav .login-ico { width: 16px; height: 16px; color: var(--lime); flex: none }
.navlinks a[aria-current="page"] { background: var(--lime); color: var(--accent-ink); font-weight: 600 }
.pagehead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 28px; padding-top: 4px }
.pagehead h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -0.015em; margin: 0; line-height: 1.1; text-wrap: balance }
.pagehead p { margin: 0; color: var(--muted); max-width: 60ch; font-size: 14.5px }
@media (max-width: 640px) {
  .topnav .logo .tag { display: none }
  .topnav .logo .brandmark { height: 30px }
  .navlinks { width: 100%; min-width: 0; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none }
  .topnav > * { min-width: 0 }
  .wrap > * { min-width: 0; max-width: 100% }
  .topnav a.login { order: 2; margin-left: auto; padding: 6px 12px; font-size: 14px }
  .topnav .navlinks { order: 3; margin-left: 0 }
  .navlinks a { padding: 7px 12px; font-size: 14px }
}
