.mobile-bottom-nav,
.mobile-more-dialog { display: none; }
.mobile-more-dialog:not([open]) { display:none!important; }

@media (max-width: 980px) {
  body.org-v4 { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.org-v4 .org-main { padding-bottom: 112px; }
  body.org-v4 .ai-chat-window { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid #d9e5f0;
    background: rgb(255 255 255 / 97%);
    box-shadow: 0 -8px 24px rgb(13 52 86 / 10%);
    backdrop-filter: blur(16px);
    direction: rtl;
  }
  .mobile-bottom-nav .org-nav-link,
  .mobile-bottom-more {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 54px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 3px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: #516982;
    text-decoration: none;
    font: inherit;
  }
  .mobile-bottom-nav .org-nav-icon { display: grid; width: 25px; height: 25px; place-items: center; background: transparent; color: currentColor; font-size: 20px; }
  .mobile-bottom-nav .org-nav-link > span:not(.org-nav-icon),
  .mobile-more-links .org-nav-link > span:not(.org-nav-icon) { display:block!important; min-width:0; }
  .mobile-bottom-nav .org-nav-link strong,
  .mobile-bottom-more strong { display: block; overflow: hidden; max-width: 100%; color: currentColor; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-bottom-nav .org-nav-link small,
  .mobile-bottom-nav .org-nav-link > b { display: none; }
  .mobile-bottom-nav .org-nav-link.active,
  .mobile-bottom-nav .org-nav-link[aria-current="page"] { background: #eaf3fd; border-color: #d6e7f7; color: #0d64ae; }
  .mobile-bottom-nav .org-nav-link.active::after { display: none; }
  .mobile-bottom-more { cursor: pointer; }
  .mobile-more-icon { display: grid; width: 25px; height: 25px; place-items: center; color: #516982; font-size: 20px; letter-spacing: 1px; }
  .mobile-more-dialog {
    position: fixed;
    inset: auto 0 0;
    display: block;
    width: 100%;
    max-width: none;
    max-height: min(78dvh, 700px);
    margin: 0;
    padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 1px solid #d6e3ef;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: #fff;
    color: #173c5e;
    box-shadow: 0 -15px 50px rgb(9 42 72 / 20%);
  }
  .mobile-more-dialog[open] { animation: mobileSheetIn .2s ease-out; }
  .mobile-more-dialog::backdrop { background: rgb(8 27 48 / 46%); backdrop-filter: blur(3px); }
  .mobile-more-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 14px; border-bottom: 1px solid #e3ebf3; }
  .mobile-more-dialog h2 { margin: 0; color: #153d61; font-family: inherit; font-size: 18px; font-weight: 700; line-height: 1.5; }
  .mobile-more-close { width: 40px; height: 40px; border: 0; border-radius: 12px; background: #edf4fb; color: #17486f; font-size: 24px; cursor: pointer; }
  .mobile-more-links { display: grid; gap: 6px; padding-top: 12px; }
  .mobile-more-links .org-nav-link { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 54px; padding: 8px 10px; border: 1px solid #e0e9f1; border-radius: 13px; background: #fbfdff; color: #294c6b; text-decoration: none; }
  .mobile-more-links .org-nav-link strong { display: block; color: #163d60; font-size: 13px; }
  .mobile-more-links .org-nav-link small { display: block; margin-top: 2px; color: #657f98; font-size: 11px; }
  .mobile-more-links .org-nav-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #edf4fb; color: #155c96; }
  .mobile-more-links .org-nav-link > b { min-width: 26px; padding: 3px 7px; border-radius: 999px; background: #e7f1fb; color: #145a92; font-size: 11px; text-align: center; }
  html[data-theme="dark"] .mobile-bottom-nav { border-color: #3b5168; background: rgb(19 34 51 / 97%); }
  html[data-theme="dark"] .mobile-bottom-nav :is(.org-nav-link, .mobile-bottom-more) { color: #c6d6e6; }
  html[data-theme="dark"] .mobile-bottom-nav :is(.org-nav-link.active, .org-nav-link[aria-current="page"]) { background: #243d58; border-color: #43617e; color: #95ceff; }
  html[data-theme="dark"] .mobile-more-dialog { border-color: #3d536a; background: #162739; color: #e5edf5; }
  html[data-theme="dark"] .mobile-more-dialog > header { border-color: #3d536a; }
  html[data-theme="dark"] .mobile-more-dialog h2,
  html[data-theme="dark"] .mobile-more-links .org-nav-link strong { color: #eef4fa; }
  html[data-theme="dark"] .mobile-more-links .org-nav-link { border-color: #3d536a; background: #1e3247; color: #d9e5f0; }
  html[data-theme="dark"] .mobile-more-links .org-nav-link small { color: #bacbdc; }
  html[data-theme="dark"] .mobile-more-close { background: #2b425a; color: #e5edf5; }
}

@keyframes mobileSheetIn { from { opacity: .7; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mobile-more-dialog[open] { animation: none; } }
