/* Mobile layout is intentionally isolated from the desktop dashboard. */
@media (max-width: 760px) {
  body { font-size: 13px; }
  .app-shell { display: block; min-height: 100vh; }

  .rail {
    position: fixed;
    z-index: 50;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 62px;
    min-height: 62px;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 7px 10px;
    overflow: visible;
    border-top: 1px solid rgba(255,255,255,.14);
    background: rgba(0,47,44,.97);
    box-shadow: 0 -8px 28px rgba(0,47,44,.18);
    backdrop-filter: blur(12px);
  }
  .rail::before, .rail::after, .rail-brand { display: none; }
  .rail nav {
    display: grid;
    grid-template-columns: repeat(4,minmax(52px,1fr));
    gap: 5px;
    overflow: visible;
  }
  .rail nav a { display: none !important; }
  .rail nav a:nth-child(1),
  .rail nav a:nth-child(2),
  .rail nav a:nth-child(3),
  .rail nav a:nth-child(4) {
    min-height: 48px;
    display: flex !important;
    justify-content: center;
    gap: 4px;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 11px;
  }
  .rail nav a.active { background: rgba(0,185,154,.24); }
  .nav-icon { width: auto; font-size: 17px; }
  .nav-icon svg { width: 17px; height: 17px; }
  .rail form {
    align-self: center;
    margin: 0 0 0 5px;
    padding: 0;
    border: 0;
  }
  .quiet { width: 44px; height: 44px; padding: 0; text-align: center; font-size: 0; }
  .quiet::before { margin: 0; font-size: 19px; }

  .content { padding: 24px 13px 88px; }
  .page-head { min-height: 0; display: block; margin-bottom: 22px; }
  .eyebrow { margin-bottom: 8px; font-size: 9px; letter-spacing: .17em; }
  h1 { margin-bottom: 13px; font-size: 27px; }
  h2 { font-size: 22px; }
  .updated { font-size: 11px; }
  .updated > span { width: 7px; height: 7px; }
  .refresh-button { width: 100%; min-width: 0; margin: 17px 0 0; padding: 10px 13px; font-size: 12px; }
  .refresh-button img { width: 18px; height: 18px; }

  .summary-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    margin: 18px 0 27px;
    padding-bottom: 27px;
  }
  .metric {
    min-height: 128px;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    padding: 13px 11px;
    border-radius: 11px;
  }
  .metric-icon { width: 32px; height: 32px; border-radius: 8px; }
  .metric-icon svg { width: 18px; height: 18px; }
  .metric-body > span { min-height: 34px; font-size: 10px; line-height: 1.35; }
  .metric-body strong { margin-top: 2px; font-size: 27px; }
  .metric-body small { margin-top: 6px; font-size: 9px; line-height: 1.35; }

  .section-head { display: block; margin-bottom: 17px; }
  .section-copy { font-size: 11px; line-height: 1.45; }
  .info-note { max-width: none; margin-top: 13px; padding: 11px 12px; gap: 10px; font-size: 10px; }
  .info-note b { width: 22px; height: 22px; font-size: 11px; }
  .add-account-button { width: 100%; justify-content: center; margin-top: 15px; padding: 10px 14px; font-size: 12px; }

  .accounts-grid { grid-template-columns: 1fr; gap: 10px; }
  .account-card { padding: 14px; border-radius: 11px; }
  .account-identity { gap: 9px; }
  .account-identity img { width: 38px; height: 38px; }
  .account-identity strong { font-size: 15px; }
  .account-identity small { font-size: 12px; }
  .account-actions { gap: 3px; }
  .pill { gap: 5px; padding: 5px 7px; font-size: 8px; }
  .pill i { width: 5px; height: 5px; }
  .kebab { padding: 2px; font-size: 12px; }
  .capacity { margin: 21px 0 13px; }
  .capacity > div:first-child > span { font-size: 11px; }
  .capacity b { font-size: 19px; }
  .capacity b small { font-size: 11px; }
  .bar { height: 7px; }
  .capacity-meta { font-size: 9px; }
  .message-stats { margin-top: 12px; padding-top: 12px; }
  .message-stats > div { grid-template-columns: 21px 1fr; column-gap: 5px; padding-right: 7px; }
  .message-stats > div + div { padding-left: 9px; }
  .message-stats svg { width: 15px; height: 15px; }
  .message-stats small { font-size: 9px; }
  .message-stats b { font-size: 19px; }
  .message-stats b em, .message-stats > div > i { font-size: 8px; }
  .flood-mini { margin-top: 9px; font-size: 8px; }
  .flood-mini b { font-size: 11px; }

  .settings-list { gap: 8px; }
  .settings-row {
    grid-template-columns: 37px minmax(0,1fr) auto 24px;
    gap: 8px;
    padding: 11px;
    border-radius: 10px;
  }
  .settings-row > img { width: 35px; height: 35px; }
  .settings-row strong { font-size: 13px; }
  .settings-row small { font-size: 11px; }
  .settings-status { gap: 4px; padding: 5px 6px; font-size: 8px !important; }

  .test-message-panel { grid-template-columns: 1fr; gap: 18px; margin-top: 20px; padding: 16px; }
  .test-message-panel h2 { font-size: 21px; }
  .test-message-panel form { grid-template-columns: 1fr; }
  .test-message-text { grid-column: auto; }
  .test-message-panel input,
  .test-message-panel select,
  .test-message-panel textarea { padding: 10px; font-size: 13px; }

  .account-dialog { padding: 23px 17px 18px; }
  .account-dialog h3 { font-size: 22px; }
  .dialog-actions { grid-template-columns: 1fr; }
  .add-account-dialog form { grid-template-columns: 1fr; }
  .add-account-dialog label:nth-of-type(4),
  .add-account-dialog label:nth-of-type(5) { grid-column: auto; }
  .settings-panel { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
  .settings-panel form { grid-template-columns: 1fr; }
  .settings-panel label:first-child,
  .settings-flags,
  .settings-panel form > button,
  .settings-panel .form-result { grid-column: auto; }
  .error-toolbar{gap:5px;margin-top:8px;padding-bottom:15px}.error-toolbar button{padding:7px 9px;font-size:9px}.error-entry{padding:13px;border-left-width:3px}.error-entry-main{grid-template-columns:1fr;gap:13px}.error-entry dl{grid-template-columns:1fr 1fr}.error-entry-head time{font-size:8px}
}

@media (max-width: 370px) {
  .summary-grid { grid-template-columns: 1fr; }
  .metric { min-height: 108px; }
  .settings-row { grid-template-columns: 34px 1fr 22px; }
  .settings-status { grid-column: 2; justify-self: start; }
}
