/* «Instrumento». La web como un aparato de hardware de lujo: carcasa gris cálido, pantallas LCD hundidas,
   teclas en relieve que se hunden al pulsarlas, pilotos, rótulos serigrafiados en mono y un único naranja de señal. */
@font-face { font-family: "Mono"; src: url("f-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Mono"; src: url("f-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Mono"; src: url("f-mono-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Narrow"; src: url("f-narrow.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --body: #cfccc5; --shell: #e9e7e2; --panel: #f3f2ee; --panel2: #dcd9d3;
  --ink: #1d1d1b; --ink2: #5f5d58; --ink3: #8e8b84;
  --lcd: #151613; --lcd2: #22241f; --lcd-ink: #f2efe8; --lcd-dim: #8f8c84;
  --orange: #ff5a1f; --orange-d: #c44112; --green: #3fbf6f; --red: #e5484d; --amber: #ffb020;
  --mono: "Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --narrow: "Narrow", "Archivo Narrow", "Arial Narrow", sans-serif;
  --raise: inset 0 2px 0 #fbfaf7, inset 0 -2px 0 #c9c6bf, 0 1px 0 #bdbab3;
  --sink: inset 0 2px 6px rgba(0,0,0,.55), 0 1px 0 #fbfaf6;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--body); color: var(--ink); font: 500 13px/1.5 var(--mono); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: rgba(255,90,31,.25); }

/* ---------- carcasa ---------- */
.shell { position: relative; max-width: 1180px; margin: 14px auto; border-radius: 40px; background: var(--shell); padding: 22px 24px 20px;
  box-shadow: inset 0 3px 0 #f7f6f2, inset 0 -4px 0 #c9c6bf, 0 30px 50px -24px rgba(40,36,28,.5), 0 2px 0 #b7b4ad; }
.silk { display: flex; flex-direction: column; gap: 3px; }
.silk span:first-child { font: 600 11px/1 var(--mono); letter-spacing: .24em; }
.silk span:last-child { font: 500 9px/1 var(--mono); letter-spacing: .2em; color: var(--ink2); }
.silk-label { font: 600 9px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink2); }
.led { width: 9px; height: 9px; border-radius: 50%; background: #b9b6af; box-shadow: inset 0 1px 1px rgba(0,0,0,.25); transition: background .3s, box-shadow .3s; }
.led.on-orange { background: var(--orange); box-shadow: 0 0 10px var(--orange), inset 0 -1px 1px rgba(0,0,0,.2); }
.led.on-green { background: var(--green); box-shadow: 0 0 8px var(--green), inset 0 -1px 1px rgba(0,0,0,.2); }
.led.on-red { background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1s infinite; }
.led.blink { animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.led-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.leds { display: flex; align-items: center; gap: 10px; justify-content: center; }

/* ---------- pantallas LCD ---------- */
.lcd { background: var(--lcd); color: var(--lcd-ink); border-radius: 14px; box-shadow: var(--sink); }
.lcd-clock { font: 500 13px/1 var(--mono); letter-spacing: .08em; padding: 9px 12px; border-radius: 10px; font-variant-numeric: tabular-nums; min-width: 90px; text-align: center; }

/* ---------- teclas ---------- */
.key { position: relative; border: 0; border-radius: 14px; background: var(--panel); color: var(--ink); font: 600 10px/1 var(--mono); letter-spacing: .16em;
  text-transform: uppercase; box-shadow: inset 0 2px 0 #fff, 0 4px 0 #bdbab3, 0 6px 10px -4px rgba(40,36,28,.35);
  transition: transform .08s, box-shadow .08s; padding: 12px 14px; }
.key:active, .key.pressed { transform: translateY(3px); box-shadow: inset 0 2px 0 #fff, 0 1px 0 #bdbab3, 0 2px 4px -2px rgba(40,36,28,.3); }
.key-orange { background: var(--orange); color: #fff; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 4px 0 var(--orange-d), 0 6px 12px -4px rgba(196,65,18,.55); }
.key-orange:active { box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 1px 0 var(--orange-d); }
.key-dark { background: var(--ink); color: var(--lcd-ink); box-shadow: inset 0 2px 0 #3a3a37, 0 4px 0 #000, 0 6px 12px -4px rgba(0,0,0,.5); }
.key-dark:active { box-shadow: inset 0 2px 0 #3a3a37, 0 1px 0 #000; }
.key-dark.lit { color: var(--orange); }
.key-wide { width: 100%; padding: 18px; font-size: 12px; }
.key:disabled { opacity: .5; }

/* ---------- entrada ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-shell { width: 100%; max-width: 380px; margin: 0; display: flex; flex-direction: column; gap: 18px; padding: 24px 22px 22px; }
.login-lcd { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 16px 30px; position: relative; overflow: hidden; }
.login-lcd::after, .screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 1px, transparent 1px 3px); }
.lcd-small { font: 500 10px/1 var(--mono); letter-spacing: .24em; color: var(--lcd-dim); }
.lcd-big { font: 600 64px/1 var(--narrow); letter-spacing: .04em; color: var(--orange); text-shadow: 0 0 18px rgba(255,90,31,.45); }
.blink-cursor::after { content: "_"; margin-left: 4px; color: var(--orange); animation: blink 1s steps(1) infinite; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form input { width: 100%; border: 0; border-radius: 12px; background: var(--lcd); color: var(--orange); box-shadow: var(--sink);
  font: 600 22px/1 var(--mono); letter-spacing: .4em; text-align: center; padding: 16px; outline: none; caret-color: var(--orange); }
.login-form input:focus { box-shadow: var(--sink), 0 0 0 3px rgba(255,90,31,.35); }
.login-lcd { min-height: 150px; justify-content: center; }
.lcd-dots { position: absolute; inset: 14px; border-radius: 8px; opacity: .5;
  background-image: radial-gradient(rgba(242,239,232,.16) 1px, transparent 1.4px); background-size: 9px 9px; }
.login-lcd .led { position: relative; width: 14px; height: 14px; }
.key-icon { display: grid; place-items: center; }
.key-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-shell.nope { animation: nope .45s; }
@keyframes nope { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.enroll-note { margin: 0 0 4px; font: 500 12px/1.6 var(--mono); color: var(--ink2); text-align: center; }
.enroll-note b { color: var(--orange); }
.err { color: var(--red); min-height: 1.3em; margin: -6px 0 0; font-size: 12px; text-align: center; letter-spacing: .06em; }
.login.unlock .login-shell { animation: powerup .5s var(--ease) forwards; }
@keyframes powerup { to { transform: scale(.97); opacity: 0; } }

/* ---------- cabecera y teclado ---------- */
.app-shell { display: flex; flex-direction: column; gap: 18px; min-height: calc(100vh - 28px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-right { display: flex; align-items: center; gap: 14px; }
main { flex-grow: 1; }
.keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 8px; border-radius: 20px; background: var(--panel2); box-shadow: inset 0 2px 5px rgba(40,36,28,.25); }
.keys .key { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px 10px; }
.keys .key svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.keys .key em { display: none; font-style: normal; }
.keys .key.on { background: var(--ink); color: var(--orange); box-shadow: inset 0 2px 0 #3a3a37, 0 1px 0 #000; transform: translateY(3px); }

/* ---------- módulos (paneles) ---------- */
.card { position: relative; background: var(--panel); border-radius: 22px; padding: 18px; margin-bottom: 14px; box-shadow: var(--raise); }
h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; font: 600 10px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
h2 small { font: 500 9px var(--mono); color: var(--ink3); letter-spacing: .16em; }
.s { color: var(--ink3); font-size: 12px; }
.note { color: var(--ink3); font-size: 11px; margin: 12px 0 0; line-height: 1.6; letter-spacing: .02em; }
.ok-t { color: #23874c; } .warn-t { color: #b8740a; } .crit-t { color: var(--red); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
input[type=text], input[type=password], input[type=number], input[type=time], select {
  width: 100%; border: 0; border-radius: 10px; background: var(--lcd); color: var(--lcd-ink); box-shadow: var(--sink); padding: 12px 13px; outline: none; font: 500 13px var(--mono); }
input:focus, select:focus { box-shadow: var(--sink), 0 0 0 3px rgba(255,90,31,.35); }
input::placeholder { color: var(--lcd-dim); }
select option { background: var(--lcd); }
.primary { border: 0; border-radius: 12px; padding: 13px 18px; background: var(--orange); color: #fff; font: 600 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 4px 0 var(--orange-d), 0 6px 12px -4px rgba(196,65,18,.55); transition: transform .08s, box-shadow .08s; }
.primary:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 1px 0 var(--orange-d); }
.btn { border: 0; border-radius: 10px; padding: 10px 13px; background: var(--panel); font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  box-shadow: inset 0 2px 0 #fff, 0 3px 0 #bdbab3, 0 5px 8px -4px rgba(40,36,28,.3); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 #fff, 0 1px 0 #bdbab3; }
.btn.small { padding: 8px 10px; font-size: 9px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; }
.chip { border: 0; border-radius: 8px; padding: 8px 11px; background: var(--panel); font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink2);
  box-shadow: inset 0 2px 0 #fff, 0 2px 0 #bdbab3; }
.chip.on { background: var(--ink); color: var(--orange); box-shadow: inset 0 2px 0 #3a3a37, 0 0 0 #000; transform: translateY(2px); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

/* ---------- directo ---------- */
.live { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 960px) { .live { grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); align-items: start; } }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bezel { border-radius: 22px; background: var(--lcd); padding: 10px; box-shadow: var(--sink); }
.screen { position: relative; border-radius: 12px; overflow: hidden; background: var(--lcd2); }
.screen img { display: block; width: 100%; min-height: 180px; filter: contrast(1.05); }
.osd { position: absolute; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; z-index: 1;
  font: 600 10px/1 var(--mono); letter-spacing: .16em; color: var(--lcd-ink); text-shadow: 0 1px 4px rgba(0,0,0,.9); }
.osd.top { top: 12px; } .osd.bot { bottom: 12px; }
.osd .rec::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); margin-right: 7px; box-shadow: 0 0 8px var(--orange); animation: blink 1.2s infinite; }
.readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.readout { border-radius: 16px; background: var(--lcd); color: var(--lcd-ink); padding: 12px 14px 10px; box-shadow: var(--sink); min-width: 0; }
.readout .lbl { font: 600 9px/1 var(--mono); letter-spacing: .2em; color: var(--lcd-dim); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout .val { font: 600 46px/1.05 var(--narrow); letter-spacing: .02em; font-variant-numeric: tabular-nums; margin-top: 6px; white-space: nowrap; }
.readout .val.orange { color: var(--orange); text-shadow: 0 0 14px rgba(255,90,31,.35); }
.readout .val .sep { color: #5d5b55; }
.readout .val.off { color: #46443f; }
.channels { display: flex; flex-direction: column; gap: 6px; }
.ch { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f8f7f4; box-shadow: inset 0 1px 0 #fff, 0 1px 0 #c9c6bf; font-size: 12px; }
.ch .n { font-weight: 600; width: 32px; color: var(--ink2); }
.ch .cname { flex-grow: 1; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .where { color: var(--ink3); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.ch.unknown .cname { color: var(--ink3); font-weight: 500; }
.badge { font: 600 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 5px 7px; border-radius: 5px; border: 1px solid var(--ink); white-space: nowrap; }
.badge.orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.badge.red { background: var(--red); border-color: var(--red); color: #fff; animation: blink 1s infinite; }
.controls { display: flex; align-items: center; gap: 14px; }
.knob-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.knob { position: relative; width: 64px; height: 64px; border-radius: 50%; background: #dcd9d3; box-shadow: inset 0 2px 0 #f7f6f2, 0 6px 10px -4px rgba(40,36,28,.5), 0 0 0 5px #e1dfd9, 0 0 0 6px #cfccc5; transition: transform .35s var(--ease); }
.knob::after { content: ""; position: absolute; left: 30px; top: 7px; width: 4px; height: 15px; border-radius: 2px; background: var(--orange); }
.knob-keys { display: flex; gap: 6px; }
.knob-keys .btn { padding: 6px 10px; font-size: 12px; }
.controls .pad { flex-grow: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.controls .pad .key { height: 64px; padding: 6px; font-size: 9px; }
.ask { display: flex; gap: 8px; }
.answer { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--lcd); color: var(--lcd-ink); box-shadow: var(--sink); white-space: pre-wrap; font: 500 13px/1.6 var(--mono); }
.answer.wait { color: var(--lcd-dim); }
.answer.wait::after { content: "_"; color: var(--orange); animation: blink 1s steps(1) infinite; }

/* plano */
.map { position: relative; height: 230px; border-radius: 14px; background-color: var(--lcd); box-shadow: var(--sink); overflow: hidden;
  background-image: linear-gradient(rgba(242,239,232,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(242,239,232,.06) 1px, transparent 1px); background-size: 24px 24px; }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map .trail { fill: none; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.map .wall { position: absolute; inset: 14px; border: 1px dashed rgba(242,239,232,.25); border-radius: 6px; pointer-events: none; }
.map .tag-l { position: absolute; font: 600 8px/1 var(--mono); letter-spacing: .2em; color: var(--lcd-dim); }
.map .chair { position: absolute; width: 46px; height: 34px; margin: -17px 0 0 -23px; border-radius: 8px; border: 1px solid rgba(255,90,31,.7); background: rgba(255,90,31,.12); }
.map .chair span { position: absolute; top: 38px; left: 0; right: 0; text-align: center; font: 600 8px/1 var(--mono); letter-spacing: .16em; color: var(--orange); }
.map .pdot { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--mono); color: var(--lcd);
  transition: left .9s linear, top .9s linear; }
.map .pdot::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid currentColor; opacity: .35; animation: ping 2s infinite; }
@keyframes ping { from { transform: scale(.7); opacity: .5; } to { transform: scale(1.5); opacity: 0; } }
.map .pdot.unknown { background: transparent !important; border: 1.5px dashed var(--lcd-ink); color: var(--lcd-ink); }
.map .pname { position: absolute; transform: translate(-50%, 20px); font: 600 8px/1 var(--mono); letter-spacing: .14em; color: var(--lcd-ink); white-space: nowrap; transition: left .9s linear, top .9s linear; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; font: 600 10px/1 var(--mono); letter-spacing: .2em; color: var(--lcd-dim); }

/* pendientes */
.who { padding: 12px; border-radius: 14px; background: #fff3ea; box-shadow: inset 0 0 0 1.5px var(--orange); display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.faces { display: flex; gap: 6px; flex-wrap: wrap; }
.faces img, .pface img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: var(--lcd); box-shadow: var(--sink); filter: grayscale(.2); }
.who form { display: flex; gap: 8px; }
.pface { width: 50px; height: 50px; flex: none; }
.pface img { width: 50px; height: 50px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0 6px; color: var(--ink3); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.radar { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 10px var(--orange); animation: blink 1.2s infinite; }
.avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; font: 600 14px/1 var(--mono); color: #fff; background: var(--av, var(--ink)); }
.avatar.unknown { background: var(--panel2); color: var(--ink3); }

/* ---------- informe ---------- */
.seg { display: inline-flex; gap: 6px; padding: 6px; border-radius: 14px; background: var(--panel2); box-shadow: inset 0 2px 4px rgba(40,36,28,.22); margin-bottom: 14px; }
.seg button { border: 0; border-radius: 9px; padding: 9px 13px; background: var(--panel); font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; box-shadow: inset 0 2px 0 #fff, 0 3px 0 #bdbab3; }
.seg button.on { background: var(--ink); color: var(--orange); box-shadow: inset 0 2px 0 #3a3a37; transform: translateY(2px); }
.pcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.pcard { margin: 0; }
.pcard h3 { margin: 0 0 14px; display: flex; align-items: center; gap: 10px; font: 600 13px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { border-radius: 12px; background: var(--lcd); color: var(--lcd-ink); padding: 10px 12px; box-shadow: var(--sink); min-width: 0; }
.stat span { display: block; font: 600 8px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--lcd-dim); margin-bottom: 6px; }
.stat b { display: block; font: 600 34px/1 var(--narrow); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.stat b small { font: 600 12px var(--mono); color: var(--lcd-dim); margin: 0 4px 0 1px; }
.stat:nth-child(3) b { color: var(--orange); }
.stat em { display: block; font-style: normal; font-size: 10px; color: var(--lcd-dim); margin-top: 5px; letter-spacing: .04em; }
.list > div { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px dashed #c9c6bf; }
.list > div:first-child { border-top: 0; padding-top: 2px; }
.dayhead { display: flex; justify-content: space-between; gap: 10px; font: 600 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.dayhead b { font-weight: 500; color: var(--ink2); text-transform: none; letter-spacing: .02em; text-align: right; }
.bar { display: flex; gap: 2px; height: 10px; border-radius: 3px; background: var(--lcd); box-shadow: var(--sink); overflow: hidden; margin: 8px 0 4px; padding: 2px; }
.bar i { display: block; height: 100%; border-radius: 1px; }
.hours { margin-bottom: 12px; }
.hname { display: flex; align-items: center; gap: 8px; font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.hgrid { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; padding: 4px; border-radius: 8px; background: var(--lcd); box-shadow: var(--sink); }
.hgrid span { height: 24px; border-radius: 2px; }
.hlab { display: flex; justify-content: space-between; font: 600 9px/1 var(--mono); color: var(--ink3); margin-top: 6px; letter-spacing: .1em; }

/* ---------- eventos ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ev { display: flex; gap: 12px; align-items: flex-start; }
.ev img { width: 110px; height: 76px; object-fit: cover; border-radius: 10px; background: var(--lcd); cursor: zoom-in; flex: none; box-shadow: var(--sink); }
.ev .t { font: 600 13px/1.35 var(--mono); }
.ev.crit .t { color: var(--red); } .ev.warn .t { color: #b8740a; }
.ev .d { white-space: pre-wrap; color: var(--ink2); font-size: 12px; margin-top: 3px; }
.rec-video { display: block; width: 100%; max-width: 560px; margin-top: 10px; border-radius: 10px; background: var(--lcd); box-shadow: var(--sink); }
.ev .s { font-size: 10px; margin-top: 6px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- fichas y ajustes ---------- */
.drop { border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--panel2); box-shadow: inset 0 2px 5px rgba(40,36,28,.22); }
input[type=file] { color: var(--ink2); font-size: 11px; }
input[type=file]::file-selector-button { margin-right: 10px; border: 0; border-radius: 9px; padding: 9px 12px; background: var(--panel); font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; box-shadow: inset 0 2px 0 #fff, 0 3px 0 #bdbab3; cursor: pointer; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.thumbs .bad { outline: 3px solid var(--red); } .thumbs .ok { outline: 3px solid var(--green); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 7px; font: 600 10px/1.4 var(--mono); letter-spacing: .08em; color: var(--ink2); text-transform: uppercase; }
label.sw { flex-direction: row !important; align-items: center; gap: 12px !important; color: var(--ink) !important; font: 600 11px/1.3 var(--mono) !important; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; padding: 6px 0; }
label.sw input { appearance: none; -webkit-appearance: none; width: 54px; height: 28px; border-radius: 8px; background: var(--lcd); box-shadow: var(--sink); position: relative; flex: none; margin: 0; cursor: pointer; }
label.sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 6px; background: var(--panel); box-shadow: inset 0 2px 0 #fff, 0 2px 0 #bdbab3; transition: transform .25s var(--ease), background .25s; }
label.sw input:checked::after { transform: translateX(26px); background: var(--orange); box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 0 10px rgba(255,90,31,.6); }
table.acts { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.acts td { padding: 8px 4px; border-top: 1px dashed #c9c6bf; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
table.acts td:last-child { width: 58%; }
.range { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; flex-wrap: wrap; }
.range input[type=range] { flex: 1; min-width: 160px; -webkit-appearance: none; appearance: none; height: 8px; border-radius: 4px; background: var(--lcd); box-shadow: var(--sink); outline: none; }
.range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 30px; border-radius: 5px; background: var(--panel); box-shadow: inset 0 2px 0 #fff, 0 3px 0 #bdbab3, inset 0 -12px 0 -10px var(--orange); cursor: pointer; }
.range input[type=range]::-moz-range-thumb { width: 18px; height: 30px; border: 0; border-radius: 5px; background: var(--panel); box-shadow: inset 0 2px 0 #fff, 0 3px 0 #bdbab3; }
.range b { font: 600 26px var(--narrow); min-width: 56px; text-align: right; color: var(--orange); }
.edit { position: relative; overflow: hidden; border-radius: 12px; cursor: crosshair; background: var(--lcd); box-shadow: var(--sink); }
.edit img { display: block; width: 100%; transition: transform .2s; }
.edit svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.poly { fill: rgba(63,191,111,.18); stroke: var(--green); stroke-width: 2; vector-effect: non-scaling-stroke; }
.poly.floor { fill: rgba(255,90,31,.12); stroke: var(--orange); stroke-dasharray: 6 4; }
.pt { fill: #fff; }
.pt.floor { fill: var(--orange); }
.savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: center; margin: 4px 0 14px; }
.savebar .primary { padding: 16px 26px; }

/* ---------- capas ---------- */
#lightbox { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(207,204,197,.92); cursor: zoom-out; }
#lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 16px; border: 10px solid var(--lcd); box-shadow: 0 30px 60px -20px rgba(40,36,28,.6); }
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%); z-index: 40; max-width: 90vw;
  padding: 12px 16px; border-radius: 12px; background: var(--lcd); color: var(--lcd-ink); font: 600 11px/1.4 var(--mono); letter-spacing: .08em;
  box-shadow: 0 16px 30px -12px rgba(0,0,0,.6); border-left: 4px solid var(--orange); }

.enter > * { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- escritorio: teclado abajo con nombres ---------- */
@media (min-width: 760px) {
  .keys .key { flex-direction: row; justify-content: center; gap: 10px; padding: 14px 8px; }
  .keys .key span { display: none; }
  .keys .key em { display: inline; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
}
/* ---------- móvil: carcasa a pantalla completa y teclado fijo abajo ---------- */
@media (max-width: 759px) {
  .shell.app-shell { margin: 0; border-radius: 0; min-height: 100vh; padding: calc(env(safe-area-inset-top) + 16px) 14px calc(env(safe-area-inset-bottom) + 96px); box-shadow: none; }
  .keys { position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 10px); z-index: 20; background: #d6d3cd; box-shadow: inset 0 2px 5px rgba(40,36,28,.25), 0 10px 24px -8px rgba(40,36,28,.5); }
  .top .silk span:last-child { display: none; }
  .lcd-clock { min-width: 0; font-size: 11px; padding: 8px 9px; }
  .top-right { gap: 10px; }
  .card { padding: 14px; border-radius: 18px; }
  .readout .val { font-size: 38px; }
  .map { height: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
