@media (max-width: 1280px) {
  :root { --rh-sidebar-width: 248px; }
  .rh-content { padding-inline: 22px; }
  .rh-command-trigger { min-width: 170px; }
  .rh-command-trigger span { display: none; }
  .rh-command-trigger { min-width: 74px; }
  .rh-dashboard-grid { grid-template-columns: minmax(0,1.1fr) minmax(320px,.9fr); }
}

@media (max-width: 1040px) {
  .rh-app-shell { display: block; }
  .rh-app-main { grid-column: auto; }
  .rh-sidebar { transform: translateX(-102%); box-shadow: 26px 0 90px rgba(0,0,0,.55); transition: transform .2s ease; }
  .rh-sidebar.is-open { transform: translateX(0); }
  .rh-sidebar__close, .rh-mobile-menu { display: grid; }
  .rh-sidebar-backdrop { display: block; position: fixed; z-index: 29; inset: 0; border: 0; background: rgba(3,4,7,.7); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .rh-sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .rh-topbar { padding-inline: 18px; }
  .rh-content { padding: 26px 18px 56px; }
  .rh-dashboard-grid { grid-template-columns: 1fr; }
  .rh-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .rh-topbar { min-height: 60px; padding-inline: 12px; }
  .rh-breadcrumb span, .rh-breadcrumb b, .rh-command-trigger, .rh-topbar__right > .rh-status, .rh-profile-copy { display: none; }
  .rh-profile-button { min-width: 36px; width: 36px; padding: 4px; grid-template-columns: 28px; }
  .rh-profile-button > svg { display: none; }
  .rh-content { padding: 22px 12px 46px; }
  .rh-page { gap: 14px; }
  .rh-page-header { align-items: stretch; flex-direction: column; gap: 14px; }
  .rh-page-header__actions { justify-content: flex-start; }
  .rh-page-header__actions .rh-button { width: 100%; }
  .rh-page-header h1 { font-size: 28px; }
  .rh-metric-grid, .rh-system-grid { grid-template-columns: 1fr 1fr; }
  .rh-event-row { grid-template-columns: 40px 48px minmax(0,1fr); }
  .rh-event-row > .rh-status { display: none; }
  .rh-quick-grid, .rh-action-picker { grid-template-columns: 1fr; }
  .rh-toolbar { align-items: stretch; flex-direction: column; }
  .rh-toolbar__left { width: 100%; }
  .rh-search-inline { flex: 1; width: auto; }
  .rh-form-grid { grid-template-columns: 1fr; }
  .rh-field--full { grid-column: auto; }
  .rh-dialog-layer { padding: 10px; align-items: end; }
  .rh-dialog, .rh-dialog--compact { width: 100%; max-height: calc(100dvh - 20px); border-radius: 16px; }
  .rh-dialog__header, .rh-dialog__body, .rh-dialog__footer { padding-inline: 15px; }
  .rh-dialog__footer { flex-wrap: wrap; }
  .rh-dialog__footer .rh-button { flex: 1 1 140px; }
}

@media (max-width: 520px) {
  .rh-topbar__right { gap: 5px; }
  .rh-topbar__right .rh-icon-button:nth-of-type(2) { display: none; }
  .rh-content { padding-inline: 9px; }
  .rh-metric-grid, .rh-system-grid { grid-template-columns: 1fr; }
  .rh-metric-card, .rh-panel, .rh-settings-list { border-radius: 13px; }
  .rh-preview-notice { align-items: flex-start; }
  .rh-event-row { grid-template-columns: 38px minmax(0,1fr); gap: 8px; }
  .rh-event-type { display: none; }
  .rh-activity-row { grid-template-columns: 29px minmax(0,1fr); }
  .rh-activity-row time { display: none; }
  .rh-health-row { align-items: flex-start; flex-direction: column; gap: 7px; }
  .rh-health-row > div { width: 100%; justify-content: space-between; }
  .rh-settings-row { grid-template-columns: 34px minmax(0,1fr); }
  .rh-settings-row > div:last-child { grid-column: 2; justify-content: flex-start; }
  .rh-toolbar__left { align-items: stretch; flex-direction: column; }
  .rh-filter-button { justify-content: space-between; }
}

@media (max-width: 760px) {
  .rh-auth-card { grid-template-columns: 48px minmax(0,1fr); gap: 14px; padding: 18px; }
  .rh-auth-card__mark { width: 48px; height: 48px; border-radius: 14px; }
  .rh-auth-card__actions { grid-column: 1 / -1; }
  .rh-auth-card__actions .rh-button { width: 100%; }
  .rh-auth-security { grid-template-columns: 1fr; }
}
