/* The current desktop workspace is the reference on every screen size.
   Keep the same navigation, actions, labels, statistics and records visible.
   Only arrange those shared components vertically on a narrow screen. */
@media (max-width:760px) {
  .header {
    position:relative;
    min-height:0;
    height:auto;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:15px;
    padding:16px;
  }
  .header>.brand { order:1; flex:1 1 auto; }
  .header-actions {
    order:2;
    flex:1 0 100%;
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    gap:10px;
    margin:0;
  }
  .header-actions .sync-label { display:flex; font-size:.75rem; }
  .header-actions .account-button { display:flex; min-height:44px; }
  .account-button>span:last-child { display:block; max-width:140px; }
  .desktop-nav {
    order:3;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    flex:1 0 100%;
    align-self:auto;
    gap:9px;
    padding-top:2px;
  }
  .desktop-nav button {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:12px 9px;
    min-height:64px;
    border:1px solid #35525d;
    border-radius:10px;
    background:#15333c;
    font-size:.875rem;
    position:relative;
  }
  .desktop-nav button.active {
    border-color:#d65766;
    background:#3c2530;
    color:#f0f5f6;
  }
  .desktop-nav button>.jp-reading { max-width:none; }
  .desktop-nav button .romaji { font-size:.75rem; }
  .desktop-nav button svg { flex-shrink:0; }
  .desktop-nav .new-badge { position:absolute; top:5px; right:5px; }
  .mobile-nav { display:none; }
  .main { padding-bottom:32px; }
  .page-title { flex-direction:column; align-items:stretch; gap:18px; }
  .page-title p { max-width:none; }
  .page-title>.btn {
    display:flex;
    width:100%;
    min-height:56px;
    justify-content:center;
    padding:12px 16px;
    font-size:1rem;
  }
  .overview-bar { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .overview-bar .stat { min-width:0; padding:15px 13px; }
  .stat label { white-space:normal; font-size:.875rem; }
  .desktop-stat { display:block; }
  .phone-stat { display:none; }
  .completion { display:flex; grid-column:1/-1; padding:16px; }
  .completion p { font-size:.8125rem; line-height:1.6; }
  .completion strong { font-size:.875rem; }
  .team-person { min-width:0; }
  .team-person small { font-size:.75rem; }
  .company-grid { grid-template-columns:minmax(0,1fr); }
  .company-card,.panel,.work-row,.doc-box { min-width:0; }
  .company-title,.work-name b,.doc-box h3 { overflow-wrap:anywhere; }
  .company-footer { flex-wrap:wrap; }
  .work-name>span:last-child { min-width:0; }
  .work-name small { white-space:normal; }
  .drawer-tabs { overflow-x:auto; align-items:stretch; }
  .drawer-tabs button { flex:1 0 auto; min-height:56px; }
  .footer { padding-bottom:calc(24px + env(safe-area-inset-bottom)); }
  #toasts { bottom:20px; }
}
