/* =====================================================================
   v2 · LOGO, BOTONES RÁPIDOS, JOYSTICKS, TIPOS VISUALES, ALERTAS, INSTALACIÓN
   ===================================================================== */
.brand-logo { height: 32px; width: auto; display: block; flex: none; filter: drop-shadow(0 0 6px rgba(0,0,0,.5)); }
.brand-div { width: 1px; height: 30px; background: linear-gradient(180deg, transparent, var(--line), transparent); flex: none; }
.loader-logo { width: min(420px, 80vw); height: auto; }
.hud-readouts { margin-right: 250px; }

#quick { position: fixed; top: 9px; right: 12px; z-index: 60; display: flex; gap: 4px; }
.qbtn {
  height: 36px; min-width: 38px; padding: 0 9px; display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: rgba(20,22,25,.85); border: 1px solid var(--line-faint); color: var(--text-dim);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; position: relative;
}
.qbtn span { display: none; }
.qbtn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.qbtn:hover { color: var(--text); border-color: var(--line); }
.qbtn:hover span { display: inline; }
.qbtn.on { color: var(--accent); border-color: var(--accent); background: rgba(255,196,20,.12); }
.qbtn.accent { color: #141517; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.qbtn.accent span { display: inline; }
.qbtn.accent:hover { background: var(--accent-2); color: #141517; }
.qbtn.accent.ready::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

#showUI { display: none; position: fixed; top: 9px; left: 12px; z-index: 60; height: 36px; padding: 0 12px; gap: 8px; align-items: center; cursor: pointer;
  background: rgba(20,22,25,.85); border: 1px solid var(--line); color: var(--accent); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; }
#showUI svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
body.ui-hidden #left, body.ui-hidden #detail, body.ui-hidden #specs, body.ui-hidden #dock, body.ui-hidden #topbar,
body.ui-hidden #compass, body.ui-hidden .frame-corner, body.ui-hidden .crosshair { display: none !important; }
body.ui-hidden #showUI { display: flex; }

/* Tipos visuales */
.vm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.vmbtn { background: rgba(255,255,255,.03); border: 1px solid var(--line-faint); color: var(--text-dim); cursor: pointer; padding: 7px 4px 6px;
  font-family: var(--disp); font-size: 12.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.vmbtn i { width: 30px; height: 22px; display: block; border: 1px solid rgba(255,255,255,.15); }
.vmbtn:hover { color: var(--text); border-color: var(--line); }
.vmbtn.on { color: var(--accent); border-color: var(--accent); background: rgba(255,196,20,.12); }
.sw-real { background: linear-gradient(135deg, #ffc414 0 45%, #1b1c1e 45% 60%, #9aa0a6 60%); }
.sw-ao { background: radial-gradient(circle at 35% 35%, #f4f2ee, #9b9894 70%, #4a4846); }
.sw-xray { background: radial-gradient(circle at 50% 50%, #031520 30%, #48bfff 75%, #031520 80%); }
.sw-solid { background: linear-gradient(135deg, #e0b23a 0 50%, #6d7176 50%); }
.sw-cad { background: #d5d9de; box-shadow: inset 0 0 0 3px #d5d9de, inset 0 0 0 4px #1b1d20; }
.sw-wire { background: repeating-linear-gradient(45deg, transparent 0 4px, #ffc414 4px 5px), repeating-linear-gradient(-45deg, transparent 0 4px, #ffc414 4px 5px); }

/* Segmentado de patrón */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.seg button { background: rgba(255,255,255,.03); border: 1px solid var(--line-faint); color: var(--text-dim); cursor: pointer; padding: 7px 6px; font-family: var(--disp); font-weight: 600; font-size: 12.5px; text-align: left; }
.seg button small { display: block; font-family: var(--mono); font-size: 9px; color: var(--text-faint); font-weight: 400; letter-spacing: .08em; }
.seg button.on { border-color: var(--accent); color: var(--accent); background: rgba(255,196,20,.1); }
.pat-help { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; margin: 8px 0 4px; padding: 8px 10px; border-left: 2px solid var(--line); background: rgba(255,255,255,.02); }
.pat-help b { color: var(--text); }

/* Telemetría */
.telem { font-family: var(--mono); font-size: 11px; }
.tl-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; }
.tl-top div { border: 1px solid var(--line-faint); padding: 5px 7px; color: var(--text-dim); }
.tl-top small { display: block; font-size: 9px; color: var(--text-faint); letter-spacing: .12em; }
.tl-top b { font-size: 15px; color: var(--cyan); font-weight: 500; }
.tl-row { display: grid; grid-template-columns: 112px 1fr 38px; align-items: center; gap: 8px; padding: 3px 0; color: var(--text-dim); }
.tl-row em { font-style: normal; text-align: right; color: var(--accent); }
.tl-bar { height: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--line-faint); position: relative; overflow: hidden; }
.tl-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #2e7bb0, var(--cyan)); transition: width .12s linear; }

/* ===== Joysticks ===== */
#joyWrap { display: none; position: fixed; left: 326px; right: 12px; bottom: 84px; z-index: 17; pointer-events: none; justify-content: space-between; align-items: flex-end; gap: 12px; }
body.joy #joyWrap { display: flex; }
body.joy #compass { display: none; }
body.joy #detail { max-height: calc(100% - 380px); }
body.joy #specs { bottom: 330px; max-height: 28%; }
body.ui-hidden #joyWrap { left: 14px; right: 14px; bottom: 16px; }
#left.collapsed ~ #joyWrap { left: 70px; }
.joy-col, .joy-mid { pointer-events: auto; }
.joy-col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.joy-title { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--accent); text-align: center; background: rgba(14,15,17,.8); border: 1px solid var(--line-soft); padding: 3px 8px; }
.joy-title small { display: block; color: var(--text-faint); font-size: 9px; }
.pad { width: 178px; height: 178px; border-radius: 50%; position: relative; touch-action: none; cursor: grab;
  background: radial-gradient(circle, rgba(40,43,48,.92) 0 40%, rgba(22,24,27,.92) 70%); border: 1px solid var(--line); box-shadow: 0 0 0 4px rgba(14,15,17,.6), inset 0 0 24px rgba(0,0,0,.6); }
.pad-ring { position: absolute; inset: 18px; border-radius: 50%; border: 1px dashed rgba(255,196,20,.3); }
.pad-cross { position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(rgba(255,196,20,.22), rgba(255,196,20,.22)) center / 1px 100% no-repeat, linear-gradient(rgba(255,196,20,.22), rgba(255,196,20,.22)) center / 100% 1px no-repeat; }
.pl { position: absolute; font-family: var(--mono); font-size: 8.5px; letter-spacing: .06em; color: var(--text); background: rgba(14,15,17,.88); border: 1px solid var(--line-faint); padding: 1px 4px; white-space: nowrap; pointer-events: none; z-index: 2; }
.pl.t { top: -10px; left: 50%; transform: translateX(-50%); }
.pl.b { bottom: -10px; left: 50%; transform: translateX(-50%); }
.pl.l { left: 4px; top: 50%; transform: translateY(-50%); }
.pl.r { right: 4px; top: 50%; transform: translateY(-50%); }
.pl:empty { display: none; }
.knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; transition: transform .18s cubic-bezier(.3,1.6,.5,1); z-index: 1;
  background: radial-gradient(circle at 35% 30%, #5a5e64, #1c1d20 65%); border: 2px solid var(--accent); box-shadow: 0 6px 14px rgba(0,0,0,.6), 0 0 0 6px rgba(255,196,20,.08); }
.knob::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--accent); opacity: .8; }
.knob.drag { transition: none; cursor: grabbing; }
.joy-mid { width: 330px; background: rgba(18,20,23,.88); border: 1px solid var(--line-soft); padding: 8px 10px 10px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.joy-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 8px; }
.jm { background: none; border: 1px solid var(--line-faint); color: var(--text-dim); font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; padding: 5px; cursor: pointer; }
.jm.on { color: #141517; background: var(--accent); border-color: var(--accent); }
.joy-tele { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; font-family: var(--mono); }
.joy-tele div { border: 1px solid var(--line-faint); padding: 3px 6px; }
.joy-tele small { display: block; font-size: 8.5px; color: var(--text-faint); letter-spacing: .14em; }
.joy-tele b { font-size: 16px; color: var(--cyan); font-weight: 500; }
.joy-tele i { font-style: normal; font-size: 9px; color: var(--text-faint); margin-left: 3px; }
.pbar { height: 5px; margin: 6px 0 8px; background: rgba(255,255,255,.06); position: relative; overflow: hidden; }
.pbar div { position: absolute; left: 0; top: 0; bottom: 0; width: 8%; background: linear-gradient(90deg, #2e7bb0, var(--cyan)); transition: width .12s linear; }
.pbar div.hot { background: linear-gradient(90deg, #e0a21b, var(--danger)); }
.holds { display: grid; gap: 3px; }
.hold-row { display: grid; grid-template-columns: 80px 1fr 1fr; gap: 4px; align-items: center; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.hb { background: rgba(255,255,255,.04); border: 1px solid var(--line-faint); color: var(--text); font-family: var(--mono); font-size: 10px; padding: 5px 2px; cursor: pointer; touch-action: none; user-select: none; }
.hb:hover { border-color: var(--line); }
.hb.on { background: var(--accent); color: #141517; border-color: var(--accent); }
@media (max-width: 1100px) { .joy-mid { width: 250px; } .pad { width: 140px; height: 140px; } .knob { width: 54px; height: 54px; margin: -27px 0 0 -27px; } }
@media (max-width: 900px) { #joyWrap { left: 8px; right: 8px; bottom: 76px; } .joy-mid { display: none; } }

/* Alertas / peligros */
.anom { cursor: pointer; transition: background .15s, border-color .15s; }
.anom:hover { border-color: rgba(255,59,48,.5); background: rgba(255,59,48,.05); }
.anom.on { border-color: #ff3b30; background: rgba(255,59,48,.12); }
.anom p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.anom-act { margin-top: 7px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: #ff6b5f; }
.anom.danger h4 { color: #ff8a80; }
.dbtn.danger.on { color: #ff3b30; border-color: rgba(255,59,48,.7); background: rgba(255,59,48,.12); }
.al-line { stroke: #ff3b30; stroke-width: 1.4; fill: none; }
.al-box { fill: rgba(38,8,8,.9); stroke: #ff3b30; stroke-width: 1; }
.al-text { fill: #fff; font-family: var(--disp); font-weight: 700; font-size: 13px; }
.al-text.sm { font-size: 12px; }
.al-code { fill: #ff6b5f; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; }
#tip em { font-style: normal; color: var(--cyan); margin-left: 8px; font-size: 10px; }

/* Modal de instalación */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(8,9,10,.6); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.show { display: flex; }
.modal-box { position: relative; width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.modal-box .body { padding: 14px 18px 18px; color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.modal-box ol { padding-left: 20px; margin: 8px 0 0; }
.modal-box li { margin-bottom: 6px; }
.modal-box code { font-family: var(--mono); font-size: 12px; color: var(--cyan); }
.modal-box b { color: var(--text); }
.modal-box .ok { color: var(--ok); }
.inst-logo { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.inst-logo img { width: 56px; height: 56px; }
.inst-logo b { display: block; font-size: 18px; color: var(--text); }
.inst-logo small { font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: .08em; }
.tbtn.big { width: 100%; justify-content: center; margin-top: 12px; padding: 12px; font-size: 16px; }

@media (max-width: 1280px) { .hud-readouts .ro:nth-child(n+3) { display: none; } }
@media (max-width: 900px) { .hud-readouts { margin-right: 0; } .brand-logo { height: 24px; } .brand-div, .brand-title, .brand-sub { display: none; } }
