/* Shared phone shell, UI0.12.0. Content charts and tables have their own responsive rules. */
:root {
  --mobile-nav-height: 64px;
  --mobile-bottom-inset: env(safe-area-inset-bottom, 0px);
  --mobile-bottom-space: calc(var(--mobile-nav-height) + var(--mobile-bottom-inset) + 20px);
}
.mobile-task-nav,.mobile-menu-trigger,.mobile-brand,.mobile-auxbar { display: none; }
.mobile-menu-dialog:not([open]) { display: none; }
.mobile-menu-dialog {
  box-sizing: border-box;
  width: min(480px, calc(100% - 24px));
  max-height: 88vh;
  max-height: 88dvh;
  margin: auto auto max(12px, var(--mobile-bottom-inset));
  border: 1px solid var(--color-divider, #dce5df);
  border-radius: 20px;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface-panel, #fff);
  color: var(--text-body, #183b33);
  box-shadow: 0 12px 50px #102b3440;
  font: 400 16px/1.6 var(--font-ui, system-ui, sans-serif);
}
.mobile-menu-dialog::backdrop { background: #102a2266; }
.mobile-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.mobile-menu-heading h2 { margin: 0; font-size: 21px; font-weight: 700; }
.mobile-menu-close { width: 44px; min-height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 9px; border: 1px solid #b2c4b8; border-radius: 12px; background: #fff; color: var(--text-body, #183b33); cursor: pointer; }
.mobile-menu-dialog svg,.mobile-task-nav svg,.mobile-menu-trigger svg { display: block; width: 23px; height: 23px; flex: none; }
.mobile-menu-links { display: grid; gap: 4px; }
.mobile-menu-links a { display: flex; flex-direction: column; min-height: 52px; justify-content: center; gap: 2px; padding: 10px 12px; border-radius: 11px; color: var(--text-body, #183b33); text-decoration: none; line-height: 1.5; }
.mobile-menu-links strong { font-size: 16px; font-weight: 700; }
.mobile-menu-links span { font-size: 13px; color: var(--text-secondary, #4f655e); }
.mobile-menu-links a[aria-current=page] { background: #e7f2eb; box-shadow: inset 3px 0 var(--color-action, #0f6b50); }
.mobile-menu-note { margin: 18px 10px 0; font-size: 13px; color: var(--text-secondary, #4f655e); }
@media (max-width: 760px), (max-height: 520px) and (pointer: coarse) {
  html { scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px)); scroll-padding-bottom: var(--mobile-bottom-space); }
  body.mobile-shell-ready { padding-bottom: var(--mobile-bottom-space); }
  body.mobile-shell-ready .sidebar { display: none; }
  body.mobile-shell-ready .app-shell,body.mobile-shell-ready .shell { margin-left: 0; min-width: 0; }
  body.mobile-shell-ready .app-topbar,body.mobile-shell-ready .topbar,.mobile-auxbar {
    display: flex; position: sticky; top: 0; z-index: 50; align-items: center; gap: 12px;
    min-height: calc(60px + env(safe-area-inset-top, 0px)); height: auto;
    padding: env(safe-area-inset-top, 0px) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--color-divider, #dce5df); background: var(--surface-page, #f5f6f3);
  }
  .mobile-brand { display: inline-flex; align-items: center; min-height: 44px; margin-right: auto; color: var(--text-body, #183b33); text-decoration: none; font: 700 17px/1.4 var(--font-ui, system-ui, sans-serif); letter-spacing: -.35px; white-space: nowrap; }
  body.mobile-shell-ready .breadcrumb,body.mobile-shell-ready .topbar>div,body.mobile-shell-ready .currency-pill,body.mobile-shell-ready .topbar>a:not(.mobile-brand) { display: none; }
  body.mobile-shell-ready .top-actions { margin-left: 0; gap: 8px; }
  body.mobile-shell-ready .find-button { min-height: 44px; width: 44px; padding: 10px; justify-content: center; font-size: 0; gap: 0; }
  body.mobile-shell-ready .find-button svg { width: 21px; height: 21px; }
  body.mobile-shell-ready .find-button kbd { display: none; }
  .mobile-menu-trigger { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; width: 44px; flex: none; padding: 9px; border: 1px solid #9bb3a4; border-radius: 11px; color: var(--text-body, #183b33); background: var(--surface-panel, #fff); cursor: pointer; }
  .mobile-task-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; inset: auto 0 0; z-index: 70; box-sizing: border-box;
    padding: 0 max(6px, env(safe-area-inset-right, 0px)) var(--mobile-bottom-inset) max(6px, env(safe-area-inset-left, 0px));
    min-height: calc(var(--mobile-nav-height) + var(--mobile-bottom-inset));
    border-top: 1px solid #c7d7cb; background: #fff; box-shadow: 0 -3px 18px #153c210a;
  }
  .mobile-task-nav a,.mobile-task-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: var(--mobile-nav-height); min-width: 0; margin: 0; padding: 7px 1px; border: 0; border-radius: 0; background: none; color: #4f655e; text-decoration: none; font: 400 12px/1.3 var(--font-ui, system-ui, sans-serif); cursor: pointer; touch-action: manipulation; }
  .mobile-task-nav span { white-space: nowrap; }
  .mobile-task-nav [aria-current=page] { color: #0c654b; font-weight: 700; background: #edf5ef; box-shadow: inset 0 3px #0f6b50; }
  .mobile-task-nav [aria-current=page] svg { stroke-width: 2.2; }
  body.mobile-shell-ready :where(button,summary) { min-height: 44px; touch-action: manipulation; }
  body.mobile-shell-ready :is(input,select,textarea):not([type=range]):not([type=checkbox]):not([type=radio]) { min-height: 48px; font-size: 16px; }
  body.mobile-shell-ready input[type=range] { min-height: 44px; touch-action: pan-y; }
  body.mobile-shell-ready :is(input[type=checkbox],input[type=radio]) { width: 22px; height: 22px; flex: none; }
  body.mobile-shell-ready :is(.app-main,main) { min-width: 0; }
  body.mobile-aux-page main { width: auto; max-width: 100%; margin: 0; padding: 24px 16px; overflow-wrap: anywhere; }
  body.mobile-aux-page pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  body.mobile-shell-ready.mobile-menu-open { overflow: hidden; }
  body.mobile-shell-ready.mobile-keyboard-open .mobile-task-nav { display: none; }
  body.mobile-shell-ready.mobile-keyboard-open { padding-bottom: 20px; }
  :is(.mobile-menu-trigger,.mobile-menu-close,.mobile-brand,.mobile-task-nav a,.mobile-task-nav button,.mobile-menu-links a):focus-visible { outline: 3px solid var(--color-focus, #205fa0); outline-offset: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-task-nav,.mobile-menu-dialog { scroll-behavior: auto; transition: none; }
}
@media print {
  .mobile-task-nav,.mobile-menu-dialog,.mobile-menu-trigger,.mobile-brand,.mobile-auxbar { display: none !important; }
  body.mobile-shell-ready { padding-bottom: 0; }
}

@media (max-width: 760px), (max-height: 520px) and (pointer: coarse) {
 body.mobile-aux-page main > nav { display:flex; flex-wrap:wrap; gap:8px; }
 body.mobile-aux-page main > nav a { display:inline-flex; align-items:center; min-height:44px; padding:8px 10px; border-radius:8px; line-height:1.4; }
}
