.mobile-categories,
.panel-heading,
.gesture-hint,
.mobile-composer-hint,
.mobile-server-name {
  display: none;
}
.shell {
  height: var(--app-height, 100dvh);
}
.channel-search input {
  width: 100%;
  font-size: 0.86rem;
}
.sidebar .workspace-select {
  margin-bottom: 12px;
  min-width: 0;
}
.workspace-select select {
  min-width: 0;
  width: 100%;
}
.sidebar-shortcuts {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.sidebar-footer {
  padding-top: 12px;
}
.channel > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 800px) {
  .shell {
    grid-template-rows: calc(60px + env(safe-area-inset-top)) 48px minmax(
        0,
        1fr
      );
  }
  .shell > .topbar {
    grid-row: 1;
    padding: env(safe-area-inset-top) 12px 0;
  }
  .brand > span {
    display: block;
    font-size: 1rem;
  }
  .mobile-server-name {
    display: block;
    max-width: 32vw;
    font-weight: 400;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .shell .top-select,
  .shell .top-nav {
    display: none;
  }
  .topbar .brand {
    margin-right: auto;
  }
  .top-actions {
    margin-left: 0;
  }
  .top-actions > .mobile-menu {
    display: flex;
  }
  .top-actions .icon-btn,
  .search-button {
    min-height: 44px;
    min-width: 40px;
  }
  .mobile-categories {
    display: flex;
    grid-row: 2;
    gap: 4px;
    padding: 0 10px 7px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }
  .mobile-categories button {
    flex: 1;
    min-width: 0;
    padding: 9px 4px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--muted);
  }
  .mobile-categories button span {
    margin-right: 5px;
  }
  .mobile-categories button.active {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
  }
  .content {
    grid-row: 3;
    min-height: 0;
  }
  .sidebar {
    top: 0;
    left: auto;
    right: 0;
    bottom: 0;
    width: min(330px, 88vw);
    transform: translateX(105%);
    z-index: 50;
    padding: max(22px, env(safe-area-inset-top)) 18px
      max(14px, env(safe-area-inset-bottom));
    border-right: 0;
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 60px #0005;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: #03071480;
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.25s,
      visibility 0.25s;
  }
  .sidebar-overlay.visible {
    inset: 0;
    z-index: 45;
    opacity: 1;
    visibility: visible;
  }
  .panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }
  .panel-heading h2 {
    margin: 4px 0 0;
    font-size: 1.5rem;
  }
  .panel-heading button {
    width: 44px;
    height: 44px;
    font-size: 1.7rem;
  }
  .channel {
    min-height: 46px;
  }
  .gesture-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 0;
  }
  .channel-header {
    padding: 12px 16px;
    min-height: 70px;
  }
  .channel-header small {
    max-width: 49vw;
  }
  .messages {
    padding: 12px 14px 0;
  }
  .message {
    padding-block: 10px;
  }
  .msg-meta {
    gap: 5px;
  }
  .msg-meta strong {
    font-size: 0.9rem;
  }
  .msg-body {
    font-size: 1rem;
    line-height: 1.5;
  }
  .msg-actions .icon-btn {
    min-width: 36px;
    min-height: 34px;
  }
  .msg-actions [data-action="react"],
  .msg-actions [data-action="save"] {
    display: none;
  }
  .message .msg-actions {
    margin-top: -5px;
    opacity: 0.8;
  }
  .desktop-composer-hint {
    display: none;
  }
  .mobile-composer-hint {
    display: inline;
  }
  .composer-wrap {
    padding: 8px 12px max(10px, env(safe-area-inset-bottom));
  }
  .composer textarea {
    font-size: 16px;
    min-height: 45px;
  }
  .composer-bottom .btn {
    min-height: 40px;
  }
  input:not([type="color"]):not([type="range"]):not([type="checkbox"]),
  textarea {
    font-size: max(16px, 1rem);
  }
  .page-title h1 {
    font-size: 1.6rem;
  }
  .settings-body {
    max-height: min(62dvh, calc(var(--app-height) - 180px));
  }
}
