.phone-brand, .phone-search-toggle, .phone-create, .phone-world, .phone-footer { display: none; }

@media (max-width: 700px), (max-width: 950px) and (max-height: 500px) {
  :root {
    --phone-gutter: clamp(14px, 4vw, 22px);
    --phone-nav-height: calc(60px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: var(--phone-nav-height);
    scroll-padding-top: calc(60px + env(safe-area-inset-top, 0px));
  }
  .app-shell { display: block; min-height: 100dvh; }
  .workspace { min-width: 0; padding-bottom: var(--phone-nav-height); }
  .topbar {
    position: sticky; top: 0; z-index: 12; display: flex; flex-wrap: wrap;
    gap: 2px; min-height: calc(58px + env(safe-area-inset-top, 0px)); height: auto;
    padding: calc(5px + env(safe-area-inset-top, 0px)) max(var(--phone-gutter), env(safe-area-inset-right, 0px)) 5px max(var(--phone-gutter), env(safe-area-inset-left, 0px));
    background: #101116f7; border-bottom: 1px solid var(--border);
  }
  .topbar .breadcrumb, .topbar .top-avatar, .topbar .search-box { display: none; }
  .topbar .phone-brand { display: inline-flex; min-height: 44px; margin-right: auto; font-size: clamp(20px, 5.2vw, 24px); }
  .phone-brand .brand-symbol { font-size: 30px; margin-right: 5px; }
  .topbar .phone-search-toggle, .topbar .notification-button { display: inline-flex; width: 44px; height: 44px; color: var(--text); }
  .topbar .phone-search-toggle[aria-expanded="true"] { color: var(--pink); background: #28212a; }
  .topbar .phone-search-toggle svg, .topbar .notification-button svg { width: 20px; height: 20px; }
  .phone-create { display: inline-flex; margin-left: 4px; min-height: 44px; padding: 8px 13px; gap: 4px; font-size: 14px; }
  .phone-create svg { width: 17px; height: 17px; }
  .topbar.search-open .search-box { display: flex; order: 5; flex: 1 0 100%; max-width: none; height: 44px; margin: 4px 0 3px; }
  .search-box input { font-size: 16px; }
  .search-box kbd { display: none; }

  .sidebar {
    position: fixed; inset: auto 0 0; z-index: 20; height: auto; padding: 0;
    background: #15161ef7; border: 0; border-top: 1px solid var(--border);
  }
  .sidebar > :not(.main-nav), .rightbar { display: none; }
  .sidebar .main-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
    padding: 2px max(3px, env(safe-area-inset-right, 0px)) calc(2px + env(safe-area-inset-bottom, 0px)) max(3px, env(safe-area-inset-left, 0px));
  }
  .main-nav .nav-item {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    min-width: 0; min-height: 54px; max-width: none; padding: 3px 1px; gap: 1px;
    font-size: 11px; line-height: 1.3; font-weight: 600; white-space: nowrap; border-radius: 0; color: #b6b5c2;
  }
  .main-nav .nav-item > [data-icon] { display: grid; place-items: center; width: 39px; height: 26px; border-radius: 8px; }
  .main-nav .nav-item svg { width: 19px; height: 19px; }
  .main-nav .nav-item.active { background: transparent; color: var(--pink); }
  .main-nav .nav-item.active > [data-icon] { background: #332632; }
  .main-nav .nav-dot { display: none; }
  .content-layout { display: block; max-width: 640px; padding: 18px max(var(--phone-gutter), env(safe-area-inset-right, 0px)) 24px max(var(--phone-gutter), env(safe-area-inset-left, 0px)); }
  .view-heading { display: block; margin-bottom: 16px; }
  .view-heading > .eyebrow, .feed-caption { display: none; }
  .view-heading h1 { font-size: clamp(26px, 6.7vw, 33px); line-height: 1.13; }
  .view-heading p { margin-top: 5px; font-size: 13px; line-height: 1.45; }
  .stories { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 0 13px; }
  .story { flex: 0 0 62px; gap: 5px; scroll-snap-align: start; }
  .stories .story-ring { width: 60px; height: 60px; }
  .stories .story-avatar, .stories .story-ring .avatar { width: 54px; height: 54px; }
  .stories .own-ring > .story-avatar > .avatar { width: 100%; height: 100%; }
  .story-label { font-size: 12px; line-height: 1.3; }
  .story-mini-world { display: none; }
  .feed-controls { display: flex; align-items: center; gap: 8px; justify-content: space-between; border-top: 1px solid var(--border); margin-bottom: 10px; }
  .feed-controls .tabs { gap: clamp(12px, 4vw, 20px); border-bottom: 0; margin: 0; }
  .feed-controls .tab { justify-content: center; min-height: 46px; padding: 5px 1px; font-size: 14px; }
  .feed-controls .tab.active::after { bottom: 1px; }
  .world-chips { display: none; }
  .phone-world { display: flex; align-items: center; color: var(--muted); gap: 4px; margin: 0 0 12px; }
  .feed-controls .phone-world { margin: 0; }
  .phone-world svg { width: 16px; height: 16px; }
  .phone-world select { max-width: 100%; min-height: 44px; padding: 3px 1px; border: 0; color: var(--text); background: var(--bg); font-size: 16px; }
  .feed-list { gap: 16px; }
  .post-card { border-radius: 12px; }
  .post-header { padding: 5px 8px 5px 12px; }
  .post-header .character-link { min-height: 44px; min-width: 0; }
  .post-header .character-meta { white-space: normal; overflow-wrap: anywhere; }
  .character-meta .name-row { flex-wrap: wrap; gap: 3px 6px; }
  .post-header .name-row strong { font-size: 13px; }
  .post-header .character-meta small { font-size: 11px; }
  .post-header .icon-button, .post-actions .icon-button { min-width: 44px; min-height: 44px; }
  .post-actions { padding: 2px 5px 0; }
  .post-image { aspect-ratio: 1.34; }
  .post-stats { padding: 0 12px; font-size: 12px; }
  .post-caption { padding: 6px 12px 0; font-size: 14px; line-height: 1.5; }
  .post-tags { font-size: 12px; }
  .post-comments-link { min-height: 44px; font-size: 12px; }
  .post-bottom { padding-bottom: 3px; }
  .profile-info { min-width: 0; overflow-wrap: anywhere; }
  .profile-heading .button, .profile-section-title button { min-height: 44px; }
  .profile-heading > div { display: flex; gap: 6px; flex-wrap: wrap; }
  .profile-grid, .explore-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .explore-tile .tile-overlay { overflow-wrap: anywhere; }
  .phone-footer { display: flex; gap: 18px; justify-content: center; padding: 0 12px 12px; color: var(--muted); }
  .phone-footer button { min-height: 44px; font-size: 12px; }
  .toast { bottom: calc(var(--phone-nav-height) + 10px); width: max-content; max-width: calc(100vw - 28px); font-size: 13px; }
}

@media (max-height: 500px) and (max-width: 950px) {
  .topbar { position: static; }
  .view-heading { margin-bottom: 10px; }
  .feed-list .post-image { max-height: 65dvh; object-fit: cover; }
}

@media (max-width: 360px) {
  .topbar .phone-brand { font-size: 18px; }
  .phone-brand .brand-symbol { font-size: 23px; margin-right: 1px; }
  .phone-create { margin-left: 1px; padding-inline: 8px; }
  .phone-create > [data-icon] { display: none; }
}

@media (min-width: 570px) and (max-width: 950px) and (max-height: 500px) {
  #main:has(> .stories) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); align-items: center; gap: 0 15px; }
  #main > .stories { min-width: 0; }
  #main > .feed-controls, #main > .feed-list, #main:has(> .stories) > .empty-state { grid-column: 1 / -1; }
  #main:has(> .stories) > .view-heading h1 { font-size: 24px; }
}
