/* Dibujo Técnico II interactivo — estilos propios (se apoyan en bf-tools.css y premium.css).
   Las figuras usan forma, trazo y texto además del color; los colores de las figuras se definen con variables para poder imprimir en papel. */
.dt-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dt-back { margin: 18px 0 0; font-size: .9rem; color: var(--bf-muted); }
.dt-back a { display: inline-block; padding: 6px 0; min-height: 24px; }
.dt-back a { color: var(--bf-cyan); }
.dt-list { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 6px; line-height: 1.55; }
.dt-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin-top: 10px; }
.dt-cols h3 { margin: 10px 0 6px; font-size: 1rem; }
.dt-mono { font-family: var(--bf-font-mono, ui-monospace, Menlo, Consolas, monospace); }

/* pestañas */
.dt-tabs { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin: 0 0 16px; padding: 4px; border-radius: 14px; border: 1px solid var(--bf-border); max-width: 100%; }
.dt-tabs a { border: 0; background: transparent; color: var(--bf-muted); font: inherit; font-weight: 700; font-size: .92rem; padding: 10px 16px; min-height: 44px; border-radius: 10px; text-decoration: none; display: inline-flex; align-items: center; }
.dt-tabs a[aria-current="page"] { background: #5a3fd6; color: #fff; }
.dt-tabs a:focus-visible { outline: 3px solid var(--bf-cyan); outline-offset: 2px; }

/* lienzo */
.dt-cv { display: grid; gap: 10px; }
.dt-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.dt-toolgroup { min-width: 0; border: 1px solid var(--bf-border); border-radius: 12px; background: color-mix(in srgb, var(--bf-panel, var(--bf-bg)) 75%, transparent); }
.dt-toolgroup summary { cursor: pointer; min-height: 38px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; color: var(--bf-muted); font-size: .78rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.dt-toolgroup summary::after { content: '＋'; font-size: 1rem; }
.dt-toolgroup[open] summary::after { content: '−'; }
.dt-toolgroup__items { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 8px; }
.dt-tool { min-height: 42px; flex: 1 1 auto; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--bf-border-strong, var(--bf-border)); background: transparent; color: var(--bf-ink); font: inherit; font-weight: 600; font-size: .84rem; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.dt-tool.is-on { background: #5a3fd6; border-color: #5a3fd6; color: #fff; }
.dt-tool:focus-visible, .dt-cell:focus-visible, .dt-obj:focus-visible, .dt-svg:focus-visible, .dt-fig:focus-visible { outline: 3px solid var(--bf-cyan); outline-offset: 2px; }
.dt-stage { position: relative; border: 1px solid var(--bf-border-strong, var(--bf-border)); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 32px color-mix(in srgb, #000 12%, transparent); }
.dt-svg { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.dt-status { margin: 0; min-height: 1.5em; padding: 7px 10px; border-left: 3px solid var(--bf-cyan); font-size: .92rem; color: var(--bf-ink); background: color-mix(in srgb, var(--bf-cyan) 7%, transparent); }
.dt-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dt-bar .bt-btn { min-height: 40px; padding: 6px 12px; font-size: .85rem; }
.dt-chk { display: inline-flex; gap: 6px; align-items: center; font-size: .88rem; min-height: 40px; }
.dt-chk input { width: 18px; height: 18px; }
.dt-menu { border: 1px solid var(--bf-border); border-radius: 12px; padding: 8px 12px; }
.dt-menu summary { cursor: pointer; font-weight: 700; min-height: 36px; display: flex; align-items: center; }
.dt-menu__body { display: grid; gap: 10px; padding: 8px 0; }
.dt-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: end; }
.dt-params { display: contents; }
.dt-objlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dt-obj { width: 100%; text-align: left; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--bf-ink); font: inherit; font-size: .88rem; padding: 6px 8px; min-height: 36px; cursor: pointer; }
.dt-obj.is-on { border-color: var(--bf-brand); background: color-mix(in srgb, var(--bf-brand) 12%, transparent); }

/* disposición del taller */
.dt-work { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .dt-work { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); align-items: start; } }
.dt-side { display: grid; gap: 12px; }
.dt-side h3 { margin: 0 0 6px; font-size: 1.02rem; }
.dt-data { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
.dt-steps { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: dtstep; }
.dt-steps li { counter-increment: dtstep; display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--bf-border); border-radius: 10px; line-height: 1.5; font-size: .92rem; }
.dt-steps li::before { content: counter(dtstep); flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--bf-ink) 10%, transparent); font: 800 .8rem/1 var(--bf-font-mono, monospace); }
.dt-steps li.is-done { border-color: var(--bt-ok); background: color-mix(in srgb, var(--bt-ok) 8%, transparent); }
.dt-steps li.is-done::before { content: "✓"; background: var(--bt-ok); color: #04101c; }
.dt-steps li.is-locked { color: var(--bf-muted); border-style: dashed; }
.dt-steps li.is-locked::before { content: "🔒"; background: transparent; font-size: .9rem; }
.dt-hintbox { margin: 0; padding: 10px 14px; border-left: 4px solid var(--bf-cyan); border-radius: 8px; background: color-mix(in srgb, var(--bf-cyan) 8%, transparent); }
.dt-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; color: var(--bf-muted); }
.dt-pickrow { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.dt-exbtn { display: grid; gap: 4px; text-align: left; padding: 12px 14px; min-height: 64px; border: 1px solid var(--bf-border-strong, var(--bf-border)); border-radius: 14px; background: transparent; color: var(--bf-ink); font: inherit; cursor: pointer; }
.dt-exbtn:hover { border-color: var(--bf-cyan); }
.dt-exbtn:focus-visible { outline: 3px solid var(--bf-cyan); outline-offset: 2px; }
.dt-exbtn strong { font-size: .98rem; }
.dt-exbtn span { font-size: .82rem; color: var(--bf-muted); }
.dt-exbtn.is-done { border-color: var(--bt-ok); }
.dt-logrow { font-size: .85rem; }

/* Entrada por tipos de problema PAU */
.dt-homehero { padding-bottom: 10px; }
.dt-homegroup { margin-top: 18px; }
.dt-homeheading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dt-homeheading h2 { margin: 0; }
.dt-homecards { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dt-homecard { display: flex; flex-direction: column; gap: 7px; min-height: 170px; min-width: 0; text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease; }
.dt-homeactions > a { min-width: 0; }
.dt-homecard:hover { border-color: var(--bf-cyan); transform: translateY(-1px); }
.dt-homecard h3, .dt-homecard h2 { margin: 5px 0 0; font-size: 1.08rem; }
.dt-homecard p { margin: 0; color: var(--bf-muted); line-height: 1.45; }
.dt-homecard .bt-badge { align-self: flex-start; }
.dt-homeaction { margin-top: auto; color: var(--bf-cyan); font-weight: 800; }
.dt-homeactions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.dt-homeactions > a { display: flex; flex-direction: column; gap: 9px; text-decoration: none; color: inherit; }
.dt-homeactions h2 { margin: 0; font-size: 1.05rem; }
.dt-homeactions p { margin: 0; color: var(--bf-muted); line-height: 1.45; }
.dt-primarycard { border-color: color-mix(in srgb, var(--bf-brand) 50%, var(--bf-border)); }
.dt-homeprogress { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 14px; border-top: 1px solid var(--bf-border); border-bottom: 1px solid var(--bf-border); }
.dt-homeprogress div { display: grid; gap: 3px; }
.dt-homeprogress span, .dt-source-note { color: var(--bf-muted); }
.dt-learncards { margin-top: 14px; }
@media (max-width: 700px) {
  .dt-homecards, .dt-homeactions { grid-template-columns: 1fr; }
  .dt-homecard { min-height: 130px; }
  .dt-homeheading, .dt-homeprogress { align-items: flex-start; flex-direction: column; }
  .dt-homeprogress .bt-btn { width: 100%; box-sizing: border-box; }
}

/* figuras (variables para poder imprimir en papel) */
.dt-fig, .dt-paper { --f-bg: #0d1322; --f-ink: #e9eeff; --f-a: #9db8ff; --f-b: #ffb86b; --f-aux: #9aa7cf; --f-res: #3ddc97; --f-lt: #e9eeff; --f-grid: #26335a; --f-hid: #8ea0d6; --f-hatch: #9aa7cf; }
:root.theme-light .dt-fig, :root[data-theme="light"] .dt-fig, .dt-fig.dt-paper, .dt-paper { --f-bg: #fff; --f-ink: #1a2038; --f-a: #2347b8; --f-b: #b45309; --f-aux: #525a78; --f-res: #0b7a4f; --f-lt: #1a2038; --f-grid: #cbd2e6; --f-hid: #3d4668; --f-hatch: #3d4668; }
.dt-paper { --f-grid: #d2d2d2; --f-a: #000; --f-b: #333; --f-aux: #555; --f-res: #000; --f-lt: #000; --f-ink: #000; --f-hid: #000; --f-hatch: #000; }
.dt-fig { display: block; width: 100%; height: auto; max-height: 72vh; background: var(--f-bg); border-radius: 12px; border: 1px solid var(--bf-border-strong, var(--bf-border)); }
.dt-fig line, .dt-fig polygon, .dt-fig circle, .dt-fig path { vector-effect: non-scaling-stroke; }
/* cuadrícula de referencia: fina y discreta, detrás de todo; las líneas principales (cada 5) son algo más marcadas */
.dt-fig .f-gridg { pointer-events: none; }
.dt-fig .f-gm { stroke: var(--f-grid); stroke-width: .6; opacity: .3; fill: none; }
.dt-fig .f-gM { stroke: var(--f-grid); stroke-width: .9; opacity: .6; fill: none; }
.no-grid .f-gridg { display: none; }
.dt-fig .f-lt { stroke: var(--f-lt); stroke-width: 2; }
.dt-fig .f-a { stroke: var(--f-a); stroke-width: 1.8; fill: none; }
.dt-fig .f-b { stroke: var(--f-b); stroke-width: 1.8; fill: none; }
.dt-fig .f-aux { stroke: var(--f-aux); stroke-width: 1.1; fill: none; }
.dt-fig .f-res { stroke: var(--f-res); stroke-width: 2.2; fill: none; }
.dt-fig .f-dash { stroke-dasharray: 6 4; }
.dt-fig .f-fill.f-a { fill: color-mix(in srgb, var(--f-a) 18%, transparent); } .dt-fig .f-fill.f-b { fill: color-mix(in srgb, var(--f-b) 18%, transparent); } .dt-fig .f-fill.f-res { fill: color-mix(in srgb, var(--f-res) 22%, transparent); }
.dt-fig .f-dot { fill: currentColor; stroke: none; }
.dt-fig .f-dot.f-a { fill: var(--f-a); } .dt-fig .f-dot.f-b { fill: var(--f-b); } .dt-fig .f-dot.f-res { fill: var(--f-res); } .dt-fig .f-dot.f-aux { fill: var(--f-aux); }
.dt-fig .f-txt { fill: var(--f-ink); font-family: Arial, sans-serif; stroke: none; }
.dt-fig .f-txt.f-a { fill: var(--f-a); } .dt-fig .f-txt.f-b { fill: var(--f-b); } .dt-fig .f-txt.f-res { fill: var(--f-res); }
.dt-fig .f-vis { stroke: var(--f-ink); stroke-width: 2.8; stroke-linecap: round; }
.dt-fig .f-hid { stroke: var(--f-hid); stroke-width: 1.3; stroke-dasharray: 5 4; }
.dt-fig .f-hid-mark { stroke: var(--f-b); stroke-width: 2.4; stroke-dasharray: 5 4; }
.dt-fig .f-hatch { stroke: var(--f-hatch); stroke-width: 1; }
.dt-fig .f-dim { stroke: var(--f-ink); stroke-width: 1; }
.dt-fig .f-dimarrow { fill: var(--f-ink); stroke: none; }
.dt-fig .f-node { fill: var(--f-aux); stroke: none; cursor: pointer; } .dt-fig .f-node.is-on { fill: var(--f-b); } .dt-fig .f-node:hover { fill: var(--f-b); }
.dt-measures { list-style: none; margin: 0; padding: 0; font-size: .88rem; color: var(--bf-muted); } .dt-measures:empty { display: none; }
.dt-fig .f-hit { stroke: transparent; stroke-width: 16; cursor: pointer; pointer-events: stroke; }
.dt-fig .f-hit:hover { stroke: color-mix(in srgb, var(--f-b) 35%, transparent); }
.dt-zbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.dt-zbar .bt-btn { min-height: 40px; padding: 6px 12px; font-size: .85rem; }
.dt-figwrap { display: grid; gap: 4px; }
.dt-figs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.dt-figs figure { margin: 0; display: grid; gap: 4px; }
.dt-figs figcaption { font-size: .85rem; color: var(--bf-muted); text-align: center; }

/* casillas y editor */
.dt-cells { --dt-cell: 2.4rem; display: grid; gap: 3px; width: max-content; max-width: 100%; }
.dt-cell { width: var(--dt-cell); height: var(--dt-cell); min-width: 32px; min-height: 32px; border: 1px solid var(--bf-border-strong, var(--bf-border)); border-radius: 6px; background: transparent; color: var(--bf-ink); font: 800 .95rem/1 var(--bf-font-mono, monospace); cursor: pointer; padding: 0; }
.dt-cell.is-on { background: #5a3fd6; border-color: #5a3fd6; color: #fff; }
.dt-cell.is-ok { box-shadow: inset 0 0 0 3px var(--bt-ok); }
.dt-cell.is-bad { box-shadow: inset 0 0 0 3px var(--bt-bad); }
.dt-cell.is-miss { background: repeating-linear-gradient(45deg, transparent 0 5px, color-mix(in srgb, var(--bt-warn) 60%, transparent) 5px 8px); border-color: var(--bt-warn); }
.dt-cell--n.is-on { background: #5a3fd6; }
.dt-scroll { overflow-x: auto; }
.pz-cubos[hidden], .pz-solidsel[hidden], .pz-secc[hidden] { display: none !important; }
.dt-fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.dt-controls { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: end; margin: 8px 0; }
.dt-timer { font: 800 1.4rem/1 var(--bf-font-mono, monospace); }
.dt-timer.is-low { color: var(--bt-bad); }
.dt-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dt-table th, .dt-table td { padding: 8px 10px; border-bottom: 1px solid var(--bf-border); text-align: left; vertical-align: top; }
.dt-table thead th { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--bf-muted); }
.dt-tablewrap { overflow-x: auto; }
.dt-pre { white-space: pre-wrap; font: .85rem/1.5 var(--bf-font-mono, monospace); margin: 0; }

/* impresión: sólo la zona de trabajo */
@media print {
  body.dt-printing .bf-header, body.dt-printing .bf-footer, body.dt-printing .dt-tabs, body.dt-printing .dt-tools, body.dt-printing .dt-bar, body.dt-printing .dt-zbar, body.dt-printing .dt-menu, body.dt-printing .dt-noprint, body.dt-printing .bf-skip-link, body.dt-printing .toast-container, body.dt-printing #bf-cookie-banner { display: none !important; }
  body.dt-printing, body.dt-printing .bt-page, body.dt-printing .bt-card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  body.dt-printing .dt-work { display: block; }
  body.dt-printing .dt-fig, body.dt-printing .dt-svg { max-height: none; border: 1px solid #000; }
  body.dt-printing .dt-fig { --f-bg: #fff; --f-ink: #000; --f-a: #000; --f-b: #333; --f-aux: #555; --f-res: #000; --f-lt: #000; --f-hid: #000; --f-hatch: #000; }
}
@media (max-width: 700px) {
  .dt-tools { grid-template-columns: 1fr; }
  .dt-work { gap: 10px; }
  .dt-stage { border-radius: 10px; }
  .dt-bar { position: static; padding: 8px; border: 1px solid var(--bf-border); border-radius: 12px; background: color-mix(in srgb, var(--bf-bg) 90%, transparent); }
  .dt-bar .bt-btn { flex: 1 1 auto; }
}

/* Espacio 3D del sistema diédrico */
.e3-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; margin-top: 8px; }
@media (max-width: 960px) { .e3-layout { grid-template-columns: minmax(0, 1fr); } }
.e3-main, .e3-side { min-width: 0; display: grid; gap: 12px; }
.e3-side .bt-card { margin: 0; }
.e3-stage { position: relative; }
.dt-fig3d { cursor: grab; touch-action: none; max-height: 76vh; user-select: none; -webkit-user-select: none; }
.dt-fig3d:active { cursor: grabbing; }
.dt-fig3d:focus-visible { outline: 3px solid var(--f-b); outline-offset: 2px; }
.dt-fig3d .f3-plane { stroke: var(--f-aux); stroke-width: 1; }
.dt-fig3d .f3-pv .f3-plane { fill: color-mix(in srgb, var(--f-a) 16%, transparent); }
.dt-fig3d .f3-ph .f3-plane { fill: color-mix(in srgb, var(--f-res) 14%, transparent); }
.dt-fig3d .f3-pp .f3-plane { fill: color-mix(in srgb, var(--f-b) 14%, transparent); }
.dt-fig3d .f3-g { stroke: var(--f-grid); stroke-width: .7; opacity: .75; fill: none; }
.dt-fig3d .f3-axis { stroke: var(--f-ink); stroke-width: 1.2; opacity: .8; }
.dt-fig3d .f3-lt { stroke: var(--f-lt); stroke-width: 2.6; }
.dt-fig3d .f3-lbl { opacity: .8; }
.dt-fig3d .f3-face { fill: var(--f-a); stroke: none; }
.dt-fig3d .f3-face.f3-q { stroke: var(--f-ink); stroke-width: .8; }
.dt-fig3d .f3-face.f3-opt { fill: var(--f-b); }
.dt-fig3d .f3-face.f3-hl { fill: var(--f-res); opacity: 1 !important; }
.dt-fig3d .f3-vis { stroke: var(--f-ink); stroke-width: 1.9; stroke-linecap: round; pointer-events: none; }
.dt-fig3d .f3-hid { stroke: var(--f-hid); stroke-width: 1.3; stroke-dasharray: 5 4; pointer-events: none; }
.dt-fig3d .f3-proj { stroke: var(--f-b); stroke-width: 1.8; stroke-linecap: round; }
.dt-fig3d .f3-proj.f3-hid { stroke: var(--f-b); opacity: .8; stroke-width: 1.3; }
.dt-fig3d .f3-ray { stroke: var(--f-aux); stroke-width: .9; stroke-dasharray: 2 4; }
.e3-views { margin-top: 10px; }
.e3-toggles { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.e3-cams { margin: 0; }
.e3-ed { display: grid; gap: 14px; }
.e3-ed figure { margin: 0; display: grid; gap: 4px; }
.e3-ed figcaption { font-weight: 700; font-size: .9rem; }
.dt-cell.is-hl { outline: 3px solid #ffd166; outline-offset: -2px; }
@media (max-width: 700px) { .e3-ed .dt-cells { --dt-cell: 2rem; } }
/* ---------- Aprender, dibujo libre e inicio ---------- */
.dt-modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.dt-start { margin: 18px 0 8px; }
.dt-start h2 { margin: 0 0 10px; font-size: 1.2rem; }
.dt-startcards { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .dt-startcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .dt-startcards { grid-template-columns: 1fr; } }
.dt-lsteps { margin: 0; padding-left: 1.2rem; display: grid; gap: 8px; }
.dt-lsteps li { color: var(--bf-muted); line-height: 1.45; }
.dt-lsteps li.is-current { color: var(--bf-ink, #e9eeff); font-weight: 600; }
.dt-lsteps li.is-done { color: var(--bf-muted); }
.dt-lgoals li.is-done { color: #3ddc97; }
.dt-lhint { color: var(--bf-muted); font-weight: 400; }
.dt-lsay { font-size: 1.02rem; line-height: 1.5; margin: 6px 0; }
.dt-lcount { margin: 0; font-weight: 700; }
.dt-lmsg { margin-top: 10px; }
.dt-side h1 { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.25; }
.dt-side h2 { margin: 0 0 6px; font-size: 1.02rem; }
.dt-fig polyline { vector-effect: non-scaling-stroke; }
.dl-svg { cursor: crosshair; touch-action: none; }
.dl-pt { cursor: grab; }
.dl-svg .dl-lbl { paint-order: stroke; stroke: var(--f-bg); stroke-width: 3px; }
