/**
 * Harbimi — Lucid Editorial mobile shell (yeni mobil / DESIGN.md)
 * max-width: 640px
 */
@media (max-width: 640px) {
  :root {
    --hm-bg: #f7f9fb;
    --hm-surface: #f7f9fb;
    --hm-surface-low: #f2f4f6;
    --hm-surface-high: #e6e8ea;
    --hm-surface-highest: #e0e3e5;
    --hm-surface-lowest: #ffffff;
    --hm-primary: #003fd8;
    --hm-primary-mid: #2563eb;
    --hm-primary-container: #2d5af7;
    --hm-on-surface: #191c1e;
    --hm-on-variant: #434656;
    --hm-outline: #747687;
    --hm-secondary-container: #a2b2fe;
    --hm-on-secondary-container: #324286;
    --hm-shadow: 0 12px 32px -4px rgba(25, 28, 30, 0.08);
    --hm-font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    --hm-font-body: "Inter", system-ui, sans-serif;
  }

  body.hm-shell-active {
    padding-bottom: 5.75rem;
    background: var(--hm-bg) !important;
    font-family: var(--hm-font-body);
  }

  body.hm-shell-active .hm-mobile-stack {
    font-family: var(--hm-font-body);
  }

  .hm-logo-link {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    margin-left: 0.05rem;
    padding: 0.2rem 0.15rem 0.2rem 0;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .hm-site-logo {
    display: block;
    height: auto;
    max-height: 30px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
  }

  .hm-mobile-stack {
    position: sticky;
    top: 0;
    z-index: 100;
    padding-top: env(safe-area-inset-top, 0);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  }

  .hm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem 0.45rem 0.5rem;
    min-height: 0;
    box-sizing: border-box;
  }

  .hm-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
  }

  .hm-topbar-right {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
  }

  .hm-icon-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--hm-on-variant);
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    position: relative;
    color: #64748b;
    flex-shrink: 0;
  }

  .hm-icon-btn.hm-avatar-btn {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .hm-icon-btn:active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--hm-primary-mid);
  }

  .hm-icon-btn.hm-icon-primary {
    color: var(--hm-primary-mid);
  }

  .hm-search-pill-wrap {
    padding: 0 0.65rem 0.45rem;
  }

  .hm-search-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    box-sizing: border-box;
    background: var(--hm-surface-highest);
    border-radius: 9999px;
    padding: 0.2rem 0.25rem 0.2rem 0.95rem;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  }

  .hm-search-pill:focus-within {
    background: var(--hm-surface-lowest);
    box-shadow: var(--hm-shadow);
  }

  .hm-search-pill input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--hm-on-surface);
    outline: none;
    font-family: var(--hm-font-body);
  }

  .hm-search-pill input::placeholder {
    color: var(--hm-outline);
  }

  .hm-search-pill button[type="submit"] {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--hm-primary) 0%, var(--hm-primary-container) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    align-self: center;
  }

  .hm-search-pill button[type="submit"]:active {
    transform: scale(0.94);
  }

  .hm-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 108;
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .hm-nav-backdrop.is-open {
    display: block;
    opacity: 1;
  }

  .hm-nav-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(20rem, 88vw);
    max-width: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 109;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s;
    pointer-events: none;
  }

  .hm-nav-sheet.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .hm-nav-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    font-family: var(--hm-font-head);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--hm-on-surface);
    border-bottom: none;
    background: var(--hm-surface-low);
  }

  .hm-nav-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 0.65rem 1.25rem;
  }

  .hm-nav-sheet-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.85rem;
    border-radius: 1rem;
    color: var(--hm-on-variant);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
  }

  .hm-nav-sheet-link i {
    width: 1.35rem;
    text-align: center;
    color: #64748b;
  }

  .hm-nav-sheet-link:hover,
  .hm-nav-sheet-link.active {
    background: var(--hm-surface-low);
    color: var(--hm-primary-mid);
  }

  .hm-nav-sheet-link.active i {
    color: var(--hm-primary-mid);
  }

  .hm-nav-sheet-auth {
    margin-top: 1rem;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .hm-nav-sheet-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    font-family: var(--hm-font-head);
  }

  .hm-nav-sheet-btn-primary {
    background: linear-gradient(90deg, var(--hm-primary-mid), var(--hm-primary-container));
    color: #fff;
  }

  .hm-nav-sheet-btn-secondary {
    background: var(--hm-surface-high);
    color: var(--hm-on-surface);
  }

  .hm-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 95;
    justify-content: space-around;
    align-items: center;
    padding: 0.35rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.05);
    border-top: none;
  }

  .hm-bottom-nav a,
  .hm-bottom-nav button {
    flex: 1;
    max-width: 5.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.25rem;
    border: none;
    background: none;
    border-radius: 9999px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 1.28rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--hm-font-head);
  }

  .hm-bottom-nav span.hm-bottom-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .hm-bottom-nav a.is-active,
  .hm-bottom-nav button.is-active {
    color: var(--hm-primary-mid);
    background: rgba(37, 99, 235, 0.1);
  }

  .hm-header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(37, 99, 235, 0.3);
    display: block;
  }

  .hm-mobile-stack .mobile-notification-badge {
    border-color: #fff;
  }

  .hm-mobile-stack .mobile-profile-dropdown {
    z-index: 120;
    border-radius: 1rem;
    box-shadow: var(--hm-shadow);
  }

  body.hm-nav-open {
    overflow: hidden;
  }

  body.hm-shell-active main.index-gradient {
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
  }

  .hm-welcome-card {
    background: var(--hm-surface-lowest) !important;
    border: none !important;
    box-shadow: var(--hm-shadow) !important;
    border-radius: 1.25rem !important;
    padding: 1.35rem 1.25rem !important;
  }

  .hm-welcome-card h1 {
    font-family: var(--hm-font-head) !important;
    font-size: 1.35rem !important;
    letter-spacing: -0.02em !important;
    color: var(--hm-on-surface) !important;
  }

  .hm-filter-strip {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 0.5rem !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hm-filter-strip::-webkit-scrollbar {
    display: none;
  }

  .hm-filter-strip .filter-chip {
    flex-shrink: 0;
    border-radius: 9999px !important;
    background: var(--hm-surface-lowest) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(25, 28, 30, 0.04) !important;
    color: var(--hm-on-variant) !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    padding: 0.55rem 1rem !important;
    min-height: 44px !important;
  }

  .hm-filter-strip .filter-chip.active {
    background: linear-gradient(90deg, var(--hm-primary-mid), var(--hm-primary-container)) !important;
    color: #fff !important;
  }

  /* Başlık kartları — tonal, çizgisiz */
  #topicsList > div {
    background: var(--hm-surface-lowest) !important;
    border: none !important;
    border-radius: 1.1rem !important;
    box-shadow: 0 2px 12px rgba(25, 28, 30, 0.04) !important;
    padding: 1.1rem 1rem !important;
  }

  #topicsList > div .border-t {
    border-top: none !important;
    padding-top: 0.85rem !important;
    margin-top: 0.65rem !important;
  }

  #topicsList .text-xl {
    font-family: var(--hm-font-head) !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: var(--hm-on-surface) !important;
  }

  .desktop-header {
    display: none !important;
  }

  .mobile-header-bar,
  .mobile-menu-bar {
    display: none !important;
  }

  /* Modallar üst çubuk ve alt nav üstünde kalsın */
  #loginModal,
  #registerModal,
  #notificationModal {
    z-index: 220 !important;
  }
}

@media (min-width: 641px) {
  .hm-mobile-stack,
  .hm-bottom-nav,
  .hm-nav-backdrop,
  .hm-nav-sheet {
    display: none !important;
  }
}
