@media (max-width: 580px) {
  body { background: radial-gradient(circle at 50% -8%, rgba(135,245,66,.1), transparent 24%), var(--bg); }
  .page-shell { width: min(100% - 24px, 1180px); padding: 26px 0 48px; }
  .topbar { height: 64px; padding: 0 14px; }
  .top-actions { gap: 5px; }
  .top-actions form { margin-left: 2px; }
  .link-button { margin-left: 4px; padding: 10px 6px; }
  .brand > span:last-child { display: none; }
  .hero { gap: 22px; margin-bottom: 24px; }
  .hero h1 { font-size: 38px; line-height: 1.02; }
  .hero .muted { font-size: 13px; line-height: 1.7; }
  .hero .button { width: 100%; min-height: 50px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 16px; border-radius: 16px; }
  .metric-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .metric-head strong { font-size: 24px; }
  .meter, .pulse-line { margin: 17px 0 10px; }
  .metric-card small { font-size: 11px; line-height: 1.4; }
  .panel { background: none; border: 0; box-shadow: none; overflow: visible; }
  .panel-heading { padding: 18px 2px; border: 0; }
  .panel-heading h2 { font-size: 26px; }
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tbody tr { padding: 6px 15px 14px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(25,30,37,.96), rgba(17,21,26,.96)); box-shadow: 0 14px 34px rgba(0,0,0,.22); }
  tbody tr:hover { background: linear-gradient(145deg, rgba(25,30,37,.96), rgba(17,21,26,.96)); }
  td { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 11px 0; border-bottom: 1px solid rgba(40,48,58,.72); font-size: 13px; }
  td::before { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  td:nth-child(1) { padding: 12px 0 14px; }
  td:nth-child(1)::before, td.actions::before { display: none; }
  td:nth-child(2)::before { content: "Адрес"; }
  td:nth-child(3)::before { content: "Последняя связь"; }
  td:nth-child(4)::before { content: "Трафик"; }
  .peer-name { width: 100%; }
  .peer-name > div { min-width: 0; }
  .peer-name small { max-width: 250px; }
  .avatar { width: 42px; height: 42px; border-radius: 13px; }
  .actions { justify-content: stretch; padding-top: 14px; border: 0; }
  .actions .icon-button, .actions form { flex: 1; }
  .actions form .icon-button { width: 100%; }
  .icon-button { height: 44px; border-radius: 11px; }
  .empty { display: block; padding: 38px 15px; text-align: center; }
  .empty::before { display: none; }
  .modal { max-height: calc(100dvh - 24px); overflow: auto; padding: 21px; }
  .modal input { min-height: 50px; }
  .modal-actions .button { min-height: 46px; }
  .qr-box { padding: 10px; }
  .login-page { padding: 14px; }
  .login-card { padding: 25px 22px; border-radius: 20px; }
  .login-card .brand-mark { margin: 0 auto 24px; }
  .login-card h1, .login-card > .eyebrow, .login-card > .muted { text-align: center; }
  .stack input, .stack .button { min-height: 50px; }
}

@media (max-width: 370px) {
  .metrics { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
}
