:root {
  --bg: #070809; --panel: #16181c; --panel2: #1b1e23;
  --line: #05060a; --edge: rgba(255,255,255,.06);
  --blue: #2aa8ff; --blue-dim: #1c6fae; --cyan: #7fe0ff;
  --text: #cfd8e0; --dim: #6b7681;
  --red: #ff3b30; --green: #34d058; --amber: #ffcf3f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(120% 80% at 50% -10%, #1b2733 0%, #0b0d10 45%, #070809 100%),
    #070809;
  color: var(--text); font-family: "Segoe UI", system-ui, Arial, sans-serif;
  user-select: none; -webkit-user-select: none; overscroll-behavior: none;
}
.app {
  min-height: 100dvh; max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 8px) 10px calc(env(safe-area-inset-bottom) + 8px);
  /* Fills the screen exactly on normal phones (no page scroll — the cluster list
     scrolls internally). On tiny screens it grows and the page scrolls as a fallback. */
  border: 2px solid #23272d; border-radius: 18px;
  background:
    radial-gradient(circle at 13px 13px, #565b63 0 2px, transparent 3px),
    radial-gradient(circle at calc(100% - 13px) 13px, #565b63 0 2px, transparent 3px),
    radial-gradient(circle at 13px calc(100% - 13px), #565b63 0 2px, transparent 3px),
    radial-gradient(circle at calc(100% - 13px) calc(100% - 13px), #565b63 0 2px, transparent 3px),
    linear-gradient(180deg, #2a2e34 0%, #1a1d22 12%, #101216 100%);
  box-shadow: inset 0 0 0 1px #000, inset 0 2px 4px rgba(255,255,255,.06), 0 12px 44px rgba(0,0,0,.6);
}

/* shared panel look */
.lcd, .scope-frame, .console { position: relative; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 4px;
}
.brand {
  flex: none; white-space: nowrap;
  font-size: 22px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(180deg, #fff, #9fc6e2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,.4);
}
.brand::after { content: ""; }
.status { flex: 1; min-width: 0; font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.status #statusTxt { overflow: hidden; text-overflow: ellipsis; }
.status b { color: var(--green); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #3a3030; box-shadow: inset 0 0 3px #000; transition: .3s; }
.dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }
.iconbtn {
  flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #33383f, #14171b); color: var(--text);
  box-shadow: inset 0 1px 0 var(--edge), 0 3px 8px rgba(0,0,0,.5);
}
.iconbtn:active { background: linear-gradient(180deg, #14171b, #22262b); }

/* ---------- LCD ---------- */
.lcd {
  flex: 0 0 auto;
  padding: 6px 14px; border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(60,120,150,.08), rgba(0,0,0,0) 30%),
    radial-gradient(120% 130% at 50% 0%, #061218 0%, #02070b 70%);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 40px rgba(0,0,0,.9), inset 0 1px 0 rgba(120,220,255,.08), 0 8px 24px rgba(0,0,0,.5);
}
.lcd-top { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
.band { color: var(--blue); text-shadow: 0 0 8px rgba(42,168,255,.5); }
.mode { color: var(--cyan); }
.chan { color: #04140a; background: var(--green); font-weight: 800; padding: 2px 9px; border-radius: 5px; font-size: 13px; box-shadow: 0 0 10px rgba(52,208,88,.5); }
.chan[hidden] { display: none; }
.sub { color: #b8ffcf; background: #123a2a; border: 1px solid #1f7a4d; font-weight: 800; padding: 2px 8px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.sub[hidden] { display: none; }
.sub:active { background: #17632e; }
.enc { font-size: 15px; cursor: pointer; opacity: .55; filter: grayscale(1); }
.enc.on { opacity: 1; filter: none; text-shadow: 0 0 10px rgba(255,208,63,.8); }
.enc[hidden] { display: none; }
.rb { font-size: 11px; font-weight: 800; letter-spacing: .5px; cursor: pointer; padding: 2px 8px; border-radius: 5px; background: #1a1c22; border: 1px solid #2f333c; color: #7a8694; white-space: nowrap; }
.rb.on { background: #123a2a; border-color: #1f7a4d; color: #b8ffcf; }
.rb:active { filter: brightness(1.2); }
.rb[hidden] { display: none; }
.pwr { margin-left: auto; color: var(--amber); font-size: 13px; text-shadow: 0 0 6px rgba(255,207,63,.4); }
.freq {
  font-family: "Consolas", ui-monospace, monospace; font-weight: 700; text-align: center;
  font-size: clamp(26px, 9vw, 44px); letter-spacing: 1px; color: #eafaff;
  text-shadow: 0 0 18px rgba(42,168,255,.75), 0 0 3px rgba(255,255,255,.4);
  margin: 1px 0; cursor: pointer; line-height: 1.05;
}
.freq:active { opacity: .7; }
.talker { text-align: center; font-size: 14px; font-weight: 800; min-height: 14px; color: var(--red); text-shadow: 0 0 10px rgba(255,59,48,.5); line-height: 1.2; }
.talker .tk-call { display: block; font-size: 14px; font-weight: 800; }
.talker .tk-flag { font-size: 15px; vertical-align: middle; }
.talker .tk-name { display: block; font-size: 11px; font-weight: 600; color: #bfe8c9; text-shadow: none; margin-top: 1px; }

/* PTT mode toggle */
.ptt-mode { display: flex; justify-content: flex-end; margin-bottom: -1px; }
.ptt-mode .mini { height: 28px; font-size: 12px; }
.ptt-mode .mini.active { color: #04121c; }
.lcd-bottom { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 10px; font-weight: 800; color: var(--dim); }
.lcd-bottom small { margin-right: 8px; }
.led { width: 9px; height: 9px; border-radius: 50%; background: #1c1717; box-shadow: inset 0 0 3px #000; transition: .12s; }
.led.tx.on { background: var(--red); box-shadow: 0 0 9px var(--red); }
.led.rx.on { background: var(--green); box-shadow: 0 0 9px var(--green); }
.led.sql.on { background: var(--amber); box-shadow: 0 0 9px var(--amber); }
.smeter-wrap { margin-top: 3px; }
.sm-scale { margin-top: 2px; }
.smeter { position: relative; height: 11px; border-radius: 6px; background: #05090d; border: 1px solid var(--line); overflow: hidden; box-shadow: inset 0 1px 4px rgba(0,0,0,.85); }
.smeter i { position: absolute; inset: 0; width: 0%; background: linear-gradient(90deg, #1e7d3a, #34d058 48%, #ffcf3f 74%, #ff3b30); box-shadow: 0 0 8px rgba(52,208,88,.4); transition: width .08s linear; }
.sm-scale { display: flex; justify-content: space-between; font-size: 9px; font-weight: 700; color: var(--dim); margin-top: 3px; padding: 0 2px; }

/* ---------- Scope ---------- */
.scope-frame {
  flex: 0 0 150px; height: 150px; min-height: 150px; padding: 4px; border-radius: 12px;
  display: flex; overflow: hidden;
  background: linear-gradient(180deg, #2a2e34, #101216);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge), 0 6px 18px rgba(0,0,0,.5);
}
.scope { flex: 1; width: 100%; height: 100%; display: block; border-radius: 9px; background: #02060a; touch-action: none; box-shadow: inset 0 0 30px rgba(0,0,0,.8); }
.scope-tag { position: absolute; top: 12px; right: 14px; font-size: 9px; font-weight: 800; letter-spacing: 2px; color: rgba(120,180,220,.45); pointer-events: none; }

/* ---------- Console (controls) ---------- */
.controls {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 5px; padding: 7px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #202429, #121418);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge), 0 6px 18px rgba(0,0,0,.45);
}
.stepper-row { display: grid; grid-template-columns: auto 1fr auto auto 1fr auto; gap: 7px; align-items: center; }
.step {
  width: 44px; height: 36px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, #33383f, #14171b); color: var(--text);
  box-shadow: inset 0 1px 0 var(--edge), 0 3px 7px rgba(0,0,0,.5);
}
.step:active { color: var(--blue); box-shadow: inset 0 0 12px rgba(42,168,255,.5); background: linear-gradient(180deg, #14171b, #22262b); }
.step-label { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--blue); }
.band-pick {
  height: 36px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--blue);
  background: linear-gradient(180deg, #33383f, #14171b);
  box-shadow: inset 0 1px 0 var(--edge), 0 3px 7px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.band-pick:active { color: #fff; box-shadow: inset 0 0 12px rgba(42,168,255,.5); background: linear-gradient(180deg, #14171b, #22262b); }
/* Selector de banda emergente */
.band-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 16px; max-height: 58vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.band-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 4px; background: linear-gradient(180deg, #22262c, #14171b); border: 1px solid var(--line); border-radius: 12px; color: var(--text); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.band-item:active { transform: translateY(1px); }
.band-item .band-name { font-size: 18px; font-weight: 800; letter-spacing: .5px; }
.band-item .band-sub { font-size: 10px; color: var(--dim); display: flex; align-items: center; gap: 5px; letter-spacing: .5px; }
.band-item.active { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset, 0 0 14px rgba(42,168,255,.25); }
.band-item.active .band-name { color: var(--blue); text-shadow: 0 0 8px rgba(42,168,255,.5); }
.band-free { background: #17632e; color: #b8ffcf; border-radius: 5px; padding: 1px 4px; font-weight: 800; font-size: 9px; letter-spacing: .5px; }
.band-test { grid-column: 1 / -1; background: linear-gradient(180deg, #123a2a, #0c221a); border-color: #1f7a4d; }
.band-test .band-name { font-size: 15px; color: #7df3b0; }
.band-test .band-sub { color: #6fbf92; }
.band-test.active { border-color: #2ee88a; box-shadow: 0 0 0 1px #2ee88a inset, 0 0 14px rgba(46,232,138,.28); }

.tune-row { display: grid; grid-template-columns: 72px 1fr 72px; gap: 7px; }
.tune {
  height: 38px; font-size: 17px; font-weight: 700; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, #33383f, #14171b); color: var(--text);
  box-shadow: inset 0 1px 0 var(--edge), 0 3px 7px rgba(0,0,0,.5);
}
.tune:active { color: var(--blue); box-shadow: inset 0 0 12px rgba(42,168,255,.5); }
.step-sel {
  height: 38px; font-size: 14px; font-weight: 800; letter-spacing: 1px; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, #202429, #101216); color: var(--amber);
  box-shadow: inset 0 1px 0 var(--edge), 0 3px 7px rgba(0,0,0,.5);
}
.step-sel:active { color: #fff; box-shadow: inset 0 0 12px rgba(255,207,63,.4); }

.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row label { width: 40px; font-size: 12px; font-weight: 800; color: var(--blue); text-shadow: 0 0 6px rgba(42,168,255,.3); }
.adj {
  flex: 0 0 auto; width: 34px; height: 28px; font-size: 19px; font-weight: 700; line-height: 1;
  border: 1px solid var(--line); border-radius: 9px; color: var(--text);
  background: linear-gradient(180deg, #33383f, #14171b); box-shadow: inset 0 1px 0 var(--edge), 0 3px 7px rgba(0,0,0,.5);
}
.adj:active { color: var(--blue); box-shadow: inset 0 0 12px rgba(42,168,255,.5); background: linear-gradient(180deg, #14171b, #22262b); }
input[type=range] { flex: 1; height: 22px; -webkit-appearance: none; appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--blue), var(--blue-dim) 40%, #0a0c0f); box-shadow: inset 0 1px 3px rgba(0,0,0,.8); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #bfeaff, #2aa8ff 55%, #12557f);
  border: 1px solid #05202f; box-shadow: 0 0 10px rgba(42,168,255,.5), 0 2px 4px rgba(0,0,0,.6);
}
input[type=range]::-moz-range-track { height: 8px; border-radius: 5px; background: linear-gradient(90deg, var(--blue), #0a0c0f); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #bfeaff, #2aa8ff 55%, #12557f); border: 1px solid #05202f; }
.mini {
  height: 32px; padding: 0 13px; font-size: 13px; font-weight: 800; border: 1px solid var(--line); border-radius: 9px;
  background: linear-gradient(180deg, #33383f, #14171b); color: var(--text); box-shadow: inset 0 1px 0 var(--edge);
}
.mini.active { color: #04121c; background: linear-gradient(180deg, #4fb6ff, #1c7fc4); border-color: var(--blue); box-shadow: 0 0 12px rgba(42,168,255,.5); }
.micbar { width: 74px; height: 12px; background: #05090d; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.8); }
.micbar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #135f96, #2aa8ff); transition: width .06s linear; }

.pwr-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pwr-row span { min-width: 64px; text-align: center; font-family: "Consolas", monospace; font-weight: 800; color: var(--amber); font-size: 16px; text-shadow: 0 0 6px rgba(255,207,63,.4); }

/* ---------- PTT ---------- */
.ptt {
  flex: 0 0 auto;
  position: relative; height: 56px; margin-top: 0; border-radius: 13px; border: 2px solid var(--blue-dim);
  background: radial-gradient(120% 140% at 50% 0%, #17496b, #0c2536 70%);
  color: var(--cyan); overflow: hidden;
  box-shadow: 0 0 18px rgba(42,168,255,.25), inset 0 2px 0 rgba(255,255,255,.08), inset 0 -8px 20px rgba(0,0,0,.5);
  touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.ptt-ring { position: absolute; width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(127,224,255,.35); box-shadow: 0 0 20px rgba(42,168,255,.3) inset; }
.ptt-label { position: relative; font-size: 23px; font-weight: 900; letter-spacing: 5px; text-shadow: 0 0 14px rgba(42,168,255,.6); }
.ptt-sub { position: relative; font-size: 9px; letter-spacing: 1px; color: rgba(180,220,240,.6); }
.ptt.tx {
  color: #fff; border-color: #ff8a82;
  background: radial-gradient(120% 140% at 50% 0%, #ff6a60, #b3271f 70%);
  box-shadow: 0 0 40px rgba(255,59,48,.7), inset 0 2px 0 rgba(255,255,255,.2);
  animation: ttx 1s infinite;
}
.ptt.tx .ptt-ring { border-color: rgba(255,255,255,.6); animation: ring 1s infinite; }
.ptt.tx .ptt-sub { color: rgba(255,220,215,.85); }
@keyframes ttx { 0%,100%{box-shadow:0 0 40px rgba(255,59,48,.7), inset 0 2px 0 rgba(255,255,255,.2)} 50%{box-shadow:0 0 60px rgba(255,59,48,.95), inset 0 2px 0 rgba(255,255,255,.25)} }
@keyframes ring { 0%{transform:scale(.9);opacity:.8} 100%{transform:scale(1.5);opacity:0} }

/* ---------- Activity cluster (desplegable hacia arriba) ---------- */
.cluster {
  position: relative; flex: 0 0 auto; margin-top: auto;   /* barra anclada abajo */
  border-radius: 14px; padding: 2px 4px;
  background: linear-gradient(180deg, #1a1d22, #121418);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge), 0 6px 18px rgba(0,0,0,.45);
}
.cluster-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: none; border: none; padding: 10px 8px; cursor: pointer;
  font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--blue);
}
.cluster-title { flex: 1 1 auto; text-align: left; }
.cluster-count { color: var(--dim); font-weight: 600; letter-spacing: 0; font-size: 12px; }
.cluster-count b { color: var(--green); }
.cluster-caret { color: var(--dim); font-size: 11px; transition: transform .2s ease; }
.cluster.open .cluster-caret { transform: rotate(180deg); }
.cluster-list {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  max-height: 58vh; overflow-y: auto; display: none; flex-direction: column; gap: 5px;
  padding: 10px; border-radius: 14px;
  background: linear-gradient(180deg, #1c2027, #0e1014);
  border: 1px solid var(--line);
  box-shadow: 0 -12px 34px rgba(0,0,0,.65);
  z-index: 30;
}
.cluster.open .cluster-list { display: flex; }
.cluster-empty { text-align: center; color: var(--dim); font-size: 13px; padding: 16px 0; }
.cl-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 10px; background: #0f1216; border: 1px solid #1a1d21;
}
.cl-row.tx { background: rgba(255,59,48,.10); border-color: rgba(255,59,48,.35); }
.cl-who { display: inline-flex; align-items: center; min-width: 0; cursor: pointer; }
.cl-who:active { opacity: .7; }
.cl-ava { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-right: 8px; border: 1px solid #2a3138; flex: 0 0 auto; }
.cl-call { font-weight: 800; color: #eafaff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-flag { margin-right: 6px; font-size: 15px; vertical-align: middle; }
.cl-freq { font-family: "Consolas", monospace; font-size: 13px; color: #9fc6e2; cursor: pointer; text-align: right; }
.cl-freq:active { color: var(--blue); }
.cl-freq b { color: var(--blue); font-family: inherit; }
.cl-badge { font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 20px; }
.cl-badge.tx { background: rgba(255,59,48,.2); color: #ff7a72; box-shadow: 0 0 8px rgba(255,59,48,.3); }
.cl-badge.rx { background: rgba(52,208,88,.16); color: #6fe08c; }
.cl-badge.me { background: rgba(42,168,255,.18); color: #7fd0ff; }

/* ---------- Connect ---------- */
.connect {
  height: 54px; border-radius: 14px; font-size: 17px; font-weight: 800; letter-spacing: 1px;
  color: var(--text); background: linear-gradient(180deg, #33383f, #14171b); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge), 0 4px 10px rgba(0,0,0,.5);
}
.connect.on { color: #04140a; background: linear-gradient(180deg, #46d36a, #1f9a44); border-color: #1c7a34; box-shadow: 0 0 16px rgba(52,208,88,.4); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-back[hidden] { display: none; }
.modal { width: 100%; max-width: 420px; background: linear-gradient(180deg, #24282d, #14171b); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.modal h2 { margin: 0 0 16px; font-size: 19px; color: var(--blue); letter-spacing: 1px; }
.modal label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 16px; }
.modal input, .modal select { display: block; width: 100%; margin-top: 6px; padding: 13px; font-size: 16px; background: #0a0c0f; border: 1px solid var(--line); border-radius: 10px; color: #eafaff; }
.modal input:focus, .modal select:focus { outline: 1px solid var(--blue); }
/* Identification = full-screen opaque splash (the radio stays hidden until Entrar) */
#idModal { background: radial-gradient(120% 80% at 50% 0%, #1b2733 0%, #0b0d10 45%, #070809 100%); backdrop-filter: none; }
#idModal .modal { background: transparent; border: none; box-shadow: none; max-width: 460px; }
.id-modal { text-align: center; }
.id-logo { width: min(230px, 62vw); height: min(230px, 62vw); object-fit: contain; margin: 0 auto 18px; display: block; filter: drop-shadow(0 0 26px rgba(42,168,255,.55)); }
.id-modal h2 { text-align: center; }
.id-modal label { text-align: left; }

/* ---- Autenticación (login / registro / recuperar) ---- */
#authModal { background: radial-gradient(120% 80% at 50% 0%, #1b2733 0%, #0b0d10 45%, #070809 100%); backdrop-filter: none; }
.auth-modal { max-width: 440px; max-height: 92vh; overflow-y: auto; text-align: center; }
.auth-modal .id-logo { width: min(120px, 34vw); height: min(120px, 34vw); margin: 0 auto 12px; }
.auth-modal h2 { text-align: center; }
.auth-modal label { text-align: left; margin-bottom: 12px; }
.auth-view h2 { margin-bottom: 14px; }
.auth-err { font-size: 13px; color: var(--red); background: #3a1113; border: 1px solid #5a1c1f; border-radius: 8px; padding: 9px 11px; margin-bottom: 12px; text-align: left; }
.auth-ok { font-size: 13px; color: #7dffa0; background: #10321a; border: 1px solid #1e5a30; border-radius: 8px; padding: 9px 11px; margin-bottom: 12px; text-align: left; }
.auth-links { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.auth-links a { color: var(--blue); font-size: 14px; text-decoration: none; cursor: pointer; }
.auth-links a:active { opacity: .6; }
.auth-links a.danger { color: var(--red); }
.acct-card { background: #0a0c0f; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 16px; text-align: center; }
.acct-call { font-size: 22px; font-weight: 800; color: var(--cyan); letter-spacing: 1px; }
.acct-meta { font-size: 13px; color: var(--dim); margin-top: 4px; }
.brand-logo { flex: none; width: 30px; height: 30px; object-fit: contain; border-radius: 50%; }
.id-note { font-size: 13px; color: var(--text); line-height: 1.5; margin: 0 0 16px; }
.id-note b { color: var(--cyan); }
.credits-modal { text-align: center; }
.credits-modal .id-logo { width: min(150px, 40vw); height: min(150px, 40vw); margin: 0 auto 14px; }
.credits-modal h2 { text-align: center; margin-bottom: 12px; }
.credits-text { font-size: 14px; color: var(--text); line-height: 1.6; margin: 0 0 14px; text-align: left; }
.credits-text b { color: var(--cyan); }
.credits-support { font-size: 13px; color: var(--text); line-height: 1.5; margin: 0 0 12px; text-align: left; }
.credits-copy { font-size: 11px; color: var(--dim); line-height: 1.5; margin: 14px 0 4px; text-align: center; border-top: 1px solid var(--line); padding-top: 12px; }
.wa-btn { display: block; text-decoration: none; text-align: center; font-weight: 700; font-size: 15px; color: #fff; background: linear-gradient(180deg, #34d571, #1faf57); border-radius: 12px; padding: 13px 16px; margin: 0 0 18px; box-shadow: 0 4px 14px rgba(37,211,102,.35); }
.wa-btn:active { transform: translateY(1px); }
.wa-btn::before { content: "\1F4AC"; margin-right: 8px; }
.id-err { font-size: 12px; color: var(--red); margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; height: 50px; border-radius: 12px; font-size: 15px; font-weight: 800; border: 1px solid var(--line); background: linear-gradient(180deg, #4fb6ff, #1c7fc4); color: #04121c; }
.modal-actions button.ghost { background: linear-gradient(180deg, #2b2f35, #131519); color: var(--text); }

/* ---------- Ajustes: perfil ---------- */
.settings-modal { max-height: 90vh; overflow-y: auto; }
.set-section { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: var(--blue); text-transform: uppercase; margin: 4px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.set-hint { font-size: 12px; color: var(--dim); line-height: 1.5; margin: -6px 0 18px; }
.switch-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--text); font-size: 14px; }
.switch-row input[type="checkbox"] { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: var(--blue); }
.switch-row span { flex: 1 1 auto; line-height: 1.4; }
.remember-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; font-size: 13px; color: var(--dim); text-align: left; line-height: 1.35; }
.remember-row input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.roger-row { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; }
.roger-row select { flex: 1 1 auto; }
.roger-row button { flex: 0 0 auto; white-space: nowrap; }

/* ---------- Avatar (foto de perfil) ---------- */
.avatar-wrap { width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, #1c2430, #0c1016); border: 2px solid #2a3a48; display: flex; align-items: center; justify-content: center; }
.avatar-wrap.lg { width: 96px; height: 96px; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-img[hidden] { display: none; }   /* el atributo hidden debe ganar a display:block */
.avatar-ph { font-size: 30px; font-weight: 800; color: var(--blue); letter-spacing: 1px; }
.avatar-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.avatar-actions .mini { height: 34px; }
.mini.ghostmini { background: linear-gradient(180deg, #2b2f35, #131519); color: var(--dim); border-color: var(--line); }
/* El input de archivo se dispara con el botón "Cambiar foto": ocultarlo (la regla
   genérica .modal input {display:block} anula el atributo hidden, hay que forzar). */
.modal input[type="file"] { display: none; }

/* ---------- Modal de perfil (al tocar un indicativo) ---------- */
.profile-modal { text-align: center; }
.prof-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; }
.prof-call { font-size: 24px; font-weight: 800; color: var(--cyan); letter-spacing: 1px; margin-top: 4px; }
.prof-name { font-size: 15px; color: var(--text); margin-top: 3px; }
.prof-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.prof-badge { font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 20px; }
.prof-badge.lic { background: rgba(52,208,88,.16); color: #6fe08c; }
.prof-badge.free { background: rgba(255,207,63,.16); color: #ffcf3f; }
.prof-rows { text-align: left; background: #0a0c0f; border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; margin-bottom: 16px; }
.prof-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #14181d; font-size: 14px; }
.prof-row:last-child { border-bottom: none; }
.prof-row .lbl { color: var(--dim); flex: 0 0 auto; }
.prof-row .val { color: #eafaff; text-align: right; word-break: break-word; }
.prof-empty { color: var(--dim); font-size: 13px; padding: 14px 0; }

/* ---------- Mensajería privada ---------- */
.iconbtn { position: relative; }
.inbox-badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px #12151a; }
.inbox-badge[hidden] { display: none; }
.iconbtn[hidden] { display: none; }   /* el botón 🛡️ (muteados) SOLO se ve a moderadores */
.prof-msg-btn { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, #34d571, #1faf57); color: #04121c; font-weight: 800; font-size: 15px; margin-bottom: 12px; }
.prof-msg-btn:active { transform: translateY(1px); }
.prof-msg-btn[hidden] { display: none; }
.msg-modal .msg-to { font-size: 13px; color: var(--cyan); margin-bottom: 10px; font-weight: 700; }
.msg-modal textarea { width: 100%; padding: 12px; font-size: 16px; background: #0a0c0f; border: 1px solid var(--line); border-radius: 10px; color: #eafaff; resize: vertical; min-height: 90px; font-family: inherit; }
.msg-modal textarea:focus { outline: 1px solid var(--blue); }
.msg-tools { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.emoji-panel { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 180px; overflow-y: auto; background: #0a0c0f; border: 1px solid var(--line); border-radius: 10px; padding: 6px; margin-bottom: 10px; }
.emoji-panel[hidden] { display: none; }
.emoji-panel .emoji { background: none; border: none; font-size: 22px; padding: 4px 0; cursor: pointer; border-radius: 6px; line-height: 1; }
.emoji-panel .emoji:active { background: rgba(42,168,255,.2); }
.inbox-list { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.inbox-item { background: #0a0c0f; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.inbox-item.unread { border-color: var(--blue); box-shadow: 0 0 0 1px rgba(42,168,255,.4); }
.inbox-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 13px; }
.inbox-from { font-weight: 800; color: #eafaff; }
.inbox-when { color: var(--dim); font-size: 11px; white-space: nowrap; }
.inbox-text { color: var(--text); font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.inbox-acts { display: flex; gap: 8px; justify-content: flex-end; }
.inbox-acts .mini { height: 32px; }
.mini.red { background: linear-gradient(180deg, #ff6a60, #b3271f); color: #fff; border-color: var(--line); }

/* ---------- PLUGINS (panel de mejoras concedidas por el admin) ---------- */
.plugins-modal h3 { margin: 0 0 4px; font-size: 18px; }
.plg-intro { font-size: 13px; color: #8aa0b4; margin: 0 0 10px; line-height: 1.4; }
.plugin-list { display: flex; flex-direction: column; gap: 10px; margin: 4px 0; max-height: 60vh; overflow-y: auto; }
.plugin-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(180deg, #0d1116, #080a0d); border: 1px solid #182230; }
.plugin-card.on { border-color: #2aa8ff; box-shadow: 0 0 0 1px rgba(42,168,255,.3), 0 0 18px rgba(42,168,255,.12); }
.plugin-card.locked { opacity: .8; }
.plugin-card .plg-ic { font-size: 26px; width: 34px; text-align: center; }
.plugin-card .plg-body { flex: 1; min-width: 0; }
.plugin-card .plg-name { font-weight: 800; font-size: 15px; color: #eaf4fd; }
.plugin-card .plg-desc { font-size: 12px; color: #8aa0b4; line-height: 1.4; margin-top: 2px; }
.plugin-card .plg-state { font-size: 11px; font-weight: 700; margin-top: 4px; color: #7f93a6; text-transform: uppercase; letter-spacing: .5px; }
.plugin-card.on .plg-state { color: #2aa8ff; }
.plg-lock { font-size: 22px; }
.plg-empty { color: #8aa0b4; font-size: 13px; text-align: center; padding: 12px; }
label.sw { position: relative; display: inline-block; width: 46px; height: 26px; cursor: pointer; }
label.sw input { display: none; }
label.sw span { position: absolute; inset: 0; background: #2a3340; border-radius: 26px; transition: .18s; }
label.sw span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #cdd9e5; border-radius: 50%; transition: .18s; }
label.sw input:checked + span { background: #2aa8ff; }
label.sw input:checked + span::before { transform: translateX(20px); background: #fff; }

/* Botón "PARAR DE HABLAR" (break-in 11m) */
.break-btn { background: linear-gradient(180deg,#7a3d00,#4a2500); border-color: rgba(255,160,40,.55); color: #ffd27f; font-weight: 800; }
.break-btn:active { transform: translateY(1px); }
.break-btn[disabled] { opacity: .5; }

/* Botón "QSY" (11m) */
.qsy-btn { background: linear-gradient(180deg,#005a32,#003a20); border-color: rgba(60,220,140,.5); color: #a9ffcf; font-weight: 800; }
.qsy-btn:active { transform: translateY(1px); }

/* Botón "RESET-TIME" (11m) */
.reset-btn { background: linear-gradient(180deg,#46285a,#2a1840); border-color: rgba(150,110,240,.5); color: #cbb6ff; font-weight: 800; }
.reset-btn:active { transform: translateY(1px); }

/* Cuenta atrás QSY (discreta) */
.qsycount { text-align:center; font-family:"Consolas",monospace; font-weight:800; font-size:12px; letter-spacing:1px; color:#9fe6c0; margin:2px auto 0; padding:1px 9px; border-radius:10px; background:rgba(0,70,45,.35); border:1px solid rgba(60,210,150,.35); width:fit-content; }

/* Botón "RETURN" (11m) */
.return-btn { background: linear-gradient(180deg,#784620,#432610); border-color: rgba(240,160,70,.5); color: #ffd0a0; font-weight: 800; }
.return-btn:active { transform: translateY(1px); }

/* Flechas ±1 kHz del QSY HF (junto al botón QSY) */
.qsy-step { min-width: 34px; padding-left: 8px; padding-right: 8px; font-weight: 800; }

/* ============================ QSL (logbook + tarjetas) ============================ */
.qsl-modal { max-width: 560px; width: 96vw; }
.qsl-tabs { display: flex; gap: 6px; margin: 4px 0 10px; flex-wrap: wrap; }
.qsl-tab {
  flex: 1 1 auto; min-width: 92px; padding: 9px 6px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-family: inherit;
  background: linear-gradient(180deg, #22262c, #14171b); color: var(--dim);
  white-space: nowrap; transition: color .12s, border-color .12s, background .12s;
}
.qsl-tab.active { color: #fff; border-color: var(--blue-dim); background: linear-gradient(180deg, #204a68, #12222e); box-shadow: 0 0 0 1px rgba(42,168,255,.25) inset; }
.qsl-list { max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.qsl-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
}
.qsl-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qsl-call { font-size: 17px; font-weight: 800; color: var(--cyan); letter-spacing: .5px; }
.qsl-when { font-size: 11px; color: var(--dim); }
.qsl-meta { margin-top: 4px; font-size: 12.5px; color: var(--text); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.qsl-meta b { color: var(--blue); font-weight: 700; }
.qsl-tag { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: .4px; }
.qsl-tag.ok { background: rgba(64,200,120,.16); color: #57d98a; border: 1px solid rgba(64,200,120,.35); }
.qsl-tag.wait { background: rgba(255,180,60,.14); color: #ffc352; border: 1px solid rgba(255,180,60,.32); }
.qsl-tag.mail { background: rgba(42,168,255,.14); color: var(--cyan); border: 1px solid rgba(42,168,255,.32); }
.qsl-acts { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.qsl-btn {
  flex: 0 0 auto; padding: 7px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  border: 1px solid var(--line); border-radius: 9px; color: var(--text);
  background: linear-gradient(180deg, #2a3a4a, #16202a);
}
.qsl-btn:hover { color: #fff; border-color: var(--blue-dim); box-shadow: 0 0 10px rgba(42,168,255,.22); }
.qsl-empty { color: var(--dim); text-align: center; padding: 26px 10px; font-size: 14px; }

/* Tarjeta (componer/ver) */
.qslc-modal { max-width: 620px; width: 96vw; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.qslc-pickbtn {
  flex: 1 1 100%; min-height: 46px; margin-top: 2px; padding: 10px 12px; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 800; letter-spacing: .2px; color: var(--cyan);
  border: 1px dashed rgba(42,168,255,.55); border-radius: 10px;
  background: linear-gradient(180deg, #16242f, #0e1a24);
}
.qslc-pickbtn:hover { color: #fff; border-style: solid; }
.qslc-preview { width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; box-shadow: 0 6px 22px rgba(0,0,0,.5); }
.qslc-preview canvas { display: block; width: 100%; height: auto; }
.qslc-form { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.qslc-lbl { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--dim); font-weight: 600; }
.qslc-lbl input {
  height: 38px; padding: 0 10px; font-size: 15px; color: var(--text); font-family: inherit;
  background: #0d0f12; border: 1px solid var(--line); border-radius: 9px;
}
.qslc-lbl input:focus { outline: none; border-color: var(--blue-dim); }
.qslc-row { display: flex; gap: 8px; }
.qslc-row .qslc-lbl { flex: 1; }
.qslc-bglabel { font-size: 12px; color: var(--dim); font-weight: 600; margin-top: 2px; }
.qslc-bgs { display: flex; flex-wrap: wrap; gap: 7px; max-height: 168px; overflow-y: auto; padding: 2px 2px 4px; }
.qslc-bg {
  flex: 0 0 auto; width: 72px; height: 46px; border-radius: 8px; cursor: pointer;
  background-size: cover; background-position: center; border: 2px solid transparent; opacity: .72;
  transition: opacity .12s, border-color .12s;
}
.qslc-bg:hover { opacity: 1; }
.qslc-bg.sel { border-color: var(--blue); opacity: 1; box-shadow: 0 0 0 1px rgba(42,168,255,.4); }
.qslc-up {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 20px; font-weight: 800; color: var(--cyan); opacity: 1;
  background: linear-gradient(180deg, #1c3446, #0e1a24); border-color: rgba(42,168,255,.45);
}
.qslc-up span { font-size: 9px; font-weight: 700; letter-spacing: .2px; }
/* Modo "solo ver": oculta el formulario y el botón enviar */
.qslc-modal.view .qslc-form, .qslc-modal.view #qslcSend { display: none; }

/* ============================ Usuarios muteados (moderadores) ============================ */
.mutes-modal { max-width: 480px; width: 96vw; }
.mutes-list { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.mute-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: linear-gradient(180deg, var(--panel2), var(--panel)); }
.mute-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mute-call { font-size: 16px; font-weight: 800; color: #ffcf6b; letter-spacing: .4px; }
.mute-meta { margin-top: 5px; font-size: 12px; color: var(--dim); }
.mute-meta b { color: var(--cyan); font-weight: 700; }
.mute-reason { margin-top: 3px; font-size: 13px; color: var(--text); }
.mute-noreason { color: var(--dim); }
.mini.green { border-color: rgba(64,200,120,.4); color: #eafff2; background: linear-gradient(180deg, #1f8a4c, #14603a); font-weight: 700; }
.mini.green:hover { filter: brightness(1.12); }

/* ============================ Menú desplegable de la cabecera (☰) ============================ */
.top-menu-back { position: fixed; inset: 0; z-index: 55; background: transparent; }
.top-menu { position: fixed; z-index: 56; top: 54px; right: 10px; min-width: 216px;
  background: linear-gradient(180deg, #24282d, #14171b); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; box-shadow: 0 16px 44px rgba(0,0,0,.65); display: flex; flex-direction: column; gap: 2px; }
.top-menu[hidden], .top-menu-back[hidden] { display: none; }
.tm-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 12px; border: none; border-radius: 9px;
  background: transparent; color: var(--text); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; }
.tm-item:active, .tm-item:hover { background: rgba(255,255,255,.07); }
.tm-item[hidden] { display: none; }
.tm-ico { font-size: 18px; width: 22px; text-align: center; flex: none; }
.tm-txt { flex: 1; }
.tm-item .inbox-badge { position: static; margin-left: auto; }
/* Puntito rojo del botón ☰ cuando hay algo en el menú (mensajes / muteados) */
.inbox-badge.menu-dot { min-width: 10px; width: 10px; height: 10px; padding: 0; border-radius: 50%; font-size: 0; }
