.mobile-tools, .mobile-navigation-title, .mobile-navigation-back, .mobile-workspace-back { display: none; }
.mobile-tools { position: relative; }
.mobile-tools__badge { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); pointer-events: none; }
.mobile-tools__dialog {
  position: fixed;
  inset: auto 0 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: 85dvh;
  margin: 0;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  color: var(--ink-dark);
  background: var(--dialog-surface);
  border: 1px solid var(--dialog-border);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--dialog-shadow);
  font-family: var(--font-sans);
}
.mobile-tools__dialog::backdrop { background: var(--dialog-backdrop); }
.mobile-tools__dialog[open] { animation: mobile-tools-arrive 180ms ease-out; }
.mobile-tools__heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mobile-tools__heading h2 { margin: 0; font-size: 20px; color: inherit; }
.mobile-tools__heading .btn-icon { min-width: 44px; min-height: 44px; }
.mobile-tools__list { display: grid; margin-top: 12px; }
.mobile-tools__list :is(a, button), .mobile-tools__context a {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; width: 100%; box-sizing: border-box; padding: 12px;
  color: var(--ink-dark); background: transparent;
  border: 0; border-bottom: 1px solid var(--sepia-line); border-radius: 0;
  font: 400 16px/1.4 var(--font-sans); text-decoration: none; text-align: left;
}
.mobile-tools__list svg { width: 20px; height: 20px; flex: 0 0 20px; }
.mobile-tools__list :is(a, button):hover { background: var(--paper-warm); }
.mobile-tools__list :is(a, button):focus-visible { outline: 2px solid var(--button-focus); outline-offset: -2px; }
.mobile-tools__unread { margin-left: auto; color: var(--ink-soft); font-size: 13px; }
.mobile-tools__context a::after { content: attr(title); }
.mobile-tools__context:empty { display: none; }
.mobile-tools-open { overflow: hidden; }
.mobile-tools-open #global-feelings-now { visibility: hidden; pointer-events: none; }
html[data-design-mode="childhood"] .mobile-tools__dialog {
  background-image: var(--childhood-writing-texture);
  background-size: var(--childhood-writing-sizes);
  border-radius: 3px 7px 0 0;
}
@keyframes mobile-tools-arrive { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mobile-tools__dialog[open] { animation: none; } }
@media (max-width: 768px) {
  html .dashboard-body.dashboard-body .dashboard-header {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
    height: 56px; min-height: 56px; box-sizing: border-box;
    padding: 6px 10px;
  }
  html .dashboard-body .dashboard-header .dashboard-header__left {
    display: flex; flex: 1 1 0; align-items: center; gap: 8px;
    min-width: 0; max-width: none; padding: 0;
  }
  html .dashboard-body .dashboard-header .dashboard-header__right {
    display: flex; flex: 0 0 auto; flex-wrap: nowrap; gap: 4px; margin: 0;
  }
  html .dashboard-header__left > :not(.mobile-navigation-title):not(.mobile-navigation-back):not(.mobile-sidebar-toggle):not(.mobile-workspace-back),
  html .dashboard-header__right > :not(.global-journal-search):not(.mobile-tools):not(.quick-note):not(.shortcuts-guide):not(.dashboard-header__search),
  html .dashboard-header .quick-note__trigger,
  html .dashboard-header .shortcuts-guide__trigger { display: none; }
  html .dashboard-body .dashboard-header--mobile-back .mobile-sidebar-toggle { display: none; }
  html .dashboard-header .mobile-navigation-title {
    display: block; order: 1; min-width: 0; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis;
    font: 500 17px/1.3 var(--font-sans); color: var(--ink-dark);
  }
  html .dashboard-header .mobile-navigation-back,
  html .dashboard-header .mobile-workspace-back,
  html .dashboard-header .mobile-sidebar-toggle,
  html .dashboard-header .dashboard-header__search,
  html .dashboard-header #mobile-tools-trigger {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 10px;
  }
  .dashboard-header .mobile-tools { display: block; }
  html .dashboard-header .mobile-workspace-back { display: none; }
  html body:has(.journal-layout.memory-open) .dashboard-header .mobile-workspace-back { display: inline-flex; }
  html body:has(.journal-layout.memory-open) .dashboard-header :is(.mobile-sidebar-toggle, .mobile-navigation-back),
  html .journal-layout .mobile-back-button { display: none; }
  .dashboard-header :is(.quick-note, .shortcuts-guide, .global-journal-search) { display: contents; }
}
@media (forced-colors: active) { html[data-design-mode="childhood"] .mobile-tools__dialog { background-image: none; } }
