@media (min-width: 701px) {
  .social-mobile-dock {
    display: none !important;
  }
}

@media (max-width: 700px) {
  body[data-social-page] {
    --dydoss-social-mobile-nav-height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    --social-mobile-nav-height: var(--dydoss-social-mobile-nav-height);
    --dydoss-social-mobile-top-gap: max(3px, var(--dydoss-safe-top, env(safe-area-inset-top, 0px)));
    --dydoss-social-mobile-bottom-gap: calc(var(--social-mobile-nav-height) + 4px);
    --dydoss-social-mobile-content-height: calc(var(--dydoss-viewport-height, 100dvh) - var(--dydoss-social-mobile-top-gap) - var(--dydoss-social-mobile-bottom-gap));
    padding-top: var(--dydoss-social-mobile-top-gap) !important;
    padding-bottom: var(--dydoss-social-mobile-bottom-gap) !important;
  }

  body[data-social-page] .xp-header.xp-header-compact {
    display: none !important;
  }

  body[data-social-page="chat"] .chat-layout {
    width: calc(100vw - (var(--dydoss-social-shell-gutter, 8px) * 2));
    margin-top: 0 !important;
    height: var(--dydoss-social-mobile-content-height) !important;
    padding-bottom: 0 !important;
  }

  body.dydoss-keyboard-open[data-social-page="chat"] {
    --dydoss-social-mobile-bottom-gap: max(6px, calc(6px + var(--dydoss-safe-bottom, env(safe-area-inset-bottom, 0px))));
    --dydoss-social-mobile-content-height: calc(var(--dydoss-viewport-height, 100dvh) - var(--dydoss-social-mobile-top-gap) - var(--dydoss-social-mobile-bottom-gap));
    padding-bottom: var(--dydoss-social-mobile-bottom-gap) !important;
  }

  body.dydoss-keyboard-open[data-social-page="chat"] .social-mobile-dock-tray,
  body.dydoss-keyboard-open[data-social-page="chat"] .social-mobile-dock-bar {
    transform: translateY(calc(100% + 14px));
    opacity: 0;
    pointer-events: none;
  }

  body.dydoss-keyboard-open[data-social-page="chat"] .social-mobile-dock-backdrop {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .social-mobile-dock {
    position: fixed;
    inset: 0 0 auto;
    top: auto;
    z-index: 3400;
    pointer-events: none;
  }

  .social-mobile-dock-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 39, 72, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease-out;
  }

  .social-mobile-dock.is-tray-open .social-mobile-dock-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .social-mobile-dock-tray {
    position: fixed;
    left: max(5px, calc(5px + var(--dydoss-safe-left, 0px)));
    right: max(5px, calc(5px + var(--dydoss-safe-right, 0px)));
    bottom: calc(var(--dydoss-social-mobile-nav-height) + 6px);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 5px;
    border: 2px solid #4f6fb6;
    border-radius: 12px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(225, 236, 251, 0.98)),
      linear-gradient(180deg, #d8e9ff, #bdd8f7);
    box-shadow:
      0 12px 34px rgba(18, 40, 77, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(10px) scale(0.96);
    transform-origin: center bottom;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.16s ease-out, opacity 0.16s ease-out;
  }

  .social-mobile-dock.is-tray-open .social-mobile-dock-tray {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .social-mobile-dock-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: var(--dydoss-social-mobile-nav-height);
    box-sizing: border-box;
    padding-top: 3px;
    padding-right: max(5px, calc(5px + var(--dydoss-safe-right, 0px)));
    padding-bottom: calc(3px + env(safe-area-inset-bottom, 0px));
    padding-left: max(5px, calc(5px + var(--dydoss-safe-left, 0px)));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    align-items: center;
    align-content: center;
    background:
      linear-gradient(180deg, #fdfefe 0%, #d5e7fb 46%, #c2d8f2 100%);
    border-top: 3px solid #476fb0;
    box-shadow: 0 -4px 18px rgba(23, 50, 93, 0.24);
    pointer-events: auto;
  }

  .social-mobile-dock-action {
    position: relative;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-family: Tahoma, sans-serif;
    min-width: 0;
    min-height: 40px;
    display: inline-flex;
    flex-direction: column;
    align-self: center;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 3px 2px 2px;
    border: 2px solid #4c6ca8;
    border-radius: 9px;
    background: linear-gradient(180deg, #fcfdfd 0%, #dce9f9 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      0 1px 0 rgba(122, 160, 206, 0.75);
    color: #1e497f;
    text-decoration: none;
    font-size: 8.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08px;
    text-align: center;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition:
      transform 0.08s ease-out,
      box-shadow 0.1s ease-out,
      border-color 0.12s ease-out,
      background 0.12s ease-out,
      color 0.12s ease-out;
  }

  .social-mobile-dock-action:hover,
  .social-mobile-dock-action:focus-visible {
    border-color: #5b7096;
    background: linear-gradient(180deg, #ffffff 0%, #edf1f7 100%);
    color: #21425f;
  }

  .social-mobile-dock-action:active,
  .social-mobile-dock-action.is-active,
  .social-mobile-dock.is-tray-open .social-mobile-dock-center {
    transform: translateY(1px);
    box-shadow:
      inset 1px 1px 0 rgba(124, 139, 160, 0.74),
      inset -1px -1px 0 rgba(255, 255, 255, 0.72);
    background: linear-gradient(180deg, #e2e7ee 0%, #f3f6fa 100%);
    border-color: #607490;
  }

  .social-mobile-dock-action.has-badge::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #d62f2f;
    box-shadow: 0 0 0 2px #f8fbff;
  }

  .social-mobile-dock-icon {
    width: 15px;
    height: 15px;
    object-fit: contain;
    flex: 0 0 auto;
    pointer-events: none;
  }

  .social-mobile-dock-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
  }

  .social-mobile-dock-center {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border-radius: 999px;
    padding: 0;
    gap: 0;
    background:
      radial-gradient(circle at 34% 28%, #ffffff, #e6eef8 42%, #b8c7da 100%);
    box-shadow:
      0 3px 10px rgba(22, 49, 92, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }

  .social-mobile-dock-center .social-mobile-dock-icon {
    width: 16px;
    height: 16px;
  }

  .social-mobile-dock-center .social-mobile-dock-label {
    display: none;
  }

  .social-mobile-dock-tray .social-mobile-dock-action {
    min-height: 42px;
    padding: 5px 3px 4px;
    border-radius: 9px;
  }

  .social-mobile-sheet-popup {
    position: fixed !important;
    left: 6px !important;
    right: 6px !important;
    top: max(8px, calc(env(safe-area-inset-top, 0px) + 6px)) !important;
    bottom: calc(var(--dydoss-social-mobile-nav-height) + 8px) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    border: 2px solid #4870ae;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fdfefe 0%, #e5effd 100%);
    box-shadow: 0 14px 36px rgba(18, 40, 77, 0.28);
    z-index: 3380 !important;
  }

  .social-mobile-sheet-popup .xp-popup-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 8px 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #2f71bf 0%, #1f4f92 100%);
  }

  .social-mobile-sheet-popup .xp-popup-content {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: auto;
    padding: 0;
    background: #eef5ff;
  }

  .social-mobile-sheet-popup .xp-popup-close {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    box-sizing: border-box;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    background: linear-gradient(180deg, #fff, #dde8f7);
    color: #184f92;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
  }

  .social-mobile-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100%;
    padding: 12px;
    box-sizing: border-box;
  }

  .social-mobile-panel-empty {
    padding: 16px 12px;
    border: 1px dashed #afc6e6;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: #4d678c;
    text-align: center;
  }

  .social-mobile-section {
    border: 1px solid #bcd0ea;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(235, 244, 255, 0.95));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .social-mobile-section-title {
    margin: 0;
    padding: 11px 12px 0;
    color: #214f8f;
    font-size: 0.92rem;
  }

  .social-mobile-list {
    display: flex;
    flex-direction: column;
  }

  .social-mobile-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e1ebf9;
  }

  .social-mobile-row:last-child {
    border-bottom: none;
  }

  .social-mobile-row-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #aac4e7;
    background: #fff;
    flex: 0 0 auto;
  }

  .social-mobile-row-main {
    min-width: 0;
    flex: 1 1 auto;
  }

  .social-mobile-row-title,
  .social-mobile-row-title a {
    color: #214b84;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
  }

  .social-mobile-row-meta {
    margin-top: 2px;
    color: #5e7797;
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .social-mobile-row-action {
    flex: 0 0 auto;
  }

  .social-mobile-chipbar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px;
    border: 1px solid #b9cee8;
    border-radius: 999px;
    background: #f5f9ff;
  }

  .social-mobile-chipbar .xp-btn.mini {
    min-height: 34px;
    padding: 5px 12px;
    border-radius: 999px;
  }

  .social-mobile-chipbar .xp-btn.mini.is-active {
    background: linear-gradient(180deg, #d9e6f8, #eef4ff);
    box-shadow: inset 1px 1px 0 rgba(137, 156, 187, 0.72);
  }

  .social-posts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px;
  }

  .social-posts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
  }

  .social-feed-card {
    border: 1px solid #bbd0ea;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #eef5ff);
    padding: 10px;
    cursor: pointer;
  }

  .social-feed-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .social-feed-card-author {
    color: #214b84;
    font-weight: 700;
    text-decoration: none;
  }

  .social-feed-card-time {
    color: #68809f;
    font-size: 0.75rem;
  }

  .social-feed-card-body {
    min-height: 0;
  }

  .social-feed-card-body.friend-post-body {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.92em;
    color: #21364f;
    line-height: 1.35;
    word-break: break-word;
    min-width: 0;
  }

  .social-feed-card-body.friend-post-body > * {
    min-width: 0;
    max-width: 100%;
  }

  .social-feed-card-body.friend-post-body .dydoss-media-player.is-mode-feed-inline {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    border-radius: 16px;
  }

  .social-feed-card-body.friend-post-body .dydoss-media-player.is-mode-feed-inline .dydoss-media-player-stage {
    aspect-ratio: 16 / 10;
    min-height: clamp(152px, 20vw, 220px);
    max-height: clamp(210px, 26vw, 250px);
  }

  .social-feed-card-body.friend-post-body .dydoss-media-player.is-mode-feed-inline .dydoss-media-player-controls {
    padding: 8px 10px 10px;
  }

  .social-feed-card-body.friend-post-body .dydoss-media-player.is-mode-feed-inline .dydoss-media-player-actions {
    gap: 8px;
  }

  .social-feed-card-body.friend-post-body img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    border: 1px solid #bfd3ec;
  }

  .friend-post-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .friend-post-author {
    color: #1a4f9c;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .friend-post-author:hover {
    text-decoration: underline;
  }

  .friend-post-time {
    font-size: 0.8em;
    color: #667b98;
  }

  .friend-post-share-btn {
    margin-left: auto;
    flex-shrink: 0;
  }

  .friend-post-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
  }

  .friend-post-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .friend-post-like-count {
    display: inline-flex;
    min-width: 18px;
    justify-content: center;
    font-weight: 700;
  }

  .friend-post-like-btn.liked {
    border-color: #ca6b6b;
    color: #8e1f2f;
    background: linear-gradient(180deg, #fff2f2 0%, #ffdede 100%);
  }

  .social-posts-more {
    align-self: center;
    min-width: 140px;
  }

  .social-online-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .social-mobile-sheet-popup .online-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 6px;
    border-bottom: 1px solid #d8e7fb;
  }

  .social-mobile-sheet-popup .online-user-row:last-child {
    border-bottom: none;
  }

  .social-mobile-sheet-popup .online-user-main-link {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1d3f71;
    text-decoration: none;
  }

  .social-mobile-sheet-popup .online-user-main-link:hover .online-user-name {
    text-decoration: underline;
  }

  .social-mobile-sheet-popup .online-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #9cb9dd;
    background: #fff;
  }

  .social-mobile-sheet-popup .online-user-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .social-mobile-sheet-popup .online-user-name {
    font-size: 0.95em;
    font-weight: 700;
    color: #1a4f9c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .social-mobile-sheet-popup .online-user-state {
    font-size: 0.82em;
    color: #27864b;
  }

  .social-mobile-sheet-popup .online-state-text {
    color: inherit;
  }

  .social-mobile-sheet-popup .online-app-link {
    color: #1f5fb6;
    text-decoration: none;
    font-weight: 700;
  }

  .social-mobile-sheet-popup .online-app-link:hover {
    text-decoration: underline;
  }

  .social-mobile-sheet-popup .online-user-self {
    color: #5e7595;
    font-size: 0.8em;
    font-weight: 700;
  }

  .social-online-list {
    display: flex;
    flex-direction: column;
  }

  .social-online-state {
    margin-top: 2px;
    color: #5f7898;
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .social-online-state a {
    color: #215c9d;
    font-weight: 700;
    text-decoration: none;
  }

  .social-global-chat {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .social-global-chat-messages {
    min-height: 220px;
    max-height: min(34vh, 320px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
  }

  .social-global-chat-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }

  .social-global-chat-message.is-own {
    flex-direction: row-reverse;
  }

  .social-global-chat-bubble {
    max-width: calc(100% - 44px);
    border: 1px solid #c6d7ef;
    border-radius: 11px;
    padding: 7px 9px;
    background: linear-gradient(180deg, #ffffff, #eef5ff);
    color: #1d3555;
  }

  .social-global-chat-message.is-own .social-global-chat-bubble {
    background: linear-gradient(180deg, #f5fff3, #e9f7e6);
    border-color: #c9e3c4;
  }

  .social-global-chat-sender {
    font-size: 0.76rem;
    font-weight: 700;
    color: #21508f;
  }

  .social-global-chat-time {
    font-size: 0.7rem;
    color: #6b829f;
    margin-left: 6px;
  }

  .social-global-chat-text {
    margin-top: 3px;
    font-size: 0.83rem;
    line-height: 1.35;
    word-break: break-word;
    white-space: pre-wrap;
  }

  .social-global-chat-text.has-inline-media {
    display: flex;
    flex-direction: column;
    gap: 8px;
    white-space: normal;
  }

  .social-global-chat-inline-media-trigger {
    width: min(100%, 240px);
    padding: 0;
    border: 1px solid #bfd3ec;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff, #eef5ff);
    cursor: pointer;
  }

  .social-global-chat-inline-image {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    background: #f1f6ff;
  }

  .social-global-chat-open-media {
    align-self: flex-start;
  }

  .social-global-chat-inline-meta {
    color: #637c99;
    font-size: 0.72rem;
    line-height: 1.3;
    word-break: break-word;
  }

  .social-global-chat-reply {
    margin-bottom: 5px;
    padding: 4px 6px;
    border-left: 3px solid #4d7dc6;
    border-radius: 7px;
    background: rgba(232, 240, 252, 0.72);
    color: #456380;
    font-size: 0.73rem;
    line-height: 1.25;
  }

  .social-global-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .social-global-chat-form input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1.5px solid #b7cfef;
    border-radius: 10px;
    font-size: 0.88rem;
  }

  .social-mobile-badge-text {
    margin-left: 4px;
    color: #7c2f2f;
    font-size: 0.72rem;
    font-weight: 700;
  }

  .social-alerts-list,
  .social-news-list {
    display: flex;
    flex-direction: column;
  }

  .social-disk-note {
    color: #637c99;
    font-size: 0.76rem;
    line-height: 1.3;
  }

  .apps-popup.social-mobile-sheet-popup .xp-popup-content {
    padding: 10px;
  }

  .social-mobile-share-post-popup .sidebar-friend-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 10px 10px;
    border-radius: 10px;
    border: 1.5px solid #d0e1f7;
    background: #ffffff;
    box-shadow: 0 4px 12px #7ca8dd21;
  }

  .social-mobile-share-post-popup .sidebar-friend-main {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .social-mobile-share-post-popup .sidebar-friend-avatar img {
    width: 39px;
    height: 39px;
    border-radius: 8px;
    border: 2px solid #7baeff;
    object-fit: cover;
  }

  .social-mobile-share-post-popup .sidebar-friend-nickname {
    font-size: 1.02em;
    font-weight: 600;
    color: #204080;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
  }

  .social-mobile-share-post-popup .sidebar-friend-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  @media (max-width: 359px) {
    .social-mobile-dock-tray {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .social-mobile-dock-tray .social-mobile-dock-action:nth-child(4),
    .social-mobile-dock-tray .social-mobile-dock-action:nth-child(5) {
      grid-column: span 1;
    }
  }
}
