body { overflow-x: clip; }
.chuleta.sim { width: min(1440px, calc(100vw - 32px)); margin-left: calc(50% - min(720px, 50vw - 16px)); }
.sa { --sa-blue: #1f5fbf; --sa-red: #c62828; --sa-yel: #e0b400; --sa-brass: #c9a227; --sa-bench: #e7ecef; --sa-grid: #d6dde2; --sa-bad: #b3261e; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); min-width: 0; }
@media (prefers-color-scheme: dark) { .sa { --sa-bench: #1b252d; --sa-grid: #24313b; --sa-bad: #ff8a80; } }
.sa-bar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 8px 10px; }
.sa-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 99px; overflow: hidden; }
.sa-seg button { border: 0; background: transparent; color: var(--ink); font: 700 14px var(--body); min-height: 40px; padding: 0 12px; cursor: pointer; }
.sa-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.sa-pick { display: inline-flex; align-items: center; gap: 6px; font: 700 13px var(--body); color: var(--muted); }
.sa-pick select { min-height: 40px; max-width: 230px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: 500 14px var(--body); padding: 0 6px; }
.sa-clock { font: 600 14px var(--mono); font-variant-numeric: tabular-nums; padding: 0 4px; }
.sa-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sa-btn { min-height: 40px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: 700 14px var(--body); cursor: pointer; }
.sa-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sa-btn[aria-pressed="true"] { background: var(--done); border-color: var(--done); color: var(--sheet); }
.sa-status { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 46px); z-index: 12; margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--today); border: 1px solid var(--rule); font-size: 15px; min-height: 42px; overflow-wrap: anywhere; }
.sa-status.warn { background: var(--warn); color: var(--warn-ink); }
.sa-status.bad { background: var(--sa-bad); color: #fff; }
.sa-status.ok { background: var(--done); color: var(--sheet); }
.sa-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); min-width: 0; }
.sa-pal { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 8px; min-width: 0; overflow-x: hidden; }
.sa-pal h2 { margin: 0 0 6px; font: 600 15px var(--display); }
.sa-pal-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.sa-pal-list h3 { display: none; }
.sa-pi { flex: none; width: 84px; display: grid; justify-items: center; gap: 2px; padding: 4px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink); font: 600 11px/1.15 var(--body); text-align: center; cursor: grab; touch-action: pan-x; user-select: none; }
.sa-pi svg { width: 56px; height: 48px; pointer-events: none; }
.sa-pi:active { cursor: grabbing; }
.sa-bench { position: relative; height: max(420px, 62vh); border-radius: 14px; border: 1px solid var(--rule); overflow: hidden; background: var(--sa-bench); background-image: linear-gradient(var(--sa-grid) 1px, transparent 1px), linear-gradient(90deg, var(--sa-grid) 1px, transparent 1px); background-size: 32px 32px; }
#sa-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; font-family: var(--body); }
#sa-svg text { pointer-events: none; }
#sa-svg .ctl { cursor: pointer; }
.sa .hit, .sa .hit * { fill: transparent !important; stroke: transparent !important; stroke-width: 14px !important; vector-effect: non-scaling-stroke; }
.sa-pi .hit { display: none; }
#sa-svg [data-comp] { cursor: move; }
#sa-svg .port { cursor: crosshair; }
#sa-svg .port circle.v, #sa-svg .port .ring { vector-effect: non-scaling-stroke; }
#sa-svg .port .ring { stroke: #e8a600; stroke-width: 2.5px; opacity: 0; transform-box: fill-box; transform-origin: center; }
#sa-svg .port:not(.on):hover .ring { opacity: .9; animation: sa-port-pulse 1.2s ease-in-out infinite; }
#sa-svg .port.on .pa { filter: drop-shadow(0 .6px .6px rgba(0,0,0,.45)); }
#sa-svg .port.armed circle.v { stroke: #e8a600; stroke-width: 4px; }
#sa-svg .port.armed .ring { opacity: 1; stroke: #e8a600; stroke-width: 3px; animation: sa-port-pulse .9s ease-in-out infinite; }
#sa-svg .port.can circle.v { stroke: #2f9e44; stroke-width: 3px; }
#sa-svg .port.can .ring { opacity: 1; stroke: #2f9e44; stroke-width: 2.5px; animation: sa-port-pulse 1.2s ease-in-out infinite; }
@keyframes sa-port-pulse { 0%, 100% { transform: scale(.92); stroke-opacity: .95; } 50% { transform: scale(1.18); stroke-opacity: .35; } }
@media (prefers-reduced-motion: reduce) { #sa-svg .port .ring { animation: none !important; } }
#sa-svg .wire { cursor: pointer; }
#sa-svg .wire:hover .vis { filter: brightness(1.25); }
#sa-svg .sel > g > rect:first-child { stroke: var(--accent); stroke-width: 3; }
.sa-zoom { position: absolute; right: 8px; top: 8px; display: grid; gap: 6px; }
.sa-zoom button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); font: 700 20px var(--body); cursor: pointer; }
.sa-tip { position: absolute; z-index: 30; pointer-events: none; max-width: 260px; background: var(--ink); color: var(--paper); font: 600 13px/1.3 var(--body); padding: 6px 9px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.sa-eq { position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: 62%; overflow: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.25); padding: 8px 10px; z-index: 20; }
.sa-eq-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sa-eq-head button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: 700 20px var(--body); cursor: pointer; }
.sa-eq svg { width: 100%; max-height: 52vh; display: block; touch-action: manipulation; }
.sa-eq .ctl { cursor: pointer; }
.sa-eq-info { font-size: 14px; margin: 6px 0 0; }
.sa-eq-info p { margin: 4px 0; }
.sa-eq-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sa-side { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 8px 12px 12px; min-width: 0; }
.sa-tab h3 { font: 600 16px var(--display); margin: 10px 0 4px; }
.sa-tab ul, .sa-tab ol { padding-left: 1.2em; margin: 6px 0; display: grid; gap: 4px; font-size: 14px; }
.sa-steps { list-style: none; padding: 0 !important; counter-reset: st; }
.sa-steps li { display: grid; grid-template-columns: 26px 1fr; gap: 6px; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.sa-steps li::before { counter-increment: st; content: counter(st); width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; font: 700 12px var(--mono); }
.sa-steps li.cur { background: var(--today); }
.sa-steps li.cur::before { border-color: var(--accent); color: var(--accent); }
.sa-steps li.done::before { content: "✓"; background: var(--done); border-color: var(--done); color: var(--sheet); }
.sa-steps li.late::before { content: "!"; background: var(--warn-ink); border-color: var(--warn-ink); color: var(--warn); }
.sa-steps li.fail::before { content: "✗"; background: var(--sa-bad); border-color: var(--sa-bad); color: #fff; }
.sa-steps small { display: block; color: var(--muted); font-size: 12px; }
.sa-score { font: 700 20px var(--display); margin: 8px 0; }
.sa-inc { font-size: 13px; color: var(--warn-ink); }
.sa-inc li.bad { color: var(--sa-bad); }
.sa-note { font-size: 12.5px; color: var(--muted); background: var(--paper); border-radius: 6px; padding: 6px 8px; margin: 6px 0; }
.sa-codes { margin: 6px 0; font-size: 13px; }
.sa-codes summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.sa-codes-t { max-height: 260px; overflow: auto; }
.sa-codes-t table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sa-codes-t td { border-top: 1px solid var(--line, #dde3e6); padding: 3px 6px; vertical-align: top; }
.sa-form { display: grid; gap: 6px; margin: 8px 0; font-size: 14px; }
.sa-form label { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sa-form input, .sa-form select, .sa-hoja input, .sa-hoja select { min-height: 36px; border-radius: 8px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: 500 14px var(--mono); padding: 0 6px; max-width: 100%; }
.sa-form input { width: 7em; }
.sa-hoja table { font-size: 13px; }
.sa-hoja td { vertical-align: middle; padding: 4px; }
.sa-hoja input { width: 5.2em; }
.sa-hoja .ok { color: var(--done); font-weight: 700; }
.sa-hoja .ko { color: var(--sa-bad); font-weight: 700; }
.sa-hoja .cap { min-height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--rule); background: var(--paper); color: var(--accent); font: 700 12px var(--body); cursor: pointer; }
.sa-wiring svg { width: 100%; max-width: 520px; display: block; margin: 0 auto; touch-action: manipulation; }
.sa-cab-hint { margin: 4px 0 6px; font-size: 14px; }
.sa-wiring .sa-scr.turn .slot { animation: sa-screw-turn .55s ease-out; }
@keyframes sa-screw-turn { from { transform: rotate(-150deg); } to { transform: rotate(45deg); } }
.sa-wiring .sa-ctip .ring { transform-box: fill-box; transform-origin: center; animation: sa-port-pulse 1s ease-in-out infinite; }
.sa-wiring [data-t]:hover > rect:first-of-type { stroke: var(--accent); stroke-width: 2; }
@media (prefers-reduced-motion: reduce) { .sa-wiring .sa-scr.turn .slot, .sa-wiring .sa-ctip .ring { animation: none; } }
.sa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.sa-chips button { min-height: 40px; padding: 0 10px; border-radius: 99px; border: 2px solid var(--rule); background: var(--paper); color: var(--ink); font: 700 13px var(--body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.sa-chips button i { width: 18px; height: 10px; border-radius: 5px; display: inline-block; }
.sa-chips button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
#sa-print { display: none; }
@media (min-width: 980px) {
  .sa-main { grid-template-columns: 176px minmax(0, 1fr) 340px; align-items: start; }
  .sa-main > .sa-pal { grid-column: 1; grid-row: 1 / span 3; }
  .sa-main > .sa-prof, .sa-main > .sa-bench { grid-column: 2; }
  .sa-main > .sa-side { grid-column: 3; grid-row: 1 / span 3; }
  .sa-pal { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; }
  .sa-pal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .sa-pi { touch-action: pan-y; }
  .sa-pal-list h3 { display: block; grid-column: 1 / -1; margin: 6px 0 0; font: 700 11px var(--body); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .sa-pi { width: auto; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
  .sa-bench { height: calc(100vh - 150px); min-height: 560px; }
  .sa-eq { left: auto; width: 340px; max-height: calc(100% - 16px); }
  .sa-side { max-height: calc(100vh - 150px); overflow: auto; position: sticky; top: 100px; }
}
@media print {
  body * { visibility: hidden !important; }
  #sa-print, #sa-print * { visibility: visible !important; }
  #sa-print { display: block !important; position: absolute; left: 0; top: 0; width: 100%; color: #000; background: #fff; font: 12pt/1.4 var(--body); }
  #sa-print table { border-collapse: collapse; width: 100%; }
  #sa-print th, #sa-print td { border: 1px solid #555; padding: 4px 6px; }
  #sa-print h2 { font-size: 15pt; margin: 0 0 6px; }
  .bar, .sa-bar { display: none !important; }
}
.sa-prof { position: sticky; top: 8px; z-index: 30; background: #102a33; color: #f2f7f8; border-radius: 12px; padding: 10px 14px; margin: 8px 0; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.sa-prof-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 14px; }
.sa-prof-n { margin-left: auto; opacity: .75; font-size: 12.5px; }
.sa-prof p { margin: 6px 0 8px; font-size: 15.5px; line-height: 1.45; }
.sa-prof-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-prof .sa-btn { background: #f2f7f8; color: #102a33; }
.sa-prof .sa-btn[aria-pressed="false"] { opacity: .6; }
.sa-hl { filter: drop-shadow(0 0 4px #ffb000) drop-shadow(0 0 8px #ffb000); animation: sa-hl-pulse 1.1s ease-in-out infinite; }
@keyframes sa-hl-pulse { 50% { filter: drop-shadow(0 0 1px #ffb000) drop-shadow(0 0 3px #ffb000); } }
@media (prefers-reduced-motion: reduce) { .sa-hl { animation: none; } }
@media print { .sa-prof { display: none; } }
.sa-main > * { min-width: 0; }
@media (max-width: 979px) {
  .sa-eq { max-height: calc(100% - 16px); }
  .sa-eq-head { position: sticky; top: -8px; z-index: 1; background: var(--sheet); margin: -8px -10px 0; padding: 8px 10px 4px; }
  .sa-eq svg { max-height: 38vh; }
  .sa-eq:has(.sa-codes[open]) svg { max-height: 16vh; }
  .sa-codes summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; }
  .sa-codes-t { max-height: none; overflow: visible; }
  .sa-codes-t table { font-size: 14px; line-height: 1.35; }
  .sa-codes-t td { padding: 6px; }
  .sa-codes-t td:first-child { width: 2.6em; text-align: center; }
  .sa-eq-info { font-size: 15px; }
  .sa-eq-row .sa-btn { min-height: 44px; }
}
@media (max-width: 600px) {
  .sa-status { font-size: 13.5px; line-height: 1.35; padding: 6px 10px; min-height: 0; }
}
.sa-avx { margin-top: var(--s4, 24px); padding-top: var(--s3, 16px); border-top: 1px solid var(--rule); display: grid; gap: 8px; min-width: 0; }
.sa-card { margin: 0; padding: 10px 12px; display: grid; gap: 2px; font-size: 14px; line-height: 1.45; }
.sa-card dt { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; margin-top: 8px; color: var(--accent, inherit); }
.sa-card dt:first-child { margin-top: 0; }
.sa-card dd { margin: 0; overflow-wrap: anywhere; }
.sa-cardw { margin-top: 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); }
.sa-cardw h4 { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--rule); font-size: 15px; }
#sa-hoja select[data-h="av"] { display: block; width: 100%; max-width: 100%; min-height: 44px; margin-top: 4px; }
.sa-lk { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; flex: none; }
.sa-locked { cursor: pointer; }
.sa-seg button.sa-locked, .sa-side [role=tab].sa-locked, .sa-btn.sa-locked { opacity: .78; }
.sa-pick.sa-locked select { pointer-events: none; opacity: .78; }
.sa-link { border: 0; background: none; padding: 0; color: var(--accent); font: 700 14px var(--body); text-decoration: underline; cursor: pointer; min-height: 32px; }
.sa-up { position: fixed; z-index: 1000; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(400px, calc(100vw - 32px)); max-height: 80vh; overflow: auto; box-sizing: border-box; padding: 14px 16px; background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.3); outline: none; }
.sa-up[hidden] { display: none; }
.sa-up p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.4; }
.sa-up h3 { margin: 0 0 6px; font: 600 17px var(--display); padding-right: 36px; }
.sa-up-ctx { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding-right: 36px; }
.sa-up-price { font-weight: 700; }
.sa-up-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sa-up-acts .sa-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex: 1 1 140px; }
.sa-up-x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: 700 20px var(--body); cursor: pointer; }
@media (max-width: 600px) { .sa-up { left: 8px; right: 8px; width: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); } }

.sa-pal-up { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: #13202a; color: #f2f5f7; font: 500 13px/1.4 var(--body); display: grid; gap: 8px; justify-items: start; }
.sa-pal-up .sa-btn.primary { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border-radius: 10px; background: #f0c04a; border: 1px solid #f0c04a; color: #13202a; font-weight: 800; text-decoration: none; }
.sa-pal-up .sa-btn.primary:focus-visible { outline: 2px solid #f0c04a; outline-offset: 2px; }
@media (max-width: 979px) { .sa-pal-up { grid-auto-flow: column; justify-content: space-between; align-items: center; justify-items: stretch; } }
@media (max-width: 600px) {
  .sa-bar { gap: 6px 8px; padding: 6px 8px; }
  .sa-pick { flex: 1 1 100%; min-width: 0; }
  .sa-pick select { flex: 1 1 0; width: 0; min-width: 0; max-width: none; }
  .sa-acts { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -8px; padding: 0 8px 2px; scroll-padding-inline: 8px; }
  .sa-acts::-webkit-scrollbar { display: none; }
  .sa-acts > * { flex: none; }
  .sa-acts .sa-pick select { flex: none; width: auto; }
  .sa-bench { height: max(360px, 58vh); }
  .sa-zoom { grid-auto-flow: column; }
  .sa-eq { max-height: calc(100% - 68px); }
}
@media (max-height: 560px) and (orientation: landscape) {
  .sa-bench { height: max(260px, calc(100vh - 24px)); }
  .sa-zoom { grid-auto-flow: column; }
  .sa-eq { max-height: calc(100% - 68px); }
}
@media (max-width: 979px) {
  .chuleta.sim { width: auto; margin-left: 0; }
}
@media (max-width: 600px) {
  .sa-prof-head { flex-wrap: nowrap; font-size: 13px; }
  .sa-prof-head span:not(.sa-prof-n) { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sa-prof-n { flex: none; }
}
