
:root{
 --bg:#06111f; --bg2:#0a1627; --card:#10233d; --card2:#0b192d; --line:#1a3b5d;
 --text:#edf6ff; --muted:#9eb6cc; --accent:#55b2ff; --green:#2de57f; --shadow:#0006;
}
:root.light{
 --bg:#eef5fb; --bg2:#f8fbff; --card:#ffffff; --card2:#f2f7fb; --line:#bfd0df;
 --text:#102234; --muted:#536b80; --accent:#0878c9; --green:#0bbf65; --shadow:#18314918;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:linear-gradient(180deg,var(--bg),#030912);color:var(--text);font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;min-height:100vh}
:root.light body{background:linear-gradient(180deg,#e8f1f8,#f7fbfe)}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:20px max(22px,4vw);border-bottom:1px solid var(--line);background:rgba(4,12,23,.65)}
:root.light .topbar{background:#f8fbff}
.brand-wrap{display:flex;align-items:center;gap:14px}.brand-mark{font-size:40px}.brand{font-size:clamp(24px,3vw,38px);font-weight:850;letter-spacing:.2px}.subtitle{margin-top:5px;color:#9dccf4}
.header-right{display:flex;align-items:center;gap:26px}.status-pill{display:flex;gap:9px;align-items:flex-start;background:#063d31;border:1px solid #08745a;padding:10px 16px;border-radius:11px}.status-dot{width:16px;height:16px;background:var(--green);border-radius:50%;margin-top:3px;box-shadow:0 0 15px #27ef8d99}.status-pill small,.yo3che-mark small{display:block;color:#b7d8cf;margin-top:2px}.yo3che-mark{display:flex;align-items:center;gap:10px}.yo3che-mark .flag{font-size:34px}.yo3che-mark strong{font-size:24px;font-style:italic}
.nav{position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;gap:12px;align-items:center;padding:8px max(22px,4vw);border-bottom:1px solid var(--line);background:#071426ef;backdrop-filter:blur(10px)}
:root.light .nav{background:#f6fbffef}
.nav-links{display:flex;gap:4px;overflow:auto}.nav a{color:var(--text);text-decoration:none;padding:10px 13px;border-radius:8px;white-space:nowrap}.nav a:hover,.nav a:first-child{background:#123b68}
:root.light .nav a:hover,:root.light .nav a:first-child{background:#d8ebfa}
.nav-actions{display:flex;align-items:center;gap:8px}.icon-button,.lang-switch button{border:1px solid var(--line);background:var(--card2);color:var(--text);padding:9px 11px;cursor:pointer}.icon-button{border-radius:9px}.lang-switch{display:flex;border-radius:9px;overflow:hidden}.lang-switch button{border-radius:0}.lang-switch button.active{background:#173f66}
main{max-width:1540px;margin:auto;padding:20px}.demo-note{display:flex;align-items:center;gap:8px;background:#3b2d08;border:1px solid #7d6115;color:#ffe8a0;padding:9px 12px;border-radius:9px;margin-bottom:14px;font-size:13px}
:root.light .demo-note{background:#fff7d8;color:#715400;border-color:#e1c95f}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.stat-card{display:flex;align-items:center;gap:18px;background:linear-gradient(145deg,var(--card),var(--card2));border:1px solid var(--line);border-radius:11px;padding:18px 20px;box-shadow:0 10px 28px var(--shadow)}.stat-icon{font-size:42px}.stat-card strong{font-size:30px;display:block}.stat-card span,.stat-card small{display:block}.stat-card span{font-size:16px}.stat-card small{color:var(--muted);margin-top:2px}
.module-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin:18px 0}.module{min-height:287px;padding:16px;border:2px solid;border-radius:10px;text-align:center;box-shadow:0 12px 30px var(--shadow)}.module-top{display:flex;justify-content:space-between;align-items:center}.letter{font-size:34px;font-weight:900}.active-dot{font-size:14px;color:#dceaf5}.active-dot::first-letter{color:var(--green)}.module-icon{font-size:45px;margin:26px 0 8px}.flags{letter-spacing:5px}.module h2{margin:7px 0 12px;font-size:22px}.module p{line-height:1.45;min-height:64px}.module-meta{display:flex;justify-content:space-around;margin-top:24px;color:#eaf4fd}.a{background:linear-gradient(145deg,#0d4e91,#10233d);border-color:#168eff}.b{background:linear-gradient(145deg,#147344,#103223);border-color:#2be57d}.c{background:linear-gradient(145deg,#98501f,#442311);border-color:#ff941f}.d{background:linear-gradient(145deg,#6639a4,#28183f);border-color:#a85bff}.e{background:linear-gradient(145deg,#405267,#192432);border-color:#91a0ae}
.two-col{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}.lower{grid-template-columns:1fr 1fr}.panel{background:linear-gradient(145deg,var(--card),var(--card2));border:1px solid var(--line);border-radius:10px;padding:16px;box-shadow:0 10px 28px var(--shadow);margin-bottom:16px}.panel h2{color:var(--accent);margin:0 0 12px;font-size:20px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:530px}th,td{text-align:left;padding:10px 8px;border-bottom:1px solid var(--line);font-size:14px}th{color:#c5dbef;font-weight:650}.badge{display:inline-block;min-width:28px;text-align:center;padding:4px 7px;border-radius:5px;font-weight:800;color:white}.ba{background:#1988e7}.bb{background:#18b75f}.bc{background:#f08a17}.bd{background:#7540db}.be{background:#627386}.live-dot{color:var(--green)}.welcome{position:relative}.welcome p{max-width:80%;line-height:1.55}.signature{position:absolute;right:25px;bottom:18px;font-style:italic;font-size:21px;transform:rotate(-4deg);color:#f1f7ff}.node-chips{display:flex;flex-wrap:wrap;gap:10px}.node-chips span{padding:9px 12px;border-radius:999px;background:#0b3152;border:1px solid #245782}
.system summary{cursor:pointer;color:var(--accent);font-size:20px;font-weight:800}.system summary small{font-size:12px;font-weight:500}.system-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:18px;margin-top:18px}.system-grid div{display:flex;flex-direction:column;gap:4px}.system-grid span{color:var(--muted)}.ok{color:var(--green)!important}
footer{max-width:1540px;margin:auto;border-top:1px solid var(--line);padding:18px 20px 24px;display:grid;grid-template-columns:1fr 1fr 1fr;gap:15px;align-items:end;color:var(--text);font-size:13px}footer small{display:block;color:var(--muted);margin-top:5px}.footer-center{text-align:center}.footer-center em{margin-left:6px}footer>div:last-child{text-align:right}
@media(max-width:1180px){.module-grid{grid-template-columns:repeat(3,1fr)}.system-grid{grid-template-columns:repeat(4,1fr)}.yo3che-mark{display:none}}
@media(max-width:900px){.stats{grid-template-columns:repeat(2,1fr)}.two-col,.lower{grid-template-columns:1fr}.module-grid{grid-template-columns:repeat(2,1fr)}.header-right{gap:12px}.system-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:640px){.topbar{flex-direction:column;align-items:flex-start}.brand{font-size:27px}.subtitle{font-size:13px}.nav{align-items:flex-start;flex-direction:column}.nav-actions{width:100%;justify-content:flex-end}.stats{grid-template-columns:1fr 1fr}.stat-card{padding:13px;gap:10px}.stat-icon{font-size:31px}.stat-card strong{font-size:24px}.module-grid{grid-template-columns:1fr}.module{min-height:245px}.system-grid{grid-template-columns:repeat(2,1fr)}.welcome p{max-width:100%;padding-bottom:58px}footer{grid-template-columns:1fr;text-align:center}footer>div:last-child{text-align:center}}


/* v3: animated online state + active QSO modulation tile */
.status-dot.pulse{
  animation:onlinePulse 1.15s ease-in-out infinite;
}
@keyframes onlinePulse{
  0%,100%{opacity:1;transform:scale(1);box-shadow:0 0 8px #27ef8d99}
  50%{opacity:.25;transform:scale(.72);box-shadow:0 0 2px #27ef8d33}
}

.qso-card{
  min-width:300px;
  background:linear-gradient(145deg,#0d2541,#09192b);
  border:1px solid #24577f;
  border-radius:11px;
  padding:10px 13px 9px;
  box-shadow:0 10px 24px #0005;
}
:root.light .qso-card{background:linear-gradient(145deg,#ffffff,#eef6fc)}
.qso-head,.qso-foot{display:flex;justify-content:space-between;align-items:center;gap:12px}
.qso-head b{font-size:15px;letter-spacing:.3px}
.qso-head small{display:block;color:var(--muted);margin-top:2px;font-size:11px}
.qso-live{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:800;color:#7fffc0}
.qso-live i{width:8px;height:8px;border-radius:50%;background:var(--green);animation:qsoBlink .65s steps(1,end) infinite}
@keyframes qsoBlink{50%{opacity:.18}}
.meter{
  display:flex;
  align-items:flex-end;
  gap:3px;
  height:42px;
  margin:8px 0 6px;
  padding:5px 6px;
  background:#06111c;
  border:1px solid #163955;
  border-radius:7px;
  overflow:hidden;
}
:root.light .meter{background:#e9f2f8}
.meter-bar{
  flex:1;
  min-width:3px;
  height:18%;
  border-radius:2px 2px 1px 1px;
  background:#27dc7a;
  box-shadow:0 0 5px #27dc7a44;
  transition:height .06s linear, background-color .06s linear;
}
.meter-bar.mid{background:#e1cd35;box-shadow:0 0 5px #e1cd3544}
.meter-bar.hot{background:#ff6f45;box-shadow:0 0 6px #ff6f4555}
.qso-foot{font-size:11px;color:var(--muted)}
.qso-foot strong{color:var(--text);font-size:12px}

@media(max-width:1180px){
  .qso-card{min-width:260px}
}
@media(max-width:900px){
  .header-right{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .qso-card{min-width:0}
}
@media(max-width:640px){
  .header-right{grid-template-columns:1fr;width:100%}
  .qso-card{width:100%}
}


/* v4: calmer indicators + speech-like modulation */
.status-dot.pulse{
  animation:onlinePulseSlow 3.2s ease-in-out infinite;
}
@keyframes onlinePulseSlow{
  0%,100%{opacity:1;transform:scale(1);box-shadow:0 0 9px #27ef8d88}
  50%{opacity:.55;transform:scale(.88);box-shadow:0 0 3px #27ef8d33}
}

/* replace fast LIVE blink with a gentle breathing glow */
.qso-live i{
  animation:liveBreath 2.4s ease-in-out infinite;
}
@keyframes liveBreath{
  0%,100%{opacity:1;box-shadow:0 0 7px #2de57f88}
  50%{opacity:.45;box-shadow:0 0 1px #2de57f22}
}

.qso-card{
  min-width:330px;
  padding:12px 14px 10px;
}
.meter{
  height:66px;
  margin:10px 0 7px;
  padding:7px 7px 5px;
  align-items:flex-end;
}
.meter-bar{
  transition:height .16s ease-out, background-color .20s ease-out, opacity .20s ease-out;
  opacity:.95;
}
.qso-card.is-paused .qso-live{
  color:var(--muted);
}
.qso-card.is-paused .qso-live i{
  animation:none;
  opacity:.25;
  box-shadow:none;
}
.qso-card.is-paused .meter-bar{
  opacity:.35;
}

@media(max-width:1180px){
  .qso-card{min-width:280px}
}


/* v5 – mobile-first refinements requested after phone test */
@media(max-width:640px){

  /* Header order: identity -> ONLINE -> navigation -> QSO */
  .topbar{
    padding:14px 13px 8px;
    gap:12px;
  }
  .brand-wrap{order:1}
  .header-right{
    order:2;
    display:contents;
  }
  .status-pill{
    order:2;
    margin:0 13px 9px;
  }

  /* Navigation is fully visible; no horizontal page/menu scrolling */
  .nav{
    order:3;
    position:relative;
    padding:9px 10px 10px;
    gap:9px;
    overflow:visible;
  }
  .nav-links{
    width:100%;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
    overflow:visible;
  }
  .nav a{
    min-width:0;
    padding:8px 4px;
    font-size:11px;
    text-align:center;
    white-space:normal;
    line-height:1.2;
  }
  .nav-actions{
    width:100%;
    display:grid;
    grid-template-columns:46px 1fr;
    gap:8px;
  }
  .icon-button{
    min-height:44px;
    font-size:19px;
  }
  .lang-switch{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
  }
  .lang-switch button{
    min-height:44px;
    font-size:16px;
    font-weight:800;
    padding:9px 12px;
  }

  /* QSO comes after the complete navigation/language area */
  .qso-card{
    order:4;
    width:auto;
    min-width:0;
    margin:0 13px 12px;
  }

  /* Keep top status and QSO visually outside desktop-only branding */
  .yo3che-mark{display:none}

  main{padding:11px}

  /* Summary cards remain compact */
  .stats{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .stat-card{
    min-height:91px;
    padding:10px;
    gap:8px;
  }
  .stat-icon{font-size:26px}
  .stat-card strong{font-size:22px}
  .stat-card span{font-size:12px}
  .stat-card small{font-size:10px}

  /* Modules: two compact tiles per row */
  .module-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin:11px 0;
  }
  .module{
    min-height:0;
    padding:10px 9px 9px;
    border-width:1px;
  }
  .module-top{align-items:flex-start}
  .letter{font-size:25px}
  .active-dot{font-size:10px}
  .module-icon{
    font-size:29px;
    margin:9px 0 4px;
    min-height:34px;
  }
  .module-icon.flags{
    font-size:22px;
    letter-spacing:0;
    white-space:nowrap;
  }
  .module h2{
    font-size:14px;
    margin:3px 0 6px;
    line-height:1.15;
  }
  .module p{
    min-height:0;
    margin:0;
    font-size:10.5px;
    line-height:1.3;
  }
  .module-meta{
    margin-top:9px;
    font-size:11px;
  }

  /* Fifth module sits naturally on the next row, half width */
  .module.e{grid-column:auto}

  .demo-note{font-size:11px}
}

/* Very narrow phones still get two module tiles, but with tighter text */
@media(max-width:380px){
  .module{padding:8px 6px}
  .module h2{font-size:12.5px}
  .module p{font-size:9.5px}
  .nav a{font-size:10px}
}


/* v6 – stronger mobile readability + compact status/QSO row */
@media(max-width:640px){

  /* ONLINE + QSO side by side, much more compact */
  .header-right{
    display:grid;
    grid-template-columns:0.78fr 1.22fr;
    gap:8px;
    width:100%;
    padding:0 10px 8px;
  }

  .status-pill{
    order:1;
    margin:0;
    min-width:0;
    padding:9px 10px;
    border-radius:9px;
  }
  .status-dot{
    width:12px;
    height:12px;
    flex:0 0 auto;
  }
  .status-pill b{
    font-size:13px;
    font-weight:900;
  }
  .status-pill small{
    font-size:10.5px;
    line-height:1.15;
  }

  .qso-card{
    order:2;
    width:100%;
    min-width:0;
    margin:0;
    padding:8px 9px 7px;
    border-radius:9px;
  }
  .qso-head b{
    font-size:13px;
    font-weight:900;
  }
  .qso-head small{
    font-size:9.5px;
    line-height:1.1;
  }
  .qso-live{
    font-size:9.5px;
  }
  .meter{
    height:40px;
    margin:6px 0 4px;
    padding:4px 5px 3px;
    gap:2px;
  }
  .qso-foot{
    font-size:9.5px;
  }
  .qso-foot strong{
    font-size:10.5px;
  }

  /* Navigation bigger and bolder */
  .nav a{
    font-size:13px;
    font-weight:800;
    padding:10px 5px;
    line-height:1.15;
  }
  .icon-button{
    font-weight:900;
  }
  .lang-switch button{
    font-size:17px;
    font-weight:900;
  }

  /* Summary/stat cards larger typography */
  .stat-card strong{
    font-size:24px;
    font-weight:900;
  }
  .stat-card span{
    font-size:13px;
    font-weight:800;
  }
  .stat-card small{
    font-size:11.5px;
    font-weight:700;
  }

  /* Module cards stay compact, text becomes much more readable */
  .module h2{
    font-size:15.5px;
    font-weight:900;
    margin-bottom:7px;
  }
  .module p{
    font-size:14.5px;
    font-weight:800;
    line-height:1.28;
    color:#f4f8fb;
  }
  :root.light .module p{
    color:#17283a;
  }
  .module-meta{
    font-size:12.5px;
    font-weight:800;
  }
  .active-dot{
    font-size:11.5px;
    font-weight:800;
  }

  /* Other panel text on mobile */
  .panel h2{
    font-size:18px;
    font-weight:900;
  }
  th,td{
    font-size:13px;
    font-weight:650;
  }
  .welcome p,
  .node-chips span,
  .system-grid div{
    font-size:13px;
    font-weight:700;
  }
}

/* keep text readable even on narrow phones */
@media(max-width:380px){
  .nav a{font-size:12px}
  .module h2{font-size:14.5px}
  .module p{font-size:13.5px}
  .header-right{grid-template-columns:0.8fr 1.2fr}
}


/* v7 – equal status/QSO tiles + stop horizontal "swimming" on mobile */
html, body{
  max-width:100%;
  overflow-x:hidden;
}

@media(max-width:640px){

  /* ONLINE and QSO same width */
  .header-right{
    grid-template-columns:1fr 1fr;
    align-items:stretch;
  }

  .status-pill,
  .qso-card{
    width:100%;
    min-width:0;
    height:100%;
  }

  .status-pill{
    display:flex;
    align-items:center;
  }

  /* Prevent any child from forcing horizontal page movement */
  body,
  .topbar,
  .nav,
  main,
  footer,
  .header-right,
  .stats,
  .module-grid,
  .two-col,
  .panel,
  .table-wrap{
    max-width:100%;
    min-width:0;
  }

  .topbar,
  .nav,
  main,
  footer{
    overflow-x:hidden;
  }

  /* Tables may scroll inside their own card, but the page itself must not */
  .table-wrap{
    overflow-x:auto;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }

  /* Avoid accidental sideways drag/bounce from wide elements */
  .nav-links{
    max-width:100%;
    overflow:hidden;
  }

  .module,
  .stat-card,
  .qso-card,
  .status-pill,
  .panel{
    overflow:hidden;
  }
}
