:root {
  --bg: #f4f6f9; --panel: #ffffff; --ink: #1c2530; --muted: #6b7785; --line: #e2e7ee;
  --brand: #0d47a1; --brand-2: #1565c0; --accent: #00b8d4; --ok: #2e7d32; --warn: #f9a825; --bad: #c62828;
  --radius: 8px; --shadow: 0 6px 24px rgba(16, 32, 64, .14);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); }
[hidden] { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small, small { font-size: 12px; }
.block { display: block; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 4px; }

/* ---------- barra superior ---------- */
.top { display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 52px; background: #0b1f3a; color: #fff; flex: none; z-index: 5; }
.brand { font-size: 17px; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand b { color: var(--accent); }
.logo { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 50% 110%, var(--accent) 0 35%, transparent 36%), var(--brand-2); box-shadow: 0 0 0 2px #1e3a66; }
.tabs { display: flex; gap: 2px; }
.tabs button { background: none; border: 0; color: #b8c7dc; padding: 16px 14px; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button:hover { color: #fff; }
.tabs button.active { color: #fff; border-bottom-color: var(--accent); }
#search { width: 260px; padding: 7px 10px; border-radius: 6px; border: 1px solid #28446b; background: #12294a; color: #fff; }
#search::placeholder { color: #8ea4c2; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: 40px; background: var(--panel); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 240px; padding: 6px; z-index: 20; }
.menu-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-decoration: none; color: inherit; }
.menu-item:hover { background: var(--bg); }

/* ---------- botones ---------- */
.btn { border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #b9c4d2; background: #f8fafc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.primary:hover { background: var(--brand); }
.btn.danger { color: var(--bad); border-color: #f1c4c4; }
.btn.danger:hover { background: #fdecec; }
.btn.active { background: #e3f2fd; border-color: var(--brand-2); color: var(--brand); }
.btn.ghost { background: transparent; color: #fff; border-color: #28446b; }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn.block { width: 100%; margin-top: 16px; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 4px 7px; border-radius: 6px; font-size: 15px; line-height: 1; color: var(--muted); }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn:disabled { opacity: .3; }
.icon-btn.small { font-size: 12px; padding: 2px 5px; }

/* ---------- layout principal ---------- */
main { flex: 1; min-height: 0; display: flex; }
.view { flex: 1; min-width: 0; }
#view-map { display: flex; position: relative; }
.page { overflow: auto; padding: 20px 24px; }
.tools { width: 76px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 6px; gap: 2px; overflow-y: auto; }
.tools button, .tools summary { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; padding: 7px 2px; border-radius: 6px; cursor: pointer; font-size: 11px; color: var(--muted); list-style: none; }
.tools summary::-webkit-details-marker { display: none; }
.tools button:hover, .tools summary:hover { background: var(--bg); color: var(--ink); }
.tools button.active { background: #e3f2fd; color: var(--brand); }
.tools span { font-size: 18px; line-height: 22px; }
.tools i { font-style: normal; font-size: 9px; font-weight: 700; color: #fff; background: var(--c); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.tools hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.layers-menu { position: relative; }
#layers { position: absolute; left: 70px; bottom: 0; background: var(--panel); box-shadow: var(--shadow); border-radius: var(--radius); padding: 10px 12px; width: 190px; display: flex; flex-direction: column; gap: 6px; z-index: 10; font-size: 13px; }
.map-area { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #dfe6ee; isolation: isolate; }
#map-msg { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(223, 230, 238, .92); z-index: 3; padding: 20px; }
.map-msg-card { background: #fff; max-width: 480px; padding: 20px 24px; border-radius: 12px; box-shadow: var(--shadow); }
.map-msg-card h3 { margin-top: 0; color: var(--bad); }
.map-legend { position: absolute; left: 10px; bottom: 24px; background: rgba(255, 255, 255, .92); border-radius: 6px; padding: 5px 10px; display: flex; gap: 12px; font-size: 12px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.map-legend i { display: inline-block; width: 16px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* ---------- marcadores ---------- */
.mk { position: relative; transform: translateY(50%); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; font-size: 9px; font-weight: 700; border: 3px solid var(--ring); box-shadow: 0 1px 4px rgba(0, 0, 0, .45); cursor: pointer; }
.mk-olt { width: 36px; height: 36px; border-radius: 8px; font-size: 10px; }
.mk-ceo { border-radius: 8px; }
.mk-poste, .mk-reserva { width: 14px; height: 14px; border-width: 2px; border-color: #fff; }
.mk-poste .mk-l, .mk-reserva .mk-l { display: none; }
.mk.sel { outline: 3px solid #ffeb3b; outline-offset: 2px; }
.mk.drag { outline: 3px dashed #ff4081; outline-offset: 3px; cursor: move; }
.mk-sub { position: absolute; top: -9px; right: -16px; background: #fff; color: #263238; border-radius: 8px; padding: 0 4px; font-size: 9px; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.mk-name { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; white-space: nowrap; background: rgba(255, 255, 255, .92); color: #263238; font-size: 11px; font-weight: 600; padding: 0 4px; border-radius: 3px; }
.zoom-labels .mk-name { display: block; }
.hide-labels .mk-name { display: none !important; }
.mk-client { position: relative; transform: translateY(50%); width: 24px; height: 24px; cursor: pointer; }
.mk-client .cl-svg { width: 24px; height: 24px; display: block; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.ic-client svg { width: 24px; height: 24px; }
.mk-client.sel { outline: 3px solid #ffeb3b; outline-offset: 1px; border-radius: 4px; }
.mk-client .mk-name { font-weight: 400; }
.mk-target { transform: translateY(50%); font-size: 26px; color: #1565c0; text-shadow: 0 0 3px #fff, 0 0 6px #fff; }

/* ---------- panel lateral ---------- */
.side { width: 0; flex: none; background: var(--panel); border-left: 1px solid var(--line); overflow: hidden; transition: width .15s; display: flex; flex-direction: column; }
.side.open { width: 380px; }
.side-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.side-head h2 { font-size: 16px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-body { padding: 12px 16px 24px; overflow-y: auto; flex: 1; }
.side-body section { margin-top: 18px; }
.side-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }
.badge { color: #fff; font-size: 10px; font-weight: 700; border-radius: 5px; padding: 3px 6px; }
.hint { background: #e8f1fb; border-radius: 6px; padding: 10px 12px 10px 28px; margin: 0 0 12px; line-height: 1.5; }
p.hint { padding-left: 12px; }
.stat-row { display: flex; gap: 10px; margin: 10px 0; }
.stat-row > div { flex: 1; background: var(--bg); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; }
.stat-row b { font-size: 18px; }
.stat-row span { font-size: 11px; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 6px; cursor: pointer; }
.list li:hover { background: var(--bg); }
.list li > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.list small { color: var(--muted); }
.sw { width: 14px; height: 4px; border-radius: 2px; flex: none; }

.ports { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.port { border: 2px solid; border-radius: 6px; padding: 5px 2px; background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; font-size: 10px; min-width: 0; }
.port b { font-size: 14px; }
.port span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port.lit { border-color: #43a047; color: #2e7d32; }
.port.dark { border-color: #cfd8dc; color: #90a4ae; border-style: dashed; }
.port.used { border-color: var(--c); background: var(--c); color: #fff; }
.legend { font-size: 11px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 2px solid; margin-left: 6px; }
.lg.lit { border-color: #43a047; } .lg.dark { border-color: #cfd8dc; border-style: dashed; } .lg.used { background: #2e7d32; border-color: #2e7d32; }

.verdict { border-radius: 8px; padding: 12px; font-weight: 800; font-size: 18px; display: flex; flex-direction: column; margin: 12px 0 6px; }
.verdict small { font-weight: 400; font-size: 12px; margin-top: 2px; }
.verdict.ok { background: #e8f5e9; color: #1b5e20; }
.verdict.no { background: #fdecea; color: #b71c1c; }
.cand { border-left: 4px solid #cfd8dc; }
.cand.ok { border-left-color: #43a047; }
.cands li { cursor: default; }

/* ---------- formularios ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 10px; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field span { font-size: 12px; color: var(--muted); }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #90caf9; border-color: var(--brand-2); }
input[readonly] { background: var(--bg); }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(12, 22, 38, .45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: min(1200px, 100%); height: calc(100vh - 40px); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; margin: 0; flex: 1; }
.modal-body { padding: 16px 18px; overflow: auto; flex: 1; min-height: 0; }

/* ---------- avisos ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; }
.toast { background: #263238; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); transition: opacity .4s; max-width: 520px; }
.toast.ok { background: #1b5e20; } .toast.error { background: #b71c1c; }
.toast.out { opacity: 0; }

/* ---------- tablas / dashboard ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.num { text-align: right; font-weight: 600; }
.table td.actions { white-space: nowrap; text-align: right; }
.table-wrap { background: var(--panel); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); overflow: auto; margin-top: 12px; }
.toolbar input[type=search] { width: 380px; }
.pill { color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis.small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kpi { background: var(--panel); border-radius: var(--radius); padding: 12px 14px; border-top: 4px solid var(--brand-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-top-width: 4px; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi b { font-size: 24px; }
.kpis.small .kpi b { font-size: 15px; }
.kpi small { color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.card { background: var(--panel); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.card.wide { grid-column: 1 / -1; }
.card h3 { margin: 0 0 12px; font-size: 14px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 110px; gap: 10px; align-items: center; padding: 4px 0; }
.bar-row.clickable { cursor: pointer; border-radius: 4px; }
.bar-row.clickable:hover { background: var(--bg); }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; background: #eceff3; border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; }
.bar-val { font-size: 12px; text-align: right; color: var(--muted); }

/* ---------- diagrama de fusiones ---------- */
.splice-wrap { display: flex; flex-direction: column; height: 100%; gap: 10px; }
.splice-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.splice-bar select { padding: 4px 6px; }
.splice-scroll { flex: 1; overflow: auto; min-height: 0; }
.splice-board { position: relative; display: grid; grid-template-columns: minmax(250px, 1fr) minmax(200px, 260px) minmax(250px, 1fr); gap: 110px; padding: 4px 8px 30px; align-items: start; }
.splice-svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; overflow: visible; }
.splice-svg .wire { fill: none; stroke-width: 3; }
.splice-svg .shadow { fill: none; stroke: #263238; stroke-width: 5; opacity: .35; }
.splice-svg .hit { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; cursor: pointer; }
.splice-svg .hit:hover + * , .splice-svg .hit:hover { stroke: rgba(255, 64, 129, .35); }
.splice-board h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.blk { background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; padding: 4px 0; }
.blk-head { display: flex; align-items: baseline; gap: 6px; padding: 4px 10px 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; flex-wrap: wrap; }
.blk-head small { color: var(--muted); }
.blk-head .icon-btn { margin-left: auto; }
.spl { background: #f3f6f9; }
.ep { display: flex; align-items: center; gap: 6px; padding: 2px 10px; cursor: pointer; font-size: 12px; min-height: 22px; position: relative; }
.ep:hover { background: #e3f2fd; }
.ep.selected { background: #ffe0ec; }
.ep.side-r { justify-content: flex-start; }
.ep.side-r .dot { margin-left: auto; }
.ep-label { white-space: nowrap; }
.ep-to { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px #90a4ae; flex: none; }
.ep.fused .dot { box-shadow: 0 0 0 2px #263238; }
.ep.selected .dot { box-shadow: 0 0 0 3px #ff4081; }
.tube { width: 4px; height: 16px; border-radius: 2px; flex: none; }

@media (max-width: 900px) {
  #search { display: none; }
  .side.open { position: absolute; right: 0; top: 0; bottom: 0; width: min(380px, 100%); z-index: 4; box-shadow: var(--shadow); }
  .bar-row { grid-template-columns: 110px 1fr 90px; }
  .toolbar input[type=search] { width: 100%; }
}

/* ---------- hilos de fibra en el panel ---------- */
.fib-cable { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fafbfc; }
.fib-cable summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; cursor: pointer; }
.fib-cable summary small { width: 100%; color: var(--muted); padding-left: 22px; }
.fib-list { list-style: none; margin: 0; padding: 2px 6px 8px; }
.fib { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.fib:hover { background: #e3f2fd; }
.fib-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; border: 1px solid rgba(0,0,0,.25); text-shadow: 0 0 2px rgba(0,0,0,.8); }
.fib-name { width: 62px; flex: none; }
.fib-to { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.fib.free .fib-to { color: var(--muted); font-style: italic; }
.fib-sig { width: 9px; height: 9px; border-radius: 50%; background: #cfd8dc; flex: none; display: inline-block; }
.fib-sig.on { background: #2e7d32; box-shadow: 0 0 0 3px rgba(46,125,50,.2); }
.legend .fib-sig { margin: 0 2px 0 8px; }
.fib-dot.light { color: #222; text-shadow: none; }

/* ---------- plano de empalmes (SVG) ---------- */
.sp-svg { width: 100%; max-width: 1100px; height: auto; display: block; margin: 0 auto; }
.sp-row { cursor: pointer; }
.sp-row:hover .bg { fill: #dcecf9; }
.sp-row.fused:hover .bg { fill: #fde4e4; }
.sp-hit { cursor: pointer; pointer-events: stroke; }
.sp-hit:hover { stroke: rgba(255, 64, 129, .35); }
.sp-act { cursor: pointer; opacity: .85; }
.sp-act:hover { opacity: 1; text-decoration: underline; }

/* ---------- catálogo de fibras ---------- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.type-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 8px 10px 12px; cursor: pointer; background: #fff; }
.type-card:hover { border-color: #90caf9; }
.type-card.on { border-color: var(--brand-2); background: #e3f2fd; }
.type-num { font-size: 24px; font-weight: 800; color: var(--brand); display: flex; flex-direction: column; align-items: center; line-height: 1; min-width: 44px; }
.type-num small { font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.type-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.type-info small { color: var(--muted); }
.size-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 12px; cursor: pointer; font-weight: 600; }
.chip.on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
h3.lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }

/* ---------- potencia: parpadeo ---------- */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 var(--pulse), 0 1px 4px rgba(0,0,0,.45); }
  70%  { box-shadow: 0 0 0 14px transparent, 0 1px 4px rgba(0,0,0,.45); }
  100% { box-shadow: 0 0 0 0 transparent, 0 1px 4px rgba(0,0,0,.45); }
}
@keyframes blink-core { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.45); } }
.mk.lit { animation: pulse-ring 1.4s ease-out infinite, blink-core 1.4s ease-in-out infinite; }
.mk.lit::after { content: ''; position: absolute; top: -4px; left: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--pulse); box-shadow: 0 0 6px var(--pulse); animation: blink-core .7s steps(2) infinite; }
.lg-pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #00e676; margin-right: 5px; vertical-align: middle; animation: pulse-ring 1.4s ease-out infinite; --pulse: #00e676; }
@media (prefers-reduced-motion: reduce) { .mk.lit, .mk.lit::after, .lg-pulse { animation: none; box-shadow: 0 0 0 4px var(--pulse); } }

/* ---------- hilos con potencia latiendo ---------- */
@keyframes sp-beat { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(2.2); opacity: 0; } }
@keyframes flow { to { stroke-dashoffset: -38; } }
.sp-pulse { transform-box: fill-box; transform-origin: center; animation: sp-beat 1.1s ease-out infinite; }
.wire-flow { stroke-dasharray: 3 16; animation: flow 1s linear infinite; pointer-events: none; opacity: .95; }
.sp-row.lit text { font-weight: 700; }
.lit-legend { display: inline-flex; align-items: center; gap: 6px; color: #1b5e20; }
.fib.lit .fib-dot { animation: fib-beat 1.1s ease-in-out infinite; }
@keyframes fib-beat { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, .9); } 50% { box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); } }
.fib-sig.on { animation: blink-core .9s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .sp-pulse, .wire-flow, .fib.lit .fib-dot, .fib-sig.on { animation: none; } }

/* ---------- potencia por puerto PON ---------- */
.pon-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.pon-table td, .pon-table th { padding: 5px 6px; vertical-align: middle; }
.pon-table input { width: 58px; padding: 4px 5px; }
.pon-table { font-size: 12px; }
.pon-table th { font-size: 10px; }
.pon-table select { padding: 4px 2px; width: 62px; }
.pon-table tr.pon-used td:first-child b { color: #1b5e20; }
.pon-table .fib-sig { margin-left: 6px; }
.btn.primary.manga { background: #ef6c00; border-color: #ef6c00; }
.btn.primary.manga:hover { background: #d65f00; }
.drop-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; background: #f8fafc; }
.drop-card > div { display: flex; flex-direction: column; }
.drop-card small { color: var(--muted); }
.side-body .col .btn { width: 100%; text-align: left; white-space: normal; }

/* ---------- menú contextual (clic derecho) ---------- */
.cx-menu { position: fixed; z-index: 60; background: #fbfbf7; border: 1px solid #cfd8dc; border-radius: 4px; box-shadow: 0 8px 28px rgba(0,0,0,.35); padding: 10px 12px 8px; min-width: 250px; user-select: none; }
.cx-title { font-size: 12px; font-weight: 700; color: #263238; margin: 0 2px 8px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-row { display: flex; gap: 2px; margin-bottom: 4px; }
.cx-btn { width: 50px; height: 38px; border: 0; background: #2aa7d9; color: #0b1f2a; display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .1s, transform .05s; }
.cx-btn:hover { background: #1b8fc0; color: #fff; }
.cx-btn:active { transform: scale(.95); }
.cx-btn.danger:hover { background: #d84315; }
.cx-btn:disabled { opacity: .35; cursor: not-allowed; }
.cx-btn.cx-close { background: #f4511e; margin-left: 2px; }
.cx-btn.cx-close:hover { background: #d84315; color: #fff; }
.cx-ico svg { width: 22px; height: 22px; display: block; }
.cx-hint { font-size: 11px; color: #546e7a; margin: 6px 2px 0; min-height: 14px; max-width: 320px; }
.fib-dot.beat { animation: fib-beat 1.1s ease-in-out infinite; }
.fx-lit td { background: #f1fbf3; }
.pw-on { color: #1b5e20; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
/* armario de red */
.mk-armario { width: 26px; height: 36px; border-radius: 4px; font-size: 8px; }
.btn.primary.armario { background: #00838f; border-color: #00838f; }
.btn.primary.armario:hover { background: #006c75; }

/* ---------- rack del armario ---------- */
.rk { display: grid; grid-template-columns: 28px 1fr; column-gap: 0; margin: 10px 0 6px; background: #263238; border: 3px solid #37474f; border-radius: 6px; padding: 6px 8px 6px 0; }
.rk-u { grid-column: 1; font-size: 9px; color: #90a4ae; text-align: right; padding-right: 6px; line-height: 24px; font-family: ui-monospace, Consolas, monospace; }
.rk-free { grid-column: 2; margin: 1px 0; border: 1px dashed #546e7a; background: #2f3d44; color: #78909c; border-radius: 2px; cursor: pointer; font-size: 13px; line-height: 1; }
.rk-free:hover { background: #37505b; color: #fff; border-color: #90a4ae; }
.rk-eq { grid-column: 2; margin: 1px 0; display: flex; align-items: center; gap: 8px; text-align: left; border: 0; border-left: 6px solid var(--c); border-radius: 2px; background: linear-gradient(#eceff1, #cfd8dc); cursor: pointer; padding: 0 8px; min-width: 0; overflow: hidden; }
.rk-eq:hover { filter: brightness(1.06); outline: 2px solid #90caf9; }
.rk-eq.lit { box-shadow: inset 0 0 0 2px #00e676; }
.rk-tag { background: var(--c); color: #fff; font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 3px; flex: none; }
.rk-name { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.1; }
.rk-name b, .rk-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-name b { font-size: 12px; } .rk-name small { font-size: 10px; color: #546e7a; }
.rk-info { display: flex; flex-direction: column; align-items: flex-end; font-size: 10px; color: #37474f; flex: none; line-height: 1.1; }
.rk-info small { color: #607d8b; }

/* ---------- implantado / proyectado ---------- */
.mk.proj { opacity: .62; border-style: dashed; filter: saturate(.6); }
.mk.proj::before { content: 'P'; position: absolute; left: -8px; bottom: -6px; background: #fff; color: #546e7a; font-size: 8px; font-weight: 800; border-radius: 6px; padding: 0 3px; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.deploy-chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 16px; padding: 3px 4px 3px 10px; font-size: 12px; }
.deploy-chip.on { background: #e8f5e9; color: #1b5e20; }
.deploy-chip.off { background: #eceff1; color: #455a64; border: 1px dashed #90a4ae; }
.deploy-chip .btn { padding: 2px 8px; }
.cat-title { margin: 16px 0 6px; font-size: 13px; }
.type-info small + small { margin-top: 1px; }

/* ---------- fotos, notas, edificios ---------- */
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #eceff1; }
.ph img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.ph-del { position: absolute; top: 3px; right: 3px; border: 0; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 11px; }
.ph-view img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 6px; }
.modal .ph-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.mk-note { transform: translateY(50%); background: var(--c); color: #212121; font-size: 11px; line-height: 1.25; padding: 4px 7px; border-radius: 2px 10px 2px 2px; box-shadow: 0 2px 5px rgba(0,0,0,.35); max-width: 150px; cursor: pointer; border-left: 3px solid rgba(0,0,0,.25); }
.mk-edificio { width: 28px; height: 30px; border-radius: 3px; font-size: 9px; }
.btn.small.danger { color: var(--bad); }

/* ---------- árbol lateral ---------- */
.tree { width: 270px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow: hidden; }
.tree input[type=search] { width: 100%; }
.tree select { flex: 1; min-width: 0; font-size: 12px; padding: 5px; }
.tr-head { display: flex; align-items: center; }
.tr-body { overflow-y: auto; flex: 1; margin: 0 -4px; }
.tr-group { margin: 2px 0; }
.tr-group summary { cursor: pointer; padding: 5px 6px; border-radius: 5px; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; list-style: none; }
.tr-group summary::-webkit-details-marker { display: none; }
.tr-group summary::before { content: '▸'; color: var(--muted); font-size: 10px; width: 8px; }
.tr-group[open] > summary::before { content: '▾'; }
.tr-group summary:hover { background: var(--bg); }
.tr-sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.tr-n { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; background: var(--bg); border-radius: 8px; padding: 0 6px; }
.tr-sub { padding-left: 10px; }
.tr-group ul { list-style: none; margin: 0; padding: 0 0 4px 18px; }
.tr-group li { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.tr-group li:hover { background: #e3f2fd; }
.tr-group li.proj .tr-name { color: var(--muted); font-style: italic; }
.tr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-group li small { color: var(--muted); font-size: 10px; }
.tr-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tools button.active#btn-tree { background: #e3f2fd; color: var(--brand); }
@media (max-width: 900px) { .tree { position: absolute; left: 76px; top: 0; bottom: 0; z-index: 5; box-shadow: var(--shadow); } }

/* ---------- manga de empalme (domo vertical) ---------- */
.mk-ceo { width: 21px; height: 35px; border: 0; border-radius: 6px; background: none; box-shadow: none; }
.mk-ceo .mg-svg { width: 21px; height: 35px; display: block; filter: drop-shadow(0 0 1.2px #fff) drop-shadow(0 0 .6px #fff) drop-shadow(0 2px 2px rgba(0,0,0,.55)); }
.mk-ceo.lit { animation: none; }
.mk-ceo.lit .mg-svg { animation: manga-glow 1.4s ease-in-out infinite; }
@keyframes manga-glow {
  0%, 100% { filter: drop-shadow(0 0 1.2px #fff) drop-shadow(0 0 2px var(--pulse)) drop-shadow(0 2px 2px rgba(0,0,0,.55)); }
  50%      { filter: drop-shadow(0 0 1.2px #fff) drop-shadow(0 0 9px var(--pulse)) drop-shadow(0 0 4px var(--pulse)); }
}
.mk-ceo.proj { opacity: .55; }
.mk-ceo.sel { outline-offset: 3px; }
.tools i.ic-manga { background: none; border-radius: 0; width: 24px; height: 26px; }
.tools i.ic-manga svg { width: 16px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }

/* ---------- caja NAP (gabinete) ---------- */
.mk-cto { width: 26px; height: 33px; border: 0; border-radius: 4px; background: none; box-shadow: none; }
.mk-cto .nap-svg { width: 26px; height: 33px; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.mk-cto.lit { animation: none; }
.mk-cto.lit .nap-svg { animation: nap-glow 1.4s ease-in-out infinite; }
@keyframes nap-glow {
  0%, 100% { filter: drop-shadow(0 0 2px var(--pulse)) drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
  50%      { filter: drop-shadow(0 0 9px var(--pulse)) drop-shadow(0 0 4px var(--pulse)); }
}
.mk-cto.lit .nap-win { animation: blink-core .7s steps(2) infinite; }
.mk-cto.proj { opacity: .55; }
.mk-cto.sel { outline-offset: 3px; }
.mk-cto .mk-sub { top: -10px; right: -22px; }
.tools i.ic-nap { background: none; border-radius: 0; width: 24px; height: 28px; }
.tools i.ic-nap svg { width: 22px; height: 28px; }

/* ---------- armario de red (panel) ---------- */
.mk-armario { width: 44px; height: 34px; border: 0; border-radius: 5px; background: none; box-shadow: none; }
.mk-armario .arm-svg { width: 44px; height: 34px; display: block; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 2px 2px rgba(0,0,0,.45)); }
.mk-armario.lit { animation: none; }
.mk-armario.lit .arm-svg { animation: arm-glow 1.4s ease-in-out infinite; }
.mk-armario.lit .arm-a, .mk-armario.lit .arm-c { animation: blink-core .7s steps(2) infinite; }
@keyframes arm-glow {
  0%, 100% { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 2px var(--pulse)) drop-shadow(0 2px 2px rgba(0,0,0,.45)); }
  50%      { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 9px var(--pulse)) drop-shadow(0 0 4px var(--pulse)); }
}
.mk-armario.proj { opacity: .55; }
.mk-armario.sel { outline-offset: 3px; }
.tools i.ic-arm { background: none; border-radius: 0; width: 30px; height: 24px; }
.tools i.ic-arm svg { width: 30px; height: 24px; }

/* ---------- carpetas (panel izquierdo) ---------- */
.tr-tabs { display: flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 8px; }
.tr-tabs button { flex: 1; border: 0; background: none; padding: 6px; border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--muted); }
.tr-tabs button.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tr-new { width: 100%; margin-bottom: 8px; }
.tr-active { font-size: 11px; background: #fff8e1; border: 1px solid #ffe082; border-radius: 6px; padding: 5px 8px; margin: 0 0 8px; }
.tr-folder { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: #fff; }
.tr-folder.act { border-color: #ffb300; box-shadow: 0 0 0 1px #ffb300 inset; }
.tr-folder.off > summary { opacity: .55; }
.tr-folder.none { background: var(--bg); }
.tr-folder > summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 7px 6px; cursor: pointer; border-radius: 8px; }
.tr-folder > summary::-webkit-details-marker { display: none; }
.tr-folder > summary.drop { background: #e3f2fd; outline: 2px dashed var(--brand); }
.tr-fic { font-size: 16px; filter: saturate(1.4); }
.tr-fname { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-fname small { display: block; font-weight: 400; font-size: 10.5px; color: var(--muted); }
.tr-acts { display: flex; gap: 1px; }
.tr-ab { border: 0; background: none; cursor: pointer; font-size: 13px; padding: 2px 3px; border-radius: 4px; color: #78909c; line-height: 1; }
.tr-ab:hover { background: var(--bg); }
.tr-ab.on { color: #ffb300; }
.tr-folder .tr-sub { padding: 0 4px 6px 8px; }
.tr-empty { margin: 2px 8px 6px; }
.tr-group li[draggable=true] { cursor: grab; }
.tr-pick { display: flex; flex-direction: column; gap: 6px; }
.tr-pick .btn { justify-content: flex-start; text-align: left; }

/* ---------- empalme: comentarios por hilo y acciones de cable ---------- */
.sp-note { cursor: pointer; opacity: .28; }
.sp-row:hover .sp-note { opacity: .75; }
.sp-note.has { opacity: 1; }
.sp-note:hover { opacity: 1; }
.fx-note { width: 100%; min-width: 160px; border: 1px solid transparent; background: transparent; padding: 3px 6px; border-radius: 4px; font-size: 12px; color: #b35c00; font-style: italic; }
.fx-note:hover, .fx-note:focus { border-color: var(--line); background: #fff; outline: none; }
.fib-note { font-size: 11px; cursor: help; }

/* ---------- mover con clic derecho ---------- */
.mk.rdrag { opacity: .85; z-index: 9999; cursor: grabbing; filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); transition: none; }
.rdragging, .rdragging * { cursor: grabbing !important; }

/* ---------- fibra visible dentro de las cajas ---------- */
.sp-strands .strand { opacity: .9; }
.sp-strands .strand-lit { animation: strand-beat 1.1s ease-in-out infinite; }
.sp-strands .strand-flow { stroke-dasharray: 2 12; animation: flow .9s linear infinite; opacity: .95; }
.sp-strands .strand-chip.lit { animation: strand-beat 1.1s ease-in-out infinite; }
@keyframes strand-beat {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(0, 230, 118, 0)); opacity: .85; }
  50%      { filter: drop-shadow(0 0 4px rgba(0, 230, 118, .95)) drop-shadow(0 0 2px #00e676); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .sp-strands .strand-lit, .sp-strands .strand-flow, .sp-strands .strand-chip.lit { animation: none; } }

/* ---------- empalme estilo Tomodat: puntas de fibra y conexiones animadas ---------- */
.stub-march { stroke-dasharray: 5 5; animation: stub-march .6s linear infinite; }
@keyframes stub-march { to { stroke-dashoffset: -10; } }
.wire-march { animation: wire-march 1s linear infinite; }
@keyframes wire-march { to { stroke-dashoffset: -25; } }
.wire-dot.lit { fill: #b9f6ca; }
@media (prefers-reduced-motion: reduce) { .stub-march, .wire-march { animation: none; } }

/* ---------- ventana de NAP / manga (estilo «Punto de acceso» de Tomodat) ---------- */
.modal.tmd-win { border-radius: 6px; overflow: hidden; }
.modal.tmd-win .modal-head { background: #7cb342; color: #fff; padding: 8px 14px; }
.modal.tmd-win .modal-head h2 { font-size: 14px; font-weight: 700; color: #fff; }
.modal.tmd-win .modal-head .icon-btn { color: #fff; background: #e53935; border-radius: 3px; width: 24px; height: 24px; }
.tw-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; background: #f5f7f8; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; }
.tw-btn { width: 32px; height: 30px; border: 0; border-radius: 3px; background: #1e88c7; color: #fff; font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.tw-btn:hover { background: #1669a0; }
.tw-btn.on { background: #2e7d32; }
.tw-btn.danger { background: #e53935; }
.tw-btn.danger:hover { background: #b71c1c; }
.tw-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.tw-chip { font-size: 12px; padding: 3px 8px; border-radius: 12px; background: #eceff1; color: #455a64; white-space: nowrap; }
.tw-chip.ok { background: #e8f5e9; color: #1b5e20; }
.tw-chip.proj { background: #fff3e0; color: #b35c00; }
.tw-chip.lit { background: #e0f7fa; color: #00695c; font-weight: 600; }

/* ---------- splitter estilo Tomodat ---------- */
.tsp-btn, .tsp-act { cursor: pointer; }
.tsp-btn:hover rect, .tsp-act:hover rect { filter: brightness(1.15); }
.tw-btn.txt { width: auto; padding: 0 7px; font-size: 11px; font-weight: 800; }
.tw-rack { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; max-height: 420px; overflow: auto; background: #fff; }
.tsp-grip { cursor: grab; }
.tsp-grip:active { cursor: grabbing; }
.tsp-dest { cursor: pointer; }
.tsp-dest:hover rect { fill: #ffffff33; }
.cv-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; margin-top: 6px; display: grid; gap: 3px; font-size: 13px; }

/* ---------- fotos 360° ---------- */
.ph { position: relative; }
.ph-360 { position: absolute; left: 4px; bottom: 4px; background: #1565c0; color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 8px; pointer-events: none; }
.ph.is360 img { outline: 2px solid #1565c0; outline-offset: -2px; }
.ph-mark { position: absolute; left: 4px; top: 4px; border: 0; background: #ffffffd9; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 12px; line-height: 1; display: none; }
.ph:hover .ph-mark { display: block; }
.pano-wrap { position: relative; width: 100%; height: min(62vh, 560px); background: #111; border-radius: 6px; overflow: hidden; }
.pano-wrap:fullscreen { height: 100vh; border-radius: 0; }
.pano-canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.pano-canvas:active { cursor: grabbing; }
.pano-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: #000a; color: #fff; font-size: 12px; padding: 5px 12px; border-radius: 14px; pointer-events: none; }
.undo-bar { display: flex; gap: 4px; margin-right: 8px; }
.undo-bar .btn { color: #fff; border-color: #ffffff33; padding: 6px 10px; }
.undo-bar .btn:disabled { opacity: .35; cursor: default; }
.dbm-toggle { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: #fff; }
.dbm-badge { pointer-events: auto; }

/* splitter desbalanceado: porcentajes enlazados */
.pct-box { border: 1px solid var(--border, #ddd); border-radius: 8px; padding: 10px; background: rgba(30, 136, 199, 0.05); }
.pct-box[hidden] { display: none; }
.pct-box .pct-in { width: 90px; font-size: 18px; font-weight: 700; text-align: center; }
.pct-bar { display: flex; height: 22px; border-radius: 5px; overflow: hidden; margin-top: 8px; font: 700 12px Arial, sans-serif; color: #fff; }
.pct-bar1 { background: #1e88c7; display: flex; align-items: center; justify-content: center; min-width: 28px; transition: width .15s; }
.pct-bar2 { background: #43a047; flex: 1; display: flex; align-items: center; justify-content: center; min-width: 28px; }
.pct-quick { min-width: 300px; }
.pct-quick .btn.danger { background: #e53935; color: #fff; border-color: #e53935; }
.pct-quick .btn.danger:hover { background: #c62828; }

/* puertos por tipo al agregar router / switch */
.pc-box { border: 1px solid var(--border, #ddd); border-radius: 8px; padding: 10px; background: rgba(30, 136, 199, 0.04); }
.pc-box[hidden] { display: none; }
.pc-title { font-weight: 600; margin-bottom: 6px; }
.pc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.pc-grid .pc-in { width: 100%; font-weight: 700; text-align: center; }
.pc-grid label > span { border-left: 4px solid #546e7a; padding-left: 5px; }
.pc-grid .pc-sfp > span { border-color: #ef6c00; }
.pc-grid .pc-sfpp > span { border-color: #6a1b9a; }
.pc-grid .pc-sfp28 > span { border-color: #00838f; }
@media (max-width: 560px) { .pc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ================= inicio de sesión ================= */
.lg-screen { position: fixed; inset: 0; z-index: 10000; display: grid; grid-template-columns: 1.15fr 1fr; background: #06101f; color: #e8f1ff; opacity: 0; transition: opacity .45s ease; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.lg-screen.in { opacity: 1; }
.lg-screen.out { opacity: 0; transform: scale(1.01); transition: opacity .45s ease, transform .45s ease; }
.lg-hero { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 20% 10%, #12305c 0%, #0a1c38 45%, #050d1b 100%); display: flex; align-items: flex-end; padding: 56px; }
.lg-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.lg-line { fill: none; stroke: rgba(125, 249, 255, .16); stroke-width: 2; }
.lg-pulse { fill: none; stroke: #7df9ff; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 40 1400; stroke-dashoffset: 1440; filter: drop-shadow(0 0 6px #00e5ff); animation: lg-run 5s linear infinite; }
@keyframes lg-run { to { stroke-dashoffset: 0; } }
.lg-node { fill: #0b1f3a; stroke: #7df9ff; stroke-width: 2; }
.lg-halo { animation: lg-breathe 3.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes lg-breathe { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: .9; transform: scale(1.1); } }
.lg-hero-txt { position: relative; max-width: 480px; }
.lg-hero-txt h2 { font-size: 34px; line-height: 1.15; margin: 22px 0 18px; font-weight: 700; letter-spacing: -.5px; background: linear-gradient(90deg, #fff, #9fdfff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-hero-txt ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: #a9bfdc; font-size: 15px; }
.lg-hero-txt li::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #00e5ff; box-shadow: 0 0 10px #00e5ff; margin-right: 12px; vertical-align: middle; }
.lg-logo { display: flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: .3px; color: #fff; }
.lg-logo b { color: #00e5ff; }
.lg-mark { width: 34px; height: 34px; border-radius: 10px; background: radial-gradient(circle at 50% 115%, #00e5ff 0 36%, transparent 37%), linear-gradient(135deg, #1565c0, #0d47a1); box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 8px 24px rgba(0, 229, 255, .25); }
.lg-side { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; background: linear-gradient(180deg, #0b1628 0%, #0a1322 100%); }
.lg-side::before { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 184, 212, .18), transparent 65%); top: 8%; right: -120px; pointer-events: none; }
.lg-mobile-logo { display: none; margin-bottom: 22px; }
.lg-card { position: relative; width: 100%; max-width: 400px; padding: 34px 32px 26px; border-radius: 20px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .09); box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 14px; }
.lg-card.shake { animation: lg-shake .42s cubic-bezier(.36,.07,.19,.97); }
@keyframes lg-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.lg-head h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.3px; color: #fff; }
.lg-head p { margin: 0 0 6px; color: #8fa6c4; font-size: 14px; line-height: 1.45; }
.lg-field { position: relative; display: block; }
.lg-field input { width: 100%; height: 54px; padding: 20px 44px 6px 46px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(6, 14, 28, .6); color: #fff; font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.lg-field input:hover { border-color: rgba(255,255,255,.22); }
.lg-field input:focus { border-color: #00b8d4; box-shadow: 0 0 0 4px rgba(0, 184, 212, .18); background: rgba(6, 14, 28, .85); }
.lg-field input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 40px #0a1628 inset; caret-color: #fff; }
.lg-lbl { position: absolute; left: 46px; top: 17px; color: #7f93b0; font-size: 15px; pointer-events: none; transition: all .18s ease; }
.lg-field input:focus + .lg-lbl, .lg-field input:not(:placeholder-shown) + .lg-lbl { top: 8px; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: #5fd4ea; }
.lg-ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: .75; filter: grayscale(1) brightness(1.6); }
.lg-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #8fa6c4; cursor: pointer; font-size: 16px; filter: grayscale(1) brightness(1.5); opacity: .7; }
.lg-eye:hover, .lg-eye.on { opacity: 1; background: rgba(255,255,255,.06); }
.lg-meter { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: -6px; }
.lg-meter i { display: block; height: 100%; width: 0; background: #e53935; transition: width .25s, background .25s; }
.lg-meter[data-level="2"] i { background: #fb8c00; } .lg-meter[data-level="3"] i { background: #fdd835; } .lg-meter[data-level="4"] i { background: #00e676; }
.lg-caps { color: #ffcc80; font-size: 12px; margin-top: -4px; }
.lg-row { display: flex; align-items: center; justify-content: space-between; }
.lg-check { display: flex; align-items: center; gap: 10px; color: #a9bfdc; font-size: 13.5px; cursor: pointer; user-select: none; }
.lg-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lg-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid rgba(255,255,255,.3); display: grid; place-items: center; transition: all .15s; }
.lg-check input:checked + .lg-box { background: #00b8d4; border-color: #00b8d4; }
.lg-check input:checked + .lg-box::after { content: '✓'; color: #04121f; font-size: 13px; font-weight: 800; }
.lg-check input:focus-visible + .lg-box { box-shadow: 0 0 0 3px rgba(0,184,212,.35); }
.lg-btn { position: relative; height: 52px; border: 0; border-radius: 12px; cursor: pointer; font-size: 15.5px; font-weight: 700; letter-spacing: .2px; color: #04121f; background: linear-gradient(135deg, #00e5ff 0%, #00b8d4 45%, #2979ff 100%); background-size: 160% 160%; box-shadow: 0 10px 30px rgba(0, 184, 212, .35); transition: transform .15s, box-shadow .2s, background-position .4s; margin-top: 4px; }
.lg-btn:hover { background-position: 100% 0; box-shadow: 0 14px 36px rgba(0, 184, 212, .5); transform: translateY(-1px); }
.lg-btn:active { transform: translateY(0); }
.lg-btn:focus-visible { outline: 3px solid rgba(125, 249, 255, .6); outline-offset: 2px; }
.lg-btn:disabled { cursor: wait; opacity: .85; }
.lg-spin { display: none; position: absolute; right: 18px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2.5px solid rgba(4,18,31,.3); border-top-color: #04121f; animation: lg-rot .7s linear infinite; }
.lg-card.busy .lg-spin { display: block; }
@keyframes lg-rot { to { transform: rotate(360deg); } }
.lg-err { background: rgba(229, 57, 53, .12); border: 1px solid rgba(229, 57, 53, .35); color: #ffb4b0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.lg-foot { margin: 4px 0 0; color: #6f84a2; font-size: 12.5px; text-align: center; line-height: 1.45; }
.lg-copy { position: absolute; bottom: 16px; color: #4d6180; font-size: 12px; }
@media (max-width: 900px) {
  .lg-screen { grid-template-columns: 1fr; }
  .lg-hero { position: absolute; inset: 0; padding: 0; opacity: .55; }
  .lg-hero-txt { display: none; }
  .lg-side { background: transparent; position: relative; }
  .lg-mobile-logo { display: block; }
  .lg-card { padding: 28px 22px 22px; }
}
@media (prefers-reduced-motion: reduce) { .lg-pulse, .lg-halo, .lg-card.shake { animation: none; } .lg-pulse { stroke-dasharray: none; stroke-dashoffset: 0; opacity: .3; } }

/* ================= usuario en la barra superior ================= */
.user-host { display: flex; align-items: center; gap: 10px; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 24px; transition: background .15s; }
.user-chip:hover, .user-menu[open] .user-chip { background: rgba(255,255,255,.1); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; letter-spacing: .5px; color: #fff; background: linear-gradient(135deg, var(--c, #00b8d4), color-mix(in srgb, var(--c, #00b8d4) 55%, #000)); box-shadow: 0 0 0 2px rgba(255,255,255,.18); flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.user-txt { display: flex; flex-direction: column; line-height: 1.15; }
.user-txt b { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-txt small { color: #9fb3cc; font-size: 11px; }
.user-menu .menu-body { right: 0; left: auto; min-width: 230px; }
.menu-who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-who small { color: var(--muted); }
.menu-item.danger { color: var(--bad); }
.ro-badge { background: rgba(255,255,255,.12); color: #e3ecf7; border: 1px solid rgba(255,255,255,.2); padding: 4px 10px; border-radius: 14px; font-size: 12px; white-space: nowrap; }
@media (max-width: 1100px) { .user-txt { display: none; } }

/* ================= solo lectura: se ocultan las herramientas de edición ================= */
body.ro .tools [data-mode^="add:"], body.ro .tools [data-mode="cable"], body.ro .tools [data-mode="region"], body.ro .tools [data-mode="client"],
body.ro .undo-bar, body.ro #btn-convert, body.ro #btn-home-view, body.ro #btn-import-kml, body.ro #btn-import,
body.ro .tsp-btn, body.ro .ph-del, body.ro .ph-mark { display: none !important; }

/* ================= administración de usuarios ================= */
.users-admin .roles-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.users-admin .roles-legend > div { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.users-admin .roles-legend i { width: 10px; height: 10px; border-radius: 50%; grid-row: span 2; }
.users-admin .u-cell { display: flex; align-items: center; gap: 10px; }
.users-admin tr.off { opacity: .55; }
.users-admin .new-user { margin-top: 16px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; }
.users-admin .new-user h3 { margin: 0 0 10px; font-size: 14px; }
.users-admin .nu-grid { display: grid; grid-template-columns: 1fr 1.3fr 1.2fr 1fr auto; gap: 8px; }
.users-admin .nu-grid input, .users-admin .nu-grid select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: #cfd8dc; cursor: pointer; transition: background .2s; }
.switch span::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + span { background: #2e7d32; }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:disabled + span { cursor: not-allowed; opacity: .6; }
@media (max-width: 760px) { .users-admin .roles-legend, .users-admin .nu-grid { grid-template-columns: 1fr; } }
.tabs button { white-space: nowrap; }
@media (max-width: 1500px) { #search { width: 200px; } .undo-bar .btn { padding-left: 8px; padding-right: 8px; } }
#search { min-width: 170px; flex-shrink: 1; }
.lg-link { background: none; border: 0; color: #5fd4ea; cursor: pointer; font-size: 13.5px; padding: 4px; align-self: center; text-decoration: none; border-radius: 6px; }
.lg-link:hover { text-decoration: underline; color: #9ff0ff; }
.lg-link:focus-visible { outline: 2px solid rgba(95, 212, 234, .6); }
.lg-ok { background: rgba(0, 230, 118, .1); border: 1px solid rgba(0, 230, 118, .35); color: #b9f6ca; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.lg-step2 { display: flex; flex-direction: column; gap: 14px; }
.lg-step2[hidden] { display: none; }
.users-admin .new-user > input[type=email] { margin-top: 8px; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }

/* logo propio */
.brand-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(0, 184, 212, .35), 0 0 12px rgba(0, 184, 212, .35); }
img.lg-mark { width: 40px; height: 40px; border-radius: 50%; background: none; }
.lg-biglogo { display: block; width: 220px; height: 220px; border-radius: 50%; filter: drop-shadow(0 0 28px rgba(0, 184, 212, .45)); animation: lg-float 6s ease-in-out infinite; }
@keyframes lg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.lg-mobile-logo .lg-biglogo { width: 120px; height: 120px; margin: 0 auto; }
@media (max-height: 760px) { .lg-hero-txt .lg-biglogo { width: 160px; height: 160px; } }
@media (prefers-reduced-motion: reduce) { .lg-biglogo { animation: none; } }

/* modo nube: aviso de pago y pantalla de bloqueo */
.bill-bar { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 7px 44px 7px 16px; font-size: 13.5px; font-weight: 600; position: relative; flex: none; }
.bill-bar.warn { background: #fff4d6; color: #7a4f00; border-bottom: 1px solid #f3d27a; }
.bill-bar.bad { background: #fde4e4; color: #8e1c1c; border-bottom: 1px solid #f2a7a7; }
.bill-bar.info { background: #e3f2fd; color: #0d47a1; border-bottom: 1px solid #b6d9f7; }
.bill-bar a { color: inherit; font-weight: 700; }
.bill-x { position: absolute; right: 10px; border: 0; background: none; cursor: pointer; color: inherit; font-size: 14px; opacity: .7; }
.lg-blocked { text-align: center; }
.lg-blocked .lg-head p { color: #b7c7dd; }
.lg-lock { font-size: 38px; width: 74px; height: 74px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: rgba(229, 57, 53, .12); border: 1px solid rgba(229, 57, 53, .35); }
.lg-btn-link { display: grid; place-items: center; text-decoration: none; }

/* ================= panel del dueño ================= */
body.owner-page { overflow: auto; display: block; }
body.owner-page .top { position: sticky; top: 0; }
.own-tag { margin-left: 10px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 3px 8px; border-radius: 10px; background: rgba(0, 229, 255, .15); color: #7df9ff; }
.own-main { display: block; max-width: 1320px; margin: 0 auto; padding: 22px 20px 60px; }
.own-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.own-head h1 { margin: 0 0 4px; font-size: 24px; }
.own-head p { margin: 0; }
.own-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.own-card { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.05); border-left: 4px solid #90a4ae; }
.own-card small { color: var(--muted); font-size: 12px; }
.own-card b { font-size: 22px; }
.own-card.ok { border-left-color: #2e7d32; } .own-card.warn { border-left-color: #f9a825; } .own-card.bad { border-left-color: #c62828; } .own-card.off { border-left-color: #616161; } .own-card.money { border-left-color: #0d47a1; cursor: default; }
.own-card.on { outline: 2px solid var(--brand-2); }
.own-tools input[type=search] { flex: 1; max-width: 420px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.own-badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 12px; }
.own-badge.ok { background: #e8f5e9; color: #1b5e20; } .own-badge.warn { background: #fff4d6; color: #7a4f00; } .own-badge.bad { background: #fde4e4; color: #8e1c1c; } .own-badge.off { background: #eceff1; color: #37474f; }
.own-table tr.st-vencido td, .own-table tr.st-suspendido td { background: #fffafa; }
.own-sub { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.own-preview { padding: 10px 12px; border-radius: 8px; background: #f1f7ff; border: 1px solid #cfe3fb; }
.own-now { padding: 8px 0; }
@media (max-width: 800px) { .own-table td:nth-child(2), .own-table th:nth-child(2), .own-table td:nth-child(6), .own-table th:nth-child(6) { display: none; } }
.own-legacy { background: #f1f7ff; border: 1px solid #cfe3fb; border-radius: 8px; padding: 8px 10px; }
@media (max-width: 600px) { .own-tag { display: none; } }
.own-empty { background: #e8f5e9; border: 1px solid #c8e6c9; color: #1b5e20; border-radius: 8px; padding: 8px 10px; margin: 0; }
.own-legacy summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.own-legacy label { margin-top: 6px; }

/* copias de seguridad */
body:not([data-role="admin"]) #btn-backup { display: none; }
.bk-sec { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bk-sec:last-child { border-bottom: 0; }
.bk-sec h3 { margin: 0 0 8px; font-size: 15px; }
.bk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-chip { background: #eef4fb; border: 1px solid #d5e4f5; border-radius: 14px; padding: 3px 10px; font-size: 12.5px; }
.bk-mail { margin-top: 8px; }
.bk-mail input { flex: 1; max-width: 320px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; }
.bk-auto { display: flex; flex-direction: column; gap: 8px; }
.bk-auto input[type=email] { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 220px; }
.bk-auto select, .bk-auto input[type=number] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.bk-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #e3f2fd; color: #0d47a1; }
.bk-tag.man { background: #e8f5e9; color: #1b5e20; }
.bk-tag.warn { background: #fff4d6; color: #7a4f00; }
.btn.busy { opacity: .6; cursor: wait; }

/* color de NAP y mangas */
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 8px; border: 2px solid #cfd8dc; background: var(--sw); cursor: pointer; color: #fff; font-weight: 800; text-shadow: 0 0 3px #000; }
.swatch.on { border-color: #0d47a1; box-shadow: 0 0 0 3px rgba(13, 71, 161, .25); }
body.ro #btn-colors { display: none !important; }

/* candado de la caja */
.tw-btn.lock { background: #c62828 !important; color: #fff; }
.tw-chip.lock { background: #fde4e4; color: #8e1c1c; font-weight: 700; }
.box-locked .tsp-btn, .box-locked .tsp-grip { display: none; }
.box-locked .splice-bar .btn, .box-locked .splice-bar select { opacity: .45; pointer-events: none; }
.box-locked .splice-bar .dbm-toggle { opacity: 1; pointer-events: auto; }
.box-locked .sp-svg { background: repeating-linear-gradient(135deg, transparent 0 22px, rgba(198, 40, 40, .035) 22px 24px); }
.eq-cover { cursor: pointer; }

/* ================= botón «mi ubicación» y punto azul ================= */
/* queda por encima de los controles de Google Maps (zoom, muñeco de Street View) */
.map-fab { position: absolute; right: 12px; bottom: 210px; z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: #1a73e8; font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); display: grid; place-items: center; }
.map-fab.on { background: #1a73e8; color: #fff; }
.map-fab.busy { animation: fab-pulse 1s ease-in-out infinite; }
@keyframes fab-pulse { 50% { box-shadow: 0 0 0 10px rgba(26, 115, 232, .25); } }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(26, 115, 232, .35), 0 2px 6px rgba(0, 0, 0, .4); transform: translateY(50%); }

/* ================= celular / app instalada (pantallas angostas) ================= */
@media (max-width: 820px) {
  html, body { overflow-x: hidden; height: 100dvh; }
  body { padding-bottom: env(safe-area-inset-bottom); }
  .top { flex-wrap: wrap; height: auto; padding: calc(6px + env(safe-area-inset-top)) 10px 0; gap: 6px 8px; }
  .brand { font-size: 15px; }
  .brand-logo { width: 30px; height: 30px; }
  .tabs { order: 10; flex: 0 0 calc(100% + 20px); margin: 0 -10px; padding: 0 4px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: 9px 12px; font-size: 13px; }
  .undo-bar { display: flex; gap: 2px; }
  .undo-bar .btn { width: 34px; padding: 6px 0 6px 10px; overflow: hidden; text-align: left; }
  .menu > summary.btn { padding: 6px 9px; }
  .user-chip { padding: 2px; }
  .ro-badge { font-size: 11px; padding: 3px 7px; }
  .menu-body { position: fixed; right: 8px; left: auto; top: calc(48px + env(safe-area-inset-top)); max-width: calc(100vw - 16px); max-height: 75dvh; overflow: auto; }
  .menu-item { padding-top: 11px; padding-bottom: 11px; }
  /* mapa: herramientas en una tira inferior deslizable */
  #view-map { flex-direction: column; }
  .map-area { order: 1; flex: 1; min-height: 0; }
  .tools { order: 5; width: 100%; flex-direction: row; align-items: stretch; overflow-x: auto; overflow-y: hidden; border-right: 0; border-top: 1px solid var(--line); padding: 4px 6px; scrollbar-width: none; }
  .tools::-webkit-scrollbar { display: none; }
  .tools button, .tools summary { flex: none; min-width: 60px; padding: 6px 4px; }
  .tools hr { border-top: 0; border-left: 1px solid var(--line); margin: 6px 3px; }
  #layers { position: fixed; left: 8px; right: 8px; bottom: 84px; width: auto; }
  .tree { position: absolute; left: 0; top: 0; bottom: 70px; z-index: 6; width: min(310px, 88vw); box-shadow: var(--shadow); }
  .map-legend { display: none; }
  .map-fab { bottom: 150px; right: 10px; }
  /* panel de detalle: hoja inferior */
  .side.open { position: absolute; left: 0; right: 0; bottom: 0; top: 32%; width: 100%; z-index: 7; border-left: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgba(16, 32, 64, .25); }
  .page { padding: 12px; }
  /* ventanas a pantalla completa */
  .modal-wrap { padding: 0; }
  .modal, .modal.wide { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .modal-head { padding-top: calc(10px + env(safe-area-inset-top)); }
  .form { grid-template-columns: 1fr; }
  .tw-bar { gap: 3px; padding: 5px; }
  .tw-btn { min-width: 38px; min-height: 38px; }
  .splice-bar { gap: 6px; }
  .btn { min-height: 36px; }
  .toast { max-width: calc(100vw - 24px); }
  .splice-bar > .muted.small { display: none; }
  /* diagrama de empalmes: tamaño legible, se desliza con el dedo en las dos direcciones */
  .sp-svg { width: 900px; max-width: none; margin: 0; }
  .splice-scroll { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  /* inicio de sesión: se puede desplazar si el teclado tapa el formulario */
  .lg-screen { overflow-y: auto; }
  .lg-side { justify-content: flex-start; padding-top: calc(28px + env(safe-area-inset-top)); min-height: 100dvh; }
  .lg-copy { position: static; margin-top: 18px; }
  .bill-bar { font-size: 12px; padding: 6px 34px 6px 10px; flex-wrap: wrap; }
}
/* app instalada: sin barras del navegador */
@media (display-mode: standalone) { .top { padding-top: env(safe-area-inset-top); } }
.own-link { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: #f7f9fc; }
